VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
simpleRdrWrnResp.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2017 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
9 
10 //class DtSimpleRadarWarningResponse:
11 //
12 //Instances of DtSimpleRadarWarningResponse are an example of a controller
13 //that implements a reactive behavior when a it receives sensor input that
14 //a radar has been detected. It receives a list of emitter systems (hostile
15 //radar systems). It takes the first emitter in the list and flys away to
16 //a location in the opposite direction.
17 
18 class DtVrfObject;
20 class DtUUID;
21 
23 {
24 public:
25 
26  //constructor
29  DtReaderWriterRegistry* const parentRegistry = 0);
30 
31 
32  //destructor
34 
35  //This returns a string that uniquely identifies this type of component.
36  //(must be unique with respect to the component types defined in compTypes.h
37  //as well as any additional user-defined components). Returns the string
38  //"simple-radar-warning-response".
39  virtual const char* type() const;
40 
41  //Calculate new control values.
42  virtual void tick();
43 
44  //Returns a newly created instance of this class. We need to provide
45  //this function so that we can register this class with the component
46  //factory.
47  static DtSimComponent* creator(const DtString& name, DtVrfObject* owner,
48  DtSimManager* simManager, DtComponentDescriptor* desc,
49  DtReaderWriterRegistry* parentRegistry);
50 
51 protected:
52 
53  //Called by DtSimComponent::init to create myEntityListPort used to manage
54  //multiple sensors that might provide targets to this controller.
55  virtual bool createPorts();
56 
57  //Looks up safe control point by name. If the object exists and it has
58  //a valid state repository, returns the object. Otherwise returns NULL.
59  virtual const DtVrfObject* getControlPoint(const DtUUID& name);
60 
61  //Returns true if we are in the vicinity of the given position. To be
62  //in the vicinity of the position means that we are within 5 seconds of
63  //the given location, given our ordered speed.
64  virtual bool inVicinity(const DtVector& localPosition);
65 
66 protected:
67 
68  //default constructor
70 
71  //copy constructor, not implemented
73 
74  //assignment operator, not implemented
76 
77 protected:
78 
79  //Port though which the list of hostile emitter systems will be received.
81 
82  //true while in state of reacting to the detection of an emitter.
84 
85  //Name of the safe location (a control point) we can retreat to.
87 
89 };
UUID is a unique ID wrapper class.
Definition: rwUUID.h:222
DtVrfObject is used to represent any type of simulated object (entities, aggregate, control objects) in a VR-Forces application.
Definition: vrfObject.h:215
DtSimManager * simManager()
Gets the sim manager.
Definition: simComponent.h:408
DtVector myLocalGoal
Definition: simpleRdrWrnResp.h:88
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:42
Definition: readerWriterRegistry.h:39
DtFixedWingPilotController is a controller that models the capabilities of a fixed-wing pilot...
Definition: fixedWingPilotController.h:44
DtEntityListInputPort * myEmitterListPort
Definition: simpleRdrWrnResp.h:80
virtual bool inVicinity(const DtVector &localPosition)
Contains class declarations for DtEntityListInputPort, DtEntityListOutputPort, and DtEntityListPortDa...
Definition: entListIOPort.h:27
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:67
virtual const DtVrfObject * getControlPoint(const DtUUID &name)
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:102
static DtSimComponent * creator(const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc, DtReaderWriterRegistry *parentRegistry)
DtSimpleRadarWarningResponse & operator=(const DtSimpleRadarWarningResponse &orig)
virtual void tick()
Only gets actuator values the first time it's called.
Definition: simpleRdrWrnResp.h:22
bool myReactingToWarning
Definition: simpleRdrWrnResp.h:83
virtual bool createPorts()
Overridden to create the fixed wing ports.
virtual DtSymbolString name() const
Accessor for name of this readable/writable object.
DtUUID mySafeControlPointName
Definition: simpleRdrWrnResp.h:86
virtual const char * type() const
Returns a string identifies the class type of component.

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)