<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Randy Hudson wrote:
<blockquote cite="mid6.2.1.2.2.20050315132842.027f0a58@pop.mcs.anl.gov"
 type="cite">
  <pre wrap="">I wasn't specific enough about the "Parameters" page.

I want to reproduce the widgets (and their values) that are created, from the XML specs of various sources, inside the MainParameterFrame of vtkPVSourceNotebook (in addition to the widgets in certain frames from the "Display" page).

At 3/15/2005 12:45 PM, Randy Hudson wrote:

  </pre>
  <blockquote type="cite">
    <pre wrap="">I'd like to mirror, on my own control panel (which might be a new notebook, or an extra page of an existing one) the contents of certain frames from the "Display" and "Parameters" pages of the "Source" notebook.

I.e., I want to be able to create my own widgets, in my own panel, that are of the same type and the same values as those in the above-mentioned frames.

How do I access that data?  (I've dug, for some time, in vtkPVSourceNotebook, vtkPVSource, vtkPVWidget, vtkKWWidget, etc., and how to get at that data is, so far, still hidden.)
    </pre>
  </blockquote>
  <pre wrap=""><!----></pre>
</blockquote>
for simple vtkSource-objects may be that copy of code will help:<br>
<br>
&nbsp;&nbsp; vtkPVSource* pvs =
this-&gt;Window-&gt;CreatePVSource("SphereSource");<br>
&nbsp;&nbsp; pvs-&gt;CreateProperties();<br>
&nbsp;&nbsp; if (pvs)<br>
&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pvs-&gt;IsPermanentOn();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pvs-&gt;Accept(1, 1);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pvs-&gt;SetTraceReferenceObject(this-&gt;GetWindow());<br>
&nbsp;&nbsp; }<br>
&nbsp;&nbsp; vtkSMSourceProxy* proxy = pvs-&gt;GetProxy();<br>
&nbsp;&nbsp; vtkSMProperty *prop = proxy-&gt;GetProperty("Center");<br>
&nbsp;&nbsp; double x1=1.0;<br>
&nbsp;&nbsp; double x2=1.0;<br>
&nbsp;&nbsp; double x3=1.0;<br>
&nbsp;&nbsp; double radius = 1.0;<br>
&nbsp;&nbsp; vtkSMDoubleVectorProperty *doubleprop =
vtkSMDoubleVectorProperty::SafeDownCast(proxy-&gt;GetProperty("Center"));<br>
&nbsp;&nbsp; doubleprop-&gt;SetElement(0, x1);<br>
&nbsp;&nbsp; doubleprop-&gt;SetElement(1, x2);<br>
&nbsp;&nbsp; doubleprop-&gt;SetElement(2, x3);<br>
&nbsp;&nbsp; pvs-&gt;SetLabel("Ball");<br>
&nbsp;&nbsp; doubleprop =
vtkSMDoubleVectorProperty::SafeDownCast(proxy-&gt;GetProperty("Radius"));<br>
&nbsp;&nbsp; doubleprop-&gt;SetElement(0, radius);<br>
<br>
&nbsp;&nbsp; pvs-&gt;GetPVWidget("Center")-&gt;ResetInternal();<br>
&nbsp;&nbsp; pvs-&gt;GetPVWidget("Radius")-&gt;ResetInternal();<br>
<br>
&nbsp;&nbsp; pvs-&gt;SetVisibility(TRUE);<br>
&nbsp;&nbsp; pvs-&gt;AcceptCallback();<br>
&nbsp;&nbsp; pvs-&gt;Update();<br>
<br>
<br>
If you/anybody find a way for complex objects<br>
like for the vtkUnstructuredGrid see code below - it would help me to !<br>
&nbsp;&nbsp; <br>
&nbsp;&nbsp; vtkPoints *points = vtkPoints::New(); <br>
&nbsp;&nbsp; vtkUnstructuredGrid *ugrid = vtkUnstructuredGrid::New();<br>
&nbsp;&nbsp; vtkVoxel&nbsp; *voxel&nbsp; = vtkVoxel::New();<br>
&nbsp;&nbsp; for(int u=0;u&lt;numberOfVoxels;u++)&nbsp;&nbsp; <br>
&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp; vtkVoxel&nbsp; *voxel&nbsp; = vtkVoxel::New();<br>
&nbsp;&nbsp;&nbsp;&nbsp; voxel-&gt;.....set data<br>
&nbsp;&nbsp;&nbsp;&nbsp; ugrid-&gt;InsertNextCell(voxel-&gt;GetCellType(),
voxel-&gt;GetPointIds());<br>
&nbsp;&nbsp; }<br>
&nbsp;&nbsp; ugrid-&gt;SetPoints(points);<br>
&nbsp;&nbsp; vtkDataSetMapper *gridMapper = vtkDataSetMapper::New();<br>
&nbsp;&nbsp; gridMapper-&gt;SetInput(ugrid);<br>
&nbsp;&nbsp; vtkActor *gridActor = vtkActor::New();<br>
<br>
Greetings<br>
Sebastian<br>
</body>
</html>