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;
}
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 );
}
//------------------------------------------------------------------------------
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();
}// if _active
VisibilityActor();
-printf("EED vtkVectorsVisu::Process() end\n");
}