fshake3d  0.0.1
FreeformDensity3DSurfaceEditor
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines
scene.cpp
Go to the documentation of this file.
00001 #include "Scene.hpp"
00002 
00003 void Scene::addNode(Node* node)
00004 {
00005   mNodes.push_back(node);
00006 }
00007 
00008 void Scene::display()
00009 {
00010   for( std::vector<Node*>::iterator i = mNodes.begin(), end = mNodes.end() ; i != end ; ++i)
00011   {
00012     if ( Shape* pShape = dynamic_cast<Shape*>(*i) )
00013       pShape->display();
00014   }
00015 }
00016 
00017 void Scene::select(const Rayd& ray, SceneView& view)
00018 {
00019   for( std::vector<Node*>::iterator i = mNodes.begin(), end = mNodes.end() ; i != end ; ++i)
00020   {
00021     if ( Control3D* pControl3D = dynamic_cast<Control3D*>(*i) )
00022     {
00023       pControl3D->select(ray,view);
00024     }
00025   }
00026 }
00027 
00028 void Scene::drag(const Rayd& ray, SceneView& view)
00029 {
00030   for( std::vector<Node*>::iterator i = mNodes.begin(), end = mNodes.end() ; i != end ; ++i)
00031   {
00032     if ( Control3D* pControl3D = dynamic_cast<Control3D*>(*i) )
00033     {
00034       pControl3D->drag(ray,view);
00035     }
00036   }
00037 }
00038 
00039 // --- future -----------------------------------------------------------------
00040 
00041 void Scene::onEvent(Event& e)
00042 {
00043 }
00044