OndselSolver can read and write *.asmt files
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
* *
|
||||
* See LICENSE file for details about copyright. *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#include "ASMTSpatialItem.h"
|
||||
#include "Units.h"
|
||||
#include "Part.h"
|
||||
@@ -30,16 +30,6 @@ void MbD::ASMTSpatialItem::setRotationMatrix(FMatDsptr mat)
|
||||
rotationMatrix = mat;
|
||||
}
|
||||
|
||||
void MbD::ASMTSpatialItem::setVelocity3D(FColDsptr vec)
|
||||
{
|
||||
velocity3D = vec;
|
||||
}
|
||||
|
||||
void MbD::ASMTSpatialItem::setOmega3D(FColDsptr vec)
|
||||
{
|
||||
omega3D = vec;
|
||||
}
|
||||
|
||||
void MbD::ASMTSpatialItem::readPosition3D(std::vector<std::string>& lines)
|
||||
{
|
||||
assert(lines[0].find("Position3D") != std::string::npos);
|
||||
@@ -70,32 +60,6 @@ void MbD::ASMTSpatialItem::readRotationMatrix(std::vector<std::string>& lines)
|
||||
}
|
||||
}
|
||||
|
||||
void MbD::ASMTSpatialItem::readVelocity3D(std::vector<std::string>& lines)
|
||||
{
|
||||
assert(lines[0].find("Velocity3D") != std::string::npos);
|
||||
lines.erase(lines.begin());
|
||||
std::istringstream iss(lines[0]);
|
||||
velocity3D = std::make_shared<FullColumn<double>>();
|
||||
double d;
|
||||
while (iss >> d) {
|
||||
velocity3D->push_back(d);
|
||||
}
|
||||
lines.erase(lines.begin());
|
||||
}
|
||||
|
||||
void MbD::ASMTSpatialItem::readOmega3D(std::vector<std::string>& lines)
|
||||
{
|
||||
assert(lines[0].find("Omega3D") != std::string::npos);
|
||||
lines.erase(lines.begin());
|
||||
std::istringstream iss(lines[0]);
|
||||
omega3D = std::make_shared<FullColumn<double>>();
|
||||
double d;
|
||||
while (iss >> d) {
|
||||
omega3D->push_back(d);
|
||||
}
|
||||
lines.erase(lines.begin());
|
||||
}
|
||||
|
||||
void MbD::ASMTSpatialItem::getPosition3D(double& a, double& b, double& c)
|
||||
{
|
||||
a = position3D->at(0);
|
||||
@@ -118,16 +82,6 @@ void MbD::ASMTSpatialItem::setPosition3D(double a, double b, double c)
|
||||
position3D = std::make_shared<FullColumn<double>>(ListD{ a, b, c });
|
||||
}
|
||||
|
||||
void MbD::ASMTSpatialItem::setVelocity3D(double a, double b, double c)
|
||||
{
|
||||
velocity3D = std::make_shared<FullColumn<double>>(ListD{ a, b, c });
|
||||
}
|
||||
|
||||
void MbD::ASMTSpatialItem::setOmega3D(double a, double b, double c)
|
||||
{
|
||||
omega3D = std::make_shared<FullColumn<double>>(ListD{ a, b, c });
|
||||
}
|
||||
|
||||
void MbD::ASMTSpatialItem::setRotationMatrix(double v11, double v12, double v13,
|
||||
double v21, double v22, double v23,
|
||||
double v31, double v32, double v33)
|
||||
@@ -137,4 +91,25 @@ void MbD::ASMTSpatialItem::setRotationMatrix(double v11, double v12, double v13,
|
||||
{ v21, v22, v23 },
|
||||
{ v31, v32, v33 }
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void MbD::ASMTSpatialItem::storeOnLevel(std::ofstream& os, int level)
|
||||
{
|
||||
storeOnLevelPosition(os, level + 1);
|
||||
storeOnLevelRotationMatrix(os, level + 1);
|
||||
}
|
||||
|
||||
void MbD::ASMTSpatialItem::storeOnLevelPosition(std::ofstream& os, int level)
|
||||
{
|
||||
storeOnLevelString(os, level, "Position3D");
|
||||
storeOnLevelArray(os, level + 1, *position3D);
|
||||
}
|
||||
|
||||
void MbD::ASMTSpatialItem::storeOnLevelRotationMatrix(std::ofstream& os, int level)
|
||||
{
|
||||
storeOnLevelString(os, level, "RotationMatrix");
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
storeOnLevelArray(os, level + 1, *rotationMatrix->at(i));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user