Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-13 08:44:30

0001 // Created on: 1999-06-21
0002 // Created by: Galina KULIKOVA
0003 // Copyright (c) 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 _ShapeAnalysis_TransferParametersProj_HeaderFile
0018 #define _ShapeAnalysis_TransferParametersProj_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Adaptor3d_CurveOnSurface.hxx>
0024 #include <TopLoc_Location.hxx>
0025 #include <ShapeAnalysis_TransferParameters.hxx>
0026 #include <TColStd_HSequenceOfReal.hxx>
0027 class Geom_Curve;
0028 class Geom2d_Curve;
0029 class TopoDS_Edge;
0030 class TopoDS_Face;
0031 class TopoDS_Vertex;
0032 
0033 class ShapeAnalysis_TransferParametersProj;
0034 DEFINE_STANDARD_HANDLE(ShapeAnalysis_TransferParametersProj, ShapeAnalysis_TransferParameters)
0035 
0036 //! This tool is used for transferring parameters
0037 //! from 3d curve of the edge to pcurve and vice versa.
0038 //! This tool transfers parameters with help of
0039 //! projection points from curve 3d on curve 2d and
0040 //! vice versa
0041 class ShapeAnalysis_TransferParametersProj : public ShapeAnalysis_TransferParameters
0042 {
0043 
0044 public:
0045   //! Creates empty constructor.
0046   Standard_EXPORT ShapeAnalysis_TransferParametersProj();
0047 
0048   Standard_EXPORT ShapeAnalysis_TransferParametersProj(const TopoDS_Edge& E, const TopoDS_Face& F);
0049 
0050   Standard_EXPORT virtual void Init(const TopoDS_Edge& E, const TopoDS_Face& F) Standard_OVERRIDE;
0051 
0052   //! Transfers parameters given by sequence Params from 3d curve
0053   //! to pcurve (if To2d is True) or back (if To2d is False)
0054   Standard_EXPORT virtual Handle(TColStd_HSequenceOfReal) Perform(
0055     const Handle(TColStd_HSequenceOfReal)& Papams,
0056     const Standard_Boolean                 To2d) Standard_OVERRIDE;
0057 
0058   //! Transfers parameter given by  Param from 3d curve
0059   //! to pcurve (if To2d is True) or back (if To2d is False)
0060   Standard_EXPORT virtual Standard_Real Perform(const Standard_Real    Param,
0061                                                 const Standard_Boolean To2d) Standard_OVERRIDE;
0062 
0063   //! Returns modifiable flag forcing projection
0064   //! If it is False (default), projection is done only
0065   //! if edge is not SameParameter or if tolerance of edge
0066   //! is greater than MaxTolerance()
0067   Standard_EXPORT Standard_Boolean& ForceProjection();
0068 
0069   //! Recomputes range of curves from NewEdge.
0070   //! If Is2d equals True parameters are recomputed by curve2d else by curve3d.
0071   Standard_EXPORT virtual void TransferRange(TopoDS_Edge&           newEdge,
0072                                              const Standard_Real    prevPar,
0073                                              const Standard_Real    currPar,
0074                                              const Standard_Boolean Is2d) Standard_OVERRIDE;
0075 
0076   //! Returns False;
0077   Standard_EXPORT virtual Standard_Boolean IsSameRange() const Standard_OVERRIDE;
0078 
0079   //! Make a copy of non-manifold vertex theVert
0080   //! (i.e. create new  TVertex and replace PointRepresentations for this vertex
0081   //! from fromedge to toedge. Other representations were copied)
0082   Standard_EXPORT static TopoDS_Vertex CopyNMVertex(const TopoDS_Vertex& theVert,
0083                                                     const TopoDS_Edge&   toedge,
0084                                                     const TopoDS_Edge&   fromedge);
0085 
0086   //! Make a copy of non-manifold vertex theVert
0087   //! (i.e. create new  TVertex and replace PointRepresentations for this vertex
0088   //! from fromFace to toFace. Other representations were copied)
0089   Standard_EXPORT static TopoDS_Vertex CopyNMVertex(const TopoDS_Vertex& theVert,
0090                                                     const TopoDS_Face&   toFace,
0091                                                     const TopoDS_Face&   fromFace);
0092 
0093   DEFINE_STANDARD_RTTIEXT(ShapeAnalysis_TransferParametersProj, ShapeAnalysis_TransferParameters)
0094 
0095 protected:
0096 private:
0097   Standard_EXPORT Standard_Real PreformSegment(const Standard_Real    Param,
0098                                                const Standard_Boolean To2d,
0099                                                const Standard_Real    First,
0100                                                const Standard_Real    Last);
0101 
0102   Handle(Geom_Curve)       myCurve;
0103   Handle(Geom2d_Curve)     myCurve2d;
0104   Adaptor3d_CurveOnSurface myAC3d;
0105   Standard_Real            myPrecision;
0106   TopLoc_Location          myLocation;
0107   Standard_Boolean         myForceProj;
0108   Standard_Boolean         myInitOK;
0109 };
0110 
0111 #endif // _ShapeAnalysis_TransferParametersProj_HeaderFile