WSF
ClonePlatformDialog.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 2003-2015 The Boeing 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#ifndef CLONEPLATFORMDIALOG_HPP
12#define CLONEPLATFORMDIALOG_HPP
13#include <QDialog>
14#include <QTimer>
15
16#include "UtMemory.hpp"
17#include "ViExport.hpp"
18#include "WsfPM_Platform.hpp"
19#include "WsfPM_Root.hpp"
20#include "ui_CloneDialog.h"
21
22class QMimeData;
23class QStandardItem;
24class QStandardItemModel;
25class UtLatPos;
26class UtLonPos;
27
28namespace wizard
29{
30class PasteContext;
31
32class VI_EXPORT ClonePlatformDialog : public QDialog
33{
34 Q_OBJECT
35
36public:
37 static void PasteHandler(const QMimeData* aMime, const PasteContext& aContext, bool aExecute);
38
39 explicit ClonePlatformDialog(QWidget* aParentWindow);
40 ~ClonePlatformDialog() override = default;
41
42 void SetReferenceLocation(const UtLatPos& aLat, const UtLonPos& aLon);
43 void Show(const std::vector<WsfPM_Platform>& aPlatforms);
44 void SetDestinationFilePath(const std::string& aFilePath) { mDestinationFilePath = aFilePath; }
45
46private slots:
47
48 void GenerateNames();
49 void ItemChanged(QStandardItem*);
50 void ValidateNames();
51 void UpdateAcceptStatus();
52
53private:
54 using QDialog::show; // private
55 WsfPProxy* GetProxy();
56 WsfPM_Root GetRoot();
57 void accept() override;
58 void reject() override;
59 std::string GetNewName(const std::string& aOldName);
60
61
62 void Clone(const WsfPM_Platform& aPlatform, const std::string& aName);
63
64 QStandardItemModel* mModelPtr;
65 QTimer mDelayedValidationTimer;
66 Ui::CloneDialog mUi;
67 std::vector<WsfPM_Platform> mPlatforms;
68 double mCentroidLat;
69 double mCentroidLon;
70 bool mNamesValid;
71 std::string mDestinationFilePath;
72 bool mApplyToTextImmediately;
73};
74} // namespace wizard
75
76#endif
#define VI_EXPORT
Definition ViExport.hpp:38
Definition WsfPM_Platform.hpp:34
Definition WsfPM_Root.hpp:24
Definition WsfPProxy.hpp:32
void SetReferenceLocation(const UtLatPos &aLat, const UtLonPos &aLon)
Definition ClonePlatformDialog.cpp:389
void Show(const std::vector< WsfPM_Platform > &aPlatforms)
Definition ClonePlatformDialog.cpp:312
~ClonePlatformDialog() override=default
void SetDestinationFilePath(const std::string &aFilePath)
Definition ClonePlatformDialog.hpp:44
static void PasteHandler(const QMimeData *aMime, const PasteContext &aContext, bool aExecute)
Definition ClonePlatformDialog.cpp:396
ClonePlatformDialog(QWidget *aParentWindow)
Definition ClonePlatformDialog.cpp:31
Definition PasteContext.hpp:31
Definition Runner.hpp:22
Copyrights Multiple, All Rights Reserved