Commit | Line | Data |
---|---|---|
b311480e | 1 | -- Created on: 1991-06-12 |
2 | -- Created by: NW,JPB,CAL | |
3 | -- Copyright (c) 1991-1999 Matra Datavision | |
973c2be1 | 4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e | 5 | -- |
973c2be1 | 6 | -- This file is part of Open CASCADE Technology software library. |
b311480e | 7 | -- |
d5f74e42 | 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 | |
973c2be1 | 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. | |
b311480e | 13 | -- |
973c2be1 | 14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. | |
b311480e | 16 | |
7fd59977 | 17 | -- 11/97 ; CAL : gestion du GraphicClear |
18 | -- 11/97 ; CAL : ajout pointer StructPtr | |
19 | -- 11/97 ; CAL : amelioration de l'effacement SetManager | |
20 | -- 01/98 ; CAL : gestion du HLRValidation | |
21 | -- 05/98 ; CAL : gestion du GraphicConnect et Disconnect | |
22 | -- 02/00 ; GG : Made Transform() methode not mutable. | |
23 | -- 31/05/01 ; GG : Add ResetDisplayPriority() method | |
7fd59977 | 24 | |
25 | class Structure from Graphic3d inherits TShared | |
26 | ||
27 | ---Version: | |
28 | ||
29 | ---Purpose: This class allows the definition a graphic object. | |
30 | -- This graphic structure can be displayed, | |
31 | -- erased, or highlighted. | |
32 | -- This graphic structure can be connected with | |
33 | -- another graphic structure. | |
34 | -- Keywords: Structure, StructureManager, Display, Erase, Highlight, | |
35 | -- UnHighlight, Visible, Priority, Selectable, Visible, | |
36 | -- Visual, Connection, Ancestors, Descendants, Transformation | |
37 | ||
38 | ---Warning: | |
39 | ---References: | |
40 | ||
41 | uses | |
42 | ||
43 | Array2OfReal from TColStd, | |
44 | SequenceOfAddress from TColStd, | |
45 | ||
46 | Color from Quantity, | |
47 | ||
48 | GenId from Aspect, | |
49 | TypeOfHighlightMethod from Aspect, | |
50 | ||
51 | DataStructureManager from Graphic3d, | |
52 | AspectFillArea3d from Graphic3d, | |
53 | AspectLine3d from Graphic3d, | |
54 | AspectMarker3d from Graphic3d, | |
55 | AspectText3d from Graphic3d, | |
63bcc448 | 56 | CStructure from Graphic3d, |
57 | CStructure_Handle from Graphic3d, | |
7fd59977 | 58 | GraphicDriver from Graphic3d, |
59 | Group from Graphic3d, | |
60 | SequenceOfGroup from Graphic3d, | |
61 | HSequenceOfGroup from Graphic3d, | |
62 | SequenceOfStructure from Graphic3d, | |
63 | HSequenceOfStructure from Graphic3d, | |
7fd59977 | 64 | MapOfStructure from Graphic3d, |
65 | Plotter from Graphic3d, | |
66 | StructureManager from Graphic3d, | |
63bcc448 | 67 | StructureManagerPtr from Graphic3d, |
7fd59977 | 68 | TypeOfComposition from Graphic3d, |
69 | TypeOfConnection from Graphic3d, | |
70 | TypeOfPrimitive from Graphic3d, | |
71 | TypeOfStructure from Graphic3d, | |
72 | Vector from Graphic3d, | |
7fd59977 | 73 | Vertex from Graphic3d, |
b8ddfc2f | 74 | TransModeFlags from Graphic3d, |
4269bd1b | 75 | Pnt from gp, |
51b10cd4 | 76 | SequenceOfHClipPlane from Graphic3d |
7fd59977 | 77 | |
78 | raises | |
79 | ||
80 | PriorityDefinitionError from Graphic3d, | |
81 | StructureDefinitionError from Graphic3d, | |
82 | TransformError from Graphic3d | |
83 | ||
84 | is | |
85 | ||
86 | ------------------------ | |
87 | -- Category: Constructor | |
88 | ------------------------ | |
89 | ||
90 | Create ( AManager : StructureManager from Graphic3d ) | |
91 | returns mutable Structure from Graphic3d; | |
92 | ---Level: Public | |
93 | ---Purpose: Creates a graphic object in the manager <AManager>. | |
94 | -- It will appear in all the views of the visualiser. | |
95 | -- Warning: The default values AspectLine, AspectFillArea, | |
96 | -- AspectText and AspectMarker are NOT applied to the | |
97 | -- structure. | |
98 | -- The structure is not displayed when it is created. | |
99 | ||
100 | --------------------------------------------------- | |
101 | -- Category: Methods to modify the class definition | |
102 | --------------------------------------------------- | |
103 | ||
104 | -------------------------------------------------------- | |
105 | -- Summary of Display Priorities -- | |
106 | -- -- | |
107 | -- Structure display priorities control the order in -- | |
108 | -- which structures are redrawn. -- | |
109 | -- -- | |
110 | -- When you display a structure, you specify its -- | |
111 | -- priority. The lower the value, the lower the -- | |
112 | -- display priority. When the display is regenerated, -- | |
113 | -- the structures with the lowest priority are drawn -- | |
114 | -- first. -- | |
115 | -- For structures with the same display priority, -- | |
116 | -- the order in which they were displayed determines -- | |
117 | -- determines the drawing order. -- | |
118 | -- -- | |
119 | -- CAS.CADE supports 11 structure display priorities, -- | |
120 | -- 0 to 10. -- | |
121 | -------------------------------------------------------- | |
122 | ||
123 | Clear ( me : mutable; | |
124 | WithDestruction : Boolean from Standard = Standard_True ) | |
125 | is virtual; | |
126 | ---Level: Public | |
127 | ---Purpose: if WithDestruction == Standard_True then | |
128 | -- suppress all the groups of primitives in the structure. | |
129 | -- and it is mandatory to create a new group in <me>. | |
130 | -- if WithDestruction == Standard_False then | |
131 | -- clears all the groups of primitives in the structure. | |
132 | -- and all the groups are conserved and empty. | |
133 | -- They will be erased at the next screen update. | |
134 | -- The structure itself is conserved. | |
135 | -- The transformation and the attributes of <me> are conserved. | |
136 | -- The childs of <me> are conserved. | |
137 | ---Category: Methods to modify the class definition | |
138 | ||
139 | Destroy ( me : mutable ) | |
140 | is virtual; | |
141 | ---Level: Public | |
142 | ---Purpose: Suppresses the structure <me>. | |
143 | -- It will be erased at the next screen update. | |
144 | ---Category: Methods to modify the class definition | |
145 | ---C++: alias ~ | |
146 | ||
147 | Display ( me : mutable ) | |
148 | is virtual; | |
149 | ---Level: Public | |
150 | ---Purpose: Displays the structure <me> in all the views of | |
151 | -- the visualiser. | |
152 | ---Category: Methods to modify the class definition | |
153 | ||
154 | Display ( me : mutable; | |
155 | Priority : Integer from Standard ) | |
156 | ---Level: Public | |
157 | ---Purpose: Displays the structure <me> in all the views of | |
158 | -- the visualiser, while modifying its current priority. | |
159 | -- Note: Display Priorities | |
160 | -- Structure display priorities control the order in which | |
161 | -- structures are redrawn. When you display a | |
162 | -- structure, you specify its priority. The lower the value, | |
163 | -- the lower the display priority. When the display is | |
164 | -- regenerated, the structures with the lowest priority | |
165 | -- are drawn first. For structures with the same display | |
166 | -- priority, the order in which they were displayed | |
167 | -- determines the drawing order. Open CASCADE | |
168 | -- supports 11 structure display priorities, 0 to 10. | |
169 | -- Warning: Raises PriorityDefinitionError if <Priority> is | |
170 | -- greater than 10 or a negative value. | |
171 | raises PriorityDefinitionError from Graphic3d is static; | |
172 | ||
173 | DisplayPriority ( me ) | |
174 | returns Integer from Standard | |
175 | is static; | |
176 | ---Level: Public | |
177 | ---Purpose: Returns the current display priority for the | |
178 | -- structure <me>. | |
179 | ---Category: Methods to modify the class definition | |
180 | ||
181 | Erase ( me : mutable ) | |
182 | is virtual; | |
183 | ---Level: Public | |
184 | ---Purpose: Erases the structure <me> in all the views | |
185 | -- of the visualiser. | |
186 | ---Category: Methods to modify the class definition | |
187 | ||
188 | Highlight ( me : mutable; | |
189 | Method : TypeOfHighlightMethod from Aspect ) | |
190 | is static; | |
191 | ---Level: Public | |
192 | ---Purpose: Highlights the structure <me> in all the | |
193 | -- views of the visualiser, using the following methods: | |
194 | -- | |
195 | -- TOHM_COLOR = drawn in the highlight color | |
196 | -- (default white) | |
197 | -- TOHM_BLINK = blinking | |
198 | -- TOHM_BOUNDBOX = enclosed by the boundary box | |
199 | -- (default white) | |
200 | -- | |
201 | ---Category: Methods to modify the class definition | |
202 | ||
203 | Remove ( me : mutable ) | |
204 | is static; | |
205 | ---Level: Public | |
206 | ---Purpose: Suppress the structure <me>. | |
207 | -- It will be erased at the next screen update. | |
208 | -- Warning: No more graphic operations in <me> after this call. | |
209 | -- Category: Methods to modify the class definition | |
210 | ||
211 | SetHighlightColor ( me : mutable; | |
212 | AColor : Color from Quantity ) | |
213 | is static; | |
214 | ---Level: Public | |
215 | ---Purpose: Modifies the highlight color for the Highlight method | |
216 | -- with the highlight method TOHM_COLOR or TOHM_BOUNDBOX. | |
217 | ---Category: Methods to modify the class definition | |
218 | ||
197ac94e | 219 | SetInfiniteState (me : mutable; theToSet : Boolean from Standard) is static; |
220 | ---Level: Internal | |
221 | ---Purpose: If <theToSet> is Standard_True then <me> is infinite and | |
222 | -- the MinMaxValues method method return : | |
223 | -- theXMin = theYMin = theZMin = RealFirst(). | |
224 | -- theXMax = theYMax = theZMax = RealLast(). | |
225 | -- By default, <me> is not infinite but empty. | |
226 | ---Category: Methods to modify the class definition | |
7fd59977 | 227 | |
228 | SetDisplayPriority ( me : mutable; | |
229 | Priority : Integer from Standard ) | |
230 | ---Level: Public | |
231 | ---Purpose: Modifies the order of displaying the structure. | |
9edc5e12 | 232 | -- Values are between 0 and 10. |
b8ddfc2f | 233 | -- Structures are drawn according to their display priorities |
234 | -- in ascending order. | |
9edc5e12 | 235 | -- A structure of priority 10 is displayed the last and appears over the others. |
236 | -- The default value is 5. | |
7fd59977 | 237 | -- Category: Methods to modify the class definition |
238 | -- Warning: If <me> is displayed then the SetDisplayPriority | |
239 | -- method erase <me> and display <me> with the | |
240 | -- new priority. | |
241 | -- Raises PriorityDefinitionError if <Priority> is | |
242 | -- greater than 10 or a negative value. | |
243 | raises PriorityDefinitionError from Graphic3d is static; | |
244 | ||
245 | ResetDisplayPriority ( me : mutable) | |
246 | is static; | |
247 | ---Level: Public | |
bbf32d01 | 248 | ---Purpose: Reset the current priority of the structure to the |
7fd59977 | 249 | -- previous priority. |
250 | -- Category: Methods to modify the class definition | |
251 | -- Warning: If <me> is displayed then the SetDisplayPriority | |
252 | -- method erase <me> and display <me> with the | |
253 | -- previous priority. | |
59f45b7c | 254 | |
255 | SetZLayer ( me : mutable; | |
256 | theLayerId : Integer from Standard ) | |
257 | is static; | |
258 | ---Purpose: Set Z layer ID for the structure. The Z layer mechanism | |
259 | -- allows to display structures presented in higher layers in overlay | |
260 | -- of structures in lower layers by switching off z buffer depth | |
261 | -- test between layers | |
262 | ||
263 | GetZLayer ( me ) | |
264 | returns Integer from Standard is static; | |
265 | ---Purpose: Get Z layer ID of displayed structure. The method | |
266 | -- returns -1 if the structure has no ID (deleted from graphic driver). | |
7fd59977 | 267 | |
51b10cd4 | 268 | SetClipPlanes (me : mutable; thePlanes : SequenceOfHClipPlane from Graphic3d) is static; |
269 | ---Purpose: Changes a sequence of clip planes slicing the structure on rendering. | |
4269bd1b | 270 | -- @param thePlanes [in] the set of clip planes. |
271 | ||
51b10cd4 | 272 | GetClipPlanes (me) returns SequenceOfHClipPlane from Graphic3d; |
4269bd1b | 273 | ---C++: return const& |
274 | ---Purpose: Get clip planes slicing the structure on rendering. | |
275 | -- @return set of clip planes. | |
276 | ||
7fd59977 | 277 | SetPick ( me : mutable; |
278 | AValue : Boolean from Standard ) | |
279 | is static; | |
280 | ---Level: Public | |
281 | ---Purpose: Modifies the detectability indicator to Standard_True | |
282 | -- or Standard_False for the structure <me>. | |
283 | -- The default value at the definition of <me> is | |
284 | -- Standard_True. | |
285 | ---Category: Methods to modify the class definition | |
286 | ||
287 | SetPrimitivesAspect ( me : mutable; | |
288 | CTX : AspectLine3d from Graphic3d ) | |
289 | is static; | |
290 | ---Level: Public | |
291 | ---Purpose: Modifies the default attributes for lines | |
292 | -- in the structure <me>. | |
293 | ---Category: Methods to modify the class definition | |
294 | ||
295 | SetPrimitivesAspect ( me : mutable; | |
296 | CTX : AspectFillArea3d from Graphic3d ) | |
297 | is static; | |
298 | ---Level: Public | |
299 | ---Purpose: Modifies the default attributes for faces | |
300 | -- in the structure <me>. | |
301 | ---Category: Methods to modify the class definition | |
302 | ||
303 | SetPrimitivesAspect ( me : mutable; | |
304 | CTX : AspectText3d from Graphic3d ) | |
305 | is static; | |
306 | ---Level: Public | |
307 | ---Purpose: Modifies the default attributes for text | |
308 | -- in the structure <me>. | |
309 | ---Category: Methods to modify the class definition | |
310 | ||
311 | SetPrimitivesAspect ( me : mutable; | |
312 | CTX : AspectMarker3d from Graphic3d ) | |
313 | is static; | |
314 | ---Level: Public | |
315 | ---Purpose: Modifies the default attributes for markers | |
316 | -- in the structure <me>. | |
317 | ---Category: Methods to modify the class definition | |
318 | ||
319 | SetVisible ( me : mutable; | |
320 | AValue : Boolean from Standard ) | |
321 | is static; | |
322 | ---Level: Public | |
323 | ---Purpose: Modifies the visibility indicator to Standard_True or | |
324 | -- Standard_False for the structure <me>. | |
325 | -- The default value at the definition of <me> is | |
326 | -- Standard_True. | |
327 | ---Category: Methods to modify the class definition | |
328 | ||
7fd59977 | 329 | SetVisual ( me : mutable; |
330 | AVisual : TypeOfStructure from Graphic3d ) | |
331 | is virtual; | |
332 | ---Level: Public | |
333 | ---Purpose: Modifies the visualisation mode for the structure <me>. | |
334 | ---Warning: It is not possible to display a structure with | |
335 | -- an incompatible display mode. | |
336 | -- If the display mode is different from the current one, | |
337 | -- the structure is erased. | |
338 | -- | |
339 | -- TOS_WIREFRAME for a wireframe visualisation | |
340 | -- TOS_SHADING for a shaded visualisation | |
341 | -- TOS_ALL for all visualisations | |
342 | -- TOS_COMPUTED for a computed visualisation | |
343 | -- The default value is TOS_ALL | |
344 | -- | |
345 | ---Category: Methods to modify the class definition | |
346 | ||
347 | SetZoomLimit ( me : mutable; | |
348 | LimitInf, LimitSup : Real from Standard ) | |
349 | ---Level: Internal | |
350 | ---Purpose: Modifies the minimum and maximum zoom coefficients | |
351 | -- for the structure <me>. | |
352 | -- The default value at the definition of <me> is unlimited. | |
353 | -- Category: Methods to modify the class definition | |
354 | -- Warning: Raises StructureDefinitionError if <LimitInf> is | |
355 | -- greater than <LimitSup> or if <LimitInf> or | |
356 | -- <LimitSup> is a negative value. | |
357 | raises StructureDefinitionError from Graphic3d is static; | |
358 | ||
359 | UnHighlight ( me : mutable ) | |
360 | is static; | |
361 | ---Level: Public | |
362 | ---Purpose: Suppresses the highlight for the structure <me> | |
363 | -- in all the views of the visualiser. | |
364 | ---Category: Methods to modify the class definition | |
365 | ||
366 | ---------------------------- | |
367 | -- Category: Compute methods | |
368 | ---------------------------- | |
369 | ||
eb4320f2 | 370 | Compute (me: mutable) |
371 | is virtual; | |
372 | ---Level: Advanced | |
373 | ---Category: Methods to modify the class definition | |
374 | ||
7fd59977 | 375 | Compute ( me : mutable; |
376 | aProjector : DataStructureManager from Graphic3d ) | |
377 | returns Structure from Graphic3d is virtual; | |
378 | ---Level: Advanced | |
379 | ---Purpose: Returns the new Structure defined for the new visualization | |
380 | ---Category: Methods to modify the class definition | |
381 | ||
382 | Compute ( me : mutable; | |
383 | aProjector : DataStructureManager from Graphic3d; | |
384 | AMatrix : Array2OfReal from TColStd ) | |
385 | returns Structure from Graphic3d is virtual; | |
386 | ---Level: Advanced | |
387 | ---Purpose: Returns the new Structure defined for the new visualization | |
388 | ---Category: Methods to modify the class definition | |
389 | ||
390 | Compute ( me : mutable; | |
391 | aProjector : DataStructureManager from Graphic3d; | |
392 | aStructure : in out Structure from Graphic3d ) | |
393 | is virtual; | |
394 | ---Level: Advanced | |
395 | ---Purpose: Returns the new Structure defined for the new visualization | |
396 | ---Category: Methods to modify the class definition | |
397 | ||
398 | Compute ( me : mutable; | |
399 | aProjector : DataStructureManager from Graphic3d; | |
400 | AMatrix : Array2OfReal from TColStd; | |
401 | aStructure : in out Structure from Graphic3d ) | |
402 | is virtual; | |
403 | ---Level: Advanced | |
404 | ---Purpose: Returns the new Structure defined for the new visualization | |
405 | ---Category: Methods to modify the class definition | |
406 | ||
407 | ReCompute ( me : mutable ); | |
408 | ---Level: Advanced | |
409 | ---Purpose: Forces a new construction of the structure <me> | |
410 | -- if <me> is displayed and TOS_COMPUTED. | |
411 | ---Category: Methods to modify the class definition | |
412 | ||
413 | ReCompute ( me : mutable; | |
414 | aProjector : DataStructureManager from Graphic3d ); | |
415 | ---Level: Advanced | |
416 | ---Purpose: Forces a new construction of the structure <me> | |
417 | -- if <me> is displayed in <aProjetor> and TOS_COMPUTED. | |
418 | ---Category: Methods to modify the class definition | |
419 | ||
420 | ---------------------------- | |
421 | -- Category: Inquire methods | |
422 | ---------------------------- | |
423 | ||
424 | ContainsFacet ( me ) | |
425 | returns Boolean from Standard | |
426 | is static; | |
427 | ---Level: Public | |
428 | ---Purpose: Returns Standard_True if the structure <me> contains | |
429 | -- Polygons, Triangles or Quadrangles. | |
430 | ---Category: Inquire methods | |
431 | ||
8ca7beb8 | 432 | |
7fd59977 | 433 | FillArea3dAspect ( me ) |
434 | returns AspectFillArea3d from Graphic3d | |
435 | is static; | |
436 | ---Level: Public | |
437 | ---Purpose: Returns the values of the current default attributes. | |
438 | ---Category: Inquire methods | |
439 | ||
440 | Groups ( me ) | |
bbf32d01 | 441 | returns SequenceOfGroup from Graphic3d |
7fd59977 | 442 | is static; |
bbf32d01 | 443 | ---C++: return const & |
7fd59977 | 444 | ---Level: Internal |
bbf32d01 | 445 | ---Purpose: Returns the groups sequence included in the structure <me> (internal storage). |
7fd59977 | 446 | ---Category: Inquire methods |
447 | ||
448 | NumberOfGroups ( me ) | |
449 | returns Integer from Standard | |
450 | is static; | |
451 | ---Level: Public | |
452 | ---Purpose: Returns the current number of groups in the | |
453 | -- structure <me>. | |
454 | ---Category: Inquire methods | |
455 | ||
456 | HighlightColor ( me ) | |
457 | returns Color from Quantity | |
458 | is static; | |
63bcc448 | 459 | ---C++: return const& |
7fd59977 | 460 | ---Level: Public |
461 | ---Purpose: Returns the highlight color for the Highlight method | |
462 | -- with the highlight method TOHM_COLOR or TOHM_BOUNDBOX. | |
463 | ---Category: Inquire methods | |
464 | ||
465 | IsDeleted ( me ) | |
466 | returns Boolean from Standard | |
467 | is static; | |
468 | ---Level: Public | |
469 | ---Purpose: Returns Standard_True if the structure <me> is deleted. | |
470 | -- <me> is deleted after the call Remove (me). | |
471 | ---Category: Inquire methods | |
472 | ||
473 | IsDisplayed ( me ) | |
474 | returns Boolean from Standard | |
475 | is virtual; | |
476 | ---Level: Public | |
477 | ---Purpose: Returns the display indicator for the structure <me>. | |
478 | ---Category: Inquire methods | |
479 | ||
480 | IsEmpty ( me ) | |
481 | returns Boolean from Standard | |
482 | is static; | |
483 | ---Level: Public | |
484 | ---Purpose: Returns Standard_True if the structure <me> is empty. | |
485 | -- Warning: A structure is empty if : | |
486 | -- it do not have group or all the groups are empties | |
487 | -- and it do not have descendant or all the descendants | |
488 | -- are empties. | |
489 | ---Category: Inquire methods | |
490 | ||
491 | IsInfinite ( me ) | |
492 | returns Boolean from Standard | |
493 | is static; | |
494 | ---Level: Internal | |
495 | ---Purpose: Returns Standard_True if the structure <me> is infinite. | |
496 | ---Category: Inquire methods | |
497 | ||
498 | IsHighlighted ( me ) | |
499 | returns Boolean from Standard | |
500 | is virtual; | |
501 | ---Level: Public | |
502 | ---Purpose: Returns the highlight indicator for the structure <me>. | |
503 | ---Category: Inquire methods | |
504 | ||
505 | IsSelectable ( me ) | |
506 | returns Boolean from Standard | |
507 | is static; | |
508 | ---Level: Public | |
509 | ---Purpose: Returns the detectability indicator for the structure <me>. | |
510 | ---Category: Inquire methods | |
511 | ||
512 | IsRotated ( me ) | |
513 | returns Boolean from Standard | |
514 | is static; | |
515 | ---Level: Public | |
516 | ---Purpose: Returns Standard_True if the structure <me> is rotated. | |
517 | -- <=> The transformation != Identity, != Scale, != Translation. | |
518 | ---Category: Inquire methods | |
519 | ||
520 | IsTransformed ( me ) | |
521 | returns Boolean from Standard | |
522 | is static; | |
523 | ---Level: Public | |
524 | ---Purpose: Returns Standard_True if the structure <me> is transformed. | |
525 | -- <=> The transformation != Identity. | |
526 | ---Category: Inquire methods | |
527 | ||
528 | IsVisible ( me ) | |
529 | returns Boolean from Standard | |
530 | is static; | |
531 | ---Level: Public | |
532 | ---Purpose: Returns the visibility indicator for the structure <me>. | |
533 | ---Category: Inquire methods | |
534 | ||
535 | Line3dAspect ( me ) | |
536 | returns AspectLine3d from Graphic3d | |
537 | is static; | |
538 | ---Level: Public | |
539 | ---Purpose: Returns the values of the current default attributes. | |
540 | ---Category: Inquire methods | |
541 | ||
542 | Marker3dAspect ( me ) | |
543 | returns AspectMarker3d from Graphic3d | |
544 | is static; | |
545 | ---Purpose: Returns the current group of graphic attributes used | |
546 | -- for 3d marker primitives. | |
547 | ||
197ac94e | 548 | MinMaxValues (me; |
549 | theXMin, theYMin, theZMin : out Real from Standard; | |
550 | theXMax, theYMax, theZMax : out Real from Standard; | |
551 | theToIgnoreInfiniteFlag : Boolean from Standard = Standard_False) | |
552 | is static; | |
553 | ---Level: Public | |
554 | ---Purpose: Returns the coordinates of the boundary box of the structure <me>. | |
555 | -- If <theToIgnoreInfiniteFlag> is TRUE, the method returns actual graphical | |
556 | -- boundaries of the Graphic3d_Group components. Otherwise, the | |
557 | -- method returns boundaries taking into account infinite state | |
558 | -- of the structure. This approach generally used for application | |
559 | -- specific fit operation (e.g. fitting the model into screen, | |
560 | -- not taking into accout infinite helper elements). | |
561 | -- Warning: If the structure <me> is empty or infinite then : | |
562 | -- theXMin = theYMin = theZMin = RealFirst (). | |
563 | -- theXMax = theYMax = theZMax = RealLast (). | |
564 | ---Category: Inquire methods | |
7fd59977 | 565 | |
566 | PrimitivesAspect ( me; | |
567 | CTXL : out AspectLine3d from Graphic3d; | |
568 | CTXT : out AspectText3d from Graphic3d; | |
569 | CTXM : out AspectMarker3d from Graphic3d; | |
570 | CTXF : out AspectFillArea3d from Graphic3d ) | |
571 | is static; | |
572 | ---Level: Public | |
573 | ---Purpose: Returns the current values of the default attributes. | |
574 | ---Category: Inquire methods | |
575 | ||
576 | Text3dAspect ( me ) | |
577 | returns AspectText3d from Graphic3d | |
578 | is static; | |
579 | ---Level: Public | |
580 | ---Purpose: Returns the values of the current default attributes. | |
581 | ---Category: Inquire methods | |
582 | ||
7fd59977 | 583 | Visual ( me ) |
584 | returns TypeOfStructure from Graphic3d | |
585 | is static; | |
586 | ---Level: Public | |
587 | ---Purpose: Returns the visualisation mode for the structure <me>. | |
588 | ---Category: Inquire methods | |
589 | ||
590 | ---------------------------------------------------- | |
591 | -- Category: Methods to manage the structure network | |
592 | ---------------------------------------------------- | |
593 | ||
594 | ----------------------------------------------------- | |
595 | -- Summary of Structure Hierarchies -- | |
596 | -- -- | |
597 | -- The root is the top of a structure hierarchy -- | |
598 | -- or structure network. -- | |
599 | -- -- | |
600 | -- The attributes of a parent structure are passed -- | |
601 | -- passed to its descendants. -- | |
602 | -- -- | |
603 | -- The attributes of the descendant structures -- | |
604 | -- don't affect the parent. -- | |
605 | -- -- | |
606 | -- Recursive structure networks are not supported. -- | |
607 | ----------------------------------------------------- | |
608 | ||
609 | AcceptConnection ( myclass; | |
610 | AStructure1 : Structure from Graphic3d; | |
611 | AStructure2 : Structure from Graphic3d; | |
612 | AType : TypeOfConnection from Graphic3d ) | |
613 | returns Boolean from Standard; | |
614 | ---Level: Internal | |
615 | ---Purpose: Returns Standard_True if the connection is possible between | |
616 | -- <AStructure1> and <AStructure2> without a creation | |
617 | -- of a cycle. | |
618 | -- | |
619 | -- It's not possible to call the method | |
620 | -- AStructure1->Connect (AStructure2, TypeOfConnection) | |
621 | -- if | |
622 | -- - the set of all ancestors of <AStructure1> contains | |
623 | -- <AStructure1> and if the | |
624 | -- TypeOfConnection == TOC_DESCENDANT | |
625 | -- - the set of all descendants of <AStructure1> contains | |
626 | -- <AStructure2> and if the | |
627 | -- TypeOfConnection == TOC_ANCESTOR | |
628 | ---Category: Methods to manage the structure network | |
629 | ||
630 | Ancestors ( me; SG: in out MapOfStructure from Graphic3d ) | |
631 | is static; | |
632 | ---Level: Internal | |
633 | ---Purpose: Returns the group of structures to which <me> is connected. | |
634 | ---Category: Methods to manage the structure network | |
635 | ||
636 | Connect ( me : mutable; | |
637 | AStructure : Structure from Graphic3d; | |
638 | AType : TypeOfConnection from Graphic3d; | |
639 | WithCheck : Boolean from Standard = Standard_False ); | |
640 | ---Level: Public | |
641 | ---Purpose: If Atype is TOC_DESCENDANT then add <AStructure> | |
642 | -- as a child structure of <me>. | |
643 | -- If Atype is TOC_ANCESTOR then add <AStructure> | |
644 | -- as a parent structure of <me>. | |
645 | -- The connection propagates Display, Highlight, Erase, | |
646 | -- Remove, and stacks the transformations. | |
647 | -- No connection if the graph of the structures | |
648 | -- contains a cycle and <WithCheck> is Standard_True; | |
649 | ---Category: Methods to manage the structure network | |
650 | ||
651 | Descendants ( me; SG : in out MapOfStructure from Graphic3d ) | |
652 | is static; | |
653 | ---Level: Internal | |
654 | ---Purpose: Returns the group of structures connected to <me>. | |
655 | ---Category: Methods to manage the structure network | |
656 | ||
657 | Disconnect ( me : mutable; | |
658 | AStructure : Structure from Graphic3d ) | |
659 | is static; | |
660 | ---Level: Public | |
661 | ---Purpose: Suppress the connection between <AStructure> and <me>. | |
662 | ---Category: Methods to manage the structure network | |
663 | ||
664 | DisconnectAll ( me : mutable; | |
665 | AType : TypeOfConnection from Graphic3d ) | |
666 | is static; | |
667 | ---Level: Public | |
668 | ---Purpose: If Atype is TOC_DESCENDANT then suppress all | |
669 | -- the connections with the child structures of <me>. | |
670 | -- If Atype is TOC_ANCESTOR then suppress all | |
671 | -- the connections with the parent structures of <me>. | |
672 | ---Category: Methods to manage the structure network | |
673 | ||
674 | Network ( myclass; | |
675 | AStructure : Structure from Graphic3d; | |
676 | AType : TypeOfConnection from Graphic3d; | |
677 | ASet : in out MapOfStructure from Graphic3d ); | |
678 | ---Level: Internal | |
679 | ---Purpose: Returns <ASet> the group of structures : | |
680 | -- - directly or indirectly connected to <AStructure> if the | |
681 | -- TypeOfConnection == TOC_DESCENDANT | |
682 | -- - to which <AStructure> is directly or indirectly connected | |
683 | -- if the TypeOfConnection == TOC_ANCESTOR | |
684 | ---Category: Methods to manage the structure network | |
685 | ||
686 | SetOwner ( me : mutable; | |
687 | Owner : Address from Standard ) | |
688 | is static; | |
689 | ---Level: Advanced | |
690 | ||
691 | Owner ( me ) | |
692 | returns Address from Standard | |
693 | is static; | |
694 | ---Level: Advanced | |
695 | ||
696 | SetHLRValidation ( me : mutable; | |
697 | AFlag : Boolean from Standard ) | |
698 | is static; | |
699 | ---Level: Advanced | |
700 | ||
701 | HLRValidation ( me ) | |
702 | returns Boolean from Standard | |
703 | is static; | |
704 | ---Level: Advanced | |
705 | ||
706 | ----------------------------------------------------------- | |
707 | -- Category: Methods to manage the structure transformation | |
708 | ----------------------------------------------------------- | |
709 | ||
710 | Composition ( me ) | |
711 | returns TypeOfComposition from Graphic3d | |
712 | is static; | |
713 | ---Level: Public | |
714 | ---Purpose: Returns the type of composition applied to matrices | |
715 | -- of transformation of <me>. | |
716 | ---Category: Methods to manage the structure transformation | |
717 | ||
718 | SetTransform ( me : mutable; | |
719 | AMatrix : Array2OfReal from TColStd; | |
720 | AType : TypeOfComposition from Graphic3d ) | |
721 | ---Level: Public | |
722 | ---Purpose: Modifies the current local modelling transformation | |
723 | -- in the structure <me>. | |
724 | -- | |
725 | -- It is defined as a 4*4 real matrix. | |
726 | -- | |
727 | -- ------------------- | |
728 | -- | a11 a12 a13 t1 | | |
729 | -- | a21 a22 a23 t2 | | |
730 | -- | a31 a32 a33 t3 | | |
731 | -- | 0 0 0 1 | | |
732 | -- ------------------- | |
733 | -- | |
734 | -- TypeOfComposition : TOC_REPLACE | |
735 | -- TOC_POSTCONCATENATE | |
736 | -- | |
737 | -- Then the modified Local Modelling Transformation is composed | |
738 | -- with the current Global Modelling Transformation to create a | |
739 | -- new Composite Modelling Transformation. | |
740 | -- | |
741 | -- The compose type specifies the role of the current local | |
742 | -- modelling transformation (L) in composing the new value for | |
743 | -- the current local modelling transformation (L'), which is | |
744 | -- then combined with the current global modelling transforma- | |
745 | -- tion (G) to calculate the new composite modelling transfor- | |
746 | -- mation (C). | |
747 | -- | |
748 | -- TOC_REPLACE | |
749 | -- The transformation matrix (T) replaces the value of | |
750 | -- current local modelling transformation (L). | |
751 | -- | |
752 | -- L' <- T | |
753 | -- C <- G x L' | |
754 | -- | |
755 | -- TOC_POSTCONCATENATE | |
756 | -- The current local modelling transformation (L) is multiplied | |
757 | -- by the transformation matrix (T): | |
758 | -- | |
759 | -- L' <- T x L | |
760 | -- C <- G x L' | |
761 | -- | |
762 | -- Category: Methods to manage the structure transformation | |
763 | -- Warning: Raises TransformError if the matrix is not a 4x4 matrix. | |
764 | raises TransformError from Graphic3d is static; | |
765 | ||
766 | -- Transform ( me : mutable; | |
767 | Transform ( me; | |
768 | AMatrix : in out Array2OfReal from TColStd ) | |
769 | is static; | |
770 | ---Level: Public | |
771 | ---Purpose: Returns the transformation associated with | |
772 | -- the structure <me>. | |
bbf32d01 K |
773 | ---Category: Methods to manage the structure transformation |
774 | ||
7fd59977 | 775 | SetTransformPersistence( me : mutable; |
bbf32d01 | 776 | AFlag : TransModeFlags from Graphic3d; |
7fd59977 | 777 | APoint : Pnt from gp ) |
778 | ---Level: Public | |
779 | ---Purpose: Modifies the current modelling transform persistence (pan, zoom or rotate) | |
780 | is static; | |
781 | ||
bbf32d01 | 782 | SetTransformPersistence( me : mutable; |
7fd59977 | 783 | AFlag : TransModeFlags from Graphic3d ) |
784 | -- Calls previous method with point (0,0,0) | |
785 | is static; | |
bbf32d01 | 786 | |
7fd59977 | 787 | |
788 | TransformPersistenceMode( me ) | |
789 | returns TransModeFlags from Graphic3d | |
790 | ---Level: Public | |
791 | ---Purpose: Get the current modelling transform persistence (pan, zoom or rotate) | |
bbf32d01 K |
792 | is static; |
793 | ||
7fd59977 | 794 | TransformPersistencePoint( me ) |
795 | returns Pnt from gp | |
796 | ---Level: Public | |
797 | ---Purpose: Get the current point of relative modelling transform persistence | |
798 | is static; | |
799 | ||
800 | ---------------------------- | |
801 | -- Category: Private methods | |
802 | ---------------------------- | |
803 | ||
804 | Add ( me : mutable; | |
805 | AGroup : Group from Graphic3d ) | |
806 | is static private; | |
807 | ---Level: Internal | |
808 | ---Purpose: Inserts in the structure <me>, the group <G>. | |
809 | -- It will be erased at the next screen update. | |
810 | ---Category: Private methods | |
811 | ||
812 | ComputeVisual ( me ) | |
813 | returns TypeOfStructure from Graphic3d | |
814 | is static; | |
815 | ---Level: Internal | |
816 | ---Category: Private methods | |
817 | ||
818 | GroupsWithFacet ( me : mutable; | |
819 | ADelta : Integer from Standard ) | |
820 | is static private; | |
821 | ---Level: Internal | |
822 | ---Purpose: Manages the number of groups in the structure <me> | |
823 | -- which contains facet. | |
824 | -- Polygons, Triangles or Quadrangles. | |
825 | -- <ADelta> = +1 or -1 | |
826 | ---Category: Private methods | |
827 | ||
7fd59977 | 828 | GraphicClear ( me : mutable; |
829 | WithDestruction : Boolean from Standard ) | |
830 | is static; | |
831 | ---Level: Internal | |
832 | ---Purpose: Clears the structure <me>. | |
833 | ---Category: Private methods | |
834 | ||
835 | GraphicConnect ( me : mutable; | |
836 | ADaughter : Structure from Graphic3d ) | |
837 | is static; | |
838 | ---Level: Internal | |
839 | ---Purpose: | |
840 | ---Category: Private methods | |
841 | ||
842 | GraphicDisconnect ( me : mutable; | |
843 | ADaughter : Structure from Graphic3d ) | |
844 | is static; | |
845 | ---Level: Internal | |
846 | ---Purpose: | |
847 | ---Category: Private methods | |
848 | ||
849 | GraphicHighlight ( me : mutable; | |
850 | Method : TypeOfHighlightMethod from Aspect ) | |
851 | is static; | |
852 | ---Level: Internal | |
853 | ---Purpose: Highlights the structure <me>. | |
854 | ---Category: Private methods | |
855 | ||
856 | GraphicTransform ( me : mutable; | |
857 | AMatrix : Array2OfReal from TColStd ) | |
858 | is static; | |
859 | ---Level: Internal | |
bbf32d01 | 860 | ---Purpose: |
7fd59977 | 861 | ---Category: Private methods |
862 | ||
863 | GraphicUnHighlight ( me : mutable ) | |
864 | is static; | |
865 | ---Level: Internal | |
866 | ---Purpose: Suppress the highlight for the structure <me>. | |
867 | ---Category: Private methods | |
868 | ||
7fd59977 | 869 | Identification ( me ) |
870 | returns Integer from Standard | |
871 | is static; | |
872 | ---Level: Internal | |
873 | ---Purpose: Returns the identification number of the structure <me>. | |
874 | ---Category: Private methods | |
875 | ||
197ac94e | 876 | MinMaxCoord (me; |
877 | theXMin, theYMin, theZMin : out Real from Standard; | |
878 | theXMax, theYMax, theZMax : out Real from Standard) | |
879 | is static private; | |
880 | ---Level: Internal | |
881 | ---Purpose: Returns the extreme coordinates found in the structure <me>. | |
882 | -- Warning: If the structure <me> is empty or infinite then : | |
883 | -- theXMin = theYMin = theZMin = RealFirst(). | |
884 | -- theXMax = theYMax = theZMax = RealLast(). | |
885 | ---Category: Private methods | |
886 | ||
887 | MinMaxCoordWithDescendants (me; | |
888 | theXMin, theYMin, theZMin : out Real from Standard; | |
889 | theXMax, theYMax, theZMax : out Real from Standard) | |
890 | is static private; | |
891 | ---Level: Internal | |
892 | ---Purpose: Returns the extreme coordinates found in the structure <me> | |
893 | -- and its descendants with transformation applied. | |
894 | -- Warning: If the structure <me> is empty or infinite then : | |
895 | -- theXMin = theYMin = theZMin = RealFirst(). | |
896 | -- theXMax = theYMax = theZMax = RealLast(). | |
897 | ---Category: Private methods | |
7fd59977 | 898 | |
899 | Plot ( me : mutable; | |
900 | aPlotter : Plotter from Graphic3d ) | |
901 | is virtual; | |
902 | ---Level: Internal | |
903 | ---Category: Private methods | |
904 | ||
905 | PrintNetwork ( myclass; | |
906 | AStructure : Structure from Graphic3d; | |
907 | AType : TypeOfConnection from Graphic3d ); | |
908 | ---Level: Internal | |
909 | ---Purpose: Prints informations about the network associated | |
910 | -- with the structure <AStructure>. | |
911 | ---Category: Private methods | |
912 | ||
913 | Remove ( me : mutable; | |
914 | APtr : Address from Standard; | |
915 | AType : TypeOfConnection from Graphic3d ) | |
916 | is static; | |
917 | ---Level: Internal | |
918 | ---Purpose: Suppress the adress <APtr> in the list | |
919 | -- of descendants or in the list of ancestors. | |
920 | ---Category: Private methods | |
921 | ||
922 | Remove ( me : mutable; | |
923 | AGroup : Group from Graphic3d ) | |
924 | is static private; | |
925 | ---Level: Internal | |
926 | ---Purpose: Suppress in the structure <me>, the group <AGroup>. | |
927 | -- It will be erased at the next screen update. | |
928 | ---Category: Private methods | |
929 | ||
930 | SetComputeVisual ( me : mutable; | |
931 | AVisual : TypeOfStructure from Graphic3d ) | |
932 | is static; | |
933 | ---Level: Internal | |
934 | ---Category: Private methods | |
935 | ||
936 | StructureManager ( me ) | |
937 | returns StructureManager from Graphic3d | |
938 | is static private; | |
939 | ---Level: Internal | |
940 | ---Purpose: Returns the manager to which <me> is associated. | |
941 | ---Category: Private methods | |
942 | ||
943 | Transforms ( myclass; | |
944 | ATrsf : Array2OfReal from TColStd; | |
945 | X, Y, Z : Real from Standard; | |
946 | NewX, NewY, NewZ : out Real from Standard ); | |
947 | ---Level: Internal | |
948 | ---Purpose: Transforms <X>, <Y>, <Z> with the transformation <ATrsf>. | |
949 | ---Category: Private methods | |
950 | ||
951 | Transforms ( myclass; | |
952 | ATrsf : Array2OfReal from TColStd; | |
953 | Coord : Vector from Graphic3d ) | |
954 | returns Vector from Graphic3d; | |
955 | ---Level: Internal | |
956 | ---Purpose: Transforms <Coord> with the transformation <ATrsf>. | |
957 | ---Category: Private methods | |
958 | ||
959 | Transforms ( myclass; | |
960 | ATrsf : Array2OfReal from TColStd; | |
961 | Coord : Vertex from Graphic3d ) | |
962 | returns Vertex from Graphic3d; | |
963 | ---Level: Internal | |
964 | ---Purpose: Transforms <Coord> with the transformation <ATrsf>. | |
965 | ---Category: Private methods | |
966 | ||
197ac94e | 967 | TransformBoundaries (myclass; |
968 | theTrsf : Array2OfReal from TColStd; | |
969 | theXMin, theYMin, theZMin : in out Real from Standard; | |
970 | theXMax, theYMax, theZMax : in out Real from Standard) | |
971 | is protected; | |
972 | ---Level: Internal | |
973 | ---Purpose: Transforms boundaries with <theTrsf> transformation. | |
974 | ---Category: Private methods | |
975 | ||
7fd59977 | 976 | Update ( me ) |
977 | is static private; | |
978 | ---Level: Internal | |
979 | ---Purpose: Calls the Update method of the StructureManager which | |
980 | -- contains the Structure <me>. | |
981 | ---Category: Private methods | |
982 | ||
983 | UpdateStructure ( me : mutable; | |
984 | CTXL : AspectLine3d from Graphic3d; | |
985 | CTXT : AspectText3d from Graphic3d; | |
986 | CTXM : AspectMarker3d from Graphic3d; | |
987 | CTXF : AspectFillArea3d from Graphic3d ) | |
988 | is static private; | |
989 | ---Level: Internal | |
990 | ---Purpose: Updates the c structure associated to <me>. | |
991 | ---Category: Private methods | |
992 | ||
63bcc448 | 993 | CStructure (me) |
994 | returns CStructure_Handle from Graphic3d | |
995 | is static; | |
996 | ---Purpose: Returns the c structure associated to <me>. | |
997 | ---C++: return const & | |
7fd59977 | 998 | |
999 | fields | |
1000 | ||
1001 | -- | |
1002 | -- Class : Graphic3d_Structure | |
1003 | -- | |
1004 | -- Purpose : Declaration of variables specific to | |
1005 | -- graphic structures. | |
1006 | -- Reminder : A structure is defined in a manager. | |
1007 | -- It is a sequence of groups of primitives. | |
1008 | -- | |
1009 | ||
63bcc448 | 1010 | -- the associated low-level structure |
1011 | myCStructure : CStructure_Handle from Graphic3d; | |
7fd59977 | 1012 | |
7fd59977 | 1013 | -- the structures to which the structure is attached |
63bcc448 | 1014 | myAncestors : SequenceOfAddress from TColStd; |
7fd59977 | 1015 | |
1016 | -- the structures attached to the structure | |
63bcc448 | 1017 | myDescendants : SequenceOfAddress from TColStd; |
7fd59977 | 1018 | |
1019 | -- the sequence of groups | |
63bcc448 | 1020 | myGroups : SequenceOfGroup from Graphic3d; |
7fd59977 | 1021 | |
1022 | -- the highlight method of the structure | |
63bcc448 | 1023 | myHighlightColor : Color from Quantity; |
1024 | myHighlightMethod : TypeOfHighlightMethod from Aspect; | |
7fd59977 | 1025 | |
1026 | -- the manager accepting the structure | |
63bcc448 | 1027 | myStructureManager : StructureManagerPtr from Graphic3d is protected; |
1028 | myFirstStructureManager : StructureManagerPtr from Graphic3d is protected; | |
1029 | myOwner : Address from Standard; | |
7fd59977 | 1030 | |
1031 | -- the type of visualisation accepted by the structure | |
63bcc448 | 1032 | myVisual : TypeOfStructure from Graphic3d; |
1033 | myComputeVisual : TypeOfStructure from Graphic3d is protected; | |
7fd59977 | 1034 | |
1035 | friends | |
1036 | ||
1037 | -- a lot of methods of Group use the methods of Structure | |
1038 | class Group from Graphic3d | |
1039 | ||
1040 | end Structure; |