API Documentation
Loading...
Searching...
No Matches
ManagedDesignCommand.h
Go to the documentation of this file.
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>
7namespace NDEVR
8{
9 /**--------------------------------------------------------------------------------------------------
10 \brief A specified type of DesignCommand that performs common actions such as grouping or setting
11 property variables
12 *-----------------------------------------------------------------------------------------------**/
14 {
15 public:
17 {
18 e_none
19 , e_set_transform
20 , e_validate
21 , e_set_geometry_property
22 , e_set_material_property
23 , e_set_model_property
24 , e_set_model_material_mode
25 , e_set_design_property
26 , e_create_property
27 , e_normal_expansion
28 , e_set_winding_mode
29 , e_center_align
30 , e_smooth_laplacian
31 , e_smooth_cotangent
32 , e_remove_smoothing
33 , e_fill_holes_by_neighbor
34 , e_make_closed_solid
35 , e_update_vertex
36 , e_calculate_tangents
37 , e_set_normal_mode
38 , e_flip_normals
39 , e_remove_duplicates
40 , e_set_UV_mode
41 , e_set_UV_color
42 , e_set_UV_image
43 , e_set_real_thickness
44 , e_scale_object
45 , e_set_UV_intensity
46 , e_set_UV_property_channel
47 , e_set_shader
48 , e_calibrate_scan
49 , e_delete_enclosed_area
52 , e_clear_all
53 , e_color_by_channel
54 , e_read_from_file
55 , e_read_from_database
56 , e_create_material
57 , e_create_geometry
59 , e_set_metadata
60 , e_append_data
61 , e_set_active_filters
62 , e_add_active_filters
63 , e_slice_into_polylines
64 , e_remove_filter
65 , e_auto_register
66 , e_place_object
67 };
68 public:
70 protected:
72 ManagedDesignCommand(CommandType command, const String& params);
73
74 template<class t_arg_type>
75 ManagedDesignCommand(CommandType command, const t_arg_type& param_a)
76 : command_type(command)
77 {
78 setParams(String(param_a));
79 }
80 template<class t_arg_type_a, class t_arg_type_b>
81 ManagedDesignCommand(CommandType command, const t_arg_type_a& param_a, const t_arg_type_b& param_b)
82 : command_type(command)
83 {
84 setParams(String(param_a) + "|" + String(param_b));
85 }
86 template<class t_arg_type_a, class t_arg_type_b, class t_arg_type_c>
87 ManagedDesignCommand(CommandType command, const t_arg_type_a& param_a, const t_arg_type_b& param_b, const t_arg_type_c& param_c)
88 : command_type(command)
89 {
90 setParams(String(param_a) + "|" + String(param_b) + "|" + String(param_c));
91 }
92 template<class t_arg_type_a, class t_arg_type_b, class t_arg_type_c, class t_arg_type_d>
93 ManagedDesignCommand(CommandType 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)
94 : command_type(command)
95 {
96 setParams(String(param_a) + "|" + String(param_b) + "|" + String(param_c) + "|" + String(param_d));
97 }
98 public:
99 bool isAsyncExecution() const override;
100 void setParams(const Buffer<String>& params)
101 {
102 m_command_params = params;
103 }
104 void setParams(const String& params)
105 {
106 m_command_params = params.splitString('|');
107 }
108 const Buffer<String>& params() const
109 {
110 return m_command_params;
111 }
112 const Buffer<String>& undoParams(const UUID& uuid) const
113 {
114 auto iter = m_undo_params.find(uuid);
115 if (iter == m_undo_params.end())
116 {
117 static Buffer<String> empty;
118 return empty;
119 }
120 return iter.value();
121 }
123 {
124 return m_undo_params;
125 }
127 {
128 return m_undo_params;
129 }
130 template<class t_arg_type>
131 void setUndoParams(const UUID& uuid, const t_arg_type& params)
132 {
133 if(!m_undo_params.hasKey(uuid))
134 m_undo_params.insert({ uuid, {String(params)} });
135 }
136 template<class t_arg_type_a, class t_arg_type_b>
137 void setUndoParams(const UUID& uuid, const t_arg_type_a& param_a, const t_arg_type_b& param_b)
138 {
139 if (!m_undo_params.hasKey(uuid))
140 m_undo_params.insert({ uuid, {String(param_a), String(param_b)} });
141 }
142 template<class t_arg_type_a, class t_arg_type_b, class t_arg_type_c>
143 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)
144 {
145 if (!m_undo_params.hasKey(uuid))
146 m_undo_params.insert({ uuid, {String(param_a), String(param_b), String(param_c)} });
147 }
148 bool hasUndo(const UUID& uuid) const
149 {
150 return m_undo_params.hasKey(uuid);
151 }
152 void execute(DesignObjectLookup* lookup) override;
153 bool canGroupWith(const DynamicPointer<DesignCommand>& command) override;
154 bool canCombineWith(const DynamicPointer<DesignCommand>& command) override;
155 void combineWith(const DynamicPointer<DesignCommand>& command) override;
156 void removeUndo(const UUID& uuid)
157 {
158 m_undo_params.erase(uuid);
159 }
160
161
163 {
164 return new ManagedDesignCommand(e_place_object, transform);
165 }
167 {
168 return new ManagedDesignCommand(e_set_transform, transform);
169 }
170 template<class t_type>
172 {
173 return new ManagedDesignCommand(e_set_geometry_property, geo_property, value);
174 }
175 template<class t_type>
177 {
178 return new ManagedDesignCommand(e_set_material_property, mat_property, value);
179 }
180 template<class t_type>
182 {
183 return new ManagedDesignCommand(e_set_model_property, mod_property, value);
184 }
186 {
187 return new ManagedDesignCommand(e_set_model_material_mode, property, mode);
188 }
189 template<class t_type>
190 static DynamicPointer<DesignCommand> SetProperty(DesignObject::DesignProperty design_property, const t_type& value)
191 {
192 return new ManagedDesignCommand(e_set_design_property, design_property, value);
193 }
199 {
200 return new ManagedDesignCommand(e_create_geometry, name);
201 }
203 {
204 return new ManagedDesignCommand(e_create_material, name);
205 }
207 {
208 return new ManagedDesignCommand(e_validate);
209 }
211 {
212 return new ManagedDesignCommand(e_scale_object, Vector<3, fltp08>(scale));
213 }
215 {
216 return new ManagedDesignCommand(e_scale_object, scale);
217 }
218 static DynamicPointer<DesignCommand> ScaleObject(const fltp08& scale, const Vector<3, fltp08>& scale_center)
219 {
220 return new ManagedDesignCommand(e_scale_object, Vector<3, fltp08>(scale), scale_center);
221 }
223 {
224 return new ManagedDesignCommand(e_scale_object, scale, scale_center);
225 }
227 {
228 return new ManagedDesignCommand(e_set_real_thickness, real_thickness);
229 }
231 {
232 return new ManagedDesignCommand(e_smooth_laplacian, number_of_iterations);
233 }
235 {
236 return new ManagedDesignCommand(e_smooth_cotangent, number_of_iterations);
237 }
238 static DynamicPointer<DesignCommand> SmoothLaplacianCommand(uint04 number_of_iterations, fltp08 shrink_rate, fltp08 grow_rate)
239 {
240 return new ManagedDesignCommand(e_smooth_laplacian, number_of_iterations, shrink_rate, grow_rate);
241 }
242 static DynamicPointer<DesignCommand> SmoothCotangentCommand(uint04 number_of_iterations, fltp08 shrink_rate, fltp08 grow_rate)
243 {
244 return new ManagedDesignCommand(e_smooth_cotangent, number_of_iterations, shrink_rate, grow_rate);
245 }
246 template<class t_type>
247 static DynamicPointer<DesignCommand> UpdateVertex(VertexProperty property, uint04 vertex_id, const t_type& new_location)
248 {
249 return new ManagedDesignCommand(e_update_vertex, property, vertex_id, new_location);
250 }
252 {
253 return new ManagedDesignCommand(e_remove_smoothing);
254 }
256 {
257 return new ManagedDesignCommand(e_remove_duplicates);
258 }
260 {
261 return new ManagedDesignCommand(e_delete_enclosed_area);
262 }
264 {
265 return new ManagedDesignCommand(e_set_UV_mode, uv_type, uv_mode);
266 }
268 {
269 return new ManagedDesignCommand(e_set_UV_color, uv_color);
270 }
272 {
273 return new ManagedDesignCommand(e_set_UV_color, uv_type, uv_color);
274 }
275 static DynamicPointer<DesignCommand> SetUVImage(UVType uv_type, const String& uv_image)
276 {
277 return new ManagedDesignCommand(e_set_UV_image, uv_type, uv_image);
278 }
280 {
281 return new ManagedDesignCommand(e_fill_holes_by_neighbor);
282 }
287 static DynamicPointer<DesignCommand> Group(const String& model_name = String())
288 {
289 return new ManagedDesignCommand(e_group, model_name);
290 }
292 {
293 return new ManagedDesignCommand(e_set_UV_intensity, uv_type, uv_intensity);
294 }
296 {
297 return new ManagedDesignCommand(e_set_UV_property_channel, uv_type, uv_channel);
298 }
300 {
301 return new ManagedDesignCommand(e_color_by_channel, vertex_channel);
302 }
304 {
305 return new ManagedDesignCommand(e_set_winding_mode, mode);
306 }
308 {
309 return new ManagedDesignCommand(e_make_closed_solid, is_closed_solid);
310 }
312 {
313 return new ManagedDesignCommand(e_set_normal_mode, mode);
314 }
316 {
317 return new ManagedDesignCommand(e_set_active_filters, filters);
318 }
320 {
321 return new ManagedDesignCommand(e_add_active_filters, filters);
322 }
323 static DynamicPointer<DesignCommand> AutoRegister(const String& filters, const UUID& reference)
324 {
325 return new ManagedDesignCommand(e_auto_register, reference, filters);
326 }
328 {
329 return new ManagedDesignCommand(e_remove_filter, index);
330 }
332 {
333 return new ManagedDesignCommand(e_set_normal_mode, mode, smooth_angle);
334 }
335 static DynamicPointer<DesignCommand> CalibrateScan(bool calibrate_yaw, InterpolationValues value = InterpolationValues::e_linear)
336 {
337 return new ManagedDesignCommand(e_calibrate_scan, calibrate_yaw, value);
338 }
339 static DynamicPointer<DesignCommand> CalibrateScan(Angle<fltp08> angle, bool calibrate_yaw, InterpolationValues value = InterpolationValues::e_linear)
340 {
341 return new ManagedDesignCommand(e_calibrate_scan, angle, calibrate_yaw, value);
342 }
343 static DynamicPointer<DesignCommand> CalculateTangents(bool calc_tangent, bool calc_bitangent)
344 {
345 return new ManagedDesignCommand(e_calculate_tangents, calc_tangent, calc_bitangent);
346 }
348 {
349 return new ManagedDesignCommand(e_slice_into_polylines, transform, spacing);
350 }
352 {
353 return new ManagedDesignCommand(e_flip_normals);
354 }
356 {
357 return new ManagedDesignCommand(e_append_data, info);
358 }
359 static DynamicPointer<DesignCommand> SetMetadata(const String& label, const String& value)
360 {
361 return new ManagedDesignCommand(e_set_metadata, label, value);
362 }
364 {
365 return new ManagedDesignCommand(e_clear_all);
366 }
368 {
369 String name = this->name().translation("en_US");
370 if (targets.size() > 0)
371 {
372 name.add('[');
373 for (const UUID& target_id : targets)
374 {
375 name += String(target_id) + ",";
376 }
377 name.last() = ']';
378 }
379 else
380 {
381 name.append("[]");
382 }
383 if (params().size() > 0)
384 {
385 name.add('(');
386 for (const String& param : params())
387 {
388 name += String(param) + "|";
389 }
390 name.last() = ')';
391 }
392 else
393 {
394 name.append("()");
395 }
396 return name;
397 }
398 virtual TranslatedString name() const override;
399 virtual String icon() const override;
404 };
406}
#define NDEVR_DESIGN_API
Definition DLLInfo.h:77
#define NDEVR_DESIGN_T_API
Definition DLLInfo.h:78
The primary angle storage class for this API. Stores an angle in an optimized format.
Definition StringStream.h:408
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:59
void add(t_type &&object)
Definition Buffer.hpp:211
decltype(auto) last()
Definition Buffer.hpp:930
A command for safely modifying something in a DesignObjectLookup. Modifications will be done in a sep...
Definition DesignCommand.h:52
DesignProperty
Definition DesignObject.h:94
A core class where all Design Objects including models, materials, and geometries are stored.
Definition DesignObjectLookup.h:65
A hash-based key-value store, useful for quick associative lookups.
Definition Dictionary.h:59
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:319
GeometryProperty
Definition Geometry.h:89
A specified type of DesignCommand that performs common actions such as grouping or setting.
Definition ManagedDesignCommand.h:14
static DynamicPointer< DesignCommand > SetUVColor(const RGBColor &uv_color)
Definition ManagedDesignCommand.h:267
static DynamicPointer< DesignCommand > Explode()
Definition ManagedDesignCommand.h:283
bool isAsyncExecution() const override
const Dictionary< UUID, Buffer< String > > & undoParams() const
Definition ManagedDesignCommand.h:122
static DynamicPointer< DesignCommand > CalculateTangents(bool calc_tangent, bool calc_bitangent)
Definition ManagedDesignCommand.h:343
static DynamicPointer< DesignCommand > SetUVImage(UVType uv_type, const String &uv_image)
Definition ManagedDesignCommand.h:275
static DynamicPointer< DesignCommand > ScaleObject(const fltp08 &scale)
Definition ManagedDesignCommand.h:210
static DynamicPointer< DesignCommand > SetMaterialProperty(Material::MaterialProperties mat_property, const t_type &value)
Definition ManagedDesignCommand.h:176
static DynamicPointer< DesignCommand > SetMetadata(const String &label, const String &value)
Definition ManagedDesignCommand.h:359
static DynamicPointer< DesignCommand > ValidateCommand()
Definition ManagedDesignCommand.h:206
Buffer< String > m_command_params
Definition ManagedDesignCommand.h:402
CommandType
Definition ManagedDesignCommand.h:17
static DynamicPointer< DesignCommand > SmoothCotangentCommand(uint04 number_of_iterations)
Definition ManagedDesignCommand.h:234
static DynamicPointer< DesignCommand > SetWindingMode(WindingMode mode)
Definition ManagedDesignCommand.h:303
String toString() const
Definition ManagedDesignCommand.h:367
virtual TranslatedString name() const override
static DynamicPointer< DesignCommand > RemoveSmoothingCommand()
Definition ManagedDesignCommand.h:251
CommandType command_type
Definition ManagedDesignCommand.h:401
static DynamicPointer< DesignCommand > ClearAll()
Definition ManagedDesignCommand.h:363
static DynamicPointer< DesignCommand > SetProperty(DesignObject::DesignProperty design_property, const t_type &value)
Definition ManagedDesignCommand.h:190
static DynamicPointer< DesignCommand > SliceIntoPolylines(const Matrix< fltp08 > &transform, const Vector< 3, fltp08 > &spacing)
Definition ManagedDesignCommand.h:347
void deleteEnclosedSelection(DesignObjectLookup *lookup)
static DynamicPointer< DesignCommand > UpdateVertex(VertexProperty property, uint04 vertex_id, const t_type &new_location)
Definition ManagedDesignCommand.h:247
bool hasUndo(const UUID &uuid) const
Definition ManagedDesignCommand.h:148
static DynamicPointer< DesignCommand > SetUVIntensity(UVType uv_type, fltp08 uv_intensity)
Definition ManagedDesignCommand.h:291
static DynamicPointer< DesignCommand > ScaleObject(const Vector< 3, fltp08 > &scale)
Definition ManagedDesignCommand.h:214
static DynamicPointer< DesignCommand > SetNormalMode(NormalMode mode, Angle< fltp08 > smooth_angle)
Definition ManagedDesignCommand.h:331
static DynamicPointer< DesignCommand > SetUVPropertyChannel(UVType uv_type, String uv_channel)
Definition ManagedDesignCommand.h:295
static DynamicPointer< DesignCommand > SetRealThickness(fltp08 real_thickness)
Definition ManagedDesignCommand.h:226
static DynamicPointer< DesignCommand > SetModelProperty(Model::ModelProperty mod_property, const t_type &value)
Definition ManagedDesignCommand.h:181
static DynamicPointer< DesignCommand > Delete()
Definition ManagedDesignCommand.h:194
void setUndoParams(const UUID &uuid, const t_arg_type &params)
Definition ManagedDesignCommand.h:131
static DynamicPointer< DesignCommand > MakeClosedSolid(bool is_closed_solid)
Definition ManagedDesignCommand.h:307
static DynamicPointer< DesignCommand > ScaleObject(const fltp08 &scale, const Vector< 3, fltp08 > &scale_center)
Definition ManagedDesignCommand.h:218
static DynamicPointer< DesignCommand > SetModelMaterialMode(PrimitiveProperty property, Model::MaterialMode mode)
Definition ManagedDesignCommand.h:185
static DynamicPointer< DesignCommand > CreateGeometry(const String &name="")
Definition ManagedDesignCommand.h:198
bool canGroupWith(const DynamicPointer< DesignCommand > &command) override
virtual String icon() const override
static DynamicPointer< DesignCommand > PlaceObject(const Matrix< fltp08 > &transform)
Definition ManagedDesignCommand.h:162
const Buffer< String > & params() const
Definition ManagedDesignCommand.h:108
static DynamicPointer< DesignCommand > SetNormalMode(NormalMode mode)
Definition ManagedDesignCommand.h:311
static DynamicPointer< DesignCommand > RemoveDuplicateVertices()
Definition ManagedDesignCommand.h:255
static DynamicPointer< DesignCommand > SmoothCotangentCommand(uint04 number_of_iterations, fltp08 shrink_rate, fltp08 grow_rate)
Definition ManagedDesignCommand.h:242
ManagedDesignCommand(CommandType command, const t_arg_type &param_a)
Definition ManagedDesignCommand.h:75
static DynamicPointer< DesignCommand > SmoothLaplacianCommand(uint04 number_of_iterations)
Definition ManagedDesignCommand.h:230
static DynamicPointer< DesignCommand > SendInfo(const String &info)
Definition ManagedDesignCommand.h:355
static DynamicPointer< DesignCommand > SetTransform(const Matrix< fltp08 > &transform)
Definition ManagedDesignCommand.h:166
static DynamicPointer< DesignCommand > Group(const String &model_name=String())
Definition ManagedDesignCommand.h:287
static DynamicPointer< DesignCommand > SetUVColor(UVType uv_type, const RGBColor &uv_color)
Definition ManagedDesignCommand.h:271
static DynamicPointer< DesignCommand > SetActiveFilters(const String &filters)
Definition ManagedDesignCommand.h:315
ManagedDesignCommand(CommandType command, const String &params)
const Buffer< String > & undoParams(const UUID &uuid) const
Definition ManagedDesignCommand.h:112
void setUndoParams(const UUID &uuid, const t_arg_type_a &param_a, const t_arg_type_b &param_b)
Definition ManagedDesignCommand.h:137
static DynamicPointer< DesignCommand > AutoRegister(const String &filters, const UUID &reference)
Definition ManagedDesignCommand.h:323
static DynamicPointer< DesignCommand > SetUVMode(UVType uv_type, Material::UVMode uv_mode)
Definition ManagedDesignCommand.h:263
void setParams(const String &params)
Definition ManagedDesignCommand.h:104
bool canCombineWith(const DynamicPointer< DesignCommand > &command) override
static DynamicPointer< DesignCommand > RemoveActiveFilter(const uint04 &index)
Definition ManagedDesignCommand.h:327
static DynamicPointer< DesignCommand > FillHolesByNeighbor()
Definition ManagedDesignCommand.h:279
static DynamicPointer< DesignCommand > CalibrateScan(bool calibrate_yaw, InterpolationValues value=InterpolationValues::e_linear)
Definition ManagedDesignCommand.h:335
Dictionary< UUID, Buffer< String > > m_undo_params
Definition ManagedDesignCommand.h:403
void execute(DesignObjectLookup *lookup) override
static DynamicPointer< DesignCommand > SetGeometryProperty(Geometry::GeometryProperty geo_property, const t_type &value)
Definition ManagedDesignCommand.h:171
static DynamicPointer< DesignCommand > FlipNormals()
Definition ManagedDesignCommand.h:351
static DynamicPointer< DesignCommand > ColorByChannel(String vertex_channel)
Definition ManagedDesignCommand.h:299
ManagedDesignCommand(CommandType command, const t_arg_type_a &param_a, const t_arg_type_b &param_b, const t_arg_type_c &param_c)
Definition ManagedDesignCommand.h:87
static DynamicPointer< DesignCommand > CreateMaterial(const String &name="")
Definition ManagedDesignCommand.h:202
ManagedDesignCommand(CommandType 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)
Definition ManagedDesignCommand.h:93
static DynamicPointer< DesignCommand > AddActiveFilters(const String &filters)
Definition ManagedDesignCommand.h:319
static DynamicPointer< DesignCommand > DeleteEnclosedArea()
Definition ManagedDesignCommand.h:259
void combineWith(const DynamicPointer< DesignCommand > &command) override
static DynamicPointer< DesignCommand > CalibrateScan(Angle< fltp08 > angle, bool calibrate_yaw, InterpolationValues value=InterpolationValues::e_linear)
Definition ManagedDesignCommand.h:339
static DynamicPointer< DesignCommand > ScaleObject(const Vector< 3, fltp08 > &scale, const Vector< 3, fltp08 > &scale_center)
Definition ManagedDesignCommand.h:222
ManagedDesignCommand(CommandType command)
Dictionary< UUID, Buffer< String > > undoParams()
Definition ManagedDesignCommand.h:126
void setParams(const Buffer< String > &params)
Definition ManagedDesignCommand.h:100
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)
Definition ManagedDesignCommand.h:143
static DynamicPointer< DesignCommand > SmoothLaplacianCommand(uint04 number_of_iterations, fltp08 shrink_rate, fltp08 grow_rate)
Definition ManagedDesignCommand.h:238
void removeUndo(const UUID &uuid)
Definition ManagedDesignCommand.h:156
ManagedDesignCommand(CommandType command, const t_arg_type_a &param_a, const t_arg_type_b &param_b)
Definition ManagedDesignCommand.h:81
MaterialProperties
Definition Material.h:108
UVMode
Definition Material.h:68
Definition Matrix.hpp:176
MaterialMode
Definition Model.h:61
ModelProperty
Definition Model.h:103
Represents a color in the RGB space with optional alpha transparency.
Definition RGBColor.h:53
The core String class for the software.
Definition String.h:47
NDEVR_BASE_API String & append(const String &string)
NDEVR_BASE_API Buffer< String, uint04, ObjectAllocator< false > > splitString(char delimiter, bool preserve_empty=true) const
Logic for reading or writing to a string or a user friendly, TranslatedString.
Definition StringStream.h:118
Any text displayed to the user should be defined as a TranslatedString which allows the.
Definition TranslatedString.h:13
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:62
A fixed-size array with better performance compared to dynamic containers.
Definition Vector.hpp:60
Definition ACIColor.h:37
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:218
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:94
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:146
UVType
Channels that describe how an object should interact with light.
Definition DesignObjectBase.h:133