diff --git a/common/preview_items/two_point_assistant.cpp b/common/preview_items/two_point_assistant.cpp index d777187753..58abcde5f3 100644 --- a/common/preview_items/two_point_assistant.cpp +++ b/common/preview_items/two_point_assistant.cpp @@ -22,20 +22,19 @@ */ #include - #include #include - #include - #include -#include using namespace KIGFX::PREVIEW; -TWO_POINT_ASSISTANT::TWO_POINT_ASSISTANT( - const TWO_POINT_GEOMETRY_MANAGER& aManager, EDA_UNITS aUnits, GEOM_SHAPE aShape ) - : EDA_ITEM( NOT_USED ), m_constructMan( aManager ), m_units( aUnits ), m_shape( aShape ) +TWO_POINT_ASSISTANT::TWO_POINT_ASSISTANT( const TWO_POINT_GEOMETRY_MANAGER& aManager, + EDA_UNITS aUnits, GEOM_SHAPE aShape ) : + EDA_ITEM( NOT_USED ), + m_constructMan( aManager ), + m_units( aUnits ), + m_shape( aShape ) { } @@ -94,6 +93,5 @@ void TWO_POINT_ASSISTANT::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const } // place the text next to cursor, on opposite side from drawing - DrawTextNextToCursor( aView, end, origin - end, cursorStrings, - aLayer == LAYER_SELECT_OVERLAY ); + DrawTextNextToCursor( aView, end, origin - end, cursorStrings, aLayer == LAYER_SELECT_OVERLAY ); } \ No newline at end of file diff --git a/include/preview_items/two_point_assistant.h b/include/preview_items/two_point_assistant.h index 72c69c4f03..bdabb4e6f4 100644 --- a/include/preview_items/two_point_assistant.h +++ b/include/preview_items/two_point_assistant.h @@ -33,60 +33,61 @@ namespace KIGFX namespace PREVIEW { - // TODO: required until PCB_SHAPE_TYPE_T is moved into commons or a better approach is found - enum class GEOM_SHAPE +// TODO: required until PCB_SHAPE_TYPE_T is moved into commons or a better approach is found +enum class GEOM_SHAPE +{ + SEGMENT = 0, + RECT, + ARC, + CIRCLE, + POLYGON, + CURVE +}; + +/** + * Represents an assistant draw when interactively drawing a line or circle on a canvas. + */ +class TWO_POINT_ASSISTANT : public EDA_ITEM +{ +public: + TWO_POINT_ASSISTANT( const TWO_POINT_GEOMETRY_MANAGER& aManager, EDA_UNITS aUnits, + GEOM_SHAPE aShape ); + + const BOX2I ViewBBox() const override; + + void ViewGetLayers( int aLayers[], int& aCount ) const override { - SEGMENT = 0, - RECT, - ARC, - CIRCLE, - POLYGON, - CURVE - }; + aLayers[0] = LAYER_SELECT_OVERLAY; // Assitant graphics + aLayers[1] = LAYER_GP_OVERLAY; // Drop shadows + aCount = 2; + } /** - * Represents an assistant draw when interactively drawing a line or circle on a canvas. + * Draw the assistance (with reference to the contstruction manager */ - class TWO_POINT_ASSISTANT : public EDA_ITEM - { - public: - TWO_POINT_ASSISTANT( - const TWO_POINT_GEOMETRY_MANAGER& aManager, EDA_UNITS aUnits, GEOM_SHAPE aShape ); - - const BOX2I ViewBBox() const override; - - void ViewGetLayers( int aLayers[], int& aCount ) const override - { - aLayers[0] = LAYER_SELECT_OVERLAY; // Assitant graphics - aLayers[1] = LAYER_GP_OVERLAY; // Drop shadows - aCount = 2; - } - - /** - * Draw the assistance (with reference to the contstruction manager - */ - void ViewDraw( int aLayer, KIGFX::VIEW* aView ) const override final; + void ViewDraw( int aLayer, KIGFX::VIEW* aView ) const override final; #if defined( DEBUG ) - void Show( int x, std::ostream& st ) const override - { - } + void Show( int x, std::ostream& st ) const override + { + } #endif - /** - * Get class name - * @return string "TWO_POINT_ASSISTANT" - */ - wxString GetClass() const override - { - return "TWO_POINT_ASSISTANT"; - } + /** + * Get class name + * @return string "TWO_POINT_ASSISTANT" + */ + wxString GetClass() const override + { + return "TWO_POINT_ASSISTANT"; + } + +private: + const TWO_POINT_GEOMETRY_MANAGER& m_constructMan; + EDA_UNITS m_units; + GEOM_SHAPE m_shape; +}; - private: - const TWO_POINT_GEOMETRY_MANAGER& m_constructMan; - EDA_UNITS m_units; - GEOM_SHAPE m_shape; - }; } // namespace PREVIEW } // namespace KIGFX