1 // Created on: 1995-01-27 2 // Created by: Jacques GOUSSARD 3 // Copyright (c) 1995-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 _GeomInt_TheMultiLineOfWLApprox_HeaderFile 18 #define _GeomInt_TheMultiLineOfWLApprox_HeaderFile 19 20 #include <Standard.hxx> 21 #include <Standard_DefineAlloc.hxx> 22 #include <Standard_Handle.hxx> 23 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 IntPatch_WLine; 34 class ApproxInt_SvSurfaces; 35 36 37 38 class GeomInt_TheMultiLineOfWLApprox 39 { 40 public: 41 42 DEFINE_STANDARD_ALLOC 43 44 Standard_EXPORT GeomInt_TheMultiLineOfWLApprox(); 45 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 GeomInt_TheMultiLineOfWLApprox( const Handle(IntPatch_WLine)& 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); 68 69 //! No Extra points will be added on the current line 70 Standard_EXPORT GeomInt_TheMultiLineOfWLApprox( const Handle(IntPatch_WLine)& 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); 85 86 Standard_EXPORT Standard_Integer FirstPoint() const; 87 88 Standard_EXPORT Standard_Integer LastPoint() const; 89 90 //! Returns the number of 2d points of a TheLine. 91 Standard_EXPORT Standard_Integer NbP2d() const; 92 93 //! Returns the number of 3d points of a TheLine. 94 Standard_EXPORT Standard_Integer NbP3d() const; 95 96 Standard_EXPORT Approx_Status WhatStatus() const; 97 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; 100 101 //! Returns the 2d points of the multipoint <MPointIndex> when only 2d points exist. 102 Standard_EXPORT void Value (const Standard_Integer MPointIndex, 103 TColgp_Array1OfPnt2d& tabPt2d) const; 104 105 //! returns the 3d and 2d points of the multipoint <MPointIndex>. 106 Standard_EXPORT void Value (const Standard_Integer MPointIndex, TColgp_Array1OfPnt& tabPt, TColgp_Array1OfPnt2d& tabPt2d) const; 107 108 //! Returns the 3d tangency points of the multipoint <MPointIndex> only 109 //! when 3d points exist. 110 Standard_EXPORT Standard_Boolean Tangency ( const Standard_Integer MPointIndex, 111 TColgp_Array1OfVec& tabV) const; 112 113 //! Returns the 2d tangency points of the multipoint <MPointIndex> only 114 //! when 2d points exist. 115 Standard_EXPORT Standard_Boolean Tangency ( const Standard_Integer MPointIndex, 116 TColgp_Array1OfVec2d& tabV2d) const; 117 118 //! Returns the 3d and 2d points of the multipoint <MPointIndex>. 119 Standard_EXPORT Standard_Boolean Tangency (const Standard_Integer MPointIndex, TColgp_Array1OfVec& tabV, TColgp_Array1OfVec2d& tabV2d) const; 120 121 //! Tries to make a sub-line between <Low> and <High> points of this line 122 //! by adding <NbPointsToInsert> new points 123 Standard_EXPORT GeomInt_TheMultiLineOfWLApprox MakeMLBetween (const Standard_Integer Low, 124 const Standard_Integer High, 125 const Standard_Integer NbPointsToInsert) const; 126 127 //! Tries to make a sub-line between <Low> and <High> points of this line 128 //! by adding one more point between (indbad-1)-th and indbad-th points 129 Standard_EXPORT Standard_Boolean MakeMLOneMorePoint (const Standard_Integer Low, 130 const Standard_Integer High, 131 const Standard_Integer indbad, 132 GeomInt_TheMultiLineOfWLApprox& OtherLine) const; 133 134 //! Dump of the current multi-line. 135 Standard_EXPORT void Dump() const; 136 137 138 139 140 protected: 141 142 private: 143 Standard_Address PtrOnmySvSurfaces; 144 Handle(IntPatch_WLine) myLine; 145 Standard_Integer indicemin; 146 Standard_Integer indicemax; 147 Standard_Integer nbp3d; 148 Standard_Integer nbp2d; 149 Standard_Boolean myApproxU1V1; 150 Standard_Boolean myApproxU2V2; 151 Standard_Boolean p2donfirst; 152 Standard_Real Xo; 153 Standard_Real Yo; 154 Standard_Real Zo; 155 Standard_Real U1o; 156 Standard_Real V1o; 157 Standard_Real U2o; 158 Standard_Real V2o; 159 160 161 }; 162 163 #endif // _GeomInt_TheMultiLineOfWLApprox_HeaderFile 164