VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
minefieldController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
14 #include "vrfutil/simClock.h"
18 #include <list>
19 
20 class DtString;
24 class DtMine;
26 
35 {
36 
37 public:
38 
41  DtMinefieldController(const DtString& name,
42  DtLocalObject* owner,
43  DtSimulationServices* simManager,
44  DtComponentDescriptor* desc = 0,
45  DtReaderWriterRegistry* parentRegistry = 0);
46 
48  virtual ~DtMinefieldController();
49 
50 private:
53 
56 
57 public:
63  virtual bool init();
64 
65  virtual bool taskVisualizationsActive() const;
66 
68  virtual void preFirstTickInit();
69 
71  virtual void tick();
72 
75  virtual const char* type() const;
76 
78  static void setDetonationCallback(DtSimMessage* msg, void* usrData);
79 
80  virtual void processSetDetonation(DtSimMessage* msg);
81 
84  virtual void updateTaskVisualizations();
85 
86 protected:
87 
93  virtual bool createPSR();
94 
96  virtual void selfDestruct(DtMineList* list);
97 
98  virtual bool isMineTriggered(const DtSimObject* target, const DtMine* mine);
99 
100  virtual bool determinePressureFuseTriggered(const DtSimObject* target,const DtVector& mineLocation);
101  virtual bool determineMagneticFuseTriggered(const DtSimObject* target, const DtVector& mineLocation);
102  virtual bool determineTiltRodFuseTriggered(const DtSimObject* target, const DtVector& mineLocation);
103  virtual bool determineCommandFuseTriggered();
104  virtual bool determineTripWireFuseTriggered(const DtSimObject* target, const DtVector& mineLocation,
105  double wireLength);
106 
107  virtual void createDetonationInteraction(DtMine* mine);
108 
109  virtual void drawMines(DtString& unique,DtMineList *mineList, DtColor& color);
110 
111 public:
115  static DtSimComponent * creator(const DtString& name,
116  DtLocalObject* owner,
117  DtSimulationServices* simManager,
118  DtComponentDescriptor* desc = 0,
119  DtReaderWriterRegistry* parentRegistry = 0);
120 
121 protected:
122 
125  virtual void setUpObjectsToCheck();
126 
128  virtual void registerMessageCallbacks();
129 
130 protected:
131 
135  std::vector<DtAmmunitionParamsEntry*> myMineTargetList;
136 
138 
142 
144 };
145 
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
Contains the DtCompositePredicate class declaration.
Definition: compositePredicate.h:23
DtMinefieldStateRepository * myMineState
Definition: minefieldController.h:134
virtual bool taskVisualizationsActive() const
Returns true if task visualizations are currently active for this component. Default behavior is to r...
DtMinefieldControllerDescriptor is a DtComponentDescriptor that has the name of the DtMinefieldContro...
Definition: minefieldControllerDescriptor.h:24
DtMinefieldControllerPSR * myProcessState
Container for state data associated with this component. This state is saved and restored as part of ...
Definition: minefieldController.h:141
DtMinefieldController models how the minefield interacts with objects. It will determine if any objec...
Definition: minefieldController.h:34
virtual void preFirstTickInit()
This function can be overridden to initialize a component before it is ticked for the first time...
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
const DtMinefieldControllerDescriptor * myMinefieldControllerDesc
Definition: minefieldController.h:133
Definition: readerWriterRegistry.h:39
Definition: color.h:25
virtual bool init()
Calls createPorts and createPortGroups Initializes myLastTickSimTime.
virtual void updateTaskVisualizations()
Called to update task visualizations after every tick. Implemented by subclasses. ...
Definition: simComponent.h:437
Process state repository for DtMinefieldController component. Hold state data associated with the sen...
Definition: minefieldControllerPSR.h:24
DtCompositePredicate myObjectsToBlowPredicate
Definition: minefieldController.h:132
File: simMsg.h.
Definition: simMessage.h:35
File: vlClock.h.
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation from ...
DtSimComponent & operator=(const DtSimComponent &orig)
assignment operator, not implemented
Description: This repository holds all information that is common to all the forms of minefield objec...
Definition: minefieldStateRepository.h:28
DtAmmunitionParamsEntry; descriptor that represents members of a DtAmmunitionParams.
Definition: ammunitionParamsEntry.h:20
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:94
Definition: mine.h:29
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:91
Represents a single simulation object in the exercise. Object may be VRF simulation, or non-VRF simulated, and may be simulated by the local sim engine, or by a remote sim engine. Only public (external) state of the object is available. All data is read-only. All access to data of the object is thread safe within the simulation frame.
Definition: simObject.h:88
Contains the DtSimComponent class declaration.
DtTacticalGraphicLocalObjectFacade myTacticalGraphicLocalObjectFacade
Definition: minefieldController.h:143
std::vector< DtAmmunitionParamsEntry * > myMineTargetList
Definition: minefieldController.h:135
DtBoost::shared_ptr< const DtManagedObjectList > DtManagedObjectListConstPtr
Typedef for a shared pointer to a const DtOrgViewManagedObjectList. These lists are used within VR-Fo...
Definition: managedObjectList.h:35
virtual const char * type() const =0
Returns a string identifies the class type of component. Type values are defined in compTypes...
DtManagedObjectListConstPtr myDetectableObjectList
Definition: minefieldController.h:137
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

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)