Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-18 09:19:56

0001 // Created on: 1996-07-12
0002 // Created by: Stagiaire Mary FABIEN
0003 // Copyright (c) 1996-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_NurbsConvertModification_HeaderFile
0018 #define _BRepTools_NurbsConvertModification_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 
0022 #include <TopoDS_Shape.hxx>
0023 #include <NCollection_List.hxx>
0024 #include <Standard_Transient.hxx>
0025 #include <NCollection_IndexedDataMap.hxx>
0026 #include <BRepTools_CopyModification.hxx>
0027 #include <Standard_Real.hxx>
0028 #include <GeomAbs_Shape.hxx>
0029 class TopoDS_Face;
0030 class Geom_Surface;
0031 class TopLoc_Location;
0032 class TopoDS_Edge;
0033 class Geom_Curve;
0034 class TopoDS_Vertex;
0035 class gp_Pnt;
0036 class Geom2d_Curve;
0037 
0038 //! Defines a modification of the geometry by a Trsf
0039 //! from gp. All methods return True and transform the
0040 //! geometry.
0041 class BRepTools_NurbsConvertModification : public BRepTools_CopyModification
0042 {
0043 
0044 public:
0045   Standard_EXPORT BRepTools_NurbsConvertModification();
0046 
0047   //! Returns true if the face <F> has been
0048   //! modified. In this case, <S> is the new geometric
0049   //! support of the face, <L> the new location,<Tol>
0050   //! the new tolerance.<RevWires> has to be set to
0051   //! true when the modification reverses the
0052   //! normal of the surface. (the wires have to be
0053   //! reversed). <RevFace> has to be set to
0054   //! true if the orientation of the modified
0055   //! face changes in the shells which contain it.
0056   //! Here, <RevFace> will return true if the
0057   //! - gp_Trsf is negative.
0058   Standard_EXPORT bool NewSurface(const TopoDS_Face&         F,
0059                                   occ::handle<Geom_Surface>& S,
0060                                   TopLoc_Location&           L,
0061                                   double&                    Tol,
0062                                   bool&                      RevWires,
0063                                   bool&                      RevFace) override;
0064 
0065   //! Returns true if the edge <E> has been
0066   //! modified. In this case, <C> is the new geometric
0067   //! support of the edge, <L> the new location, <Tol>
0068   //! the new tolerance. Otherwise, returns
0069   //! false, and <C>, <L>, <Tol> are not
0070   //! significant.
0071   Standard_EXPORT bool NewCurve(const TopoDS_Edge&       E,
0072                                 occ::handle<Geom_Curve>& C,
0073                                 TopLoc_Location&         L,
0074                                 double&                  Tol) override;
0075 
0076   //! Returns true if the vertex <V> has been
0077   //! modified. In this case, <P> is the new geometric
0078   //! support of the vertex, <Tol> the new tolerance.
0079   //! Otherwise, returns false, and <P>, <Tol>
0080   //! are not significant.
0081   Standard_EXPORT bool NewPoint(const TopoDS_Vertex& V, gp_Pnt& P, double& Tol) override;
0082 
0083   //! Returns true if the edge <E> has a new
0084   //! curve on surface on the face <F>.In this case, <C>
0085   //! is the new geometric support of the edge, <L> the
0086   //! new location, <Tol> the new tolerance.
0087   //! Otherwise, returns false, and <C>, <L>,
0088   //! <Tol> are not significant.
0089   Standard_EXPORT bool NewCurve2d(const TopoDS_Edge&         E,
0090                                   const TopoDS_Face&         F,
0091                                   const TopoDS_Edge&         NewE,
0092                                   const TopoDS_Face&         NewF,
0093                                   occ::handle<Geom2d_Curve>& C,
0094                                   double&                    Tol) override;
0095 
0096   //! Returns true if the Vertex <V> has a new
0097   //! parameter on the edge <E>. In this case, <P> is
0098   //! the parameter, <Tol> the new tolerance.
0099   //! Otherwise, returns false, and <P>, <Tol>
0100   //! are not significant.
0101   Standard_EXPORT bool NewParameter(const TopoDS_Vertex& V,
0102                                     const TopoDS_Edge&   E,
0103                                     double&              P,
0104                                     double&              Tol) override;
0105 
0106   //! Returns the continuity of <NewE> between <NewF1>
0107   //! and <NewF2>.
0108   //!
0109   //! <NewE> is the new edge created from <E>. <NewF1>
0110   //! (resp. <NewF2>) is the new face created from <F1>
0111   //! (resp. <F2>).
0112   Standard_EXPORT GeomAbs_Shape Continuity(const TopoDS_Edge& E,
0113                                            const TopoDS_Face& F1,
0114                                            const TopoDS_Face& F2,
0115                                            const TopoDS_Edge& NewE,
0116                                            const TopoDS_Face& NewF1,
0117                                            const TopoDS_Face& NewF2) override;
0118 
0119   //! Returns true if the face has been modified according to changed triangulation.
0120   //! If the face has been modified:
0121   //! - theTri is a new triangulation on the face
0122   Standard_EXPORT bool NewTriangulation(const TopoDS_Face&               theFace,
0123                                         occ::handle<Poly_Triangulation>& theTri) override;
0124 
0125   //! Returns true if the edge has been modified according to changed polygon.
0126   //! If the edge has been modified:
0127   //! - thePoly is a new polygon
0128   Standard_EXPORT bool NewPolygon(const TopoDS_Edge&           theEdge,
0129                                   occ::handle<Poly_Polygon3D>& thePoly) override;
0130 
0131   //! Returns true if the edge has been modified according to changed polygon on triangulation.
0132   //! If the edge has been modified:
0133   //! - thePoly is a new polygon on triangulation
0134   Standard_EXPORT bool NewPolygonOnTriangulation(
0135     const TopoDS_Edge&                        theEdge,
0136     const TopoDS_Face&                        theFace,
0137     occ::handle<Poly_PolygonOnTriangulation>& thePoly) override;
0138 
0139   Standard_EXPORT const NCollection_List<TopoDS_Shape>& GetUpdatedEdges() const;
0140 
0141   DEFINE_STANDARD_RTTIEXT(BRepTools_NurbsConvertModification, BRepTools_CopyModification)
0142 
0143 private:
0144   NCollection_List<TopoDS_Shape>                    myled;
0145   NCollection_List<occ::handle<Standard_Transient>> mylcu;
0146   NCollection_IndexedDataMap<occ::handle<Standard_Transient>, occ::handle<Standard_Transient>>
0147                                  myMap;
0148   NCollection_List<TopoDS_Shape> myUpdatedEdges;
0149 };
0150 
0151 #endif // _BRepTools_NurbsConvertModification_HeaderFile