[Paraview] Re: Mirroring some contents of the "Parameters" and
"Display" notebook pages
Sebastian Geller
geller150 at gmx.de
Wed Mar 16 02:56:21 EST 2005
Randy Hudson wrote:
>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:
>
>
>
>>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.)
>>
>>
for simple vtkSource-objects may be that copy of code will help:
vtkPVSource* pvs = this->Window->CreatePVSource("SphereSource");
pvs->CreateProperties();
if (pvs)
{
pvs->IsPermanentOn();
pvs->Accept(1, 1);
pvs->SetTraceReferenceObject(this->GetWindow());
}
vtkSMSourceProxy* proxy = pvs->GetProxy();
vtkSMProperty *prop = proxy->GetProperty("Center");
double x1=1.0;
double x2=1.0;
double x3=1.0;
double radius = 1.0;
vtkSMDoubleVectorProperty *doubleprop =
vtkSMDoubleVectorProperty::SafeDownCast(proxy->GetProperty("Center"));
doubleprop->SetElement(0, x1);
doubleprop->SetElement(1, x2);
doubleprop->SetElement(2, x3);
pvs->SetLabel("Ball");
doubleprop =
vtkSMDoubleVectorProperty::SafeDownCast(proxy->GetProperty("Radius"));
doubleprop->SetElement(0, radius);
pvs->GetPVWidget("Center")->ResetInternal();
pvs->GetPVWidget("Radius")->ResetInternal();
pvs->SetVisibility(TRUE);
pvs->AcceptCallback();
pvs->Update();
If you/anybody find a way for complex objects
like for the vtkUnstructuredGrid see code below - it would help me to !
vtkPoints *points = vtkPoints::New();
vtkUnstructuredGrid *ugrid = vtkUnstructuredGrid::New();
vtkVoxel *voxel = vtkVoxel::New();
for(int u=0;u<numberOfVoxels;u++)
{
vtkVoxel *voxel = vtkVoxel::New();
voxel->.....set data
ugrid->InsertNextCell(voxel->GetCellType(), voxel->GetPointIds());
}
ugrid->SetPoints(points);
vtkDataSetMapper *gridMapper = vtkDataSetMapper::New();
gridMapper->SetInput(ugrid);
vtkActor *gridActor = vtkActor::New();
Greetings
Sebastian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/paraview/attachments/20050316/056c513c/attachment.htm
More information about the ParaView
mailing list