Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1991-07-01
0002 // Created by: Remi LEQUETTE
0003 // Copyright (c) 1991-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 _BRep_Builder_HeaderFile
0018 #define _BRep_Builder_HeaderFile
0019 
0020 #include <GeomAbs_Shape.hxx>
0021 #include <Poly_ListOfTriangulation.hxx>
0022 #include <Standard.hxx>
0023 #include <Standard_DefineAlloc.hxx>
0024 #include <Standard_Handle.hxx>
0025 #include <TopoDS_Builder.hxx>
0026 
0027 class TopoDS_Face;
0028 class Geom_Surface;
0029 class TopLoc_Location;
0030 class Poly_Triangulation;
0031 class TopoDS_Edge;
0032 class Geom_Curve;
0033 class Poly_Polygon3D;
0034 class Poly_PolygonOnTriangulation;
0035 class Geom2d_Curve;
0036 class gp_Pnt2d;
0037 class Poly_Polygon2D;
0038 class TopoDS_Vertex;
0039 class gp_Pnt;
0040 
0041 
0042 //! A framework providing advanced tolerance control.
0043 //! It is used to build Shapes.
0044 //! If tolerance control is required, you are advised to:
0045 //! 1. build a default precision for topology, using the
0046 //! classes provided in the BRepAPI package
0047 //! 2. update the tolerance of the resulting shape.
0048 //! Note that only vertices, edges and faces have
0049 //! meaningful tolerance control. The tolerance value
0050 //! must always comply with the condition that face
0051 //! tolerances are more restrictive than edge tolerances
0052 //! which are more restrictive than vertex tolerances. In
0053 //! other words: Tol(Vertex) >= Tol(Edge) >= Tol(Face).
0054 //! Other rules in setting tolerance include:
0055 //! - you can open up tolerance but should never restrict it
0056 //! - an edge cannot be included within the fusion of the
0057 //! tolerance spheres of two vertices
0058 class BRep_Builder  : public TopoDS_Builder
0059 {
0060 public:
0061 
0062   DEFINE_STANDARD_ALLOC
0063 
0064   
0065   //! Makes an undefined Face.
0066     void MakeFace (TopoDS_Face& F) const;
0067   
0068   //! Makes a Face with a surface.
0069   Standard_EXPORT void MakeFace (TopoDS_Face& F, const Handle(Geom_Surface)& S, const Standard_Real Tol) const;
0070   
0071   //! Makes a Face with a surface and a location.
0072   Standard_EXPORT void MakeFace (TopoDS_Face& F, const Handle(Geom_Surface)& S, const TopLoc_Location& L, const Standard_Real Tol) const;
0073   
0074   //! Makes a theFace with a single triangulation. The triangulation
0075   //! is in the same reference system than the TFace.
0076   Standard_EXPORT void MakeFace (TopoDS_Face& theFace, const Handle(Poly_Triangulation)& theTriangulation) const;
0077 
0078   //! Makes a Face with a list of triangulations and active one.
0079   //! Use NULL active triangulation to set the first triangulation in list as active.
0080   //! The triangulations is in the same reference system than the TFace.
0081   Standard_EXPORT void MakeFace (TopoDS_Face& theFace, const Poly_ListOfTriangulation& theTriangulations, const Handle(Poly_Triangulation)& theActiveTriangulation = Handle(Poly_Triangulation)()) const;
0082   
0083   //! Updates the face F using the tolerance value Tol,
0084   //! surface S and location Location.
0085   Standard_EXPORT void UpdateFace (const TopoDS_Face& F, const Handle(Geom_Surface)& S, const TopLoc_Location& L, const Standard_Real Tol) const;
0086   
0087   //! Changes a face triangulation.
0088   //! A NULL theTriangulation removes face triangulations.
0089   //! If theToReset is TRUE face triangulations will be reset to new list with only one input triangulation that will be active.
0090   //! Else if theTriangulation is contained in internal triangulations list it will be made active,
0091   //!      else the active triangulation will be replaced to theTriangulation one.
0092   Standard_EXPORT void UpdateFace (const TopoDS_Face& theFace, const Handle(Poly_Triangulation)& theTriangulation, const Standard_Boolean theToReset = true) const;
0093 
0094   //! Updates the face Tolerance.
0095   Standard_EXPORT void UpdateFace (const TopoDS_Face& F, const Standard_Real Tol) const;
0096   
0097   //! Sets the  NaturalRestriction flag of  the face.
0098   Standard_EXPORT void NaturalRestriction (const TopoDS_Face& F, const Standard_Boolean N) const;
0099   
0100   //! Makes an undefined Edge (no geometry).
0101   Standard_EXPORT void MakeEdge (TopoDS_Edge& E) const;
0102   
0103   //! Makes an Edge with a curve.
0104     void MakeEdge (TopoDS_Edge& E, const Handle(Geom_Curve)& C, const Standard_Real Tol) const;
0105   
0106   //! Makes an Edge with a curve and a location.
0107     void MakeEdge (TopoDS_Edge& E, const Handle(Geom_Curve)& C, const TopLoc_Location& L, const Standard_Real Tol) const;
0108   
0109   //! Makes an Edge with a polygon 3d.
0110     void MakeEdge (TopoDS_Edge& E, const Handle(Poly_Polygon3D)& P) const;
0111   
0112   //! makes an Edge polygon on Triangulation.
0113     void MakeEdge (TopoDS_Edge& E, const Handle(Poly_PolygonOnTriangulation)& N, const Handle(Poly_Triangulation)& T) const;
0114   
0115   //! makes an Edge polygon on Triangulation.
0116     void MakeEdge (TopoDS_Edge& E, const Handle(Poly_PolygonOnTriangulation)& N, const Handle(Poly_Triangulation)& T, const TopLoc_Location& L) const;
0117   
0118   //! Sets a 3D curve for the edge.
0119   //! If <C> is a null handle, remove any existing 3d curve.
0120     void UpdateEdge (const TopoDS_Edge& E, const Handle(Geom_Curve)& C, const Standard_Real Tol) const;
0121   
0122   //! Sets a 3D curve for the edge.
0123   //! If <C> is a null handle, remove any existing 3d curve.
0124   Standard_EXPORT void UpdateEdge (const TopoDS_Edge& E, const Handle(Geom_Curve)& C, const TopLoc_Location& L, const Standard_Real Tol) const;
0125   
0126   //! Sets a pcurve for the edge on the face.
0127   //! If <C> is a null handle, remove any existing pcurve.
0128     void UpdateEdge (const TopoDS_Edge& E, const Handle(Geom2d_Curve)& C, const TopoDS_Face& F, const Standard_Real Tol) const;
0129   
0130   //! Sets pcurves for the edge on the  closed face.  If
0131   //! <C1> or <C2> is a null handle, remove any existing
0132   //! pcurve.
0133     void UpdateEdge (const TopoDS_Edge& E, const Handle(Geom2d_Curve)& C1, const Handle(Geom2d_Curve)& C2, const TopoDS_Face& F, const Standard_Real Tol) const;
0134   
0135   //! Sets a pcurve for the edge on the face.
0136   //! If <C> is a null handle, remove any existing pcurve.
0137   Standard_EXPORT void UpdateEdge (const TopoDS_Edge& E, const Handle(Geom2d_Curve)& C, const Handle(Geom_Surface)& S, const TopLoc_Location& L, const Standard_Real Tol) const;
0138   
0139   //! Sets a pcurve for the edge on the face.
0140   //! If <C> is a null handle, remove any existing pcurve.
0141   //! Sets UV bounds for curve repsentation
0142   Standard_EXPORT void UpdateEdge (const TopoDS_Edge& E, const Handle(Geom2d_Curve)& C, const Handle(Geom_Surface)& S, const TopLoc_Location& L, const Standard_Real Tol, const gp_Pnt2d& Pf, const gp_Pnt2d& Pl) const;
0143   
0144   //! Sets pcurves for the edge on the closed surface.
0145   //! <C1> or <C2> is a null handle, remove any existing
0146   //! pcurve.
0147   Standard_EXPORT void UpdateEdge (const TopoDS_Edge& E, const Handle(Geom2d_Curve)& C1, const Handle(Geom2d_Curve)& C2, const Handle(Geom_Surface)& S, const TopLoc_Location& L, const Standard_Real Tol) const;
0148   
0149   //! Sets pcurves for the edge on the closed surface.
0150   //! <C1> or <C2> is a null handle, remove any existing
0151   //! pcurve.
0152   //! Sets UV bounds for curve repsentation
0153   Standard_EXPORT void UpdateEdge (const TopoDS_Edge& E, const Handle(Geom2d_Curve)& C1, const Handle(Geom2d_Curve)& C2, const Handle(Geom_Surface)& S, const TopLoc_Location& L, const Standard_Real Tol, const gp_Pnt2d& Pf, const gp_Pnt2d& Pl) const;
0154   
0155   //! Changes an Edge 3D polygon.
0156   //! A null Polygon removes the 3d Polygon.
0157     void UpdateEdge (const TopoDS_Edge& E, const Handle(Poly_Polygon3D)& P) const;
0158   
0159   //! Changes an Edge 3D polygon.
0160   //! A null Polygon removes the 3d Polygon.
0161   Standard_EXPORT void UpdateEdge (const TopoDS_Edge& E, const Handle(Poly_Polygon3D)& P, const TopLoc_Location& L) const;
0162   
0163   //! Changes an Edge polygon on Triangulation.
0164     void UpdateEdge (const TopoDS_Edge& E, const Handle(Poly_PolygonOnTriangulation)& N, const Handle(Poly_Triangulation)& T) const;
0165   
0166   //! Changes an Edge polygon on Triangulation.
0167   Standard_EXPORT void UpdateEdge (const TopoDS_Edge& E, const Handle(Poly_PolygonOnTriangulation)& N, const Handle(Poly_Triangulation)& T, const TopLoc_Location& L) const;
0168   
0169   //! Changes an Edge polygon on Triangulation.
0170     void UpdateEdge (const TopoDS_Edge& E, const Handle(Poly_PolygonOnTriangulation)& N1, const Handle(Poly_PolygonOnTriangulation)& N2, const Handle(Poly_Triangulation)& T) const;
0171   
0172   //! Changes an Edge polygon on Triangulation.
0173   Standard_EXPORT void UpdateEdge (const TopoDS_Edge& E, const Handle(Poly_PolygonOnTriangulation)& N1, const Handle(Poly_PolygonOnTriangulation)& N2, const Handle(Poly_Triangulation)& T, const TopLoc_Location& L) const;
0174   
0175   //! Changes Edge polygon on a face.
0176   Standard_EXPORT void UpdateEdge (const TopoDS_Edge& E, const Handle(Poly_Polygon2D)& P, const TopoDS_Face& S) const;
0177   
0178   //! Changes Edge polygon on a face.
0179   Standard_EXPORT void UpdateEdge (const TopoDS_Edge& E, const Handle(Poly_Polygon2D)& P, const Handle(Geom_Surface)& S, const TopLoc_Location& T) const;
0180   
0181   //! Changes Edge polygons on a face.
0182   //!
0183   //! A null Polygon removes the 2d Polygon.
0184   Standard_EXPORT void UpdateEdge (const TopoDS_Edge& E, const Handle(Poly_Polygon2D)& P1, const Handle(Poly_Polygon2D)& P2, const TopoDS_Face& S) const;
0185   
0186   //! Changes Edge polygons on a face.
0187   //!
0188   //! A null Polygon removes the 2d Polygon.
0189   Standard_EXPORT void UpdateEdge (const TopoDS_Edge& E, const Handle(Poly_Polygon2D)& P1, const Handle(Poly_Polygon2D)& P2, const Handle(Geom_Surface)& S, const TopLoc_Location& L) const;
0190   
0191   //! Updates the edge tolerance.
0192   Standard_EXPORT void UpdateEdge (const TopoDS_Edge& E, const Standard_Real Tol) const;
0193   
0194   //! Sets the geometric continuity on the edge.
0195   Standard_EXPORT void Continuity (const TopoDS_Edge& E, const TopoDS_Face& F1, const TopoDS_Face& F2, const GeomAbs_Shape C) const;
0196   
0197   //! Sets the geometric continuity on the edge.
0198   Standard_EXPORT void Continuity (const TopoDS_Edge& E, const Handle(Geom_Surface)& S1, const Handle(Geom_Surface)& S2, const TopLoc_Location& L1, const TopLoc_Location& L2, const GeomAbs_Shape C) const;
0199   
0200   //! Sets the same parameter flag for the edge <E>.
0201   Standard_EXPORT void SameParameter (const TopoDS_Edge& E, const Standard_Boolean S) const;
0202   
0203   //! Sets the same range flag for the edge <E>.
0204   Standard_EXPORT void SameRange (const TopoDS_Edge& E, const Standard_Boolean S) const;
0205   
0206   //! Sets the degenerated flag for the edge <E>.
0207   Standard_EXPORT void Degenerated (const TopoDS_Edge& E, const Standard_Boolean D) const;
0208   
0209   //! Sets the range of the 3d curve if Only3d=TRUE,
0210   //! otherwise sets the range to all the representations
0211   Standard_EXPORT void Range (const TopoDS_Edge& E, const Standard_Real First, const Standard_Real Last, const Standard_Boolean Only3d = Standard_False) const;
0212   
0213   //! Sets the range  of the edge  on the pcurve on  the
0214   //! surface.
0215   Standard_EXPORT void Range (const TopoDS_Edge& E, const Handle(Geom_Surface)& S, const TopLoc_Location& L, const Standard_Real First, const Standard_Real Last) const;
0216   
0217   //! Sets the range of the edge on the pcurve on the face.
0218     void Range (const TopoDS_Edge& E, const TopoDS_Face& F, const Standard_Real First, const Standard_Real Last) const;
0219   
0220   //! Add  to <Eout>  the  geometric representations  of
0221   //! <Ein>.
0222   Standard_EXPORT void Transfert (const TopoDS_Edge& Ein, const TopoDS_Edge& Eout) const;
0223   
0224   //! Makes an udefined vertex without geometry.
0225     void MakeVertex (TopoDS_Vertex& V) const;
0226   
0227   //! Makes a vertex from a 3D point.
0228     void MakeVertex (TopoDS_Vertex& V, const gp_Pnt& P, const Standard_Real Tol) const;
0229   
0230   //! Sets a 3D point on the vertex.
0231   Standard_EXPORT void UpdateVertex (const TopoDS_Vertex& V, const gp_Pnt& P, const Standard_Real Tol) const;
0232   
0233   //! Sets  the parameter  for the   vertex on the  edge
0234   //! curves.
0235   Standard_EXPORT void UpdateVertex (const TopoDS_Vertex& V, const Standard_Real P, const TopoDS_Edge& E, const Standard_Real Tol) const;
0236   
0237   //! Sets  the parameter  for the  vertex  on the  edge
0238   //! pcurve  on the face.
0239     void UpdateVertex (const TopoDS_Vertex& V, const Standard_Real P, const TopoDS_Edge& E, const TopoDS_Face& F, const Standard_Real Tol) const;
0240   
0241   //! Sets  the parameter  for the  vertex  on the  edge
0242   //! pcurve  on the surface.
0243   Standard_EXPORT void UpdateVertex (const TopoDS_Vertex& V, const Standard_Real P, const TopoDS_Edge& E, const Handle(Geom_Surface)& S, const TopLoc_Location& L, const Standard_Real Tol) const;
0244   
0245   //! Sets the parameters for the vertex on the face.
0246   Standard_EXPORT void UpdateVertex (const TopoDS_Vertex& Ve, const Standard_Real U, const Standard_Real V, const TopoDS_Face& F, const Standard_Real Tol) const;
0247   
0248   //! Updates the vertex tolerance.
0249   Standard_EXPORT void UpdateVertex (const TopoDS_Vertex& V, const Standard_Real Tol) const;
0250   
0251   //! Transfert the parameters  of   Vin on  Ein as  the
0252   //! parameter of Vout on Eout.
0253   Standard_EXPORT void Transfert (const TopoDS_Edge& Ein, const TopoDS_Edge& Eout, const TopoDS_Vertex& Vin, const TopoDS_Vertex& Vout) const;
0254 
0255 
0256 
0257 
0258 protected:
0259 
0260 
0261 
0262 
0263 
0264 private:
0265 
0266 
0267 
0268 
0269 
0270 };
0271 
0272 
0273 #include <BRep_Builder.lxx>
0274 
0275 
0276 
0277 
0278 
0279 #endif // _BRep_Builder_HeaderFile