Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:13

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 <LocOpe_SequenceOfLin.hxx>
0026 #include <LocOpe_SequenceOfCirc.hxx>
0027 #include <TColGeom_SequenceOfCurve.hxx>
0028 #include <TopAbs_Orientation.hxx>
0029 class LocOpe_PntFace;
0030 
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 
0040   DEFINE_STANDARD_ALLOC
0041 
0042   
0043   //! Empty constructor.
0044     LocOpe_CSIntersector();
0045   
0046   //! Creates  and performs the intersection     betwwen
0047   //! <Ax1> and <S>.
0048     LocOpe_CSIntersector(const TopoDS_Shape& S);
0049   
0050   //! Performs the intersection between <Ax1 and <S>.
0051   Standard_EXPORT void Init (const TopoDS_Shape& S);
0052   
0053   Standard_EXPORT void Perform (const LocOpe_SequenceOfLin& Slin);
0054   
0055   Standard_EXPORT void Perform (const LocOpe_SequenceOfCirc& Scir);
0056   
0057   Standard_EXPORT void Perform (const TColGeom_SequenceOfCurve& Scur);
0058   
0059   //! Returns <Standard_True>  if the  intersection  has
0060   //! been done.
0061     Standard_Boolean IsDone() const;
0062   
0063   //! Returns  the number of   intersection point on the
0064   //! element of range <I>.
0065   Standard_EXPORT Standard_Integer NbPoints (const Standard_Integer I) const;
0066   
0067   //! Returns the intersection point of range <Index> on
0068   //! element of range   <I>. The points   are sorted in
0069   //! increasing order of parameter along the axis.
0070   Standard_EXPORT const LocOpe_PntFace& Point (const Standard_Integer I, const Standard_Integer Index) const;
0071   
0072   //! On  the element of range   <I>, searches the first
0073   //! intersection   point  located after  the parameter
0074   //! <From>,  which orientation is not TopAbs_EXTERNAL.
0075   //! If  found, returns <Standard_True>.  <Or> contains
0076   //! the orientation    of  the  point,  <IndFrom>  and
0077   //! <IndTo> represents  the interval  of index in  the
0078   //! sequence  of intersection  point corresponding  to
0079   //! the  point. (IndFrom <=   IndTo). <Tol> is used to
0080   //! determine if 2 parameters are equal.
0081   //!
0082   //! Otherwise, returns <Standard_False>.
0083   Standard_EXPORT Standard_Boolean LocalizeAfter (const Standard_Integer I, const Standard_Real From, const Standard_Real Tol, TopAbs_Orientation& Or, Standard_Integer& IndFrom, Standard_Integer& IndTo) const;
0084   
0085   //! On the element  of range  <I>, searches the  first
0086   //! intersection point   located before  the parameter
0087   //! <From>,  which orientation is not TopAbs_EXTERNAL.
0088   //! If found,  returns <Standard_True>.  <Or> contains
0089   //! the   orientation  of   the point,  <IndFrom>  and
0090   //! <IndTo> represents the interval   of index in  the
0091   //! sequence of  intersection  point corresponding  to
0092   //! the point (IndFrom  <=  IndTo). <Tol> is   used to
0093   //! determine if 2 parameters are equal.
0094   //!
0095   //! Otherwise, returns <Standard_False>.
0096   Standard_EXPORT Standard_Boolean LocalizeBefore (const Standard_Integer I, const Standard_Real From, const Standard_Real Tol, TopAbs_Orientation& Or, Standard_Integer& IndFrom, Standard_Integer& IndTo) const;
0097   
0098   //! On the  element of  range <I>, searches  the first
0099   //! intersection      point  located after the   index
0100   //! <FromInd> ( >=  FromInd + 1), which orientation is
0101   //! not    TopAbs_EXTERNAL.      If    found,  returns
0102   //! <Standard_True>.  <Or> contains the orientation of
0103   //! the  point, <IndFrom>  and <IndTo> represents  the
0104   //! interval of index in  the sequence of intersection
0105   //! point corresponding   to the  point.  (IndFrom  <=
0106   //! IndTo). <Tol> is used to determine if 2 parameters
0107   //! are equal.
0108   //!
0109   //! Otherwise, returns <Standard_False>.
0110   Standard_EXPORT Standard_Boolean LocalizeAfter (const Standard_Integer I, const Standard_Integer FromInd, const Standard_Real Tol, TopAbs_Orientation& Or, Standard_Integer& IndFrom, Standard_Integer& IndTo) const;
0111   
0112   //! On  the element of  range  <I>, searches the first
0113   //! intersection  point    located  before  the  index
0114   //! <FromInd>  (  <= FromInd -1), which orientation is
0115   //! not   TopAbs_EXTERNAL.  If    found,       returns
0116   //! <Standard_True>.  <Or> contains the orientation of
0117   //! the  point, <IndFrom>  and  <IndTo> represents the
0118   //! interval of  index in the sequence of intersection
0119   //! point  corresponding to   the  point  (IndFrom  <=
0120   //! IndTo). <Tol> is used to determine if 2 parameters
0121   //! are equal.
0122   //!
0123   //! Otherwise, returns <Standard_False>.
0124   Standard_EXPORT Standard_Boolean LocalizeBefore (const Standard_Integer I, const Standard_Integer FromInd, const Standard_Real Tol, TopAbs_Orientation& Or, Standard_Integer& IndFrom, Standard_Integer& IndTo) const;
0125   
0126   Standard_EXPORT void Destroy();
0127 ~LocOpe_CSIntersector()
0128 {
0129   Destroy();
0130 }
0131 
0132 
0133 
0134 
0135 protected:
0136 
0137 
0138 
0139 
0140 
0141 private:
0142 
0143 
0144 
0145   Standard_Boolean myDone;
0146   TopoDS_Shape myShape;
0147   Standard_Address myPoints;
0148   Standard_Integer myNbelem;
0149 
0150 
0151 };
0152 
0153 
0154 #include <LocOpe_CSIntersector.lxx>
0155 
0156 
0157 
0158 
0159 
0160 #endif // _LocOpe_CSIntersector_HeaderFile