MBDyn classes for reading
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "MBDynElements.h"
|
||||
#include "MBDynBody.h"
|
||||
|
||||
using namespace MbD;
|
||||
|
||||
@@ -8,5 +9,29 @@ void MbD::MBDynElements::initialize()
|
||||
|
||||
void MbD::MBDynElements::parseMBDyn(std::vector<std::string>& lines)
|
||||
{
|
||||
assert(false);
|
||||
elements = std::make_shared<std::vector<std::shared_ptr<MBDynElement>>>();
|
||||
std::vector<std::string> bodyToken{ "body:" };
|
||||
std::vector<std::string> jointToken{ "joint:" };
|
||||
std::vector<std::string>::iterator it;
|
||||
while (true) {
|
||||
it = findLineWith(lines, bodyToken);
|
||||
if (it != lines.end()) {
|
||||
auto body = std::make_shared<MBDynBody>();
|
||||
body->owner = this;
|
||||
body->parseMBDyn(*it);
|
||||
elements->push_back(body);
|
||||
lines.erase(it);
|
||||
continue;
|
||||
}
|
||||
it = findLineWith(lines, jointToken);
|
||||
if (it != lines.end()) {
|
||||
auto body = std::make_shared<MBDynBody>();
|
||||
body->owner = this;
|
||||
body->parseMBDyn(*it);
|
||||
elements->push_back(body);
|
||||
lines.erase(it);
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user