00001
00012
00013
00014 #include "imedgine_spatial_viewer.h"
00015
00016 namespace imedgine
00017 {
00018 ImedgineSpatialViewer::ImedgineSpatialViewer(
00019 SpatialPixelView* spatial_view, QWidget* parent, const char* name)
00020 : ImedgineViewer(parent, name)
00021 {
00022 QWidget* widget = this->buildWidget(this->getParentWidget());
00023 this->setBaseWidget(widget);
00024 this->setDecoration(false);
00025
00026 spatial_view_ = spatial_view;
00027 }
00028
00029
00030
00031 ImedgineSpatialViewer::~ImedgineSpatialViewer()
00032 {
00033 #ifdef DEBUG
00034 std::cout << "Deleting ImedgineSpatialViewer" << std::endl;
00035 #endif
00036 }
00037
00038
00039
00040 SbBool ImedgineSpatialViewer::processSoEvent(const SoEvent * const ev)
00041 {
00042 const SoType type(ev->getTypeId());
00043
00044 if (type.isDerivedFrom(SoMouseButtonEvent::getClassTypeId()))
00045 {
00046
00047 const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
00048 const int button = event->getButton();
00049
00050
00051 const SbVec2s size(this->getGLSize());
00052 const SbVec2s pos(ev->getPosition());
00053
00054 switch (button)
00055 {
00056 case SoMouseButtonEvent::BUTTON1:
00057 break;
00058 case SoMouseButtonEvent::BUTTON2:
00059 break;
00060 case SoMouseButtonEvent::BUTTON3:
00061 break;
00062 case SoMouseButtonEvent::BUTTON4:
00063 break;
00064 case SoMouseButtonEvent::BUTTON5:
00065 break;
00066 default:
00067 break;
00068 }
00069 }
00070
00071 return (ImedgineViewer::processSoEvent(ev));
00072 }
00073
00074
00075
00076 void ImedgineSpatialViewer::buildPopupMenu()
00077 {
00078 SoQtPopupMenu *popup_menu = SoQtPopupMenu::createInstance();
00079 popup_menu->newMenu("BLBALBA", ROOT_MENU_SPATIAL);
00080 popup_menu->setMenuTitle(ROOT_MENU_SPATIAL, "TEST");
00081
00082 popup_menu->newMenu("functionsmenu", FUNCTIONS_MENU_SPATIAL);
00083 popup_menu->setMenuTitle(FUNCTIONS_MENU_SPATIAL, "Functions");
00084 popup_menu->newMenuItem("Do That", FUNCTIONS_MENU_ITEM_DOTHAT_SPATIAL);
00085 popup_menu->newMenuItem("Do This", FUNCTIONS_MENU_ITEM_DOTHIS_SPATIAL);
00086 popup_menu->addMenuItem( FUNCTIONS_MENU_SPATIAL, FUNCTIONS_MENU_ITEM_DOTHAT_SPATIAL);
00087 popup_menu->addMenuItem( FUNCTIONS_MENU_SPATIAL, FUNCTIONS_MENU_ITEM_DOTHIS_SPATIAL);
00088
00089 popup_menu->newMenuItem("Fullscreen", ROOT_MENU_ITEM_FULLSCREEN_SPATIAL);
00090 popup_menu->addMenuItem(ROOT_MENU_SPATIAL, ROOT_MENU_ITEM_FULLSCREEN_SPATIAL);
00091
00092 popup_menu->addMenu(ROOT_MENU_SPATIAL, FUNCTIONS_MENU_SPATIAL);
00093
00094 this->prefmenu = popup_menu;
00095 }
00096
00097
00098
00099 void ImedgineSpatialViewer::menuSelection(int menu_item_id)
00100 {
00101
00102 }
00103 }