Code Search for Developers
 
 
  

ovalvobtest.py from gzz at Krugle


Show ovalvobtest.py syntax highlighted

# 
# Copyright (c) 2003, Asko Soukka
# 
# This file is part of Gzz.
# 
# Gzz is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# 
# Gzz is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
# Public License for more details.
# 
# You should have received a copy of the GNU Lesser General
# Public License along with Gzz; if not, write to the Free
# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA  02111-1307  USA
# 
# 


import gzz
from gzz.view import View
from test.tools import tools
from java.lang import Math

space = gzz.impl.ModularSpace(*tools.spaceArgList())
style = GraphicsAPI.getInstance().getTextStyle("serif", 0, 14)
c = space.N()
cv = gzz.view.TextCellContentView(style)

class ViewScene:
    def scene(self, vs):
        size = vs.getSize()
        w = .5 * size.width
        h = .5 * size.height
	self.bgcolor = (0.2, 0.3, 0.4)
        putnoc(vs, background(self.bgcolor))
        cs2 = vs.coords.affineCoordsys(0, 0, 0, 0, 0.1, 0, 0, 0.1)
        angle = Math.PI / 5.0
        for i in range(10):
            cs1 = vs.coords.affineCoordsys(0, 0, w + self.x(i*angle, w/2),
                                          h + self.y(i*angle, h/2), w/10, 0, 0, h/10)
            vs.matcher.add(cs1, "cs")
            vs.map.put(gzz.vob.OvalBgVob(), cs1, cs2)

    def x(self, angle, radius):
        return (Math.cos(angle) * radius);
		
    def y(self, angle, radius):
        return (Math.sin(angle) * radius);

currentScene = ViewScene()



#class CoronaView (View.NamedView):
#    def render(sc, into, context):
#        pass
#    
#    def getDefaultName():
#        return "CoronaView"

#import gzz
#from test.tools import tools



#class Scene:
#    def key(self, key): pass
#    def scene(self, vs):
#	putnoc(vs, background((1,1,1)))
#	w = 600
#	h = v.getHeight(c, w, 1)

#	print vs.coords
#	cs = vs.coordsys(0, 'key', 0, 100, 100, 2, 2)
#	v.place(c, vs, cs, w, h, None, 1)


#currentScene = Scene()



#c.setText("blah")



















See more files for this project here

gzz

An implementation of Ted Nelson's ZZstructure. ZZstructure is a new type of programming platform for structured data.

Project homepage: http://savannah.nongnu.org/projects/gzz
Programming language(s): C++,Java,Python
License: lgpl21

  color/
    colors.py
  fillet/
    __init__.py
    ambiguity.py
    oldcode.py
    util.py
    zbuffer.py
  nic/
    README
    stencil.py
    stencildepth.py
  opengl/
    __init__.py
    bumpy.py
    culltest.py
    fragprog.py
    glinfo.py
    imaging.py
    mipmap.py
    pacman.py
    readpixels.py
    stencil.py
    texform.py
    texperf.py
  paper/
    __init__.py
    basis.py
    combinerflow.py
    combiners.py
    combinerutil.py
    multipaper.py
    singlepaper.py
    util.py
  Makefile
  __init__.py
  brokentext.py
  buoydev.py
  buoyoing.py
  calendarvobtest.py
  clamptexture.cxx
  clonetest.py
  coords_benchmark.py
  debugtest.cxx
  fillets.py
  fisheye.py
  fontfilter.py
  fontfilter2.py
  fpfont.py
  frametest.cxx
  irregu3.py
  irregu4.py
  irreguellipse.py
  irregular2.py
  irregularframe.py
  keymap-test.py
  memoryleak.py
  mipzip.py
  motion.py
  ovalvobtest.py
  pagespan.py
  projectivecoords.py
  psyko.py
  psyko2.py
  softshadow.py
  sqfillet.py
  testtimeout.py
  texlab.py
  text.py
  text_benchmark.py
  texturelab.py
  tubeframe.cxx
  tubeframe.hxx
  viewtest.py
  vpbuoy.py
  xuconn.py
  xupdf.py
  zipf.py