Back to home page

EIC code displayed by LXR

 
 

    


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

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 
0037 //! implements the abstract Builder with the BRep Builder
0038 class BRepPrim_Builder 
0039 {
0040 public:
0041 
0042   DEFINE_STANDARD_ALLOC
0043 
0044   
0045   //! Creates an empty, useless  Builder. Necesseray for
0046   //! compilation.
0047   Standard_EXPORT BRepPrim_Builder();
0048   
0049   //! Creates from a Builder.
0050   Standard_EXPORT BRepPrim_Builder(const BRep_Builder& B);
0051   
0052     const BRep_Builder& Builder() const;
0053   
0054   //! Make a empty Shell.
0055   Standard_EXPORT void MakeShell (TopoDS_Shell& S) const;
0056   
0057   //! Returns in   <F> a  Face  built  with   the  plane
0058   //! equation <P>. Used by all primitives.
0059   Standard_EXPORT void MakeFace (TopoDS_Face& F, const gp_Pln& P) const;
0060   
0061   //! Returns in <W> an empty Wire.
0062   Standard_EXPORT void MakeWire (TopoDS_Wire& W) const;
0063   
0064   //! Returns in <E> a degenerated edge.
0065   Standard_EXPORT void MakeDegeneratedEdge (TopoDS_Edge& E) const;
0066   
0067   //! Returns   in <E>  an  Edge  built  with  the  line
0068   //! equation  <L>.
0069   Standard_EXPORT void MakeEdge (TopoDS_Edge& E, const gp_Lin& L) const;
0070   
0071   //! Returns  in <E>   an  Edge  built  with the circle
0072   //! equation  <C>.
0073   Standard_EXPORT void MakeEdge (TopoDS_Edge& E, const gp_Circ& C) const;
0074   
0075   //! Sets the line <L> to be the curve representing the
0076   //! edge <E> in the parametric space of the surface of
0077   //! <F>.
0078   Standard_EXPORT void SetPCurve (TopoDS_Edge& E, const TopoDS_Face& F, const gp_Lin2d& L) const;
0079   
0080   //! Sets the    lines  <L1,L2>  to   be     the curves
0081   //! representing the edge <E>  in the parametric space
0082   //! of the closed surface of <F>.
0083   Standard_EXPORT void SetPCurve (TopoDS_Edge& E, const TopoDS_Face& F, const gp_Lin2d& L1, 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, const TopoDS_Vertex& V, const Standard_Real P, const Standard_Boolean direct) const;
0100   
0101   //! Adds  the Vertex <V>  in the Edge <E>.   <P1,P2>
0102   //! are the  parameters of the  vertex on the closed
0103   //! edge.
0104   Standard_EXPORT void AddEdgeVertex (TopoDS_Edge& E, const TopoDS_Vertex& V, const Standard_Real P1, const Standard_Real P2) const;
0105   
0106   //! <P1,P2> are the parameters of the  vertex on the
0107   //! edge.  The edge is a closed curve.
0108   Standard_EXPORT void SetParameters (TopoDS_Edge& E, const TopoDS_Vertex& V, const Standard_Real P1, const Standard_Real P2) const;
0109   
0110   //! Adds the Edge <E> in the  Wire <W>, if direct is
0111   //! False the Edge is reversed.
0112   Standard_EXPORT void AddWireEdge (TopoDS_Wire& W, const TopoDS_Edge& E, const Standard_Boolean direct) const;
0113   
0114   //! Adds the Wire <W> in  the Face <F>.
0115   Standard_EXPORT void AddFaceWire (TopoDS_Face& F, const TopoDS_Wire& W) const;
0116   
0117   //! Adds the Face <F>  in the Shell <Sh>.
0118   Standard_EXPORT void AddShellFace (TopoDS_Shell& Sh, const TopoDS_Face& F) const;
0119   
0120   //! This is called once an edge is completed. It gives
0121   //! the opportunity to perform any post treatment.
0122   Standard_EXPORT void CompleteEdge (TopoDS_Edge& E) const;
0123   
0124   //! This is called once a wire is  completed. It gives
0125   //! the opportunity to perform any post treatment.
0126   Standard_EXPORT void CompleteWire (TopoDS_Wire& W) const;
0127   
0128   //! This is called once a face is  completed. It gives
0129   //! the opportunity to perform any post treatment.
0130   Standard_EXPORT void CompleteFace (TopoDS_Face& F) const;
0131   
0132   //! This is called once a shell is  completed. It gives
0133   //! the opportunity to perform any post treatment.
0134   Standard_EXPORT void CompleteShell (TopoDS_Shell& S) const;
0135 
0136 
0137 
0138 
0139 protected:
0140 
0141 
0142 
0143 
0144 
0145 private:
0146 
0147 
0148 
0149   BRep_Builder myBuilder;
0150 
0151 
0152 };
0153 
0154 
0155 #include <BRepPrim_Builder.lxx>
0156 
0157 
0158 
0159 
0160 
0161 #endif // _BRepPrim_Builder_HeaderFile