Skip to content
Snippets Groups Projects
Commit d626e1ac authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Florent Lamiraux
Browse files

Add setHighlight method

parent d7f7bff0
No related branches found
No related tags found
No related merge requests found
......@@ -277,6 +277,11 @@ typedef unsigned long WindowID;
/// \param input lightingMode : lighting mode can be "ON" or "OFF".
boolean setLightingMode(in string nodeName, in string lightingMode) raises (Error);
/// Change the highlight status
/// \param input nodeName : name of the node.
/// \param input state : 0 for off, 1 or 2 for other things.
boolean setHighlight (in string nodeName, in long state) raises (Error);
/// Start capturing a window into image files.
/// \param windowId the ID of the window
/// \param filename, extension image files will be
......
......@@ -153,6 +153,7 @@ namespace graphics {
virtual bool setScale(const char* nodeNameCorba, const value_type* scale);
virtual bool setWireFrameMode(const char* nodeNameCorba, const char* wireFrameModeCorba);
virtual bool setLightingMode(const char* nodeNameCorba, const char* lightingModeCorba);
virtual bool setHighlight(const char* nodeNameCorba, int state);
virtual bool startCapture (const WindowID windowId, const char* filename,
const char* extension);
......
......@@ -465,6 +465,16 @@ namespace graphics {
}
}
bool GraphicalInterface::setHighlight (const char* nodeNameCorba,
::CORBA::Long state) throw (Error)
{
try {
return windowsManager_->setHighlight ( nodeNameCorba, state) ;
} catch (const std::exception& exc) {
throw Error (exc.what ());
}
}
bool GraphicalInterface::startCapture (const WindowID windowId, const char* filename,
const char* extension) throw (Error)
{
......
......@@ -117,6 +117,7 @@ public:
virtual bool setScale(const char* nodeNameCorba, const value_type* scale)throw (Error);
virtual bool setWireFrameMode(const char* nodeNameCorba, const char* wireFrameModeCorba) throw (Error);
virtual bool setLightingMode(const char* nodeNameCorba, const char* lightingModeCorba) throw (Error);
virtual bool setHighlight(const char* nodeNameCorba, ::CORBA::Long state) throw (Error);
virtual bool startCapture (const WindowID windowId, const char* filename,
const char* extension) throw (Error);
......
......@@ -1032,6 +1032,21 @@ namespace graphics {
return true;
}
bool WindowsManager::setHighlight (const char* nodeNameCorba,
int state)
{
const std::string nodeName (nodeNameCorba);
if (nodes_.find (nodeName) == nodes_.end ()) {
std::cout << "Node \"" << nodeName << "\" doesn't exist."
<< std::endl;
return false;
}
mtx_.lock();
nodes_[nodeName]->setHighlightState (state);
mtx_.unlock();
return true;
}
bool WindowsManager::startCapture (const WindowID windowId, const char* filename,
const char* extension)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment