Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:13

0001 // Created on: 1993-07-29
0002 // Created by: Remi LEQUETTE
0003 // Copyright (c) 1993-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _BRepLib_MakePolygon_HeaderFile
0018 #define _BRepLib_MakePolygon_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <TopoDS_Vertex.hxx>
0024 #include <TopoDS_Edge.hxx>
0025 #include <BRepLib_MakeShape.hxx>
0026 class gp_Pnt;
0027 class TopoDS_Wire;
0028 
0029 
0030 //! Class to build polygonal wires.
0031 //!
0032 //! A polygonal wire may be build from
0033 //!
0034 //! - 2,4,3 points.
0035 //!
0036 //! - 2,3,4 vertices.
0037 //!
0038 //! - any number of points.
0039 //!
0040 //! - any number of vertices.
0041 //!
0042 //! When a point or vertex is added to the  polygon if
0043 //! it is identic  to the previous  point no  edge  is
0044 //! built. The method added can be used to test it.
0045 class BRepLib_MakePolygon  : public BRepLib_MakeShape
0046 {
0047 public:
0048 
0049   DEFINE_STANDARD_ALLOC
0050 
0051   
0052   //! Creates an empty MakePolygon.
0053   Standard_EXPORT BRepLib_MakePolygon();
0054   
0055   Standard_EXPORT BRepLib_MakePolygon(const gp_Pnt& P1, const gp_Pnt& P2);
0056   
0057   Standard_EXPORT BRepLib_MakePolygon(const gp_Pnt& P1, const gp_Pnt& P2, const gp_Pnt& P3, const Standard_Boolean Close = Standard_False);
0058   
0059   Standard_EXPORT BRepLib_MakePolygon(const gp_Pnt& P1, const gp_Pnt& P2, const gp_Pnt& P3, const gp_Pnt& P4, const Standard_Boolean Close = Standard_False);
0060   
0061   Standard_EXPORT BRepLib_MakePolygon(const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
0062   
0063   Standard_EXPORT BRepLib_MakePolygon(const TopoDS_Vertex& V1, const TopoDS_Vertex& V2, const TopoDS_Vertex& V3, const Standard_Boolean Close = Standard_False);
0064   
0065   Standard_EXPORT BRepLib_MakePolygon(const TopoDS_Vertex& V1, const TopoDS_Vertex& V2, const TopoDS_Vertex& V3, const TopoDS_Vertex& V4, const Standard_Boolean Close = Standard_False);
0066   
0067   Standard_EXPORT void Add (const gp_Pnt& P);
0068   
0069   Standard_EXPORT void Add (const TopoDS_Vertex& V);
0070   
0071   //! Returns  True if  the last   vertex  or point  was
0072   //! successfully added.
0073   Standard_EXPORT Standard_Boolean Added() const;
0074   
0075   Standard_EXPORT void Close();
0076   
0077   Standard_EXPORT const TopoDS_Vertex& FirstVertex() const;
0078   
0079   Standard_EXPORT const TopoDS_Vertex& LastVertex() const;
0080   
0081   //! Returns the last edge added to the polygon.
0082   Standard_EXPORT const TopoDS_Edge& Edge() const;
0083 Standard_EXPORT operator TopoDS_Edge() const;
0084   
0085   Standard_EXPORT const TopoDS_Wire& Wire();
0086   Standard_EXPORT operator TopoDS_Wire();
0087 
0088 
0089 
0090 
0091 protected:
0092 
0093 
0094 
0095 
0096 
0097 private:
0098 
0099 
0100 
0101   TopoDS_Vertex myFirstVertex;
0102   TopoDS_Vertex myLastVertex;
0103   TopoDS_Edge myEdge;
0104 
0105 
0106 };
0107 
0108 
0109 
0110 
0111 
0112 
0113 
0114 #endif // _BRepLib_MakePolygon_HeaderFile