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() override;
49 
50 private:
53 
56 
57 public:
63  virtual bool init() override;
64 
65  virtual bool taskVisualizationsActive() const override;
66 
68  virtual void preFirstTickInit() override;
69 
71  virtual void tick() override;
72 
75  virtual const char* type() const override;
76 
78  static void setDetonationCallback(DtSimMessage* msg, void* usrData);
79 
80  virtual void processSetDetonation(DtSimMessage* msg);
81 
84  virtual void updateTaskVisualizations() override;
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 
154 };
155 
#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
bool myShouldUpdateVisualization
Indicates that some mine status has changed, and the visualization should be updated.
Definition: minefieldController.h:147
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
int myLastVisualizationCount
The number of past visualizations– used to delete extras if minefield changes.
Definition: minefieldController.h:153
const DtMinefieldControllerDescriptor * myMinefieldControllerDesc
Definition: minefieldController.h:133
std::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
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:443
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
Definition: ammunitionParamsEntry.h:24
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:96
Definition: mine.h:29
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:89
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:80
Contains the DtSimComponent class declaration.
DtTacticalGraphicLocalObjectFacade myTacticalGraphicLocalObjectFacade
Definition: minefieldController.h:143
std::vector< DtAmmunitionParamsEntry * > myMineTargetList
Definition: minefieldController.h:135
int myMinefieldVersionVisualized
The iteration of the minefield created mine placement geometry that is being visualized currently...
Definition: minefieldController.h:150
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.
Definition: localObject.h:98

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)