Commit c68f9b7e authored by promayon's avatar promayon
Browse files

BUG 23 https://bugzilla-timc.imag.fr/show_bug.cgi?id=23

FIXED crash with the new reorient image action when running from a CEP build. Core::getTestDataDir() only get the first valid test data dir. The fist valid one is the one is in the build directory, which is OK for the opensource CEP set (build = install), but wrong when working on any other CEP)
FIXED crash when using the mesh cliping on PML Component (PhysicalModelDC does not have any representation)
NEW update MML component to work with latest svn SOFA version  (from svn://scm.gforge.inria.fr/svnroot/sofa/trunk/Sofa ). This is now the default

git-svn-id: svn+ssh://scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/svn/camitk/trunk/camitk@1582 ec899d31-69d1-42ba-9299-647d76f65fb3
parent e53212d9
......@@ -154,3 +154,15 @@ void ComponentDC::updateProperty(QString name, QVariant value) {
Component::updateProperty(name, value);
}
// -------------------- getPointSet --------------------
vtkSmartPointer< vtkPointSet > ComponentDC::getPointSet() {
vtkSmartPointer<vtkPointSet> firstNonNullPointSet = NULL;
unsigned int i=0;
while(i<getChildren().size() && firstNonNullPointSet==NULL) {
firstNonNullPointSet = getChildren().at(i)->getPointSet();
i++;
}
return firstNonNullPointSet;
}
......@@ -64,6 +64,9 @@ public:
/// remove a sub DC: overloaded method to avoir deletion of children that are used in more than one SCDC (that have more than one parent)
virtual void deleteChildren() {}
/// return the first non-null subcomponent point set
virtual vtkSmartPointer< vtkPointSet > getPointSet();
///@}
/// return the component that this dc is managing
......
......@@ -48,6 +48,7 @@ using namespace camitk;
//-- Vtk
#include <vtkUnstructuredGrid.h>
#include <boost/graph/graph_concepts.hpp>
// -------------------- default constructor --------------------
PMManagerDC::PMManagerDC(const QString &fileName) throw(AbortException) : MeshComponent(fileName) {
......@@ -404,3 +405,21 @@ void PMManagerDC::computeBoundingRadius() {
initialBoundingRadius = sqrt(xLength * xLength + yLength * yLength + zLength * zLength) / 2.0;
}
// --------------- getPointSet -------------------
vtkSmartPointer< vtkPointSet > PMManagerDC::getPointSet() {
vtkSmartPointer< vtkPointSet > firstPointSet=NULL;
// check the exclusive components first
MultiComponentDC *componentsDC = getDC(myPM->getExclusiveComponents());
if (componentsDC)
firstPointSet = componentsDC->getPointSet();
// check the informative components then
if (firstPointSet == NULL) {
componentsDC = getDC(myPM->getInformativeComponents());
if (componentsDC)
firstPointSet = componentsDC->getPointSet();
}
return firstPointSet;
}
......@@ -185,6 +185,9 @@ public:
/// add the A/DC pair
void addAtomDCPair(std::AtomDCPair);
/// get the first non null point set (PMManagerDC has not representation), first check the informative components, then the exclusive components
virtual vtkSmartPointer< vtkPointSet > getPointSet();
///@}
///@name Misc
......
......@@ -29,23 +29,141 @@ endif(EXISTS ${MML_SOFA_DIR})
# sofa settings
if(MML_SOFA_SUPPORT)
option(MML_SOFA_1_0_RC1 "Set to ON (default) if Sofa 1.0 RC1 is available in ${MML_SOFA_DIR}" ON)
if(MML_SOFA_1_0_RC1)
add_definitions(-DSOFA_1_0_RC1)
endif()
# compilation flag
add_definitions(-DSOFA_SUPPORT)
add_definitions(-DSOFA_PATH="${MML_SOFA_DIR}")
# library settings
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(WIN32)
set(MML_SOFA_LIB_DIR ${MML_SOFA_DIR}/lib/linux ${MML_SOFA_DIR}/lib)
endif(WIN32)
if(NOT MML_SOFA_1_0_RC1)
# Sofa1.0 from svn branch
set(MML_SOFA_LIBS sofacore sofacomponent sofasimulation sofatree sofahelper sofadefaulttype)
else()
# support multiple version of Sofa. Two version are possible:
# sofa svn version, the sofa 1.0 RC1 from the sofa website or the old sofa beta 4 from the debian repository
option(MML_SOFA_SVN "Set to ON (default) if Sofa svn is available in ${MML_SOFA_DIR}" ON) # latest
option(MML_SOFA_1_0_RC1 "Set to ON if Sofa 1.0 RC1 is available in ${MML_SOFA_DIR}" OFF)
option(MML_SOFA_1_0_BETA4 "Set to if Sofa 1.0 beta 4 is available in ${MML_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 ${MML_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)
# 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(MML_SOFA_INCLUDE_DIR ${SOFA_INCLUDE_DIRS})
# set(MML_SOFA_LIBS ${SOFA_LIB_CORE}
# ${SOFA_LIB_HELPER}
# ${SOFA_LIB_DEFAULT_TYPE})
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(MML_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(MML_SOFA_LIB_DIR ${MML_SOFA_DIR}/lib)
endif()
if (MML_SOFA_1_0_RC1)
# old sofa RC1 from the tarballs
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()
# set dependencies
set(MML_SOFA_LIBS sofacore #sofa_component_dev
#sofa_component_advanced_dev sofa_component_misc_dev
sofa_component
......@@ -71,25 +189,46 @@ if(MML_SOFA_SUPPORT)
sofamodeler
)
endif()
# add debug suffix
if(MML_SOFA_1_0_BETA4)
# Sofa1.0beta4 from the package
set(MML_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(MML_SOFA_LIBS_WIN32 ${MML_SOFA_LIBS})
set(MML_SOFA_LIBS)
if(MML_SOFA_1_0_RC1)
set(SOFA_VERSION_SUFFIX "_1_0d")
else()
set(SOFA_VERSION_SUFFIX "d")
endif()
if(MML_SOFA_1_0_BETA4)
set(SOFA_VERSION_SUFFIX "d")
endif()
foreach(SOFA_LIB ${MML_SOFA_LIBS_WIN32})
set(MML_SOFA_LIBS ${MML_SOFA_LIBS} ${SOFA_LIB}${SOFA_VERSION_SUFFIX})
endforeach()
endif()
endif()
# includes
set(MML_SOFA_INCLUDE_DIR ${MML_SOFA_DIR}/include ${MML_SOFA_DIR}/modules ${MML_SOFA_DIR}/framework
${MML_SOFA_DIR}/extlibs/miniBoost ${MML_SOFA_DIR}/include/modules
${MML_SOFA_DIR}/include/framework ${MML_SOFA_DIR}/include/extlibs/miniBoost )
# Sofa include directories
# use sofa source directory for sofa svn version
if (MML_SOFA_SVN)
set(MML_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(MML_SOFA_INCLUDE_DIR ${MML_SOFA_DIR}/include ${MML_SOFA_DIR}/modules ${MML_SOFA_DIR}/framework
${MML_SOFA_DIR}/extlibs/miniBoost ${MML_SOFA_DIR}/include/modules
${MML_SOFA_DIR}/include/framework ${MML_SOFA_DIR}/include/extlibs/miniBoost )
endif()
if(MML_GENERATE_GUI)
set(sofa_MOC_SRCS
simulator/simulators/Sofa/SofaWidget.h
......
......@@ -182,7 +182,7 @@ SofaSimulator::SofaSimulator(MonitoringManager* monitoringManager): InteractiveS
// 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);
#ifdef SOFA_1_0_RC1
#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;
scn << "<Node name=\"Root\" gravity=\"0 0 0\" dt=\"" << monitoringManager->getDt() << "\" >" << endl;
......@@ -218,7 +218,9 @@ SofaSimulator::SofaSimulator(MonitoringManager* monitoringManager): InteractiveS
}
scn << " </Node>" << endl;
scn << "</Node>" << endl;
#else
#endif
#ifdef MML_SOFA_1_0_BETA4
scn << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl;
scn << "<Node name=\"root\" gravity=\"0 0 0\" dt=\"" << monitoringManager->getDt() << "\" showBehaviorModels=\"0\" showCollisionModels=\"0\" showMappings=\"0\" showForceFields=\"0\">" << endl;
scn << " <Node name=\"MML\" gravity=\"0 0 0\" depend=\"topo dofs\">" << endl;
......@@ -297,7 +299,7 @@ SofaSimulator::~SofaSimulator() {
// -------------------- build --------------------
void SofaSimulator::build() {
#ifdef SOFA_1_0_RC1
#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());
......@@ -309,36 +311,37 @@ void SofaSimulator::build() {
*/
#endif
#ifdef MML_SOFA_1_0_BETA4
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
#ifdef SOFA_1_0_RC1
#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()));
//RC1 groot = sofa::core::objectmodel::SPtr_dynamic_cast<sofa::simulation::Node>(sofa::simulation::getSimulation()->load(scnFile.c_str()));
#else
#endif
#ifdef MML_SOFA_1_0_BETA4
groot = dynamic_cast<sofa::simulation::Node*>( sofa::simulation::getSimulation()->load(scnFile.c_str()));
#endif
if (getGNode()==NULL) {
#ifdef SOFA_1_0_RC1
#if defined(SOFA_1_0_RC1) || defined(SOFA_SVN)
groot = sofa::simulation::tree::getSimulation()->createNewGraph("");
#else
#endif
#ifdef MML_SOFA_1_0_BETA4
groot = sofa::simulation::getSimulation()->newNode("");
#endif
cerr << "SofaSimulator::build: error: cannot load " << scnFile << "." << endl;
}
/*if (!verif.empty())
{
loadVerificationData(verif, fileName, groot);
}*/
// init root
sofa::simulation::tree::getSimulation()->init(getGNode());
......
......@@ -131,9 +131,11 @@ private:
void buildConstraints();
/// the sofa graph node root
#ifdef SOFA_1_0_RC1
#if defined(SOFA_1_0_RC1) || defined(SOFA_SVN)
sofa::simulation::Node::SPtr groot;
#else
#endif
#ifdef MML_SOFA_1_0_BETA4
sofa::simulation::Node* groot;
#endif
......@@ -162,9 +164,11 @@ inline sofa::simulation::Node* SofaSimulator::getGNode() {
//-- TODO build a sofaGRoot using the nodes
}
#ifdef SOFA_1_0_RC1
#if defined(SOFA_1_0_RC1) || defined(SOFA_SVN)
return groot.get();
#else
#endif
#ifdef MML_SOFA_1_0_BETA4
return groot;
#endif
}
......
......@@ -113,25 +113,55 @@ ReorientImage::ReorientImage(ActionExtension* extension) : Action(extension) {
internalViewer = NULL;
}
// --------------- destructor -------------------
ReorientImage::~ReorientImage() {
internalViewer->getRendererWidget()->removeProp(femaleModel->getActor(InterfaceGeometry::Surface));
internalViewer->getRendererWidget()->removeProp(maleModel->getActor(InterfaceGeometry::Surface));
internalViewer->getRendererWidget()->removeProp(modelBoundingBox->getActor(InterfaceGeometry::Wireframe));
internalViewer->getRendererWidget()->removeProp(axes);
internalViewer->getRendererWidget()->removeProp(annotatedCube);
axes = NULL;
annotatedCube = NULL;
modelBoundingBox = NULL;
femaleModel = NULL;
maleModel = NULL;
if (dialog != NULL) {
delete dialog;
}
}
// --------------- buildGeometries -------------------
void ReorientImage::buildGeometries() {
QString testDataDir = Core::getTestDataDir();
// check for the CamiTK test data dir (not the first valid one, but the right one, i.e., the one that contains
// the VTK files needed for this action)
// => TODO use Qt resource files
QStringList testDataDirectories = Core::getInstallDirectories("share/" + QString(Core::shortVersion) + "/testdata");
int i=0;
bool foundVtkFiles=false;
QDir globalTestDir;
while (i<testDataDirectories.size() && !foundVtkFiles) {
globalTestDir = QDir(testDataDirectories.at(i));
foundVtkFiles = globalTestDir.exists("ImageBoundingBox.vtk") && globalTestDir.exists("male.vtk") && globalTestDir.exists("female.vtk");
i++;
}
QString boundingBoxFilename = testDataDir + "/ImageBoundingBox.vtk";
QString boundingBoxFilename = globalTestDir.canonicalPath() + "/imageBoundingBox.vtk";
modelBoundingBox = VtkMeshUtil::vtkToGeometry(boundingBoxFilename.toStdString());
modelBoundingBox->setRenderingModes(InterfaceGeometry::Wireframe);
QString maleModelFilename = testDataDir + "/male.vtk";
maleModel = VtkMeshUtil::vtkToGeometry(maleModelFilename.toStdString());
QString maleModelFilename = globalTestDir.canonicalPath() + "/male.vtk";
maleModel = VtkMeshUtil::vtkToGeometry(maleModelFilename.toStdString());
maleModel->setColor(1.0, 0.75, 0.64);
QString femaleModelFilename = testDataDir + "/female.vtk";
femaleModel = VtkMeshUtil::vtkToGeometry(femaleModelFilename.toStdString());
QString femaleModelFilename = globalTestDir.canonicalPath() + "/female.vtk";
femaleModel = VtkMeshUtil::vtkToGeometry(femaleModelFilename.toStdString());
femaleModel->setColor(1.0, 0.75, 0.64);
}
// --------------- init -------------------
// --------------- initDialog -------------------
void ReorientImage::initDialog() {
dialog = new QDialog();
......@@ -177,7 +207,7 @@ void ReorientImage::initDialog() {
}
// --------------- initInternalViewer -------------------
void ReorientImage::initInternalViewer() {
// Set up the 3D viewer to visualize actual origin/orientation locations
internalViewer = InteractiveViewer::getNewViewer("Image Orientation Viewer", InteractiveViewer::GEOMETRY_VIEWER);
......@@ -192,7 +222,7 @@ void ReorientImage::initInternalViewer() {
}
// --------------- rcsChanged -------------------
void ReorientImage::rcsChanged(const QString index)
{
QChar xLetter = index.at(0);
......@@ -206,6 +236,7 @@ void ReorientImage::rcsChanged(const QString index)
setAxesOrientation(index);
}
// --------------- modelChanged -------------------
void ReorientImage::modelChanged(bool displayMaleModel)
{
if (displayMaleModel) {
......@@ -219,24 +250,6 @@ void ReorientImage::modelChanged(bool displayMaleModel)
internalViewer->refresh();
}
// --------------- destructor -------------------
ReorientImage::~ReorientImage() {
internalViewer->getRendererWidget()->removeProp(femaleModel->getActor(InterfaceGeometry::Surface));
internalViewer->getRendererWidget()->removeProp(maleModel->getActor(InterfaceGeometry::Surface));
internalViewer->getRendererWidget()->removeProp(modelBoundingBox->getActor(InterfaceGeometry::Wireframe));
internalViewer->getRendererWidget()->removeProp(axes);
internalViewer->getRendererWidget()->removeProp(annotatedCube);
axes = NULL;
annotatedCube = NULL;
modelBoundingBox = NULL;
femaleModel = NULL;
maleModel = NULL;
if (dialog != NULL) {
delete dialog;
}
}
// --------------- getWidget -------------------
QWidget * ReorientImage::getWidget() {
......@@ -256,7 +269,7 @@ Action::ApplyStatus ReorientImage::apply() {
return process(img);
}
// --------------- process -------------------
Action::ApplyStatus ReorientImage::process( ImageComponent * image)
{
if (image == NULL)
......@@ -324,7 +337,7 @@ Action::ApplyStatus ReorientImage::process( ImageComponent * image)
return SUCCESS;
}
// --------------- buildAxes -------------------
void ReorientImage::buildAxes()
{
//-- axes
......@@ -363,6 +376,7 @@ void ReorientImage::buildAxes()
axes->GetZAxisCaptionActor2D()->GetProperty()->SetDisplayLocationToBackground();
}
// --------------- buildCube -------------------
void ReorientImage::buildCube()
{
//-- annotated cube (right, left, anterior, posterior, inferior, superior)
......@@ -407,6 +421,7 @@ void ReorientImage::buildCube()
acProp->SetInterpolationToFlat();
}
// --------------- buildTransforms -------------------
void ReorientImage::buildTransforms()
{
axesTransform = vtkSmartPointer<vtkTransform>::New();
......@@ -430,7 +445,7 @@ void ReorientImage::buildTransforms()
}
// --------------- setAxesOrientation -------------------
void ReorientImage::setAxesOrientation(const QString orientationStr)
{
ImageOrientationHelper::PossibleImageOrientations orientation = ImageOrientationHelper::getOrientationAsEnum(orientationStr);
......
......@@ -28,12 +28,11 @@
#include "ReorientImage.h"
// --------------- declare the extension -------------------
Q_EXPORT_PLUGIN2(reorientimageextension, ReorientImageExtension);
Q_EXPORT_PLUGIN2 ( reorientimageextension, ReorientImageExtension );
// --------------- getActions -------------------
void ReorientImageExtension::init() {
// Creating and registering the instance of MoveFrame
registerNewAction(ReorientImage);
// Creating and registering the instance of MoveFrame
registerNewAction ( ReorientImage );
}
......@@ -117,6 +117,9 @@ QWidget *MeshClipping::getWidget() {
widget->planeWidget->ScaleEnabledOff();
widget->planeWidget->AddObserver(vtkCommand::EndInteractionEvent, this->widget);
}
else
// just update the box
updateBox(false);
if(planeVisibility) {
widget->planeWidget->EnabledOn();
......@@ -144,6 +147,8 @@ Action::ApplyStatus MeshClipping::apply() {
if(candidate->isInstanceOf("MeshComponent")) {
if(allComponents || candidate->isSelected()) {
clipMesh(dynamic_cast < MeshComponent * >(candidate), plane);
// make sure to remove the vtk Widget of the screen if the component dies
connect(candidate, SIGNAL(destroyed()), this, SLOT(meshDeleted()));
}
}
}
......@@ -159,6 +164,11 @@ Action::ApplyStatus MeshClipping::apply() {
return SUCCESS;
}
// --------------- meshDeleted -------------------
void MeshClipping::meshDeleted() {
widget->planeWidget->EnabledOff();
}
// --------------- customizeActionLayout -------------------
void MeshClipping::customizeActionLayout() {
QLayout *informationFrameLayout = Action::getWidget()->layout();
......@@ -203,6 +213,11 @@ void MeshClipping::customizeActionLayout() {
// --------------- updateBox -------------------
void MeshClipping::updateBox() {
updateBox(true);
}
// --------------- clipMesh -------------------
void MeshClipping::updateBox ( bool refreshViewer ) {
//-- Saving previous values for the plane normal and origin
double origin[3];
widget->planeWidget->GetOrigin(origin);
......@@ -236,14 +251,20 @@ void MeshClipping::updateBox() {
widget->planeWidget->SetNormal(normal);
widget->planeWidget->SetOrigin(origin);
widget->planeWidget->UpdatePlacement();
Application::refresh();