00001 /* -*- mode: c++ -*- */ 00002 00014 #ifndef PyCanvas_H 00015 #define PyCanvas_H 00016 00017 #include <string> 00018 #include <vector> 00019 00020 namespace hippodraw { 00021 00022 class CanvasViewProxy; 00023 class CanvasWindow; 00024 class QtDisplay; 00025 class QtCut; 00026 class QtView; 00027 class NTuple; 00028 00043 class PyCanvas 00044 { 00045 00046 private: 00047 00051 CanvasWindow * m_canvas; 00052 00057 CanvasViewProxy * m_canvas_proxy; 00058 00061 bool m_has_gui; 00062 00064 mutable std::vector<QtDisplay *> m_displays; 00065 00069 void check () const; 00070 00072 QtView * findSelectedView ( QtDisplay * display ); 00073 00074 public: 00075 00078 PyCanvas ( CanvasWindow * ); 00079 00081 PyCanvas (); 00082 00085 void show (); 00086 00089 void close (); 00090 00093 void addDisplay ( QtDisplay * display_wrap ); 00094 00097 void saveAs ( const std::string & filename ); 00098 00102 QtDisplay * getDisplay (); 00103 00105 const std::vector<QtDisplay *> & getDisplays () const; 00106 00109 QtCut * getCut(); 00110 00112 void selectAllDisplays ( bool flag = true ); 00113 00115 void selectDisplay ( QtDisplay * display ); 00116 00119 void print ( const std::string & filename ); 00120 00122 void saveAsImage( QtDisplay * display, const std::string &filename ); 00123 00125 void saveSelectedImages(const std::string & filename); 00126 00128 void removeDisplay ( QtDisplay * display ); 00129 00132 const std::vector < std::string > & getTextRepTypes () const; 00133 00137 void addTextRep ( QtDisplay * display, const std::string & type ); 00138 00140 void addText( QtDisplay * display, const std::string &text ); 00141 00145 void addTextAt ( QtDisplay * display, const std::string &text, 00146 double xrel, double yrel ); 00147 00151 void addTextAtAbs ( QtDisplay * display, const std::string &text, 00152 double xabs, double yabs ); 00153 00156 const std::vector<double> & mouseData(); 00157 00161 void setPlotMatrix ( unsigned int columns, unsigned int rows ); 00162 00165 void swapOrientation (); 00166 00169 void clear (); 00170 00173 int getX ( QtDisplay * display ) const; 00174 00177 int getY ( QtDisplay * display ) const; 00178 00181 void setX ( QtDisplay * display, double value ); 00182 00185 void setY ( QtDisplay * display, double value ); 00186 00189 int getHeight ( QtDisplay * display ) const; 00190 00193 int getWidth ( QtDisplay * display ) const; 00194 00197 void setHeight ( QtDisplay *, double h ); 00198 00201 void setWidth ( QtDisplay *, double w ); 00202 00205 NTuple * getSelPickTable (); 00206 00209 NTuple * getPickTable ( QtDisplay * ); 00210 00211 }; 00212 00213 } // namespace hippodraw 00214 00215 #endif // PyCanvas_H