| Home | Trees | Indices | Help |
|
|---|
|
|
object --+
|
NetworkEditor.itemBase.NetworkItemsBase --+
|
NetworkEditor.itemBase.NetworkItems --+
|
NetworkEditor.items.NetworkNodeBase --+
|
NetworkEditor.items.NetworkNode --+
|
GeometryNode
Base Class to hold a single geometry, should be only inherited,
never instanciated. it handles naming and parenting.
The geometry nodes handle a list of geometries. When the name changes,
a new geom is generated. If an empty name is provided, the current geometry
is deleted.
The parent and children connections reflect the state of the geometry selected
in the combo box. If the parent or children geoms are currently selected in
their own node: the connections are present. If the parent or a child is not
visible (for the selected geometry) the parent port or/and the output port
contour lines are white (instead of black). Before parenting you can set the
behaviour of the 'parent' inputport. Right clicking on the port allows you to
extend the parenting to the sibling geometries present in the node or to all
the geometries of the node. This behaviour set by right clicking will only
affect the next parenting. In the same way, deleting the parent connection,
reparent to 'root' the selected geometry or the sibling geometries or all the
geometries in the child node (depending on the right click menu choice).
THINGS TO DO TO INHERIT
(the best is to follow what is done in class IndexedPolygonsNE bellow)
1- inherit :
class IndexedPolygonsNE(GeometryNode):
2- at the beginning of init, call original init
(the 'indexedPolygons' in quotes will be the name of the output port):
kw['name'] = name
apply( GeometryNode.__init__, (self, 'indexedPolygons'), kw )
3- rearrange ports order after appending additionnal input and output:
self.rearrangePorts()
4- at the beginning of doit, call original doit:
GeometryNode.doit(self, name, instanceMatrices, geomOptions, parent)
5- the doit function should really immitate the class IndexedPolygonsNE example
(parameters linked to input ports from the base class must be passed as last)
def doit(self, coords, indices, vnormals=None, colors=None,
name=None, instanceMatrices=None, geomOptions=None, parent=None):
6- override appendGeometry()
def appendGeometry(self, name):
from DejaVu.IndexedPolygons import IndexedPolygons
self.geoms.append(IndexedPolygons(name))
return 1 # num of geoms appended
7- don't forget to use the new datatypes
ip.append(datatype='coord3(0,3)', name='coords')
GeomsFromFile bellow shows how the filename can be use as a director for
the name. It shows also how to append several geoms from one file.
If you want to read a new type of file the best is to add it inside
the appendGeometry of GeomsFromFile
|
|||
| __init__(self, geomOutputPortName, **kw) | ||
| afterAddingToNetwork(self) | ||
| doit(self, name=None, geoms=None, instanceMatrices=None, geomOptions=None, texture=None, parent=None) | ||
|
rearrangePorts(self) reoder port list for backwards compatibility. |
||
| geom(self) | ||
| removeAndCleanMultipleGeometryies(self, geometryies) | ||
| removeSingleGeomAndReparentChildren(self, geom) | ||
| removeSingleGeom(self, geom) | ||
| removeViewerConnection(self, doNotRemoveThisConnection=None) | ||
| removeViewerConnections(self, doNotRemoveThisConnection=None) | ||
| ensureNameOfNodeAndDescendants(self, obj) | ||
|
getIndexFromName(self,
name) returns the index of the geom returns -1 if entry is not in the list |
||
|
naming(self,
name) returns True if we need to perform Parenting |
||
| addingEntries(self, name) | ||
| appendGeometry(self, name) | ||
| nodeOnlyGeomRemoval(self, geom) | ||
|
parenting(self,
parent,
geom=None) prepare the parenting and launch it if applicable it will parent the selectedGeomIndex unless geom is provided |
||
|
effectiveParenting(self,
lParent,
geom=None) try to reparent geometry, return True upon success after this call the geometry has a valid name it will parent the selectedGeomIndex unless geom is provided |
||
|
drawParentAndChildrenConnections(self) finds the selected children and parent and draws the connections if they are selected in their own node |
||
|
setParentConnection(self) set the parent connection if parent is selected in his own node |
||
| removeParentConnection(self) | ||
| setChildrenConnections(self) | ||
| setPortsOfTheChildrenConnections(self) | ||
| removeChildrenConnections(self) | ||
| rebuildComboBoxList(self) | ||
| reparentGeoms(self, list) | ||
| reparentGeomType(self, type, reparentCurrent=True) | ||
| getViewerConnection(self, node) | ||
| afterDisconnectParent(self, p1) | ||
| afterConnectParent(self, port, conn) | ||
| afterDisconnectChildren(self, p1, p2) | ||
| beforeRemovingFromNetwork(self) | ||
| textureManagement(self, image, textureCoordinates=None) | ||
|
Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from |
|||
|
|||
|
Inherited from Inherited from |
|||
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0alpha3 on Fri Nov 2 14:07:21 2007 | http://epydoc.sourceforge.net |