[vtkusers] Read Rectilineargrid File::Only the grid is visible
Burlen
burlen at apollo.sr.unh.edu
Wed Sep 21 20:26:57 EDT 2005
Hi, I think you might try to change
clActor->GetProperty()->SetRepresentationToWireframe();
to
clActor->GetProperty()->SetRepresentationToSurface();
.
try that
On Wednesday 21 September 2005 02:15 pm, Winfried Bilgic wrote:
> Hello Folks,
>
> i tried many things but i was still unable to read an vector dataset from
> an rectilinear gridfile. What i get from the file is the visualization of
> the grid, but no surface. I bet the solution is easy, but with 11 hours
> working in my neck i need your helpful assistence.
>
> Thanks in advance and kind regards Winne
>
> SourceCode::
> #include "vtkDataReader.h"
> #include "vtkDataSet.h"
> #include "vtkRectilinearGridReader.h"
> #include "vtkRectilinearGrid.h"
> #include "vtkRectilinearGridGeometryFilter.h"
> #include "vtkRenderer.h"
> #include "vtkRenderWindow.h"
> #include "vtkRenderWindowInteractor.h"
> #include "vtkActor.h"
> #include "vtkProperty.h"
> #include "vtkPolyDataMapper.h"
>
> int main()
> {
> char *cVTKFile = NULL;
> // cVTKFile = "./files/dump-1.80000e+003.asc.vtk";
> cVTKFile = "./files/mslfilter.vtk";
> // cVTKFile = "./files/Original.vtk";
>
> vtkRectilinearGridReader *clReader = vtkRectilinearGridReader::New();
> clReader->SetFileName(cVTKFile);
>
> vtkRectilinearGrid *clGrid = NULL;
> vtkPointData *clPointData = NULL;
> clGrid=clReader->GetOutput(0);
>
> vtkRectilinearGridGeometryFilter *clGeoGrid =
> vtkRectilinearGridGeometryFilter::New(); clGeoGrid->SetInput(clGrid);
>
> vtkPolyDataMapper *clMapper = vtkPolyDataMapper::New();
> clMapper->SetInput(clGeoGrid->GetOutput());
>
> vtkActor *clActor = vtkActor::New();
> clActor->SetMapper(clMapper);
> clActor->GetProperty()->SetRepresentationToWireframe();
>
> vtkRenderer *clRen= vtkRenderer::New();
> clRen->AddActor(clActor);
>
> vtkRenderWindow *clRenWin = vtkRenderWindow::New();
> clRenWin->AddRenderer(clRen);
> clRenWin->SetSize(800,800);
>
> vtkRenderWindowInteractor *clIren = vtkRenderWindowInteractor::New();
> clIren->SetRenderWindow(clRenWin);
>
> clRenWin->Render();
> clIren->Start();
> clIren->Delete();
> clRenWin->Delete();
> clRen->Delete();
> clActor->Delete();
> clMapper->Delete();
> clGeoGrid->Delete();
> clReader->Delete();
>
> return 0;
> }
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
More information about the vtkusers
mailing list