diff --git a/simgear/canvas/Canvas.cxx b/simgear/canvas/Canvas.cxx index 9b3ae44c..74ae92b0 100644 --- a/simgear/canvas/Canvas.cxx +++ b/simgear/canvas/Canvas.cxx @@ -1,4 +1,5 @@ -// The canvas for rendering with the 2d API +///@file +/// The canvas for rendering with the 2d API // // Copyright (C) 2012 Thomas Geymayer // diff --git a/simgear/canvas/Canvas.hxx b/simgear/canvas/Canvas.hxx index 6e02b247..7e22275c 100644 --- a/simgear/canvas/Canvas.hxx +++ b/simgear/canvas/Canvas.hxx @@ -71,18 +71,18 @@ namespace canvas public osg::NodeCallback { public: - CullCallback(const CanvasWeakPtr& canvas); + explicit CullCallback(const CanvasWeakPtr& canvas); private: CanvasWeakPtr _canvas; - virtual void operator()(osg::Node* node, osg::NodeVisitor* nv); + void operator()(osg::Node* node, osg::NodeVisitor* nv) override; }; typedef osg::ref_ptr CullCallbackPtr; - Canvas(SGPropertyNode* node); + explicit Canvas(SGPropertyNode* node); virtual ~Canvas(); - virtual void onDestroy(); + void onDestroy() override; void setCanvasMgr(CanvasMgr* canvas_mgr); CanvasMgr* getCanvasMgr() const; @@ -184,11 +184,9 @@ namespace canvas bool propagateEvent( EventPtr const& event, EventPropagationPath const& path ); - virtual void childAdded( SGPropertyNode * parent, - SGPropertyNode * child ); - virtual void childRemoved( SGPropertyNode * parent, - SGPropertyNode * child ); - virtual void valueChanged (SGPropertyNode * node); + void childAdded(SGPropertyNode* parent, SGPropertyNode* child) override; + void childRemoved(SGPropertyNode* parent, SGPropertyNode* child) override; + void valueChanged(SGPropertyNode * node) override; osg::Texture2D* getTexture() const; @@ -254,8 +252,8 @@ namespace canvas static SystemAdapterPtr _system_adapter; - Canvas(const Canvas&); // = delete; - Canvas& operator=(const Canvas&); // = delete; + Canvas(const Canvas&) = delete; + Canvas& operator=(const Canvas&) = delete; }; } // namespace canvas diff --git a/simgear/canvas/CanvasEvent.cxx b/simgear/canvas/CanvasEvent.cxx index bf54a90a..2540b907 100644 --- a/simgear/canvas/CanvasEvent.cxx +++ b/simgear/canvas/CanvasEvent.cxx @@ -1,4 +1,5 @@ -// Canvas Event for event model similar to DOM Level 3 Event Model +///@file +/// Canvas Event for event model similar to DOM Level 3 Event Model // // Copyright (C) 2012 Thomas Geymayer // @@ -125,10 +126,10 @@ namespace canvas //---------------------------------------------------------------------------- std::string Event::typeToStr(int type) { - TypeMap const& type_map = getTypeMap(); + auto const& map_by_id = getTypeMap().by(); - TypeMap::map_by::const_iterator it = type_map.by().find(type); - if( it == type_map.by().end() ) + auto it = map_by_id.find(type); + if( it == map_by_id.end() ) return "unknown"; return it->second; } diff --git a/simgear/canvas/CanvasEvent.hxx b/simgear/canvas/CanvasEvent.hxx index fcda8690..58532e53 100644 --- a/simgear/canvas/CanvasEvent.hxx +++ b/simgear/canvas/CanvasEvent.hxx @@ -115,7 +115,14 @@ namespace canvas */ bool defaultPrevented() const; + /** + * Register a new type string or get the id of an existing type string + * + * @param type Type string + * @return Id of the given @a type + */ static int getOrRegisterType(const std::string& type); + static int strToType(const std::string& type); static std::string typeToStr(int type); diff --git a/simgear/canvas/CanvasEventManager.cxx b/simgear/canvas/CanvasEventManager.cxx index 9d9df35d..0e68bdd9 100644 --- a/simgear/canvas/CanvasEventManager.cxx +++ b/simgear/canvas/CanvasEventManager.cxx @@ -1,4 +1,5 @@ -// Manage event handling inside a Canvas similar to the DOM Level 3 Event Model +///@file +/// Manage event handling inside a Canvas similar to the DOM Level 3 Event Model // // Copyright (C) 2012 Thomas Geymayer // @@ -17,9 +18,11 @@ // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA #include + #include "CanvasEventManager.hxx" -#include -#include +#include "elements/CanvasElement.hxx" +#include "events/MouseEvent.hxx" + #include namespace simgear diff --git a/simgear/canvas/CanvasEventManager.hxx b/simgear/canvas/CanvasEventManager.hxx index 5e3738c8..e29d7498 100644 --- a/simgear/canvas/CanvasEventManager.hxx +++ b/simgear/canvas/CanvasEventManager.hxx @@ -1,4 +1,5 @@ -// Manage event handling inside a Canvas similar to the DOM Level 3 Event Model +///@file +/// Manage event handling inside a Canvas similar to the DOM Level 3 Event Model // // Copyright (C) 2012 Thomas Geymayer // diff --git a/simgear/canvas/CanvasEventTypes.hxx b/simgear/canvas/CanvasEventTypes.hxx index bbe1fe71..51efea40 100644 --- a/simgear/canvas/CanvasEventTypes.hxx +++ b/simgear/canvas/CanvasEventTypes.hxx @@ -1,4 +1,5 @@ -// Mapping between canvas gui Event types and their names +///@file +/// Mapping between canvas gui Event types and their names // // Copyright (C) 2012 Thomas Geymayer // diff --git a/simgear/canvas/CanvasEventVisitor.cxx b/simgear/canvas/CanvasEventVisitor.cxx index eb7cdbf0..738a6b6c 100644 --- a/simgear/canvas/CanvasEventVisitor.cxx +++ b/simgear/canvas/CanvasEventVisitor.cxx @@ -1,5 +1,6 @@ -// Visitor for traversing a canvas element hierarchy similar to the traversal -// of the DOM Level 3 Event Model +///@file +/// Visitor for traversing a canvas element hierarchy similar to the traversal +/// of the DOM Level 3 Event Model // // Copyright (C) 2012 Thomas Geymayer // @@ -18,9 +19,10 @@ // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA #include + #include "CanvasEvent.hxx" #include "CanvasEventVisitor.hxx" -#include +#include "elements/CanvasElement.hxx" namespace simgear { diff --git a/simgear/canvas/CanvasEventVisitor.hxx b/simgear/canvas/CanvasEventVisitor.hxx index 84b304a5..ee8ab846 100644 --- a/simgear/canvas/CanvasEventVisitor.hxx +++ b/simgear/canvas/CanvasEventVisitor.hxx @@ -1,5 +1,6 @@ -// Visitor for traversing a canvas element hierarchy similar to the traversal -// of the DOM Level 3 Event Model +///@file +/// Visitor for traversing a canvas element hierarchy similar to the traversal +/// of the DOM Level 3 Event Model // // Copyright (C) 2012 Thomas Geymayer // diff --git a/simgear/canvas/CanvasMgr.cxx b/simgear/canvas/CanvasMgr.cxx index 0d2fa1ea..43e70ac3 100644 --- a/simgear/canvas/CanvasMgr.cxx +++ b/simgear/canvas/CanvasMgr.cxx @@ -1,4 +1,5 @@ -// Canvas with 2D rendering API +///@file +/// Canvas with 2D rendering API // // Copyright (C) 2012 Thomas Geymayer // @@ -17,12 +18,11 @@ // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA #include + #include "CanvasMgr.hxx" #include "Canvas.hxx" #include "CanvasEventManager.hxx" -#include - namespace simgear { namespace canvas diff --git a/simgear/canvas/CanvasMgr.hxx b/simgear/canvas/CanvasMgr.hxx index 51ffa576..3255d4bc 100644 --- a/simgear/canvas/CanvasMgr.hxx +++ b/simgear/canvas/CanvasMgr.hxx @@ -1,4 +1,5 @@ -// Canvas with 2D rendering API +///@file +/// Canvas with 2D rendering API // // Copyright (C) 2012 Thomas Geymayer // @@ -61,7 +62,7 @@ namespace canvas protected: - virtual void elementCreated(PropertyBasedElementPtr element); + void elementCreated(PropertyBasedElementPtr element) override; }; } // namespace canvas diff --git a/simgear/canvas/CanvasObjectPlacement.cxx b/simgear/canvas/CanvasObjectPlacement.cxx index 94b07330..678d7a27 100644 --- a/simgear/canvas/CanvasObjectPlacement.cxx +++ b/simgear/canvas/CanvasObjectPlacement.cxx @@ -1,4 +1,5 @@ -// Canvas placement for placing a canvas texture onto osg objects. +///@file +/// Canvas placement for placing a canvas texture onto osg objects // // It also provides a SGPickCallback for passing mouse events to the canvas and // manages emissive lighting of the placed canvas. diff --git a/simgear/canvas/CanvasObjectPlacement.hxx b/simgear/canvas/CanvasObjectPlacement.hxx index a97aeb6e..4806fffb 100644 --- a/simgear/canvas/CanvasObjectPlacement.hxx +++ b/simgear/canvas/CanvasObjectPlacement.hxx @@ -1,5 +1,5 @@ ///@file -/// Placement for putting a canvas texture onto OpenSceneGraph objects. +/// Placement for putting a canvas texture onto OpenSceneGraph objects /// /// It also provides a SGPickCallback for passing mouse events to the canvas and /// manages emissive lighting of the placed canvas. @@ -60,7 +60,7 @@ namespace canvas */ void setCaptureEvents(bool enable); - virtual bool childChanged(SGPropertyNode* child); + bool childChanged(SGPropertyNode* child) override; protected: typedef SGSharedPtr PickCallbackPtr; diff --git a/simgear/canvas/CanvasPlacement.cxx b/simgear/canvas/CanvasPlacement.cxx index 95a3bdb8..d300926e 100644 --- a/simgear/canvas/CanvasPlacement.cxx +++ b/simgear/canvas/CanvasPlacement.cxx @@ -1,4 +1,5 @@ -// Base class for canvas placements +///@file +/// Base class for canvas placements // // Copyright (C) 2012 Thomas Geymayer // diff --git a/simgear/canvas/CanvasPlacement.hxx b/simgear/canvas/CanvasPlacement.hxx index cda36795..c11af97b 100644 --- a/simgear/canvas/CanvasPlacement.hxx +++ b/simgear/canvas/CanvasPlacement.hxx @@ -1,4 +1,5 @@ -// Base class for canvas placements +///@file +/// Base class for canvas placements // // Copyright (C) 2012 Thomas Geymayer // @@ -40,9 +41,8 @@ namespace canvas protected: SGPropertyNode_ptr _node; - private: - Placement(const Placement&) /* = delete */; - Placement& operator=(const Placement&) /* = delete */; + Placement(const Placement&) = delete; + Placement& operator=(const Placement&) = delete; }; } // namespace canvas diff --git a/simgear/canvas/CanvasSystemAdapter.hxx b/simgear/canvas/CanvasSystemAdapter.hxx index 43b3f780..b29e0a13 100644 --- a/simgear/canvas/CanvasSystemAdapter.hxx +++ b/simgear/canvas/CanvasSystemAdapter.hxx @@ -1,4 +1,5 @@ -// Adapter for using the canvas with different applications +///@file +/// Adapter for using the canvas with different applications // // Copyright (C) 2012 Thomas Geymayer // @@ -29,6 +30,10 @@ namespace HTTP { class Client; } namespace canvas { + /** + * Provides access to different required systems of the application to the + * Canvas + */ class SystemAdapter { public: diff --git a/simgear/canvas/CanvasWindow.cxx b/simgear/canvas/CanvasWindow.cxx index 6ffd40d0..526c8787 100644 --- a/simgear/canvas/CanvasWindow.cxx +++ b/simgear/canvas/CanvasWindow.cxx @@ -1,4 +1,5 @@ -// Window for placing a Canvas onto it (for dialogs, menus, etc.) +///@file +/// Window for placing a Canvas onto it (for dialogs, menus, etc.) // // Copyright (C) 2012 Thomas Geymayer // diff --git a/simgear/canvas/CanvasWindow.hxx b/simgear/canvas/CanvasWindow.hxx index c4f569ab..db24bb9c 100644 --- a/simgear/canvas/CanvasWindow.hxx +++ b/simgear/canvas/CanvasWindow.hxx @@ -1,4 +1,5 @@ -// Window for placing a Canvas onto it (for dialogs, menus, etc.) +///@file +/// Window for placing a Canvas onto it (for dialogs, menus, etc.) // // Copyright (C) 2012 Thomas Geymayer // diff --git a/simgear/canvas/ODGauge.cxx b/simgear/canvas/ODGauge.cxx index 4a2b7fac..f7e95c4d 100644 --- a/simgear/canvas/ODGauge.cxx +++ b/simgear/canvas/ODGauge.cxx @@ -1,4 +1,5 @@ -// Owner Drawn Gauge helper class +///@file +/// Owner Drawn Gauge helper class // // Written by Harald JOHNSEN, started May 2005. // @@ -6,9 +7,9 @@ // // Ported to OSG by Tim Moore - Jun 2007 // -// Heavily modified to be usable for the 2d Canvas by Thomas Geymayer - April 2012 -// Supports now multisampling/mipmapping, usage of the stencil buffer and placing -// the texture in the scene by certain filter criteria +// Heavily modified to be usable for the 2d Canvas by Thomas Geymayer - April +// 2012 Supports now multisampling/mipmapping, usage of the stencil buffer and +// placing the texture in the scene by certain filter criteria. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Library General Public diff --git a/simgear/canvas/ODGauge.hxx b/simgear/canvas/ODGauge.hxx index 413c9d57..e303c4e3 100644 --- a/simgear/canvas/ODGauge.hxx +++ b/simgear/canvas/ODGauge.hxx @@ -1,4 +1,5 @@ -// Owner Drawn Gauge helper class +///@file +/// Owner Drawn Gauge helper class // // Written by Harald JOHNSEN, started May 2005. // @@ -6,9 +7,9 @@ // // Ported to OSG by Tim Moore - Jun 2007 // -// Heavily modified to be usable for the 2d Canvas by Thomas Geymayer - April 2012 -// Supports now multisampling/mipmapping, usage of the stencil buffer and placing -// the texture in the scene by certain filter criteria +// Heavily modified to be usable for the 2d Canvas by Thomas Geymayer - April +// 2012 Supports now multisampling/mipmapping, usage of the stencil buffer and +// placing the texture in the scene by certain filter criteria. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Library General Public diff --git a/simgear/canvas/VGInitOperation.cxx b/simgear/canvas/VGInitOperation.cxx index 4d5d1734..ac5f8af2 100644 --- a/simgear/canvas/VGInitOperation.cxx +++ b/simgear/canvas/VGInitOperation.cxx @@ -1,4 +1,5 @@ -// osg::Operation to initialize the OpenVG context used for path rendering +///@file +/// osg::Operation to initialize the OpenVG context used for path rendering // // Copyright (C) 2012 Thomas Geymayer // diff --git a/simgear/canvas/VGInitOperation.hxx b/simgear/canvas/VGInitOperation.hxx index 3b9c6436..f21a25f9 100644 --- a/simgear/canvas/VGInitOperation.hxx +++ b/simgear/canvas/VGInitOperation.hxx @@ -1,4 +1,5 @@ -// osg::Operation to initialize the OpenVG context used for path rendering +///@file +/// osg::Operation to initialize the OpenVG context used for path rendering // // Copyright (C) 2012 Thomas Geymayer // diff --git a/simgear/canvas/canvas_fwd.hxx b/simgear/canvas/canvas_fwd.hxx index 3b1b4646..640c2ffa 100644 --- a/simgear/canvas/canvas_fwd.hxx +++ b/simgear/canvas/canvas_fwd.hxx @@ -1,4 +1,5 @@ -// Canvas forward declarations +///@file +/// Canvas forward declarations // // Copyright (C) 2012 Thomas Geymayer // diff --git a/simgear/canvas/elements/CanvasElement.cxx b/simgear/canvas/elements/CanvasElement.cxx index 641fb876..7b564737 100644 --- a/simgear/canvas/elements/CanvasElement.cxx +++ b/simgear/canvas/elements/CanvasElement.cxx @@ -1,4 +1,5 @@ -// Interface for 2D Canvas element +///@file +/// Interface for 2D Canvas element // // Copyright (C) 2012 Thomas Geymayer // diff --git a/simgear/canvas/elements/CanvasElement.hxx b/simgear/canvas/elements/CanvasElement.hxx index fe22aa3c..c993b5d0 100644 --- a/simgear/canvas/elements/CanvasElement.hxx +++ b/simgear/canvas/elements/CanvasElement.hxx @@ -95,7 +95,7 @@ namespace canvas * */ virtual ~Element() = 0; - virtual void onDestroy(); + void onDestroy() override; ElementPtr getParent() const; CanvasWeakPtr getCanvas() const; @@ -105,7 +105,7 @@ namespace canvas * * @param dt Frame time in seconds */ - virtual void update(double dt); + void update(double dt) override; bool addEventListener(const std::string& type, const EventListener& cb); virtual void clearEventListener(); @@ -154,11 +154,9 @@ namespace canvas */ osg::Vec2f posToLocal(const osg::Vec2f& pos) const; - virtual void childAdded( SGPropertyNode * parent, - SGPropertyNode * child ); - virtual void childRemoved( SGPropertyNode * parent, - SGPropertyNode * child ); - virtual void valueChanged(SGPropertyNode * child); + void childAdded(SGPropertyNode* parent, SGPropertyNode* child) override; + void childRemoved(SGPropertyNode* parent, SGPropertyNode* child) override; + void valueChanged(SGPropertyNode* child) override; virtual bool setStyle( const SGPropertyNode* child, const StyleInfo* style_info = 0 ); @@ -597,7 +595,7 @@ namespace canvas osg::ref_ptr _drawable; - Element(const Element&);// = delete + Element(const Element&) = delete; template static Derived& derived_cast(Element& el) diff --git a/simgear/canvas/elements/CanvasGroup.cxx b/simgear/canvas/elements/CanvasGroup.cxx index 02696cde..6755f6d5 100644 --- a/simgear/canvas/elements/CanvasGroup.cxx +++ b/simgear/canvas/elements/CanvasGroup.cxx @@ -1,4 +1,5 @@ -// A group of 2D Canvas elements +///@file +/// A group of 2D Canvas elements // // Copyright (C) 2012 Thomas Geymayer // @@ -168,6 +169,7 @@ namespace canvas if( !_scene_group.valid() ) return warnSceneGroupExpired("clearEventListener"); + // TODO should this be recursive? for(size_t i = 0; i < _scene_group->getNumChildren(); ++i) getChildByIndex(i)->clearEventListener(); } diff --git a/simgear/canvas/elements/CanvasGroup.hxx b/simgear/canvas/elements/CanvasGroup.hxx index 2352aab4..33687637 100644 --- a/simgear/canvas/elements/CanvasGroup.hxx +++ b/simgear/canvas/elements/CanvasGroup.hxx @@ -1,4 +1,5 @@ -// A group of 2D Canvas elements +///@file +/// A group of 2D Canvas elements // // Copyright (C) 2012 Thomas Geymayer // @@ -86,14 +87,15 @@ namespace canvas */ ElementPtr getElementById(const std::string& id); - virtual void clearEventListener(); + void clearEventListener() override; - virtual bool traverse(EventVisitor& visitor); + bool traverse(EventVisitor& visitor) override; - virtual bool setStyle( const SGPropertyNode* child, - const StyleInfo* style_info = 0 ); + bool setStyle( const SGPropertyNode* child, + const StyleInfo* style_info = 0 ) override; - virtual osg::BoundingBox getTransformedBounds(const osg::Matrix& m) const; + osg::BoundingBox + getTransformedBounds(const osg::Matrix& m) const override; protected: @@ -105,11 +107,11 @@ namespace canvas */ virtual ElementFactory getChildFactory(const std::string& type) const; - virtual void updateImpl(double dt); + void updateImpl(double dt) override; - virtual void childAdded(SGPropertyNode * child); - virtual void childRemoved(SGPropertyNode * child); - virtual void childChanged(SGPropertyNode * child); + void childAdded(SGPropertyNode * child) override; + void childRemoved(SGPropertyNode * child) override; + void childChanged(SGPropertyNode * child) override; void handleZIndexChanged(ElementPtr child, int z_index = 0); diff --git a/simgear/canvas/elements/CanvasImage.cxx b/simgear/canvas/elements/CanvasImage.cxx index 4c3aaec9..fbd2cf9f 100644 --- a/simgear/canvas/elements/CanvasImage.cxx +++ b/simgear/canvas/elements/CanvasImage.cxx @@ -1,4 +1,5 @@ -// An image on the Canvas +///@file +/// An image on the Canvas // // Copyright (C) 2012 Thomas Geymayer // diff --git a/simgear/canvas/elements/CanvasImage.hxx b/simgear/canvas/elements/CanvasImage.hxx index 8831b184..9641c489 100644 --- a/simgear/canvas/elements/CanvasImage.hxx +++ b/simgear/canvas/elements/CanvasImage.hxx @@ -1,4 +1,5 @@ -// An image on the Canvas +///@file +/// An image on the Canvas // // Copyright (C) 2012 Thomas Geymayer // @@ -53,7 +54,7 @@ namespace canvas ElementWeakPtr parent = 0 ); virtual ~Image(); - virtual void valueChanged(SGPropertyNode* child); + void valueChanged(SGPropertyNode* child) override; void setSrcCanvas(CanvasPtr canvas); CanvasWeakPtr getSrcCanvas() const; @@ -108,9 +109,9 @@ namespace canvas SRC_CANVAS = DEST_SIZE << 1 }; - virtual void updateImpl(double dt); + void updateImpl(double dt) override; - virtual void childChanged(SGPropertyNode * child); + void childChanged(SGPropertyNode * child) override; void setupDefaultDimensions(); SGRect getTextureDimensions() const; diff --git a/simgear/canvas/elements/CanvasMap.cxx b/simgear/canvas/elements/CanvasMap.cxx index 866954ac..a7c43a51 100644 --- a/simgear/canvas/elements/CanvasMap.cxx +++ b/simgear/canvas/elements/CanvasMap.cxx @@ -1,5 +1,6 @@ -// A group of 2D Canvas elements which get automatically transformed according -// to the map parameters. +///@file +/// A group of 2D Canvas elements which get automatically transformed according +/// to the map parameters. // // Copyright (C) 2012 Thomas Geymayer // diff --git a/simgear/canvas/elements/CanvasMap.hxx b/simgear/canvas/elements/CanvasMap.hxx index ca0521f0..e2959bcf 100644 --- a/simgear/canvas/elements/CanvasMap.hxx +++ b/simgear/canvas/elements/CanvasMap.hxx @@ -1,5 +1,6 @@ -// A group of 2D Canvas elements which get automatically transformed according -// to the map parameters. +///@file +/// A group of 2D Canvas elements which get automatically transformed according +/// to the map parameters. // // Copyright (C) 2012 Thomas Geymayer // @@ -46,16 +47,14 @@ namespace canvas virtual ~Map(); protected: - virtual void updateImpl(double dt); + void updateImpl(double dt) override; void updateProjection(SGPropertyNode* type_node); - virtual void childAdded( SGPropertyNode* parent, - SGPropertyNode* child ); - virtual void childRemoved( SGPropertyNode* parent, - SGPropertyNode* child ); - virtual void valueChanged(SGPropertyNode* child); - virtual void childChanged(SGPropertyNode* child); + void childAdded(SGPropertyNode* parent, SGPropertyNode* child) override; + void childRemoved(SGPropertyNode* parent, SGPropertyNode* child) override; + void valueChanged(SGPropertyNode* child) override; + void childChanged(SGPropertyNode* child) override; using GeoNodes = std::unordered_map>; diff --git a/simgear/canvas/elements/CanvasPath.cxx b/simgear/canvas/elements/CanvasPath.cxx index 7d11a426..c23f1e49 100644 --- a/simgear/canvas/elements/CanvasPath.cxx +++ b/simgear/canvas/elements/CanvasPath.cxx @@ -1,4 +1,5 @@ -// An OpenVG path on the Canvas +///@file +/// An OpenVG path on the Canvas // // Copyright (C) 2012 Thomas Geymayer // @@ -230,9 +231,12 @@ namespace canvas vgDestroyPaint(_paint_fill); } - virtual const char* className() const { return "PathDrawable"; } - virtual osg::Object* cloneType() const { return new PathDrawable(_path_element); } - virtual osg::Object* clone(const osg::CopyOp&) const { return new PathDrawable(_path_element); } + const char* className() const override + { return "PathDrawable"; } + osg::Object* cloneType() const override + { return new PathDrawable(_path_element); } + osg::Object* clone(const osg::CopyOp&) const override + { return new PathDrawable(_path_element); } /** * Replace the current path segments with the new ones @@ -383,7 +387,7 @@ namespace canvas /** * Draw callback */ - virtual void drawImplementation(osg::RenderInfo& renderInfo) const + void drawImplementation(osg::RenderInfo& renderInfo) const override { if( _attributes_dirty & PATH ) return; @@ -555,13 +559,13 @@ namespace canvas /** * Compute the bounding box */ - virtual osg::BoundingBox + osg::BoundingBox #if OSG_VERSION_LESS_THAN(3,3,2) computeBound() #else computeBoundingBox() #endif - const + const override { if( _path == VG_INVALID_HANDLE || (_attributes_dirty & PATH) ) return osg::BoundingBox(); @@ -667,7 +671,7 @@ namespace canvas struct PathUpdateCallback: public osg::Drawable::UpdateCallback { - virtual void update(osg::NodeVisitor*, osg::Drawable* drawable) + void update(osg::NodeVisitor*, osg::Drawable* drawable) override { static_cast(drawable)->update(); } diff --git a/simgear/canvas/elements/CanvasPath.hxx b/simgear/canvas/elements/CanvasPath.hxx index c6edf30e..125c81cd 100644 --- a/simgear/canvas/elements/CanvasPath.hxx +++ b/simgear/canvas/elements/CanvasPath.hxx @@ -1,4 +1,5 @@ -// An OpenVG path on the Canvas +///@file +/// An OpenVG path on the Canvas // // Copyright (C) 2012 Thomas Geymayer // @@ -40,7 +41,8 @@ namespace canvas ElementWeakPtr parent = 0 ); virtual ~Path(); - virtual osg::BoundingBox getTransformedBounds(const osg::Matrix& m) const; + osg::BoundingBox + getTransformedBounds(const osg::Matrix& m) const override; /** Add a segment with the given command and coordinates */ Path& addSegment(uint8_t cmd, std::initializer_list coords = {}); @@ -86,10 +88,10 @@ namespace canvas bool _hasRect : 1; SGRectf _rect; - virtual void updateImpl(double dt); + void updateImpl(double dt) override; - virtual void childRemoved(SGPropertyNode * child); - virtual void childChanged(SGPropertyNode * child); + void childRemoved(SGPropertyNode * child) override; + void childChanged(SGPropertyNode * child) override; void parseRectToVGPath(); }; diff --git a/simgear/canvas/elements/CanvasText.cxx b/simgear/canvas/elements/CanvasText.cxx index 1ac81e5d..ab226be3 100644 --- a/simgear/canvas/elements/CanvasText.cxx +++ b/simgear/canvas/elements/CanvasText.cxx @@ -1,4 +1,5 @@ -// A text on the Canvas +///@file +/// A text on the Canvas // // Copyright (C) 2012 Thomas Geymayer // @@ -17,6 +18,7 @@ // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA #include + #include "CanvasText.hxx" #include #include @@ -56,21 +58,20 @@ namespace canvas SGVec2i sizeForWidth(int w) const; - virtual osg::BoundingBox + osg::BoundingBox #if OSG_VERSION_LESS_THAN(3,3,2) computeBound() #else computeBoundingBox() #endif - const; + const override; protected: - friend class TextLine; canvas::Text *_text_element; - virtual void computePositions(unsigned int contextID) const; + void computePositions(unsigned int contextID) const override; }; class TextLine diff --git a/simgear/canvas/elements/CanvasText.hxx b/simgear/canvas/elements/CanvasText.hxx index a04ba4e5..9abb5105 100644 --- a/simgear/canvas/elements/CanvasText.hxx +++ b/simgear/canvas/elements/CanvasText.hxx @@ -1,4 +1,5 @@ -// A text on the Canvas +///@file +/// A text on the Canvas // // Copyright (C) 2012 Thomas Geymayer // diff --git a/simgear/canvas/elements/map/projection.hxx b/simgear/canvas/elements/map/projection.hxx index e58b9f94..9f9434da 100644 --- a/simgear/canvas/elements/map/projection.hxx +++ b/simgear/canvas/elements/map/projection.hxx @@ -1,4 +1,5 @@ -// Geographic projections for Canvas map element +///@file +/// Geographic projections for Canvas map element // // Copyright (C) 2012 Thomas Geymayer // diff --git a/simgear/canvas/events/CustomEvent.cxx b/simgear/canvas/events/CustomEvent.cxx index 3aab6413..8c289ab1 100644 --- a/simgear/canvas/events/CustomEvent.cxx +++ b/simgear/canvas/events/CustomEvent.cxx @@ -1,4 +1,5 @@ -// Canvas user defined event +///@file +/// Canvas user defined event // // Copyright (C) 2014 Thomas Geymayer // diff --git a/simgear/canvas/events/CustomEvent.hxx b/simgear/canvas/events/CustomEvent.hxx index dc139d46..465f028c 100644 --- a/simgear/canvas/events/CustomEvent.hxx +++ b/simgear/canvas/events/CustomEvent.hxx @@ -38,6 +38,7 @@ namespace canvas public: /** + * @brief Construct a user defined event from a type string * * @param type_str Event type name (if name does not exist yet it will * be registered as new event type) @@ -49,6 +50,10 @@ namespace canvas StringMap const& data = StringMap() ); /** + * @brief Construct a user defined event from a (previously registered) + * type id + * + * @see getOrRegisterType() * * @param type_id Event type id * @param bubbles If this event should take part in the bubbling phase @@ -76,7 +81,7 @@ namespace canvas * @see #bubbles * @see CustomEvent() */ - virtual bool canBubble() const { return bubbles; } + bool canBubble() const override { return bubbles; } StringMap detail; //!< User data map bool bubbles; //!< Whether the event supports bubbling diff --git a/simgear/canvas/events/DeviceEvent.cxx b/simgear/canvas/events/DeviceEvent.cxx index 27075bb6..b45348f7 100644 --- a/simgear/canvas/events/DeviceEvent.cxx +++ b/simgear/canvas/events/DeviceEvent.cxx @@ -1,4 +1,5 @@ -// Input device event +///@file +/// Input device event // // Copyright (C) 2014 Thomas Geymayer // diff --git a/simgear/canvas/events/KeyboardEvent.cxx b/simgear/canvas/events/KeyboardEvent.cxx index 2f6147c9..3a74de52 100644 --- a/simgear/canvas/events/KeyboardEvent.cxx +++ b/simgear/canvas/events/KeyboardEvent.cxx @@ -1,4 +1,5 @@ -// Keyboard event +///@file +/// Keyboard event // // Copyright (C) 2014 Thomas Geymayer // diff --git a/simgear/canvas/events/MouseEvent.cxx b/simgear/canvas/events/MouseEvent.cxx index e513f2da..5952d86c 100644 --- a/simgear/canvas/events/MouseEvent.cxx +++ b/simgear/canvas/events/MouseEvent.cxx @@ -1,4 +1,5 @@ -// Mouse event +///@file +/// Mouse event // // Copyright (C) 2014 Thomas Geymayer // diff --git a/simgear/canvas/events/MouseEvent.hxx b/simgear/canvas/events/MouseEvent.hxx index 49377dbf..e5d0e1b0 100644 --- a/simgear/canvas/events/MouseEvent.hxx +++ b/simgear/canvas/events/MouseEvent.hxx @@ -38,7 +38,7 @@ namespace canvas MouseEvent(const osgGA::GUIEventAdapter& ea); MouseEvent* clone(int type = 0) const override; - virtual bool canBubble() const; + bool canBubble() const override; osg::Vec2f getScreenPos() const { return screen_pos; } osg::Vec2f getClientPos() const { return client_pos; } diff --git a/simgear/canvas/events/input_event_demo.cxx b/simgear/canvas/events/input_event_demo.cxx index 27e172b9..69a549c2 100644 --- a/simgear/canvas/events/input_event_demo.cxx +++ b/simgear/canvas/events/input_event_demo.cxx @@ -1,4 +1,5 @@ -// Keyboard event demo. Press some keys and get some info... +///@file +/// Keyboard event demo. Press some keys and get some info... // // Copyright (C) 2014 Thomas Geymayer // diff --git a/simgear/io/http_repo_sync.cxx b/simgear/io/http_repo_sync.cxx index 47f0db99..4d46c3c2 100644 --- a/simgear/io/http_repo_sync.cxx +++ b/simgear/io/http_repo_sync.cxx @@ -5,8 +5,6 @@ #include #include -#include - #include #include diff --git a/simgear/misc/strutils.hxx b/simgear/misc/strutils.hxx index b6126cd5..ec464a5e 100644 --- a/simgear/misc/strutils.hxx +++ b/simgear/misc/strutils.hxx @@ -72,10 +72,10 @@ namespace simgear { std::string strip( const std::string& s ); /** - * Return a new string with any trailing \r and \n characters removed. + * Return a new string with any trailing \\r and \\n characters removed. * Typically useful to clean a CR-terminated line obtained from - * std::getline() which, upon reading CRLF (\r\n), discards the Line - * Feed character (\n) but leaves the Carriage Return (\r) in the + * std::getline() which, upon reading CRLF (\\r\\n), discards the Line + * Feed character (\\n) but leaves the Carriage Return (\\r) in the * string. * @param s Input string * @return The cleaned string @@ -83,7 +83,7 @@ namespace simgear { std::string stripTrailingNewlines(const std::string& s); /** - * Strip any trailing \r and \n characters from a string. + * Strip any trailing \\r and \\n characters from a string. * Should have slightly less overhead than stripTrailingNewlines(). * @param s Input string (modified in-place) */ @@ -112,11 +112,12 @@ namespace simgear { * Produces a result similar to the perl and python functions of the * same name. * - * @param s The string to split into words, - * @param sep Word delimiters. If not specified then any whitespace is a separator, - * @param maxsplit If given, splits at no more than maxsplit places, - * resulting in at most maxsplit+1 words. - * @return Array of words. + * @param s The string to split into words + * @param sep Word delimiters. If not specified then any whitespace is + * a separator + * @param maxsplit If given, splits at no more than maxsplit places, + * resulting in at most maxsplit+1 words + * @return Array of words */ string_list split( const std::string& s, @@ -124,11 +125,11 @@ namespace simgear { int maxsplit = 0 ); /** - * split a string on any of several characters. Commonly used to deal + * Split a string on any of several characters. Commonly used to deal * with strings containing whitespace, newlines. To parse CSS style - * string, use with '\n\t ,' as the seperator list. + * string, use with '\\n\\t ,' as the separator list. * - * Note consecutive seperators will not produce empty entries in the + * @note Consecutive separators will not produce empty entries in the * the result, i.e splitting 'a,b,,c,d' with a ',' will produce a result * with four entries, not five. */ @@ -226,14 +227,22 @@ namespace simgear { bool to_bool(const std::string& s); /** - * Like strcmp(), but for dotted versions strings NN.NN.NN - * any number of terms are supported. - * @return 0 if versions match, -ve number if v1 is lower, +ve if v1 - * is greater - * @param maxComponents is the maximum number of components to look at. - * This can be used to ignore (say) the patch level by setting it to 2 + * Compare dotted versions strings NN.NN.NN (analogous to strcmp()) + * + * @note Any number of terms are supported. + * + * @param v1 First version + * @param v2 Second version + * @param maxComponents The maximum number of components to look at. This + * can be used to ignore (say) the patch level by + * setting it to 2 + * @return 0 if versions match, + * -ve number if @a v1 is lower, + * +ve if @a v1 is greater */ - int compare_versions(const std::string& v1, const std::string& v2, int maxComponents = 0); + int compare_versions( const std::string& v1, + const std::string& v2, + int maxComponents = 0 ); /** * Convert a string to upper case. diff --git a/simgear/props/PropertyBasedMgr.cxx b/simgear/props/PropertyBasedMgr.cxx index 91217fd5..a279219a 100644 --- a/simgear/props/PropertyBasedMgr.cxx +++ b/simgear/props/PropertyBasedMgr.cxx @@ -1,4 +1,5 @@ -// Base class for property controlled subsystems +///@file +/// Base class for property controlled subsystems // // Copyright (C) 2012 Thomas Geymayer // diff --git a/simgear/props/PropertyBasedMgr.hxx b/simgear/props/PropertyBasedMgr.hxx index 15205038..9a14dab5 100644 --- a/simgear/props/PropertyBasedMgr.hxx +++ b/simgear/props/PropertyBasedMgr.hxx @@ -1,4 +1,5 @@ -// Base class for property controlled subsystems +///@file +/// Base class for property controlled subsystems // // Copyright (C) 2012 Thomas Geymayer // @@ -33,10 +34,10 @@ namespace simgear public SGPropertyChangeListener { public: - virtual void init(); - virtual void shutdown(); + void init() override; + void shutdown() override; - virtual void update (double delta_time_sec); + void update (double delta_time_sec) override; /** * Create a new PropertyBasedElement @@ -88,10 +89,10 @@ namespace simgear ElementFactory element_factory ); virtual ~PropertyBasedMgr() = 0; - virtual void childAdded( SGPropertyNode * parent, - SGPropertyNode * child ); - virtual void childRemoved( SGPropertyNode * parent, - SGPropertyNode * child ); + void childAdded( SGPropertyNode * parent, + SGPropertyNode * child ) override; + void childRemoved( SGPropertyNode * parent, + SGPropertyNode * child ) override; virtual void elementCreated(PropertyBasedElementPtr element) {} diff --git a/simgear/sound/sample.hxx b/simgear/sound/sample.hxx index 4134e9d3..4329a273 100644 --- a/simgear/sound/sample.hxx +++ b/simgear/sound/sample.hxx @@ -23,7 +23,7 @@ // $Id$ /** - * \file audio sample.hxx + * \file * Provides a audio sample encapsulation */