Node.hpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef NODE_HPP
00023 #define NODE_HPP
00024
00025 #include "Platform.hpp"
00026 #ifdef SWIG
00027 %module CsoundAC
00028 %{
00029 #include "Score.hpp"
00030 #include <vector>
00031 #include <boost/numeric/ublas/matrix.hpp>
00032 %}
00033 %include "std_string.i"
00034 %include "std_vector.i"
00035 %template(NodeVector) std::vector<csound::Node*>;
00036 #else
00037 #include "Score.hpp"
00038 #include <vector>
00039 #include <boost/numeric/ublas/matrix.hpp>
00040 using namespace boost::numeric;
00041 #endif
00042
00043 namespace csound
00044 {
00050 class Node
00051 {
00052 protected:
00053 ublas::matrix<double> localCoordinates;
00054 public:
00058 std::vector<Node *> children;
00059 Node();
00060 virtual ~Node();
00064 virtual ublas::matrix<double> getLocalCoordinates() const;
00070 virtual ublas::matrix<double> traverse(const ublas::matrix<double> &globalCoordinates,
00071 Score &score);
00075 virtual void produceOrTransform(Score &score,
00076 size_t beginAt,
00077 size_t endAt,
00078 const ublas::matrix<double> &coordinates);
00079 virtual ublas::matrix<double> createTransform();
00080 virtual void clear();
00081 virtual double &element(size_t row, size_t column);
00082 virtual void setElement(size_t row, size_t column, double value);
00083 virtual void addChild(Node *node);
00084 };
00085 typedef Node* NodePtr;
00086 }
00087 #endif
00088