]> 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 c834ada83a2a76b01e51875f310a8e590a016ac5..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());         
        }