1 // Created on: 2013-09-25
2 // Created by: Denis BOGOLEPOV
3 // Copyright (c) 2013 OPEN CASCADE SAS
5 // The content of this file is subject to the Open CASCADE Technology Public
6 // License Version 6.5 (the "License"). You may not use the content of this file
7 // except in compliance with the License. Please obtain a copy of the License
8 // at http://www.opencascade.org and read it completely before using this file.
10 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 // The Original Code and all software distributed under the License is
14 // distributed on an "AS IS" basis, without warranty of any kind, and the
15 // Initial Developer hereby disclaims all such warranties, including without
16 // limitation, any warranties of merchantability, fitness for a particular
17 // purpose or non-infringement. Please see the License for the specific terms
18 // and conditions governing the rights and limitations under the License.
20 #include <Standard_Atomic.hxx>
22 #include <Graphic3d_ShaderVariable.hxx>
24 IMPLEMENT_STANDARD_HANDLE (Graphic3d_ShaderVariable, Standard_Transient)
25 IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_ShaderVariable, Standard_Transient)
27 // Specific instantiations of struct templates to avoid compilation warnings
28 template struct Graphic3d_UniformValue<Standard_Integer>;
29 template struct Graphic3d_UniformValue<Standard_ShortReal>;
30 template struct Graphic3d_UniformValue<Graphic3d_Vec2>;
31 template struct Graphic3d_UniformValue<Graphic3d_Vec3>;
32 template struct Graphic3d_UniformValue<Graphic3d_Vec4>;
33 template struct Graphic3d_UniformValue<Graphic3d_Vec2i>;
34 template struct Graphic3d_UniformValue<Graphic3d_Vec3i>;
35 template struct Graphic3d_UniformValue<Graphic3d_Vec4i>;
37 // =======================================================================
38 // function : ~Graphic3d_ValueInterface
39 // purpose : Releases memory resources of variable value
40 // =======================================================================
41 Graphic3d_ValueInterface::~Graphic3d_ValueInterface()
46 // =======================================================================
47 // function : Graphic3d_ShaderVariable
48 // purpose : Creates new abstract shader variable
49 // =======================================================================
50 Graphic3d_ShaderVariable::Graphic3d_ShaderVariable (const TCollection_AsciiString& theName)
57 // =======================================================================
58 // function : ~Graphic3d_ShaderVariableBase
59 // purpose : Releases resources of shader variable
60 // =======================================================================
61 Graphic3d_ShaderVariable::~Graphic3d_ShaderVariable()
66 // =======================================================================
68 // purpose : Checks if the shader variable is valid or not
69 // =======================================================================
70 Standard_Boolean Graphic3d_ShaderVariable::IsDone() const
72 return !myName.IsEmpty() && (myValue != NULL);
75 // =======================================================================
77 // purpose : Returns name of shader variable
78 // =======================================================================
79 const TCollection_AsciiString& Graphic3d_ShaderVariable::Name() const
84 // =======================================================================
86 // purpose : Returns interface of shader variable value
87 // =======================================================================
88 Graphic3d_ValueInterface* Graphic3d_ShaderVariable::Value()