2#include <NDEVR/DesignParameter.h>
3#include <NDEVR/DesignCommand.h>
4#include <NDEVR/DesignObjectResourceCache.h>
10 class PolylineValueSliceIterator;
16 struct ParameterSlicerArgs
19 Buffer<Model> models_to_slice;
20 PolylineValueSliceIterator* slicer =
nullptr;
21 DesignParameter parameter;
23 DesignObjectResourceCache resource_cache;
24 const void* lock =
nullptr;
31 struct ValueSlicePlane
33 Buffer<Buffer<uint04>> segments;
34 Buffer<Vertex<3, fltp04>> polyline_vertices;
35 Dictionary<String, Buffer<fltp04>> properties;
38 TranslatedString group;
45 class PolylineValueSliceIterator
54 virtual Buffer<ValueSlicePlane> slicePlanes(
const Matrix<fltp08>& transform,
const DesignParameter& param) = 0;
61 virtual void cleanupSlicePlanes(
const Matrix<fltp08>&, Buffer<ValueSlicePlane>&) { };
68 class EvenSliceIterator :
public PolylineValueSliceIterator
76 Buffer<ValueSlicePlane> slicePlanes(
const Matrix<fltp08>& transform,
const DesignParameter& param)
override;
78 Bounds<1, fltp08> bounds;
86 struct PolylineValueSliceCache
88 Matrix<fltp08> slice_transform;
89 DesignParameter parameter;
90 Buffer<ValueSlicePlane> planes;
91 Buffer<Triangle<3, fltp08>> triangles;
92 Buffer<Vector<3, fltp08>> triangle_values;
93 PolylineValueSliceIterator* slice_plane;
94 DesignObjectResourceCache resource_cache;
103 class PolylineValueSlicer
110 static void CreateActiveLinework(ParameterSlicerArgs& args);
116 static constexpr StringView SliceTypeName() {
return "polyline_slice"; }
123 static void SliceIntoLineSegments(uint04 slice_index, PolylineValueSliceCache& args);
131 static void PrepareCache(
const Matrix<fltp08>& transform,
const Geometry& geo, PolylineValueSliceCache& params);
140 static void FinishSegmenting(
const Matrix<fltp08>& transform, Model& model, uint04 slice_index, PolylineValueSliceCache& params);
148 static void AddVertices(Geometry& geo,
const ValueSlicePlane& plane,
const Matrix<fltp08>& mat);
165 NDEVR_DESIGN_API ParameterSlicerCommand(
const Bounds<1, fltp08>& bounds, fltp08 spacing, DesignParameter param);
170 virtual ~ParameterSlicerCommand() {};
176 NDEVR_DESIGN_API
virtual void execute(DesignObjectLookup* lookup)
override;
183 virtual bool canCombineWith(
const DynamicPointer<DesignCommand>&)
override {
return false; };
189 virtual bool isAsyncExecution()
const override {
return true; };
195 NDEVR_DESIGN_API
virtual StringView
icon()
const override;
201 NDEVR_DESIGN_API
virtual TranslatedString
name()
const override;
208 virtual bool addTarget(UUID target_id)
override { targets.add(target_id);
return true; }
210 Buffer<UUID> targets;
212 Bounds<1, fltp08> m_bounds;
214 DesignParameter m_param;
Forward declaration of the central design object registry.
A core class within the model hierarchy containing vertex-based data (Usually 3D data) within a set c...
A light-weight base class for Log that allows processes to update, without the need for additional in...
A core class that represents a node on model hierarchy.
The primary namespace for the NDEVR SDK.
double fltp08
Defines an alias representing an 8 byte floating-point number.
@ name
The display name of the object.
@ icon
Icon identifier for the object.