10 #ifndef IMPKINEMATICS_DIRECTIONAL_DO_FS_H
11 #define IMPKINEMATICS_DIRECTIONAL_DO_FS_H
15 IMPKINEMATICS_BEGIN_NAMESPACE
22 class IMPKINEMATICSEXPORT DirectionalDOF {
24 DirectionalDOF(
const DOFs& dofs): dofs_(dofs) {}
26 void set_end_points(
const DOFValues& q1,
const DOFValues& q2) {
29 current_delta_.resize(dofs_.size());
35 for(
unsigned int i=0; i<dofs_.size(); i++) {
37 dofs_[i]->get_number_of_steps(endpoint1_[i], endpoint2_[i]);
38 if(dof_step_number > step_number_)
39 step_number_ = dof_step_number;
42 for(
unsigned int i=0; i<dofs_.size(); i++) {
43 current_delta_[i] = (endpoint2_[i] - endpoint1_[i])/step_number_;
46 current_step_number_ = 0;
47 delta_ = 1.0/step_number_;
52 DOFValues get_dofs_values() {
53 DOFValues ret = endpoint1_;
54 for(
unsigned int i=0; i<ret.size(); i++) {
55 ret[i]+= current_step_number_ * current_delta_[i];
60 double get_value()
const {
return value_; }
64 void operator++(
int) {
65 current_step_number_++;
68 void operator--(
int) {
69 current_step_number_--;
80 DOFValues current_delta_;
86 int current_step_number_;
96 out <<
"(direction dof from " << endpoint1_ <<
" to " << endpoint2_
97 <<
" ; step number " << current_step_number_ <<
")";
104 IMPKINEMATICS_END_NAMESPACE
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.
#define IMP_SHOWABLE_INLINE(Name, how_to_show)
Declare the methods needed by an object that can be printed.
IMP::base::Vector< IMP::base::Pointer< DOF > > DOFs