mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-05 03:15:07 -04:00
Remove EventStorePandaNode, it is no longer necessary
(since PandaNode now directly inherits from TypedWritableReferenceCount)
This commit is contained in:
parent
0a64bdb33b
commit
a6cf0960fa
@ -5,8 +5,8 @@ __all__ = ['EventManager']
|
|||||||
|
|
||||||
from MessengerGlobal import *
|
from MessengerGlobal import *
|
||||||
from direct.directnotify.DirectNotifyGlobal import *
|
from direct.directnotify.DirectNotifyGlobal import *
|
||||||
|
from direct.task.TaskManagerGlobal import taskMgr
|
||||||
from panda3d.core import PStatCollector, EventQueue, EventHandler
|
from panda3d.core import PStatCollector, EventQueue, EventHandler
|
||||||
from panda3d.core import EventStorePandaNode
|
|
||||||
|
|
||||||
class EventManager:
|
class EventManager:
|
||||||
|
|
||||||
@ -16,11 +16,6 @@ class EventManager:
|
|||||||
# before the complete PandaModules have been downloaded.
|
# before the complete PandaModules have been downloaded.
|
||||||
PStatCollector = None
|
PStatCollector = None
|
||||||
|
|
||||||
# for efficiency, only call import once per module
|
|
||||||
EventStorePandaNode = None
|
|
||||||
EventQueue = None
|
|
||||||
EventHandler = None
|
|
||||||
|
|
||||||
def __init__(self, eventQueue = None):
|
def __init__(self, eventQueue = None):
|
||||||
"""
|
"""
|
||||||
Create a C++ event queue and handler
|
Create a C++ event queue and handler
|
||||||
@ -76,15 +71,8 @@ class EventManager:
|
|||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
# Must be some user defined type, return the ptr
|
# Must be some user defined type, return the ptr
|
||||||
# which will be downcast to that type
|
# which will be downcast to that type.
|
||||||
ptr = eventParameter.getPtr()
|
return eventParameter.getPtr()
|
||||||
|
|
||||||
if isinstance(ptr, EventStorePandaNode):
|
|
||||||
# Actually, it's a kludgey wrapper around a PandaNode
|
|
||||||
# pointer. Return the node.
|
|
||||||
ptr = ptr.getValue()
|
|
||||||
|
|
||||||
return ptr
|
|
||||||
|
|
||||||
def processEvent(self, event):
|
def processEvent(self, event):
|
||||||
"""
|
"""
|
||||||
@ -195,11 +183,7 @@ class EventManager:
|
|||||||
# Otherwise, we need our own event handler.
|
# Otherwise, we need our own event handler.
|
||||||
self.eventHandler = EventHandler(self.eventQueue)
|
self.eventHandler = EventHandler(self.eventQueue)
|
||||||
|
|
||||||
# Should be safe to import the global taskMgr by now.
|
|
||||||
from direct.task.TaskManagerGlobal import taskMgr
|
|
||||||
taskMgr.add(self.eventLoopTask, 'eventManager')
|
taskMgr.add(self.eventLoopTask, 'eventManager')
|
||||||
|
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
# Should be safe to import the global taskMgr by now.
|
|
||||||
from direct.task.TaskManagerGlobal import taskMgr
|
|
||||||
taskMgr.remove('eventManager')
|
taskMgr.remove('eventManager')
|
||||||
|
@ -46,7 +46,6 @@
|
|||||||
depthOffsetAttrib.I depthOffsetAttrib.h \
|
depthOffsetAttrib.I depthOffsetAttrib.h \
|
||||||
depthTestAttrib.I depthTestAttrib.h \
|
depthTestAttrib.I depthTestAttrib.h \
|
||||||
depthWriteAttrib.I depthWriteAttrib.h \
|
depthWriteAttrib.I depthWriteAttrib.h \
|
||||||
eventStorePandaNode.I eventStorePandaNode.h \
|
|
||||||
findApproxLevelEntry.I findApproxLevelEntry.h \
|
findApproxLevelEntry.I findApproxLevelEntry.h \
|
||||||
findApproxPath.I findApproxPath.h \
|
findApproxPath.I findApproxPath.h \
|
||||||
fog.I fog.h \
|
fog.I fog.h \
|
||||||
@ -155,7 +154,6 @@
|
|||||||
depthOffsetAttrib.cxx \
|
depthOffsetAttrib.cxx \
|
||||||
depthTestAttrib.cxx \
|
depthTestAttrib.cxx \
|
||||||
depthWriteAttrib.cxx \
|
depthWriteAttrib.cxx \
|
||||||
eventStorePandaNode.cxx \
|
|
||||||
findApproxLevelEntry.cxx \
|
findApproxLevelEntry.cxx \
|
||||||
findApproxPath.cxx \
|
findApproxPath.cxx \
|
||||||
fog.cxx \
|
fog.cxx \
|
||||||
@ -258,7 +256,6 @@
|
|||||||
depthOffsetAttrib.I depthOffsetAttrib.h \
|
depthOffsetAttrib.I depthOffsetAttrib.h \
|
||||||
depthTestAttrib.I depthTestAttrib.h \
|
depthTestAttrib.I depthTestAttrib.h \
|
||||||
depthWriteAttrib.I depthWriteAttrib.h \
|
depthWriteAttrib.I depthWriteAttrib.h \
|
||||||
eventStorePandaNode.I eventStorePandaNode.h \
|
|
||||||
fog.I fog.h \
|
fog.I fog.h \
|
||||||
fogAttrib.I fogAttrib.h \
|
fogAttrib.I fogAttrib.h \
|
||||||
geomDrawCallbackData.I geomDrawCallbackData.h \
|
geomDrawCallbackData.I geomDrawCallbackData.h \
|
||||||
|
@ -37,7 +37,6 @@
|
|||||||
#include "depthOffsetAttrib.h"
|
#include "depthOffsetAttrib.h"
|
||||||
#include "depthTestAttrib.h"
|
#include "depthTestAttrib.h"
|
||||||
#include "depthWriteAttrib.h"
|
#include "depthWriteAttrib.h"
|
||||||
#include "eventStorePandaNode.h"
|
|
||||||
#include "findApproxLevelEntry.h"
|
#include "findApproxLevelEntry.h"
|
||||||
#include "fog.h"
|
#include "fog.h"
|
||||||
#include "fogAttrib.h"
|
#include "fogAttrib.h"
|
||||||
@ -414,7 +413,6 @@ init_libpgraph() {
|
|||||||
DepthOffsetAttrib::init_type();
|
DepthOffsetAttrib::init_type();
|
||||||
DepthTestAttrib::init_type();
|
DepthTestAttrib::init_type();
|
||||||
DepthWriteAttrib::init_type();
|
DepthWriteAttrib::init_type();
|
||||||
EventStorePandaNode::init_type();
|
|
||||||
FindApproxLevelEntry::init_type();
|
FindApproxLevelEntry::init_type();
|
||||||
Fog::init_type();
|
Fog::init_type();
|
||||||
FogAttrib::init_type();
|
FogAttrib::init_type();
|
||||||
|
@ -1,48 +0,0 @@
|
|||||||
// Filename: eventStorePandaNode.I
|
|
||||||
// Created by: drose (13Sep06)
|
|
||||||
//
|
|
||||||
////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// PANDA 3D SOFTWARE
|
|
||||||
// Copyright (c) Carnegie Mellon University. All rights reserved.
|
|
||||||
//
|
|
||||||
// All use of this software is subject to the terms of the revised BSD
|
|
||||||
// license. You should have received a copy of this license along
|
|
||||||
// with this source code in a file named "LICENSE."
|
|
||||||
//
|
|
||||||
////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
|
||||||
// Function: EventStorePandaNode::Constructor
|
|
||||||
// Access: Published
|
|
||||||
// Description:
|
|
||||||
////////////////////////////////////////////////////////////////////
|
|
||||||
INLINE EventStorePandaNode::
|
|
||||||
EventStorePandaNode(const PandaNode *value) :
|
|
||||||
_value((PandaNode *)value)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
|
||||||
// Function: EventStorePandaNode::set_value
|
|
||||||
// Access: Published
|
|
||||||
// Description: Changes the value stored in the parameter. It is
|
|
||||||
// dangerous to do this for a parameter already added to
|
|
||||||
// an event, since the parameters may be shared.
|
|
||||||
////////////////////////////////////////////////////////////////////
|
|
||||||
INLINE void EventStorePandaNode::
|
|
||||||
set_value(const PandaNode *value) {
|
|
||||||
_value = (PandaNode *)value;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
|
||||||
// Function: EventStorePandaNode::get_value
|
|
||||||
// Access: Published
|
|
||||||
// Description: Retrieves the value stored in the parameter.
|
|
||||||
////////////////////////////////////////////////////////////////////
|
|
||||||
INLINE PandaNode *EventStorePandaNode::
|
|
||||||
get_value() const {
|
|
||||||
return _value;
|
|
||||||
}
|
|
@ -1,41 +0,0 @@
|
|||||||
// Filename: eventStorePandaNode.cxx
|
|
||||||
// Created by: drose (13Sep06)
|
|
||||||
//
|
|
||||||
////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// PANDA 3D SOFTWARE
|
|
||||||
// Copyright (c) Carnegie Mellon University. All rights reserved.
|
|
||||||
//
|
|
||||||
// All use of this software is subject to the terms of the revised BSD
|
|
||||||
// license. You should have received a copy of this license along
|
|
||||||
// with this source code in a file named "LICENSE."
|
|
||||||
//
|
|
||||||
////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
#include "eventStorePandaNode.h"
|
|
||||||
|
|
||||||
TypeHandle EventStorePandaNode::_type_handle;
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
|
||||||
// Function: EventStorePandaNode::Destructor
|
|
||||||
// Access: Published, Virtual
|
|
||||||
// Description:
|
|
||||||
////////////////////////////////////////////////////////////////////
|
|
||||||
EventStorePandaNode::
|
|
||||||
~EventStorePandaNode() {
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
|
||||||
// Function: EventStorePandaNode::output
|
|
||||||
// Access: Published, Virtual
|
|
||||||
// Description:
|
|
||||||
////////////////////////////////////////////////////////////////////
|
|
||||||
void EventStorePandaNode::
|
|
||||||
output(ostream &out) const {
|
|
||||||
if (_value == (PandaNode *)NULL) {
|
|
||||||
out << "(empty)";
|
|
||||||
|
|
||||||
} else {
|
|
||||||
out << *_value;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,60 +0,0 @@
|
|||||||
// Filename: eventStorePandaNode.h
|
|
||||||
// Created by: drose (13Sep06)
|
|
||||||
//
|
|
||||||
////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// PANDA 3D SOFTWARE
|
|
||||||
// Copyright (c) Carnegie Mellon University. All rights reserved.
|
|
||||||
//
|
|
||||||
// All use of this software is subject to the terms of the revised BSD
|
|
||||||
// license. You should have received a copy of this license along
|
|
||||||
// with this source code in a file named "LICENSE."
|
|
||||||
//
|
|
||||||
////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
#ifndef EVENTSTOREPANDANODE_H
|
|
||||||
#define EVENTSTOREPANDANODE_H
|
|
||||||
|
|
||||||
#include "pandabase.h"
|
|
||||||
#include "eventParameter.h"
|
|
||||||
#include "pandaNode.h"
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
|
||||||
// Class : EventStorePandaNode
|
|
||||||
// Description : A class object for storing specifically objects of
|
|
||||||
// type PandaNode.
|
|
||||||
////////////////////////////////////////////////////////////////////
|
|
||||||
class EXPCL_PANDA_PGRAPH EventStorePandaNode : public ParamValueBase {
|
|
||||||
PUBLISHED:
|
|
||||||
INLINE EventStorePandaNode(const PandaNode *value);
|
|
||||||
virtual ~EventStorePandaNode();
|
|
||||||
|
|
||||||
INLINE void set_value(const PandaNode *value);
|
|
||||||
INLINE PandaNode *get_value() const;
|
|
||||||
|
|
||||||
virtual void output(ostream &out) const;
|
|
||||||
|
|
||||||
public:
|
|
||||||
PT(PandaNode) _value;
|
|
||||||
|
|
||||||
public:
|
|
||||||
virtual TypeHandle get_type() const {
|
|
||||||
return get_class_type();
|
|
||||||
}
|
|
||||||
virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
|
|
||||||
static TypeHandle get_class_type() {
|
|
||||||
return _type_handle;
|
|
||||||
}
|
|
||||||
static void init_type() {
|
|
||||||
ParamValueBase::init_type();
|
|
||||||
register_type(_type_handle, "EventStorePandaNode",
|
|
||||||
ParamValueBase::get_class_type());
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
static TypeHandle _type_handle;
|
|
||||||
};
|
|
||||||
|
|
||||||
#include "eventStorePandaNode.I"
|
|
||||||
|
|
||||||
#endif
|
|
@ -13,7 +13,6 @@
|
|||||||
#include "depthTestAttrib.cxx"
|
#include "depthTestAttrib.cxx"
|
||||||
#include "depthWriteAttrib.cxx"
|
#include "depthWriteAttrib.cxx"
|
||||||
#include "alphaTestAttrib.cxx"
|
#include "alphaTestAttrib.cxx"
|
||||||
#include "eventStorePandaNode.cxx"
|
|
||||||
#include "findApproxPath.cxx"
|
#include "findApproxPath.cxx"
|
||||||
#include "findApproxLevelEntry.cxx"
|
#include "findApproxLevelEntry.cxx"
|
||||||
#include "fog.cxx"
|
#include "fog.cxx"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user