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>
17 , e_set_geometry_property
18 , e_set_material_property
19 , e_set_model_property
20 , e_set_model_material_mode
21 , e_set_design_property
29 , e_fill_holes_by_neighbor
32 , e_calculate_tangents
39 , e_set_real_thickness
42 , e_set_UV_property_channel
45 , e_delete_enclosed_area
51 , e_read_from_database
57 , e_set_active_filters
58 , e_add_active_filters
59 , e_slice_into_polylines
70 template<
class t_arg_type>
72 : command_type(command)
74 setParams(
String(param_a));
76 template<
class t_arg_type_a,
class t_arg_type_b>
78 : command_type(command)
82 template<
class t_arg_type_a,
class t_arg_type_b,
class t_arg_type_c>
84 : command_type(command)
88 template<
class t_arg_type_a,
class t_arg_type_b,
class t_arg_type_c,
class t_arg_type_d>
90 : command_type(command)
95 bool isAsyncExecution()
const override;
98 m_command_params = params;
106 return m_command_params;
110 auto iter = m_undo_params.find(uuid);
111 if (iter == m_undo_params.end())
120 return m_undo_params;
124 return m_undo_params;
126 template<
class t_arg_type>
129 if(!m_undo_params.hasKey(uuid))
130 m_undo_params.insert({ uuid, {
String(params)} });
132 template<
class t_arg_type_a,
class t_arg_type_b>
135 if (!m_undo_params.hasKey(uuid))
136 m_undo_params.insert({ uuid, {
String(param_a),
String(param_b)} });
138 template<
class t_arg_type_a,
class t_arg_type_b,
class t_arg_type_c>
139 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)
141 if (!m_undo_params.hasKey(uuid))
139 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) {
…}
146 return m_undo_params.hasKey(uuid);
154 m_undo_params.erase(uuid);
166 template<
class t_type>
171 template<
class t_type>
176 template<
class t_type>
185 template<
class t_type>
236 return new ManagedDesignCommand(e_smooth_laplacian, number_of_iterations, shrink_rate, grow_rate);
240 return new ManagedDesignCommand(e_smooth_cotangent, number_of_iterations, shrink_rate, grow_rate);
242 template<
class t_type>
365 String name = this->name().translation(
"en_US");
366 if (targets.size() > 0)
369 for (
const UUID& target_id : targets)
371 name +=
String(target_id) +
",";
379 if (params().size() > 0)
382 for (
const String& param : params())
384 name +=
String(param) +
"|";
395 virtual String icon()
const override;
Stores an angle in an optimized format.
Definition StringStream.h:352
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:64
void add(t_type &&object)
Definition Buffer.hpp:199
decltype(auto) last()
Definition Buffer.hpp:977
Definition DesignCommand.h:46
DesignProperty
Definition DesignObject.h:94
Definition DesignObjectLookup.h:61
Definition Dictionary.h:48
Definition Pointer.hpp:303
GeometryProperty
Definition Geometry.h:99
Definition ManagedDesignCommand.h:10
static DynamicPointer< DesignCommand > SetUVColor(const RGBColor &uv_color)
Definition ManagedDesignCommand.h:263
static DynamicPointer< DesignCommand > Explode()
Definition ManagedDesignCommand.h:279
const Dictionary< UUID, Buffer< String > > & undoParams() const
Definition ManagedDesignCommand.h:118
static DynamicPointer< DesignCommand > CalculateTangents(bool calc_tangent, bool calc_bitangent)
Definition ManagedDesignCommand.h:339
static DynamicPointer< DesignCommand > SetUVImage(UVType uv_type, const String &uv_image)
Definition ManagedDesignCommand.h:271
static DynamicPointer< DesignCommand > ScaleObject(const fltp08 &scale)
Definition ManagedDesignCommand.h:206
static DynamicPointer< DesignCommand > SetMaterialProperty(Material::MaterialProperties mat_property, const t_type &value)
Definition ManagedDesignCommand.h:172
static DynamicPointer< DesignCommand > SetMetadata(const String &label, const String &value)
Definition ManagedDesignCommand.h:355
static DynamicPointer< DesignCommand > ValidateCommand()
Definition ManagedDesignCommand.h:202
Buffer< String > m_command_params
Definition ManagedDesignCommand.h:398
CommandType
Definition ManagedDesignCommand.h:13
static DynamicPointer< DesignCommand > SmoothCotangentCommand(uint04 number_of_iterations)
Definition ManagedDesignCommand.h:230
static DynamicPointer< DesignCommand > SetWindingMode(WindingMode mode)
Definition ManagedDesignCommand.h:299
String toString() const
Definition ManagedDesignCommand.h:363
static DynamicPointer< DesignCommand > RemoveSmoothingCommand()
Definition ManagedDesignCommand.h:247
CommandType command_type
Definition ManagedDesignCommand.h:397
static DynamicPointer< DesignCommand > ClearAll()
Definition ManagedDesignCommand.h:359
static DynamicPointer< DesignCommand > SetProperty(DesignObject::DesignProperty design_property, const t_type &value)
Definition ManagedDesignCommand.h:186
static DynamicPointer< DesignCommand > SliceIntoPolylines(const Matrix< fltp08 > &transform, const Vector< 3, fltp08 > &spacing)
Definition ManagedDesignCommand.h:343
static DynamicPointer< DesignCommand > UpdateVertex(VertexProperty property, uint04 vertex_id, const t_type &new_location)
Definition ManagedDesignCommand.h:243
bool hasUndo(const UUID &uuid) const
Definition ManagedDesignCommand.h:144
static DynamicPointer< DesignCommand > SetUVIntensity(UVType uv_type, fltp08 uv_intensity)
Definition ManagedDesignCommand.h:287
static DynamicPointer< DesignCommand > ScaleObject(const Vector< 3, fltp08 > &scale)
Definition ManagedDesignCommand.h:210
static DynamicPointer< DesignCommand > SetNormalMode(NormalMode mode, Angle< fltp08 > smooth_angle)
Definition ManagedDesignCommand.h:327
static DynamicPointer< DesignCommand > SetUVPropertyChannel(UVType uv_type, String uv_channel)
Definition ManagedDesignCommand.h:291
static DynamicPointer< DesignCommand > SetRealThickness(fltp08 real_thickness)
Definition ManagedDesignCommand.h:222
static DynamicPointer< DesignCommand > SetModelProperty(Model::ModelProperty mod_property, const t_type &value)
Definition ManagedDesignCommand.h:177
static DynamicPointer< DesignCommand > Delete()
Definition ManagedDesignCommand.h:190
void setUndoParams(const UUID &uuid, const t_arg_type ¶ms)
Definition ManagedDesignCommand.h:127
static DynamicPointer< DesignCommand > MakeClosedSolid(bool is_closed_solid)
Definition ManagedDesignCommand.h:303
static DynamicPointer< DesignCommand > ScaleObject(const fltp08 &scale, const Vector< 3, fltp08 > &scale_center)
Definition ManagedDesignCommand.h:214
static DynamicPointer< DesignCommand > SetModelMaterialMode(PrimitiveProperty property, Model::MaterialMode mode)
Definition ManagedDesignCommand.h:181
static DynamicPointer< DesignCommand > CreateGeometry(const String &name="")
Definition ManagedDesignCommand.h:194
static DynamicPointer< DesignCommand > PlaceObject(const Matrix< fltp08 > &transform)
Definition ManagedDesignCommand.h:158
const Buffer< String > & params() const
Definition ManagedDesignCommand.h:104
static DynamicPointer< DesignCommand > SetNormalMode(NormalMode mode)
Definition ManagedDesignCommand.h:307
static DynamicPointer< DesignCommand > RemoveDuplicateVertices()
Definition ManagedDesignCommand.h:251
static DynamicPointer< DesignCommand > SmoothCotangentCommand(uint04 number_of_iterations, fltp08 shrink_rate, fltp08 grow_rate)
Definition ManagedDesignCommand.h:238
ManagedDesignCommand(CommandType command, const t_arg_type ¶m_a)
Definition ManagedDesignCommand.h:71
static DynamicPointer< DesignCommand > SmoothLaplacianCommand(uint04 number_of_iterations)
Definition ManagedDesignCommand.h:226
static DynamicPointer< DesignCommand > SendInfo(const String &info)
Definition ManagedDesignCommand.h:351
static DynamicPointer< DesignCommand > SetTransform(const Matrix< fltp08 > &transform)
Definition ManagedDesignCommand.h:162
static DynamicPointer< DesignCommand > Group(const String &model_name=String())
Definition ManagedDesignCommand.h:283
static DynamicPointer< DesignCommand > SetUVColor(UVType uv_type, const RGBColor &uv_color)
Definition ManagedDesignCommand.h:267
static DynamicPointer< DesignCommand > SetActiveFilters(const String &filters)
Definition ManagedDesignCommand.h:311
const Buffer< String > & undoParams(const UUID &uuid) const
Definition ManagedDesignCommand.h:108
void setUndoParams(const UUID &uuid, const t_arg_type_a ¶m_a, const t_arg_type_b ¶m_b)
Definition ManagedDesignCommand.h:133
static DynamicPointer< DesignCommand > AutoRegister(const String &filters, const UUID &reference)
Definition ManagedDesignCommand.h:319
static DynamicPointer< DesignCommand > SetUVMode(UVType uv_type, Material::UVMode uv_mode)
Definition ManagedDesignCommand.h:259
void setParams(const String ¶ms)
Definition ManagedDesignCommand.h:100
static DynamicPointer< DesignCommand > RemoveActiveFilter(const uint04 &index)
Definition ManagedDesignCommand.h:323
static DynamicPointer< DesignCommand > FillHolesByNeighbor()
Definition ManagedDesignCommand.h:275
static DynamicPointer< DesignCommand > CalibrateScan(bool calibrate_yaw, InterpolationValues value=InterpolationValues::e_linear)
Definition ManagedDesignCommand.h:331
Dictionary< UUID, Buffer< String > > m_undo_params
Definition ManagedDesignCommand.h:399
static DynamicPointer< DesignCommand > SetGeometryProperty(Geometry::GeometryProperty geo_property, const t_type &value)
Definition ManagedDesignCommand.h:167
static DynamicPointer< DesignCommand > FlipNormals()
Definition ManagedDesignCommand.h:347
static DynamicPointer< DesignCommand > ColorByChannel(String vertex_channel)
Definition ManagedDesignCommand.h:295
ManagedDesignCommand(CommandType command, const t_arg_type_a ¶m_a, const t_arg_type_b ¶m_b, const t_arg_type_c ¶m_c)
Definition ManagedDesignCommand.h:83
static DynamicPointer< DesignCommand > CreateMaterial(const String &name="")
Definition ManagedDesignCommand.h:198
ManagedDesignCommand(CommandType command, const t_arg_type_a ¶m_a, const t_arg_type_b ¶m_b, const t_arg_type_c ¶m_c, const t_arg_type_d ¶m_d)
Definition ManagedDesignCommand.h:89
static DynamicPointer< DesignCommand > AddActiveFilters(const String &filters)
Definition ManagedDesignCommand.h:315
static DynamicPointer< DesignCommand > DeleteEnclosedArea()
Definition ManagedDesignCommand.h:255
static DynamicPointer< DesignCommand > CalibrateScan(Angle< fltp08 > angle, bool calibrate_yaw, InterpolationValues value=InterpolationValues::e_linear)
Definition ManagedDesignCommand.h:335
static DynamicPointer< DesignCommand > ScaleObject(const Vector< 3, fltp08 > &scale, const Vector< 3, fltp08 > &scale_center)
Definition ManagedDesignCommand.h:218
Dictionary< UUID, Buffer< String > > undoParams()
Definition ManagedDesignCommand.h:122
void setParams(const Buffer< String > ¶ms)
Definition ManagedDesignCommand.h:96
void setUndoParams(const UUID &uuid, const t_arg_type_a ¶m_a, const t_arg_type_b ¶m_b, const t_arg_type_c ¶m_c)
Definition ManagedDesignCommand.h:139
static DynamicPointer< DesignCommand > SmoothLaplacianCommand(uint04 number_of_iterations, fltp08 shrink_rate, fltp08 grow_rate)
Definition ManagedDesignCommand.h:234
void removeUndo(const UUID &uuid)
Definition ManagedDesignCommand.h:152
ManagedDesignCommand(CommandType command, const t_arg_type_a ¶m_a, const t_arg_type_b ¶m_b)
Definition ManagedDesignCommand.h:77
MaterialProperties
Definition Material.h:108
UVMode
Definition Material.h:68
Definition Matrix.hpp:173
MaterialMode
Definition Model.h:57
ModelProperty
Definition Model.h:99
Represents a color in the RGB space with optional alpha transparency.
Definition RGBColor.h:53
NDEVR_BASE_API Buffer< String, uint04, ObjectAllocator< false > > splitString(char delimiter, bool preserve_empty=true) const
Definition String.cpp:57
NDEVR_BASE_API String & append(const String &string)
Definition String.cpp:484
Definition StringStream.h:62
Definition TranslatedString.h:9
An element of a vector space. An element of the real coordinate space Rn Basis vector,...
Definition Vector.hpp:62
NormalMode
Definition DesignObjectBase.h:105
VertexProperty
Definition DesignObjectBase.h:52
PrimitiveProperty
Definition DesignObjectBase.h:44
InterpolationValues
Values that represent interpolation functions. Useful in large or complicated geological or time.
Definition BaseValues.hpp:255
WindingMode
Definition DesignObjectBase.h:97
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:120
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:181
UVType
Definition DesignObjectBase.h:127