0026033: Coding rules - get rid from _Handle classes
[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
b7cd4ba7 18#include <Graphic3d_BndBox4f.hxx>
b64d84be 19#include <Graphic3d_Group.hxx>
20#include <Graphic3d_SequenceOfGroup.hxx>
51b10cd4 21#include <Graphic3d_SequenceOfHClipPlane.hxx>
63bcc448 22#include <Graphic3d_TypeOfComposition.hxx>
a272ed94 23#include <Graphic3d_ViewAffinity.hxx>
494782f6 24#include <Graphic3d_StructureManager.hxx>
63bcc448 25#include <Graphic3d_Vec3.hxx>
a1954302 26#include <Graphic3d_ZLayerId.hxx>
63bcc448 27#include <Standard_Transient.hxx>
28#include <Handle_Graphic3d_GraphicDriver.hxx>
bf75be98 29
494782f6 30//! Forward declaration.
63bcc448 31class Handle(Graphic3d_StructureManager);
494782f6 32class Handle(Graphic3d_CStructure);
63bcc448 33
34//! Low-level graphic structure interface
35class Graphic3d_CStructure : public Standard_Transient
bf75be98 36{
37
38public:
39
63bcc448 40 //! @return graphic driver created this structure
41 const Handle(Graphic3d_GraphicDriver)& GraphicDriver() const
42 {
43 return myGraphicDriver;
44 }
45
b64d84be 46 //! @return graphic groups
47 const Graphic3d_SequenceOfGroup& Groups() const
48 {
49 return myGroups;
50 }
51
63bcc448 52 //! @return associated clip planes
53 const Graphic3d_SequenceOfHClipPlane& ClipPlanes() const
54 {
55 return myClipPlanes;
56 }
57
58 //! Pass clip planes to the associated graphic driver structure
59 void SetClipPlanes (const Graphic3d_SequenceOfHClipPlane& thePlanes) { myClipPlanes = thePlanes; }
60
b7cd4ba7 61 //! @return bounding box of this presentation
62 const Graphic3d_BndBox4f& BoundingBox() const
63 {
64 return myBndBox;
65 }
66
67 //! @return bounding box of this presentation
68 //! without transformation matrix applied
69 Graphic3d_BndBox4f& ChangeBoundingBox()
70 {
71 return myBndBox;
72 }
73
a1954302 74 //! Return structure visibility flag
75 bool IsVisible() const { return visible != 0; }
76
77 //! Set z layer ID to display the structure in specified layer
78 void SetZLayer (const Graphic3d_ZLayerId theLayerIndex) { myZLayer = theLayerIndex; }
79
80 //! Get z layer ID
81 Graphic3d_ZLayerId ZLayer() const { return myZLayer; }
82
63bcc448 83public:
84
85 //! Update structure visibility state
a1954302 86 virtual void OnVisibilityChanged() = 0;
63bcc448 87
88 //! Clear graphic data
89 virtual void Clear() = 0;
90
91 //! Connect other structure to this one
92 virtual void Connect (Graphic3d_CStructure& theStructure) = 0;
93
94 //! Disconnect other structure to this one
95 virtual void Disconnect (Graphic3d_CStructure& theStructure) = 0;
96
97 //! Synchronize structure aspects
98 virtual void UpdateAspects() = 0;
99
100 //! Synchronize structure transformation
101 virtual void UpdateTransformation() = 0;
bf75be98 102
63bcc448 103 //! Highlight entire structure with color
104 virtual void HighlightWithColor (const Graphic3d_Vec3& theColor,
105 const Standard_Boolean theToCreate) = 0;
106
107 //! Highlight structure using boundary box
b64d84be 108 virtual void HighlightWithBndBox (const Handle(Graphic3d_Structure)& theStruct,
109 const Standard_Boolean theToCreate) = 0;
63bcc448 110
679ecdee 111 //! Create shadow link to this structure
112 virtual Handle(Graphic3d_CStructure) ShadowLink (const Handle(Graphic3d_StructureManager)& theManager) const = 0;
113
b64d84be 114 //! Create new group within this structure
115 virtual Handle(Graphic3d_Group) NewGroup (const Handle(Graphic3d_Structure)& theStruct) = 0;
116
117 //! Remove group from this structure
118 virtual void RemoveGroup (const Handle(Graphic3d_Group)& theGroup) = 0;
119
63bcc448 120public:
121
a1954302 122 int Id;
123 Graphic3d_ZLayerId myZLayer;
124 int Priority;
125 int PreviousPriority;
bf75be98 126
127 CALL_DEF_CONTEXTLINE ContextLine;
128 CALL_DEF_CONTEXTFILLAREA ContextFillArea;
129 CALL_DEF_CONTEXTMARKER ContextMarker;
130 CALL_DEF_CONTEXTTEXT ContextText;
131
b7cd4ba7 132 CALL_DEF_COLOR HighlightColor;
bf75be98 133
134 float Transformation[4][4];
63bcc448 135 Graphic3d_TypeOfComposition Composition;
bf75be98 136
137 int ContainsFacet;
138
a272ed94 139 Handle(Graphic3d_ViewAffinity) ViewAffinity; //!< view affinity mask
140
b7cd4ba7 141 unsigned IsInfinite : 1;
a1954302 142 unsigned stick : 1; //!< displaying state - should be set when structure has been added to scene graph (but can be in hidden state)
b7cd4ba7 143 unsigned highlight : 1;
a1954302 144 unsigned visible : 1; //!< visibility flag - can be used to suppress structure while leaving it in the scene graph
b7cd4ba7 145 unsigned HLRValidation : 1;
146 unsigned IsForHighlight : 1;
147 unsigned IsMutable : 1;
148 unsigned Is2dText : 1;
bf75be98 149
150 CALL_DEF_TRANSFORM_PERSISTENCE TransformPersistence;
151
63bcc448 152protected:
7fd59977 153
63bcc448 154 //! Create empty structure.
155 Standard_EXPORT Graphic3d_CStructure (const Handle(Graphic3d_StructureManager)& theManager);
7fd59977 156
63bcc448 157protected:
158
159 Handle(Graphic3d_GraphicDriver) myGraphicDriver;
b64d84be 160 Graphic3d_SequenceOfGroup myGroups;
b7cd4ba7 161 Graphic3d_BndBox4f myBndBox;
63bcc448 162 Graphic3d_SequenceOfHClipPlane myClipPlanes;
163
164public:
165
166 DEFINE_STANDARD_RTTI(Graphic3d_CStructure) // Type definition
167
168};
7fd59977 169
494782f6 170DEFINE_STANDARD_HANDLE (Graphic3d_CStructure, Standard_Transient)
171
63bcc448 172#endif // _Graphic3d_CStructure_HeaderFile