16 #include <dynamic-graph/factory.h> 18 #include <boost/bind.hpp> 35 selectionSIN(NULL,
"Reader(" + n +
")::input(flag)::selec"),
39 vectorSOUT,
"Reader(" + n +
")::matrix"),
59 std::ifstream datafile(filename.c_str());
60 const unsigned int SIZE = 1024;
62 std::vector<double> newline;
63 while (datafile.good()) {
64 datafile.getline(buffer, SIZE);
65 const unsigned int gcount = (
unsigned int)(datafile.gcount());
68 std::istringstream iss(buffer);
70 sotDEBUG(25) <<
"Get line = '" << buffer <<
"'" << std::endl;
78 sotDEBUG(45) <<
"New data = " << x << std::endl;
80 if (newline.size() > 0)
dataSet.push_back(newline);
102 const unsigned int time) {
106 sotDEBUG(15) <<
"Start the list" << std::endl;
121 unsigned int dim = 0;
122 for (
unsigned int i = 0;
i < curr.size(); ++
i)
123 if (selection(
i)) dim++;
127 for (
unsigned int i = 0;
i < curr.size(); ++
i)
128 if (selection(
i)) res(cursor++) = curr[
i];
135 const unsigned int time) {
138 if (vect.size() <
rows *
cols)
return res;
142 for (
int j = 0; j <
cols; ++j) res(
i, j) = vect(
i * cols + j);
152 os << CLASS_NAME <<
" " <<
name << endl;
163 namespace dc = ::dynamicgraph::command;
165 "Clear the data loaded"));
167 dc::makeCommandVoid0(
169 "Reset the iterator to the beginning of the data set"));
SignalTimeDependent< dynamicgraph::Matrix, int > matrixSOUT
void load(const std::string &filename)
sotReader(const std::string n)
SignalArray< int > sotNOSIGNAL(0)
void signalRegistration(const SignalArray< int > &signals)
#define sotDEBUGOUT(level)
dynamicgraph::Vector & getNextData(dynamicgraph::Vector &res, const unsigned int time)
void setNeedUpdateFromAllChildren(const bool b=true)
DataType::const_iterator currentData
DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(FeaturePosture, "FeaturePosture")
dynamicgraph::Matrix & getNextMatrix(dynamicgraph::Matrix &res, const unsigned int time)
#define sotDEBUGIN(level)
void display(std::ostream &os) const
virtual void initCommands()
SignalTimeDependent< dynamicgraph::Vector, int > vectorSOUT
std::ostream & operator<<(std::ostream &os, const sotReader &t)
void resize(const int &nbRow, const int &nbCol)
SignalPtr< Flags, int > selectionSIN
void addCommand(const std::string &name, command::Command *command)