X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=bbtk%2Fsrc%2FbbmaracasvisuDrawAxe3D.cxx;h=14db3707048d91771fe441748d9161dcca544684;hb=4ed4922b791cc64cd91c56d5fa285b5cfedc0811;hp=821576a8304f2cf4b97b34dc5c704ed20f562354;hpb=de5cb63cdc23317a114c77f7b6184126d7988508;p=creaMaracasVisu.git diff --git a/bbtk/src/bbmaracasvisuDrawAxe3D.cxx b/bbtk/src/bbmaracasvisuDrawAxe3D.cxx index 821576a..14db370 100644 --- a/bbtk/src/bbmaracasvisuDrawAxe3D.cxx +++ b/bbtk/src/bbmaracasvisuDrawAxe3D.cxx @@ -4,12 +4,12 @@ #include "vtkImageData.h" #include "vtkActor.h" -#include "vtkPolyDataMapper.h" #include "vtkPoints.h" #include "vtkCellArray.h" #include "vtkProperty.h" +#include "vtkLinearTransform.h" namespace bbcreaMaracasVisu { @@ -38,7 +38,7 @@ void DrawAxe3D::Process() for( i = 0; i < vectx.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( vectx[i]*spc[0], vecty[i]*spc[1], vectz[i]*spc[2] ); allTopology->InsertCellPoint( i ); } // rof @@ -66,16 +66,13 @@ void DrawAxe3D::Process() } -void DrawAxe3D::bbUserConstructor() +void DrawAxe3D::bbUserSetDefaultValues() { firsttime = true; - mallData = vtkPolyData::New( ); - vtkPolyDataMapper* polydatamapper = vtkPolyDataMapper::New(); - mvtkactor = vtkActor::New(); - polydatamapper->SetInput(mallData); - mvtkactor->SetMapper(polydatamapper); - bbSetOutputOut(mvtkactor); - + mallData = NULL; + polydatamapper = NULL; + mvtkactor = NULL; + std::vector colour; colour.push_back(1.0); colour.push_back(0.0); @@ -83,12 +80,47 @@ void DrawAxe3D::bbUserConstructor() bbSetInputColour(colour); } -void DrawAxe3D::bbUserCopyConstructor(bbtk::BlackBox::Pointer) -{ -} -void DrawAxe3D::bbUserDestructor() -{ -} + + + //----------------------------------------------------------------- + void DrawAxe3D::bbUserInitializeProcessing() + { + mallData = vtkPolyData::New( ); + polydatamapper = vtkPolyDataMapper::New(); + mvtkactor = vtkActor::New(); + + polydatamapper->SetInput(mallData); + mvtkactor->SetMapper(polydatamapper); + bbSetOutputOut(mvtkactor); + } + + //----------------------------------------------------------------- + void DrawAxe3D::bbUserFinalizeProcessing() + { + if (mallData!=NULL) + { + mallData->Delete(); + mallData=NULL; + } + + if (polydatamapper!=NULL) + { + polydatamapper->Delete(); + polydatamapper=NULL; + } + + if (mvtkactor!=NULL) + { + mvtkactor->Delete(); + mvtkactor=NULL; + } + + } + + //----------------------------------------------------------------- + + + }