NDEVR
API Documentation
DesignObjectWidgetInterface.h
1#pragma once
2#include <NDEVR/QTDesignObject.h>
3#include <NDEVR/Pointer.h>
4namespace NDEVR
5{
10 class NDEVR_API DesignObjectWidgetInterface
11 {
12 public:
13 DesignObjectWidgetInterface();
14 virtual ~DesignObjectWidgetInterface();
33 void setTargetID(const UUID& object);
38 void setTargetIDs(const Buffer<UUID>& objects);
48 virtual void removeTarget(const DynamicPointer<QTDesignObject>& object);
53 virtual void removeTarget(const UUID& object);
58 virtual void addTarget(const DynamicPointer<QTDesignObject>& object);
63 virtual Bounds<3, fltp08> bounds() const;
68 virtual void onTargetUpdated(UUID)
69 {}
70
85 protected:
92 };
93
96 class DesignObjectInterface : public QObject
97 {
98 Q_OBJECT
99 public:
109 virtual void removeTarget(const DynamicPointer<QTDesignObject>& object);
114 virtual void removeTarget(const UUID& object);
119 virtual void addTarget(const DynamicPointer<QTDesignObject>& object);
124 virtual Bounds<3, fltp08> bounds() const;
129 Buffer<UUID> targetIDs() const { return m_targets.keys(); }
150 protected slots:
156 {
157 m_widget_interface->onTargetUpdated(id);
158 }
159
164 protected:
168 };
169}
A specification of upper and lower bounds in N-dimensions.
Definition Bounds.hpp:54
The equivelent of std::vector but with a bit more control.
Definition Buffer.hpp:58
Base level class providing convenience functions for interfacing with one or more DesignObjects.
const Dictionary< UUID, DynamicPointer< QTDesignObject > > & targets() const
Returns a const reference to the dictionary of all targets.
virtual void removeTarget(const DynamicPointer< QTDesignObject > &object)
Removes a specific target design object and disconnects its signals.
virtual Bounds< 3, fltp08 > bounds() const
Returns the combined 3D bounding box of all target design objects.
virtual void removeTarget(const UUID &object)
Removes a specific target by UUID and disconnects its signals.
void onTargetDeletedSlot(UUID id)
Slot called when a target design object is deleted, removing it from the targets.
void setManager(QTModelManager *manager)
Sets the model manager used for UUID-based lookups.
virtual void addTarget(const DynamicPointer< QTDesignObject > &object)
Adds a design object to the set of targets and connects its signals.
QTModelManager * manager() const
Returns the current model manager.
Dictionary< UUID, DynamicPointer< QTDesignObject > > m_targets
Maps each target UUID to its design object pointer.
DesignObjectWidgetInterface * m_widget_interface
The owning widget interface that receives update callbacks.
DesignObjectInterface(DesignObjectWidgetInterface *widget_interface)
Constructs a DesignObjectInterface bound to the given widget interface.
Buffer< Model > models() const
Returns all target objects as Models.
QTModelManager * m_manager
The model manager for UUID-based lookups.
void onTargetUpdatedSlot(UUID id)
Slot called when a target design object is updated, forwarding to the widget interface.
Buffer< UUID > targetIDs() const
Returns the UUIDs of all current target design objects.
A base class for interacting with one or more DesignObjects.
DesignObjectInterface * m_interface
The internal QObject-based implementation handling signals and target storage.
void setTargetID(const UUID &object)
Sets a single target by UUID, replacing any existing targets.
virtual void removeTarget(const DynamicPointer< QTDesignObject > &object)
Removes a specific target design object.
void setTarget(const DynamicPointer< QTDesignObject > &object)
Sets a single target design object, replacing any existing targets.
void clearTargets()
Removes all target design objects from this widget.
QTModelManager * manager() const
Returns the current model manager.
virtual void addTarget(const DynamicPointer< QTDesignObject > &object)
Adds a design object to the set of targets.
void setTargets(const Buffer< DynamicPointer< QTDesignObject > > &objects)
Sets multiple target design objects, replacing any existing targets.
virtual void removeTarget(const UUID &object)
Removes a specific target by UUID.
Buffer< Model > models() const
Returns all target objects as Models.
Buffer< UUID > targetIDs() const
Returns the UUIDs of all current target design objects.
const Dictionary< UUID, DynamicPointer< QTDesignObject > > & targets() const
Returns a const reference to the dictionary of all targets.
virtual void onTargetUpdated(UUID)
Called when a target design object is updated.
void setTargetIDs(const Buffer< UUID > &objects)
Sets multiple targets by UUID, replacing any existing targets.
virtual Bounds< 3, fltp08 > bounds() const
Returns the combined 3D bounding box of all target design objects.
void setManager(QTModelManager *manager)
Sets the model manager used for UUID-based lookups.
A hash-based key-value store, useful for quick associative lookups.
Definition Dictionary.h:64
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:356
A wrapper around DesignObjectLookup that provides signal and slot functionality and adds rendering ca...
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:61
The primary namespace for the NDEVR SDK.