Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-12 09:17:20

0001 // Created on: 1995-01-27
0002 // Created by: Jacques GOUSSARD
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 _GeomInt_TheMultiLineOfWLApprox_HeaderFile
0018 #define _GeomInt_TheMultiLineOfWLApprox_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 IntPatch_WLine;
0034 class ApproxInt_SvSurfaces;
0035 
0036 class GeomInt_TheMultiLineOfWLApprox
0037 {
0038 public:
0039   DEFINE_STANDARD_ALLOC
0040 
0041   Standard_EXPORT GeomInt_TheMultiLineOfWLApprox();
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 GeomInt_TheMultiLineOfWLApprox(const occ::handle<IntPatch_WLine>& 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 GeomInt_TheMultiLineOfWLApprox(const occ::handle<IntPatch_WLine>& 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
0107   //! when 3d points exist.
0108   Standard_EXPORT bool Tangency(const int MPointIndex, NCollection_Array1<gp_Vec>& tabV) const;
0109 
0110   //! Returns the 2d tangency points of the multipoint <MPointIndex> only
0111   //! when 2d points exist.
0112   Standard_EXPORT bool Tangency(const int MPointIndex, NCollection_Array1<gp_Vec2d>& tabV2d) const;
0113 
0114   //! Returns the 3d and 2d points of the multipoint <MPointIndex>.
0115   Standard_EXPORT bool Tangency(const int                     MPointIndex,
0116                                 NCollection_Array1<gp_Vec>&   tabV,
0117                                 NCollection_Array1<gp_Vec2d>& tabV2d) const;
0118 
0119   //! Tries to make a sub-line between <Low> and <High> points of this line
0120   //! by adding <NbPointsToInsert> new points
0121   Standard_EXPORT GeomInt_TheMultiLineOfWLApprox MakeMLBetween(const int Low,
0122                                                                const int High,
0123                                                                const int NbPointsToInsert) const;
0124 
0125   //! Tries to make a sub-line between <Low> and <High> points of this line
0126   //! by adding one more point between (indbad-1)-th and indbad-th points
0127   Standard_EXPORT bool MakeMLOneMorePoint(const int                       Low,
0128                                           const int                       High,
0129                                           const int                       indbad,
0130                                           GeomInt_TheMultiLineOfWLApprox& OtherLine) const;
0131 
0132   //! Dump of the current multi-line.
0133   Standard_EXPORT void Dump() const;
0134 
0135 private:
0136   void*                       PtrOnmySvSurfaces;
0137   occ::handle<IntPatch_WLine> myLine;
0138   int                         indicemin;
0139   int                         indicemax;
0140   int                         nbp3d;
0141   int                         nbp2d;
0142   bool                        myApproxU1V1;
0143   bool                        myApproxU2V2;
0144   bool                        p2donfirst;
0145   double                      Xo;
0146   double                      Yo;
0147   double                      Zo;
0148   double                      U1o;
0149   double                      V1o;
0150   double                      U2o;
0151   double                      V2o;
0152 };
0153 
0154 #endif // _GeomInt_TheMultiLineOfWLApprox_HeaderFile