Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-25 09:20:22

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_GLine_HeaderFile
0018 #define _IntPatch_GLine_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <gp_Ax2.hxx>
0024 #include <Standard_Integer.hxx>
0025 #include <IntPatch_Point.hxx>
0026 #include <NCollection_Sequence.hxx>
0027 #include <IntPatch_Line.hxx>
0028 #include <IntSurf_TypeTrans.hxx>
0029 #include <IntSurf_Situation.hxx>
0030 #include <gp_Circ.hxx>
0031 class gp_Lin;
0032 class gp_Circ;
0033 class gp_Elips;
0034 class gp_Parab;
0035 class gp_Hypr;
0036 class IntPatch_Point;
0037 
0038 //! Implementation of an intersection line represented
0039 //! by a conic.
0040 class IntPatch_GLine : public IntPatch_Line
0041 {
0042 
0043 public:
0044   //! Creates a Line as intersection line
0045   //! when the transitions are In or Out.
0046   Standard_EXPORT IntPatch_GLine(const gp_Lin&           L,
0047                                  const bool              Tang,
0048                                  const IntSurf_TypeTrans Trans1,
0049                                  const IntSurf_TypeTrans Trans2);
0050 
0051   //! Creates a Line as intersection line
0052   //! when the transitions are Touch.
0053   Standard_EXPORT IntPatch_GLine(const gp_Lin&           L,
0054                                  const bool              Tang,
0055                                  const IntSurf_Situation Situ1,
0056                                  const IntSurf_Situation Situ2);
0057 
0058   //! Creates a Line as intersection line
0059   //! when the transitions are Undecided.
0060   Standard_EXPORT IntPatch_GLine(const gp_Lin& L, const bool Tang);
0061 
0062   //! Creates a circle as intersection line
0063   //! when the transitions are In or Out.
0064   Standard_EXPORT IntPatch_GLine(const gp_Circ&          C,
0065                                  const bool              Tang,
0066                                  const IntSurf_TypeTrans Trans1,
0067                                  const IntSurf_TypeTrans Trans2);
0068 
0069   //! Creates a circle as intersection line
0070   //! when the transitions are Touch.
0071   Standard_EXPORT IntPatch_GLine(const gp_Circ&          C,
0072                                  const bool              Tang,
0073                                  const IntSurf_Situation Situ1,
0074                                  const IntSurf_Situation Situ2);
0075 
0076   //! Creates a circle as intersection line
0077   //! when the transitions are Undecided.
0078   Standard_EXPORT IntPatch_GLine(const gp_Circ& C, const bool Tang);
0079 
0080   //! Creates an ellipse as intersection line
0081   //! when the transitions are In or Out.
0082   Standard_EXPORT IntPatch_GLine(const gp_Elips&         E,
0083                                  const bool              Tang,
0084                                  const IntSurf_TypeTrans Trans1,
0085                                  const IntSurf_TypeTrans Trans2);
0086 
0087   //! Creates an ellispe as intersection line
0088   //! when the transitions are Touch.
0089   Standard_EXPORT IntPatch_GLine(const gp_Elips&         E,
0090                                  const bool              Tang,
0091                                  const IntSurf_Situation Situ1,
0092                                  const IntSurf_Situation Situ2);
0093 
0094   //! Creates an ellipse as intersection line
0095   //! when the transitions are Undecided.
0096   Standard_EXPORT IntPatch_GLine(const gp_Elips& E, const bool Tang);
0097 
0098   //! Creates a parabola as intersection line
0099   //! when the transitions are In or Out.
0100   Standard_EXPORT IntPatch_GLine(const gp_Parab&         P,
0101                                  const bool              Tang,
0102                                  const IntSurf_TypeTrans Trans1,
0103                                  const IntSurf_TypeTrans Trans2);
0104 
0105   //! Creates a parabola as intersection line
0106   //! when the transitions are Touch.
0107   Standard_EXPORT IntPatch_GLine(const gp_Parab&         P,
0108                                  const bool              Tang,
0109                                  const IntSurf_Situation Situ1,
0110                                  const IntSurf_Situation Situ2);
0111 
0112   //! Creates a parabola as intersection line
0113   //! when the transitions are Undecided.
0114   Standard_EXPORT IntPatch_GLine(const gp_Parab& P, const bool Tang);
0115 
0116   //! Creates an hyperbola as intersection line
0117   //! when the transitions are In or Out.
0118   Standard_EXPORT IntPatch_GLine(const gp_Hypr&          H,
0119                                  const bool              Tang,
0120                                  const IntSurf_TypeTrans Trans1,
0121                                  const IntSurf_TypeTrans Trans2);
0122 
0123   //! Creates an hyperbola as intersection line
0124   //! when the transitions are Touch.
0125   Standard_EXPORT IntPatch_GLine(const gp_Hypr&          H,
0126                                  const bool              Tang,
0127                                  const IntSurf_Situation Situ1,
0128                                  const IntSurf_Situation Situ2);
0129 
0130   //! Creates an hyperbola as intersection line
0131   //! when the transitions are Undecided.
0132   Standard_EXPORT IntPatch_GLine(const gp_Hypr& H, const bool Tang);
0133 
0134   //! To add a vertex in the list.
0135   Standard_EXPORT void AddVertex(const IntPatch_Point& Pnt);
0136 
0137   //! To replace the element of range Index in the list
0138   //! of points.
0139   Standard_EXPORT void Replace(const int Index, const IntPatch_Point& Pnt);
0140 
0141   void SetFirstPoint(const int IndFirst);
0142 
0143   void SetLastPoint(const int IndLast);
0144 
0145   //! Returns the Lin from gp corresponding to the intersection
0146   //! when ArcType returns IntPatch_Line.
0147   gp_Lin Line() const;
0148 
0149   //! Returns the Circ from gp corresponding to the intersection
0150   //! when ArcType returns IntPatch_Circle.
0151   gp_Circ Circle() const;
0152 
0153   //! Returns the Elips from gp corresponding to the intersection
0154   //! when ArcType returns IntPatch_Ellipse.
0155   gp_Elips Ellipse() const;
0156 
0157   //! Returns the Parab from gp corresponding to the intersection
0158   //! when ArcType returns IntPatch_Parabola.
0159   gp_Parab Parabola() const;
0160 
0161   //! Returns the Hypr from gp corresponding to the intersection
0162   //! when ArcType returns IntPatch_Hyperbola.
0163   gp_Hypr Hyperbola() const;
0164 
0165   //! Returns True if the line has a known First point.
0166   //! This point is given by the method FirstPoint().
0167   bool HasFirstPoint() const;
0168 
0169   //! Returns True if the line has a known Last point.
0170   //! This point is given by the method LastPoint().
0171   bool HasLastPoint() const;
0172 
0173   //! Returns the IntPoint corresponding to the FirstPoint.
0174   //! An exception is raised when HasFirstPoint returns False.
0175   const IntPatch_Point& FirstPoint() const;
0176 
0177   //! Returns the IntPoint corresponding to the LastPoint.
0178   //! An exception is raised when HasLastPoint returns False.
0179   const IntPatch_Point& LastPoint() const;
0180 
0181   int NbVertex() const;
0182 
0183   //! Returns the vertex of range Index on the line.
0184   const IntPatch_Point& Vertex(const int Index) const;
0185 
0186   //! Set the parameters of all the vertex on the line.
0187   //! if a vertex is already in the line,
0188   //! its parameter is modified
0189   //! else a new point in the line is inserted.
0190   Standard_EXPORT void ComputeVertexParameters(const double Tol);
0191 
0192   DEFINE_STANDARD_RTTIEXT(IntPatch_GLine, IntPatch_Line)
0193 
0194 private:
0195   gp_Ax2                               pos;
0196   double                               par1;
0197   double                               par2;
0198   bool                                 fipt;
0199   bool                                 lapt;
0200   int                                  indf;
0201   int                                  indl;
0202   NCollection_Sequence<IntPatch_Point> svtx;
0203 };
0204 
0205 #include <IntPatch_GLine.lxx>
0206 
0207 #endif // _IntPatch_GLine_HeaderFile