Skip to content

Commit

Permalink
GRIDEDIT-1130 Removed undo stack from MK state
Browse files Browse the repository at this point in the history
There is now a single, global undo stack for all entities.
  • Loading branch information
BillSenior committed May 27, 2024
1 parent a6a18ad commit 8aa2f92
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 110 deletions.
21 changes: 3 additions & 18 deletions libs/MeshKernelApi/include/MeshKernelApi/MeshKernel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,18 @@ namespace meshkernelapi
MKERNEL_API int mkernel_allocate_state(int projectionType, int& meshKernelId);

/// @brief Attempt to undo by one undo-action.
/// @param[in] meshKernelId The id of the mesh state.
/// @param[out] undone Indicates if the undo action was actually undone
/// @returns Error code
MKERNEL_API int mkernel_undo_state(int meshKernelId, bool& undone);
MKERNEL_API int mkernel_undo_state(bool& undone);

/// @brief Attempt to redo by one undo-action.
/// @param[in] meshKernelId The id of the mesh state.
/// @param[out] redone Indicates if the redo action was actually redone
/// @returns Error code
MKERNEL_API int mkernel_redo_state(int meshKernelId, bool& redone);
MKERNEL_API int mkernel_redo_state(bool& redone);

/// @brief Clear the undo state.
/// @param[in] meshKernelId The id of the mesh state.
/// @returns Error code
MKERNEL_API int mkernel_clear_undo_state(int meshKernelId);
MKERNEL_API int mkernel_clear_undo_state();

/// @brief Computes 1d-2d contacts, where 1d nodes are connected to the closest 2d faces at the boundary (ggeo_make1D2DRiverLinks_dll)
///
Expand Down Expand Up @@ -1517,18 +1514,6 @@ namespace meshkernelapi
int startIndex,
int endIndex);

/// @brief Attempt to redo by one undo-action.
/// @param[in] meshKernelId The id of the mesh state.
/// @param[out] redone Indicates if the redo action was actually redone
/// @returns Error code
MKERNEL_API int mkernel_redo_state(int meshKernelId, bool& redone);

/// @brief Attempt to undo by one undo-action.
/// @param[in] meshKernelId The id of the mesh state.
/// @param[out] undone Indicates if the undo action was actually undone
/// @returns Error code
MKERNEL_API int mkernel_undo_state(int meshKernelId, bool& undone);

#ifdef __cplusplus
}
#endif
Expand Down
3 changes: 0 additions & 3 deletions libs/MeshKernelApi/include/MeshKernelApi/State.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include <MeshKernel/Mesh1D.hpp>
#include <MeshKernel/Mesh2D.hpp>
#include <MeshKernel/OrthogonalizationAndSmoothing.hpp>
#include <MeshKernel/UndoActions/UndoActionStack.hpp>

namespace meshkernelapi
{
Expand Down Expand Up @@ -71,8 +70,6 @@ namespace meshkernelapi

// Exclusively owned state
meshkernel::Projection m_projection{meshkernel::Projection::cartesian}; ///< Projection used by the meshes

meshkernel::UndoActionStack m_undoStack; ///< Stack of undo actions
};

} // namespace meshkernelapi
Loading

0 comments on commit 8aa2f92

Please sign in to comment.