#pragma once #include "vde/brep/brep.h" #include #include #include #include namespace vde::brep { /// Feature operation types enum class FeatureType { PrimitiveBox, PrimitiveCylinder, PrimitiveSphere, Extrude, Fillet, Chamfer, Shell, BooleanUnion, BooleanDifference, BooleanIntersection }; /// Parameters for a feature operation struct FeatureParams { std::vector values; // numeric params std::vector int_values; // integer params std::string name; // operation name }; /// One node in the feature tree struct FeatureNode { FeatureType type; FeatureParams params; std::vector> children; /// Evaluate this feature (rebuild geometry from parameters) [[nodiscard]] BrepModel evaluate() const; }; /// Feature tree with undo/redo support class FeatureHistory { public: /// Apply a feature operation void apply(const BrepModel& input, FeatureType type, const FeatureParams& params); /// Undo last operation [[nodiscard]] bool undo(); /// Redo last undone operation [[nodiscard]] bool redo(); /// Get current model [[nodiscard]] const BrepModel& current() const; /// Number of operations in history [[nodiscard]] size_t size() const { return states_.size(); } private: std::vector states_; size_t current_idx_ = 0; }; } // namespace vde::brep