Beispiel #1
0
	void SimSystem::setSimulator( Agents::SimulatorInterface * sim, BFSM::FSM * fsm, const std::string & outFileName, const std::string & scbVersion ) {
		setSimulator( sim, fsm );
		try {
			_scbWriter = new Agents::SCBWriter( outFileName, scbVersion, sim );
		} catch ( Agents::SCBFileException ) {
			std::string msg( "Unable to create SCB file: ");
			msg += outFileName;
			throw SimSystemFatalException( msg );
		}
	}
Beispiel #2
0
int SimViewer::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QDialog::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: setSimulator((*reinterpret_cast< const Quackle::Simulator(*)>(_a[1]))); break;
        case 1: done(); break;
        }
        _id -= 2;
    }
    return _id;
}
Beispiel #3
0
int AveragesTab::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: setSimulator((*reinterpret_cast< const Quackle::Simulator(*)>(_a[1]))); break;
        case 1: { QString _r = statisticTable((*reinterpret_cast< const Quackle::Simulator(*)>(_a[1])));
            if (_a[0]) *reinterpret_cast< QString*>(_a[0]) = _r; }  break;
        case 2: explain(); break;
        }
        _id -= 3;
    }
    return _id;
}
Beispiel #4
0
Game::Game() : univers(), simulator(&univers)
{
        glClearColor(BACKGROUND_COLOR);

#ifdef FULLSCREEN
                glutFullScreen();
#endif
        
        
        setSimulator(&simulator);
        setUnivers(&univers);
        
	Vvector pos(0, 0, 0);
	Vvector addx(10, 0, 0);
	Vvector addy(0, 10, 0);
	
	for (int i = 0; i < 48; i++) {
	for (int j = 0; j < 48; j++) {
		this->univers.addPlanet("Torus", pos);
		pos += addx;
	}
		pos = Vvector(0, pos.y() + addy.y(), pos.z());
	}
	
	
        {
                glutIgnoreKeyRepeat(GLUT_KEY_REPEAT_DEFAULT);
                glutTimerFunc(KEY_REPEAT_PERIOD, keyboard, 0);
        }
        {
                glutReshapeFunc(windowResizingHandler);
                glutWindowStatusFunc(windowStatusHandler);
#ifdef __APPLE__
                glutWMCloseFunc(windowClosingHandler);
#endif
                glutDisplayFunc(displayHandler);
        }
}