Commit 7e81e9fb authored by Matthias Möller's avatar Matthias Möller

- set highlight colors for targets/allObjects in gui

- removed direct access to status nodes

closes #2470

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@20628 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 4a911c05
......@@ -461,6 +461,80 @@
// ===============================================================================
// Visualization
// ===============================================================================
template < class MeshT >
void MeshObject< MeshT >::setSelectionColor(const ACG::Vec4f& _color)
{
if (statusNode_)
{
statusNode_->set_color(_color);
statusNode_->set_base_color(_color);
}
}
template < class MeshT >
ACG::Vec4f MeshObject< MeshT >::selectionColor() const
{
if (statusNode_)
return statusNode_->base_color();
else
return ACG::Vec4f(-1.f,-1.f,-1.f,-1.f);
}
template < class MeshT >
void MeshObject< MeshT >::setAreaColor(const ACG::Vec4f& _color)
{
if (areaNode_)
{
areaNode_->set_color(_color);
areaNode_->set_base_color(_color);
}
}
template < class MeshT >
ACG::Vec4f MeshObject< MeshT >::areaColor() const
{
if (areaNode_)
return areaNode_->base_color();
else
return ACG::Vec4f(-1.f,-1.f,-1.f,-1.f);
}
template < class MeshT >
void MeshObject< MeshT >::setFeatureColor(const ACG::Vec4f& _color)
{
if (featureNode_)
{
featureNode_->set_color(_color);
featureNode_->set_base_color(_color);
}
}
template < class MeshT >
ACG::Vec4f MeshObject< MeshT >::featureColor() const
{
if (featureNode_)
return featureNode_->base_color();
else
return ACG::Vec4f(-1.f,-1.f,-1.f,-1.f);
}
template < class MeshT >
void MeshObject< MeshT >::setHandleColor(const ACG::Vec4f& _color)
{
if (handleNode_)
{
handleNode_->set_color(_color);
handleNode_->set_base_color(_color);
}
}
template < class MeshT >
ACG::Vec4f MeshObject< MeshT >::handleColor() const
{
if (handleNode_)
return handleNode_->base_color();
else
return ACG::Vec4f(-1.f,-1.f,-1.f,-1.f);
}
/** Returns a pointer to the texture node
* @return Pointer to the texture node
*/
......
......@@ -216,10 +216,25 @@ class DLLEXPORTONLY MeshObject : public BaseObjectData {
BaseNode* primaryNode();
ACG::SceneGraph::SelectionNodeT<MeshT>* statusNode() {return statusNode_;}
ACG::SceneGraph::StatusNodeT<MeshT, AreaNodeMod<MeshT> >* areaNode() {return areaNode_;}
ACG::SceneGraph::StatusNodeT<MeshT, HandleNodeMod<MeshT> >* handleNode() {return handleNode_;}
ACG::SceneGraph::StatusNodeT<MeshT, FeatureNodeMod<MeshT> >* featureNode() {return featureNode_;}
/// set color for selection
void setSelectionColor(const ACG::Vec4f& _color);
/// get color for selection. returns -1 vector, if handle node does not exists
ACG::Vec4f selectionColor() const;
/// set color for areas
void setAreaColor(const ACG::Vec4f& _color);
/// get color for areas. returns -1 vector, if handle node does not exists
ACG::Vec4f areaColor() const;
/// set color for features
void setFeatureColor(const ACG::Vec4f& _color);
/// get color for features. returns -1 vector, if handle node does not exists
ACG::Vec4f featureColor() const;
/// set color for handles
void setHandleColor(const ACG::Vec4f& _color);
/// get color for handles. returns -1 vector, if handle node does not exists
ACG::Vec4f handleColor() const;
private :
/// Status Node for a mesh, visualizing the selection state of a mesh
......
......@@ -203,8 +203,8 @@ private slots:
//===========================================================================
private:
// set and saves the colors of the specified nodes
void setColorValues(const ACG::Vec4f& _status, const ACG::Vec4f& _handle, const ACG::Vec4f& _region, const ACG::Vec4f& _feature);
// update and saves new color values for area node/selecion noe etc.
void updateColorValues();
/// Set descriptions for local public slots
void updateSlotDescriptions();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment