Panda3D
Loading...
Searching...
No Matches
DistributedCartesianGrid Class Reference
Inheritance diagram for DistributedCartesianGrid:
DistributedNode CartesianGridBase DistributedObject DistributedObjectBase DirectObject

Public Member Functions

 __init__ (self, cr)
 
 addObjectToGrid (self, av)
 
 clearWorldContext (self, event=None)
 
 delete (self)
 
 disable (self)
 
 generate (self)
 
 getCenterPos (self)
 
 handleAvatarZoneChange (self, av, zoneId)
 
 handleChildArrive (self, child, zoneId)
 
 handleChildArriveZone (self, child, zoneId)
 
 handleChildLeave (self, child, zoneId)
 
 initializeGridLines (self)
 Visualization Tools.
 
 isGridParent (self)
 
 labelCells (self)
 
 markCells (self)
 
 processVisibility (self, task)
 
 removeObjectFromGrid (self, av)
 
 setCellWidth (self, width)
 
 setParentingRules (self, style, rule)
 
 setWorldContext (self, worldContext)
 
 startProcessVisibility (self, avatar)
 
 stopProcessVisibility (self, clearAll=False, event=None)
 
 turnOff (self)
 
 turnOn (self, av=None)
 
 unmarkCells (self)
 
 updateGrid (self)
 
 visualizeGrid (self)
 
- Public Member Functions inherited from DistributedNode
 __init__ (self, cr)
 
 __cmp__ (self, other)
 
 b_setParent (self, parentToken)
 setParent ###
 
 d_setH (self, h)
 
 d_setHpr (self, h, p, r)
 
 d_setP (self, p)
 
 d_setParent (self, parentToken)
 
 d_setPos (self, x, y, z)
 
 d_setPosHpr (self, x, y, z, h, p, r)
 
 d_setR (self, r)
 
 d_setX (self, x)
 set pos and hpr functions #######
 
 d_setXY (self, x, y)
 
 d_setXYH (self, x, y, h)
 
 d_setXYZH (self, x, y, z, h)
 
 d_setXZ (self, x, z)
 
 d_setY (self, y)
 
 d_setZ (self, z)
 
 do_setParent (self, parentToken)
 
 setLocation (self, parentId, zoneId, teleport=0)
 
 setParent (self, parentToken)
 
 setParentStr (self, parentTokenStr)
 
 setXY (self, x, y)
 
 setXYH (self, x, y, h)
 
 setXYZH (self, x, y, z, h)
 
 setXZ (self, x, z)
 
- Public Member Functions inherited from DistributedObject
 __init__ (self, cr)
 
 addInterest (self, zoneId, note="", event=None)
 
 announceGenerate (self)
 
 b_setLocation (self, parentId, zoneId)
 
 d_setLocation (self, parentId, zoneId)
 
 deleteOrDelay (self)
 
 disableAndAnnounce (self)
 
 disableAnnounceAndDelete (self)
 
 doCallbackContext (self, context, args)
 
 doneBarrier (self, name=None)
 
 execCommand (self, string, mwMgrId, avId, zoneId)
 
 flushCachedData (self, name)
 
 generateInit (self)
 
 getAutoInterests (self)
 
 getBarrierData (self)
 
 getCacheable (self)
 
 getCachedData (self, name)
 
 getCallback (self, context)
 
 getCallbackArgs (self, context)
 
 getCallbackContext (self, callback, extraArgs=[])
 
 getCurrentContexts (self)
 
 getDelayDeleteCount (self)
 
 getDelayDeleteEvent (self)
 
 getDisableEvent (self)
 
 getDoId (self)
 
 getLocation (self)
 
 getNeverDisable (self)
 
 getParentObj (self)
 
 hasCachedData (self, name)
 
 isDisabled (self)
 
 isGenerated (self)
 
 isLocal (self)
 
 postGenerateMessage (self)
 
 removeInterest (self, handle, event=None)
 
 sendDeleteMsg (self)
 
 sendDisableMsg (self)
 
 sendUpdate (self, fieldName, args=[], sendToId=None)
 
 setBarrierData (self, data)
 
 setCacheable (self, bool)
 
 setCachedData (self, name, data)
 
 setNeverDisable (self, bool)
 
 status (self, indent=0)
 
 taskName (self, taskString)
 
 uniqueName (self, idString)
 
 updateAllRequiredFields (self, dclass, di)
 
 updateRequiredFields (self, dclass, di)
 
 updateRequiredOtherFields (self, dclass, di)
 
- Public Member Functions inherited from DistributedObjectBase
 __init__ (self, cr)
 
 handleChildLeaveZone (self, childObj, zoneId)
 
 handleQueryObjectChildrenLocalDone (self, context)
 
 hasParentingRules (self)
 
- Public Member Functions inherited from DirectObject
 __init__ (self)
 
 accept (self, event, method, extraArgs=[])
 
 acceptOnce (self, event, method, extraArgs=[])
 
 addTask (self, *args, **kwargs)
 
 detectLeaks (self)
 
 doMethodLater (self, *args, **kwargs)
 
 getAllAccepting (self)
 
 ignore (self, event)
 
 ignoreAll (self)
 
 isAccepting (self, event)
 
 isIgnoring (self, event)
 
 removeAllTasks (self)
 
 removeTask (self, taskOrName)
 
- Public Member Functions inherited from CartesianGridBase
 getConcentricZones (self, zoneId, radius)
 
 getGridSizeFromSphere (self, sphereRadius, spherePos, cellWidth, gridRadius)
 
 getGridSizeFromSphereRadius (self, sphereRadius, cellWidth, gridRadius)
 
 getZoneCellOrigin (self, zoneId)
 
 getZoneCellOriginCenter (self, zoneId)
 
 getZoneFromXYZ (self, pos, wantRowAndCol=False)
 
 isValidZone (self, zoneId)
 

Public Attributes

 cellLabelParent = None
 
list cellMarkers = []
 
 cellWidth = width
 
 centerLines = LineNodePath(self.lines)
 
 centerPos = Vec3(cx, cx, 0)
 
 gridColor
 
 gridSize = int(rules[1])
 
 gridVisContext = None
 
int haveGridLines = 0
 
 lines = self.attachNewNode('gridLines')
 
 majorLines = LineNodePath(self.lines)
 
 markerParent = None
 
 minorLines = LineNodePath(self.lines)
 
 processVisibility
 
 stopProcessVisibility
 
 viewingRadius = int(rules[2])
 
 visAvatar = None
 
bool visDirty = True
 
 visZone = None
 
- Public Attributes inherited from DistributedNode
int DistributedNode_deleted = 1
 
int DistributedNode_initialized = 1
 
int gotStringParentToken = 0
 
 gridParent = None
 
 this
 
- Public Attributes inherited from DistributedObject
 activeState = ESNew
 
 autoInterests = autoInterests
 
 cacheable = ESGenerated:
 
 dclass = None
 
 destroyDoStackTrace
 
int DistributedObject_deleted = 1
 
int DistributedObject_initialized = 1
 
- Public Attributes inherited from DistributedObjectBase
 cr = cr
 
 doId
 
int parentId = None
 
 zoneId = None
 
- Public Attributes inherited from CartesianGridBase
 startingZone
 
str style = "Cartesian":
 

Static Public Attributes

str RuleSeparator = ":"
 
 VisualizeGrid = ConfigVariableBool("visualize-cartesian-grid", False)
 
- Static Public Attributes inherited from DistributedObject
int neverDisable = 0
 
- Static Public Attributes inherited from DistributedObjectBase
 notify = directNotify.newCategory("DistributedObjectBase")
 
- Static Public Attributes inherited from DirectObject
 accept_once = acceptOnce
 
 add_task = addTask
 
 detect_leaks = detectLeaks
 
 do_method_later = doMethodLater
 
 get_all_accepting = getAllAccepting
 
 ignore_all = ignoreAll
 
 is_accepting = isAccepting
 
 is_ignoring = isIgnoring
 
 remove_all_tasks = removeAllTasks
 
 remove_task = removeTask
 

Protected Attributes

bool _onOffState = False
 
- Protected Attributes inherited from DistributedObject
 _cachedData = self.cr.doDataCache.popCachedData(self.doId)
 
int _delayDeleted = 0
 
bool _delayDeleteForceAllow = False
 
dict _token2delayDeleteName = {}
 
- Protected Attributes inherited from DirectObject
dict _taskList = {}
 

Additional Inherited Members

- Protected Member Functions inherited from DistributedObject
 _deactivateDO (self)
 
 _destroyDO (self)
 
 _retrieveCachedData (self)
 
- Protected Member Functions inherited from DirectObject
 _addTask (self, task)
 
 _clearTask (self, task)
 

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
cr )

Member Function Documentation

◆ addObjectToGrid()

addObjectToGrid ( self,
av )

◆ clearWorldContext()

clearWorldContext ( self,
event = None )

◆ delete()

delete ( self)
Inheritors should redefine this to take appropriate action on delete

Reimplemented from DistributedNode.

◆ disable()

disable ( self)
Inheritors should redefine this to take appropriate action on disable

Reimplemented from DistributedNode.

◆ generate()

generate ( self)
Inheritors should redefine this to take appropriate action on generate

Reimplemented from DistributedNode.

◆ getCenterPos()

getCenterPos ( self)

◆ handleAvatarZoneChange()

handleAvatarZoneChange ( self,
av,
zoneId )

◆ handleChildArrive()

handleChildArrive ( self,
childObj,
zoneId )
A new child has just setLocation beneath us.  Give us a
chance to run code when a new child sets location to us. For
example, we may want to scene graph reparent the child to
some subnode we own.

Reimplemented from DistributedObjectBase.

◆ handleChildArriveZone()

handleChildArriveZone ( self,
childObj,
zoneId )
A child has just changed zones beneath us with setLocation.
Give us a chance to run code when an existing child sets
location to us. For example, we may want to scene graph
reparent the child to some subnode we own.

Reimplemented from DistributedObjectBase.

◆ handleChildLeave()

handleChildLeave ( self,
childObj,
zoneId )
A child is about to setLocation away from us.  Give us a
chance to run code just before a child sets location away from us.

Reimplemented from DistributedObjectBase.

◆ initializeGridLines()

initializeGridLines ( self)

Visualization Tools.

◆ isGridParent()

isGridParent ( self)

Reimplemented from DistributedObject.

◆ labelCells()

labelCells ( self)

◆ markCells()

markCells ( self)

◆ processVisibility()

processVisibility ( self,
task )

◆ removeObjectFromGrid()

removeObjectFromGrid ( self,
av )

◆ setCellWidth()

setCellWidth ( self,
width )

◆ setParentingRules()

setParentingRules ( self,
style,
rule )

◆ setWorldContext()

setWorldContext ( self,
worldContext )

◆ startProcessVisibility()

startProcessVisibility ( self,
avatar )

◆ stopProcessVisibility()

stopProcessVisibility ( self,
clearAll = False,
event = None )

◆ turnOff()

turnOff ( self)

◆ turnOn()

turnOn ( self,
av = None )

◆ unmarkCells()

unmarkCells ( self)

◆ updateGrid()

updateGrid ( self)

◆ visualizeGrid()

visualizeGrid ( self)

Member Data Documentation

◆ _onOffState

bool _onOffState = False
protected

◆ cellLabelParent

cellLabelParent = None

◆ cellMarkers

list cellMarkers = []

◆ cellWidth

cellWidth = width

◆ centerLines

centerLines = LineNodePath(self.lines)

◆ centerPos

centerPos = Vec3(cx, cx, 0)

◆ gridColor

gridColor
Initial value:
= VBase4(0.4 + randFloat(0.4),
0.4 + randFloat(0.4),
0.4 + randFloat(0.4),
1)

◆ gridSize

gridSize = int(rules[1])

◆ gridVisContext

gridVisContext = None

◆ haveGridLines

int haveGridLines = 0

◆ lines

lines = self.attachNewNode('gridLines')

◆ majorLines

majorLines = LineNodePath(self.lines)

◆ markerParent

markerParent = None

◆ minorLines

minorLines = LineNodePath(self.lines)

◆ processVisibility

processVisibility

◆ RuleSeparator

str RuleSeparator = ":"
static

◆ stopProcessVisibility

stopProcessVisibility

◆ viewingRadius

viewingRadius = int(rules[2])

◆ visAvatar

visAvatar = None

◆ visDirty

bool visDirty = True

◆ VisualizeGrid

VisualizeGrid = ConfigVariableBool("visualize-cartesian-grid", False)
static

◆ visZone

visZone = None