OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
DataCategorizationHandler.h
Go to the documentation of this file.
1/*****************************************************************/
11#pragma once
12
15#include "OTCore/CoreTypes.h"
16#include "OTCore/Color.h"
17#include "EntityInformation.h"
20#include "OTCore/Variable.h"
21#include "OTGui/TableRange.h"
22#include "IVisualisationTable.h"
23
24#include <optional>
25#include <map>
26#include <string>
27#include <memory>
28#include <set>
29
31{
32public:
33 DataCategorizationHandler(std::string tableFolder, std::string previewTableName);
36
37 void markSelectionForStorage(const std::list<ot::EntityInformation>& _selectedEntities,EntityParameterizedDataCategorization::DataCategorie _category);
38
39 void storeSelectionRanges(const std::vector<ot::TableRange>& _ranges);
40
41 inline void ensureEssentials();
42
43private:
44 const std::string m_tableFolder;
45 const std::string m_previewTableName;
46 ot::UID m_scriptFolderUID = -1;
47 std::string m_rmdEntityName;
48 const std::string _selectionRangeName = "Selection";
49 ot::Color m_backgroundColour;
50
51 std::map<std::string, std::list<std::shared_ptr<EntityTableSelectedRanges>>> _allRelevantTableSelectionsByMSMD;
52 std::map<std::string, std::list<std::optional<std::list<ot::Variable>>>> _allVariablesByMSMD;
53 std::set<std::string> m_bufferedCategorisationNames;
54 ot::UID m_bufferedTableID = -1;
55 ot::UID m_bufferedTableVersion = -1;
56 std::vector<std::shared_ptr<EntityParameterizedDataCategorization>> m_markedForStorringEntities;
57
58
59
60 bool isValidSelection(std::list<EntityBase*>& _selectedEntities);
61 std::string getTableFromSelection(std::list<EntityBase*>& _selectedEntities);
62 void bufferCorrespondingMetadataNames(std::list<EntityBase*>& _selectedEntities, EntityParameterizedDataCategorization::DataCategorie _category);
63 void setBackgroundColour(EntityParameterizedDataCategorization::DataCategorie _category);
64 void clearBufferedMetadata();
65 bool checkForCategorisationEntity(std::list<EntityBase*>& _selectedEntities);
66 void addSMDEntries(std::list<EntityBase*>& _selectedEntities);
67 void addParamOrQuantityEntries(std::list<EntityBase*>& _selectedEntities, EntityParameterizedDataCategorization::DataCategorie _category);
68 void addNewCategorizationEntity(std::string name, EntityParameterizedDataCategorization::DataCategorie category, bool addToActive);
69 void requestRangeSelection(const std::string& _tableName);
70
71 std::string determineDataTypeOfSelectionRanges(IVisualisationTable* _table,const std::vector<ot::TableRange>& _selectedRanges);
72 std::map<std::string, ot::UID> getAllScripts();
73};
Container for groups of TableSelectionEntities that describe the same metadata categorization.
Common methods for all central handler classes.
Definition BusinessLogicHandler.h:16
Definition DataCategorizationHandler.h:31
void storeSelectionRanges(const std::vector< ot::TableRange > &_ranges)
Definition DataCategorizationHandler.cpp:364
DataCategorizationHandler(const DataCategorizationHandler &other)=delete
DataCategorizationHandler & operator=(const DataCategorizationHandler &other)=delete
void markSelectionForStorage(const std::list< ot::EntityInformation > &_selectedEntities, EntityParameterizedDataCategorization::DataCategorie _category)
Definition DataCategorizationHandler.cpp:27
DataCategorizationHandler(std::string tableFolder, std::string previewTableName)
Definition DataCategorizationHandler.cpp:21
void ensureEssentials()
Definition DataCategorizationHandler.cpp:603
The Color class is used to represent RGBA colors with integer values.
Definition Color.h:72
unsigned long UID
Unique identifier (32 bit unsigned integer)
Definition CoreTypes.h:27