Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-16 09:17:47

0001 // Created on: 1993-10-07
0002 // Created by: Yves FRICAUD
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 _MAT2d_Connexion_HeaderFile
0018 #define _MAT2d_Connexion_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Standard_Integer.hxx>
0024 #include <gp_Pnt2d.hxx>
0025 #include <Standard_Transient.hxx>
0026 
0027 //! A Connexion links two lines of items in a set
0028 //! of lines. It contains two points and their paramatric
0029 //! definitions on the lines.
0030 //! The items can be points or curves.
0031 class MAT2d_Connexion : public Standard_Transient
0032 {
0033 
0034 public:
0035   Standard_EXPORT MAT2d_Connexion();
0036 
0037   Standard_EXPORT MAT2d_Connexion(const int       LineA,
0038                                   const int       LineB,
0039                                   const int       ItemA,
0040                                   const int       ItemB,
0041                                   const double    Distance,
0042                                   const double    ParameterOnA,
0043                                   const double    ParameterOnB,
0044                                   const gp_Pnt2d& PointA,
0045                                   const gp_Pnt2d& PointB);
0046 
0047   //! Returns the Index on the first line.
0048   Standard_EXPORT int IndexFirstLine() const;
0049 
0050   //! Returns the Index on the Second line.
0051   Standard_EXPORT int IndexSecondLine() const;
0052 
0053   //! Returns the Index of the item on the first line.
0054   Standard_EXPORT int IndexItemOnFirst() const;
0055 
0056   //! Returns the Index of the item on the second line.
0057   Standard_EXPORT int IndexItemOnSecond() const;
0058 
0059   //! Returns the parameter of the point on the firstline.
0060   Standard_EXPORT double ParameterOnFirst() const;
0061 
0062   //! Returns the parameter of the point on the secondline.
0063   Standard_EXPORT double ParameterOnSecond() const;
0064 
0065   //! Returns the point on the firstline.
0066   Standard_EXPORT gp_Pnt2d PointOnFirst() const;
0067 
0068   //! Returns the point on the secondline.
0069   Standard_EXPORT gp_Pnt2d PointOnSecond() const;
0070 
0071   //! Returns the distance between the two points.
0072   Standard_EXPORT double Distance() const;
0073 
0074   Standard_EXPORT void IndexFirstLine(const int anIndex);
0075 
0076   Standard_EXPORT void IndexSecondLine(const int anIndex);
0077 
0078   Standard_EXPORT void IndexItemOnFirst(const int anIndex);
0079 
0080   Standard_EXPORT void IndexItemOnSecond(const int anIndex);
0081 
0082   Standard_EXPORT void ParameterOnFirst(const double aParameter);
0083 
0084   Standard_EXPORT void ParameterOnSecond(const double aParameter);
0085 
0086   Standard_EXPORT void PointOnFirst(const gp_Pnt2d& aPoint);
0087 
0088   Standard_EXPORT void PointOnSecond(const gp_Pnt2d& aPoint);
0089 
0090   Standard_EXPORT void Distance(const double aDistance);
0091 
0092   //! Returns the reverse connexion of <me>.
0093   //! the firstpoint is the secondpoint.
0094   //! the secondpoint is the firstpoint.
0095   Standard_EXPORT occ::handle<MAT2d_Connexion> Reverse() const;
0096 
0097   //! Returns <True> if my firstPoint is on the same line
0098   //! than the firstpoint of <aConnexion> and my firstpoint
0099   //! is after the firstpoint of <aConnexion> on the line.
0100   //! <aSense> = 1 if <aConnexion> is on the Left of its
0101   //! firstline, else <aSense> = -1.
0102   Standard_EXPORT bool IsAfter(const occ::handle<MAT2d_Connexion>& aConnexion,
0103                                const double                        aSense) const;
0104 
0105   //! Print <me>.
0106   Standard_EXPORT void Dump(const int Deep = 0, const int Offset = 0) const;
0107 
0108   DEFINE_STANDARD_RTTIEXT(MAT2d_Connexion, Standard_Transient)
0109 
0110 private:
0111   int      lineA;
0112   int      lineB;
0113   int      itemA;
0114   int      itemB;
0115   double   distance;
0116   double   parameterOnA;
0117   double   parameterOnB;
0118   gp_Pnt2d pointA;
0119   gp_Pnt2d pointB;
0120 };
0121 
0122 #endif // _MAT2d_Connexion_HeaderFile