| 68 | namespace OpenOrienteering { |
| 69 | |
| 70 | DrawPathTool::DrawPathTool(MapEditorController* editor, QAction* tool_action, bool is_helper_tool, bool allow_closing_paths) |
| 71 | : DrawLineAndAreaTool(editor, DrawPath, tool_action, is_helper_tool) |
| 72 | , cur_map_widget(mapWidget()) |
| 73 | , angle_helper(new ConstrainAngleToolHelper()) |
| 74 | , azimuth_helper(new AzimuthInfoHelper(cur_map_widget, active_color)) |
| 75 | , snap_helper(new SnappingToolHelper(this)) |
| 76 | , follow_helper(new FollowPathToolHelper()) |
| 77 | , allow_closing_paths(allow_closing_paths) |
| 78 | { |
| 79 | angle_helper->setActive(false); |
| 80 | connect(angle_helper.get(), &ConstrainAngleToolHelper::displayChanged, this, &DrawPathTool::updateDirtyRect); |
| 81 | |
| 82 | updateSnapHelper(); |
| 83 | connect(snap_helper.get(), &SnappingToolHelper::displayChanged, this, &DrawPathTool::updateDirtyRect); |
| 84 | |
| 85 | connect(map(), &Map::objectSelectionChanged, this, &DrawPathTool::objectSelectionChanged); |
| 86 | } |
| 87 | |
| 88 | DrawPathTool::~DrawPathTool() |
| 89 | { |