Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cca4842
commit 4719d0e
Showing
6 changed files
with
2,419 additions
and
0 deletions.
There are no files selected for viewing
1,921 changes: 1,921 additions & 0 deletions
1,921
StencilToStl/StencilToStl.xcodeproj/project.pbxproj
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>English</string> | ||
<key>CFBundleExecutable</key> | ||
<string>${EXECUTABLE_NAME}</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>com.yourcompany.openFrameworks</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundlePackageType</key> | ||
<string>APPL</string> | ||
<key>CFBundleSignature</key> | ||
<string>????</string> | ||
<key>CFBundleVersion</key> | ||
<string>1.0</string> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#include "testApp.h" | ||
#include "ofAppGlutWindow.h" | ||
|
||
int main() { | ||
ofAppGlutWindow window; | ||
ofSetupOpenGL(&window, 1280, 800, OF_WINDOW); | ||
ofRunApp(new testApp()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
#pragma once | ||
|
||
/* | ||
r4 | ||
ofxAutoControlPanel makes ofxControlPanel a little easier to work with. | ||
the control panel is autoamtically toggle-able using the tab key. | ||
the panel is hooked up to mouse, draw, and update events automatically. | ||
addPanel() does an addPanel() followed by a setWhichPanel() to avoid redundancy and mistakes. | ||
the fps is autoamtically drawn at the lower right corner of the screen. | ||
*/ | ||
|
||
#include "ofxControlPanel.h" | ||
#include "ofEvents.h" | ||
|
||
#include <iostream> | ||
#include <vector> | ||
#include <iterator> | ||
#include <algorithm> | ||
template <typename T> | ||
struct variadic_ : public vector<T> { | ||
variadic_(const T& t) { | ||
(*this)(t); | ||
} | ||
variadic_& operator()(const T& t) { | ||
this->push_back(t); | ||
return *this; | ||
} | ||
}; | ||
|
||
typedef variadic_<string> variadic; | ||
|
||
class ofxAutoControlPanel : public ofxControlPanel { | ||
public: | ||
string msg; | ||
|
||
ofxAutoControlPanel() { | ||
msg = ""; | ||
setXMLFilename("settings.xml"); | ||
ofAddListener(ofEvents.update, this, &ofxAutoControlPanel::update); | ||
ofAddListener(ofEvents.draw, this, &ofxAutoControlPanel::draw); | ||
ofAddListener(ofEvents.keyPressed, this, &ofxAutoControlPanel::keyPressed); | ||
ofAddListener(ofEvents.mousePressed, this, &ofxAutoControlPanel::mousePressed); | ||
ofAddListener(ofEvents.mouseReleased, this, &ofxAutoControlPanel::mouseReleased); | ||
ofAddListener(ofEvents.mouseDragged, this, &ofxAutoControlPanel::mouseDragged); | ||
} | ||
void setup() { | ||
ofxControlPanel::setup("Control Panel", 5, 5, 280, 600); | ||
} | ||
void setup(int width, int height) { | ||
ofxControlPanel::setup("Control Panel", 5, 5, width, height); | ||
} | ||
void update(ofEventArgs& event) { | ||
ofxControlPanel::update(); | ||
} | ||
void draw(ofEventArgs& event) { | ||
ofxControlPanel::draw(); | ||
if(!hidden) { | ||
if(msg != "") { | ||
ofSetColor(0); | ||
ofFill(); | ||
int textWidth = 10 + msg.length() * 8; | ||
ofRect(ofGetWidth() - 5 - textWidth, ofGetHeight() - 22, textWidth, 20); | ||
ofSetColor(255); | ||
ofDrawBitmapString(msg, ofGetWidth() - textWidth, ofGetHeight() - 10); | ||
} | ||
|
||
glColor4f(1, 1, 1, 1); | ||
ofFill(); | ||
ofRect(ofGetWidth() - 45, ofGetHeight() - 25, 40, 20); | ||
glColor4f(0, 0, 0, 1); | ||
ofDrawBitmapString(ofToString((int) ofGetFrameRate()), ofGetWidth() - 40, ofGetHeight() - 10); | ||
} | ||
} | ||
// usage: panel.hasValueChanged(variadic(1)(2)(3)(4)(5)); | ||
bool hasValueChanged(const vector<string>& values) { | ||
for(int i = 0; i < values.size(); i++) { | ||
string cur = values[i]; | ||
if(ofxControlPanel::hasValueChanged(cur)) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
void keyPressed(ofKeyEventArgs& event) { | ||
if(event.key == '\t') { | ||
if(hidden) { | ||
show(); | ||
} else { | ||
hide(); | ||
} | ||
} | ||
if(event.key == 'f') { | ||
ofToggleFullscreen(); | ||
} | ||
} | ||
void show() { | ||
ofxControlPanel::show(); | ||
//ofShowCursor(); | ||
} | ||
void hide() { | ||
ofxControlPanel::hide(); | ||
//ofHideCursor(); | ||
} | ||
void mousePressed(ofMouseEventArgs& event) { | ||
ofxControlPanel::mousePressed(event.x, event.y, event.button); | ||
} | ||
void mouseReleased(ofMouseEventArgs& event) { | ||
ofxControlPanel::mouseReleased(); | ||
} | ||
void mouseDragged(ofMouseEventArgs& event) { | ||
ofxControlPanel::mouseDragged(event.x, event.y, event.button); | ||
} | ||
|
||
// by default, make sliders float | ||
void addSlider(string name, string xmlName, float value, float low, float high, bool isInt = false) { | ||
ofxControlPanel::addSlider(name, xmlName, value, low, high, isInt); | ||
} | ||
void addSlider(string name, float value, float low, float high, bool isInt = false) { | ||
ofxControlPanel::addSlider(name, name, value, low, high, isInt); | ||
} | ||
void addToggle(string name, bool value = false) { | ||
ofxControlPanel::addToggle(name, name, value); | ||
} | ||
void addPanel(string panelName, int columns = 1) { | ||
ofxControlPanel::addPanel(panelName, columns); | ||
ofxControlPanel::setWhichPanel(panelName); | ||
} | ||
}; |
Oops, something went wrong.