This file is indexed.

/usr/include/oce/Graphic3d_ShaderProgram.hxx is in liboce-visualization-dev 0.15-5.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
// Created on: 2013-09-20
// Created by: Denis BOGOLEPOV
// Copyright (c) 2013 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and / or modify it
// under the terms of the GNU Lesser General Public version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.

#ifndef _Graphic3d_ShaderProgram_HeaderFile
#define _Graphic3d_ShaderProgram_HeaderFile

#include <Graphic3d_ShaderObject_Handle.hxx>
#include <Graphic3d_ShaderProgram_Handle.hxx>
#include <Graphic3d_ShaderVariable.hxx>
#include <NCollection_Sequence.hxx>

//! List of shader objects.
typedef NCollection_Sequence<Handle(Graphic3d_ShaderObject)> Graphic3d_ShaderObjectList;

//! List of custom uniform shader variables.
typedef NCollection_Sequence<Handle(Graphic3d_ShaderVariable)> Graphic3d_ShaderVariableList;

//! This class is responsible for managing shader programs.
class Graphic3d_ShaderProgram : public Standard_Transient
{

public:

  //! The list of built-in GLSL programs
  enum ShaderName
  {
    ShaderName_UNKNOWN, //!< undefined program
    ShaderName_Phong    //!< per-pixel lighting (Phong shading)
  };

public:

  //! Creates new empty program object.
  Standard_EXPORT Graphic3d_ShaderProgram();

  //! Creates program object from pre-defined shaders.
  //! Raises Standard_Failure exception if shader resources are unavailable.
  Standard_EXPORT Graphic3d_ShaderProgram (const Graphic3d_ShaderProgram::ShaderName theName);

  //! Releases resources of program object.
  Standard_EXPORT virtual ~Graphic3d_ShaderProgram();

  //! Releases resources of program object.
  Standard_EXPORT void Destroy() const;

  //! Checks if the program object is valid or not.
  Standard_EXPORT virtual Standard_Boolean IsDone() const;

  //! Returns unique ID used to manage resource in graphic driver.
  const TCollection_AsciiString& GetId() const { return myID; }

  //! Attaches shader object to the program object.
  Standard_EXPORT Standard_Boolean AttachShader (const Handle(Graphic3d_ShaderObject)& theShader);

  //! Detaches shader object from the program object.
  Standard_EXPORT Standard_Boolean DetachShader (const Handle(Graphic3d_ShaderObject)& theShader);

  //! Returns list of attached shader objects.
  const Graphic3d_ShaderObjectList& ShaderObjects() const { return myShaderObjects; }

  //! Returns list of custom uniform variables.
  const Graphic3d_ShaderVariableList& Variables() const { return myVariables; }

  //! Pushes custom uniform variable to the program.
  template<class T>
  Standard_Boolean PushVariable (const TCollection_AsciiString& theName,
                                 const T&                       theValue);

  //! Removes all custom uniform variables from the program.
  Standard_EXPORT void ClearVariables();

public:

  //! The path to GLSL programs determined from CSF_ShadersDirectory or CASROOT environment variables.
  //! @return the root folder with default GLSL programs.
  Standard_EXPORT static const TCollection_AsciiString& ShadersFolder();

public:

  DEFINE_STANDARD_RTTI (Graphic3d_ShaderProgram)

private:

  TCollection_AsciiString      myID;            //!< The unique identifier of program object.
  Graphic3d_ShaderObjectList   myShaderObjects; //!< the list of attached shader objects.
  Graphic3d_ShaderVariableList myVariables;     //!< the list of custom uniform variables.

};

// =======================================================================
// function : PushVariable
// purpose  : Pushes custom uniform variable to the program
// =======================================================================
template<class T> inline
Standard_Boolean Graphic3d_ShaderProgram::PushVariable (const TCollection_AsciiString& theName,
                                                        const T& theValue)
{
  Handle(Graphic3d_ShaderVariable) aVariable = Graphic3d_ShaderVariable::Create (theName, theValue);
  if (aVariable.IsNull() || !aVariable->IsDone())
  {
    return Standard_False;
  }

  myVariables.Append (aVariable);
  return Standard_True;
}

#endif