// 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"
#include "GEOM_Displayer.h"
#include <LightApp_DataOwner.h>
+#include <SalomeApp_Application.h>
#include <SalomeApp_Study.h>
#include <OCCViewer_ViewModel.h>
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 );
}
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 );
}
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();
}
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<GeometryGUI*>( 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 "";
+}