VR-Forces 4.2 Class Documentation
Force Level Parameter Entry

This DtForceLevelAggregateParametersBuilder creates the entry for the force level object


Header file:

/*******************************************************************************
** Copyright (c) 2004 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/
/*******************************************************************************
** $RCSfile: forceLevelAggregateParametersBuilder.h,v $ $Revision: 1.2 $ $State: Exp $
*******************************************************************************/
#ifndef DtForceLevelAggregateParametersBuilder_H_
#define DtForceLevelAggregateParametersBuilder_H_
//class DtForceLevelAggregateParametersBuilder:
//
//Instances of DtForceLevelAggregateParametersBuilder are used to create and
//configure a DtVrfObjectParameters object for a force-level pseudo-aggregate
//entity. The parameters object returned should fully specify the necessary
//parameters to create a force-level aggregate entity.
{
public:
//default constructor
//destructor
//Creates and configures parameters for a force-level pseudo-aggregate
//entity. Calls createAndConfigureComponents() to create and connect
//sensors, controllers, and actautors.
protected:
//Create and configure sensors, controllers, and actuators for the given
//movingObjectParameters object. Connects appropriate components to one another.
//Configure local and remote subcomponent types for the given parameters object.
//Specifies the kinds of state repository, network interface, radio, etc. to
//create when an object is created using this the parameters object.
//copy constructor - not implemented
//assignment operator - not implemented
};
#endif

Implementation:

/*******************************************************************************
** Copyright (c) 2004 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/
/*******************************************************************************
** $RCSfile: forceLevelAggregateParametersBuilder.cxx,v $ $Revision: 1.7 $ $State: Exp $
*******************************************************************************/
#include <vlutil/vlPrint.h>
#include <vlpi/disEnums.h>
#include <vrfExtProtocol/objTypeEnums.h>
{
}
{
}
{
//Aggregates should be configured with a derived kind of DtVrfObjectParameters
//type, DtMovingObjectParameters.
"force-level-aggregate-param");
parameters->init();
//Set the state repository user extention and type (required). For this example,
//just create the default (we're not extending the state repository in any
//special way).
DtVrfStateRepositoryUserExtension stateRepositoryUserExtension(0);
parameters->setStateRepositoryUserExtension(stateRepositoryUserExtension);
//By default, we use an extended DtEntityType in our represention of
//force-level pseudo-aggregate type in VR-Forces.
//See objTypeEnums.h for the complete set of extended types.
DtRwObjectType objectType("object-type",
DtObjectTypePseudoAggregate,
DtAggregateKindMilitaryHierarchy,
-1,
-1,
DtAggregateCategoryForce,
-1,
-1,
-1);
parameters->setObjectType(objectType);
//Configure pseudo-aggregates with 3-D bounding geometry (a rectangular
//bounding volume).
parameters->setFormation(DtOtherAggregateFormation);
parameters->setForceType(DtForceOther);
parameters->setCategory("");
parameters->setEchelonLevel("Force");
parameters->setOrganized(true);
parameters->setMinTickPeriod(0.0);
parameters->setMinTickPeriodVariance(0.0);
//Create and connect sensors, controllers, and actuators.
//Configure local and remote subcomponent types.
//Specifies the kinds of state repository, network interface, radio, etc. to
//create when an object is created using this the parameters object.
return parameters;
}
{
//For each component, be sure to give it a unique name in the constructor.
//Remember to call setComponentType(<component type string>) for each
//descriptor. <component type string> is the type of DtSimComponent to
//create (types are defined in compTypes.h).
DtComponentDescriptor setControllerDesc("pseudo-aggregate-set-controller");
setControllerDesc.setComponentType("pseudo-aggregate-set-controller");
DtComponentDescriptor topLevelOrganizationControllerDesc("top-level-organization-controller");
topLevelOrganizationControllerDesc.setComponentType("top-level-organization-controller");
DtComponentDescriptor waitControllerDesc("pseudo-aggregate-wait-controller");
waitControllerDesc.setComponentType("pseudo-aggregate-wait-controller");
//Get a handle to the list of controllers and add the desired controller
//component desriptors to it. The order in which descriptors are added
//will be the order that the controllers in an actual entity will be
//ticked. This can affect priority (see section 5.2.2., "Configuring
//the Priority of Components" in the VR-Forces Configuration Guide).
controllerList.addComponentDescriptor(setControllerDesc);
controllerList.addComponentDescriptor(topLevelOrganizationControllerDesc);
controllerList.addComponentDescriptor(waitControllerDesc);
}
DtVrfObjectParameters& parameters)
{
//Set up local sub component types for the entry. These types
//are used to direct what kinds of state repositories and network interfaces
//should be created for locally simulated force-level pseudo-aggregates
//within our VR-Forces back-end. Note: because we don't ever want to
//publish force-level pseudo-aggregates in VR-Forces, there is no need
//to specify remote subcomponents.
//All pseudo-aggregates should specify a state repository type of type
//vrf-moving-object-state-repository (DtVrfMovingObjectStateRepository) (or
//a derived type).
local->setSimStateRepositoryType("vrf-aggregate-state-repository");
//Force level aggregates are *never* published, so they should not be
//configured with a network interface.
//Pseudo-aggregates are configured with components (sensors,
//controllers, actuators),so they must be configured with a
//component-manager (DtSimComponentManager).
local->setComponentManagerType("component-manager");
//Pseudo-aggregates can be tasked, so they must be configured with a
//pseudo-aggregate-task-manager (DtSimPseudoAggregateTaskManager).
local->setTaskManagerType("local-task-manager");
}

Document ID: Generated on Sun Nov 24 19:49:21 EST 2013 from SVN revision 133924
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)