00001
00012 #ifdef _MSC_VER
00013
00014 # pragma warning(disable:4231)
00015
00016
00017 # pragma warning(disable:4251)
00018
00019
00020 # pragma warning(disable:4275)
00021
00022
00023 # pragma warning(disable:4800)
00024 #endif
00025
00026 #define PY_ARRAY_UNIQUE_SYMBOL PyArrayHandle
00027 #include "num_util.h"
00028
00029 #include "NumArrayTuple.h"
00030
00031 using namespace boost::python;
00032
00033 namespace hippodraw {
00034 namespace Python {
00035
00036 void
00037 export_NumArrayTuple()
00038 {
00039 import_array();
00040
00041 #ifdef HAVE_NUMERIC
00042 numeric::array::set_module_and_type
00043 ( "Numeric",
00044 "ArrayType" );
00045 #else
00046 numeric::array::set_module_and_type ();
00047 #endif
00048
00049 class_ < NumArrayTuple, bases < DataSource > > ( "NumArrayTuple",
00050 "Interface to numarray Python extension module.",
00051 init< > ( "Creates an empty NumArrayTuple" ) )
00052
00053
00054
00055 .def ( "setLabels", &NumArrayTuple::setLabels,
00056 args ( "[label, ...]" ),
00057 "Sets the labels of the columns." )
00058
00059 .def ( "getLabel", &NumArrayTuple::getLabelAt,
00060 return_value_policy < copy_const_reference > () )
00061
00062
00063
00064
00065 .def ( "addColumn",
00066 &NumArrayTuple::addColumn,
00067 "Addes the array as a new column with label" )
00068
00069 .def ( "replaceColumn",
00070 ( void ( NumArrayTuple:: * )
00071 ( unsigned int, numeric::array ) )
00072 &NumArrayTuple::replaceColumn,
00073 "Replaces existing column with new array\n"
00074 "Args:\n"
00075 "\t index\n"
00076 "\t numarray" )
00077
00078 .def ( "replaceColumn",
00079 ( void ( NumArrayTuple:: * )
00080 ( const std::string &, numeric::array ) )
00081 &NumArrayTuple::replaceColumn,
00082 "Replaces existing column with new array\n"
00083 "Args:\n"
00084 "\t label\n"
00085 "\t numarray" )
00086
00087 .def ( "notifyObservers",
00088 &NumArrayTuple::notifyObservers,
00089 "Sends update message to all observers." )
00090
00091 ;
00092 }
00093
00094 }
00095 }