42cf5bc1 |
1 | // Created on: 1999-06-21 |
2 | // Created by: Galina KULIKOVA |
3 | // Copyright (c) 1999 Matra Datavision |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
8 | // This library is free software; you can redistribute it and/or modify it under |
9 | // the terms of the GNU Lesser General Public License version 2.1 as published |
10 | // by the Free Software Foundation, with special exception defined in the file |
11 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | // distribution for complete text of the license and disclaimer of any warranty. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _ShapeAnalysis_TransferParametersProj_HeaderFile |
18 | #define _ShapeAnalysis_TransferParametersProj_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
23 | #include <Adaptor3d_CurveOnSurface.hxx> |
24 | #include <Standard_Real.hxx> |
25 | #include <TopLoc_Location.hxx> |
26 | #include <Standard_Boolean.hxx> |
27 | #include <ShapeAnalysis_TransferParameters.hxx> |
28 | #include <TColStd_HSequenceOfReal.hxx> |
29 | class Geom_Curve; |
30 | class Geom2d_Curve; |
31 | class TopoDS_Edge; |
32 | class TopoDS_Face; |
33 | class TopoDS_Vertex; |
34 | |
35 | |
36 | class ShapeAnalysis_TransferParametersProj; |
37 | DEFINE_STANDARD_HANDLE(ShapeAnalysis_TransferParametersProj, ShapeAnalysis_TransferParameters) |
38 | |
39 | //! This tool is used for transferring parameters |
40 | //! from 3d curve of the edge to pcurve and vice versa. |
41 | //! This tool transfers parameters with help of |
42 | //! projection points from curve 3d on curve 2d and |
43 | //! vice versa |
44 | class ShapeAnalysis_TransferParametersProj : public ShapeAnalysis_TransferParameters |
45 | { |
46 | |
47 | public: |
48 | |
49 | |
316ea293 |
50 | //! Creates empty constructor. |
42cf5bc1 |
51 | Standard_EXPORT ShapeAnalysis_TransferParametersProj(); |
52 | |
53 | Standard_EXPORT ShapeAnalysis_TransferParametersProj(const TopoDS_Edge& E, const TopoDS_Face& F); |
54 | |
55 | Standard_EXPORT virtual void Init (const TopoDS_Edge& E, const TopoDS_Face& F) Standard_OVERRIDE; |
56 | |
57 | //! Transfers parameters given by sequence Params from 3d curve |
58 | //! to pcurve (if To2d is True) or back (if To2d is False) |
59 | Standard_EXPORT virtual Handle(TColStd_HSequenceOfReal) Perform (const Handle(TColStd_HSequenceOfReal)& Papams, const Standard_Boolean To2d) Standard_OVERRIDE; |
60 | |
61 | //! Transfers parameter given by Param from 3d curve |
62 | //! to pcurve (if To2d is True) or back (if To2d is False) |
63 | Standard_EXPORT virtual Standard_Real Perform (const Standard_Real Param, const Standard_Boolean To2d) Standard_OVERRIDE; |
64 | |
65 | //! Returns modifiable flag forcing projection |
66 | //! If it is False (default), projection is done only |
67 | //! if edge is not SameParameter or if tolerance of edge |
68 | //! is greater than MaxTolerance() |
69 | Standard_EXPORT Standard_Boolean& ForceProjection(); |
70 | |
71 | //! Recomputes range of curves from NewEdge. |
72 | //! If Is2d equals True parameters are recomputed by curve2d else by curve3d. |
73 | Standard_EXPORT virtual void TransferRange (TopoDS_Edge& newEdge, const Standard_Real prevPar, const Standard_Real currPar, const Standard_Boolean Is2d) Standard_OVERRIDE; |
74 | |
75 | //! Returns False; |
76 | Standard_EXPORT virtual Standard_Boolean IsSameRange() const Standard_OVERRIDE; |
77 | |
78 | //! Make a copy of non-manifold vertex theVert |
79 | //! (i.e. create new TVertex and replace PointRepresentations for this vertex |
80 | //! from fromedge to toedge. Other representations were copied) |
81 | Standard_EXPORT static TopoDS_Vertex CopyNMVertex (const TopoDS_Vertex& theVert, const TopoDS_Edge& toedge, const TopoDS_Edge& fromedge); |
82 | |
83 | //! Make a copy of non-manifold vertex theVert |
84 | //! (i.e. create new TVertex and replace PointRepresentations for this vertex |
85 | //! from fromFace to toFace. Other representations were copied) |
86 | Standard_EXPORT static TopoDS_Vertex CopyNMVertex (const TopoDS_Vertex& theVert, const TopoDS_Face& toFace, const TopoDS_Face& fromFace); |
87 | |
88 | |
89 | |
90 | |
92efcf78 |
91 | DEFINE_STANDARD_RTTIEXT(ShapeAnalysis_TransferParametersProj,ShapeAnalysis_TransferParameters) |
42cf5bc1 |
92 | |
93 | protected: |
94 | |
95 | |
96 | |
97 | |
98 | private: |
99 | |
100 | |
101 | Standard_EXPORT Standard_Real PreformSegment (const Standard_Real Param, const Standard_Boolean To2d, const Standard_Real First, const Standard_Real Last); |
102 | |
103 | Handle(Geom_Curve) myCurve; |
104 | Handle(Geom2d_Curve) myCurve2d; |
105 | Adaptor3d_CurveOnSurface myAC3d; |
106 | Standard_Real myPrecision; |
107 | TopLoc_Location myLocation; |
108 | Standard_Boolean myForceProj; |
109 | Standard_Boolean myInitOK; |
110 | |
111 | |
112 | }; |
113 | |
114 | |
115 | |
116 | |
117 | |
118 | |
119 | |
120 | #endif // _ShapeAnalysis_TransferParametersProj_HeaderFile |