WSF
ZoneSet.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2020 Infoscitex, a DCS Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11
12#ifndef ZONESET_HPP
13#define ZONESET_HPP
14
15#include <memory>
16#include <string>
17#include <vector>
18
19#include "UtCallback.hpp"
20#include "UtCallbackHolder.hpp"
21#include "ViExport.hpp"
22#include "WsfPM_Zone.hpp"
23
24namespace wkf
25{
26class AttachmentZone;
27}
28
29namespace wizard
30{
31class Zone;
32class ProxyChange;
33
35{
36public:
37 ZoneSet(const ZoneSet& aRhs) = delete; // vector<unique_ptr> requires deletion of default copy constructor
38 ZoneSet(const WsfPM_Zone& aZone);
39 ~ZoneSet() = default;
40
43 void UpdateZoneSet(const WsfPM_Zone& aZone);
44
46 void RemoveZoneSet();
47
51 std::vector<Zone*> GetZonesWithReferencePlatform(const std::string& aRefPlatName) const;
52
56 bool SubzoneReferencesPlatform(const std::string& aRefPlatName) const;
57
61 Zone* GetZoneByAttachment(const wkf::AttachmentZone* aAttachmentZone) const;
62
64 std::string GetZoneSetName() const { return mZoneSetName; }
65
67 std::string GetParentPlatformName() const { return mParentPlatformName; }
68
70 WsfPM_Zone GetZoneSetNode() const { return mZoneNode; }
71
73 bool IsGlobal() const { return mParentPlatformName == "Global Zones"; }
74
75private:
78 void AddZoneSet(const WsfPM_Zone& aZone);
79
82 void OnProxyModified(const ProxyChange& aProxyChange);
83
84 std::string mZoneSetName;
85
86 std::string mParentPlatformName;
87
88 WsfPM_Zone mZoneNode;
89
90 std::vector<std::unique_ptr<Zone>> mSubzones;
91
92 UtCallbackHolder mProxyCallbacks;
93 UtCallback* mUpdateCallbackPtr{nullptr};
94};
95}; // namespace wizard
96
97#endif
#define VI_EXPORT
Definition ViExport.hpp:38
Definition WsfPM_Zone.hpp:57
Records a change to proxy data.
Definition ProxyChange.hpp:21
std::string GetZoneSetName() const
Returns the name of the zone/zone set.
Definition ZoneSet.hpp:64
ZoneSet(const ZoneSet &aRhs)=delete
bool IsGlobal() const
Returns whether this zone/zone set is defined globally (i.e., not on a platform).
Definition ZoneSet.hpp:73
WsfPM_Zone GetZoneSetNode() const
Returns the node corresponding to this zone/zone set.
Definition ZoneSet.hpp:70
void RemoveZoneSet()
Visually removes the zone from the map display.
Definition ZoneSet.cpp:164
std::string GetParentPlatformName() const
Returns the name of the parent platform of this zone/zone set.
Definition ZoneSet.hpp:67
Zone * GetZoneByAttachment(const wkf::AttachmentZone *aAttachmentZone) const
Definition ZoneSet.cpp:203
~ZoneSet()=default
std::vector< Zone * > GetZonesWithReferencePlatform(const std::string &aRefPlatName) const
Definition ZoneSet.cpp:188
void UpdateZoneSet(const WsfPM_Zone &aZone)
Definition ZoneSet.cpp:157
bool SubzoneReferencesPlatform(const std::string &aRefPlatName) const
Definition ZoneSet.cpp:175
Definition lib/source/map/Zone.hpp:41
Definition Runner.hpp:22
Definition ActionManager.hpp:28
Copyrights Multiple, All Rights Reserved