Commit 9321d5f4 authored by Jan Möbius's avatar Jan Möbius
Browse files

Feature to check and disable modeling areas separatly preperation

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@15578 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 49d2ddfe
...@@ -51,11 +51,13 @@ ...@@ -51,11 +51,13 @@
#include <OpenFlipper/ACGHelper/DrawModeConverter.hh> #include <OpenFlipper/ACGHelper/DrawModeConverter.hh>
#include <ACG/Scenegraph/CoordsysNode.hh> #include <ACG/Scenegraph/CoordsysNode.hh>
#define SHOW_SELECTION "Selections" #define SHOW_SELECTION "Selections"
#define SHOW_AREAS "Modeling Areas" #define SHOW_AREAS "Modeling Areas"
#define SHOW_FEATURES "Feature Selection" #define SHOW_AREA "Modeling Area"
#define SHOW_HANDLE "Handle Area"
#define SHOW_FEATURES "Feature Selection"
#define USEGLOBALDRAWMODE "Use Global DrawMode" #define USEGLOBALDRAWMODE "Use Global DrawMode"
#define SETSHADERS "Set Shader" #define SETSHADERS "Set Shader"
ViewControlPlugin::ViewControlPlugin(): ViewControlPlugin::ViewControlPlugin():
viewControlMenu_(0), viewControlMenu_(0),
...@@ -387,10 +389,10 @@ bool ViewControlPlugin::selectionVisible( int _id ) { ...@@ -387,10 +389,10 @@ bool ViewControlPlugin::selectionVisible( int _id ) {
return false; return false;
} }
bool ViewControlPlugin::modelingAreasVisible( int _id ) { bool ViewControlPlugin::areasVisible( StatusBits _bits, int _id ) {
if ( _id == -1) if ( _id == -1)
return false; return false;
BaseObjectData* object = 0; BaseObjectData* object = 0;
if ( ! PluginFunctions::getObject(_id,object) ) if ( ! PluginFunctions::getObject(_id,object) )
...@@ -398,21 +400,28 @@ bool ViewControlPlugin::modelingAreasVisible( int _id ) { ...@@ -398,21 +400,28 @@ bool ViewControlPlugin::modelingAreasVisible( int _id ) {
if ( object->dataType( DATA_TRIANGLE_MESH ) ) { if ( object->dataType( DATA_TRIANGLE_MESH ) ) {
TriMeshObject* triMeshObject = PluginFunctions::triMeshObject( object ); TriMeshObject* triMeshObject = PluginFunctions::triMeshObject( object );
if ( triMeshObject ) if ( triMeshObject ) {
return triMeshObject->areasVisible(); return triMeshObject->areaVisible( _bits );
}
} }
if ( object->dataType( DATA_POLY_MESH ) ) { if ( object->dataType( DATA_POLY_MESH ) ) {
PolyMeshObject* polyMeshObject = PluginFunctions::polyMeshObject( object ); PolyMeshObject* polyMeshObject = PluginFunctions::polyMeshObject( object );
if ( polyMeshObject ) if ( polyMeshObject )
return( polyMeshObject->areasVisible() ); return( polyMeshObject->areaVisible( _bits ) );
} }
return false; return false;
} }
void ViewControlPlugin::showModelingAreas( int _id , bool _state ) { bool ViewControlPlugin::modelingAreasVisible( int _id ) {
return areasVisible(StatusBits(HANDLEAREA | AREA), _id);
}
void ViewControlPlugin::showAreas( StatusBits _bits, int _id , bool _state ) {
if ( _id == -1) if ( _id == -1)
return; return;
...@@ -424,17 +433,23 @@ void ViewControlPlugin::showModelingAreas( int _id , bool _state ) { ...@@ -424,17 +433,23 @@ void ViewControlPlugin::showModelingAreas( int _id , bool _state ) {
if ( object->dataType( DATA_TRIANGLE_MESH ) ) { if ( object->dataType( DATA_TRIANGLE_MESH ) ) {
TriMeshObject* triMeshObject = PluginFunctions::triMeshObject( object ); TriMeshObject* triMeshObject = PluginFunctions::triMeshObject( object );
if ( triMeshObject ) if ( triMeshObject )
triMeshObject->hideAreas( !_state); triMeshObject->hideArea( StatusBits(HANDLEAREA | AREA), !_state);
} }
if ( object->dataType( DATA_POLY_MESH ) ) { if ( object->dataType( DATA_POLY_MESH ) ) {
PolyMeshObject* polyMeshObject = PluginFunctions::polyMeshObject( object ); PolyMeshObject* polyMeshObject = PluginFunctions::polyMeshObject( object );
if ( polyMeshObject ) if ( polyMeshObject )
polyMeshObject->hideAreas( !_state); polyMeshObject->hideArea( StatusBits(HANDLEAREA | AREA), !_state);
} }
} }
void ViewControlPlugin::showModelingAreas( int _id , bool _state ) {
showAreas(StatusBits(HANDLEAREA | AREA) , _id, _state );
}
void ViewControlPlugin::showSelection( int _id , bool _state ) { void ViewControlPlugin::showSelection( int _id , bool _state ) {
...@@ -503,13 +518,13 @@ void ViewControlPlugin::slotUpdateContextMenu( int _objectId ){ ...@@ -503,13 +518,13 @@ void ViewControlPlugin::slotUpdateContextMenu( int _objectId ){
if ( object->dataType( DATA_TRIANGLE_MESH ) ) { if ( object->dataType( DATA_TRIANGLE_MESH ) ) {
TriMeshObject* triMeshObject = PluginFunctions::triMeshObject( object ); TriMeshObject* triMeshObject = PluginFunctions::triMeshObject( object );
if ( triMeshObject ) if ( triMeshObject )
act->setChecked( triMeshObject->areasVisible() ); act->setChecked( triMeshObject->areaVisible( StatusBits(HANDLEAREA | AREA) ) );
} }
if ( object->dataType( DATA_POLY_MESH ) ) { if ( object->dataType( DATA_POLY_MESH ) ) {
PolyMeshObject* polyMeshObject = PluginFunctions::polyMeshObject( object ); PolyMeshObject* polyMeshObject = PluginFunctions::polyMeshObject( object );
if ( polyMeshObject ) if ( polyMeshObject )
act->setChecked( polyMeshObject->areasVisible() ); act->setChecked( polyMeshObject->areaVisible( StatusBits(HANDLEAREA | AREA) ) );
} }
act = viewControlMenu_->addAction( SHOW_FEATURES ); act = viewControlMenu_->addAction( SHOW_FEATURES );
......
...@@ -194,6 +194,22 @@ class ViewControlPlugin : public QObject, BaseInterface , PickingInterface, Logg ...@@ -194,6 +194,22 @@ class ViewControlPlugin : public QObject, BaseInterface , PickingInterface, Logg
// Announce local slots // Announce local slots
void setDescriptions(); void setDescriptions();
/** \brief Return of all of the given modeling areas are visible
*
* @param _bits Which areas to test
* @param _id Id of the object
* @return All areas visible?
*/
bool areasVisible( StatusBits _bits, int _id );
/** \brief Show or hide modeling areas
*
* @param _bits Which areas to test
* @param _id Id of the object
* @param _state Show or hide?
*/
void showAreas( StatusBits _bits, int _id , bool _state );
public slots: public slots:
/// For meshes returns if the selection for this object is visible /// For meshes returns if the selection for this object is visible
......
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