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 /**--------------------------------------------------------------------------------------------------
43 \brief A Qt compatible ItemDelegate for showing properties around a Geometry Vertex object.
44 **/
45 class VertexTableDelegate : public QItemDelegate
46 {
47 Q_OBJECT
48 public:
49 explicit VertexTableDelegate(QObject* parent = nullptr);
50 bool editorEvent(QEvent* event, QAbstractItemModel* model, const QStyleOptionViewItem& option, const QModelIndex& index) override;
51 };
52 /**--------------------------------------------------------------------------------------------------
53 \brief A Qt compatible AbstractTableModel for showing properties around a series of Geometry
54 Vertex objects.
55 **/
56 class NDEVR_API QTVertexManagerView final : public QAbstractTableModel
57 {
58 Q_OBJECT
59 public:
60 QTVertexManagerView(QObject *parent = nullptr);
61 QTVertexManagerView(const DynamicPointer<QTDesignObject>& root, QObject *parent = nullptr);
69 void setUseGlobalTransform(bool toggle) {
70 m_is_global = toggle;
71 }
72 bool isSpecialCallbackIndex(const QModelIndex& index) const;
73 void setParameters(const Buffer<DesignParameter>& params, bool enable_edit, bool enable_primitive_edit);
74 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
75 int columnCount(const QModelIndex &parent = QModelIndex()) const override;
76 bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
77 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
78 Qt::ItemFlags flags(const QModelIndex &index) const override;
79 void onClicked(const QModelIndex& index, QRect rect);
80 void onHovered(const QModelIndex& index, QRect rect);
81 void setEditable(bool editable);
82 QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
83 Model model() const;
84 void displayLineworkEditor(uint04 vertex_index, PopupInfo info);
85 bool isEditable() const { return m_is_editable; };
86 protected:
88 signals:
90 protected slots:
91 void updateSlot();
93 protected:
94 UUID m_vertex_highlight_id = Constant<UUID>::Invalid;
99 bool m_is_editable = false;
100 bool m_is_global = false;
101 bool m_has_vertex_edit_column = false;
102 bool m_has_primitive_edit_column = false;
103 bool m_is_linework = false;
104 };
105}
#define NDEVR_API
Definition DLLInfo.h:50
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:320
A core class that represents a node on model heirarchy. This node may contain a Geometry or one or mo...
Definition Model.h:58
A Qt compatible AbstractTableModel for showing properties around a series of Geometry Vertex objects.
Definition QTVertexManagerView.h:57
bool isEditable() const
Definition QTVertexManagerView.h:85
Buffer< DesignParameterAccumulator > m_properties
Definition QTVertexManagerView.h:96
QTVertexManagerView(const DynamicPointer< QTDesignObject > &root, QObject *parent=nullptr)
void displayLineworkEditor(uint04 vertex_index, PopupInfo info)
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
bool isSpecialCallbackIndex(const QModelIndex &index) const
void setTarget(const DynamicPointer< QTDesignObject > &root)
void setParameters(const Buffer< DesignParameter > &params, bool enable_edit, bool enable_primitive_edit)
int rowCount(const QModelIndex &parent=QModelIndex()) const override
void setEditable(bool editable)
Qt::ItemFlags flags(const QModelIndex &index) const override
QTVertexManagerView(QObject *parent=nullptr)
uint04 m_num_of_decimal
Definition QTVertexManagerView.h:98
void setUseGlobalTransform(bool toggle)
Definition QTVertexManagerView.h:69
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
void onHovered(const QModelIndex &index, QRect rect)
DynamicPointer< QTDesignObject > target() const
Buffer< uint04 > m_cached_indices
Definition QTVertexManagerView.h:95
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
void onClicked(const QModelIndex &index, QRect rect)
int columnCount(const QModelIndex &parent=QModelIndex()) const override
DynamicPointer< QTDesignObject > m_root
Definition QTVertexManagerView.h:97
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:60
A Qt compatible ItemDelegate for showing properties around a Geometry Vertex object.
Definition QTVertexManagerView.h:46
VertexTableDelegate(QObject *parent=nullptr)
bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) override
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:96
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
Definition BaseValues.hpp:233
Class which is used to pass arguments and requests for creating a popup dialog or widget....
Definition PopupInfo.h:15