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_TheIWLineOfTheIWalking_HeaderFile
0018 #define _Contap_TheIWLineOfTheIWalking_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <IntSurf_SequenceOfCouple.hxx>
0024 #include <Standard_Boolean.hxx>
0025 #include <Standard_Integer.hxx>
0026 #include <IntSurf_PathPoint.hxx>
0027 #include <gp_Vec.hxx>
0028 #include <Standard_Transient.hxx>
0029 #include <IntSurf_Allocator.hxx>
0030 class IntSurf_LineOn2S;
0031 class Standard_OutOfRange;
0032 class Standard_DomainError;
0033 class IntSurf_PathPoint;
0034 class IntSurf_PntOn2S;
0035 class gp_Vec;
0036 
0037 
0038 class Contap_TheIWLineOfTheIWalking;
0039 DEFINE_STANDARD_HANDLE(Contap_TheIWLineOfTheIWalking, Standard_Transient)
0040 
0041 
0042 class Contap_TheIWLineOfTheIWalking : public Standard_Transient
0043 {
0044 
0045 public:
0046 
0047   
0048   Standard_EXPORT Contap_TheIWLineOfTheIWalking(const IntSurf_Allocator& theAllocator = 0);
0049   
0050   //! reverse the points in the line. Hasfirst, HasLast are kept.
0051   Standard_EXPORT void Reverse();
0052   
0053   //! Cut the line at the point of rank Index.
0054     void Cut (const Standard_Integer Index);
0055   
0056   //! Add a point in the line.
0057     void AddPoint (const IntSurf_PntOn2S& P);
0058   
0059     void AddStatusFirst (const Standard_Boolean Closed, const Standard_Boolean HasFirst);
0060   
0061     void AddStatusFirst (const Standard_Boolean Closed, const Standard_Boolean HasLast, const Standard_Integer Index, const IntSurf_PathPoint& P);
0062   
0063     void AddStatusFirstLast (const Standard_Boolean Closed, const Standard_Boolean HasFirst, const Standard_Boolean HasLast);
0064   
0065     void AddStatusLast (const Standard_Boolean HasLast);
0066   
0067     void AddStatusLast (const Standard_Boolean HasLast, const Standard_Integer Index, const IntSurf_PathPoint& P);
0068   
0069   //! associer a l 'indice du point sur la ligne l'indice du point
0070   //! passant dans l'iterateur de depart
0071     void AddIndexPassing (const Standard_Integer Index);
0072   
0073     void SetTangentVector (const gp_Vec& V, const Standard_Integer Index);
0074   
0075     void SetTangencyAtBegining (const Standard_Boolean IsTangent);
0076   
0077     void SetTangencyAtEnd (const Standard_Boolean IsTangent);
0078   
0079   //! Returns the number of points of the line (including first
0080   //! point and end point : see HasLastPoint and HasFirstPoint).
0081     Standard_Integer NbPoints() const;
0082   
0083   //! Returns the point of range Index.
0084   //! If index <= 0 or Index > NbPoints, an exception is raised.
0085     const IntSurf_PntOn2S& Value (const Standard_Integer Index) const;
0086   
0087   //! Returns the LineOn2S contained in the walking line.
0088     const Handle(IntSurf_LineOn2S)& Line() const;
0089   
0090   //! Returns True if the line is closed.
0091     Standard_Boolean IsClosed() const;
0092   
0093   //! Returns True if the first point of the line is a
0094   //! marching point . when is HasFirstPoint==False ,the line
0095   //! begins on the natural bound of the surface.the line can be
0096   //! too long
0097     Standard_Boolean HasFirstPoint() const;
0098   
0099   //! Returns True if the end point of the line is a
0100   //! marching point (Point from IntWS).
0101   //! when is HasFirstPoint==False ,the line ends
0102   //! on the natural bound of the surface.the line can be
0103   //! too long.
0104     Standard_Boolean HasLastPoint() const;
0105   
0106   //! Returns the first point of the line when it is a
0107   //! marching point.
0108   //! An exception is raised if HasFirstPoint returns False.
0109     const IntSurf_PathPoint& FirstPoint() const;
0110   
0111   //! Returns the Index of first point of the line when it is a
0112   //! marching point.This index is the index in the
0113   //! PointStartIterator.
0114   //! An exception is raised if HasFirstPoint returns False.
0115     Standard_Integer FirstPointIndex() const;
0116   
0117   //! Returns the last point of the line when it is a
0118   //! marching point.
0119   //! An exception is raised if HasLastPoint returns False.
0120     const IntSurf_PathPoint& LastPoint() const;
0121   
0122   //! Returns the index of last point of the line when it is a
0123   //! marching point.This index is the index in the
0124   //! PointStartIterator.
0125   //! An exception is raised if HasLastPoint returns False.
0126     Standard_Integer LastPointIndex() const;
0127   
0128   //! returns the number of points belonging to Pnts1 which are
0129   //! passing point.
0130     Standard_Integer NbPassingPoint() const;
0131   
0132   //! returns the index of the point belonging to the line which
0133   //! is associated to the passing point belonging to Pnts1
0134   //! an exception is raised if Index > NbPassingPoint()
0135     void PassingPoint (const Standard_Integer Index, Standard_Integer& IndexLine, Standard_Integer& IndexPnts) const;
0136   
0137     const gp_Vec& TangentVector (Standard_Integer& Index) const;
0138   
0139     Standard_Boolean IsTangentAtBegining() const;
0140   
0141     Standard_Boolean IsTangentAtEnd() const;
0142 
0143 
0144 
0145 
0146   DEFINE_STANDARD_RTTI_INLINE(Contap_TheIWLineOfTheIWalking,Standard_Transient)
0147 
0148 protected:
0149 
0150 
0151 
0152 
0153 private:
0154 
0155 
0156   Handle(IntSurf_LineOn2S) line;
0157   IntSurf_SequenceOfCouple couple;
0158   Standard_Boolean closed;
0159   Standard_Boolean hasFirst;
0160   Standard_Boolean hasLast;
0161   Standard_Integer firstIndex;
0162   Standard_Integer lastIndex;
0163   IntSurf_PathPoint theFirstPoint;
0164   IntSurf_PathPoint theLastPoint;
0165   Standard_Integer indextg;
0166   gp_Vec vcttg;
0167   Standard_Boolean istgtbeg;
0168   Standard_Boolean istgtend;
0169 
0170 
0171 };
0172 
0173 #define TheStartPoint IntSurf_PathPoint
0174 #define TheStartPoint_hxx <IntSurf_PathPoint.hxx>
0175 #define IntWalk_IWLine Contap_TheIWLineOfTheIWalking
0176 #define IntWalk_IWLine_hxx <Contap_TheIWLineOfTheIWalking.hxx>
0177 #define Handle_IntWalk_IWLine Handle(Contap_TheIWLineOfTheIWalking)
0178 
0179 #include <IntWalk_IWLine.lxx>
0180 
0181 #undef TheStartPoint
0182 #undef TheStartPoint_hxx
0183 #undef IntWalk_IWLine
0184 #undef IntWalk_IWLine_hxx
0185 #undef Handle_IntWalk_IWLine
0186 
0187 
0188 
0189 
0190 #endif // _Contap_TheIWLineOfTheIWalking_HeaderFile