00001 #ifndef _WINC_GTRAN 00002 #define _WINC_GTRAN 00003 00004 #include <WXP/Coords.h> 00005 #include <WXP/Point.h> 00006 #include <WXP/Points.h> 00007 #include <WXP/Rect.h> 00008 00009 namespace WXP { 00010 class GTran { 00011 Coords plt; /* The plot coordinates */ 00012 Coords ndc; /* The normalized device coordinates */ 00013 Point wn_vp; /* Transformation from window to viewport */ 00014 Point vp_plt; /* Transformation from viewport to plot */ 00015 Coords wn; /* The transformation window */ 00016 Coords vp; /* The transformation window */ 00017 Rect clip_rect; /* Transformation from viewport to plot */ 00018 00019 public: 00020 GTran(); 00021 GTran(Rect rect); 00022 ~GTran(); 00023 int set(Rect rect); 00024 int resize(Rect rect); 00025 float windowNdcX( float x ); 00026 float windowNdcY( float y ); 00027 float windowPlotX( float x ); 00028 float windowPlotY( float y ); 00029 float plotWindowX( float x ); 00030 float plotWindowY( float y ); 00031 float ndcPlotX( float x ); 00032 float ndcPlotY( float y ); 00033 Rect getClipRect(); 00034 bool pointsInWindow( int num, Point *pts ); 00035 bool pointsInWindow( Points &pts ); 00036 int getWindow( Rect &rect ); 00037 Rect getWindow(); 00038 int getViewport( Rect &rect ); 00039 Rect getViewport(); 00040 int getNdc( Rect &rect ); 00041 Rect getNdc(); 00042 int setWindow( Rect rect ); 00043 int setViewport( Rect rect ); 00044 int print(); 00045 00046 static float windowTranslateX( GTran gtran1, GTran gtran2, float x); 00047 static float windowTranslateY( GTran gtran1, GTran gtran2, float x); 00048 }; 00049 } 00050 #endif
1.6.1