0024070: OpenGL capped object-level clipping planes
[occt.git] / src / OpenGl / OpenGl_AspectFace.hxx
CommitLineData
b311480e 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
2166f0fa
SK
20#ifndef _OpenGl_AspectFace_Header
21#define _OpenGl_AspectFace_Header
22
23#include <InterfaceGraphic_telem.hxx>
24#include <Aspect_InteriorStyle.hxx>
bf75be98 25#include <TCollection_AsciiString.hxx>
26#include <Handle_Graphic3d_TextureParams.hxx>
2166f0fa 27#include <OpenGl_AspectLine.hxx>
bf75be98 28#include <OpenGl_Element.hxx>
29#include <Handle_OpenGl_Texture.hxx>
4269bd1b 30#include <Graphic3d_AspectFillArea3d.hxx>
2166f0fa
SK
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
bf75be98 37class CALL_DEF_CONTEXTFILLAREA;
38
2166f0fa
SK
39struct 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;
1c35b92f 47 DEFINE_STANDARD_ALLOC
2166f0fa
SK
48};
49
2166f0fa
SK
50class OpenGl_AspectFace : public OpenGl_Element
51{
2166f0fa 52
bf75be98 53public:
2166f0fa 54
bf75be98 55 OpenGl_AspectFace();
2166f0fa 56
bf75be98 57 void Init (const Handle(OpenGl_Context)& theContext,
58 const CALL_DEF_CONTEXTFILLAREA& theAspect);
2166f0fa 59
4269bd1b 60 void Init (const Handle(OpenGl_Context)& theContext,
61 const Handle(Graphic3d_AspectFillArea3d)& theAspect);
62
bf75be98 63 void SetAspectEdge (const OpenGl_AspectLine* theAspectEdge) { myAspectEdge = *theAspectEdge; }
64
65 const OpenGl_AspectLine* AspectEdge() const { return &myAspectEdge; }
2166f0fa 66
5e27df78 67 virtual void Render (const Handle(OpenGl_Workspace)& theWorkspace) const;
68 virtual void Release (const Handle(OpenGl_Context)& theContext);
2166f0fa 69
bf75be98 70private:
71
72 void convertMaterial (const CALL_DEF_MATERIAL& theMat,
73 OPENGL_SURF_PROP& theSurf);
74
75public:
76
77 Aspect_InteriorStyle InteriorStyle;
78 int Edge;
79 int Hatch;
80 int DistinguishingMode;
81 int CullingMode;
82 OPENGL_SURF_PROP IntFront;
83 OPENGL_SURF_PROP IntBack;
84 TEL_POFFSET_PARAM PolygonOffset;
2166f0fa 85
bf75be98 86 int doTextureMap;
87 Handle(OpenGl_Texture) TextureRes;
88 Handle(Graphic3d_TextureParams) TextureParams;
89
90protected:
91
92 TCollection_AsciiString myTextureId;
93 OpenGl_AspectLine myAspectEdge;
94
95public:
2166f0fa 96
1c35b92f 97 DEFINE_STANDARD_ALLOC
bf75be98 98
2166f0fa
SK
99};
100
101#endif //_OpenGl_AspectFace_Header