[Paraview] proxies and objects

Stephane PLOIX stephane.ploix at edf.fr
Thu Feb 28 09:25:30 EST 2008


Hi,

I have written a filter that uses a cylinder to cut the input and develop 
it: 

class VTK_EXPORT vtkDevelopedSurface : public vtkPolyDataAlgorithm
{
public:
  ...
  virtual void SetCylinder(vtkCylinder *Cylinder);
  vtkGetObjectMacro(Cylinder,vtkCylinder);

protected:
  ...
  vtkCylinder *Cylinder;
 ...
};

And now I would like to set the values associated with the Cylinder 
(Center and Radius first, then I will have to set the transform 
parameters) in ParaView.
Setting the Cylinder itself is ok with the xml, but setting the values of 
the cylinder is a mistery for me.
I wrote this xml for the server to have a proxy to the vtkCylinder 
implicit function (I copied a lot from the ImplicitPlane xml found in the 
utilities.xml) and use it in the vtkDevelopedSurface filter: 

<ServerManagerConfiguration>
  <ProxyGroup name="implicit_functions">
 
    <Proxy name="Cylinder" class="vtkCylinder">
      <InputProperty
        name="Input"
        is_internal="1">
      </InputProperty>
 
      <DoubleVectorProperty
         name="Center"
         command="SetCenter"
         number_of_elements="3"
         update_self="1"
         label="Center"
         default_values="0.0 0.0 0.0">
        <Documentation>
          The center of the cylinder in space.
        </Documentation>
        <BoundsDomain name="range" mode="normal" default_mode="mid">
          <RequiredProperties>
            <Property name="Input" function="Input" />
          </RequiredProperties>
        </BoundsDomain>
      </DoubleVectorProperty>

      <DoubleVectorProperty
         name="Radius"
         command="SetRadius"
         update_self="1"
         number_of_elements="1"
         animateable="1"
         default_values="1.0" >
        <BoundsDomain name="range" mode="oriented_magnitude" >
          <RequiredProperties>
            <Property name="Center" function="Center"/>
            <Property name="Input" function="Input" />
          </RequiredProperties>
        </BoundsDomain>
      </DoubleVectorProperty>

      <Hints>
        <PropertyGroup type="Cylinder">
          <Property name="Center" function="Center" />
          <Property name="Radius" function="Radius" />
        </PropertyGroup>
      </Hints>

          <!-- end of Cylinder proxy -->
    </Proxy>
 
  </ProxyGroup>
  <ProxyGroup name="filters">
   <SourceProxy name="DevelopedSurface" class="vtkDevelopedSurface" label=
"Developed Surface">
     <Documentation
        long_help="Cuts the Data by a cylinder, and presents the result in 
2D in the parametric space (Theta, z)."
        short_help="Cuts the data by a cylinder and develop it.">
...
     </Documentation>
     <InputProperty
        name="Input"
        command="SetInputConnection">
           <ProxyGroupDomain name="groups">
             <Group name="sources"/>
             <Group name="filters"/>
           </ProxyGroupDomain>
           <DataTypeDomain name="input_type">
             <DataType value="vtkDataSet"/>
           </DataTypeDomain>
      </InputProperty>

     <!-- I DON'T KNOW HOW TO EXPOSE THE PROPERTIES FROM THE CYLINDER ???
      <SubProxy>
        <Proxy name="Cylinder" proxygroup="implicit_functions" 
proxyname="Cylinder">
        </Proxy>
        <ExposedProperties>
          <Property name="Center" />
          <Property name="Radius" />
        </ExposedProperties>
      </SubProxy>
     -->

     <!-- End DevelopedSurface Filter -->
   </SourceProxy>
 </ProxyGroup>
</ServerManagerConfiguration>

The pb is that I can't find a way to expose the Properties of the 
Cylinder. I tried to set the cylinder as a sub proxy (as commented above), 
but there is an error during plugin load.

I couldn't find example of this in the xml file, is it supported? 
If yes, could you give me some hint?

Thanks for any help!
Stephane
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/paraview/attachments/20080228/77a08b67/attachment-0001.html


More information about the ParaView mailing list