Situations.h
1 //##################################################################################################
2 //
3 // Ceetron Desktop Components
4 // Component: App
5 //
6 // --------------------------------------------------------------------------------------------
7 // Copyright (C) 2019, Ceetron AS
8 // This is UNPUBLISHED PROPRIETARY SOURCE CODE of Ceetron AS. The contents of this file may
9 // not be disclosed to third parties, copied or duplicated in any form, in whole or in part,
10 // without the prior written permission of Ceetron AS.
11 //##################################################################################################
12 
13 #pragma once
14 
15 #include "CeeCore/Base.h"
16 #include "CeeApp/Base.h"
17 #include "CeeUnstructGrid/Situation.h"
18 
19 #include <map>
20 
21 namespace cee {
22 
23 namespace ug {
24 class UnstructGridModel;
25 class Situation;
26 }
27 
28 namespace vis { class View; }
29 }
30 
31 namespace cee {
32 namespace app {
33 
34 //==================================================================================================
35 //
36 // Class for Situations management
37 //
38 //==================================================================================================
39 class CEE_APP_EXPORT Situations : public RefCountedObject
40 {
41 public:
42  static Situations* instance();
43 
44  void add(ug::Situation* situation);
45  void remove(size_t index);
46  void removeAll();
47 
48  PtrRef<ug::Situation> captureCurrent() const;
49 
50  size_t situationsCount() const;
51  ug::Situation* situation(size_t index);
52  const ug::Situation* situation(size_t index) const;
53  size_t situationIndex(const ug::Situation* situation) const;
54  bool updateSituationInfo(size_t index, const cee::Str& situationFolder, const cee::Str& newName, const cee::Str& newDesc);
55 
56  void setRecoveryFolder(const Str& folder);
57  bool recoverySituationExists() const;
58  void saveRecovery();
59  PtrRef<ug::Situation> loadRecovery() const;
60  void removeRecovery();
61  ug::Situation* captureRecovery();
62 
63  void exportSituations(std::vector<const ug::Situation*> situations, const Str& archiveFile);
64  std::vector<PtrRef<ug::Situation> > importSituations(const Str& archiveFile);
65 
66 
67 private:
68  Situations();
69  virtual ~Situations();
70 
71  CEE_PRIVATE_IMPL(Situations);
72  CEE_DISALLOW_COPY_AND_ASSIGN(Situations);
73 };
74 
75 } // namespace cee
76 } // namespace app
Namespace cee contains all functionality and structures under the Core component. ...
Definition: AppComponent.cpp:26
A general unicode based string class.
Definition: Str.h:28
Smart pointer class used for handling reference counted objects (that derive from Object)...
Definition: PtrRef.h:26
Class to manage the hierarchy of Situations in the application.
Definition: Situations.h:39
Base class for all reference counted objects with built-in support for intrusive reference counting...
Definition: RefCountedObject.h:34
A situation stores the setup of the unstructgrid model and view.
Definition: Situation.h:41
Provides a render area in the user control/widget to enable visualization of the current model data a...
Definition: View.h:40