X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=bbtk%2Fsrc%2FbbmaracasvisuDrawAxisTree3D.cxx;h=45ec0b7d52bf1de570da9ba36a9a9a416a08b0c8;hb=cf87bb498ccc24b1fb1aa2104957e0cb1afad2f2;hp=e43b35b960c6ee3e22875114510ef69d1c524038;hpb=bb69ea7be3f8baa4122fb51d04b4ec6ce906c809;p=creaMaracasVisu.git diff --git a/bbtk/src/bbmaracasvisuDrawAxisTree3D.cxx b/bbtk/src/bbmaracasvisuDrawAxisTree3D.cxx index e43b35b..45ec0b7 100644 --- a/bbtk/src/bbmaracasvisuDrawAxisTree3D.cxx +++ b/bbtk/src/bbmaracasvisuDrawAxisTree3D.cxx @@ -44,13 +44,18 @@ BBTK_BLACK_BOX_IMPLEMENTATION(DrawAxisTree3D,bbtk::AtomicBlackBox); void DrawAxisTree3D::DrawOneAxis(int iGeneral,int numPoints, int iAxis) { -printf("EED DrawAxisTree3D::DrawOneAxis Start \n"); vtkPolyData *polydata = vtkPolyData::New( ); vtkPolyDataMapper *polydatamapper = vtkPolyDataMapper::New(); 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 ); @@ -143,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 @@ -160,7 +164,6 @@ polyline->GetPointIds()->InsertNextId(i-iGeneral); g = bbGetInputColour()[1+iPoint*3]*255.0; b = bbGetInputColour()[2+iPoint*3]*255.0; //colors->SetTuple3(iPoint,r,g,b); -printf("EED DrawAxisTree3D::DrawOneAxis iPoint=%d size=%d rgb=%f% f% f \n", iPoint , bbGetInputColour().size() , r,g,b); colors->InsertNextTuple3(r,g,b); } polydata->GetCellData()->SetScalars(colors); @@ -181,22 +184,27 @@ printf("EED DrawAxisTree3D::DrawOneAxis iPoint=%d size=%d rgb=%f% f% f \n", { bbGetInputRenderer()->AddActor( vtkactor ); } -printf("EED DrawAxisTree3D::DrawOneAxis End \n"); + } void DrawAxisTree3D::Process() { - printf("EED DrawAxisTree3D::Process start \n"); int iGeneral=0; - int iAxis,sizeLstAxis=bbGetInputlstIndexs().size(); + std::vector 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 ; iActorDelete(); vecVtkPolyDataMaper[iActor]->Delete(); vecVtkActors[iActor]->Delete(); - } - } + } // if + } // for iActor vecVtkPolyData.clear(); vecVtkPolyDataMaper.clear(); vecVtkActors.clear(); + for ( iAxis=0 ; iAxisGetProperty()->SetOpacity( bbGetInputOpacity() ); + vecVtkActors[iActor]->GetProperty()->SetLineWidth( bbGetInputLineWidth() ); } - } - - printf("EED DrawAxisTree3D::Process end \n"); +// } // if oldLstSize } @@ -277,6 +286,7 @@ void DrawAxisTree3D::bbUserSetDefaultValues() bbSetInputOpacity(1); bbSetInputLineWidth(0.5); bbSetInputColourLaw(1); + bbSetInputTransform(NULL); }