Skip to content
Snippets Groups Projects
Commit c03d0c43 authored by Otmane Lahlou's avatar Otmane Lahlou
Browse files

ENH: Widget Manager & Sons

parent 7e6573f2
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,7 @@ IF(APPLE AND BUILD_SHARED_LIBS)
ENDFOREACH(c)
ENDIF(APPLE AND BUILD_SHARED_LIBS)
FLTK_WRAP_UI(OTBVisualization otbImageWidgetPackedManager.fl)
FLTK_WRAP_UI(OTBVisualization otbImageWidgetPackedManager.fl otbImageWidgetSplittedManager.fl)
ADD_LIBRARY(OTBVisualization ${OTBVisualization_SRCS} ${OTBVisualization_FLTK_UI_SRCS})
TARGET_LINK_LIBRARIES (OTBVisualization OTBGui OTBCommon ${FLTK_LIBRARIES} ${OPENGL_LIBRARIES})
......
# data file for the Fltk User Interface Designer (fluid)
version 1.0109
header_name {.h}
code_name {.cxx}
class ImageWidgetSplittedManager {open
} {
Function {ImageWidgetSplittedManager()} {open selected return_type void
} {
Fl_Window m_FullGroup {
label {Full Window}
xywh {673 230 630 565} type Double box UP_BOX color 52 selection_color 7 labelcolor 187 resizable visible
} {}
Fl_Window m_QuicklookGroup {
label {Scroll Window}
xywh {1309 229 215 180} type Double box UP_BOX color 52 selection_color 7 labelcolor 187 resizable visible
} {}
Fl_Window m_ZoomGroup {
label {Zoom Window}
xywh {1309 436 215 170} type Double box UP_BOX color 52 selection_color 7 labelcolor 187 resizable visible
} {}
Fl_Window m_HistogramsGroup {
label {Histogram Window}
xywh {387 234 280 160} type Double box UP_BOX color 52 selection_color 7 labelcolor 187 resizable visible
} {}
Fl_Window m_PixelInformationGroup {
label {Pixel Information Window}
xywh {1309 633 215 160} type Double box UP_BOX color 52 selection_color 7 labelcolor 187 resizable visible
} {}
}
}
......@@ -112,10 +112,29 @@ PackedWidgetManager
::Hide()
{
m_PackedWidget->m_Window->hide();
}
void
PackedWidgetManager
::Refresh()
{
m_InternalScrollWidget ->redraw();
m_InternalScrollWidget ->redraw();
m_InternalZoomWidget->redraw();
m_IntenalPixelWidget->redraw();
m_InternalCurveWidget->redraw();
}
void
PackedWidgetManager
::UnRegisterAll()
{
m_PackedWidget->m_FullGroup->remove(m_InternalFullWidget);
m_PackedWidget->m_ZoomGroup->remove(m_InternalZoomWidget);
m_PackedWidget->m_PixelInformationGroup->remove(m_IntenalPixelWidget);
m_PackedWidget->m_QuicklookGroup->remove(m_InternalScrollWidget);
m_PackedWidget->m_HistogramsGroup->remove(m_InternalCurveWidget);
}
......
......@@ -21,6 +21,8 @@
#include "otbWidgetManager.h"
#include "otbImageWidgetPackedManager.h"
#include <FL/Fl_Double_Window.H>
namespace otb
{
......@@ -51,8 +53,9 @@ class PackedWidgetManager
virtual void RegisterPixelInformationWidget(Fl_Output * pixelWidget);
virtual void Show();
virtual void Hide();
virtual void Refresh();
virtual void SetLabel(const char * label){};
virtual void UnRegisterAll();
protected:
/** Constructor */
......
/*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef __otbSplittedWidgetManager_cxx
#define __otbSplittedWidgetManager_cxx
#include "otbSplittedWidgetManager.h"
namespace otb
{
SplittedWidgetManager
::SplittedWidgetManager()
{
m_SplittedWidget = new ImageWidgetSplittedManagerType();
}
SplittedWidgetManager
::~SplittedWidgetManager()
{
delete m_SplittedWidget;
}
void
SplittedWidgetManager
::RegisterFullWidget(WidgetType* fullWidget)
{
m_InternalFullWidget = fullWidget;
m_SplittedWidget->m_FullGroup->add(fullWidget);
m_SplittedWidget->m_FullGroup->resizable(fullWidget);
fullWidget->resize(0,0, m_SplittedWidget->m_FullGroup->w(),m_SplittedWidget->m_FullGroup->h());
}
void
SplittedWidgetManager
::RegisterScrollWidget(WidgetType* scrollWidget)
{
m_InternalScrollWidget = scrollWidget;
m_SplittedWidget->m_QuicklookGroup->add(scrollWidget);
m_SplittedWidget->m_QuicklookGroup->resizable(scrollWidget);
scrollWidget->resize(0,0, m_SplittedWidget->m_QuicklookGroup->w(),m_SplittedWidget->m_QuicklookGroup->h());
}
void
SplittedWidgetManager
::RegisterZoomWidget(WidgetType* zoomWidget)
{
m_InternalZoomWidget = zoomWidget;
m_SplittedWidget->m_ZoomGroup->add(zoomWidget);
m_SplittedWidget->m_ZoomGroup->resizable(zoomWidget);
zoomWidget->resize(0,0,m_SplittedWidget->m_ZoomGroup->w(),m_SplittedWidget->m_ZoomGroup->h());
}
void
SplittedWidgetManager
::RegisterPixelInformationWidget(Fl_Output * pixelWidget)
{
m_IntenalPixelWidget = pixelWidget;
m_SplittedWidget->m_PixelInformationGroup->add(pixelWidget);
m_SplittedWidget->m_PixelInformationGroup->resizable(pixelWidget);
pixelWidget->resize(0,0, m_SplittedWidget->m_PixelInformationGroup->w(),m_SplittedWidget->m_PixelInformationGroup->h());
}
void
SplittedWidgetManager
::RegisterHistogramWidget(WidgetType* curveWidget)
{
m_InternalCurveWidget = curveWidget;
m_SplittedWidget->m_HistogramsGroup->add(curveWidget);
m_SplittedWidget->m_HistogramsGroup->resizable(curveWidget);
curveWidget->resize(0,0,m_SplittedWidget->m_HistogramsGroup->w(),m_SplittedWidget->m_HistogramsGroup->h());
}
void
SplittedWidgetManager
::Show()
{
m_SplittedWidget->m_FullGroup->show();
m_SplittedWidget->m_ZoomGroup->show();
m_SplittedWidget->m_PixelInformationGroup->show();
m_SplittedWidget->m_QuicklookGroup->show();
m_SplittedWidget->m_HistogramsGroup->show();
m_InternalCurveWidget->show();
m_IntenalPixelWidget->show();
m_InternalFullWidget->show();
m_InternalScrollWidget->show();
m_InternalZoomWidget->show();
}
void
SplittedWidgetManager
::Hide()
{
m_SplittedWidget->m_FullGroup->hide();
m_SplittedWidget->m_ZoomGroup->hide();
m_SplittedWidget->m_PixelInformationGroup->hide();
m_SplittedWidget->m_QuicklookGroup->hide();
m_SplittedWidget->m_HistogramsGroup->hide();
}
void
SplittedWidgetManager
::Refresh()
{
m_InternalScrollWidget ->redraw();
m_InternalScrollWidget ->redraw();
m_InternalZoomWidget->redraw();
m_IntenalPixelWidget->redraw();
m_InternalCurveWidget->redraw();
}
void
SplittedWidgetManager
::SetLabel(const char * label)
{
m_SplittedWidget->m_FullGroup->label(label);
m_SplittedWidget->m_ZoomGroup->label(label);
m_SplittedWidget->m_PixelInformationGroup->label(label);
m_SplittedWidget->m_QuicklookGroup->label(label);
m_SplittedWidget->m_HistogramsGroup->label(label);
}
void
SplittedWidgetManager
::UnRegisterAll()
{
m_SplittedWidget->m_FullGroup->remove(m_InternalFullWidget);
m_SplittedWidget->m_ZoomGroup->remove(m_InternalZoomWidget);
m_SplittedWidget->m_PixelInformationGroup->remove(m_IntenalPixelWidget);
m_SplittedWidget->m_QuicklookGroup->remove(m_InternalScrollWidget);
m_SplittedWidget->m_HistogramsGroup->remove(m_InternalCurveWidget);
}
}
#endif
/*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef __otbSplittedWidgetManager_h
#define __otbSplittedWidgetManager_h
#include "otbWidgetManager.h"
#include "otbImageWidgetSplittedManager.h"
namespace otb
{
class SplittedWidgetManager
: public WidgetManager
{
public:
/** Standard class typedefs */
typedef SplittedWidgetManager Self;
typedef WidgetManager Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Method for creation through the object factory */
itkNewMacro(Self);
/** Runtime information */
itkTypeMacro(SplittedWidgetManager,WidgetManager);
/** typedef of the fltk file defining all the widget needed*/
typedef ImageWidgetSplittedManager ImageWidgetSplittedManagerType;
/** Register Wigets*/
virtual void RegisterFullWidget(WidgetType* fullWidget);
virtual void RegisterScrollWidget(WidgetType* scrollWidget);
virtual void RegisterZoomWidget(WidgetType* zoomWidget);
virtual void RegisterHistogramWidget(WidgetType* curveWidget);
virtual void RegisterPixelInformationWidget(Fl_Output * pixelWidget);
virtual void Show();
virtual void Hide();
virtual void Refresh();
virtual void SetLabel(const char * label);
virtual void UnRegisterAll();
protected:
/** Constructor */
SplittedWidgetManager();
/** Destructor */
virtual ~SplittedWidgetManager();
/** Printself method */
void PrintSelf(std::ostream& os, itk::Indent indent) const
{
Superclass::PrintSelf(os,indent);
}
private:
SplittedWidgetManager(const Self&); // purposely not implemented
void operator=(const Self&); // purposely not implemented
ImageWidgetSplittedManagerType* m_SplittedWidget;
};
}
#endif
......@@ -57,6 +57,10 @@ public:
virtual void RegisterPixelInformationWidget(Fl_Output * pixelWidget) = 0 ;
virtual void Show() = 0;
virtual void Hide() = 0;
virtual void Refresh() = 0;
virtual void SetLabel(const char * label) = 0;
virtual void UnRegisterAll() = 0;
protected:
/** Constructor */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment