Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit 6cacb703 authored by promayon's avatar promayon
Browse files

FIXED rationalized mml CMakeLists and start of Sofa

       stable (v15.03) support (still need some polishing and bug fixing)
NEW   mmlcomponent got simple mml testdata
FIXED simulation tab/dialog now only available from an action
FIXED silence camitk_translate macro



git-svn-id: svn+ssh://scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/svn/camitk/trunk/camitk@2050 ec899d31-69d1-42ba-9299-647d76f65fb3
parent 4be95836
......@@ -27,39 +27,39 @@
<context>
<name>OtsuFilter</name>
<message>
<location filename="../../OtsuFilter.cpp" line="59"/>
<location filename="../../OtsuFilter.cpp" line="62"/>
<source>Computed threshold:</source>
<translation>Seuil calculé:</translation>
</message>
<message>
<location filename="../../OtsuFilter.cpp" line="59"/>
<location filename="../../OtsuFilter.cpp" line="62"/>
<source>?</source>
<translation>?</translation>
</message>
<message>
<location filename="../../OtsuFilter.cpp" line="59"/>
<location filename="../../OtsuFilter.cpp" line="62"/>
<source>The computed threshold found by the Otsu filter.
This property is read only and only updated after applying the action on a component.</source>
<translation>Le seuil calculé trouvé par le filtre Otsu.
La propriété est read only et only updated aprés l&apos;application de l&apos;action sur un component.</translation>
</message>
<message>
<location filename="../../OtsuFilter.cpp" line="64"/>
<location filename="../../OtsuFilter.cpp" line="67"/>
<source>Inside value</source>
<translation>Valeur intérieure</translation>
</message>
<message>
<location filename="../../OtsuFilter.cpp" line="64"/>
<location filename="../../OtsuFilter.cpp" line="67"/>
<source>The scalar type value assigned to voxels which have their scalar type BELOW the threshold value.</source>
<translation>La valeur du type scalaire assignée aux voxels qui ont leur type scalaire en dessous de la valeur de seuil.</translation>
</message>
<message>
<location filename="../../OtsuFilter.cpp" line="70"/>
<location filename="../../OtsuFilter.cpp" line="73"/>
<source>Outside value</source>
<translation>Valeur extérieure</translation>
</message>
<message>
<location filename="../../OtsuFilter.cpp" line="70"/>
<location filename="../../OtsuFilter.cpp" line="73"/>
<source>The scalar type value assigned to voxels which have their scalar type ABOVE the threshold value.</source>
<translation>La valeur du type scalaire assignée aux voxels qui ont leur type scalaire au-dessus de la valeur de seuil. </translation>
</message>
......
......@@ -27,39 +27,39 @@
<context>
<name>OtsuFilter</name>
<message>
<location filename="../../OtsuFilter.cpp" line="59"/>
<location filename="../../OtsuFilter.cpp" line="62"/>
<source>Computed threshold:</source>
<translation>Seuil calculé:</translation>
</message>
<message>
<location filename="../../OtsuFilter.cpp" line="59"/>
<location filename="../../OtsuFilter.cpp" line="62"/>
<source>?</source>
<translation>?</translation>
</message>
<message>
<location filename="../../OtsuFilter.cpp" line="59"/>
<location filename="../../OtsuFilter.cpp" line="62"/>
<source>The computed threshold found by the Otsu filter.
This property is read only and only updated after applying the action on a component.</source>
<translation>Le seuil calculé trouvé par le filtre Otsu.
La propriété est read only et only updated aprés l&apos;application de l&apos;action sur un component.</translation>
</message>
<message>
<location filename="../../OtsuFilter.cpp" line="64"/>
<location filename="../../OtsuFilter.cpp" line="67"/>
<source>Inside value</source>
<translation>Valeur intérieure</translation>
</message>
<message>
<location filename="../../OtsuFilter.cpp" line="64"/>
<location filename="../../OtsuFilter.cpp" line="67"/>
<source>The scalar type value assigned to voxels which have their scalar type BELOW the threshold value.</source>
<translation>La valeur du type scalaire assignée aux voxels qui ont leur type scalaire en dessous de la valeur de seuil.</translation>
</message>
<message>
<location filename="../../OtsuFilter.cpp" line="70"/>
<location filename="../../OtsuFilter.cpp" line="73"/>
<source>Outside value</source>
<translation>Valeur extérieure</translation>
</message>
<message>
<location filename="../../OtsuFilter.cpp" line="70"/>
<location filename="../../OtsuFilter.cpp" line="73"/>
<source>The scalar type value assigned to voxels which have their scalar type ABOVE the threshold value.</source>
<translation>La valeur du type scalaire assignée aux voxels qui ont leur type scalaire au-dessus de la valeur de seuil. </translation>
</message>
......
......@@ -8,6 +8,11 @@ set(CAMITK_DIR ${CMAKE_BINARY_DIR})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CAMITK_DIR}/share/${CAMITK_SHORT_VERSION_STRING}/cmake)
include(CamiTKConfig)
# Sofa support is defined in separate files
include(SofaSupport.cmake)
# uncomment the following line for old versions of sofa: at your own risk!
#include(SofaLegacySupport.cmake)
camitk_extension_project(NAME "modeling"
CONTACT "Celine.Fouard@imag.fr,Emmanuel.Promayon@imag.fr"
DESCRIPTION "The modeling CamiTK Extension Project contains all the action and component extensions that are useful for biomechanical processing. It provides the LML, PML and MML libraries, and the related components and actions."
......
# Old Legacy support for Sofa, not supported
# "find" SOFA (you need to have a SOFA_DIR environment variable
# or to define it manually during configuration process)
set(SOFA_DIR $ENV{SOFA_DIR} CACHE PATH "Where to find SOFA (for SOFA svn, this is the build directory)")
if(EXISTS ${SOFA_DIR})
# Compile SOFA .scn import filter? (ON or OFF)
option(SOFA_SUPPORT "Compile SOFA Simulator?" ON)
endif(EXISTS ${SOFA_DIR})
# sofa settings
# previous versions of Sofa
# support for any other version of SOFA is not guaranted.
# Previous versions of Sofa were supported in previous version of CamiTK:
# - sofa svn version (or initial git version up to november 2014) -> CamiTK 3.4.0
# - sofa 1.0 RC1 from the sofa website -> CamiTK 3.x up to 3.3
# - the old sofa beta 4 from the debian repository -> CamiTK 2.x
if(SOFA_SUPPORT)
# unsupported previous versions
# use at your own risk, no guarantee what so ever!
add_definitions(-DSOFA_SUPPORT)
add_definitions(-DSOFA_PATH="${SOFA_DIR}")
option(MML_SOFA_SVN "Set to ON (default) if SOFA svn build dir is available in ${SOFA_DIR}" ON)
option(MML_SOFA_1_0_RC1 "Set to ON if SOFA 1.0 RC1 is available in ${SOFA_DIR}" OFF)
option(MML_SOFA_1_0_BETA4 "Set to if SOFA 1.0 beta 4 is available in ${SOFA_DIR}" OFF)
# compilation flag
if (MML_SOFA_SVN)
# include and everything else needed => path to source tree needed
# automatically get the value of CMAKE_SOURCE_DIR in the build directory toplevel Makefile
# 1. Get the correct line from the CMakeCache file
file(STRINGS ${SOFA_DIR}/CMakeCache.txt SOFA_SOURCE_DIR_LINE REGEX "^Sofa_SOURCE_DIR:STATIC=(.*)$")
# 2. Use a regex to extract the path from the line
string(REGEX REPLACE "^Sofa_SOURCE_DIR:STATIC=(.*)$" "\\1" SOFA_SOURCE_DIR "${SOFA_SOURCE_DIR_LINE}")
message("Detected sofa source directory is ${SOFA_SOURCE_DIR}")
add_definitions(-DSOFA_SVN)
endif()
if (MML_SOFA_1_0_RC1)
add_definitions(-DSOFA_1_0_RC1)
endif()
if (MML_SOFA_1_0_BETA4)
add_definitions(-DSOFA_1_0_BETA4)
endif()
# library settings depends on the sofa version
if (MML_SOFA_SVN)
set(SOFA_LIBS
# SOFA_LIB_NAME
#SofaGui
#SofaTree
SofaCore
SofaGuiQt
SofaHelper
SofaGuiGlut
SofaGuiMain
#SofaModeler
#SofaSimulation
#SofaObjectCreator
SofaDefaultType
#SofaGraph
# SOFA_LIB_COMPONENT_NAME
#SofaComponent
#SofaComponentDev
SofaComponentBase
SofaComponentMisc
SofaComponentCommon
SofaComponentGeneral
#SofaComponentMiscDev
SofaComponentAdvanced
#SofaComponentAdvancedDev
# SOFA_LIB_BASE_NAME
SofaBaseAnimationLoop
SofaBaseCollision
SofaBaseLinearSolver
SofaBaseMechanics
SofaBaseTopology
SofaBaseVisual
# SOFA_LIB_GENERAL_NAME
SofaBoundaryCondition
SofaConstraint
SofaDenseSolver
SofaEngine
SofaExporter
SofaGraphComponent
SofaOpenglVisual
SofaPreconditioner
SofaTopologyMapping
SofaUserInteraction
SofaValidation
SofaHaptics
# SOFA_LIB_ADVANCED_NAME
#SofaAdvancedConstraint
#SofaAdvancedFem
#SofaAdvancedInteraction
SofaEigen2Solver
SofaEulerianFluid
#SofaMjedFem
SofaNonUniformFem
#SofaNonUniformFemDev
SofaSphFluid
SofaVolumetricData
# SOFA_LIB_MISC_NAME
SofaMisc
SofaMiscCollision
#SofaMiscCollisionDev
SofaMiscFem
#SofaMiscDev
#SofaMiscFemDev
SofaMiscForceField
#SofaMiscForcefieldDev
SofaMiscMapping
#SofaMiscMappingDev
SofaMiscSolver
#SofaMiscSolverDev
SofaMiscTopology
#SofaMiscTopologyDev
SofaMiscEngine
)
set(SOFA_LIB_DIR ${SOFA_DIR}/lib)
endif()
if (MML_SOFA_1_0_RC1)
# old sofa RC1 from the tarballs
if(WIN32)
set(SOFA_LIB_DIR ${SOFA_DIR}/lib/win32/ReleaseVC9 ${SOFA_DIR}/lib/win32 ${SOFA_DIR}/lib ${SOFA_DIR}/bin )
else()
set(SOFA_LIB_DIR ${SOFA_DIR}/lib/linux ${SOFA_DIR}/lib)
endif()
# set dependencies
set(SOFA_LIBS sofacore #sofa_component_dev
#sofa_component_advanced_dev sofa_component_misc_dev
sofa_component
#sofa_non_uniform_fem_dev
#sofa_advanced_fem
#sofa_mjed_fem
#sofa_advanced_constraint
#sofa_advanced_interaction
#sofa_misc_topology_dev
#sofa_misc_mapping_dev
#sofa_misc_forcefield_dev
#sofa_misc_fem_dev
#sofa_misc_collision_dev
#sofa_misc_solver_dev
#sofa_misc_dev
sofa_exporter sofa_loader sofa_misc_forcefield sofa_component_base sofa_component_common sofa_component_general sofa_component_advanced sofa_component_misc sofahelper sofa_engine sofa_sph_fluid sofa_non_uniform_fem sofa_base_topology sofa_boundary_condition sofa_haptics sofa_constraint sofatree sofa_base_linear_solver sofa_implicit_ode_solver sofa_simple_fem sofa_topology_mapping sofa_user_interaction sofa_misc_collision sofa_preconditioner sofa_misc_topology sofa_mesh_collision sofa_volumetric_data
#sofabgl
sofa_base_collision sofa_deformable sofa_graph_component sofa_base_mechanics sofa_rigid sofa_base_animation_loop sofa_object_interaction sofa_explicit_ode_solver sofa_eigen2_solver sofa_validation sofa_dense_solver sofa_eulerian_fluid sofa_misc_mapping sofa_misc_fem sofa_misc_engine sofa_misc_solver sofa_misc
sofa_base_visual #-lnewmat -lGLEW -lpng
sofasimulation #-lminiFlowVR
sofacore #-ltinyxml
sofadefaulttype #-lQt3Support -lQtOpenGL -lQtGui -lQtCore -lGLU -lGL -lpthread
sofamodeler
)
endif()
if(MML_SOFA_1_0_BETA4)
# Sofa1.0beta4 from the package
set(SOFA_LIBS sofacore sofacomponent sofasimulation sofatree sofahelper sofadefaulttype)
endif()
# add debug suffix (TODO update for SOFA SVN)
if(WIN32)
if( CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo" )
set(SOFA_LIBS_WIN32 ${SOFA_LIBS})
set(SOFA_LIBS)
if(MML_SOFA_1_0_RC1)
set(SOFA_VERSION_SUFFIX "_1_0d")
endif()
if(MML_SOFA_1_0_BETA4)
set(SOFA_VERSION_SUFFIX "d")
endif()
foreach(SOFA_LIB ${SOFA_LIBS_WIN32})
set(SOFA_LIBS ${SOFA_LIBS} ${SOFA_LIB}${SOFA_VERSION_SUFFIX})
endforeach()
endif()
endif()
# SOFA include directories
# use sofa source directory for sofa svn version
if (MML_SOFA_SVN)
set(SOFA_INCLUDE_DIR ${SOFA_SOURCE_DIR}/include ${SOFA_SOURCE_DIR}/modules ${SOFA_SOURCE_DIR}/framework
${SOFA_SOURCE_DIR}/extlibs/miniBoost ${SOFA_SOURCE_DIR}/include/modules
${SOFA_SOURCE_DIR}/include/framework ${SOFA_SOURCE_DIR}/include/extlibs/miniBoost
${SOFA_SOURCE_DIR}/extlibs/tinyxml )
endif()
if (MML_SOFA_1_0_BETA4 OR MML_SOFA_1_0_RC1)
# includes
set(SOFA_INCLUDE_DIR ${SOFA_DIR}/include ${SOFA_DIR}/modules ${SOFA_DIR}/framework
${SOFA_DIR}/extlibs/miniBoost ${SOFA_DIR}/include/modules
${SOFA_DIR}/include/framework ${SOFA_DIR}/include/extlibs/miniBoost )
endif()
endif()
#
# Sofa support in MML
#
# Note that only MML_SOFA_STABLE is currently/actively supported
#
# This file defines the following variables:
# - SOFA_SUPPORTED_VERSION the name of the currently supported Sofa stable version
# this is equal to the git tag
# - SOFA_DIR To be set by the user to the Sofa build directory
# This is mandatory to have the Sofa support
#
# If Sofa support is enabled by the user by setting the build directory,
# the following variables are defined:
# - SOFA_SUPPORT Set to ON
# - SOFA_SOURCE_DIR The top-level directory of the Sofa source.
# Automatically extracted/hacked from the CMakeCache.txt in the
# build directory
# - SOFA_LIBS List of Sofa libraries to link against needed at link time
# - SOFA_LIB_DIR Directory where to find the compiled Sofa libraries
# - SOFA_INCLUDE_DIR Sofa include directories needed a compile time
#
# If Sofa support is enabled by the user by setting the build directory,
# the following flags are defined:
# -DSOFA_SUPPORT
# -DSOFA_PATH="${SOFA_DIR}"
# -DSOFA_STABLE
# list of possibly supported sofa STABLE version
# Only stable version are supported in MML
set(SOFA_STABLE_V15_03 "sofa-v15.03")
# The currently supported Sofa version
# Only stable version are supported in MML
# To support a new version, add a new SOFA_STABLE_V... above and modify this
set(SOFA_SUPPORTED_VERSION ${SOFA_STABLE_V15_03})
# "find" SOFA (you need to have a SOFA_DIR environment variable
# or to define it manually during configuration process)
set(SOFA_DIR $ENV{SOFA_DIR} CACHE PATH "Where to find SOFA (stable) ${SOFA_SUPPORTED_VERSION} build directory")
if(EXISTS ${SOFA_DIR})
# Compile SOFA .scn import filter? (ON or OFF)
option(SOFA_SUPPORT "Compile SOFA MML Simulator?" ON)
endif()
# sofa settings
if(SOFA_SUPPORT)
add_definitions(-DSOFA_SUPPORT)
add_definitions(-DSOFA_PATH="${SOFA_DIR}")
# supported stable version 15.03
if (SOFA_SUPPORTED_VERSION STREQUAL "${SOFA_STABLE_V15_03}")
message(STATUS "SOFA support on (supporting ${SOFA_SUPPORTED_VERSION})")
# TODO one day when Sofa includes an install phase and FindSofa.cmake, everything should be easier:
# # use Find SOFA script
# set(SOFA_DIR ${SOFA_SOURCE_DIR})
# include(${SOFA_DIR}/cmake/Modules/FindSOFA.cmake)
# list(APPEND CMAKE_MODULE_PATH "${SOFA_DIR}/cmake/Modules")
# find_package(SOFA)
# # Check the FindSofa.cmake and "translate" all their variables here
# set(SOFA_INCLUDE_DIR ${SOFA_INCLUDE_DIRS})
# set(SOFA_LIBS ${SOFA_LIB_CORE}
# ${SOFA_LIB_HELPER}
# ${SOFA_LIB_DEFAULT_TYPE})
# For now, lets trick it!
# Problem with the current way Sofa uses cmake:
# - there is no install procedure
# - everything needed at MML compile-time (headers mainly) are to be found in the source directory
# - everything needed at MML link-time (lib mainly) are to be found in the build directory
# The hack to solve this consists in parsing the CMakeCache file (which is in the build directory toplevel)
# to automatically get the value the source directory (in the CMAKE_SOURCE_DIR variable)
# So here it is in two steps
# 1. Get the correct line from the CMakeCache file
file(STRINGS ${SOFA_DIR}/CMakeCache.txt SOFA_SOURCE_DIR_LINE REGEX "^Sofa_SOURCE_DIR:STATIC=(.*)$")
# 2. Use a regex to extract the path from the line
string(REGEX REPLACE "^Sofa_SOURCE_DIR:STATIC=(.*)$" "\\1" SOFA_SOURCE_DIR "${SOFA_SOURCE_DIR_LINE}")
message("Detected Sofa ${MML_SOFA_STABLE} source directory is ${SOFA_SOURCE_DIR}")
add_definitions(-DSOFA_STABLE)
# fill the list of needed libraries
set(SOFA_LIBS
# SOFA_LIB_NAME
#SofaGui
#SofaTree
SofaCore
SofaGuiQt
SofaHelper
SofaGuiGlut
SofaGuiMain
#SofaModeler
#SofaSimulation
#SofaObjectCreator
SofaDefaultType
#SofaGraph
# SOFA_LIB_COMPONENT_NAME
#SofaComponent
#SofaComponentDev
SofaComponentBase
SofaComponentMisc
SofaComponentCommon
SofaComponentGeneral
#SofaComponentMiscDev
SofaComponentAdvanced
#SofaComponentAdvancedDev
# SOFA_LIB_BASE_NAME
SofaBaseAnimationLoop
SofaBaseCollision
SofaBaseLinearSolver
SofaBaseMechanics
SofaBaseTopology
SofaBaseVisual
# SOFA_LIB_GENERAL_NAME
SofaBoundaryCondition
SofaConstraint
SofaDenseSolver
SofaEngine
SofaExporter
SofaGraphComponent
SofaOpenglVisual
SofaPreconditioner
SofaTopologyMapping
SofaUserInteraction
SofaValidation
SofaHaptics
# SOFA_LIB_ADVANCED_NAME
#SofaAdvancedConstraint
#SofaAdvancedFem
#SofaAdvancedInteraction
SofaEigen2Solver
SofaEulerianFluid
#SofaMjedFem
SofaNonUniformFem
#SofaNonUniformFemDev
SofaSphFluid
SofaVolumetricData
# SOFA_LIB_MISC_NAME
SofaMisc
SofaMiscCollision
#SofaMiscCollisionDev
SofaMiscFem
#SofaMiscDev
#SofaMiscFemDev
SofaMiscForceField
#SofaMiscForcefieldDev
SofaMiscMapping
#SofaMiscMappingDev
SofaMiscSolver
#SofaMiscSolverDev
SofaMiscTopology
#SofaMiscTopologyDev
SofaMiscEngine
)
# Library path
set(SOFA_LIB_DIR ${SOFA_DIR}/lib)
# fill in the required include path
# use sofa source directory for sofa stable version
set(SOFA_INCLUDE_DIR ${SOFA_SOURCE_DIR}/include
${SOFA_SOURCE_DIR}/modules
${SOFA_SOURCE_DIR}/framework
${SOFA_SOURCE_DIR}/extlibs/miniBoost
${SOFA_SOURCE_DIR}/include/modules
${SOFA_SOURCE_DIR}/include/framework
${SOFA_SOURCE_DIR}/include/extlibs/miniBoost
${SOFA_SOURCE_DIR}/extlibs/tinyxml
)
endif()
endif()
......@@ -46,6 +46,7 @@
#include <QFileInfo>
#include <QDateTime>
#include <QFileDialog>
#include <QMessageBox>
using namespace camitk;
......@@ -234,32 +235,36 @@ void GenerateModel::saveMMLFiles( QString baseFilename ) {
// this hack should become a call to a static method to transform a sofa scn to a pml
MonitoringManager *mml = MonitoringManagerFactory::createManager( mmlFilename.toStdString().c_str() );
// Modify mml to use pml file instead of sofa
mmlIn.simulatorFile().reset();
mmlIn.pmlFile( pmlFilename.toStdString().c_str() );
// reopen for rewrite
mmlofs.open( mmlFilename.toStdString().c_str(), std::ios_base::trunc );
mml::monitoringIn( mmlofs, mmlIn, map );
mmlofs.close();
if (mml != NULL) {
// Modify mml to use pml file instead of sofa
mmlIn.simulatorFile().reset();
mmlIn.pmlFile( pmlFilename.toStdString().c_str() );
// reopen for rewrite
mmlofs.open( mmlFilename.toStdString().c_str(), std::ios_base::trunc );
mml::monitoringIn( mmlofs, mmlIn, map );
mmlofs.close();
// Modify the pml to have the selected nodes fixed
QString completePmlFilename = baseFilename + "-model.pml";
PhysicalModel *pml = new PhysicalModel( completePmlFilename.toStdString().c_str() );
// add the informative components containing the fixed dof
if (fixedDOFIndex.size()>0 && property( "Selection Is Constrained" ).toBool() ) {
StructuralComponent *fixedDof = new StructuralComponent( pml, "Fixed Dof" );
std::set<int>::const_iterator pos;
for( pos = fixedDOFIndex.begin(); pos != fixedDOFIndex.end(); ++pos )
fixedDof->addStructure( pml->getAtom( *pos ) );
pml->getInformativeComponents()->addSubComponent( fixedDof );
}
// Modify the pml to have the selected nodes fixed
QString completePmlFilename = baseFilename + "-model.pml";
PhysicalModel *pml = new PhysicalModel( completePmlFilename.toStdString().c_str() );
// reopen for rewrite
ofstream pmlofs( completePmlFilename.toStdString().c_str(), std::ios_base::trunc );
pml->xmlPrint( pmlofs );
pmlofs.close();
// add the informative components containing the fixed dof
if (fixedDOFIndex.size()>0 && property( "Selection Is Constrained" ).toBool() ) {
StructuralComponent *fixedDof = new StructuralComponent( pml, "Fixed Dof" );
std::set<int>::const_iterator pos;
for( pos = fixedDOFIndex.begin(); pos != fixedDOFIndex.end(); ++pos )
fixedDof->addStructure( pml->getAtom( *pos ) );
pml->getInformativeComponents()->addSubComponent( fixedDof );
Application::open( mmlFilename );
}
// reopen for rewrite
ofstream pmlofs( completePmlFilename.toStdString().c_str(), std::ios_base::trunc );
pml->xmlPrint( pmlofs );
pmlofs.close();
Application::open( mmlFilename );
else
QMessageBox::warning(NULL,"Generating Error", "Problem while generating the model<br/>Sofa Simulator not supported");
}
# if component MML is on, then mml gui is also needed
if(COMPONENT_MML)
set(MML_GENERATE_GUI ON CACHE BOOL "Forced by COMPONENT_MML" FORCE)
#FIXME Sofa support => fix sofa dependency properly
if(MML_SOFA_SUPPORT)
if(WIN32)
set(MML_SOFA_LIB_DIR ${MML_SOFA_DIR}/lib/win32/ReleaseVC9 ${MML_SOFA_DIR}/lib/win32 ${MML_SOFA_DIR}/lib ${MML_SOFA_DIR}/bin)
else()
set(MML_SOFA_LIB_DIR ${MML_SOFA_DIR}/lib/linux ${MML_SOFA_DIR}/lib)
endif()
link_directories(${MML_SOFA_LIB_DIR})
endif()
endif()
camitk_extension( COMPONENT_EXTENSION
......
......@@ -55,6 +55,7 @@ MMLComponent::MMLComponent(const QString & fileName) throw(AbortException) : Com
// initialize the MML export file name
exportedMml = "";
// create a simple MML from a Sofa scn file
if (fi.completeSuffix() == "scn") {
file = /*QFileInfo(fi).absolutePath() */ QDir::tempPath() + "/" + QFileInfo(fi).baseName() + ".mml";
......@@ -82,17 +83,31 @@ MMLComponent::MMLComponent(const QString & fileName) throw(AbortException) : Com
}
mmlGUI = new MonitoringGuiManager;
mmlGUI->getDialog()->hide();
display = new MMLDisplay(this);
//mmlDock = new QDockWidget(fi.baseName(), Application::getMainWindow());
//mmlDock->setAllowedAreas(Qt::RightDockWidgetArea);
//mmlDock->setWidget(mmlGUI->getDialog());
//Application::getMainWindow()->addDockWidget(Qt::RightDockWidgetArea, mmlDock);
mmlGUI->loadMmlInFile(file);
// in order to give the ownership of the pml pointer to the PMManagerDC, we need to use takePml() not getPml()
pmMgr = new PMManagerDC( mmlGUI->getMonitoringManager()->takePml(), mmlGUI->getMonitoringManager()->getPmlFileName().c_str());
// in order to give the ownership of the lml pointer to the LoadsManager of the PMManagerDC, we need to use takeLml() not getLml()
pmM