-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
return;
_PTR(Study) aStudy = aSStudy->studyDS();
- for( int i=0, n=count(); i<n; i++ )
+ for( int i=0, n=count(); i<n; i++ ) {
myTypes.append( typeName( type( entry( i ), aStudy ) ) );
+ myControls.append( controlMode( i ) );
+ }
}
}
else if ( p=="labeledTypes" ) val = QVariant( labeledTypes( ind ) );
else if ( p=="shrinkMode" ) val = QVariant( shrinkMode( ind ) );
else if ( p=="entityMode" ) val = QVariant( entityMode( ind ) );
- else if ( p=="controlMode" ) val = QVariant( controlMode( ind ) );
else if ( p=="isNumFunctor" ) val = QVariant( isNumFunctor( ind ) );
else if ( p=="displayMode" ) val = QVariant( displayMode( ind ) );
else if ( p=="isComputable" ) val = QVariant( isComputable( ind ) );
return LightApp_Selection::parameter( ind, p );
}
+//=======================================================================
+//function : parameter
+//purpose :
+//=======================================================================
+QVariant SMESHGUI_Selection::parameter( const QString& p ) const
+{
+ QVariant val;
+ if ( p=="controlMode" ) val = QVariant( controlMode() );
+
+ if ( val.isValid() )
+ return val;
+ else
+ return LightApp_Selection::parameter( p );
+}
+
//=======================================================================
//function : getVtkOwner
//purpose :
return mode;
}
+//=======================================================================
+//function : controlMode
+//purpose : gets global control mode; return SMESH_Actor::eControl
+//=======================================================================
+QString SMESHGUI_Selection::controlMode() const
+{
+ if( myControls.count() > 0 ) {
+ QString mode = myControls[0];
+ for( int ind = 1; ind < myControls.count(); ind++ ) {
+ if( mode != myControls[ind] )
+ return "eNone";
+ }
+ return mode;
+ }
+ return "eNone";
+}
+
bool SMESHGUI_Selection::isNumFunctor( int ind ) const
{
bool result = false;