0024171: Eliminate CLang compiler warning -Wreorder
[occt.git] / src / OpenGl / OpenGl_AspectFace.hxx
1 // Created on: 2011-07-13
2 // Created by: Sergey ZERCHANINOV
3 // Copyright (c) 2011-2012 OPEN CASCADE SAS
4 //
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.
9 //
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.
12 //
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.
19
20 #ifndef _OpenGl_AspectFace_Header
21 #define _OpenGl_AspectFace_Header
22
23 #include <InterfaceGraphic_telem.hxx>
24 #include <Aspect_InteriorStyle.hxx>
25 #include <TCollection_AsciiString.hxx>
26 #include <Handle_Graphic3d_TextureParams.hxx>
27
28 #include <OpenGl_AspectLine.hxx>
29 #include <OpenGl_Element.hxx>
30 #include <Handle_OpenGl_Texture.hxx>
31
32 #define OPENGL_AMBIENT_MASK  (1<<0)
33 #define OPENGL_DIFFUSE_MASK  (1<<1)
34 #define OPENGL_SPECULAR_MASK (1<<2)
35 #define OPENGL_EMISSIVE_MASK (1<<3)
36
37 class CALL_DEF_CONTEXTFILLAREA;
38
39 struct OPENGL_SURF_PROP
40 {
41   float        amb, diff, spec, emsv;
42   float        trans, shine;
43   float        env_reflexion;
44   int          isphysic;
45   unsigned int color_mask;
46   TEL_COLOUR speccol, difcol, ambcol, emscol, matcol;
47   DEFINE_STANDARD_ALLOC
48 };
49
50 class OpenGl_AspectFace : public OpenGl_Element
51 {
52
53 public:
54
55   OpenGl_AspectFace();
56
57   void Init (const Handle(OpenGl_Context)&   theContext,
58              const CALL_DEF_CONTEXTFILLAREA& theAspect);
59
60   void SetAspectEdge (const OpenGl_AspectLine* theAspectEdge) { myAspectEdge = *theAspectEdge; }
61
62   const OpenGl_AspectLine* AspectEdge() const { return &myAspectEdge; }
63
64   virtual void Render  (const Handle(OpenGl_Workspace)& theWorkspace) const;
65   virtual void Release (const Handle(OpenGl_Context)&   theContext);
66
67 private:
68
69   void convertMaterial (const CALL_DEF_MATERIAL& theMat,
70                         OPENGL_SURF_PROP&        theSurf);
71
72 public:
73
74   Aspect_InteriorStyle    InteriorStyle;
75   int                     Edge;
76   int                     Hatch;
77   int                     DistinguishingMode;
78   int                     CullingMode;
79   OPENGL_SURF_PROP        IntFront;
80   OPENGL_SURF_PROP        IntBack;
81   TEL_POFFSET_PARAM       PolygonOffset;
82
83   int                     doTextureMap;
84   Handle(OpenGl_Texture)  TextureRes;
85   Handle(Graphic3d_TextureParams) TextureParams;
86
87 protected:
88
89   TCollection_AsciiString myTextureId;
90   OpenGl_AspectLine       myAspectEdge;
91
92 public:
93
94   DEFINE_STANDARD_ALLOC
95
96 };
97
98 #endif //_OpenGl_AspectFace_Header