Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:55

0001 // Created on: 1998-06-09
0002 // Created by: data exchange team
0003 // Copyright (c) 1998-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 _ShapeBuild_Edge_HeaderFile
0018 #define _ShapeBuild_Edge_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 class TopoDS_Edge;
0025 class TopoDS_Vertex;
0026 class TopoDS_Face;
0027 class Geom_Surface;
0028 class TopLoc_Location;
0029 class Geom2d_Curve;
0030 class gp_Trsf2d;
0031 class Geom_Curve;
0032 
0033 
0034 //! This class provides low-level operators for building an edge
0035 //! 3d curve, copying edge with replaced vertices etc.
0036 class ShapeBuild_Edge 
0037 {
0038 public:
0039 
0040   DEFINE_STANDARD_ALLOC
0041 
0042   
0043   //! Copy edge and replace one or both its vertices to a given
0044   //! one(s). Vertex V1 replaces FORWARD vertex, and V2 - REVERSED,
0045   //! as they are found by TopoDS_Iterator.
0046   //! If V1 or V2 is NULL, the original vertex is taken
0047   Standard_EXPORT TopoDS_Edge CopyReplaceVertices (const TopoDS_Edge& edge, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2) const;
0048   
0049   //! Copies ranges for curve3d and all common pcurves from
0050   //! edge <fromedge> into edge <toedge>.
0051   Standard_EXPORT void CopyRanges (const TopoDS_Edge& toedge, const TopoDS_Edge& fromedge, const Standard_Real alpha = 0, const Standard_Real beta = 1) const;
0052   
0053   //! Sets range on 3d curve only.
0054   Standard_EXPORT void SetRange3d (const TopoDS_Edge& edge, const Standard_Real first, const Standard_Real last) const;
0055   
0056   //! Makes a copy of pcurves from edge <fromedge> into edge
0057   //! <toedge>. Pcurves which are already present in <toedge>,
0058   //! are replaced by copies, other are copied. Ranges are also
0059   //! copied.
0060   Standard_EXPORT void CopyPCurves (const TopoDS_Edge& toedge, const TopoDS_Edge& fromedge) const;
0061   
0062   //! Make a copy of <edge> by call to CopyReplaceVertices()
0063   //! (i.e. construct new TEdge with the same pcurves and vertices).
0064   //! If <sharepcurves> is False, pcurves are also replaced by
0065   //! their copies with help of method CopyPCurves
0066   Standard_EXPORT TopoDS_Edge Copy (const TopoDS_Edge& edge, const Standard_Boolean sharepcurves = Standard_True) const;
0067   
0068   //! Removes the PCurve(s) which could be recorded in an Edge for
0069   //! the given Face
0070   Standard_EXPORT void RemovePCurve (const TopoDS_Edge& edge, const TopoDS_Face& face) const;
0071   
0072   //! Removes the PCurve(s) which could be recorded in an Edge for
0073   //! the given Surface
0074   Standard_EXPORT void RemovePCurve (const TopoDS_Edge& edge, const Handle(Geom_Surface)& surf) const;
0075   
0076   //! Removes the PCurve(s) which could be recorded in an Edge for
0077   //! the given Surface, with given Location
0078   Standard_EXPORT void RemovePCurve (const TopoDS_Edge& edge, const Handle(Geom_Surface)& surf, const TopLoc_Location& loc) const;
0079   
0080   //! Replace the PCurve in an Edge for the given Face
0081   //! In case if edge is seam, i.e. has 2 pcurves on that face,
0082   //! only pcurve corresponding to the orientation of the edge is
0083   //! replaced
0084   Standard_EXPORT void ReplacePCurve (const TopoDS_Edge& edge, const Handle(Geom2d_Curve)& pcurve, const TopoDS_Face& face) const;
0085   
0086   //! Reassign edge pcurve lying on face <old> to another face <sub>.
0087   //! If edge has two pcurves on <old> face, only one of them will be
0088   //! reassigned, and other will left alone. Similarly, if edge already
0089   //! had a pcurve on face <sub>, it will have two pcurves on it.
0090   //! Returns True if succeeded, False if no pcurve lying on <old> found.
0091   Standard_EXPORT Standard_Boolean ReassignPCurve (const TopoDS_Edge& edge, const TopoDS_Face& old, const TopoDS_Face& sub) const;
0092   
0093   //! Transforms the PCurve with given matrix and affinity U factor.
0094   Standard_EXPORT Handle(Geom2d_Curve) TransformPCurve (const Handle(Geom2d_Curve)& pcurve, const gp_Trsf2d& trans, const Standard_Real uFact, Standard_Real& aFirst, Standard_Real& aLast) const;
0095   
0096   //! Removes the Curve3D recorded in an Edge
0097   Standard_EXPORT void RemoveCurve3d (const TopoDS_Edge& edge) const;
0098   
0099   //! Calls BRepTools::BuildCurve3D
0100   Standard_EXPORT Standard_Boolean BuildCurve3d (const TopoDS_Edge& edge) const;
0101   
0102   //! Makes edge with curve and location
0103   Standard_EXPORT void MakeEdge (TopoDS_Edge& edge, const Handle(Geom_Curve)& curve, const TopLoc_Location& L) const;
0104   
0105   //! Makes edge with curve, location and range [p1, p2]
0106   Standard_EXPORT void MakeEdge (TopoDS_Edge& edge, const Handle(Geom_Curve)& curve, const TopLoc_Location& L, const Standard_Real p1, const Standard_Real p2) const;
0107   
0108   //! Makes edge with pcurve and face
0109   Standard_EXPORT void MakeEdge (TopoDS_Edge& edge, const Handle(Geom2d_Curve)& pcurve, const TopoDS_Face& face) const;
0110   
0111   //! Makes edge with pcurve, face and range [p1, p2]
0112   Standard_EXPORT void MakeEdge (TopoDS_Edge& edge, const Handle(Geom2d_Curve)& pcurve, const TopoDS_Face& face, const Standard_Real p1, const Standard_Real p2) const;
0113   
0114   //! Makes edge with pcurve, surface and location
0115   Standard_EXPORT void MakeEdge (TopoDS_Edge& edge, const Handle(Geom2d_Curve)& pcurve, const Handle(Geom_Surface)& S, const TopLoc_Location& L) const;
0116   
0117   //! Makes edge with pcurve, surface, location and range [p1, p2]
0118   Standard_EXPORT void MakeEdge (TopoDS_Edge& edge, const Handle(Geom2d_Curve)& pcurve, const Handle(Geom_Surface)& S, const TopLoc_Location& L, const Standard_Real p1, const Standard_Real p2) const;
0119 
0120 
0121 
0122 
0123 protected:
0124 
0125 
0126 
0127 
0128 
0129 private:
0130 
0131 
0132 
0133 
0134 
0135 };
0136 
0137 
0138 
0139 
0140 
0141 
0142 
0143 #endif // _ShapeBuild_Edge_HeaderFile