Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

BarPlotModule.h

Go to the documentation of this file.
00001 /*
00002  * BarPlotModule.h
00003  *
00004  *  Created on: 26-aug-2009
00005  *      Author: dodijk
00006  */
00007 
00008 #ifndef BARPLOTMODULE_H_
00009 #define BARPLOTMODULE_H_
00010 
00011 #include "OglGui/GroupBox.h"
00012 #include "OglGui/Window.h"
00013 
00014 #include "BarPlot.h"
00015 
00016 namespace Impala { namespace Application { namespace MediaTable {
00017 
00018 class BarPlotModule : public VisualizationModule {
00019 public:
00020         BarPlotModule() : VisualizationModule("BarPlot") {}
00021 
00022         void ButtonSelectionEvent(OglGui::Button *src, void *userData)
00023         {
00024                 if(src->GetLabel() == "New " + GetName())
00025                 {
00026                         StoreConfigWindowValues();
00027                         DoHandleNewWindow("BarPlot", mConfigWindow);
00028                         delete mConfigWindow;
00029                         DoReleaseConfigWindow();
00030                 }
00031                 else
00032                         VisualizationModule::ButtonSelectionEvent(src, userData);
00033     }
00034 
00035         void ViewSelected() {
00036                 VisualizationModule::DrawConfigWindow();
00037                 OglGui::GroupBox* grp = new OglGui::GroupBox(mConfigWindow, mConfigWindow->W()-2, 362, "");
00038 
00039                 AddSelectorWithColumnsOfType(grp, "X", mStringValues["View"],
00040                                 TableDataSource::TYPE_FLAG_NUMBER, true);
00041                 AddSelectorWithColumnsOfType(grp, "Y", mStringValues["View"],
00042                                 TableDataSource::TYPE_FLAG_NUMBER, true);
00043                 AddSelectorWithColumnsOfType(grp, "Image", mStringValues["View"],
00044                                 TableDataSource::TYPE_FLAG_IMAGE, true);
00045                 (new OglGui::Button(grp, grp->W()-4, 26, "New "+GetName(), BEV_ETCHED))
00046                         ->SetButtonListener(this);
00047 
00048                 grp->RepositionViewports();
00049                 grp->ScaleChildren();
00050         }
00051 
00052         void NewWindow(OglGui::Window* window) {
00053                 TableDataView* view = TableDataStore::GetInstance()->GetTableDataView(mStringValues["View"]);
00054                 BarPlot* barplot = new BarPlot(window, view, 0, 0, window->W(), window->H());
00055                 barplot->AddColumnsFromDataSource(mStringValues["X"], mStringValues["Y"], mStringValues["Image"]);
00056                 if(mGetOglImageByIdI)
00057                         barplot->GetCache()->SetGetOglImageByIdInterface(mGetOglImageByIdI);
00058                 else 
00059                         barplot->GetCache()->SetGetOglImageByIdInterface(this);
00060         }
00061 };
00062 
00063 } } }  /* Namespace Impala::Application::MediaTable */
00064 
00065 #endif /* BarPlotModule_H_ */

Generated on Fri Mar 19 09:30:32 2010 for ImpalaSrc by  doxygen 1.5.1