vtkTensorsVisu::vtkTensorsVisu() : vtkVectorsTensorsVisuBase()
{
ss = vtkSphereSource::New();
+ superquadratic = vtkSuperquadricSource::New();
cs = vtkCubeSource::New();
tg = vtkTensorGlyph::New();
pdn = vtkPolyDataNormals::New();
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() );
_actor->GetProperty()->SetOpacity( GetOpacity() );
tg->ColorGlyphsOn();
- tg->ExtractEigenvaluesOn();
+// tg->ExtractEigenvaluesOn();
tg->SetColorModeToEigenvalues();
_pdm->SetLookupTable( _LutEED );
//int tcg = tg->GetColorGlyphs();
// tg->SetColorGlyphs(10);
- //tg->SetColorModeToScalars();
+// tg->SetColorModeToScalars();
//tg->ThreeGlyphsOn();
+ 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;i<sizeDa;i++)
{
- printf("EED vtkTensorsVisu::Process-name %d, %s, size=%d \n", i, pointdata->GetArrayName(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 );
}