Skip to content

Commit 6e35ba2

Browse files
authored
Merge pull request #12
Multiple Shape Display Support
2 parents ccec8f3 + 7fb55b3 commit 6e35ba2

25 files changed

+512
-249
lines changed

bin/data/inFORM-escher-mode.mp4

60.2 KB
Binary file not shown.

neoForm.xcodeproj/project.pbxproj

+20-14
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
A7A38C1DAA6949FC9F8B48C0 /* will_mosq.c in Sources */ = {isa = PBXBuildFile; fileRef = 98278F7AD1AA612A8F4DDA10 /* will_mosq.c */; };
5757
ACE7DC9A3223ED5EE1B80074 /* cameras.c in Sources */ = {isa = PBXBuildFile; fileRef = 3DBD37876A11E46E4D7069B3 /* cameras.c */; };
5858
B006626C26FF99AB717C7CD4 /* utf8_mosq.c in Sources */ = {isa = PBXBuildFile; fileRef = D1822FF66A31138F103D3C2F /* utf8_mosq.c */; };
59+
B94766EA2C3105CC00877064 /* InFormIOManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B94766E82C3105CC00877064 /* InFormIOManager.cpp */; };
5960
B9A9F318297DF82000ACC2F8 /* KinectManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B9A9F2F5297DF82000ACC2F8 /* KinectManager.cpp */; };
6061
B9A9F319297DF82000ACC2F8 /* SerialIOManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B9A9F2FA297DF82000ACC2F8 /* SerialIOManager.cpp */; };
6162
B9A9F31A297DF82000ACC2F8 /* ShapeIOManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B9A9F2FD297DF82000ACC2F8 /* ShapeIOManager.cpp */; };
@@ -511,6 +512,8 @@
511512
B88A80AA34B79BD6DA9253DE /* sse_utils.hpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; name = sse_utils.hpp; path = ../../../addons/ofxOpenCv/libs/opencv/include/opencv4/opencv2/core/sse_utils.hpp; sourceTree = SOURCE_ROOT; };
512513
B8A2CBF3E24E6E5026B13A90 /* ofxBase3DVideo.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; name = ofxBase3DVideo.h; path = ../../../addons/ofxKinect/src/ofxBase3DVideo.h; sourceTree = SOURCE_ROOT; };
513514
B8F39F6EBA0607ECB7D18D89 /* handle_disconnect.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.c; fileEncoding = 4; name = handle_disconnect.c; path = "../../../addons/ofxMQTT-1.5.0/libs/mosquitto/src/handle_disconnect.c"; sourceTree = SOURCE_ROOT; };
515+
B94766E82C3105CC00877064 /* InFormIOManager.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = InFormIOManager.cpp; sourceTree = "<group>"; };
516+
B94766E92C3105CC00877064 /* InFormIOManager.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = InFormIOManager.hpp; sourceTree = "<group>"; };
514517
B9A9F2F5297DF82000ACC2F8 /* KinectManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KinectManager.cpp; sourceTree = "<group>"; };
515518
B9A9F2F6297DF82000ACC2F8 /* KinectManager.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = KinectManager.hpp; sourceTree = "<group>"; };
516519
B9A9F2F8297DF82000ACC2F8 /* PinConfigs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PinConfigs.h; sourceTree = "<group>"; };
@@ -1980,15 +1983,17 @@
19801983
isa = PBXGroup;
19811984
children = (
19821985
B9A9F2F8297DF82000ACC2F8 /* PinConfigs.h */,
1983-
B9A9F2F9297DF82000ACC2F8 /* TransformIOManager.hpp */,
1986+
B94766E82C3105CC00877064 /* InFormIOManager.cpp */,
1987+
B94766E92C3105CC00877064 /* InFormIOManager.hpp */,
1988+
B9A9F2FE297DF82000ACC2F8 /* SerialIOManager.hpp */,
19841989
B9A9F2FA297DF82000ACC2F8 /* SerialIOManager.cpp */,
19851990
B9A9F2FB297DF82000ACC2F8 /* SerialShapeIO.hpp */,
1986-
B9A9F2FC297DF82000ACC2F8 /* SerialShapeIOManager.hpp */,
1987-
B9A9F2FD297DF82000ACC2F8 /* ShapeIOManager.cpp */,
1988-
B9A9F2FE297DF82000ACC2F8 /* SerialIOManager.hpp */,
19891991
B9A9F2FF297DF82000ACC2F8 /* SerialShapeIO.cpp */,
1992+
B9A9F2FC297DF82000ACC2F8 /* SerialShapeIOManager.hpp */,
19901993
B9A9F300297DF82000ACC2F8 /* SerialShapeIOManager.cpp */,
19911994
B9A9F301297DF82000ACC2F8 /* ShapeIOManager.hpp */,
1995+
B9A9F2FD297DF82000ACC2F8 /* ShapeIOManager.cpp */,
1996+
B9A9F2F9297DF82000ACC2F8 /* TransformIOManager.hpp */,
19921997
B9A9F302297DF82000ACC2F8 /* TransformIOManager.cpp */,
19931998
);
19941999
path = ShapeDisplayManagers;
@@ -2007,15 +2012,15 @@
20072012
isa = PBXGroup;
20082013
children = (
20092014
B9A9F308297DF82000ACC2F8 /* Application.hpp */,
2015+
B9A9F30E297DF82000ACC2F8 /* Application.cpp */,
2016+
B9A9F30F297DF82000ACC2F8 /* AxisChecker.hpp */,
20102017
B9A9F309297DF82000ACC2F8 /* AxisChecker.cpp */,
2011-
B9A9F30A297DF82000ACC2F8 /* MqttTransmissionApp.cpp */,
2012-
B9A9F30B297DF82000ACC2F8 /* VideoPlayerApp.cpp */,
20132018
B9A9F30C297DF82000ACC2F8 /* MqttTransmissionApp.hpp */,
2019+
B9A9F30A297DF82000ACC2F8 /* MqttTransmissionApp.cpp */,
20142020
B9A9F30D297DF82000ACC2F8 /* VideoPlayerApp.hpp */,
2015-
B9A9F30E297DF82000ACC2F8 /* Application.cpp */,
2016-
B9A9F30F297DF82000ACC2F8 /* AxisChecker.hpp */,
2017-
84B1DCFE2B792D8500DE7B7B /* KinectHandWavy.cpp */,
2021+
B9A9F30B297DF82000ACC2F8 /* VideoPlayerApp.cpp */,
20182022
84B1DCFF2B792D8500DE7B7B /* KinectHandWavy.hpp */,
2023+
84B1DCFE2B792D8500DE7B7B /* KinectHandWavy.cpp */,
20192024
B9A9F310297DF82000ACC2F8 /* DebuggingApps */,
20202025
);
20212026
path = Applications;
@@ -2024,12 +2029,12 @@
20242029
B9A9F310297DF82000ACC2F8 /* DebuggingApps */ = {
20252030
isa = PBXGroup;
20262031
children = (
2027-
B9A9F311297DF82000ACC2F8 /* KinectDebugApp.cpp */,
20282032
B9A9F312297DF82000ACC2F8 /* AxisCheckerApp.hpp */,
2029-
B9A9F313297DF82000ACC2F8 /* KinectDebugApp.hpp */,
20302033
B9A9F314297DF82000ACC2F8 /* AxisCheckerApp.cpp */,
2031-
84AEEE272A926C7700D26E7C /* DepthDebugApp.cpp */,
20322034
84AEEE282A926C7700D26E7C /* DepthDebugApp.hpp */,
2035+
84AEEE272A926C7700D26E7C /* DepthDebugApp.cpp */,
2036+
B9A9F311297DF82000ACC2F8 /* KinectDebugApp.cpp */,
2037+
B9A9F313297DF82000ACC2F8 /* KinectDebugApp.hpp */,
20332038
);
20342039
path = DebuggingApps;
20352040
sourceTree = "<group>";
@@ -2638,7 +2643,7 @@
26382643
attributes = {
26392644
LastUpgradeCheck = 1420;
26402645
};
2641-
buildConfigurationList = E4B69B4D0A3A1720003C02F2 /* Build configuration list for PBXProject "neoFORM" */;
2646+
buildConfigurationList = E4B69B4D0A3A1720003C02F2 /* Build configuration list for PBXProject "neoForm" */;
26422647
compatibilityVersion = "Xcode 3.2";
26432648
developmentRegion = en;
26442649
hasScannedForEncodings = 0;
@@ -2713,6 +2718,7 @@
27132718
F4135EEFC911E9ED211FB6F9 /* core.c in Sources */,
27142719
E55DEEF784A10419E444669E /* flags.c in Sources */,
27152720
B9A9F31F297DF82000ACC2F8 /* AxisChecker.cpp in Sources */,
2721+
B94766EA2C3105CC00877064 /* InFormIOManager.cpp in Sources */,
27162722
FCC16AB16073FF0581F50ED7 /* loader.c in Sources */,
27172723
D31F5C1B140C59B2AF1533A8 /* registration.c in Sources */,
27182724
49BEEB2DFA5319D55AA6899F /* tilt.c in Sources */,
@@ -3647,7 +3653,7 @@
36473653
/* End XCBuildConfiguration section */
36483654

36493655
/* Begin XCConfigurationList section */
3650-
E4B69B4D0A3A1720003C02F2 /* Build configuration list for PBXProject "neoFORM" */ = {
3656+
E4B69B4D0A3A1720003C02F2 /* Build configuration list for PBXProject "neoForm" */ = {
36513657
isa = XCConfigurationList;
36523658
buildConfigurations = (
36533659
E4B69B4E0A3A1720003C02F2 /* Debug */,

src/AppManager.cpp

+31-30
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,22 @@ void AppManager::setup(){
2828
timeOfLastUpdate = elapsedTimeInSeconds();
2929

3030
// set up applications
31-
mqttApp = new MqttTransmissionApp();
32-
mqttApp->setRefForShapeIOManager(m_serialShapeIOManager);
31+
mqttApp = new MqttTransmissionApp(m_serialShapeIOManager);
3332
applications["mqttTransmission"] = mqttApp;
3433

35-
videoPlayerApp = new VideoPlayerApp();
36-
videoPlayerApp->setRefForShapeIOManager(m_serialShapeIOManager);
34+
videoPlayerApp = new VideoPlayerApp(m_serialShapeIOManager);
3735
applications["videoPlayer"] = videoPlayerApp;
3836
videoPlayerApp->setup();
3937

4038
// set up debugging application
4139
// and the debugging apps, too
42-
axisCheckerApp = new AxisCheckerApp();
43-
axisCheckerApp->setRefForShapeIOManager(m_serialShapeIOManager);
40+
axisCheckerApp = new AxisCheckerApp(m_serialShapeIOManager);
4441
applications["axisChecker"] = axisCheckerApp;
4542

46-
kinectDebugApp = new KinectDebugApp(kinectManager);
47-
kinectDebugApp->setRefForShapeIOManager(m_serialShapeIOManager);
43+
kinectDebugApp = new KinectDebugApp(m_serialShapeIOManager, kinectManager);
4844
applications["kinectDebug"] = kinectDebugApp;
4945

50-
depthDebugApp = new DepthDebugApp();
51-
depthDebugApp->setRefForShapeIOManager(m_serialShapeIOManager);
46+
depthDebugApp = new DepthDebugApp(m_serialShapeIOManager);
5247
applications["depthDebug"] = depthDebugApp;
5348

5449
kinectHandWavy = new KinectHandWavy(m_serialShapeIOManager,kinectManager);
@@ -72,35 +67,41 @@ void AppManager::setup(){
7267
void AppManager::setupShapeDisplayManagement() {
7368
// initialize communication with the shape display
7469
// This is where the particulars of the shape display are set (i.e. TRANSFORM, inFORM, or any other physical layout).
75-
m_serialShapeIOManager = new TransformIOManager(kinectManager);
70+
string shapeDisplayToUse = "inFORM";
71+
72+
if (shapeDisplayToUse == "TRANSFORM") {
73+
m_serialShapeIOManager = new TransformIOManager(kinectManager);
74+
} else if (shapeDisplayToUse == "inFORM") {
75+
m_serialShapeIOManager = new InFormIOManager(kinectManager);
76+
} else {
77+
throw "unknown shape display type: " + shapeDisplayToUse;
78+
}
7679

7780
printf("Setting up Shape Display Management\n");
7881

82+
// Size the pin arrays correctly based on the hardware specific dimension, and initialize them with zero values
83+
heightsForShapeDisplay = std::vector<std::vector<unsigned char>>(m_serialShapeIOManager->shapeDisplaySizeX, std::vector<unsigned char>(m_serialShapeIOManager->shapeDisplaySizeY));
84+
heightsFromShapeDisplay = std::vector<std::vector<unsigned char>>(m_serialShapeIOManager->shapeDisplaySizeX, std::vector<unsigned char>(m_serialShapeIOManager->shapeDisplaySizeY));
7985

8086
// initialize shape display pin configs
8187
PinConfigs pinConfigs;
8288
pinConfigs.timeOfUpdate = elapsedTimeInSeconds();
83-
pinConfigs.gainP = DEFAULT_GAIN_P;
84-
pinConfigs.gainI = DEFAULT_GAIN_I;
85-
pinConfigs.maxI = DEFAULT_MAX_I;
86-
pinConfigs.deadZone = DEFAULT_DEAD_ZONE;
87-
pinConfigs.maxSpeed = DEFAULT_MAX_SPEED;
89+
pinConfigs.gainP = m_serialShapeIOManager->getGainP();
90+
pinConfigs.gainI = m_serialShapeIOManager->getGainI();
91+
pinConfigs.maxI = m_serialShapeIOManager->getMaxI();
92+
pinConfigs.deadZone = m_serialShapeIOManager->getDeadZone();
93+
pinConfigs.maxSpeed = m_serialShapeIOManager->getMaxSpeed();
8894
m_serialShapeIOManager->setGlobalPinConfigs(pinConfigs);
8995
timeOfLastPinConfigsUpdate = elapsedTimeInSeconds();
9096

91-
// clear height and pin config buffers
92-
for (int x = 0; x < SHAPE_DISPLAY_SIZE_X; x++) {
93-
for (int y = 0; y < SHAPE_DISPLAY_SIZE_Y; y++) {
94-
heightsForShapeDisplay[x][y] = 0;
95-
heightsFromShapeDisplay[x][y] = 0;
96-
pinConfigsForShapeDisplay[x][y] = pinConfigs;
97-
}
98-
}
97+
98+
// Set the dimensions of the pinConfigs
99+
pinConfigsForShapeDisplay.resize(m_serialShapeIOManager->shapeDisplaySizeX, std::vector<PinConfigs>(m_serialShapeIOManager->shapeDisplaySizeY, pinConfigs));
99100

100101
// allocate height pixels objects and clear contents
101-
heightPixelsForShapeDisplay.allocate(SHAPE_DISPLAY_SIZE_X, SHAPE_DISPLAY_SIZE_Y, 1);
102+
heightPixelsForShapeDisplay.allocate(m_serialShapeIOManager->shapeDisplaySizeX, m_serialShapeIOManager->shapeDisplaySizeY, 1);
102103
heightPixelsForShapeDisplay.set(0);
103-
heightPixelsFromShapeDisplay.allocate(SHAPE_DISPLAY_SIZE_X, SHAPE_DISPLAY_SIZE_Y, 1);
104+
heightPixelsFromShapeDisplay.allocate(m_serialShapeIOManager->shapeDisplaySizeX, m_serialShapeIOManager->shapeDisplaySizeY, 1);
104105
heightPixelsFromShapeDisplay.set(0);
105106

106107
// allocate shape display graphics container and clear contents
@@ -126,8 +127,8 @@ void AppManager::update(){
126127
// note: manually looping over all pixels is important! the underlying
127128
// ofPixels char array is stored as unsigned char[y][x], while the
128129
// shape display heights are stored as unsigned char[x][y]
129-
for (int x = 0; x < SHAPE_DISPLAY_SIZE_X; x++) {
130-
for (int y = 0; y < SHAPE_DISPLAY_SIZE_Y; y++) {
130+
for (int x = 0; x < m_serialShapeIOManager->shapeDisplaySizeX; x++) {
131+
for (int y = 0; y < m_serialShapeIOManager->shapeDisplaySizeY; y++) {
131132
int xy = heightPixelsFromShapeDisplay.getPixelIndex(x, y);
132133
heightPixelsFromShapeDisplay[xy] = heightsFromShapeDisplay[x][y];
133134
}
@@ -143,8 +144,8 @@ void AppManager::update(){
143144
// note: manually looping over all pixels is important! the underlying
144145
// ofPixels char array is stored as unsigned char[y][x], while the
145146
// shape display heights are stored as unsigned char[x][y]
146-
for (int x = 0; x < SHAPE_DISPLAY_SIZE_X; x++) {
147-
for (int y = 0; y < SHAPE_DISPLAY_SIZE_Y; y++) {
147+
for (int x = 0; x < m_serialShapeIOManager->shapeDisplaySizeX; x++) {
148+
for (int y = 0; y < m_serialShapeIOManager->shapeDisplaySizeY; y++) {
148149
int xy = heightPixelsForShapeDisplay.getPixelIndex(x, y);
149150
heightsForShapeDisplay[x][y] = heightPixelsForShapeDisplay[xy];
150151
}

src/AppManager.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,12 @@ class AppManager : public ofBaseApp {
104104
// I/O data buffers
105105

106106
// maybe rename to serialHeightOutput()
107-
unsigned char heightsForShapeDisplay[SHAPE_DISPLAY_SIZE_X][SHAPE_DISPLAY_SIZE_Y];
107+
std::vector<std::vector<unsigned char>> heightsForShapeDisplay;
108108
// maybe rename to serialHeightInput()
109-
unsigned char heightsFromShapeDisplay[SHAPE_DISPLAY_SIZE_X][SHAPE_DISPLAY_SIZE_Y];
109+
std::vector<std::vector<unsigned char>> heightsFromShapeDisplay;
110110
ofPixels heightPixelsForShapeDisplay;
111111
ofPixels heightPixelsFromShapeDisplay;
112-
PinConfigs pinConfigsForShapeDisplay[SHAPE_DISPLAY_SIZE_X][SHAPE_DISPLAY_SIZE_Y];
112+
std::vector<std::vector<PinConfigs>> pinConfigsForShapeDisplay;
113113
ofFbo graphicsForShapeDisplay;
114114
ofPixels colorPixels;
115115
ofPixels depthPixels;

src/Applications/Application.cpp

+8-9
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
88
#include "Application.hpp"
99

1010
Application::Application() {
11-
heightsForShapeDisplay.allocate(SHAPE_DISPLAY_SIZE_X, SHAPE_DISPLAY_SIZE_Y, OF_IMAGE_GRAYSCALE);
12-
heightsForShapeDisplay.set(0);
13-
heightsDrawingBuffer.allocate(SHAPE_DISPLAY_SIZE_X, SHAPE_DISPLAY_SIZE_Y);
11+
// Default constructor
1412
};
1513

1614
Application::Application(SerialShapeIOManager *theCustomShapeDisplayManager){
17-
heightsForShapeDisplay.allocate(SHAPE_DISPLAY_SIZE_X, SHAPE_DISPLAY_SIZE_Y, OF_IMAGE_GRAYSCALE);
18-
heightsForShapeDisplay.set(0);
19-
heightsDrawingBuffer.allocate(SHAPE_DISPLAY_SIZE_X, SHAPE_DISPLAY_SIZE_Y);
2015

2116
m_CustomShapeDisplayManager = theCustomShapeDisplayManager;
17+
18+
heightsForShapeDisplay.allocate(theCustomShapeDisplayManager->shapeDisplaySizeX, theCustomShapeDisplayManager->shapeDisplaySizeY, OF_IMAGE_GRAYSCALE);
19+
heightsForShapeDisplay.set(0);
20+
heightsDrawingBuffer.allocate(theCustomShapeDisplayManager->shapeDisplaySizeX, theCustomShapeDisplayManager->shapeDisplaySizeY);
21+
2222
}
2323

2424
void Application::setRefForShapeIOManager(SerialShapeIOManager* customIOManager){
@@ -30,9 +30,8 @@ void Application::getHeightsForShapeDisplay(ofPixels &heights) {
3030
heights = heightsForShapeDisplay;
3131
};
3232

33-
void Application::getPinConfigsForShapeDisplay(PinConfigs configs[SHAPE_DISPLAY_SIZE_X][SHAPE_DISPLAY_SIZE_Y]) {
34-
PinConfigs *src = (PinConfigs *) pinConfigsForShapeDisplay;
35-
copy(src, src + SHAPE_DISPLAY_SIZE_2D, (PinConfigs *) configs);
33+
void Application::getPinConfigsForShapeDisplay(std::vector<std::vector<PinConfigs>>& configs) {
34+
pinConfigsForShapeDisplay = configs;
3635
};
3736

3837
void Application::setHeightsFromShapeDisplayRef(const ofPixels *heights) {

src/Applications/Application.hpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "PinConfigs.h"
1616
#include "../ShapeDisplayManagers/ShapeIOManager.hpp"
1717
#include "../ShapeDisplayManagers/TransformIOManager.hpp"
18+
#include "../ShapeDisplayManagers/InFormIOManager.hpp"
1819

1920
class Application {
2021
public:
@@ -23,7 +24,7 @@ class Application {
2324
Application(SerialShapeIOManager *theCustomShapeDisplayManager);
2425

2526
void getHeightsForShapeDisplay(ofPixels &heights);
26-
void getPinConfigsForShapeDisplay(PinConfigs configs[SHAPE_DISPLAY_SIZE_X][SHAPE_DISPLAY_SIZE_Y]);
27+
void getPinConfigsForShapeDisplay(std::vector<std::vector<PinConfigs>>& configs);
2728
void setHeightsFromShapeDisplayRef(const ofPixels *heights);
2829
void setPixelsFromKinectRefs(const ofPixels *colorPixels, const ofPixels *depthPixels);
2930

@@ -48,7 +49,7 @@ class Application {
4849
protected:
4950

5051
ofPixels heightsForShapeDisplay;
51-
PinConfigs pinConfigsForShapeDisplay[SHAPE_DISPLAY_SIZE_X][SHAPE_DISPLAY_SIZE_Y];
52+
std::vector<std::vector<PinConfigs>> pinConfigsForShapeDisplay;
5253
const ofPixels *heightsFromShapeDisplay;
5354
bool hasHeightsFromShapeDisplay = false;
5455

src/Applications/DebuggingApps/AxisCheckerApp.cpp

+13-10
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,27 @@
77

88
#include "AxisCheckerApp.hpp"
99

10+
AxisCheckerApp::AxisCheckerApp(SerialShapeIOManager *theSerialShapeIOManager) : Application(theSerialShapeIOManager) {
11+
cout << "AxisCheckerApp constructor" << endl;
12+
}
1013

1114
void AxisCheckerApp::update(float dt) {
1215
normalizedPhase += dt * 0.5;
1316
tally++;
14-
tally %= SHAPE_DISPLAY_SIZE_X + SHAPE_DISPLAY_SIZE_Y;
17+
tally %= m_CustomShapeDisplayManager->shapeDisplaySizeX + m_CustomShapeDisplayManager->shapeDisplaySizeY;
1518
updateHeights();
1619
}
1720

1821
void AxisCheckerApp::updateHeights() {
1922
if (checkerboard) {
20-
for (int x = 0; x < SHAPE_DISPLAY_SIZE_X; x++) {
21-
for (int y = 0; y < SHAPE_DISPLAY_SIZE_Y; y++) {
23+
for (int x = 0; x < m_CustomShapeDisplayManager->shapeDisplaySizeX; x++) {
24+
for (int y = 0; y < m_CustomShapeDisplayManager->shapeDisplaySizeY; y++) {
2225
int height;
23-
if (x < SHAPE_DISPLAY_SIZE_X / 2 && y < SHAPE_DISPLAY_SIZE_Y / 2) {
26+
if (x < m_CustomShapeDisplayManager->shapeDisplaySizeX / 2 && y < m_CustomShapeDisplayManager->shapeDisplaySizeY / 2) {
2427
height = 40;
25-
} else if (x < SHAPE_DISPLAY_SIZE_X / 2) {
28+
} else if (x < m_CustomShapeDisplayManager->shapeDisplaySizeX / 2) {
2629
height = 250;
27-
} else if (y < SHAPE_DISPLAY_SIZE_Y / 2) {
30+
} else if (y < m_CustomShapeDisplayManager->shapeDisplaySizeY / 2) {
2831
height = 110;
2932
} else {
3033
height = 180;
@@ -34,13 +37,13 @@ void AxisCheckerApp::updateHeights() {
3437
}
3538
}
3639
} else {
37-
for (int x = 0; x < SHAPE_DISPLAY_SIZE_X; x++) {
38-
for (int y = 0; y < SHAPE_DISPLAY_SIZE_Y; y++) {
40+
for (int x = 0; x < m_CustomShapeDisplayManager->shapeDisplaySizeX; x++) {
41+
for (int y = 0; y < m_CustomShapeDisplayManager->shapeDisplaySizeY; y++) {
3942
int height;
40-
if (tally < SHAPE_DISPLAY_SIZE_X) {
43+
if (tally < m_CustomShapeDisplayManager->shapeDisplaySizeX) {
4144
height = x == tally ? 255 : 0;
4245
} else {
43-
height = SHAPE_DISPLAY_SIZE_X + y == tally ? 255 : 0;
46+
height = m_CustomShapeDisplayManager->shapeDisplaySizeX + y == tally ? 255 : 0;
4447
}
4548
int xy = heightsForShapeDisplay.getPixelIndex(x, y);
4649
heightsForShapeDisplay[xy] = height;

src/Applications/DebuggingApps/AxisCheckerApp.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
class AxisCheckerApp : public Application {
1717
public:
18+
AxisCheckerApp(SerialShapeIOManager *theCustomShapeDisplayManager);
1819
void update(float dt);
1920
void drawGraphicsForShapeDisplay(int x, int y, int width, int height);
2021
string appInstructionsText();

src/Applications/DebuggingApps/DepthDebugApp.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
#include "DepthDebugApp.hpp"
99

10+
DepthDebugApp::DepthDebugApp(SerialShapeIOManager *theCustomShapeDisplayManager) : Application(theCustomShapeDisplayManager) {
11+
cout << "DepthDebugApp constructor" << endl;
12+
}
1013

1114
void DepthDebugApp::update(float dt) {
1215
cout << "hello there debug depth";

src/Applications/DebuggingApps/DepthDebugApp.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
class DepthDebugApp : public Application {
1717
public:
18+
DepthDebugApp(SerialShapeIOManager *theCustomShapeDisplayManager);
19+
1820
void update(float dt);
1921
void drawGraphicsForShapeDisplay(int x, int y, int width, int height);
2022
string appInstructionsText();

0 commit comments

Comments
 (0)