
<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>


