1 // Created on: 1995-06-06
2 // Created by: Jean Yves LEBEY
3 // Copyright (c) 1995-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _BRepApprox_TheMultiLineOfApprox_HeaderFile
18 #define _BRepApprox_TheMultiLineOfApprox_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Standard_Address.hxx>
25 #include <Standard_Integer.hxx>
26 #include <Standard_Boolean.hxx>
27 #include <Standard_Real.hxx>
28 #include <Approx_Status.hxx>
29 #include <TColgp_Array1OfPnt.hxx>
30 #include <TColgp_Array1OfPnt2d.hxx>
31 #include <TColgp_Array1OfVec.hxx>
32 #include <TColgp_Array1OfVec2d.hxx>
33 class BRepApprox_ApproxLine;
34 class ApproxInt_SvSurfaces;
38 class BRepApprox_TheMultiLineOfApprox
44 Standard_EXPORT BRepApprox_TheMultiLineOfApprox();
46 //! The class SvSurfaces is used when the approximation algorithm
47 //! needs some extra points on the line <line>.
48 //! A New line is then created which shares the same surfaces and functions.
49 //! SvSurfaces is a deferred class which allows several implementations of
50 //! this algorithm with different surfaces (bi-parametric ones, or
51 //! implicit and biparametric ones)
52 Standard_EXPORT BRepApprox_TheMultiLineOfApprox(const Handle(BRepApprox_ApproxLine)& line,
53 const Standard_Address PtrSvSurfaces,
54 const Standard_Integer NbP3d,
55 const Standard_Integer NbP2d,
56 const Standard_Boolean ApproxU1V1,
57 const Standard_Boolean ApproxU2V2,
58 const Standard_Real xo,
59 const Standard_Real yo,
60 const Standard_Real zo,
61 const Standard_Real u1o,
62 const Standard_Real v1o,
63 const Standard_Real u2o,
64 const Standard_Real v2o,
65 const Standard_Boolean P2DOnFirst,
66 const Standard_Integer IndMin = 0,
67 const Standard_Integer IndMax = 0);
69 //! No Extra points will be added on the current line
70 Standard_EXPORT BRepApprox_TheMultiLineOfApprox(const Handle(BRepApprox_ApproxLine)& line,
71 const Standard_Integer NbP3d,
72 const Standard_Integer NbP2d,
73 const Standard_Boolean ApproxU1V1,
74 const Standard_Boolean ApproxU2V2,
75 const Standard_Real xo,
76 const Standard_Real yo,
77 const Standard_Real zo,
78 const Standard_Real u1o,
79 const Standard_Real v1o,
80 const Standard_Real u2o,
81 const Standard_Real v2o,
82 const Standard_Boolean P2DOnFirst,
83 const Standard_Integer IndMin = 0,
84 const Standard_Integer IndMax = 0);
86 Standard_EXPORT Standard_Integer FirstPoint() const;
88 Standard_EXPORT Standard_Integer LastPoint() const;
90 //! Returns the number of 2d points of a TheLine.
91 Standard_EXPORT Standard_Integer NbP2d() const;
93 //! Returns the number of 3d points of a TheLine.
94 Standard_EXPORT Standard_Integer NbP3d() const;
96 Standard_EXPORT Approx_Status WhatStatus() const;
98 //! Returns the 3d points of the multipoint <MPointIndex> when only 3d points exist.
99 Standard_EXPORT void Value (const Standard_Integer MPointIndex, TColgp_Array1OfPnt& tabPt) const;
101 //! Returns the 2d points of the multipoint <MPointIndex> when only 2d points exist.
102 Standard_EXPORT void Value (const Standard_Integer MPointIndex, TColgp_Array1OfPnt2d& tabPt2d) const;
104 //! Returns the 3d and 2d points of the multipoint <MPointIndex>.
105 Standard_EXPORT void Value (const Standard_Integer MPointIndex, TColgp_Array1OfPnt& tabPt, TColgp_Array1OfPnt2d& tabPt2d) const;
107 //! Returns the 3d tangency points of the multipoint <MPointIndex> only when 3d points exist.
108 Standard_EXPORT Standard_Boolean Tangency (const Standard_Integer MPointIndex, TColgp_Array1OfVec& tabV) const;
110 //! Returns the 2d tangency points of the multipoint <MPointIndex> only when 2d points exist.
111 Standard_EXPORT Standard_Boolean Tangency (const Standard_Integer MPointIndex, TColgp_Array1OfVec2d& tabV2d) const;
113 //! Returns the 3d and 2d points of the multipoint <MPointIndex>.
114 Standard_EXPORT Standard_Boolean Tangency (const Standard_Integer MPointIndex, TColgp_Array1OfVec& tabV, TColgp_Array1OfVec2d& tabV2d) const;
116 //! Tries to make a sub-line between <Low> and <High> points of this line
117 //! by adding <NbPointsToInsert> new points
118 Standard_EXPORT BRepApprox_TheMultiLineOfApprox MakeMLBetween (const Standard_Integer Low,
119 const Standard_Integer High,
120 const Standard_Integer NbPointsToInsert) const;
122 //! Tries to make a sub-line between <Low> and <High> points of this line
123 //! by adding one more point between (indbad-1)-th and indbad-th points
124 Standard_EXPORT Standard_Boolean MakeMLOneMorePoint (const Standard_Integer Low,
125 const Standard_Integer High,
126 const Standard_Integer indbad,
127 BRepApprox_TheMultiLineOfApprox& OtherLine) const;
129 //! Dump of the current multi-line.
130 Standard_EXPORT void Dump() const;
135 Standard_Address PtrOnmySvSurfaces;
136 Handle(BRepApprox_ApproxLine) myLine;
137 Standard_Integer indicemin;
138 Standard_Integer indicemax;
139 Standard_Integer nbp3d;
140 Standard_Integer nbp2d;
141 Standard_Boolean myApproxU1V1;
142 Standard_Boolean myApproxU2V2;
143 Standard_Boolean p2donfirst;
154 #endif // _BRepApprox_TheMultiLineOfApprox_HeaderFile