Commit 5d54b06d authored by promayon's avatar promayon
Browse files

FIXED sofa simulator generated pml names do not contains the whole path (nicer)

FIXED Atom points are not automatically visible (nicer)
FIXED remove path in pml name (nicer)


git-svn-id: svn+ssh://scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/svn/camitk/trunk/camitk@1590 ec899d31-69d1-42ba-9299-647d76f65fb3
parent 02cee328
......@@ -181,7 +181,7 @@ void AtomDC::initRepresentation() {
delete [] vtkPointIndex;
// create the new geometry
myGeometry = new Geometry ( this->getName(), uGrid, InterfaceGeometry::Points );
myGeometry = new Geometry ( this->getName(), uGrid, InterfaceGeometry::None );
if ( isSelectedFlag ) {
// add the glyph now
......
......@@ -68,111 +68,112 @@ using namespace sofa::simulation::tree;
using namespace sofa::simulation;
using namespace sofa::defaulttype;
MML_DECL_CLASS(SofaSimulator)
MML_DECL_CLASS( SofaSimulator )
bool sofaRegistered=SimulatorFactory::getInstance()->registerClass<SofaSimulator>("sofa",true);
bool sofaRegistered = SimulatorFactory::getInstance()->registerClass<SofaSimulator>( "sofa", true );
SofaSimulator::SofaSimulator(MonitoringManager* monitoringManager): InteractiveSimulator(monitoringManager) {
SofaSimulator::SofaSimulator( MonitoringManager* monitoringManager ): InteractiveSimulator( monitoringManager ) {
string mshFile;
// check for Sofa scn
scnFile = monitoringManager->getPmlFileName();
string::size_type pLast = scnFile.rfind(".");
string::size_type pLast = scnFile.rfind( "." );
if (pLast != string::npos) {
scnFile.erase(pLast);
mshFile=string(scnFile);
if( pLast != string::npos ) {
scnFile.erase( pLast );
mshFile = string( scnFile );
mshFile += ".msh";
scnFile += ".scn";
}
// if scn file already exist, use this file
ifstream iscn(scnFile.c_str());
ifstream iscn( scnFile.c_str() );
if (!iscn) {
if( !iscn ) {
//scn file do not exist in pml directory, create one
//TODO? add simulator file path to mml? do not create if specified?
//create msh from pmlFile
int type=0;
PhysicalModel* pml=monitoringManager->getPml();
int type = 0;
PhysicalModel* pml = monitoringManager->getPml();
ofstream msh;
msh.open(mshFile.c_str(), ios::out);
msh.open( mshFile.c_str(), ios::out );
//create nodes
msh << "$NOD" <<endl;
msh << "$NOD" << endl;
msh << pml->getNumberOfAtoms() << endl;
double pos[3];
StructuralComponent* atoms=pml->getAtoms();
StructuralComponent* atoms = pml->getAtoms();
for (unsigned int i=0; i<atoms->getNumberOfStructures(); i++) {
Atom* a=dynamic_cast<Atom*>(atoms->getStructure(i));
a->getPosition(pos);
msh << a->getIndex()+1 << " " << pos[0] << " " << pos[1] << " " << pos[2] << endl;
for( unsigned int i = 0; i < atoms->getNumberOfStructures(); i++ ) {
Atom* a = dynamic_cast<Atom*>( atoms->getStructure( i ) );
a->getPosition( pos );
msh << a->getIndex() + 1 << " " << pos[0] << " " << pos[1] << " " << pos[2] << endl;
}
msh << "$ENDNOD" << endl;
//create elements if an "Elements" components exists
Component *elements = pml->getComponentByName ( "Elements" );
Component *elements = pml->getComponentByName( "Elements" );
if (elements) {
if( elements ) {
msh << "$ELM" << endl;
int nbElements = elements->getNumberOfCells();
msh << nbElements << endl;
for (int i = 0; i < nbElements; i++ ) {
for( int i = 0; i < nbElements; i++ ) {
msh << i + 1 << " ";
// get the cell
Cell * cell = elements->getCell ( i );
Cell * cell = elements->getCell( i );
switch ( cell->getType() ) {
switch( cell->getType() ) {
case StructureProperties::HEXAHEDRON:
case StructureProperties::HEXAHEDRON:
msh << "5 1 1 8";
type=5;
break;
msh << "5 1 1 8";
type = 5;
break;
case StructureProperties::TETRAHEDRON:
case StructureProperties::TETRAHEDRON:
msh << "4 1 1 4";
type=4;
break;
msh << "4 1 1 4";
type = 4;
break;
case StructureProperties::QUAD:
case StructureProperties::QUAD:
msh << "3 1 1 4";
break;
msh << "3 1 1 4";
break;
case StructureProperties::TRIANGLE:
case StructureProperties::TRIANGLE:
msh << "2 1 1 3";
break;
msh << "2 1 1 3";
break;
default:
std::cerr << "export to Sofa : unknown type for cell " << cell->getIndex() + 1 << ", neither HEXAHEDRON, TRIANGLE, TETRAHEDRON nor QUAD" << std::endl;
continue;
default
:
std::cerr << "export to Sofa : unknown type for cell " << cell->getIndex() + 1 << ", neither HEXAHEDRON, TRIANGLE, TETRAHEDRON nor QUAD" << std::endl;
continue;
}
for (unsigned int k = 0; k < cell->getNumberOfStructures(); k++ ) {
msh << " " << cell->getStructure ( k )->getIndex()+1;
for( unsigned int k = 0; k < cell->getNumberOfStructures(); k++ ) {
msh << " " << cell->getStructure( k )->getIndex() + 1;
}
msh <<endl;
msh << endl;
}
msh <<"$ENDELM" << endl;
msh << "$ENDELM" << endl;
}
else {
std::cerr <<" no \"Elements\" component found to export Elements in msh format" << std::endl;
std::cerr << " no \"Elements\" component found to export Elements in msh format" << std::endl;
}
msh.close();
......@@ -181,7 +182,7 @@ SofaSimulator::SofaSimulator(MonitoringManager* monitoringManager): InteractiveS
// TODO convert LML in sofa constraint
// to choose a possible modeling techniques we assume that only one type of elements is used
ofstream scn;
scn.open(scnFile.c_str(), ios::out);
scn.open( scnFile.c_str(), ios::out );
#if defined(SOFA_1_0_RC1) || defined(SOFA_SVN)
scn << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl;
scn << "<!-- Created from " << monitoringManager->getPmlFileName() << " by CamiTK/mml -->" << endl;
......@@ -204,21 +205,22 @@ SofaSimulator::SofaSimulator(MonitoringManager* monitoringManager): InteractiveS
scn << " <MechanicalObject src=\"@meshLoader\" />" << endl;
scn << " <DiagonalMass massDensity=\"0.1\" />" << endl;
scn << " <!-- force field -->" << endl;
switch (type) {
case 5:
//hexa
scn << " <HexahedronFEMForceField name=\"FEM\" method=\"large\" poissonRatio=\"0.45\" youngModulus=\"1440\" />" << endl;
break;
case 4:
//tetra
scn << " <TetrahedralCorotationalFEMForceField name=\"FEM\" youngModulus=\"1440\" poissonRatio=\"0.45\" method=\"large\" />" << endl;
break;
default:
;
switch( type ) {
case 5:
//hexa
scn << " <HexahedronFEMForceField name=\"FEM\" method=\"large\" poissonRatio=\"0.45\" youngModulus=\"1440\" />" << endl;
break;
case 4:
//tetra
scn << " <TetrahedralCorotationalFEMForceField name=\"FEM\" youngModulus=\"1440\" poissonRatio=\"0.45\" method=\"large\" />" << endl;
break;
default
:
;
}
scn << " </Node>" << endl;
scn << "</Node>" << endl;
#endif
#endif
#ifdef MML_SOFA_1_0_BETA4
scn << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl;
......@@ -233,24 +235,25 @@ SofaSimulator::SofaSimulator(MonitoringManager* monitoringManager): InteractiveS
scn << " <DiagonalMass template=\"Vec3d\" name=\"computed using mass density\" massDensity=\"1\" />" << endl;
scn << " <!--modeling technique -->" << endl;
switch (type) {
case 5:
//hexa
scn << " <HexahedronFEMForceField template=\"Vec3d\" name=\"FEM\" method=\"large\" poissonRatio=\"0.45\" youngModulus=\"1440\" />" << endl;
break;
case 4:
//tetra
scn << " <TetrahedronSetTopologyContainer name=\"topo\" />" << endl;
scn << " <TetrahedronSetGeometryAlgorithms template=\"Vec3d\" name=\"GeomAlgo\" />" << endl;
scn<< " <TetrahedralCorotationalFEMForceField template=\"Vec3d\" name=\"FEM\" method=\"large\" poissonRatio=\"0.45\" youngModulus=\"1440\" />" << endl;
break;
default:
;
switch( type ) {
case 5:
//hexa
scn << " <HexahedronFEMForceField template=\"Vec3d\" name=\"FEM\" method=\"large\" poissonRatio=\"0.45\" youngModulus=\"1440\" />" << endl;
break;
case 4:
//tetra
scn << " <TetrahedronSetTopologyContainer name=\"topo\" />" << endl;
scn << " <TetrahedronSetGeometryAlgorithms template=\"Vec3d\" name=\"GeomAlgo\" />" << endl;
scn << " <TetrahedralCorotationalFEMForceField template=\"Vec3d\" name=\"FEM\" method=\"large\" poissonRatio=\"0.45\" youngModulus=\"1440\" />" << endl;
break;
default
:
;
}
scn << " </Node>" << endl;
scn << "</Node>" << endl;
#endif
#endif
scn.close();
}
......@@ -258,22 +261,22 @@ SofaSimulator::SofaSimulator(MonitoringManager* monitoringManager): InteractiveS
build();
// create the atom / DOF map
unsigned int id=0; // TODO: Warning! the actual PML should be used to make
unsigned int id = 0; // TODO: Warning! the actual PML should be used to make
// perfect correspondance with the DOF index (for e.g. using two matching positions)
StructuralComponent* sc=monitoringManager->getPml()->getAtoms();
StructuralComponent* sc = monitoringManager->getPml()->getAtoms();
for (unsigned int i = 0; i < mechanicalObjects.size(); i++) {
mechanicalObjectAtomDOFMap.push_back(new std::MechanicalObjectAtomDOFMap());
mechanicalObjectDOFAtomMap.push_back(new std::MechanicalObjectDOFAtomMap());
for( unsigned int i = 0; i < mechanicalObjects.size(); i++ ) {
mechanicalObjectAtomDOFMap.push_back( new std::MechanicalObjectAtomDOFMap() );
mechanicalObjectDOFAtomMap.push_back( new std::MechanicalObjectDOFAtomMap() );
for (unsigned int j = 0; j < getMechanicalObjectDOFPosition(i).size(); j++) {
for( unsigned int j = 0; j < getMechanicalObjectDOFPosition( i ).size(); j++ ) {
// insert in the global map
unsigned int atomId=((Atom*)(sc->getStructure(id)))->getIndex();
atomsToDOF.insert(std::pair<unsigned int, std::MechanicalObjectDOFIndex> (atomId, std::MechanicalObjectDOFIndex(i, j)));
unsigned int atomId = ( ( Atom* )( sc->getStructure( id ) ) )->getIndex();
atomsToDOF.insert( std::pair<unsigned int, std::MechanicalObjectDOFIndex> ( atomId, std::MechanicalObjectDOFIndex( i, j ) ) );
// insert in the local map
mechanicalObjectAtomDOFMap.back()->insert(std::pair<unsigned int, unsigned int>(atomId, j));
mechanicalObjectDOFAtomMap.back()->insert(std::pair<unsigned int, unsigned int>(j, atomId));
mechanicalObjectAtomDOFMap.back()->insert( std::pair<unsigned int, unsigned int>( atomId, j ) );
mechanicalObjectDOFAtomMap.back()->insert( std::pair<unsigned int, unsigned int>( j, atomId ) );
id++;
}
}
......@@ -281,16 +284,16 @@ SofaSimulator::SofaSimulator(MonitoringManager* monitoringManager): InteractiveS
}
// -------------------- constructor --------------------
SofaSimulator::SofaSimulator(MonitoringManager* monitoringManager,const char* file): InteractiveSimulator(monitoringManager, file) {
scnFile=string(file);
SofaSimulator::SofaSimulator( MonitoringManager* monitoringManager, const char* file ): InteractiveSimulator( monitoringManager, file ) {
scnFile = string( file );
build();
}
// -------------------- destructor --------------------
SofaSimulator::~SofaSimulator() {
if (getGNode()!=NULL)
sofa::simulation::getSimulation()->unload(getGNode());
if( getGNode() != NULL )
sofa::simulation::getSimulation()->unload( getGNode() );
groot = NULL;
}
......@@ -300,10 +303,10 @@ SofaSimulator::~SofaSimulator() {
void SofaSimulator::build() {
#if defined(SOFA_1_0_RC1) || defined(SOFA_SVN)
sofa::helper::system::DataRepository.addFirstPath(string(SOFA_PATH)+"/share");
sofa::helper::system::DataRepository.addFirstPath(string(SOFA_PATH)+"/examples");
QFileInfo scnFileInfo(scnFile.c_str());
sofa::helper::system::DataRepository.addFirstPath(scnFileInfo.absoluteDir().canonicalPath().toStdString());
sofa::helper::system::DataRepository.addFirstPath( string( SOFA_PATH ) + "/share" );
sofa::helper::system::DataRepository.addFirstPath( string( SOFA_PATH ) + "/examples" );
QFileInfo scnFileInfo( scnFile.c_str() );
sofa::helper::system::DataRepository.addFirstPath( scnFileInfo.absoluteDir().canonicalPath().toStdString() );
/* std::cout << "DataRepository is now: " << std::endl;
const std::vector< std::string > paths = sofa::helper::system::DataRepository.getPaths();
......@@ -312,53 +315,53 @@ void SofaSimulator::build() {
#endif
#ifdef MML_SOFA_1_0_BETA4
sofa::simulation::setSimulation(new sofa::simulation::tree::TreeSimulation());
sofa::simulation::setSimulation( new sofa::simulation::tree::TreeSimulation() );
sofa::component::init();
sofa::simulation::xml::initXml();
sofa::helper::system::PluginManager::getInstance().init();
sofa::helper::system::PluginManager::getInstance().initRecentlyOpened();
#endif
//-- load the SOFA scn
#if defined(SOFA_1_0_RC1) || defined(SOFA_SVN)
//preRC1 (svn)
groot = sofa::core::objectmodel::SPtr_dynamic_cast<sofa::simulation::Node>(sofa::simulation::tree::getSimulation()->load(scnFile.c_str()));
groot = sofa::core::objectmodel::SPtr_dynamic_cast<sofa::simulation::Node>( sofa::simulation::tree::getSimulation()->load( scnFile.c_str() ) );
//RC1 groot = sofa::core::objectmodel::SPtr_dynamic_cast<sofa::simulation::Node>(sofa::simulation::getSimulation()->load(scnFile.c_str()));
#endif
#endif
#ifdef MML_SOFA_1_0_BETA4
groot = dynamic_cast<sofa::simulation::Node*>( sofa::simulation::getSimulation()->load(scnFile.c_str()));
groot = dynamic_cast<sofa::simulation::Node*>( sofa::simulation::getSimulation()->load( scnFile.c_str() ) );
#endif
if (getGNode()==NULL) {
if( getGNode() == NULL ) {
#if defined(SOFA_1_0_RC1) || defined(SOFA_SVN)
groot = sofa::simulation::tree::getSimulation()->createNewGraph("");
#endif
groot = sofa::simulation::tree::getSimulation()->createNewGraph( "" );
#endif
#ifdef MML_SOFA_1_0_BETA4
groot = sofa::simulation::getSimulation()->newNode("");
groot = sofa::simulation::getSimulation()->newNode( "" );
#endif
cerr << "SofaSimulator::build: error: cannot load " << scnFile << "." << endl;
}
// init root
sofa::simulation::tree::getSimulation()->init(getGNode());
sofa::simulation::tree::getSimulation()->init( getGNode() );
// sofa scn dt prevails
monitoringManager->setDt(getGNode()->getDt());
monitoringManager->setDt( getGNode()->getDt() );
#ifdef MML_GENERATE_GUI
widget=new SofaWidget(NULL,this);
widget = new SofaWidget( NULL, this );
#endif
// get all mechanical objects
getGNode()->get<BaseMechanicalState>(&mechanicalObjects, BaseContext::SearchDown);
getGNode()->get<BaseMechanicalState>( &mechanicalObjects, BaseContext::SearchDown );
// if there is no mechanical objects
if (mechanicalObjects.size()==0) {
if (getGNode()!=NULL)
sofa::simulation::getSimulation()->unload(getGNode());
if( mechanicalObjects.size() == 0 ) {
if( getGNode() != NULL )
sofa::simulation::getSimulation()->unload( getGNode() );
groot = NULL;
cerr << "SofaSimulator::build: error: cannot find any MechanicalObject in the scene " << endl;
......@@ -369,58 +372,58 @@ void SofaSimulator::build() {
//--------------- getDOFPosition -------------------
Vec3Types::Coord SofaSimulator::getDOFPosition(unsigned int atomIndex) {
std::AtomDOFMap::iterator it = atomsToDOF.find(atomIndex);
return getDOFPosition((it->second).first, (it->second).second);
Vec3Types::Coord SofaSimulator::getDOFPosition( unsigned int atomIndex ) {
std::AtomDOFMap::iterator it = atomsToDOF.find( atomIndex );
return getDOFPosition( ( it->second ).first, ( it->second ).second );
}
Vec3Types::Coord SofaSimulator::getDOFPosition(unsigned int mechObjectIndex, unsigned int dofIndex) {
return getMechanicalObjectDOFPosition(mechObjectIndex)[dofIndex];
Vec3Types::Coord SofaSimulator::getDOFPosition( unsigned int mechObjectIndex, unsigned int dofIndex ) {
return getMechanicalObjectDOFPosition( mechObjectIndex )[dofIndex];
}
//--------------- getDOFForce -------------------
Vec3Types::Deriv SofaSimulator::getDOFForce(unsigned int atomIndex) {
std::AtomDOFMap::iterator it = atomsToDOF.find(atomIndex);
return getDOFForce((it->second).first, (it->second).second);
Vec3Types::Deriv SofaSimulator::getDOFForce( unsigned int atomIndex ) {
std::AtomDOFMap::iterator it = atomsToDOF.find( atomIndex );
return getDOFForce( ( it->second ).first, ( it->second ).second );
}
Vec3Types::Deriv SofaSimulator::getDOFForce(unsigned int mechObjectIndex, unsigned int dofIndex) {
return getMechanicalObjectDOFForce(mechObjectIndex)[dofIndex];
Vec3Types::Deriv SofaSimulator::getDOFForce( unsigned int mechObjectIndex, unsigned int dofIndex ) {
return getMechanicalObjectDOFForce( mechObjectIndex )[dofIndex];
}
//--------------- getAtomIndex -------------------
unsigned int SofaSimulator::getAtomIndex(unsigned int mechObjectIndex, unsigned int dofIndex) {
std::MechanicalObjectDOFAtomMap::iterator it = getMechanicalObjectDOFAtomMap(mechObjectIndex).find(dofIndex);
unsigned int SofaSimulator::getAtomIndex( unsigned int mechObjectIndex, unsigned int dofIndex ) {
std::MechanicalObjectDOFAtomMap::iterator it = getMechanicalObjectDOFAtomMap( mechObjectIndex ).find( dofIndex );
return it->second;
}
// -------------------- getMechanicalObject --------------------
MechanicalObject<Vec3Types> * SofaSimulator::getMechanicalObject(unsigned int mechObjectIndex) {
return dynamic_cast<MechanicalObject<Vec3Types> *>(mechanicalObjects[mechObjectIndex]);
MechanicalObject<Vec3Types> * SofaSimulator::getMechanicalObject( unsigned int mechObjectIndex ) {
return dynamic_cast<MechanicalObject<Vec3Types> *>( mechanicalObjects[mechObjectIndex] );
}
//--------------- doMove -------------------
void SofaSimulator::doMove(double dt) {
void SofaSimulator::doMove( double dt ) {
// if their is no graph root, nothing can be done
if (!getGNode()) {
if( !getGNode() ) {
return;
}
// set the dt
getGNode()->getContext()->setDt(dt);
getGNode()->getContext()->setDt( dt );
//-- animate one step
sofa::simulation::tree::getSimulation()->animate(getGNode(), dt);
sofa::simulation::tree::getSimulation()->animate( getGNode(), dt );
}
// --------------- getPosition -------------------
void SofaSimulator::getPosition(int index, double position[3]) {
void SofaSimulator::getPosition( int index, double position[3] ) {
Vec3Types::Coord pos;
std::AtomDOFMap::iterator it = atomsToDOF.find(index);
std::AtomDOFMap::iterator it = atomsToDOF.find( index );
if (it != atomsToDOF.end()) {
pos = getMechanicalObjectDOFPosition((it->second).first)[(it->second).second];
if( it != atomsToDOF.end() ) {
pos = getMechanicalObjectDOFPosition( ( it->second ).first )[( it->second ).second];
position[0] = pos[0];
position[1] = pos[1];
position[2] = pos[2];
......@@ -428,12 +431,12 @@ void SofaSimulator::getPosition(int index, double position[3]) {
}
// --------------- getForce -------------------
void SofaSimulator::getForce(int index, double force[3]) {
void SofaSimulator::getForce( int index, double force[3] ) {
Vec3Types::Deriv fo;
std::AtomDOFMap::iterator it = atomsToDOF.find(index);
std::AtomDOFMap::iterator it = atomsToDOF.find( index );
if (it != atomsToDOF.end()) {
fo = getMechanicalObjectDOFForce((it->second).first)[(it->second).second];
if( it != atomsToDOF.end() ) {
fo = getMechanicalObjectDOFForce( ( it->second ).first )[( it->second ).second];
force[0] = fo[0];
force[1] = fo[1];
force[2] = fo[2];
......@@ -443,21 +446,21 @@ void SofaSimulator::getForce(int index, double force[3]) {
//--------------- init -------------------
void SofaSimulator::init() {
sofa::simulation::tree::getSimulation()->reset(getGNode());
sofa::simulation::tree::getSimulation()->reset( getGNode() );
if (monitoringManager->isLmlPresent())
if( monitoringManager->isLmlPresent() )
buildConstraints(); //TODO just update?
}
//--------------- buildConstraints -------------------
void SofaSimulator::buildConstraints() {
// destroy constraints if exist
if (translations.size() > 0) {
for (unsigned int i = 0; i < translations.size(); i++) {
if( translations.size() > 0 ) {
for( unsigned int i = 0; i < translations.size(); i++ ) {
// check all MO (TODO : a LMLConstraint should have a ptr to its MO and should be able to clear itself from its context when deleted)
for (unsigned int j = 0; j < getNumberOfMechanicalObjects(); j++) {
if (getMechanicalObject(j)) {
getMechanicalObject(j)->getContext()->removeObject(translations[i]);
for( unsigned int j = 0; j < getNumberOfMechanicalObjects(); j++ ) {
if( getMechanicalObject( j ) ) {
getMechanicalObject( j )->getContext()->removeObject( translations[i] );
}
}
......@@ -470,15 +473,15 @@ void SofaSimulator::buildConstraints() {
}
// create the constraints
if (translations.size() == 0 && monitoringManager->getLml()) {
for (unsigned int i = 0; i < getNumberOfMechanicalObjects(); i++) {
TranslationConstraint<Vec3Types> *t = new TranslationConstraint<Vec3Types>(monitoringManager->getLml(), getMechanicalObjectAtomDOFMap(i), getMechanicalObject(i));
if (t->getTargets().size() > 0) {
if (getMechanicalObject(i)) {
getMechanicalObject(i)->getContext()->addObject(t);
t->setInitTime(getGNode()->getTime());
translations.push_back(t);
if( translations.size() == 0 && monitoringManager->getLml() ) {
for( unsigned int i = 0; i < getNumberOfMechanicalObjects(); i++ ) {
TranslationConstraint<Vec3Types> *t = new TranslationConstraint<Vec3Types>( monitoringManager->getLml(), getMechanicalObjectAtomDOFMap( i ), getMechanicalObject( i ) );
if( t->getTargets().size() > 0 ) {
if( getMechanicalObject( i ) ) {
getMechanicalObject( i )->getContext()->addObject( t );
t->setInitTime( getGNode()->getTime() );
translations.push_back( t );
}
}
else
......@@ -488,208 +491,214 @@ void SofaSimulator::buildConstraints() {
}
// -------------------- createPml --------------------
void SofaSimulator::createPml(const char* inputFile, const char* pmlFile) { //TODO enlever input...
void SofaSimulator::createPml( const char* inputFile, const char* pmlFile ) { //TODO enlever input...
std::string pmlName;
PhysicalModel* pm;
// if there is no mechanical objects
if (mechanicalObjects.size()==0) {