1 // Created on: 1993-10-07
2 // Created by: Yves FRICAUD
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _MAT2d_Connexion_HeaderFile
18 #define _MAT2d_Connexion_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <Standard_Integer.hxx>
24 #include <Standard_Real.hxx>
25 #include <gp_Pnt2d.hxx>
26 #include <Standard_Transient.hxx>
27 #include <Standard_Boolean.hxx>
31 class MAT2d_Connexion;
32 DEFINE_STANDARD_HANDLE(MAT2d_Connexion, Standard_Transient)
34 //! A Connexion links two lines of items in a set
35 //! of lines. It s contains two points and their paramatric
36 //! definitions on the lines.
37 //! The items can be points or curves.
38 class MAT2d_Connexion : public Standard_Transient
44 Standard_EXPORT MAT2d_Connexion();
46 Standard_EXPORT MAT2d_Connexion(const Standard_Integer LineA, const Standard_Integer LineB, const Standard_Integer ItemA, const Standard_Integer ItemB, const Standard_Real Distance, const Standard_Real ParameterOnA, const Standard_Real ParameterOnB, const gp_Pnt2d& PointA, const gp_Pnt2d& PointB);
48 //! Returns the Index on the first line.
49 Standard_EXPORT Standard_Integer IndexFirstLine() const;
51 //! Returns the Index on the Second line.
52 Standard_EXPORT Standard_Integer IndexSecondLine() const;
54 //! Returns the Index of the item on the first line.
55 Standard_EXPORT Standard_Integer IndexItemOnFirst() const;
57 //! Returns the Index of the item on the second line.
58 Standard_EXPORT Standard_Integer IndexItemOnSecond() const;
60 //! Returns the parameter of the point on the firstline.
61 Standard_EXPORT Standard_Real ParameterOnFirst() const;
63 //! Returns the parameter of the point on the secondline.
64 Standard_EXPORT Standard_Real ParameterOnSecond() const;
66 //! Returns the point on the firstline.
67 Standard_EXPORT gp_Pnt2d PointOnFirst() const;
69 //! Returns the point on the secondline.
70 Standard_EXPORT gp_Pnt2d PointOnSecond() const;
72 //! Returns the distance between the two points.
73 Standard_EXPORT Standard_Real Distance() const;
75 Standard_EXPORT void IndexFirstLine (const Standard_Integer anIndex);
77 Standard_EXPORT void IndexSecondLine (const Standard_Integer anIndex);
79 Standard_EXPORT void IndexItemOnFirst (const Standard_Integer anIndex);
81 Standard_EXPORT void IndexItemOnSecond (const Standard_Integer anIndex);
83 Standard_EXPORT void ParameterOnFirst (const Standard_Real aParameter);
85 Standard_EXPORT void ParameterOnSecond (const Standard_Real aParameter);
87 Standard_EXPORT void PointOnFirst (const gp_Pnt2d& aPoint);
89 Standard_EXPORT void PointOnSecond (const gp_Pnt2d& aPoint);
91 Standard_EXPORT void Distance (const Standard_Real aDistance);
93 //! Returns the reverse connexion of <me>.
94 //! the firstpoint is the secondpoint.
95 //! the secondpoint is the firstpoint.
96 Standard_EXPORT Handle(MAT2d_Connexion) Reverse() const;
98 //! Returns <True> if my firstPoint is on the same line
99 //! than the firstpoint of <aConnexion> and my firstpoint
100 //! is after the firstpoint of <aConnexion> on the line.
101 //! <aSense> = 1 if <aConnexion> is on the Left of its
102 //! firstline, else <aSense> = -1.
103 Standard_EXPORT Standard_Boolean IsAfter (const Handle(MAT2d_Connexion)& aConnexion, const Standard_Real aSense) const;
106 Standard_EXPORT void Dump (const Standard_Integer Deep = 0, const Standard_Integer Offset = 0) const;
111 DEFINE_STANDARD_RTTIEXT(MAT2d_Connexion,Standard_Transient)
121 Standard_Integer lineA;
122 Standard_Integer lineB;
123 Standard_Integer itemA;
124 Standard_Integer itemB;
125 Standard_Real distance;
126 Standard_Real parameterOnA;
127 Standard_Real parameterOnB;
140 #endif // _MAT2d_Connexion_HeaderFile