VR-Forces 5.0.2 Developer's Guide
 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 
19 class DtUUID;
20 
22 {
23 public:
24 
25  //constructor
28  DtReaderWriterRegistry* const parentRegistry = 0);
29 
30 
31  //destructor
33 
34  //This returns a string that uniquely identifies this type of component.
35  //(must be unique with respect to the component types defined in compTypes.h
36  //as well as any additional user-defined components). Returns the string
37  //"simple-radar-warning-response".
38  virtual const char* type() const;
39 
40  //Calculate new control values.
41  virtual void tick();
42 
43  //Returns a newly created instance of this class. We need to provide
44  //this function so that we can register this class with the component
45  //factory.
46  static DtSimComponent* creator(const DtString& name, DtLocalObject* owner,
48  DtReaderWriterRegistry* parentRegistry);
49 
50 protected:
51 
52  //Called by DtSimComponent::init to create myEntityListPort used to manage
53  //multiple sensors that might provide targets to this controller.
54  virtual bool createPorts();
55 
56  //Looks up safe control point by name. If the object exists and it has
57  //a valid state repository, returns the object. Otherwise returns NULL.
59 
60  //Returns true if we are in the vicinity of the given position. To be
61  //in the vicinity of the position means that we are within 5 seconds of
62  //the given location, given our ordered speed.
63  virtual bool inVicinity(const DtVector& localPosition);
64 
65 protected:
66 
67  //default constructor
69 
70  //copy constructor, not implemented
72 
73  //assignment operator, not implemented
75 
76 protected:
77 
78  //Port though which the list of hostile emitter systems will be received.
80 
81  //true while in state of reacting to the detection of an emitter.
83 
84  //Name of the safe location (a control point) we can retreat to.
86 
88 };
UUID is a unique ID wrapper class.
Definition: rwUUID.h:229
virtual DtSimObjectReference getControlPoint(const DtUUID &name)
DtVector myLocalGoal
Definition: simpleRdrWrnResp.h:87
The DtSimObjectReference is a shared pointer that can be used amongst many object for access to the u...
Definition: simObjectReference.h:26
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
Definition: readerWriterRegistry.h:39
DtFixedWingPilotController is a controller that models the capabilities of a fixed-wing pilot...
Definition: fixedWingPilotController.h:47
virtual bool inVicinity(const DtVector &localPosition)
Contains class declarations for DtEntityListInputPort, DtEntityListOutputPort, and DtEntityListPortDa...
Definition: entListIOPort.h:29
static DtSimComponent * creator(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc, DtReaderWriterRegistry *parentRegistry)
DtEntityListInputPort * myEmitterListPort
Definition: simpleRdrWrnResp.h:79
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:90
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:70
VRF4API_METHOD const DtSimulationServices * simManager() const
This is the deprecated API that can be used as a reference to migrate 4.X code to 5...
Definition: simComponent.h:566
DtSimpleRadarWarningResponse & operator=(const DtSimpleRadarWarningResponse &orig)
virtual void tick()
Only gets actuator values the first time it's called. Call lookupAndCacheProcessSR(), to look up myProcessState, if it hasn't already been found.
Definition: simpleRdrWrnResp.h:21
bool myReactingToWarning
Definition: simpleRdrWrnResp.h:82
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:85
A locally simulated VRF object. Holds all internal and external data for the object, and provides access to both the current frame and next frame state data for the object. All current frame data is read-only, and next-frame data can be written to. No thread safety guarantees are made on this object during the simulation frame and it should only be accessed by the thread that is simulating the object.
Definition: localObject.h:86
virtual const char * type() const
Returns a string identifies the class type of component. Type values are defined in compTypes...

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)