myIsEdit( theIsEdit ),
myActiveViewManager( NULL ),
myPreviewViewManager( NULL ),
+ myShowGeomObjects( true ),
+ myShowLandCovers( false ),
myShowZones( false )
{
setName( myIsEdit ? tr( "EDIT_CALCULATION" ) : tr( "CREATE_CALCULATION" ) );
if ( !aPanel )
return;
+ setLandCoversVisible( true );
+
QStringList aList;
QStringList anEntryList;
HYDROData_SequenceOfObjects aSeq;
QApplication::setOverrideCursor( Qt::WaitCursor );
+ setGeomObjectsVisible( false );
+ setLandCoversVisible( false );
+
QString aNewCaseName = aPanel->getObjectName();
QString anOldCaseName = myEditedObject->GetName();
bool isNameChanged = anOldCaseName != aNewCaseName;
{
if( theIndex==1 )
{
+ setGeomObjectsVisible( true );
+
closePreview( false );
createPreview( false );
}
if( theIndex==2 )
{
+ setLandCoversVisible( true );
+
closePreview( false );
createPreview( true );
}
}
+void HYDROGUI_CalculationOp::setGeomObjectsVisible( bool theIsVisible )
+{
+ myShowGeomObjects = theIsVisible;
+
+ HYDROData_SequenceOfObjects aSeq = myEditedObject->GetGeometryObjects();
+
+ HYDROData_SequenceOfObjects::Iterator anIter( aSeq );
+ for ( ; anIter.More(); anIter.Next() ) {
+ setObjectVisibility( anIter.Value(), theIsVisible );
+ }
+}
+
+void HYDROGUI_CalculationOp::setLandCoversVisible( bool theIsVisible )
+{
+ myShowLandCovers = theIsVisible;
+
+ HYDROData_SequenceOfObjects aSeq = myEditedObject->GetLandCovers();
+
+ HYDROData_SequenceOfObjects::Iterator anIter( aSeq );
+ for ( ; anIter.More(); anIter.Next() ) {
+ setObjectVisibility( anIter.Value(), theIsVisible );
+ }
+}
+
void HYDROGUI_CalculationOp::AssignDefaultZonesColors( const bool theLandCover )
{
HYDROData_SequenceOfObjects aRegions = myEditedObject->GetRegions( theLandCover );
{
LightApp_Application* anApp = module()->getApp();
HYDROData_SequenceOfObjects aSeq;
- if ( theLandCover )
- aSeq = myEditedObject->GetLandCovers();
- else
- aSeq = myEditedObject->GetGeometryObjects();
+ if ( theLandCover && myShowLandCovers )
+ {
+ HYDROData_SequenceOfObjects aSeqLC = myEditedObject->GetLandCovers();
+ aSeq.Append( aSeqLC );
+ }
+ else if ( !theLandCover && myShowGeomObjects )
+ {
+ HYDROData_SequenceOfObjects aSeqGO = myEditedObject->GetGeometryObjects();
+ aSeq.Append( aSeqGO );
+ }
Handle(HYDROData_Entity) anEntity;
void closePreview( bool theRemoveViewManager = true );
void setObjectVisibility( Handle(HYDROData_Entity) theEntity, const bool theIsVisible );
void setZonesVisible( bool theIsVisible, const bool theLandCover );
+ void setGeomObjectsVisible( bool theIsVisible );
+ void setLandCoversVisible( bool theIsVisible );
void getNamesAndEntries( const HYDROData_SequenceOfObjects& theSeq,
QStringList& theNames, QStringList& theEntries ) const;
private:
bool myIsEdit;
bool myShowZones;
+ bool myShowGeomObjects;
+ bool myShowLandCovers;
Handle(HYDROData_CalculationCase) myEditedObject;
SUIT_ViewManager* myActiveViewManager;