<!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>
vtkPVSource* pvs =
this->Window->CreatePVSource("SphereSource");<br>
pvs->CreateProperties();<br>
if (pvs)<br>
{<br>
pvs->IsPermanentOn();<br>
pvs->Accept(1, 1);<br>
pvs->SetTraceReferenceObject(this->GetWindow());<br>
}<br>
vtkSMSourceProxy* proxy = pvs->GetProxy();<br>
vtkSMProperty *prop = proxy->GetProperty("Center");<br>
double x1=1.0;<br>
double x2=1.0;<br>
double x3=1.0;<br>
double radius = 1.0;<br>
vtkSMDoubleVectorProperty *doubleprop =
vtkSMDoubleVectorProperty::SafeDownCast(proxy->GetProperty("Center"));<br>
doubleprop->SetElement(0, x1);<br>
doubleprop->SetElement(1, x2);<br>
doubleprop->SetElement(2, x3);<br>
pvs->SetLabel("Ball");<br>
doubleprop =
vtkSMDoubleVectorProperty::SafeDownCast(proxy->GetProperty("Radius"));<br>
doubleprop->SetElement(0, radius);<br>
<br>
pvs->GetPVWidget("Center")->ResetInternal();<br>
pvs->GetPVWidget("Radius")->ResetInternal();<br>
<br>
pvs->SetVisibility(TRUE);<br>
pvs->AcceptCallback();<br>
pvs->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>
<br>
vtkPoints *points = vtkPoints::New(); <br>
vtkUnstructuredGrid *ugrid = vtkUnstructuredGrid::New();<br>
vtkVoxel *voxel = vtkVoxel::New();<br>
for(int u=0;u<numberOfVoxels;u++) <br>
{<br>
vtkVoxel *voxel = vtkVoxel::New();<br>
voxel->.....set data<br>
ugrid->InsertNextCell(voxel->GetCellType(),
voxel->GetPointIds());<br>
}<br>
ugrid->SetPoints(points);<br>
vtkDataSetMapper *gridMapper = vtkDataSetMapper::New();<br>
gridMapper->SetInput(ugrid);<br>
vtkActor *gridActor = vtkActor::New();<br>
<br>
Greetings<br>
Sebastian<br>
</body>
</html>