Table of contents Index

class GvShape

Declared in module gview

Synopsis

class GvShape:
    def gview.GvShape.__init__(self, _obj=None, type=1)
    def gview.GvShape.add_node(self, x, y, z=0, ring=0) # Add a node.
    def gview.GvShape.get_node(self, node=0, ring=0) # Fetch a node (point) as a tuple.
    def gview.GvShape.get_nodes(self, ring=0) # Get number of nodes.
    def gview.GvShape.get_properties(self) # Get GvShape properties (attributes) as a dictionary.
    def gview.GvShape.get_rings(self)
    def gview.GvShape.get_type(self) # Get shape type.
    def gview.GvShape.set_node(self, x, y, z=0, node=0, ring=0) # Set a node.
    def gview.GvShape.set_property(self, name, value) # Set a GvShape property.

Description

Vector feature class for GvShapes/GvShapesLayer

gview.GvShape.add_node(self, x, y, z=0, ring=0)

Add a node.

x
the x value to assign.
y
the y value to assign.
z
the z value to assign.
ring
the ring containing the node to set.

Note that the ring will be created if not already in existance. The index of the newly created node is returned.

gview.GvShape.get_node(self, node=0, ring=0)

Fetch a node (point) as a tuple.

node
the node within the selected ring to return. Defaults to zero.
ring
the ring containing the desired node. Defaults to zero.

The node is returned as an (x,y,z) tuple. None is returned if the requested node is out of range.

gview.GvShape.get_nodes(self, ring=0)

Get number of nodes.

ring
the ring to check. Defaults to zero.

Note that the returned number of nodes will be zero for non-existent rings.

gview.GvShape.get_properties(self)

Get GvShape properties (attributes) as a dictionary.

The properties are returned as a Python dictionary. Note that changes to this dictionary are not applied back to the GvShape.

gview.GvShape.get_rings(self)

None

Get number of rings.

gview.GvShape.get_type(self)

Get shape type.

The returned integer will match one of gview.GVSHAPE_POINT, gview.GVSHAPE_LINE or gview.GVSHAPE_AREA.

gview.GvShape.set_node(self, x, y, z=0, node=0, ring=0)

Set a node.

x
the x value to assign.
y
the y value to assign.
z
the z value to assign.
node
the node to set.
ring
the ring containing the node to set.

Note that the node and ring will be created if not already in existance.

gview.GvShape.set_property(self, name, value)

Set a GvShape property.

name
the key or name of the property being set. Should be a well behaved token (no spaces, equal signs, or colons).
value
the value to be assigned. Any text is acceptable.

Valid HTML 4.0! Made with CSS