本文整理汇总了C++中Pipe::checkConnections方法的典型用法代码示例。如果您正苦于以下问题:C++ Pipe::checkConnections方法的具体用法?C++ Pipe::checkConnections怎么用?C++ Pipe::checkConnections使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pipe
的用法示例。
在下文中一共展示了Pipe::checkConnections方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char** argv) {
printf("hello world\n");
time_init();
// create the atmos grid
for (int y=0; y<simulation_ht; ++y) {
for (int x=0; x<simulation_wd; ++x) {
Environment *newEnv = new Environment(8);
volumes.push_back(newEnv);
// add connections to existing volumes in a grid
if (x > 0) { // horizontal
Pipe* p = new Pipe();
newEnv->takeControlOf(&p->A),
volumes.at(y*simulation_wd + x-1)->takeControlOf(&p->B),
p->checkConnections();
pipes.push_back(p);
}
if (y > 0) { // vertical
Pipe* p = new Pipe();
newEnv->takeControlOf(&p->A);
volumes.at((y-1)*simulation_wd + x)->takeControlOf(&p->B);
p->checkConnections();
pipes.push_back(p);
}
}
}
doTiming("graph creation");
// fill a region of the grid to its capacity
for (unsigned y=simulation_ht*0.25; y<=simulation_ht*0.5; ++y) {
for (unsigned x=simulation_wd*0.25; x<=simulation_wd*0.5; ++x) {
std::vector<Molecule_ptr> &mols = getMolecules(x, y);
for (unsigned i=0; i < mols.size(); ++i) {
mols.at(i).reset(new Molecule(1337));
}
}
}
doTiming("molecule creation");
// set up the window
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize(window_wd, window_ht);
window = glutCreateWindow("atomos");
glutDisplayFunc(tick);
glutReshapeFunc(reshapeHandler);
// glutIdleFunc(AnimateScene);
glutKeyboardFunc(keyHandler);
// glutMouseFunc(mouseHandler);
doTiming("window setup");
printf("\n");
glutMainLoop();
return 0;
}