本文整理汇总了C++中ofPolyline::close方法的典型用法代码示例。如果您正苦于以下问题:C++ ofPolyline::close方法的具体用法?C++ ofPolyline::close怎么用?C++ ofPolyline::close使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ofPolyline
的用法示例。
在下文中一共展示了ofPolyline::close方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ofxPolylineLoad
void ofxPolylineLoad(ofPolyline & poly, string xmlPath) {
ofXml xml;
bool bLoaded = xml.load(xmlPath);
if(bLoaded == false) {
return;
}
xml.setTo("poly");
bool bClosed = ofToInt(xml.getAttribute("closed"));
poly.clear();
int numOfPoints = xml.getNumChildren();
for(int i=0; i<numOfPoints; i++) {
xml.setToChild(i);
float x = ofToFloat(xml.getAttribute("x"));
float y = ofToFloat(xml.getAttribute("y"));
poly.addVertex(x, y);
}
if(bClosed == true) {
poly.close();
}
}
示例2: ofRandom
curvedSquare::curveSquare()
{
x = 100;
y = 100;
speedX = ofRandom(-1, 1); // and random speed and direction
speedY = ofRandom(-1, 1);
dim = 20;
myPoly.addVertex(x,y);
myPoly.bezierTo(x,y,x-6,y+1,x-9, y+6);
myPoly.bezierTo(x-12,y+9,x-12,y+17,x-12,y+17);
myPoly.addVertex(x-12,y+44);
myPoly.addVertex(x+14,y+44);
myPoly.bezierTo(x+14,y+44,x+22,y+44,x+26,y+41);
myPoly.bezierTo(x+30,y+38,x+30,y+32,x+30,y+32);
myPoly.addVertex(x+30,y);
myPoly.addVertex(x+30,y);
myPoly.close();
}
示例3: close
void Clipper::close(ofPolyline& polyline)
{
polyline.close();
}