Body and separate body graphs now animating
- Also, added option to disable min/max graph clearing to GUI
This commit is contained in:
parent
41db6d58b5
commit
962250b98a
Binary file not shown.
@ -1,7 +1,7 @@
|
||||
<Widget>
|
||||
<Kind>4</Kind>
|
||||
<Name>Graph Item X Gap</Name>
|
||||
<Value>11.809210777</Value>
|
||||
<Value>9.144737244</Value>
|
||||
</Widget>
|
||||
<Widget>
|
||||
<Kind>4</Kind>
|
||||
@ -16,7 +16,7 @@
|
||||
<Widget>
|
||||
<Kind>4</Kind>
|
||||
<Name>Data send speed (seconds)</Name>
|
||||
<Value>4.944078445</Value>
|
||||
<Value>4.485855103</Value>
|
||||
</Widget>
|
||||
<Widget>
|
||||
<Kind>4</Kind>
|
||||
|
||||
@ -11,12 +11,12 @@
|
||||
<Widget>
|
||||
<Kind>4</Kind>
|
||||
<Name>Graph Item X Gap</Name>
|
||||
<Value>6.332236767</Value>
|
||||
<Value>7.960526466</Value>
|
||||
</Widget>
|
||||
<Widget>
|
||||
<Kind>4</Kind>
|
||||
<Name>Line width</Name>
|
||||
<Value>7.125000000</Value>
|
||||
<Value>4.707237244</Value>
|
||||
</Widget>
|
||||
<Widget>
|
||||
<Kind>4</Kind>
|
||||
@ -26,7 +26,7 @@
|
||||
<Widget>
|
||||
<Kind>4</Kind>
|
||||
<Name>Data send speed (seconds)</Name>
|
||||
<Value>4.027631760</Value>
|
||||
<Value>3.438486814</Value>
|
||||
</Widget>
|
||||
<Widget>
|
||||
<Kind>4</Kind>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<Widget>
|
||||
<Kind>2</Kind>
|
||||
<Name>Bar graph</Name>
|
||||
<Value>1</Value>
|
||||
<Value>0</Value>
|
||||
</Widget>
|
||||
<Widget>
|
||||
<Kind>2</Kind>
|
||||
@ -11,12 +11,17 @@
|
||||
<Widget>
|
||||
<Kind>2</Kind>
|
||||
<Name>Separate Body graph</Name>
|
||||
<Value>1</Value>
|
||||
</Widget>
|
||||
<Widget>
|
||||
<Kind>2</Kind>
|
||||
<Name>Toggle New Min/Max clear</Name>
|
||||
<Value>0</Value>
|
||||
</Widget>
|
||||
<Widget>
|
||||
<Kind>6</Kind>
|
||||
<Name>Graph X begin/end (percent)</Name>
|
||||
<HighValue>0.786184192</HighValue>
|
||||
<HighValue>0.779605269</HighValue>
|
||||
<LowValue>0.059210528</LowValue>
|
||||
</Widget>
|
||||
<Widget>
|
||||
|
||||
@ -6,65 +6,65 @@
|
||||
<Widget>
|
||||
<Kind>4</Kind>
|
||||
<Name>Graph Item X Gap</Name>
|
||||
<Value>5.000000000</Value>
|
||||
<Value>10.032894135</Value>
|
||||
</Widget>
|
||||
<Widget>
|
||||
<Kind>4</Kind>
|
||||
<Name>Line width</Name>
|
||||
<Value>1.000000000</Value>
|
||||
<Value>4.546052933</Value>
|
||||
</Widget>
|
||||
<Widget>
|
||||
<Kind>4</Kind>
|
||||
<Name>Graph Height Max</Name>
|
||||
<Value>0.000000000</Value>
|
||||
<Value>0.398026317</Value>
|
||||
</Widget>
|
||||
<Widget>
|
||||
<Kind>4</Kind>
|
||||
<Name>Graph bottom end (percent)</Name>
|
||||
<Value>0.000000000</Value>
|
||||
<Value>1.039473653</Value>
|
||||
</Widget>
|
||||
<Widget>
|
||||
<Kind>4</Kind>
|
||||
<Name>Data send speed (seconds)</Name>
|
||||
<Value>0.100000001</Value>
|
||||
<Value>4.682236671</Value>
|
||||
</Widget>
|
||||
<Widget>
|
||||
<Kind>4</Kind>
|
||||
<Name>Data0 red</Name>
|
||||
<Value>0.000000000</Value>
|
||||
<Value>167.763153076</Value>
|
||||
</Widget>
|
||||
<Widget>
|
||||
<Kind>4</Kind>
|
||||
<Name>Data0 green</Name>
|
||||
<Value>0.000000000</Value>
|
||||
<Value>33.552631378</Value>
|
||||
</Widget>
|
||||
<Widget>
|
||||
<Kind>4</Kind>
|
||||
<Name>Data0 blue</Name>
|
||||
<Value>0.000000000</Value>
|
||||
<Value>135.888153076</Value>
|
||||
</Widget>
|
||||
<Widget>
|
||||
<Kind>4</Kind>
|
||||
<Name>Data0 alpha</Name>
|
||||
<Value>0.000000000</Value>
|
||||
<Value>140.921051025</Value>
|
||||
</Widget>
|
||||
<Widget>
|
||||
<Kind>4</Kind>
|
||||
<Name>Data1 red</Name>
|
||||
<Value>0.000000000</Value>
|
||||
<Value>31.875000000</Value>
|
||||
</Widget>
|
||||
<Widget>
|
||||
<Kind>4</Kind>
|
||||
<Name>Data1 green</Name>
|
||||
<Value>0.000000000</Value>
|
||||
<Value>213.898025513</Value>
|
||||
</Widget>
|
||||
<Widget>
|
||||
<Kind>4</Kind>
|
||||
<Name>Data1 blue</Name>
|
||||
<Value>0.000000000</Value>
|
||||
<Value>52.006576538</Value>
|
||||
</Widget>
|
||||
<Widget>
|
||||
<Kind>4</Kind>
|
||||
<Name>Data1 alpha</Name>
|
||||
<Value>0.000000000</Value>
|
||||
<Value>104.013153076</Value>
|
||||
</Widget>
|
||||
|
||||
@ -6,15 +6,15 @@
|
||||
<Widget>
|
||||
<Kind>4</Kind>
|
||||
<Name>Speed (data per frame)</Name>
|
||||
<Value>1.582236767</Value>
|
||||
<Value>4.687500000</Value>
|
||||
</Widget>
|
||||
<Widget>
|
||||
<Kind>4</Kind>
|
||||
<Name>Perlin X Scale (data size)</Name>
|
||||
<Value>0.163503304</Value>
|
||||
<Value>0.273480266</Value>
|
||||
</Widget>
|
||||
<Widget>
|
||||
<Kind>4</Kind>
|
||||
<Name>Perlin Y Scale (time f)</Name>
|
||||
<Value>0.217671067</Value>
|
||||
<Value>0.283328950</Value>
|
||||
</Widget>
|
||||
|
||||
@ -24,8 +24,11 @@ void DataManager::setup()
|
||||
//isPublisher0DataReceived = false;
|
||||
//isPublisher1DataReceived = false;
|
||||
|
||||
nameConcat = " dev";
|
||||
|
||||
setupSpacebrew();
|
||||
|
||||
|
||||
nextDataSendTime = 0.1;
|
||||
}
|
||||
|
||||
@ -33,7 +36,7 @@ void DataManager::setup()
|
||||
void DataManager::setupSpacebrew()
|
||||
{
|
||||
string host = "54.194.189.129"; // Spacebrew::SPACEBREW_CLOUD; // "localhost";
|
||||
string name = "Active Tripod " + ofToString(appId);
|
||||
string name = "Active Tripod " + ofToString(appId) + nameConcat;
|
||||
string description = "Description goes here. Not sure why. Let me know if you see this and tell me if you need it";
|
||||
|
||||
spacebrew.addSubscribe(publisher0Name, Spacebrew::TYPE_STRING);
|
||||
|
||||
@ -38,6 +38,8 @@ class DataManager
|
||||
|
||||
int appId;
|
||||
|
||||
string nameConcat;
|
||||
|
||||
// create your spacebrew object
|
||||
Spacebrew::Connection spacebrew;
|
||||
|
||||
|
||||
@ -66,6 +66,9 @@ void GUI::addGraphGlobalGUI()
|
||||
|
||||
gui->addRadio("Graph Selection", graphNames, OFX_UI_ORIENTATION_VERTICAL, dim*2, dim*2);
|
||||
|
||||
gui->addSpacer(length, 1);
|
||||
gui->addToggle("Toggle New Min/Max clear", &app->scene.isClearOnNewMinMax, toggleDim, toggleDim);
|
||||
|
||||
gui->addSpacer(length, 1);
|
||||
gui->addRangeSlider("Graph X begin/end (percent)", 0, 1, &AbstractGraph::minGraphPercent, &AbstractGraph::maxGraphPercent, length, dim);
|
||||
|
||||
|
||||
@ -22,7 +22,8 @@ void Scene::setup()
|
||||
|
||||
text.loadFont("fonts/Roboto-Light.ttf", 8);
|
||||
|
||||
isTestScrambleMinMaxData = false;
|
||||
//isTestScrambleMinMaxData = false;
|
||||
isClearOnNewMinMax = false;
|
||||
}
|
||||
|
||||
|
||||
@ -79,6 +80,12 @@ void Scene::drawGraphValues()
|
||||
ofPoint val0 = activeGraph->currentPub0Point;
|
||||
ofPoint val1 = activeGraph->currentPub1Point;
|
||||
|
||||
if (activeGraph->graphName == "BODY" || activeGraph->graphName == "SEPARATE_BODY")
|
||||
{
|
||||
val0 = activeGraph->graphTextPnt0;
|
||||
val1 = activeGraph->graphTextPnt1;
|
||||
}
|
||||
|
||||
string stringVal0 = reduceDecimalCount(activeGraph->publisher0Data.back().stringValue, 4);
|
||||
string stringVal1 = reduceDecimalCount(activeGraph->publisher1Data.back().stringValue, 4);
|
||||
|
||||
@ -178,9 +185,7 @@ void Scene::drawHUDCopy()
|
||||
average0 += p0Data->at(p0Data->size() - i - 1).value;
|
||||
average0 /= amountToAverage;
|
||||
|
||||
printf("l average0:%llu\n", average0);
|
||||
string valueWithCommas = addCommasToNumberString(ofToString(average0));
|
||||
printf("l av valueWithCommas:%s\n", valueWithCommas.c_str());
|
||||
|
||||
blStr = "Increase: " + ofToString(p0Data->back().value - p0Data->at(p0Data->size() - 2).value) + "\n" +
|
||||
"Current Value: " + stringVal0 + "\n" +
|
||||
@ -194,9 +199,7 @@ void Scene::drawHUDCopy()
|
||||
average0 += p0Data->at(p0Data->size() - i - 1).value;
|
||||
average0 /= amountToAverage;
|
||||
|
||||
printf("f average0:%f\n", average0);
|
||||
string valueWithCommas = (average0 > 999) ? addCommasToNumberString(ofToString(average0)) : ofToString(average0);
|
||||
printf("f av valueWithCommas:%s\n", valueWithCommas.c_str());
|
||||
|
||||
blStr = "Increase: " + ofToString(p0Data->back().value - p0Data->at(p0Data->size() - 2).value) + "\n" +
|
||||
"Current Value: " + stringVal0 + "\n" +
|
||||
@ -212,9 +215,7 @@ void Scene::drawHUDCopy()
|
||||
average1 += p1Data->at(p1Data->size() - i - 1).value;
|
||||
average1 /= amountToAverage;
|
||||
|
||||
printf("l average0:%llu\n", average1);
|
||||
string valueWithCommas = addCommasToNumberString(ofToString(average1));
|
||||
printf("l av valueWithCommas:%s\n", valueWithCommas.c_str());
|
||||
|
||||
brStr = "Increase: " + ofToString(p1Data->back().value - p1Data->at(p1Data->size() - 2).value) + "\n" +
|
||||
"Current Value: " + stringVal1 + "\n" +
|
||||
@ -228,9 +229,7 @@ void Scene::drawHUDCopy()
|
||||
average1 += p1Data->at(p1Data->size() - i - 1).value;
|
||||
average1 /= amountToAverage;
|
||||
|
||||
printf("f average1:%f\n", average1);
|
||||
string valueWithCommas = (average1 > 999) ? addCommasToNumberString(ofToString(average1)) : ofToString(average1);
|
||||
printf("f av valueWithCommas:%s\n", valueWithCommas.c_str());
|
||||
|
||||
brStr = "Increase: " + ofToString(p1Data->back().value - p1Data->at(p1Data->size() - 2).value) + "\n" +
|
||||
"Current Value: " + stringVal1 + "\n" +
|
||||
@ -300,16 +299,19 @@ void Scene::drawHUDColourBars()
|
||||
|
||||
void Scene::addNewData(vector<DataObject> newData)
|
||||
{
|
||||
if (barGraph.publisher0Data.size() > 0)
|
||||
if (isClearOnNewMinMax)
|
||||
{
|
||||
if (newData[0].min != barGraph.publisher0Data.back().min ||
|
||||
newData[0].max != barGraph.publisher0Data.back().max ||
|
||||
newData[1].min != barGraph.publisher1Data.back().min ||
|
||||
newData[1].max != barGraph.publisher1Data.back().max)
|
||||
if (barGraph.publisher0Data.size() > 0)
|
||||
{
|
||||
barGraph.clear();
|
||||
bodyGraph.clear();
|
||||
separateBodyGraph.clear();
|
||||
if (newData[0].min != barGraph.publisher0Data.back().min ||
|
||||
newData[0].max != barGraph.publisher0Data.back().max ||
|
||||
newData[1].min != barGraph.publisher1Data.back().min ||
|
||||
newData[1].max != barGraph.publisher1Data.back().max)
|
||||
{
|
||||
barGraph.clear();
|
||||
bodyGraph.clear();
|
||||
separateBodyGraph.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -87,6 +87,8 @@ public:
|
||||
string brStr;
|
||||
float averageAmount;
|
||||
|
||||
bool isClearOnNewMinMax;
|
||||
|
||||
// text colour boxes
|
||||
float topColourBoxXOffset;
|
||||
float bottomColourBoxXOffset;
|
||||
|
||||
@ -13,12 +13,14 @@ float AbstractGraph::maxGraphPercent;
|
||||
|
||||
void AbstractGraph::setup()
|
||||
{
|
||||
millisSinceLastPoint = 0;
|
||||
}
|
||||
|
||||
|
||||
void AbstractGraph::update()
|
||||
{
|
||||
maxData = (ofGetWidth() * (AbstractGraph::maxGraphPercent - AbstractGraph::minGraphPercent)) / graphItemXGap;
|
||||
normalisedTimeInc = ofMap(ofGetElapsedTimeMillis(), millisSinceLastPoint, millisSinceLastPoint + millisGap, 0, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -31,9 +33,14 @@ void AbstractGraph::draw()
|
||||
|
||||
void AbstractGraph::addNewData(vector<DataObject> newData)
|
||||
{
|
||||
millisGap = ofGetElapsedTimeMillis() - millisSinceLastPoint;
|
||||
millisSinceLastPoint = ofGetElapsedTimeMillis();
|
||||
|
||||
|
||||
publisher0Data.push_back(newData[0]);
|
||||
publisher1Data.push_back(newData[1]);
|
||||
|
||||
|
||||
while (publisher0Data.size() > maxData && publisher0Data.size() > maxData)
|
||||
{
|
||||
publisher0Data.erase(publisher0Data.begin());
|
||||
|
||||
@ -41,4 +41,16 @@ public:
|
||||
string graphName;
|
||||
float sendDataSpeed;
|
||||
|
||||
|
||||
float millisSinceLastPoint;
|
||||
float millisGap;
|
||||
//ofVec3f lastVecTarget0;
|
||||
//ofVec3f lastVecTarget1;
|
||||
float normalisedTimeInc;
|
||||
|
||||
ofPoint endPoint0;
|
||||
ofPoint endPoint1;
|
||||
|
||||
ofPoint graphTextPnt0;
|
||||
ofPoint graphTextPnt1;
|
||||
};
|
||||
@ -30,6 +30,7 @@ void BodyGraph::draw()
|
||||
ofDrawBitmapString("Time to fill screen:" + ofToString(timePerScreenfull), 500, 150);
|
||||
}
|
||||
|
||||
|
||||
if (publisher0Data.size() > 1)
|
||||
{
|
||||
float xOffset = ofGetWidth() * AbstractGraph::minGraphPercent;
|
||||
@ -41,32 +42,67 @@ void BodyGraph::draw()
|
||||
// draw main part of graph (xOffset)
|
||||
ofMesh body;
|
||||
body.setMode(OF_PRIMITIVE_TRIANGLE_STRIP);
|
||||
|
||||
for (int i = 0; i < publisher0Data.size() - 1; i++)
|
||||
{
|
||||
body.addVertex(ofVec3f(
|
||||
i * graphItemXGap + xOffset,
|
||||
ofMap(publisher0Data[i].value, publisher0Data[i].min, publisher0Data[i].max, outputMin, outputMax),
|
||||
0));
|
||||
body.addVertex(ofVec3f(
|
||||
i * graphItemXGap + xOffset,
|
||||
ofMap(publisher1Data[i].value, publisher1Data[i].min, publisher1Data[i].max, outputMin, outputMax),
|
||||
0));
|
||||
if (i < publisher0Data.size() - 2)
|
||||
{
|
||||
body.addVertex(ofVec3f(
|
||||
i * graphItemXGap + xOffset,
|
||||
ofMap(publisher0Data[i].value, publisher0Data[i].min, publisher0Data[i].max, outputMin, outputMax),
|
||||
0));
|
||||
body.addVertex(ofVec3f(
|
||||
i * graphItemXGap + xOffset,
|
||||
ofMap(publisher1Data[i].value, publisher1Data[i].min, publisher1Data[i].max, outputMin, outputMax),
|
||||
0));
|
||||
}
|
||||
else
|
||||
{
|
||||
float targetY0 = ofMap(publisher0Data[i].value, publisher0Data[i].min, publisher0Data[i].max, outputMin, outputMax);
|
||||
float prevY0 = ofMap(publisher0Data[i-1].value, publisher0Data[i-1].min, publisher0Data[i-1].max, outputMin, outputMax);
|
||||
endPoint0.y = ofMap(normalisedTimeInc, 0, 1, prevY0, targetY0);
|
||||
|
||||
float targetY1 = ofMap(publisher1Data[i].value, publisher1Data[i].min, publisher1Data[i].max, outputMin, outputMax);
|
||||
float prevY1 = ofMap(publisher1Data[i-1].value, publisher1Data[i-1].min, publisher1Data[i-1].max, outputMin, outputMax);
|
||||
endPoint1.y = ofMap(normalisedTimeInc, 0, 1, prevY1, targetY1);
|
||||
|
||||
endPoint0.x = (i-1) * graphItemXGap + xOffset + (graphItemXGap * normalisedTimeInc);
|
||||
endPoint1.x = endPoint0.x;
|
||||
|
||||
body.addVertex(ofVec3f(
|
||||
endPoint0.x,
|
||||
endPoint0.y,
|
||||
0));
|
||||
body.addVertex(ofVec3f(
|
||||
endPoint1.x,
|
||||
endPoint1.y,
|
||||
0));
|
||||
}
|
||||
body.addColor(ofColor(col0[0],col0[1],col0[2], col0[3]));
|
||||
body.addColor(ofColor(col1[0],col1[1],col1[2], col1[3]));
|
||||
|
||||
if (i == publisher0Data.size() - 2)
|
||||
{
|
||||
currentPub0Point = ofPoint(i * graphItemXGap + xOffset,
|
||||
ofMap(publisher0Data[i].value, publisher0Data[i].min, publisher0Data[i].max, outputMin, outputMax));
|
||||
currentPub1Point = ofPoint(i * graphItemXGap + xOffset,
|
||||
ofMap(publisher1Data[i].value, publisher1Data[i].min, publisher1Data[i].max, outputMin, outputMax));
|
||||
currentPub0Point = body.getVertex(body.getVertices().size() - 2);
|
||||
currentPub1Point = body.getVertices().back();
|
||||
}
|
||||
}
|
||||
|
||||
ofPushMatrix();
|
||||
if (publisher0Data.size() >= maxData) ofTranslate(ofMap(normalisedTimeInc, 0, 1, 0, -graphItemXGap), 0);
|
||||
body.drawFaces();
|
||||
ofPopMatrix();
|
||||
}
|
||||
|
||||
graphTextPnt0 = currentPub0Point;
|
||||
graphTextPnt1 = currentPub1Point;
|
||||
|
||||
if (publisher0Data.size() >= maxData)
|
||||
{
|
||||
float meshXOffset = ofMap(normalisedTimeInc, 0, 1, 0, -graphItemXGap);
|
||||
graphTextPnt0.x += meshXOffset;
|
||||
graphTextPnt1.x += meshXOffset;
|
||||
}
|
||||
|
||||
if (isDrawLines)
|
||||
{
|
||||
@ -78,22 +114,40 @@ void BodyGraph::draw()
|
||||
{
|
||||
if (i < publisher0Data.size() - 1)
|
||||
{
|
||||
poly0.addVertex(ofPoint(
|
||||
i * graphItemXGap + xOffset,
|
||||
ofMap(publisher0Data[i].value, publisher0Data[i].min, publisher0Data[i].max, outputMin, outputMax)));
|
||||
if (i < publisher0Data.size() - 2)
|
||||
{
|
||||
poly0.addVertex(ofPoint(
|
||||
i * graphItemXGap + xOffset,
|
||||
ofMap(publisher0Data[i].value, publisher0Data[i].min, publisher0Data[i].max, outputMin, outputMax)));
|
||||
|
||||
|
||||
poly1.addVertex(ofPoint(
|
||||
i * graphItemXGap + xOffset,
|
||||
ofMap(publisher1Data[i].value, publisher1Data[i].min, publisher1Data[i].max, outputMin, outputMax)));
|
||||
poly1.addVertex(ofPoint(
|
||||
i * graphItemXGap + xOffset,
|
||||
ofMap(publisher1Data[i].value, publisher1Data[i].min, publisher1Data[i].max, outputMin, outputMax)));
|
||||
}
|
||||
else
|
||||
{
|
||||
poly0.addVertex(ofPoint(
|
||||
endPoint0.x,
|
||||
endPoint0.y));
|
||||
|
||||
|
||||
poly1.addVertex(ofPoint(
|
||||
endPoint1.x,
|
||||
endPoint1.y));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ofSetLineWidth(lineWidth);
|
||||
ofPushMatrix();
|
||||
if (publisher0Data.size() >= maxData) ofTranslate(ofMap(normalisedTimeInc, 0, 1, 0, -graphItemXGap), 0);
|
||||
ofSetColor(col0[0],col0[1],col0[2], 255);
|
||||
poly0.draw();
|
||||
ofSetColor(col1[0],col1[1],col1[2], 255);
|
||||
poly1.draw();
|
||||
ofPopMatrix();
|
||||
ofPopStyle();
|
||||
}
|
||||
}
|
||||
|
||||
@ -53,19 +53,11 @@ void SeparateBodyGraph::draw()
|
||||
if (i < publisher0Data.size() - 1)
|
||||
{
|
||||
ofSetLineWidth(lineWidth);
|
||||
poly0.addVertex(ofPoint(
|
||||
i * graphItemXGap + xOffset,
|
||||
ofMap(publisher0Data[i].value, publisher0Data[i].min, publisher0Data[i].max, outputMin, outputMax)));
|
||||
|
||||
|
||||
poly1.addVertex(ofPoint(
|
||||
i * graphItemXGap + xOffset,
|
||||
ofMap(publisher1Data[i].value, publisher1Data[i].min, publisher1Data[i].max, outputMin, outputMax)));
|
||||
poly0.addVertex(body0.getVertex(i*2));
|
||||
poly1.addVertex(body1.getVertex(i*2));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
ofVec2f centroid0 = poly0.getCentroid2D();
|
||||
ofVec2f centroid1 = poly1.getCentroid2D();
|
||||
|
||||
@ -83,6 +75,18 @@ void SeparateBodyGraph::draw()
|
||||
int lineAlpha = 255;
|
||||
if (!isDrawLines) lineAlpha = 0;
|
||||
|
||||
graphTextPnt0 = currentPub0Point;
|
||||
graphTextPnt1 = currentPub1Point;
|
||||
|
||||
ofPushMatrix();
|
||||
if (publisher0Data.size() >= maxData)
|
||||
{
|
||||
float meshXOffset = ofMap(normalisedTimeInc, 0, 1, 0, -graphItemXGap);
|
||||
ofTranslate(meshXOffset, 0);
|
||||
graphTextPnt0.x += meshXOffset;
|
||||
graphTextPnt1.x += meshXOffset;
|
||||
}
|
||||
|
||||
if (av0 < av1)
|
||||
{
|
||||
body0.drawFaces();
|
||||
@ -103,6 +107,7 @@ void SeparateBodyGraph::draw()
|
||||
ofSetColor(col0[0],col0[1],col0[2], lineAlpha);
|
||||
poly0.draw();
|
||||
}
|
||||
ofPopMatrix();
|
||||
|
||||
ofPopStyle();
|
||||
}
|
||||
@ -120,14 +125,34 @@ ofMesh SeparateBodyGraph::getMesh(vector<DataObject> publisherData, float* col)
|
||||
bodyMesh.setMode(OF_PRIMITIVE_TRIANGLE_STRIP);
|
||||
for (int i = 0; i < publisherData.size() - 1; i++)
|
||||
{
|
||||
bodyMesh.addVertex(ofVec3f(
|
||||
i * graphItemXGap + xOffset,
|
||||
ofMap(publisherData[i].value, publisherData[i].min, publisherData[i].max, outputMin, outputMax),
|
||||
0));
|
||||
bodyMesh.addVertex(ofVec3f(
|
||||
i * graphItemXGap + xOffset,
|
||||
ofGetHeight() * graphEndPercent,
|
||||
0));
|
||||
if (i < publisherData.size() - 2)
|
||||
{
|
||||
bodyMesh.addVertex(ofVec3f(
|
||||
i * graphItemXGap + xOffset,
|
||||
ofMap(publisherData[i].value, publisherData[i].min, publisherData[i].max, outputMin, outputMax),
|
||||
0));
|
||||
bodyMesh.addVertex(ofVec3f(
|
||||
i * graphItemXGap + xOffset,
|
||||
ofGetHeight() * graphEndPercent,
|
||||
0));
|
||||
}
|
||||
else
|
||||
{
|
||||
float targetY0 = ofMap(publisherData[i].value, publisherData[i].min, publisherData[i].max, outputMin, outputMax);
|
||||
float prevY0 = ofMap(publisherData[i-1].value, publisherData[i-1].min, publisherData[i-1].max, outputMin, outputMax);
|
||||
endPoint0.y = ofMap(normalisedTimeInc, 0, 1, prevY0, targetY0);
|
||||
endPoint0.x = (i-1) * graphItemXGap + xOffset + (graphItemXGap * normalisedTimeInc);
|
||||
|
||||
bodyMesh.addVertex(ofVec3f(
|
||||
endPoint0.x,
|
||||
endPoint0.y,
|
||||
0));
|
||||
bodyMesh.addVertex(ofVec3f(
|
||||
endPoint0.x,
|
||||
ofGetHeight() * graphEndPercent,
|
||||
0));
|
||||
}
|
||||
|
||||
|
||||
bodyMesh.addColor(ofColor(col[0],col[1],col[2], col[3]));
|
||||
bodyMesh.addColor(ofColor(col[0],col[1],col[2], 0));
|
||||
|
||||
Binary file not shown.
@ -1,7 +1,7 @@
|
||||
<Widget>
|
||||
<Kind>2</Kind>
|
||||
<Name>Rotation</Name>
|
||||
<Value>1</Value>
|
||||
<Value>0</Value>
|
||||
</Widget>
|
||||
<Widget>
|
||||
<Kind>2</Kind>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,4 +1,4 @@
|
||||
Build started 23/1/2014 12:29:50 PM.
|
||||
Build started 24/1/2014 2:56:50 AM.
|
||||
1>Project "C:\Users\James Alliban\Work\of_v0.8.0_vs_release\CRITICAL-INFRASTRUCTURE\of\Utility_Box\Utility_Box.vcxproj" on node 2 (Build target(s)).
|
||||
1>ClCompile:
|
||||
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\CL.exe /c /I..\..\..\libs\openFrameworks /I..\..\..\libs\openFrameworks\graphics /I..\..\..\libs\openFrameworks\app /I..\..\..\libs\openFrameworks\sound /I..\..\..\libs\openFrameworks\utils /I..\..\..\libs\openFrameworks\communication /I..\..\..\libs\openFrameworks\video /I..\..\..\libs\openFrameworks\types /I..\..\..\libs\openFrameworks\math /I..\..\..\libs\openFrameworks\3d /I..\..\..\libs\openFrameworks\gl /I..\..\..\libs\openFrameworks\events /I..\..\..\libs\glut\include /I..\..\..\libs\rtAudio\include /I..\..\..\libs\quicktime\include /I..\..\..\libs\freetype\include /I..\..\..\libs\freetype\include\freetype2 /I..\..\..\libs\freeImage\include /I..\..\..\libs\fmodex\include /I..\..\..\libs\videoInput\include /I..\..\..\libs\glew\include\ /I..\..\..\libs\glu\include /I..\..\..\libs\tess2\include /I..\..\..\libs\cairo\include\cairo /I..\..\..\libs\poco\include /I..\..\..\libs\glfw\include /I..\..\..\..\libs\openssl\include /I..\..\..\addons /Isrc /Isrc\data /Isrc\gui /Isrc\visual /Isrc\visual\graph /I..\..\..\addons\ofxLibwebsockets\libs\jsoncpp /I..\..\..\addons\ofxLibwebsockets\libs\jsoncpp\json /I..\..\..\addons\ofxLibwebsockets\libs\libwebsockets\include\ /I..\..\..\addons\ofxLibwebsockets\libs\openssl\openssl /I..\..\..\addons\ofxLibwebsockets\libs\ofxLibwebsockets\include /I..\..\..\addons\ofxLibwebsockets\libs\ofxLibwebsockets\include\ofxLibwebsockets /I..\..\..\addons\ofxLibwebsockets\libs\ofxLibwebsockets\src /I..\..\..\addons\ofxLibwebsockets\src /I..\..\..\addons\ofxLibwebsockets\libs\libwebsockets\include\win32port /I..\..\..\addons\ofxLibwebsockets\libs\libwebsockets\include\win32port\win32helpers /I..\..\..\addons\ofxSpacebrew\src /I..\..\..\addons\ofxUI\src /I..\..\..\addons\ofxXmlSettings\libs /I..\..\..\addons\ofxXmlSettings\src /I..\..\..\addons\ofxFTGL\src /I..\..\..\addons\ofxFTGL\libs\FTGL\include\FTGL /I..\..\..\addons\ofxFTGL\libs\FTGL\include /I..\..\..\addons\ofxFTGL\libs\FTGL /I..\..\..\addons\ofxOsc\libs /I..\..\..\addons\ofxOsc\libs\oscpack /I..\..\..\addons\ofxOsc\libs\oscpack\src /I..\..\..\addons\ofxOsc\libs\oscpack\src\ip /I..\..\..\addons\ofxOsc\libs\oscpack\src\ip\posix /I..\..\..\addons\ofxOsc\libs\oscpack\src\ip\win32 /I..\..\..\addons\ofxOsc\libs\oscpack\src\osc /I..\..\..\addons\ofxOsc\src /Zi /nologo /W3 /WX- /O2 /Oy- /D WIN32 /D NDEBUG /D _CONSOLE /D POCO_STATIC /D CAIRO_WIN32_STATIC_BUILD /D DISABLE_SOME_FLOATING_POINT /D _UNICODE /D UNICODE /Gm- /EHsc /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"obj\Release\\" /Fd"obj\Release\vc110.pdb" /Gd /TP /analyze- /errorReport:prompt src\data\DataManager.cpp
|
||||
@ -106,4 +106,4 @@
|
||||
|
||||
Build succeeded.
|
||||
|
||||
Time Elapsed 00:00:08.88
|
||||
Time Elapsed 00:00:07.92
|
||||
|
||||
@ -1893,3 +1893,13 @@ C:\Users\James Alliban\Work\of_v0.8.0_vs_release\CRITICAL-INFRASTRUCTURE\of\Util
|
||||
C:\Users\James Alliban\Work\of_v0.8.0_vs_release\CRITICAL-INFRASTRUCTURE\of\Utility_Box\bin\Utility_Box.lib
|
||||
C:\Users\James Alliban\Work\of_v0.8.0_vs_release\CRITICAL-INFRASTRUCTURE\of\Utility_Box\bin\Utility_Box.exp
|
||||
C:\Users\James Alliban\Work\of_v0.8.0_vs_release\CRITICAL-INFRASTRUCTURE\of\Utility_Box\bin\Utility_Box.exp
|
||||
^C:\Users\James Alliban\Work\of_v0.8.0_vs_release\CRITICAL-INFRASTRUCTURE\of\Utility_Box\Utility_Box.vcxproj
|
||||
C:\Users\James Alliban\Work\of_v0.8.0_vs_release\CRITICAL-INFRASTRUCTURE\of\Utility_Box\bin\Utility_Box.lib
|
||||
C:\Users\James Alliban\Work\of_v0.8.0_vs_release\CRITICAL-INFRASTRUCTURE\of\Utility_Box\bin\Utility_Box.lib
|
||||
C:\Users\James Alliban\Work\of_v0.8.0_vs_release\CRITICAL-INFRASTRUCTURE\of\Utility_Box\bin\Utility_Box.exp
|
||||
C:\Users\James Alliban\Work\of_v0.8.0_vs_release\CRITICAL-INFRASTRUCTURE\of\Utility_Box\bin\Utility_Box.exp
|
||||
^C:\Users\James Alliban\Work\of_v0.8.0_vs_release\CRITICAL-INFRASTRUCTURE\of\Utility_Box\Utility_Box.vcxproj
|
||||
C:\Users\James Alliban\Work\of_v0.8.0_vs_release\CRITICAL-INFRASTRUCTURE\of\Utility_Box\bin\Utility_Box.lib
|
||||
C:\Users\James Alliban\Work\of_v0.8.0_vs_release\CRITICAL-INFRASTRUCTURE\of\Utility_Box\bin\Utility_Box.lib
|
||||
C:\Users\James Alliban\Work\of_v0.8.0_vs_release\CRITICAL-INFRASTRUCTURE\of\Utility_Box\bin\Utility_Box.exp
|
||||
C:\Users\James Alliban\Work\of_v0.8.0_vs_release\CRITICAL-INFRASTRUCTURE\of\Utility_Box\bin\Utility_Box.exp
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@ -16,7 +16,7 @@ void DataManager::setup()
|
||||
newData.push_back(dataObject);
|
||||
}
|
||||
|
||||
subscriberDevName = ""; // dev2
|
||||
subscriberDevName = "dev2"; // dev2
|
||||
setupSpacebrew();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user