5 # include <vcl_msvc_warnings.h> 35 std::vector<vcsl_spatial_sptr>::iterator i, j;
42 std::vector<vcsl_spatial_sptr> children=(*i)->potential_children_;
43 for (j=children.begin(); j!=children.end()&&(*j).ptr()!=
this; ++j)
45 if ((*j).ptr()==
this) children.erase(j);
52 (*i)->potential_children_.emplace_back(
this);
64 std::vector<vcsl_spatial_sptr> temp_parent; temp_parent.push_back(new_parent);
82 int sup=
beat_.size()-1;
114 std::vector<vcsl_spatial_sptr>::const_iterator child;
132 result=
parent_[i]->recursive_path_from_local_to_cs_exists(other, time);
142 result=!(*child)->reached();
145 int j=(*child)->matching_interval(time);
146 result=(*child)->parent_[j].ptr()==
this;
148 result=(*child)->motion_[j]->is_invertible(time);
152 result=(*child)==other;
154 result=(*child)->recursive_path_from_local_to_cs_exists(other, time);
170 std::vector<vcsl_spatial_transformation_sptr> &path,
174 assert(path.size()==0);
175 assert(sens.size()==0);
191 std::vector<vcsl_spatial_transformation_sptr> &path,
196 std::vector<vcsl_spatial_sptr>::const_iterator child;
210 sens.push_back(
false);
219 sens.push_back(
false);
220 result=
parent_[i]->recursive_path_from_local_to_cs(other,time,path,sens);
235 result=!(*child)->reached();
238 int j=(*child)->matching_interval(time);
239 result=(*child)->parent_[j].ptr()==
this;
241 result=(*child)->motion_[j]->is_invertible(time);
244 result=(*child)==other;
245 path.push_back((*child)->motion_[j]);
246 sens.push_back(
true);
249 result=(*child)->recursive_path_from_local_to_cs(other,time,
300 std::vector<vcsl_spatial_transformation_sptr> path;
303 std::vector<vcsl_spatial_transformation_sptr>::const_iterator i;
304 VCSL_SPATIAL_VECTOR_BOOL::const_iterator j;
312 for (i=path.begin();i!=path.end();++i,++j)
315 tmp=(*i)->inverse(tmp,time);
317 tmp=(*i)->execute(tmp,time);
319 return other->from_standard_units_to_cs(tmp);
virtual bool recursive_path_from_local_to_cs_exists(const vcsl_spatial_sptr &other, double time)
Does a path from ‘this’ to ‘other’ exist ?.
virtual bool path_from_local_to_cs_exists(const vcsl_spatial_sptr &other, double time)
Does a path from ‘this’ to ‘other’ exist ?.
virtual int matching_interval(double time) const
Return the index of the beat inferior or equal to ‘time’.
std::vector< double > beat_
Clock times.
virtual void set_graph(const vcsl_graph_sptr &new_graph)
#define VCSL_SPATIAL_VECTOR_BOOL
virtual void path_from_local_to_cs(const vcsl_spatial_sptr &other, double time, std::vector< vcsl_spatial_transformation_sptr > &path, VCSL_SPATIAL_VECTOR_BOOL &sens)
Find the sequence of transformations from ‘this’ to ‘other’.
Spatial coordinate system transformation graph.
vnl_vector< double > from_cs_to_standard_units(const vnl_vector< double > &v) const
Convert ‘v’, expressed with cs units, to standard units.
bool valid_time(double time) const
Is ‘time’ between the two time bounds ?.
void set_unique(const vcsl_spatial_sptr &new_parent, const vcsl_spatial_transformation_sptr &new_motion)
Set the unique parent and the unique motion.
std::vector< vcsl_spatial_transformation_sptr > motion_
successive transformations from ‘this’ to ‘parent’ along the time.
virtual bool recursive_path_from_local_to_cs(const vcsl_spatial_sptr &other, double time, std::vector< vcsl_spatial_transformation_sptr > &path, VCSL_SPATIAL_VECTOR_BOOL &sens)
Find the sequence of transformations from ‘this’ to ‘other’.
vcsl_graph_sptr graph_
List of all the spatial coordinate system of the graph.
std::vector< vcsl_spatial_sptr > potential_children_
List of spatial coordinate system that can be child of ‘this’ at a time.
void set_parent(std::vector< vcsl_spatial_sptr > const &new_parent)
Set the list of parent coordinate system along the time.
void set_reached(const bool &new_reached)
A spatial coordinate system.
virtual vnl_vector< double > from_local_to_cs(const vnl_vector< double > &v, const vcsl_spatial_sptr &other, double time)
Return v but expressed in the spatial coordinate system ‘other’.
virtual bool is_absolute(double time) const
Is ‘this’ an absolute spatial coordinate system at time ‘time’?.
std::vector< vcsl_spatial_sptr > parent_
successive parents of ‘this’ along the time.