Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1991-05-27
0002 // Created by: Isabelle GRIGNON
0003 // Copyright (c) 1991-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 _IntPatch_WLine_HeaderFile
0018 #define _IntPatch_WLine_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 
0022 #include <Standard_Integer.hxx>
0023 #include <IntPatch_SequenceOfPoint.hxx>
0024 #include <Standard_Real.hxx>
0025 #include <IntPatch_PointLine.hxx>
0026 #include <IntSurf_LineOn2S.hxx>
0027 #include <IntSurf_Situation.hxx>
0028 #include <IntSurf_TypeTrans.hxx>
0029 
0030 class IntPatch_Point;
0031 class IntSurf_PntOn2S;
0032 class gp_Pnt2d;
0033 class gp_Pnt;
0034 
0035 
0036 class IntPatch_WLine;
0037 DEFINE_STANDARD_HANDLE(IntPatch_WLine, IntPatch_PointLine)
0038 
0039 //! Definition of set of points as a result of the intersection
0040 //! between 2 parametrised patches.
0041 class IntPatch_WLine : public IntPatch_PointLine
0042 {
0043 
0044 public:
0045 
0046   //! Enumeration of ways of WLine creation.
0047   enum IntPatch_WLType
0048   {
0049     IntPatch_WLUnknown,
0050     IntPatch_WLImpImp,
0051     IntPatch_WLImpPrm,
0052     IntPatch_WLPrmPrm
0053   };
0054   
0055   //! Creates a WLine as an intersection when the
0056   //! transitions are In or Out.
0057   Standard_EXPORT IntPatch_WLine(const Handle(IntSurf_LineOn2S)& Line, const Standard_Boolean Tang, const IntSurf_TypeTrans Trans1, const IntSurf_TypeTrans Trans2);
0058   
0059   //! Creates a WLine as an intersection when the
0060   //! transitions are Touch.
0061   Standard_EXPORT IntPatch_WLine(const Handle(IntSurf_LineOn2S)& Line, const Standard_Boolean Tang, const IntSurf_Situation Situ1, const IntSurf_Situation Situ2);
0062   
0063   //! Creates a WLine as an intersection when the
0064   //! transitions are Undecided.
0065   Standard_EXPORT IntPatch_WLine(const Handle(IntSurf_LineOn2S)& Line, const Standard_Boolean Tang);
0066   
0067   //! Adds a vertex in the list. If theIsPrepend == TRUE the new
0068   //! vertex will be added before the first element of vertices sequence.
0069   //! Otherwise, to the end of the sequence
0070   virtual void AddVertex (const IntPatch_Point& Pnt,
0071                     const Standard_Boolean theIsPrepend = Standard_False) Standard_OVERRIDE;
0072   
0073   //! Set the Point of index <Index> in the LineOn2S
0074   Standard_EXPORT void SetPoint (const Standard_Integer Index, const IntPatch_Point& Pnt);
0075   
0076   //! Replaces the element of range Index in the list
0077   //! of points.
0078   //! The exception OutOfRange is raised when
0079   //! Index <= 0 or Index > NbVertex.
0080     void Replace (const Standard_Integer Index, const IntPatch_Point& Pnt);
0081   
0082     void SetFirstPoint (const Standard_Integer IndFirst);
0083   
0084     void SetLastPoint (const Standard_Integer IndLast);
0085   
0086   //! Returns the number of intersection points.
0087   virtual Standard_Integer NbPnts() const Standard_OVERRIDE;
0088   
0089   //! Returns the intersection point of range Index.
0090   virtual const IntSurf_PntOn2S& Point (const Standard_Integer Index) const Standard_OVERRIDE;
0091   
0092   //! Returns True if the line has a known First point.
0093   //! This point is given by the method FirstPoint().
0094     Standard_Boolean HasFirstPoint() const;
0095   
0096   //! Returns True if the line has a known Last point.
0097   //! This point is given by the method LastPoint().
0098     Standard_Boolean HasLastPoint() const;
0099   
0100   //! Returns the Point corresponding to the FirstPoint.
0101     const IntPatch_Point& FirstPoint() const;
0102   
0103   //! Returns the Point corresponding to the LastPoint.
0104     const IntPatch_Point& LastPoint() const;
0105   
0106   //! Returns the Point corresponding to the FirstPoint.
0107   //! Indfirst is the index of the first in the list
0108   //! of vertices.
0109     const IntPatch_Point& FirstPoint (Standard_Integer& Indfirst) const;
0110   
0111   //! Returns the Point corresponding to the LastPoint.
0112   //! Indlast is the index of the last in the list
0113   //! of vertices.
0114     const IntPatch_Point& LastPoint (Standard_Integer& Indlast) const;
0115   
0116   //! Returns number of vertices (IntPatch_Point) of the line
0117   virtual Standard_Integer NbVertex() const Standard_OVERRIDE;
0118   
0119   //! Returns the vertex of range Index on the line.
0120   virtual const IntPatch_Point& Vertex (const Standard_Integer Index) const Standard_OVERRIDE;
0121 
0122   //! Returns the vertex of range Index on the line.
0123   virtual IntPatch_Point& ChangeVertex (const Standard_Integer Index) Standard_OVERRIDE;
0124   
0125   //! Set the parameters of all the vertex on the line.
0126   //! if a vertex is already in the line,
0127   //! its parameter is modified
0128   //! else a new point in the line is inserted.
0129   Standard_EXPORT void ComputeVertexParameters (const Standard_Real Tol);
0130   
0131   //! Returns set of intersection points
0132   Standard_EXPORT virtual Handle(IntSurf_LineOn2S) Curve() const Standard_OVERRIDE;
0133   
0134   //! Returns TRUE if theP is out of the box built from
0135   //! the points on 1st surface
0136   Standard_Boolean IsOutSurf1Box (const gp_Pnt2d& theP) const Standard_OVERRIDE
0137   {
0138     return curv->IsOutSurf1Box(theP);
0139   }
0140   
0141   //! Returns TRUE if theP is out of the box built from
0142   //! the points on 2nd surface
0143   Standard_Boolean IsOutSurf2Box(const gp_Pnt2d& theP) const Standard_OVERRIDE
0144   {
0145     return curv->IsOutSurf2Box(theP);
0146   }
0147   
0148   //! Returns TRUE if theP is out of the box built from 3D-points.
0149   Standard_Boolean IsOutBox(const gp_Pnt& theP) const Standard_OVERRIDE
0150   {
0151     return curv->IsOutBox(theP);
0152   }
0153 
0154   Standard_EXPORT void SetPeriod (const Standard_Real pu1, const Standard_Real pv1, const Standard_Real pu2, const Standard_Real pv2);
0155   
0156   Standard_EXPORT Standard_Real U1Period() const;
0157   
0158   Standard_EXPORT Standard_Real V1Period() const;
0159   
0160   Standard_EXPORT Standard_Real U2Period() const;
0161   
0162   Standard_EXPORT Standard_Real V2Period() const;
0163   
0164   Standard_EXPORT void SetArcOnS1 (const Handle(Adaptor2d_Curve2d)& A);
0165   
0166   Standard_EXPORT Standard_Boolean HasArcOnS1() const;
0167   
0168   Standard_EXPORT const Handle(Adaptor2d_Curve2d)& GetArcOnS1() const;
0169   
0170   Standard_EXPORT void SetArcOnS2 (const Handle(Adaptor2d_Curve2d)& A);
0171   
0172   Standard_EXPORT Standard_Boolean HasArcOnS2() const;
0173   
0174   Standard_EXPORT const Handle(Adaptor2d_Curve2d)& GetArcOnS2() const;
0175   
0176   //! Removes vertices from the line (i.e. cleans svtx member)
0177   virtual void ClearVertexes() Standard_OVERRIDE;
0178   
0179   //! Removes single vertex from the line
0180   virtual void RemoveVertex (const Standard_Integer theIndex) Standard_OVERRIDE;
0181   
0182   void InsertVertexBefore (const Standard_Integer theIndex, const IntPatch_Point& thePnt);
0183   
0184   //! if (theMode == 0) then prints the information about WLine
0185   //! if (theMode == 1) then prints the list of 3d-points
0186   //! if (theMode == 2) then prints the list of 2d-points on the 1st surface
0187   //! Otherwise,             prints list of 2d-points on the 2nd surface
0188   Standard_EXPORT void Dump(const Standard_Integer theMode) const;
0189 
0190   //! Allows or forbids purging of existing WLine
0191   void EnablePurging(const Standard_Boolean theIsEnabled)
0192   {
0193     myIsPurgerAllowed = theIsEnabled;
0194   }
0195 
0196   //! Returns TRUE if purging is allowed or forbidden for existing WLine
0197   Standard_Boolean IsPurgingAllowed()
0198   {
0199     return myIsPurgerAllowed;
0200   }
0201 
0202   //! Returns the way of <*this> creation.
0203   IntPatch_WLType GetCreatingWay() const
0204   {
0205     return myCreationWay;
0206   }
0207 
0208   //! Sets the info about the way of <*this> creation.
0209   void SetCreatingWayInfo(IntPatch_WLType theAlgo)
0210   {
0211     myCreationWay = theAlgo;
0212   }
0213 
0214 
0215   DEFINE_STANDARD_RTTIEXT(IntPatch_WLine,IntPatch_PointLine)
0216 
0217 protected:
0218 
0219 
0220 
0221 
0222 private:
0223 
0224 
0225   Handle(IntSurf_LineOn2S) curv;
0226   Standard_Boolean fipt;
0227   Standard_Boolean lapt;
0228   Standard_Integer indf;
0229   Standard_Integer indl;
0230   IntPatch_SequenceOfPoint svtx;
0231   Standard_Real u1period;
0232   Standard_Real v1period;
0233   Standard_Real u2period;
0234   Standard_Real v2period;
0235   Standard_Boolean hasArcOnS1;
0236   Handle(Adaptor2d_Curve2d) theArcOnS1;
0237   Standard_Boolean hasArcOnS2;
0238   Handle(Adaptor2d_Curve2d) theArcOnS2;
0239   Standard_Boolean myIsPurgerAllowed;
0240 
0241   //! identifies the way of <*this> creation
0242   IntPatch_WLType myCreationWay;
0243 
0244 };
0245 
0246 
0247 #include <IntPatch_WLine.lxx>
0248 
0249 
0250 
0251 
0252 
0253 #endif // _IntPatch_WLine_HeaderFile