void Solve::solve(FILE *fin, FILE *fout) { fscanf(fin, "%d" VAL_T_FMT, &n, &m); a[0] = 0; for(int i = 1; i <= n; i ++) fscanf(fin, "%d", &a[i]); initBound(); for(int i = 1; i <= n; i ++) f[i] = INFINITY; workOpt(fin, fout); }
void apply(osg::PagedLOD& plod) { if (s_ExitApplication) return; ++_currentLevel; initBound(); // first compute the bounds of this subgraph for(unsigned int i=0; i<plod.getNumFileNames(); ++i) { if (plod.getFileName(i).empty()) { traverse(plod); } } if (intersects()) { for(unsigned int i=0; i<plod.getNumFileNames(); ++i) { osg::notify(osg::INFO)<<" filename["<<i<<"] "<<plod.getFileName(i)<<std::endl; if (!plod.getFileName(i).empty()) { std::string filename; if (!plod.getDatabasePath().empty()) { filename = plod.getDatabasePath() + plod.getFileName(i); } else { filename = plod.getFileName(i); } osg::ref_ptr<osg::Node> node = readNodeFileAndWriteToCache(filename); if (!s_ExitApplication && node.valid()) node->accept(*this); } } } --_currentLevel; }
void Mesh::Init() { initBound(); }