| 1 | -- Created on: 1993-07-29 |
| 2 | -- Created by: Remi LEQUETTE |
| 3 | -- Copyright (c) 1993-1999 Matra Datavision |
| 4 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS |
| 5 | -- |
| 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. |
| 10 | -- |
| 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. |
| 13 | -- |
| 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. |
| 20 | |
| 21 | |
| 22 | |
| 23 | class MakePolygon from BRepLib inherits MakeShape from BRepLib |
| 24 | |
| 25 | ---Purpose: Class to build polygonal wires. |
| 26 | -- |
| 27 | -- A polygonal wire may be build from |
| 28 | -- |
| 29 | -- - 2,4,3 points. |
| 30 | -- |
| 31 | -- - 2,3,4 vertices. |
| 32 | -- |
| 33 | -- - any number of points. |
| 34 | -- |
| 35 | -- - any number of vertices. |
| 36 | -- |
| 37 | -- |
| 38 | -- When a point or vertex is added to the polygon if |
| 39 | -- it is identic to the previous point no edge is |
| 40 | -- built. The method added can be used to test it. |
| 41 | |
| 42 | uses |
| 43 | Wire from TopoDS, |
| 44 | Edge from TopoDS, |
| 45 | Vertex from TopoDS, |
| 46 | Pnt from gp |
| 47 | |
| 48 | raises |
| 49 | NotDone from StdFail |
| 50 | |
| 51 | is |
| 52 | Create |
| 53 | returns MakePolygon from BRepLib; |
| 54 | ---Purpose: Creates an empty MakePolygon. |
| 55 | ---Level: Public |
| 56 | |
| 57 | Create(P1, P2 : Pnt from gp) |
| 58 | ---Level: Public |
| 59 | returns MakePolygon from BRepLib; |
| 60 | |
| 61 | Create(P1, P2, P3 : Pnt from gp; |
| 62 | Close : Boolean = Standard_False) |
| 63 | ---Level: Public |
| 64 | returns MakePolygon from BRepLib; |
| 65 | |
| 66 | Create(P1, P2, P3, P4 : Pnt from gp; |
| 67 | Close : Boolean = Standard_False) |
| 68 | ---Level: Public |
| 69 | returns MakePolygon from BRepLib; |
| 70 | |
| 71 | Create(V1, V2 : Vertex from TopoDS) |
| 72 | ---Level: Public |
| 73 | returns MakePolygon from BRepLib; |
| 74 | |
| 75 | Create(V1, V2, V3 : Vertex from TopoDS; |
| 76 | Close : Boolean = Standard_False) |
| 77 | ---Level: Public |
| 78 | returns MakePolygon from BRepLib; |
| 79 | |
| 80 | Create(V1, V2, V3, V4 : Vertex from TopoDS; |
| 81 | Close : Boolean = Standard_False) |
| 82 | ---Level: Public |
| 83 | returns MakePolygon from BRepLib; |
| 84 | |
| 85 | |
| 86 | Add(me : in out; P : Pnt from gp) |
| 87 | ---Level: Public |
| 88 | is static; |
| 89 | |
| 90 | Add(me : in out; V : Vertex from TopoDS) |
| 91 | ---Level: Public |
| 92 | is static; |
| 93 | |
| 94 | Added(me) returns Boolean |
| 95 | ---Purpose: Returns True if the last vertex or point was |
| 96 | -- succesfully added. |
| 97 | ---Level: Public |
| 98 | is static; |
| 99 | |
| 100 | Close(me : in out) |
| 101 | ---Level: Public |
| 102 | is static; |
| 103 | |
| 104 | FirstVertex(me) returns Vertex from TopoDS |
| 105 | ---C++: return const & |
| 106 | ---Level: Public |
| 107 | is static; |
| 108 | |
| 109 | LastVertex(me) returns Vertex from TopoDS |
| 110 | ---C++: return const & |
| 111 | ---Level: Public |
| 112 | is static; |
| 113 | |
| 114 | Edge(me) returns Edge from TopoDS |
| 115 | ---Purpose: Returns the last edge added to the polygon. |
| 116 | -- |
| 117 | ---C++: return const & |
| 118 | ---C++: alias "Standard_EXPORT operator TopoDS_Edge() const;" |
| 119 | ---Level: Public |
| 120 | raises |
| 121 | NotDone from StdFail |
| 122 | is static; |
| 123 | |
| 124 | Wire(me) returns Wire from TopoDS |
| 125 | ---C++: return const & |
| 126 | ---C++: alias "Standard_EXPORT operator TopoDS_Wire() const;" |
| 127 | ---Level: Public |
| 128 | raises |
| 129 | NotDone from StdFail |
| 130 | is static; |
| 131 | |
| 132 | fields |
| 133 | |
| 134 | myFirstVertex : Vertex from TopoDS; |
| 135 | myLastVertex : Vertex from TopoDS; |
| 136 | myEdge : Edge from TopoDS; |
| 137 | |
| 138 | end MakePolygon; |