glexampleplugin-display.cpp

Go to the documentation of this file.
00001 #include "glexampleplugin.h"
00002 
00003 
00004 /** List of menu commands -
00005  ** Text shown in menu and in dock titlebar.
00006  **/
00007 QStringList GlExamplePlugin::commands() const
00008 {
00009     return commandList;
00010 }
00011 
00012 /** Displayable widget -
00013  ** Creates Dialog and connects signals/slots.  Then creates QDockWidget so dock options can be set,
00014  ** then it's passed to BCore which can pass to the MainWindow.
00015  **/
00016 QDockWidget* GlExamplePlugin::getDock(const QString &command)
00017 {
00018     QDialog* dialog = 0;
00019 
00020     if (command == tr("OpenGL Frame Buffer Example"))
00021     {
00022         QStringList params;
00023         Module("GL Frame Buffer", params);
00024         BBoB_Module* mod = ModulePointer("GL Frame Buffer");
00025         FrameModule = (GlExampleModule*) mod;
00026         GlDlog = new GLDialog(FrameModule, "frame");
00027         GlDlog->setObjectName(mod->getName());
00028 
00029         dialog = GlDlog;
00030     }
00031     else if (command == tr("OpenGL Pixel Buffer Example"))
00032     {
00033         QStringList params;
00034         Module("GL Pixel Buffer", params);
00035         BBoB_Module* mod = ModulePointer("GL Pixel Buffer");
00036         PixelModule = (GlExampleModule*) mod;
00037         PixelModule->Channels["Bounce Rate"] = (BBoB_Channel*) new GlExampleChannel(mod, Channel_Dir_In, Channel_Type_Byte, "Bounce Rate");
00038         PixelModule->Channels["Rotation"] = (BBoB_Channel*) new GlExampleChannel(mod, Channel_Dir_In, Channel_Type_Byte, "Rotation");
00039         GlDlog = new GLDialog(PixelModule, "pixel");
00040         GlDlog->setObjectName(mod->getName());
00041 
00042         dialog = GlDlog;
00043     }
00044 
00045     if (dialog)
00046     {
00047         QDockWidget* dock = new QDockWidget(command);
00048         dock->setAllowedAreas(Qt::AllDockWidgetAreas);
00049         dock->setWidget(dialog);
00050         bcore->addDock(dock);
00051     }
00052     // This function could be void now
00053     return 0;
00054 }
00055 

Generated on Sun Oct 28 22:51:27 2007 for BBoB by  doxygen 1.5.3