|
Open CASCADE Technology
6.7.1
|
Describes functions to build polygonal wires. A
polygonal wire can be built from any number of points
or vertices, and consists of a sequence of connected
rectilinear edges.
When a point or vertex is added to the polygon if
it is identic to the previous point no edge is
built. The method added can be used to test it.
Construction of a Polygonal Wire
You can construct:
More...
#include <BRepBuilderAPI_MakePolygon.hxx>

Public Member Functions | |
| BRepBuilderAPI_MakePolygon () | |
Initializes an empty polygonal wire, to which points or <br> vertices are added using the Add function. | |
| BRepBuilderAPI_MakePolygon (const gp_Pnt &P1, const gp_Pnt &P2) | |
| BRepBuilderAPI_MakePolygon (const gp_Pnt &P1, const gp_Pnt &P2, const gp_Pnt &P3, const Standard_Boolean Close=Standard_False) | |
| BRepBuilderAPI_MakePolygon (const gp_Pnt &P1, const gp_Pnt &P2, const gp_Pnt &P3, const gp_Pnt &P4, const Standard_Boolean Close=Standard_False) | |
Constructs a polygonal wire from 2, 3 or 4 points. Vertices are <br> automatically created on the given points. The polygonal wire is | |
| BRepBuilderAPI_MakePolygon (const TopoDS_Vertex &V1, const TopoDS_Vertex &V2) | |
| BRepBuilderAPI_MakePolygon (const TopoDS_Vertex &V1, const TopoDS_Vertex &V2, const TopoDS_Vertex &V3, const Standard_Boolean Close=Standard_False) | |
| BRepBuilderAPI_MakePolygon (const TopoDS_Vertex &V1, const TopoDS_Vertex &V2, const TopoDS_Vertex &V3, const TopoDS_Vertex &V4, const Standard_Boolean Close=Standard_False) | |
Constructs a polygonal wire from <br> 2, 3 or 4 vertices. The polygonal wire is closed if Close is true; | |
| void | Add (const gp_Pnt &P) |
| void | Add (const TopoDS_Vertex &V) |
| Adds the point P or the vertex V at the end of the polygonal wire under construction. A vertex is automatically created on the point P. Warning More... | |
| Standard_Boolean | Added () const |
Returns true if the last vertex added to the constructed <br> polygonal wire is not coincident with the previous one. | |
| void | Close () |
Closes the polygonal wire under construction. Note - this <br> is equivalent to adding the first vertex to the polygonal | |
| const TopoDS_Vertex & | FirstVertex () const |
| const TopoDS_Vertex & | LastVertex () const |
Returns the first or the last vertex of the polygonal wire under construction. <br> If the constructed polygonal wire is closed, the first and the last vertices are identical. | |
| virtual Standard_Boolean | IsDone () const |
| Returns true if this algorithm contains a valid polygonal wire (i.e. if there is at least one edge). IsDone returns false if fewer than two vertices have been chained together by this construction algorithm. More... | |
| const TopoDS_Edge & | Edge () const |
Returns the edge built between the last two points or <br> vertices added to the constructed polygonal wire under construction. | |
| operator TopoDS_Edge () const | |
| const TopoDS_Wire & | Wire () const |
| Returns the constructed polygonal wire, or the already built part of the polygonal wire under construction. Exceptions StdFail_NotDone if the wire is not built, i.e. if fewer than two vertices have been chained together by this construction algorithm. More... | |
| operator TopoDS_Wire () const | |
Public Member Functions inherited from BRepBuilderAPI_MakeShape | |
| virtual void | Delete () |
| virtual | ~BRepBuilderAPI_MakeShape () |
| virtual void | Build () |
| This is called by Shape(). It does nothing but may be redefined. More... | |
| const TopoDS_Shape & | Shape () const |
Returns a shape built by the shape construction algorithm. <br> Raises exception StdFail_NotDone if the shape was not built. | |
| operator TopoDS_Shape () const | |
| virtual const TopTools_ListOfShape & | Generated (const TopoDS_Shape &S) |
| Returns the list of shapes generated from the shape <S>. More... | |
| virtual const TopTools_ListOfShape & | Modified (const TopoDS_Shape &S) |
| Returns the list of shapes modified from the shape <S>. More... | |
| virtual Standard_Boolean | IsDeleted (const TopoDS_Shape &S) |
| Returns true if the shape S has been deleted. More... | |
Public Member Functions inherited from BRepBuilderAPI_Command | |
| virtual | ~BRepBuilderAPI_Command () |
| void | Check () const |
| Raises NotDone if done is false. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from BRepBuilderAPI_MakeShape | |
| BRepBuilderAPI_MakeShape () | |
Protected Member Functions inherited from BRepBuilderAPI_Command | |
| BRepBuilderAPI_Command () | |
| Set done to False. More... | |
| void | Done () |
| Set done to true. More... | |
| void | NotDone () |
| Set done to false. More... | |
Protected Attributes inherited from BRepBuilderAPI_MakeShape | |
| TopoDS_Shape | myShape |
| TopTools_ListOfShape | myGenerated |
Describes functions to build polygonal wires. A
polygonal wire can be built from any number of points
or vertices, and consists of a sequence of connected
rectilinear edges.
When a point or vertex is added to the polygon if
it is identic to the previous point no edge is
built. The method added can be used to test it.
Construction of a Polygonal Wire
You can construct:
an empty polygonal wire and add its points or
vertices in sequence (unlimited number).
A MakePolygon object provides a framework for:
| BRepBuilderAPI_MakePolygon::BRepBuilderAPI_MakePolygon | ( | ) |
Initializes an empty polygonal wire, to which points or <br>
vertices are added using the Add function.
As soon as the polygonal wire under construction
contains vertices, it can be consulted using the Wire function.
| BRepBuilderAPI_MakePolygon::BRepBuilderAPI_MakePolygon | ( | const gp_Pnt & | P1, |
| const gp_Pnt & | P2, | ||
| const gp_Pnt & | P3, | ||
| const Standard_Boolean | Close = Standard_False |
||
| ) |
| BRepBuilderAPI_MakePolygon::BRepBuilderAPI_MakePolygon | ( | const gp_Pnt & | P1, |
| const gp_Pnt & | P2, | ||
| const gp_Pnt & | P3, | ||
| const gp_Pnt & | P4, | ||
| const Standard_Boolean | Close = Standard_False |
||
| ) |
Constructs a polygonal wire from 2, 3 or 4 points. Vertices are <br>
automatically created on the given points. The polygonal wire is
closed if Close is true; otherwise it is open. Further vertices can
be added using the Add function. The polygonal wire under
construction can be consulted at any time by using the Wire function.
Example
//an open polygon from four points
TopoDS_Wire W = BRepBuilderAPI_MakePolygon(P1,P2,P3,P4);
Warning: The process is equivalent to:
| BRepBuilderAPI_MakePolygon::BRepBuilderAPI_MakePolygon | ( | const TopoDS_Vertex & | V1, |
| const TopoDS_Vertex & | V2 | ||
| ) |
| BRepBuilderAPI_MakePolygon::BRepBuilderAPI_MakePolygon | ( | const TopoDS_Vertex & | V1, |
| const TopoDS_Vertex & | V2, | ||
| const TopoDS_Vertex & | V3, | ||
| const Standard_Boolean | Close = Standard_False |
||
| ) |
| BRepBuilderAPI_MakePolygon::BRepBuilderAPI_MakePolygon | ( | const TopoDS_Vertex & | V1, |
| const TopoDS_Vertex & | V2, | ||
| const TopoDS_Vertex & | V3, | ||
| const TopoDS_Vertex & | V4, | ||
| const Standard_Boolean | Close = Standard_False |
||
| ) |
Constructs a polygonal wire from <br>
2, 3 or 4 vertices. The polygonal wire is closed if Close is true;
otherwise it is open (default value). Further vertices can be
added using the Add function. The polygonal wire under
construction can be consulted at any time by using the Wire function.
Example
//a closed triangle from three vertices
TopoDS_Wire W = BRepBuilderAPI_MakePolygon(V1,V2,V3,Standard_True);
Warning
The process is equivalent to:
| void BRepBuilderAPI_MakePolygon::Add | ( | const gp_Pnt & | P | ) |
| void BRepBuilderAPI_MakePolygon::Add | ( | const TopoDS_Vertex & | V | ) |
Adds the point P or the vertex V at the end of the
polygonal wire under construction. A vertex is
automatically created on the point P.
Warning
| Standard_Boolean BRepBuilderAPI_MakePolygon::Added | ( | ) | const |
Returns true if the last vertex added to the constructed <br>
polygonal wire is not coincident with the previous one.
| void BRepBuilderAPI_MakePolygon::Close | ( | ) |
Closes the polygonal wire under construction. Note - this <br>
is equivalent to adding the first vertex to the polygonal
wire under construction.
| const TopoDS_Edge& BRepBuilderAPI_MakePolygon::Edge | ( | ) | const |
Returns the edge built between the last two points or <br>
vertices added to the constructed polygonal wire under construction.
Warning
If there is only one vertex in the polygonal wire, the result is a null edge.
| const TopoDS_Vertex& BRepBuilderAPI_MakePolygon::FirstVertex | ( | ) | const |
|
virtual |
Returns true if this algorithm contains a valid polygonal
wire (i.e. if there is at least one edge).
IsDone returns false if fewer than two vertices have
been chained together by this construction algorithm.
Reimplemented from BRepBuilderAPI_Command.
| const TopoDS_Vertex& BRepBuilderAPI_MakePolygon::LastVertex | ( | ) | const |
Returns the first or the last vertex of the polygonal wire under construction. <br>
If the constructed polygonal wire is closed, the first and the last vertices are identical.
| BRepBuilderAPI_MakePolygon::operator TopoDS_Edge | ( | ) | const |
| BRepBuilderAPI_MakePolygon::operator TopoDS_Wire | ( | ) | const |
| const TopoDS_Wire& BRepBuilderAPI_MakePolygon::Wire | ( | ) | const |
Returns the constructed polygonal wire, or the already
built part of the polygonal wire under construction.
Exceptions
StdFail_NotDone if the wire is not built, i.e. if fewer than
two vertices have been chained together by this construction algorithm.
1.8.5