1 // Created on: 2011-07-13
2 // Created by: Sergey ZERCHANINOV
3 // Copyright (c) 2011-2012 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 #ifndef _OpenGl_AspectFace_Header
21 #define _OpenGl_AspectFace_Header
23 #include <InterfaceGraphic_telem.hxx>
24 #include <Aspect_InteriorStyle.hxx>
25 #include <TCollection_AsciiString.hxx>
26 #include <Handle_Graphic3d_TextureParams.hxx>
28 #include <OpenGl_AspectLine.hxx>
29 #include <OpenGl_Element.hxx>
30 #include <Handle_OpenGl_Texture.hxx>
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)
37 class CALL_DEF_CONTEXTFILLAREA;
39 struct OPENGL_SURF_PROP
41 float amb, diff, spec, emsv;
45 unsigned int color_mask;
46 TEL_COLOUR speccol, difcol, ambcol, emscol, matcol;
50 class OpenGl_AspectFace : public OpenGl_Element
57 void Init (const Handle(OpenGl_Context)& theContext,
58 const CALL_DEF_CONTEXTFILLAREA& theAspect);
60 void SetAspectEdge (const OpenGl_AspectLine* theAspectEdge) { myAspectEdge = *theAspectEdge; }
62 const OpenGl_AspectLine* AspectEdge() const { return &myAspectEdge; }
64 virtual void Render (const Handle(OpenGl_Workspace)& theWorkspace) const;
65 virtual void Release (const Handle(OpenGl_Context)& theContext);
69 void convertMaterial (const CALL_DEF_MATERIAL& theMat,
70 OPENGL_SURF_PROP& theSurf);
74 Aspect_InteriorStyle InteriorStyle;
77 int DistinguishingMode;
79 OPENGL_SURF_PROP IntFront;
80 OPENGL_SURF_PROP IntBack;
81 TEL_POFFSET_PARAM PolygonOffset;
84 Handle(OpenGl_Texture) TextureRes;
85 Handle(Graphic3d_TextureParams) TextureParams;
89 TCollection_AsciiString myTextureId;
90 OpenGl_AspectLine myAspectEdge;
98 #endif //_OpenGl_AspectFace_Header