Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:07

0001 // Created on: 1995-06-06
0002 // Created by: Jean Yves LEBEY
0003 // Copyright (c) 1995-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 _BRepApprox_TheMultiLineOfApprox_HeaderFile
0018 #define _BRepApprox_TheMultiLineOfApprox_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Standard_Integer.hxx>
0025 #include <Standard_Boolean.hxx>
0026 #include <Standard_Real.hxx>
0027 #include <Approx_Status.hxx>
0028 #include <TColgp_Array1OfPnt.hxx>
0029 #include <TColgp_Array1OfPnt2d.hxx>
0030 #include <TColgp_Array1OfVec.hxx>
0031 #include <TColgp_Array1OfVec2d.hxx>
0032 class BRepApprox_ApproxLine;
0033 class ApproxInt_SvSurfaces;
0034 
0035 
0036 
0037 class BRepApprox_TheMultiLineOfApprox 
0038 {
0039 public:
0040 
0041   DEFINE_STANDARD_ALLOC
0042   
0043   Standard_EXPORT BRepApprox_TheMultiLineOfApprox();
0044   
0045   //! The class SvSurfaces is used when the approximation algorithm 
0046   //! needs some extra points on the line <line>. 
0047   //! A New line  is then created which shares the same surfaces and functions.
0048   //! SvSurfaces is a deferred class which allows several implementations of
0049   //! this  algorithm with different surfaces (bi-parametric ones, or 
0050   //! implicit and biparametric ones)
0051   Standard_EXPORT BRepApprox_TheMultiLineOfApprox(const Handle(BRepApprox_ApproxLine)& line,
0052                                                   const Standard_Address PtrSvSurfaces,
0053                                                   const Standard_Integer NbP3d,
0054                                                   const Standard_Integer NbP2d,
0055                                                   const Standard_Boolean ApproxU1V1,
0056                                                   const Standard_Boolean ApproxU2V2,
0057                                                   const Standard_Real xo,
0058                                                   const Standard_Real yo,
0059                                                   const Standard_Real zo,
0060                                                   const Standard_Real u1o,
0061                                                   const Standard_Real v1o,
0062                                                   const Standard_Real u2o,
0063                                                   const Standard_Real v2o,
0064                                                   const Standard_Boolean P2DOnFirst,
0065                                                   const Standard_Integer IndMin = 0,
0066                                                   const Standard_Integer IndMax = 0);
0067 
0068   //! No Extra points will be added on the current line
0069   Standard_EXPORT BRepApprox_TheMultiLineOfApprox(const Handle(BRepApprox_ApproxLine)& line,
0070                                                   const Standard_Integer NbP3d,
0071                                                   const Standard_Integer NbP2d,
0072                                                   const Standard_Boolean ApproxU1V1,
0073                                                   const Standard_Boolean ApproxU2V2,
0074                                                   const Standard_Real xo,
0075                                                   const Standard_Real yo,
0076                                                   const Standard_Real zo,
0077                                                   const Standard_Real u1o,
0078                                                   const Standard_Real v1o,
0079                                                   const Standard_Real u2o,
0080                                                   const Standard_Real v2o,
0081                                                   const Standard_Boolean P2DOnFirst,
0082                                                   const Standard_Integer IndMin = 0,
0083                                                   const Standard_Integer IndMax = 0);
0084 
0085   Standard_EXPORT Standard_Integer FirstPoint() const;
0086   
0087   Standard_EXPORT Standard_Integer LastPoint() const;
0088 
0089   //! Returns the number of 2d points of a TheLine.
0090   Standard_EXPORT Standard_Integer NbP2d() const;
0091 
0092   //! Returns the number of 3d points of a TheLine.
0093   Standard_EXPORT Standard_Integer NbP3d() const;
0094 
0095   Standard_EXPORT Approx_Status WhatStatus() const;
0096   
0097   //! Returns the 3d points of the multipoint <MPointIndex> when only 3d points exist.
0098   Standard_EXPORT void Value (const Standard_Integer MPointIndex, TColgp_Array1OfPnt& tabPt) const;
0099 
0100   //! Returns the 2d points of the multipoint <MPointIndex> when only 2d points exist.
0101   Standard_EXPORT void Value (const Standard_Integer MPointIndex, TColgp_Array1OfPnt2d& tabPt2d) const;
0102 
0103   //! Returns the 3d and 2d points of the multipoint <MPointIndex>.
0104   Standard_EXPORT void Value (const Standard_Integer MPointIndex, TColgp_Array1OfPnt& tabPt, TColgp_Array1OfPnt2d& tabPt2d) const;
0105 
0106   //! Returns the 3d tangency points of the multipoint <MPointIndex> only when 3d points exist.
0107   Standard_EXPORT Standard_Boolean Tangency (const Standard_Integer MPointIndex, TColgp_Array1OfVec& tabV) const;
0108   
0109   //! Returns the 2d tangency points of the multipoint <MPointIndex> only when 2d points exist.
0110   Standard_EXPORT Standard_Boolean Tangency (const Standard_Integer MPointIndex, TColgp_Array1OfVec2d& tabV2d) const;
0111   
0112   //! Returns the 3d and 2d points of the multipoint <MPointIndex>.
0113   Standard_EXPORT Standard_Boolean Tangency (const Standard_Integer MPointIndex, TColgp_Array1OfVec& tabV, TColgp_Array1OfVec2d& tabV2d) const;
0114 
0115   //! Tries to make a sub-line between <Low> and <High> points of this line
0116   //! by adding <NbPointsToInsert> new points
0117   Standard_EXPORT BRepApprox_TheMultiLineOfApprox MakeMLBetween (const Standard_Integer Low,
0118                                                                  const Standard_Integer High,
0119                                                                  const Standard_Integer NbPointsToInsert) const;
0120   
0121   //! Tries to make a sub-line between <Low> and <High> points of this line
0122   //! by adding one more point between (indbad-1)-th and indbad-th points
0123   Standard_EXPORT Standard_Boolean MakeMLOneMorePoint (const Standard_Integer Low,
0124                                                        const Standard_Integer High,
0125                                                        const Standard_Integer indbad,
0126                                                        BRepApprox_TheMultiLineOfApprox& OtherLine) const;
0127 
0128   //! Dump of the current multi-line.
0129   Standard_EXPORT void Dump() const;
0130 
0131 protected:
0132 
0133 private:
0134   Standard_Address PtrOnmySvSurfaces;
0135   Handle(BRepApprox_ApproxLine) myLine;
0136   Standard_Integer indicemin;
0137   Standard_Integer indicemax;
0138   Standard_Integer nbp3d;
0139   Standard_Integer nbp2d;
0140   Standard_Boolean myApproxU1V1;
0141   Standard_Boolean myApproxU2V2;
0142   Standard_Boolean p2donfirst;
0143   Standard_Real Xo;
0144   Standard_Real Yo;
0145   Standard_Real Zo;
0146   Standard_Real U1o;
0147   Standard_Real V1o;
0148   Standard_Real U2o;
0149   Standard_Real V2o;
0150 
0151 };
0152 
0153 #endif // _BRepApprox_TheMultiLineOfApprox_HeaderFile