VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtElementEditorLogic.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2023 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
7 
8 #pragma once
9 
14 
15 #include <vrvCoreQt/vrvCoreQt.h>
20 #include <vrvUtil/DtUnicode.h>
22 
23 namespace makVrv
24 {
25  class DtElementDefinitionManager;
26  class DtElementEditorInterface;
27  class DtVisualizerAttributeEditorInterface;
28  class DtVisualizerAttribute;
29  class DtPage;
30  class DtUnicode;
31  class DtVisualizerDefinition;
32 
35  {
36  public:
37 
40  DtDe& de, DtElementEditorInterface* iface, DtPersistenceControlsInterface* persistenceControls,
41  DtPage* page = 0);
42 
44  virtual ~DtElementEditorLogic();
45 
47  DtElementEditorLogic() = delete;
48 
50  DtElementEditorLogic(const DtElementEditorLogic &copy) = delete;
51 
53  DtElementEditorLogic& operator=(const DtElementEditorLogic&) = delete;
54 
55  public:
59  virtual void selectElement(const DtUnicode& elementName, bool valid);
60 
63  virtual void setElementRemoveAllowed(const DtUnicode& elementName);
64 
66  virtual void checkIfModified();
67 
68  protected:
69 
70  virtual void selectVisualizerDefinition(const std::string& uuidString);
71  virtual void selectAttribute(int index, const std::string& uuidString, const std::string& attrName);
72 
73  // TDL not sure what this is the index of...
74  virtual void deselectAttribute(int index, const std::string& attrName);
75 
77  virtual void refreshElementDefinitions();
78 
79  virtual void refreshVisualizerDefinitionView();
80 
82  virtual void clearElementSelection();
83 
86  virtual void setupModifiedEntitiesDialog();
87 
90  virtual void runThroughChildren(DtElementDefinition* elem, std::map<std::string, std::string>& names);
91 
93  virtual void addVisualizerDefinition();
94 
96  virtual void removeVisualizerDefinition(const std::string& uuidString);
97 
98  // TDL This doesn't appear to be possible in the current element editor widget
99  virtual void deselectVisualizerDefinition();
100 
102  virtual void addElement(const DtUnicode& name);
103 
105  virtual void removeElement();
106 
107  // TDL Currently unused as renaming elements has a bunch of issues (including the fact
108  // that entity type mappings point to elements by name, as do child nodes to their parents)
109  virtual void renameElement(const DtUnicode& oldName, const DtUnicode& newName);
110 
112  virtual void addAttributeRequested(int index, const std::string& uuidString);
113 
116  virtual void removeAttribute(const std::string& uuidString, const std::string& name);
117 
120  virtual void removeLocalAttribute(const std::string& uuidString, const std::string& name);
121 
123  virtual void changeAttribute(const DtUnicode& origin, int index, const std::string& uuidString, const std::string& name);
124 
126  virtual void cancelAttributeChange(int defIndex, const std::string& name);
127 
128  // Determine if a visualizer definition is inherited
129  virtual bool visualizerDefinitionInherited(DtElementDefinition*, DtVisualizerDefinition*) const;
130 
132  virtual void refreshModelSets();
133 
136  virtual void refreshFileSaveTo();
137 
141  void changeFileLocation();
142 
144  virtual void reloadFile(const std::string& filePath);
145 
146  virtual void updateAttributeEditorInterface(int index, const std::string& uuidString, const std::string& name,
148 
149  virtual void changeModelSet(int index);
150 
153  virtual void changeFileSaveTo(int index);
154 
157  virtual void changeFileFilter();
158 
160  virtual void on_import();
161 
163  virtual void on_restoreFactory();
164 
166  virtual void on_restoreStartup();
167 
170  virtual void on_saveAll();
171 
173  virtual void on_saveAllHier();
174 
176  virtual void on_saveAllLeaves();
177 
180  virtual void on_exportSelectedNode();
181 
183  virtual void on_reloadFiles();
184 
186  virtual void on_merge();
187 
190  virtual void on_exportSelected();
191 
193  virtual void on_importFilePathChosen(const std::string& filePath);
194 
196  virtual void on_exportFilePathChosen(const std::string& filePath);
197 
200  virtual void on_leafFilePathChosen(const std::string& filePath);
201 
203  virtual void on_mergeFilePathChosen(const std::string& filePath);
204 
206  virtual void on_exportSelectedFilePathChosen(const std::string& filePath);
207 
209  virtual void on_exportSelectedNodeFilePathChosen(const std::string& filePath);
210 
213  virtual void on_saveDefaults();
214 
216  virtual void on_copyVisualizerDefinition();
217 
221  virtual void on_pasteAndReplaceVisualizerDefinition();
222 
225  virtual void on_pasteAndAddVisualizerDefinition();
226 
229  virtual void on_clearVisualizerDefinitions();
230 
232  virtual bool shouldDisableSave();
233 
235  virtual void mapTypeToDirectoryPath(DtElementDefinitionTypeManager::ElementDefinitionType type);
236 
239  virtual void slot_managerAboutToBeDeleted();
240 
244  virtual void slot_currentStyleSheetsPathAboutToBeChanged();
245 
248  virtual void slot_postCurrentStyleSheetsPathChanged();
249 
251  virtual DtElementDefinitionManager& elementDefinitionManager();
252 
253  protected:
254 
257  unsigned int mySelectedFileSaveTo;
258 
260 
268  std::string myDirectoryPath;
270  std::vector<std::string> myNewList;
271  std::vector<std::string> myVisualList;
273  std::vector<DtVisualizerDefinition*> myCopiedVisDefs;
274  std::vector<std::string> myListOfCopiedVisDefs;
278 
279  };
280 
285  {
286  public:
289 
291  virtual ~DtElementEditorLogicCreator();
292 
294  static DtElementEditorLogicCreator& instance(DtDe&);
295 
297  static void registerInstance(DtDe&, DtElementEditorLogicCreator*);
298 
300  DtElementEditorInterface* iface, DtPersistenceControlsInterface* persistenceControls,
301  DtPage* page = 0);
302 
303  protected:
305  };
306 }
std::vector< DtVisualizerDefinition * > myCopiedVisDefs
Definition: DtElementEditorLogic.h:273
Base interface for the visualizer attribute editor to be passed to logics which will assign the attri...
Definition: DtVisualizerAttributeEditor.h:87
Definition: DtElementEditorInterface.h:22
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
DtDe & myDe
Definition: DtElementEditorLogic.h:304
A unicode string. DtUnicode stores a UTF-16 encoded unicode string. Code Point, a Unicode character...
Definition: DtUnicode.h:33
DtUnicode mySelectedElement
Definition: DtElementEditorLogic.h:255
The DtElementEditorLogicCreator class presents a factory creator for the DtElementEditorLogic. To create a subclass of the DtElementEditorLogic, register an instance of the DtElementEditorLogicCreator and return your subclass in the create method.
Definition: DtElementEditorLogic.h:284
unsigned int mySelectedFileSaveTo
Definition: DtElementEditorLogic.h:257
DtModelSetId mySelectedModelSet
Definition: DtElementEditorLogic.h:256
voidpf uLong int origin
Definition: ioapi.h:42
std::string myPathofSelectedModel
Definition: DtElementEditorLogic.h:269
#define DT_DLL_VRVCOREQT
Definition: vrvCoreQt.h:20
Contains DLL export macros.
Manager which owns element definitions.for one type of element Use the makVrv::DtElementDefinitionTyp...
Definition: DtElementDefinitionManager.h:73
Abstract interface for controlling persistence of state in a dialog.
Definition: DtPersistenceControlsInterface.h:20
DtElementDefinitionManager * myManager
Definition: DtElementEditorLogic.h:264
unsigned int ElementDefinitionType
Identifier for a type of element definition.
Definition: DtElementDefinitionManager.h:557
std::vector< std::string > myVisualList
Definition: DtElementEditorLogic.h:271
Contains makVrv::DtVirtualBaseClass class.
DtElementEditorInterface * myInterface
Definition: DtElementEditorLogic.h:266
std::vector< std::string > myNewList
Definition: DtElementEditorLogic.h:270
A widget that displays a persistence GUI for element definitions Operations presented are restore fro...
Logic class for the DtElementEditorWidget.
Definition: DtElementEditorLogic.h:34
The element definition class contains the element definition information. The makVrv::DtElementDefini...
Definition: DtElementDefinition.h:26
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
DtDe & myDe
Definition: DtElementEditorLogic.h:261
The page is a single widget component which is viewed in a page collection.
Definition: DtPage.h:30
std::string myDirectoryPath
Definition: DtElementEditorLogic.h:268
DtPage * myPage
Definition: DtElementEditorLogic.h:259
DtSignalConnectionManager myManagerConnections
Definition: DtElementEditorLogic.h:263
Interface to a widget that displays a persistence GUI in some way.
DtPersistenceControlsInterface * myPersistenceControls
Definition: DtElementEditorLogic.h:267
DtVisualizerAttribute * myEditAttribute
Definition: DtElementEditorLogic.h:277
Base class to provide boost signal/slot management.
DtVisualizerDefinition * myCopiedVisualizerDefinition
Definition: DtElementEditorLogic.h:272
The abstract base visualizer attribute class.
Definition: DtVisualizerAttribute.h:27
A definition of a visualizer. Visualizer definition are always members of a visualizer definition set...
Definition: DtVisualizerDefinition.h:26
std::vector< std::string > myListOfCopiedVisDefs
Definition: DtElementEditorLogic.h:274
std::string mySelectedVisualizerUuid
Definition: DtElementEditorLogic.h:276
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:72
DtSignalConnectionManager myConnections
Definition: DtElementEditorLogic.h:262
DtModelSetId
Definition: DtModelSetEnums.h:19
bool myAdjustDropDown
Definition: DtElementEditorLogic.h:275
int myManagerType
Definition: DtElementEditorLogic.h:265

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)