Skip to content

Commit

Permalink
use override
Browse files Browse the repository at this point in the history
  • Loading branch information
Afforix committed Dec 31, 2020
1 parent e55efe4 commit faaff66
Show file tree
Hide file tree
Showing 34 changed files with 301 additions and 298 deletions.
2 changes: 1 addition & 1 deletion .clang-tidy
@@ -1,7 +1,7 @@
---
Checks: '-*,clang-analyzer-cplusplus.InnerPointer,modernize-use-override'
WarningsAsErrors: '*'
HeaderFilterRegex: ''
HeaderFilterRegex: '.*'
AnalyzeTemporaryDtors: false
FormatStyle: none
CheckOptions:
Expand Down
7 changes: 5 additions & 2 deletions loch/CMakeLists.txt
Expand Up @@ -29,9 +29,12 @@ endif()

# loch executable
add_executable(loch WIN32 ${LOCH_HEADERS} ${LOCH_SOURCES} $<$<BOOL:${IS_WINDOWS}>:lxR2D.c> $<$<STREQUAL:${THPLATFORM},LINUX>:lxR2P.c>)
target_compile_options(loch PRIVATE ${wxWidgets_CXX_FLAGS_LIST})
# we need to filter out include directories from wxWidgets cxx flags list, because we have to set them only as system headers to ignore warnings
set(CXX_FLAGS_WITHOUT_INCLUDE_DIRS ${wxWidgets_CXX_FLAGS_LIST})
list(FILTER CXX_FLAGS_WITHOUT_INCLUDE_DIRS EXCLUDE REGEX "-I/")
target_compile_options(loch PRIVATE ${CXX_FLAGS_WITHOUT_INCLUDE_DIRS})
target_compile_definitions(loch PRIVATE ${LOCH_DEFINITIONS})
target_include_directories(loch PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${FREETYPE_INCLUDE_DIRS} ${wxWidgets_INCLUDE_DIRS} ${VTK_INCLUDE_DIRS} ${X11_INCLUDE_DIR})
target_include_directories(loch SYSTEM PRIVATE ${FREETYPE_INCLUDE_DIRS} ${wxWidgets_INCLUDE_DIRS} ${VTK_INCLUDE_DIRS} ${X11_INCLUDE_DIR})
target_link_libraries(loch PRIVATE
loch-common
${wxWidgets_LIBRARIES}
Expand Down
2 changes: 1 addition & 1 deletion loch/lxGUI.h
Expand Up @@ -269,7 +269,7 @@ class lxApp: public wxGLApp
wxLocale m_locale;
wxFileName m_path;

bool OnInit();
bool OnInit() override;

#ifdef LXMACOSX
virtual void MacOpenFile(const wxString &fileName);
Expand Down
84 changes: 42 additions & 42 deletions loch/lxOGLFT.h
Expand Up @@ -1210,7 +1210,7 @@ namespace OGLFT {
* Set the individual character rotation in the Z direction.
* \param character_rotation_z angle in degrees of the Z rotation.
*/
void setCharacterRotationZ ( GLfloat character_rotation_z );
void setCharacterRotationZ ( GLfloat character_rotation_z ) override;

/*!
* \return the character rotation in the X direction.
Expand All @@ -1225,7 +1225,7 @@ namespace OGLFT {
/*!
* \return the character rotation in the Z direction.
*/
GLfloat characterRotationZ ( void ) const { return character_rotation_.z_; }
GLfloat characterRotationZ ( void ) const override { return character_rotation_.z_; }

/*!
* Set an optional color tesselation object. Each tesselated vertex
Expand Down Expand Up @@ -1253,22 +1253,22 @@ namespace OGLFT {
/*!
* \return the height (i.e., line spacing) at the current character size.
*/
double height ( void ) const;
double height ( void ) const override;

/*!
* Implement measuring a character in a polygonal face.
* \param c the (latin1) character to measure
* \return the bounding box of c.
*/
BBox measure ( unsigned char c );
BBox measure ( unsigned char c ) override;
#ifdef _UNICODE
#ifndef OGLFT_NO_WX
/*!
* Implement measuring a character in a polygonal face.
* \param c the (UNICODE) character to measure
* \return the bounding box of c.
*/
BBox measure ( const wxChar c );
BBox measure ( const wxChar c ) override;
#endif /* OGLFT_NO_WX */
#endif /* _UNICODE */

Expand All @@ -1278,25 +1278,25 @@ namespace OGLFT {
* \param s string of (latin1) characters to measure
* \return the bounding box of s.
*/
BBox measure ( const char* s ) { return Face::measure( s ); }
BBox measure ( const char* s ) override { return Face::measure( s ); }
#ifndef OGLFT_NO_WX
/*!
* Implement measuring a formatted number
* \param format the format string
* \param number to value to format
* \return the bounding box of the formatted number
*/
BBox measure ( const wxString& format, double number )
BBox measure ( const wxString& format, double number ) override
{ return Face::measure( format, number ); }
#endif /* OGLFT_NO_WX */

private:
void init ( void );
void setCharSize ( void );
void setRotationOffset ( void );
GLuint compileGlyph ( FT_Face face, FT_UInt glyph_index );
void setCharSize ( void ) override;
void setRotationOffset ( void ) override;
GLuint compileGlyph ( FT_Face face, FT_UInt glyph_index ) override;
protected:
void clearCaches ( void );
void clearCaches ( void ) override;
};

//! Render text as a polygon outline.
Expand Down Expand Up @@ -1343,7 +1343,7 @@ namespace OGLFT {
~Outline ( void );
private:
void init ( void );
void renderGlyph ( FT_Face face, FT_UInt glyph_index );
void renderGlyph ( FT_Face face, FT_UInt glyph_index ) override;
static int moveToCallback ( FT_Vector* to, Outline* outline );
static int lineToCallback ( FT_Vector* to, Outline* outline );
static int conicToCallback ( FT_Vector* control, FT_Vector* to, Outline* outline );
Expand Down Expand Up @@ -1421,7 +1421,7 @@ namespace OGLFT {
VertexInfoList& extraVertices ( void ) { return extra_vertices_; }

protected:
void renderGlyph ( FT_Face face, FT_UInt glyph_index );
void renderGlyph ( FT_Face face, FT_UInt glyph_index ) override;
private:
void init ( void );
static int moveToCallback ( FT_Vector* to, Filled* filled );
Expand Down Expand Up @@ -1589,23 +1589,23 @@ namespace OGLFT {
* Set the individual character rotation in the Z direction.
* \param character_rotation_z angle in degrees of Z rotation.
*/
void setCharacterRotationZ ( GLfloat character_rotation_z );
void setCharacterRotationZ ( GLfloat character_rotation_z ) override;
/*!
* \return the character rotation in the Z direction.
*/
GLfloat characterRotationZ ( void ) const { return character_rotation_z_; }
GLfloat characterRotationZ ( void ) const override { return character_rotation_z_; }

/*!
* \return the height (i.e., line spacing) at the current character size.
*/
double height ( void ) const;
double height ( void ) const override;

/*!
* Implement measuring a character in a raster face.
* \param c the (latin1) character to measure
* \return the bounding box of c.
*/
BBox measure ( unsigned char c );
BBox measure ( unsigned char c ) override;

#ifdef _UNICODE
#ifndef OGLFT_NO_WX
Expand All @@ -1614,7 +1614,7 @@ namespace OGLFT {
* \param c the (UNICODE) character to measure
* \return the bounding box of c.
*/
BBox measure ( const wxChar c );
BBox measure ( const wxChar c ) override;
#endif /* OGLFT_NO_WX */
#endif /* _UNICODE */

Expand All @@ -1624,24 +1624,24 @@ namespace OGLFT {
* \param s string of (latin1) characters to measure
* \return the bounding box of s.
*/
BBox measure ( const char* s ) { return Face::measure( s ); }
BBox measure ( const char* s ) override { return Face::measure( s ); }
#ifndef OGLFT_NO_WX
/*!
* Implement measuring a formatted number
* \param format the format string
* \param number to value to format
* \return the bounding box of the formatted number
*/
BBox measure ( const wxString& format, double number )
BBox measure ( const wxString& format, double number ) override
{ return Face::measure( format, number ); }
#endif /* OGLFT_NO_WX */

private:
void init ( void );
GLuint compileGlyph ( FT_Face face, FT_UInt glyph_index );
void setCharSize ( void );
void setRotationOffset ( void );
void clearCaches ( void );
GLuint compileGlyph ( FT_Face face, FT_UInt glyph_index ) override;
void setCharSize ( void ) override;
void setRotationOffset ( void ) override;
void clearCaches ( void ) override;
};

//! Render text as a monochrome raster image.
Expand Down Expand Up @@ -1689,7 +1689,7 @@ namespace OGLFT {
~Monochrome ( void );
private:
GLubyte* invertBitmap ( const FT_Bitmap& bitmap );
void renderGlyph ( FT_Face face, FT_UInt glyph_index );
void renderGlyph ( FT_Face face, FT_UInt glyph_index ) override;
};

//! Render text as a grayscale raster image.
Expand Down Expand Up @@ -1738,7 +1738,7 @@ namespace OGLFT {
~Grayscale ( void );
private:
GLubyte* invertPixmap ( const FT_Bitmap& bitmap );
void renderGlyph ( FT_Face face, FT_UInt glyph_index );
void renderGlyph ( FT_Face face, FT_UInt glyph_index ) override;
};

//! Render text as a translucent raster image.
Expand Down Expand Up @@ -1795,7 +1795,7 @@ namespace OGLFT {

private:
GLubyte* invertPixmapWithAlpha ( const FT_Bitmap& bitmap );
void renderGlyph ( FT_Face face, FT_UInt glyph_index );
void renderGlyph ( FT_Face face, FT_UInt glyph_index ) override;
};

//! This is the base class of the texture style.
Expand Down Expand Up @@ -1883,7 +1883,7 @@ namespace OGLFT {
* Set the individual character rotation in the Z direction.
* \param character_rotation_z angle in degrees of Z rotation.
*/
void setCharacterRotationZ ( GLfloat character_rotation_z );
void setCharacterRotationZ ( GLfloat character_rotation_z ) override;

/*!
* \return the character rotation in the X direction.
Expand All @@ -1898,19 +1898,19 @@ namespace OGLFT {
/*!
* \return the character rotation in the Z direction.
*/
GLfloat characterRotationZ ( void ) const { return character_rotation_.z_; }
GLfloat characterRotationZ ( void ) const override { return character_rotation_.z_; }

/*!
* \return the height (i.e., line spacing) at the current character size.
*/
double height ( void ) const;
double height ( void ) const override;

/*!
* Implement measuring a character in a texture face.
* \param c the (latin1) character to measure
* \return the bounding box of c.
*/
BBox measure ( unsigned char c );
BBox measure ( unsigned char c ) override;

#ifdef _UNICODE
#ifndef OGLFT_NO_WX
Expand All @@ -1919,7 +1919,7 @@ namespace OGLFT {
* \param c the (UNICODE) character to measure
* \return the bounding box of c.
*/
BBox measure ( const wxChar c );
BBox measure ( const wxChar c ) override;
#endif /* OGLFT_NO_WX */
#endif /* _UNICODE */

Expand All @@ -1929,15 +1929,15 @@ namespace OGLFT {
* \param s string of (latin1) characters to measure
* \return the bounding box of s.
*/
BBox measure ( const char* s ) { return Face::measure( s ); }
BBox measure ( const char* s ) override { return Face::measure( s ); }
#ifndef OGLFT_NO_WX
/*!
* Implement measuring a formatted number
* \param format the format string
* \param number to value to format
* \return the bounding box of the formatted number
*/
BBox measure ( const wxString& format, double number )
BBox measure ( const wxString& format, double number ) override
{ return Face::measure( format, number ); }
#endif /* OGLFT_NO_WX */

Expand All @@ -1962,11 +1962,11 @@ namespace OGLFT {

private:
void init ( void );
void setCharSize ( void );
void setRotationOffset ( void );
GLuint compileGlyph ( FT_Face face, FT_UInt glyph_index );
void renderGlyph ( FT_Face face, FT_UInt glyph_index );
void clearCaches ( void );
void setCharSize ( void ) override;
void setRotationOffset ( void ) override;
GLuint compileGlyph ( FT_Face face, FT_UInt glyph_index ) override;
void renderGlyph ( FT_Face face, FT_UInt glyph_index ) override;
void clearCaches ( void ) override;
};

//! Render text as texture mapped monochrome quads.
Expand Down Expand Up @@ -2022,7 +2022,7 @@ namespace OGLFT {
~MonochromeTexture ( void );
private:
GLubyte* invertBitmap ( const FT_Bitmap& bitmap, int* width, int* height );
void bindTexture ( FT_Face face, FT_UInt glyph_index );
void bindTexture ( FT_Face face, FT_UInt glyph_index ) override;
};

//! Render text as texture mapped grayscale quads.
Expand Down Expand Up @@ -2078,7 +2078,7 @@ namespace OGLFT {
~GrayscaleTexture ( void );
private:
GLubyte* invertPixmap ( const FT_Bitmap& bitmap, int* width, int* height );
void bindTexture ( FT_Face face, FT_UInt glyph_index );
void bindTexture ( FT_Face face, FT_UInt glyph_index ) override;
};

//! Render text as texture mapped translucent quads.
Expand Down Expand Up @@ -2140,7 +2140,7 @@ namespace OGLFT {
~TranslucentTexture ( void );
private:
GLubyte* invertPixmap ( const FT_Bitmap& bitmap, int* width, int* height );
void bindTexture ( FT_Face face, FT_UInt glyph_index );
void bindTexture ( FT_Face face, FT_UInt glyph_index ) override;
};
} // Close OGLFT namespace
#endif /* OGLFT_H */
16 changes: 8 additions & 8 deletions loch/lxWX.h
Expand Up @@ -115,15 +115,15 @@ class lxDoubleValidator : public wxValidator {

~lxDoubleValidator();

virtual wxObject *Clone() const { return new lxDoubleValidator(*this); }
wxObject *Clone() const override { return new lxDoubleValidator(*this); }

bool Copy(const lxDoubleValidator& val);

virtual bool Validate(wxWindow *parent);
bool Validate(wxWindow *parent) override;

virtual bool TransferToWindow();
bool TransferToWindow() override;

virtual bool TransferFromWindow();
bool TransferFromWindow() override;

protected:

Expand Down Expand Up @@ -157,15 +157,15 @@ class lxRadioBtnValidator : public wxValidator {

~lxRadioBtnValidator();

virtual wxObject *Clone() const { return new lxRadioBtnValidator(*this); }
wxObject *Clone() const override { return new lxRadioBtnValidator(*this); }

bool Copy(const lxRadioBtnValidator& val);

virtual bool Validate(wxWindow *parent);
bool Validate(wxWindow *parent) override;

virtual bool TransferToWindow();
bool TransferToWindow() override;

virtual bool TransferFromWindow();
bool TransferFromWindow() override;

protected:

Expand Down

0 comments on commit faaff66

Please sign in to comment.