24 ColPair(
Chain* chain,
const char* jointname1,
const char* charname1,
const char* jointname2,
const char* charname2) {
41 friend class ColModel;
45 n_allocated_pairs = 0;
47 n_allocated_models = 0;
55 for(
int i=0;
i<n_pairs;
i++)
delete pairs[
i];
60 for(
int i=0;
i<n_models;
i++)
delete models[
i];
68 int AddCharPairs(
const char* char1,
const char* char2,
69 Chain* chain, SceneGraph* sg);
73 int AddJointPair(
const char* joint1,
const char* joint2,
74 Chain* chain, SceneGraph* sg);
95 for(
int i=0;
i<n_models;
i++)
97 if(models[
i]->joint == jref)
return models[
i];
102 for(
int i=0;
i<n_pairs;
i++)
104 if(pairs[
i]->models[0]->joint == jref1 && pairs[
i]->models[1]->joint == jref2)
return pairs[
i];
105 else if(pairs[
i]->models[1]->joint == jref1 && pairs[
i]->models[0]->joint == jref2)
return pairs[
i];
109 ColModel* AddModel(
Joint* jref, SceneGraph* sg);
114 pairs =
new ColPair* [n_new_alloc];
117 for(
int i=0;
i<n_allocated_pairs;
i++) pairs[
i] = tmp[
i];
120 n_allocated_pairs = n_new_alloc;
123 ColModel** tmp = models;
124 models =
new ColModel* [n_new_alloc];
127 for(
int i=0;
i<n_allocated_models;
i++) models[
i] = tmp[
i];
130 n_allocated_models = n_new_alloc;
133 void add_model(ColModel* m);
135 int add_char_pairs(
Joint* cur,
const char* char1,
const char* char2,
Chain* chain, SceneGraph* sg);
136 int add_char_pairs(
Joint* j1,
Joint* j2,
const char* char2, SceneGraph* sg);
137 int add_joint_pair(
Joint* j1,
Joint* j2, SceneGraph* sg);
void allocate_model(int n_new_alloc)
ColModel * Model(Joint *jref)
void allocate_pair(int n_new_alloc)
Classes for defining open/closed kinematic chains.
The class representing the whole mechanism. May contain multiple characters.
ColPair(Chain *chain, const char *jointname1, const char *charname1, const char *jointname2, const char *charname2)
The class for representing a joint.
ColPair * Pair(Joint *jref1, Joint *jref2)