From 54e52b0295983d8de6b88e1d946c15b991cd80d4 Mon Sep 17 00:00:00 2001 From: Philipp Schmidt <ufedv@student.kit.edu> Date: Tue, 7 Jul 2015 14:01:27 +0200 Subject: [PATCH] Changed tcp pose indicators to be transparent and made camera orthographic again due to camera culling problems --- .../gui-plugins/RobotIKPlugin/RobotIKGuiPlugin.cpp | 11 +++++++++-- .../gui-plugins/RobotIKPlugin/RobotIKGuiPlugin.h | 3 +++ .../gui-plugins/RobotIKPlugin/RobotViewer.cpp | 2 +- .../RobotAPI/gui-plugins/RobotIKPlugin/RobotViewer.h | 4 ++-- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/source/RobotAPI/gui-plugins/RobotIKPlugin/RobotIKGuiPlugin.cpp b/source/RobotAPI/gui-plugins/RobotIKPlugin/RobotIKGuiPlugin.cpp index 139844494..1ae00f53e 100644 --- a/source/RobotAPI/gui-plugins/RobotIKPlugin/RobotIKGuiPlugin.cpp +++ b/source/RobotAPI/gui-plugins/RobotIKPlugin/RobotIKGuiPlugin.cpp @@ -284,19 +284,26 @@ void armarx::RobotIKWidgetController::kinematicChainChanged(const QString &arg1) manipSeparator = new SoSeparator; currentSeparator = new SoSeparator; + tcpCurrentColor = new SoMaterial; + tcpCurrentColor->transparency = 0.6f; tcpCurrent = new SoSphere; - tcpCurrent->radius = 0.03f; + tcpCurrent->radius = 0.06f; + tcpDesiredColor = new SoMaterial; + tcpDesiredColor->ambientColor.setValue(0, 1, 0); + tcpDesiredColor->transparency = 0.3f; tcpDesired = new SoSphere; - tcpDesired->radius = 0.03f; + tcpDesired->radius = 0.06f; tcpManip = new SoCenterballManip; tcpCurrentTransform = new SoTransform; tcpManipTransform = new SoTransform; manipSeparator->addChild(tcpManipTransform); manipSeparator->addChild(tcpManip); + manipSeparator->addChild(tcpDesiredColor); manipSeparator->addChild(tcpDesired); currentSeparator->addChild(tcpCurrentTransform); + currentSeparator->addChild(tcpCurrentColor); currentSeparator->addChild(tcpCurrent); this->ui.robotViewer->getRobotViewer()->getRootNode()->insertChild(currentSeparator, 0); diff --git a/source/RobotAPI/gui-plugins/RobotIKPlugin/RobotIKGuiPlugin.h b/source/RobotAPI/gui-plugins/RobotIKPlugin/RobotIKGuiPlugin.h index 98bda26db..0042f92d7 100644 --- a/source/RobotAPI/gui-plugins/RobotIKPlugin/RobotIKGuiPlugin.h +++ b/source/RobotAPI/gui-plugins/RobotIKPlugin/RobotIKGuiPlugin.h @@ -47,6 +47,7 @@ #include <Inventor/sensors/SoTimerSensor.h> #include <Inventor/manips/SoCenterballManip.h> #include <Inventor/nodes/SoSphere.h> +#include <Inventor/nodes/SoMaterial.h> namespace armarx { @@ -115,8 +116,10 @@ namespace armarx SoSeparator* currentSeparator; SoCenterballManip* tcpManip; SoTransform* tcpManipTransform; + SoMaterial* tcpDesiredColor; SoSphere* tcpDesired; SoTransform* tcpCurrentTransform; + SoMaterial* tcpCurrentColor; SoSphere* tcpCurrent; SoTimerSensor* timerSensor; diff --git a/source/RobotAPI/gui-plugins/RobotIKPlugin/RobotViewer.cpp b/source/RobotAPI/gui-plugins/RobotIKPlugin/RobotViewer.cpp index 80f580664..b28e34e88 100644 --- a/source/RobotAPI/gui-plugins/RobotIKPlugin/RobotViewer.cpp +++ b/source/RobotAPI/gui-plugins/RobotIKPlugin/RobotViewer.cpp @@ -10,7 +10,7 @@ #include <Inventor/events/SoMouseButtonEvent.h> #include <Inventor/events/SoLocation2Event.h> -armarx::RobotViewer::RobotViewer(QWidget* widget) : SoQtExaminerViewer(widget), sceneRootNode(new SoSeparator), contentRootNode(new SoSeparator), camera(new SoPerspectiveCamera) +armarx::RobotViewer::RobotViewer(QWidget* widget) : SoQtExaminerViewer(widget), sceneRootNode(new SoSeparator), contentRootNode(new SoSeparator), camera(new SoOrthographicCamera) { this->setBackgroundColor(SbColor(150 / 255.0f, 150 / 255.0f, 150 / 255.0f)); this->setAccumulationBuffer(true); diff --git a/source/RobotAPI/gui-plugins/RobotIKPlugin/RobotViewer.h b/source/RobotAPI/gui-plugins/RobotIKPlugin/RobotViewer.h index d5997ec42..23157e005 100644 --- a/source/RobotAPI/gui-plugins/RobotIKPlugin/RobotViewer.h +++ b/source/RobotAPI/gui-plugins/RobotIKPlugin/RobotViewer.h @@ -2,7 +2,7 @@ #define __RobotViewer_h__ /* Coin headers */ -#include <Inventor/nodes/SoPerspectiveCamera.h> +#include <Inventor/nodes/SoOrthographicCamera.h> #include <Inventor/Qt/viewers/SoQtExaminerViewer.h> namespace armarx @@ -18,7 +18,7 @@ namespace armarx virtual SbBool processSoEvent(const SoEvent* const event); SoSeparator* sceneRootNode; SoSeparator* contentRootNode; - SoPerspectiveCamera* camera; + SoOrthographicCamera* camera; }; } -- GitLab