]> Creatis software - creaMaracasVisu.git/blobdiff - bbtk/src/bbmaracasvisuDrawAxisTree3D.cxx
#3418 creaMaracasVisu Feature New Normal - ManualPaint_model with openmp
[creaMaracasVisu.git] / bbtk / src / bbmaracasvisuDrawAxisTree3D.cxx
index 00fae1748ba908cee2709fc7467027938bf880a8..45ec0b7d52bf1de570da9ba36a9a9a416a08b0c8 100644 (file)
@@ -49,7 +49,13 @@ void DrawAxisTree3D::DrawOneAxis(int iGeneral,int numPoints, int iAxis)
        vtkActor                        *vtkactor               = vtkActor::New();
 
 //     polydatamapper->ScalarVisibilityOff();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        polydatamapper->SetInput(polydata);
+#else
+       polydatamapper->SetInputData(polydata);
+       polydatamapper->Update();
+#endif
        vtkactor->SetMapper(polydatamapper);
 
        vecVtkPolyData.push_back( polydata );
@@ -142,7 +148,6 @@ polyline->GetPointIds()->InsertNextId(i-iGeneral);
                vtkactor->GetProperty()->SetColor( r,g,b );
        }  // Law 2  color for each segment
 
-
        if (bbGetInputColourLaw()==3)  // color for each point 
        {
                // Setup the colors array
@@ -166,7 +171,6 @@ polyline->GetPointIds()->InsertNextId(i-iGeneral);
  
        }  // Law 3 color for each point
 
-
        vtkactor->GetProperty()->SetLineWidth( bbGetInputLineWidth() );
        vtkactor->GetProperty()->SetOpacity( bbGetInputOpacity() );
 
@@ -180,21 +184,27 @@ polyline->GetPointIds()->InsertNextId(i-iGeneral);
      {
            bbGetInputRenderer()->AddActor( vtkactor );
      }
+
 }
 
 
 void DrawAxisTree3D::Process()
 {
-       printf("EED DrawAxisTree3D::Process start \n");
 
        int iGeneral=0;
-       int iAxis,sizeLstAxis=bbGetInputlstIndexs().size();
+       std::vector<int> lstIndexs = bbGetInputlstIndexs();
+       if ( bbGetInputlstIndexs().size()==0 )
+       {
+               lstIndexs.push_back( bbGetInputlstPointX().size() );
+       } // if
+       int iAxis,sizeLstAxis=lstIndexs.size();
     int iActor,sizeActors = vecVtkActors.size();
        int numPoints;
 
-    if (oldLstSize!=sizeLstAxis)
-        {
-        oldLstSize=sizeLstAxis;
+
+//    if (oldLstSize!=sizeLstAxis)
+//      {
+//        oldLstSize=sizeLstAxis;
          for (iActor=0 ; iActor<sizeActors; iActor++)
          {
             if (bbGetInputRenderer()!=NULL )
@@ -203,15 +213,16 @@ void DrawAxisTree3D::Process()
                 vecVtkPolyData[iActor]->Delete();
                 vecVtkPolyDataMaper[iActor]->Delete();
                 vecVtkActors[iActor]->Delete();
-            }
-         }
+            } // if
+         } // for iActor
          vecVtkPolyData.clear();
          vecVtkPolyDataMaper.clear();
          vecVtkActors.clear();
 
+
         for ( iAxis=0 ; iAxis<sizeLstAxis ; iAxis++)
         {
-            numPoints = bbGetInputlstIndexs()[iAxis];
+            numPoints = lstIndexs[iAxis];
             DrawOneAxis(iGeneral,numPoints,iAxis);
             iGeneral = iGeneral+numPoints;
 
@@ -220,24 +231,23 @@ void DrawAxisTree3D::Process()
     //                 printf("EED  DrawAxisTree3D::Process  %d/%d\n", iAxis,sizeLstAxis );
     //         }
 
-        }
+        } // for iAxis
 
         if ( bbGetInputiAxis() < (int)(vecVtkActors.size()-1) )
         {
             bbSetOutputOutAxis( vecVtkActors[ bbGetInputiAxis() ] );
         } else         {
             printf("DrawAxisTree3D .ERROR. missing index vector...\n");
-        }
+        } // if 
+
+ //   } else {// if oldLstSize
 
-    } else {// if oldLstSize
         for (iActor=0 ; iActor<sizeActors; iActor++)
         {
             vecVtkActors[iActor]->GetProperty()->SetOpacity( bbGetInputOpacity() );
            vecVtkActors[iActor]->GetProperty()->SetLineWidth( bbGetInputLineWidth() );
         }
-    }
-
-       printf("EED DrawAxisTree3D::Process end \n");
+//    } // if oldLstSize
 
 }
 
@@ -276,6 +286,7 @@ void DrawAxisTree3D::bbUserSetDefaultValues()
      bbSetInputOpacity(1);
      bbSetInputLineWidth(0.5);
      bbSetInputColourLaw(1);
+     bbSetInputTransform(NULL);
 
 }