24MASS_FILE::MASS_FILE(
void ){
Clean (); }
26MASS_FILE::~MASS_FILE(
void ){}
52 ifstream in(FileName);
60 for(
int j=0; j<33; j++)
63 for(
unsigned int i=0; i<
n_Masses; i++)
66 mObjs.push_back(mObj);
78 ofstream out(FileName);
83 out << fixed << setprecision(6);
84 out << setw(12) << std::left <<
"DataRows: " <<
n_Masses << endl;
85 out << setw(12) << std::left <<
"RefInertia: " << setw(12) <<
RefInertia;
86 out << setw(12) << std::left <<
Ref_x;
87 out << setw(12) << std::left <<
Ref_y;
88 out << setw(12) << std::left <<
Ref_z;
93 for(
unsigned int i=0; i<
n_Masses; i++)
96 out << setw(44) << std::right <<
"Global: ";
98 out << setw(36) << std::left <<
m_glob;
99 out << setw(12) << std::left <<
CGx_glob;
100 out << setw(12) << std::left <<
CGy_glob;
101 out << setw(12) << std::left <<
CGz_glob;
102 out << setw(12) << std::left <<
Ixx_glob;
103 out << setw(12) << std::left <<
Iyy_glob;
104 out << setw(12) << std::left <<
Izz_glob;
105 out << setw(12) << std::left <<
Ixy_glob;
106 out << setw(12) << std::left <<
Iyz_glob;
107 out << setw(12) << std::left <<
Izx_glob;
114void MASS_FILE::WriteHeader(std::ofstream &out)
116 out << setw(4) << std::left <<
"Id";
117 out << setw(8) << std::left <<
"Active";
118 out << setw(80) << std::left <<
"Name";
119 out << setw(12) << std::left <<
"Type";
121 out << setw(12) << std::left <<
"m";
122 out << setw(12) << std::left <<
"ro";
123 out << setw(12) << std::left <<
"Vol";
125 out << setw(12) << std::left <<
"CGx";
126 out << setw(12) << std::left <<
"CGy";
127 out << setw(12) << std::left <<
"CGz";
129 out << setw(12) << std::left <<
"Ixx";
130 out << setw(12) << std::left <<
"Iyy";
131 out << setw(12) << std::left <<
"Izz";
132 out << setw(12) << std::left <<
"Ixy";
133 out << setw(12) << std::left <<
"Iyz";
134 out << setw(12) << std::left <<
"Izx";
136 out << setw(12) << std::left <<
"Base_x";
137 out << setw(12) << std::left <<
"Base_y";
138 out << setw(12) << std::left <<
"Base_z";
139 out << setw(12) << std::left <<
"Tip_x";
140 out << setw(12) << std::left <<
"Tip_y";
141 out << setw(12) << std::left <<
"Tip_z";
142 out << setw(12) << std::left <<
"Side_x";
143 out << setw(12) << std::left <<
"Side_y";
144 out << setw(12) << std::left <<
"Side_z";
146 out << setw(12) << std::left <<
"R";
147 out << setw(12) << std::left <<
"r";
148 out << setw(12) << std::left <<
"H";
149 out << setw(12) << std::left <<
"a";
150 out << setw(12) << std::left <<
"b";
151 out << setw(12) << std::left <<
"c";
152 out << setw(12) << std::left <<
"th";
154 out << setw(4) << std::left <<
"Color" << endl;
int Read(const char *FileName)
reads masses file
double Iyy_glob
global inertia moment wrt CG [kg m^2]
unsigned int RefInertia
type of origin for inertia moment computation: CG/CS/Arbitrary
double Ixx_glob
global inertia moment wrt CG [kg m^2]
std::vector< MASS_OBJECT_DATA > mObjs
vector of mass objects
unsigned int n_Masses
number of mass objects
double Izx_glob
global inertia moment wrt CG [kg m^2]
double CGx_glob
global CG position X [m]
double Izz_glob
global inertia moment wrt CG [kg m^2]
void Clean()
cleans local variables
double Iyz_glob
global inertia moment wrt CG [kg m^2]
double Ref_y
arbitrary reference point y coordinate
double CGy_glob
global CG position Y [m]
double Ref_z
arbitrary reference point z coordinate
int Write(const char *Filename)
writes masses file
double CGz_glob
global CG position Z [m]
double Ixy_glob
global inertia moment wrt CG [kg m^2]
double Ref_x
arbitrary reference point x coordinate
double m_glob
global mass value [kg]
MASS_OBJECT_DATA class and functions.
void Read(std::ifstream &in)
reads single mass object