[vtkusers] Specifying cells with names

David E DeMarle dave.demarle at kitware.com
Mon Feb 27 13:38:33 EST 2012


Please keep discussions on the mailing list so that everyone can
contribute and benefit (and you're likely get faster responses).

I don't think the the point and cell associated array collections can
hold sparse arrays yet. You can find ways around this such as by
adding arrays to the data object associated vtkFieldData and coming up
with some convention to associate entries in the array with cell or
points indices.

David E DeMarle
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909



On Mon, Feb 20, 2012 at 9:15 AM, Brett Tully <brett.tully at oxyntix.com> wrote:
> Thanks David -- we want to use the XML format anyway, so no problems with
> the legacy readers/writers.
>
> Forgive me if this is a simple question (I have only been looking at VTK
> since Saturday) but does this mean that every cell (Line, Poly etc...) must
> have an entry in the StringArray? I have just generated the attached vtp
> file using a small python script that constructs using the minidom xml
> creator. If I wanted to set only the first line to have a name, can you
> suggest how I might do this?
>
> Kind regards,
> Brett.
>
>
> On Mon, Feb 20, 2012 at 12:53 PM, David E DeMarle <dave.demarle at kitware.com>
> wrote:
>>
>> Try adding a vtkStringArray
>> (http://www.vtk.org/doc/release/5.0/html/a02052.html) to the
>> vtkPolyData's vtkCellData arrays. Assuming the older vtk format
>> readers and writers respect that data type then you should be all set.
>> If not, try the newer vtk xml file format readers/writers they most
>> likely do.
>>
>> David E DeMarle
>> Kitware, Inc.
>> R&D Engineer
>> 21 Corporate Drive
>> Clifton Park, NY 12065-8662
>> Phone: 518-881-4909
>>
>>
>>
>> On Mon, Feb 20, 2012 at 7:10 AM, Brett Tully <brett.tully at oxyntix.com>
>> wrote:
>> > Dear all,
>> >
>> > We run a numerical simulation platform and are investigating the
>> > possibility
>> > of switching to VTK as our primary file format. One of the things we
>> > need to
>> > be able to do is identify cells of PolyData (specifically lines in 2D,
>> > or
>> > polys in 3d) by name. For instance, if we have a 2D simulation shaped
>> > like a
>> > box -- we would like to be able to label one of the boundaries 'inlet'
>> > and
>> > another 'outlet'. I have spent quite a bit of time looking around the
>> > web
>> > without luck -- can anyone here point me in a direction for more
>> > information? (I am currently trying to track down a copy of the VTK
>> > User's
>> > Guide).
>> >
>> > One of the ideas we have talked about is having a separate file for each
>> > boundary, but this seems like a bit of a hack.
>> >
>> > Regards,
>> > Brett.
>> >
>> > _______________________________________________
>> > Powered by www.kitware.com
>> >
>> > Visit other Kitware open-source projects at
>> > http://www.kitware.com/opensource/opensource.html
>> >
>> > Please keep messages on-topic and check the VTK 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