0030675: Visualization - remove redundant proxy classes in hierarchy of PrsMgr_Presen...
[occt.git] / src / Graphic3d / Graphic3d_Structure.hxx
CommitLineData
42cf5bc1 1// Created on: 1991-06-12
2// Created by: NW,JPB,CAL
3// Copyright (c) 1991-1999 Matra Datavision
4// Copyright (c) 1999-2014 OPEN CASCADE SAS
5//
6// This file is part of Open CASCADE Technology software library.
7//
8// This library is free software; you can redistribute it and/or modify it under
9// the terms of the GNU Lesser General Public License version 2.1 as published
10// by the Free Software Foundation, with special exception defined in the file
11// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12// distribution for complete text of the license and disclaimer of any warranty.
13//
14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
16
17#ifndef _Graphic3d_Structure_HeaderFile
18#define _Graphic3d_Structure_HeaderFile
19
7dd7c146 20#include <Graphic3d_BndBox4f.hxx>
21#include <Graphic3d_BndBox4d.hxx>
42cf5bc1 22#include <Graphic3d_CStructure.hxx>
42cf5bc1 23#include <Graphic3d_MapOfStructure.hxx>
7dd7c146 24#include <Graphic3d_SequenceOfGroup.hxx>
25#include <Graphic3d_SequenceOfHClipPlane.hxx>
42cf5bc1 26#include <Graphic3d_TypeOfComposition.hxx>
7dd7c146 27#include <Graphic3d_TypeOfConnection.hxx>
28#include <Graphic3d_TypeOfStructure.hxx>
825aa485 29#include <Graphic3d_TransformPers.hxx>
42cf5bc1 30#include <Graphic3d_TransModeFlags.hxx>
42cf5bc1 31#include <Graphic3d_Vertex.hxx>
7dd7c146 32#include <Graphic3d_ZLayerId.hxx>
33#include <NCollection_IndexedMap.hxx>
34
42cf5bc1 35class Graphic3d_StructureManager;
42cf5bc1 36class Graphic3d_DataStructureManager;
37class Bnd_Box;
38class gp_Pnt;
42cf5bc1 39
25e59720 40DEFINE_STANDARD_HANDLE(Graphic3d_Structure, Standard_Transient)
42cf5bc1 41
42//! This class allows the definition a graphic object.
7dd7c146 43//! This graphic structure can be displayed, erased, or highlighted.
44//! This graphic structure can be connected with another graphic structure.
25e59720 45class Graphic3d_Structure : public Standard_Transient
42cf5bc1 46{
7dd7c146 47 DEFINE_STANDARD_RTTIEXT(Graphic3d_Structure, Standard_Transient)
48 friend class Graphic3d_Group;
42cf5bc1 49public:
50
42cf5bc1 51 //! Creates a graphic object in the manager theManager.
52 //! It will appear in all the views of the visualiser.
42cf5bc1 53 //! The structure is not displayed when it is created.
7dd7c146 54 //! @param theManager structure manager holding this structure
55 //! @param theLinkPrs another structure for creating a shadow (linked) structure
56 Standard_EXPORT Graphic3d_Structure (const Handle(Graphic3d_StructureManager)& theManager,
57 const Handle(Graphic3d_Structure)& theLinkPrs = Handle(Graphic3d_Structure)());
42cf5bc1 58
59 //! if WithDestruction == Standard_True then
60 //! suppress all the groups of primitives in the structure.
61 //! and it is mandatory to create a new group in <me>.
62 //! if WithDestruction == Standard_False then
63 //! clears all the groups of primitives in the structure.
64 //! and all the groups are conserved and empty.
65 //! They will be erased at the next screen update.
66 //! The structure itself is conserved.
67 //! The transformation and the attributes of <me> are conserved.
68 //! The childs of <me> are conserved.
69 Standard_EXPORT virtual void Clear (const Standard_Boolean WithDestruction = Standard_True);
70
71 //! Suppresses the structure <me>.
72 //! It will be erased at the next screen update.
7dd7c146 73 Standard_EXPORT virtual ~Graphic3d_Structure();
42cf5bc1 74
75 //! Displays the structure <me> in all the views of the visualiser.
76 Standard_EXPORT virtual void Display();
7dd7c146 77
78 //! Returns the current display priority for this structure.
79 Standard_Integer DisplayPriority() const { return myCStructure->Priority; }
42cf5bc1 80
81 //! Erases the structure <me> in all the views
82 //! of the visualiser.
83 Standard_EXPORT virtual void Erase();
84
8e5fb5ea 85 //! Highlights the structure in all the views with the given style
86 //! @param theStyle [in] the style (type of highlighting: box/color, color and opacity)
87 //! @param theToUpdateMgr [in] defines whether related computed structures will be
88 //! highlighted via structure manager or not
f838dac4 89 Standard_EXPORT void Highlight (const Handle(Graphic3d_PresentationAttributes)& theStyle, const Standard_Boolean theToUpdateMgr = Standard_True);
42cf5bc1 90
91 //! Suppress the structure <me>.
92 //! It will be erased at the next screen update.
93 //! Warning: No more graphic operations in <me> after this call.
94 //! Category: Methods to modify the class definition
95 Standard_EXPORT void Remove();
96
97 //! Computes axis-aligned bounding box of a structure.
770fa4d4 98 Standard_EXPORT virtual void CalculateBoundBox();
42cf5bc1 99
7dd7c146 100 //! Sets infinite flag.
101 //! When TRUE, the MinMaxValues method returns:
42cf5bc1 102 //! theXMin = theYMin = theZMin = RealFirst().
103 //! theXMax = theYMax = theZMax = RealLast().
7dd7c146 104 //! By default, structure is created not infinite but empty.
105 void SetInfiniteState (const Standard_Boolean theToSet) { myCStructure->IsInfinite = theToSet ? 1 : 0; }
106
42cf5bc1 107 //! Modifies the order of displaying the structure.
108 //! Values are between 0 and 10.
109 //! Structures are drawn according to their display priorities
110 //! in ascending order.
111 //! A structure of priority 10 is displayed the last and appears over the others.
112 //! The default value is 5.
113 //! Category: Methods to modify the class definition
114 //! Warning: If <me> is displayed then the SetDisplayPriority
115 //! method erase <me> and display <me> with the
116 //! new priority.
117 //! Raises PriorityDefinitionError if <Priority> is
118 //! greater than 10 or a negative value.
119 Standard_EXPORT void SetDisplayPriority (const Standard_Integer Priority);
120
121 //! Reset the current priority of the structure to the
122 //! previous priority.
123 //! Category: Methods to modify the class definition
124 //! Warning: If <me> is displayed then the SetDisplayPriority
125 //! method erase <me> and display <me> with the
126 //! previous priority.
127 Standard_EXPORT void ResetDisplayPriority();
128
129 //! Set Z layer ID for the structure. The Z layer mechanism
130 //! allows to display structures presented in higher layers in overlay
131 //! of structures in lower layers by switching off z buffer depth
132 //! test between layers
133 Standard_EXPORT void SetZLayer (const Graphic3d_ZLayerId theLayerId);
134
7dd7c146 135 //! Get Z layer ID of displayed structure.
136 //! The method returns -1 if the structure has no ID (deleted from graphic driver).
137 Graphic3d_ZLayerId GetZLayer() const { return myCStructure->ZLayer(); }
42cf5bc1 138
139 //! Changes a sequence of clip planes slicing the structure on rendering.
140 //! @param thePlanes [in] the set of clip planes.
7dd7c146 141 void SetClipPlanes (const Handle(Graphic3d_SequenceOfHClipPlane)& thePlanes) { myCStructure->SetClipPlanes (thePlanes); }
42cf5bc1 142
143 //! Get clip planes slicing the structure on rendering.
144 //! @return set of clip planes.
7dd7c146 145 const Handle(Graphic3d_SequenceOfHClipPlane)& ClipPlanes() const { return myCStructure->ClipPlanes(); }
2831708b 146
42cf5bc1 147 //! Modifies the visibility indicator to Standard_True or
148 //! Standard_False for the structure <me>.
149 //! The default value at the definition of <me> is
150 //! Standard_True.
151 Standard_EXPORT void SetVisible (const Standard_Boolean AValue);
152
153 //! Modifies the visualisation mode for the structure <me>.
154 Standard_EXPORT virtual void SetVisual (const Graphic3d_TypeOfStructure AVisual);
155
156 //! Modifies the minimum and maximum zoom coefficients
157 //! for the structure <me>.
158 //! The default value at the definition of <me> is unlimited.
159 //! Category: Methods to modify the class definition
160 //! Warning: Raises StructureDefinitionError if <LimitInf> is
161 //! greater than <LimitSup> or if <LimitInf> or
162 //! <LimitSup> is a negative value.
163 Standard_EXPORT void SetZoomLimit (const Standard_Real LimitInf, const Standard_Real LimitSup);
7dd7c146 164
165 //! Marks the structure <me> representing wired structure needed for highlight only so it won't be added to BVH tree.
166 void SetIsForHighlight (const Standard_Boolean isForHighlight) { myCStructure->IsForHighlight = isForHighlight; }
42cf5bc1 167
168 //! Suppresses the highlight for the structure <me>
169 //! in all the views of the visualiser.
170 Standard_EXPORT void UnHighlight();
171
7dd7c146 172 virtual void Compute()
173 {
174 //
175 }
42cf5bc1 176
177 //! Returns the new Structure defined for the new visualization
7dd7c146 178 virtual Handle(Graphic3d_Structure) Compute (const Handle(Graphic3d_DataStructureManager)& theProjector)
179 {
180 (void )theProjector;
181 return this;
182 }
42cf5bc1 183
184 //! Returns the new Structure defined for the new visualization
7dd7c146 185 virtual Handle(Graphic3d_Structure) Compute (const Handle(Graphic3d_DataStructureManager)& theProjector,
186 const Handle(Geom_Transformation)& theTrsf)
187 {
188 (void )theProjector;
189 (void )theTrsf;
190 return this;
191 }
192
42cf5bc1 193 //! Returns the new Structure defined for the new visualization
7dd7c146 194 virtual void Compute (const Handle(Graphic3d_DataStructureManager)& theProjector,
195 Handle(Graphic3d_Structure)& theStructure)
196 {
197 (void )theProjector;
198 (void )theStructure;
199 }
42cf5bc1 200
201 //! Returns the new Structure defined for the new visualization
7dd7c146 202 virtual void Compute (const Handle(Graphic3d_DataStructureManager)& theProjector,
203 const Handle(Geom_Transformation)& theTrsf,
204 Handle(Graphic3d_Structure)& theStructure)
205 {
206 (void )theProjector;
207 (void )theTrsf;
208 (void )theStructure;
209 }
1f7f5a90 210
42cf5bc1 211 //! Forces a new construction of the structure <me>
212 //! if <me> is displayed and TOS_COMPUTED.
213 Standard_EXPORT void ReCompute();
214
215 //! Forces a new construction of the structure <me>
216 //! if <me> is displayed in <aProjetor> and TOS_COMPUTED.
217 Standard_EXPORT void ReCompute (const Handle(Graphic3d_DataStructureManager)& aProjector);
218
219 //! Returns Standard_True if the structure <me> contains
220 //! Polygons, Triangles or Quadrangles.
221 Standard_EXPORT Standard_Boolean ContainsFacet() const;
2831708b 222
7dd7c146 223 //! Returns the groups sequence included in this structure.
224 const Graphic3d_SequenceOfGroup& Groups() const { return myCStructure->Groups(); }
225
226 //! Returns the current number of groups in this structure.
227 Standard_Integer NumberOfGroups() const { return myCStructure->Groups().Length(); }
42cf5bc1 228
229 //! Append new group to this structure.
230 Standard_EXPORT Handle(Graphic3d_Group) NewGroup();
7dd7c146 231
232 //! Returns the last created group or creates new one if list is empty.
233 Handle(Graphic3d_Group) CurrentGroup()
234 {
235 if (Groups().IsEmpty())
236 {
237 return NewGroup();
238 }
239 return Groups().Last();
240 }
241
242 //! Returns the highlight attributes.
243 const Handle(Graphic3d_PresentationAttributes)& HighlightStyle() const { return myCStructure->HighlightStyle(); }
244
245 //! Returns TRUE if this structure is deleted (after Remove() call).
246 Standard_Boolean IsDeleted() const { return myCStructure.IsNull(); }
42cf5bc1 247
7dd7c146 248 //! Returns the display indicator for this structure.
249 virtual Standard_Boolean IsDisplayed() const { return myCStructure->stick != 0; }
42cf5bc1 250
251 //! Returns Standard_True if the structure <me> is empty.
252 //! Warning: A structure is empty if :
253 //! it do not have group or all the groups are empties
254 //! and it do not have descendant or all the descendants
255 //! are empties.
256 Standard_EXPORT Standard_Boolean IsEmpty() const;
257
258 //! Returns Standard_True if the structure <me> is infinite.
7dd7c146 259 Standard_Boolean IsInfinite() const
260 {
261 return IsDeleted()
262 || myCStructure->IsInfinite;
263 }
42cf5bc1 264
7dd7c146 265 //! Returns the highlight indicator for this structure.
266 virtual Standard_Boolean IsHighlighted() const { return myCStructure->highlight != 0; }
42cf5bc1 267
7dd7c146 268 //! Returns TRUE if the structure is transformed.
269 Standard_Boolean IsTransformed() const
270 {
271 return !myCStructure->Transformation().IsNull()
272 && myCStructure->Transformation()->Form() != gp_Identity;
273 }
42cf5bc1 274
7dd7c146 275 //! Returns the visibility indicator for this structure.
276 Standard_Boolean IsVisible() const { return myCStructure->visible != 0; }
2831708b 277
42cf5bc1 278 //! Returns the coordinates of the boundary box of the structure <me>.
279 //! If <theToIgnoreInfiniteFlag> is TRUE, the method returns actual graphical
280 //! boundaries of the Graphic3d_Group components. Otherwise, the
281 //! method returns boundaries taking into account infinite state
282 //! of the structure. This approach generally used for application
283 //! specific fit operation (e.g. fitting the model into screen,
284 //! not taking into accout infinite helper elements).
285 //! Warning: If the structure <me> is empty then the empty box is returned,
286 //! If the structure <me> is infinite then the whole box is returned.
287 Standard_EXPORT Bnd_Box MinMaxValues (const Standard_Boolean theToIgnoreInfiniteFlag = Standard_False) const;
2831708b 288
42cf5bc1 289 //! Returns the visualisation mode for the structure <me>.
7dd7c146 290 Graphic3d_TypeOfStructure Visual() const { return myVisual; }
42cf5bc1 291
292 //! Returns Standard_True if the connection is possible between
293 //! <AStructure1> and <AStructure2> without a creation
294 //! of a cycle.
295 //!
296 //! It's not possible to call the method
297 //! AStructure1->Connect (AStructure2, TypeOfConnection)
298 //! if
299 //! - the set of all ancestors of <AStructure1> contains
300 //! <AStructure1> and if the
301 //! TypeOfConnection == TOC_DESCENDANT
302 //! - the set of all descendants of <AStructure1> contains
303 //! <AStructure2> and if the
304 //! TypeOfConnection == TOC_ANCESTOR
7dd7c146 305 Standard_EXPORT static Standard_Boolean AcceptConnection (Graphic3d_Structure* theStructure1,
306 Graphic3d_Structure* theStructure2,
307 Graphic3d_TypeOfConnection theType);
42cf5bc1 308
309 //! Returns the group of structures to which <me> is connected.
310 Standard_EXPORT void Ancestors (Graphic3d_MapOfStructure& SG) const;
311
312 //! If Atype is TOC_DESCENDANT then add <AStructure>
313 //! as a child structure of <me>.
314 //! If Atype is TOC_ANCESTOR then add <AStructure>
315 //! as a parent structure of <me>.
316 //! The connection propagates Display, Highlight, Erase,
317 //! Remove, and stacks the transformations.
318 //! No connection if the graph of the structures
319 //! contains a cycle and <WithCheck> is Standard_True;
7dd7c146 320 Standard_EXPORT void Connect (Graphic3d_Structure* theStructure,
321 Graphic3d_TypeOfConnection theType,
322 Standard_Boolean theWithCheck = Standard_False);
323
324 Standard_DEPRECATED("Deprecated short-cut")
325 void Connect (const Handle(Graphic3d_Structure)& thePrs)
326 {
327 Connect (thePrs.get(), Graphic3d_TOC_DESCENDANT);
328 }
42cf5bc1 329
330 //! Returns the group of structures connected to <me>.
331 Standard_EXPORT void Descendants (Graphic3d_MapOfStructure& SG) const;
332
333 //! Suppress the connection between <AStructure> and <me>.
7dd7c146 334 Standard_EXPORT void Disconnect (Graphic3d_Structure* theStructure);
335
336 Standard_DEPRECATED("Deprecated alias for Disconnect()")
337 void Remove (const Handle(Graphic3d_Structure)& thePrs) { Disconnect (thePrs.get()); }
42cf5bc1 338
339 //! If Atype is TOC_DESCENDANT then suppress all
340 //! the connections with the child structures of <me>.
341 //! If Atype is TOC_ANCESTOR then suppress all
342 //! the connections with the parent structures of <me>.
343 Standard_EXPORT void DisconnectAll (const Graphic3d_TypeOfConnection AType);
7dd7c146 344
345 Standard_DEPRECATED("Deprecated alias for DisconnectAll()")
346 void RemoveAll() { DisconnectAll (Graphic3d_TOC_DESCENDANT); }
42cf5bc1 347
348 //! Returns <ASet> the group of structures :
349 //! - directly or indirectly connected to <AStructure> if the
350 //! TypeOfConnection == TOC_DESCENDANT
351 //! - to which <AStructure> is directly or indirectly connected
352 //! if the TypeOfConnection == TOC_ANCESTOR
7dd7c146 353 Standard_EXPORT static void Network (Graphic3d_Structure* theStructure,
354 const Graphic3d_TypeOfConnection theType,
355 NCollection_Map<Graphic3d_Structure*>& theSet);
42cf5bc1 356
7dd7c146 357 void SetOwner (const Standard_Address theOwner) { myOwner = theOwner; }
42cf5bc1 358
7dd7c146 359 Standard_Address Owner() const { return myOwner; }
42cf5bc1 360
7dd7c146 361 void SetHLRValidation (const Standard_Boolean theFlag) { myCStructure->HLRValidation = theFlag ? 1 : 0; }
362
363 //! Hidden parts stored in this structure are valid if:
364 //! 1) the owner is defined.
365 //! 2) they are not invalid.
366 Standard_Boolean HLRValidation() const
367 {
368 return myOwner != NULL
369 && myCStructure->HLRValidation != 0;
370 }
6bd94e0d 371
1f7f5a90 372 //! Return local transformation.
373 const Handle(Geom_Transformation)& Transformation() const { return myCStructure->Transformation(); }
374
375 //! Modifies the current local transformation
376 Standard_EXPORT void SetTransformation (const Handle(Geom_Transformation)& theTrsf);
377
378 Standard_DEPRECATED("This method is deprecated - SetTransformation() should be called instead")
379 void Transform (const Handle(Geom_Transformation)& theTrsf) { SetTransformation (theTrsf); }
778cd667 380
381 //! Modifies the current transform persistence (pan, zoom or rotate)
382 Standard_EXPORT void SetTransformPersistence (const Handle(Graphic3d_TransformPers)& theTrsfPers);
825aa485 383
384 //! @return transform persistence of the presentable object.
778cd667 385 const Handle(Graphic3d_TransformPers)& TransformPersistence() const { return myCStructure->TransformPersistence(); }
825aa485 386
42cf5bc1 387 //! Sets if the structure location has mutable nature (content or location will be changed regularly).
7dd7c146 388 void SetMutable (const Standard_Boolean theIsMutable) { myCStructure->IsMutable = theIsMutable; }
42cf5bc1 389
390 //! Returns true if structure has mutable nature (content or location are be changed regularly).
391 //! Mutable structure will be managed in different way than static onces.
7dd7c146 392 Standard_Boolean IsMutable() const { return myCStructure->IsMutable; }
42cf5bc1 393
7dd7c146 394 Graphic3d_TypeOfStructure ComputeVisual() const { return myComputeVisual; }
42cf5bc1 395
396 //! Clears the structure <me>.
397 Standard_EXPORT void GraphicClear (const Standard_Boolean WithDestruction);
398
7dd7c146 399 void GraphicConnect (const Handle(Graphic3d_Structure)& theDaughter) { myCStructure->Connect (*theDaughter->myCStructure); }
42cf5bc1 400
7dd7c146 401 void GraphicDisconnect (const Handle(Graphic3d_Structure)& theDaughter) { myCStructure->Disconnect (*theDaughter->myCStructure); }
8e5fb5ea 402
1f7f5a90 403 //! Internal method which sets new transformation without calling graphic manager callbacks.
7dd7c146 404 void GraphicTransform (const Handle(Geom_Transformation)& theTrsf) { myCStructure->SetTransformation (theTrsf); }
8e5fb5ea 405
7dd7c146 406 //! Returns the identification number of this structure.
407 Standard_Integer Identification() const { return myCStructure->Id; }
42cf5bc1 408
409 //! Prints informations about the network associated
410 //! with the structure <AStructure>.
411 Standard_EXPORT static void PrintNetwork (const Handle(Graphic3d_Structure)& AStructure, const Graphic3d_TypeOfConnection AType);
412
7dd7c146 413 //! Suppress the structure in the list of descendants or in the list of ancestors.
414 Standard_EXPORT void Remove (Graphic3d_Structure* thePtr,
415 const Graphic3d_TypeOfConnection theType);
42cf5bc1 416
7dd7c146 417 void SetComputeVisual (const Graphic3d_TypeOfStructure theVisual)
418 {
419 // The ComputeVisual is saved only if the structure is declared TOS_ALL, TOS_WIREFRAME or TOS_SHADING.
420 // This declaration permits to calculate proper representation of the structure calculated by Compute instead of passage to TOS_COMPUTED.
421 if (theVisual != Graphic3d_TOS_COMPUTED)
422 {
423 myComputeVisual = theVisual;
424 }
425 }
42cf5bc1 426
1f7f5a90 427 //! Transforms theX, theY, theZ with the transformation theTrsf.
428 Standard_EXPORT static void Transforms (const gp_Trsf& theTrsf,
429 const Standard_Real theX, const Standard_Real theY, const Standard_Real theZ,
430 Standard_Real& theNewX, Standard_Real& theNewY, Standard_Real& theNewZ);
431
42cf5bc1 432 //! Returns the low-level structure
778cd667 433 const Handle(Graphic3d_CStructure)& CStructure() const { return myCStructure; }
42cf5bc1 434
42cf5bc1 435protected:
436
42cf5bc1 437 //! Transforms boundaries with <theTrsf> transformation.
1f7f5a90 438 Standard_EXPORT static void TransformBoundaries (const gp_Trsf& theTrsf,
439 Standard_Real& theXMin, Standard_Real& theYMin, Standard_Real& theZMin,
440 Standard_Real& theXMax, Standard_Real& theYMax, Standard_Real& theZMax);
441
42cf5bc1 442 //! Appends new descendant structure.
7dd7c146 443 Standard_EXPORT Standard_Boolean AppendDescendant (Graphic3d_Structure* theDescendant);
42cf5bc1 444
445 //! Removes the given descendant structure.
7dd7c146 446 Standard_EXPORT Standard_Boolean RemoveDescendant (Graphic3d_Structure* theDescendant);
42cf5bc1 447
448 //! Appends new ancestor structure.
7dd7c146 449 Standard_EXPORT Standard_Boolean AppendAncestor (Graphic3d_Structure* theAncestor);
42cf5bc1 450
451 //! Removes the given ancestor structure.
7dd7c146 452 Standard_EXPORT Standard_Boolean RemoveAncestor (Graphic3d_Structure* theAncestor);
42cf5bc1 453
42cf5bc1 454private:
455
42cf5bc1 456 //! Suppress in the structure <me>, the group theGroup.
457 //! It will be erased at the next screen update.
458 Standard_EXPORT void Remove (const Handle(Graphic3d_Group)& theGroup);
459
460 //! Manages the number of groups in the structure <me>
461 //! which contains facet.
462 //! Polygons, Triangles or Quadrangles.
463 //! <ADelta> = +1 or -1
464 Standard_EXPORT void GroupsWithFacet (const Standard_Integer ADelta);
465
466 //! Returns the extreme coordinates found in the structure <me> without transformation applied.
467 Standard_EXPORT Graphic3d_BndBox4f minMaxCoord() const;
468
469 //! Gets untransformed bounding box from structure.
7c3ef2f7 470 Standard_EXPORT void getBox (Graphic3d_BndBox3d& theBox, const Standard_Boolean theToIgnoreInfiniteFlag = Standard_False) const;
42cf5bc1 471
472 //! Adds transformed (with myCStructure->Transformation) bounding box of structure to theBox.
7c3ef2f7 473 Standard_EXPORT void addTransformed (Graphic3d_BndBox3d& theBox, const Standard_Boolean theToIgnoreInfiniteFlag = Standard_False) const;
42cf5bc1 474
475 //! Returns the manager to which <me> is associated.
476 Standard_EXPORT Handle(Graphic3d_StructureManager) StructureManager() const;
477
50d06d8f 478 //! Calls the Update method of the StructureManager which contains the Structure <me>.
479 //! If theUpdateLayer is true then invalidates bounding box of ZLayer.
480 Standard_EXPORT void Update (const bool theUpdateLayer = false) const;
2831708b 481
482protected:
42cf5bc1 483
7dd7c146 484 Graphic3d_StructureManager* myStructureManager;
485 Handle(Graphic3d_CStructure) myCStructure;
486 NCollection_IndexedMap<Graphic3d_Structure*> myAncestors;
487 NCollection_IndexedMap<Graphic3d_Structure*> myDescendants;
488 Standard_Address myOwner;
489 Graphic3d_TypeOfStructure myVisual;
490 Graphic3d_TypeOfStructure myComputeVisual;
42cf5bc1 491
42cf5bc1 492};
493
42cf5bc1 494#endif // _Graphic3d_Structure_HeaderFile