Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1993-02-05
0002 // Created by: Jacques GOUSSARD
0003 // Copyright (c) 1993-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 _Contap_TheIWalking_HeaderFile
0018 #define _Contap_TheIWalking_HeaderFile
0019 
0020 #include <Adaptor3d_Surface.hxx>
0021 #include <IntSurf_SequenceOfPathPoint.hxx>
0022 #include <math_Vector.hxx>
0023 #include <IntWalk_VectorOfWalkingData.hxx>
0024 #include <IntWalk_VectorOfInteger.hxx>
0025 #include <IntSurf_PntOn2S.hxx>
0026 #include <gp_Vec.hxx>
0027 #include <gp_Dir2d.hxx>
0028 #include <TColStd_SequenceOfInteger.hxx>
0029 #include <TColStd_DataMapOfIntegerListOfInteger.hxx>
0030 #include <Contap_SequenceOfIWLineOfTheIWalking.hxx>
0031 #include <IntSurf_SequenceOfInteriorPoint.hxx>
0032 #include <TColStd_SequenceOfReal.hxx>
0033 #include <IntWalk_StatusDeflection.hxx>
0034 #include <Bnd_Range.hxx>
0035 
0036 class IntSurf_PathPoint;
0037 class IntSurf_PathPointTool;
0038 class IntSurf_InteriorPoint;
0039 class IntSurf_InteriorPointTool;
0040 class Adaptor3d_HSurfaceTool;
0041 class Contap_SurfFunction;
0042 class Contap_TheIWLineOfTheIWalking;
0043 class math_FunctionSetRoot;
0044 
0045 class Contap_TheIWalking 
0046 {
0047 public:
0048 
0049   DEFINE_STANDARD_ALLOC
0050 
0051   
0052   //! Deflection is the maximum deflection admitted between two
0053   //! consecutive points on a resulting polyline.
0054   //! Step is the maximum increment admitted between two
0055   //! consecutive points (in 2d space).
0056   //! Epsilon is the tolerance beyond which 2 points
0057   //! are confused.
0058   //! theToFillHoles is the flag defining whether possible holes
0059   //! between resulting curves are filled or not
0060   //! in case of Contap walking theToFillHoles is True
0061   Standard_EXPORT Contap_TheIWalking(const Standard_Real Epsilon, const Standard_Real Deflection, const Standard_Real Step,
0062                                      const Standard_Boolean theToFillHoles = Standard_False);
0063   
0064   //! Deflection is the maximum deflection admitted between two
0065   //! consecutive points on a resulting polyline.
0066   //! Step is the maximum increment admitted between two
0067   //! consecutive points (in 2d space).
0068   //! Epsilon is the tolerance beyond which 2 points
0069   //! are confused
0070     void SetTolerance (const Standard_Real Epsilon, const Standard_Real Deflection, const Standard_Real Step);
0071   
0072   //! Searches a set of polylines starting on a point of Pnts1
0073   //! or Pnts2.
0074   //! Each point on a resulting polyline verifies F(u,v)=0
0075   Standard_EXPORT void Perform (const IntSurf_SequenceOfPathPoint& Pnts1, const IntSurf_SequenceOfInteriorPoint& Pnts2, Contap_SurfFunction& Func, const Handle(Adaptor3d_Surface)& S, const Standard_Boolean Reversed = Standard_False);
0076   
0077   //! Searches a set of polylines starting on a point of Pnts1.
0078   //! Each point on a resulting polyline verifies F(u,v)=0
0079   Standard_EXPORT void Perform (const IntSurf_SequenceOfPathPoint& Pnts1, Contap_SurfFunction& Func, const Handle(Adaptor3d_Surface)& S, const Standard_Boolean Reversed = Standard_False);
0080   
0081   //! Returns true if the calculus was successful.
0082     Standard_Boolean IsDone() const;
0083   
0084   //! Returns the number of resulting polylines.
0085   //! An exception is raised if IsDone returns False.
0086     Standard_Integer NbLines() const;
0087   
0088   //! Returns the polyline of range Index.
0089   //! An exception is raised if IsDone is False.
0090   //! An exception is raised if Index<=0 or Index>NbLines.
0091     const Handle(Contap_TheIWLineOfTheIWalking)& Value (const Standard_Integer Index) const;
0092   
0093   //! Returns the number of points belonging to Pnts on which no
0094   //! line starts or ends.
0095   //! An exception is raised if IsDone returns False.
0096     Standard_Integer NbSinglePnts() const;
0097   
0098   //! Returns the point of range Index .
0099   //! An exception is raised if IsDone returns False.
0100   //! An exception is raised if Index<=0 or
0101   //! Index > NbSinglePnts.
0102     const IntSurf_PathPoint& SinglePnt (const Standard_Integer Index) const;
0103 
0104 
0105 
0106 
0107 protected:
0108 
0109   
0110   Standard_EXPORT Standard_Boolean Cadrage (math_Vector& BornInf, math_Vector& BornSup, math_Vector& UVap, Standard_Real& Step, const Standard_Integer StepSign) const;
0111   
0112   Standard_EXPORT Standard_Boolean TestArretPassage (const TColStd_SequenceOfReal& Umult, const TColStd_SequenceOfReal& Vmult, Contap_SurfFunction& Section, math_Vector& UV, Standard_Integer& Irang);
0113   
0114   Standard_EXPORT Standard_Boolean TestArretPassage (const TColStd_SequenceOfReal& Umult, const TColStd_SequenceOfReal& Vmult, const math_Vector& UV, const Standard_Integer Index, Standard_Integer& Irang);
0115   
0116   Standard_EXPORT Standard_Boolean TestArretAjout (Contap_SurfFunction& Section, math_Vector& UV, Standard_Integer& Irang, IntSurf_PntOn2S& PSol);
0117   
0118   Standard_EXPORT void FillPntsInHoles (Contap_SurfFunction& Section,
0119                                         TColStd_SequenceOfInteger& CopySeqAlone,
0120                                         IntSurf_SequenceOfInteriorPoint& PntsInHoles);
0121   
0122   Standard_EXPORT void TestArretCadre (const TColStd_SequenceOfReal& Umult, const TColStd_SequenceOfReal& Vmult, const Handle(Contap_TheIWLineOfTheIWalking)& Line, Contap_SurfFunction& Section, math_Vector& UV, Standard_Integer& Irang);
0123   
0124   Standard_EXPORT IntWalk_StatusDeflection TestDeflection (Contap_SurfFunction& Section, const Standard_Boolean Finished, const math_Vector& UV, const IntWalk_StatusDeflection StatusPrecedent, Standard_Integer& NbDivision, Standard_Real& Step, const Standard_Integer StepSign);
0125   
0126   Standard_EXPORT void ComputeOpenLine (const TColStd_SequenceOfReal& Umult, const TColStd_SequenceOfReal& Vmult, const IntSurf_SequenceOfPathPoint& Pnts1, Contap_SurfFunction& Section, Standard_Boolean& Rajout);
0127   
0128   Standard_EXPORT void OpenLine (const Standard_Integer N, const IntSurf_PntOn2S& Psol, const IntSurf_SequenceOfPathPoint& Pnts1, Contap_SurfFunction& Section, const Handle(Contap_TheIWLineOfTheIWalking)& Line);
0129   
0130   Standard_EXPORT Standard_Boolean IsValidEndPoint (const Standard_Integer IndOfPoint, const Standard_Integer IndOfLine);
0131   
0132   Standard_EXPORT void RemoveTwoEndPoints (const Standard_Integer IndOfPoint);
0133   
0134   Standard_EXPORT Standard_Boolean IsPointOnLine (const gp_Pnt2d& theP2d, const Standard_Integer Irang);
0135   
0136   Standard_EXPORT void ComputeCloseLine (const TColStd_SequenceOfReal& Umult, const TColStd_SequenceOfReal& Vmult, const IntSurf_SequenceOfPathPoint& Pnts1, const IntSurf_SequenceOfInteriorPoint& Pnts2, Contap_SurfFunction& Section, Standard_Boolean& Rajout);
0137   
0138   Standard_EXPORT void AddPointInCurrentLine (const Standard_Integer N, const IntSurf_PathPoint& PathPnt, const Handle(Contap_TheIWLineOfTheIWalking)& CurrentLine) const;
0139   
0140   Standard_EXPORT void MakeWalkingPoint (const Standard_Integer Case, const Standard_Real U, const Standard_Real V, Contap_SurfFunction& Section, IntSurf_PntOn2S& Psol);
0141   
0142   //! Clears up internal containers
0143   Standard_EXPORT void Clear();
0144 
0145   //! Returns TRUE if thePOn2S is in one of existing lines.
0146   Standard_EXPORT Standard_Boolean IsPointOnLine(const IntSurf_PntOn2S& thePOn2S,
0147                                                  const math_Vector& theInfBounds,
0148                                                  const math_Vector& theSupBounds,
0149                                                  math_FunctionSetRoot& theSolver,
0150                                                  Contap_SurfFunction& theFunc);
0151 
0152 
0153 private:
0154 
0155 
0156 
0157   Standard_Boolean done;
0158   IntSurf_SequenceOfPathPoint seqSingle;
0159   Standard_Real fleche;
0160   Standard_Real pas;
0161   math_Vector tolerance;
0162   Standard_Real epsilon;
0163   Standard_Boolean reversed;
0164   IntWalk_VectorOfWalkingData wd1;
0165   IntWalk_VectorOfWalkingData wd2;
0166   IntWalk_VectorOfInteger nbMultiplicities;
0167   Bnd_Range mySRangeU; // Estimated U-range for section curve
0168   Bnd_Range mySRangeV; // Estimated V-range for section curve
0169   Standard_Real Um;
0170   Standard_Real UM;
0171   Standard_Real Vm;
0172   Standard_Real VM;
0173   IntSurf_PntOn2S previousPoint;
0174   gp_Vec previousd3d;
0175   gp_Dir2d previousd2d;
0176   TColStd_SequenceOfInteger seqAjout;
0177   TColStd_SequenceOfInteger seqAlone;
0178   TColStd_DataMapOfIntegerListOfInteger PointLineLine;
0179   Contap_SequenceOfIWLineOfTheIWalking lines;
0180   Standard_Boolean ToFillHoles;
0181 
0182 
0183 };
0184 
0185 #define ThePointOfPath IntSurf_PathPoint
0186 #define ThePointOfPath_hxx <IntSurf_PathPoint.hxx>
0187 #define ThePointOfPathTool IntSurf_PathPointTool
0188 #define ThePointOfPathTool_hxx <IntSurf_PathPointTool.hxx>
0189 #define ThePOPIterator IntSurf_SequenceOfPathPoint
0190 #define ThePOPIterator_hxx <IntSurf_SequenceOfPathPoint.hxx>
0191 #define ThePointOfLoop IntSurf_InteriorPoint
0192 #define ThePointOfLoop_hxx <IntSurf_InteriorPoint.hxx>
0193 #define ThePointOfLoopTool IntSurf_InteriorPointTool
0194 #define ThePointOfLoopTool_hxx <IntSurf_InteriorPointTool.hxx>
0195 #define ThePOLIterator IntSurf_SequenceOfInteriorPoint
0196 #define ThePOLIterator_hxx <IntSurf_SequenceOfInteriorPoint.hxx>
0197 #define ThePSurface Handle(Adaptor3d_Surface)
0198 #define ThePSurface_hxx <Adaptor3d_Surface.hxx>
0199 #define ThePSurfaceTool Adaptor3d_HSurfaceTool
0200 #define ThePSurfaceTool_hxx <Adaptor3d_HSurfaceTool.hxx>
0201 #define TheIWFunction Contap_SurfFunction
0202 #define TheIWFunction_hxx <Contap_SurfFunction.hxx>
0203 #define IntWalk_TheIWLine Contap_TheIWLineOfTheIWalking
0204 #define IntWalk_TheIWLine_hxx <Contap_TheIWLineOfTheIWalking.hxx>
0205 #define IntWalk_SequenceOfIWLine Contap_SequenceOfIWLineOfTheIWalking
0206 #define IntWalk_SequenceOfIWLine_hxx <Contap_SequenceOfIWLineOfTheIWalking.hxx>
0207 #define Handle_IntWalk_TheIWLine Handle(Contap_TheIWLineOfTheIWalking)
0208 #define IntWalk_IWalking Contap_TheIWalking
0209 #define IntWalk_IWalking_hxx <Contap_TheIWalking.hxx>
0210 
0211 #include <IntWalk_IWalking.lxx>
0212 
0213 #undef ThePointOfPath
0214 #undef ThePointOfPath_hxx
0215 #undef ThePointOfPathTool
0216 #undef ThePointOfPathTool_hxx
0217 #undef ThePOPIterator
0218 #undef ThePOPIterator_hxx
0219 #undef ThePointOfLoop
0220 #undef ThePointOfLoop_hxx
0221 #undef ThePointOfLoopTool
0222 #undef ThePointOfLoopTool_hxx
0223 #undef ThePOLIterator
0224 #undef ThePOLIterator_hxx
0225 #undef ThePSurface
0226 #undef ThePSurface_hxx
0227 #undef ThePSurfaceTool
0228 #undef ThePSurfaceTool_hxx
0229 #undef TheIWFunction
0230 #undef TheIWFunction_hxx
0231 #undef IntWalk_TheIWLine
0232 #undef IntWalk_TheIWLine_hxx
0233 #undef IntWalk_SequenceOfIWLine
0234 #undef IntWalk_SequenceOfIWLine_hxx
0235 #undef Handle_IntWalk_TheIWLine
0236 #undef IntWalk_IWalking
0237 #undef IntWalk_IWalking_hxx
0238 
0239 
0240 
0241 
0242 #endif // _Contap_TheIWalking_HeaderFile