[Paraview] Fwd: Fwd: Fwd: annotating in paraview?
Nehmé Bilal
nehmebilal at gmail.com
Sat Mar 7 16:41:18 EST 2009
---------- Forwarded message ----------
From: Nehmé Bilal <nehmebilal at gmail.com>
Date: 2009/3/7
Subject: Re: Fwd: [Paraview] Fwd: annotating in paraview?
To: goller at gmail.com
Hi,
Lets say your verts output port contains 4 verts :
1 2 3 4
if you want to display "a" on vert 1, "b" on vert 2 and nothing on the
other verts, you can add one vtkStringArray that contains 4 element :
"a", "b", "", ""
then you do:
myOutput->GetPointData()->AddArray(myVtkStringArray) ;
If you want to have 2 options of labels:
Verts: 1 2 3 4
vtkStringArray1: "a" "b" "c" "d"
vtkStringArray2: "i" "j" "k" "F"
then you add two vtkStringArray to your output:
myOutput->GetPointData()->AddArray(myVtkStringArray1);
myOutput->GetPointData()->AddArray(myVtkStringArray2) ;
That will allow you to have different options of labeling.
The size of your vtkStringArray must be equal to the number of Points.
That's why i suggested to adding a new output port so you dont have to
add an empty string
on all you data that you don't want to annotate.
For adding labels using the user interface, I have no idea how to do
it. The text source is a static widget and I don't thing you wants a
static labels.
Nehme
2009/3/7 <goller at gmail.com>:
> That's a really good idea. Thanks!
>
> A few questions: in your method does every single vertex contain its own
> vtkStringArray even if the array is an array of empty strings?
> Also, does this allow me to add additional strings through the paraview
> interface? If so, is it possible to store those strings in an arbitrary
> location (I'm thinking database).
>
> Regards,
>
> Chris
>
> On Mar 7, 2009 10:30am, Nehmé Bilal <nehmebilal at gmail.com> wrote:
>> Hi Chris,
>>
>>
>>
>> To do the annotation your looking for, I suggest the following:
>>
>>
>>
>> - Add a new output port to your filter, reader or source. This output
>>
>> port will contain only verts.
>>
>> These verts will be the centers of you boxes where you want to display
>>
>> you labels.
>>
>>
>>
>> - Add a vtkStringArray to you verts (point based property) and set the
>>
>> value of each element in this array to the label
>>
>> you want to display at the corresponding vert position
>>
>>
>>
>> - In the pipeline browser, Apply your plugin, turn off visibility on
>>
>> all you output ports and keep visibile the annotation output port.
>>
>>
>>
>> - use the selection inspector to select all the points.
>>
>>
>>
>> - Use the selection inspector gui to turn on point label and then use
>>
>> label mode to select the annotation property you added (
>>
>> vtkStringArray).
>>
>>
>>
>> - Now you can see the labels on the verts, turn on the visibility of
>>
>> you other output ports and you will get the data with the boxes and
>>
>> labels you looking for ! (if you already added the boxes)
>>
>>
>>
>> If you dont want to add a new output port for labeling, you can add
>>
>> the labels to your vtkStringArray on the points where you want to
>>
>> display information and
>>
>> add an empty value on other points. ( vtkSringArray::InsertNextValue("") )
>>
>>
>>
>> I already done something similar, and it works perfectly.
>>
>>
>>
>>
>>
>> Nehme
>>
>>
>>
>>
>>
>> 2009/3/6 Moreland, Kenneth kmorel at sandia.gov>:
>>
>> > I think the closest thing you can do is select the cell and then create
>> > some
>>
>> > text annotation next to it. To select the cell, click the toolbar
>> > button
>>
>> > that has a green triangle in a dotted square with a mouse pointer (or
>> > hit
>>
>> > the ‘s’ key) and then click the cell in the 3D view. To create some
>> > text,
>>
>> > go to Sources -> Text, type the text you want in the object inspector,
>>
>> > apply, then move the text where you want it to go.
>>
>> >
>>
>> > If the text annotation you want happens to be a field variable on the
>> > cell,
>>
>> > you can automatically label with that. Turn on those labels with the
>>
>> > selection inspector (View -> Selection Inspector).
>>
>> >
>>
>> > -Ken
>>
>> >
>>
>> >
>>
>> > On 3/5/09 9:06 PM, "Chris Goller" goller at gmail.com> wrote:
>>
>> >
>>
>> > Hi-
>>
>> >
>>
>> > I'm trying to analyze data by rendering it in paraview and then
>>
>> > annotating it. I'd like to draw a box around anomalies and then write
>>
>> > some information about it.
>>
>> >
>>
>> > Is that possible to do?
>>
>> >
>>
>> > Thanks,
>>
>> >
>>
>> > Chris
>>
>> > _______________________________________________
>>
>> > 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 ParaView Wiki at:
>>
>> > http://paraview.org/Wiki/ParaView
>>
>> >
>>
>> > Follow this link to subscribe/unsubscribe:
>>
>> > http://www.paraview.org/mailman/listinfo/paraview
>>
>> >
>>
>> >
>>
>> >
>>
>> >
>>
>> > **** Kenneth Moreland
>>
>> > *** Sandia National Laboratories
>>
>> > ***********
>>
>> > *** *** *** email: kmorel at sandia.gov
>>
>> > ** *** ** phone: (505) 844-8919
>>
>> > *** web: http://www.cs.unm.edu/~kmorel
>>
>> >
>>
>> >
>>
>> > _______________________________________________
>>
>> > 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 ParaView Wiki at:
>>
>> > http://paraview.org/Wiki/ParaView
>>
>> >
>>
>> > Follow this link to subscribe/unsubscribe:
>>
>> > http://www.paraview.org/mailman/listinfo/paraview
>>
>> >
>>
>> >
>>
More information about the ParaView
mailing list