Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-23 09:16:52

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