Joint.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef JOINT_H_
00012 # define JOINT_H_
00013
00014
00015 #define MAX_NAME 100
00016
00017
00018
00019 #include <stdlib.h>
00020 #include <iostream>
00021 #include <cmath>
00022 #include <string>
00023 #include <errno.h>
00024 #include <stdio.h>
00025
00026 #include <vector>
00027 using namespace std;
00028
00029 #include <Matrix.h>
00030 #include <V_3D.h>
00031 #include <list>
00032
00033
00034 using namespace std;
00035
00036 class Joint
00037 {
00038 public:
00039 Joint();
00040 Joint(const Joint&);
00041 ~Joint();
00042
00043
00044 int set_name(const char* _name);
00045 int set_name(const std::string &name);
00046 char *get_name();
00047
00048
00049 int set_position(double x,double y,double z);
00050 int add_position(double x,double y,double z);
00051 int add_position(double *translation);
00052 int get_position(double *_position);
00053 double *get_position();
00054
00055
00056 int set_orientation(double t1,double t2,double t3);
00057 int set_orientation(double *t);
00058 int get_orientation(double *_orientation);
00059 double *get_orientation();
00060
00061 int multiply_matrix(Matrix R);
00062
00063 int set_matrix(Matrix M);
00064 Matrix get_matrix();
00065 int get_matrix(Matrix *_M);
00066
00067 int set_father(Joint *_father);
00068 Joint* get_father();
00069
00070 int add_son();
00071 Joint* get_son(int k);
00072
00073 int get_N_son();
00074 int add_rotation(double *v,double theta);
00075
00076 int add_rotation(double v0,double v1,double v2,double theta);
00077
00078 int scale(double *s);
00079 int scale(double s0,double s1,double s2);
00080 int set_bind_pose(Matrix D);
00081 int set_position_bind(double x,double y,double z);
00082 int set_position_bind(double *t);
00083 Matrix get_bind_pose();
00084 int get_bind_pose(Matrix *_M);
00085
00086 int set_access_number(int _access_number);
00087 int get_access_number();
00088
00089 int set_son(int k,Joint *new_joint);
00090
00091 int set_world_matrix(Matrix _world_matrix);
00092 Matrix get_world_matrix();
00093 int set_T(Matrix _T);
00094 Matrix get_T();
00095
00096
00097 friend ostream& operator << (ostream& flux, Joint *joint)
00098 {flux<<joint->get_name();return flux;}
00099 Joint& operator=(const Joint& J);
00100
00101
00102 double get_min_distance_to_bone(V_3D vertex);
00103
00104
00105
00106 int get_level();
00107 int set_level(int _level);
00108
00109 int set_weight_name(const char* weight_name);
00110 const char* get_weight_name() const;
00111
00112 private:
00113
00114 int destroy();
00115
00116 Joint *father;
00117 int N_son;
00118 std::list <Joint*> son;
00119
00120 char name[MAX_NAME];
00121 std::string weight_name;
00122 Matrix M;
00123 double orientation[3];
00124 Matrix bind_pose;
00125 Matrix world_matrix;
00126 Matrix T;
00127
00128 int access_number;
00129 int level;
00130
00131 };
00132
00133
00134
00135 #endif