]> Creatis software - creaMaracasVisu.git/commitdiff
Clean code
authoreduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Mon, 13 Jan 2025 16:33:59 +0000 (17:33 +0100)
committereduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Mon, 13 Jan 2025 16:33:59 +0000 (17:33 +0100)
bbtk/src/bbmaracasvisuShowNPoints.cxx
bbtk/src/bbmaracasvisuShowNPoints.h
bbtk/src/bbmaracasvisuViewerNV.cxx

index fb51a02953dc9ae59ad93353d1ddf6aef7a49e23..e5694152fa759a5dc0747fe9f197b3e6e2bca674 100644 (file)
@@ -36,9 +36,9 @@ namespace bbcreaMaracasVisu
 //------------------------------------------------------------------------
 //------------------------------------------------------------------------
 WidgetShowNPointsBox::WidgetShowNPointsBox(wxWindow *parent,  bbcreaMaracasVisu::ShowNPoints *box, int type)
-    : WidgetShowNPoints( parent, type)
+: WidgetShowNPoints( parent, type)
 {
-       mbbShowNPoints=box;
+    mbbShowNPoints=box;
 }
 
 //------------------------------------------------------------------------
@@ -50,30 +50,30 @@ WidgetShowNPointsBox::~WidgetShowNPointsBox()
 //------------------------------------------------------------------------
 void WidgetShowNPointsBox::UpdatePoints(wxCommandEvent &event)
 {
-       WidgetShowNPoints::UpdatePoints(event);
-       //Difference in Radio for text placement
-//     double radio=GetModelShowNPoints()->GetRadio();
-//     this->mopacity = sdrOpacity->GetValue()/100.0;
-//     GetModelShowNPoints()->SetRadio( sdrRadio->GetValue() ) ;
-//     radio = sdrRadio->GetValue();
-       //NTU refresh the inputs
-       mbbShowNPoints->bbSetInputOpacity( GetOpacity() );
-       mbbShowNPoints->bbSetInputRadio( GetRadio() );
-       // EED 
-//     RefreshPoints();
+    WidgetShowNPoints::UpdatePoints(event);
+    //Difference in Radio for text placement
+    // double radio=GetModelShowNPoints()->GetRadio();
+    // this->mopacity = sdrOpacity->GetValue()/100.0;
+    // GetModelShowNPoints()->SetRadio( sdrRadio->GetValue() ) ;
+    // radio = sdrRadio->GetValue();
+    //NTU refresh the inputs
+    mbbShowNPoints->bbSetInputOpacity( GetOpacity() );
+    mbbShowNPoints->bbSetInputRadio( GetRadio() );
+    // EED
+    // RefreshPoints();
 }
 
 
 //------------------------------------------------------------------------
 void WidgetShowNPointsBox::SetOutputBox()
 {
-       WidgetShowNPoints::SetOutputBox();
-
-//     wxString strTmp;
-//     strTmp.Printf(_T("Nbr of points: %d"), GetModelShowNPoints()->GetLstPointsSize() );
-//     txtNrPoints->SetLabel(  strTmp );
-
-       //--BBTK
+    WidgetShowNPoints::SetOutputBox();
+    
+    // wxString strTmp;
+    // strTmp.Printf(_T("Nbr of points: %d"), GetModelShowNPoints()->GetLstPointsSize() );
+    // txtNrPoints->SetLabel(  strTmp );
+    
+    //--BBTK
     mbbShowNPoints->bbSetOutputlstPointsX( GetLstPointsX() );
     mbbShowNPoints->bbSetOutputlstPointsY( GetLstPointsY() );
     mbbShowNPoints->bbSetOutputlstPointsZ( GetLstPointsZ() );
@@ -84,7 +84,7 @@ void WidgetShowNPointsBox::SetOutputBox()
     //    mbbShowNPoints->bbSetOutputlstPointsY( GetModelShowNPoints()->GetLstPointsY() );
     //    mbbShowNPoints->bbSetOutputlstPointsZ( GetModelShowNPoints()->GetLstPointsZ() );
     //    mbbShowNPoints->bbSetOutputlstLabels( GetModelShowNPoints()->GetLstLabels() );
-       mbbShowNPoints->bbSignalOutputModification();
+    mbbShowNPoints->bbSignalOutputModification();
 }
 
 
@@ -100,32 +100,32 @@ BBTK_BLACK_BOX_IMPLEMENTATION(ShowNPoints,bbtk::WxBlackBox);
 void ShowNPoints::Process()
 {
     printf("EED ShowNPoints::Process start \n");
-       if (mwxwidget!=NULL)
-       {
+    if (mwxwidget!=NULL)
+    {
         mwxwidget->SetImage( bbGetInputImage() );
-               mwxwidget->SetRenderer( bbGetInputRenderer() );
-               mwxwidget->SetReferencePoint( bbGetInputIn() );
-               mwxwidget->SetColour( bbGetInputColour() );
-//             mwxwidget->SetOpacity( bbGetInputOpacity() );
-               mwxwidget->SetRadio( bbGetInputRadio() );
+        mwxwidget->SetRenderer( bbGetInputRenderer() );
+        mwxwidget->SetReferencePoint( bbGetInputIn() );
+        mwxwidget->SetColour( bbGetInputColour() );
+        //             mwxwidget->SetOpacity( bbGetInputOpacity() );
+        mwxwidget->SetRadio( bbGetInputRadio() );
         if ( backOpacity!=bbGetInputOpacity() )
         {
             backOpacity = bbGetInputOpacity();
             mwxwidget->SetOpacity( bbGetInputOpacity() );
         } // if backOpacity
-//        if (firsttime==true)
-//        {
-//            firsttime=false;
-            if ( mwxwidget->GetModelShowNPoints()->GetFirstTime()==false )
-            {
-                mwxwidget->DetectCollectionActive();
-            }
-            if ( mwxwidget->GetModelShowNPoints()->GetFirstTime()==true )
-            {
-                mwxwidget->GetModelShowNPoints()->SetFirstTime(false);
-                mwxwidget->SetInitLstPoints( bbGetInputInitLstPointsX() , bbGetInputInitLstPointsY() , bbGetInputInitLstPointsZ() , bbGetInputInitLstLabels() ,  bbGetInputInitLstIndexs() );
-            }
-//        } // firsttime OJO machete Eduardo pour ANDREAS a verificar
+        //        if (firsttime==true)
+        //        {
+        //            firsttime=false;
+        if ( mwxwidget->GetModelShowNPoints()->GetFirstTime()==false )
+        {
+            mwxwidget->DetectCollectionActive();
+        }
+        if ( mwxwidget->GetModelShowNPoints()->GetFirstTime()==true )
+        {
+            mwxwidget->GetModelShowNPoints()->SetFirstTime(false);
+            mwxwidget->SetInitLstPoints( bbGetInputInitLstPointsX() , bbGetInputInitLstPointsY() , bbGetInputInitLstPointsZ() , bbGetInputInitLstLabels() ,  bbGetInputInitLstIndexs() );
+        }
+        //        } // firsttime OJO machete Eduardo pour ANDREAS a verificar
         mwxwidget->AutoAddPoints();
         mwxwidget->TrackingPoint();
         bbSetOutputlstPointsX( mwxwidget->GetLstPointsX()               );
@@ -135,34 +135,41 @@ void ShowNPoints::Process()
         bbSetOutputlstIndexs( mwxwidget->GetLstIndexs()                 );
         bbSetOutputlstSelectedIndexs( mwxwidget->GetLstSelectedIndexs() );
         bbSetOutputWidgetShowNPoints( (WidgetShowNPoints*)mwxwidget );
-       } // mwxwidget
+    } // mwxwidget
     printf("EED ShowNPoints::Process end \n");
 }
 
 //-----------------------------------------------------------------
 void ShowNPoints::CreateWidget(wxWindow* parent)
 {
-       mwxwidget = new WidgetShowNPointsBox( parent, this, bbGetInputType() );
+    printf("EED ShowNPoints::CreateWidget\n");
+    mwxwidget = new WidgetShowNPointsBox( parent, this, bbGetInputType() );
     bbSetOutputWidget( mwxwidget );
 }
 
+//-----------------------------------------------------------------
+void  ShowNPoints::OnShowWidget()
+{
+//    mwxwidget->SetRenderer( bbGetInputRenderer() );
+}
+
 //-----------------------------------------------------------------
 void ShowNPoints::bbUserSetDefaultValues()
 {
     firsttime   = true;
     backOpacity = -1;
-       mwxwidget   = NULL;
-       bbSetInputRadio(10);
-       bbSetInputOpacity(1);
-       std::vector<double> colour;
-       colour.push_back(1.0);
-       colour.push_back(1.0);
-       colour.push_back(0.0);
-       bbSetInputColour(colour);
-       bbSetInputImage(NULL);
-       bbSetInputType(0);
-       bbSetInputRenderer(NULL);
-       bbSetOutputWidgetShowNPoints(NULL);
+    mwxwidget   = NULL;
+    bbSetInputRadio(10);
+    bbSetInputOpacity(1);
+    std::vector<double> colour;
+    colour.push_back(1.0);
+    colour.push_back(1.0);
+    colour.push_back(0.0);
+    bbSetInputColour(colour);
+    bbSetInputImage(NULL);
+    bbSetInputType(0);
+    bbSetInputRenderer(NULL);
+    bbSetOutputWidgetShowNPoints(NULL);
 }
 
 //-----------------------------------------------------------------
@@ -175,6 +182,4 @@ void ShowNPoints::bbUserFinalizeProcessing()
 {
 }
 
-//-----------------------------------------------------------------
-
 } // EO namespace bbcreaMaracasVisu
index 69a424b398cf52cd7485e4d10a48dd4539f3ba09..7c709a0bb7be7fcbd33fd0080c70c571d7ebfbc4 100644 (file)
@@ -87,6 +87,9 @@ class /*BBTK_EXPORT*/ ShowNPoints
   void CreateWidget(wxWindow*);
   double backOpacity;
     
+  BBTK_ON_SHOW_WIDGET(OnShowWidget);
+  void OnShowWidget();
+
 private:
     bool                    firsttime;
        WidgetShowNPointsBox    *mwxwidget;
index b8f2c62453084e5d2623102d01e50a7b60cfbc45..d106f423c2fbefc8cc94f1dad22ddc208a2a4cda 100644 (file)
@@ -111,6 +111,7 @@ BBTK_BLACK_BOX_IMPLEMENTATION(ViewerNV,bbtk::WxBlackBox);
 //-------------------------------------------------------------
 void ViewerNV::Process()
 {
+    printf("EED \10ViewerNV::Process\n");
        vtkImageData* img               = bbGetInputIn();
        std::vector<int> type   = bbGetInputnTypeView();
        if(img != NULL && _mwxwidget != NULL)
@@ -182,6 +183,8 @@ void ViewerNV::Process()
 //-------------------------------------------------------------
 void ViewerNV::CreateWidget(wxWindow* parent)
 {
+    printf("EED \10ViewerNV::CreateWidget\n");
+
     bbtkDebugMessageInc("Core",9,"ViewerNV::CreateWidget()"<<std::endl);
     _mwxwidget = new bbwxMaracas_N_ViewersWidget( this, parent );
     bbtkDebugDecTab("Core",9);
@@ -196,6 +199,8 @@ void ViewerNV::CreateWidget(wxWindow* parent)
 // when window is shown
 void ViewerNV::OnShowWidget()
 {
+    printf("EED \10ViewerNV::OnShowWidget\n");
+
     if (bbGetOutputWidget()!=NULL)
     {
         bbGetOutputWidget()->Layout();