def runTest():
    options = servermanager.vtkProcessModule.GetProcessModule().GetOptions()
    url = options.GetServerURL()
    smp.Connect(getHost(url), getPort(url))

    r = smp.CreateRenderView()
    r.RemoteRenderThreshold = 20
    s = smp.Sphere()
    s.PhiResolution = 80
    s.ThetaResolution = 80

    d = smp.Show()
    d.Representation = "Wireframe"
    smp.Render()
    r.RemoteRenderThreshold = 0
    smp.Render()
    s.PhiResolution = 8
    s.ThetaResolution = 8
    smp.Render()

    smtesting.ProcessCommandLineArguments()
    if not smtesting.DoRegressionTesting(r.SMProxy):
        raise smtesting.TestError("Test failed!!!")
    print("Test Passed")
view = GetRenderView()
view.ViewSize = [400, 400]
view.RemoteRenderThreshold = 0
SetActiveView(view)
Render()

# Select cells from a wavelet volume
wav = FindSource('Wavelet1')
SetActiveSource(wav)

rep = vtkCollection()
sources = vtkCollection()
view.SelectSurfaceCells([0, 0, 200, 200], rep, sources)
sel = sources.GetItemAsObject(0)
selPyProxy = servermanager._getPyProxy(sel)
extract = ExtractSelection(Selection=selPyProxy)
Show()

# Hide the volume and show the ExtractSelection filter
wav_rep = GetRepresentation(wav)
wav_rep.Visibility = False

extract_rep = GetRepresentation(extract)
extract_rep.Visibility = True

## Compare with baseline
if not smtesting.DoRegressionTesting(view.SMProxy):
    raise smtesting.TestError('Test failed.')

print('\nTest passed.')
from visocyte import simple
from visocyte import smtesting

renderView = simple.CreateView('RenderView')

renderView.AxesGrid = 'GridAxes3DActor'
renderView.AxesGrid.Visibility = 1
renderView.AxesGrid.XTitleColor = [0.0, 0.0, 0.0]
renderView.AxesGrid.YTitleColor = [0.0, 0.0, 0.0]
renderView.AxesGrid.ZTitleColor = [0.0, 0.0, 0.0]
renderView.AxesGrid.GridColor = [0.0, 0.0, 0.0]
renderView.AxesGrid.ShowGrid = 1
renderView.AxesGrid.XLabelColor = [0.0, 0.0, 0.0]
renderView.AxesGrid.YLabelColor = [0.0, 0.0, 0.0]
renderView.AxesGrid.ZLabelColor = [0.0, 0.0, 0.0]
renderView.AxesGrid.DataScale = [1, 1, 1]

renderView.OrientationAxesVisibility = 0
renderView.Background = [1.0, 1.0, 1.0]

simple.Render(renderView)

if not smtesting.DoRegressionTesting(renderView.SMProxy):
    raise smtesting.TestError('Image comparison failed.')
Пример #4
0
from visocyte.simple import *
import sys
from visocyte import smtesting

resolution = 15
cone = Cone(Resolution=resolution)
if cone.Resolution != resolution:
    raise smtesting.TestError(
        'Test failed: Resolution has not been set properly.')

resolution = 12
cone.Resolution = resolution
if cone.Resolution != resolution:
    raise smtesting.TestError('Test failed: Problem changing resolution.')

cone.Center = [3.1, 4.2, 5.5]
if cone.Center[0] != 3.1 or cone.Center[1] != 4.2 or cone.Center[2] != 5.5:
    raise smtesting.TestError('Test failed: Problem setting center of cone.')

shrinkFilter = Shrink(cone)
if shrinkFilter.Input.GetAddressAsString('') != cone.GetAddressAsString(''):
    raise smtesting.TestError('Test failed: Pipeline not properly set.')

shrinkFilter.UpdatePipeline()
if shrinkFilter.GetDataInformation().GetNumberOfCells(
) != resolution + 1 or shrinkFilter.GetDataInformation().GetNumberOfPoints(
) != resolution * 4:
    raise smtesting.TestError('Test failed: Pipeline not operating properly.')

resolution = 33
rp = cone.GetProperty("Resolution")
Пример #5
0
from visocyte.simple import *
import sys
from visocyte import smtesting

sphere = Sphere()
sphere.PhiResolution = 20
sphere.ThetaResolution = 20

clientsphere = servermanager.Fetch(sphere)
if clientsphere.GetNumberOfPolys() != 720:
    raise smtesting.TestError('Test failed: Problem fetching polydata.')

elev = Elevation(sphere)
mm = servermanager.filters.MinMax()
mm.Operation = "MIN"

mindata = servermanager.Fetch(elev, mm, mm)

if mindata.GetPointData().GetNumberOfArrays() != 2:
    raise smtesting.TestError('Test failed: Wrong number of arrays.')

array = mindata.GetPointData().GetArray('Elevation')
print("%d %f" % (array.GetNumberOfTuples(), array.GetTuple1(0)))

if array.GetTuple1(0) < 0.2 and array.GetTuple1(0) > 0.29:
    raise smtesting.TestError('Test failed: Bad array value.')

rep = Show(elev)
ai = elev.PointData[1]
if ai.GetName() != 'Elevation':
    pd = elev.GetPointDataInformation()
Пример #6
0
from visocyte.simple import *
import sys
from visocyte import smtesting

smtesting.ProcessCommandLineArguments()
reader = ExodusIIReader(FileName=smtesting.DataDir + '/Testing/Data/can.ex2')

if len(reader.TimestepValues) != 44:
    raise smtesting.TestError('Wrong amount of time steps.')

if reader.TimestepValues[0] != 0.0 or reader.TimestepValues[
        -1] != 0.004299988504499197:
    raise smtesting.TestError('Wrong time step value.')

fields = reader.PointVariables

if 'DISPL' not in fields:
    raise smtesting.TestError('DISPL not available.')

if 'VEL' not in fields:
    raise smtesting.TestError('VEL not available.')

if 'ACCL' not in fields:
    raise smtesting.TestError('ACCL not available.')

fields = reader.PointVariables.Available

if 'DISPL' not in fields:
    raise smtesting.TestError('DISPL not available.')

if 'VEL' not in fields: