00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef __WXLINER_H
00013 #define __WXLINER_H
00014
00015
00016 #include "wx/artbase/afmatrix.h"
00017
00018 enum OUTPRODUCT {R_IS_LEFT, R_IS_ON, R_IS_RIGHT};
00019
00020
00021 enum R_PointStatus {R_LEFT_SIDE, R_RIGHT_SIDE, R_ON_AREA, R_IN_AREA};
00022
00023 #undef _BB
00024 #undef _AA
00025 #undef _CC
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 class A2DARTBASEDLLEXP a2dLine
00037 {
00038 public:
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048 a2dLine( double x1 = 0, double y1 = 0, double x2 = 0, double y2 = 0 );
00049
00050
00051
00052
00053
00054
00055
00056 a2dLine( const a2dPoint2D& a, const a2dPoint2D& b );
00057
00058 a2dLine( const a2dLine& other );
00059
00060
00061 ~a2dLine();
00062
00063 a2dLine& operator = ( const a2dLine& other );
00064
00065
00066 a2dPoint2D GetBeginPoint() const;
00067
00068
00069 a2dPoint2D GetEndPoint() const;
00070
00071
00072
00073
00074
00075
00076 bool CheckIntersect( a2dLine& line, double Marge ) const;
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088 int Intersect( a2dLine& line, a2dPoint2D& bp , a2dPoint2D& ep , double Marge ) const;
00089
00090
00091 bool Intersect( a2dLine& lijn, a2dPoint2D& crossing ) const;
00092
00093
00094 R_PointStatus PointOnLine( const a2dPoint2D& a_Point, double& Distance, double Marge ) const;
00095
00096
00097 R_PointStatus PointInLine( const a2dPoint2D& a_Point, double& Distance, double Marge ) const;
00098
00099
00100 a2dPoint2D ProjectedPoint( const a2dPoint2D& p ) const;
00101
00102
00103
00104
00105
00106 double PointDistance( const a2dPoint2D& p, a2dPoint2D *nearest ) const;
00107
00108
00109
00110
00111
00112 double PointDistanceOrhto( const a2dPoint2D& p, a2dPoint2D *nearest ) const;
00113
00114
00115 OUTPRODUCT OutProduct( const a2dLine& two, double accur ) const;
00116
00117
00118 double Calculate_Y( double X ) const;
00119
00120
00121 void Virtual_Point( a2dPoint2D& a_point, double distance ) const;
00122
00123
00124 a2dPoint2D DistancePoint( double distance, bool begin ) const;
00125
00126
00127 a2dLine* CreatePerpendicularLineAt( const a2dPoint2D& a_point ) const;
00128
00129
00130 void CalculateLineParameters();
00131
00132
00133 void OffsetContour( const a2dLine& nextline, double factor, a2dPoint2D& offsetpoint ) const;
00134
00135
00136 double GetLength() const;
00137
00138 private:
00139
00140
00141 int ActionOnTable1( R_PointStatus, R_PointStatus ) const;
00142
00143
00144 int ActionOnTable2( R_PointStatus, R_PointStatus ) const;
00145
00146
00147
00148 double m_AA;
00149
00150
00151 double m_BB;
00152
00153
00154 double m_CC;
00155
00156
00157 a2dPoint2D m_a;
00158
00159
00160 a2dPoint2D m_b;
00161
00162
00163 bool m_valid_parameters;
00164 };
00165
00166 #endif