File: helix.xml

package info (click to toggle)
paraview 5.1.2%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 221,108 kB
  • ctags: 236,092
  • sloc: cpp: 2,416,026; ansic: 190,891; python: 99,856; xml: 81,001; tcl: 46,915; yacc: 5,039; java: 4,413; perl: 3,108; sh: 1,974; lex: 1,926; f90: 748; asm: 471; pascal: 228; makefile: 198; objc: 83; fortran: 31
file content (71 lines) | stat: -rw-r--r-- 2,868 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71

<ServerManagerConfiguration>
  <ProxyGroup name="sources">

  <!-- server manager xml for a python script that creates a helix 
       the auto generated panel for this exposes everything more than we want so
       a custom panel would be good -->
    <SourceProxy name="HelixSource" class="vtkPythonProgrammableFilter"
                 label="Helix Source">
      <Documentation
         long_help="Creates a helix using a python script using parameters filled in by the user."
         short_help="Creates a helix.">
           This source will execute a python script to produce a helix dataset.
      </Documentation>
      
      <!-- data set type -->
      <IntVectorProperty 
        name="OutputDataSetType" 
        command="SetOutputDataSetType" 
        number_of_elements="1"
        default_values="0"> 
        <!-- value of 0 means vtkPolyData -->
      </IntVectorProperty>

      <!-- the script -->
     <StringVectorProperty 
        name="Script" 
        command="SetScript"
        number_of_elements="1"
        default_values="import math;&#xa;pdo = self.GetPolyDataOutput()&#xa;&#xa;newPts = vtk.vtkPoints()&#xa;for i in range(0, numPts):&#xa;   x = i*float(length)/float(numPts)&#xa;   y = math.sin(i*rounds*2*math.pi/numPts)&#xa;   z = math.cos(i*rounds*2*math.pi/numPts)&#xa;   newPts.InsertPoint(i, x,y,z)&#xa;&#xa;pdo.SetPoints(newPts)&#xa;aPolyLine = vtk.vtkPolyLine()&#xa;&#xa;aPolyLine.GetPointIds().SetNumberOfIds(numPts)&#xa;for i in range(0,numPts):&#xa;   aPolyLine.GetPointIds().SetId(i, i)&#xa;&#xa;pdo.Allocate(1, 1)&#xa;pdo.InsertNextCell(aPolyLine.GetCellType(), aPolyLine.GetPointIds())&#xa;">
       <Hints>
         <Widget type="multi_line"/>
       </Hints>
     </StringVectorProperty>

     <!-- python script references a variable "numPts" 
          we expose this as a property allowing the user to set it -->
     <StringVectorProperty
       name="NumberOfPoints"
       command="SetParameter"
       number_of_elements="2"
       default_values_delimiter=";"
       default_values="numPts;80">
     </StringVectorProperty>
     
     <!-- python script references a variable "length" 
          we expose this as a property allowing the user to set it -->
     <StringVectorProperty
       name="Length"
       command="SetParameter"
       number_of_elements="2"
       default_values_delimiter=";"
       default_values="length;2.0">
     </StringVectorProperty>
     
     <!-- python script references a variable "rounds" 
          we expose this as a property allowing the user to set it -->
     <StringVectorProperty
       name="NumberOfRounds"
       command="SetParameter"
       number_of_elements="2"
       default_values_delimiter=";"
       default_values="rounds;3">
     </StringVectorProperty>

    <!-- End HelixSource -->
    </SourceProxy>
  </ProxyGroup>
</ServerManagerConfiguration>