Beispiel #1
0
			L = ( flts[0], flts[1], flts[2] )
			print( "LAUNCH : successfully read 'L' field" )
			continue
		assert O is not None, "LAUNCH : 'O' field not found?"
		assert L is not None, "LAUNCH : 'L' field not found?"
		bigbox = BigBox( O, L ) # if here, header is completely known and current line (should) contains the first point -- initialize outermost box and fall out of this if-statement
	assert O[0] <= flts[0] and flts[0] < O[0]+L[0] and O[1] <= flts[1] and flts[1] < O[1]+L[1] and O[2] <= flts[2] and flts[2] < O[2]+L[2], "LAUNCH : tried to insert point outside of BigBox!"
	bigbox.insert_point( ( flts[0], flts[1], flts[2] ) )
f.close()

# scale the BigBox to fit exactly within a BOXVIEWMAXPIXELS x BOXVIEWMAXPIXELS x BOXVIEWMAXPIXELS cube (largest of L[0],L[1] becomes BOXVIEWMAXPIXELS, others scale appropriately)
dilation = ( 2 * mainwin.get_screen().height() / 6.0 ) / max( abs(L[0]), abs(L[1]) )
BBW = dilation*L[0]
BBH = dilation*L[1]
BBD = dilation*L[2]
bigboxview = BoxView( BBW, BBH ) # TO DO: be sure the aspect ratio corresponds to the actual dimensions of the box (only matters for non-cubical)
smallboxviewXY = BoxView( BBW/2, BBH/2 ) # when the BigBox is non-cubical, need three different BoxViews for projections (all three could be different sizes)
smallboxviewYZ = BoxView( BBH/2, BBD/2 ) # when the BigBox is non-cubical, need three different BoxViews for projections (all three could be different sizes)
smallboxviewXZ = BoxView( BBW/2, BBD/2 ) # when the BigBox is non-cubical, need three different BoxViews for projections (all three could be different sizes)
smallboxviews = { "XY":smallboxviewXY , "YZ":smallboxviewYZ , "XZ":smallboxviewXZ } # for convenience
##print( "LAUNCH : screen's resolution is %dx%d; " % ( mainwin.get_screen().width(), mainwin.get_screen().height() ) )
##print( "LAUNCH : large image set to %dx%d; " % ( BBW, BBH ) )
##print( "LAUNCH : small images set to %dx%d, %dx%d, %dx%d" % ( smallboxviewXY.Img.width, smallboxviewXY.Img.height, smallboxviewYZ.Img.width, smallboxviewYZ.Img.height, smallboxviewXZ.Img.width, smallboxviewXZ.Img.height ) )


# connect all signals/events
firstbutton.connect( "clicked", on_first_button_click, bigbox, bigboxview, bigboximage )
prevbutton.connect( "clicked", on_prev_button_click, bigbox, bigboxview, bigboximage )
nextbutton.connect( "clicked", on_next_button_click, bigbox, bigboxview, bigboximage )
lastbutton.connect( "clicked", on_last_button_click, bigbox, bigboxview, bigboximage )
refinebutton.connect( "clicked", on_refine_button_click, bigbox, bigboxview, bigboximage )
Beispiel #2
0
 def setUp(self):
     self.api = BoxView('<box view api key>')