Open CASCADE Technology 7.8.0
Public Member Functions
BRepBuilderAPI_MakePolygon Class Reference

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>

Inheritance diagram for BRepBuilderAPI_MakePolygon:
Inheritance graph
[legend]

Public Member Functions

 BRepBuilderAPI_MakePolygon ()
 Initializes an empty polygonal wire, to which points or 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 (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 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 (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 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 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.
 
Standard_Boolean Added () const
 Returns true if the last vertex added to the constructed polygonal wire is not coincident with the previous one.
 
void Close ()
 Closes the polygonal wire under construction. Note - this is equivalent to adding the first vertex to the polygonal wire under construction.
 
const TopoDS_VertexFirstVertex () const
 
const TopoDS_VertexLastVertex () const
 Returns the first or the last vertex of the polygonal wire under construction. If the constructed polygonal wire is closed, the first and the last vertices are identical.
 
virtual Standard_Boolean IsDone () const override
 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.
 
const TopoDS_EdgeEdge () const
 Returns the edge built between the last two points or 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.
 
 operator TopoDS_Edge () const
 
const TopoDS_WireWire ()
 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.
 
 operator TopoDS_Wire ()
 
- Public Member Functions inherited from BRepBuilderAPI_MakeShape
virtual void Build (const Message_ProgressRange &theRange=Message_ProgressRange())
 This is called by Shape(). It does nothing but may be redefined.
 
virtual const TopoDS_ShapeShape ()
 Returns a shape built by the shape construction algorithm. Raises exception StdFail_NotDone if the shape was not built.
 
 operator TopoDS_Shape ()
 
virtual const TopTools_ListOfShapeGenerated (const TopoDS_Shape &S)
 Returns the list of shapes generated from the shape .
 
virtual const TopTools_ListOfShapeModified (const TopoDS_Shape &S)
 Returns the list of shapes modified from the shape .
 
virtual Standard_Boolean IsDeleted (const TopoDS_Shape &S)
 Returns true if the shape S has been deleted.
 
- Public Member Functions inherited from BRepBuilderAPI_Command
virtual ~BRepBuilderAPI_Command ()
 
void Check () const
 Raises NotDone if done is false.
 

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.
 
void Done ()
 Set done to true.
 
void NotDone ()
 Set done to false.
 
- Protected Attributes inherited from BRepBuilderAPI_MakeShape
TopoDS_Shape myShape
 
TopTools_ListOfShape myGenerated
 

Detailed Description

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:

Constructor & Destructor Documentation

◆ BRepBuilderAPI_MakePolygon() [1/7]

BRepBuilderAPI_MakePolygon::BRepBuilderAPI_MakePolygon ( )

Initializes an empty polygonal wire, to which points or 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() [2/7]

BRepBuilderAPI_MakePolygon::BRepBuilderAPI_MakePolygon ( const gp_Pnt P1,
const gp_Pnt P2 
)

◆ BRepBuilderAPI_MakePolygon() [3/7]

BRepBuilderAPI_MakePolygon::BRepBuilderAPI_MakePolygon ( const gp_Pnt P1,
const gp_Pnt P2,
const gp_Pnt P3,
const Standard_Boolean  Close = Standard_False 
)

◆ BRepBuilderAPI_MakePolygon() [4/7]

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 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:

  • initializing an empty polygonal wire,
  • and adding the given points in sequence. Consequently, be careful when using this function: if the sequence of points p1 - p2 - p1 is found among the arguments of the constructor, you will create a polygonal wire with two consecutive coincident edges.

◆ BRepBuilderAPI_MakePolygon() [5/7]

BRepBuilderAPI_MakePolygon::BRepBuilderAPI_MakePolygon ( const TopoDS_Vertex V1,
const TopoDS_Vertex V2 
)

◆ BRepBuilderAPI_MakePolygon() [6/7]

BRepBuilderAPI_MakePolygon::BRepBuilderAPI_MakePolygon ( const TopoDS_Vertex V1,
const TopoDS_Vertex V2,
const TopoDS_Vertex V3,
const Standard_Boolean  Close = Standard_False 
)

◆ BRepBuilderAPI_MakePolygon() [7/7]

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 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:

  • initializing an empty polygonal wire,
  • then adding the given points in sequence. So be careful, as when using this function, you could create a polygonal wire with two consecutive coincident edges if the sequence of vertices v1 - v2 - v1 is found among the constructor's arguments.

Member Function Documentation

◆ Add() [1/2]

void BRepBuilderAPI_MakePolygon::Add ( const gp_Pnt P)

◆ Add() [2/2]

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.

  • When P or V is coincident to the previous vertex, no edge is built. The method Added can be used to test for this. Neither P nor V is checked to verify that it is coincident with another vertex than the last one, of the polygonal wire under construction. It is also possible to add vertices on a closed polygon (built for example by using a constructor which declares the polygon closed, or after the use of the Close function). Consequently, be careful using this function: you might create:
  • a polygonal wire with two consecutive coincident edges, or
  • a non manifold polygonal wire.
  • P or V is not checked to verify if it is coincident with another vertex but the last one, of the polygonal wire under construction. It is also possible to add vertices on a closed polygon (built for example by using a constructor which declares the polygon closed, or after the use of the Close function). Consequently, be careful when using this function: you might create:
  • a polygonal wire with two consecutive coincident edges, or
  • a non-manifold polygonal wire.

◆ Added()

Standard_Boolean BRepBuilderAPI_MakePolygon::Added ( ) const

Returns true if the last vertex added to the constructed polygonal wire is not coincident with the previous one.

◆ Close()

void BRepBuilderAPI_MakePolygon::Close ( )

Closes the polygonal wire under construction. Note - this is equivalent to adding the first vertex to the polygonal wire under construction.

◆ Edge()

const TopoDS_Edge & BRepBuilderAPI_MakePolygon::Edge ( ) const

Returns the edge built between the last two points or 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.

◆ FirstVertex()

const TopoDS_Vertex & BRepBuilderAPI_MakePolygon::FirstVertex ( ) const

◆ IsDone()

virtual Standard_Boolean BRepBuilderAPI_MakePolygon::IsDone ( ) const
overridevirtual

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.

◆ LastVertex()

const TopoDS_Vertex & BRepBuilderAPI_MakePolygon::LastVertex ( ) const

Returns the first or the last vertex of the polygonal wire under construction. If the constructed polygonal wire is closed, the first and the last vertices are identical.

◆ operator TopoDS_Edge()

BRepBuilderAPI_MakePolygon::operator TopoDS_Edge ( ) const

◆ operator TopoDS_Wire()

BRepBuilderAPI_MakePolygon::operator TopoDS_Wire ( )

◆ Wire()

const TopoDS_Wire & BRepBuilderAPI_MakePolygon::Wire ( )

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.


The documentation for this class was generated from the following file: