Пример #1
0
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);
}
Пример #2
0
    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;
    }
Пример #3
0
	void Mesh::Init() {
		initBound();
	}