From 666b81854889d74367ed9cfacd764e7703312649 Mon Sep 17 00:00:00 2001 From: simeval <simeval@simeval-Precision-M2400.(none)> Date: Wed, 17 Dec 2014 13:32:37 +0100 Subject: [PATCH] add addLandmark and deleteLandmark functions. --- .../corbaserver/graphicalinterface.idl | 9 ++++++++ src/GraphicalInterface.impl.cpp | 23 +++++++++++++++++++ src/GraphicalInterface.impl.hh | 3 +++ 3 files changed, 35 insertions(+) diff --git a/idl/Graphics/corbaserver/graphicalinterface.idl b/idl/Graphics/corbaserver/graphicalinterface.idl index dfe1d98..6341ac5 100644 --- a/idl/Graphics/corbaserver/graphicalinterface.idl +++ b/idl/Graphics/corbaserver/graphicalinterface.idl @@ -143,6 +143,15 @@ typedef double Color [4]; /// \param input configuration : Double[7] new configuration. boolean applyConfiguration(in string nodeName, in Transform configuration) ; + /// Add Landmark at the center of a node (x=blue, y=green, z=red). + /// \param input nodeName : name of the node + /// \param input size : lenght of axises. + boolean addLandmark(in string nodeName, in float size) ; + + /// delete Landmark of a node. + /// \param input nodeName : name of the node + boolean deleteLandmark(in string nodeName) ; + /// Change the visibility of a node. If this node is a group node, visibility mode will be apply to all children. /// \param input nodeName : name of the node. /// \param input visibilityMode : visibility mode can be "ON", "OFF" or "ALWAYS_ON_TOP". diff --git a/src/GraphicalInterface.impl.cpp b/src/GraphicalInterface.impl.cpp index a682633..474b049 100644 --- a/src/GraphicalInterface.impl.cpp +++ b/src/GraphicalInterface.impl.cpp @@ -551,6 +551,29 @@ bool GraphicalInterface::applyConfiguration(const char* nodeNameCorba, const dou } } +bool GraphicalInterface::addLandmark(const char* nodeNameCorba, float size) +{ + const std::string nodeName(nodeNameCorba); + if (nodes_.find(nodeName) == nodes_.end()) { + std::cout << "Node \"" << nodeName << "\" doesn't exist." << std::endl; + return false; + } + nodes_[nodeName]->addLandmark(size); + return true; +} + + +bool GraphicalInterface::deleteLandmark(const char* nodeNameCorba) +{ + const std::string nodeName(nodeNameCorba); + if (nodes_.find(nodeName) == nodes_.end()) { + std::cout << "Node \"" << nodeName << "\" doesn't exist." << std::endl; + return false; + } + nodes_[nodeName]->deleteLandmark(); + return true; +} + bool GraphicalInterface::setVisibility(const char* nodeNameCorba, const char* visibilityModeCorba) { const std::string nodeName(nodeNameCorba); diff --git a/src/GraphicalInterface.impl.hh b/src/GraphicalInterface.impl.hh index 58e5223..2d127b2 100644 --- a/src/GraphicalInterface.impl.hh +++ b/src/GraphicalInterface.impl.hh @@ -117,6 +117,9 @@ public: virtual bool applyConfiguration(const char* nodeNameCorba, const double* configuration) ; + virtual bool addLandmark(const char* nodeNameCorba, float size); + virtual bool deleteLandmark(const char* nodeNameCorba); + virtual bool setVisibility(const char* nodeNameCorba, const char* visibilityModeCorba) ; virtual bool setWireFrameMode(const char* nodeNameCorba, const char* wireFrameModeCorba) ; virtual bool setLightingMode(const char* nodeNameCorba, const char* lightingModeCorba) ; -- GitLab