1 // Copyright (c) 1995-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
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
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.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
15 #ifndef _Graphic3d_CStructure_HeaderFile
16 #define _Graphic3d_CStructure_HeaderFile
18 #include <Graphic3d_BndBox4f.hxx>
19 #include <Graphic3d_CStructure_Handle.hxx>
20 #include <Graphic3d_Group.hxx>
21 #include <Graphic3d_SequenceOfGroup.hxx>
22 #include <Graphic3d_SequenceOfHClipPlane.hxx>
23 #include <Graphic3d_TypeOfComposition.hxx>
24 #include <Graphic3d_Vec3.hxx>
25 #include <Standard_Transient.hxx>
26 #include <Handle_Graphic3d_GraphicDriver.hxx>
28 class Handle(Graphic3d_StructureManager);
30 //! Low-level graphic structure interface
31 class Graphic3d_CStructure : public Standard_Transient
36 //! @return graphic driver created this structure
37 const Handle(Graphic3d_GraphicDriver)& GraphicDriver() const
39 return myGraphicDriver;
42 //! @return graphic groups
43 const Graphic3d_SequenceOfGroup& Groups() const
48 //! @return associated clip planes
49 const Graphic3d_SequenceOfHClipPlane& ClipPlanes() const
54 //! Pass clip planes to the associated graphic driver structure
55 void SetClipPlanes (const Graphic3d_SequenceOfHClipPlane& thePlanes) { myClipPlanes = thePlanes; }
57 //! @return bounding box of this presentation
58 const Graphic3d_BndBox4f& BoundingBox() const
63 //! @return bounding box of this presentation
64 //! without transformation matrix applied
65 Graphic3d_BndBox4f& ChangeBoundingBox()
72 //! Update structure visibility state
73 virtual void UpdateNamedStatus() = 0;
75 //! Clear graphic data
76 virtual void Clear() = 0;
78 //! Connect other structure to this one
79 virtual void Connect (Graphic3d_CStructure& theStructure) = 0;
81 //! Disconnect other structure to this one
82 virtual void Disconnect (Graphic3d_CStructure& theStructure) = 0;
84 //! Synchronize structure aspects
85 virtual void UpdateAspects() = 0;
87 //! Synchronize structure transformation
88 virtual void UpdateTransformation() = 0;
90 //! Highlight entire structure with color
91 virtual void HighlightWithColor (const Graphic3d_Vec3& theColor,
92 const Standard_Boolean theToCreate) = 0;
94 //! Highlight structure using boundary box
95 virtual void HighlightWithBndBox (const Handle(Graphic3d_Structure)& theStruct,
96 const Standard_Boolean theToCreate) = 0;
98 //! Create shadow link to this structure
99 virtual Handle(Graphic3d_CStructure) ShadowLink (const Handle(Graphic3d_StructureManager)& theManager) const = 0;
101 //! Create new group within this structure
102 virtual Handle(Graphic3d_Group) NewGroup (const Handle(Graphic3d_Structure)& theStruct) = 0;
104 //! Remove group from this structure
105 virtual void RemoveGroup (const Handle(Graphic3d_Group)& theGroup) = 0;
111 int PreviousPriority;
113 CALL_DEF_CONTEXTLINE ContextLine;
114 CALL_DEF_CONTEXTFILLAREA ContextFillArea;
115 CALL_DEF_CONTEXTMARKER ContextMarker;
116 CALL_DEF_CONTEXTTEXT ContextText;
118 CALL_DEF_COLOR HighlightColor;
120 float Transformation[4][4];
121 Graphic3d_TypeOfComposition Composition;
125 unsigned IsInfinite : 1;
127 unsigned highlight : 1;
128 unsigned visible : 1;
130 unsigned HLRValidation : 1;
131 unsigned IsForHighlight : 1;
132 unsigned IsMutable : 1;
133 unsigned Is2dText : 1;
135 CALL_DEF_TRANSFORM_PERSISTENCE TransformPersistence;
139 //! Create empty structure.
140 Standard_EXPORT Graphic3d_CStructure (const Handle(Graphic3d_StructureManager)& theManager);
144 Handle(Graphic3d_GraphicDriver) myGraphicDriver;
145 Graphic3d_SequenceOfGroup myGroups;
146 Graphic3d_BndBox4f myBndBox;
147 Graphic3d_SequenceOfHClipPlane myClipPlanes;
151 DEFINE_STANDARD_RTTI(Graphic3d_CStructure) // Type definition
155 #endif // _Graphic3d_CStructure_HeaderFile