]> Creatis software - creaMaracasVisu.git/blobdiff - bbtk/src/bbmaracasvisuContourCrown.cxx
no message
[creaMaracasVisu.git] / bbtk / src / bbmaracasvisuContourCrown.cxx
index 1c9e0ea1da1a3eea577c05274a3dacdf39dab6f3..1dac025acc6f081e4eea9b84961446225d01b24c 100644 (file)
@@ -13,6 +13,26 @@ BBTK_BLACK_BOX_IMPLEMENTATION(ContourCrown,bbtk::WxBlackBox);
 void ContourCrown::Process()
 {
 
+    if (firsttime==true)
+       {
+               firsttime=false;
+               if (bbGetInputwxVtkBaseView()==NULL) 
+               {
+                       wxMessageDialog(NULL,  bbtk::std2wx("(ContourCrown) Input 'wxVtkBaseView' is not set"),  bbtk::std2wx(bbGetFullName()) ).ShowModal();
+               }
+               if (bbGetInputIn()==NULL) 
+               {
+                       wxMessageDialog(NULL,  bbtk::std2wx("(ContourCrown) Input 'In' is not set"),  bbtk::std2wx(bbGetFullName()) ).ShowModal();
+               }
+       
+               mwxwidget->Init(  bbGetInputwxVtkBaseView(), bbGetInputIn() );
+               mwxwidget->ConfigureVTK();
+       
+               bbSetOutputImageValueResult( mwxwidget->GetVtkImageValueResult() );
+               bbSetOutputImageMaskResult( mwxwidget->GetVtkImageMaskResult() );
+       }
+       
+       
        if (mwxwidget!=NULL){
                //JSTG 04-04-08
                mwxwidget->SetControlPoints( bbGetInputControlPointsInX(), bbGetInputControlPointsInY(), bbGetInputControlPointsInZ() );
@@ -48,27 +68,15 @@ void ContourCrown::CreateWidget(wxWindow* parent)
 {
        bbtkDebugMessageInc("Core",9,"ContourCrown::CreateWidget()"<<std::endl);
   
-       if (bbGetInputwxVtkBaseView()==NULL) 
-    {
-      wxMessageDialog(NULL,  bbtk::std2wx("(ContourCrown) Input 'wxVtkBaseView' is not set"),  bbtk::std2wx(bbGetFullName()) ).ShowModal();
-    }
-       if (bbGetInputIn()==NULL) 
-    {
-      wxMessageDialog(NULL,  bbtk::std2wx("(ContourCrown) Input 'In' is not set"),  bbtk::std2wx(bbGetFullName()) ).ShowModal();
-    }
-
-       mwxwidget = new wxMaracasCoutourTool( parent, bbGetInputwxVtkBaseView(), bbGetInputIn() );
-       mwxwidget->ConfigureVTK();
-
-       bbSetOutputImageValueResult( mwxwidget->GetVtkImageValueResult() );
-       bbSetOutputImageMaskResult( mwxwidget->GetVtkImageMaskResult() );
-       bbSetOutputWidget(mwxwidget);
+       mwxwidget = new wxMaracasCoutourTool( parent );
+       bbSetOutputWidget( mwxwidget );
        bbtkDebugDecTab("Core",9);
 }
 
 //-----------------------------------------------------------
 void ContourCrown::bbUserSetDefaultValues()
 {
+       firsttime=true;
        mwxwidget = NULL;
        bbSetInputIn(NULL);
        bbSetInputwxVtkBaseView(NULL);