X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGEOMGUI%2FGEOMGUI_Selection.cxx;h=70cb563b5414aa1a3621dd24dd4972a798cb88a2;hb=7ac24e7592ac5965df5aa639a9f8bd21feab562d;hp=87cc9d6304a8a57aaccb231c4cfa2d245f1dcb92;hpb=a62a321c849518376e3aa4d24a0b902a24167c64;p=modules%2Fgeom.git diff --git a/src/GEOMGUI/GEOMGUI_Selection.cxx b/src/GEOMGUI/GEOMGUI_Selection.cxx index 87cc9d630..70cb563b5 100644 --- a/src/GEOMGUI/GEOMGUI_Selection.cxx +++ b/src/GEOMGUI/GEOMGUI_Selection.cxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "GEOMGUI_Selection.h" @@ -23,6 +23,7 @@ #include "GEOM_Displayer.h" #include +#include #include #include @@ -66,7 +67,9 @@ GEOMGUI_Selection::~GEOMGUI_Selection() QtxValue GEOMGUI_Selection::globalParam( const QString& p ) const { if ( p == "isOCC" ) return QtxValue( activeViewType() == OCCViewer_Viewer::Type() ); - + if ( p == "selectionmode" ){ + return QtxValue(selectionMode()); + } return LightApp_Selection::globalParam( p ); } @@ -79,6 +82,8 @@ QtxValue GEOMGUI_Selection::param( const int ind, const QString& p ) const return QtxValue( typeName( ind ) ); else if ( p == "displaymode" ) return QtxValue( displayMode( ind ) ); + else if ( p == "isAutoColor" ) + return QtxValue( isAutoColor( ind ) ); else return LightApp_Selection::param( ind, p ); } @@ -109,6 +114,14 @@ bool GEOMGUI_Selection::isVisible( const int index ) const return false; } +bool GEOMGUI_Selection::isAutoColor( const int index ) const +{ + GEOM::GEOM_Object_var obj = getObject( index ); + if ( !CORBA::is_nil( obj ) ) + return obj->GetAutoColor(); + return false; +} + QString GEOMGUI_Selection::displayMode( const int index ) const { SALOME_View* view = GEOM_Displayer::GetActiveView(); @@ -201,3 +214,26 @@ GEOM::GEOM_Object_ptr GEOMGUI_Selection::getObject( const int index ) const } return GEOM::GEOM_Object::_nil(); } + +QString GEOMGUI_Selection::selectionMode() const +{ + SalomeApp_Application* app = (SalomeApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) { + GeometryGUI* aGeomGUI = dynamic_cast( app->module( "Geometry" ) ); + if (aGeomGUI) { + switch (aGeomGUI->getLocalSelectionMode()) + { + case GEOM_POINT : return "VERTEX"; + case GEOM_EDGE : return "EDGE"; + case GEOM_WIRE : return "WIRE"; + case GEOM_FACE : return "FACE"; + case GEOM_SHELL : return "SHELL"; + case GEOM_SOLID : return "SOLID"; + case GEOM_COMPOUND : return "COMPOUND"; + case GEOM_ALLOBJECTS : return "ALL"; + default: return ""; + } + } + } + return ""; +}