pdk.Plot.Primitives ($Date: 2002/12/04 10:15:49 $)
index
pdk/Plot/Primitives.py

Primitives for the plotting package of pdk.

Based on graphite, which was written by Joseph and Michelle Strout in 1999.

All primitives accept information such as start and end points as part of their constructor.

Symbols and FormattedLines can be cloned and their appearance simultaneously changed by configuring the "style" property of an arbitrary clone.

Todo: + Bezier primitive + re-implement dashed lines

FOG 03/2000

 
Classes
            
pdk.PropertyManagers.ComponentPropertyManager(pdk.PropertyManagers.PropertyManager)
_Primitive
ManyPointsPrimitive
Box
Polygon
SinglePointPrimitive
Text
_Symbol
CircleSymbol
SquareSymbol
TriangleSymbol
TwoPointsPrimitive
Arrow
Line
__builtin__.dict(__builtin__.object)
_SymbolTypeRegistry
 
class Arrow(TwoPointsPrimitive)
     
Purpose:implements an arrow primitive

 
  
Method resolution order:
Arrow
TwoPointsPrimitive
_Primitive
pdk.PropertyManagers.ComponentPropertyManager
pdk.PropertyManagers.PropertyManager
__builtin__.object

Methods defined here:
draw(self, canvas)

Data and non-method functions defined here:
PROPERTIES = {'style': <pdk.Properties.InstanceProperty instance>}
 
class Box(ManyPointsPrimitive)
     
Purpose:3D box primitive

 
  
Method resolution order:
Box
ManyPointsPrimitive
_Primitive
pdk.PropertyManagers.ComponentPropertyManager
pdk.PropertyManagers.PropertyManager
__builtin__.object

Methods defined here:
__init__(self, (p1, p2), **optionD)
Parameters:
  • p1 : bottom left back corner
  • p2 : top right front corner

Both corners are 2-, 3-, or 4-tuples.

draw(self, canvas)

Data and non-method functions defined here:
PROPERTIES = {'style': <pdk.Properties.InstanceProperty instance>}
 
class CircleSymbol(_Symbol)
     
Purpose:implements the circle symbol

 
  
Method resolution order:
CircleSymbol
_Symbol
SinglePointPrimitive
_Primitive
pdk.PropertyManagers.ComponentPropertyManager
pdk.PropertyManagers.PropertyManager
__builtin__.object

Methods defined here:
draw(self, canvas)

Properties defined here:
style

Data and non-method functions defined here:
PROPERTIES = {'style': <pdk.Properties.InstanceProperty instance>}
 
class Line(TwoPointsPrimitive)
     
Purpose:line primitive
Detail:implements a line from %p1% to %p2%, each of which is a 2-, 3-, or 4-tuple.

 
  
Method resolution order:
Line
TwoPointsPrimitive
_Primitive
pdk.PropertyManagers.ComponentPropertyManager
pdk.PropertyManagers.PropertyManager
__builtin__.object

Methods defined here:
draw(self, canvas)
setPreviousSegment(self, segment)

Data and non-method functions defined here:
PROPERTIES = {'style': <pdk.Properties.InstanceProperty instance>}
 
class ManyPointsPrimitive(_Primitive)
     
Purpose:base class for primitives based on more than two points

 
  
Method resolution order:
ManyPointsPrimitive
_Primitive
pdk.PropertyManagers.ComponentPropertyManager
pdk.PropertyManagers.PropertyManager
__builtin__.object
 
class Polygon(ManyPointsPrimitive)
     
Purpose:polygon primitive

 
  
Method resolution order:
Polygon
ManyPointsPrimitive
_Primitive
pdk.PropertyManagers.ComponentPropertyManager
pdk.PropertyManagers.PropertyManager
__builtin__.object

Methods defined here:
draw(self, canvas)

Data and non-method functions defined here:
PROPERTIES = {'closed': <pdk.Properties.BooleanProperty instance>, 'style': <pdk.Properties.InstanceProperty instance>}
 
class SinglePointPrimitive(_Primitive)
     
Purpose:base class for primitives consisting of a single point

 
  
Method resolution order:
SinglePointPrimitive
_Primitive
pdk.PropertyManagers.ComponentPropertyManager
pdk.PropertyManagers.PropertyManager
__builtin__.object

Methods defined here:
getPosition(self, axes=[0, 1, 2])
setPosition(self, p)
 
class SquareSymbol(_Symbol)
     
Purpose:implements the square symbol

 
  
Method resolution order:
SquareSymbol
_Symbol
SinglePointPrimitive
_Primitive
pdk.PropertyManagers.ComponentPropertyManager
pdk.PropertyManagers.PropertyManager
__builtin__.object

Methods defined here:
draw(self, canvas)

Data and non-method functions defined here:
PROPERTIES = {'angle': <pdk.Properties.FloatProperty instance>}
 
class Text(SinglePointPrimitive)
     
Purpose:a string to be drawn at some position in 3D space.

 
  
Method resolution order:
Text
SinglePointPrimitive
_Primitive
pdk.PropertyManagers.ComponentPropertyManager
pdk.PropertyManagers.PropertyManager
__builtin__.object

Methods defined here:
draw(self, canvas)

Data and non-method functions defined here:
PROPERTIES = {'angle': <pdk.Properties.FloatProperty instance>, 'style': <pdk.Properties.InstanceProperty instance>, 'text': <pdk.Properties.StringProperty instance>}
 
class TriangleSymbol(_Symbol)
     
Purpose:implements the triangle symbol

 
  
Method resolution order:
TriangleSymbol
_Symbol
SinglePointPrimitive
_Primitive
pdk.PropertyManagers.ComponentPropertyManager
pdk.PropertyManagers.PropertyManager
__builtin__.object

Methods defined here:
draw(self, canvas)

Data and non-method functions defined here:
PROPERTIES = {'angle': <pdk.Properties.FloatProperty instance>}
 
class TwoPointsPrimitive(_Primitive)
     
Purpose:base class for primitives based on two points.

 
  
Method resolution order:
TwoPointsPrimitive
_Primitive
pdk.PropertyManagers.ComponentPropertyManager
pdk.PropertyManagers.PropertyManager
__builtin__.object

Methods defined here:
getBounds(self)
setBounds(self, (p1, p2))
 
class _Symbol(SinglePointPrimitive)
     
Purpose:abstract base class for symbols

 
  
Method resolution order:
_Symbol
SinglePointPrimitive
_Primitive
pdk.PropertyManagers.ComponentPropertyManager
pdk.PropertyManagers.PropertyManager
__builtin__.object

Data and non-method functions defined here:
PROPERTIES = {'style': <pdk.Properties.InstanceProperty instance>}
 
class _Primitive(pdk.PropertyManagers.ComponentPropertyManager)
     
Purpose:abstract base class for elementary drawing object in 3D space
Detail:can be transformed, and can plot itself into a PIDDLE canvas (ignoring Z coordinate when doing so). By convention, all primitives receive the coordinates that define their position in space as positional arguments to their constructor; consequently, derived classes have to provide customized methods to configure that position.

 
  
Method resolution order:
_Primitive
pdk.PropertyManagers.ComponentPropertyManager
pdk.PropertyManagers.PropertyManager
__builtin__.object

Methods defined here:
__getstate__(self)
fine-tunes the copying behavior for this object: copies share the properties (via the base class method), but maintain their own point arrays)
__init__(self, points, **initPropertyD)
__setstate__(self, argT)
draw(self, canvas)
getPoint(self, index)
get the index th point.
getPoints(self)
get the point array.
projectTo2D(self)
do the final projection from extended 3D coordinates to 2D coordinates.
setPoint(self, index, p)
set the index`th point to `p.
setPoints(self, pointT)
update the points array with the points in pointT.
transform3x3(self, matrix)
transform our control points by the given 3x3 transformation matrix.
transform4x4(self, matrix)
transform our control points by the given 4x4 transformation matrix.
 
class _SymbolTypeRegistry(__builtin__.dict)
     
Purpose:a simple registry mapping symbol type strings to symbol classes

 
  
Method resolution order:
_SymbolTypeRegistry
__builtin__.dict
__builtin__.object

Methods defined here:
getSymbolType(self, symbolTypeString)
registerSymbolType(self, symbolTypeString, symbolClass)
registers the symbol class symbolClass with the type string symbolTypeString.

Data and non-method functions defined here:
__dict__ = <dict-proxy object>
__weakref__ = <member '__weakref__' of '_SymbolTypeRegistry' objects>
 
Functions
            
register_symbol_type = registerSymbolType(self, symbolTypeString, symbolClass) method of _SymbolTypeRegistry instance
 
Author
            
$Author: gathmann $