0024752: Visualization - inherit OpenGl_Group from Graphic3d_Group
[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>
b64d84be 19#include <Graphic3d_Group.hxx>
20#include <Graphic3d_SequenceOfGroup.hxx>
51b10cd4 21#include <Graphic3d_SequenceOfHClipPlane.hxx>
63bcc448 22#include <Graphic3d_TypeOfComposition.hxx>
23#include <Graphic3d_Vec3.hxx>
24#include <Standard_Transient.hxx>
25#include <Handle_Graphic3d_GraphicDriver.hxx>
bf75be98 26
63bcc448 27class Handle(Graphic3d_StructureManager);
28
29//! Low-level graphic structure interface
30class Graphic3d_CStructure : public Standard_Transient
bf75be98 31{
32
33public:
34
63bcc448 35 //! @return graphic driver created this structure
36 const Handle(Graphic3d_GraphicDriver)& GraphicDriver() const
37 {
38 return myGraphicDriver;
39 }
40
b64d84be 41 //! @return graphic groups
42 const Graphic3d_SequenceOfGroup& Groups() const
43 {
44 return myGroups;
45 }
46
63bcc448 47 //! @return associated clip planes
48 const Graphic3d_SequenceOfHClipPlane& ClipPlanes() const
49 {
50 return myClipPlanes;
51 }
52
53 //! Pass clip planes to the associated graphic driver structure
54 void SetClipPlanes (const Graphic3d_SequenceOfHClipPlane& thePlanes) { myClipPlanes = thePlanes; }
55
56public:
57
58 //! Update structure visibility state
59 virtual void UpdateNamedStatus() = 0;
60
61 //! Clear graphic data
62 virtual void Clear() = 0;
63
64 //! Connect other structure to this one
65 virtual void Connect (Graphic3d_CStructure& theStructure) = 0;
66
67 //! Disconnect other structure to this one
68 virtual void Disconnect (Graphic3d_CStructure& theStructure) = 0;
69
70 //! Synchronize structure aspects
71 virtual void UpdateAspects() = 0;
72
73 //! Synchronize structure transformation
74 virtual void UpdateTransformation() = 0;
bf75be98 75
63bcc448 76 //! Highlight entire structure with color
77 virtual void HighlightWithColor (const Graphic3d_Vec3& theColor,
78 const Standard_Boolean theToCreate) = 0;
79
80 //! Highlight structure using boundary box
b64d84be 81 virtual void HighlightWithBndBox (const Handle(Graphic3d_Structure)& theStruct,
82 const Standard_Boolean theToCreate) = 0;
63bcc448 83
679ecdee 84 //! Create shadow link to this structure
85 virtual Handle(Graphic3d_CStructure) ShadowLink (const Handle(Graphic3d_StructureManager)& theManager) const = 0;
86
b64d84be 87 //! Create new group within this structure
88 virtual Handle(Graphic3d_Group) NewGroup (const Handle(Graphic3d_Structure)& theStruct) = 0;
89
90 //! Remove group from this structure
91 virtual void RemoveGroup (const Handle(Graphic3d_Group)& theGroup) = 0;
92
63bcc448 93public:
94
95 int Id;
bf75be98 96 int Priority;
97 int PreviousPriority;
bf75be98 98
99 CALL_DEF_CONTEXTLINE ContextLine;
100 CALL_DEF_CONTEXTFILLAREA ContextFillArea;
101 CALL_DEF_CONTEXTMARKER ContextMarker;
102 CALL_DEF_CONTEXTTEXT ContextText;
103
104 CALL_DEF_BOUNDBOX BoundBox;
105
106 float Transformation[4][4];
63bcc448 107 Graphic3d_TypeOfComposition Composition;
bf75be98 108
109 int ContainsFacet;
110
bf75be98 111 unsigned IsInfinite : 1;
112 unsigned stick : 1;
113 unsigned highlight : 1;
114 unsigned visible : 1;
115 unsigned pick : 1;
116 unsigned HLRValidation : 1;
117
118 CALL_DEF_TRANSFORM_PERSISTENCE TransformPersistence;
119
63bcc448 120protected:
7fd59977 121
63bcc448 122 //! Create empty structure.
123 Standard_EXPORT Graphic3d_CStructure (const Handle(Graphic3d_StructureManager)& theManager);
7fd59977 124
63bcc448 125protected:
126
127 Handle(Graphic3d_GraphicDriver) myGraphicDriver;
b64d84be 128 Graphic3d_SequenceOfGroup myGroups;
63bcc448 129 Graphic3d_SequenceOfHClipPlane myClipPlanes;
130
131public:
132
133 DEFINE_STANDARD_RTTI(Graphic3d_CStructure) // Type definition
134
135};
7fd59977 136
63bcc448 137#endif // _Graphic3d_CStructure_HeaderFile