2 // Created: 04.08.05 22:26:39
3 // Author: Alexander GRIGORIEV
4 // Copyright: Open Cascade 2005
7 #ifndef LineConn2d_HeaderFile
8 #define LineConn2d_HeaderFile
10 #include <Precision.hxx>
12 class LineConn2d_Object;
16 #define LineConn2d_FABS(x) ((x) < 0.? -(x) : (x))
19 #define LineConn2d_FABS(x) ::fabs(x)
30 * One of 4 possible orientations.
33 Indefinite = -1, ///< non-initialized
41 // ---------- PUBLIC METHODS ----------
44 * Test the value if it is small (absolute value is tested).
46 inline static Standard_Boolean IsSmall (const Standard_Real theVal)
47 { return LineConn2d_FABS (theVal) < Precision::Confusion(); }
50 * Test the value for inclusion in the given interval.
51 * To ensure the inclusion the interval is extended by Confusion value.
53 * the given Real value
55 * lower bound of the interval
57 * upper bound of the interval
59 * True if theVal is inside the interval inclusive.
61 inline static Standard_Boolean IsInside (const Standard_Real theVal,
62 const Standard_Real theLow,
63 const Standard_Real theUp)
64 { return (theVal > theLow - Precision::Confusion() &&
65 theVal < theUp + Precision::Confusion()); }
68 * Return the orientatation of the given axis.
69 * LineConn2d_Port can be used as subclass of the axis
71 Standard_EXPORT static Orient Orientation (const gp_XY& aDir);
74 * Test intersection of two Objects.
76 Standard_EXPORT static Standard_Boolean IsIntersect
77 (const LineConn2d_Object& anObj1,
78 const LineConn2d_Object& anObj2);
82 // ---------- PRIVATE METHODS ----------