{
}
-bool HYDROGUI_SetColorOp::CanObjectBeColored( const Handle(HYDROData_Entity)& theObject )
+bool HYDROGUI_SetColorOp::CanObjectBeColored( const Handle(HYDROData_Entity)& theObject,
+ HYDROGUI_Module* theModule )
{
if ( theObject.IsNull() )
return false;
- return theObject->IsKind( STANDARD_TYPE(HYDROData_Object) ) ||
- theObject->IsKind( STANDARD_TYPE(HYDROData_IPolyline) ) ||
- theObject->IsKind( STANDARD_TYPE(HYDROData_LandCover) );
+ bool isCanBeColored = false;
+ if ( theObject->IsKind( STANDARD_TYPE(HYDROData_LandCover) ) ) {
+ size_t anActiveViewId = HYDROGUI_Tool::GetActiveOCCViewId( theModule );
+ isCanBeColored = !theModule->isLandCoversScalarMapModeOn( anActiveViewId );
+ }
+
+ return isCanBeColored ||
+ theObject->IsKind( STANDARD_TYPE(HYDROData_Object) ) ||
+ theObject->IsKind( STANDARD_TYPE(HYDROData_IPolyline) );
}
void HYDROGUI_SetColorOp::startOperation()
// Get the selected object
//myEditedObject = Handle(HYDROData_Object)::DownCast( HYDROGUI_Tool::GetSelectedObject( module() ) );
myEditedObject = HYDROGUI_Tool::GetSelectedObject( module() );
- if ( !CanObjectBeColored( myEditedObject ) )
+ if ( !CanObjectBeColored( myEditedObject, module() ) )
{
abort();
return;
virtual ~HYDROGUI_SetColorOp();
- static bool CanObjectBeColored( const Handle(HYDROData_Entity)& theObject );
+ static bool CanObjectBeColored( const Handle(HYDROData_Entity)& theObject,
+ HYDROGUI_Module* theModule );
protected:
virtual void startOperation();