For examples and more explanations, see the module level docs.
class TopologyViewer(Kamaelia.UI.MH.PyGameApp, Axon.Component.component)
TopologyViewer(...) -> new TopologyViewer component.
A component that takes incoming topology (change) data and displays it live using pygame. A simple physics model assists with visual layout. Particle types, appearance and physics interactions can be customised.
Keyword arguments (in order):
Methods defined here
__init__(self[, screensize][, fullscreen][, caption][, particleTypes][, initialTopology][, laws][, simCyclesPerRedraw][, border][, extraDrawing][, showGrid][, transparency][, position])
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
generateXY(posSpec) -> (x,y) or raises ValueError
posSpec == "randompos" or "auto" -> random (x,y) within the surface (specified border distance in from the edege) posSpec == "(XXX,YYY)" -> specified x,y (positive or negative integers)
Add particles to the system
Break a bond from source to destination particle, specified by IDs
Proceses a topology command tuple: [ "ADD", "NODE", <id>, <name>, <positionSpec>, <particle type> ] [ "DEL", "NODE", <id> ] [ "ADD", "LINK", <id from>, <id to> ] [ "DEL", "LINK", <id from>, <id to> ] [ "DEL", "ALL" ] [ "GET", "ALL" ]
getParticleLabel(node_id) -> particle's name
Returns the name/label of the specified particle.
getTopology() -> list of command tuples that would build the current topology
Handle keypresses: ESCAPE, Q : quits F : toggles fullscreen mode arrows : scroll the view
Handle releases of keys
Proceses commands from "inbox" inbox, runs physics simulation, then renders display
FIXME: This is massively broken, this component overrides initialiseComponent, and also has a main AND has a mainLoop.
Make a bond from source to destination particle, specified by IDs
Remove particle(s) specified by their ids.
Also breaks any bonds to/from that particle.
Render elements to self.screen
Scroll the contents being displayed on the surface by (dx,dy) left and up.
Select the specified particle.
updateParticleLabel(node_id, new_name) -> updates the given nodes name & visual label if it exists
node_id - an id for an already existing node new_name - a string (may include spaces) defining the new node name
Got a problem with the documentation? Something unclear that could be clearer? Want to help improve it? Constructive criticism is very welcome - especially if you can suggest a better rewording!
Please leave you feedback here in reply to the documentation thread in the Kamaelia blog.
-- Automatic documentation generator, 05 Jun 2009 at 03:01:38 UTC/GMT
This is an ongoing community based development site. As a result the contents of this page is the opinions of the contributors of the pages involved not the organisations involved. Specificially, this page may contain personal views which are not the views of the BBC. (the site is powered by a wiki engine)
(C) Copyright 2008 Kamaelia Contributors, including the British Broadcasting Corporation, All Rights Reserved.