NDEVR
API Documentation
PrimitiveVertexEditor.h
1#pragma once
2#include <NDEVR/PointWidget.h>
3#include <NDEVR/Button.h>
4#include <NDEVR/Model.h>
5#include <NDEVR/DesignObjectLookup.h>
6#include <NDEVR/Geometry.h>
7#include <QWidget>
8#include <QVBoxLayout>
9namespace NDEVR
10{
14 class PrimitiveVertexEditor : public QWidget
15 {
16 public:
21 PrimitiveVertexEditor(QWidget* parent = nullptr);
29 void setVertex(DesignObjectLookup* lookup, Model parent, Geometry geo, uint04 vertex_index);
30 bool event(QEvent* event) override;
49 static Model SetVertexVisualModel(const Vertex<3, fltp08>& location, DesignObjectLookup* lookup, UUID id = UUID::CreateUUID("PrimitiveLineSegmentEditor"));
56 static Model HideVertexVisualModel(DesignObjectLookup* lookup, UUID id = UUID::CreateUUID("PrimitiveLineSegmentEditor"));
57 protected:
59 void init();
75 protected:
79 QVBoxLayout* m_segment_layout = new QVBoxLayout();
82 uint04 m_vertex_index = Constant<uint04>::Invalid;
83 };
84}
The equivelent of std::vector but with a bit more control.
Definition Buffer.hpp:58
A core class where all Design Objects including models, materials, and geometries are stored.
A core class within the model hierarchy containing vertex-based data (Usually 3D data) within a set c...
Definition Geometry.h:143
A core class that represents a node on model hierarchy.
Definition Model.h:292
Allows the user to input an N-dimensional point (up to 4 dimensions) with an optional unit.
Definition PointWidget.h:58
PointWidget * m_point_widget
The point widget for editing the vertex position.
Geometry m_geometry
The geometry containing the vertex.
void setVertex(DesignObjectLookup *lookup, Model parent, Geometry geo, uint04 vertex_index)
Sets the vertex to edit by specifying its geometry and index.
void init()
Initializes the UI elements and connects signals.
void updateFromVertex()
Updates the UI fields from the current vertex data.
void updateFromUI()
Writes the current UI values back to the geometry vertex.
Buffer< Vector< 2, uint04 > > findAttachedLineSegments() const
Finds all line segments attached to this vertex.
void showSegmentEditor(Vector< 2, uint04 > segment, PopupInfo info)
Shows a line segment editor for the given segment.
Buffer< Button * > m_segments_buttons
Buttons for opening editors of attached line segments.
Model setVertexVisualModel(const Vertex< 3, fltp08 > &location)
Creates or updates a visual indicator model at the vertex location.
Model m_parent
The parent model containing the geometry.
PrimitiveVertexEditor(QWidget *parent=nullptr)
Constructs a vertex editor widget.
static Model HideVertexVisualModel(DesignObjectLookup *lookup, UUID id=UUID::CreateUUID("PrimitiveLineSegmentEditor"))
Hides the visual indicator model in the given lookup.
static Model SetVertexVisualModel(const Vertex< 3, fltp08 > &location, DesignObjectLookup *lookup, UUID id=UUID::CreateUUID("PrimitiveLineSegmentEditor"))
Creates or updates a visual indicator model at the given location in the lookup.
Vertex< 3, fltp08 > location() const
Gets the current 3D location of the vertex from the UI.
uint04 m_vertex_index
The index of the vertex being edited.
DesignObjectLookup * m_lookup
The design object lookup for resolving references.
QVBoxLayout * m_segment_layout
Layout for the attached segment buttons.
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:61
static UUID CreateUUID()
A fixed-size array with N dimensions used as the basis for geometric and mathematical types.
Definition Vector.hpp:62
A point in N-dimensional space, used primarily for spatial location information.
Definition Vertex.hpp:44
The primary namespace for the NDEVR SDK.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Class which is used to pass arguments and requests for creating a popup dialog or widget.
Definition PopupInfo.h:16