0027047: STEP -- eliminate useless polymorhic methods Init()
[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
20#include <Standard.hxx>
21#include <Standard_Type.hxx>
22
23#include <Graphic3d_CStructure.hxx>
24#include <Graphic3d_IndexedMapOfAddress.hxx>
25#include <Quantity_Color.hxx>
26#include <Aspect_TypeOfHighlightMethod.hxx>
27#include <Graphic3d_StructureManagerPtr.hxx>
28#include <Standard_Address.hxx>
29#include <Graphic3d_TypeOfStructure.hxx>
30#include <MMgt_TShared.hxx>
31#include <Standard_Boolean.hxx>
32#include <Standard_Integer.hxx>
33#include <Graphic3d_ZLayerId.hxx>
34#include <Graphic3d_SequenceOfHClipPlane.hxx>
35#include <Standard_Real.hxx>
36#include <TColStd_Array2OfReal.hxx>
37#include <Graphic3d_SequenceOfGroup.hxx>
38#include <Graphic3d_TypeOfConnection.hxx>
39#include <Graphic3d_MapOfStructure.hxx>
40#include <Graphic3d_TypeOfComposition.hxx>
825aa485 41#include <Graphic3d_TransformPers.hxx>
42cf5bc1 42#include <Graphic3d_TransModeFlags.hxx>
43#include <Graphic3d_BndBox4f.hxx>
44#include <Graphic3d_BndBox4d.hxx>
45#include <Graphic3d_Vertex.hxx>
46class Graphic3d_PriorityDefinitionError;
47class Graphic3d_StructureDefinitionError;
48class Graphic3d_TransformError;
49class Graphic3d_Group;
50class Graphic3d_StructureManager;
51class Quantity_Color;
52class Graphic3d_AspectLine3d;
53class Graphic3d_AspectFillArea3d;
54class Graphic3d_AspectText3d;
55class Graphic3d_AspectMarker3d;
56class Graphic3d_DataStructureManager;
57class Bnd_Box;
58class gp_Pnt;
59class Graphic3d_Vector;
60
61
62class Graphic3d_Structure;
63DEFINE_STANDARD_HANDLE(Graphic3d_Structure, MMgt_TShared)
64
65//! This class allows the definition a graphic object.
66//! This graphic structure can be displayed,
67//! erased, or highlighted.
68//! This graphic structure can be connected with
69//! another graphic structure.
70//! Keywords: Structure, StructureManager, Display, Erase, Highlight,
71//! UnHighlight, Visible, Priority, Selectable, Visible,
72//! Visual, Connection, Ancestors, Descendants, Transformation
73class Graphic3d_Structure : public MMgt_TShared
74{
75
76public:
77
78
79 //! Creates a graphic object in the manager theManager.
80 //! It will appear in all the views of the visualiser.
81 //! Warning: The default values AspectLine, AspectFillArea, AspectText and AspectMarker are NOT applied to the structure.
82 //! The structure is not displayed when it is created.
83 Standard_EXPORT Graphic3d_Structure(const Handle(Graphic3d_StructureManager)& theManager);
84
85 //! Creates a shadow link to existing graphic object.
86 Standard_EXPORT Graphic3d_Structure(const Handle(Graphic3d_StructureManager)& theManager, const Handle(Graphic3d_Structure)& thePrs);
87
88 //! if WithDestruction == Standard_True then
89 //! suppress all the groups of primitives in the structure.
90 //! and it is mandatory to create a new group in <me>.
91 //! if WithDestruction == Standard_False then
92 //! clears all the groups of primitives in the structure.
93 //! and all the groups are conserved and empty.
94 //! They will be erased at the next screen update.
95 //! The structure itself is conserved.
96 //! The transformation and the attributes of <me> are conserved.
97 //! The childs of <me> are conserved.
98 Standard_EXPORT virtual void Clear (const Standard_Boolean WithDestruction = Standard_True);
99
100 //! Suppresses the structure <me>.
101 //! It will be erased at the next screen update.
102 Standard_EXPORT virtual void Destroy();
103~Graphic3d_Structure()
104{
105 Destroy();
106}
107
108 //! Displays the structure <me> in all the views of the visualiser.
109 Standard_EXPORT virtual void Display();
110
111 //! Returns the current display priority for the
112 //! structure <me>.
113 Standard_EXPORT Standard_Integer DisplayPriority() const;
114
115 //! Erases the structure <me> in all the views
116 //! of the visualiser.
117 Standard_EXPORT virtual void Erase();
118
119 //! Highlights the structure <me> in all the views of the visualiser, using the following methods:
120 //! TOHM_COLOR = drawn in the highlight color
121 //! TOHM_BOUNDBOX = enclosed by the boundary box
122 Standard_EXPORT void Highlight (const Aspect_TypeOfHighlightMethod theMethod, const Quantity_Color& theColor, const Standard_Boolean theToUpdateMgr = Standard_True);
123
124 //! Suppress the structure <me>.
125 //! It will be erased at the next screen update.
126 //! Warning: No more graphic operations in <me> after this call.
127 //! Category: Methods to modify the class definition
128 Standard_EXPORT void Remove();
129
130 //! Computes axis-aligned bounding box of a structure.
131 //! Category: Methods to modify the class definition
132 Standard_EXPORT void CalculateBoundBox();
133
134 //! If <theToSet> is Standard_True then <me> is infinite and
135 //! the MinMaxValues method method return :
136 //! theXMin = theYMin = theZMin = RealFirst().
137 //! theXMax = theYMax = theZMax = RealLast().
138 //! By default, <me> is not infinite but empty.
139 Standard_EXPORT void SetInfiniteState (const Standard_Boolean theToSet);
140
141 //! Modifies the order of displaying the structure.
142 //! Values are between 0 and 10.
143 //! Structures are drawn according to their display priorities
144 //! in ascending order.
145 //! A structure of priority 10 is displayed the last and appears over the others.
146 //! The default value is 5.
147 //! Category: Methods to modify the class definition
148 //! Warning: If <me> is displayed then the SetDisplayPriority
149 //! method erase <me> and display <me> with the
150 //! new priority.
151 //! Raises PriorityDefinitionError if <Priority> is
152 //! greater than 10 or a negative value.
153 Standard_EXPORT void SetDisplayPriority (const Standard_Integer Priority);
154
155 //! Reset the current priority of the structure to the
156 //! previous priority.
157 //! Category: Methods to modify the class definition
158 //! Warning: If <me> is displayed then the SetDisplayPriority
159 //! method erase <me> and display <me> with the
160 //! previous priority.
161 Standard_EXPORT void ResetDisplayPriority();
162
163 //! Set Z layer ID for the structure. The Z layer mechanism
164 //! allows to display structures presented in higher layers in overlay
165 //! of structures in lower layers by switching off z buffer depth
166 //! test between layers
167 Standard_EXPORT void SetZLayer (const Graphic3d_ZLayerId theLayerId);
168
169 //! Get Z layer ID of displayed structure. The method
170 //! returns -1 if the structure has no ID (deleted from graphic driver).
171 Standard_EXPORT Graphic3d_ZLayerId GetZLayer() const;
172
173 //! Changes a sequence of clip planes slicing the structure on rendering.
174 //! @param thePlanes [in] the set of clip planes.
175 Standard_EXPORT void SetClipPlanes (const Graphic3d_SequenceOfHClipPlane& thePlanes);
176
177 //! Get clip planes slicing the structure on rendering.
178 //! @return set of clip planes.
179 Standard_EXPORT const Graphic3d_SequenceOfHClipPlane& GetClipPlanes() const;
180
181 //! Modifies the default attributes for lines
182 //! in the structure <me>.
183 Standard_EXPORT void SetPrimitivesAspect (const Handle(Graphic3d_AspectLine3d)& CTX);
184
185 //! Modifies the default attributes for faces
186 //! in the structure <me>.
187 Standard_EXPORT void SetPrimitivesAspect (const Handle(Graphic3d_AspectFillArea3d)& CTX);
188
189 //! Modifies the default attributes for text
190 //! in the structure <me>.
191 Standard_EXPORT void SetPrimitivesAspect (const Handle(Graphic3d_AspectText3d)& CTX);
192
193 //! Modifies the default attributes for markers
194 //! in the structure <me>.
195 Standard_EXPORT void SetPrimitivesAspect (const Handle(Graphic3d_AspectMarker3d)& CTX);
196
197 //! Modifies the visibility indicator to Standard_True or
198 //! Standard_False for the structure <me>.
199 //! The default value at the definition of <me> is
200 //! Standard_True.
201 Standard_EXPORT void SetVisible (const Standard_Boolean AValue);
202
203 //! Modifies the visualisation mode for the structure <me>.
204 Standard_EXPORT virtual void SetVisual (const Graphic3d_TypeOfStructure AVisual);
205
206 //! Modifies the minimum and maximum zoom coefficients
207 //! for the structure <me>.
208 //! The default value at the definition of <me> is unlimited.
209 //! Category: Methods to modify the class definition
210 //! Warning: Raises StructureDefinitionError if <LimitInf> is
211 //! greater than <LimitSup> or if <LimitInf> or
212 //! <LimitSup> is a negative value.
213 Standard_EXPORT void SetZoomLimit (const Standard_Real LimitInf, const Standard_Real LimitSup);
214
215 //! marks the structure <me> representing wired structure needed for
216 //! highlight only so it won't be added to BVH tree.
217 //! Category: Methods to modify the class definition
218 Standard_EXPORT void SetIsForHighlight (const Standard_Boolean isForHighlight);
219
220 //! Suppresses the highlight for the structure <me>
221 //! in all the views of the visualiser.
222 Standard_EXPORT void UnHighlight();
223
224 Standard_EXPORT virtual void Compute();
225
226 //! Returns the new Structure defined for the new visualization
227 Standard_EXPORT virtual Handle(Graphic3d_Structure) Compute (const Handle(Graphic3d_DataStructureManager)& aProjector);
228
229 //! Returns the new Structure defined for the new visualization
230 Standard_EXPORT virtual Handle(Graphic3d_Structure) Compute (const Handle(Graphic3d_DataStructureManager)& aProjector, const TColStd_Array2OfReal& AMatrix);
231
232 //! Returns the new Structure defined for the new visualization
233 Standard_EXPORT virtual void Compute (const Handle(Graphic3d_DataStructureManager)& aProjector, Handle(Graphic3d_Structure)& aStructure);
234
235 //! Returns the new Structure defined for the new visualization
236 Standard_EXPORT virtual void Compute (const Handle(Graphic3d_DataStructureManager)& aProjector, const TColStd_Array2OfReal& AMatrix, Handle(Graphic3d_Structure)& aStructure);
237
238 //! Forces a new construction of the structure <me>
239 //! if <me> is displayed and TOS_COMPUTED.
240 Standard_EXPORT void ReCompute();
241
242 //! Forces a new construction of the structure <me>
243 //! if <me> is displayed in <aProjetor> and TOS_COMPUTED.
244 Standard_EXPORT void ReCompute (const Handle(Graphic3d_DataStructureManager)& aProjector);
245
246 //! Returns Standard_True if the structure <me> contains
247 //! Polygons, Triangles or Quadrangles.
248 Standard_EXPORT Standard_Boolean ContainsFacet() const;
249
250 //! Returns the values of the current default attributes.
251 Standard_EXPORT Handle(Graphic3d_AspectFillArea3d) FillArea3dAspect() const;
252
253 //! Returns the groups sequence included in the structure <me> (internal storage).
254 Standard_EXPORT const Graphic3d_SequenceOfGroup& Groups() const;
255
256 //! Returns the current number of groups in the
257 //! structure <me>.
258 Standard_EXPORT Standard_Integer NumberOfGroups() const;
259
260 //! Append new group to this structure.
261 Standard_EXPORT Handle(Graphic3d_Group) NewGroup();
262
263 //! Returns the highlight color for the Highlight method
264 //! with the highlight method TOHM_COLOR or TOHM_BOUNDBOX.
265 Standard_EXPORT const Quantity_Color& HighlightColor() const;
266
267 //! Returns Standard_True if the structure <me> is deleted.
268 //! <me> is deleted after the call Remove (me).
269 Standard_EXPORT Standard_Boolean IsDeleted() const;
270
271 //! Returns the display indicator for the structure <me>.
272 Standard_EXPORT virtual Standard_Boolean IsDisplayed() const;
273
274 //! Returns Standard_True if the structure <me> is empty.
275 //! Warning: A structure is empty if :
276 //! it do not have group or all the groups are empties
277 //! and it do not have descendant or all the descendants
278 //! are empties.
279 Standard_EXPORT Standard_Boolean IsEmpty() const;
280
281 //! Returns Standard_True if the structure <me> is infinite.
282 Standard_EXPORT Standard_Boolean IsInfinite() const;
283
284 //! Returns the highlight indicator for the structure <me>.
285 Standard_EXPORT virtual Standard_Boolean IsHighlighted() const;
286
42cf5bc1 287 //! Returns Standard_True if the structure <me> is transformed.
288 //! <=> The transformation != Identity.
289 Standard_EXPORT Standard_Boolean IsTransformed() const;
290
291 //! Returns the visibility indicator for the structure <me>.
292 Standard_EXPORT Standard_Boolean IsVisible() const;
293
294 //! Returns the values of the current default attributes.
295 Standard_EXPORT Handle(Graphic3d_AspectLine3d) Line3dAspect() const;
296
297 //! Returns the current group of graphic attributes used
298 //! for 3d marker primitives.
299 Standard_EXPORT Handle(Graphic3d_AspectMarker3d) Marker3dAspect() const;
300
301 //! Returns the coordinates of the boundary box of the structure <me>.
302 //! If <theToIgnoreInfiniteFlag> is TRUE, the method returns actual graphical
303 //! boundaries of the Graphic3d_Group components. Otherwise, the
304 //! method returns boundaries taking into account infinite state
305 //! of the structure. This approach generally used for application
306 //! specific fit operation (e.g. fitting the model into screen,
307 //! not taking into accout infinite helper elements).
308 //! Warning: If the structure <me> is empty then the empty box is returned,
309 //! If the structure <me> is infinite then the whole box is returned.
310 Standard_EXPORT Bnd_Box MinMaxValues (const Standard_Boolean theToIgnoreInfiniteFlag = Standard_False) const;
311
312 //! Returns the current values of the default attributes.
313 Standard_EXPORT void PrimitivesAspect (Handle(Graphic3d_AspectLine3d)& CTXL, Handle(Graphic3d_AspectText3d)& CTXT, Handle(Graphic3d_AspectMarker3d)& CTXM, Handle(Graphic3d_AspectFillArea3d)& CTXF) const;
314
315 //! Returns the values of the current default attributes.
316 Standard_EXPORT Handle(Graphic3d_AspectText3d) Text3dAspect() const;
317
318 //! Returns the visualisation mode for the structure <me>.
319 Standard_EXPORT Graphic3d_TypeOfStructure Visual() const;
320
321 //! Returns Standard_True if the connection is possible between
322 //! <AStructure1> and <AStructure2> without a creation
323 //! of a cycle.
324 //!
325 //! It's not possible to call the method
326 //! AStructure1->Connect (AStructure2, TypeOfConnection)
327 //! if
328 //! - the set of all ancestors of <AStructure1> contains
329 //! <AStructure1> and if the
330 //! TypeOfConnection == TOC_DESCENDANT
331 //! - the set of all descendants of <AStructure1> contains
332 //! <AStructure2> and if the
333 //! TypeOfConnection == TOC_ANCESTOR
334 Standard_EXPORT static Standard_Boolean AcceptConnection (const Handle(Graphic3d_Structure)& AStructure1, const Handle(Graphic3d_Structure)& AStructure2, const Graphic3d_TypeOfConnection AType);
335
336 //! Returns the group of structures to which <me> is connected.
337 Standard_EXPORT void Ancestors (Graphic3d_MapOfStructure& SG) const;
338
339 //! If Atype is TOC_DESCENDANT then add <AStructure>
340 //! as a child structure of <me>.
341 //! If Atype is TOC_ANCESTOR then add <AStructure>
342 //! as a parent structure of <me>.
343 //! The connection propagates Display, Highlight, Erase,
344 //! Remove, and stacks the transformations.
345 //! No connection if the graph of the structures
346 //! contains a cycle and <WithCheck> is Standard_True;
347 Standard_EXPORT void Connect (const Handle(Graphic3d_Structure)& AStructure, const Graphic3d_TypeOfConnection AType, const Standard_Boolean WithCheck = Standard_False);
348
349 //! Returns the group of structures connected to <me>.
350 Standard_EXPORT void Descendants (Graphic3d_MapOfStructure& SG) const;
351
352 //! Suppress the connection between <AStructure> and <me>.
353 Standard_EXPORT void Disconnect (const Handle(Graphic3d_Structure)& AStructure);
354
355 //! If Atype is TOC_DESCENDANT then suppress all
356 //! the connections with the child structures of <me>.
357 //! If Atype is TOC_ANCESTOR then suppress all
358 //! the connections with the parent structures of <me>.
359 Standard_EXPORT void DisconnectAll (const Graphic3d_TypeOfConnection AType);
360
361 //! Returns <ASet> the group of structures :
362 //! - directly or indirectly connected to <AStructure> if the
363 //! TypeOfConnection == TOC_DESCENDANT
364 //! - to which <AStructure> is directly or indirectly connected
365 //! if the TypeOfConnection == TOC_ANCESTOR
366 Standard_EXPORT static void Network (const Handle(Graphic3d_Structure)& AStructure, const Graphic3d_TypeOfConnection AType, Graphic3d_MapOfStructure& ASet);
367
368 Standard_EXPORT void SetOwner (const Standard_Address Owner);
369
370 Standard_EXPORT Standard_Address Owner() const;
371
372 Standard_EXPORT void SetHLRValidation (const Standard_Boolean AFlag);
373
374 Standard_EXPORT Standard_Boolean HLRValidation() const;
6bd94e0d 375
42cf5bc1 376 //! Modifies the current local modelling transformation
377 //! in the structure <me>.
378 //!
379 //! It is defined as a 4*4 real matrix.
380 //!
381 //! -------------------
382 //! | a11 a12 a13 t1 |
383 //! | a21 a22 a23 t2 |
384 //! | a31 a32 a33 t3 |
385 //! | 0 0 0 1 |
386 //! -------------------
387 //!
388 //! TypeOfComposition : TOC_REPLACE
389 //! TOC_POSTCONCATENATE
390 //!
391 //! Then the modified Local Modelling Transformation is composed
392 //! with the current Global Modelling Transformation to create a
393 //! new Composite Modelling Transformation.
394 //!
395 //! The compose type specifies the role of the current local
396 //! modelling transformation (L) in composing the new value for
397 //! the current local modelling transformation (L'), which is
398 //! then combined with the current global modelling transforma-
399 //! tion (G) to calculate the new composite modelling transfor-
400 //! mation (C).
401 //!
402 //! TOC_REPLACE
403 //! The transformation matrix (T) replaces the value of
404 //! current local modelling transformation (L).
405 //!
406 //! L' <- T
407 //! C <- G x L'
408 //!
409 //! TOC_POSTCONCATENATE
410 //! The current local modelling transformation (L) is multiplied
411 //! by the transformation matrix (T):
412 //!
413 //! L' <- T x L
414 //! C <- G x L'
415 //!
416 //! Category: Methods to manage the structure transformation
417 //! Warning: Raises TransformError if the matrix is not a 4x4 matrix.
418 Standard_EXPORT void SetTransform (const TColStd_Array2OfReal& AMatrix, const Graphic3d_TypeOfComposition AType);
419
420 //! Returns the transformation associated with
421 //! the structure <me>.
422 Standard_EXPORT void Transform (TColStd_Array2OfReal& AMatrix) const;
423
424 //! Modifies the current modelling transform persistence (pan, zoom or rotate)
425 Standard_EXPORT void SetTransformPersistence (const Graphic3d_TransModeFlags& AFlag, const gp_Pnt& APoint);
426
427 Standard_EXPORT void SetTransformPersistence (const Graphic3d_TransModeFlags& AFlag);
428
429 //! Get the current modelling transform persistence (pan, zoom or rotate)
430 Standard_EXPORT Graphic3d_TransModeFlags TransformPersistenceMode() const;
431
432 //! Get the current point of relative modelling transform persistence
433 Standard_EXPORT gp_Pnt TransformPersistencePoint() const;
825aa485 434
435 //! @return transform persistence of the presentable object.
436 const Graphic3d_TransformPers& TransformPersistence() const;
437
42cf5bc1 438 //! Sets if the structure location has mutable nature (content or location will be changed regularly).
439 Standard_EXPORT void SetMutable (const Standard_Boolean theIsMutable);
440
441 //! Returns true if structure has mutable nature (content or location are be changed regularly).
442 //! Mutable structure will be managed in different way than static onces.
443 Standard_EXPORT Standard_Boolean IsMutable() const;
444
445 Standard_EXPORT Graphic3d_TypeOfStructure ComputeVisual() const;
446
447 //! Clears the structure <me>.
448 Standard_EXPORT void GraphicClear (const Standard_Boolean WithDestruction);
449
450 Standard_EXPORT void GraphicConnect (const Handle(Graphic3d_Structure)& ADaughter);
451
452 Standard_EXPORT void GraphicDisconnect (const Handle(Graphic3d_Structure)& ADaughter);
453
454 //! Highlights the structure <me>.
455 Standard_EXPORT void GraphicHighlight (const Aspect_TypeOfHighlightMethod Method);
456
457 Standard_EXPORT void GraphicTransform (const TColStd_Array2OfReal& AMatrix);
458
459 //! Suppress the highlight for the structure <me>.
460 Standard_EXPORT void GraphicUnHighlight();
461
462 //! Returns the identification number of the structure <me>.
463 Standard_EXPORT Standard_Integer Identification() const;
464
465 //! Prints informations about the network associated
466 //! with the structure <AStructure>.
467 Standard_EXPORT static void PrintNetwork (const Handle(Graphic3d_Structure)& AStructure, const Graphic3d_TypeOfConnection AType);
468
469 //! Suppress the adress <APtr> in the list
470 //! of descendants or in the list of ancestors.
471 Standard_EXPORT void Remove (const Standard_Address APtr, const Graphic3d_TypeOfConnection AType);
472
473 Standard_EXPORT void SetComputeVisual (const Graphic3d_TypeOfStructure AVisual);
474
475 //! Transforms <X>, <Y>, <Z> with the transformation <ATrsf>.
476 Standard_EXPORT static void Transforms (const TColStd_Array2OfReal& ATrsf, const Standard_Real X, const Standard_Real Y, const Standard_Real Z, Standard_Real& NewX, Standard_Real& NewY, Standard_Real& NewZ);
477
478 //! Transforms <Coord> with the transformation <ATrsf>.
479 Standard_EXPORT static Graphic3d_Vector Transforms (const TColStd_Array2OfReal& ATrsf, const Graphic3d_Vector& Coord);
480
481 //! Transforms <Coord> with the transformation <ATrsf>.
482 Standard_EXPORT static Graphic3d_Vertex Transforms (const TColStd_Array2OfReal& ATrsf, const Graphic3d_Vertex& Coord);
483
484 //! Returns the low-level structure
485 const Handle(Graphic3d_CStructure)& CStructure() const;
486
487friend class Graphic3d_Group;
488
489
92efcf78 490 DEFINE_STANDARD_RTTIEXT(Graphic3d_Structure,MMgt_TShared)
42cf5bc1 491
492protected:
493
494
495 //! Transforms boundaries with <theTrsf> transformation.
496 Standard_EXPORT static void TransformBoundaries (const TColStd_Array2OfReal& theTrsf, Standard_Real& theXMin, Standard_Real& theYMin, Standard_Real& theZMin, Standard_Real& theXMax, Standard_Real& theYMax, Standard_Real& theZMax);
497
498 //! Appends new descendant structure.
499 Standard_EXPORT Standard_Boolean AppendDescendant (const Standard_Address theDescendant);
500
501 //! Removes the given descendant structure.
502 Standard_EXPORT Standard_Boolean RemoveDescendant (const Standard_Address theDescendant);
503
504 //! Appends new ancestor structure.
505 Standard_EXPORT Standard_Boolean AppendAncestor (const Standard_Address theAncestor);
506
507 //! Removes the given ancestor structure.
508 Standard_EXPORT Standard_Boolean RemoveAncestor (const Standard_Address theAncestor);
509
510 Graphic3d_StructureManagerPtr myStructureManager;
511 Graphic3d_StructureManagerPtr myFirstStructureManager;
512 Graphic3d_TypeOfStructure myComputeVisual;
513
514
515private:
516
517
518 //! Suppress in the structure <me>, the group theGroup.
519 //! It will be erased at the next screen update.
520 Standard_EXPORT void Remove (const Handle(Graphic3d_Group)& theGroup);
521
522 //! Manages the number of groups in the structure <me>
523 //! which contains facet.
524 //! Polygons, Triangles or Quadrangles.
525 //! <ADelta> = +1 or -1
526 Standard_EXPORT void GroupsWithFacet (const Standard_Integer ADelta);
527
528 //! Returns the extreme coordinates found in the structure <me> without transformation applied.
529 Standard_EXPORT Graphic3d_BndBox4f minMaxCoord() const;
530
531 //! Gets untransformed bounding box from structure.
532 Standard_EXPORT void getBox (Graphic3d_BndBox4d& theBox, const Standard_Boolean theToIgnoreInfiniteFlag = Standard_False) const;
533
534 //! Adds transformed (with myCStructure->Transformation) bounding box of structure to theBox.
535 Standard_EXPORT void addTransformed (Graphic3d_BndBox4d& theBox, const Standard_Boolean theToIgnoreInfiniteFlag = Standard_False) const;
536
537 //! Returns the manager to which <me> is associated.
538 Standard_EXPORT Handle(Graphic3d_StructureManager) StructureManager() const;
539
540 //! Calls the Update method of the StructureManager which
541 //! contains the Structure <me>.
542 Standard_EXPORT void Update() const;
543
544 //! Updates the c structure associated to <me>.
545 Standard_EXPORT void UpdateStructure (const Handle(Graphic3d_AspectLine3d)& CTXL, const Handle(Graphic3d_AspectText3d)& CTXT, const Handle(Graphic3d_AspectMarker3d)& CTXM, const Handle(Graphic3d_AspectFillArea3d)& CTXF);
546
547 Handle(Graphic3d_CStructure) myCStructure;
548 Graphic3d_IndexedMapOfAddress myAncestors;
549 Graphic3d_IndexedMapOfAddress myDescendants;
550 Quantity_Color myHighlightColor;
551 Aspect_TypeOfHighlightMethod myHighlightMethod;
552 Standard_Address myOwner;
553 Graphic3d_TypeOfStructure myVisual;
554
555
556};
557
558
559#include <Graphic3d_Structure.lxx>
560
561
562
563
564
565#endif // _Graphic3d_Structure_HeaderFile