[Paraview] Save State/adding custom property

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Mon May 30 08:10:48 EDT 2016


There's a preexisting feature called "annotation" that vtkSMProxy
supports via the following API. Seems to me that'd map well to what
you're trying to do with the "user" property.

void SetAnnotation (const char *key, const char *value)
const char * GetAnnotation (const char *key)
void RemoveAnnotation (const char *key)
void RemoveAllAnnotations ()
bool HasAnnotation (const char *key)
int GetNumberOfAnnotations ()
const char * GetAnnotationKeyAt (int index)

Utkarsh

On Sun, May 29, 2016 at 1:37 PM, michal wozniak <michalwozniak at live.ca> wrote:
> Hi everyone,
>
> I am trying to add a custom property to the state xml.
>
> For eg:
>
> I loaded object.stl and did a slice on it. Then, I saved the state and went
> to look at the XML.
>
> <ProxyCollection name="sources">
>       <Item id="4031" name="Slice1"/>
>       <Item id="3783" name="object.stl"/>
>  </ProxyCollection>
>
> I want to add an extra property called "user"
>
> <ProxyCollection name="sources">
>       <Item id="4031" name="Slice1" user="dev"/>
>       <Item id="3783" name="object.stl" user="basic"/>
>  </ProxyCollection>
>
> the extra property will be added during the saving of the state. I will be
> changing user property using a widget.
> I just want to know how to send the value of my variable user to be printed
> in the xml.
>
> I have been looking at a couple of classes  vtkSMStateVersionController,
> vtkSMStateLoader, vtkSMProperty.
> I got confused after looking at so many classes related to this.  Do i need
> to register my variable or send it using a specific function?
> Is there some documentation/tutorial for this?
>
> thanks
>
> Michal Wozniak
>
>
>
>
> _______________________________________________
> 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
>
> Search the list archives at: http://markmail.org/search/?q=ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview
>


More information about the ParaView mailing list