Commit e33f6caf authored by Cédric Traizet's avatar Cédric Traizet

STY: revert change in Visualization/Ice to avoid conflicts

parent d7145c04
Pipeline #2643 passed with stages
in 96 minutes and 11 seconds
......@@ -29,15 +29,16 @@
namespace otb
{
class OTBIce_EXPORT FragmentShader : public itk::Object
class OTBIce_EXPORT FragmentShader
: public itk::Object
{
public:
typedef FragmentShader Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
typedef FragmentShader Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
typedef itk::Point<float, 2> PointType;
typedef itk::Point<float,2> PointType;
void LoadShader();
......@@ -45,14 +46,14 @@ public:
void UnloadShader();
itkSetMacro(UL, PointType);
itkSetMacro(UR, PointType);
itkSetMacro(LL, PointType);
itkSetMacro(LR, PointType);
itkGetConstReferenceMacro(UL, PointType);
itkGetConstReferenceMacro(UR, PointType);
itkGetConstReferenceMacro(LL, PointType);
itkGetConstReferenceMacro(LR, PointType);
itkSetMacro(UL,PointType);
itkSetMacro(UR,PointType);
itkSetMacro(LL,PointType);
itkSetMacro(LR,PointType);
itkGetConstReferenceMacro(UL,PointType);
itkGetConstReferenceMacro(UR,PointType);
itkGetConstReferenceMacro(LL,PointType);
itkGetConstReferenceMacro(LR,PointType);
protected:
FragmentShader();
......
......@@ -27,13 +27,14 @@
namespace otb
{
class FragmentShaderRegistry : public itk::Object
class FragmentShaderRegistry
: public itk::Object
{
public:
typedef FragmentShaderRegistry Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
typedef FragmentShaderRegistry Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
static Pointer Instance();
......@@ -57,7 +58,7 @@ protected:
~FragmentShaderRegistry() override;
private:
typedef std::map<std::string, std::pair<unsigned int, unsigned int>> ShaderMapType;
typedef std::map<std::string, std::pair<unsigned int, unsigned int> > ShaderMapType;
itkNewMacro(Self);
......
......@@ -52,17 +52,17 @@ class OTBIce_EXPORT GeoInterface
public:
/**
*/
typedef itk::Point<itk::SpacePrecisionType, 2> Point2;
typedef itk::Point< itk::SpacePrecisionType, 2 > Point2;
/**
* Double precision point-type.
*/
typedef itk::Point<double, 2> Point2d;
typedef itk::Point< double, 2 > Point2d;
/**
* Spacing-type based on ITK floating-point prevision.
*/
typedef itk::Vector<itk::SpacePrecisionType, 2> Spacing2;
typedef itk::Vector< itk::SpacePrecisionType, 2 > Spacing2;
/**
* Transform given point from viewport coordinate-system to this
......@@ -77,7 +77,9 @@ public:
*
* @return true if the operation has succeeded; false otherwise.
*/
virtual bool TransformFromViewport(Point2d& out, const Point2d& in, bool isPhysical = true) const;
virtual bool TransformFromViewport( Point2d & out,
const Point2d & in,
bool isPhysical = true ) const;
/**
* Transform given point from viewport coordinate-system to this
......@@ -92,11 +94,13 @@ public:
*
* @return true if the operation has succeeded; false otherwise.
*/
virtual bool TransformToViewport(Point2d& out, const Point2d& in, bool isPhysical = true) const;
virtual bool TransformToViewport( Point2d & out,
const Point2d & in,
bool isPhysical = true ) const;
/**
*/
virtual const Spacing2& GetSpacing() const;
virtual const Spacing2 & GetSpacing() const;
/**
*/
......@@ -108,7 +112,7 @@ public:
/**
*/
virtual bool GetKwl(ImageKeywordlist&) const;
virtual bool GetKwl( ImageKeywordlist & ) const;
protected:
......@@ -116,6 +120,7 @@ protected:
virtual ~GeoInterface();
private:
}; // End class GeoInterface
......
......@@ -30,35 +30,36 @@
namespace otb
{
class OTBIce_EXPORT GlActor : public itk::Object
class OTBIce_EXPORT GlActor
: public itk::Object
{
public:
typedef GlActor Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
itkSetObjectMacro(Settings, ViewSettings);
itkGetObjectMacro(Settings, ViewSettings);
itkGetConstObjectMacro(Settings, ViewSettings);
itkSetMacro(Visible, bool);
itkGetMacro(Visible, bool);
typedef GlActor Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
itkSetObjectMacro(Settings,ViewSettings);
itkGetObjectMacro(Settings,ViewSettings);
itkGetConstObjectMacro(Settings,ViewSettings);
itkSetMacro(Visible,bool);
itkGetMacro(Visible,bool);
itkBooleanMacro(Visible);
itkSetStringMacro(Name);
itkGetStringMacro(Name);
itkSetMacro(GeometryChanged, bool);
itkGetMacro(GeometryChanged, bool);
itkBooleanMacro(GeometryChanged);
itkSetMacro( GeometryChanged, bool );
itkGetMacro( GeometryChanged, bool );
itkBooleanMacro( GeometryChanged );
itkSetMacro(Overlay, bool);
itkGetMacro(Overlay, bool);
itkBooleanMacro(Overlay);
itkSetMacro( Overlay, bool );
itkGetMacro( Overlay, bool );
itkBooleanMacro( Overlay );
// Retrieve the full extent of the actor
virtual void GetExtent(double& ulx, double& uly, double& lrx, double& lry) const = 0;
virtual void GetExtent(double & ulx, double & uly, double & lrx, double & lry) const = 0;
// Update internal actor state with respect to ViewSettings
virtual void ProcessViewSettings() = 0;
......@@ -85,15 +86,15 @@ private:
std::string m_Name;
// Visibility flag
bool m_Visible : 1;
bool m_Visible: 1;
/**
*/
bool m_GeometryChanged : 1;
bool m_GeometryChanged: 1;
/**
*/
bool m_Overlay : 1;
bool m_Overlay: 1;
}; // End class GlActor
......
......@@ -33,23 +33,24 @@
namespace otb
{
class OTBIce_EXPORT GlROIActor : public GlActor
class OTBIce_EXPORT GlROIActor
: public GlActor
{
public:
typedef GlROIActor Self;
typedef GlActor Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
typedef ImageKeywordlist ImageKeywordlistType;
typedef itk::ImageRegion<2> ImageRegionType;
typedef otb::GenericRSTransform<> RSTransformType;
typedef RSTransformType::InputPointType PointType;
typedef itk::Vector<double, 3> ColorType;
typedef GlROIActor Self;
typedef GlActor Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
typedef ImageKeywordlist ImageKeywordlistType;
typedef itk::ImageRegion<2> ImageRegionType;
typedef otb::GenericRSTransform<> RSTransformType;
typedef RSTransformType::InputPointType PointType;
typedef itk::Vector<double,3> ColorType;
itkNewMacro(Self);
// Retrieve the full extent of the actor
void GetExtent(double& ulx, double& uly, double& lrx, double& lry) const override;
void GetExtent(double & ulx, double & uly, double & lrx, double & lry) const override;
// Update internal actor state with respect to ViewSettings
void ProcessViewSettings() override;
......@@ -60,59 +61,59 @@ public:
// Gl rendering of current state
void Render() override;
void SetUL(const PointType&);
void SetUL( const PointType & );
itkGetConstReferenceMacro(UL, PointType);
itkGetConstReferenceMacro(UL,PointType);
void SetLR(const PointType&);
void SetLR( const PointType & );
itkGetConstReferenceMacro(LR, PointType);
itkGetConstReferenceMacro(LR,PointType);
itkSetStringMacro(Wkt);
itkGetStringMacro(Wkt);
void SetKwl(const ImageKeywordlistType& kwl);
itkGetConstReferenceMacro(Kwl, ImageKeywordlistType);
itkSetMacro(Color, ColorType);
itkGetConstReferenceMacro(Color, ColorType);
itkSetMacro(Alpha, double);
itkGetConstReferenceMacro(Alpha, double);
itkSetMacro(Fill, bool);
itkGetMacro(Fill, bool);
void SetKwl(const ImageKeywordlistType & kwl);
itkGetConstReferenceMacro(Kwl,ImageKeywordlistType);
itkSetMacro(Color,ColorType);
itkGetConstReferenceMacro(Color,ColorType);
itkSetMacro(Alpha,double);
itkGetConstReferenceMacro(Alpha,double);
itkSetMacro(Fill,bool);
itkGetMacro(Fill,bool);
itkBooleanMacro(Fill);
protected:
GlROIActor();
~GlROIActor() override;
private:
// prevent implementation
GlROIActor(const Self&);
void operator=(const Self&);
void UpdateTransforms();
PointType m_UL;
PointType m_LR;
PointType m_UL;
PointType m_LR;
std::string m_Wkt;
ImageKeywordlistType m_Kwl;
ColorType m_Color;
double m_Alpha;
bool m_Fill;
ColorType m_Color;
double m_Alpha;
bool m_Fill;
RSTransformType::Pointer m_ViewportToImageTransform;
RSTransformType::Pointer m_ImageToViewportTransform;
PointType m_VpUL;
PointType m_VpUR;
PointType m_VpLL;
PointType m_VpLR;
PointType m_VpUL;
PointType m_VpUR;
PointType m_VpLL;
PointType m_VpLR;
}; // End class GlROIActor
......
......@@ -40,22 +40,23 @@ class GLUtesselator;
namespace otb
{
class OTBIce_EXPORT GlVectorActor : public GlActor, public GeoInterface
class OTBIce_EXPORT GlVectorActor
: public GlActor, public GeoInterface
{
public:
typedef GlVectorActor Self;
typedef GlActor Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
typedef otb::GenericRSTransform<> RSTransformType;
typedef RSTransformType::InputPointType PointType;
typedef itk::Vector<double, 3> ColorType;
typedef itk::CenteredRigid2DTransform<> RigidTransformType;
typedef GlVectorActor Self;
typedef GlActor Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
typedef otb::GenericRSTransform<> RSTransformType;
typedef RSTransformType::InputPointType PointType;
typedef itk::Vector<double,3> ColorType;
typedef itk::CenteredRigid2DTransform<> RigidTransformType;
itkNewMacro(Self);
// Initialize with a new file
void Initialize(const std::string& filename, const std::string& layername = "");
void Initialize(const std::string & filename, const std::string & layername = "");
// Get all available layers
std::vector<std::string> GetAvailableLayers() const;
......@@ -64,13 +65,13 @@ public:
std::string GetCurrentLayer() const;
// Set layer name
void SetCurrentLayer(const std::string& layername);
void SetCurrentLayer(const std::string & layername);
// Retrieve the full extent of the actor
void GetExtent(double& ulx, double& uly, double& lrx, double& lry) const override;
void GetExtent(double & ulx, double & uly, double & lrx, double & lry) const override;
// Return actor extent in its own geometry
void GetBoundingBox(double& ulx, double& uly, double& lrx, double& lry) const;
void GetBoundingBox(double & ulx, double & uly, double & lrx, double & lry) const;
// Update internal actor state with respect to ViewSettings
void ProcessViewSettings() override;
......@@ -81,30 +82,30 @@ public:
// Gl rendering of current state
void Render() override;
PointType ViewportToVectorTransform(const PointType& point) const;
itkSetMacro(Color, ColorType);
itkGetConstReferenceMacro(Color, ColorType);
PointType ViewportToVectorTransform(const PointType & point) const;
itkSetMacro(Alpha, double);
itkGetConstReferenceMacro(Alpha, double);
itkSetMacro(Color,ColorType);
itkGetConstReferenceMacro(Color,ColorType);
itkSetMacro(Alpha,double);
itkGetConstReferenceMacro(Alpha,double);
void SetFill(bool flag);
itkGetMacro(Fill, bool);
itkGetMacro(Fill,bool);
itkBooleanMacro(Fill);
void SetSolidBorder(bool flag);
itkGetMacro(SolidBorder, bool);
itkGetMacro(SolidBorder,bool);
itkBooleanMacro(SolidBorder);
void SetOptimizedRendering(bool flag);
itkGetMacro(OptimizedRendering, bool);
itkGetMacro(OptimizedRendering,bool);
itkBooleanMacro(OptimizedRendering);
itkGetMacro(OptimizedRenderingActive,bool);
itkGetMacro(OptimizedRenderingActive, bool);
itkSetMacro(LineWidth, double);
itkGetConstReferenceMacro(LineWidth, double);
itkSetMacro(LineWidth,double);
itkGetConstReferenceMacro(LineWidth,double);
std::string GetWkt() const override;
......@@ -112,12 +113,14 @@ public:
// otb::GlActor overloads.
//
bool TransformFromViewport(Point2d& out, const Point2d& in, bool isPhysical = true) const override;
bool TransformFromViewport( Point2d & out,
const Point2d & in,
bool isPhysical = true ) const override;
protected:
GlVectorActor();
~GlVectorActor() override;
......@@ -125,14 +128,15 @@ protected:
class InternalFeature
{
public:
InternalFeature(OGRFeatureDefn& definition) : m_SourceFeature(definition), m_RenderedFeature(definition)
{
}
InternalFeature(OGRFeatureDefn & definition)
: m_SourceFeature(definition),
m_RenderedFeature(definition)
{}
otb::ogr::Feature m_SourceFeature;
otb::ogr::Feature m_RenderedFeature;
};
private:
// prevent implementation
GlVectorActor(const Self&);
......@@ -144,12 +148,12 @@ private:
void UpdateDisplayList();
ColorType m_Color;
double m_Alpha;
bool m_Fill;
bool m_SolidBorder;
double m_LineWidth;
ColorType m_Color;
double m_Alpha;
bool m_Fill;
bool m_SolidBorder;
double m_LineWidth;
RSTransformType::Pointer m_ViewportToVectorTransform;
RSTransformType::Pointer m_VectorToViewportTransform;
......@@ -158,10 +162,10 @@ private:
std::vector<InternalFeature> m_InternalFeatures;
GLUtesselator* m_GluTesselator;
GLUtesselator * m_GluTesselator;
unsigned int m_DisplayList;
bool m_DisplayListNeedsRebuild;
bool m_DisplayListNeedsRebuild;
double m_ExtentULX;
double m_ExtentULY;
......
......@@ -29,17 +29,18 @@ namespace otb
class OTBIce_EXPORT GlVersionChecker
{
public:
/**
* Constant containing required OpenGL version for
* client-application feedback messages.
*/
static const char* REQUIRED_GL_VERSION;
static const char * REQUIRED_GL_VERSION;
/**
* Constant containing required shading-language version for
* client-application feedback messages.
*/
static const char* REQUIRED_GLSL_VERSION;
static const char * REQUIRED_GLSL_VERSION;
/**
* \return The OpenGL version used at runtime. The call to this
......@@ -47,7 +48,7 @@ public:
* std::runtime_error() is thrown when glGetError() is different
* than GL_NO_ERROR.
*/
static const char* GLVersion();
static const char * GLVersion();
/**
* \return The OpenGL Shading-Language version used at runtime. The
......@@ -58,7 +59,7 @@ public:
* 2.0. (@see
* http://www.opengl.org/sdk/docs/man2/xhtml/glGetString.xml).
*/
static const char* GLSLVersion();
static const char * GLSLVersion();
/**
* \brief Check that OpenGL required capabilities have been reached.
......@@ -72,7 +73,8 @@ public:
* \return true if OpengGL capabilities of running platform meets
* the needs of the library.
*/
static bool CheckGLCapabilities(const char*& glVersion, const char*& glslVersion);
static bool CheckGLCapabilities( const char * & glVersion,
const char * & glslVersion );
/**
* \brief Compares to version-strings on the model of strcmp().
......@@ -88,7 +90,7 @@ public:
* \return <code>-1</code> if version<required; <code>0</code> if
* version==required; <code>+1</code> if version>=required.
*/
static int VerCmp(const char* version, const char* required);
static int VerCmp( const char * version, const char * required );
private:
// Prevent instantiation
......@@ -109,7 +111,10 @@ private:
* \return <code>true</code> if operation has succeeded,
* <code>false</code> otherwise.
*/
static bool SplitVersion(const char* version, int& major, int& minor, int& release);
static bool SplitVersion( const char * version,
int& major,
int& minor,
int& release );
};
} // End namespace otb
......
......@@ -33,49 +33,49 @@ namespace otb
class ImageSettings : public itk::Object
{
public:
typedef ImageSettings Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
typedef ImageSettings Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkSetMacro( MinRed, double );
itkSetMacro( MinGreen, double );
itkSetMacro( MinBlue, double );
itkSetMacro(MinRed, double);
itkSetMacro(MinGreen, double);
itkSetMacro(MinBlue, double);
itkGetMacro( MinRed, double );
itkGetMacro( MinGreen, double );
itkGetMacro( MinBlue, double );
itkGetMacro(MinRed, double);
itkGetMacro(MinGreen, double);
itkGetMacro(MinBlue, double);
itkSetMacro( MaxRed, double );
itkSetMacro( MaxGreen, double );
itkSetMacro( MaxBlue, double);
itkSetMacro(MaxRed, double);
itkSetMacro(MaxGreen, double);
itkSetMacro(MaxBlue, double);
itkGetMacro( MaxRed, double);
itkGetMacro( MaxGreen, double);
itkGetMacro( MaxBlue, double);
itkGetMacro(MaxRed, double);
itkGetMacro(MaxGreen, double);
itkGetMacro(MaxBlue, double);
itkSetMacro( UseNoData, bool );
itkGetMacro( UseNoData, bool );
itkSetMacro(UseNoData, bool);
itkGetMacro(UseNoData, bool);
itkSetMacro( NoData, double );
itkGetMacro( NoData, double );
itkSetMacro(NoData, double);
itkGetMacro(NoData, double);
itkSetMacro( CurrentRed, double );
itkSetMacro( CurrentGreen, double );
itkSetMacro( CurrentBlue, double );
itkSetMacro(CurrentRed, double);
itkSetMacro(CurrentGreen, double);
itkSetMacro(CurrentBlue, double);
itkGetMacro( CurrentRed, double );
itkGetMacro( CurrentGreen, double );
itkGetMacro( CurrentBlue, double );
itkGetMacro(CurrentRed, double);
itkGetMacro(CurrentGreen, double);
itkGetMacro(CurrentBlue, double);
itkSetMacro( Gamma, double );
itkGetMacro( Gamma, double );
itkSetMacro(Gamma, double);
itkGetMacro(Gamma, double);
itkSetMacro( Alpha, double );
itkGetMacro( Alpha, double );
itkSetMacro(Alpha, double);
itkGetMacro(Alpha, double);
itkNewMacro(Self);
itkNewMacro( Self );
protected:
......@@ -86,8 +86,8 @@ protected:
private:
// prevent implementation
ImageSettings(const Self&);
void operator=(const Self&);
ImageSettings( const Self & );
void operator = ( const Self & );
double m_MinRed;
double m_MaxRed;
......
......@@ -33,29 +33,30 @@
namespace otb
{
class OTBIce_EXPORT NonOptGlImageActor : public GlActor
class OTBIce_EXPORT NonOptGlImageActor
: public GlActor
{
public:
typedef NonOptGlImageActor Self;
typedef GlActor Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
typedef NonOptGlImageActor Self;
typedef GlActor Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
itkNewMacro(Self);
typedef VectorImage<float> VectorImageType;
typedef VectorImageType::ImageKeywordlistType ImageKeywordlistType;
typedef VectorImageType::SizeType SizeType;
typedef VectorImageType::IndexType IndexType;
typedef VectorImageType::RegionType RegionType;
typedef VectorImageType::SpacingType SpacingType;
typedef VectorImageType::PointType PointType;
typedef VectorImage<float> VectorImageType;