1 # Copyright (C) 2010-2014 CEA/DEN, EDF R&D
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 if not ('servermanager' in dir()):
21 from pvsimple import *
26 """Simple demo that create the following pipeline
32 # Create a sphere of radius = 0.5, theta res. = 32
33 # This object becomes the active source.
34 ss = Sphere(Radius=0.5, ThetaResolution=32, PhiResolution=8)
36 # The view and representation
39 v = CreateRenderView()
40 v.CameraPosition = [-3, -3, -3]
41 v.CameraViewUp = [0, 0, 1]
44 # Apply the shrink filter. The Input property is optional. If Input
45 # is not specified, the filter is applied to the active source.
46 shr = Shrink(Input=ss)
48 # Create a cone source.
51 # Append cone and shrink
52 app = AppendDatasets()
55 # Show the output of the append filter. The argument is optional
56 # as the app filter is now the active object.
58 WriteImage(filename = (impth + "demo1_1.png"), view=v, Magnification=2)
60 PointData = app.GetDataInformation().GetNumberOfPoints()
61 CellData = app.GetDataInformation().GetNumberOfCells()
62 print PointData, " Points"
63 print CellData, " Cells"
65 # Render the default view.
69 testdir = os.getenv("TESTDIR")
70 pvdata = os.getenv("PVDATA")
72 if __name__ == "__main__":
73 demo1(impth =testdir+"/Pic/")