https://github.com/moebiussurfing/ofxsurfingundohelper
Helper to integrate an Undo Engine over an ofParameterGroup params container. Based on ofxUndo from nariakiiwatani.
https://github.com/moebiussurfing/ofxsurfingundohelper
openframeworks openframeworks-addon
Last synced: 3 months ago
JSON representation
Helper to integrate an Undo Engine over an ofParameterGroup params container. Based on ofxUndo from nariakiiwatani.
- Host: GitHub
- URL: https://github.com/moebiussurfing/ofxsurfingundohelper
- Owner: moebiussurfing
- License: other
- Created: 2021-08-27T00:38:47.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-24T06:26:31.000Z (over 3 years ago)
- Last Synced: 2025-04-02T00:44:11.357Z (about 1 year ago)
- Topics: openframeworks, openframeworks-addon
- Language: C++
- Homepage:
- Size: 456 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ofxSurfingUndoHelper
[](https://opensource.org/licenses/MIT)
## Overview
An add-on helper to integrate an **Undo Engine** based on [ofxUndo](https://github.com/nariakiiwatani/ofxUndo) from [nariakiiwatani](https://github.com/nariakiiwatani), but simplified to easely use **ofParameters** and with an **ImGui** based **GUI**.
## Screenshot

## Features
- Controls the **ofParameters** inside an **ofParameterGroup**.
- Adds **ImGui** controls to improve the workflow.
- **Files Mode** to allow **persistent Undo History** between App sessions.
- **Ram Mode** should be faster on big files / too many params scenarios.
- Key Commands:
ENTER : SAVE UNDO
CTRL + Z : UNDO
CTRL + SHIFT + Z : REDO
CTRL + C : CLEAR HISTORY
CTRL + S : STATE STORE
CTRL + R : STATE RECALL
## Usage
- Check the example.
ofApp.h
```.cpp
#include "ofxSurfingUndoHelper.h"
#include "ofxSurfingImGui.h"
ofxSurfingUndoHelper undoManager;
ofxSurfing_ImGui_Manager guiManager;
ofParameterGroup params;
```
ofApp.cpp
```.cpp
void ofApp::setup()
{
params.add(..) // -> add params
undoManager.setup(params);
guiManager.setup();
}
void ofApp::draw()
{
guiManager.beginWindow();
{
undoManager.drawImGui();
}
guiManager.endWindow();
}
void ofApp::keyPressed(int key)
{
if (key == 's') undoManager.doStoreUndo();
}
```
## Dependencies
* [ofxSurfingHelpers](https://github.com/moebiussurfing/ofxSurfingHelpers)
* [ofxSurfingImGui](https://github.com/moebiussurfing/ofxSurfingImGui/) [WIP]
* [ofxImGui](https://github.com/Daandelange/ofxImGui/). Fork from @**Daandelange**.
* [ofxUndo](https://github.com/moebiussurfing/ofxUndo) Already added to `OFX_ADDON/libs/`. No need to add into **PROJECT GENERATOR**.
## Tested Systems
* **Windows 10** / **VS 2017** / **OF ~0.11**
* **Windows 10** / **VS 2022** / **oF ~0.12**
## Author
An add-on by **@moebiusSurfing**
*( ManuMolina ) 2021-2022*
## License
[**MIT License**](https://github.com/LICENSE)
## TODO
+ Allow multiple independent groups.
+ Add Lite version without **ImGui** but **ofxGui** instead.