API Documentation
Loading...
Searching...
No Matches
QTVertexManagerView.h
Go to the documentation of this file.
1/**--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: NDEVR
28File: QTVertexManagerView
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include <NDEVR/QTDesignObject.h>
34
35#include <NDEVR/Model.h>
36#include <NDEVR/DesignParameter.h>
37#include <NDEVR/Pointer.h>
38#include <QAbstractTableModel>
39#include <QItemDelegate>
40namespace NDEVR
41{
42 class VertexTableDelegate : public QItemDelegate
43 {
44 Q_OBJECT
45 public:
46 explicit VertexTableDelegate(QObject* parent = nullptr);
47 bool editorEvent(QEvent* event, QAbstractItemModel* model, const QStyleOptionViewItem& option, const QModelIndex& index) override;
48 };
49 class NDEVR_API QTVertexManagerView final : public QAbstractTableModel
50 {
51 Q_OBJECT
52 public:
53 QTVertexManagerView(QObject *parent = nullptr);
54 QTVertexManagerView(const DynamicPointer<QTDesignObject>& root, QObject *parent = nullptr);
55 virtual ~QTVertexManagerView();
56 void setTarget(const DynamicPointer<QTDesignObject>& root);
57 DynamicPointer<QTDesignObject> target() const;
58 void setParametersToGlobalLinework();
59 void setParametersToGlobalLocations();
60 void setParametersToLocalLocations();
61 void autoPopulateColumns();
62 void setUseGlobalTransform(bool toggle) {
63 m_is_global = toggle;
64 }
65 bool isSpecialCallbackIndex(const QModelIndex& index) const;
66 void setParameters(const Buffer<DesignParameter>& params, bool enable_edit, bool enable_primitive_edit);
67 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
68 int columnCount(const QModelIndex &parent = QModelIndex()) const override;
69 bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
70 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
71 Qt::ItemFlags flags(const QModelIndex &index) const override;
72 void onClicked(const QModelIndex& index, QRect rect);
73 void onHovered(const QModelIndex& index, QRect rect);
74 void setEditable(bool editable);
75 QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
76 Model model() const;
77 void displayLineworkEditor(uint04 vertex_index, PopupInfo info);
78 bool isEditable() const { return m_is_editable; };
79 protected:
80 void cacheValues();
81 signals:
83 protected slots:
84 void updateSlot();
85 void deletedSlot();
86 protected:
87 UUID m_vertex_highlight_id = Constant<UUID>::NaN;
92 bool m_is_editable = false;
93 bool m_is_global = false;
94 bool m_has_vertex_edit_column = false;
95 bool m_has_primitive_edit_column = false;
96 bool m_is_linework = false;
97 };
98}
#define NDEVR_API
Definition DLLInfo.h:67
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:64
Definition Pointer.hpp:303
Definition Model.h:54
Definition QTVertexManagerView.h:50
bool isEditable() const
Definition QTVertexManagerView.h:78
Buffer< DesignParameterAccumulator > m_properties
Definition QTVertexManagerView.h:89
uint04 m_num_of_decimal
Definition QTVertexManagerView.h:91
void setUseGlobalTransform(bool toggle)
Definition QTVertexManagerView.h:62
Buffer< uint04 > m_cached_indices
Definition QTVertexManagerView.h:88
DynamicPointer< QTDesignObject > m_root
Definition QTVertexManagerView.h:90
Definition UUID.h:66
Definition QTVertexManagerView.h:43
VertexTableDelegate(QObject *parent=nullptr)
Definition QTVertexManagerView.cpp:419
bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) override
Definition QTVertexManagerView.cpp:423
Definition ACIColor.h:37
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:120
Definition BaseValues.hpp:272
Definition PopupInfo.h:10