Ejemplo n.º 1
0
 def __next__(self):
     self.i = self.i + 1
     if self.startVal + self.i * self.inc < self.stopVal:
         inviwo.setPropertyValue(self.id, self.startVal + self.i * self.inc)
         return self.i
     else:
         raise StopIteration
Ejemplo n.º 2
0
# Inviwo Python script 
import inviwo 
import math 
import time

start = time.clock()

d = 70
steps = 360
for i in range(0, steps):
   r = (2 * 3.14 * i) / steps
   x = -d*math.sin(r)
   z = d*math.cos(r)
   inviwo.setPropertyValue("PointLightSource.lighting.lightPosition",(x,0,z))

end = time.clock()
fps = steps / (end - start)

fps = round(fps,2)

print ("fps: " + str(fps))
Ejemplo n.º 3
0
import inviwo
import inviwo_utils
import math
import time

start = time.clock()

scale = 1
d = 15
steps = 120
for i in range(0, steps):
    r = (2 * 3.14 * i) / (steps - 1)
    x = d * math.sin(r)
    z = -d * math.cos(r)
    inviwo.setPropertyValue("EntryExitPoints.camera",
                            ((x * scale, 3 * scale, z * scale), (0, 0, 0),
                             (0, 1, 0)))
    inviwo_utils.update()  # Needed for canvas to update

for i in range(0, steps):
    r = (2 * 3.14 * i) / (steps - 1)
    x = 1.0 * math.sin(r)
    z = 1.0 * math.cos(r)
    inviwo.setCameraUp("EntryExitPoints.camera", (x * scale, z * scale, 0))
    inviwo_utils.update()  # Needed for canvas to update

end = time.clock()
fps = 2 * steps / (end - start)

fps = round(fps, 3)
Ejemplo n.º 4
0
# Inviwo Python script
import inviwo

inviwo.setPropertyValue("VolumeSource.filename",
                        inviwo.getVolumePath() + "hydrogenatom.dat")
Ejemplo n.º 5
0
# Inviwo Python script 
import inviwo 
import inviwo_utils
import math 
import time

start = time.clock()

d = 70
steps = 360
for i in range(0, steps):
    r = (2 * 3.14 * i) / (steps-1)
    x = -d*math.sin(r)
    z = d*math.cos(r)
    inviwo.setPropertyValue("Point light source.lightPosition.position",(x,0,z))
    inviwo_utils.update() # Needed for canvas to update

end = time.clock()
fps = steps / (end - start)

fps = round(fps,2)

print ("fps: " + str(fps))
Ejemplo n.º 6
0
	def set(self):
		inviwo.setPropertyValue(self.id, (self.lookfrom, self.lookto, self.lookup))
		inviwoqt.update()
Ejemplo n.º 7
0
# Inviwo Python script 
import inviwo 
import inviwoqt 

#help('modules')


#help('inviwo')

outpath = "D:/temp/pythontest/"

ws = inviwo.getDataPath() + "/workspaces/boron.inv"
inviwoqt.loadWorkspace(ws)

inviwo.wait() 

inviwo.snapshotCanvas(0,outpath +"/snapshot001.png")

inviwo.setPropertyValue("CubeProxyGeometry.clipX",(75,149))

inviwo.snapshotAllCanvases(outpath, "snapshots" , "png")
inviwo.snapshotAllCanvases(outpath)


sampRate = inviwo.getPropertyValue("VolumeRaycaster.raycaster.samplingRate");
if sampRate != 3.0:
    print("should not get here" , file=sys.stderr)
Ejemplo n.º 8
0
# Inviwo Python script 
import inviwo 

inviwo.setPropertyValue("VolumeSource.filename",inviwo.getVolumePath() +"hydrogenatom.dat") 
import inviwo
import inviwoqt

nTests = 25

print("###" + str(nTests) + "###")

print("##PCPRenderer (plain)##")
for i in range(0, nTests):
    inviwo.clickButton("PCP Renderer.invalidate")
    inviwo.wait()
    inviwoqt.update()

inviwo.setPropertyValue("PCP Renderer._depthTesting", True)
inviwo.wait()

print("##PCPRenderer (transparency)##")
for i in range(0, nTests):
    inviwo.clickButton("PCP Renderer.invalidate")
    inviwo.wait()
    inviwoqt.update()

print("##DensityMapGenerator##")
for i in range(0, nTests):
    inviwo.clickButton("Density Map Generator._invalidate")
    inviwo.wait()
    inviwoqt.update()
# Inviwo Python script
import inviwo
import inviwoqt

#help('modules')

#help('inviwo')

outpath = "D:/temp/pythontest/"

ws = inviwo.getDataPath() + "/workspaces/boron.inv"
inviwoqt.loadWorkspace(ws)

inviwo.wait()

inviwo.snapshotCanvas(0, outpath + "/snapshot001.png")

inviwo.setPropertyValue("CubeProxyGeometry.clipX", (75, 149))

inviwo.snapshotAllCanvases(outpath, "snapshots", "png")
inviwo.snapshotAllCanvases(outpath)

sampRate = inviwo.getPropertyValue("VolumeRaycaster.raycaster.samplingRate")
if sampRate != 3.0:
    print("should not get here", file=sys.stderr)
Ejemplo n.º 11
0
	def set(self):
		inviwo.setPropertyValue(self.id, (self.lookfrom, self.lookto, self.lookup))
		inviwoqt.update()
Ejemplo n.º 12
0
# Inviwo Python script 
import inviwo 
import inviwoqt
import math 
import time

import ivw.regression
import ivw.camera

steps = 50

m = ivw.regression.Measurements()


for kernelSize in range(1,25,2):
    start = time.clock()    
    inviwo.setPropertyValue("Image Low Pass.kernelSize",kernelSize)
    inviwoqt.update()
    ivw.regression.saveCanvas("Lowpass", "Lowpass-"+str(kernelSize) + "x" +str(kernelSize))
    end = time.clock()
    m.addFrequency('time-'+str(kernelSize) + "x" +str(kernelSize) , end - start );



m.save()
Ejemplo n.º 13
0
def expectError():
    sys.exit()


###################
#### Load a workspsace ###
###################

#inviwoqt.loadWorkspace(inviwo.getDataPath() + "/workspaces/boron.inv")

#########################
### TEST PROPERTY FUNCTIONS ####
############################

try:
    inviwo.setPropertyValue(12342, 12342)
except:
    printError(sys.exc_info())

try:
    inviwo.setPropertyValue("no.property.with.this.path", 12342)
except:
    printError(sys.exc_info())

try:
    inviwo.setPropertyValue("CubeProxyGeometry.clipX", 12342)
except:
    printError(sys.exc_info())

try:
    inviwo.setPropertyValue("CubeProxyGeometry.clipX", "asdf")
Ejemplo n.º 14
0

###################
#### Load a workspsace ###
###################

#inviwoqt.loadWorkspace(inviwo.getDataPath() + "/workspaces/boron.inv")


#########################
### TEST PROPERTY FUNCTIONS ####
############################


try:
    inviwo.setPropertyValue(12342,12342)
except:
    printError(sys.exc_info())    

try:
    inviwo.setPropertyValue("no.property.with.this.path",12342)
except:
    printError(sys.exc_info())    


try:
    inviwo.setPropertyValue("CubeProxyGeometry.clipX",12342)
except:
    printError(sys.exc_info())    

try:
Ejemplo n.º 15
0
 def start(self):
     self.i = 0
     inviwo.setPropertyValue(self.id, self.startVal)
Ejemplo n.º 16
0
# Inviwo Python script 
import inviwo 
import math 
import time

start = time.clock()

scale = 1;
d = 15
steps = 120
for i in range(0, steps):
   r = (2 * 3.14 * i) / steps
   x = d*math.sin(r)
   z = -d*math.cos(r)
   inviwo.setPropertyValue("EntryExitPoints.camera",((x*scale,3*scale,z*scale),(0,0,0),(0,1,0)))


for i in range(0, steps):
   r = (2 * 3.14 * i) / (steps)
   x = 1.0*math.sin(r)
   z = 1.0*math.cos(r)
   inviwo.setCameraUp("EntryExitPoints.camera",(x*scale,z*scale,0))


end = time.clock()
fps = 2*steps / (end - start)

fps = round(fps,3)

print("Frames per second: " + str(fps))
print("Time per frame: " + str(round(1000/fps,1)) + " ms")
Ejemplo n.º 17
0
 def restore(self):
     self.i = 0
     inviwo.setPropertyValue(self.id, self.initalVal)
Ejemplo n.º 18
0
 def restore(self):
     inviwo.setPropertyValue(self.id, (self.oldlookfrom, self.oldlookto, self.oldlookup))