]> Creatis software - creaMaracasVisu.git/blobdiff - bbtk/src/bbmaracasvisuDrawAxisTree3D.cxx
*** empty log message ***
[creaMaracasVisu.git] / bbtk / src / bbmaracasvisuDrawAxisTree3D.cxx
index 4c80882c463d011ece282b76e2c942879f823ca8..79e256866eec7bbcffb0488464e5df65a426310a 100644 (file)
@@ -1,5 +1,7 @@
 #include "bbmaracasvisuDrawAxisTree3D.h"
 #include "bbcreaMaracasVisuPackage.h"
+#include "vtkLinearTransform.h"
+
 namespace bbcreaMaracasVisu
 {
 
@@ -38,10 +40,11 @@ void DrawAxisTree3D::DrawOneAxis(int iGeneral,int numPoints, int iAxis)
                for (i=iGeneral;i<size;i++)
                {
                        //multiplicar ver parametros spacing, en maracas cuando se toca la imagen y se ve dycom
-                       //hay parámetro dycom, vtkImagedata valor spacing y esos datos hay que multiplicar al polydata
+                       //hay par·metro dycom, vtkImagedata valor spacing y esos datos hay que multiplicar al polydata
                        allPoints->InsertNextPoint( bbGetInputlstPointX()[i]*spc[0],  
                                                                                bbGetInputlstPointY()[i]*spc[1], 
                                                                                bbGetInputlstPointZ()[i]*spc[2] );
+                       printf("DrawAxisTree3D::DrawOneAxis point  %d -> %f, %f, %f \n", i,  bbGetInputlstPointX()[i], bbGetInputlstPointY()[i], bbGetInputlstPointZ()[i] );
                        allTopology->InsertCellPoint( i-iGeneral );
                } // rof
                polydata->SetPoints( allPoints );
@@ -53,18 +56,27 @@ void DrawAxisTree3D::DrawOneAxis(int iGeneral,int numPoints, int iAxis)
        // color
        double r,g,b;
 
-       if ( (iAxis*3+1) < bbGetInputColour().size() ){
+       if ( (iAxis*3+1) < (int)(bbGetInputColour().size()) )
+       {
                        r = bbGetInputColour()[0+iAxis*3];
                        g = bbGetInputColour()[1+iAxis*3]; 
                        b = bbGetInputColour()[2+iAxis*3];
-               } else {
-                       r = bbGetInputColour()[0];
-                       g = bbGetInputColour()[1]; 
-                       b = bbGetInputColour()[2];
-               }
+       } else {
+//                     r = bbGetInputColour()[0];
+//                     g = bbGetInputColour()[1]; 
+//                     b = bbGetInputColour()[2];
+                       r = (rand() % 100) / 100.0;
+                       g = (rand() % 100) / 100.0;
+                       b = (rand() % 100) / 100.0;
+       }
 
-       vtkactor->GetProperty()->SetColor( 1,0,0 );
-       vtkactor->GetProperty()->SetLineWidth( 3 );
+       vtkactor->GetProperty()->SetColor( r,g,b );
+       vtkactor->GetProperty()->SetLineWidth( 0.5 );
+
+       if ( bbGetInputTransform()!=NULL )
+       {
+               vtkactor->SetUserTransform( bbGetInputTransform() );
+       }
 
      // Interface Update
      if  (bbGetInputRenderer()!=NULL )
@@ -100,6 +112,11 @@ void DrawAxisTree3D::Process()
                numPoints = bbGetInputlstIndexs()[iAxis];
                DrawOneAxis(iGeneral,numPoints,iAxis);
                iGeneral = iGeneral+numPoints;
+               
+               if ((iAxis % 1)==0)
+               {
+                       printf("EED  DrawAxisTree3D::Process  %d/%d\n", iAxis,sizeLstAxis );
+               }
        }
 
 
@@ -107,7 +124,7 @@ void DrawAxisTree3D::Process()
 
 }
 
-void DrawAxisTree3D::bbUserConstructor()
+void DrawAxisTree3D::bbUserSetDefaultValues()
 { 
         bbSetInputiAxis(0);
      std::vector<double> colour;
@@ -141,13 +158,18 @@ void DrawAxisTree3D::bbUserConstructor()
 
 }
 
-void DrawAxisTree3D::bbUserCopyConstructor()
-{  
-}
-
-void DrawAxisTree3D::bbUserDestructor()
-{  
-}
+       
+       //-----------------------------------------------------------------     
+       void DrawAxisTree3D::bbUserInitializeProcessing()
+       {
+       }
+       
+       //-----------------------------------------------------------------     
+       void DrawAxisTree3D::bbUserFinalizeProcessing()
+       {
+       }
+       
+       //-----------------------------------------------------------------     
 
 }
 // EO namespace bbcreaMaracasVisu