]> Creatis software - creaVtk.git/commitdiff
#3100 creaVtk Feature New Normal - Vectors Visu refresh
authorEduardo DAVILA <davila@localhost.localdomain>
Fri, 29 Dec 2017 14:10:10 +0000 (15:10 +0100)
committerEduardo DAVILA <davila@localhost.localdomain>
Fri, 29 Dec 2017 14:10:10 +0000 (15:10 +0100)
lib/creaVtk/vtkVectorsTensorsVisuBase.cpp
lib/creaVtk/vtkVectorsVisu.cpp
lib/creaVtk/vtkVectorsVisu.h

index ee7fc4999d6066a96640c5bedb001e17b4286343..5f6eeed8da7e91a05495f821d73eea2abd913634 100644 (file)
@@ -196,21 +196,21 @@ void vtkLookupTableDirectionVector::PrintSelf(ostream& os, vtkIndent indent)
 
 vtkVectorsTensorsVisuBase::vtkVectorsTensorsVisuBase()
 {
-      _firsttime       = true;
+       _firsttime      = true;
        _active         = false;
        _scalefactor= 1;
-       _opacity                = 1;
+       _opacity        = 1;
        _dataobject     = NULL;
        _renderer       = NULL;
-               _typeForm       = 0;
+       _typeForm       = 0;
 
        _LutEED         = vtkLookupTableDirectionVector::New();
-//     _LutEED->SetVectorMode(0);
-//_LutEED->SetVectorModeToMagnitude();
-//_LutEED->SetVectorModeToComponent();
-_LutEED->SetVectorModeToRGBColors();
+       //_LutEED->SetVectorMode(0);
+       //_LutEED->SetVectorModeToMagnitude();
+       //_LutEED->SetVectorModeToComponent();
+       _LutEED->SetVectorModeToRGBColors();
 
-       _pdm                            = vtkPolyDataMapper::New();
+       _pdm                    = vtkPolyDataMapper::New();
        _actor                  = vtkActor::New();
        _actorAdded             = false;
 }
index af6fe0d9c8eff54dbf9aaacf7a77d4112f494876..5b50b2ae0395e506e8e40c51243479be963eb3d8 100644 (file)
 vtkVectorsVisu::vtkVectorsVisu()
   :vtkVectorsTensorsVisuBase()
 {
-       _vtkarrowsource = vtkArrowSource::New();
-       _vtklinesource          = vtkLineSource::New();
+       _vtkarrowsource         = vtkArrowSource::New();
        _vtkglyph                       = vtkGlyph3D::New();
+       _vtklinesource          = vtkLineSource::New();
+
+       double point1[3];
+       double point2[3];
+       point1[0]=1;
+       point1[1]=0;
+       point1[2]=0;
+       point2[0]=-1;
+       point2[1]=0;
+       point2[2]=0;
+       _vtklinesource->SetPoint1( point1 );
+       _vtklinesource->SetPoint2( point2 );
 }
 
 
@@ -51,56 +62,31 @@ vtkVectorsVisu::~vtkVectorsVisu()
 //------------------------------------------------------------------------------
 void vtkVectorsVisu::Process()
 {
-printf("EED vtkVectorsVisu::Process()  start\n");
      if(_active==true)
      {
          _vtkglyph->SetInput( GetDataObject() );  
-
                        if(GetTypeForm()==1)                                                            // source Arrow
                        {
                 _vtkglyph->SetSource( _vtkarrowsource->GetOutput() );
                        } else {                                                                                                // source Line
                                _vtkglyph->SetSource( _vtklinesource->GetOutput() );    
                        }
-
          _vtkglyph->SetScaleModeToScaleByVector();
          _vtkglyph->SetColorModeToColorByVector();
          _vtkglyph->SetScaleFactor( GetScaleFactor() );
          _vtkglyph->Update();
-
          _pdm->SetInput( _vtkglyph->GetOutput());
-
 vtkPointData   *data   = _vtkglyph->GetOutput()->GetPointData();
 //printf("EED -------------------------------------------\n");
 //_vtkglyph->GetOutput()->Print(std::cout);
 //printf("EED -------------------------------------------\n");
 //data->Print(std::cout);
-printf("EED -------------------------------------------\n");                   
 int i,sizeDa = data->GetNumberOfArrays();
-printf("EED vtkVectorsVisu::Process  sizeDa %d \n", sizeDa );
 for (i=0;i<sizeDa;i++)
 {
-       printf("EED vtkVectorsVisu::Process-name %d, %s \n", i, data->GetArrayName(i) );
        data->GetArray(i)->Print(std::cout);
-       printf("EED -------------------------------------------\n");
 }
 
-//EED         _pdm->SetScalarRange( range );
-//EED         vtkPolyData      *pd                     = vGlyphFlowPlane->GetOutput();
-//EED         vtkPointData     *pointdata              = pd->GetPointData();
-//EED         vtkDataArray     *da                     = pointdata->GetVectors();
-//EED         vtkDataArray *nda = vtkFloatArray::New();
-//EED         nda->DeepCopy(da);
-//       pointdata->RemoveArray( "GlyphVector" );
-//       bbGetInputIn()->GetPointData()->RemoveArray( "GlyphVector" );
-//EED         pointdata->AddArray( nda );
-//EED         bbGetInputIn()->GetPointData()->AddArray( nda );
-//EED2         _pdm->ScalarVisibilityOn();
-
-
-
-
-
        _pdm->ScalarVisibilityOn();
        _pdm->SetColorModeToMapScalars();
        //_pdm->SetColorModeToDefault();
@@ -126,7 +112,6 @@ for (i=0;i<sizeDa;i++)
     }// if _active
 
     VisibilityActor(); 
-printf("EED vtkVectorsVisu::Process()  end\n");
 }
        
 
index 55981f0047622307aa14806a641cd9edaaf92e2a..0e2dda4efe67b34a9c90b75fe8d356f0ad593876 100644 (file)
 
 #include "vtkVectorsTensorsVisuBase.h"
 
-
 #include "vtkArrowSource.h"
 #include "vtkLineSource.h"
 #include "vtkGlyph3D.h"
 
-
-
 //---------------------------------------------
 // Class Name: vtkVectorsVisu
 // [classdescription]