├── bin
└── data
│ └── .gitkeep
├── addons.make
├── image
└── img.png
├── AeonNodeEditor.xcodeproj
├── xcuserdata
│ └── Akira.xcuserdatad
│ │ ├── xcdebugger
│ │ └── Breakpoints_v2.xcbkptlist
│ │ └── xcschemes
│ │ └── xcschememanagement.plist
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ ├── xcuserdata
│ │ └── Akira.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ └── xcshareddata
│ │ └── AeonNodeEditor.xcscmblueprint
├── xcshareddata
│ └── xcschemes
│ │ ├── AeonNodeEditor Release.xcscheme
│ │ └── AeonNodeEditor Debug.xcscheme
└── project.pbxproj
├── src
├── lib
│ ├── AeonKitMapper
│ │ └── src
│ │ │ ├── Module
│ │ │ ├── Condition
│ │ │ │ ├── ConditionModule.cpp
│ │ │ │ ├── ConditionModule.hpp
│ │ │ │ └── detail
│ │ │ │ │ └── ConditionModule.hpp
│ │ │ ├── Utility
│ │ │ │ ├── ValueModule
│ │ │ │ │ ├── ValueModule.cpp
│ │ │ │ │ ├── ValueModule.hpp
│ │ │ │ │ └── detail
│ │ │ │ │ │ └── ValueModule.hpp
│ │ │ │ ├── StringConverterModule
│ │ │ │ │ ├── StringConverterModule.cpp
│ │ │ │ │ ├── StringConverterModule.hpp
│ │ │ │ │ └── detail
│ │ │ │ │ │ └── StringConverterModule.hpp
│ │ │ │ ├── CounterModule
│ │ │ │ │ ├── CounterModule.hpp
│ │ │ │ │ └── CounterModule.cpp
│ │ │ │ └── HapticPatternGeneratorModule
│ │ │ │ │ ├── HapticPatternGeneratorModule.hpp
│ │ │ │ │ └── HapticPatternGeneratorModule.cpp
│ │ │ ├── Hardware
│ │ │ │ ├── HardwareModuleCore.cpp
│ │ │ │ ├── HardwareModule.cpp
│ │ │ │ ├── HardwareModuleCore.hpp
│ │ │ │ ├── HardwareModule.hpp
│ │ │ │ ├── DisplayModule
│ │ │ │ │ ├── DisplayModule.cpp
│ │ │ │ │ └── DisplayModule.hpp
│ │ │ │ └── SensorModule
│ │ │ │ │ ├── SensorModule.hpp
│ │ │ │ │ └── SensorModule.cpp
│ │ │ ├── Module.cpp
│ │ │ ├── ModuleCore.cpp
│ │ │ ├── ModuleCore.hpp
│ │ │ ├── Module.hpp
│ │ │ ├── detail
│ │ │ │ └── Module.hpp
│ │ │ └── Logic
│ │ │ │ ├── LogicModule.hpp
│ │ │ │ └── LogicModule.cpp
│ │ │ ├── ModuleImporter
│ │ │ ├── ModuleImporter.cpp
│ │ │ └── ModuleImporter.hpp
│ │ │ ├── ModuleExporter
│ │ │ ├── ModuleExporter.hpp
│ │ │ └── ModuleExporter.cpp
│ │ │ └── AeonKitMapper.hpp
│ └── AeonNode
│ │ └── src
│ │ ├── Node.hpp
│ │ ├── Connector.hpp
│ │ ├── Node.cpp
│ │ └── Connector.cpp
├── main.cpp
├── ofApp.h
└── ofApp.cpp
├── icon.rc
├── README.md
├── Makefile
├── Project.xcconfig
├── openFrameworks-Info.plist
├── AeonNodeEditor.vcxproj.filters
├── AeonNodeEditor.sln
├── .gitignore
├── config.make
└── AeonNodeEditor.vcxproj
/bin/data/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/addons.make:
--------------------------------------------------------------------------------
1 | ofxDatGui
2 | ofxHierarchy
3 | ofxSmartFont
4 |
--------------------------------------------------------------------------------
/image/img.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0x0c/AeonNodeEditor/HEAD/image/img.png
--------------------------------------------------------------------------------
/AeonNodeEditor.xcodeproj/xcuserdata/Akira.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/src/lib/AeonKitMapper/src/Module/Condition/ConditionModule.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // ConditionModule.cpp
3 | // AeonNodeEditor
4 | //
5 | // Created by Akira Matsuda on 3/12/16.
6 | //
7 | //
8 |
9 | #include "ConditionModule.hpp"
--------------------------------------------------------------------------------
/src/lib/AeonKitMapper/src/Module/Utility/ValueModule/ValueModule.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // ValueModule.cpp
3 | // AeonNodeEditor
4 | //
5 | // Created by Akira Matsuda on 3/13/16.
6 | //
7 | //
8 |
9 | #include "ValueModule.hpp"
--------------------------------------------------------------------------------
/AeonNodeEditor.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/lib/AeonKitMapper/src/ModuleImporter/ModuleImporter.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // ModuleImporter.cpp
3 | // AeonNodeEditor
4 | //
5 | // Created by Akira Matsuda on 3/13/16.
6 | //
7 | //
8 |
9 | #include "ModuleImporter.hpp"
10 |
--------------------------------------------------------------------------------
/src/lib/AeonKitMapper/src/Module/Hardware/HardwareModuleCore.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // HardwareModuleCore.cpp
3 | // AeonNodeEditor
4 | //
5 | // Created by Akira Matsuda on 3/13/16.
6 | //
7 | //
8 |
9 | #include "HardwareModuleCore.hpp"
10 |
--------------------------------------------------------------------------------
/src/lib/AeonKitMapper/src/Module/Module.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // SensorModule.cpp
3 | // AeonNodeEditor
4 | //
5 | // Created by Akira Matsuda on 3/10/16.
6 | //
7 | //
8 |
9 | #include "Module.hpp"
10 |
11 | namespace AeonKitMapper {
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/AeonNodeEditor.xcodeproj/project.xcworkspace/xcuserdata/Akira.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0x0c/AeonNodeEditor/HEAD/AeonNodeEditor.xcodeproj/project.xcworkspace/xcuserdata/Akira.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/icon.rc:
--------------------------------------------------------------------------------
1 | // Icon Resource Definition
2 | #define MAIN_ICON 102
3 |
4 | #if defined(_DEBUG)
5 | MAIN_ICON ICON "icon_debug.ico"
6 | #else
7 | MAIN_ICON ICON "icon.ico"
8 | #endif
9 |
--------------------------------------------------------------------------------
/src/lib/AeonKitMapper/src/Module/Hardware/HardwareModule.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // HardwareModule.cpp
3 | // AeonNodeEditor
4 | //
5 | // Created by Akira Matsuda on 3/12/16.
6 | //
7 | //
8 |
9 | #include "HardwareModule.hpp"
10 |
11 | namespace AeonKitMapper {
12 |
13 | }
--------------------------------------------------------------------------------
/src/lib/AeonKitMapper/src/Module/Utility/StringConverterModule/StringConverterModule.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // StringConverterModule.cpp
3 | // AeonNodeEditor
4 | //
5 | // Created by Akira Matsuda on 3/12/16.
6 | //
7 | //
8 |
9 | #include "StringConverterModule.hpp"
10 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # AeonNodeEditor
2 |
3 | 
4 |
5 | ## Dependencies
6 | - openFrameworks 0.9.0
7 | - [ofxDatGui](https://github.com/braitsch/ofxDatGui)
8 | - [thunderclap](https://github.com/0x0c/thunderclap)
--------------------------------------------------------------------------------
/src/main.cpp:
--------------------------------------------------------------------------------
1 | #include "ofMain.h"
2 | #include "ofApp.h"
3 |
4 | //========================================================================
5 | int main( ){
6 | ofSetupOpenGL(1024, 1024, OF_WINDOW); // <-------- setup the GL context
7 |
8 | // this kicks off the running of my app
9 | // can be OF_WINDOW or OF_FULLSCREEN
10 | // pass in width and height too:
11 | ofRunApp(new ofApp());
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | # Attempt to load a config.make file.
2 | # If none is found, project defaults in config.project.make will be used.
3 | ifneq ($(wildcard config.make),)
4 | include config.make
5 | endif
6 |
7 | # make sure the the OF_ROOT location is defined
8 | ifndef OF_ROOT
9 | OF_ROOT=$(realpath ../../..)
10 | endif
11 |
12 | # call the project makefile!
13 | include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk
14 |
--------------------------------------------------------------------------------
/src/lib/AeonKitMapper/src/Module/ModuleCore.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // ModuleCore.cpp
3 | // AeonNodeEditor
4 | //
5 | // Created by Akira Matsuda on 3/13/16.
6 | //
7 | //
8 |
9 | #include "ModuleCore.hpp"
10 |
11 | namespace AeonKitMapper {
12 | std::string ModuleCore::get_module_name() {
13 | return this->module_name;
14 | }
15 |
16 | ModuleCore::ModuleCore(std::string module_name, float x, float y) : AeonNode::Node({x, y, 150, 80}), module_name(module_name) {}
17 | }
18 |
--------------------------------------------------------------------------------
/AeonNodeEditor.xcodeproj/xcuserdata/Akira.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SuppressBuildableAutocreation
6 |
7 | E4B69B5A0A3A1756003C02F2
8 |
9 | primary
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/lib/AeonKitMapper/src/ModuleExporter/ModuleExporter.hpp:
--------------------------------------------------------------------------------
1 | //
2 | // ModuleExporter.hpp
3 | // AeonNodeEditor
4 | //
5 | // Created by Akira Matsuda on 3/13/16.
6 | //
7 | //
8 |
9 | #ifndef ModuleExporter_hpp
10 | #define ModuleExporter_hpp
11 |
12 | #include "Node.hpp"
13 |
14 | namespace AeonKitMapper {
15 | class ModuleExporter {
16 | public:
17 | static void export_module_relation(std::vector module);
18 | };
19 | }
20 |
21 | #endif /* ModuleExporter_hpp */
22 |
--------------------------------------------------------------------------------
/src/lib/AeonKitMapper/src/Module/Hardware/HardwareModuleCore.hpp:
--------------------------------------------------------------------------------
1 | //
2 | // HardwareModuleCore.hpp
3 | // AeonNodeEditor
4 | //
5 | // Created by Akira Matsuda on 3/13/16.
6 | //
7 | //
8 |
9 | #ifndef HardwareModuleCore_hpp
10 | #define HardwareModuleCore_hpp
11 |
12 | #include
13 |
14 | namespace AeonKitMapper {
15 | class HardwareModuleCore {
16 | public:
17 | virtual std::string get_device_name() = 0;
18 | virtual void set_device_name(std::string name) = 0;
19 | };
20 | }
21 |
22 | #endif /* HardwareModuleCore_hpp */
23 |
--------------------------------------------------------------------------------
/src/lib/AeonKitMapper/src/Module/ModuleCore.hpp:
--------------------------------------------------------------------------------
1 | //
2 | // ModuleCore.hpp
3 | // AeonNodeEditor
4 | //
5 | // Created by Akira Matsuda on 3/13/16.
6 | //
7 | //
8 |
9 | #ifndef ModuleCore_hpp
10 | #define ModuleCore_hpp
11 |
12 |
13 | #include
14 | #include
15 | #include "../../../AeonNode/src/Node.hpp"
16 |
17 | namespace AeonKitMapper {
18 | class ModuleCore : public AeonNode::Node {
19 | protected:
20 | std::string module_name;
21 | public:
22 | std::string get_module_name();
23 | ModuleCore(std::string module_name, float x, float y);
24 | };
25 | }
26 |
27 | #endif /* ModuleCore_hpp */
28 |
--------------------------------------------------------------------------------
/Project.xcconfig:
--------------------------------------------------------------------------------
1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT.
2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED
3 | OF_PATH = ../../..
4 |
5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE
6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig"
7 |
8 | //ICONS - NEW IN 0072
9 | ICON_NAME_DEBUG = icon-debug.icns
10 | ICON_NAME_RELEASE = icon.icns
11 | ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/
12 |
13 | //IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to:
14 | //ICON_FILE_PATH = bin/data/
15 |
16 | OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS)
17 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS)
18 |
--------------------------------------------------------------------------------
/openFrameworks-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | English
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | cc.openFrameworks.ofapp
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundlePackageType
14 | APPL
15 | CFBundleSignature
16 | ????
17 | CFBundleVersion
18 | 1.0
19 | CFBundleIconFile
20 | ${ICON}
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/lib/AeonKitMapper/src/Module/Utility/CounterModule/CounterModule.hpp:
--------------------------------------------------------------------------------
1 | //
2 | // CounterModule.hpp
3 | // AeonNodeEditor
4 | //
5 | // Created by Akira Matsuda on 3/12/16.
6 | //
7 | //
8 |
9 | #ifndef CounterModule_hpp
10 | #define CounterModule_hpp
11 |
12 | #include "../Module.hpp"
13 |
14 | namespace AeonKitMapper {
15 | class CounterModule : public Module {
16 | private:
17 | int counter;
18 | ofxDatGuiLabel *counter_label;
19 | public:
20 | CounterModule(float x, float y);
21 | virtual void received_data(AeonNode::Node *from, AeonNode::Connector *connector, boost::any data) override;
22 | virtual int eval() override;
23 | virtual void eval_and_send() override;
24 | virtual int update_output_state() override;
25 | void increment();
26 | void decrement();
27 | };
28 | }
29 |
30 | #endif /* CounterModule_hpp */
31 |
--------------------------------------------------------------------------------
/src/lib/AeonKitMapper/src/Module/Utility/ValueModule/ValueModule.hpp:
--------------------------------------------------------------------------------
1 | //
2 | // ValueModule.hpp
3 | // AeonNodeEditor
4 | //
5 | // Created by Akira Matsuda on 3/13/16.
6 | //
7 | //
8 |
9 | #ifndef ValueModule_hpp
10 | #define ValueModule_hpp
11 |
12 | #include "../Module.hpp"
13 |
14 | namespace AeonKitMapper {
15 | template class ValueModule : public Module {
16 | private:
17 | T value;
18 | void onSliderEvent(ofxDatGuiSliderEvent e);
19 | public:
20 | ValueModule(float x, float y);
21 | virtual void set_value(T value) {
22 | this->value = value;
23 | };
24 | virtual void received_data(AeonNode::Node *from, AeonNode::Connector *connector, boost::any data) override {};
25 | virtual T eval() override;
26 | virtual void eval_and_send() override;
27 | virtual T update_output_state() override;
28 | };
29 | }
30 |
31 | #include "detail/ValueModule.hpp"
32 |
33 | #endif /* ValueModule_hpp */
34 |
--------------------------------------------------------------------------------
/src/ofApp.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include "ofMain.h"
5 | #include "ofxDatGui.h"
6 | #include "ofxHierarchy.h"
7 | #include "AeonKitMapper.hpp"
8 |
9 | class ofApp : public ofBaseApp{
10 | public:
11 | std::vector modules;
12 | ofxHierarchy::View view;
13 | ofxDatGui *gui;
14 |
15 | void setup();
16 | void update();
17 | void draw();
18 | void keyPressed(int key);
19 | void keyReleased(int key);
20 | void mouseMoved(int x, int y );
21 | void mouseDragged(int x, int y, int button);
22 | void mousePressed(int x, int y, int button);
23 | void mouseReleased(int x, int y, int button);
24 | void mouseEntered(int x, int y);
25 | void mouseExited(int x, int y);
26 | void windowResized(int w, int h);
27 | void dragEvent(ofDragInfo dragInfo);
28 | void gotMessage(ofMessage msg);
29 |
30 | void onExportButtonEvent(ofxDatGuiButtonEvent e);
31 | void onAddModuleButtonEvent(ofxDatGuiButtonEvent e);
32 | };
33 |
--------------------------------------------------------------------------------
/src/lib/AeonKitMapper/src/AeonKitMapper.hpp:
--------------------------------------------------------------------------------
1 | //
2 | // AeonKitMapper.hpp
3 | // AeonNodeEditor
4 | //
5 | // Created by Akira Matsuda on 3/12/16.
6 | //
7 | //
8 |
9 | #ifndef AeonKitMapper_hpp
10 | #define AeonKitMapper_hpp
11 |
12 | #include "Module/Module.hpp"
13 | #include "Module/Condition/ConditionModule.hpp"
14 | #include "Module/Logic/LogicModule.hpp"
15 | #include "Module/Utility/HapticPatternGeneratorModule/HapticPatternGeneratorModule.hpp"
16 | #include "Module/Utility/CounterModule/CounterModule.hpp"
17 | #include "Module/Utility/ValueModule/ValueModule.hpp"
18 | #include "Module/Utility/StringConverterModule/StringConverterModule.hpp"
19 | #include "Module/Hardware/HardwareModule.hpp"
20 | #include "Module/Hardware/HardwareModuleCore.hpp"
21 | #include "Module/Hardware/SensorModule/SensorModule.hpp"
22 | #include "Module/Hardware/DisplayModule/DisplayModule.hpp"
23 | #include "ModuleImporter/ModuleImporter.hpp"
24 | #include "ModuleExporter/ModuleExporter.hpp"
25 |
26 | #endif /* AeonKitMapper_hpp */
27 |
--------------------------------------------------------------------------------
/src/lib/AeonKitMapper/src/Module/Hardware/HardwareModule.hpp:
--------------------------------------------------------------------------------
1 | //
2 | // HardwareModule.hpp
3 | // AeonNodeEditor
4 | //
5 | // Created by Akira Matsuda on 3/12/16.
6 | //
7 | //
8 |
9 | #ifndef HardwareModule_hpp
10 | #define HardwareModule_hpp
11 |
12 | #include "../Module.hpp"
13 | #include "HardwareModuleCore.hpp"
14 |
15 | namespace AeonKitMapper {
16 | template class HardwareModule : public Module, public HardwareModuleCore {
17 | private:
18 | ofxDatGuiTextInput *device_name_input;
19 | public:
20 | virtual std::string get_device_name() override {
21 | return this->device_name_input->getText();
22 | }
23 |
24 | virtual virtual void set_device_name(std::string name) override {
25 | this->device_name_input->setText(name);
26 | }
27 |
28 | HardwareModule(std::string module_name, float x, float y) : Module(module_name, x, y) {
29 | this->device_name_input = this->gui->addTextInput("Device name");
30 | }
31 | };
32 | }
33 |
34 | #endif /* HardwareModule_hpp */
35 |
--------------------------------------------------------------------------------
/src/lib/AeonKitMapper/src/Module/Utility/StringConverterModule/StringConverterModule.hpp:
--------------------------------------------------------------------------------
1 | //
2 | // StringConverterModule.hpp
3 | // AeonNodeEditor
4 | //
5 | // Created by Akira Matsuda on 3/12/16.
6 | //
7 | //
8 |
9 | #ifndef StringConverterModule_hpp
10 | #define StringConverterModule_hpp
11 |
12 | #include "../Module.hpp"
13 |
14 | namespace AeonKitMapper {
15 | template class StringConverterModule : public Module {
16 | ofxDatGuiLabel *input_number_label;
17 | T input_number;
18 | public:
19 | virtual void connected(AeonNode::Connector *to) override {
20 | this->eval_and_send();
21 | }
22 | StringConverterModule(float x, float y);
23 | virtual void received_data(AeonNode::Node *from, AeonNode::Connector *connector, boost::any data) override;
24 | virtual std::string eval() override;
25 | virtual void eval_and_send() override;
26 | virtual std::string update_output_state() override;
27 | };
28 | }
29 |
30 | #include "detail/StringConverterModule.hpp"
31 |
32 | #endif /* StringConverterModule_hpp */
33 |
--------------------------------------------------------------------------------
/src/lib/AeonKitMapper/src/Module/Utility/ValueModule/detail/ValueModule.hpp:
--------------------------------------------------------------------------------
1 | //
2 | // ValueModule.hpp
3 | // AeonNodeEditor
4 | //
5 | // Created by Akira Matsuda on 3/13/16.
6 | //
7 | //
8 |
9 | #include "../ValueModule.hpp"
10 |
11 | namespace AeonKitMapper {
12 | template ValueModule::ValueModule(float x, float y) : Module("Value", x, y) {
13 | this->add_connector("output", (std::type_info *)&typeid(T), AeonNode::Connector::Type::Output);
14 | ofxDatGuiSlider *slider = this->gui->addSlider("value", 0, 255);
15 | slider->onSliderEvent(this,& ValueModule::onSliderEvent);
16 | slider->bind(this->value, 0, 255);
17 | }
18 |
19 | template void ValueModule::onSliderEvent(ofxDatGuiSliderEvent e) {
20 | this->eval_and_send();
21 | }
22 |
23 | template T ValueModule::eval() {
24 | return this->value;
25 | }
26 |
27 | template void ValueModule::eval_and_send() {
28 | this->send_data(this->update_output_state());
29 | }
30 |
31 | template T ValueModule::update_output_state() {
32 | return this->eval();
33 | }
34 | }
--------------------------------------------------------------------------------
/AeonNodeEditor.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | src
6 |
7 |
8 | src
9 |
10 |
11 | src\AeonNodeEditor
12 |
13 |
14 |
15 |
16 | {d8376475-7454-4a24-b08a-aac121d3ad6f}
17 |
18 |
19 | {CD535047-7219-6081-8116-DBB6}
20 |
21 |
22 |
23 |
24 | src
25 |
26 |
27 | src\AeonNodeEditor
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/src/lib/AeonKitMapper/src/Module/Hardware/DisplayModule/DisplayModule.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // DisplayModule.cpp
3 | // AeonNodeEditor
4 | //
5 | // Created by Akira Matsuda on 3/12/16.
6 | //
7 | //
8 |
9 | #include "DisplayModule.hpp"
10 |
11 | namespace AeonKitMapper {
12 | HapticDisplay::HapticDisplay(float x, float y) : DisplayModule("HapticDisplay", x, y) {
13 | this->add_connector("pattern", (std::type_info *)&typeid(int), AeonNode::Connector::Type::Input);
14 | this->pattern_text_label = this->gui->addLabel("");
15 | }
16 |
17 | void HapticDisplay::received_data(AeonNode::Node *from, AeonNode::Connector *connector, boost::any data) {
18 | int pattern = boost::any_cast(data);
19 | this->pattern_text_label->setLabel(HapticDisplay::pattern_text((HapticPattern)pattern));
20 | }
21 |
22 | OLEDDisplay::OLEDDisplay(float x, float y) : DisplayModule("OLEDDisplay", x, y) {
23 | this->add_connector("str", (std::type_info *)&typeid(std::string), AeonNode::Connector::Type::Input);
24 | this->display_text_label = this->gui->addLabel("");
25 | }
26 |
27 | void OLEDDisplay::received_data(AeonNode::Node *from, AeonNode::Connector *connector, boost::any data) {
28 | std::string str = boost::any_cast(data);
29 | this->display_text_label->setLabel(str);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/lib/AeonKitMapper/src/Module/Module.hpp:
--------------------------------------------------------------------------------
1 | //
2 | // Module.hpp
3 | // AeonNodeEditor
4 | //
5 | // Created by Akira Matsuda on 3/10/16.
6 | //
7 | //
8 |
9 | #ifndef Module_hpp
10 | #define Module_hpp
11 |
12 | #include
13 | #include
14 | #include "ofEventUtils.h"
15 | #include "ofxDatGui.h"
16 | #include "ModuleCore.hpp"
17 | #include "thunderclap.h"
18 |
19 | namespace AeonKitMapper {
20 | template class Module : public ModuleCore {
21 | protected:
22 | ofxDatGui *gui;
23 |
24 | virtual void onMouseDragged(ofMouseEventArgs& mouseArgs) override;
25 | public:
26 | virtual void connected(AeonNode::Connector *to) override {
27 | this->eval_and_send();
28 | }
29 | virtual void size_to_fit() override;
30 | void update(ofEventArgs &args);
31 | Module(std::string module_name, float x, float y);
32 | ~Module();
33 | virtual void add_connector(std::string tag, std::type_info *connectable_type, AeonNode::Connector::Type type) override;
34 | virtual void received_data(AeonNode::Node *from, AeonNode::Connector *connector, boost::any data) override = 0;
35 | virtual T eval() = 0;
36 | virtual void eval_and_send() = 0;
37 | virtual T update_output_state() = 0;
38 | };
39 | }
40 |
41 | #include "detail/Module.hpp"
42 |
43 | #endif /* Module_hpp */
44 |
--------------------------------------------------------------------------------
/src/lib/AeonKitMapper/src/Module/Utility/StringConverterModule/detail/StringConverterModule.hpp:
--------------------------------------------------------------------------------
1 | //
2 | // StringConverterModule.hpp
3 | // AeonNodeEditor
4 | //
5 | // Created by Akira Matsuda on 3/12/16.
6 | //
7 | //
8 |
9 | #include "../StringConverterModule.hpp"
10 |
11 | namespace AeonKitMapper {
12 | template StringConverterModule::StringConverterModule(float x, float y) : Module("StringConverter", x, y) {
13 | this->add_connector("input", (std::type_info *)&typeid(T), AeonNode::Connector::Type::Input);
14 | this->add_connector("str", (std::type_info *)&typeid(std::string), AeonNode::Connector::Type::Output);
15 | this->input_number_label = this->gui->addLabel("");
16 | }
17 |
18 | template void StringConverterModule::received_data(AeonNode::Node *from, AeonNode::Connector *connector, boost::any data) {
19 | this->input_number = boost::any_cast(data);
20 | this->eval_and_send();
21 | }
22 |
23 | template std::string StringConverterModule::eval() {
24 | return std::to_string(this->input_number);
25 | }
26 |
27 | template void StringConverterModule::eval_and_send() {
28 | this->send_data(this->update_output_state());
29 | }
30 |
31 | template std::string StringConverterModule::update_output_state() {
32 | auto str = this->eval();
33 | this->input_number_label->setLabel(str);
34 | return str;
35 | }
36 | }
--------------------------------------------------------------------------------
/src/lib/AeonKitMapper/src/Module/Utility/CounterModule/CounterModule.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // CounterModule.cpp
3 | // AeonNodeEditor
4 | //
5 | // Created by Akira Matsuda on 3/12/16.
6 | //
7 | //
8 |
9 | #include "CounterModule.hpp"
10 |
11 | namespace AeonKitMapper {
12 | CounterModule::CounterModule(float x, float y) : Module("Counter", x, y) , counter(0) {
13 | this->add_connector("input", (std::type_info *)&typeid(bool), AeonNode::Connector::Type::Input);
14 | this->add_connector("output", (std::type_info *)&typeid(int), AeonNode::Connector::Type::Output);
15 | this->counter_label = this->gui->addLabel(std::to_string(this->eval()));
16 | }
17 |
18 | void CounterModule::received_data(AeonNode::Node *from, AeonNode::Connector *connector, boost::any data) {
19 | bool in = boost::any_cast(data);
20 | if (in) {
21 | this->increment();
22 | }
23 | else {
24 | this->decrement();
25 | }
26 |
27 | this->eval_and_send();
28 | }
29 |
30 | int CounterModule::eval() {
31 | return this->counter;
32 | }
33 |
34 | void CounterModule::eval_and_send() {
35 | this->send_data(this->update_output_state());
36 | }
37 |
38 | int CounterModule::update_output_state() {
39 | this->counter_label->setLabel(std::to_string(this->eval()));
40 | return this->eval();
41 | }
42 |
43 | void CounterModule::increment() {
44 | this->counter++;
45 | }
46 |
47 | void CounterModule::decrement() {
48 | this->counter--;
49 | }
50 | }
--------------------------------------------------------------------------------
/src/lib/AeonKitMapper/src/Module/detail/Module.hpp:
--------------------------------------------------------------------------------
1 | //
2 | // Module.hpp
3 | // AeonNodeEditor
4 | //
5 | // Created by Akira Matsuda on 3/10/16.
6 | //
7 | //
8 |
9 |
10 | #include "../Module.hpp"
11 |
12 | namespace AeonKitMapper {
13 | template void Module::onMouseDragged(ofMouseEventArgs& mouseArgs) {
14 | Node::onMouseDragged(mouseArgs);
15 | if (this->selected) {
16 | this->gui->setPosition(this->frame.origin.x, this->frame.origin.y);
17 | }
18 | }
19 |
20 | template void Module::size_to_fit() {
21 | Node::size_to_fit();
22 | this->frame.size.height = this->gui->getHeight() - 3;
23 | }
24 |
25 | template void Module::update(ofEventArgs &args) {
26 | this->gui->update();
27 | }
28 |
29 | template Module::Module(std::string module_name, float x, float y) : ModuleCore(module_name, x, y) {
30 | this->did_draw = [=] (ofxHierarchy::Rect frame) {
31 | this->gui->draw();
32 | };
33 |
34 | this->gui = new ofxDatGui(ofxDatGuiAnchor::NO_ANCHOR);
35 | this->gui->setPosition(this->frame.origin.x, this->frame.origin.y);
36 | this->gui->setWidth(150, 20);
37 | this->gui->addHeader(this->module_name, false);
38 | this->size_to_fit();
39 |
40 | ofAddListener(ofEvents().update, this, &Module::update);
41 | }
42 |
43 | template Module::~Module() {
44 | delete this->gui;
45 | }
46 |
47 | template void Module::add_connector(std::string tag, std::type_info *connectable_type, AeonNode::Connector::Type type) {
48 | this->size_to_fit();
49 | ModuleCore::add_connector(tag, connectable_type, type);
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/src/lib/AeonNode/src/Node.hpp:
--------------------------------------------------------------------------------
1 | //
2 | // Node.hpp
3 | // AeonNodeEditor
4 | //
5 | // Created by Akira Matsuda on 3/10/16.
6 | //
7 | //
8 |
9 | #ifndef Node_hpp
10 | #define Node_hpp
11 |
12 | #include
13 | #include
14 | #include
15 | #include "ofGraphics.h"
16 | #include "ofxHierarchy.h"
17 | #include "Connector.hpp"
18 |
19 | namespace AeonNode {
20 | class Connector;
21 | class Node : public ofxHierarchy::View {
22 | protected:
23 | ofxHierarchy::Point original_position;
24 | ofxHierarchy::Point clicked_position;
25 | bool selected;
26 | std::string identifier;
27 |
28 | Connector* tag_for_connector(std::vector *connector, std::string tag);
29 | Connector* add_connector(Connector::Type type, std::type_info *connectable_type, std::string tag, std::vector *connecter);
30 | virtual void onMousePressed(ofMouseEventArgs& mouseArgs);
31 | virtual void onMouseReleased(ofMouseEventArgs& mouseArgs);
32 | virtual void onMouseDragged(ofMouseEventArgs& mouseArgs);
33 | public:
34 | std::vector input_connector;
35 | std::vector output_connector;
36 | Connector* tag_for_connector(std::string tag, Connector::Type type);
37 |
38 | std::string get_identifier();
39 | Node(ofxHierarchy::Rect f);
40 | virtual void connected(Connector *to) {};
41 | virtual void add_connector(std::string tag, std::type_info *connectable_type, Connector::Type type);
42 | virtual void send_data(boost::any data);
43 | virtual void received_data(Node *from, Connector *connector, boost::any data) = 0;
44 | virtual void size_to_fit();
45 | };
46 | }
47 |
48 | #endif /* Node_hpp */
49 |
--------------------------------------------------------------------------------
/src/lib/AeonKitMapper/src/Module/Utility/HapticPatternGeneratorModule/HapticPatternGeneratorModule.hpp:
--------------------------------------------------------------------------------
1 | //
2 | // HapticPatternGeneratorModule.hpp
3 | // AeonNodeEditor
4 | //
5 | // Created by Akira Matsuda on 3/13/16.
6 | //
7 | //
8 |
9 | #ifndef HapticPatternGeneratorModule_hpp
10 | #define HapticPatternGeneratorModule_hpp
11 |
12 | #include "../Module.hpp"
13 | #include "../../Hardware/DisplayModule/DisplayModule.hpp"
14 |
15 | namespace AeonKitMapper {
16 | class HapticPatternGeneratorModule : public Module {
17 | private:
18 | static std::string pattern_text(HapticDisplay::HapticPattern type) {
19 | std::string result = "";
20 | switch (type) {
21 | case HapticDisplay::HapticPattern::SingleTap: {
22 | result = "SingleTap";
23 | }
24 | break;
25 | case HapticDisplay::HapticPattern::DoubleTap: {
26 | result = "DoubleTap";
27 | }
28 | break;
29 | case HapticDisplay::HapticPattern::ShortDuration: {
30 | result = "ShortDuration";
31 | }
32 | break;
33 | case HapticDisplay::HapticPattern::LongDuration: {
34 | result = "LongDuration";
35 | }
36 | break;
37 | }
38 |
39 | return result;
40 | }
41 | ofxDatGuiButton *pattern_button;
42 | void onButtonEvent(ofxDatGuiButtonEvent e);
43 | public:
44 | HapticPatternGeneratorModule(float x, float y);
45 | HapticDisplay::HapticPattern type;
46 | void switch_pattern();
47 | virtual void received_data(AeonNode::Node *from, AeonNode::Connector *connector, boost::any data) override;
48 | virtual int eval() override;
49 | virtual void eval_and_send() override;
50 | virtual int update_output_state() override;
51 | };
52 | }
53 |
54 | #endif /* HapticPatternGeneratorModule_hpp */
55 |
--------------------------------------------------------------------------------
/src/lib/AeonKitMapper/src/Module/Logic/LogicModule.hpp:
--------------------------------------------------------------------------------
1 | //
2 | // LogicModule.hpp
3 | // AeonNodeEditor
4 | //
5 | // Created by Akira Matsuda on 3/12/16.
6 | //
7 | //
8 |
9 | #ifndef LogicModule_hpp
10 | #define LogicModule_hpp
11 |
12 | #include