X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcreaVtk%2FvtkTensorsVisu.cpp;h=5ed091f1ca8d4a29b8208d1451a8a59adbdd4f09;hb=b5ae034170e154e060837d657257f22c422d4b21;hp=53f55174ca22e1b81b76a2a52bdaa8bae0bc21fe;hpb=01e86dfa5ed3ba31723d46760d83e267f7f1e558;p=creaVtk.git diff --git a/lib/creaVtk/vtkTensorsVisu.cpp b/lib/creaVtk/vtkTensorsVisu.cpp index 53f5517..5ed091f 100644 --- a/lib/creaVtk/vtkTensorsVisu.cpp +++ b/lib/creaVtk/vtkTensorsVisu.cpp @@ -33,6 +33,7 @@ vtkTensorsVisu::vtkTensorsVisu() : vtkVectorsTensorsVisuBase() { ss = vtkSphereSource::New(); + superquadratic = vtkSuperquadricSource::New(); cs = vtkCubeSource::New(); tg = vtkTensorGlyph::New(); pdn = vtkPolyDataNormals::New(); @@ -53,16 +54,19 @@ printf("EED vtkTensorsVisu::Process Start\n"); if (_active==true){ - std::string source="sphere"; +// std::string source="sphere"; + std::string source="superquadratic"; if(source=="sphere") { 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(source=="cube") - { - tg->SetSource(ss->GetOutput()); - } - else{} tg->SetInput( GetDataObject() ); @@ -118,7 +122,7 @@ printf("EED vtkTensorsVisu::Process Start\n"); _actor->GetProperty()->SetOpacity( GetOpacity() ); tg->ColorGlyphsOn(); - tg->ExtractEigenvaluesOn(); +// tg->ExtractEigenvaluesOn(); tg->SetColorModeToEigenvalues(); _pdm->SetLookupTable( _LutEED ); @@ -127,7 +131,7 @@ printf("EED vtkTensorsVisu::Process Start\n"); //int tcg = tg->GetColorGlyphs(); // tg->SetColorGlyphs(10); - //tg->SetColorModeToScalars(); +// tg->SetColorModeToScalars(); //tg->ThreeGlyphsOn(); @@ -146,15 +150,49 @@ printf("EED vtkTensorsVisu::Process Start\n"); + tg->Print( std::cout ); + printf("EED vtkTensorsVisu::Process ------------------------------------------\n"); + pd->Print( std::cout ); + + tg->Update(); vtkPolyData *pd = pdn->GetOutput(); vtkPointData *pointdata = pd->GetPointData(); + + + printf("EED vtkTensorsVisu::Process XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx\n"); + pointdata->Print( std::cout ); + + int aa = pd->GetNumberOfPieces (); + int bb = pd->GetNumberOfVerts (); + int cc = pd->GetNumberOfLines (); + int dd = pd->GetNumberOfPolys (); + int ee = pd->GetNumberOfStrips (); + int ff = pd->GetNumberOfCells(); + + printf("EED vtkTensorsVisu::Process %d %d %d %d %d %d \n", aa,bb,cc,dd,ee,ff); + + vtkPolyData *ttt = (vtkPolyData *)GetDataObject(); + int numPnts = ttt->GetNumberOfPoints(); + printf("EED vtkTensorsVisu::Process numPnts %d \n", numPnts ); + + + vtkIdType numSourcePts, numSourceCells; + vtkPoints *sourcePts; + sourcePts = tg->GetSource()->GetPoints(); + numSourcePts = sourcePts->GetNumberOfPoints(); + numSourceCells = tg->GetSource()->GetNumberOfCells(); + printf("EED vtkTensorsVisu::Process numSourcePts %d numSourceCells %d\n", numSourcePts, numSourceCells); + + + int i,sizeDa = pointdata->GetNumberOfArrays(); printf("EED vtkTensorsVisu::Process sizeDa %d \n", sizeDa ); for (i=0;iGetArrayName(i) , pointdata->GetArray(i)->GetSize() ); + int faces = pointdata->GetArray(i)->GetSize() / numPnts; + printf("EED vtkTensorsVisu::Process-name %d, %s, size=%d %d \n", i, pointdata->GetArrayName(i) , pointdata->GetArray(i)->GetSize(), faces ); }