Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-19 09:27:28

0001 // Created on: 1992-03-12
0002 // Created by: Philippe DAUTRY
0003 // Copyright (c) 1992-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 _BRepPrim_Builder_HeaderFile
0018 #define _BRepPrim_Builder_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <BRep_Builder.hxx>
0024 class TopoDS_Shell;
0025 class TopoDS_Face;
0026 class gp_Pln;
0027 class TopoDS_Wire;
0028 class TopoDS_Edge;
0029 class gp_Lin;
0030 class gp_Circ;
0031 class gp_Lin2d;
0032 class gp_Circ2d;
0033 class TopoDS_Vertex;
0034 class gp_Pnt;
0035 
0036 //! implements the abstract Builder with the BRep Builder
0037 class BRepPrim_Builder
0038 {
0039 public:
0040   DEFINE_STANDARD_ALLOC
0041 
0042   //! Creates an empty, useless Builder. Necesseray for
0043   //! compilation.
0044   Standard_EXPORT BRepPrim_Builder();
0045 
0046   //! Creates from a Builder.
0047   Standard_EXPORT BRepPrim_Builder(const BRep_Builder& B);
0048 
0049   const BRep_Builder& Builder() const;
0050 
0051   //! Make a empty Shell.
0052   Standard_EXPORT void MakeShell(TopoDS_Shell& S) const;
0053 
0054   //! Returns in <F> a Face built with the plane
0055   //! equation <P>. Used by all primitives.
0056   Standard_EXPORT void MakeFace(TopoDS_Face& F, const gp_Pln& P) const;
0057 
0058   //! Returns in <W> an empty Wire.
0059   Standard_EXPORT void MakeWire(TopoDS_Wire& W) const;
0060 
0061   //! Returns in <E> a degenerated edge.
0062   Standard_EXPORT void MakeDegeneratedEdge(TopoDS_Edge& E) const;
0063 
0064   //! Returns in <E> an Edge built with the line
0065   //! equation <L>.
0066   Standard_EXPORT void MakeEdge(TopoDS_Edge& E, const gp_Lin& L) const;
0067 
0068   //! Returns in <E> an Edge built with the circle
0069   //! equation <C>.
0070   Standard_EXPORT void MakeEdge(TopoDS_Edge& E, const gp_Circ& C) const;
0071 
0072   //! Sets the line <L> to be the curve representing the
0073   //! edge <E> in the parametric space of the surface of
0074   //! <F>.
0075   Standard_EXPORT void SetPCurve(TopoDS_Edge& E, const TopoDS_Face& F, const gp_Lin2d& L) const;
0076 
0077   //! Sets the lines <L1,L2> to be the curves
0078   //! representing the edge <E> in the parametric space
0079   //! of the closed surface of <F>.
0080   Standard_EXPORT void SetPCurve(TopoDS_Edge&       E,
0081                                  const TopoDS_Face& F,
0082                                  const gp_Lin2d&    L1,
0083                                  const gp_Lin2d&    L2) const;
0084 
0085   //! Sets the circle <C> to be the curve representing
0086   //! the edge <E> in the parametric space of the
0087   //! surface of <F>.
0088   Standard_EXPORT void SetPCurve(TopoDS_Edge& E, const TopoDS_Face& F, const gp_Circ2d& C) const;
0089 
0090   //! Returns in <V> a Vertex built with the point <P>.
0091   Standard_EXPORT void MakeVertex(TopoDS_Vertex& V, const gp_Pnt& P) const;
0092 
0093   //! Reverses the Face <F>.
0094   Standard_EXPORT void ReverseFace(TopoDS_Face& F) const;
0095 
0096   //! Adds the Vertex <V> in the Edge <E>. <P> is the
0097   //! parameter of the vertex on the edge. If direct
0098   //! is False the Vertex is reversed.
0099   Standard_EXPORT void AddEdgeVertex(TopoDS_Edge&         E,
0100                                      const TopoDS_Vertex& V,
0101                                      const double         P,
0102                                      const bool           direct) const;
0103 
0104   //! Adds the Vertex <V> in the Edge <E>. <P1,P2>
0105   //! are the parameters of the vertex on the closed
0106   //! edge.
0107   Standard_EXPORT void AddEdgeVertex(TopoDS_Edge&         E,
0108                                      const TopoDS_Vertex& V,
0109                                      const double         P1,
0110                                      const double         P2) const;
0111 
0112   //! <P1,P2> are the parameters of the vertex on the
0113   //! edge. The edge is a closed curve.
0114   Standard_EXPORT void SetParameters(TopoDS_Edge&         E,
0115                                      const TopoDS_Vertex& V,
0116                                      const double         P1,
0117                                      const double         P2) const;
0118 
0119   //! Adds the Edge <E> in the Wire <W>, if direct is
0120   //! False the Edge is reversed.
0121   Standard_EXPORT void AddWireEdge(TopoDS_Wire& W, const TopoDS_Edge& E, const bool direct) const;
0122 
0123   //! Adds the Wire <W> in the Face <F>.
0124   Standard_EXPORT void AddFaceWire(TopoDS_Face& F, const TopoDS_Wire& W) const;
0125 
0126   //! Adds the Face <F> in the Shell <Sh>.
0127   Standard_EXPORT void AddShellFace(TopoDS_Shell& Sh, const TopoDS_Face& F) const;
0128 
0129   //! This is called once an edge is completed. It gives
0130   //! the opportunity to perform any post treatment.
0131   Standard_EXPORT void CompleteEdge(TopoDS_Edge& E) const;
0132 
0133   //! This is called once a wire is completed. It gives
0134   //! the opportunity to perform any post treatment.
0135   Standard_EXPORT void CompleteWire(TopoDS_Wire& W) const;
0136 
0137   //! This is called once a face is completed. It gives
0138   //! the opportunity to perform any post treatment.
0139   Standard_EXPORT void CompleteFace(TopoDS_Face& F) const;
0140 
0141   //! This is called once a shell is completed. It gives
0142   //! the opportunity to perform any post treatment.
0143   Standard_EXPORT void CompleteShell(TopoDS_Shell& S) const;
0144 
0145 private:
0146   BRep_Builder myBuilder;
0147 };
0148 
0149 #include <BRepPrim_Builder.lxx>
0150 
0151 #endif // _BRepPrim_Builder_HeaderFile