[Paraview] Show Widget in CompoundSourceProxy
Christoffer Green
christoffer.green at gmail.com
Tue Feb 15 03:49:20 EST 2011
Utkarsh,
Thank you for your response it has helped me make the xml file shorter since
I don't need to copy the PlaneSource to add a widget to it. Exposing the
needed properties in the CompoundSourceProxy worked well but I cannot get
the widget hints to work, whenever I add the hints section to
the CompoundSourceProxy ParaView crashes when applying the filter to a
volume. Do you know if I am doing things correctly?
I am using 32bit ParaView (3.8.1 and 3.10 rc1) on Windows 7
Here is the xml again (somewhat shorter this time):
------
<ServerManagerConfiguration>
<ProxyGroup name="filters">
<!-- Probe Filter -->
<SourceProxy name="Probe Filter" class="vtkCompositeDataProbeFilter">
<InputProperty
name="Input"
command="AddInputConnection"
clean_command="RemoveAllInputs"
multiple_input="1">
<ProxyGroupDomain name="groups">
<Group name="sources"/>
<Group name="filters"/>
</ProxyGroupDomain>
<DataTypeDomain name="input_type" composite_data_supported="1">
<DataType value="vtkDataObject"/>
</DataTypeDomain>
</InputProperty>
<InputProperty
name="Source"
command="SetSourceConnection"
multiple_input="1">
<ProxyGroupDomain name="groups">
<Group name="sources"/>
<Group name="filters"/>
</ProxyGroupDomain>
<DataTypeDomain name="input_type">
<DataType value="vtkDataSet"/>
</DataTypeDomain>
</InputProperty>
</SourceProxy>
<!-- Compound Source -->
<CompoundSourceProxy id="3316" servers="1" name="ProbePlane">
<!-- Instance of Calculator so we can get the magnitude of the volume
data source for the probe filter-->
<Proxy group="filters" type="Calculator" id="2154" servers="1"
compound_name="Calculator2">
<Property name="AttributeMode" id="2154.AttributeMode"
number_of_elements="1">
<Element index="0" value="1"/>
<Domain name="enum" id="2154.AttributeMode.enum">
<Entry value="1" text="point_data"/>
<Entry value="2" text="cell_data"/>
<Entry value="5" text="field_data"/>
</Domain>
</Property>
<Property name="CoordinateResults" id="2154.CoordinateResults"
number_of_elements="1">
<Element index="0" value="0"/>
<Domain name="bool" id="2154.CoordinateResults.bool"/>
</Property>
<Property name="Function" id="2154.Function" number_of_elements="1">
<Element index="0" value="V_3D_01_X^2+V_3D_01_Y^2+V_3D_01_Z^2"/>
</Property>
<Property name="Input" id="2154.Input" number_of_elements="1">
<Domain name="groups" id="2154.Input.groups">
<Group value="sources"/>
<Group value="filters"/>
</Domain>
<Domain name="input_type" id="2154.Input.input_type">
<DataType value="vtkDataSet"/>
</Domain>
</Property>
<Property name="ReplaceInvalidValues" id="2154.ReplaceInvalidValues"
number_of_elements="1">
<Element index="0" value="1"/>
<Domain name="bool" id="2154.ReplaceInvalidValues.bool"/>
</Property>
<Property name="ReplacementValue" id="2154.ReplacementValue"
number_of_elements="1">
<Element index="0" value="0"/>
<Domain name="range" id="2154.ReplacementValue.range"/>
</Property>
<Property name="ResultArrayName" id="2154.ResultArrayName"
number_of_elements="1">
<Element index="0" value="Result"/>
</Property>
</Proxy>
<!-- instance of PlaneSource; used for visualizing the probe filter-->
<Proxy group="sources" type="PlaneSource" id="2453" servers="1"
compound_name="Plane2">
</Proxy>
<!-- instance of Probe Filter -->
<Proxy group="filters" type="Probe Filter" id="2867" servers="1"
compound_name="ProbeFilter2">
<Property name="Input" id="2867.Input" number_of_elements="1">
<Proxy value="2453" output_port="0"/>
<Domain name="groups" id="2867.Input.groups">
<Group value="sources"/>
<Group value="filters"/>
</Domain>
<Domain name="input_type" id="2867.Input.input_type">
<DataType value="vtkDataObject"/>
</Domain>
</Property>
<Property name="Source" id="2867.Source" number_of_elements="1">
<Proxy value="2154" output_port="0"/>
<Domain name="groups" id="2867.Source.groups">
<Group value="sources"/>
<Group value="filters"/>
</Domain>
<Domain name="input_type" id="2867.Source.input_type">
<DataType value="vtkDataSet"/>
</Domain>
</Property>
</Proxy>
<ExposedProperties>
<Property name="Input" proxy_name="Calculator2"
exposed_name="Calcinput"/>
<Property name="Function" proxy_name="Calculator2"
exposed_name="Function"/>
<Property name="Origin" proxy_name="Plane2" exposed_name="Origin"/>
<Property name="Point1" proxy_name="Plane2" exposed_name="Point 1"/>
<Property name="Point2" proxy_name="Plane2" exposed_name="Point 2"/>
<Property name="XResolution" proxy_name="Plane2" exposed_name="X
Resolution"/>
<Property name="YResolution" proxy_name="Plane2" exposed_name="Y
Resolution"/>
</ExposedProperties>
<!-- Uncommenting this crashes ParaView when applying the
CompoundSourceProxy filter
<Hints>
<PropertyGroup type="LineSource" >
<Property function="Point1WorldPosition" name="Point1" />
<Property function="Point2WorldPosition" name="Point2" />
<Property function="Resolution" name="XResolution" />
</PropertyGroup>
</Hints>-->
<OutputPort name="ProbeOut" proxy="ProbeFilter2" port_index="0"/>
</CompoundSourceProxy>
</ProxyGroup>
</ServerManagerConfiguration>
-----
Thanks
BR/ Christoffer
On Mon, Feb 14, 2011 at 6:52 AM, Utkarsh Ayachit <
utkarsh.ayachit at kitware.com> wrote:
> Christoffer,
>
> You need to redefine the Hints for the "PropertyGroup" on the
> CompoundSourceProxy as well. Also the properties that the widget is
> controlling, such as Point1WorldPosition, Point2WorldPosition,
> Resolution must be exposed from the CompoundSourceProxy.
>
> Utkarsh
>
> On Mon, Feb 14, 2011 at 9:44 AM, Christoffer Green
> <christoffer.green at gmail.com> wrote:
> > Hello!
> > I am trying to write an xml definition for a CompoundSourceProxy in
> ParaView
> > 3.8.1 that produces a plane that is used by a probe filter to
> > show the ParaView input (volume data in my case) on the plane. The
> position
> > and orientation of the plane should be controlled by a widget.
> > The problem:
> > I have been able to create a plane as a SourceProxy that is controlled by
> a
> > widget and I have been able to create a CompoundSourceProxy that shows
> the
> > volume data on a plane but the CompoundSourceProxy does not show the
> Widget
> > that is defined with the PropertyGroup hints in the SourceProxy plane. If
> I
> > create an instance of the plane without the CompoundSourceProxy then the
> > widget is displayed as it should. Does hint widget information disappear
> > when sources are used in a CompoundSourceProxy? How does one use widgets
> to
> > control properties in subproxies in a CompoundSourceProxy?
> > The xml definition I have written follows here (sorry about the length):
> > -----------------------
> > The structure of this file is like so:
> > ParaViewInput(Volume)-->Calculator--(source)-->Probe
> > Filter<--(input)--PlaneSource<--Widget
> > <ServerManagerConfiguration>
> > <ProxyGroup name="sources">
> > <!-- Plane Source -->
> > <SourceProxy name="PlaneSourceWithWidget" class="vtkPlaneSource"
> > label="PlaneWithWidget">
> > <Documentation
> > long_help="Create a parallelogram given an origin and two points.
> > The resolution indicates the number of division along each axis of the
> > plane."
> > short_help="Create a parallelogram from an origin and two
> points">
> > The Plane source can be used to add a polygonal parallelogram to the 3D
> > scene. Unlike the sphere, cone, and cylinder sources, the parallelogram
> is
> > exactly represented at the lowest resolution, but higher resolutions may
> be
> > desired if this plane is to be used as an input to a filter. The output
> of
> > the Plane source is polygonal data.
> > </Documentation>
> > <DoubleVectorProperty
> > name="Origin"
> > command="SetOrigin"
> > number_of_elements="3"
> > animateable="1"
> > default_values="-0.5 -0.5 0.0" >
> > <DoubleRangeDomain name="range"/>
> > <Documentation>
> > This property specifies the 3D coordinate of the origin (one
> > corner) of the plane.
> > </Documentation>
> > </DoubleVectorProperty>
> > <DoubleVectorProperty
> > name="Point1"
> > command="SetPoint1"
> > number_of_elements="3"
> > animateable="1"
> > default_values="0.5 -0.5 0.0" >
> > <DoubleRangeDomain name="range"/>
> > <Documentation>
> > This property specifies the 3D coordinate a second corner of
> the
> > parallelogram. The line connecting this point and that specified by the
> > Origin property define one edge of the parallelogram (its X axis).
> > </Documentation>
> > </DoubleVectorProperty>
> > <DoubleVectorProperty
> > name="Point2"
> > command="SetPoint2"
> > number_of_elements="3"
> > animateable="1"
> > default_values="-0.5 0.5 0.0" >
> > <DoubleRangeDomain name="range"/>
> > <Documentation>
> > This property specifies the 3D coordinate a third corner of the
> > parallelogram. The line connecting this point and that specified by the
> > Origin property define a second edge of the parallelogram (its Y axis).
> > </Documentation>
> > </DoubleVectorProperty>
> > <IntVectorProperty
> > name="XResolution"
> > command="SetXResolution"
> > number_of_elements="1"
> > default_values="100" >
> > <IntRangeDomain name="range" min="1" />
> > <Documentation>
> > This property specifies the number of divisions along the X
> axis
> > of the parallelogram.
> > </Documentation>
> > </IntVectorProperty>
> > <IntVectorProperty
> > name="YResolution"
> > command="SetYResolution"
> > number_of_elements="1"
> > default_values="100" >
> > <IntRangeDomain name="range" min="1" />
> > <Documentation>
> > This property specifies the number of divisions along the Y
> axis
> > of the parallelogram.
> > </Documentation>
> > </IntVectorProperty>
> > <Hints>
> > <PropertyGroup type="LineSource" >
> > <Property function="Point1WorldPosition" name="Point1" />
> > <Property function="Point2WorldPosition" name="Point2" />
> > <Property function="Resolution" name="XResolution" />
> > </PropertyGroup>
> > </Hints>
> > </SourceProxy>
> > </ProxyGroup>
> >
> >
> > <ProxyGroup name="filters">
> > <!-- Probe Filter -->
> > <SourceProxy name="Probe Filter" class="vtkCompositeDataProbeFilter">
> > <InputProperty
> > name="Input"
> > command="AddInputConnection"
> > clean_command="RemoveAllInputs"
> > multiple_input="1">
> > <ProxyGroupDomain name="groups">
> > <Group name="sources"/>
> > <Group name="filters"/>
> > </ProxyGroupDomain>
> > <DataTypeDomain name="input_type" composite_data_supported="1">
> > <DataType value="vtkDataObject"/>
> > </DataTypeDomain>
> > </InputProperty>
> > <InputProperty
> > name="Source"
> > command="SetSourceConnection"
> > multiple_input="1">
> > <ProxyGroupDomain name="groups">
> > <Group name="sources"/>
> > <Group name="filters"/>
> > </ProxyGroupDomain>
> > <DataTypeDomain name="input_type">
> > <DataType value="vtkDataSet"/>
> > </DataTypeDomain>
> > </InputProperty>
> > </SourceProxy>
> >
> > <!-- Compound -->
> > <CompoundSourceProxy id="3316" servers="1" name="ProbePlane">
> > <!-- Instance of Calculator so we can get the magnitude of the
> volume
> > data source for the probe filter-->
> > <Proxy group="filters" type="Calculator" id="2154" servers="1"
> > compound_name="Calculator2">
> > <Property name="AttributeMode" id="2154.AttributeMode"
> > number_of_elements="1">
> > <Element index="0" value="1"/>
> > <Domain name="enum" id="2154.AttributeMode.enum">
> > <Entry value="1" text="point_data"/>
> > <Entry value="2" text="cell_data"/>
> > <Entry value="5" text="field_data"/>
> > </Domain>
> > </Property>
> > <Property name="CoordinateResults" id="2154.CoordinateResults"
> > number_of_elements="1">
> > <Element index="0" value="0"/>
> > <Domain name="bool" id="2154.CoordinateResults.bool"/>
> > </Property>
> > <Property name="Function" id="2154.Function"
> number_of_elements="1">
> > <Element index="0"
> value="V_3D_01_X^2+V_3D_01_Y^2+V_3D_01_Z^2"/>
> > </Property>
> > <Property name="Input" id="2154.Input" number_of_elements="1">
> > <Domain name="groups" id="2154.Input.groups">
> > <Group value="sources"/>
> > <Group value="filters"/>
> > </Domain>
> > <Domain name="input_type" id="2154.Input.input_type">
> > <DataType value="vtkDataSet"/>
> > </Domain>
> > </Property>
> > <Property name="ReplaceInvalidValues"
> id="2154.ReplaceInvalidValues"
> > number_of_elements="1">
> > <Element index="0" value="1"/>
> > <Domain name="bool" id="2154.ReplaceInvalidValues.bool"/>
> > </Property>
> > <Property name="ReplacementValue" id="2154.ReplacementValue"
> > number_of_elements="1">
> > <Element index="0" value="0"/>
> > <Domain name="range" id="2154.ReplacementValue.range"/>
> > </Property>
> > <Property name="ResultArrayName" id="2154.ResultArrayName"
> > number_of_elements="1">
> > <Element index="0" value="Result"/>
> > </Property>
> > </Proxy>
> >
> > <!-- instance of PlaneSourceWithWidget -->
> > <Proxy group="sources" type="PlaneSourceWithWidget" id="2453"
> > servers="1" compound_name="Plane2">
> > </Proxy>
> > <!-- instance of Probe Filter -->
> > <Proxy group="filters" type="Probe Filter" id="2867" servers="1"
> > compound_name="ProbeFilter2">
> > <Property name="Input" id="2867.Input" number_of_elements="1">
> > <Proxy value="2453" output_port="0"/>
> > <Domain name="groups" id="2867.Input.groups">
> > <Group value="sources"/>
> > <Group value="filters"/>
> > </Domain>
> > <Domain name="input_type" id="2867.Input.input_type">
> > <DataType value="vtkDataObject"/>
> > </Domain>
> > </Property>
> > <Property name="Source" id="2867.Source" number_of_elements="1">
> > <Proxy value="2154" output_port="0"/>
> > <Domain name="groups" id="2867.Source.groups">
> > <Group value="sources"/>
> > <Group value="filters"/>
> > </Domain>
> > <Domain name="input_type" id="2867.Source.input_type">
> > <DataType value="vtkDataSet"/>
> > </Domain>
> > </Property>
> > </Proxy>
> > <ExposedProperties>
> > <Property name="Input" proxy_name="Calculator2"
> > exposed_name="Calcinput"/>
> > <Property name="Function" proxy_name="Calculator2"
> > exposed_name="Function"/>
> > <Property name="XResolution" proxy_name="Plane2" exposed_name="X
> > Resolution"/>
> > <Property name="YResolution" proxy_name="Plane2" exposed_name="Y
> > Resolution"/>
> > </ExposedProperties>
> > <OutputPort name="ProbeOut" proxy="ProbeFilter2" port_index="0"/>
> > </CompoundSourceProxy>
> > </ProxyGroup>
> > </ServerManagerConfiguration>
> > -------------------------------------------
> > Thanks
> > _______________________________________________
> > 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
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20110215/32ff206a/attachment-0001.htm>
More information about the ParaView
mailing list