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

ADD : First kind of display : Packed ...

parent c7d82bc9
No related branches found
No related tags found
No related merge requests found
/*=========================================================================
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 __otbPackedWidgetManager_cxx
#define __otbPackedWidgetManager_cxx
#include "otbPackedWidgetManager.h"
namespace otb
{
PackedWidgetManager
::PackedWidgetManager()
{
m_PackedWidget = new ImageWidgetPackedManagerType();
}
PackedWidgetManager
::~PackedWidgetManager()
{
delete m_PackedWidget;
}
void
PackedWidgetManager
::RegisterFullWidget(WidgetType* fullWidget)
{
m_InternalFullWidget = fullWidget;
m_PackedWidget->m_FullGroup->add(fullWidget);
m_PackedWidget->m_FullGroup->resizable(fullWidget);
fullWidget->resize(m_PackedWidget->m_FullGroup->x(),m_PackedWidget->m_FullGroup->y(),
m_PackedWidget->m_FullGroup->w(),m_PackedWidget->m_FullGroup->h());
}
void
PackedWidgetManager
::RegisterScrollWidget(WidgetType* scrollWidget)
{
m_InternalScrollWidget = scrollWidget;
m_PackedWidget->m_QuicklookGroup->add(scrollWidget);
m_PackedWidget->m_QuicklookGroup->resizable(scrollWidget);
scrollWidget->resize(m_PackedWidget->m_QuicklookGroup->x(),m_PackedWidget->m_QuicklookGroup->y(),
m_PackedWidget->m_QuicklookGroup->w(),m_PackedWidget->m_QuicklookGroup->h());
}
void
PackedWidgetManager
::RegisterZoomWidget(WidgetType* zoomWidget)
{
m_InternalZoomWidget = zoomWidget;
m_PackedWidget->m_ZoomGroup->add(zoomWidget);
m_PackedWidget->m_ZoomGroup->resizable(zoomWidget);
zoomWidget->resize(m_PackedWidget->m_ZoomGroup->x(),m_PackedWidget->m_ZoomGroup->y(),
m_PackedWidget->m_ZoomGroup->w(),m_PackedWidget->m_ZoomGroup->h());
}
void
PackedWidgetManager
::RegisterPixelInformationWidget(Fl_Output * pixelWidget)
{
m_IntenalPixelWidget = pixelWidget;
m_PackedWidget->m_PixelInformationGroup->add(pixelWidget);
m_PackedWidget->m_PixelInformationGroup->resizable(pixelWidget);
pixelWidget->resize(m_PackedWidget->m_PixelInformationGroup->x(),m_PackedWidget->m_PixelInformationGroup->y(),
m_PackedWidget->m_PixelInformationGroup->w(),m_PackedWidget->m_PixelInformationGroup->h());
}
void
PackedWidgetManager
::RegisterHistogramWidget(WidgetType* curveWidget)
{
m_InternalCurveWidget = curveWidget;
m_PackedWidget->m_HistogramsGroup->add(curveWidget);
m_PackedWidget->m_HistogramsGroup->resizable(curveWidget);
curveWidget->resize(m_PackedWidget->m_HistogramsGroup->x(),m_PackedWidget->m_HistogramsGroup->y(),
m_PackedWidget->m_HistogramsGroup->w(),m_PackedWidget->m_HistogramsGroup->h());
}
void
PackedWidgetManager
::Show()
{
m_PackedWidget->m_Window->show();
m_InternalCurveWidget->show();
m_IntenalPixelWidget->show();
m_InternalFullWidget->show();
m_InternalScrollWidget->show();
m_InternalZoomWidget->show();
}
void
PackedWidgetManager
::Hide()
{
m_PackedWidget->m_Window->hide();
}
}
#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 __otbPackedWidgetManager_h
#define __otbPackedWidgetManager_h
#include "otbWidgetManager.h"
#include "otbImageWidgetPackedManager.h"
namespace otb
{
class PackedWidgetManager
: public WidgetManager
{
public:
/** Standard class typedefs */
typedef PackedWidgetManager 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(PackedWidgetManager,WidgetManager);
/** typedef of the fltk file defining all the widget needed*/
typedef ImageWidgetPackedManager ImageWidgetPackedManagerType;
/** 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();
protected:
/** Constructor */
PackedWidgetManager();
/** Destructor */
virtual ~PackedWidgetManager();
/** Printself method */
void PrintSelf(std::ostream& os, itk::Indent indent) const
{
Superclass::PrintSelf(os,indent);
}
private:
PackedWidgetManager(const Self&); // purposely not implemented
void operator=(const Self&); // purposely not implemented
ImageWidgetPackedManagerType* m_PackedWidget;
};
}
#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 __otbWidgetManager_h
#define __otbWidgetManager_h
#include "itkObject.h"
#include "otbMacro.h"
#include "otbGlWidget.h"
#include <FL/Fl_Output.H>
namespace otb
{
/** \class WidgetManager
* \brief Base class for displays
*
*/
class WidgetManager
: public itk::Object
{
public:
/** Standard class typedefs */
typedef WidgetManager Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Runtime information */
itkTypeMacro(WidgetManager,Object);
/** Image widget */
typedef otb::GlWidget WidgetType;
typedef WidgetType::Pointer WidgetPointerType;
/** Register Wigets*/
virtual void RegisterFullWidget(WidgetType* fullWidget) = 0 ;
virtual void RegisterScrollWidget(WidgetType* scrollWidget) = 0 ;
virtual void RegisterZoomWidget(WidgetType* zoomWidget) = 0 ;
virtual void RegisterHistogramWidget(WidgetType* curveWidget) = 0 ;
virtual void RegisterPixelInformationWidget(Fl_Output * pixelWidget) = 0 ;
virtual void Show() = 0;
virtual void Hide() = 0;
protected:
/** Constructor */
WidgetManager() {};
/** Destructor */
virtual ~WidgetManager(){};
/** Printself method */
void PrintSelf(std::ostream& os, itk::Indent indent) const
{
Superclass::PrintSelf(os,indent);
}
WidgetType* m_InternalFullWidget;
WidgetType* m_InternalScrollWidget;
WidgetType* m_InternalZoomWidget;
WidgetType* m_InternalCurveWidget;
Fl_Output * m_IntenalPixelWidget;
private:
WidgetManager(const Self&); // purposely not implemented
void operator=(const Self&); // purposely not implemented
}; // end class
} // end namespace otb
#endif
...@@ -298,6 +298,11 @@ ${INPUTDATA}/DEM/srtm_directory ...@@ -298,6 +298,11 @@ ${INPUTDATA}/DEM/srtm_directory
) )
ENDIF(OTB_DATA_USE_LARGEINPUT) ENDIF(OTB_DATA_USE_LARGEINPUT)
#---------- otb::PackedWidget--------
ADD_TEST(vrTuPackedWidgetManagerNew ${VISUREFAC_TESTS1}
otbPackedWidgetManagerNew
)
# Testing srcs # Testing srcs
SET(Visualization_SRCS1 SET(Visualization_SRCS1
otbImageWidgetNew.cxx otbImageWidgetNew.cxx
...@@ -338,6 +343,7 @@ otbImageWidgetWithVectorDataGlComponent.cxx ...@@ -338,6 +343,7 @@ otbImageWidgetWithVectorDataGlComponent.cxx
otbImageViewerEndToEndWithVectorData.cxx otbImageViewerEndToEndWithVectorData.cxx
otbStandardImageViewerNew.cxx otbStandardImageViewerNew.cxx
otbStandardImageViewer.cxx otbStandardImageViewer.cxx
otbPackedWidgetManagerNew.cxx
) )
# Building testing executables # Building testing executables
......
...@@ -64,4 +64,6 @@ void RegisterTests() ...@@ -64,4 +64,6 @@ void RegisterTests()
REGISTER_TEST(otbImageViewerEndToEndWithVectorData); REGISTER_TEST(otbImageViewerEndToEndWithVectorData);
REGISTER_TEST(otbStandardImageViewerNew); REGISTER_TEST(otbStandardImageViewerNew);
REGISTER_TEST(otbStandardImageViewer); REGISTER_TEST(otbStandardImageViewer);
REGISTER_TEST(otbPackedWidgetManagerNew);
} }
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