Skip to content
Snippets Groups Projects
Commit 8c457170 authored by Julien Michel's avatar Julien Michel
Browse files

ENH: (Visu Refactoring) Adding a base class for GlComponents

parent 93e66a5a
Branches
Tags
No related merge requests found
......@@ -18,10 +18,7 @@
#ifndef __otbCurve2D_h
#define __otbCurve2D_h
#include "itkObject.h"
#include "itkImageRegion.h"
#include "itkAffineTransform.h"
#include "itkFixedArray.h"
#include "otbGlComponent.h"
// FLTK includes
#include <FL/gl.h>
......@@ -32,31 +29,28 @@ namespace otb
/** \class Curve2D
* \brief Base class Curves to be rendered in Curves2DWidget.
*
* \sa ImageViewerModel
* \sa Curves2DWidget
*/
class Curve2D
: public itk::Object
: public GlComponent
{
public:
/** Standard class typedefs */
typedef Curve2D Self;
typedef itk::Object Superclass;
typedef GlComponent Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
typedef itk::ImageRegion<2> RegionType;
// affine transform
typedef itk::AffineTransform<double,2> AffineTransformType;
typedef AffineTransformType::InputPointType PointType;
typedef AffineTransformType::InputVectorType VectorType;
typedef itk::FixedArray<double,4> ColorType;
typedef Superclass::AffineTransformType AffineTransformType;
typedef Superclass::PointType PointType;
typedef Superclass::VectorType VectorType;
typedef Superclass::ColorType ColorType;
/** Runtime information */
itkTypeMacro(Curve2D,Object);
/// Render the curve according to display extent and axis characteristics
virtual void Render(const RegionType& extent,const AffineTransformType * space2ScreenTransform) = 0;
itkTypeMacro(Curve2D,GlComponent);
/// This method is provided to do some computation before rendering
virtual void BeforeRendering() {};
......
/*=========================================================================
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 __otbGlComponent_h
#define __otbGlComponent_h
#include "itkObject.h"
#include "itkImageRegion.h"
#include "itkAffineTransform.h"
#include "itkFixedArray.h"
// FLTK includes
#include <FL/gl.h>
#include "FL/Fl_Gl_Window.H"
namespace otb
{
/** \class GlComponent
* \brief Base class for openGl rendered components.
*/
class GlComponent
: public itk::Object
{
public:
/** Standard class typedefs */
typedef GlComponent Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
typedef itk::ImageRegion<2> RegionType;
// affine transform
typedef itk::AffineTransform<double,2> AffineTransformType;
typedef AffineTransformType::InputPointType PointType;
typedef AffineTransformType::InputVectorType VectorType;
typedef itk::FixedArray<double,4> ColorType;
/** Runtime information */
itkTypeMacro(GlComponent,Object);
/// Render the curve according to display extent and axis characteristics
virtual void Render(const RegionType& extent,const AffineTransformType * space2ScreenTransform) = 0;
protected:
/** Constructor */
GlComponent()
{}
/** Destructor */
virtual ~GlComponent(){}
/** Printself method */
void PrintSelf(std::ostream& os, itk::Indent indent) const
{
Superclass::PrintSelf(os,indent);
}
private:
GlComponent(const Self&); // purposely not implemented
void operator=(const Self&); // purposely not implemented
}; // end class
} // end namespace otb
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment