VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Add a new sensor propagator (addSensorPropagator)

Table of Contents

The Add Sensor Propagator example demonstrates the following:

A sensor propagator is responsible for taking in a group of parameters stored in a DtSignaturePropagatorArgs class along with the absolute signature of the object being detected. It returns an apparent signature which represents how well the sensor detected the object. Hence the base class is called DtSignaturePropagator.

This propagator adds an additional check on signature. It takes the apparent signature calculated by the parent class,DtSignaturePropagator, and checks if the target is inside a forest areal feature. If so then the apparent signature is further reduced by half.

How to Run the Example

Since this example is loaded as a plugin, it can be used in conjunction with the released VR-Forces application

Usage

In the launcher, set the addSensorPropagator plugin to load and then start VR Forces.

To view the new behavior:

  1. Load the scenario for the example: userData/scenarios/developer_toolkit_examples/addSensorPropagator/addSensorPropagator.scn
  2. Switch to PVD mode
  3. Enable the display of feature data from the Observer menu
  4. Position the front-end back-end windows so that you can see both
  5. Click on the play button

The entity named "inside" is within a forest areal feature and all the other entities are outside so the only message printed to the back-end console should be the following: Target inside is in an area. Cutting apparent signature in half.

Classes

MySignaturePropagatorThe new Signature Propagator derived from DtVisualSignaturePropagator

Plugin Entry Points

/*******************************************************************************
** Copyright (c) 2011 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/
/*******************************************************************************
** $RCSfile: plugin.cxx,v $ $Revision: 1.1 $ $State: Exp $
*******************************************************************************/

#include "vrfcgf/vrfPluginExtension.h"
#include "mySignaturePropagator.h"
#include "vrfobjcore/signaturePropagatorTypes.h"

#include "vrfcgf/cgf.h"
#include "vrfcgf/factoryManager.h"
#include "vrfobjcore/signaturePropagatorFactory.h"

extern "C" {

   DT_VRF_DLL_PLUGIN void DtPluginInformation(DtVrfPluginInformation& info)
   {
      info.pluginName = "addSensorPropagator";
      info.pluginVersion = "1.00";
      info.pluginDescription = "An example of how to add a new sensor propagation model.";
      info.pluginCreator = "MAK Technologies";
      info.pluginCreatorEmail = "sales@mak.com";
      info.pluginContactWebPage = "www.mak.com";
      info.pluginContactMailingAddress = "150 Cambridge Park Drive 3rd Floor - Cambridge, MA 02140 USA";
      info.pluginContactPhone = "(617) 876 8085";
   }

   DT_VRF_DLL_PLUGIN bool DtInitializeVrfPlugin(DtCgf* cgf)
   {
      //Register new propagator.
      //Here, we are using the same type string as the default visual signature propagator
      //so that no configuration files need to be changed.  This will replace all sensors
      //using the visual propagator with this new propagator.
      //If a different string was used, this would be configured in the physicalWorldParams.mtl file.
	  cgf->factoryManager()->signaturePropagatorFactory()->addCreatorFcn(DtVisualSignaturePropagatorType,MySignaturePropagator::create);
      
      return true;
   }
}


Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)