export_Canvas.cxx
Go to the documentation of this file.
1 
12 // for dll interface warning
13 #ifdef _MSC_VER
14 #include "msdevstudio/MSconfig.h"
15 #endif
16 
17 // include first to avoid _POSIX_C_SOURCE warning.
18 #include <boost/python.hpp>
19 
20 #include "PyCanvas.h"
21 
22 #include "QtCut.h"
23 
24 #include "datasrcs/NTuple.h"
25 
26 using namespace boost::python;
27 
28 namespace hippodraw {
29 namespace Python {
30 
31 void
33 {
34  class_ < PyCanvas >
35  ( "Canvas",
36  "The HippoDraw canvas.\n\n"
37  "This class provides an interface to the canvas.\n"
38  "One can take various actions that are also\n"
39  "available from menu items in the canvas window." )
40 
41  .def ( "show", &PyCanvas::show,
42  "show () -> None\n"
43  "\n"
44  "Displays the canvas window on the screen. One only needs\n"
45  "to use this method if running HippoDraw in the Python\n"
46  "thread." )
47 
48  .def ( "close", &PyCanvas::close,
49  "close () -> None\n"
50  "\n"
51  "Closes the window." )
52 
53  .def ( "addDisplay", &PyCanvas::addDisplay,
54  with_custodian_and_ward < 1, 2 > (),
55  "addDisplay ( Display ) -> None\n"
56  "\n"
57  "Adds a display to the canvas." )
58 
59  .def ( "saveAs", &PyCanvas::saveAs,
60  "saveAs ( string ) -> None\n"
61  "\n"
62  "Save the canvas as a XML file." )
63 
64  .def ( "printTo", &PyCanvas::print,
65  "printTo ( string ) -> None\n"
66  "\n"
67  "Prints the canvas to PostScript file." )
68 
69  .def ( "getDisplay", &PyCanvas::getDisplay,
70  return_value_policy < reference_existing_object > (),
71  "getDisplay () -> Display\n"
72  "\n"
73  "Returns the selected Display object." )
74 
75  .def ( "getDisplays", &PyCanvas::getDisplays,
76  return_value_policy < copy_const_reference > (),
77  "getDisplays () -> tuple\n"
78  "\n"
79  "Returns a tuple of all Display objects on the canvas." )
80 
81  .def ( "getCut", &PyCanvas::getCut,
82  return_value_policy < reference_existing_object > (),
83  "getCut () -> Cut\n"
84  "\n"
85  "Returns the currently selected Cut object." )
86 
87  .def ( "selectAllDisplays", &PyCanvas::selectAllDisplays,
88  "selectAllDisplays ( Boolean ) -> None\n"
89  "\n"
90  "Sets all displays to selected state or not." )
91 
92  .def ( "selectDisplay", &PyCanvas::selectDisplay,
93  "selectDisplay ( Display ) -> None\n"
94  "\n"
95  "Sets a display to selected state." )
96 
97  .def ( "saveAsImage", &PyCanvas::saveAsImage,
98  "saveAsImage ( Display, string ) -> None\n"
99  "\n"
100  "Save a display as an image file.\n"
101  "The suffix of the file name controls the image type." )
102 
103  .def ( "saveSelectedImages", &PyCanvas::saveSelectedImages,
104  "saveSelectedImages ( string ) -> None\n"
105  "\n"
106  "Save the selected displays as an image file.\n"
107  "The suffix of the file name controls the image type." )
108 
109  .def ( "removeDisplay", &PyCanvas::removeDisplay,
110  "removeDisplay ( Display ) -> None\n"
111  "\n"
112  "Removes the display from the canvas." )
113 
114  .def ( "addText", &PyCanvas::addText,
115  "addText ( Display, string ) -> None\n"
116  "\n"
117  "Adds text to display." )
118 
119  .def ( "addTextAt", &PyCanvas::addTextAt,
120  "addTextAt ( Display, string, value, value ) -> None\n"
121  "\n"
122  "Adds text to a display at specified position\n"
123  "Position is fraction of width and height." )
124 
125  .def ( "addTextAtAbs", &PyCanvas::addTextAtAbs,
126  "addTextAt ( Display, string, value, value ) -> None\n"
127  "\n"
128  "Adds text to a display at specified position\n"
129  "Position is absolute value of the date point." )
130 
131  .def ( "addTextRep", &PyCanvas::addTextRep,
132  "addTextRep ( Display, string ) -> None\n"
133  "\n"
134  "Adds textual data representation to display. Use\n"
135  "Canvas.getTextRepTypes() to see available types." )
136 
137  .def ( "mouseData", &PyCanvas::mouseData,
138  return_value_policy < copy_const_reference > (),
139  "mouseData () -> tuple\n"
140  "\n"
141  "Returns a tuple of picked data." )
142 
143  .def ( "setPlotMatrix", &PyCanvas::setPlotMatrix,
144  "setPlotMatrix ( columns, rows ) -> None\n"
145  "\n"
146  "Sets the number of columns and "
147  "rows of plots for each page." )
148 
149  .def ( "swapOrientation", &PyCanvas::swapOrientation,
150  "swapOrientation ( ) -> None\n"
151  "\n"
152  "Swaps the canvas' orientation from portrait to landscape\n"
153  "or vice verse." )
154 
155  .def ( "getTextRepTypes", &PyCanvas::getTextRepTypes,
156  return_value_policy < copy_const_reference > (),
157  "getTextRepTypes () -> tuple\n"
158  "\n"
159  "Returns the types of textual data representations"
160  " available." )
161 
162  .def ( "clear", &PyCanvas::clear,
163  "clear () -> None\n"
164  "\n"
165  "Removes all items from the canvas" )
166 
167  .def ( "getX", &PyCanvas::getX,
168  "getX ( Display ) -> value\n"
169  "\n"
170  "Returns the X coordinate of the Display." )
171 
172  .def ( "getY", &PyCanvas::getY,
173  "getY ( Display ) -> value\n"
174  "\n"
175  "Returns the Y coordinate of the Display. Note that Y=0 is\n"
176  "at the top and Y increases downward." )
177 
178  .def ( "setX", &PyCanvas::setX,
179  "setX ( Display, value ) -> None\n"
180  "\n"
181  "Sets the X coordinate of the Display" )
182 
183  .def ( "setY", &PyCanvas::setY,
184  "setY ( Display, value ) -> None\n"
185  "\n"
186  "Sets the Y coordinate of the Display. Note that Y = 0 is\n"
187  "at the top and Y increases downward." )
188 
189  .def ( "getHeight", &PyCanvas::getHeight,
190  "getHeight ( Display ) -> value\n"
191  "\n"
192  "Returns the height of the Display." )
193 
194  .def ( "getWidth", &PyCanvas::getWidth,
195  "getWidth ( Display ) -> value\n"
196  "\n"
197  "Returns the width of the Display." )
198 
199  .def ( "setHeight", &PyCanvas::setHeight,
200  "setHeight ( Display, value ) -> None\n"
201  "\n"
202  "Sets the height of the Display." )
203 
204  .def ( "setWidth", &PyCanvas::setWidth,
205  "setWidth ( Display, value ) -> None\n"
206  "\n"
207  "Sets the width of the Display." )
208 
209  .def ( "getSelPickTable", &PyCanvas::getSelPickTable,
210  return_value_policy < reference_existing_object > (),
211  "getSelPickTable () -> NTuple\n"
212  "\n"
213  "Gets the pick table for selected Display." )
214 
215  .def ( "getPickTable", &PyCanvas::getPickTable,
216  return_value_policy < reference_existing_object > (),
217  "getPickTable ( Display ) -> NTuple\n"
218  "\n"
219  "Gets the pick table of the Display." )
220 
221  ;
222 }
223 
224 } // namespace Python
225 } // namespace hippodraw

Generated for HippoDraw Class Library by doxygen