VR-Forces 4.0.4 Class Documentation
Extended Object Manager

This subclass of the DtVrfObjectManager prints out a message in its tick() method


Header file:

/*******************************************************************************
** Copyright (c) 2003 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/
/*******************************************************************************
** $RCSfile: myObjectManager.h,v $ $Revision: 1.4 $ $State: Exp $
*******************************************************************************/

#ifndef MyObjectManager_H_
#define MyObjectManager_H_

#include "vrfobjcore/vrfObjMgr.h"

class MyObjectManager : public DtVrfObjectManager
{
public:

   //The constructor takes a DtSimManager and entityAdvisory which get passed 
   //to the base class
   MyObjectManager(DtSimManager* simManager, int entityAdvisory);

   //destructor
   virtual ~MyObjectManager();

   //This is a good place to add your own behavior.
   virtual void tick();

public:

   //Creator function to be registered with the DtDefaultVrfCreator from
   //main.cxx
   static DtVrfObjectManager* creator(DtSimManager* simManager, 
      int entityAdvisory);

};

#endif



Implementation:

/*******************************************************************************
** Copyright (c) 2003 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/
/*******************************************************************************
** $RCSfile: myObjectManager.cxx,v $ $Revision: 1.3 $ $State: Exp $
*******************************************************************************/

#include "myObjectManager.h"

//It is important to pass the DtSimManager to the constructor of the base class
MyObjectManager::MyObjectManager(DtSimManager* simManager, int entityAdvisory) :
   DtVrfObjectManager(simManager)
{
}

MyObjectManager::~MyObjectManager()
{
}

void MyObjectManager::tick()
{
   //This is a good place to add your own functionality. For instance, if you
   //were making an after action review tool, this might be a good place to
   //connect to a database to store simulation information.

   DtInfo("MyObjectManager::tick()\n");


   //In order for VR-Forces to function, it is vital to call down to the base
   //class !
   DtVrfObjectManager::tick();
}


//The creator simply calls new. It is important to pass on the DtSimManager.
DtVrfObjectManager* MyObjectManager::creator(DtSimManager* simManager,
   int entityAdvisory)
{
   return new MyObjectManager(simManager, entityAdvisory);
}


Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)