[vtkusers] Create a VTK-File in binary format

David Doria daviddoria+vtk at gmail.com
Thu Dec 17 06:28:32 EST 2009


On Thu, Dec 17, 2009 at 6:25 AM, David Doria
<daviddoria+vtk at gmail.com<daviddoria%2Bvtk at gmail.com>
> wrote:

> On Thu, Dec 17, 2009 at 5:46 AM, Dmitri Danewitz <d.danewitz at yahoo.de>wrote:
>
>>  Hello all!
>>
>> I want to create a VTK File  with my own C# program. I have the data
>> stored in int variables. Does someone know a way in C# to write them into a
>> vtk not as "12345" but as "?€ _ _" (binary) format?
>>
>> Thanks a lot!
>>
>> Dmitri
>>
>>
> Dmitri,
>
> You can use vtkXMLPolyDataWriter with SetDataModeToBinary<http://www.vtk.org/doc/nightly/html/classvtkXMLWriter.html#a5ca529771f07f666a6291086948d66ea>
> ()
>
> Let us know if this does what you're looking for.
>
> Thanks,
>
> David
>

I just noticed that you wanted a vtk file. Is there a reason for this? I
believe vtk files have been "depricated" and replaced by vtp files. If you
indeed want a vtk file, I think you can use:

vtkPolyDataWriter with
SetFileTypeToBinary<http://www.vtk.org/doc/nightly/html/classvtkDataWriter.html#a430bdf89f9711259820f703d6c846a1b>
()

Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091217/3b60e419/attachment.htm>


More information about the vtkusers mailing list