Kactus2
Kactus2 reference guide
Loading...
Searching...
No Matches
ModeReferenceInterface.h
Go to the documentation of this file.
1//-----------------------------------------------------------------------------
2// File: ModeReferenceInterface.h
3//-----------------------------------------------------------------------------
4// Project: Kactus 2
5// Author: Anton Hagqvist
6// Date: 26.10.2023
7//
8// Description:
9// Interface for accessing mode references.
10//-----------------------------------------------------------------------------
11
12#ifndef MODEREFERENCEINTERFACE_H
13#define MODEREFERENCEINTERFACE_H
14
15#include <KactusAPI/KactusAPIGlobal.h>
16
17#include <QList>
18#include <QSharedPointer>
19
20class ModeReference;
21class Mode;
22
23class KACTUS2_API ModeReferenceInterface
24{
25
26public:
27
29
30 virtual ~ModeReferenceInterface() = default;
31
37 void setModeReferences(std::vector<std::pair<unsigned int, std::string> > const& modeReferences);
38
45
53 std::string getModeReferenceValue(int modeReferenceIndex) const;
54
62 int getModeReferencePriority(int modeReferenceIndex) const;
63
72 bool setModeReferenceValue(int modeReferenceIndex, std::string const& newValue);
73
82 bool setModeReferencePriority(int modeReferenceIndex, unsigned int newPriority);
83
89 bool addModeReference(int row);
90
98 bool removeModeReference(int modeReferenceIndex);
99
107 bool modeReferenceValueIsValid(int modeReferenceIndex) const;
108
116 bool modeReferencePriorityIsValid(int modeReferenceIndex) const;
117
123 std::vector<std::string> getModeReferencesString() const;
124
130 void setContainingElementIsRemap(bool isRemap);
131
138 void setContainingElementModeReferences(std::vector<std::pair<unsigned int, std::string> > const& modeReferences);
139
145 std::vector<std::string> getComponentModes() const;
146
152 void setComponentModes(QSharedPointer<QList<QSharedPointer<Mode> > > newModes);
153
159 std::vector<std::pair<unsigned int, std::string> > getModeReferences() const;
160
167
168private:
169
177 std::vector<std::pair<unsigned int, std::string> > getModeReferencesInUse(int modeReferenceIndex) const;
178
180 std::vector<std::pair<unsigned int, std::string> > containingElementModeReferences_;
181
183 std::vector<std::pair<unsigned int, std::string> > modeReferences_;
184
186 QSharedPointer<QList<QSharedPointer<Mode> > > componentModes_;
187
189 bool containingElementIsRemap_ = false;
190
191};
192
193#endif // MODEREFERENCEINTERFACE_H
bool addModeReference(int row)
std::vector< std::string > getComponentModes() const
int getModeReferenceCount() const
void setComponentModes(QSharedPointer< QList< QSharedPointer< Mode > > > newModes)
virtual ~ModeReferenceInterface()=default
std::vector< std::pair< unsigned int, std::string > > getModeReferences() const
void setContainingElementModeReferences(std::vector< std::pair< unsigned int, std::string > > const &modeReferences)
bool setModeReferenceValue(int modeReferenceIndex, std::string const &newValue)
bool setModeReferencePriority(int modeReferenceIndex, unsigned int newPriority)
void setModeReferences(std::vector< std::pair< unsigned int, std::string > > const &modeReferences)
void setContainingElementIsRemap(bool isRemap)
std::string getModeReferenceValue(int modeReferenceIndex) const
std::vector< std::string > getModeReferencesString() const
bool removeModeReference(int modeReferenceIndex)
ModeReferenceInterface()=default
bool modeReferencePriorityIsValid(int modeReferenceIndex) const
int getModeReferencePriority(int modeReferenceIndex) const
bool modeReferenceValueIsValid(int modeReferenceIndex) const