*** empty log message ***

This commit is contained in:
Jesse Schell 2001-03-29 23:05:21 +00:00
parent c612bc0e52
commit 47e1a235ac
3 changed files with 50 additions and 1 deletions

View File

@ -152,6 +152,7 @@ class ClientRepository(DirectObject.DirectObject):
# Assign it an Id
distObj.doId = doId
# Update the required fields
distObj.generateInit() # Only called when constructed
distObj.generate()
distObj.updateRequiredFields(cdc, di)
# Put the new do in both dictionaries
@ -190,6 +191,7 @@ class ClientRepository(DirectObject.DirectObject):
self.doId2do[doId] = distObj
self.doId2cdc[doId] = cdc
# Update the required fields
distObj.generateInit() # Only called when constructed
distObj.generate()
distObj.updateRequiredOtherFields(cdc, di)
# Put the new do in both dictionaries

View File

@ -49,6 +49,12 @@ class DistributedObject(PandaObject):
Inheritors should redefine this to take appropriate action on generate
"""
pass
def generateInit(self):
"""generateInit(self)
This method is called when the DistributedObject is first introduced
to the world... Not when it is pulled from the cache.
"""
def getDoId(self):
"""getDoId(self)

View File

@ -44,9 +44,33 @@ class EventInterval(FunctionInterval):
# Create function interval
FunctionInterval.__init__(self, sendFunc, name = event)
### FunctionInterval subclass for accepting hooks ###
class AcceptInterval(FunctionInterval):
# Initialization
def __init__(self, dirObj, event, function, name):
"""__init__(dirObj, event, function, name)
"""
def acceptFunc(dirObj = dirObj, event = event, function = function):
print "accepting..."
dirObj.accept(event, function)
# Create function interval
FunctionInterval.__init__(self, acceptFunc, name = name)
### FunctionInterval subclass for throwing events ###
class IgnoreInterval(FunctionInterval):
# Initialization
def __init__(self, dirObj, event, name):
"""__init__(dirObj, event, name)
"""
def ignoreFunc(dirObj = dirObj, event = event):
print "ignoring..."
dirObj.ignore(event)
# Create function interval
FunctionInterval.__init__(self, ignoreFunc, name = name)
### Function Interval subclass for adjusting scene graph hierarchy ###
class ParentInterval(FunctionInterval):
# PosInterval counter
# ParentInterval counter
parentIntervalNum = 1
# Initialization
def __init__(self, nodePath, parent, name = None):
@ -61,6 +85,23 @@ class ParentInterval(FunctionInterval):
# Create function interval
FunctionInterval.__init__(self, reparentFunc, name = name)
### Function Interval subclass for adjusting scene graph hierarchy ###
class WrtParentInterval(FunctionInterval):
# WrtParentInterval counter
wrtParentIntervalNum = 1
# Initialization
def __init__(self, nodePath, parent, name = None):
"""__init__(nodePath, parent, name)
"""
def wrtReparentFunc(nodePath = nodePath, parent = parent):
nodePath.wrtReparentTo(parent)
# Determine name
if (name == None):
name = 'WrtParentInterval-%d' % WrtParentInterval.wrtParentIntervalNum
WrtParentInterval.wrtParentIntervalNum += 1
# Create function interval
FunctionInterval.__init__(self, wrtReparentFunc, name = name)
### Function Interval subclasses for instantaneous pose changes ###
class PosInterval(FunctionInterval):
# PosInterval counter