00001 /* 00002 * This file is part of Micole Architecture 00003 * 00004 * Copyright (C) 2007 Micole partners 00005 * 00006 * Micole Architecture is free software: you can redistribute it 00007 * and/or modify it under the terms of the GNU Lesser General 00008 * Public License as published by the Free Software Foundation, 00009 * either version 3 of the License, or (at your option) any 00010 * later version. 00011 * 00012 * Micole Architecture is distributed in the hope that it will be 00013 * useful, * but WITHOUT ANY WARRANTY; without even the implied 00014 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00015 * PURPOSE. See the GNU Lesser General Public License for more 00016 * details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public 00019 * License along with Micole Architecture. If not, see 00020 * <http://www.gnu.org/licenses/>. 00021 */ 00022 00023 #include "stdafx.h" 00024 #include "ReachinMicoleApplication.h" 00025 00026 /*#include <Shape.h> 00027 #include <Sphere.h> 00028 #include <Appearance.h>*/ 00029 #include <FrictionalSurface.h> 00030 00031 using namespace Reachin; 00032 00033 ReachinMicoleApplication * ReachinMicoleApplication::_riInstance = NULL; 00034 00035 ReachinMicoleApplication::ReachinMicoleApplication() 00036 : _display(new Display()) 00037 { 00038 //ref(_display); 00039 } 00040 00041 ReachinMicoleApplication::~ReachinMicoleApplication() 00042 { 00043 00044 } 00045 00046 void ReachinMicoleApplication::startScene() 00047 { 00048 try { 00049 //AutoRef<Display> dis(new Display); //create AutoRef for Display 00050 /* 00051 Shape * sh = new Shape; 00052 00053 Sphere * sph = new Sphere; 00054 00055 FrictionalSurface * surf = new FrictionalSurface; 00056 00057 sph->radius->set(0.05); 00058 00059 surf->stiffness->set( 500 ); 00060 00061 Material * mat = new Material; 00062 mat->diffuse_color->set( RGB(0,1,0)); 00063 00064 Appearance * app = new Appearance; 00065 app->material->set(mat); 00066 app->surface->set( surf ); 00067 00068 sh->appearance->set(app); 00069 sh->geometry->set(sph); 00070 00071 _display->children->add(sh); 00072 */ 00073 Scene::startScene(); 00074 } 00075 catch (Error::QuitAPI) 00076 { 00077 sendBusMessage("Quit"); 00078 Scene::stopScenes(); 00079 } 00080 catch (Error::ErrorBase &e) 00081 { 00082 cerr << e << endl; 00083 sendBusMessage("Quit"); 00084 Scene::stopScenes(); 00085 } 00086 }