Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1992-04-06
0002 // Created by: Jacques GOUSSARD
0003 // Copyright (c) 1992-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_RLine_HeaderFile
0018 #define _IntPatch_RLine_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 
0022 #include <Standard_Real.hxx>
0023 #include <Standard_Integer.hxx>
0024 #include <IntPatch_SequenceOfPoint.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 
0033 
0034 class IntPatch_RLine;
0035 DEFINE_STANDARD_HANDLE(IntPatch_RLine, IntPatch_PointLine)
0036 
0037 //! Implementation of an intersection line described by a
0038 //! restriction line on one of the surfaces.
0039 class IntPatch_RLine : public IntPatch_PointLine
0040 {
0041 
0042 public:
0043 
0044   
0045   //! Creates a restriction as an intersection line
0046   //! when the transitions are In or Out.
0047   Standard_EXPORT IntPatch_RLine(const Standard_Boolean Tang, const IntSurf_TypeTrans Trans1, const IntSurf_TypeTrans Trans2);
0048   
0049   //! Creates a restriction as an intersection line
0050   //! when the transitions are Touch.
0051   Standard_EXPORT IntPatch_RLine(const Standard_Boolean Tang, const IntSurf_Situation Situ1, const IntSurf_Situation Situ2);
0052   
0053   //! Creates a restriction as an intersection line
0054   //! when the transitions are Undecided.
0055   Standard_EXPORT IntPatch_RLine(const Standard_Boolean Tang);
0056   
0057   //! Adds a vertex in the list. If theIsPrepend == TRUE the new
0058   //! vertex will be added before the first element of vertices sequence.
0059   //! Otherwise, to the end of the sequence
0060   virtual void AddVertex (const IntPatch_Point& Pnt,
0061                     const Standard_Boolean theIsPrepend = Standard_False) Standard_OVERRIDE;
0062   
0063   //! Replaces the element of range Index in the list
0064   //! of points.
0065     void Replace (const Standard_Integer Index, const IntPatch_Point& Pnt);
0066   
0067     void SetFirstPoint (const Standard_Integer IndFirst);
0068   
0069     void SetLastPoint (const Standard_Integer IndLast);
0070   
0071     void Add (const Handle(IntSurf_LineOn2S)& L);
0072   
0073   //! Returns True if the intersection is on the domain of the
0074   //! first patch.
0075   //! Returns False if the intersection is on the domain of
0076   //! the second patch.
0077     Standard_Boolean IsArcOnS1() const;
0078   
0079   //! Returns True if the intersection is on the domain of the
0080   //! first patch.
0081   //! Returns False if the intersection is on the domain of
0082   //! the second patch.
0083     Standard_Boolean IsArcOnS2() const;
0084   
0085   Standard_EXPORT void SetArcOnS1 (const Handle(Adaptor2d_Curve2d)& A);
0086   
0087   Standard_EXPORT void SetArcOnS2 (const Handle(Adaptor2d_Curve2d)& A);
0088   
0089   Standard_EXPORT void SetParamOnS1 (const Standard_Real p1, const Standard_Real p2);
0090   
0091   Standard_EXPORT void SetParamOnS2 (Standard_Real& p1, Standard_Real& p2);
0092   
0093   //! Returns the concerned arc.
0094     const Handle(Adaptor2d_Curve2d)& ArcOnS1() const;
0095   
0096   //! Returns the concerned arc.
0097     const Handle(Adaptor2d_Curve2d)& ArcOnS2() const;
0098   
0099   Standard_EXPORT void ParamOnS1 (Standard_Real& p1, Standard_Real& p2) const;
0100   
0101   Standard_EXPORT void ParamOnS2 (Standard_Real& p1, Standard_Real& p2) const;
0102   
0103   //! Returns True if the line has a known First point.
0104   //! This point is given by the method FirstPoint().
0105     Standard_Boolean HasFirstPoint() const;
0106   
0107   //! Returns True if the line has a known Last point.
0108   //! This point is given by the method LastPoint().
0109     Standard_Boolean HasLastPoint() const;
0110   
0111   //! Returns the IntPoint corresponding to the FirstPoint.
0112   //! An exception is raised when HasFirstPoint returns False.
0113     const IntPatch_Point& FirstPoint() const;
0114   
0115   //! Returns the IntPoint corresponding to the LastPoint.
0116   //! An exception is raised when HasLastPoint returns False.
0117     const IntPatch_Point& LastPoint() const;
0118   
0119   //! Returns number of vertices (IntPatch_Point) of the line
0120   virtual Standard_Integer NbVertex() const Standard_OVERRIDE;
0121   
0122   //! Returns the vertex of range Index on the line.
0123   virtual const IntPatch_Point& Vertex (const Standard_Integer Index) const Standard_OVERRIDE;
0124 
0125   //! Returns the vertex of range Index on the line.
0126   virtual IntPatch_Point& ChangeVertex (const Standard_Integer Index) Standard_OVERRIDE;
0127   
0128   //! Removes single vertex from the line
0129   virtual void RemoveVertex (const Standard_Integer theIndex) Standard_OVERRIDE;
0130 
0131     Standard_Boolean HasPolygon() const;
0132   
0133   //! Returns the number of intersection points.
0134   virtual Standard_Integer NbPnts() const Standard_OVERRIDE;
0135   
0136   //! Returns the intersection point of range Index.
0137   virtual const IntSurf_PntOn2S& Point (const Standard_Integer Index) const Standard_OVERRIDE;
0138   
0139   //! Set the Point of index <Index> in the LineOn2S
0140   Standard_EXPORT void SetPoint (const Standard_Integer Index, const IntPatch_Point& Pnt);
0141   
0142   //! Set the parameters of all the vertex on the line.
0143   //! if a vertex is already in the line,
0144   //! its parameter is modified
0145   //! else a new point in the line is inserted.
0146   Standard_EXPORT void ComputeVertexParameters (const Standard_Real Tol);
0147 
0148   //! Returns set of intersection points
0149   virtual Handle(IntSurf_LineOn2S) Curve() const Standard_OVERRIDE;
0150 
0151   //! Returns TRUE if theP is out of the box built from
0152   //! the points on 1st surface
0153   virtual Standard_Boolean IsOutSurf1Box(const gp_Pnt2d& theP) const Standard_OVERRIDE
0154   {
0155     return curv->IsOutSurf1Box(theP);
0156   }
0157 
0158   //! Returns TRUE if theP is out of the box built from
0159   //! the points on 2nd surface
0160   virtual Standard_Boolean IsOutSurf2Box(const gp_Pnt2d& theP) const Standard_OVERRIDE
0161   {
0162     return curv->IsOutSurf2Box(theP);
0163   }
0164 
0165   //! Returns TRUE if theP is out of the box built from 3D-points.
0166   virtual Standard_Boolean IsOutBox(const gp_Pnt& theP) const Standard_OVERRIDE
0167   {
0168     return curv->IsOutBox(theP);
0169   }
0170 
0171   //! Removes vertices from the line (i.e. cleans svtx member)
0172   virtual void ClearVertexes() Standard_OVERRIDE
0173   {
0174     svtx.Clear();
0175   }
0176 
0177   void SetCurve(const Handle(IntSurf_LineOn2S)& theNewCurve)
0178   {
0179     curv = theNewCurve;
0180   }
0181 
0182   //! if (theMode == 0) then prints the information about WLine
0183   //! if (theMode == 1) then prints the list of 3d-points
0184   //! if (theMode == 2) then prints the list of 2d-points on the 1st surface
0185   //! Otherwise,             prints list of 2d-points on the 2nd surface
0186   Standard_EXPORT void Dump(const Standard_Integer theMode) const;
0187 
0188   DEFINE_STANDARD_RTTIEXT(IntPatch_RLine,IntPatch_PointLine)
0189 
0190 protected:
0191 
0192 
0193 
0194 
0195 private:
0196 
0197 
0198   Handle(Adaptor2d_Curve2d) theArcOnS1;
0199   Handle(Adaptor2d_Curve2d) theArcOnS2;
0200   Standard_Boolean onS1;
0201   Standard_Boolean onS2;
0202   Standard_Real ParamInf1;
0203   Standard_Real ParamSup1;
0204   Standard_Real ParamInf2;
0205   Standard_Real ParamSup2;
0206   Handle(IntSurf_LineOn2S) curv;
0207   Standard_Boolean fipt;
0208   Standard_Boolean lapt;
0209   Standard_Integer indf;
0210   Standard_Integer indl;
0211   IntPatch_SequenceOfPoint svtx;
0212 
0213 
0214 };
0215 
0216 
0217 #include <IntPatch_RLine.lxx>
0218 
0219 
0220 
0221 
0222 
0223 #endif // _IntPatch_RLine_HeaderFile