X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcreaVtk%2FvtkVectorsTensorsVisuBase.cpp;h=8da1d1a0cf5854268dc2b5e91ceb2d84de7b2200;hb=0a78cc1bbbd1875930b8e9b74053f947e33691ef;hp=4c2872458255da38e8d196e569e65d89774f4ebb;hpb=5cb2a22b34194409fb4cf97fd06a371d3c391acb;p=creaVtk.git diff --git a/lib/creaVtk/vtkVectorsTensorsVisuBase.cpp b/lib/creaVtk/vtkVectorsTensorsVisuBase.cpp index 4c28724..8da1d1a 100644 --- a/lib/creaVtk/vtkVectorsTensorsVisuBase.cpp +++ b/lib/creaVtk/vtkVectorsTensorsVisuBase.cpp @@ -26,13 +26,8 @@ */ #include "vtkVectorsTensorsVisuBase.h" - - #include "vtkObjectFactory.h" - - - vtkStandardNewMacro(vtkLookupTableDirectionVector); // Construct with range=(0,1); and hsv ranges set up for rainbow color table @@ -48,14 +43,11 @@ vtkLookupTableDirectionVector::~vtkLookupTableDirectionVector() { } - - unsigned char *vtkLookupTableDirectionVector::MapValue(double v) { //int idx = this->GetIndex(v); - //return (this->Table->GetPointer(0) + 4*idx); - + //return (this->Table->GetPointer(0) + 4*idx); return 0; } @@ -119,7 +111,7 @@ void vtkLookupTableMapDirVectorEED(vtkLookupTableDirectionVector *self, T *input inIncr=3; - printf("EED length %d %p\n", length,input); +// printf("EED length %d %p\n", length,input); // mag = new double[length]; for (i = 0; i < length; ++i) { @@ -129,10 +121,10 @@ inIncr=3; sum = 0; for (j = 0; j < inIncr; ++j) { - if (j==0) dirx= static_cast(*input); - if (j==1) diry= static_cast(*input); - if (j==2) dirz= static_cast(*input); - tmp = static_cast(*input); + if (j==0) dirx= static_cast(*input); + if (j==1) diry= static_cast(*input); + if (j==2) dirz= static_cast(*input); + tmp = static_cast(*input); sum += (tmp * tmp); ++input; } @@ -151,7 +143,6 @@ inIncr=3; } - //---------------------------------------------------------------------------- void vtkLookupTableDirectionVector::MapScalarsThroughTable2(void *input, unsigned char *output, @@ -160,7 +151,7 @@ void vtkLookupTableDirectionVector::MapScalarsThroughTable2(void *input, int inputIncrement, int outputFormat) { - printf("vtkLookupTableEED::MapScalarsThroughTable2 inputIncrement=%d inputDataType=%d\n",inputIncrement,inputDataType); +// printf("vtkLookupTableEED::MapScalarsThroughTable2 inputIncrement=%d inputDataType=%d\n",inputIncrement,inputDataType); // if (this->UseMagnitude && inputIncrement > 1) // { switch (inputDataType) @@ -196,23 +187,24 @@ void vtkLookupTableDirectionVector::PrintSelf(ostream& os, vtkIndent indent) vtkVectorsTensorsVisuBase::vtkVectorsTensorsVisuBase() { - _firsttime = true; - _active = false; - _scalefactor= 1; + _firsttime = true; + _active = false; + _scalefactor = 1; _opacity = 1; - _dataobject = NULL; - _renderer = NULL; - _typeForm = 0; + _dataobject = NULL; + _renderer = NULL; + _typeForm = 0; + _orientation = 0; _LutEED = vtkLookupTableDirectionVector::New(); -// _LutEED->SetVectorMode(0); -//_LutEED->SetVectorModeToMagnitude(); -//_LutEED->SetVectorModeToComponent(); -_LutEED->SetVectorModeToRGBColors(); - - _pdm = vtkPolyDataMapper::New(); - _actor = vtkActor::New(); - _actorAdded = false; + //_LutEED->SetVectorMode(0); + //_LutEED->SetVectorModeToMagnitude(); + //_LutEED->SetVectorModeToComponent(); + _LutEED->SetVectorModeToRGBColors(); + + _pdm = vtkPolyDataMapper::New(); + _actor = vtkActor::New(); + _actorAdded = false; } vtkVectorsTensorsVisuBase::~vtkVectorsTensorsVisuBase() @@ -305,8 +297,6 @@ void vtkVectorsTensorsVisuBase::Process() // virtual { } - - //------------------------------------------------------------------------------ void vtkVectorsTensorsVisuBase::VisibilityActor() { @@ -328,7 +318,6 @@ void vtkVectorsTensorsVisuBase::VisibilityActor() } // if _active==false } - //------------------------------------------------------------------------------ void vtkVectorsTensorsVisuBase::SetColorLaw(int colorlaw) { @@ -350,4 +339,16 @@ void vtkVectorsTensorsVisuBase::SetColor(std::vector rgb) } } +//------------------------------------------------------------------------------ +void vtkVectorsTensorsVisuBase::SetOrientation(int orientation) +{ + _orientation = orientation; +} + +//------------------------------------------------------------------------------ +int vtkVectorsTensorsVisuBase::GetOrientation() +{ + return _orientation; +} +