0024637: Visualization - clean up implementation of rendering in immediate mode
[occt.git] / src / Graphic3d / Graphic3d_CStructure.hxx
CommitLineData
b311480e 1// Copyright (c) 1995-1999 Matra Datavision
973c2be1 2// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 3//
973c2be1 4// This file is part of Open CASCADE Technology software library.
b311480e 5//
d5f74e42 6// This library is free software; you can redistribute it and/or modify it under
7// the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 8// by the Free Software Foundation, with special exception defined in the file
9// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10// distribution for complete text of the license and disclaimer of any warranty.
b311480e 11//
973c2be1 12// Alternatively, this file may be used under the terms of Open CASCADE
13// commercial license or contractual agreement.
b311480e 14
7fd59977 15#ifndef _Graphic3d_CStructure_HeaderFile
16#define _Graphic3d_CStructure_HeaderFile
17
63bcc448 18#include <Graphic3d_CStructure_Handle.hxx>
bf75be98 19#include <Graphic3d_CGroup.hxx>
51b10cd4 20#include <Graphic3d_SequenceOfHClipPlane.hxx>
63bcc448 21#include <Graphic3d_TypeOfComposition.hxx>
22#include <Graphic3d_Vec3.hxx>
23#include <Standard_Transient.hxx>
24#include <Handle_Graphic3d_GraphicDriver.hxx>
bf75be98 25
63bcc448 26class Handle(Graphic3d_StructureManager);
27
28//! Low-level graphic structure interface
29class Graphic3d_CStructure : public Standard_Transient
bf75be98 30{
31
32public:
33
63bcc448 34 //! @return graphic driver created this structure
35 const Handle(Graphic3d_GraphicDriver)& GraphicDriver() const
36 {
37 return myGraphicDriver;
38 }
39
40 //! @return associated clip planes
41 const Graphic3d_SequenceOfHClipPlane& ClipPlanes() const
42 {
43 return myClipPlanes;
44 }
45
46 //! Pass clip planes to the associated graphic driver structure
47 void SetClipPlanes (const Graphic3d_SequenceOfHClipPlane& thePlanes) { myClipPlanes = thePlanes; }
48
49public:
50
51 //! Update structure visibility state
52 virtual void UpdateNamedStatus() = 0;
53
54 //! Clear graphic data
55 virtual void Clear() = 0;
56
57 //! Connect other structure to this one
58 virtual void Connect (Graphic3d_CStructure& theStructure) = 0;
59
60 //! Disconnect other structure to this one
61 virtual void Disconnect (Graphic3d_CStructure& theStructure) = 0;
62
63 //! Synchronize structure aspects
64 virtual void UpdateAspects() = 0;
65
66 //! Synchronize structure transformation
67 virtual void UpdateTransformation() = 0;
bf75be98 68
63bcc448 69 //! Highlight entire structure with color
70 virtual void HighlightWithColor (const Graphic3d_Vec3& theColor,
71 const Standard_Boolean theToCreate) = 0;
72
73 //! Highlight structure using boundary box
74 virtual void HighlightWithBndBox (const Standard_Boolean theToCreate) = 0;
75
679ecdee 76 //! Create shadow link to this structure
77 virtual Handle(Graphic3d_CStructure) ShadowLink (const Handle(Graphic3d_StructureManager)& theManager) const = 0;
78
63bcc448 79public:
80
81 int Id;
bf75be98 82 int Priority;
83 int PreviousPriority;
bf75be98 84
85 CALL_DEF_CONTEXTLINE ContextLine;
86 CALL_DEF_CONTEXTFILLAREA ContextFillArea;
87 CALL_DEF_CONTEXTMARKER ContextMarker;
88 CALL_DEF_CONTEXTTEXT ContextText;
89
90 CALL_DEF_BOUNDBOX BoundBox;
91
92 float Transformation[4][4];
63bcc448 93 Graphic3d_TypeOfComposition Composition;
bf75be98 94
95 int ContainsFacet;
96
bf75be98 97 unsigned IsInfinite : 1;
98 unsigned stick : 1;
99 unsigned highlight : 1;
100 unsigned visible : 1;
101 unsigned pick : 1;
102 unsigned HLRValidation : 1;
103
104 CALL_DEF_TRANSFORM_PERSISTENCE TransformPersistence;
105
63bcc448 106protected:
7fd59977 107
63bcc448 108 //! Create empty structure.
109 Standard_EXPORT Graphic3d_CStructure (const Handle(Graphic3d_StructureManager)& theManager);
7fd59977 110
63bcc448 111protected:
112
113 Handle(Graphic3d_GraphicDriver) myGraphicDriver;
114 Graphic3d_SequenceOfHClipPlane myClipPlanes;
115
116public:
117
118 DEFINE_STANDARD_RTTI(Graphic3d_CStructure) // Type definition
119
120};
7fd59977 121
63bcc448 122#endif // _Graphic3d_CStructure_HeaderFile