Salome HOME
Add possibility to build the module without VISU if it is abcent.
[samples/sierpinsky.git] / src / SierpinskyGUI / SierpinskyGUI_RunDlg.cxx
index 75088e224d276c6bf762a8eb59abc1825d905ba1..8bdb37805f6442e63a2c79c4956d561406a0c084 100644 (file)
@@ -49,7 +49,9 @@
 #include CORBA_SERVER_HEADER(Sierpinsky)
 #include CORBA_CLIENT_HEADER(Randomizer)
 #include CORBA_CLIENT_HEADER(SALOMEDS)
+#ifdef WITH_VISU
 #include CORBA_CLIENT_HEADER(VISU_Gen)
+#endif
 
 /*!
  * Get Randomizer component engine
@@ -95,6 +97,7 @@ static SIERPINSKY_ORB::SIERPINSKY_var getSierpinskyEngine()
   return aGen;
 }
 
+#ifdef WITH_VISU
 /*!
  * Get VISU component engine
  */
@@ -117,6 +120,7 @@ static VISU::VISU_Gen_var getVisuEngine()
   }
   return aGen;
 }
+#endif
 
 #define MY_EVENT QEvent::User + 555
 class MyEvent : public QEvent
@@ -362,6 +366,9 @@ SierpinskyGUI_RunDlg::SierpinskyGUI_RunDlg( QWidget* parent, SierpinskyGUI* modu
   myMedCheck->setChecked( false );
   myMedSize->setValue( 100 );
   myVisuCheck->setChecked( true );
+#ifndef WITH_VISU
+  myVisuCheck->setVisible( false );
+#endif
   updateState();
 }
 
@@ -568,6 +575,7 @@ void SierpinskyGUI_RunDlg::nextStep( const int step )
       double aMEDSize = myMedSize->value();
       if ( !aMEDFile.isEmpty() && aMEDSize > 0 ) {
         bool res = getSierpinskyEngine()->ExportToMED( aMEDFile.toLatin1().data(), aMEDSize );
+#ifdef WITH_VISU
        if ( res && myVisuCheck->isChecked() ) {
           VISU::VISU_Gen_var aVisuGen = getVisuEngine();
           if ( !CORBA::is_nil( aVisuGen ) ) {
@@ -577,6 +585,7 @@ void SierpinskyGUI_RunDlg::nextStep( const int step )
            myModule->getApp()->updateObjectBrowser( true );
           }
         }
+#endif
       }
     }
   }