[vtkusers] [Fwd: [Paraview] Writting files]
Eduardo Camargo
camargo at lncc.br
Wed Dec 12 08:44:01 EST 2007
Hi,
The problem was in the class VtkEnSightWriter. I have just
added "fclose(fd);" in the end of method
"WriteCaseFile".
HeMoLab Development Team
http://www.lncc.br/prjhemo/
---------------------------- Original Message
----------------------------
Subject: [Paraview] Writting files
From: "Eduardo Camargo" <camargo at lncc.br>
Date:
Mon, December 10, 2007 2:59 pm
To: paraview at paraview.org
--------------------------------------------------------------------------
Hi,
I have a problem with the
vtkEnsgihtWriter, the
method creates all files correctly (array and
.case files) but doesn`t
finish the .case file until the user closes
Paraview. The method used was
the follow:
void
GenerateCaseFiles(vtkUnstructuredGrid *grid)
{
vtkIntArray *bids = vtkIntArray::New();
bids->SetName("BlockId");
for(int i = 0; i
< grid->GetNumberOfCells(); i++)
bids->InsertNextValue(1);
grid->GetCellData()->SetScalars(bids);
char name[256];
sprintf(name,
"%s%s",
this->GetOutputPath(), "Out.case");
vtkEnSightWriter *
writer;
writer =
vtkEnSightWriter::New();
writer->SetFileName(name);
int
blockids[2];
blockids[0] = 1;
blockids[1] = 0;
writer->SetNumberOfBlocks(1);
writer->SetBlockIDs(blockids);
for(int i=0; i <
grid->GetNumberOfBlocks(); i++)
{
vtkUnstructuredGrid *output_grid =
vtkUnstructuredGrid::New();
output_grid->DeepCopy(grid);
this->GetGridOfInstantOfTime(i, output_grid);
writer->SetInput(output_grid);
writer->SetTimeStep(i);
writer->Write();
output_grid->Delete();
}
writer->UpdateInformation();
writer->UpdateWholeExtent();
writer->Update();
writer->WriteCaseFile(grid->GetNumberOfBlocks());
writer->Delete();
bids->Delete();
}
Regards,
Eduardo Camargo
Analista de Sistemas
HeMoLab -
http://www.lncc.br/prjhemo
Laboratório Nacional de
Computação Científica - LNCC
_______________________________________________
ParaView mailing
list
ParaView at paraview.org
http://www.paraview.org/mailman/listinfo/paraview
--
Atenciosamente,
Eduardo Camargo
Analista de
Sistemas
HeMoLab - http://www.lncc.br/prjhemo
Laboratório
Nacional de Computação Científica - LNCC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20071212/db965a7b/attachment.htm>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20071212/db965a7b/attachment-0001.htm>
More information about the vtkusers
mailing list