Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-20 09:17:12

0001 // Copyright (c) 1999-2022 OPEN CASCADE SAS
0002 //
0003 // This file is part of Open CASCADE Technology software library.
0004 //
0005 // This library is free software; you can redistribute it and/or modify it under
0006 // the terms of the GNU Lesser General Public License version 2.1 as published
0007 // by the Free Software Foundation, with special exception defined in the file
0008 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0009 // distribution for complete text of the license and disclaimer of any warranty.
0010 //
0011 // Alternatively, this file may be used under the terms of Open CASCADE
0012 // commercial license or contractual agreement.
0013 
0014 #ifndef _BRepTools_CopyModification_HeaderFile
0015 #define _BRepTools_CopyModification_HeaderFile
0016 
0017 #include <BRepTools_Modification.hxx>
0018 
0019 //! Tool class implementing necessary functionality for copying geometry and triangulation.
0020 class BRepTools_CopyModification : public BRepTools_Modification
0021 {
0022 public:
0023   //! Constructor.
0024   //! \param[in] theCopyGeom  indicates that the geometry (surfaces and curves) should be copied
0025   //! \param[in] theCopyMesh  indicates that the triangulation should be copied
0026   Standard_EXPORT explicit BRepTools_CopyModification(const bool theCopyGeom = true,
0027                                                       const bool theCopyMesh = true);
0028 
0029   //! Returns true if theFace has been modified.
0030   //! If the face has been modified:
0031   //! - theSurf is the new geometry of the face,
0032   //! - theLoc is its new location, and
0033   //! - theTol is the new tolerance.
0034   //! theRevWires, theRevFace are always set to false, because the orientation is not changed.
0035   Standard_EXPORT bool NewSurface(const TopoDS_Face&         theFace,
0036                                   occ::handle<Geom_Surface>& theSurf,
0037                                   TopLoc_Location&           theLoc,
0038                                   double&                    theTol,
0039                                   bool&                      theRevWires,
0040                                   bool&                      theRevFace) override;
0041 
0042   //! Returns true if theEdge has been modified.
0043   //! If the edge has been modified:
0044   //! - theCurve is the new geometric support of the edge,
0045   //! - theLoc is the new location, and
0046   //! - theTol is the new tolerance.
0047   //! If the edge has not been modified, this function
0048   //! returns false, and the values of theCurve, theLoc and theTol are not significant.
0049   Standard_EXPORT bool NewCurve(const TopoDS_Edge&       theEdge,
0050                                 occ::handle<Geom_Curve>& theCurve,
0051                                 TopLoc_Location&         theLoc,
0052                                 double&                  theTol) override;
0053 
0054   //! Returns true if theVertex has been modified.
0055   //! If the vertex has been modified:
0056   //! - thePnt is the new geometry of the vertex, and
0057   //! - theTol is the new tolerance.
0058   //! If the vertex has not been modified this function
0059   //! returns false, and the values of thePnt and theTol are not significant.
0060   Standard_EXPORT bool NewPoint(const TopoDS_Vertex& theVertex,
0061                                 gp_Pnt&              thePnt,
0062                                 double&              theTol) override;
0063 
0064   //! Returns true if theEdge has a new curve on surface on theFace.
0065   //! If a new curve exists:
0066   //! - theCurve is the new geometric support of the edge,
0067   //! - theTol the new tolerance.
0068   //! If no new curve exists, this function returns false, and
0069   //! the values of theCurve and theTol are not significant.
0070   Standard_EXPORT bool NewCurve2d(const TopoDS_Edge&         theEdge,
0071                                   const TopoDS_Face&         theFace,
0072                                   const TopoDS_Edge&         theNewEdge,
0073                                   const TopoDS_Face&         theNewFace,
0074                                   occ::handle<Geom2d_Curve>& theCurve,
0075                                   double&                    theTol) override;
0076 
0077   //! Returns true if theVertex has a new parameter on theEdge.
0078   //! If a new parameter exists:
0079   //! - thePnt is the parameter, and
0080   //! - theTol is the new tolerance.
0081   //! If no new parameter exists, this function returns false,
0082   //! and the values of thePnt and theTol are not significant.
0083   Standard_EXPORT bool NewParameter(const TopoDS_Vertex& theVertex,
0084                                     const TopoDS_Edge&   theEdge,
0085                                     double&              thePnt,
0086                                     double&              theTol) override;
0087 
0088   //! Returns the continuity of theNewEdge between theNewFace1 and theNewFace2.
0089   //!
0090   //! theNewEdge is the new edge created from theEdge. theNewFace1
0091   //! (resp. theNewFace2) is the new face created from theFace1 (resp. theFace2).
0092   Standard_EXPORT GeomAbs_Shape Continuity(const TopoDS_Edge& theEdge,
0093                                            const TopoDS_Face& theFace1,
0094                                            const TopoDS_Face& theFace2,
0095                                            const TopoDS_Edge& theNewEdge,
0096                                            const TopoDS_Face& theNewFace1,
0097                                            const TopoDS_Face& theNewFace2) override;
0098 
0099   //! Returns true if the face has been modified according to changed triangulation.
0100   //! If the face has been modified:
0101   //! - theTri is a new triangulation on the face
0102   Standard_EXPORT bool NewTriangulation(const TopoDS_Face&               theFace,
0103                                         occ::handle<Poly_Triangulation>& theTri) override;
0104 
0105   //! Returns true if the edge has been modified according to changed polygon.
0106   //! If the edge has been modified:
0107   //! - thePoly is a new polygon
0108   Standard_EXPORT bool NewPolygon(const TopoDS_Edge&           theEdge,
0109                                   occ::handle<Poly_Polygon3D>& thePoly) override;
0110 
0111   //! Returns true if the edge has been modified according to changed polygon on triangulation.
0112   //! If the edge has been modified:
0113   //! - thePoly is a new polygon on triangulation
0114   Standard_EXPORT bool NewPolygonOnTriangulation(
0115     const TopoDS_Edge&                        theEdge,
0116     const TopoDS_Face&                        theFace,
0117     occ::handle<Poly_PolygonOnTriangulation>& thePoly) override;
0118 
0119   DEFINE_STANDARD_RTTIEXT(BRepTools_CopyModification, BRepTools_Modification)
0120 
0121 private:
0122   bool myCopyGeom;
0123   bool myCopyMesh;
0124 };
0125 
0126 #endif // _BRepTools_CopyModification_HeaderFile