Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/Contap_TheIWalking.hxx was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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