Exemple #1
0
/// Constructs a vector-valued attribute with the given name
XMLAttrib::XMLAttrib(const std::string& name, const Matrix3d& matrix_value)
{  
  this->processed = false;
  this->name = name;
  std::ostringstream oss;

  // set the first value of the matrix
  oss << str(matrix_value(0,0));

  // for each row of the matrix
  for (unsigned j=0; j< matrix_value.rows(); j++)
  {
    // determine column iteration
    unsigned i = (j == 0) ? 1 : 0;

    // for each column of the matrix
    for (; i< matrix_value.columns(); i++)
      oss << " " << str(matrix_value(j,i));

    // separate rows with a semicolon
    oss << ";";
  }

  // get the string value
  this->value = oss.str();
}