]> Creatis software - creaMaracasVisu.git/blobdiff - bbtk/src/bbmaracasvisuShowNPoints.cxx
BUG 1440 and 1441
[creaMaracasVisu.git] / bbtk / src / bbmaracasvisuShowNPoints.cxx
index 63b5236cb28ed3f5ffb173941a4c2f4f05b1437c..25debba998835ec2288161ba90eb76b10d9a49d3 100644 (file)
@@ -6,6 +6,7 @@
 #include "vtkPolyDataMapper.h"
 #include "vtkRenderWindow.h"
 #include "vtkTextActor3D.h"
+#include <vtkTextProperty.h>
 
 namespace bbcreaMaracasVisu
 {
@@ -344,7 +345,8 @@ void WidgetShowNPoints::OnAddPoint (wxCommandEvent& event)
                //EED
 
                int result_FD = FD->ShowModal();
-
+               std::string tmpLabel;
+               
                // This line is need it by windows //EED
                FD->SetReturnCode( result_FD );
 
@@ -366,7 +368,13 @@ void WidgetShowNPoints::OnAddPoint (wxCommandEvent& event)
                                        y=lstPointsY[i];
                                        z=lstPointsZ[i];
                                        value= mimage->GetScalarComponentAsDouble(x,y,z,0);
-                                       fprintf(ff,"%d\t%d\t%d\t%f\t%s\n", x , y , z , value  , lstLabels[i].c_str());
+                                       if (lstLabels[i]!="") 
+                                       {
+                                               tmpLabel=lstLabels[i];
+                                       } else{
+                                           tmpLabel="<_VOID_>";
+                                       }
+                                       fprintf(ff,"%d\t%d\t%d\t%f\t%s\n", x , y , z , value  , tmpLabel.c_str());
                                } // for
                                fclose(ff);
                        } else {   // else ff
@@ -409,6 +417,7 @@ void WidgetShowNPoints::OnAddPoint (wxCommandEvent& event)
                                for (i=0; i<size; i++)
                                {
                                        fscanf(ff,"%d%d%d%f%s",&x,&y,&z,&value,chartmp );  // x,y,z,value,label
+                                       if (strcmp(chartmp,"<_VOID_>")==0) { strcpy(chartmp,""); }
                                        AddPoint(x,y,z, chartmp );
                                }
                                fclose(ff);
@@ -591,6 +600,7 @@ void WidgetShowNPoints::UpdatePoints(wxCommandEvent &event)
        {
                this->lstSourceSphere[i]->SetRadius(mradio);
                this->lstActorsSphere[i]->GetProperty()->SetOpacity(mopacity);
+               this->lstActorsText[i]->GetTextProperty()->SetOpacity(mopacity);
                this->lstActorsText[i]->SetPosition(this->lstActorsText[i]->GetPosition()[0]+difradio,this->lstActorsText[i]->GetPosition()[1], this->lstActorsText[i]->GetPosition()[2]);
        }