1 -- Created on: 1991-09-06
2 -- Created by: NW,JPB,CAL
3 -- Copyright (c) 1991-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
21 -- 27/09/97 ; PCT : add manual control of textures
22 -- 11/97 ; CAL : ajout polyline par 2 points
23 -- 16/06/2000 : ATS: Study G005 - Group store presentations of it's objects in field
24 -- MyListOfPArray to avoid deletion of handle-manipulating
26 class Group from Graphic3d inherits TShared
30 ---Purpose: This class allows the definition of groups
31 -- of primitives inside of graphic objects (presentations).
32 -- A group contains the primitives and attributes
33 -- for which the range is limited to this group.
34 -- The primitives of a group can be globally suppressed.
36 -- There are two main group usage models:
38 -- 1) Non-modifiable, or unbounded, group ('black box').
39 -- Developers can repeat a sequence of
40 -- SetPrimitivesAspect() with AddPrimitiveArray() methods arbitrary number of times
41 -- to define arbitrary number of primitive "blocks" each having individual apect values.
42 -- Any modification of such a group is forbidden, as aspects and primitives are mixed
43 -- in memory without any high-level logical structure, and any modification is very likely to result
44 -- in corruption of the group internal data.
45 -- It is necessary to recreate such a group as a whole when some attribute should be changed.
46 -- (for example, in terms of AIS it is necessary to re-Compute() the whole presentation each time).
47 -- 2) Bounded group. Developers should specify the necessary group aspects with help of
48 -- SetGroupPrimitivesAspect() and then add primitives to the group.
49 -- Such a group have simplified organization in memory (a single block of attributes
50 -- followed by a block of primitives) and therefore it can be modified, if it is necessary to
51 -- change parameters of some aspect that has already been set, using methods:
52 -- IsGroupPrimitivesAspectSet() to detect which aspect was set for primitives;
53 -- GroupPrimitivesAspect() to read current aspect values
54 -- and SetGroupPrimitivesAspect() to set new values.
56 -- Developers are strongly recommended to take all the above into account when filling Graphic3d_Group
57 -- with aspects and primitives and choose the group usage model beforehand out of application needs.
64 Array1OfInteger from TColStd,
65 Array1OfReal from TColStd,
66 HArray1OfByte from TColStd,
68 ExtendedString from TCollection,
70 PlaneAngle from Quantity,
72 Array1OfEdge from Aspect,
75 GroupAspect from Graphic3d,
76 AspectLine3d from Graphic3d,
77 AspectMarker3d from Graphic3d,
78 AspectText3d from Graphic3d,
79 AspectFillArea3d from Graphic3d,
80 HorizontalTextAlignment from Graphic3d,
81 CBitFields4 from Graphic3d,
82 CGroup from Graphic3d,
83 GraphicDriver from Graphic3d,
84 Structure from Graphic3d,
85 TextPath from Graphic3d,
86 TypeOfPolygon from Graphic3d,
87 Vector from Graphic3d,
88 Array1OfVertex from Graphic3d,
89 Array2OfVertex from Graphic3d,
90 Vertex from Graphic3d,
91 Array1OfVertexC from Graphic3d,
92 Array2OfVertexC from Graphic3d,
93 VertexC from Graphic3d,
94 Array1OfVertexN from Graphic3d,
95 Array2OfVertexN from Graphic3d,
96 VertexN from Graphic3d,
97 Array1OfVertexNC from Graphic3d,
98 Array2OfVertexNC from Graphic3d,
99 VertexNC from Graphic3d,
100 VerticalTextAlignment from Graphic3d,
101 VertexNT from Graphic3d,
102 Array1OfVertexNT from Graphic3d,
103 Array2OfVertexNT from Graphic3d,
104 ArrayOfPrimitives from Graphic3d,
105 ListOfPArray from Graphic3d,
106 ListIteratorOfListOfPArray from Graphic3d,
107 TransModeFlags from Graphic3d,
108 CBounds from Graphic3d
112 GroupDefinitionError from Graphic3d,
113 PickIdDefinitionError from Graphic3d,
114 OutOfRange from Standard
117 Create ( AStructure : Structure from Graphic3d )
118 returns mutable Group from Graphic3d;
120 ---Purpose: Creates a group in the structure <AStructure>.
122 ---------------------------------------------------
123 -- Category: Methods to modify the class definition
124 ---------------------------------------------------
126 Clear ( me : mutable;
127 theUpdateStructureMgr : Boolean from Standard = Standard_True )
130 ---Purpose: Supress all primitives and attributes of <me>.
131 -- To clear group without update in Graphic3d_StructureManager
132 -- pass Standard_False as <theUpdateStructureMgr>. This
133 -- used on context and viewer destruction, when the pointer
134 -- to structure manager in Graphic3d_Structure could be
135 -- already released (pointers are used here to avoid handle
137 ---Category: Methods to modify the class definition
139 Destroy ( me : mutable )
142 ---Purpose: Supress the group <me> in the structure.
143 ---Category: Methods to modify the class definition
146 Remove ( me : mutable )
149 ---Purpose: Supress the group <me> in the structure.
150 -- Warning: No more graphic operations in <me> after this call.
151 ---Category: Methods to modify the class definition
153 --SetTransformPersistence( me : mutable;
154 -- AFlag : TransModeFlags from Graphic3d )
156 ---Purpose: Modifies the current modelling transform persistence (pan, zoom or rotate)
159 --TransformPersistence( me )
160 -- returns TransModeFlags from Graphic3d
162 ---Purpose: Get the current modelling transform persistence (pan, zoom or rotate)
165 SetGroupPrimitivesAspect ( me : mutable )
168 ---Purpose: Removes the context for all the line primitives
170 ---Category: Methods to modify the class definition
172 SetGroupPrimitivesAspect ( me : mutable;
173 CTX : AspectLine3d from Graphic3d )
176 ---Purpose: Modifies the context for all the line primitives
178 ---Category: Methods to modify the class definition
180 SetGroupPrimitivesAspect ( me : mutable;
181 CTX : AspectFillArea3d from Graphic3d )
184 ---Purpose: Modifies the context for all the face primitives
186 ---Category: Methods to modify the class definition
188 SetGroupPrimitivesAspect ( me : mutable;
189 CTX : AspectText3d from Graphic3d )
192 ---Purpose: Modifies the context for all the text primitives
194 ---Category: Methods to modify the class definition
196 SetGroupPrimitivesAspect ( me : mutable;
197 CTX : AspectMarker3d from Graphic3d )
200 ---Purpose: Modifies the context for all the marker primitives
202 ---Category: Methods to modify the class definition
204 SetPrimitivesAspect ( me : mutable;
205 CTX : AspectLine3d from Graphic3d )
208 ---Purpose: Modifies the current context of the group to give
209 -- another aspect for all the line primitives created
210 -- after this call in the group.
211 ---Category: Methods to modify the class definition
213 SetPrimitivesAspect ( me : mutable;
214 CTX : AspectFillArea3d from Graphic3d )
217 ---Purpose: Modifies the current context of the group to give
218 -- another aspect for all the face primitives created
219 -- after this call in the group.
220 ---Category: Methods to modify the class definition
222 SetPrimitivesAspect ( me : mutable;
223 CTX : AspectText3d from Graphic3d )
226 ---Purpose: Modifies the current context of the group to give
227 -- another aspect for all the text primitives created
228 -- after this call in the group.
229 ---Category: Methods to modify the class definition
231 SetPrimitivesAspect ( me : mutable;
232 CTX : AspectMarker3d from Graphic3d )
235 ---Purpose: Modifies the current context of the group to give
236 -- another aspect for all the marker primitives created
237 -- after this call in the group.
238 ---Category: Methods to modify the class definition
240 SetMinMaxValues ( me : mutable;
241 XMin, YMin, ZMin : Real from Standard;
242 XMax, YMax, ZMax : Real from Standard )
245 ---Purpose: Sets the coordinates of the boundary box of the
247 ---Category: Methods to modify the class definition
249 -------------------------------------
250 -- Category: Methods to create Marker
251 -------------------------------------
253 ---------------------------------------------
254 -- Summary of Markers --
256 -- They should have one or more vertices. --
258 -- They have the following attributes. --
261 -- Marker Scale Factor. --
264 -- The size, shape and orientation of a --
265 -- marker is not subject to transformation --
266 ---------------------------------------------
268 Marker ( me : mutable;
269 APoint : Vertex from Graphic3d;
270 EvalMinMax : Boolean from Standard = Standard_True )
273 ---Purpose: Creates a marker in position <APoint> which will be drawn
274 -- with the current attribute (AspectMarker).
275 ---Category: Methods to create Marker
277 MarkerSet ( me : mutable;
278 ListVertex : Array1OfVertex from Graphic3d;
279 EvalMinMax : Boolean from Standard = Standard_True )
281 ---Purpose: Creates a group of markers defined by a table of
283 ---Category: Methods to create Marker
285 --------------------------------------
286 -- Category: Methods to create Polygon
287 --------------------------------------
289 --------------------------------------------------
290 -- Summary of Polygons --
292 -- They are limited to one boundary. --
294 -- The boundary should be closed. --
296 -- They should have at least three vertices. --
298 -- They should be planar. --
300 -- They should have a normal. --
302 -- The boundary is drawn only when the interior --
303 -- style is hollow. --
305 -- The boundary have the following attributes : --
308 -- Line Width Scale Factor. --
311 -- They have only interior attributes : --
313 -- Interior Style. --
314 -- Interior Color. --
315 -- Front Material. --
317 --------------------------------------------------
319 Polygon ( me : mutable;
320 ListVertex : Array1OfVertex from Graphic3d;
321 AType : TypeOfPolygon from Graphic3d = Graphic3d_TOP_CONVEX;
322 EvalMinMax : Boolean from Standard = Standard_True )
325 ---Purpose: Links up points to create a face drawn
326 -- using the current fill attributes (AspectFillArea3d))
327 -- The first and last points are not duplicates.
328 ---Category: Methods to create Polygon
330 Polygon ( me : mutable;
331 ListVertex : Array1OfVertex from Graphic3d;
332 Normal : Vector from Graphic3d;
333 AType : TypeOfPolygon from Graphic3d = Graphic3d_TOP_CONVEX;
334 EvalMinMax : Boolean from Standard = Standard_True )
337 ---Purpose: Links up points to create a face drawn
338 -- using the current fill attributes (AspectFillArea3d))
339 -- The first and last points are not duplicates.
340 -- The normal to the polygon is defined normalised.
341 ---Category: Methods to create Polygon
343 Polygon ( me : mutable;
344 ListVertex : Array1OfVertexN from Graphic3d;
345 AType : TypeOfPolygon from Graphic3d = Graphic3d_TOP_CONVEX;
346 EvalMinMax : Boolean from Standard = Standard_True )
349 ---Purpose: Links up points to create a face drawn
350 -- using the current fill attributes (AspectFillArea3d))
351 -- The first and last points are not duplicates.
352 -- The normal is defined and normalised for each vertex.
353 ---Category: Methods to create Polygon
355 Polygon ( me : mutable;
356 ListVertex : Array1OfVertexN from Graphic3d;
357 Normal : Vector from Graphic3d;
358 AType : TypeOfPolygon from Graphic3d = Graphic3d_TOP_CONVEX;
359 EvalMinMax : Boolean from Standard = Standard_True )
362 ---Purpose: Links up points to create a face drawn
363 -- using the current fill attributes (AspectFillArea3d))
364 -- The first and last points are not duplicates.
365 -- The normal is defined for each vertex.
366 -- The normal to the polygon is defined normalised.
367 ---Category: Methods to create Polygon
370 Polygon ( me : mutable;
371 ListVertex : Array1OfVertexNT from Graphic3d;
372 AType : TypeOfPolygon from Graphic3d = Graphic3d_TOP_CONVEX;
373 EvalMinMax : Boolean from Standard = Standard_True )
376 ---Purpose: Links up points to create a face drawn
377 -- using the current fill attributes (AspectFillArea3d))
378 -- The first and last points are not duplicated.
379 -- The normal is defined and normalised for each vertex.
380 -- The texture coordinate is defined for each vertex.
381 ---Category: Methods to create Polygon
385 --------------------------------------------------
386 -- Summary of Polygons with holes --
388 -- They may have multiple boundaries. --
390 -- Each boundary should be closed. --
392 -- Each boundary should have at least three --
395 -- They should be planar. --
397 -- They should have a normal. --
399 -- The boundary is drawn only when the interior --
400 -- style is hollow. --
402 -- The boundary have the following attributes : --
405 -- Line Width Scale Factor. --
408 -- They have only interior attributes : --
410 -- Interior Style. --
411 -- Interior Color. --
412 -- Front Material. --
414 --------------------------------------------------
416 Polygon ( me : mutable;
417 Bounds : Array1OfInteger from TColStd;
418 ListVertex : Array1OfVertex from Graphic3d;
419 EvalMinMax : Boolean from Standard = Standard_True )
422 ---Purpose: Creates a face with holes.
423 -- The face is described by the total number
424 -- of vertices on the external contour and around the holes,
425 -- and by the list of vertices.
426 -- The face will be drawn
427 -- using the current fill attributes (AspectFillArea3d))
428 -- The first and last points are not duplicates.
429 -- Bounds : total number of interior and exterior vertices
430 -- ListVertex : a list of the interior and exterior vertices
431 ---Category: Methods to create Polygon
433 Polygon ( me : mutable;
434 Bounds : Array1OfInteger from TColStd;
435 ListVertex : Array1OfVertex from Graphic3d;
436 Normal : Vector from Graphic3d;
437 EvalMinMax : Boolean from Standard = Standard_True )
440 ---Purpose: Creates a face with holes.
441 -- The face is described by the total number
442 -- of vertices on the external contour and around the holes,
443 -- and by the list of vertices.
444 -- The face will be drawn
445 -- using the current fill attributes (AspectFillArea3d))
446 -- The first and last points are not duplicates.
447 -- The normal to the polygon is normalised.
448 -- Bounds : total number of interior and exterior vertices
449 -- ListVertex : a list of the interior and exterior vertices
450 ---Category: Methods to create Polygon
452 Polygon ( me : mutable;
453 Bounds : Array1OfInteger from TColStd;
454 ListVertex : Array1OfVertexN from Graphic3d;
455 EvalMinMax : Boolean from Standard = Standard_True )
458 ---Purpose: Creates a face with holes.
459 -- The face is described by the total number
460 -- of vertices on the external contour and around the holes,
461 -- and by the list of vertices.
462 -- The face will be drawn
463 -- using the current fill attributes (AspectFillArea3d))
464 -- The first and last points are not duplicates.
465 -- Bounds : total number of interior and exterior vertices
466 -- ListVertex : a list of the interior and exterior vertices
467 ---Category: Methods to create Polygon
469 Polygon ( me : mutable;
470 Bounds : Array1OfInteger from TColStd;
471 ListVertex : Array1OfVertexN from Graphic3d;
472 Normal : Vector from Graphic3d;
473 EvalMinMax : Boolean from Standard = Standard_True )
476 ---Purpose: Creates a face with holes.
477 -- The face is described by the total number
478 -- of vertices on the external contour and around the holes,
479 -- and by the list of vertices.
480 -- The face will be drawn
481 -- using the current fill attributes (AspectFillArea3d))
482 -- The first and last points are not duplicates.
483 -- The normal to the polygon is normalised.
484 -- Bounds : total number of interior and exterior vertices
485 -- ListVertex : a list of the interior and exterior vertices
486 ---Category: Methods to create Polygon
488 PolygonSet ( me : mutable;
489 Bounds : Array1OfInteger from TColStd;
490 ListVertex : Array1OfVertex from Graphic3d;
491 AType : TypeOfPolygon from Graphic3d = Graphic3d_TOP_CONVEX;
492 EvalMinMax : Boolean from Standard = Standard_True )
495 ---Purpose: Links up points to create a set of face drawn
496 -- using the current fill attributes (AspectFillArea3d))
497 -- The first and last points are not duplicates.
498 ---Category: Methods to create Polygon
500 ---------------------------------------
501 -- Category: Methods to create Polyline
502 ---------------------------------------
504 --------------------------------------------
505 -- Summary of Polylines --
507 -- They should have two or more vertices. --
509 -- They have the following attributes. --
512 -- Line Width Scale Factor. --
514 --------------------------------------------
516 Polyline ( me : mutable;
517 APT1 : Vertex from Graphic3d;
518 APT2 : Vertex from Graphic3d;
519 EvalMinMax : Boolean from Standard = Standard_True )
522 ---Purpose: Links up points to create a line drawn
523 -- using the current line attributes (AspectLine)
524 ---Category: Methods to create Polyline
526 Polyline ( me : mutable;
527 ListVertex : Array1OfVertex from Graphic3d;
528 EvalMinMax : Boolean from Standard = Standard_True )
531 ---Purpose: Links up points to create a line drawn
532 -- using the current line attributes (AspectLine)
533 ---Category: Methods to create Polyline
535 Polyline ( me : mutable;
536 ListVertex : Array1OfVertexC from Graphic3d;
537 EvalMinMax : Boolean from Standard = Standard_True )
540 ---Purpose: Links up points to create a line drawn
541 -- using the current line attributes (AspectLine)
542 -- except for the colour which is defined
544 ---Category: Methods to create Polyline
546 -----------------------------------------
547 -- Category: Methods to create Quadrangle
548 -----------------------------------------
550 QuadrangleMesh ( me : mutable;
551 ListVertex : Array2OfVertex from Graphic3d;
552 EvalMinMax : Boolean from Standard = Standard_True )
554 ---Purpose: Creates a group of quadrilaterals from a list of
555 -- points, such that their vertices are:
556 -- Ki,j; Ki,j+1; Ki+1,j+1; Ki+1,j.
557 -- The quadrilaterals will be drawn according to the
558 -- current attributes (AspectFillArea3d).
559 -- Category: Methods to create Quadrangle
560 -- Warning: Raises GroupDefinitionError if <ListVertex> contains
561 -- less than four points.
562 raises GroupDefinitionError from Graphic3d is static;
564 QuadrangleMesh ( me : mutable;
565 ListVertex : Array2OfVertexN from Graphic3d;
566 EvalMinMax : Boolean from Standard = Standard_True )
568 ---Purpose: Creates a group of quadrilaterals from a list of
569 -- points, such that their vertices are:
570 -- Ki,j; Ki,j+1; Ki+1,j+1; Ki+1,j.
571 -- The quadrilaterals will be drawn according to the
572 -- current attributes (AspectFillArea3d).
573 -- For each vertex the normal is given.
574 -- Category: Methods to create Quadrangle
575 -- Warning: Raises GroupDefinitionError if <ListVertex> contains
576 -- less than four points.
577 raises GroupDefinitionError from Graphic3d is static;
579 QuadrangleMesh ( me : mutable;
580 ListVertex : Array2OfVertexNT from Graphic3d;
581 EvalMinMax : Boolean from Standard = Standard_True )
583 ---Purpose: Creates a group of quadrilaterals from a list of
584 -- points, such that their vertices are:
585 -- Ki,j; Ki,j+1; Ki+1,j+1; Ki+1,j.
586 -- The quadrilaterals will be drawn according to the
587 -- current attributes (AspectFillArea3d).
588 -- For each vertex the normal is given.
589 -- For each vertex a texture coordinate is given.
590 -- Category: Methods to create Quadrangle
591 -- Warning: Raises GroupDefinitionError if <ListVertex> contains
592 -- less than four points.
593 raises GroupDefinitionError from Graphic3d is static;
595 -----------------------------------
596 -- Category: Methods to create Text
597 -----------------------------------
599 --------------------------------------------
600 -- Summary of Texts --
602 -- Text has geometric and nongeometric --
605 -- The geometric text attributes are : --
607 -- Character Height. --
608 -- Character Up Vector. --
610 -- Text Alignment Horizontal. --
611 -- Text Alignment Vertical. --
613 -- The nongeometric text attributes are : --
616 -- Character Spacing. --
617 -- Character Expansion Factor. --
619 --------------------------------------------
622 AText : CString from Standard;
623 APoint : Vertex from Graphic3d;
624 AHeight : Real from Standard;
625 AAngle : PlaneAngle from Quantity;
626 ATp : TextPath from Graphic3d;
627 AHta : HorizontalTextAlignment from Graphic3d;
628 AVta : VerticalTextAlignment from Graphic3d;
629 EvalMinMax : Boolean from Standard = Standard_True )
632 ---Purpose: Creates the string <AText> at position <APoint>.
633 -- The 3D point of attachment is projected. The text is
634 -- written in the plane of projection.
635 -- The attributes are given with respect to the plane of
637 -- AHeight : Height of text.
638 -- (Relative to the Normalized Projection
639 -- Coordinates (NPC) Space).
640 -- AAngle : Orientation of the text
641 -- (with respect to the horizontal).
642 ---Category: Methods to create Text
645 AText : CString from Standard;
646 APoint : Vertex from Graphic3d;
647 AHeight : Real from Standard;
648 EvalMinMax : Boolean from Standard = Standard_True )
651 ---Purpose: Creates the string <AText> at position <APoint>.
652 -- The 3D point of attachment is projected. The text is
653 -- written in the plane of projection.
654 -- The attributes are given with respect to the plane of
656 -- AHeight : Height of text.
657 -- (Relative to the Normalized Projection
658 -- Coordinates (NPC) Space).
659 -- The other attributes have the following default values:
664 ---Category: Methods to create Text
667 AText : ExtendedString from TCollection;
668 APoint : Vertex from Graphic3d;
669 AHeight : Real from Standard;
670 AAngle : PlaneAngle from Quantity;
671 ATp : TextPath from Graphic3d;
672 AHta : HorizontalTextAlignment from Graphic3d;
673 AVta : VerticalTextAlignment from Graphic3d;
674 EvalMinMax : Boolean from Standard = Standard_True )
677 ---Purpose: Creates the string <AText> at position <APoint>.
678 -- The 3D point of attachment is projected. The text is
679 -- written in the plane of projection.
680 -- The attributes are given with respect to the plane of
682 -- AHeight : Height of text.
683 -- (Relative to the Normalized Projection
684 -- Coordinates (NPC) Space).
685 -- AAngle : Orientation of the text
686 -- (with respect to the horizontal).
687 ---Category: Methods to create Text
690 AText : ExtendedString from TCollection;
691 APoint : Vertex from Graphic3d;
692 AHeight : Real from Standard;
693 EvalMinMax : Boolean from Standard = Standard_True )
696 ---Purpose: Creates the string <AText> at position <APoint>.
697 -- The 3D point of attachment is projected. The text is
698 -- written in the plane of projection.
699 -- The attributes are given with respect to the plane of
701 -- AHeight : Height of text.
702 -- (Relative to the Normalized Projection
703 -- Coordinates (NPC) Space).
704 -- The other attributes have the following default values:
709 ---Category: Methods to create Text
711 ---------------------------------------
712 ---Category: Methods to create Triangle
713 ---------------------------------------
715 TriangleMesh ( me : mutable;
716 ListVertex : Array1OfVertex from Graphic3d;
717 EvalMinMax : Boolean from Standard = Standard_True )
719 ---Purpose: Creates triangles from an array of points such that
720 -- the Kth triangle contains the vertices K, K+1, K+2.
721 -- The triangle will be drawn using the current fill
722 -- attributes (AspectFillArea3d)
723 -- Category: Methods to create Triangle
724 -- Warning: Raises GroupDefinitionError if <ListVertex> contains
725 -- less than three points.
726 raises GroupDefinitionError from Graphic3d is static;
728 TriangleMesh ( me : mutable;
729 ListVertex : Array1OfVertexN from Graphic3d;
730 EvalMinMax : Boolean from Standard = Standard_True )
732 ---Purpose: Creates triangles from an array of points such that
733 -- the Kth triangle contains the vertices K, K+1, K+2.
734 -- The triangle will be drawn using the current fill
735 -- attributes (AspectFillArea3d)
736 -- The normal is given for each vertex.
737 -- Category: Methods to create Triangle
738 -- Warning: Raises GroupDefinitionError if <ListVertex> contains
739 -- less than three points.
740 raises GroupDefinitionError from Graphic3d is static;
742 TriangleMesh ( me : mutable;
743 ListVertex : Array1OfVertexNT from Graphic3d;
744 EvalMinMax : Boolean from Standard = Standard_True )
746 ---Purpose: Creates triangles from an array of points such that
747 -- the Kth triangle contains the vertices K, K+1, K+2.
748 -- The triangle will be drawn using the current fill
749 -- attributes (AspectFillArea3d)
750 -- The normal is given for each vertex.
751 -- A texture coordinate is given for each vertex.
752 -- Category: Methods to create Triangle
753 -- Warning: Raises GroupDefinitionError if <ListVertex> contains
754 -- less than three points.
755 raises GroupDefinitionError from Graphic3d is static;
757 TriangleSet ( me : mutable;
758 ListVertex : Array1OfVertex from Graphic3d;
759 ListEdge : Array1OfEdge from Aspect;
760 EvalMinMax : Boolean from Standard = Standard_True )
762 ---Purpose: Creates a group of triangles defined by a table of
763 -- vertices and a table of edges, visible or not.
764 -- Category: Methods to create Triangle
765 -- Warning: Raises GroupDefinitionError if <ListVertex> contains
766 -- less than three points or if <ListEdge> contains
767 -- less than three edges.
768 raises GroupDefinitionError from Graphic3d is static;
770 TriangleSet ( me : mutable;
771 ListVertex : Array1OfVertexN from Graphic3d;
772 ListEdge : Array1OfEdge from Aspect;
773 EvalMinMax : Boolean from Standard = Standard_True )
775 ---Purpose: Creates a group of triangles defined by a table of
776 -- vertices and a table of edges, visible or not.
777 -- For each vertex the normal is given.
778 -- Category: Methods to create Triangle
779 -- Warning: Raises GroupDefinitionError if <ListVertex> contains
780 -- less than three points or if <ListEdge> contains
781 -- less than three edges.
782 raises GroupDefinitionError from Graphic3d is static;
784 TriangleSet ( me : mutable;
785 ListVertex : Array1OfVertexNT from Graphic3d;
786 ListEdge : Array1OfEdge from Aspect;
787 EvalMinMax : Boolean from Standard = Standard_True )
789 ---Purpose: Creates a group of triangles defined by a table of
790 -- vertices and a table of edges, visible or not.
791 -- For each vertex the normal is given.
792 -- For each vertex a texture coordinate is given.
793 -- Category: Methods to create Triangle
794 -- Warning: Raises GroupDefinitionError if <ListVertex> contains
795 -- less than three points or if <ListEdge> contains
796 -- less than three edges.
797 raises GroupDefinitionError from Graphic3d is static;
799 TriangleSet ( me : mutable;
800 ListVertex : Array1OfVertexC from Graphic3d;
801 ListEdge : Array1OfEdge from Aspect;
802 EvalMinMax : Boolean from Standard = Standard_True )
804 ---Purpose: Creates a group of triangles defined by a table of
805 -- vertices and a table of edges, visible or not.
806 -- For each vertex the color is given.
807 -- Category: Methods to create Triangle
808 -- Warning: Raises GroupDefinitionError if <ListVertex> contains
809 -- less than three points or if <ListEdge> contains
810 -- less than three edges.
811 raises GroupDefinitionError from Graphic3d is static;
813 TriangleSet ( me : mutable;
814 ListVertex : Array1OfVertexNC from Graphic3d;
815 ListEdge : Array1OfEdge from Aspect;
816 EvalMinMax : Boolean from Standard = Standard_True )
818 ---Purpose: Creates a group of triangles defined by a table of
819 -- vertices and a table of edges, visible or not.
820 -- For each vertex the normal and the color are given.
821 -- Category: Methods to create Triangle
822 -- Warning: Raises GroupDefinitionError if <ListVertex> contains
823 -- less than three points or if <ListEdge> contains
824 -- less than three edges.
825 raises GroupDefinitionError from Graphic3d is static;
827 AddPrimitiveArray( me : mutable;
828 elem : ArrayOfPrimitives from Graphic3d;
829 EvalMinMax: Boolean from Standard = Standard_True );
831 ---Purpose: Adds an array of primitives for display
833 RemovePrimitiveArray( me : mutable;
834 aRank : Integer from Standard)
836 ---Purpose: Remove the array of primitives of rank <aRank>
837 raises OutOfRange from Standard is static;
838 -- if <aRank> is < 1 or > ArrayNumber()
840 RemovePrimitiveArrays( me : mutable);
842 ---Purpose: Remove all array of primitives
844 UserDraw ( me : mutable;
845 AnObject : Address from Standard;
846 EvalMinMax : Boolean from Standard = Standard_True;
847 ContainsFacet: Boolean from Standard = Standard_False
850 ---Purpose: Creates an UserDraw primitive
851 -- Category: Methods to create UserDraw
852 -- Warning: Raises GroupDefinitionError if ...
853 raises GroupDefinitionError from Graphic3d is static;
855 ----------------------------
856 -- Category: Inquire methods
857 ----------------------------
860 returns Integer from Standard;
862 ---Purpose: Returns the number of primitive array added in this group
864 InitDefinedArray( me:mutable );
866 ---Purpose: Initialize the array list iterator.
868 NextDefinedArray( me:mutable );
870 ---Purpose: Increments the array list iterator.
872 MoreDefinedArray( me:mutable )
873 returns Boolean from Standard;
875 ---Purpose: Returns TRUE if more array exists in the list.
878 returns mutable ArrayOfPrimitives from Graphic3d;
880 ---Purpose: Returns the current array of primitives according
881 -- to the array list iterator value.
883 IsGroupPrimitivesAspectSet ( me;
884 theAspect : GroupAspect from Graphic3d )
885 returns Boolean from Standard
888 ---Purpose: Returns TRUE if aspect is set for the group.
889 ---Category: Inquire methods
891 GroupPrimitivesAspect ( me;
892 CTXL : AspectLine3d from Graphic3d;
893 CTXT : AspectText3d from Graphic3d;
894 CTXM : AspectMarker3d from Graphic3d;
895 CTXF : AspectFillArea3d from Graphic3d )
898 ---Purpose: Returns the context of all the primitives of the group.
899 ---Category: Inquire methods
901 PrimitivesAspect ( me;
902 CTXL : AspectLine3d from Graphic3d;
903 CTXT : AspectText3d from Graphic3d;
904 CTXM : AspectMarker3d from Graphic3d;
905 CTXF : AspectFillArea3d from Graphic3d )
908 ---Purpose: Returns the last inserted context in the group <me>
909 -- foreach kind of primitives.
910 ---Category: Inquire methods
913 returns Boolean from Standard
916 ---Purpose: Returns Standard_True if the group <me> contains
917 -- Polygons, Triangles or Quadrangles.
918 ---Category: Inquire methods
921 returns Boolean from Standard
924 ---Purpose: Returns Standard_True if the group <me> is deleted.
925 -- <me> is deleted after the call Remove (me) or the
926 -- associated structure is deleted.
927 ---Category: Inquire methods
930 returns Boolean from Standard
933 ---Purpose: Returns Standard_True if the group <me> is empty.
934 ---Warning: A group is empty if the MinMaxValues method returns :
935 -- XMin = YMin = ZMin = RealFirst ().
936 -- XMax = YMax = ZMax = RealLast ().
937 ---Category: Inquire methods
940 XMin, YMin, ZMin : out Real from Standard;
941 XMax, YMax, ZMax : out Real from Standard )
944 ---Purpose: Returns the coordinates of the boundary box of the
946 ---Warning: If the group <me> is empty then :
947 -- XMin = YMin = ZMin = RealFirst ().
948 -- XMax = YMax = ZMax = RealLast ().
949 ---Category: Inquire methods
952 returns mutable Structure from Graphic3d
955 ---Purpose: Returns the structure containing the group <me>.
956 ---Category: Inquire methods
958 ----------------------------
959 -- Category: Private methods
960 ----------------------------
963 LB, LE : in out Integer from Standard )
966 ---Purpose: Returns the position of the group in the structure.
967 ---Category: Private methods
970 XMin, YMin, ZMin : out Real from Standard;
971 XMax, YMax, ZMax : out Real from Standard )
974 ---Purpose: Returns the extreme coordinates found in the group.
975 ---Warning: If the group <me> is empty then :
976 -- XMin = YMin = ZMin = RealFirst ().
977 -- XMax = YMax = ZMax = RealLast ().
978 ---Category: Private methods
983 ---Purpose: Calls the Update method of the StructureManager which
984 -- contains the associated Structure of the Group <me>.
985 ---Category: Private methods
987 -----------------------------
988 -- Category: Internal methods
989 -----------------------------
991 BeginPrimitives ( me : mutable )
994 ---Category: Internal methods
996 EndPrimitives ( me : mutable )
999 ---Category: Internal methods
1001 Bezier ( me : mutable;
1002 ListVertex : Array1OfVertex from Graphic3d;
1003 EvalMinMax : Boolean from Standard = Standard_True )
1005 ---Purpose: Creates a non rational Bezier curve with a set of poles :
1006 -- ListVertex. The weights are defaulted to all being 1.
1007 -- Category: Methods to create Curve
1008 -- Warning: Raises GroupDefinitionError if <ListVertex> contains
1009 -- less than two points.
1010 raises GroupDefinitionError from Graphic3d is static;
1012 Bezier ( me : mutable;
1013 ListVertex : Array1OfVertex from Graphic3d;
1014 ListWeight : Array1OfReal from TColStd;
1015 EvalMinMax : Boolean from Standard = Standard_True )
1017 ---Purpose: Creates a non rational Bezier curve with a set of poles :
1018 -- ListVertex and the set of weights ListWeight.
1019 -- If all the weights are identical the curve is considered
1021 -- Category: Methods to create Curve
1022 -- Warning: Raises GroupDefinitionError if <ListVertex> contains
1023 -- less than two points or <ListVertex> and <ListWeight>
1024 -- have not the same length or one weight value is lower
1025 -- or equal to Resolution from package gp.
1026 raises GroupDefinitionError from Graphic3d is static;
1033 -- Class : Graphic3d_Group
1035 -- Purpose : Declaration of variables specific to groups
1038 -- Reminder : A group is defined in a structure
1039 -- It acts as the smallest editable entity.
1041 -- the associated C structure
1042 MyCGroup : CGroup from Graphic3d;
1044 -- the graphic driver used
1045 MyGraphicDriver : GraphicDriver from Graphic3d;
1047 -- the state of the different contexts for primitives
1048 MyCBitFields : CBitFields4 from Graphic3d;
1050 -- the structure contains the group
1051 MyPtrStructure : Address from Standard;
1054 MyBounds : CBounds from Graphic3d;
1056 MyListOfPArray : ListOfPArray from Graphic3d;
1057 MyListOfPArrayIterator : ListIteratorOfListOfPArray from Graphic3d;
1059 MyMarkArray : HArray1OfByte from TColStd;
1060 MyMarkWidth : Integer from Standard;
1061 MyMarkHeight : Integer from Standard;
1065 Remove from class Structure from Graphic3d
1066 ( me : mutable; AGroup : Group from Graphic3d )