当前位置: 首页>>代码示例>>C++>>正文


C++ ofPolyline::getBoundingBox方法代码示例

本文整理汇总了C++中ofPolyline::getBoundingBox方法的典型用法代码示例。如果您正苦于以下问题:C++ ofPolyline::getBoundingBox方法的具体用法?C++ ofPolyline::getBoundingBox怎么用?C++ ofPolyline::getBoundingBox使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ofPolyline的用法示例。


在下文中一共展示了ofPolyline::getBoundingBox方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: calibrationDone

void testApp::calibrationDone(ofPolyline &_surface){
    ofLog(OF_LOG_NOTICE, "Calibration done");
    
    if ( bStart )
        killGame();
    
    if (activeGameName == "simon"){
        game = new Simon();
    } else if (activeGameName == "pong"){
        game = new Pong();
    } else if (activeGameName == "shadows"){
        game = new Shadows();
    } else if (activeGameName == "oca"){
        game = new Oca();
    } else if (activeGameName == "communitas"){
        game = new Communitas();
    } else if (activeGameName == "kaleido"){
        game = new Kaleido();
    }
    
    if (game != NULL){
        ofLog(OF_LOG_NOTICE, "Game " + activeGameName + " loaded");
        game->init( _surface.getBoundingBox() );
        iSurface.setTrackMode( game->getTrackMode() );
        bStart = true;
    } else {
        ofLog(OF_LOG_ERROR, "Game " + activeGameName + " not loaded.");
        bStart = false;
    }
}
开发者ID:patriciogonzalezvivo,项目名称:mesaDelTiempo,代码行数:30,代码来源:testApp.cpp

示例2: draw_featEnMarco

void scanner_faces::draw_featEnMarco(ofPolyline feat, int gap, bool uu, bool rr) {
	
	ofRectangle featRect;
	featRect = feat.getBoundingBox();
	featRect.x-=gap;
	featRect.y-=gap;
	featRect.width+=2*gap;
	featRect.height+=2*gap;
	
	ofSetLineWidth(1);
	if(rr) {
		ofLine(marco.rect.x-marco.gap, featRect.y, featRect.x, featRect.y);
		ofLine(marco.rect.x-marco.gap, featRect.y+featRect.height, featRect.x, featRect.y+featRect.height);
	}
	else {
		ofLine(marco.rect.x+marco.rect.width+marco.gap, featRect.y, featRect.x, featRect.y);
		ofLine(marco.rect.x+marco.rect.width+marco.gap, featRect.y+featRect.height, featRect.x, featRect.y+featRect.height);
	}
	
	if(uu) {
		ofLine(featRect.x, featRect.y, featRect.x, marco.rect.y-marco.gap);
		ofLine(featRect.x+marco.rect.width, featRect.y, featRect.x+marco.rect.width+marco.gap, featRect.y);
	}
	else {
		ofLine(featRect.x, featRect.y, featRect.x, marco.rect.y+marco.rect.height+marco.gap);
		ofLine(featRect.x+featRect.width, featRect.y, 
			   featRect.x+featRect.width, marco.rect.y+marco.rect.height+marco.gap);
	}
	
	ofSetLineWidth(2.5);
	ofRect(featRect);
	
}
开发者ID:serman,项目名称:muncyt,代码行数:33,代码来源:scanner_faces.cpp

示例3: oscSendContour

void testApp::oscSendContour(int label, const ofPolyline &polyline){
    ofxOscMessage m;
    stringstream ss;
    ss<<"/contour";
    m.setAddress(ss.str());
    
    int size = polyline.size();
    m.addIntArg(label);
    m.addIntArg(size);
    cout<<"contour: "<<label<<" size: "<<size<<endl;
    const ofRectangle& rect = polyline.getBoundingBox();
    m.addIntArg(rect.getTopLeft().x);
    m.addIntArg(rect.getTopLeft().y);
    m.addIntArg(rect.getBottomRight().x);
    m.addIntArg(rect.getBottomRight().y);
    ofPolyline newLine = polyline.getResampledByCount(100);
    cout<<"resized to "<<newLine.size()<<endl;
//    newLine.draw();
    
    if(bSendContours){
        const vector<ofPoint> points = newLine.getVertices();
        for(int i=0; i< newLine.size(); i++){
            m.addFloatArg(points[i].x);
            m.addFloatArg(points[i].y);
        }
    }
    sender.sendMessage(m);
}
开发者ID:kinetecharts,项目名称:multiTracker,代码行数:28,代码来源:testApp.cpp

示例4: compareBoundingBox

/*
 * This function takes a polyline and checks whether its bounding box (along the x-axis) is within that of the face's.
 * This is more reliable than simply checking whether that polyline's centroid lies within the face's bounding box because we
 * get rid of ancilliary polylines that might cover huge regions of the image plane (and thus have valid centroids) but aren't
 * necessarily part of the facial features.
 */
bool FaceScanner::compareBoundingBox(ofPolyline &other, float distThreshold)
{
    ofRectangle otherRect = other.getBoundingBox();
    if ( otherRect.x > (m_faceBoundingBox.x - MIN_HORZ_DISTANCE_TO_FACE) &&
        (otherRect.x + otherRect.width) < (m_faceBoundingBox.x + m_faceBoundingBox.width + MIN_HORZ_DISTANCE_TO_FACE) &&
         otherRect.y > (m_faceBoundingBox.y - MIN_VERT_DISTANCE_TO_FACE) &&
        (otherRect.y + otherRect.height) < (m_faceBoundingBox.y + m_faceBoundingBox.height + MIN_VERT_DISTANCE_TO_FACE))
    {
        return true;
    }
    
    return false;
}
开发者ID:mwalczyk,项目名称:Collective-Portrait,代码行数:19,代码来源:faceScanner.cpp


注:本文中的ofPolyline::getBoundingBox方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。