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


C++ ofPath::flagShapeChanged方法代码示例

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


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

示例1: ofxSimplifyPath

void ofxSimplifyPath(ofPath &path, int iterations, float amount, float distance) { //wat doet amount?? should be distance???
    for (int iteration=0; iteration<iterations; iteration++) {
        vector<ofSubPath> &subpaths = path.getSubPaths();
        for (int i=0; i<subpaths.size(); i++) {
            vector<ofSubPath::Command> &commands = subpaths[i].getCommands();
            if (commands.size()<amount) continue;
            for (int j=1; j<commands.size()-2; j++) { //laat eerste en laatste punt met rust
                if (commands[j].to.distance(commands[j+1].to)<distance) {
                    commands[j].to = (commands[j].to+commands[j+1].to)/2;
                    commands.erase(commands.begin()+j+1);
                }
            }
        }
    }
    path.flagShapeChanged();
}
开发者ID:Bicicletorama,项目名称:Game,代码行数:16,代码来源:ofxExtras.cpp

示例2: ofxSimplifyPath

void ofxSimplifyPath(ofPath &path, int iterations, float amount) {
    for (int iteration=0; iteration<iterations; iteration++) {
        vector<ofSubPath> &subpaths = path.getSubPaths();
        for (int i=0; i<subpaths.size(); i++) {
            vector<ofSubPath::Command> &commands = subpaths[i].getCommands();
            if (commands.size()<amount) continue;
            for (int j=0; j<commands.size()-1; j++) {
                if (commands[j].to.distance(commands[j+1].to)<3) {
                    commands[j].to = (commands[j].to+commands[j+1].to)/2;
                    commands.erase(commands.begin()+j+1);
                }
            }
        }
    }
    path.flagShapeChanged();
}
开发者ID:minusplusminus,项目名称:ofxExtras,代码行数:16,代码来源:ofxExtras.cpp

示例3: keyPressed

    void keyPressed(int key) {
        switch (key) {
            case '/': case '\\': case '$': case '#': case '|': case '%': case '@': case '^': case '&': case '_': side.setShape(key); break;
            case '3': side.is3D=!side.is3D; break;
            case '<': twists-=.5; break;
            case '>': twists+=.5; break;
            case '\'': twists=0; break;
            case '?': showHelp(); break;
            case 'a': side.toggle(); break;
            case 'b': useSubpathColors=!useSubpathColors; break;
            case 'C': canvas.createCircle(); break;
            case 'c': canvas.clear(); files.unloadFile(); break;
            case 'd': debug=!debug; refreshDebugInfo(); break;
            case 'e': print(true); break;
            case 'f': ofToggleFullscreen(); break;
            case 'k': path.setFilled(!path.isFilled()); path.flagShapeChanged(); break;
            case 'h': objectHeight+=5; if (objectHeight>maxObjectHeight) objectHeight=maxObjectHeight; break;
            case 'H': objectHeight-=5; if (objectHeight<3) objectHeight=3; break;
            case 'G': ultimaker.sendCommand("G28 X0 Y0 Z0\nM84",2); break;
            case 'A': ultimaker.sendCommand("M84"); break;
            case 'T': ultimaker.sendCommand("M109 S230"); break;
            case 'l': files.loadNext(); break;
            case 'L': files.loadPrevious(); break;
            case 'o': files.load(); break;
            case 'p': case 'm': case OF_KEY_RETURN: print(); break;
            case 'q': stop(); break;
//            case 'r': ultimaker.setRelative(); break;
            case 'S': files.save(); break;
            case 's': files.saveAs(); break;
            case '`': showSubPathLines=!showSubPathLines;
            case 't': ultimaker.sendCommand("M105",1); break;
            case 'u': case 'z': canvas.undo(); break;
            case '~': files.deleteCurrentFile(); break;
            case ' ': files.listDir(); break;
            case 'x': files.saveSvg(resourceFolder+"template.svg",documentFolder+"output.svg"); break;
            case 27: if (ultimaker.isThreadRunning()) ultimaker.stopThread(); break;
            case 'n': cloneApp(); break; //run new instance of Doodle3D
            case 'i': cout << getNumInstances() << endl; break;
        }
    }
开发者ID:Doodle3D,项目名称:Doodle3D,代码行数:40,代码来源:main.cpp


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