Commit 49d2ddfe authored by Jan Möbius's avatar Jan Möbius
Browse files

Feature to check and disable modeling areas seperatly

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@15577 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 73923a62
......@@ -500,14 +500,21 @@
/** Shows or hides the areas on the object
*/
template < class MeshT >
void MeshObject< MeshT >::hideAreas( bool _hide ) {
void MeshObject< MeshT >::hideArea( StatusBits _bit, bool _hide ) {
ACG::SceneGraph::BaseNode::StatusMode status;
if ( _hide ) {
areaNode_->set_status( ACG::SceneGraph::BaseNode::HideNode );
handleNode_->set_status( ACG::SceneGraph::BaseNode::HideNode );
} else {
areaNode_->set_status( ACG::SceneGraph::BaseNode::Active );
handleNode_->set_status( ACG::SceneGraph::BaseNode::Active );
status = ACG::SceneGraph::BaseNode::HideNode;
}else
status = ACG::SceneGraph::BaseNode::Active;
if ( _bit & AREA ) {
areaNode_->set_status( status );
}
if ( _bit & HANDLEAREA )
handleNode_->set_status( status );
}
template < class MeshT >
......@@ -516,8 +523,16 @@
}
template < class MeshT >
bool MeshObject< MeshT >::areasVisible() {
return ( areaNode_->status() == ACG::SceneGraph::BaseNode::Active );
bool MeshObject< MeshT >::areaVisible( StatusBits _bit ) {
bool status = true;
if ( _bit & AREA )
status &= ( areaNode_->status() == ACG::SceneGraph::BaseNode::Active );
if ( _bit & HANDLEAREA )
status &= ( handleNode_->status() == ACG::SceneGraph::BaseNode::Active );
return status;
}
/** Returns a pointer to the mesh node
......
......@@ -200,10 +200,17 @@ class DLLEXPORTONLY MeshObject : public BaseObjectData {
bool featuresVisible( );
/// Hide or show the area Nodes of the object
void hideAreas( bool _hide );
void hideArea( StatusBits _bit, bool _hide );
/// return if the areas are currently visible
bool areasVisible();
/** \brief Return if the selected areas are currently visible
*
* \note If the bits contain multiple area bits, than only if all are visible,
* this function will return true
*
* @param _bit Status bit to check
* @return All visible?
*/
bool areaVisible( StatusBits _bit );
/// Get the Scenegraph Mesh Node
ACG::SceneGraph::MeshNodeT<MeshT>* meshNode();
......
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