2 -- File: Graphic3d_Group.cdl
3 -- Created: Vendredi 6 Septembre 1991
5 -- 27/09/97 ; PCT : ajout du controle manuel des textures
6 -- 11/97 ; CAL : ajout polyline par 2 points
7 -- 16/06/2000 : ATS: Study G005 - Group store presentations of it's objects in field
8 -- MyListOfPArray to avoid deletion of handle-manipulating
11 ---Copyright: MatraDatavision 1991,1992,1993,1994
13 class Group from Graphic3d inherits TShared
17 ---Purpose: This class allows the definition of groups
18 -- of primitives inside of graphic objects (presentations).
19 -- A group contains the primitives and attributes
20 -- for which the range is limited to this group.
21 -- The primitives of a group can be globally suppressed.
23 -- There are two main group usage models:
25 -- 1) Non-modifiable, or unbounded, group ('black box').
26 -- Developers can repeat a sequence of
27 -- SetPrimitivesAspect() with AddPrimitiveArray() methods arbitrary number of times
28 -- to define arbitrary number of primitive "blocks" each having individual apect values.
29 -- Any modification of such a group is forbidden, as aspects and primitives are mixed
30 -- in memory without any high-level logical structure, and any modification is very likely to result
31 -- in corruption of the group internal data.
32 -- It is necessary to recreate such a group as a whole when some attribute should be changed.
33 -- (for example, in terms of AIS it is necessary to re-Compute() the whole presentation each time).
34 -- 2) Bounded group. Developers should specify the necessary group aspects with help of
35 -- SetGroupPrimitivesAspect() and then add primitives to the group.
36 -- Such a group have simplified organization in memory (a single block of attributes
37 -- followed by a block of primitives) and therefore it can be modified, if it is necessary to
38 -- change parameters of some aspect that has already been set, using methods:
39 -- IsGroupPrimitivesAspectSet() to detect which aspect was set for primitives;
40 -- GroupPrimitivesAspect() to read current aspect values
41 -- and SetGroupPrimitivesAspect() to set new values.
43 -- Developers are strongly recommended to take all the above into account when filling Graphic3d_Group
44 -- with aspects and primitives and choose the group usage model beforehand out of application needs.
51 Array1OfInteger from TColStd,
52 Array1OfReal from TColStd,
53 HArray1OfByte from TColStd,
55 ExtendedString from TCollection,
57 PlaneAngle from Quantity,
59 Array1OfEdge from Aspect,
62 GroupAspect from Graphic3d,
63 AspectLine3d from Graphic3d,
64 AspectMarker3d from Graphic3d,
65 AspectText3d from Graphic3d,
66 AspectFillArea3d from Graphic3d,
67 HorizontalTextAlignment from Graphic3d,
68 CBitFields4 from Graphic3d,
69 CGroup from Graphic3d,
70 GraphicDriver from Graphic3d,
71 Structure from Graphic3d,
72 TextPath from Graphic3d,
73 TypeOfPolygon from Graphic3d,
74 Vector from Graphic3d,
75 Array1OfVertex from Graphic3d,
76 Array2OfVertex from Graphic3d,
77 Vertex from Graphic3d,
78 Array1OfVertexC from Graphic3d,
79 Array2OfVertexC from Graphic3d,
80 VertexC from Graphic3d,
81 Array1OfVertexN from Graphic3d,
82 Array2OfVertexN from Graphic3d,
83 VertexN from Graphic3d,
84 Array1OfVertexNC from Graphic3d,
85 Array2OfVertexNC from Graphic3d,
86 VertexNC from Graphic3d,
87 VerticalTextAlignment from Graphic3d,
88 VertexNT from Graphic3d,
89 Array1OfVertexNT from Graphic3d,
90 Array2OfVertexNT from Graphic3d,
91 ArrayOfPrimitives from Graphic3d,
92 ListOfPArray from Graphic3d,
93 ListIteratorOfListOfPArray from Graphic3d,
94 TransModeFlags from Graphic3d,
95 CBounds from Graphic3d
99 GroupDefinitionError from Graphic3d,
100 PickIdDefinitionError from Graphic3d,
101 OutOfRange from Standard
104 Create ( AStructure : Structure from Graphic3d )
105 returns mutable Group from Graphic3d;
107 ---Purpose: Creates a group in the structure <AStructure>.
109 ---------------------------------------------------
110 -- Category: Methods to modify the class definition
111 ---------------------------------------------------
113 Clear ( me : mutable )
116 ---Purpose: Supress all primitives and attributes of <me>.
117 ---Category: Methods to modify the class definition
119 Destroy ( me : mutable )
122 ---Purpose: Supress the group <me> in the structure.
123 ---Category: Methods to modify the class definition
126 Remove ( me : mutable )
129 ---Purpose: Supress the group <me> in the structure.
130 -- Warning: No more graphic operations in <me> after this call.
131 ---Category: Methods to modify the class definition
133 --SetTransformPersistence( me : mutable;
134 -- AFlag : TransModeFlags from Graphic3d )
136 ---Purpose: Modifies the current modelling transform persistence (pan, zoom or rotate)
139 --TransformPersistence( me )
140 -- returns TransModeFlags from Graphic3d
142 ---Purpose: Get the current modelling transform persistence (pan, zoom or rotate)
145 SetGroupPrimitivesAspect ( me : mutable )
148 ---Purpose: Removes the context for all the line primitives
150 ---Category: Methods to modify the class definition
152 SetGroupPrimitivesAspect ( me : mutable;
153 CTX : AspectLine3d from Graphic3d )
156 ---Purpose: Modifies the context for all the line primitives
158 ---Category: Methods to modify the class definition
160 SetGroupPrimitivesAspect ( me : mutable;
161 CTX : AspectFillArea3d from Graphic3d )
164 ---Purpose: Modifies the context for all the face primitives
166 ---Category: Methods to modify the class definition
168 SetGroupPrimitivesAspect ( me : mutable;
169 CTX : AspectText3d from Graphic3d )
172 ---Purpose: Modifies the context for all the text primitives
174 ---Category: Methods to modify the class definition
176 SetGroupPrimitivesAspect ( me : mutable;
177 CTX : AspectMarker3d from Graphic3d )
180 ---Purpose: Modifies the context for all the marker primitives
182 ---Category: Methods to modify the class definition
184 SetPrimitivesAspect ( me : mutable;
185 CTX : AspectLine3d from Graphic3d )
188 ---Purpose: Modifies the current context of the group to give
189 -- another aspect for all the line primitives created
190 -- after this call in the group.
191 ---Category: Methods to modify the class definition
193 SetPrimitivesAspect ( me : mutable;
194 CTX : AspectFillArea3d from Graphic3d )
197 ---Purpose: Modifies the current context of the group to give
198 -- another aspect for all the face primitives created
199 -- after this call in the group.
200 ---Category: Methods to modify the class definition
202 SetPrimitivesAspect ( me : mutable;
203 CTX : AspectText3d from Graphic3d )
206 ---Purpose: Modifies the current context of the group to give
207 -- another aspect for all the text primitives created
208 -- after this call in the group.
209 ---Category: Methods to modify the class definition
211 SetPrimitivesAspect ( me : mutable;
212 CTX : AspectMarker3d from Graphic3d )
215 ---Purpose: Modifies the current context of the group to give
216 -- another aspect for all the marker primitives created
217 -- after this call in the group.
218 ---Category: Methods to modify the class definition
220 SetMinMaxValues ( me : mutable;
221 XMin, YMin, ZMin : Real from Standard;
222 XMax, YMax, ZMax : Real from Standard )
225 ---Purpose: Sets the coordinates of the boundary box of the
227 ---Category: Methods to modify the class definition
229 --------------------------------------------------
230 -- Category: Methods to manage the pick identifier
231 --------------------------------------------------
234 returns Integer from Standard
237 ---Purpose: Returns the pick identifier of the group <me>.
238 -- Category: Methods to manage the pick identifier
239 -- Warning: Returns 0 if the pick identifier is not defined.
241 RemovePickId ( me : mutable )
244 ---Purpose: Removes the pick identifier of the group <me>.
245 -- Category: Methods to manage the pick identifier
246 -- Warning: Now the Pick Identifier is null.
248 SetPickId ( me : mutable;
249 Id : Integer from Standard )
251 ---Purpose: Places a pick identifier in the group <me>.
252 -- Category: Methods to manage the pick identifier
253 -- Warning: A Pick Identifier is an integer greater than zero.
254 --- Raises PickIdDefinitionError if <Id> is a negative value.
255 raises PickIdDefinitionError from Graphic3d is static;
257 -------------------------------------
258 -- Category: Methods to create Marker
259 -------------------------------------
261 ---------------------------------------------
262 -- Summary of Markers --
264 -- They should have one or more vertices. --
266 -- They have the following attributes. --
269 -- Marker Scale Factor. --
272 -- The size, shape and orientation of a --
273 -- marker is not subject to transformation --
274 ---------------------------------------------
276 Marker ( me : mutable;
277 APoint : Vertex from Graphic3d;
278 EvalMinMax : Boolean from Standard = Standard_True )
281 ---Purpose: Creates a marker in position <APoint> which will be drawn
282 -- with the current attribute (AspectMarker).
283 ---Category: Methods to create Marker
285 MarkerSet ( me : mutable;
286 ListVertex : Array1OfVertex from Graphic3d;
287 EvalMinMax : Boolean from Standard = Standard_True )
289 ---Purpose: Creates a group of markers defined by a table of
291 ---Category: Methods to create Marker
293 --------------------------------------
294 -- Category: Methods to create Polygon
295 --------------------------------------
297 --------------------------------------------------
298 -- Summary of Polygons --
300 -- They are limited to one boundary. --
302 -- The boundary should be closed. --
304 -- They should have at least three vertices. --
306 -- They should be planar. --
308 -- They should have a normal. --
310 -- The boundary is drawn only when the interior --
311 -- style is hollow. --
313 -- The boundary have the following attributes : --
316 -- Line Width Scale Factor. --
319 -- They have only interior attributes : --
321 -- Interior Style. --
322 -- Interior Color. --
323 -- Front Material. --
325 --------------------------------------------------
327 Polygon ( me : mutable;
328 ListVertex : Array1OfVertex from Graphic3d;
329 AType : TypeOfPolygon from Graphic3d = Graphic3d_TOP_CONVEX;
330 EvalMinMax : Boolean from Standard = Standard_True )
333 ---Purpose: Links up points to create a face drawn
334 -- using the current fill attributes (AspectFillArea3d))
335 -- The first and last points are not duplicates.
336 ---Category: Methods to create Polygon
338 Polygon ( me : mutable;
339 ListVertex : Array1OfVertex from Graphic3d;
340 Normal : Vector from Graphic3d;
341 AType : TypeOfPolygon from Graphic3d = Graphic3d_TOP_CONVEX;
342 EvalMinMax : Boolean from Standard = Standard_True )
345 ---Purpose: Links up points to create a face drawn
346 -- using the current fill attributes (AspectFillArea3d))
347 -- The first and last points are not duplicates.
348 -- The normal to the polygon is defined normalised.
349 ---Category: Methods to create Polygon
351 Polygon ( me : mutable;
352 ListVertex : Array1OfVertexN from Graphic3d;
353 AType : TypeOfPolygon from Graphic3d = Graphic3d_TOP_CONVEX;
354 EvalMinMax : Boolean from Standard = Standard_True )
357 ---Purpose: Links up points to create a face drawn
358 -- using the current fill attributes (AspectFillArea3d))
359 -- The first and last points are not duplicates.
360 -- The normal is defined and normalised for each vertex.
361 ---Category: Methods to create Polygon
363 Polygon ( me : mutable;
364 ListVertex : Array1OfVertexN from Graphic3d;
365 Normal : Vector from Graphic3d;
366 AType : TypeOfPolygon from Graphic3d = Graphic3d_TOP_CONVEX;
367 EvalMinMax : Boolean from Standard = Standard_True )
370 ---Purpose: Links up points to create a face drawn
371 -- using the current fill attributes (AspectFillArea3d))
372 -- The first and last points are not duplicates.
373 -- The normal is defined for each vertex.
374 -- The normal to the polygon is defined normalised.
375 ---Category: Methods to create Polygon
378 Polygon ( me : mutable;
379 ListVertex : Array1OfVertexNT from Graphic3d;
380 AType : TypeOfPolygon from Graphic3d = Graphic3d_TOP_CONVEX;
381 EvalMinMax : Boolean from Standard = Standard_True )
384 ---Purpose: Links up points to create a face drawn
385 -- using the current fill attributes (AspectFillArea3d))
386 -- The first and last points are not duplicates.
387 -- The normal is defined and normalised for each vertex.
388 -- The texture coordinate is defined for each vertex.
389 ---Category: Methods to create Polygon
393 --------------------------------------------------
394 -- Summary of Polygons with holes --
396 -- They may have multiple boundaries. --
398 -- Each boundary should be closed. --
400 -- Each boundary should have at least three --
403 -- They should be planar. --
405 -- They should have a normal. --
407 -- The boundary is drawn only when the interior --
408 -- style is hollow. --
410 -- The boundary have the following attributes : --
413 -- Line Width Scale Factor. --
416 -- They have only interior attributes : --
418 -- Interior Style. --
419 -- Interior Color. --
420 -- Front Material. --
422 --------------------------------------------------
424 Polygon ( me : mutable;
425 Bounds : Array1OfInteger from TColStd;
426 ListVertex : Array1OfVertex from Graphic3d;
427 EvalMinMax : Boolean from Standard = Standard_True )
430 ---Purpose: Creates a face with holes.
431 -- The face is described by the total number
432 -- of vertices on the external contour and around the holes,
433 -- and by the list of vertices.
434 -- The face will be drawn
435 -- using the current fill attributes (AspectFillArea3d))
436 -- The first and last points are not duplicates.
437 -- Bounds : total number of interior and exterior vertices
438 -- ListVertex : a list of the interior and exterior vertices
439 ---Category: Methods to create Polygon
441 Polygon ( me : mutable;
442 Bounds : Array1OfInteger from TColStd;
443 ListVertex : Array1OfVertex from Graphic3d;
444 Normal : Vector from Graphic3d;
445 EvalMinMax : Boolean from Standard = Standard_True )
448 ---Purpose: Creates a face with holes.
449 -- The face is described by the total number
450 -- of vertices on the external contour and around the holes,
451 -- and by the list of vertices.
452 -- The face will be drawn
453 -- using the current fill attributes (AspectFillArea3d))
454 -- The first and last points are not duplicates.
455 -- The normal to the polygon is normalised.
456 -- Bounds : total number of interior and exterior vertices
457 -- ListVertex : a list of the interior and exterior vertices
458 ---Category: Methods to create Polygon
460 Polygon ( me : mutable;
461 Bounds : Array1OfInteger from TColStd;
462 ListVertex : Array1OfVertexN from Graphic3d;
463 EvalMinMax : Boolean from Standard = Standard_True )
466 ---Purpose: Creates a face with holes.
467 -- The face is described by the total number
468 -- of vertices on the external contour and around the holes,
469 -- and by the list of vertices.
470 -- The face will be drawn
471 -- using the current fill attributes (AspectFillArea3d))
472 -- The first and last points are not duplicates.
473 -- Bounds : total number of interior and exterior vertices
474 -- ListVertex : a list of the interior and exterior vertices
475 ---Category: Methods to create Polygon
477 Polygon ( me : mutable;
478 Bounds : Array1OfInteger from TColStd;
479 ListVertex : Array1OfVertexN from Graphic3d;
480 Normal : Vector from Graphic3d;
481 EvalMinMax : Boolean from Standard = Standard_True )
484 ---Purpose: Creates a face with holes.
485 -- The face is described by the total number
486 -- of vertices on the external contour and around the holes,
487 -- and by the list of vertices.
488 -- The face will be drawn
489 -- using the current fill attributes (AspectFillArea3d))
490 -- The first and last points are not duplicates.
491 -- The normal to the polygon is normalised.
492 -- Bounds : total number of interior and exterior vertices
493 -- ListVertex : a list of the interior and exterior vertices
494 ---Category: Methods to create Polygon
496 PolygonSet ( me : mutable;
497 Bounds : Array1OfInteger from TColStd;
498 ListVertex : Array1OfVertex from Graphic3d;
499 AType : TypeOfPolygon from Graphic3d = Graphic3d_TOP_CONVEX;
500 EvalMinMax : Boolean from Standard = Standard_True )
503 ---Purpose: Links up points to create a set of face drawn
504 -- using the current fill attributes (AspectFillArea3d))
505 -- The first and last points are not duplicates.
506 ---Category: Methods to create Polygon
508 ---------------------------------------
509 -- Category: Methods to create Polyline
510 ---------------------------------------
512 --------------------------------------------
513 -- Summary of Polylines --
515 -- They should have two or more vertices. --
517 -- They have the following attributes. --
520 -- Line Width Scale Factor. --
522 --------------------------------------------
524 Polyline ( me : mutable;
525 APT1 : Vertex from Graphic3d;
526 APT2 : Vertex from Graphic3d;
527 EvalMinMax : Boolean from Standard = Standard_True )
530 ---Purpose: Links up points to create a line drawn
531 -- using the current line attributes (AspectLine)
532 ---Category: Methods to create Polyline
534 Polyline ( me : mutable;
535 ListVertex : Array1OfVertex from Graphic3d;
536 EvalMinMax : Boolean from Standard = Standard_True )
539 ---Purpose: Links up points to create a line drawn
540 -- using the current line attributes (AspectLine)
541 ---Category: Methods to create Polyline
543 Polyline ( me : mutable;
544 ListVertex : Array1OfVertexC from Graphic3d;
545 EvalMinMax : Boolean from Standard = Standard_True )
548 ---Purpose: Links up points to create a line drawn
549 -- using the current line attributes (AspectLine)
550 -- except for the colour which is defined
552 ---Category: Methods to create Polyline
554 -----------------------------------------
555 -- Category: Methods to create Quadrangle
556 -----------------------------------------
558 QuadrangleMesh ( me : mutable;
559 ListVertex : Array2OfVertex from Graphic3d;
560 EvalMinMax : Boolean from Standard = Standard_True )
562 ---Purpose: Creates a group of quadrilaterals from a list of
563 -- points, such that their vertices are:
564 -- Ki,j; Ki,j+1; Ki+1,j+1; Ki+1,j.
565 -- The quadrilaterals will be drawn according to the
566 -- current attributes (AspectFillArea3d).
567 -- Category: Methods to create Quadrangle
568 -- Warning: Raises GroupDefinitionError if <ListVertex> contains
569 -- less than four points.
570 raises GroupDefinitionError from Graphic3d is static;
572 QuadrangleMesh ( me : mutable;
573 ListVertex : Array2OfVertexN from Graphic3d;
574 EvalMinMax : Boolean from Standard = Standard_True )
576 ---Purpose: Creates a group of quadrilaterals from a list of
577 -- points, such that their vertices are:
578 -- Ki,j; Ki,j+1; Ki+1,j+1; Ki+1,j.
579 -- The quadrilaterals will be drawn according to the
580 -- current attributes (AspectFillArea3d).
581 -- For each vertex the normal is given.
582 -- Category: Methods to create Quadrangle
583 -- Warning: Raises GroupDefinitionError if <ListVertex> contains
584 -- less than four points.
585 raises GroupDefinitionError from Graphic3d is static;
587 QuadrangleMesh ( me : mutable;
588 ListVertex : Array2OfVertexNT from Graphic3d;
589 EvalMinMax : Boolean from Standard = Standard_True )
591 ---Purpose: Creates a group of quadrilaterals from a list of
592 -- points, such that their vertices are:
593 -- Ki,j; Ki,j+1; Ki+1,j+1; Ki+1,j.
594 -- The quadrilaterals will be drawn according to the
595 -- current attributes (AspectFillArea3d).
596 -- For each vertex the normal is given.
597 -- For each vertex a texture coordinate is given.
598 -- Category: Methods to create Quadrangle
599 -- Warning: Raises GroupDefinitionError if <ListVertex> contains
600 -- less than four points.
601 raises GroupDefinitionError from Graphic3d is static;
603 QuadrangleSet ( me : mutable;
604 ListVertex : Array1OfVertex from Graphic3d;
605 ListEdge : Array1OfEdge from Aspect;
606 EvalMinMax : Boolean from Standard = Standard_True )
608 ---Purpose: Creates a group of quadrangles defined by a table of
609 -- vertices and a table of edges, visible or not.
610 -- Category: Methods to create Quadrangle
611 -- Warning: Raises GroupDefinitionError if <ListVertex> contains
612 -- less than four points or if <ListEdge> contains
613 -- less than four edges.
614 raises GroupDefinitionError from Graphic3d is static;
616 QuadrangleSet ( me : mutable;
617 ListVertex : Array1OfVertexN from Graphic3d;
618 ListEdge : Array1OfEdge from Aspect;
619 EvalMinMax : Boolean from Standard = Standard_True )
621 ---Purpose: Creates a group of quadrangles defined by a table of
622 -- vertices and a table of edges, visible or not.
623 -- For each vertex the normal is given.
624 -- Category: Methods to create Quadrangle
625 -- Warning: Raises GroupDefinitionError if <ListVertex> contains
626 -- less than four points or if <ListEdge> contains
627 -- less than four edges.
628 raises GroupDefinitionError from Graphic3d is static;
630 QuadrangleSet ( me : mutable;
631 ListVertex : Array1OfVertexNT from Graphic3d;
632 ListEdge : Array1OfEdge from Aspect;
633 EvalMinMax : Boolean from Standard = Standard_True )
635 ---Purpose: Creates a group of quadrangles defined by a table of
636 -- vertices and a table of edges, visible or not.
637 -- For each vertex the normal is given.
638 -- For each vertex a texture coordinate is given.
639 -- Category: Methods to create Quadrangle
640 -- Warning: Raises GroupDefinitionError if <ListVertex> contains
641 -- less than four points or if <ListEdge> contains
642 -- less than four edges.
643 raises GroupDefinitionError from Graphic3d is static;
645 QuadrangleSet ( me : mutable;
646 ListVertex : Array1OfVertexC from Graphic3d;
647 ListEdge : Array1OfEdge from Aspect;
648 EvalMinMax : Boolean from Standard = Standard_True )
650 ---Purpose: Creates a group of quadrangles defined by a table of
651 -- vertices and a table of edges, visible or not.
652 -- For each vertex the color is given.
653 -- Category: Methods to create Quadrangle
654 -- Warning: Raises GroupDefinitionError if <ListVertex> contains
655 -- less than four points or if <ListEdge> contains
656 -- less than four edges.
657 raises GroupDefinitionError from Graphic3d is static;
659 QuadrangleSet ( me : mutable;
660 ListVertex : Array1OfVertexNC from Graphic3d;
661 ListEdge : Array1OfEdge from Aspect;
662 EvalMinMax : Boolean from Standard = Standard_True )
664 ---Purpose: Creates a group of quadrangles defined by a table of
665 -- vertices and a table of edges, visible or not.
666 -- For each vertex the normal and the color are given.
667 -- Category: Methods to create Quadrangle
668 -- Warning: Raises GroupDefinitionError if <ListVertex> contains
669 -- less than four points or if <ListEdge> contains
670 -- less than four edges.
671 raises GroupDefinitionError from Graphic3d is static;
673 -----------------------------------
674 -- Category: Methods to create Text
675 -----------------------------------
677 --------------------------------------------
678 -- Summary of Texts --
680 -- Text has geometric and nongeometric --
683 -- The geometric text attributes are : --
685 -- Character Height. --
686 -- Character Up Vector. --
688 -- Text Alignment Horizontal. --
689 -- Text Alignment Vertical. --
691 -- The nongeometric text attributes are : --
694 -- Character Spacing. --
695 -- Character Expansion Factor. --
697 --------------------------------------------
700 AText : CString from Standard;
701 APoint : Vertex from Graphic3d;
702 AHeight : Real from Standard;
703 AAngle : PlaneAngle from Quantity;
704 ATp : TextPath from Graphic3d;
705 AHta : HorizontalTextAlignment from Graphic3d;
706 AVta : VerticalTextAlignment from Graphic3d;
707 EvalMinMax : Boolean from Standard = Standard_True )
710 ---Purpose: Creates the string <AText> at position <APoint>.
711 -- The 3D point of attachment is projected. The text is
712 -- written in the plane of projection.
713 -- The attributes are given with respect to the plane of
715 -- AHeight : Height of text.
716 -- (Relative to the Normalized Projection
717 -- Coordinates (NPC) Space).
718 -- AAngle : Orientation of the text
719 -- (with respect to the horizontal).
720 ---Category: Methods to create Text
723 AText : CString from Standard;
724 APoint : Vertex from Graphic3d;
725 AHeight : Real from Standard;
726 EvalMinMax : Boolean from Standard = Standard_True )
729 ---Purpose: Creates the string <AText> at position <APoint>.
730 -- The 3D point of attachment is projected. The text is
731 -- written in the plane of projection.
732 -- The attributes are given with respect to the plane of
734 -- AHeight : Height of text.
735 -- (Relative to the Normalized Projection
736 -- Coordinates (NPC) Space).
737 -- The other attributes have the following default values:
742 ---Category: Methods to create Text
745 AText : ExtendedString from TCollection;
746 APoint : Vertex from Graphic3d;
747 AHeight : Real from Standard;
748 AAngle : PlaneAngle from Quantity;
749 ATp : TextPath from Graphic3d;
750 AHta : HorizontalTextAlignment from Graphic3d;
751 AVta : VerticalTextAlignment from Graphic3d;
752 EvalMinMax : Boolean from Standard = Standard_True )
755 ---Purpose: Creates the string <AText> at position <APoint>.
756 -- The 3D point of attachment is projected. The text is
757 -- written in the plane of projection.
758 -- The attributes are given with respect to the plane of
760 -- AHeight : Height of text.
761 -- (Relative to the Normalized Projection
762 -- Coordinates (NPC) Space).
763 -- AAngle : Orientation of the text
764 -- (with respect to the horizontal).
765 ---Category: Methods to create Text
768 AText : ExtendedString from TCollection;
769 APoint : Vertex from Graphic3d;
770 AHeight : Real from Standard;
771 EvalMinMax : Boolean from Standard = Standard_True )
774 ---Purpose: Creates the string <AText> at position <APoint>.
775 -- The 3D point of attachment is projected. The text is
776 -- written in the plane of projection.
777 -- The attributes are given with respect to the plane of
779 -- AHeight : Height of text.
780 -- (Relative to the Normalized Projection
781 -- Coordinates (NPC) Space).
782 -- The other attributes have the following default values:
787 ---Category: Methods to create Text
789 ---------------------------------------
790 ---Category: Methods to create Triangle
791 ---------------------------------------
793 TriangleMesh ( me : mutable;
794 ListVertex : Array1OfVertex from Graphic3d;
795 EvalMinMax : Boolean from Standard = Standard_True )
797 ---Purpose: Creates triangles from an array of points such that
798 -- the Kth triangle contains the vertices K, K+1, K+2.
799 -- The triangle will be drawn using the current fill
800 -- attributes (AspectFillArea3d)
801 -- Category: Methods to create Triangle
802 -- Warning: Raises GroupDefinitionError if <ListVertex> contains
803 -- less than three points.
804 raises GroupDefinitionError from Graphic3d is static;
806 TriangleMesh ( me : mutable;
807 ListVertex : Array1OfVertexN from Graphic3d;
808 EvalMinMax : Boolean from Standard = Standard_True )
810 ---Purpose: Creates triangles from an array of points such that
811 -- the Kth triangle contains the vertices K, K+1, K+2.
812 -- The triangle will be drawn using the current fill
813 -- attributes (AspectFillArea3d)
814 -- The normal is given for each vertex.
815 -- Category: Methods to create Triangle
816 -- Warning: Raises GroupDefinitionError if <ListVertex> contains
817 -- less than three points.
818 raises GroupDefinitionError from Graphic3d is static;
820 TriangleMesh ( me : mutable;
821 ListVertex : Array1OfVertexNT from Graphic3d;
822 EvalMinMax : Boolean from Standard = Standard_True )
824 ---Purpose: Creates triangles from an array of points such that
825 -- the Kth triangle contains the vertices K, K+1, K+2.
826 -- The triangle will be drawn using the current fill
827 -- attributes (AspectFillArea3d)
828 -- The normal is given for each vertex.
829 -- A texture coordinate is given for each vertex.
830 -- Category: Methods to create Triangle
831 -- Warning: Raises GroupDefinitionError if <ListVertex> contains
832 -- less than three points.
833 raises GroupDefinitionError from Graphic3d is static;
835 TriangleSet ( me : mutable;
836 ListVertex : Array1OfVertex from Graphic3d;
837 ListEdge : Array1OfEdge from Aspect;
838 EvalMinMax : Boolean from Standard = Standard_True )
840 ---Purpose: Creates a group of triangles defined by a table of
841 -- vertices and a table of edges, visible or not.
842 -- Category: Methods to create Triangle
843 -- Warning: Raises GroupDefinitionError if <ListVertex> contains
844 -- less than three points or if <ListEdge> contains
845 -- less than three edges.
846 raises GroupDefinitionError from Graphic3d is static;
848 TriangleSet ( me : mutable;
849 ListVertex : Array1OfVertexN from Graphic3d;
850 ListEdge : Array1OfEdge from Aspect;
851 EvalMinMax : Boolean from Standard = Standard_True )
853 ---Purpose: Creates a group of triangles defined by a table of
854 -- vertices and a table of edges, visible or not.
855 -- For each vertex the normal is given.
856 -- Category: Methods to create Triangle
857 -- Warning: Raises GroupDefinitionError if <ListVertex> contains
858 -- less than three points or if <ListEdge> contains
859 -- less than three edges.
860 raises GroupDefinitionError from Graphic3d is static;
862 TriangleSet ( me : mutable;
863 ListVertex : Array1OfVertexNT from Graphic3d;
864 ListEdge : Array1OfEdge from Aspect;
865 EvalMinMax : Boolean from Standard = Standard_True )
867 ---Purpose: Creates a group of triangles defined by a table of
868 -- vertices and a table of edges, visible or not.
869 -- For each vertex the normal is given.
870 -- For each vertex a texture coordinate is given.
871 -- Category: Methods to create Triangle
872 -- Warning: Raises GroupDefinitionError if <ListVertex> contains
873 -- less than three points or if <ListEdge> contains
874 -- less than three edges.
875 raises GroupDefinitionError from Graphic3d is static;
877 TriangleSet ( me : mutable;
878 ListVertex : Array1OfVertexC from Graphic3d;
879 ListEdge : Array1OfEdge from Aspect;
880 EvalMinMax : Boolean from Standard = Standard_True )
882 ---Purpose: Creates a group of triangles defined by a table of
883 -- vertices and a table of edges, visible or not.
884 -- For each vertex the color is given.
885 -- Category: Methods to create Triangle
886 -- Warning: Raises GroupDefinitionError if <ListVertex> contains
887 -- less than three points or if <ListEdge> contains
888 -- less than three edges.
889 raises GroupDefinitionError from Graphic3d is static;
891 TriangleSet ( me : mutable;
892 ListVertex : Array1OfVertexNC from Graphic3d;
893 ListEdge : Array1OfEdge from Aspect;
894 EvalMinMax : Boolean from Standard = Standard_True )
896 ---Purpose: Creates a group of triangles defined by a table of
897 -- vertices and a table of edges, visible or not.
898 -- For each vertex the normal and the color are given.
899 -- Category: Methods to create Triangle
900 -- Warning: Raises GroupDefinitionError if <ListVertex> contains
901 -- less than three points or if <ListEdge> contains
902 -- less than three edges.
903 raises GroupDefinitionError from Graphic3d is static;
905 AddPrimitiveArray( me : mutable;
906 elem : ArrayOfPrimitives from Graphic3d;
907 EvalMinMax: Boolean from Standard = Standard_True );
909 ---Purpose: Adds an array of primitives for display
911 RemovePrimitiveArray( me : mutable;
912 aRank : Integer from Standard)
914 ---Purpose: Remove the array of primitives of rank <aRank>
915 raises OutOfRange from Standard is static;
916 -- if <aRank> is < 1 or > ArrayNumber()
918 RemovePrimitiveArrays( me : mutable);
920 ---Purpose: Remove all array of primitives
922 UserDraw ( me : mutable;
923 AnObject : Address from Standard;
924 EvalMinMax : Boolean from Standard = Standard_True;
925 -- SAMTECH contribution 5 July 2007 -- BEGIN
926 ContainsFacet: Boolean from Standard = Standard_False
927 -- SAMTECH contribution 5 July 2007 -- END
930 ---Purpose: Creates an UserDraw primitive
931 -- Category: Methods to create UserDraw
932 -- Warning: Raises GroupDefinitionError if ...
933 raises GroupDefinitionError from Graphic3d is static;
935 ----------------------------
936 -- Category: Inquire methods
937 ----------------------------
940 returns Integer from Standard;
942 ---Purpose: Returns the number of primitive array added in this group
944 InitDefinedArray( me:mutable );
946 ---Purpose: Initialize the array list iterator.
948 NextDefinedArray( me:mutable );
950 ---Purpose: Increments the array list iterator.
952 MoreDefinedArray( me:mutable )
953 returns Boolean from Standard;
955 ---Purpose: Returns TRUE if more array exists in the list.
958 returns mutable ArrayOfPrimitives from Graphic3d;
960 ---Purpose: Returns the current array of primitives according
961 -- to the array list iterator value.
963 IsGroupPrimitivesAspectSet ( me;
964 theAspect : GroupAspect from Graphic3d )
965 returns Boolean from Standard
968 ---Purpose: Returns TRUE if aspect is set for the group.
969 ---Category: Inquire methods
971 GroupPrimitivesAspect ( me;
972 CTXL : AspectLine3d from Graphic3d;
973 CTXT : AspectText3d from Graphic3d;
974 CTXM : AspectMarker3d from Graphic3d;
975 CTXF : AspectFillArea3d from Graphic3d )
978 ---Purpose: Returns the context of all the primitives of the group.
979 ---Category: Inquire methods
981 PrimitivesAspect ( me;
982 CTXL : AspectLine3d from Graphic3d;
983 CTXT : AspectText3d from Graphic3d;
984 CTXM : AspectMarker3d from Graphic3d;
985 CTXF : AspectFillArea3d from Graphic3d )
988 ---Purpose: Returns the last inserted context in the group <me>
989 -- foreach kind of primitives.
990 ---Category: Inquire methods
993 returns Boolean from Standard
996 ---Purpose: Returns Standard_True if the group <me> contains
997 -- Polygons, Triangles or Quadrangles.
998 ---Category: Inquire methods
1001 returns Boolean from Standard
1004 ---Purpose: Returns Standard_True if the group <me> is deleted.
1005 -- <me> is deleted after the call Remove (me) or the
1006 -- associated structure is deleted.
1007 ---Category: Inquire methods
1010 returns Boolean from Standard
1013 ---Purpose: Returns Standard_True if the group <me> is empty.
1014 ---Warning: A group is empty if the MinMaxValues method returns :
1015 -- XMin = YMin = ZMin = RealFirst ().
1016 -- XMax = YMax = ZMax = RealLast ().
1017 ---Category: Inquire methods
1020 XMin, YMin, ZMin : out Real from Standard;
1021 XMax, YMax, ZMax : out Real from Standard )
1024 ---Purpose: Returns the coordinates of the boundary box of the
1026 ---Warning: If the group <me> is empty then :
1027 -- XMin = YMin = ZMin = RealFirst ().
1028 -- XMax = YMax = ZMax = RealLast ().
1029 ---Category: Inquire methods
1032 returns mutable Structure from Graphic3d
1035 ---Purpose: Returns the structure containing the group <me>.
1036 ---Category: Inquire methods
1038 ----------------------------
1039 -- Category: Private methods
1040 ----------------------------
1045 ---Purpose: Prints informations about the group <me>.
1046 ---Category: Private methods
1049 LB, LE : in out Integer from Standard )
1052 ---Purpose: Returns the position of the group in the structure.
1053 ---Category: Private methods
1056 XMin, YMin, ZMin : out Real from Standard;
1057 XMax, YMax, ZMax : out Real from Standard )
1060 ---Purpose: Returns the extreme coordinates found in the group.
1061 ---Warning: If the group <me> is empty then :
1062 -- XMin = YMin = ZMin = RealFirst ().
1063 -- XMax = YMax = ZMax = RealLast ().
1064 ---Category: Private methods
1069 ---Purpose: Calls the Update method of the StructureManager which
1070 -- contains the associated Structure of the Group <me>.
1071 ---Category: Private methods
1073 -----------------------------
1074 -- Category: Internal methods
1075 -----------------------------
1077 BeginPrimitives ( me : mutable )
1080 ---Category: Internal methods
1082 EndPrimitives ( me : mutable )
1085 ---Category: Internal methods
1087 Bezier ( me : mutable;
1088 ListVertex : Array1OfVertex from Graphic3d;
1089 EvalMinMax : Boolean from Standard = Standard_True )
1091 ---Purpose: Creates a non rational Bezier curve with a set of poles :
1092 -- ListVertex. The weights are defaulted to all being 1.
1093 -- Category: Methods to create Curve
1094 -- Warning: Raises GroupDefinitionError if <ListVertex> contains
1095 -- less than two points.
1096 raises GroupDefinitionError from Graphic3d is static;
1098 Bezier ( me : mutable;
1099 ListVertex : Array1OfVertex from Graphic3d;
1100 ListWeight : Array1OfReal from TColStd;
1101 EvalMinMax : Boolean from Standard = Standard_True )
1103 ---Purpose: Creates a non rational Bezier curve with a set of poles :
1104 -- ListVertex and the set of weights ListWeight.
1105 -- If all the weights are identical the curve is considered
1107 -- Category: Methods to create Curve
1108 -- Warning: Raises GroupDefinitionError if <ListVertex> contains
1109 -- less than two points or <ListVertex> and <ListWeight>
1110 -- have not the same length or one weight value is lower
1111 -- or equal to Resolution from package gp.
1112 raises GroupDefinitionError from Graphic3d is static;
1119 -- Class : Graphic3d_Group
1121 -- Purpose : Declaration of variables specific to groups
1124 -- Reminder : A group is defined in a structure
1125 -- It acts as the smallest editable entity.
1127 -- the associated C structure
1128 MyCGroup : CGroup from Graphic3d;
1130 -- the graphic driver used
1131 MyGraphicDriver : GraphicDriver from Graphic3d;
1133 -- the state of the different contexts for primitives
1134 MyCBitFields : CBitFields4 from Graphic3d;
1136 -- the structure contains the group
1137 MyPtrStructure : Address from Standard;
1140 MyBounds : CBounds from Graphic3d;
1142 MyListOfPArray : ListOfPArray from Graphic3d;
1143 MyListOfPArrayIterator : ListIteratorOfListOfPArray from Graphic3d;
1145 MyMarkArray : HArray1OfByte from TColStd;
1146 MyMarkWidth : Integer from Standard;
1147 MyMarkHeight : Integer from Standard;
1151 Remove from class Structure from Graphic3d
1152 ( me : mutable; AGroup : Group from Graphic3d )