示例#1
0
void ofApp::draw()
{
    ofBackground(0);

    map.draw();

    ofSetColor(255, 127, 255);

    cout << map.getGeoLocationCenter() << endl;

    ofDrawBitmapStringHighlight(ofToString(map.getGeoLocationCenter()),
                                ofGetWidth() / 2,
                                ofGetHeight() / 2);

    ofVec2d mousePosition(mouseX, mouseY);

    ofDrawBitmapStringHighlight(ofToString(map.pointToTileCoordinate(mousePosition)),
                                mouseX + 16,
                                mouseY);

    ofDrawBitmapStringHighlight(ofToString(map.pointToGeolocation(mousePosition)),
                                mouseX + 16,
                                mouseY + 14);


}
示例#2
0
//--------------------------------------------------------------
void AppCore::draw() {
    ofBackground(140);
    bothKinects.draw(ofGetWidth()-bothKinects.width/4-10,10,bothKinects.width/4,bothKinects.height/4);
    contourFinder.draw(0, 0, ofGetWidth(), ofGetHeight());
    
    for (int i = 0; i < TUBE_NUM; i++){
        allPipes[i]->draw();
    }
    string mText = ofToString(mPerson->pipeID) + "/f:" + ofToString(mPerson->frequency) + "/d:" + ofToString(mPerson->diameter) + "/h:" + ofToString(mPerson->height - mPerson->length);
    ofDrawBitmapStringHighlight(mText, ofGetAppPtr()->mouseX + 5, ofGetAppPtr()->mouseY);
    
    ofSetColor(0, 0, 0);
    ofDrawBitmapStringHighlight(message, 20,ofGetHeight()-40);
    if(outputState){
        ofDrawBitmapStringHighlight("stereo audio (press a to switch)", 20, ofGetHeight()-20);
    }else{
        ofDrawBitmapStringHighlight("8-channel audio (press a to switch)", 20,ofGetHeight()-20);
    }
    

    for(int i=0; i<currentInput; i++){
        // draw center of blobs
        string pText = ofToString(i) + " " + ofToString(persons[i]->pipeID) + " " + ofToString(persons[i]->frequency);
        ofSetColor(255, 255, 0);
        ofFill();
        ofCircle(persons[i]->x, persons[i]->y, 5);
        ofDrawBitmapStringHighlight(pText, persons[i]->x+5, persons[i]->y-5);
        ofSetColor(255);
    }

}
示例#3
0
//------------------------------------------------------------------------------
void ofApp::draw()
{
    ofBackgroundGradient(ofColor::white, ofColor::black);

    if (calendarWidget)
    {
        calendarWidget->draw();
    }

    int y = 14;

    std::deque<std::string>::const_iterator iter = messages.begin();

    ofDrawBitmapStringHighlight("Events:", 20, y);

    while (iter != messages.end())
    {
        y += 14;

        ofDrawBitmapString(*iter, 20, y);

        if (y > ofGetHeight()) break;

        ++iter;
    }

    ofDrawBitmapStringHighlight("From the Current Event Description:", 20, ofGetHeight() - 45);
    ofDrawBitmapString("color: " + ofToString(currentColor), 20, ofGetHeight() - 30);
    ofDrawBitmapString("speed: " + ofToString(currentSpeed), 20, ofGetHeight() - 15);
}
示例#4
0
//--------------------------------------------------------------
void testApp::draw(){
    
    // calculate the total size needed to display all the colors
    
    float totalSize = (ceil(colorNameMap.size()/3.0)) * 50 - ofGetHeight() + 60;
    
    // map the smoothed mouse to this: 
    
    float offset = ofMap(mouseSmoothed.y, 0, ofGetHeight(), 0, totalSize, true);
    
    // draw all the colors
    // note this could be optimized, since we're drawing plenty that's offscreen here.
    
  
    
    for (unsigned int i = 0; i < colorNames.size(); i++){
    
        int x = (i % 3) * ofGetWidth()/3.0;
        int y = (floor(i / 3)) * 50;
        
        ofSetColor( colorNames[i].color );
        ofRect(0 + x, y - offset, (i%3 == 2) ? ofGetWidth() - x : ofGetWidth()/3.0, 50);
        
        ofDrawBitmapStringHighlight(colorNames[i].name, 20 + x, y -offset+30, ofColor::white, ofColor::black);
        
    }

    
    
    ofSetColor(0);
    ofRect(0, ofGetHeight()-60, ofGetWidth(), 60);
    ofDrawBitmapStringHighlight("press '1' to sort by name, '2' to sort by hue,\n'3' to sort by brightness, '4' to sort by saturation", 20, ofGetHeight()-60 + 30, ofColor::black, ofColor::white);
    
    
}
示例#5
0
//--------------------------------------------------------------
void ofApp::draw(){
    
    ofSetColor(255);
    currentImg.draw(0, 0);
    
    ofNoFill();
    ofSetColor(0, 0, 255);
    for(int i=0; i<allRects.size();i++){
        ofDrawRectangle(allRects[i]);
    }
    
    
    if(isPressed){
        ofSetColor(255);
        int w = mouseX-startPoint.x;
        int h = w; //mouseY-startPoint.y;
        currentRect = ofRectangle(startPoint.x,startPoint.y,w,h);
        
        ofDrawRectangle(currentRect);
    }
    
    ofSetColor(255);
    int str_y = 10;
    ofDrawBitmapStringHighlight("drag rect over object of interest", 10, str_y+=20);
    ofDrawBitmapStringHighlight("press x to remove last selection", 10, str_y+=20);
    ofDrawBitmapStringHighlight("use arrow keys to adjust position", 10, str_y+=20);
    ofDrawBitmapStringHighlight("press n for next image and save current data", 10, str_y+=20);
    
    ofDrawBitmapString("source: "+imageFilePaths[currentIndex], 10, ofGetHeight() - 30);
    
}
示例#6
0
//--------------------------------------------------------------
void ofApp::draw(){
    ofClear(0);
    
    //gr.getRegisteredTexture(process_occlusion).draw(0, 0, 1024, 848);
    
    
    //return;
    
    if (depthTex0.isAllocated()) {
        ofPushStyle();
        glPointSize(2);
        ecam.begin();
        ofDrawAxis(100);
        ofPushMatrix();
        ofTranslate(0, 0, -100);
        
        shader.begin();
        //shader.setUniform2f("resolution", gr.getRegisteredTexture(process_occlusion).getWidth(), gr.getRegisteredTexture(process_occlusion).getHeight());
        //shader.setUniformTexture("colorTex", gr.getRegisteredTexture(process_occlusion), 0);
        
        mesh.draw();
        shader.end();
        
        ofPopMatrix();
        ecam.end();
        ofPopStyle();
    }
    
    ofDrawBitmapStringHighlight(ofToString(ofGetFrameRate()), 10, 20);
    ofDrawBitmapStringHighlight("Device Count : " + ofToString(ofxMultiKinectV2::getDeviceCount()), 10, 40);

}
示例#7
0
//--------------------------------------------------------------
void ofApp::draw(){
    ofPushStyle();
    ofEnableBlendMode(OF_BLENDMODE_ADD);
    ofEnablePointSprites();
    cam.begin();
    render.begin();

    // パーティクルの位置と経過時間

    render.setUniformTexture("u_posAndAgeTex", pingPong.src->getTextureReference(0), 0);
    particles.draw();
    render.end();
    cam.end();
    ofDisablePointSprites();
    ofPopStyle();
    
    if(showTex){
        ofPushStyle();
        ofEnableBlendMode(OF_BLENDMODE_ALPHA);
        pingPong.dst->getTextureReference(0).draw(0,0);
        ofDrawBitmapStringHighlight("Position", 0,14);
        pingPong.dst->getTextureReference(1).draw(texRes,0);
        ofDrawBitmapStringHighlight("Velocity", texRes,14);
        ofPopStyle();
    }
    ofDrawBitmapStringHighlight(ofToString(ofGetFrameRate()), 0,ofGetHeight() - 2);
}
示例#8
0
//--------------------------------------------------------------
void ofApp::draw(){
    cout << stat << endl;
//    ofLog() << stat << endl;
    
    time = ofGetElapsedTimef() - timeStamp;
    string s;
    for (int i =0; i < fiveSeconds.size(); i++) {
        s += ofToString(i+1) + ": " + ofToString(fiveSeconds[i]) + "  ";
    }
    
    ofDrawBitmapStringHighlight(s, 20, 80);
    
    switch (stat) {
        case s01:
            ofDrawBitmapStringHighlight("type space key for 5 seconds", 20, 20);
            break;
            
        case s02:
            ofDrawBitmapStringHighlight("type space key for 5 seconds", 20, 20);
            break;
            
        case s03:
            ofDrawBitmapStringHighlight("your score is  " + ofToString(fiveSeconds.back()), 20,20);
            ofDrawBitmapStringHighlight("best score is  " + ofToString(bestScore), 20, 50);
            break;
            
        default:
            break;
            
    }
}
示例#9
0
//--------------------------------------------------------------
void ofApp::draw(){

    string output = "";

    string pointSprites = ((info.bPointSpritesSupported == true) ? "yes" : "no");
    string shaders = ((info.bShadersSupported == true) ? "yes" : "no");
    string vbo = ((info.bVboSupported == true) ? "yes" : "no");


    output += "opengl version: " + info.version + "\n";
    output += "vendor: " + info.vendor + "\n";
    output += "renderer: " + info.renderer + "\n";
    output += "\n";
    output += "point sprites support: " + pointSprites + "\n";
    output += "shader support: " + shaders + "\n";
    output += "vbo support: " + vbo + "\n";
    output += "\n";
    output += "max texture size: " + ofToString(info.maxTextureSize) + "\n";
    output += "max viewport dimensions: " + ofToString(info.maxDimensions[0]) + "," +  ofToString(info.maxDimensions[1]) + "\n";
    output += "max lights: " + ofToString(info.maxLights) + "\n";



    ofDrawBitmapStringHighlight(output, ofPoint(20,20));
    ofDrawBitmapStringHighlight("press ' ' to load full report", ofPoint(20,220), ofColor::magenta, ofColor::white);

}
示例#10
0
//--------------------------------------------------------------
void ofApp::draw(){

    ofBackgroundGradient(100, 0);

    //if image exists, draw it
    if(receivedImage.getWidth() > 0){
        ofSetColor(255);
        receivedImage.draw(ofGetWidth()/2-receivedImage.getWidth()/2,
         ofGetHeight()/2-receivedImage.getHeight()/2);
    }

    //draw recent unrecognized messages
    for(int i = 0; i < NUM_MSG_STRINGS; i++){
        ofDrawBitmapStringHighlight(msg_strings[i], 10, 40 + 15 * i);
    }

    string buf = "listening for osc messages on port : " + ofToString(PORT);
    ofDrawBitmapStringHighlight(buf, 10, 20);





    // draw mouse state
    ofPoint mouseIn(mouseXf*ofGetWidth(),mouseYf*ofGetHeight());
    if (mouseButtonInt == 0) {
        ofSetColor(255);
    }else ofSetColor(ofColor::salmon);
    ofDrawCircle(mouseIn, 20);
    ofDrawBitmapStringHighlight(mouseButtonState, mouseIn);


}
示例#11
0
//--------------------------------------------------------------
void testApp::draw(){
        
    vector< string > callHistory ;

    string currentUrl = ipAddress + "/api/" + username + "/" + apiMethod ;
    stringstream ss ;
    ss << "Current API Call : " << currentUrl << endl ;
    
    for ( int i = 0 ; i < callHistory.size() ; i++ )
    {
        ss << i << "| " << callHistory[i] << endl ;
    }
    
    ss << endl << endl ;
    ss << "last HTTP response : " << endl ; 
    ss << lastHttpResponse.data.getText() << endl ;
    
    
    if ( lightbulbs.size() > 0 )
    {
        float x = 375 ;
        float yStart = 250 ;
        float ySpacing = 105 ;
        for ( int i = 0 ; i < lightbulbs.size() ; i++ )
        {
            
            lightbulbs[ i ]->draw( x , ySpacing * i + yStart ) ; 
            
        }
    }
    ofDrawBitmapStringHighlight( ss.str() , 400 , 15 ) ;
    
    ofDrawBitmapStringHighlight(requestStr,400,500);
	ofDrawBitmapStringHighlight(responseStr,400,560);
}
void ofxDynamicBackgroundCV::drawDebug(float scale) //default:1.0
{
    float scaledWidth = frameMat.size().width*scale;
    float scaledHeight = frameMat.size().height*scale;
    ofColor color1 = ofColor::black;
    ofColor color2 = ofColor::yellow;
    
    ofxCv::drawMat(frameMat, 0, 0, scaledWidth, scaledHeight);
    ofDrawBitmapStringHighlight("frameMat", 0, 20, color1, color2);
    
    ofPushMatrix();
        ofTranslate(0, scaledHeight);
            ofxCv::drawMat(backgroundOutputMat, 0, 0, scaledWidth, scaledHeight);
            ofDrawBitmapStringHighlight("backgroundOutputMat", 0, 20, color1, color2);
    ofPopMatrix();

    ofPushMatrix();
        ofTranslate(scaledWidth, 0);
            ofxCv::drawMat(accumulatorMat, 0, 0, scaledWidth, scaledHeight);
            ofDrawBitmapStringHighlight("accumulatorMat", 0, 20, color1, color2);
    ofPopMatrix();
    return;
    
    ofPushMatrix();
        ofTranslate(scaledWidth, scaledHeight);
            getImageRef().draw(0, 0, scaledWidth,scaledHeight);
            ofDrawBitmapStringHighlight("backgroundOutputImage", 0, 20, color1, color2);
    ofPopMatrix();
}
示例#13
0
//--------------------------------------------------------------
void testApp::draw(){
    ofBackground(0);

    // draw original subject in lower left-hand corner
    if(!bUseImage) {
        ofFill(); ofSetColor(subjectColor, 80);
        ofRect(10, ofGetHeight() - subjectRect.height - 10, subjectRect.width, subjectRect.height);
    } else {
        ofFill(); ofSetColor(255);
        img.draw(10, ofGetHeight() - subjectRect.height - 10, subjectRect.width, subjectRect.height);
    }
    // draw original subject frame in lower left-hand corner
    ofNoFill(); ofSetColor(subjectColor, 120);
    ofRect(10, ofGetHeight() - subjectRect.height - 10, subjectRect.width, subjectRect.height);
    // draw original subject label
    ofSetColor(255);
    ofDrawBitmapStringHighlight("SUBJECT", 16, ofGetHeight() - 20);
    
    // draw original target in lower right-hand corner
    ofFill(); ofSetColor(targetColor, 80);
    ofRect(ofGetWidth() - targetRect.width - 10, ofGetHeight() - targetRect.height - 10, targetRect.width, targetRect.height);
    // draw original target frame in lower right-hand corner
    ofNoFill(); ofSetColor(targetColor, 120);
    ofRect(ofGetWidth() - targetRect.width - 10, ofGetHeight() - targetRect.height - 10, targetRect.width, targetRect.height);
    ofSetColor(255);
    ofDrawBitmapStringHighlight("TARGET", ofGetWidth() - 65, ofGetHeight() - 20);    
    
    // draw target rectangle in center
    drawAlignRect(targetRect,  targetColor,  target_hAlign,  target_vAlign, false);
    
    // draw aligned / scaled subject with respect to the target
    drawAlignRect(workingSubjectRect, subjectColor, subject_hAlign, subject_vAlign, bUseImage);

    // make the menu
    stringstream ss;
    
    int tab = 20;
    ss << "Keys:" << endl;
    ss << "----------------------------------------------------------" << endl;
    ss << " New Subject / Target (space) " << endl;
    ss << " Use An Image Subject (i) = " << (bUseImage ? "YES" : "NO") << endl;
    ss << "----------------------------------------------------------" << endl;
    ss << "  Enable Custom Align (A) = " << (isAligning && !isRectScaling ? "YES" : "NO") << endl;
    ss << "  Subject ofAlignHorz (h) = " << (isAligning && !isRectScaling ? getHorzAlignString(subject_hAlign) : "-") << endl;
    ss << "    Model ofAlignHorz (H) = " << (isAligning && !isRectScaling ? getHorzAlignString(target_hAlign)  : "-") << endl;
    ss << "  Subject ofAlignVert (v) = " << (isAligning && !isRectScaling ? getVertAlignString(subject_vAlign) : "-") << endl;
    ss << "    Model ofAlignVert (V) = " << (isAligning && !isRectScaling ? getVertAlignString(target_vAlign)  : "-") << endl;
    ss << "----------------------------------------------------------" << endl;
    ss << "Enable Custom Scaling (S) = " << (isScaling && !isRectScaling ? "YES" : "NO") << endl;
    ss << "    ofAspectRatioMode (a) = " << (isScaling && !isRectScaling ? getAspectRatioModeString(aspectRatioMode) : "-") << endl;
    ss << "----------------------------------------------------------" << endl;
    ss << " Override Scale/Align (r) = " << (isRectScaling ? "YES" : "NO") << endl;
    ss << "          ofScaleMode (s) = " << (isRectScaling ? getScaleModeString(scaleMode) : "-") << endl;

    // draw the menu
    ofSetColor(255);
    ofDrawBitmapString(ss.str(), 10, 14);

}
示例#14
0
void ofApp::draw()
{
    inkSim.draw();
    gui.draw();
    
    ofDrawBitmapStringHighlight("drag mouse to stroke", 10, ofGetHeight() - 40);
    ofDrawBitmapStringHighlight("press ' ' to hide gui", 10, ofGetHeight() - 20);
}
示例#15
0
//--------------------------------------------------------------
void ofApp::draw(){

	dShow.draw();
	shader.end();

	ofDrawBitmapStringHighlight("system fps : " + ofToString(ofGetFrameRate()), 30, 20);
	ofDrawBitmapStringHighlight("vlc fps : " + ofToString(dShow.getFps()), 30, 40);
}
示例#16
0
//--------------------------------------------------------------
void testApp::draw(){
    
    // Print tweets:
    
    int maxLineSize = 90;
    
    if(twitterClient.getTotalLoadedTweets() > 0) {
        
        tweet = twitterClient.getTweetByIndex(actualTweet);
        
        ofSetColor(255, 255, 255, 125);
        if(tweet.isBannerImageLoaded()) {
            tweet.user.profile_banner.draw(0, 0, ofGetWidth(), ofGetHeight());
        }
        
        ofSetColor(0);
        
        ofDrawBitmapString("User:"******"Location:", ofPoint(120,180));
        ofDrawBitmapStringHighlight(tweet.user.location, ofPoint(220,180));
        
        ofDrawBitmapString("Descript.:", ofPoint(120,210));
        string desc = tweet.user.description;
        for(int i=0;i<(desc.length()/maxLineSize)+1;i++) {
            ofDrawBitmapStringHighlight(desc.substr(i*maxLineSize,maxLineSize), ofPoint(220,210+(30*i)));
        }
        
        ofDrawBitmapString("Text:", ofPoint(120,300));
        string text = tweet.text;
        for(int i=0;i<(text.length()/maxLineSize)+1;i++) {
            ofDrawBitmapStringHighlight(text.substr(i*maxLineSize,maxLineSize), ofPoint(220,300+(30*i)));
        }
        
        ofSetColor(255, 255, 255);
        if(tweet.isProfileImageLoaded()) {
            tweet.user.profile_image.draw(40, 150);
        }
        
        ofSetColor(0);
        string nav = "Now showing tweet: " + ofToString(actualTweet+1) + " of "+ofToString(twitterClient.getTotalLoadedTweets());
        ofDrawBitmapString(nav, ofPoint(220,420));
        
    }
    
    ofSetColor(0);
    string info;
    info += "ofxTwitter query example:";
    info += "\nPress 'q' to get tweets containing 'cat'";
    info += "\nPress 's' to get tweets containing 'cat' with more advanced options";
    info += "\nPress 'l' to load previous query from disk if avilable";
    info += "\nPress UP/DOWN to navigate tweets";
    ofDrawBitmapString(info, ofPoint(20,20));
    
    twitterClient.printDebugInfo();
    
}
示例#17
0
//--------------------------------------------------------------
void testApp::draw(){
    
    
    ofDrawBitmapStringHighlight(comboVals[comboVal] , ofPoint(400,30));
    ofDrawBitmapStringHighlight(ofToString(sliderVal), ofPoint(400,60));
    ofDrawBitmapStringHighlight(enteredText, ofPoint(400,90));
    
    
}
示例#18
0
//--------------------------------------------------------------
void ofApp::draw(){

	// Draw Jordi's color
	ofSetColor(colorJordi);
	ofRect(100, 100, 100, 100);
	ofDrawBitmapStringHighlight("Jordi's color", 100,200);
	
	ofSetColor(colorLaly);
	ofRect(300, 500, 200, 100);
	ofDrawBitmapStringHighlight("Laly's color", 300,600);
}
示例#19
0
void ofApp::draw(){

	// (re) load shader
	if (isShaderDirty){
		mShd1 = shared_ptr<ofShader>(new ofShader());
		mShd1->load("shaders/lut.vert","shaders/lut.frag");
		isShaderDirty = false;
	}

	ofBackground(ofColor::black);

	// Display the colour graded image texture by drawing the canvas geometry with
	// LUT texture and the image texture bound manually.
	ofPushMatrix();
	mShd1->begin();
	{
		// Bind textures:

		// 1. bind the render texture
		// mShd1->setUniformTexture("tex_unit_0", mVid.getTexture(), 0); // use this if you want to use a video =)
		mShd1->setUniformTexture("tex_unit_0", mTex1, 0);

		// 2. bind the LUT 3D texture - we don't need any 3d texture coordinates for this texture,
		// we just need to pass it as texture unit 1, and bind it to the GL_TEXTURE_3D texture
		// target.
		{
			// we have to roll our own binding here,
			// since oF does not yet support 3d textures
			glActiveTexture(GL_TEXTURE0 + mLutTexID);
			glBindTexture(GL_TEXTURE_3D, mLutTexID);
			mShd1->setUniform1i("tex_unit_1", 1);
			glActiveTexture(GL_TEXTURE0);
		}

		float texProportions = mTex1.getHeight() / mTex1.getWidth();
		// make sure our canvas respects the aspect ratio of the texture we want to colour grade.
		ofScale(ofGetWidth(), ofGetWidth() * texProportions);

		// this is where the magic happens
		mVbo1.draw();
	}
	mShd1->end();
	ofPopMatrix();

	ofSetColor(ofColor::white);
	ofDrawBitmapStringHighlight("Drag & Drop lut png to change lookup table.", 10, 20);

	// draw our status message if it is not older than 2 seconds
	if (ofGetElapsedTimeMillis() - whenStatusAppeared < 2000) {
		ofDrawBitmapStringHighlight(currentStatus, 10, 20 + 20);
	}
}
示例#20
0
 void draw() {
     cam.draw(0, 0);
     
     ofPushStyle();
     ofNoFill();
     ofSetLineWidth(2);
     for(int i = 0; i < results.size(); i++) {
         ofDrawRectangle(results[i]);
         ofDrawBitmapStringHighlight(ofToString(i), results[i].getPosition() + ofPoint(-5,-5));
     }
     ofPopStyle();
     
     ofDrawBitmapStringHighlight("press any key to track", 10,20);
 }
示例#21
0
//--------------------------------------------------------------
void ofApp::draw(){

	float y = 1;
	float angle; ofVec3f axis;

	ofDrawBitmapStringHighlight("Connected bands: " + ofToString(myo.numConnectedArmbands()), 20, 20 * y);

	for (int i = 0; i < myo.numConnectedArmbands(); i++) {

		ofxMyoWebSockets::Armband* armband = myo.armbands[i];

		cam.begin();
		ofDrawGrid(250, 5);

		ofVec3f pos = armband->quat * ofVec3f(300, 0, 0);
		ofSetColor( ofColor::fromHsb((float)i/myo.numConnectedArmbands()*255, 225, 225) );
		ofDrawArrow( ofVec3f(0, 0, 0), pos, 8 );

		cam.end();

		y++;

		ofDrawBitmapStringHighlight("Armband " + ofToString(i), 20, 20 * ++y);
		ofDrawBitmapStringHighlight("Myo ID: " + ofToString(armband->id), 20, 20 * ++y);
		ofDrawBitmapStringHighlight("Arm: " + armband->arm, 20, 20 * ++y);
		ofDrawBitmapStringHighlight("X Direction: " + armband->direction, 20, 20 * ++y);
		ofDrawBitmapStringHighlight("Pose: " + armband->pose, 20, 20 * ++y);
		ofDrawBitmapStringHighlight("Pose Confirmed: " + ofToString(armband->poseConfirmed), 20, 20 * ++y);
		ofDrawBitmapStringHighlight("Unlocked: " + ofToString(armband->unlocked), 20, 20 * ++y);
		
	}

}
示例#22
0
//--------------------------------------------------------------
//* Debug Data
//--------------------------------------------------------------
//--------------------------------------------------------------
void ofApp::drawData()
{
    ofSetColor(255);
    string title = "Shadowing " + ofToString(ofGetTimestampString("%H:%M:%S  %d/%m/%Y"));
    stringstream debugData;
    debugData << title << endl;
    debugData << "Unit " << "City Centre" << endl;
    
    debugData << endl;
    debugData << "BUFFERS" << endl;
    debugData << "Maximum Buffer Size: " << howManyBuffersToStore << endl;
    debugData << "Current Buffer Size: " << buffers.size() << endl;
    debugData << "Currently Playing Buffer: " << whichBufferAreWePlaying << endl;
    debugData << endl;
    
    if (!buffers.empty())
    {
        for (int i = 0; i < buffers.size(); i++)
        {
            debugData << "Buffer " << i+1 << " has " << buffers[i].getNumberOfFrames() << " Frames" << endl;
        }
    }
    debugData << endl;
    debugData << "OPENCV" << endl;
    debugData << "Currently Tracking " << openCV.getNumberOfBlobs() << " Number of Blobs " << endl;
    debugData << endl;
    debugData << "FBO Current Brightness " << backColor.getBrightness() << endl;
    debugData << endl;
    debugData << "Current Mode: " << modeString << endl;

    debugData << endl;
    debugData << endl;
    
    debugData << "HTTP Status" << endl;
    debugData << responseStr << endl;
    debugData << requestStr << endl;
    
    
    
    if (showPreviousBuffers == true)
    {
        ofDrawBitmapStringHighlight(debugData.str(), 80,10);
    }
    else
    {
        ofDrawBitmapStringHighlight(debugData.str(), 5,10);
    }
    
}
示例#23
0
//--------------------------------------------------------------
void ofApp::draw(){
    
    // draw a blue rectangle for meditation
    ofSetColor(0, 174, 240);
    float meditationScaled = ofMap(meditation, 0, 100, 0, ofGetHeight());
    ofRect(0, ofGetHeight(), ofGetWidth()*.5, -meditationScaled);
    ofDrawBitmapStringHighlight(ofToString(meditation), ofGetWidth()*.25, ofGetHeight()-50);
    
    // draw a red rectangle for attention
    ofSetColor(255, 107, 130);
    float attentionScaled = ofMap(attention, 0, 100, 0, ofGetHeight());
    ofRect(ofGetWidth()*.5, ofGetHeight(), ofGetWidth()*.5, -attentionScaled);
    ofDrawBitmapStringHighlight(ofToString(attention), ofGetWidth()*.75, ofGetHeight()-50);
 
}
//--------------------------------------------------------------
void testApp::draw(){
    
    ofPushMatrix();
    ofTranslate(300, 180);
    shader.begin();
    shader.setUniformTexture("tex", image.getTextureReference(), 0);
    shader.setUniform1f("time", (ofGetElapsedTimeMillis()%1000)/1000.);
    mesh.draw();
    shader.end();
    ofPopMatrix();
    
    /////////////////////////////////////////////////////////
    // Some info:
    /////////////////////////////////////////////////////////
    
    string info;
    info = "ofShader.\n\n";
    info += "Instructions:\n";
    info += "You can find the shaders in the data folder of the example.\n";
    info += "A shader is a small program that runs on the graphics card (GPU).\n";
    info += "The vertex shader handles the geometry / The fragment shader handles how fragment (!=pixels) are rendered.\n";
    
    ofDrawBitmapStringHighlight(info, ofPoint(10,20));
    
    diagram.draw(ofGetWidth()-510, ofGetHeight()-115);
    
}
void Model::drawDebug()
{

    int w = 400;
    for (int i = 0; i < pieces.size(); i++)
    {
        int h = pieces.at(i).instancedAnimTextre.getHeight();
        pieces.at(i).instancedAnimTextre.draw(0, i * h,
                                              pieces.at(i).instancedAnimTextre.getWidth(),
                                              h);
    }
    
    ofDrawBitmapStringHighlight("mesh parts = " + ofToString(pieces.size()), w + 10, 10);
    ofDrawBitmapStringHighlight("ttl anim frame = " + ofToString(pieces.at(0).bmfs.size()-1), w + 10, 35);
    ofDrawBitmapStringHighlight("num instance = " + ofToString(pieces.at(0).instancedAnimTextre.getHeight()), w + 10, 60);
}
示例#26
0
void VisionDebug::draw(const std::string& label,
                       const std::string& value,
                       float x,
                       float y,
                       float width,
                       float height)
{
    ofPushStyle();
    
    ofFill();
    ofSetColor(0, 200);
    ofDrawRectangle(x, y, width, height);

//    ofFill();
//    ofSetColor(127, 200);
//    ofDrawRectangle(x, y, width * value, height);

    ofSetColor(255);
    ofDrawBitmapStringHighlight(label + "(" + value + ")", x + 5, y + 14);

    ofNoFill();
    ofSetColor(255, 200);
    ofDrawRectangle(x, y, width, height);

    ofPopStyle();
}
示例#27
0
void testApp::draw(){
	http.draw(30,30);
	ofSetColor(255);

	//clock hand to see threading in action
	ofPushMatrix();
	ofTranslate(ofGetWidth() - 60,60, 0);
	ofRotate( ofGetFrameNum() * 3, 0,0,1);
    ofSetColor(255,255,255);
	float h = 5;
	ofRect(-h/2,h/2, h,50);
	ofPopMatrix();

	//instructions
	ofDrawBitmapStringHighlight("press '1' to download asset to disk on a bg thread\n"
								"press '2' to download asset to disk blocking (main thread)\n"
								"press '3' to download asset to RAM on bg thread\n"
								"press '4' to download asset to RAM blocking (main thread)\n"
								"press '5' to download multiple assets to Disk on main thread\n"
								"press '6' call an https based API, print result on console\n"
								"press '7' to download (copy) a local file (file:// url)\n"
								"press 'c' to cancel current download\n"
								"press 'C' to cancel current download and empty queue",
								20,
								ofGetHeight() - 133
								);


}
示例#28
0
void ofxPiMapper::draw() {
    if (!isSetUp) {
        return;
    }
    
    gui.draw();
    
    if (bShowInfo){
        stringstream ss;
        ss << "There are 4 modes:\n\n";
        ss << " 1. Presentation mode\n";
        ss << " 2. Texture mapping mode\n";
        ss << " 3. Projection mapping mode\n";
        ss << " 4. Source selection mode\n\n";
        ss << "You can switch between the modes by using <1>, <2>, <3> and <4> "
        "keys on the keyboard.\n\n";
        ss << "Press <t> to add new triangle surface\n";
        ss << "Press <q> to add new quad surface\n";
        ss << "Press <s> to save the composition\n";
        ss << "Press <f> to toggle fullscreen\n";
        ss << "Press <i> to hide this message";
        ofDrawBitmapStringHighlight(ss.str(), 10, 20, 
            ofColor(0, 0, 0, 100),
            ofColor(255, 255, 255, 200));
    }

    _application->draw();
} // draw
//--------------------------------------------------------------
void ofApp::draw(){
	
	if (doShader)
	{
		fbo.draw(0, 0);		
	}else 
	{
		videoGrabber.draw();
	}

	stringstream info;
	info << "APP FPS: " << ofGetFrameRate() << "\n";
	info << "Camera Resolution: " << videoGrabber.getWidth() << "x" << videoGrabber.getHeight()	<< " @ "<< videoGrabber.getFrameRate() <<"FPS"<< "\n";
	info << "CURRENT FILTER: " << filterCollection.getCurrentFilterName() << "\n";
	info << "SHADER ENABLED: " << doShader << "\n";
	//info <<	filterCollection.filterList << "\n";
	
	info << "\n";
	info << "Press e to increment filter" << "\n";
	info << "Press g to Toggle info" << "\n";
	info << "Press s to Toggle Shader" << "\n";
	
	if (doDrawInfo) 
	{
		ofDrawBitmapStringHighlight(info.str(), 100, 100, ofColor::black, ofColor::yellow);
	}
	
	//
}
示例#30
0
//--------------------------------------------------------------
void ofApp::draw(){

    // display sent messages
    stringstream sendOutput;
    sendOutput << "SENT MESSAGES..." << endl;
    for(int i = sentMessages.size()-1; i >= 0; i--) {
        sendOutput << sentMessages[i] << endl;
    }
    ofSetColor(0);
    ofDrawBitmapString(sendOutput.str(), 20, 80);
    
    // display received messages
    stringstream receiveOutput;
    receiveOutput << "RECEIVED MESSAGES..." << endl;
    for(int i = receivedMessages.size()-1; i >= 0; i--) {
        receiveOutput << receivedMessages[i] << endl;
    }
    ofSetColor(0);
    ofDrawBitmapString(receiveOutput.str(), ofGetWidth()*.5, 80);

    
    stringstream s;
    s << "Poco TCP Reactor Client" << endl;
    s << "Connected: " << client.isConnected() << endl;
    s << "Fps: " << ofGetFrameRate();
    ofDrawBitmapStringHighlight(s.str(), 20, 20);
}