NDEVR
API Documentation
ManagedDesignCommand.h
1#pragma once
2#include <NDEVR/DesignCommand.h>
3#include <NDEVR/Model.h>
4#include <NDEVR/Geometry.h>
5#include <NDEVR/Material.h>
6#include <NDEVR/Pointer.h>
7#include <NDEVR/StringEnum.h>
8namespace NDEVR
9{
14
21#define NDEVR_MANAGED_COMMAND_TYPES(X) \
22 X(e_none) \
23 X(e_validate) \
24 X(e_set_geometry_property) \
25 X(e_set_material_property) \
26 X(e_set_model_property) \
27 X(e_set_model_material_mode) \
28 X(e_set_design_property) \
29 X(e_create_property) \
30 X(e_normal_expansion) \
31 X(e_set_winding_mode) \
32 X(e_center_align) \
33 X(e_smooth_laplacian) \
34 X(e_smooth_cotangent) \
35 X(e_remove_smoothing) \
36 X(e_fill_holes_by_neighbor) \
37 X(e_make_closed_solid) \
38 X(e_update_vertex) \
39 X(e_calculate_tangents) \
40 X(e_set_normal_mode) \
41 X(e_flip_normals) \
42 X(e_remove_duplicates) \
43 X(e_set_UV_mode) \
44 X(e_set_UV_color) \
45 X(e_set_UV_image) \
46 X(e_set_real_thickness) \
47 X(e_scale_object) \
48 X(e_set_UV_intensity) \
49 X(e_set_UV_property_channel) \
50 X(e_set_shader) \
51 X(e_calibrate_scan) \
52 X(e_delete_enclosed_area) \
53 X(e_explode) \
54 X(e_group) \
55 X(e_clear_all) \
56 X(e_color_by_channel) \
57 X(e_read_from_file) \
58 X(e_read_from_database) \
59 X(e_create_material) \
60 X(e_create_geometry) \
61 X(e_delete_object) \
62 X(e_set_metadata) \
63 X(e_append_data) \
64 X(e_set_active_filters) \
65 X(e_add_active_filters) \
66 X(e_slice_into_polylines) \
67 X(e_remove_filter) \
68 X(e_auto_register) \
69 X(e_place_object) \
70 X(e_select_objects) \
71 X(e_set_size)
72 NDEVR_DEFINE_STRING_STREAM(ManagedCommandType, NDEVR_MANAGED_COMMAND_TYPES);
73
85 {
86
87 public:
89 NDEVR_DESIGN_API ManagedDesignCommand();
90 protected:
95 NDEVR_DESIGN_API explicit ManagedDesignCommand(ManagedCommandType command);
101 NDEVR_DESIGN_API ManagedDesignCommand(ManagedCommandType command, const String& params);
102
108 template<class t_arg_type>
109 ManagedDesignCommand(ManagedCommandType command, const t_arg_type& param_a)
110 : command_type(command)
111 {
112 setParams(String(param_a));
113 }
114
120 template<class t_arg_type_a, class t_arg_type_b>
121 ManagedDesignCommand(ManagedCommandType command, const t_arg_type_a& param_a, const t_arg_type_b& param_b)
122 : command_type(command)
123 {
124 setParams(String(param_a) + "|" + String(param_b));
125 }
126
133 template<class t_arg_type_a, class t_arg_type_b, class t_arg_type_c>
134 ManagedDesignCommand(ManagedCommandType command, const t_arg_type_a& param_a, const t_arg_type_b& param_b, const t_arg_type_c& param_c)
135 : command_type(command)
136 {
137 setParams(String(param_a) + "|" + String(param_b) + "|" + String(param_c));
138 }
139
147 template<class t_arg_type_a, class t_arg_type_b, class t_arg_type_c, class t_arg_type_d>
148 ManagedDesignCommand(ManagedCommandType command, const t_arg_type_a& param_a, const t_arg_type_b& param_b, const t_arg_type_c& param_c, const t_arg_type_d& param_d)
149 : command_type(command)
150 {
151 setParams(String(param_a) + "|" + String(param_b) + "|" + String(param_c) + "|" + String(param_d));
152 }
153 public:
158 NDEVR_DESIGN_API bool isAsyncExecution() const override;
164 {
166 }
167
172 {
174 }
175
179 const Buffer<String>& params() const
180 {
181 return m_command_params;
182 }
183
188 const Buffer<String>& undoParams(const UUID& uuid) const
189 {
190 auto iter = m_undo_params.find(uuid);
191 if (iter == m_undo_params.end())
192 {
193 static Buffer<String> empty;
194 return empty;
195 }
196 return iter.value();
197 }
198
203 {
204 return m_undo_params;
205 }
206
214
219 template<class t_arg_type>
220 void setUndoParams(const UUID& uuid, const t_arg_type& params)
221 {
222 m_undo_params[uuid] = { String(params) };
223 }
224
230 template<class t_arg_type_a, class t_arg_type_b>
231 void setUndoParams(const UUID& uuid, const t_arg_type_a& param_a, const t_arg_type_b& param_b)
232 {
233 m_undo_params[uuid] = {String(param_a), String(param_b)};
234 }
235
242 template<class t_arg_type_a, class t_arg_type_b, class t_arg_type_c>
243 void setUndoParams(const UUID& uuid, const t_arg_type_a& param_a, const t_arg_type_b& param_b, const t_arg_type_c& param_c)
244 {
245 m_undo_params[uuid] = { String(param_a), String(param_b), String(param_c) };
246 }
247
252 bool hasUndo(const UUID& uuid) const
253 {
254 return m_undo_params.hasKey(uuid);
255 }
256
260 NDEVR_DESIGN_API void execute(DesignObjectLookup* lookup) override;
266 NDEVR_DESIGN_API bool canGroupWith(const DynamicPointer<DesignCommand>& command) override;
272 NDEVR_DESIGN_API bool canCombineWith(const DynamicPointer<DesignCommand>& command) override;
277 NDEVR_DESIGN_API void combineWith(const DynamicPointer<DesignCommand>& command) override;
282 void removeUndo(const UUID& uuid)
283 {
284 m_undo_params.erase(uuid);
285 }
286
293 {
294 return new ManagedDesignCommand(ManagedCommandType::e_place_object, transform);
295 }
296
302 template<class t_type>
303 static DynamicPointer<ManagedDesignCommand> set(NDPG geo_property, const t_type& value)
304 {
305 return new ManagedDesignCommand(ManagedCommandType::e_set_geometry_property, geo_property, value);
306 }
307
313 template<class t_type>
314 static DynamicPointer<ManagedDesignCommand> SetMaterialProperty(NDPM mat_property, const t_type& value)
315 {
316 return new ManagedDesignCommand(ManagedCommandType::e_set_material_property, mat_property, value);
317 }
318
324 template<class t_type>
325 static DynamicPointer<ManagedDesignCommand> set(NDPN mod_property, const t_type& value)
326 {
327 return new ManagedDesignCommand(ManagedCommandType::e_set_model_property, mod_property, value);
328 }
329
335 {
336 return new ManagedDesignCommand(ManagedCommandType::e_set_model_material_mode, mode);
337 }
338
344 template<class t_type>
345 static DynamicPointer<ManagedDesignCommand> SetProperty(NDPO design_property, const t_type& value)
346 {
347 return new ManagedDesignCommand(ManagedCommandType::e_set_design_property, design_property, value);
348 }
349
354 {
355 return new ManagedDesignCommand(ManagedCommandType::e_delete_object);
356 }
357
363 {
364 return new ManagedDesignCommand(ManagedCommandType::e_create_geometry, name);
365 }
366
372 {
373 return new ManagedDesignCommand(ManagedCommandType::e_set_size, size);
374 }
375
381 {
382 return new ManagedDesignCommand(ManagedCommandType::e_create_material, name);
383 }
384
389 {
390 return new ManagedDesignCommand(ManagedCommandType::e_validate);
391 }
392
398 {
399 return new ManagedDesignCommand(ManagedCommandType::e_scale_object, Vector<3, fltp08>(scale));
400 }
401
407 {
408 return new ManagedDesignCommand(ManagedCommandType::e_scale_object, scale);
409 }
410
417 {
418 return new ManagedDesignCommand(ManagedCommandType::e_scale_object, Vector<3, fltp08>(scale), scale_center);
419 }
420
427 {
428 return new ManagedDesignCommand(ManagedCommandType::e_scale_object, scale, scale_center);
429 }
430
436 {
437 return new ManagedDesignCommand(ManagedCommandType::e_set_real_thickness, real_thickness);
438 }
439
445 {
446 return new ManagedDesignCommand(ManagedCommandType::e_smooth_laplacian, number_of_iterations);
447 }
448
454 {
455 return new ManagedDesignCommand(ManagedCommandType::e_smooth_cotangent, number_of_iterations);
456 }
457
464 static DynamicPointer<ManagedDesignCommand> SmoothLaplacianCommand(uint04 number_of_iterations, fltp08 shrink_rate, fltp08 grow_rate)
465 {
466 return new ManagedDesignCommand(ManagedCommandType::e_smooth_laplacian, number_of_iterations, shrink_rate, grow_rate);
467 }
468
475 static DynamicPointer<ManagedDesignCommand> SmoothCotangentCommand(uint04 number_of_iterations, fltp08 shrink_rate, fltp08 grow_rate)
476 {
477 return new ManagedDesignCommand(ManagedCommandType::e_smooth_cotangent, number_of_iterations, shrink_rate, grow_rate);
478 }
479
486 template<class t_type>
487 static DynamicPointer<ManagedDesignCommand> UpdateVertex(VertexProperty property, uint04 vertex_id, const t_type& new_location)
488 {
489 return new ManagedDesignCommand(ManagedCommandType::e_update_vertex, property, vertex_id, new_location);
490 }
491
496 {
497 return new ManagedDesignCommand(ManagedCommandType::e_remove_smoothing);
498 }
499
504 {
505 return new ManagedDesignCommand(ManagedCommandType::e_remove_duplicates);
506 }
507
512 {
513 return new ManagedDesignCommand(ManagedCommandType::e_delete_enclosed_area);
514 }
515
522 {
523 return new ManagedDesignCommand(ManagedCommandType::e_set_UV_mode, uv_type, uv_mode);
524 }
525
531 {
532 return new ManagedDesignCommand(ManagedCommandType::e_set_UV_color, uv_color);
533 }
534
541 {
542 return new ManagedDesignCommand(ManagedCommandType::e_set_UV_color, uv_type, uv_color);
543 }
544
551 {
552 return new ManagedDesignCommand(ManagedCommandType::e_set_UV_image, uv_type, uv_image);
553 }
554
559 {
560 return new ManagedDesignCommand(ManagedCommandType::e_fill_holes_by_neighbor);
561 }
562
567 {
568 return new ManagedDesignCommand(ManagedCommandType::e_explode);
569 }
570
576 {
577 return new ManagedDesignCommand(ManagedCommandType::e_group, model_name);
578 }
579
586 {
587 return new ManagedDesignCommand(ManagedCommandType::e_set_UV_intensity, uv_type, uv_intensity);
588 }
589
596 {
597 return new ManagedDesignCommand(ManagedCommandType::e_set_UV_property_channel, uv_type, uv_channel);
598 }
599
605 {
606 return new ManagedDesignCommand(ManagedCommandType::e_color_by_channel, vertex_channel);
607 }
608
614 {
615 return new ManagedDesignCommand(ManagedCommandType::e_set_winding_mode, mode);
616 }
617
623 {
624 return new ManagedDesignCommand(ManagedCommandType::e_make_closed_solid, is_closed_solid);
625 }
626
632 {
633 return new ManagedDesignCommand(ManagedCommandType::e_set_normal_mode, mode);
634 }
635
641 {
642 return new ManagedDesignCommand(ManagedCommandType::e_set_active_filters, filters);
643 }
644
650 {
651 return new ManagedDesignCommand(ManagedCommandType::e_add_active_filters, filters);
652 }
653
660 static DynamicPointer<ManagedDesignCommand> AutoRegister(const String& filters, const UUID& reference)
661 {
662 return new ManagedDesignCommand(ManagedCommandType::e_auto_register, reference, filters);
663 }
664
670 {
671 return new ManagedDesignCommand(ManagedCommandType::e_remove_filter, index);
672 }
673
680 {
681 return new ManagedDesignCommand(ManagedCommandType::e_set_normal_mode, mode, smooth_angle);
682 }
683
689 static DynamicPointer<ManagedDesignCommand> CalibrateScan(bool calibrate_yaw, InterpolationValues value = InterpolationValues::e_linear)
690 {
691 return new ManagedDesignCommand(ManagedCommandType::e_calibrate_scan, calibrate_yaw, value);
692 }
693
700 static DynamicPointer<ManagedDesignCommand> CalibrateScan(Angle<fltp08> angle, bool calibrate_yaw, InterpolationValues value = InterpolationValues::e_linear)
701 {
702 return new ManagedDesignCommand(ManagedCommandType::e_calibrate_scan, angle, calibrate_yaw, value);
703 }
704
710 static DynamicPointer<ManagedDesignCommand> CalculateTangents(bool calc_tangent, bool calc_bitangent)
711 {
712 return new ManagedDesignCommand(ManagedCommandType::e_calculate_tangents, calc_tangent, calc_bitangent);
713 }
714
721 {
722 return new ManagedDesignCommand(ManagedCommandType::e_slice_into_polylines, transform, spacing);
723 }
724
730 {
731 ManagedDesignCommand* command = new ManagedDesignCommand(ManagedCommandType::e_select_objects, add_to_selection);
732 command->can_undo = false;
733 command->update_project_modified = false;
734 return command;
735 }
736
741 {
742 return new ManagedDesignCommand(ManagedCommandType::e_flip_normals);
743 }
744
752 {
753 return new ManagedDesignCommand(ManagedCommandType::e_append_data, info);
754 }
755
762 {
763 return new ManagedDesignCommand(ManagedCommandType::e_set_metadata, label, value);
764 }
765
770 {
771 return new ManagedDesignCommand(ManagedCommandType::e_clear_all);
772 }
773
778 {
779 return new ManagedDesignCommand(ManagedCommandType::e_center_align);
780 }
781
788 {
790 if (targets.size() > 0)
791 {
792 name.add('[');
793 for (const UUID& target_id : targets)
794 {
795 name += String(target_id) + ",";
796 }
797 name.last() = ']';
798 }
799 else
800 {
801 name.append("[]");
802 }
803 if (params().size() > 0)
804 {
805 name.add('(');
806 for (const String& param : params())
807 {
808 name += String(param) + "|";
809 }
810 name.last() = ')';
811 }
812 else
813 {
814 name.append("()");
815 }
816 return name;
817 }
818
823 virtual bool addTarget(UUID target_id) override { targets.add(target_id); return true; }
828 NDEVR_DESIGN_API virtual TranslatedString name() const override;
833 NDEVR_DESIGN_API virtual StringView icon() const override;
838 NDEVR_DESIGN_API void deleteEnclosedSelection(DesignObjectLookup* lookup);
839 public:
840 ManagedCommandType command_type;
844 };
845 NDEVR_DESIGN_T_API template class NDEVR_DESIGN_API StringStream<ManagedCommandType>;
846}
Stores an angle in an optimized internal format with support for efficient trigonometric operations.
Definition Angle.h:83
The equivelent of std::vector but with a bit more control.
Definition Buffer.hpp:58
bool update_project_modified
Whether executing this command should mark the project as modified.
DesignCommand()
Default constructor.
bool can_undo
Whether this command supports being undone.
A core class where all Design Objects including models, materials, and geometries are stored.
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
String toString() const
Produces a human-readable string representation of this command including its targets and parameters.
static DynamicPointer< ManagedDesignCommand > SmoothLaplacianCommand(uint04 number_of_iterations, fltp08 shrink_rate, fltp08 grow_rate)
Creates a Laplacian smoothing command with shrink and grow rates for Taubin-style smoothing.
static DynamicPointer< ManagedDesignCommand > SetWindingMode(WindingMode mode)
Creates a command to set the polygon winding mode on target geometry.
static DynamicPointer< ManagedDesignCommand > SetSize(const Vector< 3, fltp08 > &size)
Creates a command to set the size of a design object.
virtual TranslatedString name() const override
Gets the human-readable translated name of this command based on its command_type.
ManagedDesignCommand(ManagedCommandType command, const t_arg_type &param_a)
Constructs a managed command with a single typed parameter.
virtual StringView icon() const override
Gets the icon identifier for this command based on its command_type.
bool canCombineWith(const DynamicPointer< DesignCommand > &command) override
Checks whether this command can be combined with another into a single operation.
Dictionary< UUID, Buffer< String > > m_undo_params
Per-target undo parameters keyed by UUID, used to restore previous state.
bool isAsyncExecution() const override
Whether this command should be executed asynchronously.
void setParams(const String &params)
Sets the command parameters by splitting a pipe-delimited string.
static DynamicPointer< ManagedDesignCommand > RemoveSmoothingCommand()
Creates a command to remove any applied smoothing from the target geometry.
void setUndoParams(const UUID &uuid, const t_arg_type_a &param_a, const t_arg_type_b &param_b)
Stores two undo parameters for a specific target object.
ManagedDesignCommand(ManagedCommandType command, const String &params)
Constructs a managed command of the given type with pipe-delimited parameter string.
static DynamicPointer< ManagedDesignCommand > SetUVPropertyChannel(UVType uv_type, String uv_channel)
Creates a command to set the UV property channel for a specific UV type.
static DynamicPointer< ManagedDesignCommand > ScaleObject(const Vector< 3, fltp08 > &scale, const Vector< 3, fltp08 > &scale_center)
Creates a command to scale an object by per-axis factors about a specified center point.
static DynamicPointer< ManagedDesignCommand > CreateMaterial(const StringView &name=StringView())
Creates a command to create a new material object.
static DynamicPointer< ManagedDesignCommand > AddActiveFilters(const String &filters)
Creates a command to append additional filters to the active filter set.
static DynamicPointer< ManagedDesignCommand > SetProperty(NDPO design_property, const t_type &value)
Creates a command to set a design-level property to the given value.
bool hasUndo(const UUID &uuid) const
Checks whether undo parameters exist for a given target object.
static DynamicPointer< ManagedDesignCommand > SetModelMaterialMode(Model::MaterialMode mode)
Creates a command to set the material mode on a model.
static DynamicPointer< ManagedDesignCommand > SelectObjects(bool add_to_selection)
Creates a non-undoable command to select target objects in the design.
static DynamicPointer< ManagedDesignCommand > MakeClosedSolid(bool is_closed_solid)
Creates a command to mark geometry as a closed solid or open surface.
virtual bool addTarget(UUID target_id) override
Adds a target object UUID to this command.
static DynamicPointer< ManagedDesignCommand > FillHolesByNeighbor()
Creates a command to fill mesh holes by extrapolating from neighboring geometry.
Buffer< String > m_command_params
The serialized string parameters for this command.
static DynamicPointer< ManagedDesignCommand > SmoothCotangentCommand(uint04 number_of_iterations, fltp08 shrink_rate, fltp08 grow_rate)
Creates a cotangent-weighted smoothing command with shrink and grow rates for Taubin-style smoothing.
static DynamicPointer< ManagedDesignCommand > SendInfo(const String &info)
Creates a command to append data or informational content to the target.
static DynamicPointer< ManagedDesignCommand > Delete()
Creates a command to delete target design objects.
Dictionary< UUID, Buffer< String > > undoParams()
Gets a copy of the entire undo parameter dictionary.
static DynamicPointer< ManagedDesignCommand > SetUVMode(UVType uv_type, Material::UVMode uv_mode)
Creates a command to set the UV mapping mode for a given UV type.
void execute(DesignObjectLookup *lookup) override
Executes this managed command against the given DesignObjectLookup.
static DynamicPointer< ManagedDesignCommand > SetMetadata(const String &label, const String &value)
Creates a command to set a metadata key-value pair on target objects.
ManagedDesignCommand(ManagedCommandType command, const t_arg_type_a &param_a, const t_arg_type_b &param_b, const t_arg_type_c &param_c, const t_arg_type_d &param_d)
Constructs a managed command with four typed parameters, pipe-delimited.
static DynamicPointer< ManagedDesignCommand > UpdateVertex(VertexProperty property, uint04 vertex_id, const t_type &new_location)
Creates a command to update a single vertex property value.
ManagedDesignCommand()
Default constructor.
const Buffer< String > & params() const
Gets the command parameters.
void deleteEnclosedSelection(DesignObjectLookup *lookup)
Deletes geometry within an enclosed selection region from the given lookup.
void setParams(const Buffer< String > &params)
Sets the command parameters from a buffer of strings.
static DynamicPointer< ManagedDesignCommand > DeleteEnclosedArea()
Creates a command to delete geometry enclosed within a selection area.
static DynamicPointer< ManagedDesignCommand > SetUVImage(UVType uv_type, const String &uv_image)
Creates a command to set the UV texture image for a specific UV type.
static DynamicPointer< ManagedDesignCommand > ScaleObject(const fltp08 &scale)
Creates a command to uniformly scale an object by a single factor.
static DynamicPointer< ManagedDesignCommand > Explode()
Creates a command to explode grouped objects into individual children.
ManagedCommandType command_type
The type of managed operation this command represents.
static DynamicPointer< ManagedDesignCommand > CalculateTangents(bool calc_tangent, bool calc_bitangent)
Creates a command to compute tangent and/or bitangent vectors for target geometry.
void setUndoParams(const UUID &uuid, const t_arg_type &params)
Stores a single undo parameter for a specific target object.
static DynamicPointer< ManagedDesignCommand > SetActiveFilters(const String &filters)
Creates a command to replace the active filter set on target objects.
static DynamicPointer< ManagedDesignCommand > FlipNormals()
Creates a command to flip (reverse) the normals on target geometry.
static DynamicPointer< ManagedDesignCommand > PlaceObject(const Matrix< fltp08 > &transform)
Creates a command to place an object using the given transformation matrix.
static DynamicPointer< ManagedDesignCommand > ClearAll()
Creates a command to clear all design objects from the lookup.
static DynamicPointer< ManagedDesignCommand > SetNormalMode(NormalMode mode, Angle< fltp08 > smooth_angle)
Creates a command to set the normal mode with a smooth angle threshold.
static DynamicPointer< ManagedDesignCommand > SetNormalMode(NormalMode mode)
Creates a command to set the normal computation mode on target geometry.
static DynamicPointer< ManagedDesignCommand > ValidateCommand()
Creates a command that validates the target design objects.
static DynamicPointer< ManagedDesignCommand > CalibrateScan(Angle< fltp08 > angle, bool calibrate_yaw, InterpolationValues value=InterpolationValues::e_linear)
Creates a command to calibrate scan data with an explicit angle and yaw correction.
static DynamicPointer< ManagedDesignCommand > ScaleObject(const fltp08 &scale, const Vector< 3, fltp08 > &scale_center)
Creates a command to uniformly scale an object about a specified center point.
void setUndoParams(const UUID &uuid, const t_arg_type_a &param_a, const t_arg_type_b &param_b, const t_arg_type_c &param_c)
Stores three undo parameters for a specific target object.
static DynamicPointer< ManagedDesignCommand > SetUVIntensity(UVType uv_type, fltp08 uv_intensity)
Creates a command to set the UV intensity for a specific UV type.
static DynamicPointer< ManagedDesignCommand > CenterAlign()
Creates a command to center-align the target objects at the origin.
static DynamicPointer< ManagedDesignCommand > RemoveDuplicateVertices()
Creates a command to remove duplicate vertices from the target geometry.
const Buffer< String > & undoParams(const UUID &uuid) const
Gets the undo parameters stored for a specific target object.
static DynamicPointer< ManagedDesignCommand > CreateGeometry(const StringView &name=StringView())
Creates a command to create a new geometry object.
static DynamicPointer< ManagedDesignCommand > AutoRegister(const String &filters, const UUID &reference)
Creates a command to automatically register objects using a filter and reference.
static DynamicPointer< ManagedDesignCommand > ScaleObject(const Vector< 3, fltp08 > &scale)
Creates a command to scale an object by per-axis scale factors.
static DynamicPointer< ManagedDesignCommand > ColorByChannel(String vertex_channel)
Creates a command to colorize geometry vertices based on a named data channel.
static DynamicPointer< ManagedDesignCommand > SmoothCotangentCommand(uint04 number_of_iterations)
Creates a cotangent-weighted smoothing command with the given iteration count.
bool canGroupWith(const DynamicPointer< DesignCommand > &command) override
Checks whether this command can be grouped with another for batch execution.
static DynamicPointer< ManagedDesignCommand > SetUVColor(const RGBColor &uv_color)
Creates a command to set the UV color using the default UV type.
static DynamicPointer< ManagedDesignCommand > SetMaterialProperty(NDPM mat_property, const t_type &value)
Creates a command to set a material property to the given value.
void removeUndo(const UUID &uuid)
Removes the stored undo parameters for a specific target object.
static DynamicPointer< ManagedDesignCommand > SmoothLaplacianCommand(uint04 number_of_iterations)
Creates a Laplacian smoothing command with the given iteration count.
static DynamicPointer< ManagedDesignCommand > set(NDPG geo_property, const t_type &value)
Creates a command to set a geometry property to the given value.
ManagedDesignCommand(ManagedCommandType command)
Constructs a managed command of the given type with no parameters.
static DynamicPointer< ManagedDesignCommand > set(NDPN mod_property, const t_type &value)
Creates a command to set a model property to the given value.
ManagedDesignCommand(ManagedCommandType command, const t_arg_type_a &param_a, const t_arg_type_b &param_b)
Constructs a managed command with two typed parameters, pipe-delimited.
const Dictionary< UUID, Buffer< String > > & undoParams() const
Gets the entire undo parameter dictionary (const).
static DynamicPointer< ManagedDesignCommand > SetUVColor(UVType uv_type, const RGBColor &uv_color)
Creates a command to set the UV color for a specific UV type.
static DynamicPointer< ManagedDesignCommand > CalibrateScan(bool calibrate_yaw, InterpolationValues value=InterpolationValues::e_linear)
Creates a command to calibrate scan data with optional yaw correction.
Buffer< UUID > targets
The UUIDs of design objects this command will operate on.
static DynamicPointer< ManagedDesignCommand > SetRealThickness(fltp08 real_thickness)
Creates a command to set the real-world thickness of a geometry.
void combineWith(const DynamicPointer< DesignCommand > &command) override
Combines this command with another compatible command, merging their operations.
static DynamicPointer< ManagedDesignCommand > RemoveActiveFilter(const uint04 &index)
Creates a command to remove an active filter by its index.
static DynamicPointer< ManagedDesignCommand > SliceIntoPolylines(const Matrix< fltp08 > &transform, const Vector< 3, fltp08 > &spacing)
Creates a command to slice geometry into polylines along planes defined by a transform and spacing.
ManagedDesignCommand(ManagedCommandType command, const t_arg_type_a &param_a, const t_arg_type_b &param_b, const t_arg_type_c &param_c)
Constructs a managed command with three typed parameters, pipe-delimited.
static DynamicPointer< ManagedDesignCommand > Group(const String &model_name=String())
Creates a command to group the target objects under a new parent model.
UVMode
Defines UV mapping modes that control how texture colors are determined for surfaces.
Definition Material.h:185
Templated logic for doing matrix multiplication.
Definition Matrix.hpp:182
MaterialMode
Determines how a model resolves its material for rendering.
Definition Model.h:298
Represents a color in the RGB space with optional alpha transparency.
Definition RGBColor.h:57
Logic for reading or writing to a string or a user friendly, TranslatedString.
The core String View class for the NDEVR API.
Definition StringView.h:58
static StringViewBuffer Convert(const StringBuffer &strings)
Converts a StringBuffer into a StringViewBuffer.
The core String class for the NDEVR API.
Definition String.h:95
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
String englishTranslation() const
Returns the English translation of this string.
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:61
A fixed-size array with N dimensions used as the basis for geometric and mathematical types.
Definition Vector.hpp:62
The primary namespace for the NDEVR SDK.
NormalMode
Describes how surface normals are computed or stored for a Geometry object.
NDPM
NDPM - NDEVR Design Property Material: Values stored in the material database.
Definition Material.h:53
NDPN
NDPN - NDEVR Design Property Node: Values stored in the model database.
Definition Model.h:57
VertexProperty
Per-vertex data channels that can be stored in the vertex table to be used by Geometry.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
double fltp08
Defines an alias representing an 8 byte floating-point number.
InterpolationValues
Values that represent interpolation functions.
NDPO
NDPO - NDEVR Design Property Object: Values stored in the property database.
@ transform
A 4x4 transform matrix that maps local coordinates into global space.
WindingMode
Describes the vertex winding order used to determine front-facing direction of polygons.
UVType
Channels that describe how an object should interact with light.
NDPG
Forward declaration for Geometry design object.
Definition Geometry.h:56
@ is_closed_solid
Whether the geometry forms a closed solid (watertight mesh).
Definition Geometry.h:72