Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-11-09 10:28:01

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