Commit b21ce73c authored by Maciej Suminski's avatar Maciej Suminski
Browse files

Initial version of the drawing tool.

parent 363709e7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -251,6 +251,7 @@ set( PCBNEW_CLASS_SRCS
    tools/selection_tool.cpp
    tools/selection_area.cpp
    tools/bright_box.cpp
	tools/drawing_tool.cpp
    tools/edit_tool.cpp
    tools/pcb_tools.cpp
    tools/common_actions.cpp
+4 −0
Original line number Diff line number Diff line
@@ -56,3 +56,7 @@ TOOL_ACTION COMMON_ACTIONS::remove( "pcbnew.InteractiveEdit.remove",
TOOL_ACTION COMMON_ACTIONS::properties( "pcbnew.InteractiveEdit.properties",
        AS_GLOBAL, 'E',
        "Properties...", "Displays properties window" );

TOOL_ACTION COMMON_ACTIONS::drawingLine( "pcbnew.InteractiveDrawing.line",
        AS_GLOBAL, 'D',
        "Draw a line", "Draw a line" );
+3 −0
Original line number Diff line number Diff line
@@ -56,4 +56,7 @@ public:

    /// Deleting a BOARD_ITEM
    static TOOL_ACTION remove;

    /// Activation of the drawing tool (line)
    static TOOL_ACTION drawingLine;
};
+3 −0
Original line number Diff line number Diff line
@@ -114,6 +114,9 @@ private:
            m_updateFlag = aFlag;
    }

    ///> Updates ratsnest for selected items.
    ///> @param aRedraw says if selected items should be drawn using the simple mode (e.g. one line
    ///> per item).
    void updateRatsnest( bool aRedraw );

    ///> Returns the right modification point (e.g. for rotation), depending on the number of
+3 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@

#include "selection_tool.h"
#include "edit_tool.h"
#include "drawing_tool.h"
#include "common_actions.h"
#include <router/router_tool.h>

@@ -54,11 +55,13 @@ void PCB_EDIT_FRAME::setupTools()
    m_toolManager->RegisterAction( &COMMON_ACTIONS::flip );
    m_toolManager->RegisterAction( &COMMON_ACTIONS::remove );
    m_toolManager->RegisterAction( &COMMON_ACTIONS::properties );
    m_toolManager->RegisterAction( &COMMON_ACTIONS::drawingLine );

    // Register tools
    m_toolManager->RegisterTool( new SELECTION_TOOL );
    m_toolManager->RegisterTool( new ROUTER_TOOL );
    m_toolManager->RegisterTool( new EDIT_TOOL );
	m_toolManager->RegisterTool( new DRAWING_TOOL );

    m_toolManager->SetEnvironment( NULL, GetGalCanvas()->GetView(),
                                   GetGalCanvas()->GetViewControls(), this );