1 -- Created on: 2001-01-04
2 -- Copyright (c) 2001-2012 OPEN CASCADE SAS
4 -- The content of this file is subject to the Open CASCADE Technology Public
5 -- License Version 6.5 (the "License"). You may not use the content of this file
6 -- except in compliance with the License. Please obtain a copy of the License
7 -- at http://www.opencascade.org and read it completely before using this file.
9 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
10 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
12 -- The Original Code and all software distributed under the License is
13 -- distributed on an "AS IS" basis, without warranty of any kind, and the
14 -- Initial Developer hereby disclaims all such warranties, including without
15 -- limitation, any warranties of merchantability, fitness for a particular
16 -- purpose or non-infringement. Please see the License for the specific terms
17 -- and conditions governing the rights and limitations under the License.
20 class ArrayOfPolygons from Graphic3d inherits ArrayOfPrimitives from Graphic3d
26 maxVertexs: Integer from Standard;
27 maxBounds: Integer from Standard = 0;
28 maxEdges: Integer from Standard = 0;
29 hasVNormals: Boolean from Standard = Standard_False;
30 hasVColors: Boolean from Standard = Standard_False;
31 hasBColors: Boolean from Standard = Standard_False;
32 hasTexels: Boolean from Standard = Standard_False;
33 hasEdgeInfos: Boolean from Standard = Standard_False)
34 returns mutable ArrayOfPolygons from Graphic3d;
35 ---Purpose: Creates an array of polygons,
36 -- a polygon can be filled as:
37 -- 1) creating a single polygon defined with his vertexs.
39 -- myArray = Graphic3d_ArrayOfPolygons(7)
40 -- myArray->AddVertex(x1,y1,z1)
42 -- myArray->AddVertex(x7,y7,z7)
43 -- 2) creating separate polygons defined with a predefined
44 -- number of bounds and the number of vertex per bound.
46 -- myArray = Graphic3d_ArrayOfPolygons(7,2)
47 -- myArray->AddBound(4)
48 -- myArray->AddVertex(x1,y1,z1)
50 -- myArray->AddVertex(x4,y4,z4)
51 -- myArray->AddBound(3)
52 -- myArray->AddVertex(x5,y5,z5)
54 -- myArray->AddVertex(x7,y7,z7)
55 -- 3) creating a single indexed polygon defined with his vertex
58 -- myArray = Graphic3d_ArrayOfPolygons(4,0,6)
59 -- myArray->AddVertex(x1,y1,z1)
61 -- myArray->AddVertex(x4,y4,z4)
62 -- myArray->AddEdge(1)
63 -- myArray->AddEdge(2)
64 -- myArray->AddEdge(3)
65 -- myArray->AddEdge(1)
66 -- myArray->AddEdge(2)
67 -- myArray->AddEdge(4)
68 -- 4) creating separate polygons defined with a predefined
69 -- number of bounds and the number of edges per bound.
71 -- myArray = Graphic3d_ArrayOfPolygons(6,4,14)
72 -- myArray->AddBound(3)
73 -- myArray->AddVertex(x1,y1,z1)
74 -- myArray->AddVertex(x2,y2,z2)
75 -- myArray->AddVertex(x3,y3,z3)
76 -- myArray->AddEdge(1)
77 -- myArray->AddEdge(2)
78 -- myArray->AddEdge(3)
79 -- myArray->AddBound(3)
80 -- myArray->AddVertex(x4,y4,z4)
81 -- myArray->AddVertex(x5,y5,z5)
82 -- myArray->AddVertex(x6,y6,z6)
83 -- myArray->AddEdge(4)
84 -- myArray->AddEdge(5)
85 -- myArray->AddEdge(6)
86 -- myArray->AddBound(4)
87 -- myArray->AddEdge(2)
88 -- myArray->AddEdge(3)
89 -- myArray->AddEdge(5)
90 -- myArray->AddEdge(6)
91 -- myArray->AddBound(4)
92 -- myArray->AddEdge(1)
93 -- myArray->AddEdge(3)
94 -- myArray->AddEdge(5)
95 -- myArray->AddEdge(4)
96 -- <maxVertexs> defined the maximun allowed vertex number in the array.
97 -- <maxBounds> defined the maximun allowed bound number in the array.
98 -- <maxEdges> defined the maximun allowed edge number in the array.
100 -- When <hasVNormals> is TRUE , you must use one of
101 -- AddVertex(Point,Normal)
102 -- or AddVertex(Point,Normal,Color)
103 -- or AddVertex(Point,Normal,Texel) methods.
104 -- When <hasVColors> is TRUE , you must use one of
105 -- AddVertex(Point,Color)
106 -- or AddVertex(Point,Normal,Color) methods.
107 -- When <hasTexels> is TRUE , you must use one of
108 -- AddVertex(Point,Texel)
109 -- or AddVertex(Point,Normal,Texel) methods.
110 -- When <hasBColors> is TRUE , <maxBounds> must be > 0 and
112 -- AddBound(number,Color) method.
113 -- When <hasEdgeInfos> is TRUE , <maxEdges> must be > 0 and
115 -- AddEdge(number,visibillity) method.
117 -- the user is responsible about the orientation of the polygon
118 -- depending of the order of the created vertex or edges and this
119 -- orientation must be coherent with the vertex normal optionnaly
120 -- given at each vertex (See the Orientate() methods).