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 //! The class SvSurfaces is used when the approximation algorithm
45 //! needs some extra points on the line <line>.
46 //! A New line is then created which shares the same surfaces and functions.
47 //! SvSurfaces is a deferred class which allows several implementations of
48 //! this algorithm with different surfaces (bi-parametric ones, or
49 //! implicit and biparametric ones)
50 Standard_EXPORT BRepApprox_TheMultiLineOfApprox(const Handle(BRepApprox_ApproxLine)& line,
51 const Standard_Address PtrSvSurfaces,
52 const Standard_Integer NbP3d,
53 const Standard_Integer NbP2d,
54 const Standard_Real xo,
55 const Standard_Real yo,
56 const Standard_Real zo,
57 const Standard_Real u1o,
58 const Standard_Real v1o,
59 const Standard_Real u2o,
60 const Standard_Real v2o,
61 const Standard_Boolean P2DOnFirst,
62 const Standard_Integer IndMin = 0,
63 const Standard_Integer IndMax = 0);
65 //! No Extra points will be added on the current line
66 Standard_EXPORT BRepApprox_TheMultiLineOfApprox(const Handle(BRepApprox_ApproxLine)& line,
67 const Standard_Integer NbP3d,
68 const Standard_Integer NbP2d,
69 const Standard_Real xo,
70 const Standard_Real yo,
71 const Standard_Real zo,
72 const Standard_Real u1o,
73 const Standard_Real v1o,
74 const Standard_Real u2o,
75 const Standard_Real v2o,
76 const Standard_Boolean P2DOnFirst,
77 const Standard_Integer IndMin = 0,
78 const Standard_Integer IndMax = 0);
80 Standard_EXPORT Standard_Integer FirstPoint() const;
82 Standard_EXPORT Standard_Integer LastPoint() const;
84 //! Returns the number of 2d points of a TheLine.
85 Standard_EXPORT Standard_Integer NbP2d() const;
87 //! Returns the number of 3d points of a TheLine.
88 Standard_EXPORT Standard_Integer NbP3d() const;
90 Standard_EXPORT Approx_Status WhatStatus() const;
92 //! Returns the 3d points of the multipoint <MPointIndex> when only 3d points exist.
93 Standard_EXPORT void Value (const Standard_Integer MPointIndex, TColgp_Array1OfPnt& tabPt) const;
95 //! Returns the 2d points of the multipoint <MPointIndex> when only 2d points exist.
96 Standard_EXPORT void Value (const Standard_Integer MPointIndex, TColgp_Array1OfPnt2d& tabPt2d) const;
98 //! Returns the 3d and 2d points of the multipoint <MPointIndex>.
99 Standard_EXPORT void Value (const Standard_Integer MPointIndex, TColgp_Array1OfPnt& tabPt, TColgp_Array1OfPnt2d& tabPt2d) const;
101 //! Returns the 3d tangency points of the multipoint <MPointIndex> only when 3d points exist.
102 Standard_EXPORT Standard_Boolean Tangency (const Standard_Integer MPointIndex, TColgp_Array1OfVec& tabV) const;
104 //! Returns the 2d tangency points of the multipoint <MPointIndex> only when 2d points exist.
105 Standard_EXPORT Standard_Boolean Tangency (const Standard_Integer MPointIndex, TColgp_Array1OfVec2d& tabV2d) const;
107 //! Returns the 3d and 2d points of the multipoint <MPointIndex>.
108 Standard_EXPORT Standard_Boolean Tangency (const Standard_Integer MPointIndex, TColgp_Array1OfVec& tabV, TColgp_Array1OfVec2d& tabV2d) const;
110 Standard_EXPORT BRepApprox_TheMultiLineOfApprox MakeMLBetween (const Standard_Integer Low, const Standard_Integer High, const Standard_Integer NbPointsToInsert) const;
112 //! Dump of the current multi-line.
113 Standard_EXPORT void Dump() const;
116 BRepApprox_TheMultiLineOfApprox operator=(BRepApprox_TheMultiLineOfApprox&);
119 const Standard_Address PtrOnmySvSurfaces;
120 const Handle(BRepApprox_ApproxLine) myLine;
121 const Standard_Integer indicemin;
122 const Standard_Integer indicemax;
123 const Standard_Integer nbp3d;
124 const Standard_Integer nbp2d;
125 const Standard_Boolean p2donfirst;
126 const Standard_Real Xo;
127 const Standard_Real Yo;
128 const Standard_Real Zo;
129 const Standard_Real U1o;
130 const Standard_Real V1o;
131 const Standard_Real U2o;
132 const Standard_Real V2o;
136 #endif // _BRepApprox_TheMultiLineOfApprox_HeaderFile