Commit 9cab1aef authored by Emmanuel Promayon's avatar Emmanuel Promayon

NEW API change + optimized InteractiveViewer refresh

Using Viewer* is deprecated. Using the viewer name untie the link
between viewers and component
The optimization consist in refreshing the interactive viewer only if its widget is visible
When the widget (InteractiveViewerFrame) becomes visible, the viewer is forced to refresh.
parent a72dc688
......@@ -36,11 +36,11 @@
#include "MMLMonitorDisplay.h"
#include <PMLComponent.h>
#include <InteractiveViewer.h>
#include <QtGui>
#include <QTableWidget>
#include <QRadioButton>
#include <QComboBox>
#include "MMLMonitorDisplayFactory.h"
#include <MonitoringDriver.h>
......
......@@ -24,7 +24,6 @@
****************************************************************************/
// CamiTK stuff
#include <Action.h>
#include <InteractiveViewer.h>
#include <Log.h>
#include <Geometry.h>
#include <Property.h>
......@@ -224,7 +223,7 @@ void PMLComponent::create3DStructure() {
initRepresentation(mainGrid);
// Tell this component is visible in the 3D viewer, otherwise we won't see it!
setVisibility(Application::getViewer("3D Viewer"), true);
setVisibility("3D Viewer", true);
}
//-------------------- parseMultiComponent -------------------
......@@ -343,7 +342,7 @@ void PMLComponent::refreshDisplay() {
// for instance in a MML monitor) in order to obtain a real refresh
getPointSet()->Modified();
// This is a forced/active refresh (breaking CamiTK programming guidelines)
Application::getViewer("3D Viewer")->refresh();
refresh();
// shade the current selected component in order to see the selected item (SC, MC, Atoms or Cells)
myGeometry->setEnhancedModes(InterfaceGeometry::Shaded);
}
......
......@@ -159,7 +159,7 @@ QWidget* FrameEditor::getWidget() {
void FrameEditor::initializeDialogWithCurrentComponent() {
// update checkbox
ui.displayFrameCheckBox->blockSignals(true);
bool isFrameDisplayed = currentComponent->getFrameVisibility(Application::getViewer("3D Viewer"));
bool isFrameDisplayed = currentComponent->getFrameVisibility("3D Viewer");
ui.displayFrameCheckBox->setChecked(isFrameDisplayed);
ui.displayFrameCheckBox->blockSignals(false);
......@@ -217,18 +217,18 @@ void FrameEditor::initializeDialogWithCurrentComponent() {
void FrameEditor::displayFrameToggled(bool display) {
int frameSize = ui.frameSizeSpinBox->value();
currentComponent->getFrameAxisActor()->SetTotalLength(frameSize, frameSize, frameSize);
currentComponent->setFrameVisibility(Application::getViewer("3D Viewer"), display);
currentComponent->setFrameVisibility("3D Viewer", display);
Application::getViewer("3D Viewer")->refresh();
Application::refresh();
}
// --------------- frameSizeChanged -------------------
void FrameEditor::frameSizeChanged(int val) {
bool display = ui.displayFrameCheckBox->isChecked();
currentComponent->getFrameAxisActor()->SetTotalLength(val, val, val);
currentComponent->setFrameVisibility(Application::getViewer("3D Viewer"), display);
currentComponent->setFrameVisibility("3D Viewer", display);
Application::getViewer("3D Viewer")->refresh();
Application::refresh();
}
// --------------- setParentFrame -------------------
......@@ -249,7 +249,7 @@ void FrameEditor::setParentFrame() {
}
currentComponent->setParentFrame(parentFrame, keepTransform);
Application::getViewer("3D Viewer")->refresh();
Application::refresh();
initializeDialogWithCurrentComponent();
}
......@@ -298,7 +298,7 @@ void FrameEditor::setTransformation() {
matrixTransform->SetMatrix(matrix);
currentComponent->setTransform(matrixTransform);
Application::getViewer("3D Viewer")->refresh();
Application::refresh();
initializeDialogWithCurrentComponent();
}
......@@ -313,7 +313,7 @@ void FrameEditor::translate() {
ui.yTranslationLineEdit->text().toDouble(),
ui.zTranslationLineEdit->text().toDouble());
Application::getViewer("3D Viewer")->refresh();
Application::refresh();
initializeDialogWithCurrentComponent();
}
......@@ -323,7 +323,7 @@ void FrameEditor::setTranslation() {
ui.yTranslationLineEdit->text().toDouble(),
ui.zTranslationLineEdit->text().toDouble());
Application::getViewer("3D Viewer")->refresh();
Application::refresh();
initializeDialogWithCurrentComponent();
}
......@@ -346,7 +346,7 @@ void FrameEditor::rotate() {
ui.zRotationLineEdit->text().toDouble());
}
Application::getViewer("3D Viewer")->refresh();
Application::refresh();
initializeDialogWithCurrentComponent();
}
......@@ -363,7 +363,7 @@ void FrameEditor::setRotation() {
ui.zRotationLineEdit->text().toDouble());
}
Application::getViewer("3D Viewer")->refresh();
Application::refresh();
initializeDialogWithCurrentComponent();
}
......
......@@ -26,9 +26,7 @@
#ifndef FRAMEEDITOR_H
#define FRAMEEDITOR_H
#include "Action.h"
#include "Component.h"
#include "Viewer.h"
#include <Action.h>
#include <QVector>
#include <QLineEdit>
......
......@@ -28,9 +28,7 @@
#include <Application.h>
#include <Property.h>
#include <MedicalImageViewer.h>
#include <InteractiveViewer.h>
#include <ImageComponent.h>
#include <Log.h>
// to get the enum as a string
#include <QMetaEnum>
......
......@@ -25,7 +25,7 @@
// CamiTK includes
#include "PixelColorChanger.h"
#include <Application.h>
#include <InteractiveViewer.h>
#include <InteractiveSliceViewer.h>
#include <Property.h>
......
......@@ -87,24 +87,24 @@ ReorientImage::ReorientImage(ActionExtension* extension) : Action(extension) {
lettersMeaning.insert('S', SMeaning);
// see initDialog
dialog = NULL;
dialog = nullptr;
// see buildAxes
axes = NULL;
axes = nullptr;
// see buildCube
annotatedCube = NULL;
annotatedCube = nullptr;
orientationTransform = NULL;
axesTransform = NULL;
orientationCubeTransform = NULL;
cubeTransform = NULL;
orientationTransform = nullptr;
axesTransform = nullptr;
orientationCubeTransform = nullptr;
cubeTransform = nullptr;
// see buildGeometries for the 3D representation
internalViewer = NULL;
modelBoundingBox = NULL;
maleModel = NULL;
femaleModel = NULL;
internalViewer = nullptr;
modelBoundingBox = nullptr;
maleModel = nullptr;
femaleModel = nullptr;
// these properties are for pipeline users to set parameters
Property* useMaleModel = new Property("Use Male Model", QVariant(true), tr("Use male or female model for image orientation illustration"), "");
......@@ -117,14 +117,14 @@ ReorientImage::ReorientImage(ActionExtension* extension) : Action(extension) {
// --------------- destructor -------------------
ReorientImage::~ReorientImage() {
axes = NULL;
annotatedCube = NULL;
axes = nullptr;
annotatedCube = nullptr;
delete modelBoundingBox;
modelBoundingBox = NULL;
modelBoundingBox = nullptr;
delete femaleModel;
femaleModel = NULL;
femaleModel = nullptr;
delete maleModel;
maleModel = NULL;
maleModel = nullptr;
}
// --------------- initDialog -------------------
......@@ -219,7 +219,7 @@ void ReorientImage::rcsChanged(const QString index) {
// --------------- modelChanged -------------------
void ReorientImage::modelChanged(bool displayMaleModel) {
if (femaleModel == NULL || maleModel == NULL) {
if (femaleModel == nullptr || maleModel == nullptr) {
return;
}
......@@ -332,7 +332,7 @@ Action::ApplyStatus ReorientImage::process(ImageComponent* image) {
updatedTransform->SetMatrix(updatedMatrix);
image->setTransform(updatedTransform);
image->setFrameVisibility(Application::getViewer("3D Viewer"), true);
image->setFrameVisibility("3D Viewer", true);
}
else {
......@@ -356,7 +356,7 @@ Action::ApplyStatus ReorientImage::process(ImageComponent* image) {
updatedTransform->SetMatrix(updatedMatrix);
result->setTransform(updatedTransform);
result->setFrameVisibility(Application::getViewer("3D Viewer"), true);
result->setFrameVisibility("3D Viewer", true);
}
Application::getViewer("3D Viewer")->refresh();
......
......@@ -26,7 +26,6 @@
#include <ImageComponent.h>
#include <ArbitrarySingleImageComponent.h>
#include <InteractiveViewer.h>
using namespace camitk;
......
......@@ -26,7 +26,6 @@
#include <ImageComponent.h>
#include <SingleImageComponent.h>
#include <InteractiveViewer.h>
using namespace camitk;
......
......@@ -26,7 +26,6 @@
#include <ImageComponent.h>
#include <SingleImageComponent.h>
#include <InteractiveViewer.h>
using namespace camitk;
......
......@@ -26,7 +26,6 @@
#include <ImageComponent.h>
#include <SingleImageComponent.h>
#include <InteractiveViewer.h>
using namespace camitk;
......
......@@ -97,21 +97,19 @@ Action::ApplyStatus VolumeRenderingAction::apply() {
// --------------- process ---------------
void VolumeRenderingAction::process(ImageComponent* comp) {
bool isVisible = comp->getVolumeRenderingChild()->getVisibility(Application::getViewer("3D Viewer"));
bool existVR = (comp->getVolumeRenderingChild()->getProp(volumeName) != NULL);
bool isVisible = comp->getVolumeRenderingChild()->getVisibility("3D Viewer");
bool existVR = (comp->getVolumeRenderingChild()->getProp(volumeName) != nullptr);
if (existVR) {
if (isVisible) {
comp->getVolumeRenderingChild()->setVisibility(Application::getViewer("3D Viewer"), false);
if (myWidget) {
comp->getVolumeRenderingChild()->setVisibility("3D Viewer", false);
if (myWidget != nullptr) {
myWidget->close();
}
Application::refresh();
}
else {
comp->getVolumeRenderingChild()->setVisibility(Application::getViewer("3D Viewer"), true);
comp->getVolumeRenderingChild()->setVisibility("3D Viewer", true);
if (myWidget != nullptr) {
myWidget->show();
Application::refresh();
}
}
}
......@@ -123,6 +121,7 @@ void VolumeRenderingAction::process(ImageComponent* comp) {
myWidget->updateImage(comp);
myWidget->show();
}
Application::refresh();
}
......@@ -260,7 +259,7 @@ void VolumeRenderingAction::createVolumeRendering(ImageComponent* comp) {
comp->getVolumeRenderingChild()->getProp(volumeName)->SetVisibility(true);
//Application::getViewer<InteractiveViewer>("3D Viewer")->getRendererWidget()->addProp(volume);
comp->getVolumeRenderingChild()->setVisibility(Application::getViewer("3D Viewer"), true);
comp->getVolumeRenderingChild()->setVisibility("3D Viewer", true);
Application::getViewer("3D Viewer")->refresh();
}
......
......@@ -2,6 +2,7 @@ camitk_extension(ACTION_EXTENSION
DEFINES COMPILE_BASIC_MESH_ACTION_API
CEP_NAME SDK
DESCRIPTION "Provides basic actions on meshes"
NEEDS_VIEWER_EXTENSION interactivegeometryviewer
ENABLE_AUTO_TEST
TEST_FILES brain.mha bassin.msh liver-smooth.obj Mesh.off robot.wrl scissors.obj simple.vtk sinus_skin.vtk sinus_skull.vtk skull1.stl structured.vtk pointcloud-with-data.vtk polydata-with-data.vtk cube-with-point-and-cell-data.vtk fieldfile.vtk check-with-color-pointdata.vtk plate-with-data.vtk female.vtk brainImageSmooth.vtk structuredgrid-with-data.vtk male.vtk cube-with-tensors.vtk imageBoundingBox.vtk binary-mesh-with-pointdata.vtk unstructured_binary_with_celldata.vtk
)
......
......@@ -26,7 +26,7 @@
#include "MeshPicking.h"
#include <MeshComponent.h>
#include <Application.h>
#include <InteractiveViewer.h>
#include <InteractiveGeometryViewer.h>
using namespace camitk;
......
......@@ -26,9 +26,8 @@
#include <MeshComponent.h>
#include <Application.h>
#include <InteractiveViewer.h>
#include <InteractiveGeometryViewer.h>
#include <Log.h>
using namespace camitk;
#include <vtkMeshQuality.h>
#include <vtkCellData.h>
......@@ -41,6 +40,7 @@ using namespace camitk;
#include <QVBoxLayout>
#include <QHeaderView>
using namespace camitk;
// WARNING If you change the order of one of QStringList below, change the switch case in corresponding "computeXXX" methods
QStringList MeshQuality::trisFuncList = QStringList() << "Area" << "Aspect Frobenius" << "Aspect Ratio" << "Condition" << "Distortion" << "Edge Ratio" << "Maximum Angle" << "Minimum Angle" << "Radius Ratio" << "Relative Size Squared" << "Scaled Jacobian" << "Shape" << "Shape and Size";
......
......@@ -25,7 +25,6 @@
// CamiTK includes
#include "RenderingOption.h"
#include <MeshComponent.h>
#include <InteractiveViewer.h>
#include <Property.h>
//-- Vtk includes
......
......@@ -25,7 +25,7 @@
#include "RigidTransform.h"
#include <Component.h>
#include <InteractiveViewer.h>
#include <InteractiveGeometryViewer.h>
#include <Log.h>
#include <Application.h>
using namespace camitk;
......@@ -131,7 +131,7 @@ void RigidTransform::reset() {
//-- init values
double bounds[6];
dynamic_cast<InteractiveViewer*>(Application::getViewer("3D Viewer"))->getBounds(bounds);
dynamic_cast<InteractiveGeometryViewer*>(Application::getViewer("3D Viewer"))->getBounds(bounds);
double xLength = bounds[1] - bounds[0];
double yLength = bounds[3] - bounds[2];
double zLength = bounds[5] - bounds[4];
......
......@@ -29,7 +29,7 @@
//- Core stuffs
#include <ImageComponent.h>
#include <Application.h>
#include <InteractiveViewer.h>
#include <InteractiveGeometryViewer.h>
#include <RendererWidget.h>
#include <ActionWidget.h>
#include <Log.h>
......@@ -85,7 +85,7 @@ QWidget* MeshClipping::getWidget() {
//-- Creating the clipping plane widget (the first time getWidget() is called)
if (!widget->planeWidget) {
vtkRenderWindowInteractor* iren =
dynamic_cast<InteractiveViewer*>(Application::getViewer("3D Viewer"))
dynamic_cast<InteractiveGeometryViewer*>(Application::getViewer("3D Viewer"))
->getRendererWidget()->GetRenderWindow()->GetInteractor();
//-- Configure the plane widget including callbacks
......@@ -96,7 +96,7 @@ QWidget* MeshClipping::getWidget() {
//-- Bounding box definition and placement
widget->planeWidget->SetPlaceFactor(1.5);
dynamic_cast<InteractiveViewer*>(Application::getViewer("3D Viewer"))->getBounds(limBounds);
dynamic_cast<InteractiveGeometryViewer*>(Application::getViewer("3D Viewer"))->getBounds(limBounds);
widget->planeWidget->PlaceWidget(limBounds);
QVector3D origin((limBounds[1] + limBounds[0]) / 2,
(limBounds[3] + limBounds[2]) / 2,
......
......@@ -25,10 +25,6 @@
#include "PlaneWidget.h"
//-- Core stuffs
#include <InteractiveViewer.h>
using namespace camitk;
// -------------------- constructor --------------------
......
......@@ -27,9 +27,6 @@
#include "MshComponent.h"
#include <sstream>
#include <Application.h>
#include <InteractiveViewer.h>
#include <Log.h>
#include <QFileInfo>
......@@ -166,7 +163,7 @@ void MshComponent::readLegacyFormat(std::ifstream& fileStream) {
initRepresentation(mesh);
// add the represention in the 3D viewer
setVisibility(Application::getViewer("3D Viewer"), true);
setVisibility("3D Viewer", true);
}
void MshComponent::readV2Format(std::ifstream& fileStream) {
......@@ -323,5 +320,5 @@ void MshComponent::readV2Format(std::ifstream& fileStream) {
initRepresentation(mesh);
// add the represention in the 3D viewer
setVisibility(Application::getViewer("3D Viewer"), true);
setVisibility("3D Viewer", true);
}
......@@ -27,9 +27,6 @@
#include <sstream>
#include <Application.h>
#include <InteractiveViewer.h>
#include <QFileInfo>
#include <QVector3D>
......@@ -117,8 +114,5 @@ OffComponent::OffComponent(const QString& file) : MeshComponent(file) {
initRepresentation(offMesh);
// add the represention in the 3D viewer
setVisibility(Application::getViewer("3D Viewer"), true);
// initialize the dynamic properties
//initDynamicProperties();
setVisibility("3D Viewer", true);
}
......@@ -24,10 +24,6 @@
****************************************************************************/
#include "StlComponent.h"
#include <Geometry.h>
#include <InteractiveViewer.h>
#include <Log.h>
#include <QFileInfo>
#include <vtkSTLReader.h>
......
......@@ -29,7 +29,7 @@
//-- CamiTK stuff
#include <Application.h>
#include <InteractiveViewer.h>
#include <InteractiveGeometryViewer.h>
#include <Log.h>
using namespace camitk;
......@@ -70,7 +70,7 @@ bool VRMLComponentExtension::save(Component* component) const {
}
else if (mesh->getPointSet()) {
vtkSmartPointer<vtkVRMLExporter> exporter = vtkSmartPointer<vtkVRMLExporter>::New();
exporter->SetInput(dynamic_cast<InteractiveViewer*>(Application::getViewer("3D Viewer"))->getRendererWidget()->GetRenderWindow());
exporter->SetInput(dynamic_cast<InteractiveGeometryViewer*>(Application::getViewer("3D Viewer"))->getRendererWidget()->GetRenderWindow());
exporter->SetFileName(mesh->getFileName().toStdString().c_str());
exporter->Write();
return true;
......
......@@ -238,7 +238,7 @@ void MainWindow::showDockViewer(Viewer* theViewer, bool visible) {
// ------------- showViewer -----------------
void MainWindow::showViewer(Viewer* theViewer, bool visible) {
CAMITK_WARNING(tr("ShowViewer(..) method is now deprecated and will be remove from CamiTK API, please use showDockViewer(..) instead"))
CAMITK_WARNING(tr("ShowViewer(..) method is now deprecated and will be removed from CamiTK API, please use showDockViewer(..) instead"))
showDockViewer(theViewer, visible);
}
......
......@@ -281,14 +281,11 @@ void Component::setVisibility(QString viewerName, bool b) {
it.value() = b;
}
}
else {
CAMITK_WARNING(tr("Viewer \"%1\" not found: please make sure the required viewer extension is loaded").arg(viewerName))
}
}
void Component::setVisibility(Viewer* v, bool b) {
CAMITK_WARNING(tr("setVisibility(Viewer*,bool) method is now deprecated and will be remove from CamiTK API, please use setVisibility(QString,bool) instead"))
CAMITK_WARNING(tr("setVisibility(Viewer*,bool) method is now deprecated and will be removed from CamiTK API, please use setVisibility(QString,bool) instead"))
// only insert real non-null viewers
if (v != nullptr) {
......@@ -320,14 +317,10 @@ bool Component::getVisibility(QString viewerName) const {
return it.value();
}
}
else {
CAMITK_WARNING(tr("Viewer \"%1\" not found: please make sure the required viewer extension is loaded").arg(viewerName))
}
}
bool Component::getVisibility(Viewer* v) const {
CAMITK_WARNING(tr("getVisibility(Viewer*) method is now deprecated and will be remove from CamiTK API, please use getVisibility(QString) instead"))
CAMITK_WARNING(tr("getVisibility(Viewer*) method is now deprecated and will be removed from CamiTK API, please use getVisibility(QString) instead"))
auto it = myViewers.constFind(v);
......@@ -471,7 +464,7 @@ QMenu* Component::getActionMenu() {
// viewerAction is own by visibilityMenu, visibilityMenu.clear() will delete it
QAction* visibilityAction = visibilityMenu->addAction(viewer->getName());
visibilityAction->setCheckable(true);
visibilityAction->setChecked(getVisibility(viewer));
visibilityAction->setChecked(getVisibility(viewer->getName()));
visibilityAction->setIcon(viewer->getIcon());
QString tipString = "Set the visibility of this component in the \"" + viewer->getName() + "\" viewer\n(note that it might not have effect depending on the viewer)";
visibilityAction->setStatusTip(tr(tipString.toStdString().c_str()));
......@@ -793,6 +786,16 @@ vtkSmartPointer<vtkAxesActor> Component::getFrameAxisActor() {
}
// -------------------- getFrameVisibility --------------------
bool Component::getFrameVisibility(QString viewerName) const {
if (myFrame == nullptr) {
CAMITK_ERROR(tr("myFrame is not instantiated."))
return false;
}
else {
return myFrame->getFrameVisibility(viewerName);
}
}
bool Component::getFrameVisibility(Viewer* viewer) const {
if (myFrame == nullptr) {
CAMITK_ERROR(tr("myFrame is not instantiated."))
......
......@@ -774,9 +774,22 @@ public:
vtkSmartPointer<vtkAxesActor> getFrameAxisActor() override;
///@cond
/**
* TODO CAMITK_DEPRECATED. This section list all the methods marked as deprecated. They are to be removed in CamiTK 5.0
* @deprecated
*
* DEPRECATED (CamiTK 5.0) -> to be removed
* Use the setVisibility(QString, bool) / getVisibility(QString, bool) methods
*/
delegate2(myFrame, setFrameVisibility, Viewer*, bool)
bool getFrameVisibility(Viewer* viewer) const override;
///@endcond
delegate2(myFrame, setFrameVisibility, QString, bool)
bool getFrameVisibility(QString) const override;
delegate1(myFrame, addFrameChild, InterfaceFrame*)
......
......@@ -24,6 +24,7 @@
****************************************************************************/
// Local Includes
#include "Frame.h"
#include "Application.h"
#include "Viewer.h"
#include "Log.h"
......@@ -137,6 +138,7 @@ void Frame::setParentFrame(InterfaceFrame* parent, bool keepTransform) {
else {
// compute all the descendants of the current frame
QVector<InterfaceFrame*> descendants = computeDescendants(this);
// check if one of the descendant if the checked parent
foreach (InterfaceFrame* descendant, descendants) {
if (descendant->getFrameName() == checkedParent->getFrameName()) {
......@@ -207,6 +209,7 @@ const vtkSmartPointer<vtkTransform> Frame::getTransformFromFrame(InterfaceFrame*
// World -> Frame
vtkSmartPointer<vtkMatrix4x4> worldToFrameMatrix;
if (frame == nullptr) { // Frame IS the world Frame !
worldToFrameMatrix = vtkSmartPointer<vtkMatrix4x4>::New();
worldToFrameMatrix->Identity();
......@@ -249,7 +252,7 @@ void Frame::resetTransform() {
void Frame::translate(double x, double y, double z) {
transformParentToMe->Translate(x, y, z);
transformParentToMe->Update();
transformWorldToMe->Update();
representationTransformFilter->Update();
}
......@@ -261,7 +264,7 @@ void Frame::rotate(double aroundX, double aroundY, double aroundZ) {
transformParentToMe->Translate(-initialPos[0], -initialPos[1], -initialPos[2]);
transformParentToMe->Update();
transformParentToMe->RotateX(aroundX);
transformParentToMe->RotateY(aroundY);
transformParentToMe->RotateZ(aroundZ);
......@@ -269,7 +272,7 @@ void Frame::rotate(double aroundX, double aroundY, double aroundZ) {
transformParentToMe->Translate(initialPos[0], initialPos[1], initialPos[2]);
transformParentToMe->Update();
transformWorldToMe->Update();
representationTransformFilter->Update();
}
......@@ -280,7 +283,7 @@ void Frame::rotateVTK(double aroundX, double aroundY, double aroundZ) {
transformParentToMe->Translate(-initialPos[0], -initialPos[1], -initialPos[2]);
transformParentToMe->Update();
transformParentToMe->RotateZ(aroundZ);
transformParentToMe->RotateX(aroundX);
transformParentToMe->RotateY(aroundY);
......@@ -288,7 +291,7 @@ void Frame::rotateVTK(double aroundX, double aroundY, double aroundZ) {
transformParentToMe->Translate(initialPos[0], initialPos[1], initialPos[2]);
transformParentToMe->Update();
transformWorldToMe->Update();
representationTransformFilter->Update();
}
......@@ -313,20 +316,20 @@ void Frame::setTransformTranslation(double x, double y, double z) {
// .arg(getTransform()->GetMatrix()->GetElement(3,1))
// .arg(getTransform()->GetMatrix()->GetElement(3,2))
// .arg(getTransform()->GetMatrix()->GetElement(3,3))
// )
// )
double* initialRotation = transformParentToMe->GetOrientation();
transformParentToMe->Identity();
transformParentToMe->RotateX(initialRotation[0]);
transformParentToMe->RotateY(initialRotation[1]);
transformParentToMe->RotateZ(initialRotation[2]);
transformParentToMe->Update();
transformParentToMe->Translate(x, y, z);
transformParentToMe->Update();
transformWorldToMe->Update();
representationTransformFilter->Update();
......@@ -348,8 +351,8 @@ void Frame::setTransformTranslation(double x, double y, double z) {
// .arg(getTransform()->GetMatrix()->GetElement(3,1))
// .arg(getTransform()->GetMatrix()->GetElement(3,2))
// .arg(getTransform()->GetMatrix()->GetElement(3,3))
// )
// )
}
// ------------------- setTransformTranslationVTK --------------------------
......@@ -357,13 +360,13 @@ void Frame::setTransformTranslationVTK(double x, double y, double z) {
double* initialRotation = transformParentToMe->GetOrientation();
transformParentToMe->Identity();
// VTK rotation order is Z, X, Y