]> Creatis software - creaVtk.git/blobdiff - lib/creaVtk/vtkTensorsVisu.cpp
#2446 creaVtk Feature New Normal - Stream Tracer, Stream Line (interface, widget)
[creaVtk.git] / lib / creaVtk / vtkTensorsVisu.cpp
index 5ed091f1ca8d4a29b8208d1451a8a59adbdd4f09..046b0a5bbd5c35bf1bf1342175c7b54da34b7d7b 100644 (file)
 //------------------------------------------------------------------------
 vtkTensorsVisu::vtkTensorsVisu() : vtkVectorsTensorsVisuBase()
 {
-       ss              = vtkSphereSource::New();
+       ss                                      = vtkSphereSource::New();
        superquadratic  = vtkSuperquadricSource::New();
-       cs              = vtkCubeSource::New(); 
-       tg              = vtkTensorGlyph::New();
-       pdn             = vtkPolyDataNormals::New();
-       pd              = vtkPolyData::New();
-       pod             = vtkPointData::New();
+       cs                                      = vtkCubeSource::New(); 
+       tg                                      = vtkTensorGlyph::New();
+       pdn                                     = vtkPolyDataNormals::New();
+       pd                                      = vtkPolyData::New();
+       pod                                     = vtkPointData::New();
 }
 
 //------------------------------------------------------------------------
@@ -53,19 +53,18 @@ void vtkTensorsVisu::Process()
 printf("EED vtkTensorsVisu::Process Start\n");
 
 
-  if (_active==true){
-//        std::string source="sphere";
-        std::string source="superquadratic";
-       if(source=="sphere")
+  if (_active==true)
+  {
+
+       if(GetTypeForm()==2)                                                            // source superquadratic
        {
-               tg->SetSource(ss->GetOutput());
-       } else if(source=="cube") {
-               tg->SetSource(cs->GetOutput());
-       }else if(source=="superquadratic") {
                superquadratic->SetThetaResolution(20);
                superquadratic->SetPhiResolution(20);
                tg->SetSource(superquadratic->GetOutput());
-       } else {
+       } else if(GetTypeForm()==1) {                                   // source sphere
+               tg->SetSource(ss->GetOutput());
+       } else {                                                                                                // source cube
+               tg->SetSource(cs->GetOutput());         
        }
 
 
@@ -112,21 +111,21 @@ printf("EED vtkTensorsVisu::Process Start\n");
        _pdm->SetInput( pdn->GetOutput() );
        _pdm->ImmediateModeRenderingOn();
 
-         _pdm->ScalarVisibilityOn();
-         _pdm->SetScalarModeToUsePointFieldData();
+   _pdm->ScalarVisibilityOn();
+   _pdm->SetScalarModeToUsePointFieldData();
 
 
 //EED  _pdm->Update();
 
        _actor->SetMapper( _pdm );
-        _actor->GetProperty()->SetOpacity( GetOpacity() );
+   _actor->GetProperty()->SetOpacity( GetOpacity() );
 
        tg->ColorGlyphsOn();
 //     tg->ExtractEigenvaluesOn();
        tg->SetColorModeToEigenvalues();
 
-        _pdm->SetLookupTable( _LutEED );
-         _pdm->SelectColorArray( "Normals" );
+       _pdm->SetLookupTable( _LutEED );
+   _pdm->SelectColorArray( "Normals" );
 
 
        //int tcg = tg->GetColorGlyphs();