Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/LocOpe_CSIntersector.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: 1996-06-11
0002 // Created by: Jacques GOUSSARD
0003 // Copyright (c) 1996-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 _LocOpe_CSIntersector_HeaderFile
0018 #define _LocOpe_CSIntersector_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <TopoDS_Shape.hxx>
0024 #include <Standard_Integer.hxx>
0025 #include <gp_Lin.hxx>
0026 #include <NCollection_Sequence.hxx>
0027 #include <gp_Circ.hxx>
0028 #include <Geom_Curve.hxx>
0029 #include <TopAbs_Orientation.hxx>
0030 class LocOpe_PntFace;
0031 
0032 //! This class provides the intersection between a set
0033 //! of axis or a circle and the faces of a shape. The
0034 //! intersection points are sorted in increasing
0035 //! parameter along each axis or circle.
0036 class LocOpe_CSIntersector
0037 {
0038 public:
0039   DEFINE_STANDARD_ALLOC
0040 
0041   //! Empty constructor.
0042   LocOpe_CSIntersector();
0043 
0044   //! Creates and performs the intersection between
0045   //! <Ax1> and <S>.
0046   LocOpe_CSIntersector(const TopoDS_Shape& S);
0047 
0048   //! Performs the intersection between <Ax1 and <S>.
0049   Standard_EXPORT void Init(const TopoDS_Shape& S);
0050 
0051   Standard_EXPORT void Perform(const NCollection_Sequence<gp_Lin>& Slin);
0052 
0053   Standard_EXPORT void Perform(const NCollection_Sequence<gp_Circ>& Scir);
0054 
0055   Standard_EXPORT void Perform(const NCollection_Sequence<occ::handle<Geom_Curve>>& Scur);
0056 
0057   //! Returns <true> if the intersection has
0058   //! been done.
0059   bool IsDone() const;
0060 
0061   //! Returns the number of intersection point on the
0062   //! element of range <I>.
0063   Standard_EXPORT int NbPoints(const int I) const;
0064 
0065   //! Returns the intersection point of range <Index> on
0066   //! element of range <I>. The points are sorted in
0067   //! increasing order of parameter along the axis.
0068   Standard_EXPORT const LocOpe_PntFace& Point(const int I, const int Index) const;
0069 
0070   //! On the element of range <I>, searches the first
0071   //! intersection point located after the parameter
0072   //! <From>, which orientation is not TopAbs_EXTERNAL.
0073   //! If found, returns <true>. <Or> contains
0074   //! the orientation of the point, <IndFrom> and
0075   //! <IndTo> represents the interval of index in the
0076   //! sequence of intersection point corresponding to
0077   //! the point. (IndFrom <= IndTo). <Tol> is used to
0078   //! determine if 2 parameters are equal.
0079   //!
0080   //! Otherwise, returns <false>.
0081   Standard_EXPORT bool LocalizeAfter(const int           I,
0082                                      const double        From,
0083                                      const double        Tol,
0084                                      TopAbs_Orientation& Or,
0085                                      int&                IndFrom,
0086                                      int&                IndTo) const;
0087 
0088   //! On the element of range <I>, searches the first
0089   //! intersection point located before the parameter
0090   //! <From>, which orientation is not TopAbs_EXTERNAL.
0091   //! If found, returns <true>. <Or> contains
0092   //! the orientation of the point, <IndFrom> and
0093   //! <IndTo> represents the interval of index in the
0094   //! sequence of intersection point corresponding to
0095   //! the point (IndFrom <= IndTo). <Tol> is used to
0096   //! determine if 2 parameters are equal.
0097   //!
0098   //! Otherwise, returns <false>.
0099   Standard_EXPORT bool LocalizeBefore(const int           I,
0100                                       const double        From,
0101                                       const double        Tol,
0102                                       TopAbs_Orientation& Or,
0103                                       int&                IndFrom,
0104                                       int&                IndTo) const;
0105 
0106   //! On the element of range <I>, searches the first
0107   //! intersection point located after the index
0108   //! <FromInd> ( >= FromInd + 1), which orientation is
0109   //! not TopAbs_EXTERNAL. If found, returns
0110   //! <true>. <Or> contains the orientation of
0111   //! the point, <IndFrom> and <IndTo> represents the
0112   //! interval of index in the sequence of intersection
0113   //! point corresponding to the point. (IndFrom <= IndTo).
0114   //! <Tol> is used to determine if 2 parameters are equal.
0115   //!
0116   //! Otherwise, returns <false>.
0117   Standard_EXPORT bool LocalizeAfter(const int           I,
0118                                      const int           FromInd,
0119                                      const double        Tol,
0120                                      TopAbs_Orientation& Or,
0121                                      int&                IndFrom,
0122                                      int&                IndTo) const;
0123 
0124   //! On the element of range <I>, searches the first
0125   //! intersection point located before the index
0126   //! <FromInd> (<= FromInd -1), which orientation is
0127   //! not TopAbs_EXTERNAL. If found, returns
0128   //! <true>. <Or> contains the orientation of
0129   //! the point, <IndFrom> and <IndTo> represents the
0130   //! interval of index in the sequence of intersection
0131   //! point corresponding to the point (IndFrom <= IndTo).
0132   //! <Tol> is used to determine if 2 parameters are equal.
0133   //!
0134   //! Otherwise, returns <false>.
0135   Standard_EXPORT bool LocalizeBefore(const int           I,
0136                                       const int           FromInd,
0137                                       const double        Tol,
0138                                       TopAbs_Orientation& Or,
0139                                       int&                IndFrom,
0140                                       int&                IndTo) const;
0141 
0142   Standard_EXPORT void Destroy();
0143 
0144   ~LocOpe_CSIntersector() { Destroy(); }
0145 
0146 private:
0147   bool         myDone;
0148   TopoDS_Shape myShape;
0149   void*        myPoints;
0150   int          myNbelem;
0151 };
0152 
0153 #include <LocOpe_CSIntersector.lxx>
0154 
0155 #endif // _LocOpe_CSIntersector_HeaderFile