Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-15 09:38:03

0001 // Created on: 1994-08-25
0002 // Created by: Jacques GOUSSARD
0003 // Copyright (c) 1994-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 _BRepTools_TrsfModification_HeaderFile
0018 #define _BRepTools_TrsfModification_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <gp_Trsf.hxx>
0024 #include <BRepTools_Modification.hxx>
0025 #include <GeomAbs_Shape.hxx>
0026 class TopoDS_Face;
0027 class Geom_Surface;
0028 class TopLoc_Location;
0029 class TopoDS_Edge;
0030 class Geom_Curve;
0031 class TopoDS_Vertex;
0032 class gp_Pnt;
0033 class Geom2d_Curve;
0034 
0035 //! Describes a modification that uses a gp_Trsf to
0036 //! change the geometry of a shape. All functions return
0037 //! true and transform the geometry of the shape.
0038 class BRepTools_TrsfModification : public BRepTools_Modification
0039 {
0040 
0041 public:
0042   Standard_EXPORT BRepTools_TrsfModification(const gp_Trsf& T);
0043 
0044   //! Provides access to the gp_Trsf associated with this
0045   //! modification. The transformation can be changed.
0046   Standard_EXPORT gp_Trsf& Trsf();
0047 
0048   //! Sets a flag to indicate the need to copy mesh.
0049   Standard_EXPORT bool& IsCopyMesh();
0050 
0051   //! Returns true if the face F has been modified.
0052   //! If the face has been modified:
0053   //! - S is the new geometry of the face,
0054   //! - L is its new location, and
0055   //! - Tol is the new tolerance.
0056   //! RevWires is set to true when the modification
0057   //! reverses the normal of the surface (the wires have to be reversed).
0058   //! RevFace is set to true if the orientation of the
0059   //! modified face changes in the shells which contain it.
0060   //! For this class, RevFace returns true if the gp_Trsf
0061   //! associated with this modification is negative.
0062   Standard_EXPORT bool NewSurface(const TopoDS_Face&         F,
0063                                   occ::handle<Geom_Surface>& S,
0064                                   TopLoc_Location&           L,
0065                                   double&                    Tol,
0066                                   bool&                      RevWires,
0067                                   bool&                      RevFace) override;
0068 
0069   //! Returns true if the face has been modified according to changed triangulation.
0070   //! If the face has been modified:
0071   //! - T is a new triangulation on the face
0072   Standard_EXPORT bool NewTriangulation(const TopoDS_Face&               F,
0073                                         occ::handle<Poly_Triangulation>& T) override;
0074 
0075   //! Returns true if the edge has been modified according to changed polygon.
0076   //! If the edge has been modified:
0077   //! - P is a new polygon
0078   Standard_EXPORT bool NewPolygon(const TopoDS_Edge& E, occ::handle<Poly_Polygon3D>& P) override;
0079 
0080   //! Returns true if the edge has been modified according to changed polygon on triangulation.
0081   //! If the edge has been modified:
0082   //! - P is a new polygon on triangulation
0083   Standard_EXPORT bool NewPolygonOnTriangulation(
0084     const TopoDS_Edge&                        E,
0085     const TopoDS_Face&                        F,
0086     occ::handle<Poly_PolygonOnTriangulation>& P) override;
0087 
0088   //! Always returns true indicating that the edge E is always modified.
0089   //! - C is the new geometric support of the edge,
0090   //! - L is the new location, and
0091   //! - Tol is the new tolerance.
0092   Standard_EXPORT bool NewCurve(const TopoDS_Edge&       E,
0093                                 occ::handle<Geom_Curve>& C,
0094                                 TopLoc_Location&         L,
0095                                 double&                  Tol) override;
0096 
0097   //! Returns true if the vertex V has been modified.
0098   //! If the vertex has been modified:
0099   //! - P is the new geometry of the vertex, and
0100   //! - Tol is the new tolerance.
0101   //! If the vertex has not been modified this function
0102   //! returns false, and the values of P and Tol are not significant.
0103   Standard_EXPORT bool NewPoint(const TopoDS_Vertex& V, gp_Pnt& P, double& Tol) override;
0104 
0105   //! Returns true if the edge E has a new curve on surface on the face F.
0106   //! If a new curve exists:
0107   //! - C is the new geometric support of the edge,
0108   //! - L is the new location, and
0109   //! - Tol the new tolerance.
0110   //! If no new curve exists, this function returns false, and
0111   //! the values of C, L and Tol are not significant.
0112   Standard_EXPORT bool NewCurve2d(const TopoDS_Edge&         E,
0113                                   const TopoDS_Face&         F,
0114                                   const TopoDS_Edge&         NewE,
0115                                   const TopoDS_Face&         NewF,
0116                                   occ::handle<Geom2d_Curve>& C,
0117                                   double&                    Tol) override;
0118 
0119   //! Returns true if the Vertex V has a new parameter on the edge E.
0120   //! If a new parameter exists:
0121   //! - P is the parameter, and
0122   //! - Tol is the new tolerance.
0123   //! If no new parameter exists, this function returns false,
0124   //! and the values of P and Tol are not significant.
0125   Standard_EXPORT bool NewParameter(const TopoDS_Vertex& V,
0126                                     const TopoDS_Edge&   E,
0127                                     double&              P,
0128                                     double&              Tol) override;
0129 
0130   //! Returns the continuity of <NewE> between <NewF1>
0131   //! and <NewF2>.
0132   //!
0133   //! <NewE> is the new edge created from <E>. <NewF1>
0134   //! (resp. <NewF2>) is the new face created from <F1>
0135   //! (resp. <F2>).
0136   Standard_EXPORT GeomAbs_Shape Continuity(const TopoDS_Edge& E,
0137                                            const TopoDS_Face& F1,
0138                                            const TopoDS_Face& F2,
0139                                            const TopoDS_Edge& NewE,
0140                                            const TopoDS_Face& NewF1,
0141                                            const TopoDS_Face& NewF2) override;
0142 
0143   DEFINE_STANDARD_RTTIEXT(BRepTools_TrsfModification, BRepTools_Modification)
0144 
0145 private:
0146   gp_Trsf myTrsf;
0147   bool    myCopyMesh;
0148 };
0149 
0150 #endif // _BRepTools_TrsfModification_HeaderFile