[Paraview] Does 'Show cube axes' not work with slice/plane?

2008-11-21 Thread Hom Nath Gharti
Reproduction:
- Draw Box source with all lengths 600 each and center (0,0,0)
- Make default slice (X slice)
-- Show cube axis

Two of my axis labels gone to the centre!

I had a similar problem with my real data sets.

I am using version 3.4.0 in windows.

Many thanks,
Hom Nath
attachment: test.png___
ParaView mailing list
ParaView@paraview.org
http://www.paraview.org/mailman/listinfo/paraview


[Paraview] Got programmable filter to work outside PV GUI - but still not programmable source

2008-11-21 Thread Louis at M-Tech
Hi 

 

I got programmable filter to work outside the paraview GUI - but still not
the programmable source; See the example below - if you want to try out the
programmable source, just set ptr = pgsrc instead of ptr = pgflt - see
below.

 

I am still puzzled why the programmable source does not work. It works
within the paraview GUI - but not outside. To see how it works within the
paraview GUI do the following:

Open paraview

Create a programmable source

Copy the script part below into the GUI editor

Click apply

.

 

 

Regards,

Louis

 

 

$$

 

from paraview import servermanager

connection = servermanager.Connect()

#

pgsrc = servermanager.sources.ProgrammableSource()

pgflt = servermanager.filters.ProgrammableFilter()

#

#ptr = pgsrc

ptr = pgflt

#

ptr.GetProperty(Script).SetElement(0, 

import vtk

pts=vtk.vtkPoints() 

pts.Initialize()

pts.InsertNextPoint(0,0,0)

pts.InsertNextPoint(1,0,.0)

pts.InsertNextPoint(2,1,0)

pts.InsertNextPoint(3,3,0.)

 

cel=vtk.vtkCellArray() 

cel.Initialize()

cel.InsertNextCell(4) # number of points

cel.InsertCellPoint(0)

cel.InsertCellPoint(1)

cel.InsertCellPoint(2)

cel.InsertCellPoint(3)

 

output = self.GetOutput()

output.SetPoints(pts)

output.SetStrips(cel)

)

 

pgflt.Input = pgsrc

 

view = servermanager.CreateRenderView()

rep = servermanager.CreateRepresentation(ptr,view)

 

view.StillRender()

view.ResetCamera()

view.StillRender()

 

$$$

 

___
ParaView mailing list
ParaView@paraview.org
http://www.paraview.org/mailman/listinfo/paraview


[Paraview] Manipulating points.

2008-11-21 Thread Andrew Maclean
Is it possible to select a single point, change its 3D coordinates and
re-render it?
We are building 3D maps by hand and sometimes the coordinates of
points go awry so we need to adjust them.

What I am hoping to do is to convert our files to vtp files, feed them
into ParaView and then hand edit any points that are wrong. The point
here is that ParaView is really good at visualisation so any errors
are readily apparent.

Thanks for any information,
Andrew
-- 
___
Andrew J. P. Maclean
Centre for Autonomous Systems
The Rose Street Building J04
The University of Sydney  2006  NSW
AUSTRALIA
Ph: +61 2 9351 3283
Fax: +61 2 9351 7474
URL: http://www.acfr.usyd.edu.au/
___
___
ParaView mailing list
ParaView@paraview.org
http://www.paraview.org/mailman/listinfo/paraview


Re: [Paraview] Manipulating points.

2008-11-21 Thread David E DeMarle
On Fri, Nov 21, 2008 at 5:20 AM, Andrew Maclean
[EMAIL PROTECTED] wrote:
 Is it possible to select a single point, change its 3D coordinates and
 re-render it?
 We are building 3D maps by hand and sometimes the coordinates of
 points go awry so we need to adjust them.

 What I am hoping to do is to convert our files to vtp files, feed them
 into ParaView and then hand edit any points that are wrong. The point
 here is that ParaView is really good at visualisation so any errors
 are readily apparent.

 Thanks for any information,
 Andrew
 --
 ___
 Andrew J. P. Maclean
 Centre for Autonomous Systems
 The Rose Street Building J04
 The University of Sydney  2006  NSW
 AUSTRALIA
 Ph: +61 2 9351 3283
 Fax: +61 2 9351 7474
 URL: http://www.acfr.usyd.edu.au/
 ___
 ___
 ParaView mailing list
 ParaView@paraview.org
 http://www.paraview.org/mailman/listinfo/paraview


Not automatically. You could do it with a lot of effort via selection
and the programmable filter and the spreadsheet view.

The process would be:

Split the view top to bottom and make a spreadsheet view. Show the
data's selected point values in the spreadsheet view.

Insert a programmable filter, make it shallow copy through the point
and cell associated attribute data.

Split the 3D view again, now right to left, and make the original data
visible in one view and the filter's output in the other. Link the
cameras.

Select a vertex in the original. It's index and coordinates will be
shown in the spreadsheet view.

At a line to the end of the python filters program and change that
particular point's coordinates in the output data.

Repeat the last two steps, adding to the program each time.

-- 
David E DeMarle
Kitware, Inc.
RD Engineer
28 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-371-3971 x109
___
ParaView mailing list
ParaView@paraview.org
http://www.paraview.org/mailman/listinfo/paraview


[Paraview] Multiple temporal shifts still not working right

2008-11-21 Thread Eric E. Monson

Hey,

Sorry for the long email, but I find this problem difficult to  
describe succinctly...


In February I was trying to use multiple Temporal Shift Scale filters  
as input to a Python Programmable Filter to do on-the-fly point  
velocity calculations (for diffusing particles in my simulation  
output). There were troubles with the pipeline updating properly, and  
Ken Moreland came up with a nice self-contained test case and filed  
the bug 6307:


http://www.paraview.org/Bug/view.php?id=6307

which was listed in August as fixed because the test case seemed to  
work now. But, I don't think this is really resolved yet.


If you load in the TimeShiftTest2.pvsm state file, the animation seems  
to play correctly, but I think that's a red herring. If you turn off  
the visibility of the TemporalShiftScale filters, you can see that no  
boxes move until after t=1.0, whereas if the temporal filters are  
turned on, and the group filter is turned off, one box moves and then  
the other.


I don't know if this helps, but if you look at the Output printed by  
the Python filter in TimeShiftTest1.pvsm, you can see that the  
temporal data sets have the correct time, but the ImageData within  
them doesn't match.

..

All of this is much more clear to me when I load in a simple data set  
with one point moving in time (attached Xdmf data set -- I'll also  
attach a link to a state file which sets this pipeline up, but you'll  
have to change the path for the data file in the state file manually  
if you want to use it).


The pipeline is: Load data. Add a Temporal Shift Scale with (post)  
shift=0. Add another TSS off the original data set with (post) shift =  
1. Highlight both TSSs and route into a Python Programmable Filter  
with Unstructured Grid output and this script:


in0 = self.GetInputDataObject(0,0)
ds0 = in0.GetTimeStep(0)
in1 = self.GetInputDataObject(0,1)
ds1 = in1.GetTimeStep(0)
print 'in1 t = %.1f' % in1.GetInformation().Get(in1.DATA_TIME_STEPS(),0)
print 'ds1 t = %.1f' % ds1.GetInformation().Get(ds1.DATA_TIME_STEPS(),0)
print 'in0 t = %.1f' % in0.GetInformation().Get(in0.DATA_TIME_STEPS(),0)
print 'ds0 t = %.1f' % ds0.GetInformation().Get(ds0.DATA_TIME_STEPS(),0)
out1 = self.GetOutputDataObject(0)
out1.ShallowCopy(ds0)
print 'out1 t = %.1f' %  
out1.GetInformation().Get(out1.DATA_TIME_STEPS(),0)


When I animate this (PV CVS or 3.4, OS X 10.5.5), with the TSSs on and  
the PPF off, I see the expected: two points, one following the other.  
When the TSSs are off and the PPF is on, only one point shows up.  
Also, the behavior is different if the animation is stepped backwards  
rather than forwards. And, the printed Output times from the PPF show  
one of the ImageData sets time doesn't match its temporal host.


As in Ken's example, this works very similarly with a Group filter in  
place of the PPF.


This still seems very confusing, and I hope someone will have some clue!

Thanks,
-Eric

--
Eric E Monson
Duke Visualization Technology Group

Test data set:



singlePointTest1.xmf
Description: Binary data



State file to set up pipeline automatically:
http://www.cs.duke.edu/~emonson/TimeShiftData3.pvsm


___
ParaView mailing list
ParaView@paraview.org
http://www.paraview.org/mailman/listinfo/paraview


Re: [Paraview] how to change decimal places?

2008-11-21 Thread Scott, W Alan
Pei,
Are you running ParaView 3.4?  I can put in more than 2 decimal places in the 
cylinder center.  Another way to place the cylinder in another location is to 
use the transform filter.  It also will allow any number of decimal places.

Alan


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Pei-Ying Hsieh
Sent: Thursday, November 20, 2008 7:55 PM
To: paraview
Subject: [Paraview] how to change decimal places?

Hi, Paraview group:

I created a cylinder in PV.  I need to move it to a new location.  But, default 
only has 2 decimal places, but, I need it to be precise to 3 decimal places.  
Is there a way to achieve this?

Thanks!

Pei

___
ParaView mailing list
ParaView@paraview.org
http://www.paraview.org/mailman/listinfo/paraview


Re: [Paraview] Does 'Show cube axes' not work with slice/plane?

2008-11-21 Thread Scott, W Alan
Hom,
That is a bug in ParaView.  I will create a bug report.  Thanks for finding  
and reporting it!

Alan


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Hom Nath Gharti
Sent: Friday, November 21, 2008 1:47 AM
To: ParaView
Subject: [Paraview] Does 'Show cube axes' not work with slice/plane?

Reproduction:
- Draw Box source with all lengths 600 each and center (0,0,0)
- Make default slice (X slice)
-- Show cube axis

Two of my axis labels gone to the centre!

I had a similar problem with my real data sets.

I am using version 3.4.0 in windows.

Many thanks,
Hom Nath
___
ParaView mailing list
ParaView@paraview.org
http://www.paraview.org/mailman/listinfo/paraview


Re: [Paraview] Does 'Show cube axes' not work with slice/plane?

2008-11-21 Thread Scott, W Alan
Hom,
This has already been fixed on the trunk.  Thus, you should see the fix in the 
next version of ParaView, which will probably be coming out this winter.

Alan


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Hom Nath Gharti
Sent: Friday, November 21, 2008 1:47 AM
To: ParaView
Subject: [Paraview] Does 'Show cube axes' not work with slice/plane?

Reproduction:
- Draw Box source with all lengths 600 each and center (0,0,0)
- Make default slice (X slice)
-- Show cube axis

Two of my axis labels gone to the centre!

I had a similar problem with my real data sets.

I am using version 3.4.0 in windows.

Many thanks,
Hom Nath
___
ParaView mailing list
ParaView@paraview.org
http://www.paraview.org/mailman/listinfo/paraview


[Paraview] reg file loading

2008-11-21 Thread L Susithra

Hello,
I've a data ( velocity fields, x,y,z for each node )from the simulation and i 
need to load it in paraview to visulaise the flow field. i converted the data 
as .csv from excel  and when i read it from paraview, i am not able to load the 
data , getting an error. It just reads the first column only (xvelocity). I am 
not sure is there a specific way to load the data. It would be a great help  if 
any one could suggest me. 

Thanks

_
Searching for the best deals on travel? Visit MSN Travel.
http://in.msn.com/coxandkings___
ParaView mailing list
ParaView@paraview.org
http://www.paraview.org/mailman/listinfo/paraview


Re: [Paraview] reg file loading

2008-11-21 Thread Utkarsh Ayachit

What is the error you are getting? What version of ParaView are you using?

Utkarsh

L Susithra wrote:

Hello,
I've a data ( velocity fields, x,y,z for each node )from the simulation 
and i need to load it in paraview to visulaise the flow field. i 
converted the data as .csv from excel  and when i read it from paraview, 
i am not able to load the data , getting an error. It just reads the 
first column only (xvelocity). I am not sure is there a specific way to 
load the data. It would be a great help  if any one could suggest me.


Thanks


Free up your senses. Experience reality up close on MSN video Try it! 
http://video.msn.com/?mkt=en-in





___
ParaView mailing list
ParaView@paraview.org
http://www.paraview.org/mailman/listinfo/paraview

___
ParaView mailing list
ParaView@paraview.org
http://www.paraview.org/mailman/listinfo/paraview


[Paraview] (no subject)

2008-11-21 Thread Natalie Happenhofer

Hi!
I´m writing a new filter called vtkDataCalculator, which should 
add/subtract/multiply/ divide the point data arrays of two datasets. 
Having written now a very simple version which just adds the point data, I try 
to build it as a Plugin and I get the error

Linking Cxx Shared Library ...\bin\libDataCalculator.dll
Creating library file: ..\bin\libDataCalculator.dll.a
CMakeFiles\DataCalculator.dir\vtkDataCalculator.obj: In function 
'ZN17vtkDataCalculator3NewEv':
C:/ParaviewSource/ParaView3/Plugins/vtkDataCalculator.h:14 undefined reference 
to 'vtable for vtkDataCalculator'
collect2: ld returned 1 exit status 


I believe that I miss to specify a Macro, I just put 

vtkTypeMacro(vtkDataCalculator,vtkDataSetAlgorithm);

in my Headerfile. 

If there is a Macro missing, does anyone know, which one?
And if it´s something else .. what´s wrong?

thx for help,
Natalie

_
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/___
ParaView mailing list
ParaView@paraview.org
http://www.paraview.org/mailman/listinfo/paraview


[Paraview] error linking a plugin - dll

2008-11-21 Thread Natalie Happenhofer

Hi!
I´m writing a new filter called vtkDataCalculator, which should 
add/subtract/multiply/ divide the point data arrays of two datasets. 
Having written now a very simple version which just adds the point data, I try 
to build it as a Plugin and I get the error

Linking Cxx Shared Library ...\bin\libDataCalculator.dll
Creating library file: ..\bin\libDataCalculator.dll.a
CMakeFiles\DataCalculator.dir\vtkDataCalculator.obj: In function 
'ZN17vtkDataCalculator3NewEv':
C:/ParaviewSource/ParaView3/Plugins/vtkDataCalculator.h:14 undefined reference 
to 'vtable for vtkDataCalculator'
collect2: ld returned 1 exit status 


I believe that I miss to specify a Macro, I just put 

vtkTypeMacro(vtkDataCalculator,vtkDataSetAlgorithm);

in my Headerfile. 

If there is a Macro missing, does anyone know, which one?
And if it´s something else .. what´s wrong?

thx for help,
Natalie

_
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/___
ParaView mailing list
ParaView@paraview.org
http://www.paraview.org/mailman/listinfo/paraview


Re: [Paraview] Why does this programmable source not work outside the paraview GUI

2008-11-21 Thread Utkarsh Ayachit
The answer is simple: you are missing the UpdateVTKObjects() call to 
'apply' the change to the property.


If you going to use ...GetProperty(..).SetElement(...) API then after 
the property has been set, one must call proxy.UpdateVTKObjects().


so in your example:
...
pgsrc.GetProperty(Script).SetElement(0,  ... )
pgsrc.UpdateVTKObjects()

Alternatively  you can simply do:
pgsrc.Script = .

and then you don't have to worry about calling UpdateVTKObjects().

Utkarsh



Louis at M-Tech wrote:

Hi All,

 

Why does this piece of code containing a programmable source not work 
OUTSIDE the paraview GUI?


 

a) When the source is changed to ConeSource() it works (see Label 1 in 
the code below).


 

b) Also when the Script content is pasted inside the paraview GUI 
scripting editor, it does work – so the script contents itself is ok.


 

When the code is run directly from a python command line only an empty 
graphis window is displayed – as if the script part is faulty.


 


Thanks in advance,

Louis

 


HERE IS THE EXAMPLE:

@@

from paraview import servermanager

connection = servermanager.Connect()

pgsrc=servermanager.sources.ProgrammableSource()

 

 


pgsrc.GetProperty(Script).SetElement(0, 

 


import vtk

pts=vtk.vtkPoints()

pts.Initialize()

pts.InsertNextPoint(0,0,0)

pts.InsertNextPoint(1,0,.0)

pts.InsertNextPoint(2,1,0)

pts.InsertNextPoint(3,3,0.)

 


cel=vtk.vtkCellArray()

cel.Initialize()

cel.InsertNextCell(4) # number of points

cel.InsertCellPoint(0)

cel.InsertCellPoint(1)

cel.InsertCellPoint(2)

cel.InsertCellPoint(3)

 


output = self.GetOutput()

output.SetPoints(pts)

output.SetStrips(cel)

 


)

 

 


view = servermanager.CreateRenderView()

 


# This programmable source pgsrc does not display

rep = servermanager.CreateRepresentation(pgsrc,view)

 


# Label 1: This source do display

#coneSource = servermanager.sources.ConeSource()

#rep = servermanager.CreateRepresentation(coneSource,view)

 

 


view.StillRender()

view.ResetCamera()

view.StillRender()

 




 





___
ParaView mailing list
ParaView@paraview.org
http://www.paraview.org/mailman/listinfo/paraview

___
ParaView mailing list
ParaView@paraview.org
http://www.paraview.org/mailman/listinfo/paraview


Re: [Paraview] error linking a plugin - dll

2008-11-21 Thread Utkarsh Ayachit

Make sure your header and cxx files look something like follows:

vtkDataCalulator.h -

#include vtkDataSetAlgorithm.h

class VTK_EXPORT vtkDataCalculator : public vtkDataSetAlgorithm
{
public:
  static vtkDataCalculator* New();
  vtkTypeRevisionMacro(vtkDataCalculator, vtkDataSetAlgorithm);
...
};


vtkDataCalculator.cxx-

#include vtkDataCalculator.h
#include vtkObjectFactory.h

vtkStandardNewMacro(vtkDataCalculator);
vtkCxxRevisionMacro(vtkDataCalculator, $Revision$);





Natalie Happenhofer wrote:

Hi!
I´m writing a new filter called vtkDataCalculator, which should 
add/subtract/multiply/ divide the point data arrays of two datasets.
Having written now a very simple version which just adds the point data, 
I try to build it as a Plugin and I get the error


Linking Cxx Shared Library ...\bin\libDataCalculator.dll
Creating library file: ..\bin\libDataCalculator.dll.a
CMakeFiles\DataCalculator.dir\vtkDataCalculator.obj: In function 
'ZN17vtkDataCalculator3NewEv':
C:/ParaviewSource/ParaView3/Plugins/vtkDataCalculator.h:14 undefined 
reference to 'vtable for vtkDataCalculator'

collect2: ld returned 1 exit status


I believe that I miss to specify a Macro, I just put

vtkTypeMacro(vtkDataCalculator,vtkDataSetAlgorithm);

in my Headerfile.

If there is a Macro missing, does anyone know, which one?
And if it´s something else .. what´s wrong?

thx for help,
Natalie


Express yourself instantly with MSN Messenger! MSN Messenger 
http://clk.atdmt.com/AVE/go/onm00200471ave/direct/01/





___
ParaView mailing list
ParaView@paraview.org
http://www.paraview.org/mailman/listinfo/paraview

___
ParaView mailing list
ParaView@paraview.org
http://www.paraview.org/mailman/listinfo/paraview


Re: [Paraview] Got programmable filter to work outside PV GUI - but still not programmable source

2008-11-21 Thread Utkarsh Ayachit
Please avoid changing the subject line for a continuing thread. It makes 
it easier to track the message thread.


Thanks
Utkarsh

Louis at M-Tech wrote:

Hi

 

I got programmable filter to work outside the paraview GUI - but still 
not the programmable source; See the example below – if you want to try 
out the programmable source, just set ptr = pgsrc instead of ptr = pgflt 
– see below.


 

I am still puzzled why the programmable source does not work. It works 
within the paraview GUI – but not outside. To see how it works within 
the paraview GUI do the following:


Open paraview

Create a programmable source

Copy the script part below into the GUI editor

Click apply

.

 

 


Regards,

Louis

 

 


$$

 


from paraview import servermanager

connection = servermanager.Connect()

#

pgsrc = servermanager.sources.ProgrammableSource()

pgflt = servermanager.filters.ProgrammableFilter()

#

#ptr = pgsrc

ptr = pgflt

#

ptr.GetProperty(Script).SetElement(0, 

import vtk

pts=vtk.vtkPoints()

pts.Initialize()

pts.InsertNextPoint(0,0,0)

pts.InsertNextPoint(1,0,.0)

pts.InsertNextPoint(2,1,0)

pts.InsertNextPoint(3,3,0.)

 


cel=vtk.vtkCellArray()

cel.Initialize()

cel.InsertNextCell(4) # number of points

cel.InsertCellPoint(0)

cel.InsertCellPoint(1)

cel.InsertCellPoint(2)

cel.InsertCellPoint(3)

 


output = self.GetOutput()

output.SetPoints(pts)

output.SetStrips(cel)

)

 


pgflt.Input = pgsrc

 


view = servermanager.CreateRenderView()

rep = servermanager.CreateRepresentation(ptr,view)

 


view.StillRender()

view.ResetCamera()

view.StillRender()

 


$$$

 





___
ParaView mailing list
ParaView@paraview.org
http://www.paraview.org/mailman/listinfo/paraview

___
ParaView mailing list
ParaView@paraview.org
http://www.paraview.org/mailman/listinfo/paraview


Re: [Paraview] Manipulating points.

2008-11-21 Thread Andrew Maclean
Thankyou for this, I will try it out.
Regards
   Andrew

On Sat, Nov 22, 2008 at 1:47 AM, David E DeMarle
[EMAIL PROTECTED] wrote:
 On Fri, Nov 21, 2008 at 5:20 AM, Andrew Maclean
 [EMAIL PROTECTED] wrote:
 Is it possible to select a single point, change its 3D coordinates and
 re-render it?
 We are building 3D maps by hand and sometimes the coordinates of
 points go awry so we need to adjust them.

 What I am hoping to do is to convert our files to vtp files, feed them
 into ParaView and then hand edit any points that are wrong. The point
 here is that ParaView is really good at visualisation so any errors
 are readily apparent.

 Thanks for any information,
 Andrew
 --
 ___
 Andrew J. P. Maclean
 Centre for Autonomous Systems
 The Rose Street Building J04
 The University of Sydney  2006  NSW
 AUSTRALIA
 Ph: +61 2 9351 3283
 Fax: +61 2 9351 7474
 URL: http://www.acfr.usyd.edu.au/
 ___
 ___
 ParaView mailing list
 ParaView@paraview.org
 http://www.paraview.org/mailman/listinfo/paraview


 Not automatically. You could do it with a lot of effort via selection
 and the programmable filter and the spreadsheet view.

 The process would be:

 Split the view top to bottom and make a spreadsheet view. Show the
 data's selected point values in the spreadsheet view.

 Insert a programmable filter, make it shallow copy through the point
 and cell associated attribute data.

 Split the 3D view again, now right to left, and make the original data
 visible in one view and the filter's output in the other. Link the
 cameras.

 Select a vertex in the original. It's index and coordinates will be
 shown in the spreadsheet view.

 At a line to the end of the python filters program and change that
 particular point's coordinates in the output data.

 Repeat the last two steps, adding to the program each time.

 --
 David E DeMarle
 Kitware, Inc.
 RD Engineer
 28 Corporate Drive
 Clifton Park, NY 12065-8662
 Phone: 518-371-3971 x109
 ___
 ParaView mailing list
 ParaView@paraview.org
 http://www.paraview.org/mailman/listinfo/paraview




-- 
___
Andrew J. P. Maclean
Centre for Autonomous Systems
The Rose Street Building J04
The University of Sydney  2006  NSW
AUSTRALIA
Ph: +61 2 9351 3283
Fax: +61 2 9351 7474
URL: http://www.acfr.usyd.edu.au/
___
___
ParaView mailing list
ParaView@paraview.org
http://www.paraview.org/mailman/listinfo/paraview


Re: [Paraview] Why does this programmable source not work outside the paraview GUI

2008-11-21 Thread Louis at M-Tech
Thank you Utkarsh, this solved my problem.

-Original Message-
From: Utkarsh Ayachit [mailto:[EMAIL PROTECTED] 
Sent: 21 November 2008 09:35 PM
To: Louis Le Grange
Cc: [EMAIL PROTECTED] Org
Subject: Re: [Paraview] Why does this programmable source not work outside
the paraview GUI

The answer is simple: you are missing the UpdateVTKObjects() call to
'apply' the change to the property.

If you going to use ...GetProperty(..).SetElement(...) API then after
the property has been set, one must call proxy.UpdateVTKObjects().

so in your example:
...
pgsrc.GetProperty(Script).SetElement(0,  ... )
pgsrc.UpdateVTKObjects()

Alternatively  you can simply do:
pgsrc.Script = .

and then you don't have to worry about calling UpdateVTKObjects().

Utkarsh



Louis at M-Tech wrote:
 Hi All,



 Why does this piece of code containing a programmable source not work
 OUTSIDE the paraview GUI?



 a) When the source is changed to ConeSource() it works (see Label 1 in
 the code below).



 b) Also when the Script content is pasted inside the paraview GUI
 scripting editor, it does work - so the script contents itself is ok.



 When the code is run directly from a python command line only an empty
 graphis window is displayed - as if the script part is faulty.



 Thanks in advance,

 Louis



 HERE IS THE EXAMPLE:

 @@

 from paraview import servermanager

 connection = servermanager.Connect()

 pgsrc=servermanager.sources.ProgrammableSource()





 pgsrc.GetProperty(Script).SetElement(0, 



 import vtk

 pts=vtk.vtkPoints()

 pts.Initialize()

 pts.InsertNextPoint(0,0,0)

 pts.InsertNextPoint(1,0,.0)

 pts.InsertNextPoint(2,1,0)

 pts.InsertNextPoint(3,3,0.)



 cel=vtk.vtkCellArray()

 cel.Initialize()

 cel.InsertNextCell(4) # number of points

 cel.InsertCellPoint(0)

 cel.InsertCellPoint(1)

 cel.InsertCellPoint(2)

 cel.InsertCellPoint(3)



 output = self.GetOutput()

 output.SetPoints(pts)

 output.SetStrips(cel)



 )





 view = servermanager.CreateRenderView()



 # This programmable source pgsrc does not display

 rep = servermanager.CreateRepresentation(pgsrc,view)



 # Label 1: This source do display

 #coneSource = servermanager.sources.ConeSource()

 #rep = servermanager.CreateRepresentation(coneSource,view)





 view.StillRender()

 view.ResetCamera()

 view.StillRender()



 




 

 ___
 ParaView mailing list
 ParaView@paraview.org
 http://www.paraview.org/mailman/listinfo/paraview

___
ParaView mailing list
ParaView@paraview.org
http://www.paraview.org/mailman/listinfo/paraview


[Paraview] loading Proxy from xml state

2008-11-21 Thread Nehme Bilal

Hello,

I am trying to copy proxy properties from xml state. the 
folowing code work well for sources proxies. It works 
also for representations proxies, but Instead of copying 
properties to the existing representation, it create 
another representation and I got this error:
vtkSMStateLoader (0A075FD0): No root is defined. Cannot 
locate proxy element with id 74

In Paraview I got two representations for the same source.
Here is my code:
void pqPowerView::loadProxyFromState(vtkPVXMLElement 
*stateElement,


 vtkSMProxy 
*smProxy )
{
vtkSMProxyManager* pxm = vtkSMObject::GetProxyManager();
vtkSMStateLoader *myLoader = vtkSMStateLoader::New();
	vtkPVXMLElement* collectionElement = 
vtkPVXMLElement::New();


	unsigned int numElems = 
stateElement-GetNumberOfNestedElements();

  unsigned int i=0;

  for (i=0; inumElems; i++)
  {
vtkPVXMLElement* currentElement = 
stateElement-GetNestedElement(i);

if (currentElement-GetName() 
  strcmp(currentElement-GetName(), Proxy) == 0)
{
currentElement-AddNestedElement(collectionElement);
			if(QString(currentElement-GetAttribute(group)) == 
smProxy-GetXMLGroup()
 QString(currentElement-GetAttribute(id)) == 
QString(smProxy-GetSelfIDAsString()) )

{
vtkSMProxy *newProxy = 
pxm-NewProxy(smProxy-GetXMLGroup(), 
smProxy-GetXMLName());

newProxy-LoadState(currentElement, myLoader);
this-copyProxy(newProxy,smProxy);   

if(!smProxy)
qDebug()  proxy not loaded;
}
}   
}
}


void pqPowerView::copyProxy(vtkSMProxy* src, vtkSMProxy* 
dest)

{
	vtkSMPropertyIterator* iter = 
dest-NewPropertyIterator();

for (iter-Begin(); !iter-IsAtEnd(); iter-Next())
 {
 vtkSMProperty* destProp = iter-GetProperty();
		 vtkSMProperty* srcProp = 
src-GetProperty(iter-GetKey());

 if (destProp  srcProp)
 {
 destProp-Copy(srcProp);
 }
 }
iter-Delete();
}

can you please tell me what am doing wrong ?

the goal is to restore the exposed properties for the xml 
state.


 
___

ParaView mailing list
ParaView@paraview.org
http://www.paraview.org/mailman/listinfo/paraview