Exemple #1
0
//! \cond
dmz::InputPluginExit::InputPluginExit (
      const PluginInfo &Info,
      Config &local) :
      Plugin (Info),
      InputObserverUtil (Info, local),
      _exit (Info.get_context ()),
      _log (Info.get_name (), Info.get_context ()) {

   _init (local);
}
Exemple #2
0
/*!

\brief PluginInfo constructor.
\param[in] Info PluginInfo used for setting the observers name, handle, and runtime
context.
\note This constructor is intended for Plugins that wish to receive messages.
The observer will have the same name and runtime handle as the plugin using this
constructor.

*/
dmz::MessageObserver::MessageObserver (const PluginInfo &Info) :
      _msgObsState (*(new MessageObserverState (
         Info.get_handle (),
         Info.get_name (),
         Info.get_context ()))) {

   if (_msgObsState.context) { _msgObsState.context->add_observer (*this); }
}
Exemple #3
0
/*!

\brief PluginInfo constructor.
\param[in] Info PluginInfo used to obtain the runtime context.

*/
dmz::Undo::Undo (const PluginInfo &Info) : _context (0) {

    RuntimeContext *context (Info.get_context ());
    if (context) {
        _context = context->get_undo_context();
    }
    if (_context) {
        _context->ref ();
    }
}
Exemple #4
0
   State (const PluginInfo &Info, const Config &Init) :
         ArchiveModuleName (config_to_string ("module.archive.name", Init)),
         log (Info.get_name () + ".ArchiveObserverUtil", Info.get_context ()),
         defs (Info, &log),
         module (0) {

      if (ArchiveModuleName) {

         log.info << "Looking for Archive Module: " << ArchiveModuleName << endl;
      }
   }
Exemple #5
0
/*!

\brief PluginInfo construct.
\param[in] Info PluginInfo object containing Handle and RuntimeContext.

*/
dmz::UndoObserver::UndoObserver (const PluginInfo &Info) :
      __state (*(new State (Info.get_handle (), Info.get_context ()))) {

   if (__state.handle && __state.context) {

      if (!__state.context->obsTable.store (__state.handle, this)) {

         __state.handle = 0;
      }
   }
}
Exemple #6
0
/*!

\brief Stores an interface with a unique handle using the PluginInfo.
\details Defined in dmzRuntimeRTTI.h.
\param[in] InterfaceName String containing name of interface.
\param[in] Info PluginInfo containing unique handle and runtime context.
\param[in] ptr Void pointer to the interface.
\return Returns dmz::True if the interface was successfully stored with the specified
handle and name.

*/
dmz::Boolean
dmz::store_rtti_interface (
      const String &InterfaceName,
      const PluginInfo &Info,
      void *ptr) {

   return store_rtti_interface (
      InterfaceName,
      Info.get_handle (),
      Info.get_context (),
      ptr);
}
dmz::ExPluginMessageSend::ExPluginMessageSend (const PluginInfo &Info, Config &local) :
      Plugin (Info),
      TimeSlice (Info, TimeSliceTypeRuntime, TimeSliceModeRepeating, 1.0),
      _log (Info),
      _type (),
      _binder (Info.get_context (), &_log),
      _value ("Some Value"),
      _time (0.0) {

   _binder.bind ("value", 0, _value);
   _binder.bind ("time", 0, _time);

   _init (local);
}
Exemple #8
0
dmz::RenderModuleCoreOgreBasic::RenderModuleCoreOgreBasic (
      const PluginInfo &Info,
      Config &local,
      Config &global) :
      Plugin (Info),
      TimeSlice (Info),
      ObjectObserverUtil (Info, local),
      OSMSceneCallbacks (),
      RenderModuleCoreOgre (Info),
      _log (Info),
      _extensions (Info.get_context (), &_log),
      _objectModule (0),
      _defaultAttributeHandle (0),
      _ogreLogger (Info.get_context ()),
      _root (0),
      _sceneManager (0),
      _osmSceneLoader (0),
      _portalTable (),
      _dynamicObjectTable () {

   _init (local, global);

   activate_default_object_attribute (ObjectPositionMask | ObjectOrientationMask);
}
//! \cond
dmz::NetExtPacketCodecObjectBasic::NetExtPacketCodecObjectBasic (
      const PluginInfo &Info,
      Config &local) :
      Plugin (Info),
      NetExtPacketCodecObject (Info),
      _SysID (get_runtime_uuid (Info)),
      _log (Info),
      _time (Info.get_context ()),
      _defaultHandle (0),
      _lnvHandle (0),
      _objMod (0),
      _attrMod (0) {

   _init (local);
}
Exemple #10
0
dmz::EventModuleBasic::EventModuleBasic (const PluginInfo &Info, Config &local) :
      Plugin (Info),
      TimeSlice (Info),
      EventModule (Info),
      _log (Info),
      _time (Info.get_context ()),
      _inCloseEvent (False),
      _maxEvents (0),
      _eventTTL (1.0),
      _eventCache (0),
      _delayedListHead (0),
      _delayedListTail (0),
      _recycleList (0) {

   _init (local);
}
//! \cond
dmz::EntityPluginFreeFly::EntityPluginFreeFly (
      const PluginInfo &Info,
      Config &local) :
      Plugin (Info),
      TimeSlice (Info),
      ObjectObserverUtil (Info, local),
      InputObserverUtil (Info, local),
      _handle (0),
      _defaultHandle (0),
      _hilHandle (0),
      _isect (0),
      _active (0),
      _log (Info.get_name (), Info.get_context ()) {

   stop_time_slice ();

   _init (local);
}
Exemple #12
0
//! \cond
dmz::NetPluginRemoteDR::NetPluginRemoteDR (const PluginInfo &Info, Config &local) :
      Plugin (Info),
      TimeSlice (Info),
      ObjectObserverUtil (Info, local),
      _log (Info),
      _time (Info.get_context ()),
      _objMod (0),
      _defaultHandle (0),
      _lnvHandle (0) {

   _init (local);

   _defaultHandle = activate_object_attribute (
      ObjectAttributeDefaultName,
      ObjectCreateMask | ObjectDestroyMask | ObjectLocalityMask);

   _lnvHandle = activate_object_attribute (
      ObjectAttributeLastNetworkValueName,
      ObjectCreateMask);
}
//! \cond
dmz::NetModuleIdentityMapBasic::NetModuleIdentityMapBasic (
      const PluginInfo &Info,
      Config &local) :
      Plugin (Info),
      NetModuleIdentityMap (Info),
      MessageObserver (Info),
      _log (Info),
      _site (0),
      _host (0),
      _netHandles (1001, 1, 0xFFFF),
      _handleConverter (Info.get_context ()) {

   _init (local);

   Definitions defs (Info, &_log);

   if (defs.create_message (ObjectDestroyMessageName, _removeObjMsg)) {

      subscribe_to_message (_removeObjMsg);
   }
}
/*!

\brief PluginInfo Constructor.
\param[in] Info Reference to the PluginInfo.
\param[in] log Pointer to the Log to user for error reporting.

*/
dmz::Resources::Resources (const PluginInfo &Info, Log *log) : _context (0), _log (log) {

   RuntimeContext *context (Info.get_context ());
   _context = (context ? context->get_resources_context () : 0);
   if (_context) { _context->ref (); }
}
/*!

\brief Constructor.
\param[in] Info Reference to the PluginInfo.

*/
dmz::ResourcesObserver::ResourcesObserver (const PluginInfo &Info) :
      __state (*(new State (Info.get_handle (), Info.get_name (), Info.get_context ()))) {
}
dmz::RenderModuleCoreOSGBasic::RenderModuleCoreOSGBasic (
      const PluginInfo &Info,
      Config &local,
      Config &global) :
      Plugin (Info),
      TimeSlice (Info),
      ObjectObserverUtil (Info, local),
      RenderModuleCoreOSG (Info),
      _log (Info),
      _defs (Info),
      _extensions (Info.get_context (), &_log),
      _cullMask (0x001),
      _isectMask (0),
      _defaultHandle (0),
      _bvrHandle (0),
      _dirtyObjects (0) {

   _log.info << "Built using Open Scene Graph v"
      << Int32 (OPENSCENEGRAPH_MAJOR_VERSION) << "."
      << Int32 (OPENSCENEGRAPH_MINOR_VERSION) << "."
      << Int32 (OPENSCENEGRAPH_PATCH_VERSION) << endl;

   const UInt32 StaticMask (0x01 << 1);
   const UInt32 EntityMask (0x01 << 2);
   const UInt32 GlyphMask (0x01 << 3);
   const UInt32 OverlayMask (0x01 << 4);

   _isectMaskTable.store (
      _defs.create_named_handle (RenderIsectStaticName),
      new UInt32 (StaticMask));

   _isectMaskTable.store (
      _defs.create_named_handle (RenderIsectEntityName),
      new UInt32 (EntityMask));

   _isectMaskTable.store (
      _defs.create_named_handle (RenderIsectGlyphName),
      new UInt32 (GlyphMask));

   _isectMaskTable.store (
      _defs.create_named_handle (RenderIsectOverlayName),
      new UInt32 (OverlayMask));

   _scene = new osg::Group;

   _overlay = new osg::Group;
   _scene->addChild (_overlay.get ());

   _isect = new osg::Group;
   _scene->addChild (_isect.get ());

   _staticObjects = new osg::Group;
   _isect->addChild (_staticObjects.get ());

   _dynamicObjects = new osg::Group;
   _dynamicObjects->setDataVariance (osg::Object::DYNAMIC);
   _isect->addChild (_dynamicObjects.get ());

   _init (local, global);

   HashTableHandleIterator it;
   UInt32 *mask (0);

   while (_isectMaskTable.get_next (it, mask)) { _isectMask |= *mask; }

   _staticObjects->setNodeMask (
      (_staticObjects->getNodeMask () & ~_isectMask) | StaticMask);

   _dynamicObjects->setNodeMask (
      (_dynamicObjects->getNodeMask () & ~_isectMask) | EntityMask | GlyphMask);

   _overlay->setNodeMask (OverlayMask | _cullMask);
}
Exemple #17
0
/*!

\brief Constructor.
\param[in] Info reference to PluginInfo.

*/
dmz::DataConverterBoolean::DataConverterBoolean (const PluginInfo &Info) :
      _state (*(new State (Info.get_context ()))) {;}
Exemple #18
0
/*!

\brief Constructor.
\param[in] Info PluginInfo used to obtain the runtime context.
\param[in] log Pointer to the Log to use for log messages. May be NULL.

*/
dmz::Definitions::Definitions (const PluginInfo &Info, Log *log) :
      _state (*(new State (Info.get_context (), log))) {;}
/*!

\brief Constructor.
\param[in] Info Reference to PluginInfo.

*/
dmz::DataConverterHandle::DataConverterHandle (const PluginInfo &Info) :
      _state (*(new State (Info.get_context ()))) {;}
/*!

\brief Constructor.
\param[in] Info reference to PluginInfo.

*/
dmz::DataConverterString::DataConverterString (const PluginInfo &Info) :
      _state (*(new State (Info.get_context ()))) {;}