Documentation


frameNodeGUI.cpp

Go to the documentation of this file.
00001 
00002 //                            frameNodeGUI.cpp                                //
00004 
00005 #include "frameNodeGUI.h"
00006 
00007 namespace X3DTK
00008 {
00009   namespace Qt
00010   {
00011 
00013     QWidget * createFrameQWidget(X3D::FrameNode * node, QWidget * parent)
00014     {
00015       //std::cerr<<"createFrameNodeQWidget"<<std::endl;
00016 
00017       //  // parent is the child of the scrollview, child of the QDialog, child of the MC !!
00018       //  // (See in MainController::createQWidgetController(...))
00019       //  MainController * MC = dynamic_cast<MainController *>(parent->parent()->parent()->parent());
00020       if (node)
00021       {
00022         // Create the GUI of a animal::engine and insert the new features of a X3DTK::X3D::FrameNode
00023         EngineGUI * engineGUI = static_cast<EngineGUI *>(createEngineNodeQWidget(node, parent));
00024 
00025         // The list of all the fields to control in the GUI
00026         FieldList fieldList;
00027 
00028         //Swollen field
00029         fieldList.push_back(new SFFloat("Swollen", &node->swollen));
00030 
00031         // Use an ObjectGUI to build the X3DTK::X3D::SpinningFrameNode
00032         X3DTK::Qt::ObjectGUI * objectGUI = new X3DTK::Qt::ObjectGUI(fieldList, 0);
00033 
00034         // Juste take the first tab of the objectGUI, because there is only one tab for single fields
00035         engineGUI->insertTab( objectGUI->page(0), "FrameNode" ,0);
00036         engineGUI->setCurrentPage(0);
00037         QWidget::connect( objectGUI, SIGNAL( changed() ), engineGUI, SLOT(ok()));
00038 
00039         return engineGUI;
00040 
00041       }
00042 
00043       std::cerr<<"Warning createFrameQWidget(): impossible to create a X3DTK::Qt::EngineGUI because the associated animal::Engine is NULL."<<std::endl;
00044       std::cerr<<"        or the MainController is NULL."<<std::endl;
00045       return NULL;
00046     }
00047 
00048   } // Qt
00049 } // X3DTK

Generated on Thu Dec 23 13:52:25 2004 by doxygen 1.3.6