Main Page   Class Hierarchy   Compound List   File List   Compound Members  

liner.h

00001 /*
00002 Program wxLine.H
00003 Purpose Mainy used for calculating crossings
00004 Last Update     12-12-1995
00005 */
00006 
00007 #ifndef wxLineR_H
00008 #define wxLineR_H
00009 
00010 #ifdef __GNUG__
00011 #pragma interface
00012 #endif
00013 
00014 enum OUTPRODUCT{R_IS_LEFT,R_IS_ON,R_IS_RIGHT};
00015 
00016 #include "point.h"
00017 
00018 // Status of a point to a wxLine
00019 enum R_PointStatus {R_LEFT_SIDE, R_RIGHT_SIDE, R_ON_AREA, R_IN_AREA};
00020 
00021 class G_Polygon;
00022 
00023 class wxLine
00024 {
00025         public:
00026                 // constructors and destructor
00027                 wxLine();
00028                 wxLine(const Point& a,const Point& b);
00029                 ~wxLine();
00030 
00031                 Point                                   GetBeginPoint();                                                           // Get the beginpoint from a wxLine
00032                 Point                                   GetEndPoint();                                                             // Get the endpoint from a wxLine
00033                 int                                     CheckIntersect(wxLine&, double Marge);  // Check if two wxLines intersects
00034                 int                                     Intersect(wxLine&,  Point& bp ,Point& ep ,double Marge) ;   // Intersects two wxLines
00035                 bool                            Intersect(wxLine& lijn,Point& crossing); //intersect two (infinit) lines
00036                 R_PointStatus           PointOnLine(const Point& a_Point, double& Distance, double Marge ); //For an infinite wxLine
00037                 R_PointStatus           PointInLine(const Point& a_Point, double& Distance, double Marge ); //For a non-infinite wxLine
00038                 OUTPRODUCT                      OutProduct(const wxLine& two,double accur);              // outproduct of two wxLines
00039                 double                          Calculate_Y(double X);                                                          // Caclulate Y if X is known
00040                 void              Virtual_Point(Point& a_point,double distance) const;
00041                 wxLine&                                 operator=(const wxLine&);                                                               // assignment operator
00042 /*
00043                 Point*                          OffsetContour_rounded(wxLine* const nextline,Point _last_ins, double factor,G_Polygon *shape);
00044 */
00045                 void  CalculateLineParameters();                                                                        // Calculate the parameters if nessecary
00046       void   OffsetContour(const wxLine& nextline,double factor,Point& offsetpoint) const;
00047 
00048         private:
00049 
00050                 int   ActionOnTable1(R_PointStatus,R_PointStatus);                                                      // Function needed for Intersect
00051                 int   ActionOnTable2(R_PointStatus,R_PointStatus);                                                      // Function needed for Intersect
00052 
00053                 double          _AA;
00054                 double          _BB;
00055                 double          _CC;
00056       Point       m_a;
00057       Point       m_b;
00058                 bool            _valid_parameters;
00059 };
00060 
00061 #endif
liner.h Source File -- Thu Nov 28 21:24:56 2002 -- 28 Nov 2002 -- 1.2.18 -- -- . -- Main Page