#include "VISU_Convertor.hxx"
#include "VISU_ConvertorUtils.hxx"
-typedef VISU_ScalarMapOnDeformedShapePL TPresent;
+typedef VISU_ScalarMapPL TPresent;
#include <vtkUnstructuredGrid.h>
#include <vtkDataSetMapper.h>
+#include <vtkInteractorStyleTrackballCamera.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkRenderWindow.h>
#include <vtkImageData.h>
{
try{
if(argc > 1){
- vtkRenderWindow *renWin = vtkRenderWindow::New();
- vtkRenderer *ren = vtkRenderer::New();
- renWin->AddRenderer(ren);
- ren->GetActiveCamera()->ParallelProjectionOn();
- vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
- iren->SetRenderWindow(renWin);
+ vtkRenderWindow *aWindow = vtkRenderWindow::New();
+ vtkRenderer *aRenderer = vtkRenderer::New();
+
+ aWindow->AddRenderer(aRenderer);
+ aRenderer->GetActiveCamera()->ParallelProjectionOn();
+
+ vtkRenderWindowInteractor *anInteractor = vtkRenderWindowInteractor::New();
+ anInteractor->SetRenderWindow(aWindow);
+ aWindow->Delete();
+
+ vtkInteractorStyle* aStyle = vtkInteractorStyleTrackballCamera::New();
+ anInteractor->SetInteractorStyle(aStyle);
+ aStyle->Delete();
+
VISU_Convertor* aConvertor = CreateConvertor(argv[1]);
aConvertor->BuildEntities();
aConvertor->BuildGroups();
vtkActor* aActor = vtkActor::New();
aActor->SetMapper(aPresent->GetMapper());
aActor->GetProperty()->SetRepresentation(VTK_WIREFRAME);
- //ren->ResetCameraClippingRange();
+ //aRenderer->ResetCameraClippingRange();
- ren->AddActor(aActor);
+ aRenderer->AddActor(aActor);
- renWin->Render();
- iren->Start();
+ aWindow->Render();
+ anInteractor->Start();
return 0;
}
//Import fields
VISU_ColoredPL* aPresent = NULL;
if(anEntity != VISU::NODE_ENTITY){
+ continue;
aPresent = CreateColoredPL<TPresent>(aConvertor,
aMeshName,
anEntity,
aFieldName,
aTimeStamp);
}else{
- continue;
aPresent = CreateColoredPL<TPresent>(aConvertor,
aMeshName,
anEntity,
VISU_ScalarBarActor * aScalarBar = VISU_ScalarBarActor::New();
aScalarBar->SetLookupTable(aPresent->GetBarTable());
- ren->AddActor(anActor);
- ren->AddActor2D(aScalarBar);
+ aRenderer->AddActor(anActor);
+ aRenderer->AddActor2D(aScalarBar);
- renWin->Render();
- ren->ResetCamera();
+ aWindow->Render();
+ aRenderer->ResetCamera();
- iren->Start();
+ anInteractor->Start();
return 0;
}
}