NDEVR
API Documentation
PrimitiveLineSegmentEditor.h
1#pragma once
2#include <NDEVR/Model.h>
3#include <NDEVR/Geometry.h>
4#include <NDEVR/LineSegment.h>
5#include <QWidget>
6namespace Ui
7{
8 class PrimitiveLineSegmentEditorUI;
9}
10namespace NDEVR
11{
12 class Model;
17 class PrimitiveLineSegmentEditor : public QWidget
18 {
19 Q_OBJECT
20 public:
25 PrimitiveLineSegmentEditor(QWidget* parent = nullptr);
33 void setSegment(DesignObjectLookup* lookup, Model parent, Geometry geo, Vector<2, uint04> vertex_index);
56 void setPoint(uint01 index, Vertex<3, fltp08> vector);
57 bool event(QEvent* event) override;
58 protected:
60 void init();
61 signals:
63 protected:
67 Vector<2, uint04> m_vertex_index = Vector<2, uint04>(Constant<uint04>::Invalid);
68 Ui::PrimitiveLineSegmentEditorUI* ui;
69 };
70}
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
Class: LineSegment.
Definition Line.hpp:52
A core class that represents a node on model hierarchy.
Definition Model.h:292
void setPoint(uint01 index, Vertex< 3, fltp08 > vector)
Sets one of the two segment endpoints by index.
Vector< 2, uint04 > m_vertex_index
The vertex indices of the segment endpoints.
void setEndPoint(Vertex< 3, fltp08 > vector)
Sets the end point of the line segment.
LineSegment< 3, fltp08 > getSegment() const
Gets the current line segment from the UI values.
DesignObjectLookup * m_lookup
The design object lookup for resolving references.
Geometry m_geometry
The geometry containing the line segment.
void setSegment(DesignObjectLookup *lookup, Model parent, Geometry geo, Vector< 2, uint04 > vertex_index)
Sets the line segment to edit by specifying its geometry and vertex indices.
Model m_parent
The parent model containing the geometry.
Ui::PrimitiveLineSegmentEditorUI * ui
The auto-generated UI form.
PrimitiveLineSegmentEditor(QWidget *parent=nullptr)
Constructs a line segment editor widget.
void onSegmentUpdatedSignal()
Emitted when the segment is modified by the user.
void updateFromSegment()
Updates the UI fields from the current segment geometry data.
void setReferenceIndex(uint04 index)
Sets which endpoint is treated as the reference (fixed) point.
void init()
Initializes the UI elements and connects signals.
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...
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...