VR-Forces 4.3 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
simpleRdrWrnResp.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2003 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 /*******************************************************************************
6 ** $RCSfile: simpleRdrWrnResp.h,v $ $Revision: 1.7 $ $State: Exp $
7 *******************************************************************************/
8 
9 #ifndef DtSimpleRadarWarningResponse_H_
10 #define DtSimpleRadarWarningResponse_H_
11 
13 
14 //class DtSimpleRadarWarningResponse:
15 //
16 //Instances of DtSimpleRadarWarningResponse are an example of a controller
17 //that implements a reactive behavior when a it receives sensor input that
18 //a radar has been detected. It receives a list of emitter systems (hostile
19 //radar systems). It takes the first emitter in the list and flys away to
20 //a location in the opposite direction.
21 
22 class DtVrfObject;
24 
26 {
27 public:
28 
29  //constructor
32  DtReaderWriterRegistry* const parentRegistry = 0);
33 
34 
35  //destructor
37 
38  //This returns a string that uniquely identifies this type of component.
39  //(must be unique with respect to the component types defined in compTypes.h
40  //as well as any additional user-defined components). Returns the string
41  //"simple-radar-warning-response".
42  virtual DtString type() const;
43 
44  //Calculate new control values.
45  virtual void tick();
46 
47  //Returns a newly created instance of this class. We need to provide
48  //this function so that we can register this class with the component
49  //factory.
50  static DtSimComponent* creator(const DtString& name, DtVrfObject* owner,
51  DtSimManager* simManager, DtComponentDescriptor* desc,
52  DtReaderWriterRegistry* parentRegistry);
53 
54 protected:
55 
56  //Called by DtSimComponent::init to create myEntityListPort used to manage
57  //multiple sensors that might provide targets to this controller.
58  virtual bool createPorts();
59 
60  //Looks up safe control point by name. If the object exists and it has
61  //a valid state repository, returns the object. Otherwise returns NULL.
62  virtual DtVrfObject* getControlPoint(const DtString& name);
63 
64  //Returns true if we are in the vicinity of the given position. To be
65  //in the vicinity of the position means that we are within 5 seconds of
66  //the given location, given our ordered speed.
67  virtual bool inVicinity(const DtVector& localPosition);
68 
69 protected:
70 
71  //default constructor
73 
74  //copy constructor, not implemented
76 
77  //assignment operator, not implemented
79 
80 protected:
81 
82  //Port though which the list of hostile emitter systems will be received.
84 
85  //true while in state of reacting to the detection of an emitter.
87 
88  //Name of the safe location (a control point) we can retreat to.
90 
92 };
93 
94 #endif
95 

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)