if ( myId == LandCoverScalarMapModeOnId ) {
aTable = Handle(HYDROData_StricklerTable)::DownCast( HYDROGUI_Tool::GetSelectedObject( module() ) );
- if ( !aTable.IsNull() ) {
+ if ( !aTable.IsNull() && aViewId) {
aModule->setLandCoverColoringTable( aViewId, aTable );
}
} else if ( myId == LandCoverScalarMapModeOffId ) {
DEBTRACE("anEntry: " << anEntry.toStdString());
if (myObjectStateMap.find(theViewId) == myObjectStateMap.end())
{
- DEBTRACE("theViewId is not a valid key for myObjectStateMap, created");
+ DEBTRACE("theViewId is not a valid key for myObjectStateMap");
}
- Entry2ObjectStateMap& aEntry2ObjectStateMap = myObjectStateMap[ theViewId ]; // created OK if it does not exist
+ if (theViewId)
+ {
+ Entry2ObjectStateMap& aEntry2ObjectStateMap = myObjectStateMap[ theViewId ]; // created OK if it does not exist
+ DEBTRACE("myObjectStateMap key created");
- ObjectState& anObjectState = aEntry2ObjectStateMap[ anEntry ];
- anObjectState.Visibility = theState;
+ ObjectState& anObjectState = aEntry2ObjectStateMap[ anEntry ];
+ anObjectState.Visibility = theState;
+ }
HYDROGUI_DataObject* hydroObject = getDataModel()->getDataObject( theObject );
if ( hydroObject )
void HYDROGUI_Module::setLandCoverColoringTable( const size_t theViewId,
const Handle(HYDROData_StricklerTable)& theTable )
{
- if ( !theTable.IsNull() ) {
+ if ( !theTable.IsNull() && theViewId ) {
myLandCoverColoringMap.insert( theViewId, theTable );
}
}