1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00

Fix cyclic dependency between OpenGl (OpenGl_Vec) and Graphic3d (Graphic3d_ShaderVariable)

This commit is contained in:
kgv 2013-10-25 11:23:16 +04:00
parent bd0b3e6097
commit c4a8a6bb7b
8 changed files with 87 additions and 46 deletions

View File

@ -56,6 +56,7 @@ Graphic3d_NListOfHAsciiString.hxx
Graphic3d_AspectText3d.cxx
Graphic3d_PtrFrameBuffer.hxx
Graphic3d_BufferType.hxx
Graphic3d_Vec.hxx
Graphic3d_Vec2.hxx
Graphic3d_Vec3.hxx
Graphic3d_Vec4.hxx

View File

@ -24,17 +24,15 @@
IMPLEMENT_STANDARD_HANDLE (Graphic3d_ShaderVariable, Standard_Transient)
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_ShaderVariable, Standard_Transient)
//
// Specific instantiations of struct templates to avoid compilation warnings
//
template struct Graphic3d_UniformValue<int>;
template struct Graphic3d_UniformValue<float>;
template struct Graphic3d_UniformValue<OpenGl_Vec2>;
template struct Graphic3d_UniformValue<OpenGl_Vec3>;
template struct Graphic3d_UniformValue<OpenGl_Vec4>;
template struct Graphic3d_UniformValue<OpenGl_Vec2i>;
template struct Graphic3d_UniformValue<OpenGl_Vec3i>;
template struct Graphic3d_UniformValue<OpenGl_Vec4i>;
template struct Graphic3d_UniformValue<Standard_Integer>;
template struct Graphic3d_UniformValue<Standard_ShortReal>;
template struct Graphic3d_UniformValue<Graphic3d_Vec2>;
template struct Graphic3d_UniformValue<Graphic3d_Vec3>;
template struct Graphic3d_UniformValue<Graphic3d_Vec4>;
template struct Graphic3d_UniformValue<Graphic3d_Vec2i>;
template struct Graphic3d_UniformValue<Graphic3d_Vec3i>;
template struct Graphic3d_UniformValue<Graphic3d_Vec4i>;
// =======================================================================
// function : ~Graphic3d_ValueInterface

View File

@ -20,7 +20,7 @@
#ifndef _Graphic3d_ShaderVariable_HeaderFile
#define _Graphic3d_ShaderVariable_HeaderFile
#include <OpenGl_Vec.hxx>
#include <Graphic3d_Vec.hxx>
#include <Standard_Transient.hxx>
#include <TCollection_AsciiString.hxx>
@ -49,42 +49,42 @@ struct Graphic3d_UniformValueTypeID {
};
template<>
struct Graphic3d_UniformValueTypeID<int> {
struct Graphic3d_UniformValueTypeID<Standard_Integer> {
static const Standard_Size ID = __LINE__;
};
template<>
struct Graphic3d_UniformValueTypeID<float> {
struct Graphic3d_UniformValueTypeID<Standard_ShortReal> {
static const Standard_Size ID = __LINE__;
};
template<>
struct Graphic3d_UniformValueTypeID<OpenGl_Vec2> {
struct Graphic3d_UniformValueTypeID<Graphic3d_Vec2> {
static const Standard_Size ID = __LINE__;
};
template<>
struct Graphic3d_UniformValueTypeID<OpenGl_Vec3> {
struct Graphic3d_UniformValueTypeID<Graphic3d_Vec3> {
static const Standard_Size ID = __LINE__;
};
template<>
struct Graphic3d_UniformValueTypeID<OpenGl_Vec4> {
struct Graphic3d_UniformValueTypeID<Graphic3d_Vec4> {
static const Standard_Size ID = __LINE__;
};
template<>
struct Graphic3d_UniformValueTypeID<OpenGl_Vec2i> {
struct Graphic3d_UniformValueTypeID<Graphic3d_Vec2i> {
static const Standard_Size ID = __LINE__;
};
template<>
struct Graphic3d_UniformValueTypeID<OpenGl_Vec3i> {
struct Graphic3d_UniformValueTypeID<Graphic3d_Vec3i> {
static const Standard_Size ID = __LINE__;
};
template<>
struct Graphic3d_UniformValueTypeID<OpenGl_Vec4i> {
struct Graphic3d_UniformValueTypeID<Graphic3d_Vec4i> {
static const Standard_Size ID = __LINE__;
};
@ -103,28 +103,28 @@ struct Graphic3d_UniformValue : public Graphic3d_ValueInterface
};
//! Integer uniform value.
typedef Graphic3d_UniformValue<int> Graphic3d_UniformInt;
typedef Graphic3d_UniformValue<Standard_Integer> Graphic3d_UniformInt;
//! Integer uniform 2D vector.
typedef Graphic3d_UniformValue<OpenGl_Vec2i> Graphic3d_UniformVec2i;
typedef Graphic3d_UniformValue<Graphic3d_Vec2i> Graphic3d_UniformVec2i;
//! Integer uniform 3D vector.
typedef Graphic3d_UniformValue<OpenGl_Vec3i> Graphic3d_UniformVec3i;
typedef Graphic3d_UniformValue<Graphic3d_Vec3i> Graphic3d_UniformVec3i;
//! Integer uniform 4D vector.
typedef Graphic3d_UniformValue<OpenGl_Vec4i> Graphic3d_UniformVec4i;
typedef Graphic3d_UniformValue<Graphic3d_Vec4i> Graphic3d_UniformVec4i;
//! Floating-point uniform value.
typedef Graphic3d_UniformValue<float> Graphic3d_UniformFloat;
typedef Graphic3d_UniformValue<Standard_ShortReal> Graphic3d_UniformFloat;
//! Floating-point uniform 2D vector.
typedef Graphic3d_UniformValue<OpenGl_Vec2> Graphic3d_UniformVec2;
typedef Graphic3d_UniformValue<Graphic3d_Vec2> Graphic3d_UniformVec2;
//! Floating-point uniform 3D vector.
typedef Graphic3d_UniformValue<OpenGl_Vec3> Graphic3d_UniformVec3;
typedef Graphic3d_UniformValue<Graphic3d_Vec3> Graphic3d_UniformVec3;
//! Floating-point uniform 4D vector.
typedef Graphic3d_UniformValue<OpenGl_Vec4> Graphic3d_UniformVec4;
typedef Graphic3d_UniformValue<Graphic3d_Vec4> Graphic3d_UniformVec4;
//! Describes custom uniform shader variable.
class Graphic3d_ShaderVariable : public Standard_Transient

View File

@ -0,0 +1,27 @@
// Created on: 2013-10-25
// Created by: Kirill GAVRILOV
// Copyright (c) 2013 OPEN CASCADE SAS
//
// The content of this file is subject to the Open CASCADE Technology Public
// License Version 6.5 (the "License"). You may not use the content of this file
// except in compliance with the License. Please obtain a copy of the License
// at http://www.opencascade.org and read it completely before using this file.
//
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
//
// The Original Code and all software distributed under the License is
// distributed on an "AS IS" basis, without warranty of any kind, and the
// Initial Developer hereby disclaims all such warranties, including without
// limitation, any warranties of merchantability, fitness for a particular
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
#ifndef _Graphic3d_Vec_H__
#define _Graphic3d_Vec_H__
#include <Graphic3d_Vec2.hxx>
#include <Graphic3d_Vec3.hxx>
#include <Graphic3d_Vec4.hxx>
#endif // _Graphic3d_Vec_H__

View File

@ -22,5 +22,10 @@
#include <Standard_TypeDef.hxx>
typedef NCollection_Vec2<Standard_ShortReal> Graphic3d_Vec2;
typedef NCollection_Vec2<Standard_Real> Graphic3d_Vec2d;
typedef NCollection_Vec2<Standard_Integer> Graphic3d_Vec2i;
typedef NCollection_Vec2<unsigned int> Graphic3d_Vec2u;
typedef NCollection_Vec2<Standard_Byte> Graphic3d_Vec2ub;
typedef NCollection_Vec2<Standard_Character> Graphic3d_Vec2b;
#endif // _Graphic3d_Vec2_HeaderFile

View File

@ -22,5 +22,10 @@
#include <Standard_TypeDef.hxx>
typedef NCollection_Vec3<Standard_ShortReal> Graphic3d_Vec3;
typedef NCollection_Vec3<Standard_Real> Graphic3d_Vec3d;
typedef NCollection_Vec3<Standard_Integer> Graphic3d_Vec3i;
typedef NCollection_Vec3<unsigned int> Graphic3d_Vec3u;
typedef NCollection_Vec3<Standard_Byte> Graphic3d_Vec3ub;
typedef NCollection_Vec3<Standard_Character> Graphic3d_Vec3b;
#endif // _Graphic3d_Vec3_HeaderFile

View File

@ -22,5 +22,10 @@
#include <Standard_TypeDef.hxx>
typedef NCollection_Vec4<Standard_ShortReal> Graphic3d_Vec4;
typedef NCollection_Vec4<Standard_Real> Graphic3d_Vec4d;
typedef NCollection_Vec4<Standard_Integer> Graphic3d_Vec4i;
typedef NCollection_Vec4<unsigned int> Graphic3d_Vec4u;
typedef NCollection_Vec4<Standard_Byte> Graphic3d_Vec4ub;
typedef NCollection_Vec4<Standard_Character> Graphic3d_Vec4b;
#endif // _Graphic3d_Vec4_HeaderFile

View File

@ -20,30 +20,30 @@
#ifndef _OpenGl_Vec_H__
#define _OpenGl_Vec_H__
#include <NCollection_Vec4.hxx>
#include <Graphic3d_Vec.hxx>
typedef NCollection_Vec2<int> OpenGl_Vec2i;
typedef NCollection_Vec3<int> OpenGl_Vec3i;
typedef NCollection_Vec4<int> OpenGl_Vec4i;
typedef Graphic3d_Vec2i OpenGl_Vec2i;
typedef Graphic3d_Vec3i OpenGl_Vec3i;
typedef Graphic3d_Vec4i OpenGl_Vec4i;
typedef NCollection_Vec2<char> OpenGl_Vec2b;
typedef NCollection_Vec3<char> OpenGl_Vec3b;
typedef NCollection_Vec4<char> OpenGl_Vec4b;
typedef Graphic3d_Vec2b OpenGl_Vec2b;
typedef Graphic3d_Vec3b OpenGl_Vec3b;
typedef Graphic3d_Vec4b OpenGl_Vec4b;
typedef NCollection_Vec2<unsigned int> OpenGl_Vec2u;
typedef NCollection_Vec3<unsigned int> OpenGl_Vec3u;
typedef NCollection_Vec4<unsigned int> OpenGl_Vec4u;
typedef Graphic3d_Vec2u OpenGl_Vec2u;
typedef Graphic3d_Vec3u OpenGl_Vec3u;
typedef Graphic3d_Vec4u OpenGl_Vec4u;
typedef NCollection_Vec2<unsigned char> OpenGl_Vec2ub;
typedef NCollection_Vec3<unsigned char> OpenGl_Vec3ub;
typedef NCollection_Vec4<unsigned char> OpenGl_Vec4ub;
typedef Graphic3d_Vec2ub OpenGl_Vec2ub;
typedef Graphic3d_Vec3ub OpenGl_Vec3ub;
typedef Graphic3d_Vec4ub OpenGl_Vec4ub;
typedef NCollection_Vec2<float> OpenGl_Vec2;
typedef NCollection_Vec3<float> OpenGl_Vec3;
typedef NCollection_Vec4<float> OpenGl_Vec4;
typedef Graphic3d_Vec2 OpenGl_Vec2;
typedef Graphic3d_Vec3 OpenGl_Vec3;
typedef Graphic3d_Vec4 OpenGl_Vec4;
typedef NCollection_Vec2<double> OpenGl_Vec2d;
typedef NCollection_Vec3<double> OpenGl_Vec3d;
typedef NCollection_Vec4<double> OpenGl_Vec4d;
typedef Graphic3d_Vec2d OpenGl_Vec2d;
typedef Graphic3d_Vec3d OpenGl_Vec3d;
typedef Graphic3d_Vec4d OpenGl_Vec4d;
#endif // _OpenGl_Vec_H__