2#include <NDEVR/DesignParameter.h>
3#include <NDEVR/DesignCommand.h>
9 class PolylineValueSliceIterator;
15 struct ParameterSlicerArgs
18 Buffer<Model> models_to_slice;
19 PolylineValueSliceIterator* slicer =
nullptr;
20 DesignParameter parameter;
21 ProgressInfo* log =
nullptr;
22 const void* lock =
nullptr;
25 struct ValueSlicePlane
27 Buffer<Buffer<uint04>> segments;
28 Buffer<Vertex<3, fltp04>> polyline_vertices;
29 Dictionary<String, Buffer<fltp04>> properties;
34 class PolylineValueSliceIterator
37 virtual Buffer<ValueSlicePlane> slicePlanes(
const Matrix<fltp08>& transform,
const DesignParameter& param) = 0;
38 virtual void cleanupSlicePlanes(
const Matrix<fltp08>&, Buffer<ValueSlicePlane>&) { };
41 class EvenSliceIterator :
public PolylineValueSliceIterator
43 Buffer<ValueSlicePlane> slicePlanes(
const Matrix<fltp08>& transform,
const DesignParameter& param)
override;
45 Bounds<1, fltp08> bounds;
49 struct PolylineValueSliceCache
51 Matrix<fltp08> slice_transform;
52 DesignParameter parameter;
53 Buffer<ValueSlicePlane> planes;
54 Buffer<Triangle<3, fltp08>> triangles;
55 Buffer<Vector<3, fltp08>> triangle_values;
56 PolylineValueSliceIterator* slice_plane;
63 class PolylineValueSlicer
66 static void CreateActiveLinework(ParameterSlicerArgs& args);
67 static constexpr const char* SliceTypeName() {
return "polyline_slice"; }
69 static void SliceIntoLineSegments(uint04 slice_index, PolylineValueSliceCache& args);
70 static void PrepareCache(
const Matrix<fltp08>& transform,
const Geometry& geo, PolylineValueSliceCache& params);
71 static void FinishSegmenting(
const Matrix<fltp08>& transform, Model& model, uint04 slice_index,
const PolylineValueSliceCache& params);
72 static void AddVertices(Geometry& geo,
const ValueSlicePlane& plane,
const Matrix<fltp08>& mat);
77 ParameterSlicerCommand(
const Bounds<1, fltp08>& bounds, fltp08 spacing, DesignParameter param);
78 virtual ~ParameterSlicerCommand() {};
79 virtual void execute(DesignObjectLookup* lookup)
override;
80 virtual bool canCombineWith(
const DynamicPointer<DesignCommand>&)
override {
return false; };
82 virtual bool isAsyncExecution()
const override {
return true; };
83 virtual String icon()
const override;
84 virtual TranslatedString name()
const override;
86 Bounds<1, fltp08> m_bounds;
88 DesignParameter m_param;
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:146