]>
git.saurik.com Git - wxWidgets.git/blob - contrib/include/wx/canvas/liner.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Author: Klaas Holwerda
5 // Copyright: 2000 (c) Klaas Holwerda
6 // Licence: wxWindows Licence
7 /////////////////////////////////////////////////////////////////////////////
11 #if defined(__GNUG__) && !defined(__APPLE__)
12 #pragma interface "liner.cpp"
16 #include "wx/geometry.h"
18 enum OUTPRODUCT
{R_IS_LEFT
,R_IS_ON
,R_IS_RIGHT
};
20 // Status of a point to a wxLine
21 enum R_PointStatus
{R_LEFT_SIDE
, R_RIGHT_SIDE
, R_ON_AREA
, R_IN_AREA
};
26 // constructors and destructor
27 wxLine( double x1
, double y1
, double x2
, double y2
);
28 wxLine( const wxPoint2DDouble
& a
, const wxPoint2DDouble
& b
);
31 wxPoint2DDouble
GetBeginPoint(); // Get the beginpoint from a wxLine
32 wxPoint2DDouble
GetEndPoint(); // Get the endpoint from a wxLine
33 bool CheckIntersect( wxLine
&, double Marge
); // Check if two wxLines intersects
34 int Intersect( wxLine
&, wxPoint2DDouble
& bp
,wxPoint2DDouble
& ep
,double Marge
) ; // Intersects two wxLines
35 bool Intersect( wxLine
& lijn
, wxPoint2DDouble
& crossing
); //intersect two (infinit) lines
36 R_PointStatus
PointOnLine( const wxPoint2DDouble
& a_Point
, double& Distance
, double Marge
); //For an infinite wxLine
37 R_PointStatus
PointInLine( const wxPoint2DDouble
& a_Point
, double& Distance
, double Marge
); //For a non-infinite wxLine
38 OUTPRODUCT
OutProduct( const wxLine
& two
, double accur
); // outproduct of two wxLines
39 double Calculate_Y( double X
); // Caclulate Y if X is known
40 void Virtual_Point( wxPoint2DDouble
& a_point
, double distance
) const;
41 wxLine
& operator=( const wxLine
&); // assignment operator
42 void CalculateLineParameters(); // Calculate the parameters if nessecary
43 void OffsetContour( const wxLine
& nextline
, double factor
,wxPoint2DDouble
& offsetpoint
) const;
47 int ActionOnTable1(R_PointStatus
,R_PointStatus
); // Function needed for Intersect
48 int ActionOnTable2(R_PointStatus
,R_PointStatus
); // Function needed for Intersect
55 bool m_valid_parameters
;