From 7afd16f36facb6e2254b63880cf0b7f3976409c6 Mon Sep 17 00:00:00 2001 From: Richard Powell Date: Sun, 2 May 2021 10:43:15 -0700 Subject: [PATCH 1/2] Wide variety of changes to make modernize CalChart. Working towards a more unified syntax for easier reading. Consolidating many of the ancillary data objects for the Show into the Doc to allow greater understanding on what is part of the larger show instead of transient state. Making FieldCanvas easier to understand by changing wording and objects to be consistent (ie, lasso is a type of shape, and how to check if something is in a polygon is a freestanding object). using auto in more places as a more modern programming technique. Changing naming convention of files to CamelCase style that is consistent with the name of the class they are containing inside. --- CMakeLists.txt | 54 ++- calchart_cmd/main.cpp | 4 +- src/AnimationCanvas.cpp | 2 +- src/AnimationErrorsPanel.cpp | 6 +- src/AnimationErrorsPanel.h | 2 +- src/AnimationView.cpp | 36 +- src/BackgroundImage.cpp | 255 ++++++++++ src/{background_image.h => BackgroundImage.h} | 46 +- src/CCOmniviewCanvas.cpp | 12 - src/CalChartApp.cpp | 107 ++-- src/CalChartApp.h | 18 +- src/CalChartDoc.cpp | 56 ++- src/CalChartDoc.h | 41 +- src/CalChartFrame.cpp | 114 ++--- src/CalChartFrame.h | 14 +- src/CalChartSizes.h | 2 +- src/{TopFrame.cpp => CalChartSplash.cpp} | 118 ++--- src/{TopFrame.h => CalChartSplash.h} | 17 +- src/CalChartToolBar.cpp | 2 +- src/CalChartToolBar.h | 2 +- src/CalChartView.cpp | 90 ++-- src/CalChartView.h | 30 +- src/ColorSetupCanvas.cpp | 8 +- src/ColorSetupDialog.cpp | 2 +- src/ContinuityBrowserPanel.cpp | 2 +- src/ContinuityBrowserPanel.h | 2 +- src/FieldCanvas.cpp | 459 ++++++++---------- src/FieldCanvas.h | 55 +-- src/FieldControlsToolBar.h | 4 +- src/GhostModule.h | 48 ++ ..._instance_ipc.cpp => HostAppInterface.cpp} | 263 ++++------ ...ngle_instance_ipc.h => HostAppInterface.h} | 13 +- src/PreferencesDrawingSetup.cpp | 2 +- src/PreferencesPSPrintingSetup.cpp | 2 +- src/PreferencesShowModeSetup.cpp | 2 +- ...s_dialog.cpp => PrintPostScriptDialog.cpp} | 134 +++-- ...nt_ps_dialog.h => PrintPostScriptDialog.h} | 10 +- src/TransitionSolverView.cpp | 2 +- src/background_image.cpp | 268 ---------- src/contgram.y | 2 +- .../{animate.cpp => CalChartAnimation.cpp} | 112 +---- src/core/{animate.h => CalChartAnimation.h} | 90 +--- ...mmand.cpp => CalChartAnimationCommand.cpp} | 111 ++--- ...tecommand.h => CalChartAnimationCommand.h} | 66 +-- ...mpile.cpp => CalChartAnimationCompile.cpp} | 52 +- ...tecompile.h => CalChartAnimationCompile.h} | 36 +- src/core/CalChartAnimationErrors.h | 63 +++ src/core/CalChartAnimationSheet.cpp | 74 +++ src/core/CalChartAnimationSheet.h | 96 ++++ src/core/{cc_coord.cpp => CalChartCoord.cpp} | 28 +- src/core/{cc_coord.h => CalChartCoord.h} | 65 +-- .../CalChartMovePointsTool.cpp} | 299 ++++++------ src/core/CalChartMovePointsTool.h | 105 ++++ src/core/CalChartSelectTool.cpp | 82 ++++ src/core/CalChartSelectTool.h | 82 ++++ .../{cc_shapes.cpp => CalChartShapes.cpp} | 223 +++++---- src/core/CalChartShapes.h | 236 +++++++++ src/core/{cc_types.h => CalChartTypes.h} | 29 -- src/core/animate_types.h | 34 +- src/core/cc_drawcommand.h | 2 +- src/core/cc_point.h | 4 +- src/core/cc_shapes.h | 234 --------- src/core/cc_sheet.cpp | 4 +- src/core/cc_sheet.h | 6 +- src/core/cc_show.cpp | 37 +- src/core/cc_show.h | 22 +- src/core/cc_text.h | 2 +- src/core/cont.cpp | 146 +++--- src/core/cont.h | 94 ++-- src/core/e7_transition_solver.h | 2 +- src/{ => core}/linmath.h | 0 src/core/math_utils.cpp | 2 +- src/core/math_utils.h | 6 +- src/core/modes.h | 2 +- src/core/print_ps.h | 2 +- src/core/viewer_translate.h | 4 +- src/draw.cpp | 4 +- src/draw.h | 2 +- src/field_canvas_shapes.h | 62 --- src/ghost_module.cpp | 25 - src/ghost_module.h | 40 -- src/precomp.cpp | 1 - src/precomp.h | 3 - src/ui_enums.h | 2 +- 84 files changed, 2502 insertions(+), 2395 deletions(-) create mode 100644 src/BackgroundImage.cpp rename src/{background_image.h => BackgroundImage.h} (56%) rename src/{TopFrame.cpp => CalChartSplash.cpp} (55%) rename src/{TopFrame.h => CalChartSplash.h} (76%) create mode 100644 src/GhostModule.h rename src/{single_instance_ipc.cpp => HostAppInterface.cpp} (52%) rename src/{single_instance_ipc.h => HostAppInterface.h} (67%) rename src/{print_ps_dialog.cpp => PrintPostScriptDialog.cpp} (78%) rename src/{print_ps_dialog.h => PrintPostScriptDialog.h} (91%) delete mode 100644 src/background_image.cpp rename src/core/{animate.cpp => CalChartAnimation.cpp} (81%) rename src/core/{animate.h => CalChartAnimation.h} (57%) rename src/core/{animatecommand.cpp => CalChartAnimationCommand.cpp} (65%) rename src/core/{animatecommand.h => CalChartAnimationCommand.h} (56%) rename src/core/{animatecompile.cpp => CalChartAnimationCompile.cpp} (70%) rename src/core/{animatecompile.h => CalChartAnimationCompile.h} (69%) create mode 100644 src/core/CalChartAnimationErrors.h create mode 100644 src/core/CalChartAnimationSheet.cpp create mode 100644 src/core/CalChartAnimationSheet.h rename src/core/{cc_coord.cpp => CalChartCoord.cpp} (89%) rename src/core/{cc_coord.h => CalChartCoord.h} (69%) rename src/{field_canvas_shapes.cpp => core/CalChartMovePointsTool.cpp} (70%) create mode 100644 src/core/CalChartMovePointsTool.h create mode 100644 src/core/CalChartSelectTool.cpp create mode 100644 src/core/CalChartSelectTool.h rename src/core/{cc_shapes.cpp => CalChartShapes.cpp} (59%) create mode 100644 src/core/CalChartShapes.h rename src/core/{cc_types.h => CalChartTypes.h} (76%) delete mode 100644 src/core/cc_shapes.h rename src/{ => core}/linmath.h (100%) delete mode 100644 src/field_canvas_shapes.h delete mode 100644 src/ghost_module.cpp delete mode 100644 src/ghost_module.h delete mode 100644 src/precomp.cpp delete mode 100644 src/precomp.h diff --git a/CMakeLists.txt b/CMakeLists.txt index f0763ce9..e953746f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,17 +55,27 @@ FLEX_TARGET ( add_library ( calchart_core STATIC - ${CMAKE_CURRENT_SOURCE_DIR}/src/core/animate.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/core/animate.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/core/CalChartAnimation.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/core/CalChartAnimation.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/core/CalChartAnimationErrors.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/core/CalChartAnimationSheet.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/core/CalChartAnimationSheet.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/core/CalChartAnimationCommand.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/core/CalChartAnimationCommand.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/core/CalChartAnimationCompile.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/core/CalChartAnimationCompile.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/core/CalChartCoord.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/core/CalChartCoord.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/core/CalChartMovePointsTool.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/core/CalChartMovePointsTool.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/core/CalChartSelectTool.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/core/CalChartSelectTool.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/core/CalChartShapes.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/core/CalChartShapes.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/core/CalChartTypes.h ${CMAKE_CURRENT_SOURCE_DIR}/src/core/animate_types.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/core/animatecommand.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/core/animatecommand.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/core/animatecompile.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/core/animatecompile.h ${CMAKE_CURRENT_SOURCE_DIR}/src/core/cc_continuity.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/core/cc_continuity.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/core/cc_coord.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/core/cc_coord.h ${CMAKE_CURRENT_SOURCE_DIR}/src/core/cc_drawcommand.h ${CMAKE_CURRENT_SOURCE_DIR}/src/core/cc_fileformat.h ${CMAKE_CURRENT_SOURCE_DIR}/src/core/cc_image.cpp @@ -73,19 +83,17 @@ add_library ( ${CMAKE_CURRENT_SOURCE_DIR}/src/core/cc_parse_errors.h ${CMAKE_CURRENT_SOURCE_DIR}/src/core/cc_point.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/core/cc_point.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/core/cc_shapes.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/core/cc_shapes.h ${CMAKE_CURRENT_SOURCE_DIR}/src/core/cc_sheet.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/core/cc_sheet.h ${CMAKE_CURRENT_SOURCE_DIR}/src/core/cc_show.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/core/cc_show.h ${CMAKE_CURRENT_SOURCE_DIR}/src/core/cc_text.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/core/cc_text.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/core/cc_types.h ${CMAKE_CURRENT_SOURCE_DIR}/src/core/cont.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/core/cont.h ${CMAKE_CURRENT_SOURCE_DIR}/src/core/e7_transition_solver.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/core/e7_transition_solver.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/core/linmath.h ${CMAKE_CURRENT_SOURCE_DIR}/src/core/math_utils.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/core/math_utils.h ${CMAKE_CURRENT_SOURCE_DIR}/src/core/modes.cpp @@ -188,6 +196,8 @@ add_executable ( ${CMAKE_CURRENT_SOURCE_DIR}/src/AnimationPanel.h ${CMAKE_CURRENT_SOURCE_DIR}/src/AnimationView.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/AnimationView.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/BackgroundImage.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/BackgroundImage.h ${CMAKE_CURRENT_SOURCE_DIR}/src/CCOmniviewCanvas.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/CCOmniviewCanvas.h ${CMAKE_CURRENT_SOURCE_DIR}/src/CalChartApp.cpp @@ -202,6 +212,8 @@ add_executable ( ${CMAKE_CURRENT_SOURCE_DIR}/src/CalChartPreferences.h ${CMAKE_CURRENT_SOURCE_DIR}/src/CalChartSizes.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/CalChartSizes.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/CalChartSplash.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/CalChartSplash.h ${CMAKE_CURRENT_SOURCE_DIR}/src/CalChartToolBar.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/CalChartToolBar.h ${CMAKE_CURRENT_SOURCE_DIR}/src/CalChartView.cpp @@ -228,6 +240,8 @@ add_executable ( ${CMAKE_CURRENT_SOURCE_DIR}/src/FieldControlsToolBar.h ${CMAKE_CURRENT_SOURCE_DIR}/src/FieldThumbnailBrowser.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/FieldThumbnailBrowser.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/HostAppInterface.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/HostAppInterface.h ${CMAKE_CURRENT_SOURCE_DIR}/src/PointPicker.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/PointPicker.h ${CMAKE_CURRENT_SOURCE_DIR}/src/PreferencesContCellSetup.cpp @@ -244,20 +258,18 @@ add_executable ( ${CMAKE_CURRENT_SOURCE_DIR}/src/PreferencesUtils.h ${CMAKE_CURRENT_SOURCE_DIR}/src/PrintContinuityEditor.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/PrintContinuityEditor.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/PrintPostScriptDialog.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/PrintPostScriptDialog.h ${CMAKE_CURRENT_SOURCE_DIR}/src/SetupInstruments.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/SetupInstruments.h ${CMAKE_CURRENT_SOURCE_DIR}/src/SetupMarchers.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/SetupMarchers.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/TopFrame.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/TopFrame.h ${CMAKE_CURRENT_SOURCE_DIR}/src/TransitionSolverFrame.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/TransitionSolverFrame.h ${CMAKE_CURRENT_SOURCE_DIR}/src/TransitionSolverProgressFrame.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/TransitionSolverProgressFrame.h ${CMAKE_CURRENT_SOURCE_DIR}/src/TransitionSolverView.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/TransitionSolverView.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/background_image.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/background_image.h ${CMAKE_CURRENT_SOURCE_DIR}/src/basic_ui.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/basic_ui.h ${CMAKE_CURRENT_SOURCE_DIR}/src/cc_omniview_constants.h @@ -268,24 +280,14 @@ add_executable ( ${CMAKE_CURRENT_SOURCE_DIR}/src/draw.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/draw.h ${CMAKE_CURRENT_SOURCE_DIR}/src/draw_utils.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/field_canvas_shapes.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/field_canvas_shapes.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/ghost_module.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/ghost_module.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/linmath.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/GhostModule.h ${CMAKE_CURRENT_SOURCE_DIR}/src/mode_dialog.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/mode_dialog.h ${CMAKE_CURRENT_SOURCE_DIR}/src/mode_dialog_canvas.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/mode_dialog_canvas.h ${CMAKE_CURRENT_SOURCE_DIR}/src/platconf.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/precomp.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/precomp.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/print_ps_dialog.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/print_ps_dialog.h ${CMAKE_CURRENT_SOURCE_DIR}/src/setup_wizards.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/setup_wizards.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/single_instance_ipc.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/single_instance_ipc.h ${CMAKE_CURRENT_SOURCE_DIR}/src/ui_enums.h ${CalChartDocs} ${CalChartResources} diff --git a/calchart_cmd/main.cpp b/calchart_cmd/main.cpp index 6cfcdee9..30ce6fbf 100644 --- a/calchart_cmd/main.cpp +++ b/calchart_cmd/main.cpp @@ -8,8 +8,8 @@ #include "cc_show.h" #include "cc_sheet.h" -#include "animate.h" -#include "animatecompile.h" +#include "CalChartAnimation.h" +#include "CalChartAnimationCompile.h" #include "print_ps.h" #include "modes.h" #include "cont.h" diff --git a/src/AnimationCanvas.cpp b/src/AnimationCanvas.cpp index 4b552851..181abc18 100644 --- a/src/AnimationCanvas.cpp +++ b/src/AnimationCanvas.cpp @@ -23,7 +23,7 @@ #include "AnimationCanvas.h" #include "AnimationView.h" #include "basic_ui.h" -#include "cc_coord.h" +#include "CalChartCoord.h" #include "confgr.h" #include "ui_enums.h" diff --git a/src/AnimationErrorsPanel.cpp b/src/AnimationErrorsPanel.cpp index 040f816c..e0cebccd 100644 --- a/src/AnimationErrorsPanel.cpp +++ b/src/AnimationErrorsPanel.cpp @@ -19,9 +19,9 @@ along with this program. If not, see . */ +#include "CalChartAnimationErrors.h" #include "AnimationErrorsPanel.h" #include "CalChartView.h" -#include "animate_types.h" #include "basic_ui.h" #include @@ -85,7 +85,7 @@ void AnimationErrorsPanel::OnSelectionChanged(wxTreeListEvent& event) } if (auto error = mErrorLookup.find(event.GetItem()); error != mErrorLookup.end()) { - mView->GoToSheetAndSetSelection(std::get<0>(error->second), std::get<1>(error->second)); + mView->GoToSheetAndSetSelectionList(std::get<0>(error->second), std::get<1>(error->second)); } } @@ -96,7 +96,7 @@ void AnimationErrorsPanel::OnItemActivated(wxTreeListEvent& event) } if (auto error = mErrorLookup.find(event.GetItem()); error != mErrorLookup.end()) { - mView->GoToSheetAndSetSelection(std::get<0>(error->second), std::get<1>(error->second)); + mView->GoToSheetAndSetSelectionList(std::get<0>(error->second), std::get<1>(error->second)); } } diff --git a/src/AnimationErrorsPanel.h b/src/AnimationErrorsPanel.h index bd703755..40df82d7 100644 --- a/src/AnimationErrorsPanel.h +++ b/src/AnimationErrorsPanel.h @@ -20,7 +20,7 @@ along with this program. If not, see . */ -#include "animatecompile.h" +#include "CalChartAnimationCompile.h" #include #include diff --git a/src/AnimationView.cpp b/src/AnimationView.cpp index 09d44cb4..0951011d 100644 --- a/src/AnimationView.cpp +++ b/src/AnimationView.cpp @@ -25,9 +25,8 @@ #include "CalChartApp.h" #include "CalChartSizes.h" #include "CalChartView.h" -#include "animate.h" -#include "animate_types.h" -#include "cc_shapes.h" +#include "CalChartAnimation.h" +#include "CalChartShapes.h" #include "cc_sheet.h" #include "confgr.h" #include "draw.h" @@ -38,18 +37,6 @@ #include #include -template -static auto NormalizeAngle(Float angle) -{ - while (angle > 2 * M_PI) { - angle -= (Float)(2 * M_PI); - } - while (angle < 0.0) { - angle += (Float)(2 * M_PI); - } - return angle; -} - AnimationView::AnimationView(CalChartView* view, wxWindow* frame) : mView(view) { @@ -107,12 +94,12 @@ void AnimationView::OnDrawDots(wxDC& dc, CalChartConfiguration const& config) { auto checkForCollision = mDrawCollisionWarning; for (auto info : mAnimation->GetAllAnimateInfo()) { - if (checkForCollision && info.mCollision) { - if (info.mCollision == CalChart::Coord::COLLISION_WARNING) { + if (checkForCollision && (info.mCollision != CalChart::Coord::CollisionType::none)) { + if (info.mCollision == CalChart::Coord::CollisionType::warning) { auto brushAndPen = config.Get_CalChartBrushAndPen(COLOR_POINT_ANIM_COLLISION_WARNING); dc.SetBrush(brushAndPen.first); dc.SetPen(brushAndPen.second); - } else if (info.mCollision == CalChart::Coord::COLLISION_INTERSECT) { + } else if (info.mCollision == CalChart::Coord::CollisionType::intersect) { auto brushAndPen = config.Get_CalChartBrushAndPen(COLOR_POINT_ANIM_COLLISION); dc.SetBrush(brushAndPen.first); dc.SetPen(brushAndPen.second); @@ -308,12 +295,13 @@ void AnimationView::SelectMarchersInBox(wxPoint const& mouseStart, wxPoint const auto x_off = mView->GetShowMode().Offset().x; auto y_off = mView->GetShowMode().Offset().y; - Lasso lasso(Coord(mouseStartTranslated.x - x_off, mouseStartTranslated.y - y_off)); - lasso.Append(Coord(mouseStartTranslated.x - x_off, mouseEndTranslated.y - y_off)); - lasso.Append(Coord(mouseEndTranslated.x - x_off, mouseEndTranslated.y - y_off)); - lasso.Append(Coord(mouseEndTranslated.x - x_off, mouseStartTranslated.y - y_off)); - lasso.End(); - mView->SelectWithLasso(&lasso, altDown); + auto polygon = CalChart::RawPolygon_t{ + Coord(mouseStartTranslated.x - x_off, mouseStartTranslated.y - y_off), + Coord(mouseStartTranslated.x - x_off, mouseEndTranslated.y - y_off), + Coord(mouseEndTranslated.x - x_off, mouseEndTranslated.y - y_off), + Coord(mouseEndTranslated.x - x_off, mouseStartTranslated.y - y_off), + }; + mView->SelectWithinPolygon(polygon, altDown); } // Keystroke command toggles the timer, but the timer diff --git a/src/BackgroundImage.cpp b/src/BackgroundImage.cpp new file mode 100644 index 00000000..1655e68a --- /dev/null +++ b/src/BackgroundImage.cpp @@ -0,0 +1,255 @@ +/* + * BackgroundImage.cpp + * Maintains the background image data + */ + +/* + Copyright (C) 1995-2011 Garrick Brian Meeker, Richard Michael Powell + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +#include "BackgroundImage.h" +#include + +BackgroundImage::BackgroundImage(const wxImage& image, int x, int y, int scaled_width, int scaled_height) + : mImage(image) + , mBitmapPoint(x, y) + , // always adjust when we get created + mBackgroundAdjustType(BackgroundAdjustType::kLast) +{ + mBitmap = wxBitmap(mImage.Scale(scaled_width, scaled_height, wxIMAGE_QUALITY_HIGH)); +} + +template +constexpr auto toUType(E enumerator) +{ + return static_cast>(enumerator); +} + +bool BackgroundImage::MouseClickIsHit(const wxMouseEvent& event, const wxDC& dc) const +{ + auto point = event.GetPosition(); + auto x = dc.DeviceToLogicalX(point.x); + auto y = dc.DeviceToLogicalY(point.y); + + // where are we? + auto bitmapSize = mBitmap.GetSize(); + auto middle = mBitmapPoint + bitmapSize / 2; + for (auto where = toUType(BackgroundAdjustType::kUpperLeft); where < toUType(BackgroundAdjustType::kLast); ++where) { + if (where == toUType(BackgroundAdjustType::kMove) && wxRect{mBitmapPoint, mBitmap.GetSize()}.Contains(x, y)) { + return true; + } + auto offsetX = (where % 3) - 1; + auto offsetY = (where / 3) - 1; + auto grabPoint = wxRect { + middle.x + (offsetX * (bitmapSize.x / 2 + dc.DeviceToLogicalXRel(kCircleSize / 3))) - dc.DeviceToLogicalXRel(kCircleSize), + middle.y + (offsetY * (bitmapSize.y / 2 + dc.DeviceToLogicalYRel(kCircleSize / 3))) - dc.DeviceToLogicalXRel(kCircleSize), + dc.DeviceToLogicalXRel(kCircleSize * 2), + dc.DeviceToLogicalXRel(kCircleSize * 2) + }; + + if (grabPoint.Contains(x, y)) { + return true; + } + } + return false; +} + +void BackgroundImage::OnMouseLeftDown(wxMouseEvent const& event, wxDC const& dc) +{ + auto point = event.GetPosition(); + auto x = dc.DeviceToLogicalX(point.x); + auto y = dc.DeviceToLogicalY(point.y); + + // where are we? + auto bitmapSize = mBitmap.GetSize(); + auto middle = mBitmapPoint + bitmapSize / 2; + auto where = toUType(BackgroundAdjustType::kUpperLeft); + for (; where < toUType(BackgroundAdjustType::kLast); ++where) { + if (where == toUType(BackgroundAdjustType::kMove)) { + continue; + } + auto offsetX = (where % 3) - 1; + auto offsetY = (where / 3) - 1; + auto grabPoint = wxRect{ + middle.x + (offsetX * (bitmapSize.x / 2 + dc.DeviceToLogicalXRel(kCircleSize / 3))) - dc.DeviceToLogicalXRel(kCircleSize), + middle.y + (offsetY * (bitmapSize.y / 2 + dc.DeviceToLogicalYRel(kCircleSize / 3))) - dc.DeviceToLogicalXRel(kCircleSize), + dc.DeviceToLogicalXRel(kCircleSize * 2), + dc.DeviceToLogicalXRel(kCircleSize * 2) + }; + + if (grabPoint.Contains(x, y)) { + break; + } + } + mBackgroundAdjustType = static_cast(where); + if (mBackgroundAdjustType == BackgroundAdjustType::kLast) { + if (wxRect{mBitmapPoint, wxSize{ mBitmap.GetWidth(), mBitmap.GetHeight() } }.Contains(x, y)) { + mBackgroundAdjustType = BackgroundAdjustType::kMove; + } + } + if (mBackgroundAdjustType != BackgroundAdjustType::kLast) { + mScaleAndMove = std::make_unique(wxPoint{x, y}, wxRect{ mBitmapPoint, mBitmap.GetSize() }, mBackgroundAdjustType); + } +} + +std::array BackgroundImage::OnMouseLeftUp(const wxMouseEvent& event, const wxDC& dc) +{ + if (mScaleAndMove) { + // done moving, lock down the picture and make it pretty: + mBitmap = wxBitmap(mImage.Scale(mBitmap.GetWidth(), mBitmap.GetHeight(), wxIMAGE_QUALITY_HIGH)); + std::array data{ { mBitmapPoint.x, mBitmapPoint.y, mBitmap.GetWidth(), mBitmap.GetHeight() } }; + mScaleAndMove.reset(); + mBackgroundAdjustType = BackgroundAdjustType::kLast; + return data; + } + return { { 0, 0, 0, 0 } }; +} + +void BackgroundImage::OnMouseMove(const wxMouseEvent& event, const wxDC& dc) +{ + auto point = event.GetPosition(); + auto x = dc.DeviceToLogicalX(point.x); + auto y = dc.DeviceToLogicalY(point.y); + + if (event.Dragging() && event.LeftIsDown() && mScaleAndMove) { + auto rect = (*mScaleAndMove)(x, y, { mBitmapPoint, mBitmap.GetSize() }); + mBitmapPoint = rect.GetPosition(); + mBitmap = wxBitmap(mImage.Scale(rect.width, rect.height)); + } +} + +void BackgroundImage::OnPaint(wxDC& dc, bool drawPicAdjustDots, bool selected) const +{ + dc.DrawBitmap(mBitmap, mBitmapPoint.x, mBitmapPoint.y, true); + if (drawPicAdjustDots) { + // draw guide dots + auto bitmapSize = mBitmap.GetSize(); + auto middle = mBitmapPoint + bitmapSize / 2; + dc.SetBrush(*wxBLUE_BRUSH); + dc.SetPen(*wxBLUE_PEN); + for (auto where = toUType(BackgroundAdjustType::kUpperLeft); where < toUType(BackgroundAdjustType::kLast); ++where) { + dc.SetBrush(*wxBLUE_BRUSH); + if (where == toUType(BackgroundAdjustType::kMove)) { + continue; + } + auto offsetX = (where % 3) - 1; + auto offsetY = (where / 3) - 1; + if (toUType(mBackgroundAdjustType) == where) { + dc.SetBrush(*wxRED_BRUSH); + } + dc.DrawCircle( + middle.x + (offsetX * (bitmapSize.x / 2 + dc.DeviceToLogicalXRel(kCircleSize / 3))), + middle.y + (offsetY * (bitmapSize.y / 2 + dc.DeviceToLogicalYRel(kCircleSize / 3))), + dc.DeviceToLogicalXRel(kCircleSize)); + if (selected && toUType(mBackgroundAdjustType) != where) { + dc.SetBrush(*wxWHITE_BRUSH); + dc.DrawCircle( + middle.x + (offsetX * (bitmapSize.x / 2 + dc.DeviceToLogicalXRel(kCircleSize / 3))), + middle.y + (offsetY * (bitmapSize.y / 2 + dc.DeviceToLogicalYRel(kCircleSize / 3))), + dc.DeviceToLogicalXRel(kCircleSize * 0.75)); + } + } + } +} + +BackgroundImage::CalculateScaleAndMove::CalculateScaleAndMove(wxPoint startClick, wxRect rect, BackgroundAdjustType adjustType) + : mStartClick(startClick) + , mRect(rect) + , mAspectRatio(rect.width / static_cast(rect.height)) + , mAdjustType(adjustType) +{ +} + +wxRect BackgroundImage::CalculateScaleAndMove::operator()(wxCoord x, wxCoord y, wxRect rect) +{ + switch (mAdjustType) { + case BackgroundAdjustType::kUpper: + // for upper: make sure we never go lower than the bottom + // don't modify where the top is, but adjust the heigth + if (y < mRect.GetBottom()) { + rect.y = y; + rect.height = mRect.GetBottom() - y; + } + return rect; + case BackgroundAdjustType::kLower: + // for lower: make sure we never go higher than the top + // don't modify where the top is, but adjust the heigth + if (rect.y < y) { + rect.height = y - rect.y; + } + return rect; + case BackgroundAdjustType::kLeft: + if (x < mRect.GetRight()) { + rect.x = x; + rect.width = mRect.GetRight() - x; + } + return rect; + case BackgroundAdjustType::kRight: + if (rect.x < x) { + rect.width = x - rect.x; + } + return rect; + // we should keep the aspect ratio + case BackgroundAdjustType::kUpperLeft: + x = std::max(x, mRect.GetRight() - std::abs(y - mRect.GetBottom()) * mAspectRatio / 1.0); + y = std::max(y, mRect.GetBottom() - std::abs(x - mRect.GetRight()) * 1.0 / mAspectRatio); + if (x < mRect.GetRight()) { + rect.x = x; + rect.width = mRect.GetRight() - x; + } + if (y < mRect.GetBottom()) { + rect.y = y; + rect.height = mRect.GetBottom() - y; + } + return rect; + case BackgroundAdjustType::kUpperRight: + x = std::min(x, mRect.GetLeft() + std::abs(y - mRect.GetBottom()) * mAspectRatio / 1.0); + y = std::max(y, mRect.GetBottom() - std::abs(x - mRect.GetLeft()) * 1.0 / mAspectRatio); + if (rect.x < x) + rect.width = x - rect.x; + if (y < mRect.GetBottom()) { + rect.y = y; + rect.height = mRect.GetBottom() - y; + } + return rect; + case BackgroundAdjustType::kLowerLeft: + x = std::max(x, mRect.GetRight() - std::abs(y - mRect.GetTop()) * mAspectRatio / 1.0); + y = std::min(y, mRect.GetTop() + std::abs(x - mRect.GetRight()) * 1.0 / mAspectRatio); + if (x < mRect.GetRight()) { + rect.x = x; + rect.width = mRect.GetRight() - x; + } + if (rect.y < y) { + rect.height = y - rect.y; + } + return rect; + case BackgroundAdjustType::kLowerRight: + x = std::min(x, mRect.GetLeft() + std::abs(y - mRect.GetTop()) * mAspectRatio / 1.0); + y = std::min(y, mRect.GetTop() + std::abs(x - mRect.GetLeft()) * 1.0 / mAspectRatio); + if (rect.x < x) + rect.width = x - rect.x; + if (rect.y < y) { + rect.height = y - rect.y; + } + return rect; + case BackgroundAdjustType::kMove: + rect.x = mRect.GetLeft() + (x - mStartClick.x); + rect.y = mRect.GetTop() + (y - mStartClick.y); + return rect; + default: + return rect; + } +} diff --git a/src/background_image.h b/src/BackgroundImage.h similarity index 56% rename from src/background_image.h rename to src/BackgroundImage.h index d12b9853..8c265d71 100644 --- a/src/background_image.h +++ b/src/BackgroundImage.h @@ -1,8 +1,8 @@ +#pragma once /* - * background_image.h - * Header for background image + * BackgroundImage.h + * Maintains the background image data */ - /* Copyright (C) 1995-2011 Garrick Brian Meeker, Richard Michael Powell @@ -20,8 +20,6 @@ along with this program. If not, see . */ -#pragma once - #include #include #include @@ -29,24 +27,25 @@ class BackgroundImage { public: - BackgroundImage(const wxImage& image, int x, int y, int scaled_width, int scaled_height); + BackgroundImage(wxImage const& image, int x, int y, int scaled_width, int scaled_height); - bool MouseClickIsHit(const wxMouseEvent& event, const wxDC& dc) const; - void OnMouseLeftDown(const wxMouseEvent& event, const wxDC& dc); + bool MouseClickIsHit(wxMouseEvent const& event, wxDC const& dc) const; + void OnMouseLeftDown(wxMouseEvent const& event, wxDC const& dc); // returns left, top, width, height - std::array OnMouseLeftUp(const wxMouseEvent& event, const wxDC& dc); - void OnMouseMove(const wxMouseEvent& event, const wxDC& dc); + std::array OnMouseLeftUp(wxMouseEvent const& event, wxDC const& dc); + + void OnMouseMove(wxMouseEvent const& event, wxDC const& dc); void OnPaint(wxDC& dc, bool drawPicAdjustDots, bool selected) const; private: - static const long kCircleSize = 6; + static constexpr auto kCircleSize = 6; wxImage mImage; wxBitmap mBitmap; - wxCoord mBitmapX, mBitmapY; + wxPoint mBitmapPoint; // what type of background adjustments could we do - typedef enum { + enum class BackgroundAdjustType { kUpperLeft = 0, kUpper, kUpperRight, @@ -57,21 +56,18 @@ class BackgroundImage { kLower, kLowerRight, kLast, - } eBackgroundAdjustType; - eBackgroundAdjustType mBackgroundAdjustType; + }; + BackgroundAdjustType mBackgroundAdjustType; - class CalculateScaleAndMove { + struct CalculateScaleAndMove { public: - CalculateScaleAndMove(const wxPoint& startClick, wxCoord x, wxCoord y, - wxCoord width, wxCoord height, - eBackgroundAdjustType adjustType); - void operator()(wxCoord x, wxCoord y, wxCoord& topX, wxCoord& topY, - wxCoord& width, wxCoord& height); + CalculateScaleAndMove(wxPoint startClick, wxRect rect, BackgroundAdjustType adjustType); + + wxRect operator()(wxCoord x, wxCoord y, wxRect wxRect); wxPoint mStartClick; - wxCoord mLeft, mTop; - wxCoord mRight, mBottom; + wxRect mRect; float mAspectRatio; - eBackgroundAdjustType mAdjustType; + BackgroundAdjustType mAdjustType; }; - std::shared_ptr mScaleAndMove; + std::unique_ptr mScaleAndMove; }; diff --git a/src/CCOmniviewCanvas.cpp b/src/CCOmniviewCanvas.cpp index f60773d8..0c08c017 100644 --- a/src/CCOmniviewCanvas.cpp +++ b/src/CCOmniviewCanvas.cpp @@ -204,18 +204,6 @@ static void CheckGLError() } } -template -auto NormalizeAngle(Float angle) -{ - while (angle > 2 * M_PI) { - angle -= 2 * M_PI; - } - while (angle < 0.0) { - angle += 2 * M_PI; - } - return angle; -} - static auto LoadTextureWithImage(wxImage const& image, GLuint& texture) { glBindTexture(GL_TEXTURE_2D, texture); diff --git a/src/CalChartApp.cpp b/src/CalChartApp.cpp index 063d4022..7778615e 100644 --- a/src/CalChartApp.cpp +++ b/src/CalChartApp.cpp @@ -23,21 +23,14 @@ #include "CalChartApp.h" #include "CalChartDoc.h" #include "CalChartView.h" -#include "TopFrame.h" +#include "CalChartSplash.h" #include "basic_ui.h" #include "confgr.h" -#include "modes.h" #include "platconf.h" -#include "single_instance_ipc.h" +#include "HostAppInterface.h" #include #include -#include - -#include -#include - -wxPrintDialogData* gPrintDialogData; namespace CalChart { void Coord_UnitTests(); @@ -51,49 +44,54 @@ void Continuity_UnitTests(); // This statement initializes the whole application and calls OnInit IMPLEMENT_APP(CalChartApp) -wxHtmlHelpController& CalChartApp::GetGlobalHelpController() +bool CalChartApp::OnInit() { - return *mHelpController; + SetAppName("CalChart"); + wxInitAllImageHandlers(); + auto asServer = StartStopFunc_t{ [this]() { InitAppAsServer(); }, [this]() { ExitAppAsServer(); } }; + auto asClient = StartStopFunc_t{ [this]() { InitAppAsClient(); }, [this]() { ExitAppAsClient(); } }; + mHostInterface = HostAppInterface::Make(this, asServer, asClient); + return mHostInterface->OnInit(); } -#if defined(__APPLE__) && (__APPLE__) -void CalChartApp::MacOpenFile(wxString const& fileName) +int CalChartApp::OnExit() { - OpenFileOnHost(fileName); + mHostInterface.reset(); // calls ExitApp for client or server + return wxApp::OnExit(); } -void CalChartApp::MacOpenFiles(wxArrayString const& fileNames) +void CalChartApp::OpenFile(wxString const& fileName) { - for (auto index = 0; index < static_cast(fileNames.GetCount()); ++index) { - MacOpenFile(fileNames[index]); - } + mDocManager->CreateDocument(fileName, wxDOC_SILENT); } -#endif // defined(__APPLE__) && (__APPLE__) -bool CalChartApp::OnInit() +void CalChartApp::OpenFileOnHost(wxString const& filename) { - SetAppName(wxT("CalChart")); - wxInitAllImageHandlers(); - StartStopFunc_t asServer{ [=]() { this->InitAppAsServer(); }, [=]() { this->ExitAppAsServer(); } }; - StartStopFunc_t asClient{ [=]() { this->InitAppAsClient(); }, [=]() { this->ExitAppAsClient(); } }; - mHostInterface = HostAppInterface::Make(this, asServer, asClient); - return mHostInterface->OnInit(); + mHostInterface->OpenFile(filename); } -int CalChartApp::OnExit() +#if defined(__APPLE__) && (__APPLE__) +void CalChartApp::MacOpenFile(wxString const& fileName) { - mHostInterface.reset(); // calls ExitApp for client or server - return wxApp::OnExit(); + OpenFileOnHost(fileName); } -void CalChartApp::OpenFileOnHost(const wxString& filename) +void CalChartApp::MacOpenFiles(wxArrayString const& fileNames) { - mHostInterface->OpenFile(filename); + for (auto file : fileNames) { + MacOpenFile(file); + } } +#endif // defined(__APPLE__) && (__APPLE__) -void CalChartApp::OpenFile(const wxString& fileName) +wxHtmlHelpController& CalChartApp::GetGlobalHelpController() { - mDocManager->CreateDocument(fileName, wxDOC_SILENT); + return *mHelpController; +} + +wxPrintDialogData& CalChartApp::GetGlobalPrintDialog() +{ + return *mPrintDialogData; } void CalChartApp::InitAppAsServer() @@ -102,28 +100,26 @@ void CalChartApp::InitAppAsServer() mDocManager = new wxDocManager; //// Create a template relating drawing documents to their views - (void)new wxDocTemplate(mDocManager, _T("CalChart Show"), _T("*.shw"), _T(""), _T("shw"), _T("CalChart Doc"), _T("CalChart View"), CLASSINFO(CalChartDoc), CLASSINFO(CalChartView)); + (void)new wxDocTemplate(mDocManager, "CalChart Show", "*.shw", "", "shw", "CalChart Doc", "CalChart View", CLASSINFO(CalChartDoc), CLASSINFO(CalChartView)); - gPrintDialogData = new wxPrintDialogData; - mHelpController = std::unique_ptr(new wxHtmlHelpController()); + mHelpController = std::make_unique(); + mPrintDialogData = std::make_unique(); //// Create the main frame window - auto frame = new TopFrame(mDocManager, (wxFrame*)NULL, _T("CalChart")); + auto frame = new CalChartSplash(mDocManager, nullptr, "CalChart"); - { - // Required for advanced HTML help - wxFileSystem::AddHandler(new wxZipFSHandler); - wxFileSystem::AddHandler(new wxArchiveFSHandler); + // Required for advanced HTML help + wxFileSystem::AddHandler(new wxZipFSHandler); + wxFileSystem::AddHandler(new wxArchiveFSHandler); #if defined(__APPLE__) && (__APPLE__) - wxString helpfile(wxT("CalChart.app/Contents/Resources")); + auto helpfile = wxString("CalChart.app/Contents/Resources"); #else - wxString helpfile = wxFileName(::wxStandardPaths::Get().GetExecutablePath()).GetPath().Append(PATH_SEPARATOR wxT("docs")); + auto helpfile = wxFileName(::wxStandardPaths::Get().GetExecutablePath()).GetPath().Append(PATH_SEPARATOR "docs"); #endif - helpfile.Append(PATH_SEPARATOR wxT("charthlp.hhp")); - if (!GetGlobalHelpController().AddBook(wxFileName(helpfile))) { - wxLogError(wxT("Cannot find the help system.")); - } + helpfile.Append(PATH_SEPARATOR "charthlp.hhp"); + if (!GetGlobalHelpController().AddBook(wxFileName(helpfile))) { + wxLogError("Cannot find the help system."); } #ifndef __WXMAC__ @@ -132,10 +128,11 @@ void CalChartApp::InitAppAsServer() SetTopWindow(frame); // Get the file history - wxConfigBase* config = wxConfigBase::Get(); - config->SetPath(wxT("/FileHistory")); + auto config = wxConfigBase::Get(); + config->SetPath("/FileHistory"); mDocManager->FileHistoryLoad(*config); + // run the built in self tests. CalChart::Continuity_UnitTests(); CalChart::Point_UnitTests(); CalChart::Coord_UnitTests(); @@ -160,23 +157,15 @@ void CalChartApp::ExitAppAsServer() // Flush out the other commands CalChartConfiguration::GetGlobalConfig().FlushWriteQueue(); // Get the file history - wxConfigBase* config = wxConfigBase::Get(); - config->SetPath(wxT("/FileHistory")); + auto config = wxConfigBase::Get(); + config->SetPath("/FileHistory"); mDocManager->FileHistorySave(*config); config->Flush(); - if (gPrintDialogData) - delete gPrintDialogData; - // delete the doc manager delete wxDocManager::GetDocumentManager(); mHelpController.reset(); } -CalChart::ShowMode CalChartApp::GetShowMode(wxString const& which) -{ - return GetConfigShowMode(which); -} - void CalChartApp::ExitAppAsClient() { } diff --git a/src/CalChartApp.h b/src/CalChartApp.h index 6203d3d6..a4cb6217 100644 --- a/src/CalChartApp.h +++ b/src/CalChartApp.h @@ -21,7 +21,6 @@ along with this program. If not, see . */ -#include #include // CalChartApp represents the wxWidgets App for CalChart. The document manager creates @@ -31,6 +30,8 @@ class CalChartApp; class HostAppInterface; class wxHtmlHelpController; +class wxDocManager; +class wxPrintDialogData; namespace CalChart { class ShowMode; } @@ -38,22 +39,22 @@ class ShowMode; DECLARE_APP(CalChartApp) // Define a new application -class CalChartApp : public wxApp { +class CalChartApp : public wxApp +{ public: virtual bool OnInit() override; + int OnExit() override; + + void OpenFile(wxString const& fileName); + void OpenFileOnHost(wxString const& filename); #if defined(__APPLE__) && (__APPLE__) virtual void MacOpenFile(wxString const& fileName) override; virtual void MacOpenFiles(wxArrayString const& fileNames) override; #endif // defined(__APPLE__) && (__APPLE__) - int OnExit() override; - - CalChart::ShowMode GetShowMode(const wxString& which); // the global help system: wxHtmlHelpController& GetGlobalHelpController(); - - void OpenFile(const wxString& fileName); - void OpenFileOnHost(const wxString& filename); + wxPrintDialogData& GetGlobalPrintDialog(); private: void ProcessArguments(); @@ -66,4 +67,5 @@ class CalChartApp : public wxApp { wxDocManager* mDocManager{}; std::unique_ptr mHelpController; std::unique_ptr mHostInterface; + std::unique_ptr mPrintDialogData; }; diff --git a/src/CalChartDoc.cpp b/src/CalChartDoc.cpp index 3dd7a9f7..fa61ffdf 100644 --- a/src/CalChartDoc.cpp +++ b/src/CalChartDoc.cpp @@ -27,7 +27,7 @@ #include "cc_fileformat.h" #include "cc_parse_errors.h" #include "cc_point.h" -#include "cc_shapes.h" +#include "CalChartShapes.h" #include "cc_sheet.h" #include "confgr.h" #include "draw.h" @@ -52,7 +52,7 @@ IMPLEMENT_DYNAMIC_CLASS(CalChartDoc, CalChartDoc::super); // Create a new show CalChartDoc::CalChartDoc() - : mShow(Show::Create_CC_show(wxGetApp().GetShowMode(kShowModeStrings[0]))) + : mShow(Show::Create_CC_show(GetConfigShowMode(kShowModeStrings[0]))) , mTimer(*this) { mTimer.Start(static_cast(CalChartConfiguration::GetGlobalConfig().Get_AutosaveInterval()) * 1000); @@ -228,7 +228,7 @@ T& CalChartDoc::LoadObjectGeneric(T& stream) return ContinuityEditorPopup::ProcessEditContinuity(GetDocumentWindow(), description, what, line, column).ToStdString(); } }; - mShow = Show::Create_CC_show(wxGetApp().GetShowMode(kShowModeStrings[0]), stream, &handlers); + mShow = Show::Create_CC_show(GetConfigShowMode(kShowModeStrings[0]), stream, &handlers); } catch (std::exception const& e) { wxString message = wxT("Error encountered:\n"); message += e.what(); @@ -336,13 +336,37 @@ std::pair> CalChartDoc::GetRelabelMapping(Show::const_ return mShow->GetRelabelMapping(source_sheet, target_sheets, tolerance); } -void CalChartDoc::SetSelection(const SelectionList& sl) +void CalChartDoc::SetSelectionList(SelectionList const& sl) { - auto cmd = mShow->Create_SetSelectionCommand(sl); + auto cmd = mShow->Create_SetSelectionListCommand(sl); cmd.first(*mShow); UpdateAllViews(); } +void CalChartDoc::SetSelect(CalChart::Select select) +{ + mSelect = select; + UpdateAllViews(); +} + +void CalChartDoc::SetCurrentReferencePoint(int currentReferencePoint) +{ + mCurrentReferencePoint = currentReferencePoint; + UpdateAllViews(); +} + +void CalChartDoc::SetDrawPaths(bool drawPaths) +{ + mDrawPaths = drawPaths; + UpdateAllViews(); +} + +void CalChartDoc::SetDrawBackground(bool drawBackground) +{ + mDrawBackground = drawBackground; + UpdateAllViews(); +} + const ShowMode& CalChartDoc::GetShowMode() const { return mShow->GetShowMode(); } int CalChartDoc::PrintToPS(std::ostream& buffer, bool overview, @@ -394,7 +418,7 @@ std::vector CalChartDoc::Create_SetShee std::vector CalChartDoc::Create_SetSheetAndSelectionPair() const { auto SetSheet_cmds = Create_SetSheetPair(); - SetSheet_cmds.emplace_back(Inject_CalChartDocArg(mShow->Create_SetSelectionCommand(mShow->GetSelectionList()))); + SetSheet_cmds.emplace_back(Inject_CalChartDocArg(mShow->Create_SetSelectionListCommand(mShow->GetSelectionList()))); return SetSheet_cmds; } @@ -406,9 +430,9 @@ std::unique_ptr CalChartDoc::Create_SetCurrentSheetCommand(int n) return std::make_unique(*this, wxT("Set Current Sheet"), show_cmds); } -std::unique_ptr CalChartDoc::Create_SetSelectionCommand(const SelectionList& sl) +std::unique_ptr CalChartDoc::Create_SetSelectionListCommand(const SelectionList& sl) { - auto show_cmds = Inject_CalChartDocArg(mShow->Create_SetSelectionCommand(sl)); + auto show_cmds = Inject_CalChartDocArg(mShow->Create_SetSelectionListCommand(sl)); return std::make_unique(*this, wxT("Set Selection"), show_cmds); } @@ -499,17 +523,17 @@ std::unique_ptr CalChartDoc::Create_SetPrintableContinuity(std::map(*this, wxT("Set Continuity"), cmds); } -std::unique_ptr CalChartDoc::Create_MovePointsCommand(std::map const& new_positions, int ref) +std::unique_ptr CalChartDoc::Create_MovePointsCommand(std::map const& new_positions) { auto cmds = Create_SetSheetAndSelectionPair(); - cmds.emplace_back(Inject_CalChartDocArg(mShow->Create_MovePointsCommand(new_positions, ref))); + cmds.emplace_back(Inject_CalChartDocArg(mShow->Create_MovePointsCommand(new_positions, mCurrentReferencePoint))); return std::make_unique(*this, wxT("Move Points"), cmds); } -std::unique_ptr CalChartDoc::Create_MovePointsCommand(unsigned whichSheet, std::map const& new_positions, int ref) +std::unique_ptr CalChartDoc::Create_MovePointsCommand(unsigned whichSheet, std::map const& new_positions) { auto cmds = Create_SetSheetAndSelectionPair(); - cmds.emplace_back(Inject_CalChartDocArg(mShow->Create_MovePointsCommand(whichSheet, new_positions, ref))); + cmds.emplace_back(Inject_CalChartDocArg(mShow->Create_MovePointsCommand(whichSheet, new_positions, mCurrentReferencePoint))); return std::make_unique(*this, wxT("Move Points"), cmds); } @@ -520,17 +544,17 @@ std::unique_ptr CalChartDoc::Create_DeletePointsCommand() return std::make_unique(*this, wxT("Delete Points"), cmds); } -std::unique_ptr CalChartDoc::Create_RotatePointPositionsCommand(int rotateAmount, int ref) +std::unique_ptr CalChartDoc::Create_RotatePointPositionsCommand(int rotateAmount) { auto cmds = Create_SetSheetAndSelectionPair(); - cmds.emplace_back(Inject_CalChartDocArg(mShow->Create_RotatePointPositionsCommand(rotateAmount, ref))); + cmds.emplace_back(Inject_CalChartDocArg(mShow->Create_RotatePointPositionsCommand(rotateAmount, mCurrentReferencePoint))); return std::make_unique(*this, wxT("Rotate Points"), cmds); } -std::unique_ptr CalChartDoc::Create_ResetReferencePointToRef0(int ref) +std::unique_ptr CalChartDoc::Create_ResetReferencePointToRef0() { auto cmds = Create_SetSheetAndSelectionPair(); - cmds.emplace_back(Inject_CalChartDocArg(mShow->Create_ResetReferencePointToRef0(ref))); + cmds.emplace_back(Inject_CalChartDocArg(mShow->Create_ResetReferencePointToRef0(mCurrentReferencePoint))); return std::make_unique(*this, wxT("Reset Reference Point"), cmds); } diff --git a/src/CalChartDoc.h b/src/CalChartDoc.h index 10e2f986..a0d79269 100644 --- a/src/CalChartDoc.h +++ b/src/CalChartDoc.h @@ -124,6 +124,13 @@ class CalChartDoc : public wxDocument { auto GetNumSheets() const { return mShow ? mShow->GetNumSheets() : 0; } + struct CalChartDocSheetRange { + CalChart::Show const& mShow; + auto begin() { return mShow.GetSheetBegin(); } + auto end() { return mShow.GetSheetEnd(); } + }; + CalChartDocSheetRange GetSheets() const { return CalChartDocSheetRange{*mShow}; } + auto GetSheetBegin() const { return static_cast(*mShow).GetSheetBegin(); } auto GetSheetEnd() const { return static_cast(*mShow).GetSheetEnd(); } auto GetNthSheet(int n) const { return static_cast(*mShow).GetNthSheet(n); } @@ -144,33 +151,42 @@ class CalChartDoc : public wxDocument { // how to select points // Utility functions for constructing new selection lists - // Then you push the selection list with the Create_SetSelectionCommand + // Then you push the selection list with the Create_SetSelectionListCommand auto MakeSelectAll() const { return mShow->MakeSelectAll(); } auto MakeUnselectAll() const { return mShow->MakeUnselectAll(); } auto MakeAddToSelection(const SelectionList& sl) const { return mShow->MakeAddToSelection(sl); } auto MakeRemoveFromSelection(const SelectionList& sl) const { return mShow->MakeRemoveFromSelection(sl); } auto MakeToggleSelection(const SelectionList& sl) const { return mShow->MakeToggleSelection(sl); } - auto MakeSelectWithLasso(const CalChart::Lasso& lasso, int ref) const { return mShow->MakeSelectWithLasso(lasso, ref); } + auto MakeSelectWithinPolygon(CalChart::RawPolygon_t const& polygon) const { return mShow->MakeSelectWithinPolygon(polygon, mCurrentReferencePoint); } auto MakeSelectBySymbol(SYMBOL_TYPE symbol) const { return mShow->MakeSelectBySymbol(symbol); } auto MakeSelectByInstrument(std::string const& instrument) const { return mShow->MakeSelectByInstrument(instrument); } auto MakeSelectByLabel(std::string const& label) const { return mShow->MakeSelectByLabel(label); } - void SetSelection(const SelectionList& sl); + void SetSelectionList(SelectionList const& sl); auto IsSelected(int i) const { return mShow->IsSelected(i); } auto GetSelectionList() const { return mShow->GetSelectionList(); } + auto GetSelect() const { return mSelect; } + void SetSelect(CalChart::Select select); + auto GetCurrentReferencePoint() const { return mCurrentReferencePoint; } + void SetCurrentReferencePoint(int currentReferencePoint); + auto GetDrawPaths() const { return mDrawPaths; } + void SetDrawPaths(bool drawPaths); + auto GetDrawBackground() const { return mDrawBackground; } + void SetDrawBackground(bool drawBackground); + CalChart::ShowMode const& GetShowMode() const; // nullptr if there is no animation CalChart::Animation const* GetAnimation() const; auto AlreadyHasPrintContinuity() const { return mShow->AlreadyHasPrintContinuity(); } - auto WillMovePoints(std::map const& new_positions, int ref) const { return mShow->WillMovePoints(new_positions, ref); } + auto WillMovePoints(std::map const& new_positions) const { return mShow->WillMovePoints(new_positions, mCurrentReferencePoint); } int PrintToPS(std::ostream& buffer, bool overview, int min_yards, const std::set& isPicked, const CalChartConfiguration& config_) const; // create a set of commands to apply to the document. This is the best way to interact with the doc. std::unique_ptr Create_SetCurrentSheetCommand(int n); - std::unique_ptr Create_SetSelectionCommand(const SelectionList& sl); + std::unique_ptr Create_SetSelectionListCommand(const SelectionList& sl); std::unique_ptr Create_SetCurrentSheetAndSelectionCommand(int n, const SelectionList& sl); std::unique_ptr Create_SetShowModeCommand(CalChart::ShowMode const& newmode); std::unique_ptr Create_SetupMarchersCommand(std::vector> const& labels, int numColumns); @@ -182,11 +198,11 @@ class CalChartDoc : public wxDocument { std::unique_ptr Create_ApplyRelabelMapping(int sheet, std::vector const& mapping); std::unique_ptr Create_AppendShow(std::unique_ptr sheets, CalChart::Coord::units tolerance); std::unique_ptr Create_SetPrintableContinuity(std::map> const& data); - std::unique_ptr Create_MovePointsCommand(std::map const& new_positions, int ref); - std::unique_ptr Create_MovePointsCommand(unsigned whichSheet, std::map const& new_positions, int ref); + std::unique_ptr Create_MovePointsCommand(std::map const& new_positions); + std::unique_ptr Create_MovePointsCommand(unsigned whichSheet, std::map const& new_positions); std::unique_ptr Create_DeletePointsCommand(); - std::unique_ptr Create_RotatePointPositionsCommand(int rotateAmount, int ref); - std::unique_ptr Create_ResetReferencePointToRef0(int ref); + std::unique_ptr Create_RotatePointPositionsCommand(int rotateAmount); + std::unique_ptr Create_ResetReferencePointToRef0(); std::unique_ptr Create_SetSymbolCommand(SYMBOL_TYPE sym); std::unique_ptr Create_SetContinuityCommand(SYMBOL_TYPE i, CalChart::Continuity const& new_cont); std::unique_ptr Create_SetLabelRightCommand(bool right); @@ -232,7 +248,14 @@ class CalChartDoc : public wxDocument { CalChartDoc& mShow; }; + // CalChart doc contains the state of the show and all ancillary data objects for displaying/manipulating the show + // This include temporary non-saved aspects like what configuration tools are in (select mode), or what reference + // points are currently being moved. std::unique_ptr mShow; std::unique_ptr mAnimation; + CalChart::Select mSelect = CalChart::Select::Box; + int mCurrentReferencePoint{}; + bool mDrawPaths{}; + bool mDrawBackground{}; AutoSaveTimer mTimer; }; diff --git a/src/CalChartFrame.cpp b/src/CalChartFrame.cpp index 57f76e9a..d7844bcd 100644 --- a/src/CalChartFrame.cpp +++ b/src/CalChartFrame.cpp @@ -25,6 +25,7 @@ #include "CalChartFrame.h" +#include "CalChartAnimationErrors.h" #include "AnimationErrorsPanel.h" #include "AnimationPanel.h" #include "CalChartApp.h" @@ -40,10 +41,10 @@ #include "PrintContinuityEditor.h" #include "SetupInstruments.h" #include "SetupMarchers.h" -#include "TopFrame.h" +#include "CalChartSplash.h" #include "TransitionSolverFrame.h" #include "TransitionSolverView.h" -#include "cc_coord.h" +#include "CalChartCoord.h" #include "cc_fileformat.h" #include "cc_point.h" #include "cc_sheet.h" @@ -54,7 +55,7 @@ #include "mode_dialog.h" #include "modes.h" #include "platconf.h" -#include "print_ps_dialog.h" +#include "PrintPostScriptDialog.h" #include "ui_enums.h" #include @@ -71,8 +72,6 @@ const wxString kSheetDataClipboardFormat = wxT("CC_sheet_clipboard_v1"); static const wxChar* file_wild = FILE_WILDCARDS; -extern wxPrintDialogData* gPrintDialogData; - static std::map kAUIEnumToString = { { CALCHART__ViewFieldThumbnail, "Field Thumbnails" }, { CALCHART__ViewFieldControls, "Controls ToolBar" }, @@ -80,10 +79,16 @@ static std::map kAUIEnumToString = { { CALCHART__ViewAnimationErrors, "Marching Errors" }, { CALCHART__ViewAnimation, "Animation" }, { CALCHART__ViewPrintContinuity, "Print Continuity" }, - { CALCHART__ViewLassosToolBar, "Lassos ToolBar" }, + { CALCHART__ViewSelectAndMoveToolBar, "Select and Move ToolBar" }, { CALCHART__ViewMarcherToolBar, "Marcher ToolBar" }, }; +template +constexpr auto toUType(E enumerator) +{ + return static_cast>(enumerator); +} + BEGIN_EVENT_TABLE(CalChartFrame, wxDocChildFrame) EVT_CHAR(CalChartFrame::OnChar) EVT_MENU(CALCHART__APPEND_FILE, CalChartFrame::OnCmdAppend) @@ -122,7 +127,7 @@ EVT_MENU(CALCHART__ViewContinuityInfo, CalChartFrame::OnCmd_AdjustViews) EVT_MENU(CALCHART__ViewAnimationErrors, CalChartFrame::OnCmd_AdjustViews) EVT_MENU(CALCHART__ViewAnimation, CalChartFrame::OnCmd_AdjustViews) EVT_MENU(CALCHART__ViewPrintContinuity, CalChartFrame::OnCmd_AdjustViews) -EVT_MENU(CALCHART__ViewLassosToolBar, CalChartFrame::OnCmd_AdjustViews) +EVT_MENU(CALCHART__ViewSelectAndMoveToolBar, CalChartFrame::OnCmd_AdjustViews) EVT_MENU(CALCHART__ViewMarcherToolBar, CalChartFrame::OnCmd_AdjustViews) EVT_MENU(CALCHART__ViewSwapFieldAndAnimate, CalChartFrame::OnCmd_SwapAnimation) EVT_MENU(CALCHART__ViewZoomFit, CalChartFrame::OnCmd_ZoomFit) @@ -204,7 +209,7 @@ class MyPrintout : public wxPrintout { wxDC* dc = wxPrintout::GetDC(); auto sheet = mShow.GetNthSheet(pageNum - 1); - int size = gPrintDialogData->GetPrintData().GetOrientation(); + int size = wxGetApp().GetGlobalPrintDialog().GetPrintData().GetOrientation(); DrawForPrinting(dc, mConfig, mShow, *sheet, 0, 2 == size); @@ -321,8 +326,8 @@ CalChartFrame::CalChartFrame(wxDocument* doc, wxView* view, refreshGhostOptionStates(); // Add a toolbar - mLassosToolBar = CreateLassosAndMoves(this, wxID_ANY, wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_OVERFLOW); - mLassosToolBar->SetFont(ResizeFont(mLassosToolBar->GetFont(), GetToolBarFontSize())); + mSelectAndMoveToolBar = CreateSelectAndMoves(this, wxID_ANY, wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_OVERFLOW); + mSelectAndMoveToolBar->SetFont(ResizeFont(mSelectAndMoveToolBar->GetFont(), GetToolBarFontSize())); mMarcherToolBar = CreateDotModifiers(this, wxID_ANY, wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_OVERFLOW); mMarcherToolBar->SetFont(ResizeFont(mMarcherToolBar->GetFont(), GetToolBarFontSize())); @@ -360,7 +365,7 @@ CalChartFrame::CalChartFrame(wxDocument* doc, wxView* view, mLookupEnumToSubWindow[CALCHART__ViewAnimationErrors] = mAnimationErrorsPanel; mLookupEnumToSubWindow[CALCHART__ViewAnimation] = mAnimationPanel; mLookupEnumToSubWindow[CALCHART__ViewPrintContinuity] = mPrintContinuityEditor; - mLookupEnumToSubWindow[CALCHART__ViewLassosToolBar] = mLassosToolBar; + mLookupEnumToSubWindow[CALCHART__ViewSelectAndMoveToolBar] = mSelectAndMoveToolBar; mLookupEnumToSubWindow[CALCHART__ViewMarcherToolBar] = mMarcherToolBar; for (auto&& i : mLookupEnumToSubWindow) { @@ -383,7 +388,7 @@ CalChartFrame::CalChartFrame(wxDocument* doc, wxView* view, mAUIManager->AddPane(mAnimationErrorsPanel, wxAuiPaneInfo().Name(kAUIEnumToString[CALCHART__ViewAnimationErrors]).Caption(kAUIEnumToString[CALCHART__ViewAnimationErrors]).Right().BestSize(GetAnimationErrorsSize())); mAUIManager->AddPane(mPrintContinuityEditor, wxAuiPaneInfo().Name(kAUIEnumToString[CALCHART__ViewPrintContinuity]).Caption(kAUIEnumToString[CALCHART__ViewPrintContinuity]).Right().BestSize(GetPrintContinuitySize())); mAUIManager->AddPane(mControls, wxAuiPaneInfo().Name(kAUIEnumToString[CALCHART__ViewFieldControls]).Caption(kAUIEnumToString[CALCHART__ViewFieldControls]).ToolbarPane().Top()); - mAUIManager->AddPane(mLassosToolBar, wxAuiPaneInfo().Name(kAUIEnumToString[CALCHART__ViewLassosToolBar]).Caption(kAUIEnumToString[CALCHART__ViewLassosToolBar]).ToolbarPane().Left()); + mAUIManager->AddPane(mSelectAndMoveToolBar, wxAuiPaneInfo().Name(kAUIEnumToString[CALCHART__ViewSelectAndMoveToolBar]).Caption(kAUIEnumToString[CALCHART__ViewSelectAndMoveToolBar]).ToolbarPane().Left()); mAUIManager->AddPane(mMarcherToolBar, wxAuiPaneInfo().Name(kAUIEnumToString[CALCHART__ViewMarcherToolBar]).Caption(kAUIEnumToString[CALCHART__ViewMarcherToolBar]).ToolbarPane().Top()); mAUIManager->Update(); @@ -409,7 +414,7 @@ CalChartFrame::CalChartFrame(wxDocument* doc, wxView* view, doc->GetCommandProcessor()->Initialize(); // Update the tool bar - SetCurrentLasso(mCanvas->GetCurrentLasso()); + SetCurrentSelect(mCanvas->GetCurrentSelect()); SetCurrentMove(mCanvas->GetCurrentMove()); // Show the frame @@ -452,7 +457,7 @@ void CalChartFrame::OnCmdImportCont(wxCommandEvent& event) { ImportContFile(); } void CalChartFrame::OnCmdPrint(wxCommandEvent& event) { // grab our current page setup. - wxPrinter printer(gPrintDialogData); + wxPrinter printer(&(wxGetApp().GetGlobalPrintDialog())); MyPrintout printout(wxT("My Printout"), *GetShow(), mConfig); wxPrintDialogData& printDialog = printer.GetPrintDialogData(); @@ -467,7 +472,7 @@ void CalChartFrame::OnCmdPrint(wxCommandEvent& event) wxT("Printing"), wxOK); } } else { - *gPrintDialogData = printer.GetPrintDialogData(); + wxGetApp().GetGlobalPrintDialog() = printer.GetPrintDialogData(); } } @@ -477,7 +482,7 @@ void CalChartFrame::OnCmdPrintPreview(wxCommandEvent& event) // grab our current page setup. wxPrintPreview* preview = new wxPrintPreview( new MyPrintout(wxT("My Printout"), *GetShow(), mConfig), - new MyPrintout(wxT("My Printout"), *GetShow(), mConfig), gPrintDialogData); + new MyPrintout(wxT("My Printout"), *GetShow(), mConfig), &wxGetApp().GetGlobalPrintDialog()); if (!preview->Ok()) { delete preview; wxMessageBox(wxT("There was a problem previewing.\nPerhaps your current " @@ -500,7 +505,7 @@ void CalChartFrame::OnCmdPageSetup(wxCommandEvent& event) if (pageSetupDialog.ShowModal() == wxID_OK) mPageSetupData = pageSetupDialog.GetPageSetupData(); // pass the print data to our global print dialog - gPrintDialogData->SetPrintData(mPageSetupData.GetPrintData()); + wxGetApp().GetGlobalPrintDialog().SetPrintData(mPageSetupData.GetPrintData()); } void CalChartFrame::OnCmdLegacyPrint(wxCommandEvent& event) @@ -738,7 +743,7 @@ void CalChartFrame::OnCmdPointPicker(wxCommandEvent& event) if (GetShow()) { PointPicker dialog(*GetShow(), this); if (dialog.ShowModal() == wxID_OK) { - GetShow()->SetSelection(dialog.GetSelection()); + GetShow()->SetSelectionList(dialog.GetSelection()); } } } @@ -746,7 +751,7 @@ void CalChartFrame::OnCmdPointPicker(wxCommandEvent& event) void CalChartFrame::OnCmdSelectAll(wxCommandEvent& event) { if (GetShow()) { - GetShow()->SetSelection(GetShow()->MakeSelectAll()); + GetShow()->SetSelectionList(GetShow()->MakeSelectAll()); } } @@ -761,9 +766,9 @@ void CalChartFrame::ShowFieldAndHideAnimation(bool showField) mAUIManager->Update(); } -void CalChartFrame::OnCmdAbout(wxCommandEvent& event) { TopFrame::About(); } +void CalChartFrame::OnCmdAbout(wxCommandEvent& event) { CalChartSplash::About(); } -void CalChartFrame::OnCmdHelp(wxCommandEvent& event) { TopFrame::Help(); } +void CalChartFrame::OnCmdHelp(wxCommandEvent& event) { CalChartSplash::Help(); } void CalChartFrame::OnCmd_prev_ss(wxCommandEvent& event) { @@ -777,87 +782,87 @@ void CalChartFrame::OnCmd_next_ss(wxCommandEvent& event) void CalChartFrame::OnCmd_box(wxCommandEvent& event) { - SetCurrentLasso(CC_DRAG::BOX); + SetCurrentSelect(CalChart::Select::Box); } void CalChartFrame::OnCmd_poly(wxCommandEvent& event) { - SetCurrentLasso(CC_DRAG::POLY); + SetCurrentSelect(CalChart::Select::Poly); } void CalChartFrame::OnCmd_lasso(wxCommandEvent& event) { - SetCurrentLasso(CC_DRAG::LASSO); + SetCurrentSelect(CalChart::Select::Lasso); } void CalChartFrame::OnCmd_swap(wxCommandEvent& event) { - SetCurrentLasso(CC_DRAG::SWAP); + SetCurrentSelect(CalChart::Select::Swap); } void CalChartFrame::OnCmd_move(wxCommandEvent& event) { - SetCurrentMove(CC_MOVE_NORMAL); + SetCurrentMove(CalChart::MoveMode::Normal); } void CalChartFrame::OnCmd_shape_line(wxCommandEvent& event) { - SetCurrentMove(CC_MOVE_SHAPE_LINE); + SetCurrentMove(CalChart::MoveMode::ShapeLine); } void CalChartFrame::OnCmd_shape_x(wxCommandEvent& event) { - SetCurrentMove(CC_MOVE_SHAPE_X); + SetCurrentMove(CalChart::MoveMode::ShapeX); } void CalChartFrame::OnCmd_shape_cross(wxCommandEvent& event) { - SetCurrentMove(CC_MOVE_SHAPE_CROSS); + SetCurrentMove(CalChart::MoveMode::ShapeCross); } void CalChartFrame::OnCmd_shape_box(wxCommandEvent& event) { - SetCurrentMove(CC_MOVE_SHAPE_RECTANGLE); + SetCurrentMove(CalChart::MoveMode::ShapeRectange); } void CalChartFrame::OnCmd_shape_ellipse(wxCommandEvent& event) { - SetCurrentMove(CC_MOVE_SHAPE_ELLIPSE); + SetCurrentMove(CalChart::MoveMode::ShapeEllipse); } void CalChartFrame::OnCmd_shape_draw(wxCommandEvent& event) { - SetCurrentMove(CC_MOVE_SHAPE_DRAW); + SetCurrentMove(CalChart::MoveMode::ShapeDraw); } void CalChartFrame::OnCmd_line(wxCommandEvent& event) { - SetCurrentMove(CC_MOVE_LINE); + SetCurrentMove(CalChart::MoveMode::MoveLine); } void CalChartFrame::OnCmd_rot(wxCommandEvent& event) { - SetCurrentMove(CC_MOVE_ROTATE); + SetCurrentMove(CalChart::MoveMode::MoveRotate); } void CalChartFrame::OnCmd_shear(wxCommandEvent& event) { - SetCurrentMove(CC_MOVE_SHEAR); + SetCurrentMove(CalChart::MoveMode::MoveShear); } void CalChartFrame::OnCmd_reflect(wxCommandEvent& event) { - SetCurrentMove(CC_MOVE_REFL); + SetCurrentMove(CalChart::MoveMode::MoveReflect); } void CalChartFrame::OnCmd_size(wxCommandEvent& event) { - SetCurrentMove(CC_MOVE_SIZE); + SetCurrentMove(CalChart::MoveMode::MoveSize); } void CalChartFrame::OnCmd_genius(wxCommandEvent& event) { - SetCurrentMove(CC_MOVE_GENIUS); + SetCurrentMove(CalChart::MoveMode::MoveGenius); } void CalChartFrame::OnCmd_label_left(wxCommandEvent& event) @@ -1004,15 +1009,15 @@ void CalChartFrame::OnCmd_GhostOption(wxCommandEvent& event) : 3; switch (which_option) { case 0: - GetFieldView()->getGhostModule().setGhostSource(GhostModule::disabled); + GetFieldView()->getGhostModule().setGhostSource(GhostSource::disabled); FieldControls::SetGhostChoice(mControls, 0); break; case 1: - GetFieldView()->getGhostModule().setGhostSource(GhostModule::next); + GetFieldView()->getGhostModule().setGhostSource(GhostSource::next); FieldControls::SetGhostChoice(mControls, 1); break; case 2: - GetFieldView()->getGhostModule().setGhostSource(GhostModule::previous); + GetFieldView()->getGhostModule().setGhostSource(GhostSource::previous); FieldControls::SetGhostChoice(mControls, 2); break; case 3: { @@ -1020,7 +1025,7 @@ void CalChartFrame::OnCmd_GhostOption(wxCommandEvent& event) "Ghost Sheet", "1", this); long targetSheetNum = 0; if (targetSheet.ToLong(&targetSheetNum)) { - GetFieldView()->getGhostModule().setGhostSource(GhostModule::specific, + GetFieldView()->getGhostModule().setGhostSource(GhostSource::specific, static_cast(targetSheetNum) - 1); FieldControls::SetGhostChoice(mControls, 3); } else { @@ -1038,7 +1043,7 @@ void CalChartFrame::OnCmd_InstrumentSelection(wxCommandEvent& event) auto choice = static_cast(FindWindow(CALCHART__InstrumentChoice)); auto selection = choice->GetString(choice->GetSelection()); if (selection != "" && GetShow()) { - GetShow()->SetSelection(GetShow()->MakeSelectByInstrument(selection)); + GetShow()->SetSelectionList(GetShow()->MakeSelectByInstrument(selection)); } } @@ -1047,7 +1052,7 @@ void CalChartFrame::OnCmd_SymbolSelection(wxCommandEvent& event) auto choice = static_cast(FindWindow(CALCHART__SymbolChoice)); auto selection = choice->GetString(choice->GetSelection()); if (selection != "" && GetShow()) { - GetShow()->SetSelection(GetShow()->MakeSelectByInstrument(selection)); + GetShow()->SetSelectionList(GetShow()->MakeSelectByInstrument(selection)); } } @@ -1056,7 +1061,7 @@ void CalChartFrame::OnCmd_MarcherSelection(wxCommandEvent& event) auto choice = static_cast(FindWindow(CALCHART__MarcherChoice)); auto selection = choice->GetString(choice->GetSelection()); if (selection != "" && GetShow()) { - GetShow()->SetSelection(GetShow()->MakeSelectByLabel(selection)); + GetShow()->SetSelectionList(GetShow()->MakeSelectByLabel(selection)); } } @@ -1178,28 +1183,29 @@ std::pair CalChartFrame::ToolGri return FieldControls::ToolGridChoice(mControls); } -void CalChartFrame::SetCurrentLasso(CC_DRAG type) +void CalChartFrame::SetCurrentSelect(CalChart::Select select) { // retoggle the tool because we want it to draw as selected - int toggleID = (type == CC_DRAG::POLY) ? CALCHART__poly : (type == CC_DRAG::LASSO) ? CALCHART__lasso - : (type == CC_DRAG::SWAP) ? CALCHART__swap - : CALCHART__box; - mLassosToolBar->ToggleTool(toggleID, true); + int toggleID = (select == CalChart::Select::Poly) ? CALCHART__poly + : (select == CalChart::Select::Lasso) ? CALCHART__lasso + : (select == CalChart::Select::Swap) ? CALCHART__swap + : CALCHART__box; + mSelectAndMoveToolBar->ToggleTool(toggleID, true); - mCanvas->SetCurrentLasso(type); + mCanvas->SetCurrentSelect(select); } -void CalChartFrame::SetCurrentMove(CC_MOVE_MODES type) +void CalChartFrame::SetCurrentMove(CalChart::MoveMode type) { ToolBarSetCurrentMove(type); mCanvas->SetCurrentMove(type); } // call by the canvas to inform that the move has been set. Don't call back to canvas -void CalChartFrame::ToolBarSetCurrentMove(CC_MOVE_MODES type) +void CalChartFrame::ToolBarSetCurrentMove(CalChart::MoveMode type) { // retoggle the tool because we want it to draw as selected - mLassosToolBar->ToggleTool(CALCHART__move + type, true); + mSelectAndMoveToolBar->ToggleTool(CALCHART__move + toUType(type), true); } void CalChartFrame::SetMode() diff --git a/src/CalChartFrame.h b/src/CalChartFrame.h index ac442b26..833faed8 100644 --- a/src/CalChartFrame.h +++ b/src/CalChartFrame.h @@ -20,8 +20,10 @@ along with this program. If not, see . */ -#include "cc_coord.h" -#include "cc_types.h" +#include "CalChartCoord.h" +#include "CalChartTypes.h" +#include "CalChartMovePointsTool.h" +#include "CalChartSelectTool.h" #include #include @@ -149,9 +151,9 @@ class CalChartFrame : public wxDocChildFrame { std::pair ToolGridChoice() const; void OnUpdate(); - void SetCurrentLasso(CC_DRAG type); - void SetCurrentMove(CC_MOVE_MODES type); - void ToolBarSetCurrentMove(CC_MOVE_MODES type); + void SetCurrentSelect(CalChart::Select type); + void SetCurrentMove(CalChart::MoveMode type); + void ToolBarSetCurrentMove(CalChart::MoveMode type); float ToolBarSetZoom(float zoom); // set to an amount, returns what it was set to. void zoom_callback(wxCommandEvent&); void zoom_callback_textenter(wxCommandEvent&); @@ -197,7 +199,7 @@ class CalChartFrame : public wxDocChildFrame { AnimationPanel* mShadowAnimationPanel{}; PrintContinuityEditor* mPrintContinuityEditor{}; wxAuiToolBar* mControls; - wxAuiToolBar* mLassosToolBar; + wxAuiToolBar* mSelectAndMoveToolBar; wxAuiToolBar* mMarcherToolBar; std::map mLookupEnumToSubWindow; diff --git a/src/CalChartSizes.h b/src/CalChartSizes.h index 5b3cf6a7..8b64a15f 100644 --- a/src/CalChartSizes.h +++ b/src/CalChartSizes.h @@ -23,7 +23,7 @@ #include -#include "cc_coord.h" +#include "CalChartCoord.h" template static auto fDIP(T const& t) { return wxWindow::FromDIP(t, nullptr); } diff --git a/src/TopFrame.cpp b/src/CalChartSplash.cpp similarity index 55% rename from src/TopFrame.cpp rename to src/CalChartSplash.cpp index d1e7859e..59c26f16 100644 --- a/src/TopFrame.cpp +++ b/src/CalChartSplash.cpp @@ -1,6 +1,5 @@ /* - * main_ui.cpp - * Handle wxWindows interface + * CalChartSplash.cpp */ /* @@ -20,54 +19,48 @@ along with this program. If not, see . */ -#include "TopFrame.h" +#include "CalChartSplash.h" #include "CalChartApp.h" #include "CalChartPreferences.h" -#include "CalChartSizes.h" #include "basic_ui.h" -#include "calchart.xbm" #include "ccvers.h" #include #include -#include -#include -IMPLEMENT_CLASS(TopFrame, wxDocParentFrame) +IMPLEMENT_CLASS(CalChartSplash, wxDocParentFrame) -BEGIN_EVENT_TABLE(TopFrame, wxDocParentFrame) -EVT_MENU(wxID_ABOUT, TopFrame::OnCmdAbout) -EVT_MENU(wxID_HELP, TopFrame::OnCmdHelp) -EVT_MENU(wxID_PREFERENCES, TopFrame::OnCmdPreferences) +BEGIN_EVENT_TABLE(CalChartSplash, wxDocParentFrame) +EVT_MENU(wxID_ABOUT, CalChartSplash::OnCmdAbout) +EVT_MENU(wxID_HELP, CalChartSplash::OnCmdHelp) +EVT_MENU(wxID_PREFERENCES, CalChartSplash::OnCmdPreferences) END_EVENT_TABLE() -class TopFrameDropTarget : public wxFileDropTarget { +struct CalChartSplashDropTarget : public wxFileDropTarget { public: - TopFrameDropTarget(wxDocManager* manager) + CalChartSplashDropTarget(wxDocManager* manager) : mManager(manager) { } - virtual bool OnDropFiles(wxCoord x, wxCoord y, wxArrayString const& filenames); + virtual bool OnDropFiles(wxCoord x, wxCoord y, wxArrayString const& filenames) override + { + for (auto&& filename : filenames) { + mManager->CreateDocument(filename, wxDOC_SILENT); + } + return true; + } private: wxDocManager* mManager; }; -bool TopFrameDropTarget::OnDropFiles(wxCoord x, wxCoord y, wxArrayString const& filenames) -{ - for (auto&& filename : filenames) { - mManager->CreateDocument(filename, wxDOC_SILENT); - } - return true; -} - -TopFrame::TopFrame(wxDocManager* manager, wxFrame* frame, const wxString& title) - : wxDocParentFrame(manager, frame, wxID_ANY, title) +CalChartSplash::CalChartSplash(wxDocManager* manager, wxFrame* frame, wxString const& title) + : super(manager, frame, wxID_ANY, title) { // Give it an icon SetBandIcon(this); - wxMenu* file_menu = new wxMenu; + auto file_menu = new wxMenu; file_menu->Append(wxID_NEW, wxT("&New Show\tCTRL-N"), wxT("Create a new show")); file_menu->Append(wxID_OPEN, wxT("&Open...\tCTRL-O"), wxT("Load a saved show")); file_menu->Append(wxID_PREFERENCES, wxT("&Preferences\tCTRL-,")); @@ -76,17 +69,17 @@ TopFrame::TopFrame(wxDocManager* manager, wxFrame* frame, const wxString& title) // A nice touch: a history of files visited. Use this menu. manager->FileHistoryUseMenu(file_menu); - wxMenu* help_menu = new wxMenu; + auto help_menu = new wxMenu; help_menu->Append(wxID_ABOUT, wxT("&About CalChart..."), wxT("Information about the program")); // this comes up as a leak on Mac? help_menu->Append(wxID_HELP, wxT("&Help on CalChart...\tCTRL-H"), wxT("Help on using CalChart")); - wxMenuBar* menu_bar = new wxMenuBar; + auto menu_bar = new wxMenuBar; menu_bar->Append(file_menu, wxT("&File")); menu_bar->Append(help_menu, wxT("&Help")); SetMenuBar(menu_bar); - SetDropTarget(new TopFrameDropTarget(manager)); + SetDropTarget(new CalChartSplashDropTarget(manager)); // create a sizer and populate SetSizer(VStack([this](auto sizer) { @@ -112,64 +105,41 @@ TopFrame::TopFrame(wxDocManager* manager, wxFrame* frame, const wxString& title) Show(true); } -TopFrame::~TopFrame() { } - -void TopFrame::OnCmdAbout(wxCommandEvent& event) { TopFrame::About(); } +void CalChartSplash::OnCmdAbout(wxCommandEvent& event) { CalChartSplash::About(); } -void TopFrame::OnCmdHelp(wxCommandEvent& event) { TopFrame::Help(); } +void CalChartSplash::OnCmdHelp(wxCommandEvent& event) { CalChartSplash::Help(); } -void TopFrame::About() +void CalChartSplash::About() { // clang-format off (void)wxMessageBox( - wxT("CalChart v") - wxT(STRINGIZE(CC_MAJOR_VERSION)) wxT(".") wxT(STRINGIZE(CC_MINOR_VERSION)) wxT(".") wxT(STRINGIZE(CC_SUB_MINOR_VERSION)) - wxT("\nAuthors: Gurk Meeker, Richard Michael Powell\n") - wxT("\nContributors: Brandon Chinn, Kevin Durand, Noah Gilmore, David Strachan-Olson, Allan Yu\n") - wxT("http://calchart.sourceforge.net\n") - wxT("Copyright (c) 1994-2019\n") - wxT("\n") - wxT("This program is free software: " - "you can redistribute it and/or " - "modify\n") - wxT("it under the terms of the GNU General Public License as " - "published by\n") - wxT("the Free Software Foundation, " - "either " - "version 3 of the License, or\n") - wxT("(at your option) any later version.\n") - wxT("\n") - wxT("This program is distributed in the hope " - "that it will be " - "useful,\n") - wxT("but WITHOUT ANY WARRANTY; without even " - "the implied warranty of\n") - wxT("MERCHANTABILITY or FITNESS FOR A PARTICULAR " - "PURPOSE. See the\n") - wxT("GNU General Public License for more " - "details.\n") - wxT("\n") - wxT("You should have received a copy of " - "the GNU General Public License\n") - wxT("along with this program. If not, " - "see " - ".\n") - wxT("\n") - wxT("Report issues to:\nhttps://github.com/calband/calchart/issues/new\n") - wxT("\n") - wxT("Compiled on ") - __TDATE__ wxT(" at ") __TTIME__, - wxT("About CalChart")); + "CalChart v" STRINGIZE(CC_MAJOR_VERSION) "." STRINGIZE(CC_MINOR_VERSION) "." STRINGIZE(CC_SUB_MINOR_VERSION) "\n" + "Authors: Gurk Meeker, Richard Michael Powell\n" + "\n" + "Contributors: Brandon Chinn, Kevin Durand, Noah Gilmore, David Strachan-Olson, Allan Yu\n" + "http://calchart.sourceforge.net\n" + "Copyright (c) 1994-2019\n" + "\n" + "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n" + "\n" + "This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n" + "\n" + "You should have received a copy of the GNU General Public License along with this program. If not, see .\n" + "\n" + "Report issues to:\nhttps://github.com/calband/calchart/issues/new\n" + "\n" + "Compiled on " __TDATE__ " at " __TTIME__, + "About CalChart"); // clang-format on } -void TopFrame::Help() +void CalChartSplash::Help() { wxGetApp().GetGlobalHelpController().LoadFile(); wxGetApp().GetGlobalHelpController().DisplayContents(); } -void TopFrame::OnCmdPreferences(wxCommandEvent& event) +void CalChartSplash::OnCmdPreferences(wxCommandEvent& event) { CalChartPreferences dialog1(this); if (dialog1.ShowModal() == wxID_OK) { diff --git a/src/TopFrame.h b/src/CalChartSplash.h similarity index 76% rename from src/TopFrame.h rename to src/CalChartSplash.h index 88dbb4ba..986a029a 100644 --- a/src/TopFrame.h +++ b/src/CalChartSplash.h @@ -1,7 +1,7 @@ #pragma once /* - * top_frame.h - * Header for TopFrame, the wxMDI parent frame + * CalChartSplash.h + * Header for CalChartSplash, the wxMDI parent frame */ /* @@ -23,13 +23,15 @@ #include -// TopFrame +// CalChartSplash // Serves as the top frame that gets displayed when CalChart starts -class TopFrame : public wxDocParentFrame { - DECLARE_CLASS(TopFrame) +class CalChartSplash : public wxDocParentFrame { + using super = wxDocParentFrame; + DECLARE_CLASS(CalChartSplash) + DECLARE_EVENT_TABLE() public: - TopFrame(wxDocManager* manager, wxFrame* frame, const wxString& title); - ~TopFrame(); + CalChartSplash(wxDocManager* manager, wxFrame* frame, wxString const& title); + ~CalChartSplash() = default; void OnCmdAbout(wxCommandEvent& event); void OnCmdHelp(wxCommandEvent& event); @@ -38,5 +40,4 @@ class TopFrame : public wxDocParentFrame { static void About(); static void Help(); - DECLARE_EVENT_TABLE() }; diff --git a/src/CalChartToolBar.cpp b/src/CalChartToolBar.cpp index 57180f7b..a78cc259 100644 --- a/src/CalChartToolBar.cpp +++ b/src/CalChartToolBar.cpp @@ -162,7 +162,7 @@ auto CreateAuiToolBar(wxAuiToolBar* tb, T toolbarBits) return tb; } -wxAuiToolBar* CreateLassosAndMoves(wxWindow* parent, wxWindowID id, long style) +wxAuiToolBar* CreateSelectAndMoves(wxWindow* parent, wxWindowID id, long style) { return CreateAuiToolBar(new wxAuiToolBar(parent, id, wxDefaultPosition, wxDefaultSize, style), GetHalfOfMainToolBar()); } diff --git a/src/CalChartToolBar.h b/src/CalChartToolBar.h index 6bdb9eb0..d8b4fa92 100644 --- a/src/CalChartToolBar.h +++ b/src/CalChartToolBar.h @@ -32,5 +32,5 @@ struct ToolBarEntry; std::vector GetSymbolsBitmap(); -wxAuiToolBar* CreateLassosAndMoves(wxWindow* parent, wxWindowID id = wxID_ANY, long style = 0); +wxAuiToolBar* CreateSelectAndMoves(wxWindow* parent, wxWindowID id = wxID_ANY, long style = 0); wxAuiToolBar* CreateDotModifiers(wxWindow* parent, wxWindowID id = wxID_ANY, long style = 0); diff --git a/src/CalChartView.cpp b/src/CalChartView.cpp index 6ab2acc2..6af68407 100644 --- a/src/CalChartView.cpp +++ b/src/CalChartView.cpp @@ -24,20 +24,19 @@ #include "CalChartDoc.h" #include "CalChartDocCommand.h" #include "CalChartFrame.h" +#include "CalChartAnimationErrors.h" #include "FieldCanvas.h" #include "SetupInstruments.h" #include "SetupMarchers.h" -#include "animate.h" -#include "animate_types.h" -#include "animatecommand.h" -#include "animatecompile.h" -#include "background_image.h" +#include "CalChartAnimation.h" +#include "CalChartAnimationCommand.h" +#include "CalChartAnimationCompile.h" +#include "BackgroundImage.h" #include "cc_drawcommand.h" -#include "cc_shapes.h" +#include "CalChartShapes.h" #include "cc_sheet.h" #include "confgr.h" #include "draw.h" -#include "ghost_module.h" #include "setup_wizards.h" #include @@ -85,31 +84,31 @@ void CalChartView::OnDraw(wxDC* dc) auto sheet = mShow->GetCurrentSheet(); if (sheet != mShow->GetSheetEnd()) { - if (mCurrentReferencePoint > 0) { + if (mShow->GetCurrentReferencePoint() > 0) { DrawPoints(*dc, mConfig, origin, mShow->GetSelectionList(), mShow->GetNumPoints(), mShow->GetPointsLabel(), *mShow->GetCurrentSheet(), 0, false); DrawPoints(*dc, mConfig, origin, mShow->GetSelectionList(), mShow->GetNumPoints(), mShow->GetPointsLabel(), - *mShow->GetCurrentSheet(), mCurrentReferencePoint, true); + *mShow->GetCurrentSheet(), mShow->GetCurrentReferencePoint(), true); } else { DrawPoints(*dc, mConfig, origin, mShow->GetSelectionList(), mShow->GetNumPoints(), mShow->GetPointsLabel(), - *mShow->GetCurrentSheet(), mCurrentReferencePoint, true); + *mShow->GetCurrentSheet(), mShow->GetCurrentReferencePoint(), true); } DrawPaths(*dc, *sheet); } } } -void CalChartView::DrawOtherPoints(wxDC& dc, std::map const& positions) +void CalChartView::DrawUncommitedMovePoints(wxDC& dc, std::map const& positions) { DrawPhatomPoints(dc, mConfig, *mShow, *mShow->GetCurrentSheet(), positions); } void CalChartView::OnDrawBackground(wxDC& dc) { - if (!mDrawBackground) { + if (!mShow->GetDrawBackground()) { return; } for (auto i = 0; i < static_cast(mBackgroundImages.size()); ++i) { @@ -177,7 +176,7 @@ void CalChartView::OnWizardSetup(CalChartDoc& show) if (wizard->RunWizard(page1)) { auto labels = page1->GetLabelsAndInstruments(); auto columns = page1->GetNumberColumns(); - auto newmode = wxGetApp().GetShowMode(page2->GetValue()); + auto newmode = GetConfigShowMode(page2->GetValue()); show.WizardSetupNewShow(labels, columns, newmode); SetupInstruments dialog(show, mFrame); @@ -202,17 +201,17 @@ bool CalChartView::DoRotatePointPositions(int rotateAmount) if (mShow->GetSelectionList().size() == 0) { return false; } - auto cmd = mShow->Create_RotatePointPositionsCommand(rotateAmount, mCurrentReferencePoint); + auto cmd = mShow->Create_RotatePointPositionsCommand(rotateAmount); GetDocument()->GetCommandProcessor()->Submit(cmd.release()); return true; } bool CalChartView::DoMovePoints(const std::map& newPositions) { - if (mShow->GetSelectionList().size() == 0 || !mShow->WillMovePoints(newPositions, mCurrentReferencePoint)) { + if (mShow->GetSelectionList().size() == 0 || !mShow->WillMovePoints(newPositions)) { return false; } - auto cmd = mShow->Create_MovePointsCommand(newPositions, mCurrentReferencePoint); + auto cmd = mShow->Create_MovePointsCommand(newPositions); GetDocument()->GetCommandProcessor()->Submit(cmd.release()); return true; } @@ -232,7 +231,7 @@ bool CalChartView::DoResetReferencePoint() if (mShow->GetSelectionList().size() == 0) { return false; } - auto cmd = mShow->Create_ResetReferencePointToRef0(mCurrentReferencePoint); + auto cmd = mShow->Create_ResetReferencePointToRef0(); GetDocument()->GetCommandProcessor()->Submit(cmd.release()); return true; } @@ -240,7 +239,7 @@ bool CalChartView::DoResetReferencePoint() bool CalChartView::DoSetPointsSymbol(SYMBOL_TYPE sym) { if (mShow->GetSelectionList().size() == 0) { - SetSelection(mShow->MakeSelectBySymbol(sym)); + SetSelectionList(mShow->MakeSelectBySymbol(sym)); return true; } auto cmd = mShow->Create_SetSymbolCommand(sym); @@ -418,14 +417,12 @@ bool CalChartView::DoSetContinuityCommand(SYMBOL_TYPE sym, CalChart::Continuity int CalChartView::FindPoint(CalChart::Coord pos) const { - return mShow->GetCurrentSheet()->FindPoint( - pos, Float2CoordUnits(mConfig.Get_DotRatio()), - mCurrentReferencePoint); + return mShow->GetCurrentSheet()->FindPoint(pos, Float2CoordUnits(mConfig.Get_DotRatio()), mShow->GetCurrentReferencePoint()); } CalChart::Coord CalChartView::PointPosition(int which) const { - return mShow->GetCurrentSheet()->GetPosition(which, mCurrentReferencePoint); + return mShow->GetCurrentSheet()->GetPosition(which, mShow->GetCurrentReferencePoint()); } std::vector CalChartView::GetAnimationErrors() const @@ -477,50 +474,46 @@ void CalChartView::GoToSheet(int which) void CalChartView::SetActiveReferencePoint(int which) { - mCurrentReferencePoint = which; - OnUpdate(this); + mShow->SetCurrentReferencePoint(which); } // toggle selection means toggle it as selected to unselected // otherwise, always select it -void CalChartView::SelectWithLasso(const CalChart::Lasso* lasso, bool toggleSelected) +void CalChartView::SelectWithinPolygon(CalChart::RawPolygon_t const& lasso, bool toggleSelected) { - auto select = mShow->MakeSelectWithLasso(*lasso, mCurrentReferencePoint); + auto select = mShow->MakeSelectWithinPolygon(lasso); if (toggleSelected) { select = mShow->MakeToggleSelection(select); } else { select = mShow->MakeAddToSelection(select); } - SetSelection(select); + SetSelectionList(select); } -// Select points within rectangle -void CalChartView::SelectPointsInRect(const CalChart::Coord& c1, const CalChart::Coord& c2, - bool toggleSelected) -{ - CalChart::Lasso lasso(c1); - lasso.Append(CalChart::Coord(c1.x, c2.y)); - lasso.Append(c2); - lasso.Append(CalChart::Coord(c2.x, c1.y)); - lasso.End(); - SelectWithLasso(&lasso, toggleSelected); -} - -void CalChartView::SetSelection(const SelectionList& sl) +void CalChartView::SetSelectionList(const SelectionList& sl) { auto current_sl = mShow->GetSelectionList(); if (std::equal(current_sl.begin(), current_sl.end(), sl.begin(), sl.end())) return; // This *could* be run through a command or run directly... if (mConfig.Get_CommandUndoSelection()) { - auto cmd = mShow->Create_SetSelectionCommand(sl); + auto cmd = mShow->Create_SetSelectionListCommand(sl); GetDocument()->GetCommandProcessor()->Submit(cmd.release()); } else { - mShow->SetSelection(sl); + mShow->SetSelectionList(sl); + } +} + +void CalChartView::SetSelect(CalChart::Select select) +{ + if (select == mShow->GetSelect()) { + return; } + // select is special, directly manipulates the show without going through undo system... + mShow->SetSelect(select); } -void CalChartView::GoToSheetAndSetSelection(int which, const SelectionList& sl) +void CalChartView::GoToSheetAndSetSelectionList(int which, const SelectionList& sl) { if (which < 0 || which >= mShow->GetNumSheets()) { return; @@ -535,20 +528,19 @@ void CalChartView::GoToSheetAndSetSelection(int which, const SelectionList& sl) GetDocument()->GetCommandProcessor()->Submit(cmd.release()); } else { mShow->SetCurrentSheet(which); - mShow->SetSelection(sl); + mShow->SetSelectionList(sl); } } void CalChartView::OnEnableDrawPaths(bool enable) { - mDrawPaths = enable; - mFrame->Refresh(); + mShow->SetDrawPaths(enable); } void CalChartView::DrawPaths(wxDC& dc, const CalChart::Sheet& sheet) { auto animation = mShow->GetAnimation(); - if (mDrawPaths && animation && animation->GetNumberSheets() && (animation->GetNumberSheets() > mShow->GetCurrentSheetNum())) { + if (mShow->GetDrawPaths() && animation && animation->GetNumberSheets() && (animation->GetNumberSheets() > mShow->GetCurrentSheetNum())) { auto origin = GetShowFieldOffset(); for (auto&& point : mShow->GetSelectionList()) { DrawPath(dc, mConfig, animation->GenPathToDraw(mShow->GetCurrentSheetNum(), point, origin), animation->EndPosition(mShow->GetCurrentSheetNum(), point, origin)); @@ -558,12 +550,12 @@ void CalChartView::DrawPaths(wxDC& dc, const CalChart::Sheet& sheet) void CalChartView::DoDrawBackground(bool enable) { - mDrawBackground = enable; + mShow->SetDrawBackground(enable); } bool CalChartView::DoingDrawBackground() const { - return mDrawBackground; + return mShow->GetDrawBackground(); } void CalChartView::DoPictureAdjustment(bool enable) diff --git a/src/CalChartView.h b/src/CalChartView.h index 2064a355..3831d6c6 100644 --- a/src/CalChartView.h +++ b/src/CalChartView.h @@ -21,10 +21,10 @@ */ #include "CalChartDoc.h" -#include "animatecompile.h" -#include "cc_coord.h" -#include "cc_types.h" -#include "ghost_module.h" +#include "CalChartAnimationCompile.h" +#include "CalChartCoord.h" +#include "CalChartTypes.h" +#include "GhostModule.h" #include "modes.h" #include @@ -49,7 +49,7 @@ class CalChartView : public wxView { bool OnClose(bool deleteWindow = true) override; void OnDraw(wxDC* dc) override; - void DrawOtherPoints(wxDC& dc, std::map const& positions); + void DrawUncommitedMovePoints(wxDC& dc, std::map const& positions); void OnDrawBackground(wxDC& dc); void OnWizardSetup(CalChartDoc& show); @@ -88,6 +88,7 @@ class CalChartView : public wxView { auto GetShowFieldOffset() const { return mShow->GetShowMode().Offset(); } auto GetShowFieldSize() const { return mShow->GetShowMode().Size(); } + auto GetSheets() const { return mShow->GetSheets(); } auto GetSheetBegin() const { return mShow->GetSheetBegin(); } auto GetSheetEnd() const { return mShow->GetSheetEnd(); } auto GetCurrentSheet() const { return mShow->GetCurrentSheet(); } @@ -108,14 +109,18 @@ class CalChartView : public wxView { void SetActiveReferencePoint(int which); ///// Select ///// - void UnselectAll() { SetSelection(mShow->MakeUnselectAll()); } - void AddToSelection(const SelectionList& sl) { SetSelection(mShow->MakeAddToSelection(sl)); } - void ToggleSelection(const SelectionList& sl) { SetSelection(mShow->MakeToggleSelection(sl)); } - void SelectWithLasso(const CalChart::Lasso* lasso, bool toggleSelected); + void UnselectAll() { SetSelectionList(mShow->MakeUnselectAll()); } + void AddToSelection(const SelectionList& sl) { SetSelectionList(mShow->MakeAddToSelection(sl)); } + void ToggleSelection(const SelectionList& sl) { SetSelectionList(mShow->MakeToggleSelection(sl)); } + void SelectWithinPolygon(CalChart::RawPolygon_t const& polygon, bool toggleSelected); void SelectPointsInRect(const CalChart::Coord& c1, const CalChart::Coord& c2, bool toggleSelected); auto GetSelectionList() const { return mShow->GetSelectionList(); } - void SetSelection(const SelectionList& sl); - void GoToSheetAndSetSelection(int which, const SelectionList& sl); + void SetSelectionList(const SelectionList& sl); + auto GetSelect() const { return mShow->GetSelect(); } + void SetSelect(CalChart::Select select); + auto GetCurrentMove() const { return mCurrentMove; } + void SetCurrentMove(CalChart::MoveMode move) { mCurrentMove = move; } + void GoToSheetAndSetSelectionList(int which, const SelectionList& sl); auto IsSelected(int i) const { return mShow->IsSelected(i); } ///// Drawing marcher's paths ///// @@ -140,15 +145,14 @@ class CalChartView : public wxView { void UpdateBackgroundImages(); CalChartFrame* mFrame{}; - bool mDrawPaths{}; GhostModule mGhostModule{}; CalChartDoc* mShow{}; - int mCurrentReferencePoint{}; CalChartConfiguration& mConfig; std::vector mBackgroundImages; bool mDrawBackground{}; bool mAdjustBackgroundMode{}; int mWhichBackgroundIndex{}; + CalChart::MoveMode mCurrentMove = CalChart::MoveMode::Normal; DECLARE_DYNAMIC_CLASS(CalChartView) }; diff --git a/src/ColorSetupCanvas.cpp b/src/ColorSetupCanvas.cpp index f7e28507..6ab5fd42 100644 --- a/src/ColorSetupCanvas.cpp +++ b/src/ColorSetupCanvas.cpp @@ -26,7 +26,7 @@ #include "ContinuityBrowserPanel.h" #include "ContinuityComposerDialog.h" #include "cc_drawcommand.h" -#include "cc_shapes.h" +#include "CalChartShapes.h" #include "cc_sheet.h" #include "confgr.h" #include "cont.h" @@ -79,11 +79,11 @@ ColorSetupCanvas::ColorSetupCanvas(CalChartConfiguration& config, wxWindow* pare }; mShow->Create_SetupMarchersCommand(labels, 4, field_offset).first(*mShow); mShow->Create_SetupMarchersCommand(labels, 4, field_offset).first(*mShow); - mShow->Create_SetSelectionCommand(SelectionList{ 0, 2 }).first(*mShow); + mShow->Create_SetSelectionListCommand(SelectionList{ 0, 2 }).first(*mShow); mShow->Create_SetSymbolCommand(SYMBOL_X).first(*mShow); - mShow->Create_SetSelectionCommand(SelectionList{ 1, 3 }).first(*mShow); + mShow->Create_SetSelectionListCommand(SelectionList{ 1, 3 }).first(*mShow); mShow->Create_SetSymbolCommand(SYMBOL_SOLX).first(*mShow); - mShow->Create_SetSelectionCommand(SelectionList{}).first(*mShow); + mShow->Create_SetSelectionListCommand(SelectionList{}).first(*mShow); for (auto i = 0; i < 4; ++i) { mShow->Create_MovePointsCommand({ { i, field_offset + Coord(Int2CoordUnits(i * 4), Int2CoordUnits(2)) } }, 0).first(*mShow); diff --git a/src/ColorSetupDialog.cpp b/src/ColorSetupDialog.cpp index 60b93d99..bd6d8a9c 100644 --- a/src/ColorSetupDialog.cpp +++ b/src/ColorSetupDialog.cpp @@ -26,7 +26,7 @@ #include "ContinuityBrowserPanel.h" #include "ContinuityComposerDialog.h" #include "cc_drawcommand.h" -#include "cc_shapes.h" +#include "CalChartShapes.h" #include "cc_sheet.h" #include "confgr.h" #include "cont.h" diff --git a/src/ContinuityBrowserPanel.cpp b/src/ContinuityBrowserPanel.cpp index da6383b8..a7fadd07 100644 --- a/src/ContinuityBrowserPanel.cpp +++ b/src/ContinuityBrowserPanel.cpp @@ -169,7 +169,7 @@ void ContinuityBrowserPanel::DoSetFocus(wxFocusEvent& event) } auto&& sht = mView->GetCurrentSheet(); - mView->SetSelection(sht->MakeSelectPointsBySymbol(mSym)); + mView->SetSelectionList(sht->MakeSelectPointsBySymbol(mSym)); } void ContinuityBrowserPanel::DoKillFocus(wxFocusEvent& event) diff --git a/src/ContinuityBrowserPanel.h b/src/ContinuityBrowserPanel.h index ef13be42..9e037d96 100644 --- a/src/ContinuityBrowserPanel.h +++ b/src/ContinuityBrowserPanel.h @@ -22,7 +22,7 @@ #include "CustomListViewPanel.h" #include "cc_continuity.h" -#include "cc_types.h" +#include "CalChartTypes.h" #include diff --git a/src/FieldCanvas.cpp b/src/FieldCanvas.cpp index ed3466b7..dea14e80 100644 --- a/src/FieldCanvas.cpp +++ b/src/FieldCanvas.cpp @@ -24,17 +24,34 @@ #include "CalChartFrame.h" #include "CalChartView.h" -#include "background_image.h" +#include "BackgroundImage.h" #include "cc_drawcommand.h" -#include "cc_shapes.h" +#include "CalChartShapes.h" #include "confgr.h" #include "draw.h" -#include "field_canvas_shapes.h" -#include "linmath.h" -#include "math_utils.h" +#include "CalChartMovePointsTool.h" #include + +static inline auto TranslateMouseToCoord(wxClientDC& dc, wxMouseEvent& event) +{ + auto mousePos = event.GetPosition(); + return CalChart::Coord(tDIP(dc.DeviceToLogicalX(mousePos.x)), tDIP(dc.DeviceToLogicalY(mousePos.y))); +} + +static inline auto SNAPGRID(CalChart::Coord::units a, CalChart::Coord::units n, CalChart::Coord::units s) +{ + auto a2 = (a + (n >> 1)) & (~(n - 1)); + auto h = s >> 1; + if ((a - a2) >= h) + return a2 + s; + else if ((a - a2) < -h) + return a2 - s; + else + return a2; +} + BEGIN_EVENT_TABLE(FieldCanvas, FieldCanvas::super) EVT_CHAR(FieldCanvas::OnChar) EVT_LEFT_DOWN(FieldCanvas::OnMouseLeftDown) @@ -67,11 +84,11 @@ void FieldCanvas::SetView(CalChartView* view) mView = view; } -// Define the repainting behaviour +// Painting involves deferring to the view as it has much of the information about how to draw consistently +// across several different widgets void FieldCanvas::OnFieldPaint(wxPaintEvent& event) { - const auto& config = CalChartConfiguration::GetGlobalConfig(); - OnPaint(event, config); + OnPaint(event, CalChartConfiguration::GetGlobalConfig()); } void FieldCanvas::OnPaint(wxPaintEvent& event, CalChartConfiguration const& config) @@ -92,7 +109,7 @@ void FieldCanvas::OnPaint(wxPaintEvent& event, CalChartConfiguration const& conf mView->OnDraw(&dc); // draw the move points dots - mView->DrawOtherPoints(dc, mMovePoints); + mView->DrawUncommitedMovePoints(dc, mUncommittedMovePoints); PaintSelectShapes(dc, config); PaintMoveShapes(dc, config); @@ -106,191 +123,133 @@ void FieldCanvas::PaintBackground(wxDC& dc, CalChartConfiguration const& config) dc.Clear(); } -void FieldCanvas::PaintShapes(wxDC& dc, CalChartConfiguration const& config, ShapeList const& shape_list) -{ - if (!mView) { - return; - } - if (!shape_list.empty()) { - dc.SetBrush(*wxTRANSPARENT_BRUSH); - dc.SetPen(config.Get_CalChartBrushAndPen(COLOR_SHAPES).second); - auto origin = mView->GetShowFieldOffset(); - for (auto&& i : shape_list) { - DrawCC_DrawCommandList(dc, i->GetCC_DrawCommand(origin.x, origin.y)); - } - } -} - void FieldCanvas::PaintSelectShapes(wxDC& dc, CalChartConfiguration const& config) { - return PaintShapes(dc, config, m_select_shape_list); + if (mSelectTool) { + PaintShapes(dc, config, mSelectTool->GetShapeList()); + } } void FieldCanvas::PaintMoveShapes(wxDC& dc, CalChartConfiguration const& config) { - if (m_move_points) { - PaintShapes(dc, config, m_move_points->GetShapeList()); + if (mMovePointsTool) { + PaintShapes(dc, config, mMovePointsTool->GetShapeList()); } } -// We have a empty erase background to improve redraw performance. -void FieldCanvas::OnEraseBackground(wxEraseEvent& event) { } - -void FieldCanvas::OnMouseLeftDown_default(CalChart::Coord pos, bool shiftDown, bool altDown) +void FieldCanvas::PaintShapes(wxDC& dc, CalChartConfiguration const& config, ShapeList const& shapeList) { - if (!mView) { - return; - } - if (select_drag == CC_DRAG::POLY) { - return; - } - if (curr_lasso == CC_DRAG::SWAP) { - OnMouseLeftDown_CC_DRAG_SWAP(pos); - } - auto i = mView->FindPoint(pos); - if ((i < 0) && !(shiftDown || altDown)) { - mView->UnselectAll(); - } - if (i < 0) { - // if no point selected, we grab using the current lasso - BeginSelectDrag(curr_lasso, pos); - } else { - SelectionList select; - select.insert(i); - if (altDown) { - mView->ToggleSelection(select); - } else { - mView->AddToSelection(select); - } - - m_move_points = Create_MovePoints(CC_MOVE_NORMAL); - m_move_points->OnMouseLeftDown(SnapToolToGrid(pos)); + for (auto&& i : shapeList) { + PaintShapes(dc, config, i.get()); } } -void FieldCanvas::OnMouseLeftUp_CC_DRAG_BOX(CalChart::Coord, bool altDown) +void FieldCanvas::PaintShapes(wxDC& dc, CalChartConfiguration const& config, CalChart::Shape const* shapeList) { - if (!mView) { - return; + if (shapeList) { + dc.SetBrush(*wxTRANSPARENT_BRUSH); + dc.SetPen(config.Get_CalChartBrushAndPen(COLOR_SHAPES).second); + auto origin = mView->GetShowFieldOffset(); + DrawCC_DrawCommandList(dc, shapeList->GetCC_DrawCommand(origin.x, origin.y)); } - auto* shape = (CalChart::Shape_2point*)m_select_shape_list.back().get(); - mView->SelectPointsInRect(shape->GetOrigin(), shape->GetPoint(), altDown); - EndDrag(); } -void FieldCanvas::OnMouseLeftUp_CC_DRAG_LASSO(CalChart::Coord pos, bool altDown) +// We have a empty erase background to improve redraw performance. +void FieldCanvas::OnEraseBackground(wxEraseEvent& event) {} + +// When a left click down occurs: +// We could be doing picture adjustments, so handle that first +// Otherwise, we're either doing a Normal move or a complicated Move +// For the complicated move, we create one if it doesn't exist and then add this click to it. +void FieldCanvas::OnMouseLeftDown(wxMouseEvent& event) { if (!mView) { return; } - ((CalChart::Lasso*)m_select_shape_list.back().get())->End(); - mView->SelectWithLasso((CalChart::Lasso*)m_select_shape_list.back().get(), altDown); - EndDrag(); -} + wxClientDC dc(this); + PrepareDC(dc); -void FieldCanvas::OnMouseLeftUp_CC_DRAG_POLY(CalChart::Coord pos, bool altDown) -{ - if (!mView) { + if (mView->DoingPictureAdjustment()) { + mView->OnBackgroundMouseLeftDown(event, dc); + Refresh(); return; } - static constexpr auto CLOSE_ENOUGH_TO_CLOSE = 10; - auto* p = ((CalChart::Lasso*)m_select_shape_list.back().get())->FirstPoint(); - auto numPnts = ((CalChart::Lasso*)m_select_shape_list.back().get())->NumPoints(); - if (p != NULL && numPnts > 2) { - // need to know where the scale is, so we need the device. - wxClientDC dc(this); - PrepareDC(dc); - auto polydist = dc.DeviceToLogicalXRel(CLOSE_ENOUGH_TO_CLOSE); - auto d = p->x - pos.x; - if (std::abs(d) < polydist) { - d = p->y - pos.y; - if (std::abs(d) < polydist) { - mView->SelectWithLasso((CalChart::Lasso*)m_select_shape_list.back().get(), altDown); - EndDrag(); - return; - } + + auto mousePos = TranslateMouseToCoord(dc, event); + auto pos = mousePos - mView->GetShowFieldOffset(); + + if (GetCurrentMove() == CalChart::MoveMode::Normal) { + OnMouseLeftDown_NormalMove(pos, event.ShiftDown(), event.AltDown()); + } else { + if (!mMovePointsTool) { + mMovePointsTool = CalChart::MovePointsTool::Create(GetCurrentMove()); } + mMovePointsTool->OnClickDown(SnapToolToGrid(pos)); } - ((CalChart::Lasso*)m_select_shape_list.back().get())->Append(pos); + Refresh(); } -void FieldCanvas::OnMouseLeftUp_default(CalChart::Coord pos, bool altDown) +void FieldCanvas::OnMouseLeftDown_NormalMove(CalChart::Coord pos, bool shiftDown, bool altDown) { - if (!mView) { + // If we are doing a polygon we only care about when the mouse click is released + if (mSelectTool && mView->GetSelect() == CalChart::Select::Poly) { return; } - switch (select_drag) { - case CC_DRAG::BOX: - OnMouseLeftUp_CC_DRAG_BOX(pos, altDown); - break; - case CC_DRAG::LASSO: - OnMouseLeftUp_CC_DRAG_LASSO(pos, altDown); - break; - case CC_DRAG::POLY: - OnMouseLeftUp_CC_DRAG_POLY(pos, altDown); - break; - default: - break; + // If we're doing a Swap, handle swapping the marchers now. + if (mView->GetSelect() == CalChart::Select::Swap) { + OnMouseLeftDown_Swap(pos); } -} -void FieldCanvas::OnMouseLeftDown_CC_DRAG_SWAP(CalChart::Coord pos) -{ - if (!mView) { + auto i = mView->FindPoint(pos); + // if we didn't click on anything, and we have no modifiers, we are starting a new selection + if ((i < 0) && !(shiftDown || altDown)) { + mView->UnselectAll(); + } + if (i < 0) { + // if no point selected, we grab using the current select + BeginSelectDrag(mView->GetSelect(), pos); return; } - int targetDotIndex = mView->FindPoint(pos); - if (targetDotIndex >= 0) { - SelectionList targetDot; - targetDot.insert(targetDotIndex); - if (mView->GetSelectionList().size() != 1) { - mView->UnselectAll(); - } - mView->AddToSelection(targetDot); - if (mView->GetSelectionList().size() == 2) { - mView->DoRotatePointPositions(1); - mView->UnselectAll(); - } + + // Now add whatever we clicked to the selection. + auto select = SelectionList{ i }; + if (altDown) { + mView->ToggleSelection(select); } else { - mView->UnselectAll(); + mView->AddToSelection(select); } -} -CalChart::Coord FieldCanvas::TranslateMouseToCoord(wxClientDC& dc, wxMouseEvent& event) -{ - auto mousePos = event.GetPosition(); - return CalChart::Coord(tDIP(dc.DeviceToLogicalX(mousePos.x)), tDIP(dc.DeviceToLogicalY(mousePos.y))); + mMovePointsTool = CalChart::MovePointsTool::Create(CalChart::MoveMode::Normal); + mMovePointsTool->OnClickDown(SnapToolToGrid(pos)); } -// Allow clicking within pixels to close polygons -void FieldCanvas::OnMouseLeftDown(wxMouseEvent& event) +// Swap works by finding the points clicked on. +// if more than 1 point is in the current selectionList, we unselect everything +// then we add the newly clicked point to the selectionList. +// If we have 2 points, we're done, and we swap those two points (rotate) +// And then we unselect +void FieldCanvas::OnMouseLeftDown_Swap(CalChart::Coord pos) { - if (!mView) { + int targetDotIndex = mView->FindPoint(pos); + if (targetDotIndex < 0) { return; } - wxClientDC dc(this); - PrepareDC(dc); - - if (mView->DoingPictureAdjustment()) { - mView->OnBackgroundMouseLeftDown(event, dc); - } else { - CalChart::Coord pos = mView->GetShowFieldOffset(); - auto mousePos = TranslateMouseToCoord(dc, event); - pos = mousePos - pos; - - if (curr_move != CC_MOVE_NORMAL) { - if (!m_move_points) { - m_move_points = Create_MovePoints(curr_move); - } - m_move_points->OnMouseLeftDown(SnapToolToGrid(pos)); - } else { - OnMouseLeftDown_default(pos, event.ShiftDown(), event.AltDown()); - } + SelectionList targetDot; + targetDot.insert(targetDotIndex); + if (mView->GetSelectionList().size() != 1) { + mView->UnselectAll(); + } + mView->AddToSelection(targetDot); + if (mView->GetSelectionList().size() == 2) { + mView->DoRotatePointPositions(1); + mView->UnselectAll(); } - Refresh(); } -// Allow clicking within pixels to close polygons +// When a left click up occurs: +// We could be doing picture adjustments, so handle that first +// Otherwise, if we are moving points, then determine if we're done. +// Finally, if none of that, close up any select tools void FieldCanvas::OnMouseLeftUp(wxMouseEvent& event) { if (!mView) { @@ -301,21 +260,26 @@ void FieldCanvas::OnMouseLeftUp(wxMouseEvent& event) if (mView->DoingPictureAdjustment()) { mView->OnBackgroundMouseLeftUp(event, dc); - } else { - CalChart::Coord pos = mView->GetShowFieldOffset(); - auto mousePos = TranslateMouseToCoord(dc, event); - pos = mousePos - pos; - - if (m_move_points) { - if (m_move_points->OnMouseUpDone(pos)) { - mView->DoMovePoints(mMovePoints); - EndDrag(); - curr_move = CC_MOVE_NORMAL; - static_cast(GetParent())->ToolBarSetCurrentMove(CC_MOVE_NORMAL); - } + Refresh(); + return; + } + auto mousePos = TranslateMouseToCoord(dc, event); + auto pos = mousePos - mView->GetShowFieldOffset(); + + if (mMovePointsTool) { + mMovePointsTool->OnClickUp(pos); + if (mMovePointsTool->IsDone()) { + mView->DoMovePoints(mUncommittedMovePoints); + EndDrag(); + mView->SetCurrentMove(CalChart::MoveMode::Normal); + static_cast(GetParent())->ToolBarSetCurrentMove(CalChart::MoveMode::Normal); } - if (!(m_select_shape_list.empty())) { - OnMouseLeftUp_default(pos, event.AltDown()); + } + if (mSelectTool) { + mSelectTool->OnClickUp(pos); + if (auto polygon = mSelectTool->GetPolygon(); polygon && mSelectTool->SelectDone()) { + mView->SelectWithinPolygon(*mSelectTool->GetPolygon(), event.AltDown()); + EndDrag(); } } Refresh(); @@ -330,8 +294,10 @@ void FieldCanvas::OnMouseLeftDoubleClick(wxMouseEvent& event) wxClientDC dc(this); PrepareDC(dc); - if (!m_select_shape_list.empty() && (CC_DRAG::POLY == select_drag)) { - mView->SelectWithLasso((CalChart::Lasso*)m_select_shape_list.back().get(), event.AltDown()); + if (mSelectTool && (CalChart::Select::Poly == mView->GetSelect())) { + if (auto polygon = mSelectTool->GetPolygon(); polygon) { + mView->SelectWithinPolygon(*polygon, event.AltDown()); + } EndDrag(); } Refresh(); @@ -340,14 +306,7 @@ void FieldCanvas::OnMouseLeftDoubleClick(wxMouseEvent& event) // Allow right click to close polygons void FieldCanvas::OnMouseRightDown(wxMouseEvent& event) { - wxClientDC dc(this); - PrepareDC(dc); - - if (!m_select_shape_list.empty() && (CC_DRAG::POLY == select_drag)) { - mView->SelectWithLasso((CalChart::Lasso*)m_select_shape_list.back().get(), event.AltDown()); - EndDrag(); - } - Refresh(); + OnMouseLeftDoubleClick(event); } // Allow clicking within pixels to close polygons @@ -358,26 +317,50 @@ void FieldCanvas::OnMouseMove(wxMouseEvent& event) } super::OnMouseMove(event); - if (!IsScrolling()) { - wxClientDC dc(this); - PrepareDC(dc); + if (IsScrolling()) { + Refresh(); + return; + } - if (mView->DoingPictureAdjustment()) { - mView->OnBackgroundMouseMove(event, dc); - } else { - CalChart::Coord pos = mView->GetShowFieldOffset(); - auto mousePos = TranslateMouseToCoord(dc, event); - pos = mousePos - pos; + wxClientDC dc(this); + PrepareDC(dc); - if (event.Dragging() && event.LeftIsDown()) { - MoveDrag(pos); - } - if (event.Moving() && !m_select_shape_list.empty() && (CC_DRAG::POLY == select_drag)) { - MoveDrag(pos); + if (mView->DoingPictureAdjustment()) { + mView->OnBackgroundMouseMove(event, dc); + Refresh(); + return; + } + + auto mousePos = TranslateMouseToCoord(dc, event); + auto pos = mousePos - mView->GetShowFieldOffset(); + + // if we are dragging with the left mouse down OR we are moving with the poly selection tool + if ((event.Dragging() && event.LeftIsDown()) || + (event.Moving() && mSelectTool && (CalChart::Select::Poly == mView->GetSelect()))) { + MoveDrag(pos); + } + Refresh(); +} + +void FieldCanvas::MoveDrag(CalChart::Coord end) +{ + if (mSelectTool) { + mSelectTool->OnMove(end, SnapToolToGrid(end)); + } + if (mMovePointsTool) { + mMovePointsTool->OnMove(end, SnapToolToGrid(end)); + std::map selected_points; + for (auto i : mView->GetSelectionList()) { + selected_points[i] = mView->PointPosition(i); + } + + if (mMovePointsTool->IsReadyForMoving()) { + mUncommittedMovePoints = mMovePointsTool->TransformPoints(selected_points); + for (auto& i : mUncommittedMovePoints) { + i.second = mView->ClipPositionToShowMode(SnapToGrid(i.second)); } } } - Refresh(); } // Allow clicking within pixels to close polygons @@ -407,13 +390,13 @@ void FieldCanvas::OnChar(wxKeyEvent& event) if (event.GetKeyCode() == 'w') { MoveByKey(direction::north); } - if (event.GetKeyCode() == 'd') { + else if (event.GetKeyCode() == 'd') { MoveByKey(direction::east); } - if (event.GetKeyCode() == 's') { + else if (event.GetKeyCode() == 's') { MoveByKey(direction::south); } - if (event.GetKeyCode() == 'a') { + else if (event.GetKeyCode() == 'a') { MoveByKey(direction::west); } else event.Skip(); @@ -432,62 +415,13 @@ void FieldCanvas::SetZoom(float factor) Refresh(); } -void FieldCanvas::BeginSelectDrag(CC_DRAG type, const CalChart::Coord& start) -{ - select_drag = type; - m_select_shape_list.clear(); - switch (type) { - case CC_DRAG::BOX: - m_select_shape_list.emplace_back(new CalChart::Shape_rect(start)); - break; - case CC_DRAG::POLY: - m_select_shape_list.emplace_back(new CalChart::Poly(start)); - break; - case CC_DRAG::LASSO: - m_select_shape_list.emplace_back(new CalChart::Lasso(start)); - break; - case CC_DRAG::LINE: - m_select_shape_list.emplace_back(new CalChart::Shape_line(start)); - break; - case CC_DRAG::CROSSHAIRS: - m_select_shape_list.emplace_back(new CalChart::Shape_crosshairs(start, Int2CoordUnits(2))); - break; - case CC_DRAG::SHAPE_ELLIPSE: - m_select_shape_list.emplace_back(new CalChart::Shape_ellipse(start)); - break; - case CC_DRAG::SHAPE_X: - m_select_shape_list.emplace_back(new CalChart::Shape_x(start)); - break; - case CC_DRAG::SHAPE_CROSS: - m_select_shape_list.emplace_back(new CalChart::Shape_cross(start)); - break; - default: - break; - } -} - -void FieldCanvas::MoveDrag(const CalChart::Coord& end) +void FieldCanvas::BeginSelectDrag(CalChart::Select type, CalChart::Coord start) { - if (!mView) { - return; - } - if (!m_select_shape_list.empty()) { - m_select_shape_list.back()->OnMove(end, SnapToolToGrid(end)); - } - if (m_move_points) { - m_move_points->OnMove(end, SnapToolToGrid(end)); - std::map selected_points; - for (auto i : mView->GetSelectionList()) { - selected_points[i] = mView->PointPosition(i); - } - - if (m_move_points->IsReadyForMoving()) { - mMovePoints = m_move_points->TransformPoints(selected_points); - for (auto& i : mMovePoints) { - i.second = mView->ClipPositionToShowMode(SnapToGrid(i.second)); - } - } - } + mSelectTool = std::make_unique(type, start, [this](int input) { + wxClientDC dc(this); + PrepareDC(dc); + return dc.DeviceToLogicalXRel(input); + }); } CalChart::Coord FieldCanvas::GetMoveAmount(direction dir) @@ -508,18 +442,6 @@ CalChart::Coord FieldCanvas::GetMoveAmount(direction dir) return { 0, 0 }; } -static inline CalChart::Coord::units SNAPGRID(CalChart::Coord::units a, CalChart::Coord::units n, CalChart::Coord::units s) -{ - auto a2 = (a + (n >> 1)) & (~(n - 1)); - auto h = s >> 1; - if ((a - a2) >= h) - return a2 + s; - else if ((a - a2) < -h) - return a2 - s; - else - return a2; -} - CalChart::Coord FieldCanvas::SnapToGrid(CalChart::Coord c) { CalChart::Coord::units gridn, grids; @@ -554,26 +476,33 @@ void FieldCanvas::MoveByKey(direction dir) std::map move_points; auto&& select_list = mView->GetSelectionList(); auto pos = GetMoveAmount(dir); + // saturate by mode for (auto i = select_list.begin(); i != select_list.end(); ++i) { move_points[*i] = mView->ClipPositionToShowMode(mView->PointPosition(*i) + pos); } - // saturate by mode mView->DoMovePoints(move_points); } void FieldCanvas::EndDrag() { - mMovePoints.clear(); - m_move_points.reset(); - m_select_shape_list.clear(); - select_drag = CC_DRAG::NONE; + mUncommittedMovePoints.clear(); + mMovePointsTool.reset(); + mSelectTool.reset(); } -void FieldCanvas::SetCurrentLasso(CC_DRAG lasso) { curr_lasso = lasso; } +CalChart::Select FieldCanvas::GetCurrentSelect() const { return mView ? mView->GetSelect() : CalChart::Select::Box; } +CalChart::MoveMode FieldCanvas::GetCurrentMove() const { return mView ? mView->GetCurrentMove() : CalChart::MoveMode::Normal; } + +void FieldCanvas::SetCurrentSelect(CalChart::Select select) +{ + if (mView) { + mView->SetSelect(select); + } +} // implies a call to EndDrag() -void FieldCanvas::SetCurrentMove(CC_MOVE_MODES move) +void FieldCanvas::SetCurrentMove(CalChart::MoveMode move) { EndDrag(); - curr_move = move; + mView->SetCurrentMove(move); } diff --git a/src/FieldCanvas.h b/src/FieldCanvas.h index fb870c4b..e743e511 100644 --- a/src/FieldCanvas.h +++ b/src/FieldCanvas.h @@ -22,7 +22,9 @@ */ #include "basic_ui.h" -#include "cc_types.h" +#include "CalChartTypes.h" +#include "CalChartMovePointsTool.h" +#include "CalChartSelectTool.h" #include #include @@ -35,12 +37,12 @@ class CalChartFrame; class BackgroundImage; namespace CalChart { class Shape; -class Coord; +struct Coord; class Shape_2point; +class MovePoints; } class Matrix; class CalChartConfiguration; -class MovePoints; using ShapeList = std::vector>; @@ -60,11 +62,11 @@ class FieldCanvas : public ClickDragCtrlScrollCanvas { float ZoomToFitFactor() const; virtual void SetZoom(float factor); - auto GetCurrentLasso() const { return curr_lasso; } - void SetCurrentLasso(CC_DRAG lasso); - auto GetCurrentMove() const { return curr_move; } + CalChart::Select GetCurrentSelect() const; + void SetCurrentSelect(CalChart::Select select); + CalChart::MoveMode GetCurrentMove() const; // implies a call to EndDrag() - void SetCurrentMove(CC_MOVE_MODES move); + void SetCurrentMove(CalChart::MoveMode move); void OnChar(wxKeyEvent& event); @@ -82,14 +84,17 @@ class FieldCanvas : public ClickDragCtrlScrollCanvas { void OnMousePinchToZoom(wxMouseEvent& event) override; // Internals - void BeginSelectDrag(CC_DRAG type, const CalChart::Coord& start); - void AddMoveDrag(CC_DRAG type, std::unique_ptr shape); - void MoveDrag(const CalChart::Coord& end); + void BeginSelectDrag(CalChart::Select select, CalChart::Coord start); + void AddMoveDrag(CalChart::Select select, std::unique_ptr shape); + void MoveDrag(CalChart::Coord end); void EndDrag(); - enum class direction { north, + + enum class direction { + north, east, south, - west }; + west + }; void MoveByKey(direction); CalChart::Coord GetMoveAmount(direction dir); CalChart::Coord SnapToGrid(CalChart::Coord c); @@ -99,26 +104,18 @@ class FieldCanvas : public ClickDragCtrlScrollCanvas { void OnPaint(wxPaintEvent& event, const CalChartConfiguration& config); void PaintBackground(wxDC& dc, const CalChartConfiguration& config); void PaintShapes(wxDC& dc, CalChartConfiguration const& config, ShapeList const&); + void PaintShapes(wxDC& dc, CalChartConfiguration const& config, CalChart::Shape const*); void PaintSelectShapes(wxDC& dc, CalChartConfiguration const& config); void PaintMoveShapes(wxDC& dc, CalChartConfiguration const& config); - void OnMouseLeftDown_default(CalChart::Coord pos, bool shiftDown, bool altDown); - void OnMouseLeftUp_default(CalChart::Coord pos, bool altDown); - - void OnMouseLeftDown_CC_DRAG_SWAP(CalChart::Coord pos); - - void OnMouseLeftUp_CC_DRAG_BOX(CalChart::Coord pos, bool altDown); - void OnMouseLeftUp_CC_DRAG_LASSO(CalChart::Coord pos, bool altDown); - void OnMouseLeftUp_CC_DRAG_POLY(CalChart::Coord pos, bool altDown); - - // utility - CalChart::Coord TranslateMouseToCoord(wxClientDC& dc, wxMouseEvent& event); + void OnMouseLeftDown_NormalMove(CalChart::Coord pos, bool shiftDown, bool altDown); + void OnMouseLeftDown_Swap(CalChart::Coord pos); CalChartView* mView{}; - CC_DRAG curr_lasso = CC_DRAG::BOX; - CC_MOVE_MODES curr_move = CC_MOVE_NORMAL; - std::unique_ptr m_move_points; - std::map mMovePoints; - CC_DRAG select_drag = CC_DRAG::NONE; - ShapeList m_select_shape_list; + // The current selection + std::unique_ptr mSelectTool; + // we maintain the transient movement of points, and the selection list in Canvas. + std::unique_ptr mMovePointsTool; + // A cached list of the place where the selection list will move + std::map mUncommittedMovePoints; }; diff --git a/src/FieldControlsToolBar.h b/src/FieldControlsToolBar.h index d70fcd4c..d952fcbd 100644 --- a/src/FieldControlsToolBar.h +++ b/src/FieldControlsToolBar.h @@ -21,8 +21,8 @@ along with this program. If not, see . */ -#include "cc_coord.h" -#include "cc_types.h" +#include "CalChartCoord.h" +#include "CalChartTypes.h" #include class wxAuiToolBar; diff --git a/src/GhostModule.h b/src/GhostModule.h new file mode 100644 index 00000000..2945b566 --- /dev/null +++ b/src/GhostModule.h @@ -0,0 +1,48 @@ +#pragma once +/* + * GhostModule.h + * Maintains the indirection of the Ghost sheet. + */ + +#include "CalChartDoc.h" +#include "cc_sheet.h" + +namespace CalChart { +class Sheet; +} +class CalChartDoc; + +enum class GhostSource { + disabled, + next, + previous, + specific, +}; + +class GhostModule { +public: + void setGhostSource(GhostSource source, int which = 0) + { + mCurrentSource = source; + mWhich = which; + } + + auto isActive() const { return mCurrentSource != GhostSource::disabled; } + + CalChart::Sheet const* getGhostSheet(CalChartDoc const* doc, int currentSheet) const + { + if (!isActive() || (doc == nullptr)) { + return nullptr; + } + auto targetSheet = (mCurrentSource == GhostSource::next) ? currentSheet + 1 : (mCurrentSource == GhostSource::previous) ? currentSheet - 1 : mWhich; + if (targetSheet >= 0 && targetSheet < doc->GetNumSheets()) { + return &(*(doc->GetNthSheet(targetSheet))); + } + return nullptr; + } + + +private: + GhostSource mCurrentSource = GhostSource::disabled; + int mWhich = 0; +}; diff --git a/src/single_instance_ipc.cpp b/src/HostAppInterface.cpp similarity index 52% rename from src/single_instance_ipc.cpp rename to src/HostAppInterface.cpp index d288d08f..3a6d8dfd 100644 --- a/src/single_instance_ipc.cpp +++ b/src/HostAppInterface.cpp @@ -1,5 +1,10 @@ +/* + * CalChartApp.cpp + * Central App for CalChart + */ -#include "single_instance_ipc.h" + +#include "HostAppInterface.h" #include "CalChartApp.h" #include @@ -10,84 +15,97 @@ const wxString OPEN_FILE = "OpenFile"; -class CCAppClientConnection; -class CCAppServerConnection; - -class CCAppServer : public wxServer { -public: - static wxString GetServerName(); +// because these are all implementation details, using structs here make sense. No encapsulation needed. - static std::unique_ptr MakeServer(CalChartApp* app); - virtual ~CCAppServer(); - virtual wxConnectionBase* OnAcceptConnection(const wxString& topic); +struct CCAppClientConnection; +struct CCAppServerConnection; - void OpenFile(const wxString& filename); +struct CCAppServer : public wxServer { + static auto GetServerName() { + auto name = wxGetUserId() + wxStandardPaths::Get().GetExecutablePath(); + return std::to_string(static_cast(std::hash{}(name))); + } - // should only be called by the connection - void DestroyConnection(CCAppServerConnection* connection); + static std::unique_ptr MakeServer(CalChartApp* app) { + auto newServer = std::make_unique(app); + if (!newServer->Create(GetServerName())) { + return nullptr; + } + return newServer; + } -private: CCAppServer(CalChartApp* app) : mApp(app) { } + virtual ~CCAppServer() override; + virtual wxConnectionBase* OnAcceptConnection(wxString const& topic) override; + + void OpenFile(wxString const& filename) { + mApp->OpenFile(filename); + } + + // should only be called by the connection + void DestroyConnection(CCAppServerConnection* connection) { + mActiveConnections.erase(std::remove(mActiveConnections.begin(), mActiveConnections.end(), connection)); + } + +private: // maintain a list of connections to disconnect from on d-tor std::vector mActiveConnections; - - CalChartApp* mApp; + CalChartApp* mApp{}; }; -class CCAppClient : public wxClient { -public: - static std::unique_ptr MakeClient(); - virtual ~CCAppClient(); - virtual wxConnectionBase* OnMakeConnection(); +struct CCAppClient : public wxClient { + static std::unique_ptr MakeClient() { + auto newClient = std::make_unique(); + if (newClient->Connect("localhost", CCAppServer::GetServerName(), "Client")) { + return newClient; + } + return nullptr; + } + + virtual ~CCAppClient() override { Disconnect(); } + + virtual wxConnectionBase* OnMakeConnection() override; - void OpenFile(const wxString& filename); + void OpenFile(wxString const& filename); // should only be called by the connection - void DestroyConnection(); + void DestroyConnection() { mConnection = nullptr; } private: - CCAppClient() - : mConnection(nullptr) - { - } - - bool Connect(const wxString& host, const wxString& service, - const wxString& topic); - bool IsConnected(); + bool Connect(wxString const& host, wxString const& service, wxString const& topic); + auto IsConnected() { return mConnection != nullptr; } void Disconnect(); // mConnection may be null, depending on the state of the connection - CCAppClientConnection* mConnection; + CCAppClientConnection* mConnection{}; }; // Connection pair: // Servers will get Poked, then they turn around and ask the server object to // open it. // Clients will Poke the servers to open files for them. -class CCAppServerConnection : public wxConnection { +struct CCAppServerConnection : public wxConnection { using super = wxConnection; -public: CCAppServerConnection(CCAppServer* server) : mServer(server) { } // ServerConnection: OnPoke, ask the server to open a file. - virtual bool OnPoke(const wxString& topic, const wxString& item, - const void* data, size_t size, wxIPCFormat format) + virtual bool OnPoke(wxString const& topic, wxString const& item, void const* data, size_t size, wxIPCFormat format) override { if (item == OPEN_FILE) { - mServer->OpenFile(wxString((const char*)data, size - 1)); + mServer->OpenFile(std::string(static_cast(data), size - 1)); } return super::OnPoke(topic, item, data, size, format); } - virtual bool OnDisconnect() + virtual bool OnDisconnect() override { mServer->DestroyConnection(this); return super::OnDisconnect(); @@ -97,19 +115,18 @@ class CCAppServerConnection : public wxConnection { CCAppServer* mServer; }; -class CCAppClientConnection : public wxConnection { +struct CCAppClientConnection : public wxConnection { using super = wxConnection; -public: CCAppClientConnection(CCAppClient* client) : mClient(client) { } // ClientConnect: Poke the server to open a file. - void OpenFile(const wxString& filename) { Poke(OPEN_FILE, filename); } + void OpenFile(wxString const& filename) { Poke(OPEN_FILE, filename); } - virtual bool OnDisconnect() + virtual bool OnDisconnect() override { mClient->DestroyConnection(); return super::OnDisconnect(); @@ -119,26 +136,6 @@ class CCAppClientConnection : public wxConnection { CCAppClient* mClient; }; -wxString CCAppServer::GetServerName() -{ - wxString name = wxGetUserId() + wxStandardPaths::Get().GetExecutablePath(); - std::hash nameHasher; - auto hash = nameHasher(name.ToStdString()); - int16_t sizedHash = hash; - wxString returnVal; - returnVal << sizedHash; - return returnVal; -} - -std::unique_ptr CCAppServer::MakeServer(CalChartApp* app) -{ - std::unique_ptr newServer{ new CCAppServer(app) }; - if (!newServer->Create(GetServerName())) { - return nullptr; - } - return newServer; -} - CCAppServer::~CCAppServer() { while (mActiveConnections.size() > 0) { @@ -148,42 +145,19 @@ CCAppServer::~CCAppServer() } } -void CCAppServer::OpenFile(const wxString& filename) -{ - mApp->OpenFile(filename); -} - -wxConnectionBase* CCAppServer::OnAcceptConnection(const wxString&) +wxConnectionBase* CCAppServer::OnAcceptConnection(wxString const&) { - CCAppServerConnection* newConnection = new CCAppServerConnection(this); - mActiveConnections.push_back(newConnection); - return newConnection; + mActiveConnections.push_back(new CCAppServerConnection(this)); + return mActiveConnections.back(); } -void CCAppServer::DestroyConnection(CCAppServerConnection* connection) -{ - mActiveConnections.erase(std::remove(mActiveConnections.begin(), - mActiveConnections.end(), connection)); -} - -std::unique_ptr CCAppClient::MakeClient() -{ - std::unique_ptr newClient{ new CCAppClient() }; - if (newClient->Connect("localhost", CCAppServer::GetServerName(), "Client")) { - return newClient; - } - return nullptr; -} - -void CCAppClient::OpenFile(const wxString& filename) +void CCAppClient::OpenFile(wxString const& filename) { if (mConnection != nullptr) { mConnection->OpenFile(filename); } } -bool CCAppClient::IsConnected() { return mConnection != nullptr; } - void CCAppClient::Disconnect() { if (mConnection != nullptr) { @@ -191,8 +165,7 @@ void CCAppClient::Disconnect() } } -bool CCAppClient::Connect(const wxString& host, const wxString& service, - const wxString& topic) +bool CCAppClient::Connect(wxString const& host, wxString const& service, wxString const& topic) { auto oldLogLevel = wxLog::GetLogLevel(); wxLog::SetLogLevel(wxLOG_FatalError); // Make sure that we don't throw errors @@ -201,7 +174,7 @@ bool CCAppClient::Connect(const wxString& host, const wxString& service, // are testing whether or not there is a // server, and the user shouldn't be // informed when we cannot find a server - mConnection = (CCAppClientConnection*)MakeConnection(host, service, topic); + mConnection = static_cast(MakeConnection(host, service, topic)); wxLog::SetLogLevel(oldLogLevel); return IsConnected(); } @@ -211,79 +184,72 @@ wxConnectionBase* CCAppClient::OnMakeConnection() return new CCAppClientConnection(this); } -void CCAppClient::DestroyConnection() { mConnection = nullptr; } - -CCAppClient::~CCAppClient() { Disconnect(); } // Server, Client, and Independent are all derived from HostAppInterface. // Mostly it's all boilerplate, with "smarts" done in the Make functions -class ServerSideHostAppInterface : public HostAppInterface { -public: - static std::unique_ptr - Make(CalChartApp* app, StartStopFunc_t serverStartStop, - StartStopFunc_t clientStartStop); +struct ServerSideHostAppInterface : public HostAppInterface { + static std::unique_ptr Make(CalChartApp* app, StartStopFunc_t serverStartStop, StartStopFunc_t clientStartStop); - virtual ~ServerSideHostAppInterface() { m_serverStartStop.second(); } + ServerSideHostAppInterface(std::unique_ptr server, + StartStopFunc_t serverStartStop, + StartStopFunc_t clientStartStop) + : HostAppInterface(serverStartStop, clientStartStop) + , mServer(std::move(server)) + { + } + virtual ~ServerSideHostAppInterface() override { m_serverStartStop.second(); } - virtual bool OnInit() + virtual bool OnInit() override { m_serverStartStop.first(); return true; } - virtual void OpenFile(const wxString& filename) + virtual void OpenFile(const wxString& filename) override { mServer->OpenFile(filename); } private: - ServerSideHostAppInterface(std::unique_ptr server, + std::unique_ptr mServer; +}; + +struct ClientSideHostAppInterface : public HostAppInterface { + static std::unique_ptr Make(StartStopFunc_t serverStartStop, StartStopFunc_t clientStartStop); + + ClientSideHostAppInterface(std::unique_ptr client, StartStopFunc_t serverStartStop, StartStopFunc_t clientStartStop) : HostAppInterface(serverStartStop, clientStartStop) - , mServer(std::move(server)) + , mClient(std::move(client)) { } + virtual ~ClientSideHostAppInterface() override { m_clientStartStop.second(); } - std::unique_ptr mServer; -}; - -class ClientSideHostAppInterface : public HostAppInterface { -public: - static std::unique_ptr - Make(StartStopFunc_t serverStartStop, StartStopFunc_t clientStartStop); - - virtual ~ClientSideHostAppInterface() { m_clientStartStop.second(); } - - virtual bool OnInit() + virtual bool OnInit() override { m_clientStartStop.first(); return false; } - virtual void OpenFile(const wxString& filename) + virtual void OpenFile(const wxString& filename) override { mClient->OpenFile(filename); } private: - ClientSideHostAppInterface(std::unique_ptr client, - StartStopFunc_t serverStartStop, - StartStopFunc_t clientStartStop) - : HostAppInterface(serverStartStop, clientStartStop) - , mClient(std::move(client)) - { - } - std::unique_ptr mClient; }; -class IndependentHostAppInterface : public HostAppInterface { -public: - static std::unique_ptr - Make(CalChartApp* app, StartStopFunc_t serverStartStop, - StartStopFunc_t clientStartStop); +struct IndependentHostAppInterface : public HostAppInterface { + static std::unique_ptr Make(CalChartApp* app, StartStopFunc_t serverStartStop, StartStopFunc_t clientStartStop); + IndependentHostAppInterface(CalChartApp* app, StartStopFunc_t serverStartStop, + StartStopFunc_t clientStartStop) + : HostAppInterface(serverStartStop, clientStartStop) + , mApp(app) + { + } virtual ~IndependentHostAppInterface() { m_serverStartStop.second(); } virtual bool OnInit() @@ -295,36 +261,25 @@ class IndependentHostAppInterface : public HostAppInterface { virtual void OpenFile(const wxString& filename) { mApp->OpenFile(filename); } private: - IndependentHostAppInterface(CalChartApp* app, StartStopFunc_t serverStartStop, - StartStopFunc_t clientStartStop) - : HostAppInterface(serverStartStop, clientStartStop) - , mApp(app) - { - } - CalChartApp* mApp; }; // Linch-pin function that ties everything together std::unique_ptr -HostAppInterface::Make(CalChartApp* app, StartStopFunc_t serverStartStop, - StartStopFunc_t clientStartStop) +HostAppInterface::Make(CalChartApp* app, StartStopFunc_t serverStartStop, StartStopFunc_t clientStartStop) { #ifdef __APPLE__ - return IndependentHostAppInterface::Make(app, serverStartStop, - clientStartStop); + return IndependentHostAppInterface::Make(app, serverStartStop, clientStartStop); #else auto client = ClientSideHostAppInterface::Make(serverStartStop, clientStartStop); if (client) { return client; } - return ServerSideHostAppInterface::Make(app, serverStartStop, - clientStartStop); + return ServerSideHostAppInterface::Make(app, serverStartStop, clientStartStop); #endif } -HostAppInterface::HostAppInterface(StartStopFunc_t serverStartStop, - StartStopFunc_t clientStartStop) +HostAppInterface::HostAppInterface(StartStopFunc_t serverStartStop, StartStopFunc_t clientStartStop) : m_serverStartStop(serverStartStop) , m_clientStartStop(clientStartStop) { @@ -333,14 +288,11 @@ HostAppInterface::HostAppInterface(StartStopFunc_t serverStartStop, HostAppInterface::~HostAppInterface() { } std::unique_ptr -ServerSideHostAppInterface::Make(CalChartApp* app, - StartStopFunc_t serverStartStop, - StartStopFunc_t clientStartStop) +ServerSideHostAppInterface::Make(CalChartApp* app, StartStopFunc_t serverStartStop, StartStopFunc_t clientStartStop) { auto server = CCAppServer::MakeServer(app); if (server != nullptr) { - return std::unique_ptr{ new ServerSideHostAppInterface( - std::move(server), serverStartStop, clientStartStop) }; + return std::make_unique(std::move(server), serverStartStop, clientStartStop); } return nullptr; } @@ -351,18 +303,13 @@ ClientSideHostAppInterface::Make(StartStopFunc_t serverStartStop, { auto client = CCAppClient::MakeClient(); if (client != nullptr) { - return std::unique_ptr{ new ClientSideHostAppInterface( - std::move(client), serverStartStop, clientStartStop) }; + return std::make_unique(std::move(client), serverStartStop, clientStartStop); } return nullptr; } std::unique_ptr -IndependentHostAppInterface::Make(CalChartApp* app, - StartStopFunc_t serverStartStop, - StartStopFunc_t clientStartStop) +IndependentHostAppInterface::Make(CalChartApp* app, StartStopFunc_t serverStartStop, StartStopFunc_t clientStartStop) { - return std::unique_ptr{ - new IndependentHostAppInterface(app, serverStartStop, clientStartStop) - }; + return std::make_unique(app, serverStartStop, clientStartStop); } diff --git a/src/single_instance_ipc.h b/src/HostAppInterface.h similarity index 67% rename from src/single_instance_ipc.h rename to src/HostAppInterface.h index fc4db15e..d1b16eb5 100644 --- a/src/single_instance_ipc.h +++ b/src/HostAppInterface.h @@ -1,4 +1,9 @@ #pragma once +/* + * HostAppInterface.cpp + * Object for communicating across different app instances + */ + #include #include @@ -15,18 +20,14 @@ using StartStopFunc_t = std::pair, std::function>; // to call. class HostAppInterface { public: - static std::unique_ptr - Make(CalChartApp* app, StartStopFunc_t serverStartStop, - StartStopFunc_t clientStartStop); - + static std::unique_ptr Make(CalChartApp* app, StartStopFunc_t serverStartStop, StartStopFunc_t clientStartStop); virtual ~HostAppInterface(); // calls the exit function virtual bool OnInit() = 0; virtual void OpenFile(const wxString& filename) = 0; protected: - HostAppInterface(StartStopFunc_t serverStartStop, - StartStopFunc_t clientStartStop); + HostAppInterface(StartStopFunc_t serverStartStop, StartStopFunc_t clientStartStop); StartStopFunc_t m_serverStartStop; StartStopFunc_t m_clientStartStop; }; diff --git a/src/PreferencesDrawingSetup.cpp b/src/PreferencesDrawingSetup.cpp index 63b85d4b..0ac86fdc 100644 --- a/src/PreferencesDrawingSetup.cpp +++ b/src/PreferencesDrawingSetup.cpp @@ -28,7 +28,7 @@ #include "ContinuityComposerDialog.h" #include "PreferencesUtils.h" #include "cc_drawcommand.h" -#include "cc_shapes.h" +#include "CalChartShapes.h" #include "cc_sheet.h" #include "confgr.h" #include "cont.h" diff --git a/src/PreferencesPSPrintingSetup.cpp b/src/PreferencesPSPrintingSetup.cpp index 3a11e5d2..874ffaa7 100644 --- a/src/PreferencesPSPrintingSetup.cpp +++ b/src/PreferencesPSPrintingSetup.cpp @@ -28,7 +28,7 @@ #include "ContinuityComposerDialog.h" #include "PreferencesUtils.h" #include "cc_drawcommand.h" -#include "cc_shapes.h" +#include "CalChartShapes.h" #include "cc_sheet.h" #include "confgr.h" #include "cont.h" diff --git a/src/PreferencesShowModeSetup.cpp b/src/PreferencesShowModeSetup.cpp index 33e13180..949f18d3 100644 --- a/src/PreferencesShowModeSetup.cpp +++ b/src/PreferencesShowModeSetup.cpp @@ -28,7 +28,7 @@ #include "ContinuityComposerDialog.h" #include "PreferencesUtils.h" #include "cc_drawcommand.h" -#include "cc_shapes.h" +#include "CalChartShapes.h" #include "cc_sheet.h" #include "confgr.h" #include "cont.h" diff --git a/src/print_ps_dialog.cpp b/src/PrintPostScriptDialog.cpp similarity index 78% rename from src/print_ps_dialog.cpp rename to src/PrintPostScriptDialog.cpp index 673d30ca..6fc5aa50 100644 --- a/src/print_ps_dialog.cpp +++ b/src/PrintPostScriptDialog.cpp @@ -1,6 +1,5 @@ - /* - * print_ps_dialog.h + * PrintPostScriptDialog.cpp * Dialox box for printing postscript */ @@ -21,7 +20,7 @@ along with this program. If not, see . */ -#include "print_ps_dialog.h" +#include "PrintPostScriptDialog.h" #include "CalChartDoc.h" #include "basic_ui.h" @@ -37,12 +36,16 @@ #include #include -enum { CC_PRINT_ORIENT_PORTRAIT, - CC_PRINT_ORIENT_LANDSCAPE }; +enum { + CC_PRINT_ORIENT_PORTRAIT, + CC_PRINT_ORIENT_LANDSCAPE +}; -enum { CC_PRINT_ACTION_PRINTER, +enum { + CC_PRINT_ACTION_PRINTER, CC_PRINT_ACTION_FILE, - CC_PRINT_ACTION_PREVIEW }; + CC_PRINT_ACTION_PREVIEW +}; enum { CC_PRINT_BUTTON_PRINT = 1000, @@ -55,43 +58,55 @@ EVT_BUTTON(CC_PRINT_BUTTON_SELECT, PrintPostScriptDialog::ShowPrintSelect) EVT_BUTTON(CC_PRINT_BUTTON_RESET_DEFAULTS, PrintPostScriptDialog::ResetDefaults) END_EVENT_TABLE() +IMPLEMENT_CLASS(PrintPostScriptDialog, wxDialog) + +PrintPostScriptDialog::PrintPostScriptDialog() { Init(); } + +PrintPostScriptDialog::PrintPostScriptDialog( + const CalChartDoc* show, wxFrame* parent, wxWindowID id, + const wxString& caption, const wxPoint& pos, const wxSize& size, long style) + : mShow(NULL) +{ + Init(); + + Create(show, parent, id, caption, pos, size, style); +} + +PrintPostScriptDialog::~PrintPostScriptDialog() { } + +void PrintPostScriptDialog::Init() { } + void PrintPostScriptDialog::PrintShow(const CalChartConfiguration& config) { - wxString s; #ifdef PRINT__RUN_CMD wxString buf; #endif - bool overview; - long minyards; + long minyards; text_minyards->GetValue().ToLong(&minyards); if (minyards < 10 || minyards > 100) { - wxLogError(wxT( - "Yards entered invalid. Please enter a number between 10 and 100.")); + wxLogError("Yards entered invalid. Please enter a number between 10 and 100."); return; } - overview = config.Get_PrintPSOverview(); + auto overview = config.Get_PrintPSOverview(); + wxString s; switch (config.Get_PrintPSModes()) { case CC_PRINT_ACTION_PREVIEW: { #ifdef PRINT__RUN_CMD - s = wxFileName::CreateTempFileName(wxT("cc_")); - buf.sprintf(wxT("%s %s \"%s\""), config.Get_PrintViewCmd().c_str(), - config.Get_PrintViewCmd().c_str(), s.c_str()); + s = wxFileName::CreateTempFileName("cc_"); + buf.sprintf("%s %s \"%s\"", config.Get_PrintViewCmd().c_str(), config.Get_PrintViewCmd().c_str(), s.c_str()); #endif } break; case CC_PRINT_ACTION_FILE: - s = wxFileSelector(wxT("Print to file"), wxEmptyString, wxEmptyString, - wxEmptyString, wxT("*.ps"), - wxFD_SAVE | wxFD_OVERWRITE_PROMPT); + s = wxFileSelector("Print to file", wxEmptyString, wxEmptyString, wxEmptyString, "*.ps", wxFD_SAVE | wxFD_OVERWRITE_PROMPT); if (s.empty()) return; break; case CC_PRINT_ACTION_PRINTER: { #ifdef PRINT__RUN_CMD - s = wxFileName::CreateTempFileName(wxT("cc_")); - buf.sprintf(wxT("%s %s \"%s\""), config.Get_PrintCmd().c_str(), - config.Get_PrintOpts().c_str(), s.c_str()); + s = wxFileName::CreateTempFileName("cc_"); + buf.sprintf("%s %s \"%s\"", config.Get_PrintCmd().c_str(), config.Get_PrintOpts().c_str(), s.c_str()); #else #endif } break; @@ -100,13 +115,9 @@ void PrintPostScriptDialog::PrintShow(const CalChartConfiguration& config) } std::ostringstream buffer; - - int n = mShow->PrintToPS(buffer, overview, static_cast(minyards), mIsSheetPicked, config); + auto n = mShow->PrintToPS(buffer, overview, static_cast(minyards), mIsSheetPicked, config); // stream to file: - { - wxFFileOutputStream outstream(s); - outstream.Write(buffer.str().c_str(), buffer.str().size()); - } + wxFFileOutputStream(s).Write(buffer.str().c_str(), buffer.str().size()); #ifdef PRINT__RUN_CMD switch (config.Get_PrintPSModes()) { @@ -120,33 +131,24 @@ void PrintPostScriptDialog::PrintShow(const CalChartConfiguration& config) #endif wxString tempbuf; - tempbuf.sprintf(wxT("Printed %d pages."), n); + tempbuf.sprintf("Printed %d pages.", n); (void)wxMessageBox(tempbuf, mShow->GetTitle()); } void PrintPostScriptDialog::ShowPrintSelect(wxCommandEvent&) { wxArrayString choices; - for (auto sheet = mShow->GetSheetBegin(); - sheet != mShow->GetSheetEnd(); ++sheet) { - choices.Add(sheet->GetName()); - } - wxMultiChoiceDialog dialog(this, wxT("Choose which pages to print"), - wxT("Pagest to Print"), choices); - wxArrayInt markedChoices; - for (auto sheet = mShow->GetSheetBegin(); - sheet != mShow->GetSheetEnd(); ++sheet) { - if (mIsSheetPicked.count(std::distance(mShow->GetSheetBegin(), sheet))) { - markedChoices.Add(static_cast(std::distance(mShow->GetSheetBegin(), sheet))); - } + for (auto&& sheet : mShow->GetSheets()) { + choices.Add(sheet.GetName()); } + wxMultiChoiceDialog dialog(this, "Choose which pages to print", "Pages to Print", choices); + wxArrayInt markedChoices(mIsSheetPicked.begin(), mIsSheetPicked.end()); dialog.SetSelections(markedChoices); if (dialog.ShowModal() == wxID_OK) { - wxArrayInt selections = dialog.GetSelections(); mIsSheetPicked.clear(); // build up a set of what's been selected: - for (size_t n = 0; n < selections.GetCount(); ++n) - mIsSheetPicked.insert(selections[n]); + for (auto&& selection : dialog.GetSelections()) + mIsSheetPicked.insert(selection); } } @@ -171,35 +173,17 @@ void PrintPostScriptDialog::ResetDefaults(wxCommandEvent&) TransferDataToWindow(); } -IMPLEMENT_CLASS(PrintPostScriptDialog, wxDialog) - -PrintPostScriptDialog::PrintPostScriptDialog() { Init(); } - -PrintPostScriptDialog::PrintPostScriptDialog( - const CalChartDoc* show, wxFrame* parent, wxWindowID id, - const wxString& caption, const wxPoint& pos, const wxSize& size, long style) - : mShow(NULL) -{ - Init(); - - Create(show, parent, id, caption, pos, size, style); -} - -PrintPostScriptDialog::~PrintPostScriptDialog() { } - -void PrintPostScriptDialog::Init() { } - bool PrintPostScriptDialog::Create(const CalChartDoc* show, wxFrame* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style) { - if (!wxDialog::Create(parent, id, caption, pos, size, style)) + if (!wxDialog::Create(parent, id, caption, pos, size, style)) { return false; + } mShow = show; - for (auto sheet = mShow->GetSheetBegin(); - sheet != mShow->GetSheetEnd(); ++sheet) { - mIsSheetPicked.insert(std::distance(mShow->GetSheetBegin(), sheet)); + for (auto i = 0; i < mShow->GetNumSheets(); ++i) { + mIsSheetPicked.insert(i); } CreateControls(); @@ -259,13 +243,13 @@ void PrintPostScriptDialog::CreateControls() #endif HStack(sizer, [this](auto sizer) { - wxString orientation[] = { wxT("Portrait"), wxT("Landscape") }; - radio_orient = new wxRadioBox(this, wxID_ANY, wxT("&Orientation:"), wxDefaultPosition, wxDefaultSize, sizeof(orientation) / sizeof(wxString), orientation); + wxString orientation[] = { "Portrait", "Landscape" }; + radio_orient = new wxRadioBox(this, wxID_ANY, "&Orientation:", wxDefaultPosition, wxDefaultSize, sizeof(orientation) / sizeof(wxString), orientation); sizer->Add(radio_orient, 0, wxALL, 5); #ifdef PRINT__RUN_CMD - wxString print_modes[] = { wxT("Send to Printer"), wxT("Print to File"), wxT("Preview Only") }; + wxString print_modes[] = { "Send to Printer", "Print to File", "Preview Only" }; #else - wxString print_modes[] = { wxT("Send to Printer"), wxT("Print to File") }; + wxString print_modes[] = { "Send to Printer", "Print to File" }; #endif radio_method = new wxRadioBox(this, -1, "Post&Script:", wxDefaultPosition, wxDefaultSize, sizeof(print_modes) / sizeof(wxString), print_modes); sizer->Add(radio_method, 0, wxALL, 5); @@ -337,15 +321,15 @@ bool PrintPostScriptDialog::TransferDataToWindow() } wxString buf; - buf.Printf(wxT("%.2f"), config.Get_PageOffsetX()); + buf.Printf("%.2f", config.Get_PageOffsetX()); text_x->SetValue(buf); - buf.Printf(wxT("%.2f"), config.Get_PageOffsetY()); + buf.Printf("%.2f", config.Get_PageOffsetY()); text_y->SetValue(buf); - buf.Printf(wxT("%.2f"), config.Get_PageWidth()); + buf.Printf("%.2f", config.Get_PageWidth()); text_width->SetValue(buf); - buf.Printf(wxT("%.2f"), config.Get_PageHeight()); + buf.Printf("%.2f", config.Get_PageHeight()); text_height->SetValue(buf); - buf.Printf(wxT("%.2f"), config.Get_PaperLength()); + buf.Printf("%.2f", config.Get_PaperLength()); text_length->SetValue(buf); return true; } diff --git a/src/print_ps_dialog.h b/src/PrintPostScriptDialog.h similarity index 91% rename from src/print_ps_dialog.h rename to src/PrintPostScriptDialog.h index a1a74e65..e9e96b28 100644 --- a/src/print_ps_dialog.h +++ b/src/PrintPostScriptDialog.h @@ -1,5 +1,5 @@ /* - * print_ps_dialog.h + * PrintPostScriptDialog.h * Dialox box for printing postscript */ @@ -37,7 +37,8 @@ class PrintPostScriptDialog : public wxDialog { public: PrintPostScriptDialog(); - PrintPostScriptDialog(const CalChartDoc* doc, wxFrame* parent, + PrintPostScriptDialog(const CalChartDoc* doc, + wxFrame* parent, wxWindowID id = wxID_ANY, const wxString& caption = wxT("Print Dialog"), const wxPoint& pos = wxDefaultPosition, @@ -47,7 +48,8 @@ class PrintPostScriptDialog : public wxDialog { void Init(); - bool Create(const CalChartDoc* show, wxFrame* parent, + bool Create(const CalChartDoc* show, + wxFrame* parent, wxWindowID id = wxID_ANY, const wxString& caption = wxT("Print Dialog"), const wxPoint& pos = wxDefaultPosition, @@ -68,7 +70,7 @@ class PrintPostScriptDialog : public wxDialog { void PrintShow(const CalChartConfiguration& config); private: - const CalChartDoc* mShow; + CalChartDoc const* mShow; wxTextCtrl* text_cmd; #ifdef PRINT__RUN_CMD wxTextCtrl *text_opts, *text_view_cmd, *text_view_opts; diff --git a/src/TransitionSolverView.cpp b/src/TransitionSolverView.cpp index 6ad2d0e7..877bd0ce 100644 --- a/src/TransitionSolverView.cpp +++ b/src/TransitionSolverView.cpp @@ -47,5 +47,5 @@ void TransitionSolverView::SelectMarchers(std::set marchers) for (unsigned marcher : marchers) { selectionList.insert(marcher); } - GetDocument()->GetCommandProcessor()->Submit(static_cast(GetDocument())->Create_SetSelectionCommand(selectionList).release()); + GetDocument()->GetCommandProcessor()->Submit(static_cast(GetDocument())->Create_SetSelectionListCommand(selectionList).release()); } diff --git a/src/background_image.cpp b/src/background_image.cpp deleted file mode 100644 index 8cdf0e2a..00000000 --- a/src/background_image.cpp +++ /dev/null @@ -1,268 +0,0 @@ -/* - * main_ui.cpp - * Handle Background Image - */ - -/* - Copyright (C) 1995-2011 Garrick Brian Meeker, Richard Michael Powell - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - */ - -#include "background_image.h" -#include - -BackgroundImage::BackgroundImage(const wxImage& image, int x, int y, int scaled_width, int scaled_height) - : mImage(image) - , mBitmapX(x) - , mBitmapY(y) - , // always adjust when we get created - mBackgroundAdjustType(kLast) -{ - mBitmap = wxBitmap(mImage.Scale(scaled_width, scaled_height, wxIMAGE_QUALITY_HIGH)); -} - -bool BackgroundImage::MouseClickIsHit(const wxMouseEvent& event, - const wxDC& dc) const -{ - auto point = event.GetPosition(); - auto x = dc.DeviceToLogicalX(point.x); - auto y = dc.DeviceToLogicalY(point.y); - - // where are we? - int height = mBitmap.GetHeight(); - int width = mBitmap.GetWidth(); - int middleX = mBitmapX + width / 2; - int middleY = mBitmapY + height / 2; - int where; - for (where = kUpperLeft; where < kLast; ++where) { - if (where == kMove) { - wxRect bitmapSquare(wxPoint(mBitmapX, mBitmapY), - wxSize(mBitmap.GetWidth(), mBitmap.GetHeight())); - if (bitmapSquare.Contains(x, y)) { - return true; - } - } - int offsetX = (where % 3) - 1; - int offsetY = (where / 3) - 1; - wxRect grabPoint( - middleX + (offsetX * (width / 2 + dc.DeviceToLogicalXRel(kCircleSize / 3))) - dc.DeviceToLogicalXRel(kCircleSize), - middleY + (offsetY * (height / 2 + dc.DeviceToLogicalYRel(kCircleSize / 3))) - dc.DeviceToLogicalXRel(kCircleSize), - dc.DeviceToLogicalXRel(kCircleSize * 2), - dc.DeviceToLogicalXRel(kCircleSize * 2)); - - if (grabPoint.Contains(x, y)) { - return true; - } - } - return false; -} - -void BackgroundImage::OnMouseLeftDown(const wxMouseEvent& event, - const wxDC& dc) -{ - auto point = event.GetPosition(); - auto x = dc.DeviceToLogicalX(point.x); - auto y = dc.DeviceToLogicalY(point.y); - - // where are we? - int height = mBitmap.GetHeight(); - int width = mBitmap.GetWidth(); - int middleX = mBitmapX + width / 2; - int middleY = mBitmapY + height / 2; - int where; - for (where = kUpperLeft; where < kLast; ++where) { - if (where == kMove) - continue; - int offsetX = (where % 3) - 1; - int offsetY = (where / 3) - 1; - wxRect grabPoint( - middleX + (offsetX * (width / 2 + dc.DeviceToLogicalXRel(kCircleSize / 3))) - dc.DeviceToLogicalXRel(kCircleSize), - middleY + (offsetY * (height / 2 + dc.DeviceToLogicalYRel(kCircleSize / 3))) - dc.DeviceToLogicalXRel(kCircleSize), - dc.DeviceToLogicalXRel(kCircleSize * 2), - dc.DeviceToLogicalXRel(kCircleSize * 2)); - - if (grabPoint.Contains(x, y)) { - break; - } - } - mBackgroundAdjustType = static_cast(where); - if (mBackgroundAdjustType == kLast) { - wxRect bitmapSquare(wxPoint(mBitmapX, mBitmapY), - wxSize(mBitmap.GetWidth(), mBitmap.GetHeight())); - if (bitmapSquare.Contains(x, y)) { - mBackgroundAdjustType = kMove; - } - } - if (mBackgroundAdjustType != kLast) { - mScaleAndMove.reset(new CalculateScaleAndMove( - wxPoint(x, y), mBitmapX, mBitmapY, mBitmap.GetWidth(), - mBitmap.GetHeight(), mBackgroundAdjustType)); - } -} - -std::array BackgroundImage::OnMouseLeftUp(const wxMouseEvent& event, const wxDC& dc) -{ - if (mScaleAndMove) { - // done moving, lock down the picture and make it pretty: - mBitmap = wxBitmap(mImage.Scale(mBitmap.GetWidth(), mBitmap.GetHeight(), - wxIMAGE_QUALITY_HIGH)); - std::array data{ { mBitmapX, mBitmapY, mBitmap.GetWidth(), mBitmap.GetHeight() } }; - mScaleAndMove.reset(); - mBackgroundAdjustType = kLast; - return data; - } - return { { 0, 0, 0, 0 } }; -} - -void BackgroundImage::OnMouseMove(const wxMouseEvent& event, const wxDC& dc) -{ - auto point = event.GetPosition(); - auto x = dc.DeviceToLogicalX(point.x); - auto y = dc.DeviceToLogicalY(point.y); - - if (event.Dragging() && event.LeftIsDown() && mScaleAndMove) { - wxCoord width = mBitmap.GetWidth(); - wxCoord height = mBitmap.GetHeight(); - (*mScaleAndMove)(x, y, mBitmapX, mBitmapY, width, height); - mBitmap = wxBitmap(mImage.Scale(width, height)); - } -} - -void BackgroundImage::OnPaint(wxDC& dc, bool drawPicAdjustDots, bool selected) const -{ - dc.DrawBitmap(mBitmap, mBitmapX, mBitmapY, true); - if (drawPicAdjustDots) { - // draw guide dots - int height = mBitmap.GetHeight(); - int width = mBitmap.GetWidth(); - int middleX = mBitmapX + width / 2; - int middleY = mBitmapY + height / 2; - dc.SetBrush(*wxBLUE_BRUSH); - dc.SetPen(*wxBLUE_PEN); - for (int where = kUpperLeft; where < kLast; ++where) { - dc.SetBrush(*wxBLUE_BRUSH); - if (where == kMove) - continue; - int offsetX = (where % 3) - 1; - int offsetY = (where / 3) - 1; - if (mBackgroundAdjustType == where) { - dc.SetBrush(*wxRED_BRUSH); - } - dc.DrawCircle( - middleX + (offsetX * (width / 2 + dc.DeviceToLogicalXRel(kCircleSize / 3))), - middleY + (offsetY * (height / 2 + dc.DeviceToLogicalYRel(kCircleSize / 3))), - dc.DeviceToLogicalXRel(kCircleSize)); - if (selected && mBackgroundAdjustType != where) { - dc.SetBrush(*wxWHITE_BRUSH); - dc.DrawCircle( - middleX + (offsetX * (width / 2 + dc.DeviceToLogicalXRel(kCircleSize / 3))), - middleY + (offsetY * (height / 2 + dc.DeviceToLogicalYRel(kCircleSize / 3))), - dc.DeviceToLogicalXRel(kCircleSize * 0.75)); - } - } - } -} - -BackgroundImage::CalculateScaleAndMove::CalculateScaleAndMove( - const wxPoint& startClick, wxCoord x, wxCoord y, wxCoord width, wxCoord height, - eBackgroundAdjustType adjustType) - : mStartClick(startClick) - , mLeft(x) - , mTop(y) - , mRight(x + width) - , mBottom(y + height) - , mAspectRatio(width / static_cast(height)) - , mAdjustType(adjustType) -{ -} - -void BackgroundImage::CalculateScaleAndMove:: -operator()(wxCoord x, wxCoord y, wxCoord& topX, wxCoord& topY, wxCoord& width, - wxCoord& height) -{ - switch (mAdjustType) { - case kUpper: - // for upper: make sure we never go lower than the bottom - // don't modify where the top is, but adjust the heigth - if (y < mBottom) { - topY = y; - height = mBottom - y; - } - break; - case kLower: - // for lower: make sure we never go higher than the top - // don't modify where the top is, but adjust the heigth - if (topY < y) - height = y - topY; - break; - case kLeft: - if (x < mRight) { - topX = x; - width = mRight - x; - } - break; - case kRight: - if (topX < x) - width = x - topX; - break; - // we should keep the aspect ratio - case kUpperLeft: - x = std::max(x, mRight - std::abs(y - mBottom) * mAspectRatio / 1.0); - y = std::max(y, mBottom - std::abs(x - mRight) * 1.0 / mAspectRatio); - if (x < mRight) { - topX = x; - width = mRight - x; - } - if (y < mBottom) { - topY = y; - height = mBottom - y; - } - break; - case kUpperRight: - x = std::min(x, mLeft + std::abs(y - mBottom) * mAspectRatio / 1.0); - y = std::max(y, mBottom - std::abs(x - mLeft) * 1.0 / mAspectRatio); - if (topX < x) - width = x - topX; - if (y < mBottom) { - topY = y; - height = mBottom - y; - } - break; - case kLowerLeft: - x = std::max(x, mRight - std::abs(y - mTop) * mAspectRatio / 1.0); - y = std::min(y, mTop + std::abs(x - mRight) * 1.0 / mAspectRatio); - if (x < mRight) { - topX = x; - width = mRight - x; - } - if (topY < y) - height = y - topY; - break; - case kLowerRight: - x = std::min(x, mLeft + std::abs(y - mTop) * mAspectRatio / 1.0); - y = std::min(y, mTop + std::abs(x - mLeft) * 1.0 / mAspectRatio); - if (topX < x) - width = x - topX; - if (topY < y) - height = y - topY; - break; - case kMove: - topX = mLeft + (x - mStartClick.x); - topY = mTop + (y - mStartClick.y); - break; - default: - break; - } -} diff --git a/src/contgram.y b/src/contgram.y index 3d8a2788..7678455b 100644 --- a/src/contgram.y +++ b/src/contgram.y @@ -26,7 +26,7 @@ #include "cont.h" #include "parse.h" -#include "animate.h" +#include "CalChartAnimation.h" #include diff --git a/src/core/animate.cpp b/src/core/CalChartAnimation.cpp similarity index 81% rename from src/core/animate.cpp rename to src/core/CalChartAnimation.cpp index 553f9202..4adcdf33 100644 --- a/src/core/animate.cpp +++ b/src/core/CalChartAnimation.cpp @@ -1,5 +1,5 @@ /* - * animate.cpp + * CalChartAnimations.cpp * Classes for animating shows */ @@ -20,9 +20,10 @@ along with this program. If not, see . */ -#include "animate.h" -#include "animatecommand.h" -#include "animatecompile.h" +#include "CalChartAnimation.h" +#include "CalChartAnimationErrors.h" +#include "CalChartAnimationCommand.h" +#include "CalChartAnimationCompile.h" #include "cc_continuity.h" #include "cc_drawcommand.h" #include "cc_point.h" @@ -38,82 +39,14 @@ #include #include -namespace CalChart { - -AnimateDir AnimGetDirFromAngle(float ang) +template +constexpr auto toUType(E enumerator) { - ang = NormalizeAngle(ang); - // rotate angle by 22.5: - ang += 22.5; - size_t quadrant = ang / 45.0; - switch (quadrant) { - case 0: - return ANIMDIR_N; - case 1: - return ANIMDIR_NW; - case 2: - return ANIMDIR_W; - case 3: - return ANIMDIR_SW; - case 4: - return ANIMDIR_S; - case 5: - return ANIMDIR_SE; - case 6: - return ANIMDIR_E; - case 7: - return ANIMDIR_NE; - case 8: - return ANIMDIR_N; - } - return ANIMDIR_N; + return static_cast>(enumerator); } -// make things copiable -AnimateSheet::AnimateSheet(AnimateSheet const& other) - : mPoints(other.mPoints) - , mCommands(other.mCommands.size()) - , name(other.name) - , numbeats(other.numbeats) -{ - std::transform(other.mCommands.cbegin(), other.mCommands.cend(), mCommands.begin(), [](auto&& a) { - AnimateCommands result(a.size()); - std::transform(a.cbegin(), a.cend(), result.begin(), [](auto&& b) { - return b->clone(); - }); - return result; - }); -} -AnimateSheet& AnimateSheet::operator=(AnimateSheet other) -{ - swap(other); - return *this; -} - -AnimateSheet::AnimateSheet(AnimateSheet&& other) noexcept - : mPoints(std::move(other.mPoints)) - , mCommands(std::move(other.mCommands)) - , name(std::move(other.name)) - , numbeats(std::move(other.numbeats)) -{ -} - -AnimateSheet& AnimateSheet::operator=(AnimateSheet&& other) noexcept -{ - AnimateSheet tmp{ std::move(other) }; - swap(tmp); - return *this; -} - -void AnimateSheet::swap(AnimateSheet& other) noexcept -{ - using std::swap; - swap(mPoints, other.mPoints); - swap(mCommands, other.mCommands); - swap(name, other.name); - swap(numbeats, other.numbeats); -} +namespace CalChart { Animation::Animation(const Show& show) : mPoints(show.GetNumPoints()) @@ -139,7 +72,7 @@ Animation::Animation(const Show& show) // Now parse continuity AnimationErrors errors; - std::vector theCommands(mPoints.size()); + std::vector theCommands(mPoints.size()); for (auto& current_symbol : k_symbols) { if (curr_sheet->ContinuityInUse(current_symbol)) { auto& current_continuity = curr_sheet->GetContinuityBySymbol(current_symbol); @@ -153,7 +86,7 @@ Animation::Animation(const Show& show) #endif for (unsigned j = 0; j < mPoints.size(); j++) { if (curr_sheet->GetSymbol(j) == current_symbol) { - theCommands[j] = AnimateCompile::Compile(show, variablesStates, errors, curr_sheet, j, current_symbol, continuity); + theCommands[j] = AnimationCompile::Compile(show, variablesStates, errors, curr_sheet, j, current_symbol, continuity); } } } @@ -161,7 +94,7 @@ Animation::Animation(const Show& show) // Handle points that don't have continuity (shouldn't happen) for (unsigned j = 0; j < mPoints.size(); j++) { if (theCommands[j].empty()) { - theCommands[j] = AnimateCompile::Compile(show, variablesStates, errors, curr_sheet, j, MAX_NUM_SYMBOLS, {}); + theCommands[j] = AnimationCompile::Compile(show, variablesStates, errors, curr_sheet, j, MAX_NUM_SYMBOLS, {}); } } if (errors.AnyErrors()) { @@ -271,11 +204,6 @@ void Animation::GotoBeat(unsigned i) } void Animation::GotoSheet(unsigned i) -{ - GotoAnimationSheet(mAnimSheetIndices[i]); -} - -void Animation::GotoAnimationSheet(unsigned i) { mCurrentSheetNumber = i; RefreshSheet(); @@ -331,7 +259,7 @@ void Animation::FindAllCollisions() for (unsigned i = 0; i < mPoints.size(); i++) { for (unsigned j = i + 1; j < mPoints.size(); j++) { auto collisionResult = mPoints[i].DetectCollision(mPoints[j]); - if (collisionResult) { + if (collisionResult != Coord::CollisionType::none) { if (!mCollisions.count({ i, mCurrentSheetNumber, mCurrentBeatNumber }) || mCollisions[{ i, mCurrentSheetNumber, mCurrentBeatNumber }] < collisionResult) { mCollisions[{ i, mCurrentSheetNumber, mCurrentBeatNumber }] = collisionResult; } @@ -361,7 +289,7 @@ Animation::animate_info_t Animation::GetAnimateInfo(int which) const { return { which, - mCollisions.count({ which, mCurrentSheetNumber, mCurrentBeatNumber }) ? mCollisions.find({ which, mCurrentSheetNumber, mCurrentBeatNumber })->second : Coord::COLLISION_NONE, + mCollisions.count({ which, mCurrentSheetNumber, mCurrentBeatNumber }) ? mCollisions.find({ which, mCurrentSheetNumber, mCurrentBeatNumber })->second : Coord::CollisionType::none, GetCommand(mCurrentSheetNumber, which).Direction(), GetCommand(mCurrentSheetNumber, which).RealDirection(), mPoints.at(which) }; @@ -375,7 +303,7 @@ std::vector Animation::GetAllAnimateInfo() const std::transform(points.begin(), points.end(), std::back_inserter(animates), [this](auto which) -> Animation::animate_info_t { return { which, - mCollisions.count({ which, mCurrentSheetNumber, mCurrentBeatNumber }) ? mCollisions.find({ which, mCurrentSheetNumber, mCurrentBeatNumber })->second : Coord::COLLISION_NONE, + mCollisions.count({ which, mCurrentSheetNumber, mCurrentBeatNumber }) ? mCollisions.find({ which, mCurrentSheetNumber, mCurrentBeatNumber })->second : Coord::CollisionType::none, GetCommand(mCurrentSheetNumber, which).Direction(), GetCommand(mCurrentSheetNumber, which).RealDirection(), mPoints.at(which) }; @@ -400,12 +328,12 @@ int Animation::GetTotalCurrentBeat() const return GetTotalNumberBeatsUpTo(mCurrentSheetNumber) + mCurrentBeatNumber; } -AnimateCommands Animation::GetCommands(unsigned whichSheet, unsigned whichPoint) const +AnimationCommands Animation::GetCommands(unsigned whichSheet, unsigned whichPoint) const { return mSheets.at(whichSheet).GetCommands(whichPoint); } -AnimateCommand& Animation::GetCommand(unsigned whichSheet, unsigned whichPoint) const +AnimationCommand& Animation::GetCommand(unsigned whichSheet, unsigned whichPoint) const { return *GetCommands(whichSheet, whichPoint).at(mCurrentCmdIndex.at(whichPoint)); } @@ -444,7 +372,7 @@ Animation::GetCurrentInfo() const each_string << "pt " << i << ": (" << info.mPosition.x << ", " << info.mPosition.y << "), dir=" << info.mDirection << ", realdir=" << info.mRealDirection - << (info.mCollision ? ", collision!" : ""); + << ((info.mCollision != CalChart::Coord::CollisionType::none) ? ", collision!" : ""); each.push_back(each_string.str()); } std::ostringstream output; @@ -454,12 +382,12 @@ Animation::GetCurrentInfo() const return std::pair>(output.str(), each); } -std::vector::const_iterator Animation::sheetsBegin() const +std::vector::const_iterator Animation::sheetsBegin() const { return mSheets.begin(); } -std::vector::const_iterator Animation::sheetsEnd() const +std::vector::const_iterator Animation::sheetsEnd() const { return mSheets.end(); } diff --git a/src/core/animate.h b/src/core/CalChartAnimation.h similarity index 57% rename from src/core/animate.h rename to src/core/CalChartAnimation.h index 80c49cbf..4066ef9a 100644 --- a/src/core/animate.h +++ b/src/core/CalChartAnimation.h @@ -1,6 +1,6 @@ #pragma once /* - * animate.h + * CalChartAnimation.h * Classes for animating shows */ @@ -22,94 +22,28 @@ */ #include "animate_types.h" -#include "cc_coord.h" +#include "CalChartAnimationSheet.h" +#include "CalChartCoord.h" -#include -#include #include #include -#include #include namespace CalChart { -AnimateDir AnimGetDirFromAngle(float ang); - -class AnimateCommand; -class AnimateSheet; +class AnimationCommand; +class AnimationSheet; struct DrawCommand; class Show; class AnimationErrors; -class ContProcedure; - -typedef std::function NotifyStatus; -typedef std::function& error_markers, size_t sheetnum, - const std::string& message)> - NotifyErrorList; - -using AnimateCommands = std::vector>; - -// AnimateSheet is a snapshot of CC_sheet -class AnimateSheet { -public: - AnimateSheet(const std::vector& thePoints, - const std::vector& theCommands, - const std::string& s, unsigned beats) - : mPoints(thePoints) - , mCommands(theCommands) - , name(s) - , numbeats(beats) - { - } - - // make things copiable - AnimateSheet(AnimateSheet const&); - AnimateSheet& operator=(AnimateSheet); - AnimateSheet(AnimateSheet&&) noexcept; - AnimateSheet& operator=(AnimateSheet&&) noexcept; - void swap(AnimateSheet&) noexcept; - - auto GetName() const { return name; } - auto GetNumBeats() const { return numbeats; } - auto GetPoints() const { return mPoints; } - auto GetCommands(int which) const { return mCommands.at(which); } - auto GetCommandsBegin(int which) const - { - return mCommands.at(which).begin(); - } - auto GetCommandsBeginIndex(int /*which*/) const - { - return std::vector::size_type(0); - } - auto GetCommandsEnd(int which) const - { - return mCommands.at(which).end(); - } - auto GetCommandsEndIndex(int which) const - { - return mCommands.at(which).size(); - } - auto GetCommandsAt(int which, int index) const - { - return mCommands.at(which).at(index); - } - -private: - std::vector mPoints; // should probably be const - std::vector mCommands; - std::string name; - unsigned numbeats; -}; class Animation { public: Animation(const Show& show); ~Animation(); - // Returns true if changes made void GotoSheet(unsigned i); - void GotoAnimationSheet(unsigned i); + // Returns true if changes made bool PrevSheet(); bool NextSheet(); @@ -121,7 +55,7 @@ class Animation { // For drawing: struct animate_info_t { int index; - int mCollision; + CalChart::Coord::CollisionType mCollision; AnimateDir mDirection; float mRealDirection; Coord mPosition; @@ -148,8 +82,8 @@ class Animation { std::vector GenPathToDraw(unsigned whichSheet, unsigned point, const Coord& offset) const; Coord EndPosition(unsigned whichSheet, unsigned point, const Coord& offset) const; - std::vector::const_iterator sheetsBegin() const; - std::vector::const_iterator sheetsEnd() const; + std::vector::const_iterator sheetsBegin() const; + std::vector::const_iterator sheetsEnd() const; private: void BeginCmd(unsigned i); @@ -158,11 +92,11 @@ class Animation { void RefreshSheet(); void FindAllCollisions(); - std::vector> GetCommands(unsigned whichSheet, unsigned whichPoint) const; - AnimateCommand& GetCommand(unsigned whichSheet, unsigned whichPoint) const; + std::vector> GetCommands(unsigned whichSheet, unsigned whichPoint) const; + AnimationCommand& GetCommand(unsigned whichSheet, unsigned whichPoint) const; // There are two types of data, the ones that are set when we are created, and the ones that modify over time. - std::vector mSheets; + std::vector mSheets; std::vector mPoints; // current position of these points std::vector mCurrentCmdIndex; // pointer to the current command in the sheet diff --git a/src/core/animatecommand.cpp b/src/core/CalChartAnimationCommand.cpp similarity index 65% rename from src/core/animatecommand.cpp rename to src/core/CalChartAnimationCommand.cpp index 8575abb4..1f91278d 100644 --- a/src/core/animatecommand.cpp +++ b/src/core/CalChartAnimationCommand.cpp @@ -23,24 +23,25 @@ #define _USE_MATH_DEFINES #include -#include "animatecommand.h" +#include "CalChartAnimationCommand.h" +#include "CalChartAnimation.h" #include "cc_drawcommand.h" #include "viewer_translate.h" namespace CalChart { -AnimateCommand::AnimateCommand(unsigned beats) +AnimationCommand::AnimationCommand(unsigned beats) : mNumBeats(beats) , mBeat(0) { } -DrawCommand AnimateCommand::GenCC_DrawCommand(const Coord& /*pt*/, const Coord& /*offset*/) const +DrawCommand AnimationCommand::GenCC_DrawCommand(Coord /*pt*/, Coord /*offset*/) const { return DrawCommand(); } -bool AnimateCommand::Begin(Coord& pt) +bool AnimationCommand::Begin(Coord& pt) { mBeat = 0; if (mNumBeats == 0) { @@ -50,7 +51,7 @@ bool AnimateCommand::Begin(Coord& pt) return true; } -bool AnimateCommand::End(Coord& pt) +bool AnimationCommand::End(Coord& pt) { mBeat = mNumBeats; if (mNumBeats == 0) { @@ -60,7 +61,7 @@ bool AnimateCommand::End(Coord& pt) return true; } -bool AnimateCommand::NextBeat(Coord&) +bool AnimationCommand::NextBeat(Coord&) { ++mBeat; if (mBeat >= mNumBeats) @@ -68,7 +69,7 @@ bool AnimateCommand::NextBeat(Coord&) return true; } -bool AnimateCommand::PrevBeat(Coord&) +bool AnimationCommand::PrevBeat(Coord&) { if (mBeat == 0) return false; @@ -78,31 +79,31 @@ bool AnimateCommand::PrevBeat(Coord&) } } -void AnimateCommand::ApplyForward(Coord&) { mBeat = mNumBeats; } +void AnimationCommand::ApplyForward(Coord&) { mBeat = mNumBeats; } -void AnimateCommand::ApplyBackward(Coord&) { mBeat = 0; } +void AnimationCommand::ApplyBackward(Coord&) { mBeat = 0; } -float AnimateCommand::MotionDirection() const { return RealDirection(); } +float AnimationCommand::MotionDirection() const { return RealDirection(); } -void AnimateCommand::ClipBeats(unsigned beats) { mNumBeats = beats; } +void AnimationCommand::ClipBeats(unsigned beats) { mNumBeats = beats; } -AnimateCommandMT::AnimateCommandMT(unsigned beats, float direction) - : AnimateCommand(beats) +AnimationCommandMT::AnimationCommandMT(unsigned beats, float direction) + : AnimationCommand(beats) , dir(AnimGetDirFromAngle(direction)) , realdir(direction) { } -std::unique_ptr AnimateCommandMT::clone() const +std::unique_ptr AnimationCommandMT::clone() const { - return std::make_unique(*this); + return std::make_unique(*this); } -AnimateDir AnimateCommandMT::Direction() const { return dir; } +AnimateDir AnimationCommandMT::Direction() const { return dir; } -float AnimateCommandMT::RealDirection() const { return realdir; } +float AnimationCommandMT::RealDirection() const { return realdir; } -nlohmann::json AnimateCommandMT::toOnlineViewerJSON(const Coord& start) const +nlohmann::json AnimationCommandMT::toOnlineViewerJSON(Coord start) const { nlohmann::json j; @@ -114,27 +115,27 @@ nlohmann::json AnimateCommandMT::toOnlineViewerJSON(const Coord& start) const return j; } -AnimateCommandMove::AnimateCommandMove(unsigned beats, Coord movement) - : AnimateCommandMT(beats, movement.Direction()) +AnimationCommandMove::AnimationCommandMove(unsigned beats, Coord movement) + : AnimationCommandMT(beats, movement.Direction()) , mVector(movement) { } -std::unique_ptr AnimateCommandMove::clone() const +std::unique_ptr AnimationCommandMove::clone() const { - return std::make_unique(*this); + return std::make_unique(*this); } -AnimateCommandMove::AnimateCommandMove(unsigned beats, Coord movement, +AnimationCommandMove::AnimationCommandMove(unsigned beats, Coord movement, float direction) - : AnimateCommandMT(beats, direction) + : AnimationCommandMT(beats, direction) , mVector(movement) { } -bool AnimateCommandMove::NextBeat(Coord& pt) +bool AnimationCommandMove::NextBeat(Coord& pt) { - bool b = AnimateCommand::NextBeat(pt); + bool b = AnimationCommand::NextBeat(pt); pt.x += (mNumBeats) ? ((long)mBeat * mVector.x / (short)mNumBeats) - ((long)(mBeat - 1) * mVector.x / (short)mNumBeats) : 0; @@ -144,9 +145,9 @@ bool AnimateCommandMove::NextBeat(Coord& pt) return b; } -bool AnimateCommandMove::PrevBeat(Coord& pt) +bool AnimationCommandMove::PrevBeat(Coord& pt) { - if (AnimateCommand::PrevBeat(pt)) { + if (AnimationCommand::PrevBeat(pt)) { pt.x += mNumBeats ? ((long)mBeat * mVector.x / (short)mNumBeats) - ((long)(mBeat + 1) * mVector.x / (short)mNumBeats) : 0; @@ -159,37 +160,37 @@ bool AnimateCommandMove::PrevBeat(Coord& pt) } } -void AnimateCommandMove::ApplyForward(Coord& pt) +void AnimationCommandMove::ApplyForward(Coord& pt) { - AnimateCommand::ApplyForward(pt); + AnimationCommand::ApplyForward(pt); pt += mVector; } -void AnimateCommandMove::ApplyBackward(Coord& pt) +void AnimationCommandMove::ApplyBackward(Coord& pt) { - AnimateCommand::ApplyBackward(pt); + AnimationCommand::ApplyBackward(pt); pt -= mVector; } -float AnimateCommandMove::MotionDirection() const +float AnimationCommandMove::MotionDirection() const { return mVector.Direction(); } -void AnimateCommandMove::ClipBeats(unsigned beats) +void AnimationCommandMove::ClipBeats(unsigned beats) { - AnimateCommand::ClipBeats(beats); + AnimationCommand::ClipBeats(beats); } DrawCommand -AnimateCommandMove::GenCC_DrawCommand(const Coord& pt, const Coord& offset) const +AnimationCommandMove::GenCC_DrawCommand(Coord pt, Coord offset) const { return { pt.x + offset.x, pt.y + offset.y, pt.x + mVector.x + offset.x, pt.y + mVector.y + offset.y }; } -nlohmann::json AnimateCommandMove::toOnlineViewerJSON(const Coord& start) const +nlohmann::json AnimationCommandMove::toOnlineViewerJSON(Coord start) const { nlohmann::json j; @@ -204,10 +205,10 @@ nlohmann::json AnimateCommandMove::toOnlineViewerJSON(const Coord& start) const return j; } -AnimateCommandRotate::AnimateCommandRotate(unsigned beats, Coord cntr, +AnimationCommandRotate::AnimationCommandRotate(unsigned beats, Coord cntr, float rad, float ang1, float ang2, bool backwards) - : AnimateCommand(beats) + : AnimationCommand(beats) , mOrigin(cntr) , mR(rad) , mAngStart(ang1) @@ -219,14 +220,14 @@ AnimateCommandRotate::AnimateCommandRotate(unsigned beats, Coord cntr, mFace = 90; } -std::unique_ptr AnimateCommandRotate::clone() const +std::unique_ptr AnimationCommandRotate::clone() const { - return std::make_unique(*this); + return std::make_unique(*this); } -bool AnimateCommandRotate::NextBeat(Coord& pt) +bool AnimationCommandRotate::NextBeat(Coord& pt) { - bool b = AnimateCommand::NextBeat(pt); + bool b = AnimationCommand::NextBeat(pt); float curr_ang = (mNumBeats ? ((mAngEnd - mAngStart) * mBeat / mNumBeats + mAngStart) : mAngStart) * M_PI / 180.0; @@ -235,9 +236,9 @@ bool AnimateCommandRotate::NextBeat(Coord& pt) return b; } -bool AnimateCommandRotate::PrevBeat(Coord& pt) +bool AnimationCommandRotate::PrevBeat(Coord& pt) { - if (AnimateCommand::PrevBeat(pt)) { + if (AnimationCommand::PrevBeat(pt)) { float curr_ang = (mNumBeats ? ((mAngEnd - mAngStart) * mBeat / mNumBeats + mAngStart) : mAngStart) * M_PI / 180.0; @@ -249,26 +250,26 @@ bool AnimateCommandRotate::PrevBeat(Coord& pt) } } -void AnimateCommandRotate::ApplyForward(Coord& pt) +void AnimationCommandRotate::ApplyForward(Coord& pt) { - AnimateCommand::ApplyForward(pt); + AnimationCommand::ApplyForward(pt); pt.x = RoundToCoordUnits(mOrigin.x + cos(mAngEnd * M_PI / 180.0) * mR); pt.y = RoundToCoordUnits(mOrigin.y - sin(mAngEnd * M_PI / 180.0) * mR); } -void AnimateCommandRotate::ApplyBackward(Coord& pt) +void AnimationCommandRotate::ApplyBackward(Coord& pt) { - AnimateCommand::ApplyBackward(pt); + AnimationCommand::ApplyBackward(pt); pt.x = RoundToCoordUnits(mOrigin.x + cos(mAngStart * M_PI / 180.0) * mR); pt.y = RoundToCoordUnits(mOrigin.y - sin(mAngStart * M_PI / 180.0) * mR); } -AnimateDir AnimateCommandRotate::Direction() const +AnimateDir AnimationCommandRotate::Direction() const { return AnimGetDirFromAngle(RealDirection()); } -float AnimateCommandRotate::RealDirection() const +float AnimationCommandRotate::RealDirection() const { float curr_ang = mNumBeats ? (mAngEnd - mAngStart) * mBeat / mNumBeats + mAngStart @@ -280,13 +281,13 @@ float AnimateCommandRotate::RealDirection() const } } -void AnimateCommandRotate::ClipBeats(unsigned beats) +void AnimationCommandRotate::ClipBeats(unsigned beats) { - AnimateCommand::ClipBeats(beats); + AnimationCommand::ClipBeats(beats); } DrawCommand -AnimateCommandRotate::GenCC_DrawCommand(const Coord& /*pt*/, const Coord& offset) const +AnimationCommandRotate::GenCC_DrawCommand(Coord /*pt*/, Coord offset) const { float start = (mAngStart < mAngEnd) ? mAngStart : mAngEnd; float end = (mAngStart < mAngEnd) ? mAngEnd : mAngStart; @@ -298,7 +299,7 @@ AnimateCommandRotate::GenCC_DrawCommand(const Coord& /*pt*/, const Coord& offset return { x_start, y_start, x_end, y_end, mOrigin.x + offset.x, mOrigin.y + offset.y }; } -nlohmann::json AnimateCommandRotate::toOnlineViewerJSON(const Coord& start) const +nlohmann::json AnimationCommandRotate::toOnlineViewerJSON(Coord start) const { nlohmann::json j; diff --git a/src/core/animatecommand.h b/src/core/CalChartAnimationCommand.h similarity index 56% rename from src/core/animatecommand.h rename to src/core/CalChartAnimationCommand.h index a3a6fc66..6920a975 100644 --- a/src/core/animatecommand.h +++ b/src/core/CalChartAnimationCommand.h @@ -1,7 +1,7 @@ #pragma once /* - * animate.h - * Classes for animating shows + * CalChartAnimationCommand.h + * Classes for the Animation Commands */ /* @@ -21,19 +21,31 @@ along with this program. If not, see . */ -#include "animate.h" +#include "animate_types.h" #include +/** + * Animation Commands + * Continuities can be broken down into 3 distinct types: + * MarkTime: A direction to be facing + * Moving: A vector along which to be moving (indicating how far to move each point) + * Rotate: A point which to rotate, radius, start and end angles + * AnimationCommand is an object that represents a particular part of a continuity. When we decompose + * continuities into these parts, we can then "transform" a point from a starting position to the end of the + * Animation by "stepping" it along each AnimationCommand + */ + namespace CalChart { struct DrawCommand; +struct Coord; -class AnimateCommand { +class AnimationCommand { public: - AnimateCommand(unsigned beats); - virtual ~AnimateCommand() = default; + AnimationCommand(unsigned beats); + virtual ~AnimationCommand() = default; - virtual std::unique_ptr clone() const = 0; + virtual std::unique_ptr clone() const = 0; // returns false if end of command virtual bool Begin(Coord& pt); @@ -56,43 +68,43 @@ class AnimateCommand { virtual MarchingStyle StepStyle() { return STYLE_HighStep; } // when we want to have the path drawn: - virtual DrawCommand GenCC_DrawCommand(const Coord& pt, const Coord& offset) const; + virtual DrawCommand GenCC_DrawCommand(Coord pt, Coord offset) const; /*! * @brief json that represent this movement in an Online Viewer '.viewer' file. * @param start The position at which this movement begins. */ - virtual nlohmann::json toOnlineViewerJSON(const Coord& start) const = 0; + virtual nlohmann::json toOnlineViewerJSON(Coord start) const = 0; protected: unsigned mNumBeats; unsigned mBeat; }; -class AnimateCommandMT : public AnimateCommand { +class AnimationCommandMT : public AnimationCommand { public: - AnimateCommandMT(unsigned beats, float direction); - virtual ~AnimateCommandMT() = default; + AnimationCommandMT(unsigned beats, float direction); + virtual ~AnimationCommandMT() = default; - std::unique_ptr clone() const override; + std::unique_ptr clone() const override; AnimateDir Direction() const override; float RealDirection() const override; - nlohmann::json toOnlineViewerJSON(const Coord& start) const override; + nlohmann::json toOnlineViewerJSON(Coord start) const override; protected: AnimateDir dir; float realdir; }; -class AnimateCommandMove : public AnimateCommandMT { +class AnimationCommandMove : public AnimationCommandMT { public: - AnimateCommandMove(unsigned beats, Coord movement); - AnimateCommandMove(unsigned beats, Coord movement, float direction); - virtual ~AnimateCommandMove() = default; + AnimationCommandMove(unsigned beats, Coord movement); + AnimationCommandMove(unsigned beats, Coord movement, float direction); + virtual ~AnimationCommandMove() = default; - std::unique_ptr clone() const override; + std::unique_ptr clone() const override; bool NextBeat(Coord& pt) override; bool PrevBeat(Coord& pt) override; @@ -103,21 +115,21 @@ class AnimateCommandMove : public AnimateCommandMT { float MotionDirection() const override; void ClipBeats(unsigned beats) override; - DrawCommand GenCC_DrawCommand(const Coord& pt, const Coord& offset) const override; + DrawCommand GenCC_DrawCommand(Coord pt, Coord offset) const override; - nlohmann::json toOnlineViewerJSON(const Coord& start) const override; + nlohmann::json toOnlineViewerJSON(Coord start) const override; private: Coord mVector; }; -class AnimateCommandRotate : public AnimateCommand { +class AnimationCommandRotate : public AnimationCommand { public: - AnimateCommandRotate(unsigned beats, Coord cntr, float rad, float ang1, + AnimationCommandRotate(unsigned beats, Coord cntr, float rad, float ang1, float ang2, bool backwards = false); - virtual ~AnimateCommandRotate() = default; + virtual ~AnimationCommandRotate() = default; - std::unique_ptr clone() const override; + std::unique_ptr clone() const override; bool NextBeat(Coord& pt) override; bool PrevBeat(Coord& pt) override; @@ -129,9 +141,9 @@ class AnimateCommandRotate : public AnimateCommand { float RealDirection() const override; void ClipBeats(unsigned beats) override; - DrawCommand GenCC_DrawCommand(const Coord& pt, const Coord& offset) const override; + DrawCommand GenCC_DrawCommand(Coord pt, Coord offset) const override; - nlohmann::json toOnlineViewerJSON(const Coord& start) const override; + nlohmann::json toOnlineViewerJSON(Coord start) const override; private: Coord mOrigin; diff --git a/src/core/animatecompile.cpp b/src/core/CalChartAnimationCompile.cpp similarity index 70% rename from src/core/animatecompile.cpp rename to src/core/CalChartAnimationCompile.cpp index 09efd1b8..3a506cc3 100644 --- a/src/core/animatecompile.cpp +++ b/src/core/CalChartAnimationCompile.cpp @@ -20,34 +20,15 @@ along with this program. If not, see . */ -#include "animatecompile.h" -#include "animatecommand.h" +#include "CalChartAnimationCompile.h" +#include "CalChartAnimationErrors.h" +#include "CalChartAnimationCommand.h" #include "cc_sheet.h" #include "cont.h" namespace CalChart { -void AnimationErrors::RegisterError(AnimateError err, const ContToken* token, - unsigned curr_pt, SYMBOL_TYPE contsymbol) -{ - mErrorMarkers[err].contsymbol = contsymbol; - if (token != NULL) { - mErrorMarkers[err].line = token->line; - mErrorMarkers[err].col = token->col; - } - mErrorMarkers[err].pntgroup.insert(curr_pt); -} - -void AnimationErrors::RegisterError(AnimateError err, int line, int col, - unsigned curr_pt, SYMBOL_TYPE contsymbol) -{ - mErrorMarkers[err].contsymbol = contsymbol; - mErrorMarkers[err].line = line; - mErrorMarkers[err].col = col; - mErrorMarkers[err].pntgroup.insert(curr_pt); -} - -AnimateCompile::AnimateCompile(const Show& show, SYMBOL_TYPE cont_symbol, unsigned pt_num, Show::const_Sheet_iterator_t c_sheet, AnimateState& state) +AnimationCompile::AnimationCompile(const Show& show, SYMBOL_TYPE cont_symbol, unsigned pt_num, Show::const_Sheet_iterator_t c_sheet, AnimateState& state) : mShow(show) , contsymbol(cont_symbol) , curr_pt(pt_num) @@ -56,8 +37,8 @@ AnimateCompile::AnimateCompile(const Show& show, SYMBOL_TYPE cont_symbol, unsign { } -AnimateCommands -AnimateCompile::Compile( +AnimationCommands +AnimationCompile::Compile( const Show& show, AnimationVariables& variablesStates, AnimationErrors& errors, Show::const_Sheet_iterator_t c_sheet, unsigned pt_num, SYMBOL_TYPE cont_symbol, @@ -71,7 +52,7 @@ AnimateCompile::Compile( {}, }; - AnimateCompile ac(show, cont_symbol, pt_num, c_sheet, state); + AnimationCompile ac(show, cont_symbol, pt_num, c_sheet, state); if (procs.empty()) { // no continuity was specified @@ -101,17 +82,17 @@ AnimateCompile::Compile( if (state.pt != next_point) { auto c = next_point - state.pt; ac.RegisterError(ANIMERR_WRONGPLACE, NULL); - ac.Append(std::make_shared(state.beats_rem, c), NULL); + ac.Append(std::make_shared(state.beats_rem, c), NULL); } } if (state.beats_rem) { ac.RegisterError(ANIMERR_EXTRATIME, NULL); - ac.Append(std::make_shared(state.beats_rem, ANIMDIR_E), NULL); + ac.Append(std::make_shared(state.beats_rem, ANIMDIR_E), NULL); } return state.cmds; } -bool AnimateCompile::Append(std::shared_ptr cmd, +bool AnimationCompile::Append(std::shared_ptr cmd, const ContToken* token) { if (mState.beats_rem < cmd->NumBeats()) { @@ -130,13 +111,13 @@ bool AnimateCompile::Append(std::shared_ptr cmd, return true; } -void AnimateCompile::RegisterError(AnimateError err, +void AnimationCompile::RegisterError(AnimateError err, const ContToken* token) const { mState.error_markers.RegisterError(err, token, curr_pt, contsymbol); } -float AnimateCompile::GetVarValue(int varnum, const ContToken* token) const +float AnimationCompile::GetVarValue(int varnum, const ContToken* token) const { auto i = mState.mVars[varnum].find(curr_pt); if (i != mState.mVars[varnum].end()) { @@ -146,17 +127,17 @@ float AnimateCompile::GetVarValue(int varnum, const ContToken* token) const return 0.0; } -void AnimateCompile::SetVarValue(int varnum, float value) +void AnimationCompile::SetVarValue(int varnum, float value) { mState.mVars[varnum][curr_pt] = value; } -Coord AnimateCompile::GetStartingPosition() const +Coord AnimationCompile::GetStartingPosition() const { return curr_sheet->GetPosition(GetCurrentPoint()); } -Coord AnimateCompile::GetEndingPosition(const ContToken* token) const +Coord AnimationCompile::GetEndingPosition(const ContToken* token) const { auto sheet = curr_sheet + 1; @@ -172,8 +153,9 @@ Coord AnimateCompile::GetEndingPosition(const ContToken* token) const } } -Coord AnimateCompile::GetReferencePointPosition(unsigned refnum) const +Coord AnimationCompile::GetReferencePointPosition(unsigned refnum) const { return curr_sheet->GetPosition(GetCurrentPoint(), refnum + 1); } + } diff --git a/src/core/animatecompile.h b/src/core/CalChartAnimationCompile.h similarity index 69% rename from src/core/animatecompile.h rename to src/core/CalChartAnimationCompile.h index e8baf47c..37e5903a 100644 --- a/src/core/animatecompile.h +++ b/src/core/CalChartAnimationCompile.h @@ -1,6 +1,6 @@ #pragma once /* - * animate.h + * CalChartAnimation.h * Classes for animating shows */ @@ -21,7 +21,7 @@ along with this program. If not, see . */ -#include "animate.h" +#include "CalChartAnimation.h" #include "animate_types.h" #include "cc_show.h" @@ -34,50 +34,32 @@ namespace CalChart { class ContProcedure; class ContToken; -class AnimateCommand; +class AnimationCommand; using AnimationVariables = std::array, NUMCONTVARS>; -using AnimateCommands = std::vector>; - -class AnimationErrors { -public: - auto AnyErrors() const { return !mErrorMarkers.empty(); } - auto GetErrors() const { return mErrorMarkers; } - void RegisterError(AnimateError err, const ContToken* token, unsigned curr_pt, - SYMBOL_TYPE contsymbol); - void RegisterError(AnimateError err, int line, int col, unsigned curr_pt, - SYMBOL_TYPE contsymbol); - - bool operator==(AnimationErrors const& rhs) const - { - return mErrorMarkers == rhs.mErrorMarkers; - } - -private: - std::map mErrorMarkers; -}; +using AnimationCommands = std::vector>; struct AnimateState { Coord pt; unsigned beats_rem; AnimationVariables& mVars; AnimationErrors& error_markers; - AnimateCommands cmds; + AnimationCommands cmds; }; -class AnimateCompile { +class AnimationCompile { public: // Compile a point - static AnimateCommands + static AnimationCommands Compile(const Show& show, AnimationVariables& variablesStates, AnimationErrors& errors, Show::const_Sheet_iterator_t c_sheet, unsigned pt_num, SYMBOL_TYPE cont_symbol, std::vector> const& proc); private: - AnimateCompile(const Show& show, SYMBOL_TYPE cont_symbol, unsigned pt_num, Show::const_Sheet_iterator_t c_sheet, AnimateState& state); + AnimationCompile(const Show& show, SYMBOL_TYPE cont_symbol, unsigned pt_num, Show::const_Sheet_iterator_t c_sheet, AnimateState& state); public: - bool Append(std::shared_ptr cmd, const ContToken* token); + bool Append(std::shared_ptr cmd, const ContToken* token); void RegisterError(AnimateError err, const ContToken* token) const; float GetVarValue(int varnum, const ContToken* token) const; diff --git a/src/core/CalChartAnimationErrors.h b/src/core/CalChartAnimationErrors.h new file mode 100644 index 00000000..4b22ec53 --- /dev/null +++ b/src/core/CalChartAnimationErrors.h @@ -0,0 +1,63 @@ +#pragma once +/* + * CalChartAnimationErrors.h + * Errors that may occur when compiling a show + */ + +/* + Copyright (C) 1995-2011 Garrick Brian Meeker, Richard Michael Powell + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "animate_types.h" +#include "cont.h" +#include +#include + +/** + * Animation Errors + * An object that holds the errors when compiling a show. + */ + +namespace CalChart { + +class AnimationErrors { +public: + void RegisterError(AnimateError err, ContToken const* token, unsigned curr_pt, SYMBOL_TYPE contsymbol) { + mErrorMarkers[err].contsymbol = contsymbol; + if (token != NULL) { + mErrorMarkers[err].line = token->line; + mErrorMarkers[err].col = token->col; + } + mErrorMarkers[err].pntgroup.insert(curr_pt); + } + void RegisterError(AnimateError err, int line, int col, unsigned curr_pt, SYMBOL_TYPE contsymbol) { + mErrorMarkers[err].contsymbol = contsymbol; + mErrorMarkers[err].line = line; + mErrorMarkers[err].col = col; + mErrorMarkers[err].pntgroup.insert(curr_pt); + } + auto AnyErrors() const { return !mErrorMarkers.empty(); } + auto GetErrors() const { return mErrorMarkers; } + + bool operator==(AnimationErrors const& rhs) const { + return mErrorMarkers == rhs.mErrorMarkers; + } + +private: + std::map mErrorMarkers; +}; + +} diff --git a/src/core/CalChartAnimationSheet.cpp b/src/core/CalChartAnimationSheet.cpp new file mode 100644 index 00000000..eea3b4bb --- /dev/null +++ b/src/core/CalChartAnimationSheet.cpp @@ -0,0 +1,74 @@ +/* + * animate.cpp + * Classes for animating shows + */ + +/* + Copyright (C) 1995-2011 Garrick Brian Meeker, Richard Michael Powell + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "CalChartAnimation.h" +#include "CalChartAnimationCommand.h" + +namespace CalChart { + +// make things copiable +AnimationSheet::AnimationSheet(AnimationSheet const& other) + : mPoints(other.mPoints) + , mCommands(other.mCommands.size()) + , name(other.name) + , numbeats(other.numbeats) +{ + std::transform(other.mCommands.cbegin(), other.mCommands.cend(), mCommands.begin(), [](auto&& a) { + AnimationCommands result(a.size()); + std::transform(a.cbegin(), a.cend(), result.begin(), [](auto&& b) { + return b->clone(); + }); + return result; + }); +} + +AnimationSheet& AnimationSheet::operator=(AnimationSheet other) +{ + swap(other); + return *this; +} + +AnimationSheet::AnimationSheet(AnimationSheet&& other) noexcept + : mPoints(std::move(other.mPoints)) + , mCommands(std::move(other.mCommands)) + , name(std::move(other.name)) + , numbeats(std::move(other.numbeats)) +{ +} + +AnimationSheet& AnimationSheet::operator=(AnimationSheet&& other) noexcept +{ + AnimationSheet tmp{ std::move(other) }; + swap(tmp); + return *this; +} + +void AnimationSheet::swap(AnimationSheet& other) noexcept +{ + using std::swap; + swap(mPoints, other.mPoints); + swap(mCommands, other.mCommands); + swap(name, other.name); + swap(numbeats, other.numbeats); +} + +} diff --git a/src/core/CalChartAnimationSheet.h b/src/core/CalChartAnimationSheet.h new file mode 100644 index 00000000..c62a5891 --- /dev/null +++ b/src/core/CalChartAnimationSheet.h @@ -0,0 +1,96 @@ +#pragma once +/* + * CalChartAnimation.h + * Classes for animating shows + */ + +/* + Copyright (C) 1995-2011 Garrick Brian Meeker, Richard Michael Powell + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "animate_types.h" +#include "CalChartCoord.h" + +#include + +/** + * Animation Sheet + * Continuities can be broken down into 3 distinct types: + * MarkTime: A direction to be facing + * Moving: A vector along which to be moving (indicating how far to move each point) + * Rotate: A point which to rotate, radius, start and end angles + * AnimationCommand is an object that represents a particular part of a continuity. When we decompose + * continuities into these parts, we can then "transform" a point from a starting position to the end of the + * Animation by "stepping" it along each AnimationCommand + */ + +namespace CalChart { + +class AnimationCommand; + +using AnimationCommands = std::vector>; + +// AnimationSheet is a snapshot of CC_sheet +class AnimationSheet { +public: + AnimationSheet(std::vector const& thePoints, std::vector const& theCommands, std::string const& s, unsigned beats) + : mPoints(thePoints) + , mCommands(theCommands) + , name(s) + , numbeats(beats) + { + } + + // make things copiable + AnimationSheet(AnimationSheet const&); + AnimationSheet& operator=(AnimationSheet); + AnimationSheet(AnimationSheet&&) noexcept; + AnimationSheet& operator=(AnimationSheet&&) noexcept; + void swap(AnimationSheet&) noexcept; + + auto GetName() const { return name; } + auto GetNumBeats() const { return numbeats; } + auto GetPoints() const { return mPoints; } + auto GetCommands(int which) const { return mCommands.at(which); } + auto GetCommandsBegin(int which) const + { + return mCommands.at(which).begin(); + } + auto GetCommandsBeginIndex(int /*which*/) const + { + return std::vector::size_type(0); + } + auto GetCommandsEnd(int which) const + { + return mCommands.at(which).end(); + } + auto GetCommandsEndIndex(int which) const + { + return mCommands.at(which).size(); + } + auto GetCommandsAt(int which, int index) const + { + return mCommands.at(which).at(index); + } + +private: + std::vector mPoints; // should probably be const + std::vector mCommands; + std::string name; + unsigned numbeats; +}; + +} diff --git a/src/core/cc_coord.cpp b/src/core/CalChartCoord.cpp similarity index 89% rename from src/core/cc_coord.cpp rename to src/core/CalChartCoord.cpp index fa8dffb3..ee68afad 100644 --- a/src/core/cc_coord.cpp +++ b/src/core/CalChartCoord.cpp @@ -1,6 +1,6 @@ /* - * cc_coord.cpp - * Member functions for coordinate classes + * CalChartCoord.cpp + * Definitions for the coordinate object */ /* @@ -23,7 +23,7 @@ #define _USE_MATH_DEFINES #include -#include "cc_coord.h" +#include "CalChartCoord.h" #include namespace CalChart { @@ -65,29 +65,29 @@ float Coord::Direction() const } // Get direction from this coord to another -float Coord::Direction(const Coord& c) const +float Coord::Direction(Coord const& c) const { return (c - *this).Direction(); } // Returns the type of collision between this point and another -Coord::CollisionType Coord::DetectCollision(const Coord& c) const +Coord::CollisionType Coord::DetectCollision(Coord const& c) const { auto dx = x - c.x; auto dy = y - c.y; // Check for special cases to avoid multiplications if (std::abs(dx) > Int2CoordUnits(1)) - return COLLISION_NONE; + return CollisionType::none; if (std::abs(dy) > Int2CoordUnits(1)) - return COLLISION_NONE; + return CollisionType::none; auto squaredDist = ((dx * dx) + (dy * dy)); auto distOfOne = Int2CoordUnits(1) * Int2CoordUnits(1); if (squaredDist < distOfOne) { - return COLLISION_INTERSECT; + return CollisionType::intersect; } else if (squaredDist == distOfOne) { - return COLLISION_WARNING; + return CollisionType::warning; } else { - return COLLISION_NONE; + return CollisionType::none; } } @@ -98,14 +98,14 @@ struct Coord_values { Coord::units x, y; }; -bool Check_Coord(const Coord& underTest, const Coord_values& values) +bool Check_Coord(Coord const& underTest, Coord_values const& values) { return (underTest.x == values.x) && (underTest.y == values.y); } void Coord_UnitTests() { - static const size_t kNumRand = 10; + static constexpr auto kNumRand = 10; // test some defaults: { Coord undertest; @@ -132,11 +132,9 @@ void Coord_UnitTests() assert(!(Coord(x1, y1) != undertest1)); assert(!(Coord(x2, y2) != undertest2)); - Coord newValue; - Coord::units x3, y3; - newValue = undertest1 + undertest2; + auto newValue = undertest1 + undertest2; x3 = undertest1.x + undertest2.x; y3 = undertest1.y + undertest2.y; assert((x3) == newValue.x); diff --git a/src/core/cc_coord.h b/src/core/CalChartCoord.h similarity index 69% rename from src/core/cc_coord.h rename to src/core/CalChartCoord.h index 397bd9fd..95ef0ec8 100644 --- a/src/core/cc_coord.h +++ b/src/core/CalChartCoord.h @@ -1,7 +1,7 @@ #pragma once /* - * cc_coord.h - * Definitions for the coordinate classes + * CalChartCoord.h + * Definitions for the coordinate object */ /* @@ -23,13 +23,22 @@ #include + namespace CalChart { -class Coord { -public: +constexpr auto kCoordShift = 4; +constexpr auto kCoordDecimal = (1 << kCoordShift); + +struct Coord { using units = int16_t; - Coord(Coord::units xval = 0, Coord::units yval = 0) + enum class CollisionType { + none = 0, + warning, + intersect, + }; + + constexpr Coord(Coord::units xval = 0, Coord::units yval = 0) : x(xval) , y(yval) { @@ -39,46 +48,45 @@ class Coord { float Distance(Coord const&) const; float DM_Magnitude() const; // check for diagonal military also float Direction() const; - float Direction(const Coord& c) const; - - enum CollisionType { - COLLISION_NONE = 0, - COLLISION_WARNING, - COLLISION_INTERSECT - }; + float Direction(Coord const& c) const; - CollisionType DetectCollision(const Coord& c) const; + CollisionType DetectCollision(Coord const& c) const; - Coord& operator+=(const Coord& c) + constexpr Coord& operator+=(Coord const& c) { x += c.x; y += c.y; return *this; } - Coord& operator-=(const Coord& c) + + constexpr Coord& operator-=(Coord const& c) { x -= c.x; y -= c.y; return *this; } + Coord& operator*=(int s) { x *= s; y *= s; return *this; } + Coord& operator/=(int s) { x /= s; y /= s; return *this; } + Coord& operator*=(double s) { x *= s; y *= s; return *this; } + Coord& operator/=(double s) { x /= s; @@ -89,39 +97,39 @@ class Coord { units x, y; }; -inline Coord operator+(const Coord& a, const Coord& b) +inline Coord operator+(Coord const& a, Coord const& b) { return Coord(a.x + b.x, a.y + b.y); } -inline Coord operator-(const Coord& a, const Coord& b) +inline Coord operator-(Coord const& a, Coord const& b) { return Coord(a.x - b.x, a.y - b.y); } -inline Coord operator*(const Coord& a, int s) +inline Coord operator*(Coord const& a, int s) { return Coord(a.x * s, a.y * s); } -inline Coord operator/(const Coord& a, int s) +inline Coord operator/(Coord const& a, int s) { return Coord(a.x / s, a.y / s); } -inline Coord operator-(const Coord& c) { return Coord(-c.x, -c.y); } +inline Coord operator-(Coord const& c) { return Coord(-c.x, -c.y); } -inline bool operator==(const Coord& a, const Coord& b) +inline bool operator==(Coord const& a, Coord const& b) { return ((a.x == b.x) && (a.y == b.y)); } -inline bool operator<(const Coord& a, const Coord& b) +inline bool operator<(Coord const& a, Coord const& b) { return (a.y == b.y) ? (a.x < b.x) : (a.y < b.y); } -inline bool operator!=(const Coord& a, const Coord& b) +inline bool operator!=(Coord const& a, Coord const& b) { return ((a.x != b.x) || (a.y != b.y)); } @@ -129,9 +137,6 @@ inline bool operator!=(const Coord& a, const Coord& b) void Coord_UnitTests(); } -constexpr auto COORD_SHIFT = 4; -constexpr auto COORD_DECIMAL = (1 << COORD_SHIFT); - // RoundToCoordUnits: Use when number is already in Coord format, just needs to be // rounded template @@ -145,12 +150,12 @@ constexpr auto RoundToCoordUnits(T inCoord) template constexpr auto Float2CoordUnits(T a) { - return static_cast(RoundToCoordUnits(a * COORD_DECIMAL)); + return static_cast(RoundToCoordUnits(a * CalChart::kCoordDecimal)); } template constexpr auto CoordUnits2Float(T a) { - return a / (float)COORD_DECIMAL; + return a / (float)CalChart::kCoordDecimal; } // Int2CoordUnits, CoordUnits2Int @@ -158,10 +163,10 @@ constexpr auto CoordUnits2Float(T a) template constexpr auto Int2CoordUnits(T a) { - return static_cast(a * COORD_DECIMAL); + return static_cast(a * CalChart::kCoordDecimal); } template constexpr auto CoordUnits2Int(T a) { - return static_cast(a / COORD_DECIMAL); + return static_cast(a / CalChart::kCoordDecimal); } diff --git a/src/field_canvas_shapes.cpp b/src/core/CalChartMovePointsTool.cpp similarity index 70% rename from src/field_canvas_shapes.cpp rename to src/core/CalChartMovePointsTool.cpp index 7379106d..6897d23f 100644 --- a/src/field_canvas_shapes.cpp +++ b/src/core/CalChartMovePointsTool.cpp @@ -1,6 +1,6 @@ /* - * field_canvas_shapes.cpp - * Canvas for the Field window + * CalChartMovePointsTool.cpp + * MovePointsTool represent the shapes and transformation of Marcher moves. */ /* @@ -20,131 +20,133 @@ along with this program. If not, see . */ -#include "field_canvas_shapes.h" +#include "CalChartMovePointsTool.h" -#include "cc_shapes.h" -#include "confgr.h" -#include "draw.h" +#include "CalChartShapes.h" #include "linmath.h" #include "math_utils.h" -#include +namespace CalChart { -class MovePoints_CC_MOVE_NORMAL : public MovePoints { +class MovePointsTool_Normal : public MovePointsTool { public: virtual std::map TransformPoints(std::map const& select_list) const override; - virtual void OnMouseLeftDown(CalChart::Coord pos) override; + virtual void OnClickDown(CalChart::Coord pos) override; }; -class MovePoints_CC_MOVE_LINE : public MovePoints { +class MovePointsTool_MoveLine : public MovePointsTool { public: virtual std::map TransformPoints(std::map const& select_list) const override; - virtual void OnMouseLeftDown(CalChart::Coord pos) override; + virtual void OnClickDown(CalChart::Coord pos) override; }; -class MovePoints_CC_MOVE_ROTATE : public MovePoints { +class MovePointsTool_MoveRotate : public MovePointsTool { public: virtual std::map TransformPoints(std::map const& select_list) const override; - virtual void OnMouseLeftDown(CalChart::Coord pos) override; - virtual bool OnMouseUpDone(CalChart::Coord const&) override; + virtual void OnClickDown(CalChart::Coord pos) override; + virtual void OnClickUp(CalChart::Coord pos) override; + virtual bool IsDone() const override; virtual bool IsReadyForMoving() const override; }; -class MovePoints_CC_MOVE_SHEAR : public MovePoints { +class MovePointsTool_MoveShear : public MovePointsTool { public: virtual std::map TransformPoints(std::map const& select_list) const override; - virtual void OnMouseLeftDown(CalChart::Coord pos) override; - virtual bool OnMouseUpDone(CalChart::Coord const&) override; + virtual void OnClickDown(CalChart::Coord pos) override; + virtual void OnClickUp(CalChart::Coord pos) override; + virtual bool IsDone() const override; virtual bool IsReadyForMoving() const override; }; -class MovePoints_CC_MOVE_REFL : public MovePoints { +class MovePointsTool_MoveReflect : public MovePointsTool { public: virtual std::map TransformPoints(std::map const& select_list) const override; - virtual void OnMouseLeftDown(CalChart::Coord pos) override; + virtual void OnClickDown(CalChart::Coord pos) override; }; -class MovePoints_CC_MOVE_SIZE : public MovePoints { +class MovePointsTool_MoveSize : public MovePointsTool { public: virtual std::map TransformPoints(std::map const& select_list) const override; - virtual void OnMouseLeftDown(CalChart::Coord pos) override; - virtual bool OnMouseUpDone(CalChart::Coord const&) override; + virtual void OnClickDown(CalChart::Coord pos) override; + virtual void OnClickUp(CalChart::Coord pos) override; + virtual bool IsDone() const override; virtual bool IsReadyForMoving() const override; }; -class MovePoints_CC_MOVE_GENIUS : public MovePoints { +class MovePointsTool_MoveGenius : public MovePointsTool { public: virtual std::map TransformPoints(std::map const& select_list) const override; - virtual void OnMouseLeftDown(CalChart::Coord pos) override; - virtual bool OnMouseUpDone(CalChart::Coord const&) override; + virtual void OnClickDown(CalChart::Coord pos) override; + virtual void OnClickUp(CalChart::Coord pos) override; + virtual bool IsDone() const override; virtual bool IsReadyForMoving() const override; }; -class MovePoints_CC_MOVE_SHAPE_LINE : public MovePoints { +class MovePointsTool_ShapeLine : public MovePointsTool { public: virtual std::map TransformPoints(std::map const& select_list) const override; - virtual void OnMouseLeftDown(CalChart::Coord pos) override; + virtual void OnClickDown(CalChart::Coord pos) override; }; -class MovePoints_CC_MOVE_SHAPE_ELLIPSE : public MovePoints { +class MovePointsTool_ShapeEllipse : public MovePointsTool { public: virtual std::map TransformPoints(std::map const& select_list) const override; - virtual void OnMouseLeftDown(CalChart::Coord pos) override; + virtual void OnClickDown(CalChart::Coord pos) override; }; -class MovePoints_CC_MOVE_SHAPE_RECTANGLE : public MovePoints { +class MovePointsTool_ShapeRectangle : public MovePointsTool { public: virtual std::map TransformPoints(std::map const& select_list) const override; - virtual void OnMouseLeftDown(CalChart::Coord pos) override; + virtual void OnClickDown(CalChart::Coord pos) override; }; -class MovePoints_CC_MOVE_SHAPE_DRAW : public MovePoints { +class MovePointsTool_ShapeDraw : public MovePointsTool { public: virtual std::map TransformPoints(std::map const& select_list) const override; - virtual void OnMouseLeftDown(CalChart::Coord pos) override; + virtual void OnClickDown(CalChart::Coord pos) override; }; -class MovePoints_CC_MOVE_SHAPE_X : public MovePoints { +class MovePointsTool_ShapeX : public MovePointsTool { public: virtual std::map TransformPoints(std::map const& select_list) const override; - virtual void OnMouseLeftDown(CalChart::Coord pos) override; + virtual void OnClickDown(CalChart::Coord pos) override; }; -class MovePoints_CC_MOVE_SHAPE_CROSS : public MovePoints { +class MovePointsTool_ShapeCross : public MovePointsTool { public: virtual std::map TransformPoints(std::map const& select_list) const override; - virtual void OnMouseLeftDown(CalChart::Coord pos) override; + virtual void OnClickDown(CalChart::Coord pos) override; }; -std::unique_ptr Create_MovePoints(CC_MOVE_MODES curr_move) +std::unique_ptr MovePointsTool::Create(CalChart::MoveMode curr_move) { switch (curr_move) { - case CC_MOVE_NORMAL: - return std::make_unique(); - case CC_MOVE_SHAPE_LINE: - return std::make_unique(); - case CC_MOVE_SHAPE_X: - return std::make_unique(); - case CC_MOVE_SHAPE_CROSS: - return std::make_unique(); - case CC_MOVE_SHAPE_RECTANGLE: - return std::make_unique(); - case CC_MOVE_SHAPE_ELLIPSE: - return std::make_unique(); - case CC_MOVE_SHAPE_DRAW: - return std::make_unique(); - case CC_MOVE_LINE: - return std::make_unique(); - case CC_MOVE_ROTATE: - return std::make_unique(); - case CC_MOVE_SHEAR: - return std::make_unique(); - case CC_MOVE_REFL: - return std::make_unique(); - case CC_MOVE_SIZE: - return std::make_unique(); - case CC_MOVE_GENIUS: - return std::make_unique(); + case CalChart::MoveMode::Normal: + return std::make_unique(); + case CalChart::MoveMode::ShapeLine: + return std::make_unique(); + case CalChart::MoveMode::ShapeX: + return std::make_unique(); + case CalChart::MoveMode::ShapeCross: + return std::make_unique(); + case CalChart::MoveMode::ShapeRectange: + return std::make_unique(); + case CalChart::MoveMode::ShapeEllipse: + return std::make_unique(); + case CalChart::MoveMode::ShapeDraw: + return std::make_unique(); + case CalChart::MoveMode::MoveLine: + return std::make_unique(); + case CalChart::MoveMode::MoveRotate: + return std::make_unique(); + case CalChart::MoveMode::MoveShear: + return std::make_unique(); + case CalChart::MoveMode::MoveReflect: + return std::make_unique(); + case CalChart::MoveMode::MoveSize: + return std::make_unique(); + case CalChart::MoveMode::MoveGenius: + return std::make_unique(); } } @@ -176,33 +178,33 @@ static std::vector get_ordered_selection(std::map con return result; } -void FieldCanvasShapes::BeginMoveDrag(CC_DRAG type, const CalChart::Coord& start) +void MovePointsTool::BeginMoveDrag(Drag type, CalChart::Coord start) { move_drag = type; m_shape_list.clear(); switch (type) { - case CC_DRAG::BOX: + case Drag::BOX: AddMoveDrag(type, std::make_unique(start)); break; - case CC_DRAG::POLY: + case Drag::POLY: AddMoveDrag(type, std::make_unique(start)); break; - case CC_DRAG::LASSO: + case Drag::LASSO: AddMoveDrag(type, std::make_unique(start)); break; - case CC_DRAG::LINE: + case Drag::LINE: AddMoveDrag(type, std::make_unique(start)); break; - case CC_DRAG::CROSSHAIRS: + case Drag::CROSSHAIRS: AddMoveDrag(type, std::make_unique(start, Int2CoordUnits(2))); break; - case CC_DRAG::SHAPE_ELLIPSE: + case Drag::SHAPE_ELLIPSE: AddMoveDrag(type, std::make_unique(start)); break; - case CC_DRAG::SHAPE_X: + case Drag::SHAPE_X: AddMoveDrag(type, std::make_unique(start)); break; - case CC_DRAG::SHAPE_CROSS: + case Drag::SHAPE_CROSS: AddMoveDrag(type, std::make_unique(start)); break; default: @@ -210,25 +212,25 @@ void FieldCanvasShapes::BeginMoveDrag(CC_DRAG type, const CalChart::Coord& start } } -void FieldCanvasShapes::AddMoveDrag(CC_DRAG type, std::unique_ptr shape) +void MovePointsTool::AddMoveDrag(Drag type, std::unique_ptr shape) { move_drag = type; m_shape_list.emplace_back(std::move(shape)); } -void FieldCanvasShapes::OnMove(const CalChart::Coord& p, const CalChart::Coord& snapped_p) +void MovePointsTool::OnMove(CalChart::Coord p, CalChart::Coord snapped_p) { if (!m_shape_list.empty()) { m_shape_list.back()->OnMove(p, snapped_p); } } -void MovePoints_CC_MOVE_LINE::OnMouseLeftDown(CalChart::Coord pos) +void MovePointsTool_MoveLine::OnClickDown(CalChart::Coord pos) { - BeginMoveDrag(CC_DRAG::LINE, pos); + BeginMoveDrag(Drag::LINE, pos); } -std::map MovePoints_CC_MOVE_LINE::TransformPoints(std::map const& select_list) const +std::map MovePointsTool_MoveLine::TransformPoints(std::map const& select_list) const { assert(m_shape_list.size() == 1); auto* shape = static_cast(m_shape_list.back().get()); @@ -245,12 +247,12 @@ std::map MovePoints_CC_MOVE_LINE::TransformPoints(std::map return result; } -void MovePoints_CC_MOVE_NORMAL::OnMouseLeftDown(CalChart::Coord pos) +void MovePointsTool_Normal::OnClickDown(CalChart::Coord pos) { - BeginMoveDrag(CC_DRAG::LINE, pos); + BeginMoveDrag(Drag::LINE, pos); } -std::map MovePoints_CC_MOVE_NORMAL::TransformPoints(std::map const& select_list) const +std::map MovePointsTool_Normal::TransformPoints(std::map const& select_list) const { auto* shape = static_cast(m_shape_list.back().get()); auto pos = shape->GetPoint() - shape->GetOrigin(); @@ -261,20 +263,20 @@ std::map MovePoints_CC_MOVE_NORMAL::TransformPoints(std::m return result; } -void MovePoints_CC_MOVE_ROTATE::OnMouseLeftDown(CalChart::Coord pos) +void MovePointsTool_MoveRotate::OnClickDown(CalChart::Coord pos) { // rotate is a 2-distinct mouse click action if (m_shape_list.empty()) { - BeginMoveDrag(CC_DRAG::CROSSHAIRS, pos); + BeginMoveDrag(Drag::CROSSHAIRS, pos); } else if (static_cast(m_shape_list.back().get())->GetOrigin() != pos) { // and this is a point not on the origin. - AddMoveDrag(CC_DRAG::LINE, + AddMoveDrag(Drag::LINE, std::make_unique( static_cast(m_shape_list.back().get())->GetOrigin(), pos)); } } -std::map MovePoints_CC_MOVE_ROTATE::TransformPoints(std::map const& select_list) const +std::map MovePointsTool_MoveRotate::TransformPoints(std::map const& select_list) const { if (m_shape_list.size() < 2) { return select_list; @@ -286,21 +288,23 @@ std::map MovePoints_CC_MOVE_ROTATE::TransformPoints(std::m } } -bool MovePoints_CC_MOVE_ROTATE::OnMouseUpDone(CalChart::Coord const& pos) +void MovePointsTool_MoveRotate::OnClickUp(CalChart::Coord pos) { - if (m_shape_list.size() > 1) { + if (IsReadyForMoving()) { auto* shape = (CalChart::Shape_2point const*)m_shape_list.back().get(); if (shape->GetOrigin() == shape->GetPoint()) { // reset - BeginMoveDrag(CC_DRAG::CROSSHAIRS, pos); - return false; + BeginMoveDrag(Drag::CROSSHAIRS, pos); } - return true; } - return false; } -bool MovePoints_CC_MOVE_ROTATE::IsReadyForMoving() const +bool MovePointsTool_MoveRotate::IsDone() const +{ + return IsReadyForMoving(); +} + +bool MovePointsTool_MoveRotate::IsReadyForMoving() const { if (m_shape_list.size() > 1) { return true; @@ -308,19 +312,19 @@ bool MovePoints_CC_MOVE_ROTATE::IsReadyForMoving() const return false; } -void MovePoints_CC_MOVE_SHEAR::OnMouseLeftDown(CalChart::Coord pos) +void MovePointsTool_MoveShear::OnClickDown(CalChart::Coord pos) { // shear is a 2-distinct mouse click action if (m_shape_list.empty()) { - BeginMoveDrag(CC_DRAG::CROSSHAIRS, pos); + BeginMoveDrag(Drag::CROSSHAIRS, pos); } else if (((CalChart::Shape_1point*)m_shape_list.back().get())->GetOrigin() != pos) { CalChart::Coord vect(pos - ((CalChart::Shape_1point*)m_shape_list.back().get())->GetOrigin()); // rotate vect 90 degrees - AddMoveDrag(CC_DRAG::LINE, std::make_unique(pos, CalChart::Coord(-vect.y, vect.x))); + AddMoveDrag(Drag::LINE, std::make_unique(pos, CalChart::Coord(-vect.y, vect.x))); } } -std::map MovePoints_CC_MOVE_SHEAR::TransformPoints(std::map const& select_list) const +std::map MovePointsTool_MoveShear::TransformPoints(std::map const& select_list) const { if (m_shape_list.size() < 2) { return select_list; @@ -342,21 +346,23 @@ std::map MovePoints_CC_MOVE_SHEAR::TransformPoints(std::ma } } -bool MovePoints_CC_MOVE_SHEAR::OnMouseUpDone(CalChart::Coord const& pos) +void MovePointsTool_MoveShear::OnClickUp(CalChart::Coord pos) { - if (m_shape_list.size() > 1) { + if (IsReadyForMoving()) { auto* shape = (CalChart::Shape_2point const*)m_shape_list.back().get(); if (shape->GetOrigin() == shape->GetPoint()) { // reset - BeginMoveDrag(CC_DRAG::CROSSHAIRS, pos); - return false; + BeginMoveDrag(Drag::CROSSHAIRS, pos); } - return true; } - return false; } -bool MovePoints_CC_MOVE_SHEAR::IsReadyForMoving() const +bool MovePointsTool_MoveShear::IsDone() const +{ + return IsReadyForMoving(); +} + +bool MovePointsTool_MoveShear::IsReadyForMoving() const { if (m_shape_list.size() > 1) { return true; @@ -364,13 +370,13 @@ bool MovePoints_CC_MOVE_SHEAR::IsReadyForMoving() const return false; } -void MovePoints_CC_MOVE_REFL::OnMouseLeftDown(CalChart::Coord pos) +void MovePointsTool_MoveReflect::OnClickDown(CalChart::Coord pos) { // reflect is a 1 mouse click action - BeginMoveDrag(CC_DRAG::LINE, pos); + BeginMoveDrag(Drag::LINE, pos); } -std::map MovePoints_CC_MOVE_REFL::TransformPoints(std::map const& select_list) const +std::map MovePointsTool_MoveReflect::TransformPoints(std::map const& select_list) const { assert(m_shape_list.size() == 1); auto* shape = (CalChart::Shape_2point const*)m_shape_list.back().get(); @@ -381,17 +387,17 @@ std::map MovePoints_CC_MOVE_REFL::TransformPoints(std::map return GetTransformedPoints(m, select_list); } -void MovePoints_CC_MOVE_SIZE::OnMouseLeftDown(CalChart::Coord pos) +void MovePointsTool_MoveSize::OnClickDown(CalChart::Coord pos) { // move is a 2-distinct mouse click action if (m_shape_list.empty()) { - BeginMoveDrag(CC_DRAG::CROSSHAIRS, pos); + BeginMoveDrag(Drag::CROSSHAIRS, pos); } else if (((CalChart::Shape_1point*)m_shape_list.back().get())->GetOrigin() != pos) { - AddMoveDrag(CC_DRAG::LINE, std::make_unique(pos)); + AddMoveDrag(Drag::LINE, std::make_unique(pos)); } } -std::map MovePoints_CC_MOVE_SIZE::TransformPoints(std::map const& select_list) const +std::map MovePointsTool_MoveSize::TransformPoints(std::map const& select_list) const { if (m_shape_list.size() < 2) { return select_list; @@ -421,21 +427,23 @@ std::map MovePoints_CC_MOVE_SIZE::TransformPoints(std::map } } -bool MovePoints_CC_MOVE_SIZE::OnMouseUpDone(CalChart::Coord const& pos) +void MovePointsTool_MoveSize::OnClickUp(CalChart::Coord pos) { - if (m_shape_list.size() > 1) { + if (IsReadyForMoving()) { auto* shape = (CalChart::Shape_2point const*)m_shape_list.back().get(); if (shape->GetOrigin() == shape->GetPoint()) { // reset - BeginMoveDrag(CC_DRAG::CROSSHAIRS, pos); - return false; + BeginMoveDrag(Drag::CROSSHAIRS, pos); } - return true; } - return false; } -bool MovePoints_CC_MOVE_SIZE::IsReadyForMoving() const +bool MovePointsTool_MoveSize::IsDone() const +{ + return IsReadyForMoving(); +} + +bool MovePointsTool_MoveSize::IsReadyForMoving() const { if (m_shape_list.size() > 1) { return true; @@ -443,15 +451,15 @@ bool MovePoints_CC_MOVE_SIZE::IsReadyForMoving() const return false; } -void MovePoints_CC_MOVE_GENIUS::OnMouseLeftDown(CalChart::Coord pos) +void MovePointsTool_MoveGenius::OnClickDown(CalChart::Coord pos) { // move is a 2-distinct mouse click action if (m_shape_list.size() < 3) { - AddMoveDrag(CC_DRAG::LINE, std::make_unique(pos)); + AddMoveDrag(Drag::LINE, std::make_unique(pos)); } } -std::map MovePoints_CC_MOVE_GENIUS::TransformPoints(std::map const& select_list) const +std::map MovePointsTool_MoveGenius::TransformPoints(std::map const& select_list) const { if (m_shape_list.size() < 3) { return select_list; @@ -487,15 +495,16 @@ std::map MovePoints_CC_MOVE_GENIUS::TransformPoints(std::m } } -bool MovePoints_CC_MOVE_GENIUS::OnMouseUpDone(CalChart::Coord const& pos) +void MovePointsTool_MoveGenius::OnClickUp(CalChart::Coord) { - if (m_shape_list.size() > 2) { - return true; - } - return false; } -bool MovePoints_CC_MOVE_GENIUS::IsReadyForMoving() const +bool MovePointsTool_MoveGenius::IsDone() const +{ + return IsReadyForMoving(); +} + +bool MovePointsTool_MoveGenius::IsReadyForMoving() const { if (m_shape_list.size() > 2) { return true; @@ -503,13 +512,13 @@ bool MovePoints_CC_MOVE_GENIUS::IsReadyForMoving() const return false; } -void MovePoints_CC_MOVE_SHAPE_LINE::OnMouseLeftDown(CalChart::Coord pos) +void MovePointsTool_ShapeLine::OnClickDown(CalChart::Coord pos) { // reflect is a 1 mouse click action - BeginMoveDrag(CC_DRAG::LINE, pos); + BeginMoveDrag(Drag::LINE, pos); } -std::map MovePoints_CC_MOVE_SHAPE_LINE::TransformPoints(std::map const& select_list) const +std::map MovePointsTool_ShapeLine::TransformPoints(std::map const& select_list) const { assert(m_shape_list.size() == 1); auto* shape = (CalChart::Shape_2point const*)m_shape_list.back().get(); @@ -526,13 +535,13 @@ std::map MovePoints_CC_MOVE_SHAPE_LINE::TransformPoints(st return result; } -void MovePoints_CC_MOVE_SHAPE_ELLIPSE::OnMouseLeftDown(CalChart::Coord pos) +void MovePointsTool_ShapeEllipse::OnClickDown(CalChart::Coord pos) { // reflect is a 1 mouse click action - BeginMoveDrag(CC_DRAG::SHAPE_ELLIPSE, pos); + BeginMoveDrag(Drag::SHAPE_ELLIPSE, pos); } -std::map MovePoints_CC_MOVE_SHAPE_ELLIPSE::TransformPoints(std::map const& select_list) const +std::map MovePointsTool_ShapeEllipse::TransformPoints(std::map const& select_list) const { assert(m_shape_list.size() == 1); auto* shape = (CalChart::Shape_2point const*)m_shape_list.back().get(); @@ -557,13 +566,13 @@ std::map MovePoints_CC_MOVE_SHAPE_ELLIPSE::TransformPoints return result; } -void MovePoints_CC_MOVE_SHAPE_RECTANGLE::OnMouseLeftDown(CalChart::Coord pos) +void MovePointsTool_ShapeRectangle::OnClickDown(CalChart::Coord pos) { // reflect is a 1 mouse click action - BeginMoveDrag(CC_DRAG::BOX, pos); + BeginMoveDrag(Drag::BOX, pos); } -std::map MovePoints_CC_MOVE_SHAPE_RECTANGLE::TransformPoints(std::map const& select_list) const +std::map MovePointsTool_ShapeRectangle::TransformPoints(std::map const& select_list) const { assert(m_shape_list.size() == 1); auto* shape = (CalChart::Shape_2point const*)m_shape_list.back().get(); @@ -591,13 +600,13 @@ std::map MovePoints_CC_MOVE_SHAPE_RECTANGLE::TransformPoin return result; } -void MovePoints_CC_MOVE_SHAPE_DRAW::OnMouseLeftDown(CalChart::Coord pos) +void MovePointsTool_ShapeDraw::OnClickDown(CalChart::Coord pos) { // reflect is a 1 mouse click action - BeginMoveDrag(CC_DRAG::LASSO, pos); + BeginMoveDrag(Drag::LASSO, pos); } -std::map MovePoints_CC_MOVE_SHAPE_DRAW::TransformPoints(std::map const& select_list) const +std::map MovePointsTool_ShapeDraw::TransformPoints(std::map const& select_list) const { assert(m_shape_list.size() == 1); auto* shape = (CalChart::Lasso const*)m_shape_list.back().get(); @@ -613,13 +622,13 @@ std::map MovePoints_CC_MOVE_SHAPE_DRAW::TransformPoints(st return result; } -void MovePoints_CC_MOVE_SHAPE_X::OnMouseLeftDown(CalChart::Coord pos) +void MovePointsTool_ShapeX::OnClickDown(CalChart::Coord pos) { // reflect is a 1 mouse click action - BeginMoveDrag(CC_DRAG::SHAPE_X, pos); + BeginMoveDrag(Drag::SHAPE_X, pos); } -std::map MovePoints_CC_MOVE_SHAPE_X::TransformPoints(std::map const& select_list) const +std::map MovePointsTool_ShapeX::TransformPoints(std::map const& select_list) const { assert(m_shape_list.size() == 1); auto* shape = (CalChart::Shape_2point const*)m_shape_list.back().get(); @@ -657,13 +666,13 @@ std::map MovePoints_CC_MOVE_SHAPE_X::TransformPoints(std:: return result; } -void MovePoints_CC_MOVE_SHAPE_CROSS::OnMouseLeftDown(CalChart::Coord pos) +void MovePointsTool_ShapeCross::OnClickDown(CalChart::Coord pos) { // reflect is a 1 mouse click action - BeginMoveDrag(CC_DRAG::SHAPE_CROSS, pos); + BeginMoveDrag(Drag::SHAPE_CROSS, pos); } -std::map MovePoints_CC_MOVE_SHAPE_CROSS::TransformPoints(std::map const& select_list) const +std::map MovePointsTool_ShapeCross::TransformPoints(std::map const& select_list) const { assert(m_shape_list.size() == 1); auto* shape = (CalChart::Shape_2point const*)m_shape_list.back().get(); @@ -702,3 +711,5 @@ std::map MovePoints_CC_MOVE_SHAPE_CROSS::TransformPoints(s assert(iter == select_list.end()); return result; } + +} diff --git a/src/core/CalChartMovePointsTool.h b/src/core/CalChartMovePointsTool.h new file mode 100644 index 00000000..f94a8264 --- /dev/null +++ b/src/core/CalChartMovePointsTool.h @@ -0,0 +1,105 @@ +#pragma once +/* + * CalChartMovePointsTool.h + * MovePointsTool represent the shapes and transformation of Marcher moves. + */ + +/* + Copyright (C) 1995-2012 Garrick Brian Meeker, Richard Michael Powell + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "CalChartCoord.h" + +#include +#include +#include +#include + +/** + * CalChart MovePoints + * MovePoints represent the way that a user may move Marchers around on a field. These objects control both the shapes + * that should be drawn to represent the move, but also the calculations on where the marchers will be after they move. + * This allows the UI to create objects that represent how the user wants to move marchers on the field. The "what" to draw + * is returned by reading the ShapeList of the Move Points, and TransformPoints translates each point position to the new placement. + * + * Some MovePoints objects require multiple "clicks", for example like Rotate. You would first click at the radius, then click + * and drag around the arc. So multiple clicks state are stored in each MovePoint. Only when the "IsReadyForMoving" is true + * does the TransformPoints result in meaningful data. + * + * Because the user may click again in a place they have clicked, we have the concept of "Done". For example, on a rotate move + * command the user may press on the Radius twice, for example to re-center. So the IsDone means that this MovePoints object + * will not handle any more "Clicks. + */ + + +namespace CalChart { +class Shape; + +enum class MoveMode { + Normal, + ShapeLine, + ShapeX, + ShapeCross, + ShapeRectange, + ShapeEllipse, + ShapeDraw, + MoveLine, + MoveRotate, + MoveShear, + MoveReflect, + MoveSize, + MoveGenius, +}; + +class MovePointsTool { +public: + // Factory for creating a specific move. + static std::unique_ptr Create(CalChart::MoveMode); + virtual ~MovePointsTool() = default; + + auto& GetShapeList() const { return m_shape_list; } + virtual std::map TransformPoints(std::map const& select_list) const = 0; + + // provides both the high resolution point and the low resolution point. + void OnMove(CalChart::Coord p, CalChart::Coord snapped_p); + + virtual void OnClickDown(CalChart::Coord pos) = 0; + virtual void OnClickUp(CalChart::Coord) {}; + virtual bool IsDone() const { return true; } + virtual bool IsReadyForMoving() const { return true; } + +protected: + enum class Drag { + NONE, + BOX, + POLY, + LASSO, + LINE, + CROSSHAIRS, + SHAPE_ELLIPSE, + SHAPE_X, + SHAPE_CROSS, + SWAP, + }; + + void BeginMoveDrag(Drag type, CalChart::Coord start); + void AddMoveDrag(Drag type, std::unique_ptr shape); + + std::vector> m_shape_list; + Drag move_drag = Drag::NONE; +}; + +} diff --git a/src/core/CalChartSelectTool.cpp b/src/core/CalChartSelectTool.cpp new file mode 100644 index 00000000..18aff23e --- /dev/null +++ b/src/core/CalChartSelectTool.cpp @@ -0,0 +1,82 @@ +/* + * CalChartMovePoints.cpp + * MovePoints represent the shapes and transformation of Dot manipulations. + */ + +/* + Copyright (C) 1995-2012 Garrick Brian Meeker, Richard Michael Powell + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "CalChartSelectTool.h" + +#include "CalChartShapes.h" +#include "linmath.h" +#include "math_utils.h" + +namespace CalChart { + +SelectTool::SelectTool(CalChart::Select select, CalChart::Coord start, std::function userScale) + : mSelect(select) + , mUserScale(userScale) +{ + // Factory for creating a specific move. + switch (select) { + case CalChart::Select::Box: + mLassoShape = std::make_unique(start); + break; + case CalChart::Select::Poly: + mLassoShape = std::make_unique(start); + mSelectComplete = false; + break; + case CalChart::Select::Lasso: + mLassoShape = std::make_unique(start); + break; + default: + break; + } +} + +void SelectTool::OnMove(CalChart::Coord p, CalChart::Coord snapped_p) +{ + if (mLassoShape) { + mLassoShape->OnMove(p, snapped_p); + } +} + +void SelectTool::OnClickUp(CalChart::Coord pos) +{ + if (mSelect != CalChart::Select::Poly) { + return ; + } + static constexpr auto CLOSE_ENOUGH_TO_CLOSE = 10; + auto* p = ((CalChart::Lasso*)mLassoShape.get())->FirstPoint(); + auto numPnts = ((CalChart::Lasso*)mLassoShape.get())->NumPoints(); + if (p != NULL && numPnts > 2) { + // need to know where the scale is, so we need the device. + auto polydist = mUserScale(CLOSE_ENOUGH_TO_CLOSE); + auto d = p->x - pos.x; + if (std::abs(d) < polydist) { + d = p->y - pos.y; + if (std::abs(d) < polydist) { + mSelectComplete = true; + return; + } + } + } + ((CalChart::Lasso*)mLassoShape.get())->Append(pos); +} + +} diff --git a/src/core/CalChartSelectTool.h b/src/core/CalChartSelectTool.h new file mode 100644 index 00000000..2000bd2e --- /dev/null +++ b/src/core/CalChartSelectTool.h @@ -0,0 +1,82 @@ +#pragma once +/* + * CalChartSelectTool.h + * Represents a way to select Marchers + */ + +/* + Copyright (C) 1995-2012 Garrick Brian Meeker, Richard Michael Powell + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "CalChartTypes.h" +#include "CalChartCoord.h" +#include "CalChartShapes.h" + +#include +#include +#include +#include + +/** + * CalChart MovePoints + * MovePoints represent the way that a user may move Marchers around on a field. These objects control both the shapes + * that should be drawn to represent the move, but also the calculations on where the marchers will be after they move. + * This allows the UI to create objects that represent how the user wants to move marchers on the field. The "what" to draw + * is returned by reading the ShapeList of the Move Points, and TransformPoints translates each point position to the new placement. + * + * Some MovePoints objects require multiple "clicks", for example like Rotate. You would first click at the radius, then click + * and drag around the arc. So multiple clicks state are stored in each MovePoint. Only when the "IsReadyForMoving" is true + * does the TransformPoints result in meaningful data. + * + * Because the user may click again in a place they have clicked, we have the concept of "Done". For example, on a rotate move + * command the user may press on the Radius twice, for example to re-center. So the IsDone means that this MovePoints object + * will not handle any more "Clicks. + */ + + +namespace CalChart { +class Shape; + +enum class Select { + Box, + Poly, + Lasso, + Swap, +}; + +class SelectTool { +public: + SelectTool(CalChart::Select, CalChart::Coord start, std::function userScale); + ~SelectTool() = default; + + CalChart::Shape const* GetShapeList() const { return mLassoShape.get(); } + std::optional GetPolygon() const { return mLassoShape ? mLassoShape->GetPolygon() : std::optional{}; } + + // provides both the high resolution point and the low resolution point. + void OnMove(CalChart::Coord p, CalChart::Coord snapped_p); + + void OnClickUp(CalChart::Coord); + virtual bool SelectDone() const { return mSelectComplete; } + +protected: + + std::unique_ptr mLassoShape; + CalChart::Select mSelect = CalChart::Select::Box; + bool mSelectComplete = true; + std::function mUserScale; +}; + +} diff --git a/src/core/cc_shapes.cpp b/src/core/CalChartShapes.cpp similarity index 59% rename from src/core/cc_shapes.cpp rename to src/core/CalChartShapes.cpp index ac1e3775..708d4696 100644 --- a/src/core/cc_shapes.cpp +++ b/src/core/CalChartShapes.cpp @@ -1,5 +1,5 @@ /* - * cc_shapes.cpp + * CalChartShapes.cpp * Implementation for calchart selector shapes */ @@ -25,91 +25,133 @@ #include #include "cc_drawcommand.h" -#include "cc_shapes.h" +#include "CalChartShapes.h" namespace CalChart { -void Shape_1point::OnMove(const Coord& p, const Coord&) +static bool CrossesLine(Coord start, Coord end, Coord p) +{ + if (start.y > end.y) { + if (!((p.y <= start.y) && (p.y > end.y))) { + return false; + } + } else { + if (!((p.y <= end.y) && (p.y > start.y))) { + return false; + } + } + if (p.x >= ((end.x - start.x) * (p.y - start.y) / (end.y - start.y) + start.x)) { + return true; + } + return false; +} + +// Test if inside polygon using odd-even rule +bool Inside(Coord p, RawPolygon_t const& polygon) +{ + auto parity = false; + if (polygon.size() < 2) { + return parity; + } + for (auto prev = polygon.begin(), next = prev + 1; next != polygon.end(); + ++prev, ++next) { + if (CrossesLine(*prev, *next, p)) { + parity = !parity; + } + } + // don't forget the first one: + if (CrossesLine(polygon.back(), polygon.front(), p)) { + parity = !parity; + } + + return parity; +} + + +void Shape_1point::OnMove(Coord p, Coord) { MoveOrigin(p); } -void Shape_crosshairs::OnMove(const Coord&, const Coord& snapped_p) +void Shape_crosshairs::OnMove(Coord, Coord snapped_p) { MoveOrigin(snapped_p); } -std::vector Shape_crosshairs::GetCC_DrawCommand(float x, - float y) const +std::vector Shape_crosshairs::GetCC_DrawCommand(float x, float y) const { - std::vector result; - result.emplace_back(origin.x + x - crosshairs_width, origin.y + y - crosshairs_width, - origin.x + x + crosshairs_width, origin.y + y + crosshairs_width); - result.emplace_back(origin.x + x + crosshairs_width, origin.y + y - crosshairs_width, - origin.x + x - crosshairs_width, origin.y + y + crosshairs_width); - return result; + return { + DrawCommand( origin.x + x - crosshairs_width, origin.y + y - crosshairs_width, origin.x + x + crosshairs_width, origin.y + y + crosshairs_width ), + DrawCommand( origin.x + x + crosshairs_width, origin.y + y - crosshairs_width, origin.x + x - crosshairs_width, origin.y + y + crosshairs_width ), + }; } -void Shape_2point::OnMove(const Coord& p, const Coord&) +void Shape_2point::OnMove(Coord p, Coord) { MovePoint(p); } -void Shape_line::OnMove(const Coord&, const Coord& snapped_p) +std::optional Shape_2point::GetPolygon() const +{ + return { { + Coord(origin.x, origin.y), + Coord(point.x, origin.y), + Coord(point.x, point.y), + Coord(origin.x, point.y), + } }; +} + +void Shape_line::OnMove(Coord, Coord snapped_p) { MovePoint(snapped_p); } -std::vector Shape_line::GetCC_DrawCommand(float x, - float y) const +std::vector Shape_line::GetCC_DrawCommand(float x, float y) const { - std::vector result; - result.emplace_back(origin.x + x, origin.y + y, point.x + x, point.y + y); - return result; + return { + DrawCommand(origin.x + x, origin.y + y, point.x + x, point.y + y) + }; } -void Shape_x::OnMove(const Coord&, const Coord& snapped_p) +void Shape_x::OnMove(Coord, Coord snapped_p) { MovePoint(snapped_p); } -std::vector Shape_x::GetCC_DrawCommand(float x, - float y) const +std::vector Shape_x::GetCC_DrawCommand(float x, float y) const { - std::vector result; - result.emplace_back(origin.x + x, origin.y + y, point.x + x, point.y + y); - result.emplace_back(point.x + x, origin.y + y, origin.x + x, point.y + y); - return result; + return { + DrawCommand(origin.x + x, origin.y + y, point.x + x, point.y + y), + DrawCommand(point.x + x, origin.y + y, origin.x + x, point.y + y), + }; } -void Shape_cross::OnMove(const Coord&, const Coord& snapped_p) +void Shape_cross::OnMove(Coord, Coord snapped_p) { MovePoint(snapped_p); } -std::vector Shape_cross::GetCC_DrawCommand(float x, - float y) const +std::vector Shape_cross::GetCC_DrawCommand(float x, float y) const { - std::vector result; - result.emplace_back(origin.x + (point.x - origin.x) / 2 + x, origin.y + y, origin.x + (point.x - origin.x) / 2 + x, point.y + y); - result.emplace_back(origin.x + x, origin.y + (point.y - origin.y) / 2 + y, point.x + x, origin.y + (point.y - origin.y) / 2 + y); - return result; + return { + DrawCommand(origin.x + (point.x - origin.x) / 2 + x, origin.y + y, origin.x + (point.x - origin.x) / 2 + x, point.y + y), + DrawCommand(origin.x + x, origin.y + (point.y - origin.y) / 2 + y, point.x + x, origin.y + (point.y - origin.y) / 2 + y), + }; } -void Shape_ellipse::OnMove(const Coord&, const Coord& snapped_p) +void Shape_ellipse::OnMove(Coord, Coord snapped_p) { MovePoint(snapped_p); } -std::vector Shape_ellipse::GetCC_DrawCommand(float x, - float y) const +std::vector Shape_ellipse::GetCC_DrawCommand(float x, float y) const { - std::vector result; - result.emplace_back(DrawCommand::Ellipse, origin.x + x, origin.y + y, point.x + x, point.y + y); - return result; + return { + DrawCommand(DrawCommand::Ellipse, origin.x + x, origin.y + y, point.x + x, point.y + y), + }; } -void Shape_angline::OnMove(const Coord&, const Coord& snapped_p) +void Shape_angline::OnMove(Coord, Coord snapped_p) { auto o = GetOrigin(); auto p1 = snapped_p - o; @@ -119,27 +161,26 @@ void Shape_angline::OnMove(const Coord&, const Coord& snapped_p) MovePoint(p1); } -Shape_arc::Shape_arc(const Coord& c, const Coord& p) +Shape_arc::Shape_arc(Coord c, Coord p) : Shape_2point(c, p) { auto p1 = p - c; r = r0 = p1.Direction() * M_PI / 180.0; - d = p1.Magnitude() * COORD_DECIMAL; + d = p1.Magnitude() * kCoordDecimal; } -Shape_arc::Shape_arc(const Coord& c, const Coord& p1, - const Coord& p2) +Shape_arc::Shape_arc(Coord c, Coord p1, Coord p2) : Shape_2point(c, p2) { auto p = p1 - c; r0 = p.Direction(); - d = p.Magnitude() * COORD_DECIMAL; + d = p.Magnitude() * kCoordDecimal; r = (p2 - c).Direction(); } -void Shape_arc::OnMove(const Coord&, const Coord& snapped_p) +void Shape_arc::OnMove(Coord, Coord snapped_p) { auto p1 = snapped_p; @@ -149,24 +190,19 @@ void Shape_arc::OnMove(const Coord&, const Coord& snapped_p) MovePoint(p1); } -std::vector Shape_arc::GetCC_DrawCommand(float x, - float y) const +std::vector Shape_arc::GetCC_DrawCommand(float x, float y) const { - std::vector result; if (GetAngle() < 0.0 || GetAngle() > 180.0) { - result.emplace_back(origin.x + x + d * cos(r), origin.y + y + -d * sin(r), - origin.x + x + d * cos(r0), origin.y + y + -d * sin(r0), - origin.x + x, origin.y + y); - } else { - result.emplace_back(origin.x + x + d * cos(r0), origin.y + y + -d * sin(r0), - origin.x + x + d * cos(r), origin.y + y + -d * sin(r), - origin.x + x, origin.y + y); + return { + DrawCommand(origin.x + x + d * cos(r), origin.y + y + -d * sin(r), origin.x + x + d * cos(r0), origin.y + y + -d * sin(r0), origin.x + x, origin.y + y), + }; } - return result; + return { + DrawCommand(origin.x + x + d * cos(r0), origin.y + y + -d * sin(r0), origin.x + x + d * cos(r), origin.y + y + -d * sin(r), origin.x + x, origin.y + y), + }; } -std::vector Shape_rect::GetCC_DrawCommand(float x, - float y) const +std::vector Shape_rect::GetCC_DrawCommand(float x, float y) const { float w, h; @@ -184,23 +220,24 @@ std::vector Shape_rect::GetCC_DrawCommand(float x, y += point.y; h = origin.y - point.y + 1; } - std::vector result; if ((w > 1) && (h > 1)) { - result.emplace_back(x, y, x + w, y); - result.emplace_back(x + w, y, x + w, y + h); - result.emplace_back(x + w, y + h, x, y + h); - result.emplace_back(x, y + h, x, y); + return { + DrawCommand(x, y, x + w, y), + DrawCommand(x + w, y, x + w, y + h), + DrawCommand(x + w, y + h, x, y + h), + DrawCommand(x, y + h, x, y), + }; } - return result; + return {}; } -Lasso::Lasso(const Coord& p) { Append(p); } +Lasso::Lasso(Coord p) { Append(p); } -void Lasso::OnMove(const Coord& p, const Coord&) { Append(p); } +void Lasso::OnMove(Coord p, Coord) { Append(p); } void Lasso::Clear() { pntlist.clear(); } -void Lasso::Start(const Coord& p) +void Lasso::Start(Coord p) { Clear(); Append(p); @@ -214,7 +251,7 @@ void Lasso::End() } } -void Lasso::Append(const Coord& p) { pntlist.push_back(p); } +void Lasso::Append(Coord p) { pntlist.push_back(p); } float Lasso::GetDistance() const { @@ -279,29 +316,7 @@ std::vector Lasso::GetPointsOnLine(int numpnts) const return results; } -// Test if inside polygon using odd-even rule -bool Lasso::Inside(const Coord& p) const -{ - bool parity = false; - if (pntlist.size() < 2) { - return parity; - } - for (auto prev = pntlist.begin(), next = prev + 1; next != pntlist.end(); - ++prev, ++next) { - if (CrossesLine(*prev, *next, p)) { - parity = !parity; - } - } - // don't forget the first one: - if (CrossesLine(pntlist.back(), pntlist.front(), p)) { - parity = !parity; - } - - return parity; -} - -std::vector Lasso::GetCC_DrawCommand(float x, - float y) const +std::vector Lasso::GetCC_DrawCommand(float x, float y) const { std::vector result; if (pntlist.size() > 1) { @@ -314,37 +329,19 @@ std::vector Lasso::GetCC_DrawCommand(float x, return result; } -void Lasso::Drag(const Coord& p) +void Lasso::Drag(Coord p) { if (!pntlist.empty()) { pntlist.back() = p; } } -bool Lasso::CrossesLine(const Coord& start, const Coord& end, - const Coord& p) -{ - if (start.y > end.y) { - if (!((p.y <= start.y) && (p.y > end.y))) { - return false; - } - } else { - if (!((p.y <= end.y) && (p.y > start.y))) { - return false; - } - } - if (p.x >= ((end.x - start.x) * (p.y - start.y) / (end.y - start.y) + start.x)) { - return true; - } - return false; -} - -Poly::Poly(const Coord& p) +Poly::Poly(Coord p) : Lasso(p) { // add end point Append(p); } -void Poly::OnMove(const Coord& p, const Coord&) { Drag(p); } +void Poly::OnMove(Coord p, Coord) { Drag(p); } } diff --git a/src/core/CalChartShapes.h b/src/core/CalChartShapes.h new file mode 100644 index 00000000..7834098e --- /dev/null +++ b/src/core/CalChartShapes.h @@ -0,0 +1,236 @@ +#pragma once +/* + * CalChartShapes.h + * Header for calchart selector shapes + */ + +/* + Copyright (C) 1995-2011 Garrick Brian Meeker, Richard Michael Powell + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "CalChartCoord.h" +#include +#include + +/** + * CalChart Shapes + * These are general objects that represent Shapes in CalChart. + * A shape object returns a vector of DrawCommands that represent how to draw the shape. This keeps the implementation details + * of "how" to draw seperate from the "what" to draw, allowing reusablity. + */ + +namespace CalChart { +struct DrawCommand; + +using RawPolygon_t = std::vector; +bool Inside(Coord p, RawPolygon_t const& polygon); + +class Shape { +public: + virtual ~Shape() = default; + + virtual std::vector GetCC_DrawCommand(float x, float y) const = 0; + virtual void OnMove(Coord p, Coord snapped_p) = 0; + virtual std::optional GetPolygon() const { return {}; } +}; + +class Shape_1point : public Shape { +public: + Shape_1point(Coord p) + : origin(p) + { + } + + virtual void OnMove(Coord p, Coord snapped_p) override; + void MoveOrigin(Coord p) { origin = p; } + auto GetOrigin() const { return origin; } + +protected: + Coord origin; +}; + +class Shape_crosshairs : public Shape_1point { +public: + Shape_crosshairs(Coord p, Coord::units width) + : Shape_1point(p) + , crosshairs_width(width) + { + } + + virtual void OnMove(Coord p, Coord snapped_p) override; + virtual std::vector GetCC_DrawCommand(float x, float y) const override; + +protected: + Coord::units crosshairs_width; +}; + +class Shape_2point : public Shape_1point { +public: + Shape_2point(Coord p) + : Shape_1point(p) + , point(p) + { + } + Shape_2point(Coord p1, Coord p2) + : Shape_1point(p1) + , point(p2) + { + } + + virtual void OnMove(Coord p, Coord snapped_p) override; + void MovePoint(Coord p) { point = p; } + auto GetPoint() const { return point; } + std::optional GetPolygon() const override; + +protected: + Coord point; +}; + +class Shape_line : public Shape_2point { +public: + Shape_line(Coord p) + : Shape_2point(p) + { + } + Shape_line(Coord p1, Coord p2) + : Shape_2point(p1, p2) + { + } + + virtual void OnMove(Coord p, Coord snapped_p) override; + virtual std::vector GetCC_DrawCommand(float x, float y) const override; +}; + +class Shape_x : public Shape_2point { +public: + Shape_x(Coord p) + : Shape_2point(p) + { + } + Shape_x(Coord p1, Coord p2) + : Shape_2point(p1, p2) + { + } + + virtual void OnMove(Coord p, Coord snapped_p) override; + virtual std::vector GetCC_DrawCommand(float x, float y) const override; +}; + +class Shape_cross : public Shape_2point { +public: + Shape_cross(Coord p) + : Shape_2point(p) + { + } + Shape_cross(Coord p1, Coord p2) + : Shape_2point(p1, p2) + { + } + + virtual void OnMove(Coord p, Coord snapped_p) override; + virtual std::vector GetCC_DrawCommand(float x, float y) const override; +}; + +class Shape_ellipse : public Shape_2point { +public: + Shape_ellipse(Coord p) + : Shape_2point(p) + { + } + Shape_ellipse(Coord p1, Coord p2) + : Shape_2point(p1, p2) + { + } + + virtual void OnMove(Coord p, Coord snapped_p) override; + virtual std::vector GetCC_DrawCommand(float x, float y) const override; +}; + +class Shape_angline : public Shape_line { +public: + Shape_angline(Coord p, Coord refvect) + : Shape_line(p) + , vect(refvect) + , mag(refvect.Magnitude()) + { + } + + virtual void OnMove(Coord p, Coord snapped_p) override; + +private: + Coord vect; + float mag; +}; + +class Shape_arc : public Shape_2point { +public: + Shape_arc(Coord c, Coord p); + Shape_arc(Coord c, Coord p1, Coord p2); + + virtual void OnMove(Coord p, Coord snapped_p) override; + virtual std::vector GetCC_DrawCommand(float x, float y) const override; + + inline auto GetAngle() const { return r - r0; } + +private: + float r, r0, d; +}; + +class Shape_rect : public Shape_2point { +public: + Shape_rect(Coord p) + : Shape_2point(p) + { + } + Shape_rect(Coord p1, Coord p2) + : Shape_2point(p1, p2) + { + } + + virtual std::vector GetCC_DrawCommand(float x, float y) const override; +}; + +class Lasso : public Shape { +public: + Lasso(Coord p); + + virtual void OnMove(Coord p, Coord snapped_p) override; + void Clear(); + void Start(Coord p); + void End(); + void Append(Coord p); + virtual std::vector GetCC_DrawCommand(float x, float y) const override; + void Drag(Coord p); + inline const Coord* FirstPoint() const + { + return pntlist.empty() ? nullptr : &pntlist.front(); + } + std::vector GetPointsOnLine(int numpnts) const; + auto NumPoints() const { return pntlist.size(); } + std::optional GetPolygon() const override { return { pntlist }; } + +private: + float GetDistance() const; + std::vector pntlist; +}; + +class Poly : public Lasso { +public: + Poly(Coord p); + + virtual void OnMove(Coord p, Coord snapped_p) override; +}; +} diff --git a/src/core/cc_types.h b/src/core/CalChartTypes.h similarity index 76% rename from src/core/cc_types.h rename to src/core/CalChartTypes.h index 90a94837..2457f680 100644 --- a/src/core/cc_types.h +++ b/src/core/CalChartTypes.h @@ -56,33 +56,4 @@ std::string GetLongNameForSymbol(SYMBOL_TYPE which); SYMBOL_TYPE GetSymbolForName(const std::string& name); } -enum class CC_DRAG { - NONE, - BOX, - POLY, - LASSO, - LINE, - CROSSHAIRS, - SHAPE_ELLIPSE, - SHAPE_X, - SHAPE_CROSS, - SWAP, -}; - -enum CC_MOVE_MODES { - CC_MOVE_NORMAL, - CC_MOVE_SHAPE_LINE, - CC_MOVE_SHAPE_X, - CC_MOVE_SHAPE_CROSS, - CC_MOVE_SHAPE_RECTANGLE, - CC_MOVE_SHAPE_ELLIPSE, - CC_MOVE_SHAPE_DRAW, - CC_MOVE_LINE, - CC_MOVE_ROTATE, - CC_MOVE_SHEAR, - CC_MOVE_REFL, - CC_MOVE_SIZE, - CC_MOVE_GENIUS, -}; - typedef std::set SelectionList; diff --git a/src/core/animate_types.h b/src/core/animate_types.h index 55ddc448..20cb4b8c 100644 --- a/src/core/animate_types.h +++ b/src/core/animate_types.h @@ -21,8 +21,9 @@ along with this program. If not, see . */ -#include "cc_coord.h" -#include "cc_types.h" +#include "CalChartCoord.h" +#include "CalChartTypes.h" +#include "math_utils.h" #include namespace CalChart { @@ -112,4 +113,33 @@ struct ErrorMarker { } }; +inline AnimateDir AnimGetDirFromAngle(float ang) +{ + ang = NormalizeAngle(ang); + // rotate angle by 22.5: + ang += 22.5; + size_t quadrant = ang / 45.0; + switch (quadrant) { + case 0: + return ANIMDIR_N; + case 1: + return ANIMDIR_NW; + case 2: + return ANIMDIR_W; + case 3: + return ANIMDIR_SW; + case 4: + return ANIMDIR_S; + case 5: + return ANIMDIR_SE; + case 6: + return ANIMDIR_E; + case 7: + return ANIMDIR_NE; + case 8: + return ANIMDIR_N; + } + return ANIMDIR_N; +} + } diff --git a/src/core/cc_drawcommand.h b/src/core/cc_drawcommand.h index e86c854c..66c21228 100644 --- a/src/core/cc_drawcommand.h +++ b/src/core/cc_drawcommand.h @@ -21,7 +21,7 @@ along with this program. If not, see . */ -#include "cc_coord.h" +#include "CalChartCoord.h" namespace CalChart { diff --git a/src/core/cc_point.h b/src/core/cc_point.h index f9dd7f0a..7e63f123 100644 --- a/src/core/cc_point.h +++ b/src/core/cc_point.h @@ -21,8 +21,8 @@ along with this program. If not, see . */ -#include "cc_coord.h" -#include "cc_types.h" +#include "CalChartCoord.h" +#include "CalChartTypes.h" #include #include diff --git a/src/core/cc_shapes.h b/src/core/cc_shapes.h deleted file mode 100644 index f111cb11..00000000 --- a/src/core/cc_shapes.h +++ /dev/null @@ -1,234 +0,0 @@ -#pragma once -/* - * cc_shapes.h - * Header for calchart selector shapes - */ - -/* - Copyright (C) 1995-2011 Garrick Brian Meeker, Richard Michael Powell - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include "cc_coord.h" -#include - -namespace CalChart { -struct DrawCommand; - -class Shape { -public: - virtual ~Shape() = default; - - virtual std::vector GetCC_DrawCommand(float x, - float y) const = 0; - virtual void OnMove(const Coord& p, const Coord& snapped_p) = 0; -}; - -class Shape_1point : public Shape { -public: - Shape_1point(const Coord& p) - : origin(p) - { - } - - virtual void OnMove(const Coord& p, const Coord& snapped_p) override; - void MoveOrigin(const Coord& p) { origin = p; } - auto GetOrigin() const { return origin; } - -protected: - Coord origin; -}; - -class Shape_crosshairs : public Shape_1point { -public: - Shape_crosshairs(const Coord& p, Coord::units width) - : Shape_1point(p) - , crosshairs_width(width) - { - } - - virtual void OnMove(const Coord& p, const Coord& snapped_p) override; - virtual std::vector GetCC_DrawCommand(float x, - float y) const override; - -protected: - Coord::units crosshairs_width; -}; - -class Shape_2point : public Shape_1point { -public: - Shape_2point(const Coord& p) - : Shape_1point(p) - , point(p) - { - } - Shape_2point(const Coord& p1, const Coord& p2) - : Shape_1point(p1) - , point(p2) - { - } - - virtual void OnMove(const Coord& p, const Coord& snapped_p) override; - void MovePoint(const Coord& p) { point = p; } - auto GetPoint() const { return point; } - -protected: - Coord point; -}; - -class Shape_line : public Shape_2point { -public: - Shape_line(const Coord& p) - : Shape_2point(p) - { - } - Shape_line(const Coord& p1, const Coord& p2) - : Shape_2point(p1, p2) - { - } - - virtual void OnMove(const Coord& p, const Coord& snapped_p) override; - virtual std::vector GetCC_DrawCommand(float x, - float y) const override; -}; - -class Shape_x : public Shape_2point { -public: - Shape_x(const Coord& p) - : Shape_2point(p) - { - } - Shape_x(const Coord& p1, const Coord& p2) - : Shape_2point(p1, p2) - { - } - - virtual void OnMove(const Coord& p, const Coord& snapped_p) override; - virtual std::vector GetCC_DrawCommand(float x, - float y) const override; -}; - -class Shape_cross : public Shape_2point { -public: - Shape_cross(const Coord& p) - : Shape_2point(p) - { - } - Shape_cross(const Coord& p1, const Coord& p2) - : Shape_2point(p1, p2) - { - } - - virtual void OnMove(const Coord& p, const Coord& snapped_p) override; - virtual std::vector GetCC_DrawCommand(float x, - float y) const override; -}; - -class Shape_ellipse : public Shape_2point { -public: - Shape_ellipse(const Coord& p) - : Shape_2point(p) - { - } - Shape_ellipse(const Coord& p1, const Coord& p2) - : Shape_2point(p1, p2) - { - } - - virtual void OnMove(const Coord& p, const Coord& snapped_p) override; - virtual std::vector GetCC_DrawCommand(float x, - float y) const override; -}; - -class Shape_angline : public Shape_line { -public: - Shape_angline(const Coord& p, const Coord& refvect) - : Shape_line(p) - , vect(refvect) - , mag(refvect.Magnitude()) - { - } - - virtual void OnMove(const Coord& p, const Coord& snapped_p) override; - -private: - Coord vect; - float mag; -}; - -class Shape_arc : public Shape_2point { -public: - Shape_arc(const Coord& c, const Coord& p); - Shape_arc(const Coord& c, const Coord& p1, const Coord& p2); - - virtual void OnMove(const Coord& p, const Coord& snapped_p) override; - virtual std::vector GetCC_DrawCommand(float x, - float y) const override; - - inline float GetAngle() const { return r - r0; } - -private: - float r, r0, d; -}; - -class Shape_rect : public Shape_2point { -public: - Shape_rect(const Coord& p) - : Shape_2point(p) - { - } - Shape_rect(const Coord& p1, const Coord& p2) - : Shape_2point(p1, p2) - { - } - - virtual std::vector GetCC_DrawCommand(float x, - float y) const override; -}; - -class Lasso : public Shape { -public: - Lasso(const Coord& p); - - virtual void OnMove(const Coord& p, const Coord& snapped_p) override; - void Clear(); - void Start(const Coord& p); - void End(); - void Append(const Coord& p); - bool Inside(const Coord& p) const; - virtual std::vector GetCC_DrawCommand(float x, - float y) const override; - void Drag(const Coord& p); - inline const Coord* FirstPoint() const - { - return pntlist.empty() ? nullptr : &pntlist.front(); - } - std::vector GetPointsOnLine(int numpnts) const; - auto NumPoints() const { return pntlist.size(); } - -private: - static bool CrossesLine(const Coord& start, const Coord& end, - const Coord& p); - float GetDistance() const; - std::vector pntlist; -}; - -class Poly : public Lasso { -public: - Poly(const Coord& p); - - virtual void OnMove(const Coord& p, const Coord& snapped_p) override; -}; -} diff --git a/src/core/cc_sheet.cpp b/src/core/cc_sheet.cpp index 96f612ae..c3285627 100644 --- a/src/core/cc_sheet.cpp +++ b/src/core/cc_sheet.cpp @@ -22,7 +22,7 @@ #include "cc_sheet.h" -#include "animatecommand.h" +#include "CalChartAnimationCommand.h" #include "cc_fileformat.h" #include "cc_parse_errors.h" #include "cc_show.h" @@ -710,7 +710,7 @@ std::vector Sheet::GetSymbols() const return result; } -nlohmann::json Sheet::toOnlineViewerJSON(unsigned sheetNum, std::vector dotLabels, const AnimateSheet& compiledSheet) const +nlohmann::json Sheet::toOnlineViewerJSON(unsigned sheetNum, std::vector dotLabels, const AnimationSheet& compiledSheet) const { nlohmann::json j; // TODO; add printed continuities to viewer file manually for now diff --git a/src/core/cc_sheet.h b/src/core/cc_sheet.h index 1a1312a9..e766f28c 100644 --- a/src/core/cc_sheet.h +++ b/src/core/cc_sheet.h @@ -21,13 +21,13 @@ along with this program. If not, see . */ -#include "animate.h" +#include "CalChartAnimation.h" #include "cc_continuity.h" #include "cc_fileformat.h" #include "cc_image.h" #include "cc_point.h" #include "cc_text.h" -#include "cc_types.h" +#include "CalChartTypes.h" #include #include @@ -119,7 +119,7 @@ class Sheet { * @return A JSON which could represent this sheet in * a '.viewer' file. */ - nlohmann::json toOnlineViewerJSON(unsigned sheetNum, std::vector dotLabels, const AnimateSheet& compiledSheet) const; + nlohmann::json toOnlineViewerJSON(unsigned sheetNum, std::vector dotLabels, const AnimationSheet& compiledSheet) const; private: std::vector mAnimationContinuity; diff --git a/src/core/cc_show.cpp b/src/core/cc_show.cpp index 4deaba29..ccc31247 100644 --- a/src/core/cc_show.cpp +++ b/src/core/cc_show.cpp @@ -25,7 +25,7 @@ #include "cc_continuity.h" #include "cc_fileformat.h" #include "cc_point.h" -#include "cc_shapes.h" +#include "CalChartShapes.h" #include "cc_sheet.h" #include "ccvers.h" @@ -79,8 +79,7 @@ std::unique_ptr Show::Create_CC_show(ShowMode const& mode, std::istream& s // Create a new show Show::Show(ShowMode const& mode) - : mSheetNum(0) - , mMode(mode) + : mMode(mode) { } @@ -88,8 +87,7 @@ Show::Show(ShowMode const& mode) // Recommend that you don't touch this unless you know what you are doing. // Constructor for shows 3.3 and ealier. Show::Show(ShowMode const& mode, std::istream& stream, ParseErrorHandlers const* correction) - : mSheetNum(0) - , mMode(mode) + : mMode(mode) { // caller should have stripped off INGL and GURK headers /* @@ -156,8 +154,7 @@ Show::Show(ShowMode const& mode, std::istream& stream, ParseErrorHandlers const* // -=-=-=-=-=- LEGACY CODE -=-=-=-=-=- Show::Show(ShowMode const& mode, const uint8_t* ptr, size_t size, ParseErrorHandlers const* correction) - : mSheetNum(0) - , mMode(mode) + : mMode(mode) { // caller should have stripped off INGL and GURK headers @@ -536,7 +533,7 @@ SelectionList Show::MakeUnselectAll() const return {}; } -void Show::SetSelection(const SelectionList& sl) +void Show::SetSelectionList(const SelectionList& sl) { mSelectionList = sl; } @@ -570,16 +567,16 @@ SelectionList Show::MakeToggleSelection(const SelectionList& sl) const // toggle selection means toggle it as selected to unselected // otherwise, always select it -SelectionList Show::MakeSelectWithLasso(const Lasso& lasso, int ref) const +SelectionList Show::MakeSelectWithinPolygon(CalChart::RawPolygon_t const& polygon, int ref) const { - if (!lasso.FirstPoint()) { + if (polygon.size() < 3) { return {}; } SelectionList sl; auto sheet = GetCurrentSheet(); for (int i = 0; i < GetNumPoints(); i++) { - if (lasso.Inside(sheet->GetPosition(i, ref))) { + if (CalChart::Inside(sheet->GetPosition(i, ref), polygon)) { sl.insert(i); } } @@ -626,11 +623,11 @@ nlohmann::json Show::toOnlineViewerJSON(const Animation& compiledShow) const j["labels"] = ptLabels; std::vector sheetData; - auto animateSheetIter = compiledShow.sheetsBegin(); + auto animationSheetIter = compiledShow.sheetsBegin(); auto sheetIndex = 0; for (auto showSheetIter = GetSheetBegin(); showSheetIter != GetSheetEnd(); ++showSheetIter) { - sheetData.push_back(showSheetIter->toOnlineViewerJSON(sheetIndex + 1, ptLabels, *animateSheetIter)); - ++animateSheetIter; + sheetData.push_back(showSheetIter->toOnlineViewerJSON(sheetIndex + 1, ptLabels, *animationSheetIter)); + ++animationSheetIter; ++sheetIndex; } @@ -646,17 +643,17 @@ Show_command_pair Show::Create_SetCurrentSheetCommand(int n) const return { action, reaction }; } -Show_command_pair Show::Create_SetSelectionCommand(const SelectionList& sl) const +Show_command_pair Show::Create_SetSelectionListCommand(const SelectionList& sl) const { - auto action = [sl](Show& show) { show.SetSelection(sl); }; - auto reaction = [sl = mSelectionList](Show& show) { show.SetSelection(sl); }; + auto action = [sl](Show& show) { show.SetSelectionList(sl); }; + auto reaction = [sl = mSelectionList](Show& show) { show.SetSelectionList(sl); }; return { action, reaction }; } Show_command_pair Show::Create_SetCurrentSheetAndSelectionCommand(int n, const SelectionList& sl) const { - auto action = [n, sl](Show& show) { show.SetCurrentSheet(n); show.SetSelection(sl); }; - auto reaction = [n = mSheetNum, sl = mSelectionList](Show& show) { show.SetCurrentSheet(n); show.SetSelection(sl); }; + auto action = [n, sl](Show& show) { show.SetCurrentSheet(n); show.SetSelectionList(sl); }; + auto reaction = [n = mSheetNum, sl = mSelectionList](Show& show) { show.SetCurrentSheet(n); show.SetSelectionList(sl); }; return { action, reaction }; } @@ -810,7 +807,7 @@ Show_command_pair Show::Create_DeletePointsCommand() const { auto action = [selectionList = mSelectionList](Show& show) { show.DeletePoints(selectionList); - show.SetSelection({}); + show.SetSelectionList({}); }; // need to go through and save all the positions and labels for later auto old_labels = mDotLabelAndInstrument; diff --git a/src/core/cc_show.h b/src/core/cc_show.h index 7e71986c..c63f39e8 100644 --- a/src/core/cc_show.h +++ b/src/core/cc_show.h @@ -22,9 +22,12 @@ */ #include "cc_fileformat.h" -#include "cc_types.h" +#include "CalChartTypes.h" +#include "CalChartMovePointsTool.h" +#include "CalChartSelectTool.h" +#include "CalChartShapes.h" -#include "animate.h" +#include "CalChartAnimation.h" #include "cc_sheet.h" #include "modes.h" @@ -36,7 +39,6 @@ #include namespace CalChart { -class Lasso; class Show; class Sheet; struct ParseErrorHandlers; @@ -77,7 +79,7 @@ class Show { // Create command, consists of an action and undo action Show_command_pair Create_SetCurrentSheetCommand(int n) const; - Show_command_pair Create_SetSelectionCommand(const SelectionList& sl) const; + Show_command_pair Create_SetSelectionListCommand(const SelectionList& sl) const; Show_command_pair Create_SetCurrentSheetAndSelectionCommand(int n, const SelectionList& sl) const; Show_command_pair Create_SetShowModeCommand(CalChart::ShowMode const& newmode) const; Show_command_pair Create_SetupMarchersCommand(std::vector> const& labelsAndInstruments, int numColumns, Coord const& new_march_position) const; @@ -134,7 +136,7 @@ class Show { SelectionList MakeAddToSelection(const SelectionList& sl) const; SelectionList MakeRemoveFromSelection(const SelectionList& sl) const; SelectionList MakeToggleSelection(const SelectionList& sl) const; - SelectionList MakeSelectWithLasso(const Lasso& lasso, int ref) const; + SelectionList MakeSelectWithinPolygon(CalChart::RawPolygon_t const& polygon, int ref) const; SelectionList MakeSelectBySymbol(SYMBOL_TYPE i) const; SelectionList MakeSelectByInstrument(std::string const& instrumentName) const; SelectionList MakeSelectByLabel(std::string const& labelName) const; @@ -158,7 +160,7 @@ class Show { void InsertSheet(const Sheet& nsheet, int sheetidx); void InsertSheet(const Sheet_container_t& nsheet, int sheetidx); void SetCurrentSheet(int n); - void SetSelection(const SelectionList& sl); + void SetSelectionList(const SelectionList& sl); void SetNumPoints(std::vector> const& labelsAndInstruments, int columns, Coord const& new_march_position); void DeletePoints(SelectionList const& sl); @@ -180,13 +182,15 @@ class Show { // members std::string mDescr; - Sheet_container_t mSheets; // labels and instruments go hand in hand, put them together to make sure we don't have extras or missing std::vector> mDotLabelAndInstrument; - SelectionList mSelectionList; // order of selections - int mSheetNum; + Sheet_container_t mSheets; ShowMode mMode; + // the more "transient" settings, representing a current set of manipulations by the user + SelectionList mSelectionList; // order of selections + int mSheetNum{}; + // unit tests friend void Show_UnitTests(); static void CC_show_round_trip_test(); diff --git a/src/core/cc_text.h b/src/core/cc_text.h index fa8a2287..082e5ac0 100644 --- a/src/core/cc_text.h +++ b/src/core/cc_text.h @@ -21,7 +21,7 @@ along with this program. If not, see . */ -#include "cc_types.h" +#include "CalChartTypes.h" #include #include diff --git a/src/core/cont.cpp b/src/core/cont.cpp index 2ae7d90a..54bd6f85 100644 --- a/src/core/cont.cpp +++ b/src/core/cont.cpp @@ -21,8 +21,8 @@ */ #include "cont.h" -#include "animatecommand.h" -#include "animatecompile.h" +#include "CalChartAnimationCommand.h" +#include "CalChartAnimationCompile.h" #include "cc_fileformat.h" #include "cc_sheet.h" #include "math_utils.h" @@ -162,16 +162,16 @@ static const std::string ContDefinedValue_strings[] = { "HS", "MM", "SH", "JS", "GV", "M", "DM" }; -int float2int(const ContProcedure* proc, AnimateCompile& anim, float f) +int float2int(const ContProcedure* proc, AnimationCompile& anim, float f) { auto v = (int)floor(f + 0.5); - if (std::abs(f - (float)v) >= COORD_DECIMAL) { + if (std::abs(f - (float)v) >= kCoordDecimal) { anim.RegisterError(ANIMERR_NONINT, proc); } return v; } -unsigned float2unsigned(const ContProcedure* proc, AnimateCompile& anim, +unsigned float2unsigned(const ContProcedure* proc, AnimationCompile& anim, float f) { auto v = float2int(proc, anim, f); @@ -183,7 +183,7 @@ unsigned float2unsigned(const ContProcedure* proc, AnimateCompile& anim, } } -void DoCounterMarch(const ContProcedure& proc, AnimateCompile& anim, +void DoCounterMarch(const ContProcedure& proc, AnimationCompile& anim, const ContPoint& pnt1, const ContPoint& pnt2, const ContValue& stps, const ContValue& dir1, const ContValue& dir2, const ContValue& numbeats) @@ -247,7 +247,7 @@ void DoCounterMarch(const ContProcedure& proc, AnimateCompile& anim, c = v1.DM_Magnitude(); if (c <= beats) { beats -= c; - if (!anim.Append(std::make_shared( + if (!anim.Append(std::make_shared( float2unsigned(&proc, anim, c), v1), &proc)) { return; @@ -267,7 +267,7 @@ void DoCounterMarch(const ContProcedure& proc, AnimateCompile& anim, v1 = CreateVector(d1 + 180.0f, beats); break; } - anim.Append(std::make_shared( + anim.Append(std::make_shared( float2unsigned(&proc, anim, beats), v1), &proc); return; @@ -510,7 +510,7 @@ uint8_t const* ContToken::Deserialize(uint8_t const* begin, uint8_t const* end) } // ContPoint -Coord ContPoint::Get(AnimateCompile& anim) const +Coord ContPoint::Get(AnimationCompile& anim) const { return anim.GetPointPosition(); } @@ -605,7 +605,7 @@ uint8_t const* ContPointUnset::Deserialize(uint8_t const* begin, uint8_t const* } // ContStartPoint -Coord ContStartPoint::Get(AnimateCompile& anim) const +Coord ContStartPoint::Get(AnimationCompile& anim) const { return anim.GetStartingPosition(); } @@ -655,7 +655,7 @@ uint8_t const* ContStartPoint::Deserialize(uint8_t const* begin, uint8_t const* } // ContNextPoint -Coord ContNextPoint::Get(AnimateCompile& anim) const +Coord ContNextPoint::Get(AnimationCompile& anim) const { return anim.GetEndingPosition(this); } @@ -710,7 +710,7 @@ ContRefPoint::ContRefPoint(unsigned n) { } -Coord ContRefPoint::Get(AnimateCompile& anim) const +Coord ContRefPoint::Get(AnimationCompile& anim) const { return anim.GetReferencePointPosition(refnum); } @@ -843,7 +843,7 @@ ContValueFloat::ContValueFloat(float v) { } -float ContValueFloat::Get(AnimateCompile&) const { return val; } +float ContValueFloat::Get(AnimationCompile&) const { return val; } std::ostream& ContValueFloat::Print(std::ostream& os) const { @@ -896,7 +896,7 @@ ContValueDefined::ContValueDefined(ContDefinedValue v) { } -float ContValueDefined::Get(AnimateCompile&) const +float ContValueDefined::Get(AnimationCompile&) const { static const std::map mapping = { { CC_NW, 45.0 }, @@ -993,7 +993,7 @@ ContValueAdd::ContValueAdd(std::unique_ptr v1, std::unique_ptrGet(anim) + val2->Get(anim)); } @@ -1066,7 +1066,7 @@ ContValueSub::ContValueSub(std::unique_ptr v1, std::unique_ptrGet(anim) - val2->Get(anim)); } @@ -1139,7 +1139,7 @@ ContValueMult::ContValueMult(std::unique_ptr v1, std::unique_ptrGet(anim) * val2->Get(anim)); } @@ -1212,7 +1212,7 @@ ContValueDiv::ContValueDiv(std::unique_ptr v1, std::unique_ptrGet(anim); if (IS_ZERO(f)) { @@ -1289,7 +1289,7 @@ ContValueNeg::ContValueNeg(std::unique_ptr v) SetParentPtr_helper(this, val); } -float ContValueNeg::Get(AnimateCompile& anim) const { return -val->Get(anim); } +float ContValueNeg::Get(AnimationCompile& anim) const { return -val->Get(anim); } std::ostream& ContValueNeg::Print(std::ostream& os) const { @@ -1343,7 +1343,7 @@ uint8_t const* ContValueNeg::Deserialize(uint8_t const* begin, uint8_t const* en } // ContValueREM -float ContValueREM::Get(AnimateCompile& anim) const +float ContValueREM::Get(AnimationCompile& anim) const { return anim.GetBeatsRemaining(); } @@ -1398,7 +1398,7 @@ ContValueVar::ContValueVar(unsigned num) { } -float ContValueVar::Get(AnimateCompile& anim) const +float ContValueVar::Get(AnimationCompile& anim) const { return anim.GetVarValue(varnum, this); } @@ -1426,7 +1426,7 @@ std::unique_ptr ContValueVar::clone() const return std::make_unique(varnum); } -void ContValueVar::Set(AnimateCompile& anim, float v) +void ContValueVar::Set(AnimationCompile& anim, float v) { anim.SetVarValue(varnum, v); } @@ -1513,7 +1513,7 @@ ContFuncDir::ContFuncDir(std::unique_ptr p) SetParentPtr_helper(this, pnt); } -float ContFuncDir::Get(AnimateCompile& anim) const +float ContFuncDir::Get(AnimationCompile& anim) const { auto c = pnt->Get(anim); if (c == anim.GetPointPosition()) { @@ -1588,7 +1588,7 @@ ContFuncDirFrom::ContFuncDirFrom(std::unique_ptr start, std::unique_p SetParentPtr_helper(this, pnt_start, pnt_end); } -float ContFuncDirFrom::Get(AnimateCompile& anim) const +float ContFuncDirFrom::Get(AnimationCompile& anim) const { auto start = pnt_start->Get(anim); auto end = pnt_end->Get(anim); @@ -1664,7 +1664,7 @@ ContFuncDist::ContFuncDist(std::unique_ptr p) SetParentPtr_helper(this, pnt); } -float ContFuncDist::Get(AnimateCompile& anim) const +float ContFuncDist::Get(AnimationCompile& anim) const { auto vector = pnt->Get(anim) - anim.GetPointPosition(); return vector.DM_Magnitude(); @@ -1736,7 +1736,7 @@ ContFuncDistFrom::ContFuncDistFrom(std::unique_ptr start, std::unique SetParentPtr_helper(this, pnt_start, pnt_end); } -float ContFuncDistFrom::Get(AnimateCompile& anim) const +float ContFuncDistFrom::Get(AnimationCompile& anim) const { auto vector = pnt_end->Get(anim) - pnt_start->Get(anim); return vector.Magnitude(); @@ -1812,7 +1812,7 @@ ContFuncEither::ContFuncEither(std::unique_ptr d1, std::unique_ptrGet(anim); if (anim.GetPointPosition() == c) { @@ -1902,7 +1902,7 @@ ContFuncOpp::ContFuncOpp(std::unique_ptr d) SetParentPtr_helper(this, dir); } -float ContFuncOpp::Get(AnimateCompile& anim) const +float ContFuncOpp::Get(AnimationCompile& anim) const { return (dir->Get(anim) + 180.0f); } @@ -1975,7 +1975,7 @@ ContFuncStep::ContFuncStep(std::unique_ptr beats, std::unique_ptrGet(anim) - anim.GetPointPosition(); return (c.DM_Magnitude() * numbeats->Get(anim) / blksize->Get(anim)); @@ -2127,7 +2127,7 @@ ContProcSet::ContProcSet(std::unique_ptr vr, std::unique_ptrSet(anim, val->Get(anim)); } @@ -2212,11 +2212,11 @@ uint8_t const* ContProcSet::Deserialize(uint8_t const* begin, uint8_t const* end } // ContProcBlam -void ContProcBlam::Compile(AnimateCompile& anim) +void ContProcBlam::Compile(AnimationCompile& anim) { ContNextPoint np; auto c = np.Get(anim) - anim.GetPointPosition(); - anim.Append(std::make_shared(anim.GetBeatsRemaining(), c), + anim.Append(std::make_shared(anim.GetBeatsRemaining(), c), this); } @@ -2289,7 +2289,7 @@ ContProcCM::ContProcCM(std::unique_ptr p1, std::unique_ptr SetParentPtr_helper(this, pnt1, pnt2, stps, dir1, dir2, numbeats); } -void ContProcCM::Compile(AnimateCompile& anim) +void ContProcCM::Compile(AnimationCompile& anim) { DoCounterMarch(*this, anim, *pnt1, *pnt2, *stps, *dir1, *dir2, *numbeats); } @@ -2374,7 +2374,7 @@ ContProcDMCM::ContProcDMCM(std::unique_ptr p1, std::unique_ptr p) SetParentPtr_helper(this, pnt); } -void ContProcDMHS::Compile(AnimateCompile& anim) +void ContProcDMHS::Compile(AnimationCompile& anim) { short b_hs; @@ -2507,13 +2507,13 @@ void ContProcDMHS::Compile(AnimateCompile& anim) } if (c_dm != 0) { auto b = CoordUnits2Int(c_dm.x); - if (!anim.Append(std::make_shared(std::abs(b), c_dm), + if (!anim.Append(std::make_shared(std::abs(b), c_dm), this)) { return; } } if (c_hs != 0) { - anim.Append(std::make_shared(std::abs(b_hs), c_hs), + anim.Append(std::make_shared(std::abs(b_hs), c_hs), this); } } @@ -2584,16 +2584,16 @@ ContProcEven::ContProcEven(std::unique_ptr steps, std::unique_ptrGet(anim) - anim.GetPointPosition(); auto steps = float2int(this, anim, stps->Get(anim)); if (steps < 0) { - anim.Append(std::make_shared((unsigned)-steps, c, + anim.Append(std::make_shared((unsigned)-steps, c, -c.Direction()), this); } else { - anim.Append(std::make_shared((unsigned)steps, c), this); + anim.Append(std::make_shared((unsigned)steps, c), this); } } @@ -2663,13 +2663,13 @@ ContProcEWNS::ContProcEWNS(std::unique_ptr p) SetParentPtr_helper(this, pnt); } -void ContProcEWNS::Compile(AnimateCompile& anim) +void ContProcEWNS::Compile(AnimationCompile& anim) { auto c1 = pnt->Get(anim) - anim.GetPointPosition(); if (c1.y != 0) { Coord c2{ 0, c1.y }; auto b = CoordUnits2Int(c2.y); - if (!anim.Append(std::make_shared(std::abs(b), c2), + if (!anim.Append(std::make_shared(std::abs(b), c2), this)) { return; } @@ -2677,7 +2677,7 @@ void ContProcEWNS::Compile(AnimateCompile& anim) if (c1.x != 0) { Coord c2{ c1.x, 0 }; auto b = CoordUnits2Int(c2.x); - if (!anim.Append(std::make_shared(std::abs(b), c2), + if (!anim.Append(std::make_shared(std::abs(b), c2), this)) { return; } @@ -2758,7 +2758,7 @@ ContProcFountain::ContProcFountain(std::unique_ptr d1, std::unique_pt SetParentPtr_helper(this, dir1, dir2, stepsize1, stepsize2, pnt); } -void ContProcFountain::Compile(AnimateCompile& anim) +void ContProcFountain::Compile(AnimationCompile& anim) { float a, b, c, d; @@ -2790,7 +2790,7 @@ void ContProcFountain::Compile(AnimateCompile& anim) } else { f1 = e / a; } - if (!anim.Append(std::make_shared( + if (!anim.Append(std::make_shared( float2unsigned(this, anim, f1), v), this)) { return; @@ -2804,7 +2804,7 @@ void ContProcFountain::Compile(AnimateCompile& anim) if (!IS_ZERO(f2)) { v.x = Float2CoordUnits(f2 * a); v.y = Float2CoordUnits(f2 * c); - if (!anim.Append(std::make_shared( + if (!anim.Append(std::make_shared( float2unsigned(this, anim, f2), v), this)) { return; @@ -2814,7 +2814,7 @@ void ContProcFountain::Compile(AnimateCompile& anim) if (!IS_ZERO(f2)) { v.x = Float2CoordUnits(f2 * b); v.y = Float2CoordUnits(f2 * d); - if (!anim.Append(std::make_shared( + if (!anim.Append(std::make_shared( float2unsigned(this, anim, f2), v), this)) { return; @@ -2941,18 +2941,18 @@ ContProcFM::ContProcFM(std::unique_ptr steps, std::unique_ptrGet(anim)); if (b != 0) { auto c = CreateVector(dir->Get(anim), stps->Get(anim)); if (c != 0) { if (b < 0) { - anim.Append(std::make_shared((unsigned)-b, c, + anim.Append(std::make_shared((unsigned)-b, c, -c.Direction()), this); } else { - anim.Append(std::make_shared((unsigned)b, c), this); + anim.Append(std::make_shared((unsigned)b, c), this); } } } @@ -3024,12 +3024,12 @@ ContProcFMTO::ContProcFMTO(std::unique_ptr p) SetParentPtr_helper(this, pnt); } -void ContProcFMTO::Compile(AnimateCompile& anim) +void ContProcFMTO::Compile(AnimationCompile& anim) { auto c = pnt->Get(anim) - anim.GetPointPosition(); if (c != 0) { anim.Append( - std::make_shared((unsigned)c.DM_Magnitude(), c), + std::make_shared((unsigned)c.DM_Magnitude(), c), this); } } @@ -3111,7 +3111,7 @@ ContProcGrid::ContProcGrid(std::unique_ptr g) SetParentPtr_helper(this, grid); } -void ContProcGrid::Compile(AnimateCompile& anim) +void ContProcGrid::Compile(AnimationCompile& anim) { auto gridc = Float2CoordUnits(grid->Get(anim)); @@ -3122,7 +3122,7 @@ void ContProcGrid::Compile(AnimateCompile& anim) c -= anim.GetPointPosition(); if (c != 0) { - anim.Append(std::make_shared(0, c), this); + anim.Append(std::make_shared(0, c), this); } } @@ -3194,7 +3194,7 @@ ContProcHSCM::ContProcHSCM(std::unique_ptr p1, std::unique_ptr p) SetParentPtr_helper(this, pnt); } -void ContProcHSDM::Compile(AnimateCompile& anim) +void ContProcHSDM::Compile(AnimationCompile& anim) { Coord c_hs, c_dm; short b; @@ -3311,14 +3311,14 @@ void ContProcHSDM::Compile(AnimateCompile& anim) b = CoordUnits2Int(c_hs.y); } if (c_hs != 0) { - if (!anim.Append(std::make_shared(std::abs(b), c_hs), + if (!anim.Append(std::make_shared(std::abs(b), c_hs), this)) { return; } } if (c_dm != 0) { b = CoordUnits2Int(c_dm.x); - anim.Append(std::make_shared(std::abs(b), c_dm), this); + anim.Append(std::make_shared(std::abs(b), c_dm), this); } } @@ -3386,10 +3386,10 @@ ContProcMagic::ContProcMagic(std::unique_ptr p) SetParentPtr_helper(this, pnt); } -void ContProcMagic::Compile(AnimateCompile& anim) +void ContProcMagic::Compile(AnimationCompile& anim) { auto c = pnt->Get(anim) - anim.GetPointPosition(); - anim.Append(std::make_shared(0, c), this); + anim.Append(std::make_shared(0, c), this); } std::ostream& ContProcMagic::Print(std::ostream& os) const @@ -3464,7 +3464,7 @@ ContProcMarch::ContProcMarch(std::unique_ptr stepsize, std::unique_pt SetParentPtr_helper(this, stpsize, stps, dir, facedir); } -void ContProcMarch::Compile(AnimateCompile& anim) +void ContProcMarch::Compile(AnimationCompile& anim) { auto b = float2int(this, anim, stps->Get(anim)); if (b != 0) { @@ -3474,15 +3474,15 @@ void ContProcMarch::Compile(AnimateCompile& anim) static_cast(-Float2CoordUnits(sin(rads) * mag)) }; if (c != 0) { if (facedir) - anim.Append(std::make_shared((unsigned)std::abs(b), + anim.Append(std::make_shared((unsigned)std::abs(b), c, facedir->Get(anim)), this); else if (b < 0) { - anim.Append(std::make_shared((unsigned)-b, c, + anim.Append(std::make_shared((unsigned)-b, c, -c.Direction()), this); } else { - anim.Append(std::make_shared((unsigned)b, c), this); + anim.Append(std::make_shared((unsigned)b, c), this); } } } @@ -3579,11 +3579,11 @@ ContProcMT::ContProcMT(std::unique_ptr beats, std::unique_ptrGet(anim)); if (b != 0) { - anim.Append(std::make_shared((unsigned)std::abs(b), + anim.Append(std::make_shared((unsigned)std::abs(b), dir->Get(anim)), this); } @@ -3655,9 +3655,9 @@ ContProcMTRM::ContProcMTRM(std::unique_ptr d) SetParentPtr_helper(this, dir); } -void ContProcMTRM::Compile(AnimateCompile& anim) +void ContProcMTRM::Compile(AnimationCompile& anim) { - anim.Append(std::make_shared(anim.GetBeatsRemaining(), + anim.Append(std::make_shared(anim.GetBeatsRemaining(), dir->Get(anim)), this); } @@ -3726,13 +3726,13 @@ ContProcNSEW::ContProcNSEW(std::unique_ptr p) SetParentPtr_helper(this, pnt); } -void ContProcNSEW::Compile(AnimateCompile& anim) +void ContProcNSEW::Compile(AnimationCompile& anim) { auto c1 = pnt->Get(anim) - anim.GetPointPosition(); if (c1.x != 0) { Coord c2{ c1.x, 0 }; auto b = CoordUnits2Int(c2.x); - if (!anim.Append(std::make_shared(std::abs(b), c2), + if (!anim.Append(std::make_shared(std::abs(b), c2), this)) { return; } @@ -3740,7 +3740,7 @@ void ContProcNSEW::Compile(AnimateCompile& anim) if (c1.y != 0) { Coord c2{ 0, c1.y }; auto b = CoordUnits2Int(c2.y); - if (!anim.Append(std::make_shared(std::abs(b), c2), + if (!anim.Append(std::make_shared(std::abs(b), c2), this)) { return; } @@ -3815,7 +3815,7 @@ ContProcRotate::ContProcRotate(std::unique_ptr angle, std::unique_ptr SetParentPtr_helper(this, ang, stps, pnt); } -void ContProcRotate::Compile(AnimateCompile& anim) +void ContProcRotate::Compile(AnimationCompile& anim) { // Most of the work is converting to polar coordinates auto c = pnt->Get(anim); @@ -3831,7 +3831,7 @@ void ContProcRotate::Compile(AnimateCompile& anim) if (b < 0) { backwards = true; } - anim.Append(std::make_shared( + anim.Append(std::make_shared( (unsigned)std::abs(b), c, // Don't use Magnitude() because // we want Coord numbers diff --git a/src/core/cont.h b/src/core/cont.h index 7597bebe..693650ac 100644 --- a/src/core/cont.h +++ b/src/core/cont.h @@ -21,7 +21,7 @@ along with this program. If not, see . */ -#include "cc_coord.h" +#include "CalChartCoord.h" #include #include @@ -69,7 +69,7 @@ enum class ContType { }; class ContToken; -class AnimateCompile; +class AnimationCompile; // DrawableCont is a structure that describes the continuity for drawing struct DrawableCont { @@ -128,7 +128,7 @@ class ContPoint : public ContToken { public: ContPoint() = default; - virtual Coord Get(AnimateCompile& anim) const; + virtual Coord Get(AnimationCompile& anim) const; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const; virtual std::unique_ptr clone() const; @@ -161,7 +161,7 @@ class ContStartPoint : public ContPoint { public: ContStartPoint() = default; - virtual Coord Get(AnimateCompile& anim) const override; + virtual Coord Get(AnimationCompile& anim) const override; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -182,7 +182,7 @@ class ContNextPoint : public ContPoint { public: ContNextPoint() = default; - virtual Coord Get(AnimateCompile& anim) const override; + virtual Coord Get(AnimationCompile& anim) const override; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -204,7 +204,7 @@ class ContRefPoint : public ContPoint { public: ContRefPoint() = default; ContRefPoint(unsigned n); - virtual Coord Get(AnimateCompile& anim) const override; + virtual Coord Get(AnimationCompile& anim) const override; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -227,7 +227,7 @@ class ContValue : public ContToken { public: ContValue() = default; - virtual float Get(AnimateCompile& anim) const = 0; + virtual float Get(AnimationCompile& anim) const = 0; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const = 0; virtual std::unique_ptr clone() const = 0; @@ -240,7 +240,7 @@ class ContValueUnset : public ContValue { using super = ContValue; public: - virtual float Get(AnimateCompile&) const override { return 0; } + virtual float Get(AnimationCompile&) const override { return 0; } virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -255,7 +255,7 @@ class ContValueFloat : public ContValue { public: ContValueFloat() = default; ContValueFloat(float v); - virtual float Get(AnimateCompile& anim) const override; + virtual float Get(AnimationCompile& anim) const override; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -279,7 +279,7 @@ class ContValueDefined : public ContValue { public: ContValueDefined() = default; ContValueDefined(ContDefinedValue v); - virtual float Get(AnimateCompile& anim) const override; + virtual float Get(AnimationCompile& anim) const override; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -304,7 +304,7 @@ class ContValueAdd : public ContValue { ContValueAdd() = default; ContValueAdd(ContValue* v1, ContValue* v2); ContValueAdd(std::unique_ptr v1, std::unique_ptr v2); - virtual float Get(AnimateCompile& anim) const override; + virtual float Get(AnimationCompile& anim) const override; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -332,7 +332,7 @@ class ContValueSub : public ContValue { ContValueSub() = default; ContValueSub(ContValue* v1, ContValue* v2); ContValueSub(std::unique_ptr v1, std::unique_ptr v2); - virtual float Get(AnimateCompile& anim) const override; + virtual float Get(AnimationCompile& anim) const override; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -360,7 +360,7 @@ class ContValueMult : public ContValue { ContValueMult() = default; ContValueMult(ContValue* v1, ContValue* v2); ContValueMult(std::unique_ptr v1, std::unique_ptr v2); - virtual float Get(AnimateCompile& anim) const override; + virtual float Get(AnimationCompile& anim) const override; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -388,7 +388,7 @@ class ContValueDiv : public ContValue { ContValueDiv() = default; ContValueDiv(ContValue* v1, ContValue* v2); ContValueDiv(std::unique_ptr v1, std::unique_ptr v2); - virtual float Get(AnimateCompile& anim) const override; + virtual float Get(AnimationCompile& anim) const override; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -416,7 +416,7 @@ class ContValueNeg : public ContValue { ContValueNeg() = default; ContValueNeg(ContValue* v); ContValueNeg(std::unique_ptr v); - virtual float Get(AnimateCompile& anim) const override; + virtual float Get(AnimationCompile& anim) const override; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -440,7 +440,7 @@ class ContValueREM : public ContValue { using super = ContValue; public: - virtual float Get(AnimateCompile& anim) const override; + virtual float Get(AnimationCompile& anim) const override; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -462,8 +462,8 @@ class ContValueVar : public ContValue { public: ContValueVar() = default; ContValueVar(unsigned num); - virtual float Get(AnimateCompile& anim) const override; - void Set(AnimateCompile& anim, float v); + virtual float Get(AnimationCompile& anim) const override; + void Set(AnimationCompile& anim, float v); virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -485,7 +485,7 @@ class ContValueVarUnset : public ContValueVar { using super = ContValueVar; public: - virtual float Get(AnimateCompile&) const override { return 0; } + virtual float Get(AnimationCompile&) const override { return 0; } virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -501,7 +501,7 @@ class ContFuncDir : public ContValue { ContFuncDir() = default; ContFuncDir(ContPoint* p); ContFuncDir(std::unique_ptr p); - virtual float Get(AnimateCompile& anim) const override; + virtual float Get(AnimationCompile& anim) const override; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -528,7 +528,7 @@ class ContFuncDirFrom : public ContValue { ContFuncDirFrom() = default; ContFuncDirFrom(ContPoint* start, ContPoint* end); ContFuncDirFrom(std::unique_ptr start, std::unique_ptr end); - virtual float Get(AnimateCompile& anim) const override; + virtual float Get(AnimationCompile& anim) const override; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -556,7 +556,7 @@ class ContFuncDist : public ContValue { ContFuncDist() = default; ContFuncDist(ContPoint* p); ContFuncDist(std::unique_ptr p); - virtual float Get(AnimateCompile& anim) const override; + virtual float Get(AnimationCompile& anim) const override; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -583,7 +583,7 @@ class ContFuncDistFrom : public ContValue { ContFuncDistFrom() = default; ContFuncDistFrom(ContPoint* start, ContPoint* end); ContFuncDistFrom(std::unique_ptr start, std::unique_ptr end); - virtual float Get(AnimateCompile& anim) const override; + virtual float Get(AnimationCompile& anim) const override; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -611,7 +611,7 @@ class ContFuncEither : public ContValue { ContFuncEither() = default; ContFuncEither(ContValue* d1, ContValue* d2, ContPoint* p); ContFuncEither(std::unique_ptr d1, std::unique_ptr d2, std::unique_ptr p); - virtual float Get(AnimateCompile& anim) const override; + virtual float Get(AnimationCompile& anim) const override; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -640,7 +640,7 @@ class ContFuncOpp : public ContValue { ContFuncOpp() = default; ContFuncOpp(ContValue* d); ContFuncOpp(std::unique_ptr d); - virtual float Get(AnimateCompile& anim) const override; + virtual float Get(AnimationCompile& anim) const override; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -667,7 +667,7 @@ class ContFuncStep : public ContValue { ContFuncStep() = default; ContFuncStep(ContValue* beats, ContValue* blocksize, ContPoint* p); ContFuncStep(std::unique_ptr beats, std::unique_ptr blocksize, std::unique_ptr p); - virtual float Get(AnimateCompile& anim) const override; + virtual float Get(AnimationCompile& anim) const override; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -694,7 +694,7 @@ class ContProcedure : public ContToken { public: ContProcedure() = default; - virtual void Compile(AnimateCompile& anim) = 0; + virtual void Compile(AnimationCompile& anim) = 0; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const = 0; virtual std::unique_ptr clone() const = 0; @@ -708,7 +708,7 @@ class ContProcUnset : public ContProcedure { using super = ContProcedure; public: - virtual void Compile(AnimateCompile&) override { } + virtual void Compile(AnimationCompile&) override { } virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -725,7 +725,7 @@ class ContProcSet : public ContProcedure { ContProcSet() = default; ContProcSet(ContValueVar* vr, ContValue* v); ContProcSet(std::unique_ptr vr, std::unique_ptr v); - virtual void Compile(AnimateCompile& anim) override; + virtual void Compile(AnimationCompile& anim) override; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -753,7 +753,7 @@ class ContProcBlam : public ContProcedure { using super = ContProcedure; public: - virtual void Compile(AnimateCompile& anim) override; + virtual void Compile(AnimationCompile& anim) override; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -778,7 +778,7 @@ class ContProcCM : public ContProcedure { ContValue* d2, ContValue* beats); ContProcCM(std::unique_ptr p1, std::unique_ptr p2, std::unique_ptr steps, std::unique_ptr d1, std::unique_ptr d2, std::unique_ptr beats); - virtual void Compile(AnimateCompile& anim) override; + virtual void Compile(AnimationCompile& anim) override; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -807,7 +807,7 @@ class ContProcDMCM : public ContProcedure { ContProcDMCM() = default; ContProcDMCM(ContPoint* p1, ContPoint* p2, ContValue* beats); ContProcDMCM(std::unique_ptr p1, std::unique_ptr p2, std::unique_ptr beats); - virtual void Compile(AnimateCompile& anim) override; + virtual void Compile(AnimationCompile& anim) override; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -836,7 +836,7 @@ class ContProcDMHS : public ContProcedure { ContProcDMHS() = default; ContProcDMHS(ContPoint* p); ContProcDMHS(std::unique_ptr p); - virtual void Compile(AnimateCompile& anim) override; + virtual void Compile(AnimationCompile& anim) override; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -864,7 +864,7 @@ class ContProcEven : public ContProcedure { ContProcEven() = default; ContProcEven(ContValue* steps, ContPoint* p); ContProcEven(std::unique_ptr steps, std::unique_ptr p); - virtual void Compile(AnimateCompile& anim) override; + virtual void Compile(AnimationCompile& anim) override; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -893,7 +893,7 @@ class ContProcEWNS : public ContProcedure { ContProcEWNS() = default; ContProcEWNS(ContPoint* p); ContProcEWNS(std::unique_ptr p); - virtual void Compile(AnimateCompile& anim) override; + virtual void Compile(AnimationCompile& anim) override; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -923,7 +923,7 @@ class ContProcFountain : public ContProcedure { ContPoint* p); ContProcFountain(std::unique_ptr d1, std::unique_ptr d2, std::unique_ptr s1, std::unique_ptr s2, std::unique_ptr p); - virtual void Compile(AnimateCompile& anim) override; + virtual void Compile(AnimationCompile& anim) override; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -967,7 +967,7 @@ class ContProcFM : public ContProcedure { ContProcFM() = default; ContProcFM(ContValue* steps, ContValue* d); ContProcFM(std::unique_ptr steps, std::unique_ptr d); - virtual void Compile(AnimateCompile& anim) override; + virtual void Compile(AnimationCompile& anim) override; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -995,7 +995,7 @@ class ContProcFMTO : public ContProcedure { ContProcFMTO() = default; ContProcFMTO(ContPoint* p); ContProcFMTO(std::unique_ptr p); - virtual void Compile(AnimateCompile& anim) override; + virtual void Compile(AnimationCompile& anim) override; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -1023,7 +1023,7 @@ class ContProcGrid : public ContProcedure { ContProcGrid() = default; ContProcGrid(ContValue* g); ContProcGrid(std::unique_ptr g); - virtual void Compile(AnimateCompile& anim) override; + virtual void Compile(AnimationCompile& anim) override; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -1051,7 +1051,7 @@ class ContProcHSCM : public ContProcedure { ContProcHSCM() = default; ContProcHSCM(ContPoint* p1, ContPoint* p2, ContValue* beats); ContProcHSCM(std::unique_ptr p1, std::unique_ptr p2, std::unique_ptr beats); - virtual void Compile(AnimateCompile& anim) override; + virtual void Compile(AnimationCompile& anim) override; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -1080,7 +1080,7 @@ class ContProcHSDM : public ContProcedure { ContProcHSDM() = default; ContProcHSDM(ContPoint* p); ContProcHSDM(std::unique_ptr p); - virtual void Compile(AnimateCompile& anim) override; + virtual void Compile(AnimationCompile& anim) override; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -1108,7 +1108,7 @@ class ContProcMagic : public ContProcedure { ContProcMagic() = default; ContProcMagic(ContPoint* p); ContProcMagic(std::unique_ptr p); - virtual void Compile(AnimateCompile& anim) override; + virtual void Compile(AnimationCompile& anim) override; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -1138,7 +1138,7 @@ class ContProcMarch : public ContProcedure { ContValue* face); ContProcMarch(std::unique_ptr stepsize, std::unique_ptr steps, std::unique_ptr d, std::unique_ptr face); - virtual void Compile(AnimateCompile& anim) override; + virtual void Compile(AnimationCompile& anim) override; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -1176,7 +1176,7 @@ class ContProcMT : public ContProcedure { ContProcMT() = default; ContProcMT(ContValue* beats, ContValue* d); ContProcMT(std::unique_ptr beats, std::unique_ptr d); - virtual void Compile(AnimateCompile& anim) override; + virtual void Compile(AnimationCompile& anim) override; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -1204,7 +1204,7 @@ class ContProcMTRM : public ContProcedure { ContProcMTRM() = default; ContProcMTRM(ContValue* d); ContProcMTRM(std::unique_ptr d); - virtual void Compile(AnimateCompile& anim) override; + virtual void Compile(AnimationCompile& anim) override; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -1232,7 +1232,7 @@ class ContProcNSEW : public ContProcedure { ContProcNSEW() = default; ContProcNSEW(ContPoint* p); ContProcNSEW(std::unique_ptr p); - virtual void Compile(AnimateCompile& anim) override; + virtual void Compile(AnimationCompile& anim) override; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; @@ -1260,7 +1260,7 @@ class ContProcRotate : public ContProcedure { ContProcRotate() = default; ContProcRotate(ContValue* angle, ContValue* steps, ContPoint* p); ContProcRotate(std::unique_ptr angle, std::unique_ptr steps, std::unique_ptr p); - virtual void Compile(AnimateCompile& anim) override; + virtual void Compile(AnimationCompile& anim) override; virtual std::ostream& Print(std::ostream&) const override; virtual DrawableCont GetDrawableCont() const override; virtual std::unique_ptr clone() const override; diff --git a/src/core/e7_transition_solver.h b/src/core/e7_transition_solver.h index 5b46398d..7c4574ab 100644 --- a/src/core/e7_transition_solver.h +++ b/src/core/e7_transition_solver.h @@ -10,7 +10,7 @@ #include #include -#include "cc_coord.h" +#include "CalChartCoord.h" #include "cc_sheet.h" namespace CalChart { diff --git a/src/linmath.h b/src/core/linmath.h similarity index 100% rename from src/linmath.h rename to src/core/linmath.h diff --git a/src/core/math_utils.cpp b/src/core/math_utils.cpp index 2210796e..f8f7c75d 100644 --- a/src/core/math_utils.cpp +++ b/src/core/math_utils.cpp @@ -22,7 +22,7 @@ #include "math_utils.h" -#include "cc_coord.h" +#include "CalChartCoord.h" #include #include diff --git a/src/core/math_utils.h b/src/core/math_utils.h index 166b9774..1344a3ba 100644 --- a/src/core/math_utils.h +++ b/src/core/math_utils.h @@ -31,7 +31,7 @@ #endif namespace CalChart { -class Coord; +struct Coord; } static const double kEpsilon = 0.00001; @@ -47,7 +47,7 @@ T Deg2Rad(const T& a) { return a * M_PI / 180.0; } #define SQRT2 1.4142136 template -T BoundDirection(T f) +constexpr T BoundDirection(T f) { while (f >= 360.0) f -= 360.0; @@ -57,7 +57,7 @@ T BoundDirection(T f) } template -T NormalizeAngle(T ang) { return BoundDirection(ang); } +constexpr T NormalizeAngle(T ang) { return BoundDirection(ang); } float BoundDirectionSigned(float f); diff --git a/src/core/modes.h b/src/core/modes.h index 49b0484f..0cf02476 100644 --- a/src/core/modes.h +++ b/src/core/modes.h @@ -21,7 +21,7 @@ along with this program. If not, see . */ -#include "cc_coord.h" +#include "CalChartCoord.h" #include #include diff --git a/src/core/print_ps.h b/src/core/print_ps.h index 97675817..e30ab9a6 100644 --- a/src/core/print_ps.h +++ b/src/core/print_ps.h @@ -21,7 +21,7 @@ along with this program. If not, see . */ -#include "cc_types.h" +#include "CalChartTypes.h" #include #include diff --git a/src/core/viewer_translate.h b/src/core/viewer_translate.h index 3d6ebf37..c407b77b 100644 --- a/src/core/viewer_translate.h +++ b/src/core/viewer_translate.h @@ -6,8 +6,8 @@ */ // -#include "cc_coord.h" -#include "cc_types.h" +#include "CalChartCoord.h" +#include "CalChartTypes.h" namespace CalChart { diff --git a/src/draw.cpp b/src/draw.cpp index 6676e9b5..213ca742 100644 --- a/src/draw.cpp +++ b/src/draw.cpp @@ -23,8 +23,8 @@ #include "draw.h" #include "CalChartDoc.h" -#include "animate.h" -#include "animatecommand.h" +#include "CalChartAnimation.h" +#include "CalChartAnimationCommand.h" #include "basic_ui.h" #include "cc_drawcommand.h" #include "cc_point.h" diff --git a/src/draw.h b/src/draw.h index 97bed3d4..d9dcd0c6 100644 --- a/src/draw.h +++ b/src/draw.h @@ -35,7 +35,7 @@ class Sheet; class Textline; using Textline_list = std::vector; class Point; -class Coord; +struct Coord; struct DrawCommand; } class CalChartDoc; diff --git a/src/field_canvas_shapes.h b/src/field_canvas_shapes.h deleted file mode 100644 index 4eaa047f..00000000 --- a/src/field_canvas_shapes.h +++ /dev/null @@ -1,62 +0,0 @@ -#pragma once -/* - * field_canvas_shapes.h - * Canvas for the Field window - */ - -/* - Copyright (C) 1995-2012 Garrick Brian Meeker, Richard Michael Powell - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include "cc_types.h" - -#include - -#include -#include -#include -#include - -namespace CalChart { -class Shape; -class Coord; -} -class CalChartConfiguration; - -class FieldCanvasShapes { -public: - virtual ~FieldCanvasShapes() = default; - void OnMove(const CalChart::Coord& p, const CalChart::Coord& snapped_p); - auto& GetShapeList() const { return m_shape_list; } - - virtual void OnMouseLeftDown(CalChart::Coord pos) = 0; - virtual bool OnMouseUpDone(CalChart::Coord const&) { return true; } - virtual bool IsReadyForMoving() const { return true; } - -protected: - void BeginMoveDrag(CC_DRAG type, const CalChart::Coord& start); - void AddMoveDrag(CC_DRAG type, std::unique_ptr shape); - - std::vector> m_shape_list; - CC_DRAG move_drag = CC_DRAG::NONE; -}; - -class MovePoints : public FieldCanvasShapes { -public: - virtual std::map TransformPoints(std::map const& select_list) const = 0; -}; - -std::unique_ptr Create_MovePoints(CC_MOVE_MODES); diff --git a/src/ghost_module.cpp b/src/ghost_module.cpp deleted file mode 100644 index df78bd7e..00000000 --- a/src/ghost_module.cpp +++ /dev/null @@ -1,25 +0,0 @@ -#include "ghost_module.h" - -#include "CalChartDoc.h" -#include "cc_sheet.h" - -void GhostModule::setGhostSource(GhostSource source, int which) -{ - mCurrentSource = source; - mWhich = which; -} - -CalChart::Sheet const* GhostModule::getGhostSheet(CalChartDoc const* doc, int currentSheet) const -{ - if ((doc == nullptr) || (mCurrentSource == disabled)) { - return nullptr; - } - auto targetSheet = (mCurrentSource == next) ? currentSheet + 1 : (mCurrentSource == previous) ? currentSheet - 1 - : mWhich; - if (targetSheet >= 0 && targetSheet < doc->GetNumSheets()) { - return &(*(doc->GetNthSheet(targetSheet))); - } - return nullptr; -} - -bool GhostModule::isActive() const { return mCurrentSource != disabled; } diff --git a/src/ghost_module.h b/src/ghost_module.h deleted file mode 100644 index 8eaafb2e..00000000 --- a/src/ghost_module.h +++ /dev/null @@ -1,40 +0,0 @@ -#pragma once - -namespace CalChart { -class Sheet; -} - -class CalChartDoc; -/** - * The part of the Field Frame that controls the active ghosted formation. - */ -class GhostModule { -public: - /** - * Sets the source from which the ghost sheet is extracted. - * @param source The source from which the active ghost sheet will be - * extracted. - * @param isResponsible True if the GhostModule should delete the source - * when it forgets it. - */ - enum GhostSource { disabled, - next, - previous, - specific }; - void setGhostSource(GhostSource source, int which = 0); - /** - * Returns the sheet having the ghost formation to draw. - * @return The sheet having the ghost formation to draw. - */ - CalChart::Sheet const* getGhostSheet(CalChartDoc const* doc, int currentSheet) const; - /** - * Returns whether or not ghost formations are active. - * @return True if the ghost formations are currently active; false - * otherwise. - */ - bool isActive() const; - -private: - GhostSource mCurrentSource = disabled; - int mWhich = 0; -}; diff --git a/src/precomp.cpp b/src/precomp.cpp deleted file mode 100644 index 5944cf51..00000000 --- a/src/precomp.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.h" \ No newline at end of file diff --git a/src/precomp.h b/src/precomp.h deleted file mode 100644 index 361de8c7..00000000 --- a/src/precomp.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -//#include \ No newline at end of file diff --git a/src/ui_enums.h b/src/ui_enums.h index 948f99f3..39b584b9 100644 --- a/src/ui_enums.h +++ b/src/ui_enums.h @@ -133,7 +133,7 @@ enum { CALCHART__ViewAnimationErrors, CALCHART__ViewAnimation, CALCHART__ViewPrintContinuity, - CALCHART__ViewLassosToolBar, + CALCHART__ViewSelectAndMoveToolBar, CALCHART__ViewMarcherToolBar, CALCHART__ViewSwapFieldAndAnimate, From 2912394fa9f70a1ed27703d78501994221a1b3f6 Mon Sep 17 00:00:00 2001 From: Richard Powell Date: Mon, 17 May 2021 20:35:19 -0700 Subject: [PATCH 2/2] Just a bit further cleanup by making background images. and making the naming convention more consistent. --- CMakeLists.txt | 20 +- Makefile | 3311 ++++++++++++++++- calchart_cmd/main.cpp | 14 +- src/AnimationView.cpp | 2 +- src/BackgroundImage.h | 73 - ...ckgroundImage.cpp => BackgroundImages.cpp} | 121 +- src/BackgroundImages.h | 57 + src/CalChartDoc.cpp | 16 +- src/CalChartDoc.h | 5 +- src/CalChartFrame.cpp | 6 +- src/CalChartView.cpp | 64 +- src/CalChartView.h | 13 +- src/ColorSetupCanvas.cpp | 4 +- src/ColorSetupDialog.cpp | 2 +- src/ContinuityBrowser.cpp | 2 +- src/ContinuityEditorPopup.cpp | 4 +- .../cc_point.cpp => Core/CalChartPoint.cpp} | 12 +- src/{core/cc_point.h => Core/CalChartPoint.h} | 8 +- src/FieldCanvas.cpp | 1 - src/FieldControlsToolBar.cpp | 2 +- src/FieldThumbnailBrowser.cpp | 2 +- src/GhostModule.h | 2 +- src/PreferencesDrawingSetup.cpp | 2 +- src/PreferencesPSPrintingSetup.cpp | 2 +- src/PreferencesShowModeSetup.cpp | 2 +- src/PrintContinuityEditor.cpp | 2 +- src/PrintPostScriptDialog.cpp | 4 +- src/SetupInstruments.cpp | 2 +- src/SetupMarchers.cpp | 2 +- src/TransitionSolverFrame.cpp | 4 +- src/TransitionSolverProgressFrame.cpp | 4 +- src/TransitionSolverView.cpp | 10 +- src/core/CalChartAnimation.cpp | 6 +- src/core/CalChartAnimationCompile.cpp | 2 +- src/core/CalChartAnimationCompile.h | 2 +- src/core/CalChartAnimationSheet.h | 2 +- src/core/{cc_image.cpp => CalChartImage.cpp} | 8 +- src/core/{cc_image.h => CalChartImage.h} | 4 +- src/core/{cc_sheet.cpp => CalChartSheet.cpp} | 89 +- src/core/{cc_sheet.h => CalChartSheet.h} | 33 +- src/core/{cc_show.cpp => CalChartShow.cpp} | 96 +- src/core/{cc_show.h => CalChartShow.h} | 30 +- src/core/cont.cpp | 2 +- src/core/e7_transition_solver.h | 2 +- src/core/print_ps.cpp | 4 +- src/draw.cpp | 6 +- src/draw.h | 2 +- 47 files changed, 3592 insertions(+), 471 deletions(-) delete mode 100644 src/BackgroundImage.h rename src/{BackgroundImage.cpp => BackgroundImages.cpp} (71%) create mode 100644 src/BackgroundImages.h rename src/{core/cc_point.cpp => Core/CalChartPoint.cpp} (95%) rename src/{core/cc_point.h => Core/CalChartPoint.h} (94%) rename src/core/{cc_image.cpp => CalChartImage.cpp} (90%) rename src/core/{cc_image.h => CalChartImage.h} (95%) rename src/core/{cc_sheet.cpp => CalChartSheet.cpp} (91%) rename src/core/{cc_sheet.h => CalChartSheet.h} (84%) rename src/core/{cc_show.cpp => CalChartShow.cpp} (93%) rename src/core/{cc_show.h => CalChartShow.h} (89%) diff --git a/CMakeLists.txt b/CMakeLists.txt index e953746f..846af9d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,27 +66,27 @@ add_library ( ${CMAKE_CURRENT_SOURCE_DIR}/src/core/CalChartAnimationCompile.h ${CMAKE_CURRENT_SOURCE_DIR}/src/core/CalChartCoord.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/core/CalChartCoord.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/core/CalChartImage.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/core/CalChartImage.h ${CMAKE_CURRENT_SOURCE_DIR}/src/core/CalChartMovePointsTool.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/core/CalChartMovePointsTool.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/core/CalChartPoint.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/core/CalChartPoint.h ${CMAKE_CURRENT_SOURCE_DIR}/src/core/CalChartSelectTool.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/core/CalChartSelectTool.h ${CMAKE_CURRENT_SOURCE_DIR}/src/core/CalChartShapes.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/core/CalChartShapes.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/core/CalChartSheet.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/core/CalChartSheet.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/core/CalChartShow.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/core/CalChartShow.h ${CMAKE_CURRENT_SOURCE_DIR}/src/core/CalChartTypes.h ${CMAKE_CURRENT_SOURCE_DIR}/src/core/animate_types.h ${CMAKE_CURRENT_SOURCE_DIR}/src/core/cc_continuity.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/core/cc_continuity.h ${CMAKE_CURRENT_SOURCE_DIR}/src/core/cc_drawcommand.h ${CMAKE_CURRENT_SOURCE_DIR}/src/core/cc_fileformat.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/core/cc_image.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/core/cc_image.h ${CMAKE_CURRENT_SOURCE_DIR}/src/core/cc_parse_errors.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/core/cc_point.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/core/cc_point.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/core/cc_sheet.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/core/cc_sheet.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/core/cc_show.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/core/cc_show.h ${CMAKE_CURRENT_SOURCE_DIR}/src/core/cc_text.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/core/cc_text.h ${CMAKE_CURRENT_SOURCE_DIR}/src/core/cont.cpp @@ -196,8 +196,8 @@ add_executable ( ${CMAKE_CURRENT_SOURCE_DIR}/src/AnimationPanel.h ${CMAKE_CURRENT_SOURCE_DIR}/src/AnimationView.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/AnimationView.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/BackgroundImage.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/BackgroundImage.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/BackgroundImages.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/BackgroundImages.h ${CMAKE_CURRENT_SOURCE_DIR}/src/CCOmniviewCanvas.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/CCOmniviewCanvas.h ${CMAKE_CURRENT_SOURCE_DIR}/src/CalChartApp.cpp diff --git a/Makefile b/Makefile index 0c83e8bf..fca9f2cf 100644 --- a/Makefile +++ b/Makefile @@ -1,158 +1,3217 @@ -# Makefile for calchart (UNIX). -# this file is obsolete and CMake should be used instead -# we keep it as a reference on how to rebuild the docs. - -#### TOOLS #### -WXCONFIG = wx-config -LEX = flex -LFLAGS = -B -i -YACC = bison -YFLAGS = -dv -TEX2RTF = tex2rtf - -CXXFLAGS += `$(WXCONFIG) --cxxflags` -CXXFLAGS += -I$(RESDIR) -I$(SRCDIR) -CXXFLAGS += -g -Wall $(CONF_FLAGS) -CXX = `$(WXCONFIG) --cxx` -LIBS = `$(WXCONFIG) --libs` - -#### Directories #### -SRCDIR = ./src -GENDIR = ./generated -RESDIR = ./resources -OBJDIR = build -WINOBJDIR = build-win - -#### Files #### -HEADERS = $(wildcard $(SRCDIR)/*.h) -SRCS = $(wildcard $(SRCDIR)/*.cpp) - -GENERATED_BASES = $(SRCDIR)/contscan.l $(SRCDIR)/contgram.y -GENERATED_SRCS = $(GENDIR)/contscan.cpp $(GENDIR)/contgram.cpp -GENERATED_FILES = $(GENERATED_SRCS) - -OBJS += $(patsubst $(SRCDIR)/%.cpp, $(OBJDIR)/%.o, $(SRCS)) -OBJS += $(patsubst $(GENDIR)/%.cpp, $(OBJDIR)/%.o, $(GENERATED_SRCS)) - -IMAGES = $(wildcard $(RESDIR)/*.xbm) -IMAGES_X = $(wildcard $(RESDIR)/*.xpm) -IMAGES_BMP = $(IMAGES:.xbm=.bmp) -IMAGES_MSW = $(IMAGES_BMP) calchart.ico -IMAGES_ALL = $(IMAGES) $(IMAGES_X) calchart.ico +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.20 -DOCSRCDIR = doc_src -DOCSRC = $(wildcard $(DOCSRCDIR)/*) +# Default target executed when no arguments are given to make. +default_target: all +.PHONY : default_target -MOSTSRCS = $(SRCS) $(GENERATED_BASES) $(HEADERS) $(DOCSRC) -ALLSRCS = $(MOSTSRCS) $(IMAGES_ALL) Makefile xbm2xpm \ - makefile.wat calchart.rc install.inf -MSWSRCS = $(MOSTSRCS) $(GENERATED_SRCS) \ - makefile.wat calchart.rc install.inf +# Allow only one "make -f Makefile2" at a time, but pass parallelism. +.NOTPARALLEL: -#### Targets #### -all: calchart +#============================================================================= +# Special targets provided by cmake. -$(OBJDIR)/%.o: $(SRCDIR)/%.cpp - @mkdir -p $(OBJDIR) - $(CXX) $(CXXFLAGS) -c $< -o $@ +# Disable implicit rules so canonical targets will work. +.SUFFIXES: -$(OBJDIR)/%.o: $(GENDIR)/%.cpp - @mkdir -p $(OBJDIR) - $(CXX) $(CXXFLAGS) -c $< -o $@ +# Disable VCS-based implicit rules. +% : %,v -$(GENDIR)/%.cpp: $(SRCDIR)/%.y - @mkdir -p $(GENDIR) - $(YACC) $(YFLAGS) $< -o $@ +# Disable VCS-based implicit rules. +% : RCS/% -$(GENDIR)/%.cpp: $(SRCDIR)/%.l - @mkdir -p $(GENDIR) - $(LEX) $(LFLAGS) -t $< > $@ +# Disable VCS-based implicit rules. +% : RCS/%,v -%.bmp: %.xbm -# use ImageMagick to convert - rm -f $@ - convert $< $@ +# Disable VCS-based implicit rules. +% : SCCS/s.% -generate: $(GENERATED_FILES) +# Disable VCS-based implicit rules. +% : s.% -calchart: $(OBJS) - $(CXX) $(CXXFLAGS) $(OBJS) -o $@ $(LIBS) +.SUFFIXES: .hpux_make_needs_suffix_list -TAGS: $(SRCS) $(HEADERS) - etags $(SRCS) $(HEADERS) +# Command-line flag to silence nested $(MAKE). +$(VERBOSE)MAKESILENT = -s -tags:: TAGS +#Suppress display of executed commands. +$(VERBOSE).SILENT: -# Stuff for help files -docs/charthlp.dvi: html $(DOCSRC) - cd docs; latex charthlp; latex charthlp; makeindex charthlp; latex charthlp +# A target that is always out of date. +cmake_force: +.PHONY : cmake_force -docs/charthlp.ps: docs/charthlp.dvi - cd docs; dvips -f -r < charthlp.dvi > charthlp.ps +#============================================================================= +# Set environment variables for the build. -docs/charthlp.ps.gz: docs/charthlp.ps - rm -f $@ - gzip -c9 $< > $@ +# The shell in which to execute make rules. +SHELL = /bin/sh -docs/charthlp_contents.html: $(DOCSRC) - mkdir -p docs - cp $(DOCSRC) docs - -cd docs; $(TEX2RTF) charthlp.tex charthlp.html -twice -html +# The CMake executable. +CMAKE_COMMAND = /opt/homebrew/Cellar/cmake/3.20.2/bin/cmake -docs/charthlp.html.tar.gz: docs/charthlp_contents.html - rm -f $@ - tar cf - docs/*.html | gzip -9 > $@ +# The command to remove a file. +RM = /opt/homebrew/Cellar/cmake/3.20.2/bin/cmake -E rm -f -docs/charthlp.tex.tar.gz: $(TEXDOCS) - rm -f $@ - tar cf - $(TEXDOCS) | gzip -9 > $@ +# Escaping for special characters. +EQUALS = = -ps: docs/charthlp.ps -html: docs/charthlp_contents.html +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /Users/richardpowell/Development/github.com/calband/calchart.git -$(WINOBJDIR)/README.txt : README.md - sed 's/$$/\r/' $< > $@ +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /Users/richardpowell/Development/github.com/calband/calchart.git -chartsrc.tar.gz: $(ALLSRCS) - rm -f $@ - mv -f Makefile Makefile.bak - sed '/^# DO NOT DELETE/q' Makefile.bak > Makefile - tar cf - $(ALLSRCS) | gzip -9 > $@ - mv -f Makefile.bak Makefile +#============================================================================= +# Targets provided globally by CMake. -chartbin.tar.gz: calchart - rm -f $@ - tar cf - calchart | gzip -9 > $@ +# Special rule for the target list_install_components +list_install_components: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Docs\" \"Resources\" \"Unspecified\" \"applications\" \"tools\"" +.PHONY : list_install_components -chartsrc.zip: $(MSWSRCS) $(IMAGES_MSW) - rm -f $@ - zip -Dlqr9 $@ $(MSWSRCS) - zip -q9 $@ $(IMAGES_MSW) +# Special rule for the target list_install_components +list_install_components/fast: list_install_components +.PHONY : list_install_components/fast -length:: - @echo `cat $(HEADERS) $(SRCS) $(GENERATED_BASES) | wc -l` C++ lines in $(HEADERS) $(SRCS) $(GENERATED_BASES) +# Special rule for the target install/local +install/local: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." + /opt/homebrew/Cellar/cmake/3.20.2/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake +.PHONY : install/local -tar:: chartsrc.tar.gz +# Special rule for the target install/local +install/local/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." + /opt/homebrew/Cellar/cmake/3.20.2/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake +.PHONY : install/local/fast -distrib:: chartbin.tar.gz docs/charthlp.ps.gz docs/charthlp.html.tar.gz \ - docs/charthlp.tex.tar.gz +# Special rule for the target test +test: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running tests..." + /opt/homebrew/Cellar/cmake/3.20.2/bin/ctest --force-new-ctest-process $(ARGS) +.PHONY : test -zip:: chartsrc.zip +# Special rule for the target test +test/fast: test +.PHONY : test/fast -clean:: - rm -f $(OBJS) $(GENERATED_FILES) calchart core *~ *.bak TAGS - rm -rf $(OBJDIR) +# Special rule for the target rebuild_cache +rebuild_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." + /opt/homebrew/Cellar/cmake/3.20.2/bin/cmake --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : rebuild_cache -depend:: - rm -f depend - gcc -MM $(CXXFLAGS) $(SRCS) $(GENERATED_SRCS) > depend +# Special rule for the target rebuild_cache +rebuild_cache/fast: rebuild_cache +.PHONY : rebuild_cache/fast -format:: - find . -name "*.cpp" | xargs clang-format -i - find . -name "*.h" | xargs clang-format -i +# Special rule for the target package_source +package_source: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Run CPack packaging tool for source..." + /opt/homebrew/Cellar/cmake/3.20.2/bin/cpack --config ./CPackSourceConfig.cmake /Users/richardpowell/Development/github.com/calband/calchart.git/CPackSourceConfig.cmake +.PHONY : package_source -ifeq (depend,$(wildcard depend)) -include depend -endif +# Special rule for the target package_source +package_source/fast: package_source +.PHONY : package_source/fast + +# Special rule for the target install +install: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." + /opt/homebrew/Cellar/cmake/3.20.2/bin/cmake -P cmake_install.cmake +.PHONY : install + +# Special rule for the target install +install/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." + /opt/homebrew/Cellar/cmake/3.20.2/bin/cmake -P cmake_install.cmake +.PHONY : install/fast + +# Special rule for the target install/strip +install/strip: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." + /opt/homebrew/Cellar/cmake/3.20.2/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake +.PHONY : install/strip + +# Special rule for the target install/strip +install/strip/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." + /opt/homebrew/Cellar/cmake/3.20.2/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake +.PHONY : install/strip/fast + +# Special rule for the target package +package: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Run CPack packaging tool..." + /opt/homebrew/Cellar/cmake/3.20.2/bin/cpack --config ./CPackConfig.cmake +.PHONY : package + +# Special rule for the target package +package/fast: package +.PHONY : package/fast + +# Special rule for the target edit_cache +edit_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." + /opt/homebrew/Cellar/cmake/3.20.2/bin/ccmake -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : edit_cache + +# Special rule for the target edit_cache +edit_cache/fast: edit_cache +.PHONY : edit_cache/fast + +# The main all target +all: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /Users/richardpowell/Development/github.com/calband/calchart.git/CMakeFiles /Users/richardpowell/Development/github.com/calband/calchart.git//CMakeFiles/progress.marks + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 all + $(CMAKE_COMMAND) -E cmake_progress_start /Users/richardpowell/Development/github.com/calband/calchart.git/CMakeFiles 0 +.PHONY : all + +# The main clean target +clean: + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 clean +.PHONY : clean + +# The main clean target +clean/fast: clean +.PHONY : clean/fast + +# Prepare targets for installation. +preinstall: all + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall + +# Prepare targets for installation. +preinstall/fast: + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall/fast + +# clear depends +depend: + $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 +.PHONY : depend + +#============================================================================= +# Target rules for targets named CalChart + +# Build rule for target. +CalChart: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 CalChart +.PHONY : CalChart + +# fast build rule for target. +CalChart/fast: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/build +.PHONY : CalChart/fast + +#============================================================================= +# Target rules for targets named calchart_cmd + +# Build rule for target. +calchart_cmd: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 calchart_cmd +.PHONY : calchart_cmd + +# fast build rule for target. +calchart_cmd/fast: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_cmd.dir/build.make CMakeFiles/calchart_cmd.dir/build +.PHONY : calchart_cmd/fast + +#============================================================================= +# Target rules for targets named calchart_core + +# Build rule for target. +calchart_core: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 calchart_core +.PHONY : calchart_core + +# fast build rule for target. +calchart_core/fast: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/build +.PHONY : calchart_core/fast + +#============================================================================= +# Target rules for targets named munkres + +# Build rule for target. +munkres: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 munkres +.PHONY : munkres + +# fast build rule for target. +munkres/fast: + $(MAKE) $(MAKESILENT) -f submodules/munkres-cpp/CMakeFiles/munkres.dir/build.make submodules/munkres-cpp/CMakeFiles/munkres.dir/build +.PHONY : munkres/fast + +#============================================================================= +# Target rules for targets named example + +# Build rule for target. +example: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 example +.PHONY : example + +# fast build rule for target. +example/fast: + $(MAKE) $(MAKESILENT) -f submodules/munkres-cpp/CMakeFiles/example.dir/build.make submodules/munkres-cpp/CMakeFiles/example.dir/build +.PHONY : example/fast + +#============================================================================= +# Target rules for targets named munkres.bin + +# Build rule for target. +munkres.bin: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 munkres.bin +.PHONY : munkres.bin + +# fast build rule for target. +munkres.bin/fast: + $(MAKE) $(MAKESILENT) -f submodules/munkres-cpp/CMakeFiles/munkres.bin.dir/build.make submodules/munkres-cpp/CMakeFiles/munkres.bin.dir/build +.PHONY : munkres.bin/fast + +#============================================================================= +# Target rules for targets named ContinuousCoverage + +# Build rule for target. +ContinuousCoverage: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 ContinuousCoverage +.PHONY : ContinuousCoverage + +# fast build rule for target. +ContinuousCoverage/fast: + $(MAKE) $(MAKESILENT) -f submodules/nlohmann_json/CMakeFiles/ContinuousCoverage.dir/build.make submodules/nlohmann_json/CMakeFiles/ContinuousCoverage.dir/build +.PHONY : ContinuousCoverage/fast + +#============================================================================= +# Target rules for targets named ContinuousTest + +# Build rule for target. +ContinuousTest: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 ContinuousTest +.PHONY : ContinuousTest + +# fast build rule for target. +ContinuousTest/fast: + $(MAKE) $(MAKESILENT) -f submodules/nlohmann_json/CMakeFiles/ContinuousTest.dir/build.make submodules/nlohmann_json/CMakeFiles/ContinuousTest.dir/build +.PHONY : ContinuousTest/fast + +#============================================================================= +# Target rules for targets named ContinuousBuild + +# Build rule for target. +ContinuousBuild: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 ContinuousBuild +.PHONY : ContinuousBuild + +# fast build rule for target. +ContinuousBuild/fast: + $(MAKE) $(MAKESILENT) -f submodules/nlohmann_json/CMakeFiles/ContinuousBuild.dir/build.make submodules/nlohmann_json/CMakeFiles/ContinuousBuild.dir/build +.PHONY : ContinuousBuild/fast + +#============================================================================= +# Target rules for targets named ContinuousStart + +# Build rule for target. +ContinuousStart: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 ContinuousStart +.PHONY : ContinuousStart + +# fast build rule for target. +ContinuousStart/fast: + $(MAKE) $(MAKESILENT) -f submodules/nlohmann_json/CMakeFiles/ContinuousStart.dir/build.make submodules/nlohmann_json/CMakeFiles/ContinuousStart.dir/build +.PHONY : ContinuousStart/fast + +#============================================================================= +# Target rules for targets named ExperimentalBuild + +# Build rule for target. +ExperimentalBuild: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 ExperimentalBuild +.PHONY : ExperimentalBuild + +# fast build rule for target. +ExperimentalBuild/fast: + $(MAKE) $(MAKESILENT) -f submodules/nlohmann_json/CMakeFiles/ExperimentalBuild.dir/build.make submodules/nlohmann_json/CMakeFiles/ExperimentalBuild.dir/build +.PHONY : ExperimentalBuild/fast + +#============================================================================= +# Target rules for targets named ExperimentalCoverage + +# Build rule for target. +ExperimentalCoverage: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 ExperimentalCoverage +.PHONY : ExperimentalCoverage + +# fast build rule for target. +ExperimentalCoverage/fast: + $(MAKE) $(MAKESILENT) -f submodules/nlohmann_json/CMakeFiles/ExperimentalCoverage.dir/build.make submodules/nlohmann_json/CMakeFiles/ExperimentalCoverage.dir/build +.PHONY : ExperimentalCoverage/fast + +#============================================================================= +# Target rules for targets named ExperimentalSubmit + +# Build rule for target. +ExperimentalSubmit: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 ExperimentalSubmit +.PHONY : ExperimentalSubmit + +# fast build rule for target. +ExperimentalSubmit/fast: + $(MAKE) $(MAKESILENT) -f submodules/nlohmann_json/CMakeFiles/ExperimentalSubmit.dir/build.make submodules/nlohmann_json/CMakeFiles/ExperimentalSubmit.dir/build +.PHONY : ExperimentalSubmit/fast + +#============================================================================= +# Target rules for targets named ContinuousUpdate + +# Build rule for target. +ContinuousUpdate: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 ContinuousUpdate +.PHONY : ContinuousUpdate + +# fast build rule for target. +ContinuousUpdate/fast: + $(MAKE) $(MAKESILENT) -f submodules/nlohmann_json/CMakeFiles/ContinuousUpdate.dir/build.make submodules/nlohmann_json/CMakeFiles/ContinuousUpdate.dir/build +.PHONY : ContinuousUpdate/fast + +#============================================================================= +# Target rules for targets named ExperimentalUpdate + +# Build rule for target. +ExperimentalUpdate: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 ExperimentalUpdate +.PHONY : ExperimentalUpdate + +# fast build rule for target. +ExperimentalUpdate/fast: + $(MAKE) $(MAKESILENT) -f submodules/nlohmann_json/CMakeFiles/ExperimentalUpdate.dir/build.make submodules/nlohmann_json/CMakeFiles/ExperimentalUpdate.dir/build +.PHONY : ExperimentalUpdate/fast + +#============================================================================= +# Target rules for targets named ExperimentalStart + +# Build rule for target. +ExperimentalStart: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 ExperimentalStart +.PHONY : ExperimentalStart + +# fast build rule for target. +ExperimentalStart/fast: + $(MAKE) $(MAKESILENT) -f submodules/nlohmann_json/CMakeFiles/ExperimentalStart.dir/build.make submodules/nlohmann_json/CMakeFiles/ExperimentalStart.dir/build +.PHONY : ExperimentalStart/fast + +#============================================================================= +# Target rules for targets named ContinuousSubmit + +# Build rule for target. +ContinuousSubmit: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 ContinuousSubmit +.PHONY : ContinuousSubmit + +# fast build rule for target. +ContinuousSubmit/fast: + $(MAKE) $(MAKESILENT) -f submodules/nlohmann_json/CMakeFiles/ContinuousSubmit.dir/build.make submodules/nlohmann_json/CMakeFiles/ContinuousSubmit.dir/build +.PHONY : ContinuousSubmit/fast + +#============================================================================= +# Target rules for targets named ExperimentalTest + +# Build rule for target. +ExperimentalTest: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 ExperimentalTest +.PHONY : ExperimentalTest + +# fast build rule for target. +ExperimentalTest/fast: + $(MAKE) $(MAKESILENT) -f submodules/nlohmann_json/CMakeFiles/ExperimentalTest.dir/build.make submodules/nlohmann_json/CMakeFiles/ExperimentalTest.dir/build +.PHONY : ExperimentalTest/fast + +#============================================================================= +# Target rules for targets named NightlySubmit + +# Build rule for target. +NightlySubmit: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 NightlySubmit +.PHONY : NightlySubmit + +# fast build rule for target. +NightlySubmit/fast: + $(MAKE) $(MAKESILENT) -f submodules/nlohmann_json/CMakeFiles/NightlySubmit.dir/build.make submodules/nlohmann_json/CMakeFiles/NightlySubmit.dir/build +.PHONY : NightlySubmit/fast + +#============================================================================= +# Target rules for targets named NightlyMemCheck + +# Build rule for target. +NightlyMemCheck: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 NightlyMemCheck +.PHONY : NightlyMemCheck + +# fast build rule for target. +NightlyMemCheck/fast: + $(MAKE) $(MAKESILENT) -f submodules/nlohmann_json/CMakeFiles/NightlyMemCheck.dir/build.make submodules/nlohmann_json/CMakeFiles/NightlyMemCheck.dir/build +.PHONY : NightlyMemCheck/fast + +#============================================================================= +# Target rules for targets named ExperimentalConfigure + +# Build rule for target. +ExperimentalConfigure: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 ExperimentalConfigure +.PHONY : ExperimentalConfigure + +# fast build rule for target. +ExperimentalConfigure/fast: + $(MAKE) $(MAKESILENT) -f submodules/nlohmann_json/CMakeFiles/ExperimentalConfigure.dir/build.make submodules/nlohmann_json/CMakeFiles/ExperimentalConfigure.dir/build +.PHONY : ExperimentalConfigure/fast + +#============================================================================= +# Target rules for targets named NightlyCoverage + +# Build rule for target. +NightlyCoverage: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 NightlyCoverage +.PHONY : NightlyCoverage + +# fast build rule for target. +NightlyCoverage/fast: + $(MAKE) $(MAKESILENT) -f submodules/nlohmann_json/CMakeFiles/NightlyCoverage.dir/build.make submodules/nlohmann_json/CMakeFiles/NightlyCoverage.dir/build +.PHONY : NightlyCoverage/fast + +#============================================================================= +# Target rules for targets named NightlyTest + +# Build rule for target. +NightlyTest: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 NightlyTest +.PHONY : NightlyTest + +# fast build rule for target. +NightlyTest/fast: + $(MAKE) $(MAKESILENT) -f submodules/nlohmann_json/CMakeFiles/NightlyTest.dir/build.make submodules/nlohmann_json/CMakeFiles/NightlyTest.dir/build +.PHONY : NightlyTest/fast + +#============================================================================= +# Target rules for targets named ContinuousMemCheck + +# Build rule for target. +ContinuousMemCheck: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 ContinuousMemCheck +.PHONY : ContinuousMemCheck + +# fast build rule for target. +ContinuousMemCheck/fast: + $(MAKE) $(MAKESILENT) -f submodules/nlohmann_json/CMakeFiles/ContinuousMemCheck.dir/build.make submodules/nlohmann_json/CMakeFiles/ContinuousMemCheck.dir/build +.PHONY : ContinuousMemCheck/fast + +#============================================================================= +# Target rules for targets named NightlyBuild + +# Build rule for target. +NightlyBuild: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 NightlyBuild +.PHONY : NightlyBuild + +# fast build rule for target. +NightlyBuild/fast: + $(MAKE) $(MAKESILENT) -f submodules/nlohmann_json/CMakeFiles/NightlyBuild.dir/build.make submodules/nlohmann_json/CMakeFiles/NightlyBuild.dir/build +.PHONY : NightlyBuild/fast + +#============================================================================= +# Target rules for targets named NightlyConfigure + +# Build rule for target. +NightlyConfigure: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 NightlyConfigure +.PHONY : NightlyConfigure + +# fast build rule for target. +NightlyConfigure/fast: + $(MAKE) $(MAKESILENT) -f submodules/nlohmann_json/CMakeFiles/NightlyConfigure.dir/build.make submodules/nlohmann_json/CMakeFiles/NightlyConfigure.dir/build +.PHONY : NightlyConfigure/fast + +#============================================================================= +# Target rules for targets named NightlyUpdate + +# Build rule for target. +NightlyUpdate: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 NightlyUpdate +.PHONY : NightlyUpdate + +# fast build rule for target. +NightlyUpdate/fast: + $(MAKE) $(MAKESILENT) -f submodules/nlohmann_json/CMakeFiles/NightlyUpdate.dir/build.make submodules/nlohmann_json/CMakeFiles/NightlyUpdate.dir/build +.PHONY : NightlyUpdate/fast + +#============================================================================= +# Target rules for targets named ExperimentalMemCheck + +# Build rule for target. +ExperimentalMemCheck: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 ExperimentalMemCheck +.PHONY : ExperimentalMemCheck + +# fast build rule for target. +ExperimentalMemCheck/fast: + $(MAKE) $(MAKESILENT) -f submodules/nlohmann_json/CMakeFiles/ExperimentalMemCheck.dir/build.make submodules/nlohmann_json/CMakeFiles/ExperimentalMemCheck.dir/build +.PHONY : ExperimentalMemCheck/fast + +#============================================================================= +# Target rules for targets named ContinuousConfigure + +# Build rule for target. +ContinuousConfigure: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 ContinuousConfigure +.PHONY : ContinuousConfigure + +# fast build rule for target. +ContinuousConfigure/fast: + $(MAKE) $(MAKESILENT) -f submodules/nlohmann_json/CMakeFiles/ContinuousConfigure.dir/build.make submodules/nlohmann_json/CMakeFiles/ContinuousConfigure.dir/build +.PHONY : ContinuousConfigure/fast + +#============================================================================= +# Target rules for targets named NightlyMemoryCheck + +# Build rule for target. +NightlyMemoryCheck: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 NightlyMemoryCheck +.PHONY : NightlyMemoryCheck + +# fast build rule for target. +NightlyMemoryCheck/fast: + $(MAKE) $(MAKESILENT) -f submodules/nlohmann_json/CMakeFiles/NightlyMemoryCheck.dir/build.make submodules/nlohmann_json/CMakeFiles/NightlyMemoryCheck.dir/build +.PHONY : NightlyMemoryCheck/fast + +#============================================================================= +# Target rules for targets named NightlyStart + +# Build rule for target. +NightlyStart: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 NightlyStart +.PHONY : NightlyStart + +# fast build rule for target. +NightlyStart/fast: + $(MAKE) $(MAKESILENT) -f submodules/nlohmann_json/CMakeFiles/NightlyStart.dir/build.make submodules/nlohmann_json/CMakeFiles/NightlyStart.dir/build +.PHONY : NightlyStart/fast + +#============================================================================= +# Target rules for targets named Nightly + +# Build rule for target. +Nightly: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 Nightly +.PHONY : Nightly + +# fast build rule for target. +Nightly/fast: + $(MAKE) $(MAKESILENT) -f submodules/nlohmann_json/CMakeFiles/Nightly.dir/build.make submodules/nlohmann_json/CMakeFiles/Nightly.dir/build +.PHONY : Nightly/fast + +#============================================================================= +# Target rules for targets named Continuous + +# Build rule for target. +Continuous: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 Continuous +.PHONY : Continuous + +# fast build rule for target. +Continuous/fast: + $(MAKE) $(MAKESILENT) -f submodules/nlohmann_json/CMakeFiles/Continuous.dir/build.make submodules/nlohmann_json/CMakeFiles/Continuous.dir/build +.PHONY : Continuous/fast + +#============================================================================= +# Target rules for targets named Experimental + +# Build rule for target. +Experimental: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 Experimental +.PHONY : Experimental + +# fast build rule for target. +Experimental/fast: + $(MAKE) $(MAKESILENT) -f submodules/nlohmann_json/CMakeFiles/Experimental.dir/build.make submodules/nlohmann_json/CMakeFiles/Experimental.dir/build +.PHONY : Experimental/fast + +#============================================================================= +# Target rules for targets named docopt_o + +# Build rule for target. +docopt_o: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 docopt_o +.PHONY : docopt_o + +# fast build rule for target. +docopt_o/fast: + $(MAKE) $(MAKESILENT) -f submodules/docopt.cpp/CMakeFiles/docopt_o.dir/build.make submodules/docopt.cpp/CMakeFiles/docopt_o.dir/build +.PHONY : docopt_o/fast + +#============================================================================= +# Target rules for targets named docopt + +# Build rule for target. +docopt: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 docopt +.PHONY : docopt + +# fast build rule for target. +docopt/fast: + $(MAKE) $(MAKESILENT) -f submodules/docopt.cpp/CMakeFiles/docopt.dir/build.make submodules/docopt.cpp/CMakeFiles/docopt.dir/build +.PHONY : docopt/fast + +#============================================================================= +# Target rules for targets named docopt_s + +# Build rule for target. +docopt_s: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 docopt_s +.PHONY : docopt_s + +# fast build rule for target. +docopt_s/fast: + $(MAKE) $(MAKESILENT) -f submodules/docopt.cpp/CMakeFiles/docopt_s.dir/build.make submodules/docopt.cpp/CMakeFiles/docopt_s.dir/build +.PHONY : docopt_s/fast + +#============================================================================= +# Target rules for targets named uninstall + +# Build rule for target. +uninstall: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 uninstall +.PHONY : uninstall + +# fast build rule for target. +uninstall/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/CMakeFiles/uninstall.dir/build.make submodules/wxWidgets/CMakeFiles/uninstall.dir/build +.PHONY : uninstall/fast + +#============================================================================= +# Target rules for targets named wxjpeg + +# Build rule for target. +wxjpeg: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 wxjpeg +.PHONY : wxjpeg + +# fast build rule for target. +wxjpeg/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/libs/CMakeFiles/wxjpeg.dir/build.make submodules/wxWidgets/libs/CMakeFiles/wxjpeg.dir/build +.PHONY : wxjpeg/fast + +#============================================================================= +# Target rules for targets named wxregex + +# Build rule for target. +wxregex: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 wxregex +.PHONY : wxregex + +# fast build rule for target. +wxregex/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/libs/CMakeFiles/wxregex.dir/build.make submodules/wxWidgets/libs/CMakeFiles/wxregex.dir/build +.PHONY : wxregex/fast + +#============================================================================= +# Target rules for targets named wxtiff + +# Build rule for target. +wxtiff: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 wxtiff +.PHONY : wxtiff + +# fast build rule for target. +wxtiff/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/libs/CMakeFiles/wxtiff.dir/build.make submodules/wxWidgets/libs/CMakeFiles/wxtiff.dir/build +.PHONY : wxtiff/fast + +#============================================================================= +# Target rules for targets named wxpng + +# Build rule for target. +wxpng: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 wxpng +.PHONY : wxpng + +# fast build rule for target. +wxpng/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/libs/CMakeFiles/wxpng.dir/build.make submodules/wxWidgets/libs/CMakeFiles/wxpng.dir/build +.PHONY : wxpng/fast + +#============================================================================= +# Target rules for targets named clean_cotire + +# Build rule for target. +clean_cotire: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 clean_cotire +.PHONY : clean_cotire + +# fast build rule for target. +clean_cotire/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/libs/base/CMakeFiles/clean_cotire.dir/build.make submodules/wxWidgets/libs/base/CMakeFiles/clean_cotire.dir/build +.PHONY : clean_cotire/fast + +#============================================================================= +# Target rules for targets named wxbase + +# Build rule for target. +wxbase: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 wxbase +.PHONY : wxbase + +# fast build rule for target. +wxbase/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/libs/base/CMakeFiles/wxbase.dir/build.make submodules/wxWidgets/libs/base/CMakeFiles/wxbase.dir/build +.PHONY : wxbase/fast + +#============================================================================= +# Target rules for targets named all_pch + +# Build rule for target. +all_pch: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 all_pch +.PHONY : all_pch + +# fast build rule for target. +all_pch/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/libs/base/CMakeFiles/all_pch.dir/build.make submodules/wxWidgets/libs/base/CMakeFiles/all_pch.dir/build +.PHONY : all_pch/fast + +#============================================================================= +# Target rules for targets named wxbase_pch + +# Build rule for target. +wxbase_pch: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 wxbase_pch +.PHONY : wxbase_pch + +# fast build rule for target. +wxbase_pch/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/libs/base/CMakeFiles/wxbase_pch.dir/build.make submodules/wxWidgets/libs/base/CMakeFiles/wxbase_pch.dir/build +.PHONY : wxbase_pch/fast + +#============================================================================= +# Target rules for targets named wxnet_pch + +# Build rule for target. +wxnet_pch: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 wxnet_pch +.PHONY : wxnet_pch + +# fast build rule for target. +wxnet_pch/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/libs/net/CMakeFiles/wxnet_pch.dir/build.make submodules/wxWidgets/libs/net/CMakeFiles/wxnet_pch.dir/build +.PHONY : wxnet_pch/fast + +#============================================================================= +# Target rules for targets named wxnet + +# Build rule for target. +wxnet: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 wxnet +.PHONY : wxnet + +# fast build rule for target. +wxnet/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/libs/net/CMakeFiles/wxnet.dir/build.make submodules/wxWidgets/libs/net/CMakeFiles/wxnet.dir/build +.PHONY : wxnet/fast + +#============================================================================= +# Target rules for targets named wxcore_pch + +# Build rule for target. +wxcore_pch: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 wxcore_pch +.PHONY : wxcore_pch + +# fast build rule for target. +wxcore_pch/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/libs/core/CMakeFiles/wxcore_pch.dir/build.make submodules/wxWidgets/libs/core/CMakeFiles/wxcore_pch.dir/build +.PHONY : wxcore_pch/fast + +#============================================================================= +# Target rules for targets named wxcore + +# Build rule for target. +wxcore: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 wxcore +.PHONY : wxcore + +# fast build rule for target. +wxcore/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/libs/core/CMakeFiles/wxcore.dir/build.make submodules/wxWidgets/libs/core/CMakeFiles/wxcore.dir/build +.PHONY : wxcore/fast + +#============================================================================= +# Target rules for targets named wxadv + +# Build rule for target. +wxadv: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 wxadv +.PHONY : wxadv + +# fast build rule for target. +wxadv/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/libs/adv/CMakeFiles/wxadv.dir/build.make submodules/wxWidgets/libs/adv/CMakeFiles/wxadv.dir/build +.PHONY : wxadv/fast + +#============================================================================= +# Target rules for targets named wxaui_pch + +# Build rule for target. +wxaui_pch: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 wxaui_pch +.PHONY : wxaui_pch + +# fast build rule for target. +wxaui_pch/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/libs/aui/CMakeFiles/wxaui_pch.dir/build.make submodules/wxWidgets/libs/aui/CMakeFiles/wxaui_pch.dir/build +.PHONY : wxaui_pch/fast + +#============================================================================= +# Target rules for targets named wxaui + +# Build rule for target. +wxaui: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 wxaui +.PHONY : wxaui + +# fast build rule for target. +wxaui/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/libs/aui/CMakeFiles/wxaui.dir/build.make submodules/wxWidgets/libs/aui/CMakeFiles/wxaui.dir/build +.PHONY : wxaui/fast + +#============================================================================= +# Target rules for targets named wxhtml_pch + +# Build rule for target. +wxhtml_pch: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 wxhtml_pch +.PHONY : wxhtml_pch + +# fast build rule for target. +wxhtml_pch/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/libs/html/CMakeFiles/wxhtml_pch.dir/build.make submodules/wxWidgets/libs/html/CMakeFiles/wxhtml_pch.dir/build +.PHONY : wxhtml_pch/fast + +#============================================================================= +# Target rules for targets named wxhtml + +# Build rule for target. +wxhtml: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 wxhtml +.PHONY : wxhtml + +# fast build rule for target. +wxhtml/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/libs/html/CMakeFiles/wxhtml.dir/build.make submodules/wxWidgets/libs/html/CMakeFiles/wxhtml.dir/build +.PHONY : wxhtml/fast + +#============================================================================= +# Target rules for targets named wxpropgrid + +# Build rule for target. +wxpropgrid: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 wxpropgrid +.PHONY : wxpropgrid + +# fast build rule for target. +wxpropgrid/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/libs/propgrid/CMakeFiles/wxpropgrid.dir/build.make submodules/wxWidgets/libs/propgrid/CMakeFiles/wxpropgrid.dir/build +.PHONY : wxpropgrid/fast + +#============================================================================= +# Target rules for targets named wxpropgrid_pch + +# Build rule for target. +wxpropgrid_pch: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 wxpropgrid_pch +.PHONY : wxpropgrid_pch + +# fast build rule for target. +wxpropgrid_pch/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/libs/propgrid/CMakeFiles/wxpropgrid_pch.dir/build.make submodules/wxWidgets/libs/propgrid/CMakeFiles/wxpropgrid_pch.dir/build +.PHONY : wxpropgrid_pch/fast + +#============================================================================= +# Target rules for targets named wxribbon_pch + +# Build rule for target. +wxribbon_pch: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 wxribbon_pch +.PHONY : wxribbon_pch + +# fast build rule for target. +wxribbon_pch/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/libs/ribbon/CMakeFiles/wxribbon_pch.dir/build.make submodules/wxWidgets/libs/ribbon/CMakeFiles/wxribbon_pch.dir/build +.PHONY : wxribbon_pch/fast + +#============================================================================= +# Target rules for targets named wxribbon + +# Build rule for target. +wxribbon: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 wxribbon +.PHONY : wxribbon + +# fast build rule for target. +wxribbon/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/libs/ribbon/CMakeFiles/wxribbon.dir/build.make submodules/wxWidgets/libs/ribbon/CMakeFiles/wxribbon.dir/build +.PHONY : wxribbon/fast + +#============================================================================= +# Target rules for targets named wxrichtext_pch + +# Build rule for target. +wxrichtext_pch: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 wxrichtext_pch +.PHONY : wxrichtext_pch + +# fast build rule for target. +wxrichtext_pch/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/libs/richtext/CMakeFiles/wxrichtext_pch.dir/build.make submodules/wxWidgets/libs/richtext/CMakeFiles/wxrichtext_pch.dir/build +.PHONY : wxrichtext_pch/fast + +#============================================================================= +# Target rules for targets named wxrichtext + +# Build rule for target. +wxrichtext: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 wxrichtext +.PHONY : wxrichtext + +# fast build rule for target. +wxrichtext/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/libs/richtext/CMakeFiles/wxrichtext.dir/build.make submodules/wxWidgets/libs/richtext/CMakeFiles/wxrichtext.dir/build +.PHONY : wxrichtext/fast + +#============================================================================= +# Target rules for targets named wxwebview + +# Build rule for target. +wxwebview: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 wxwebview +.PHONY : wxwebview + +# fast build rule for target. +wxwebview/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/libs/webview/CMakeFiles/wxwebview.dir/build.make submodules/wxWidgets/libs/webview/CMakeFiles/wxwebview.dir/build +.PHONY : wxwebview/fast + +#============================================================================= +# Target rules for targets named wxwebview_pch + +# Build rule for target. +wxwebview_pch: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 wxwebview_pch +.PHONY : wxwebview_pch + +# fast build rule for target. +wxwebview_pch/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/libs/webview/CMakeFiles/wxwebview_pch.dir/build.make submodules/wxWidgets/libs/webview/CMakeFiles/wxwebview_pch.dir/build +.PHONY : wxwebview_pch/fast + +#============================================================================= +# Target rules for targets named wxstc_pch + +# Build rule for target. +wxstc_pch: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 wxstc_pch +.PHONY : wxstc_pch + +# fast build rule for target. +wxstc_pch/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/libs/stc/CMakeFiles/wxstc_pch.dir/build.make submodules/wxWidgets/libs/stc/CMakeFiles/wxstc_pch.dir/build +.PHONY : wxstc_pch/fast + +#============================================================================= +# Target rules for targets named wxstc + +# Build rule for target. +wxstc: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 wxstc +.PHONY : wxstc + +# fast build rule for target. +wxstc/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/libs/stc/CMakeFiles/wxstc.dir/build.make submodules/wxWidgets/libs/stc/CMakeFiles/wxstc.dir/build +.PHONY : wxstc/fast + +#============================================================================= +# Target rules for targets named wxscintilla_pch + +# Build rule for target. +wxscintilla_pch: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 wxscintilla_pch +.PHONY : wxscintilla_pch + +# fast build rule for target. +wxscintilla_pch/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/libs/stc/CMakeFiles/wxscintilla_pch.dir/build.make submodules/wxWidgets/libs/stc/CMakeFiles/wxscintilla_pch.dir/build +.PHONY : wxscintilla_pch/fast + +#============================================================================= +# Target rules for targets named wxscintilla + +# Build rule for target. +wxscintilla: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 wxscintilla +.PHONY : wxscintilla + +# fast build rule for target. +wxscintilla/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/libs/stc/CMakeFiles/wxscintilla.dir/build.make submodules/wxWidgets/libs/stc/CMakeFiles/wxscintilla.dir/build +.PHONY : wxscintilla/fast + +#============================================================================= +# Target rules for targets named wxxrc_pch + +# Build rule for target. +wxxrc_pch: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 wxxrc_pch +.PHONY : wxxrc_pch + +# fast build rule for target. +wxxrc_pch/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/libs/xrc/CMakeFiles/wxxrc_pch.dir/build.make submodules/wxWidgets/libs/xrc/CMakeFiles/wxxrc_pch.dir/build +.PHONY : wxxrc_pch/fast + +#============================================================================= +# Target rules for targets named wxxrc + +# Build rule for target. +wxxrc: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 wxxrc +.PHONY : wxxrc + +# fast build rule for target. +wxxrc/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/libs/xrc/CMakeFiles/wxxrc.dir/build.make submodules/wxWidgets/libs/xrc/CMakeFiles/wxxrc.dir/build +.PHONY : wxxrc/fast + +#============================================================================= +# Target rules for targets named wxmedia + +# Build rule for target. +wxmedia: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 wxmedia +.PHONY : wxmedia + +# fast build rule for target. +wxmedia/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/libs/media/CMakeFiles/wxmedia.dir/build.make submodules/wxWidgets/libs/media/CMakeFiles/wxmedia.dir/build +.PHONY : wxmedia/fast + +#============================================================================= +# Target rules for targets named wxgl_pch + +# Build rule for target. +wxgl_pch: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 wxgl_pch +.PHONY : wxgl_pch + +# fast build rule for target. +wxgl_pch/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/libs/gl/CMakeFiles/wxgl_pch.dir/build.make submodules/wxWidgets/libs/gl/CMakeFiles/wxgl_pch.dir/build +.PHONY : wxgl_pch/fast + +#============================================================================= +# Target rules for targets named wxgl + +# Build rule for target. +wxgl: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 wxgl +.PHONY : wxgl + +# fast build rule for target. +wxgl/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/libs/gl/CMakeFiles/wxgl.dir/build.make submodules/wxWidgets/libs/gl/CMakeFiles/wxgl.dir/build +.PHONY : wxgl/fast + +#============================================================================= +# Target rules for targets named wxqa + +# Build rule for target. +wxqa: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 wxqa +.PHONY : wxqa + +# fast build rule for target. +wxqa/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/libs/qa/CMakeFiles/wxqa.dir/build.make submodules/wxWidgets/libs/qa/CMakeFiles/wxqa.dir/build +.PHONY : wxqa/fast + +#============================================================================= +# Target rules for targets named wxqa_pch + +# Build rule for target. +wxqa_pch: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 wxqa_pch +.PHONY : wxqa_pch + +# fast build rule for target. +wxqa_pch/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/libs/qa/CMakeFiles/wxqa_pch.dir/build.make submodules/wxWidgets/libs/qa/CMakeFiles/wxqa_pch.dir/build +.PHONY : wxqa_pch/fast + +#============================================================================= +# Target rules for targets named wxxml_pch + +# Build rule for target. +wxxml_pch: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 wxxml_pch +.PHONY : wxxml_pch + +# fast build rule for target. +wxxml_pch/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/libs/xml/CMakeFiles/wxxml_pch.dir/build.make submodules/wxWidgets/libs/xml/CMakeFiles/wxxml_pch.dir/build +.PHONY : wxxml_pch/fast + +#============================================================================= +# Target rules for targets named wxxml + +# Build rule for target. +wxxml: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 wxxml +.PHONY : wxxml + +# fast build rule for target. +wxxml/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/libs/xml/CMakeFiles/wxxml.dir/build.make submodules/wxWidgets/libs/xml/CMakeFiles/wxxml.dir/build +.PHONY : wxxml/fast + +#============================================================================= +# Target rules for targets named wxrc + +# Build rule for target. +wxrc: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 wxrc +.PHONY : wxrc + +# fast build rule for target. +wxrc/fast: + $(MAKE) $(MAKESILENT) -f submodules/wxWidgets/utils/CMakeFiles/wxrc.dir/build.make submodules/wxWidgets/utils/CMakeFiles/wxrc.dir/build +.PHONY : wxrc/fast + +calchart_cmd/main.o: calchart_cmd/main.cpp.o +.PHONY : calchart_cmd/main.o + +# target to build an object file +calchart_cmd/main.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_cmd.dir/build.make CMakeFiles/calchart_cmd.dir/calchart_cmd/main.cpp.o +.PHONY : calchart_cmd/main.cpp.o + +calchart_cmd/main.i: calchart_cmd/main.cpp.i +.PHONY : calchart_cmd/main.i + +# target to preprocess a source file +calchart_cmd/main.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_cmd.dir/build.make CMakeFiles/calchart_cmd.dir/calchart_cmd/main.cpp.i +.PHONY : calchart_cmd/main.cpp.i + +calchart_cmd/main.s: calchart_cmd/main.cpp.s +.PHONY : calchart_cmd/main.s + +# target to generate assembly for a file +calchart_cmd/main.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_cmd.dir/build.make CMakeFiles/calchart_cmd.dir/calchart_cmd/main.cpp.s +.PHONY : calchart_cmd/main.cpp.s + +contgram.o: contgram.cpp.o +.PHONY : contgram.o + +# target to build an object file +contgram.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/contgram.cpp.o +.PHONY : contgram.cpp.o + +contgram.i: contgram.cpp.i +.PHONY : contgram.i + +# target to preprocess a source file +contgram.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/contgram.cpp.i +.PHONY : contgram.cpp.i + +contgram.s: contgram.cpp.s +.PHONY : contgram.s + +# target to generate assembly for a file +contgram.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/contgram.cpp.s +.PHONY : contgram.cpp.s + +contscan.o: contscan.cpp.o +.PHONY : contscan.o + +# target to build an object file +contscan.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/contscan.cpp.o +.PHONY : contscan.cpp.o + +contscan.i: contscan.cpp.i +.PHONY : contscan.i + +# target to preprocess a source file +contscan.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/contscan.cpp.i +.PHONY : contscan.cpp.i + +contscan.s: contscan.cpp.s +.PHONY : contscan.s + +# target to generate assembly for a file +contscan.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/contscan.cpp.s +.PHONY : contscan.cpp.s + +src/AnimationCanvas.o: src/AnimationCanvas.cpp.o +.PHONY : src/AnimationCanvas.o + +# target to build an object file +src/AnimationCanvas.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/AnimationCanvas.cpp.o +.PHONY : src/AnimationCanvas.cpp.o + +src/AnimationCanvas.i: src/AnimationCanvas.cpp.i +.PHONY : src/AnimationCanvas.i + +# target to preprocess a source file +src/AnimationCanvas.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/AnimationCanvas.cpp.i +.PHONY : src/AnimationCanvas.cpp.i + +src/AnimationCanvas.s: src/AnimationCanvas.cpp.s +.PHONY : src/AnimationCanvas.s + +# target to generate assembly for a file +src/AnimationCanvas.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/AnimationCanvas.cpp.s +.PHONY : src/AnimationCanvas.cpp.s + +src/AnimationErrorsPanel.o: src/AnimationErrorsPanel.cpp.o +.PHONY : src/AnimationErrorsPanel.o + +# target to build an object file +src/AnimationErrorsPanel.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/AnimationErrorsPanel.cpp.o +.PHONY : src/AnimationErrorsPanel.cpp.o + +src/AnimationErrorsPanel.i: src/AnimationErrorsPanel.cpp.i +.PHONY : src/AnimationErrorsPanel.i + +# target to preprocess a source file +src/AnimationErrorsPanel.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/AnimationErrorsPanel.cpp.i +.PHONY : src/AnimationErrorsPanel.cpp.i + +src/AnimationErrorsPanel.s: src/AnimationErrorsPanel.cpp.s +.PHONY : src/AnimationErrorsPanel.s + +# target to generate assembly for a file +src/AnimationErrorsPanel.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/AnimationErrorsPanel.cpp.s +.PHONY : src/AnimationErrorsPanel.cpp.s + +src/AnimationPanel.o: src/AnimationPanel.cpp.o +.PHONY : src/AnimationPanel.o + +# target to build an object file +src/AnimationPanel.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/AnimationPanel.cpp.o +.PHONY : src/AnimationPanel.cpp.o + +src/AnimationPanel.i: src/AnimationPanel.cpp.i +.PHONY : src/AnimationPanel.i + +# target to preprocess a source file +src/AnimationPanel.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/AnimationPanel.cpp.i +.PHONY : src/AnimationPanel.cpp.i + +src/AnimationPanel.s: src/AnimationPanel.cpp.s +.PHONY : src/AnimationPanel.s + +# target to generate assembly for a file +src/AnimationPanel.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/AnimationPanel.cpp.s +.PHONY : src/AnimationPanel.cpp.s + +src/AnimationView.o: src/AnimationView.cpp.o +.PHONY : src/AnimationView.o + +# target to build an object file +src/AnimationView.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/AnimationView.cpp.o +.PHONY : src/AnimationView.cpp.o + +src/AnimationView.i: src/AnimationView.cpp.i +.PHONY : src/AnimationView.i + +# target to preprocess a source file +src/AnimationView.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/AnimationView.cpp.i +.PHONY : src/AnimationView.cpp.i + +src/AnimationView.s: src/AnimationView.cpp.s +.PHONY : src/AnimationView.s + +# target to generate assembly for a file +src/AnimationView.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/AnimationView.cpp.s +.PHONY : src/AnimationView.cpp.s + +src/BackgroundImages.o: src/BackgroundImages.cpp.o +.PHONY : src/BackgroundImages.o + +# target to build an object file +src/BackgroundImages.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/BackgroundImages.cpp.o +.PHONY : src/BackgroundImages.cpp.o + +src/BackgroundImages.i: src/BackgroundImages.cpp.i +.PHONY : src/BackgroundImages.i + +# target to preprocess a source file +src/BackgroundImages.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/BackgroundImages.cpp.i +.PHONY : src/BackgroundImages.cpp.i + +src/BackgroundImages.s: src/BackgroundImages.cpp.s +.PHONY : src/BackgroundImages.s + +# target to generate assembly for a file +src/BackgroundImages.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/BackgroundImages.cpp.s +.PHONY : src/BackgroundImages.cpp.s + +src/CCOmniviewCanvas.o: src/CCOmniviewCanvas.cpp.o +.PHONY : src/CCOmniviewCanvas.o + +# target to build an object file +src/CCOmniviewCanvas.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/CCOmniviewCanvas.cpp.o +.PHONY : src/CCOmniviewCanvas.cpp.o + +src/CCOmniviewCanvas.i: src/CCOmniviewCanvas.cpp.i +.PHONY : src/CCOmniviewCanvas.i + +# target to preprocess a source file +src/CCOmniviewCanvas.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/CCOmniviewCanvas.cpp.i +.PHONY : src/CCOmniviewCanvas.cpp.i + +src/CCOmniviewCanvas.s: src/CCOmniviewCanvas.cpp.s +.PHONY : src/CCOmniviewCanvas.s + +# target to generate assembly for a file +src/CCOmniviewCanvas.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/CCOmniviewCanvas.cpp.s +.PHONY : src/CCOmniviewCanvas.cpp.s + +src/CalChartApp.o: src/CalChartApp.cpp.o +.PHONY : src/CalChartApp.o + +# target to build an object file +src/CalChartApp.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/CalChartApp.cpp.o +.PHONY : src/CalChartApp.cpp.o + +src/CalChartApp.i: src/CalChartApp.cpp.i +.PHONY : src/CalChartApp.i + +# target to preprocess a source file +src/CalChartApp.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/CalChartApp.cpp.i +.PHONY : src/CalChartApp.cpp.i + +src/CalChartApp.s: src/CalChartApp.cpp.s +.PHONY : src/CalChartApp.s + +# target to generate assembly for a file +src/CalChartApp.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/CalChartApp.cpp.s +.PHONY : src/CalChartApp.cpp.s + +src/CalChartDoc.o: src/CalChartDoc.cpp.o +.PHONY : src/CalChartDoc.o + +# target to build an object file +src/CalChartDoc.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/CalChartDoc.cpp.o +.PHONY : src/CalChartDoc.cpp.o + +src/CalChartDoc.i: src/CalChartDoc.cpp.i +.PHONY : src/CalChartDoc.i + +# target to preprocess a source file +src/CalChartDoc.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/CalChartDoc.cpp.i +.PHONY : src/CalChartDoc.cpp.i + +src/CalChartDoc.s: src/CalChartDoc.cpp.s +.PHONY : src/CalChartDoc.s + +# target to generate assembly for a file +src/CalChartDoc.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/CalChartDoc.cpp.s +.PHONY : src/CalChartDoc.cpp.s + +src/CalChartDocCommand.o: src/CalChartDocCommand.cpp.o +.PHONY : src/CalChartDocCommand.o + +# target to build an object file +src/CalChartDocCommand.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/CalChartDocCommand.cpp.o +.PHONY : src/CalChartDocCommand.cpp.o + +src/CalChartDocCommand.i: src/CalChartDocCommand.cpp.i +.PHONY : src/CalChartDocCommand.i + +# target to preprocess a source file +src/CalChartDocCommand.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/CalChartDocCommand.cpp.i +.PHONY : src/CalChartDocCommand.cpp.i + +src/CalChartDocCommand.s: src/CalChartDocCommand.cpp.s +.PHONY : src/CalChartDocCommand.s + +# target to generate assembly for a file +src/CalChartDocCommand.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/CalChartDocCommand.cpp.s +.PHONY : src/CalChartDocCommand.cpp.s + +src/CalChartFrame.o: src/CalChartFrame.cpp.o +.PHONY : src/CalChartFrame.o + +# target to build an object file +src/CalChartFrame.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/CalChartFrame.cpp.o +.PHONY : src/CalChartFrame.cpp.o + +src/CalChartFrame.i: src/CalChartFrame.cpp.i +.PHONY : src/CalChartFrame.i + +# target to preprocess a source file +src/CalChartFrame.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/CalChartFrame.cpp.i +.PHONY : src/CalChartFrame.cpp.i + +src/CalChartFrame.s: src/CalChartFrame.cpp.s +.PHONY : src/CalChartFrame.s + +# target to generate assembly for a file +src/CalChartFrame.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/CalChartFrame.cpp.s +.PHONY : src/CalChartFrame.cpp.s + +src/CalChartPreferences.o: src/CalChartPreferences.cpp.o +.PHONY : src/CalChartPreferences.o + +# target to build an object file +src/CalChartPreferences.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/CalChartPreferences.cpp.o +.PHONY : src/CalChartPreferences.cpp.o + +src/CalChartPreferences.i: src/CalChartPreferences.cpp.i +.PHONY : src/CalChartPreferences.i + +# target to preprocess a source file +src/CalChartPreferences.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/CalChartPreferences.cpp.i +.PHONY : src/CalChartPreferences.cpp.i + +src/CalChartPreferences.s: src/CalChartPreferences.cpp.s +.PHONY : src/CalChartPreferences.s + +# target to generate assembly for a file +src/CalChartPreferences.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/CalChartPreferences.cpp.s +.PHONY : src/CalChartPreferences.cpp.s + +src/CalChartSizes.o: src/CalChartSizes.cpp.o +.PHONY : src/CalChartSizes.o + +# target to build an object file +src/CalChartSizes.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/CalChartSizes.cpp.o +.PHONY : src/CalChartSizes.cpp.o + +src/CalChartSizes.i: src/CalChartSizes.cpp.i +.PHONY : src/CalChartSizes.i + +# target to preprocess a source file +src/CalChartSizes.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/CalChartSizes.cpp.i +.PHONY : src/CalChartSizes.cpp.i + +src/CalChartSizes.s: src/CalChartSizes.cpp.s +.PHONY : src/CalChartSizes.s + +# target to generate assembly for a file +src/CalChartSizes.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/CalChartSizes.cpp.s +.PHONY : src/CalChartSizes.cpp.s + +src/CalChartSplash.o: src/CalChartSplash.cpp.o +.PHONY : src/CalChartSplash.o + +# target to build an object file +src/CalChartSplash.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/CalChartSplash.cpp.o +.PHONY : src/CalChartSplash.cpp.o + +src/CalChartSplash.i: src/CalChartSplash.cpp.i +.PHONY : src/CalChartSplash.i + +# target to preprocess a source file +src/CalChartSplash.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/CalChartSplash.cpp.i +.PHONY : src/CalChartSplash.cpp.i + +src/CalChartSplash.s: src/CalChartSplash.cpp.s +.PHONY : src/CalChartSplash.s + +# target to generate assembly for a file +src/CalChartSplash.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/CalChartSplash.cpp.s +.PHONY : src/CalChartSplash.cpp.s + +src/CalChartToolBar.o: src/CalChartToolBar.cpp.o +.PHONY : src/CalChartToolBar.o + +# target to build an object file +src/CalChartToolBar.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/CalChartToolBar.cpp.o +.PHONY : src/CalChartToolBar.cpp.o + +src/CalChartToolBar.i: src/CalChartToolBar.cpp.i +.PHONY : src/CalChartToolBar.i + +# target to preprocess a source file +src/CalChartToolBar.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/CalChartToolBar.cpp.i +.PHONY : src/CalChartToolBar.cpp.i + +src/CalChartToolBar.s: src/CalChartToolBar.cpp.s +.PHONY : src/CalChartToolBar.s + +# target to generate assembly for a file +src/CalChartToolBar.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/CalChartToolBar.cpp.s +.PHONY : src/CalChartToolBar.cpp.s + +src/CalChartView.o: src/CalChartView.cpp.o +.PHONY : src/CalChartView.o + +# target to build an object file +src/CalChartView.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/CalChartView.cpp.o +.PHONY : src/CalChartView.cpp.o + +src/CalChartView.i: src/CalChartView.cpp.i +.PHONY : src/CalChartView.i + +# target to preprocess a source file +src/CalChartView.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/CalChartView.cpp.i +.PHONY : src/CalChartView.cpp.i + +src/CalChartView.s: src/CalChartView.cpp.s +.PHONY : src/CalChartView.s + +# target to generate assembly for a file +src/CalChartView.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/CalChartView.cpp.s +.PHONY : src/CalChartView.cpp.s + +src/ColorPalette.o: src/ColorPalette.cpp.o +.PHONY : src/ColorPalette.o + +# target to build an object file +src/ColorPalette.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/ColorPalette.cpp.o +.PHONY : src/ColorPalette.cpp.o + +src/ColorPalette.i: src/ColorPalette.cpp.i +.PHONY : src/ColorPalette.i + +# target to preprocess a source file +src/ColorPalette.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/ColorPalette.cpp.i +.PHONY : src/ColorPalette.cpp.i + +src/ColorPalette.s: src/ColorPalette.cpp.s +.PHONY : src/ColorPalette.s + +# target to generate assembly for a file +src/ColorPalette.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/ColorPalette.cpp.s +.PHONY : src/ColorPalette.cpp.s + +src/ColorSetupCanvas.o: src/ColorSetupCanvas.cpp.o +.PHONY : src/ColorSetupCanvas.o + +# target to build an object file +src/ColorSetupCanvas.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/ColorSetupCanvas.cpp.o +.PHONY : src/ColorSetupCanvas.cpp.o + +src/ColorSetupCanvas.i: src/ColorSetupCanvas.cpp.i +.PHONY : src/ColorSetupCanvas.i + +# target to preprocess a source file +src/ColorSetupCanvas.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/ColorSetupCanvas.cpp.i +.PHONY : src/ColorSetupCanvas.cpp.i + +src/ColorSetupCanvas.s: src/ColorSetupCanvas.cpp.s +.PHONY : src/ColorSetupCanvas.s + +# target to generate assembly for a file +src/ColorSetupCanvas.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/ColorSetupCanvas.cpp.s +.PHONY : src/ColorSetupCanvas.cpp.s + +src/ColorSetupDialog.o: src/ColorSetupDialog.cpp.o +.PHONY : src/ColorSetupDialog.o + +# target to build an object file +src/ColorSetupDialog.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/ColorSetupDialog.cpp.o +.PHONY : src/ColorSetupDialog.cpp.o + +src/ColorSetupDialog.i: src/ColorSetupDialog.cpp.i +.PHONY : src/ColorSetupDialog.i + +# target to preprocess a source file +src/ColorSetupDialog.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/ColorSetupDialog.cpp.i +.PHONY : src/ColorSetupDialog.cpp.i + +src/ColorSetupDialog.s: src/ColorSetupDialog.cpp.s +.PHONY : src/ColorSetupDialog.s + +# target to generate assembly for a file +src/ColorSetupDialog.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/ColorSetupDialog.cpp.s +.PHONY : src/ColorSetupDialog.cpp.s + +src/ContinuityBrowser.o: src/ContinuityBrowser.cpp.o +.PHONY : src/ContinuityBrowser.o + +# target to build an object file +src/ContinuityBrowser.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/ContinuityBrowser.cpp.o +.PHONY : src/ContinuityBrowser.cpp.o + +src/ContinuityBrowser.i: src/ContinuityBrowser.cpp.i +.PHONY : src/ContinuityBrowser.i + +# target to preprocess a source file +src/ContinuityBrowser.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/ContinuityBrowser.cpp.i +.PHONY : src/ContinuityBrowser.cpp.i + +src/ContinuityBrowser.s: src/ContinuityBrowser.cpp.s +.PHONY : src/ContinuityBrowser.s + +# target to generate assembly for a file +src/ContinuityBrowser.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/ContinuityBrowser.cpp.s +.PHONY : src/ContinuityBrowser.cpp.s + +src/ContinuityBrowserPanel.o: src/ContinuityBrowserPanel.cpp.o +.PHONY : src/ContinuityBrowserPanel.o + +# target to build an object file +src/ContinuityBrowserPanel.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/ContinuityBrowserPanel.cpp.o +.PHONY : src/ContinuityBrowserPanel.cpp.o + +src/ContinuityBrowserPanel.i: src/ContinuityBrowserPanel.cpp.i +.PHONY : src/ContinuityBrowserPanel.i + +# target to preprocess a source file +src/ContinuityBrowserPanel.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/ContinuityBrowserPanel.cpp.i +.PHONY : src/ContinuityBrowserPanel.cpp.i + +src/ContinuityBrowserPanel.s: src/ContinuityBrowserPanel.cpp.s +.PHONY : src/ContinuityBrowserPanel.s + +# target to generate assembly for a file +src/ContinuityBrowserPanel.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/ContinuityBrowserPanel.cpp.s +.PHONY : src/ContinuityBrowserPanel.cpp.s + +src/ContinuityComposerDialog.o: src/ContinuityComposerDialog.cpp.o +.PHONY : src/ContinuityComposerDialog.o + +# target to build an object file +src/ContinuityComposerDialog.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/ContinuityComposerDialog.cpp.o +.PHONY : src/ContinuityComposerDialog.cpp.o + +src/ContinuityComposerDialog.i: src/ContinuityComposerDialog.cpp.i +.PHONY : src/ContinuityComposerDialog.i + +# target to preprocess a source file +src/ContinuityComposerDialog.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/ContinuityComposerDialog.cpp.i +.PHONY : src/ContinuityComposerDialog.cpp.i + +src/ContinuityComposerDialog.s: src/ContinuityComposerDialog.cpp.s +.PHONY : src/ContinuityComposerDialog.s + +# target to generate assembly for a file +src/ContinuityComposerDialog.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/ContinuityComposerDialog.cpp.s +.PHONY : src/ContinuityComposerDialog.cpp.s + +src/ContinuityEditorPopup.o: src/ContinuityEditorPopup.cpp.o +.PHONY : src/ContinuityEditorPopup.o + +# target to build an object file +src/ContinuityEditorPopup.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/ContinuityEditorPopup.cpp.o +.PHONY : src/ContinuityEditorPopup.cpp.o + +src/ContinuityEditorPopup.i: src/ContinuityEditorPopup.cpp.i +.PHONY : src/ContinuityEditorPopup.i + +# target to preprocess a source file +src/ContinuityEditorPopup.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/ContinuityEditorPopup.cpp.i +.PHONY : src/ContinuityEditorPopup.cpp.i + +src/ContinuityEditorPopup.s: src/ContinuityEditorPopup.cpp.s +.PHONY : src/ContinuityEditorPopup.s + +# target to generate assembly for a file +src/ContinuityEditorPopup.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/ContinuityEditorPopup.cpp.s +.PHONY : src/ContinuityEditorPopup.cpp.s + +src/CustomListViewPanel.o: src/CustomListViewPanel.cpp.o +.PHONY : src/CustomListViewPanel.o + +# target to build an object file +src/CustomListViewPanel.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/CustomListViewPanel.cpp.o +.PHONY : src/CustomListViewPanel.cpp.o + +src/CustomListViewPanel.i: src/CustomListViewPanel.cpp.i +.PHONY : src/CustomListViewPanel.i + +# target to preprocess a source file +src/CustomListViewPanel.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/CustomListViewPanel.cpp.i +.PHONY : src/CustomListViewPanel.cpp.i + +src/CustomListViewPanel.s: src/CustomListViewPanel.cpp.s +.PHONY : src/CustomListViewPanel.s + +# target to generate assembly for a file +src/CustomListViewPanel.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/CustomListViewPanel.cpp.s +.PHONY : src/CustomListViewPanel.cpp.s + +src/FieldCanvas.o: src/FieldCanvas.cpp.o +.PHONY : src/FieldCanvas.o + +# target to build an object file +src/FieldCanvas.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/FieldCanvas.cpp.o +.PHONY : src/FieldCanvas.cpp.o + +src/FieldCanvas.i: src/FieldCanvas.cpp.i +.PHONY : src/FieldCanvas.i + +# target to preprocess a source file +src/FieldCanvas.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/FieldCanvas.cpp.i +.PHONY : src/FieldCanvas.cpp.i + +src/FieldCanvas.s: src/FieldCanvas.cpp.s +.PHONY : src/FieldCanvas.s + +# target to generate assembly for a file +src/FieldCanvas.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/FieldCanvas.cpp.s +.PHONY : src/FieldCanvas.cpp.s + +src/FieldControlsToolBar.o: src/FieldControlsToolBar.cpp.o +.PHONY : src/FieldControlsToolBar.o + +# target to build an object file +src/FieldControlsToolBar.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/FieldControlsToolBar.cpp.o +.PHONY : src/FieldControlsToolBar.cpp.o + +src/FieldControlsToolBar.i: src/FieldControlsToolBar.cpp.i +.PHONY : src/FieldControlsToolBar.i + +# target to preprocess a source file +src/FieldControlsToolBar.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/FieldControlsToolBar.cpp.i +.PHONY : src/FieldControlsToolBar.cpp.i + +src/FieldControlsToolBar.s: src/FieldControlsToolBar.cpp.s +.PHONY : src/FieldControlsToolBar.s + +# target to generate assembly for a file +src/FieldControlsToolBar.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/FieldControlsToolBar.cpp.s +.PHONY : src/FieldControlsToolBar.cpp.s + +src/FieldThumbnailBrowser.o: src/FieldThumbnailBrowser.cpp.o +.PHONY : src/FieldThumbnailBrowser.o + +# target to build an object file +src/FieldThumbnailBrowser.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/FieldThumbnailBrowser.cpp.o +.PHONY : src/FieldThumbnailBrowser.cpp.o + +src/FieldThumbnailBrowser.i: src/FieldThumbnailBrowser.cpp.i +.PHONY : src/FieldThumbnailBrowser.i + +# target to preprocess a source file +src/FieldThumbnailBrowser.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/FieldThumbnailBrowser.cpp.i +.PHONY : src/FieldThumbnailBrowser.cpp.i + +src/FieldThumbnailBrowser.s: src/FieldThumbnailBrowser.cpp.s +.PHONY : src/FieldThumbnailBrowser.s + +# target to generate assembly for a file +src/FieldThumbnailBrowser.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/FieldThumbnailBrowser.cpp.s +.PHONY : src/FieldThumbnailBrowser.cpp.s + +src/HostAppInterface.o: src/HostAppInterface.cpp.o +.PHONY : src/HostAppInterface.o + +# target to build an object file +src/HostAppInterface.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/HostAppInterface.cpp.o +.PHONY : src/HostAppInterface.cpp.o + +src/HostAppInterface.i: src/HostAppInterface.cpp.i +.PHONY : src/HostAppInterface.i + +# target to preprocess a source file +src/HostAppInterface.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/HostAppInterface.cpp.i +.PHONY : src/HostAppInterface.cpp.i + +src/HostAppInterface.s: src/HostAppInterface.cpp.s +.PHONY : src/HostAppInterface.s + +# target to generate assembly for a file +src/HostAppInterface.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/HostAppInterface.cpp.s +.PHONY : src/HostAppInterface.cpp.s + +src/PointPicker.o: src/PointPicker.cpp.o +.PHONY : src/PointPicker.o + +# target to build an object file +src/PointPicker.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/PointPicker.cpp.o +.PHONY : src/PointPicker.cpp.o + +src/PointPicker.i: src/PointPicker.cpp.i +.PHONY : src/PointPicker.i + +# target to preprocess a source file +src/PointPicker.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/PointPicker.cpp.i +.PHONY : src/PointPicker.cpp.i + +src/PointPicker.s: src/PointPicker.cpp.s +.PHONY : src/PointPicker.s + +# target to generate assembly for a file +src/PointPicker.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/PointPicker.cpp.s +.PHONY : src/PointPicker.cpp.s + +src/PreferencesContCellSetup.o: src/PreferencesContCellSetup.cpp.o +.PHONY : src/PreferencesContCellSetup.o + +# target to build an object file +src/PreferencesContCellSetup.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/PreferencesContCellSetup.cpp.o +.PHONY : src/PreferencesContCellSetup.cpp.o + +src/PreferencesContCellSetup.i: src/PreferencesContCellSetup.cpp.i +.PHONY : src/PreferencesContCellSetup.i + +# target to preprocess a source file +src/PreferencesContCellSetup.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/PreferencesContCellSetup.cpp.i +.PHONY : src/PreferencesContCellSetup.cpp.i + +src/PreferencesContCellSetup.s: src/PreferencesContCellSetup.cpp.s +.PHONY : src/PreferencesContCellSetup.s + +# target to generate assembly for a file +src/PreferencesContCellSetup.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/PreferencesContCellSetup.cpp.s +.PHONY : src/PreferencesContCellSetup.cpp.s + +src/PreferencesDrawingSetup.o: src/PreferencesDrawingSetup.cpp.o +.PHONY : src/PreferencesDrawingSetup.o + +# target to build an object file +src/PreferencesDrawingSetup.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/PreferencesDrawingSetup.cpp.o +.PHONY : src/PreferencesDrawingSetup.cpp.o + +src/PreferencesDrawingSetup.i: src/PreferencesDrawingSetup.cpp.i +.PHONY : src/PreferencesDrawingSetup.i + +# target to preprocess a source file +src/PreferencesDrawingSetup.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/PreferencesDrawingSetup.cpp.i +.PHONY : src/PreferencesDrawingSetup.cpp.i + +src/PreferencesDrawingSetup.s: src/PreferencesDrawingSetup.cpp.s +.PHONY : src/PreferencesDrawingSetup.s + +# target to generate assembly for a file +src/PreferencesDrawingSetup.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/PreferencesDrawingSetup.cpp.s +.PHONY : src/PreferencesDrawingSetup.cpp.s + +src/PreferencesGeneralSetup.o: src/PreferencesGeneralSetup.cpp.o +.PHONY : src/PreferencesGeneralSetup.o + +# target to build an object file +src/PreferencesGeneralSetup.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/PreferencesGeneralSetup.cpp.o +.PHONY : src/PreferencesGeneralSetup.cpp.o + +src/PreferencesGeneralSetup.i: src/PreferencesGeneralSetup.cpp.i +.PHONY : src/PreferencesGeneralSetup.i + +# target to preprocess a source file +src/PreferencesGeneralSetup.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/PreferencesGeneralSetup.cpp.i +.PHONY : src/PreferencesGeneralSetup.cpp.i + +src/PreferencesGeneralSetup.s: src/PreferencesGeneralSetup.cpp.s +.PHONY : src/PreferencesGeneralSetup.s + +# target to generate assembly for a file +src/PreferencesGeneralSetup.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/PreferencesGeneralSetup.cpp.s +.PHONY : src/PreferencesGeneralSetup.cpp.s + +src/PreferencesPSPrintingSetup.o: src/PreferencesPSPrintingSetup.cpp.o +.PHONY : src/PreferencesPSPrintingSetup.o + +# target to build an object file +src/PreferencesPSPrintingSetup.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/PreferencesPSPrintingSetup.cpp.o +.PHONY : src/PreferencesPSPrintingSetup.cpp.o + +src/PreferencesPSPrintingSetup.i: src/PreferencesPSPrintingSetup.cpp.i +.PHONY : src/PreferencesPSPrintingSetup.i + +# target to preprocess a source file +src/PreferencesPSPrintingSetup.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/PreferencesPSPrintingSetup.cpp.i +.PHONY : src/PreferencesPSPrintingSetup.cpp.i + +src/PreferencesPSPrintingSetup.s: src/PreferencesPSPrintingSetup.cpp.s +.PHONY : src/PreferencesPSPrintingSetup.s + +# target to generate assembly for a file +src/PreferencesPSPrintingSetup.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/PreferencesPSPrintingSetup.cpp.s +.PHONY : src/PreferencesPSPrintingSetup.cpp.s + +src/PreferencesShowModeSetup.o: src/PreferencesShowModeSetup.cpp.o +.PHONY : src/PreferencesShowModeSetup.o + +# target to build an object file +src/PreferencesShowModeSetup.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/PreferencesShowModeSetup.cpp.o +.PHONY : src/PreferencesShowModeSetup.cpp.o + +src/PreferencesShowModeSetup.i: src/PreferencesShowModeSetup.cpp.i +.PHONY : src/PreferencesShowModeSetup.i + +# target to preprocess a source file +src/PreferencesShowModeSetup.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/PreferencesShowModeSetup.cpp.i +.PHONY : src/PreferencesShowModeSetup.cpp.i + +src/PreferencesShowModeSetup.s: src/PreferencesShowModeSetup.cpp.s +.PHONY : src/PreferencesShowModeSetup.s + +# target to generate assembly for a file +src/PreferencesShowModeSetup.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/PreferencesShowModeSetup.cpp.s +.PHONY : src/PreferencesShowModeSetup.cpp.s + +src/PreferencesUtils.o: src/PreferencesUtils.cpp.o +.PHONY : src/PreferencesUtils.o + +# target to build an object file +src/PreferencesUtils.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/PreferencesUtils.cpp.o +.PHONY : src/PreferencesUtils.cpp.o + +src/PreferencesUtils.i: src/PreferencesUtils.cpp.i +.PHONY : src/PreferencesUtils.i + +# target to preprocess a source file +src/PreferencesUtils.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/PreferencesUtils.cpp.i +.PHONY : src/PreferencesUtils.cpp.i + +src/PreferencesUtils.s: src/PreferencesUtils.cpp.s +.PHONY : src/PreferencesUtils.s + +# target to generate assembly for a file +src/PreferencesUtils.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/PreferencesUtils.cpp.s +.PHONY : src/PreferencesUtils.cpp.s + +src/PrintContinuityEditor.o: src/PrintContinuityEditor.cpp.o +.PHONY : src/PrintContinuityEditor.o + +# target to build an object file +src/PrintContinuityEditor.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/PrintContinuityEditor.cpp.o +.PHONY : src/PrintContinuityEditor.cpp.o + +src/PrintContinuityEditor.i: src/PrintContinuityEditor.cpp.i +.PHONY : src/PrintContinuityEditor.i + +# target to preprocess a source file +src/PrintContinuityEditor.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/PrintContinuityEditor.cpp.i +.PHONY : src/PrintContinuityEditor.cpp.i + +src/PrintContinuityEditor.s: src/PrintContinuityEditor.cpp.s +.PHONY : src/PrintContinuityEditor.s + +# target to generate assembly for a file +src/PrintContinuityEditor.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/PrintContinuityEditor.cpp.s +.PHONY : src/PrintContinuityEditor.cpp.s + +src/PrintPostScriptDialog.o: src/PrintPostScriptDialog.cpp.o +.PHONY : src/PrintPostScriptDialog.o + +# target to build an object file +src/PrintPostScriptDialog.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/PrintPostScriptDialog.cpp.o +.PHONY : src/PrintPostScriptDialog.cpp.o + +src/PrintPostScriptDialog.i: src/PrintPostScriptDialog.cpp.i +.PHONY : src/PrintPostScriptDialog.i + +# target to preprocess a source file +src/PrintPostScriptDialog.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/PrintPostScriptDialog.cpp.i +.PHONY : src/PrintPostScriptDialog.cpp.i + +src/PrintPostScriptDialog.s: src/PrintPostScriptDialog.cpp.s +.PHONY : src/PrintPostScriptDialog.s + +# target to generate assembly for a file +src/PrintPostScriptDialog.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/PrintPostScriptDialog.cpp.s +.PHONY : src/PrintPostScriptDialog.cpp.s + +src/SetupInstruments.o: src/SetupInstruments.cpp.o +.PHONY : src/SetupInstruments.o + +# target to build an object file +src/SetupInstruments.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/SetupInstruments.cpp.o +.PHONY : src/SetupInstruments.cpp.o + +src/SetupInstruments.i: src/SetupInstruments.cpp.i +.PHONY : src/SetupInstruments.i + +# target to preprocess a source file +src/SetupInstruments.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/SetupInstruments.cpp.i +.PHONY : src/SetupInstruments.cpp.i + +src/SetupInstruments.s: src/SetupInstruments.cpp.s +.PHONY : src/SetupInstruments.s + +# target to generate assembly for a file +src/SetupInstruments.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/SetupInstruments.cpp.s +.PHONY : src/SetupInstruments.cpp.s + +src/SetupMarchers.o: src/SetupMarchers.cpp.o +.PHONY : src/SetupMarchers.o + +# target to build an object file +src/SetupMarchers.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/SetupMarchers.cpp.o +.PHONY : src/SetupMarchers.cpp.o + +src/SetupMarchers.i: src/SetupMarchers.cpp.i +.PHONY : src/SetupMarchers.i + +# target to preprocess a source file +src/SetupMarchers.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/SetupMarchers.cpp.i +.PHONY : src/SetupMarchers.cpp.i + +src/SetupMarchers.s: src/SetupMarchers.cpp.s +.PHONY : src/SetupMarchers.s + +# target to generate assembly for a file +src/SetupMarchers.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/SetupMarchers.cpp.s +.PHONY : src/SetupMarchers.cpp.s + +src/TransitionSolverFrame.o: src/TransitionSolverFrame.cpp.o +.PHONY : src/TransitionSolverFrame.o + +# target to build an object file +src/TransitionSolverFrame.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/TransitionSolverFrame.cpp.o +.PHONY : src/TransitionSolverFrame.cpp.o + +src/TransitionSolverFrame.i: src/TransitionSolverFrame.cpp.i +.PHONY : src/TransitionSolverFrame.i + +# target to preprocess a source file +src/TransitionSolverFrame.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/TransitionSolverFrame.cpp.i +.PHONY : src/TransitionSolverFrame.cpp.i + +src/TransitionSolverFrame.s: src/TransitionSolverFrame.cpp.s +.PHONY : src/TransitionSolverFrame.s + +# target to generate assembly for a file +src/TransitionSolverFrame.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/TransitionSolverFrame.cpp.s +.PHONY : src/TransitionSolverFrame.cpp.s + +src/TransitionSolverProgressFrame.o: src/TransitionSolverProgressFrame.cpp.o +.PHONY : src/TransitionSolverProgressFrame.o + +# target to build an object file +src/TransitionSolverProgressFrame.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/TransitionSolverProgressFrame.cpp.o +.PHONY : src/TransitionSolverProgressFrame.cpp.o + +src/TransitionSolverProgressFrame.i: src/TransitionSolverProgressFrame.cpp.i +.PHONY : src/TransitionSolverProgressFrame.i + +# target to preprocess a source file +src/TransitionSolverProgressFrame.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/TransitionSolverProgressFrame.cpp.i +.PHONY : src/TransitionSolverProgressFrame.cpp.i + +src/TransitionSolverProgressFrame.s: src/TransitionSolverProgressFrame.cpp.s +.PHONY : src/TransitionSolverProgressFrame.s + +# target to generate assembly for a file +src/TransitionSolverProgressFrame.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/TransitionSolverProgressFrame.cpp.s +.PHONY : src/TransitionSolverProgressFrame.cpp.s + +src/TransitionSolverView.o: src/TransitionSolverView.cpp.o +.PHONY : src/TransitionSolverView.o + +# target to build an object file +src/TransitionSolverView.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/TransitionSolverView.cpp.o +.PHONY : src/TransitionSolverView.cpp.o + +src/TransitionSolverView.i: src/TransitionSolverView.cpp.i +.PHONY : src/TransitionSolverView.i + +# target to preprocess a source file +src/TransitionSolverView.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/TransitionSolverView.cpp.i +.PHONY : src/TransitionSolverView.cpp.i + +src/TransitionSolverView.s: src/TransitionSolverView.cpp.s +.PHONY : src/TransitionSolverView.s + +# target to generate assembly for a file +src/TransitionSolverView.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/TransitionSolverView.cpp.s +.PHONY : src/TransitionSolverView.cpp.s + +src/basic_ui.o: src/basic_ui.cpp.o +.PHONY : src/basic_ui.o + +# target to build an object file +src/basic_ui.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/basic_ui.cpp.o +.PHONY : src/basic_ui.cpp.o + +src/basic_ui.i: src/basic_ui.cpp.i +.PHONY : src/basic_ui.i + +# target to preprocess a source file +src/basic_ui.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/basic_ui.cpp.i +.PHONY : src/basic_ui.cpp.i + +src/basic_ui.s: src/basic_ui.cpp.s +.PHONY : src/basic_ui.s + +# target to generate assembly for a file +src/basic_ui.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/basic_ui.cpp.s +.PHONY : src/basic_ui.cpp.s + +src/confgr.o: src/confgr.cpp.o +.PHONY : src/confgr.o + +# target to build an object file +src/confgr.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/confgr.cpp.o +.PHONY : src/confgr.cpp.o + +src/confgr.i: src/confgr.cpp.i +.PHONY : src/confgr.i + +# target to preprocess a source file +src/confgr.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/confgr.cpp.i +.PHONY : src/confgr.cpp.i + +src/confgr.s: src/confgr.cpp.s +.PHONY : src/confgr.s + +# target to generate assembly for a file +src/confgr.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/confgr.cpp.s +.PHONY : src/confgr.cpp.s + +src/cont_box_draw.o: src/cont_box_draw.cpp.o +.PHONY : src/cont_box_draw.o + +# target to build an object file +src/cont_box_draw.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/cont_box_draw.cpp.o +.PHONY : src/cont_box_draw.cpp.o + +src/cont_box_draw.i: src/cont_box_draw.cpp.i +.PHONY : src/cont_box_draw.i + +# target to preprocess a source file +src/cont_box_draw.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/cont_box_draw.cpp.i +.PHONY : src/cont_box_draw.cpp.i + +src/cont_box_draw.s: src/cont_box_draw.cpp.s +.PHONY : src/cont_box_draw.s + +# target to generate assembly for a file +src/cont_box_draw.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/cont_box_draw.cpp.s +.PHONY : src/cont_box_draw.cpp.s + +src/core/CalChartAnimation.o: src/core/CalChartAnimation.cpp.o +.PHONY : src/core/CalChartAnimation.o + +# target to build an object file +src/core/CalChartAnimation.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/CalChartAnimation.cpp.o +.PHONY : src/core/CalChartAnimation.cpp.o + +src/core/CalChartAnimation.i: src/core/CalChartAnimation.cpp.i +.PHONY : src/core/CalChartAnimation.i + +# target to preprocess a source file +src/core/CalChartAnimation.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/CalChartAnimation.cpp.i +.PHONY : src/core/CalChartAnimation.cpp.i + +src/core/CalChartAnimation.s: src/core/CalChartAnimation.cpp.s +.PHONY : src/core/CalChartAnimation.s + +# target to generate assembly for a file +src/core/CalChartAnimation.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/CalChartAnimation.cpp.s +.PHONY : src/core/CalChartAnimation.cpp.s + +src/core/CalChartAnimationCommand.o: src/core/CalChartAnimationCommand.cpp.o +.PHONY : src/core/CalChartAnimationCommand.o + +# target to build an object file +src/core/CalChartAnimationCommand.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/CalChartAnimationCommand.cpp.o +.PHONY : src/core/CalChartAnimationCommand.cpp.o + +src/core/CalChartAnimationCommand.i: src/core/CalChartAnimationCommand.cpp.i +.PHONY : src/core/CalChartAnimationCommand.i + +# target to preprocess a source file +src/core/CalChartAnimationCommand.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/CalChartAnimationCommand.cpp.i +.PHONY : src/core/CalChartAnimationCommand.cpp.i + +src/core/CalChartAnimationCommand.s: src/core/CalChartAnimationCommand.cpp.s +.PHONY : src/core/CalChartAnimationCommand.s + +# target to generate assembly for a file +src/core/CalChartAnimationCommand.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/CalChartAnimationCommand.cpp.s +.PHONY : src/core/CalChartAnimationCommand.cpp.s + +src/core/CalChartAnimationCompile.o: src/core/CalChartAnimationCompile.cpp.o +.PHONY : src/core/CalChartAnimationCompile.o + +# target to build an object file +src/core/CalChartAnimationCompile.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/CalChartAnimationCompile.cpp.o +.PHONY : src/core/CalChartAnimationCompile.cpp.o + +src/core/CalChartAnimationCompile.i: src/core/CalChartAnimationCompile.cpp.i +.PHONY : src/core/CalChartAnimationCompile.i + +# target to preprocess a source file +src/core/CalChartAnimationCompile.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/CalChartAnimationCompile.cpp.i +.PHONY : src/core/CalChartAnimationCompile.cpp.i + +src/core/CalChartAnimationCompile.s: src/core/CalChartAnimationCompile.cpp.s +.PHONY : src/core/CalChartAnimationCompile.s + +# target to generate assembly for a file +src/core/CalChartAnimationCompile.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/CalChartAnimationCompile.cpp.s +.PHONY : src/core/CalChartAnimationCompile.cpp.s + +src/core/CalChartAnimationSheet.o: src/core/CalChartAnimationSheet.cpp.o +.PHONY : src/core/CalChartAnimationSheet.o + +# target to build an object file +src/core/CalChartAnimationSheet.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/CalChartAnimationSheet.cpp.o +.PHONY : src/core/CalChartAnimationSheet.cpp.o + +src/core/CalChartAnimationSheet.i: src/core/CalChartAnimationSheet.cpp.i +.PHONY : src/core/CalChartAnimationSheet.i + +# target to preprocess a source file +src/core/CalChartAnimationSheet.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/CalChartAnimationSheet.cpp.i +.PHONY : src/core/CalChartAnimationSheet.cpp.i + +src/core/CalChartAnimationSheet.s: src/core/CalChartAnimationSheet.cpp.s +.PHONY : src/core/CalChartAnimationSheet.s + +# target to generate assembly for a file +src/core/CalChartAnimationSheet.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/CalChartAnimationSheet.cpp.s +.PHONY : src/core/CalChartAnimationSheet.cpp.s + +src/core/CalChartCoord.o: src/core/CalChartCoord.cpp.o +.PHONY : src/core/CalChartCoord.o + +# target to build an object file +src/core/CalChartCoord.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/CalChartCoord.cpp.o +.PHONY : src/core/CalChartCoord.cpp.o + +src/core/CalChartCoord.i: src/core/CalChartCoord.cpp.i +.PHONY : src/core/CalChartCoord.i + +# target to preprocess a source file +src/core/CalChartCoord.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/CalChartCoord.cpp.i +.PHONY : src/core/CalChartCoord.cpp.i + +src/core/CalChartCoord.s: src/core/CalChartCoord.cpp.s +.PHONY : src/core/CalChartCoord.s + +# target to generate assembly for a file +src/core/CalChartCoord.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/CalChartCoord.cpp.s +.PHONY : src/core/CalChartCoord.cpp.s + +src/core/CalChartMovePointsTool.o: src/core/CalChartMovePointsTool.cpp.o +.PHONY : src/core/CalChartMovePointsTool.o + +# target to build an object file +src/core/CalChartMovePointsTool.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/CalChartMovePointsTool.cpp.o +.PHONY : src/core/CalChartMovePointsTool.cpp.o + +src/core/CalChartMovePointsTool.i: src/core/CalChartMovePointsTool.cpp.i +.PHONY : src/core/CalChartMovePointsTool.i + +# target to preprocess a source file +src/core/CalChartMovePointsTool.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/CalChartMovePointsTool.cpp.i +.PHONY : src/core/CalChartMovePointsTool.cpp.i + +src/core/CalChartMovePointsTool.s: src/core/CalChartMovePointsTool.cpp.s +.PHONY : src/core/CalChartMovePointsTool.s + +# target to generate assembly for a file +src/core/CalChartMovePointsTool.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/CalChartMovePointsTool.cpp.s +.PHONY : src/core/CalChartMovePointsTool.cpp.s + +src/core/CalChartSelectTool.o: src/core/CalChartSelectTool.cpp.o +.PHONY : src/core/CalChartSelectTool.o + +# target to build an object file +src/core/CalChartSelectTool.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/CalChartSelectTool.cpp.o +.PHONY : src/core/CalChartSelectTool.cpp.o + +src/core/CalChartSelectTool.i: src/core/CalChartSelectTool.cpp.i +.PHONY : src/core/CalChartSelectTool.i + +# target to preprocess a source file +src/core/CalChartSelectTool.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/CalChartSelectTool.cpp.i +.PHONY : src/core/CalChartSelectTool.cpp.i + +src/core/CalChartSelectTool.s: src/core/CalChartSelectTool.cpp.s +.PHONY : src/core/CalChartSelectTool.s + +# target to generate assembly for a file +src/core/CalChartSelectTool.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/CalChartSelectTool.cpp.s +.PHONY : src/core/CalChartSelectTool.cpp.s + +src/core/CalChartShapes.o: src/core/CalChartShapes.cpp.o +.PHONY : src/core/CalChartShapes.o + +# target to build an object file +src/core/CalChartShapes.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/CalChartShapes.cpp.o +.PHONY : src/core/CalChartShapes.cpp.o + +src/core/CalChartShapes.i: src/core/CalChartShapes.cpp.i +.PHONY : src/core/CalChartShapes.i + +# target to preprocess a source file +src/core/CalChartShapes.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/CalChartShapes.cpp.i +.PHONY : src/core/CalChartShapes.cpp.i + +src/core/CalChartShapes.s: src/core/CalChartShapes.cpp.s +.PHONY : src/core/CalChartShapes.s + +# target to generate assembly for a file +src/core/CalChartShapes.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/CalChartShapes.cpp.s +.PHONY : src/core/CalChartShapes.cpp.s + +src/core/cc_continuity.o: src/core/cc_continuity.cpp.o +.PHONY : src/core/cc_continuity.o + +# target to build an object file +src/core/cc_continuity.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/cc_continuity.cpp.o +.PHONY : src/core/cc_continuity.cpp.o + +src/core/cc_continuity.i: src/core/cc_continuity.cpp.i +.PHONY : src/core/cc_continuity.i + +# target to preprocess a source file +src/core/cc_continuity.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/cc_continuity.cpp.i +.PHONY : src/core/cc_continuity.cpp.i + +src/core/cc_continuity.s: src/core/cc_continuity.cpp.s +.PHONY : src/core/cc_continuity.s + +# target to generate assembly for a file +src/core/cc_continuity.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/cc_continuity.cpp.s +.PHONY : src/core/cc_continuity.cpp.s + +src/core/cc_image.o: src/core/cc_image.cpp.o +.PHONY : src/core/cc_image.o + +# target to build an object file +src/core/cc_image.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/cc_image.cpp.o +.PHONY : src/core/cc_image.cpp.o + +src/core/cc_image.i: src/core/cc_image.cpp.i +.PHONY : src/core/cc_image.i + +# target to preprocess a source file +src/core/cc_image.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/cc_image.cpp.i +.PHONY : src/core/cc_image.cpp.i + +src/core/cc_image.s: src/core/cc_image.cpp.s +.PHONY : src/core/cc_image.s + +# target to generate assembly for a file +src/core/cc_image.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/cc_image.cpp.s +.PHONY : src/core/cc_image.cpp.s + +src/core/cc_point.o: src/core/cc_point.cpp.o +.PHONY : src/core/cc_point.o + +# target to build an object file +src/core/cc_point.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/cc_point.cpp.o +.PHONY : src/core/cc_point.cpp.o + +src/core/cc_point.i: src/core/cc_point.cpp.i +.PHONY : src/core/cc_point.i + +# target to preprocess a source file +src/core/cc_point.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/cc_point.cpp.i +.PHONY : src/core/cc_point.cpp.i + +src/core/cc_point.s: src/core/cc_point.cpp.s +.PHONY : src/core/cc_point.s + +# target to generate assembly for a file +src/core/cc_point.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/cc_point.cpp.s +.PHONY : src/core/cc_point.cpp.s + +src/core/cc_sheet.o: src/core/cc_sheet.cpp.o +.PHONY : src/core/cc_sheet.o + +# target to build an object file +src/core/cc_sheet.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/cc_sheet.cpp.o +.PHONY : src/core/cc_sheet.cpp.o + +src/core/cc_sheet.i: src/core/cc_sheet.cpp.i +.PHONY : src/core/cc_sheet.i + +# target to preprocess a source file +src/core/cc_sheet.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/cc_sheet.cpp.i +.PHONY : src/core/cc_sheet.cpp.i + +src/core/cc_sheet.s: src/core/cc_sheet.cpp.s +.PHONY : src/core/cc_sheet.s + +# target to generate assembly for a file +src/core/cc_sheet.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/cc_sheet.cpp.s +.PHONY : src/core/cc_sheet.cpp.s + +src/core/cc_show.o: src/core/cc_show.cpp.o +.PHONY : src/core/cc_show.o + +# target to build an object file +src/core/cc_show.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/cc_show.cpp.o +.PHONY : src/core/cc_show.cpp.o + +src/core/cc_show.i: src/core/cc_show.cpp.i +.PHONY : src/core/cc_show.i + +# target to preprocess a source file +src/core/cc_show.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/cc_show.cpp.i +.PHONY : src/core/cc_show.cpp.i + +src/core/cc_show.s: src/core/cc_show.cpp.s +.PHONY : src/core/cc_show.s + +# target to generate assembly for a file +src/core/cc_show.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/cc_show.cpp.s +.PHONY : src/core/cc_show.cpp.s + +src/core/cc_text.o: src/core/cc_text.cpp.o +.PHONY : src/core/cc_text.o + +# target to build an object file +src/core/cc_text.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/cc_text.cpp.o +.PHONY : src/core/cc_text.cpp.o + +src/core/cc_text.i: src/core/cc_text.cpp.i +.PHONY : src/core/cc_text.i + +# target to preprocess a source file +src/core/cc_text.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/cc_text.cpp.i +.PHONY : src/core/cc_text.cpp.i + +src/core/cc_text.s: src/core/cc_text.cpp.s +.PHONY : src/core/cc_text.s + +# target to generate assembly for a file +src/core/cc_text.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/cc_text.cpp.s +.PHONY : src/core/cc_text.cpp.s + +src/core/cont.o: src/core/cont.cpp.o +.PHONY : src/core/cont.o + +# target to build an object file +src/core/cont.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/cont.cpp.o +.PHONY : src/core/cont.cpp.o + +src/core/cont.i: src/core/cont.cpp.i +.PHONY : src/core/cont.i + +# target to preprocess a source file +src/core/cont.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/cont.cpp.i +.PHONY : src/core/cont.cpp.i + +src/core/cont.s: src/core/cont.cpp.s +.PHONY : src/core/cont.s + +# target to generate assembly for a file +src/core/cont.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/cont.cpp.s +.PHONY : src/core/cont.cpp.s + +src/core/e7_transition_solver.o: src/core/e7_transition_solver.cpp.o +.PHONY : src/core/e7_transition_solver.o + +# target to build an object file +src/core/e7_transition_solver.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/e7_transition_solver.cpp.o +.PHONY : src/core/e7_transition_solver.cpp.o + +src/core/e7_transition_solver.i: src/core/e7_transition_solver.cpp.i +.PHONY : src/core/e7_transition_solver.i + +# target to preprocess a source file +src/core/e7_transition_solver.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/e7_transition_solver.cpp.i +.PHONY : src/core/e7_transition_solver.cpp.i + +src/core/e7_transition_solver.s: src/core/e7_transition_solver.cpp.s +.PHONY : src/core/e7_transition_solver.s + +# target to generate assembly for a file +src/core/e7_transition_solver.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/e7_transition_solver.cpp.s +.PHONY : src/core/e7_transition_solver.cpp.s + +src/core/math_utils.o: src/core/math_utils.cpp.o +.PHONY : src/core/math_utils.o + +# target to build an object file +src/core/math_utils.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/math_utils.cpp.o +.PHONY : src/core/math_utils.cpp.o + +src/core/math_utils.i: src/core/math_utils.cpp.i +.PHONY : src/core/math_utils.i + +# target to preprocess a source file +src/core/math_utils.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/math_utils.cpp.i +.PHONY : src/core/math_utils.cpp.i + +src/core/math_utils.s: src/core/math_utils.cpp.s +.PHONY : src/core/math_utils.s + +# target to generate assembly for a file +src/core/math_utils.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/math_utils.cpp.s +.PHONY : src/core/math_utils.cpp.s + +src/core/modes.o: src/core/modes.cpp.o +.PHONY : src/core/modes.o + +# target to build an object file +src/core/modes.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/modes.cpp.o +.PHONY : src/core/modes.cpp.o + +src/core/modes.i: src/core/modes.cpp.i +.PHONY : src/core/modes.i + +# target to preprocess a source file +src/core/modes.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/modes.cpp.i +.PHONY : src/core/modes.cpp.i + +src/core/modes.s: src/core/modes.cpp.s +.PHONY : src/core/modes.s + +# target to generate assembly for a file +src/core/modes.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/modes.cpp.s +.PHONY : src/core/modes.cpp.s + +src/core/print_ps.o: src/core/print_ps.cpp.o +.PHONY : src/core/print_ps.o + +# target to build an object file +src/core/print_ps.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/print_ps.cpp.o +.PHONY : src/core/print_ps.cpp.o + +src/core/print_ps.i: src/core/print_ps.cpp.i +.PHONY : src/core/print_ps.i + +# target to preprocess a source file +src/core/print_ps.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/print_ps.cpp.i +.PHONY : src/core/print_ps.cpp.i + +src/core/print_ps.s: src/core/print_ps.cpp.s +.PHONY : src/core/print_ps.s + +# target to generate assembly for a file +src/core/print_ps.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/print_ps.cpp.s +.PHONY : src/core/print_ps.cpp.s + +src/core/viewer_translate.o: src/core/viewer_translate.cpp.o +.PHONY : src/core/viewer_translate.o + +# target to build an object file +src/core/viewer_translate.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/viewer_translate.cpp.o +.PHONY : src/core/viewer_translate.cpp.o + +src/core/viewer_translate.i: src/core/viewer_translate.cpp.i +.PHONY : src/core/viewer_translate.i + +# target to preprocess a source file +src/core/viewer_translate.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/viewer_translate.cpp.i +.PHONY : src/core/viewer_translate.cpp.i + +src/core/viewer_translate.s: src/core/viewer_translate.cpp.s +.PHONY : src/core/viewer_translate.s + +# target to generate assembly for a file +src/core/viewer_translate.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/calchart_core.dir/build.make CMakeFiles/calchart_core.dir/src/core/viewer_translate.cpp.s +.PHONY : src/core/viewer_translate.cpp.s + +src/draw.o: src/draw.cpp.o +.PHONY : src/draw.o + +# target to build an object file +src/draw.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/draw.cpp.o +.PHONY : src/draw.cpp.o + +src/draw.i: src/draw.cpp.i +.PHONY : src/draw.i + +# target to preprocess a source file +src/draw.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/draw.cpp.i +.PHONY : src/draw.cpp.i + +src/draw.s: src/draw.cpp.s +.PHONY : src/draw.s + +# target to generate assembly for a file +src/draw.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/draw.cpp.s +.PHONY : src/draw.cpp.s + +src/mode_dialog.o: src/mode_dialog.cpp.o +.PHONY : src/mode_dialog.o + +# target to build an object file +src/mode_dialog.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/mode_dialog.cpp.o +.PHONY : src/mode_dialog.cpp.o + +src/mode_dialog.i: src/mode_dialog.cpp.i +.PHONY : src/mode_dialog.i + +# target to preprocess a source file +src/mode_dialog.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/mode_dialog.cpp.i +.PHONY : src/mode_dialog.cpp.i + +src/mode_dialog.s: src/mode_dialog.cpp.s +.PHONY : src/mode_dialog.s + +# target to generate assembly for a file +src/mode_dialog.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/mode_dialog.cpp.s +.PHONY : src/mode_dialog.cpp.s + +src/mode_dialog_canvas.o: src/mode_dialog_canvas.cpp.o +.PHONY : src/mode_dialog_canvas.o + +# target to build an object file +src/mode_dialog_canvas.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/mode_dialog_canvas.cpp.o +.PHONY : src/mode_dialog_canvas.cpp.o + +src/mode_dialog_canvas.i: src/mode_dialog_canvas.cpp.i +.PHONY : src/mode_dialog_canvas.i + +# target to preprocess a source file +src/mode_dialog_canvas.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/mode_dialog_canvas.cpp.i +.PHONY : src/mode_dialog_canvas.cpp.i + +src/mode_dialog_canvas.s: src/mode_dialog_canvas.cpp.s +.PHONY : src/mode_dialog_canvas.s + +# target to generate assembly for a file +src/mode_dialog_canvas.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/mode_dialog_canvas.cpp.s +.PHONY : src/mode_dialog_canvas.cpp.s + +src/setup_wizards.o: src/setup_wizards.cpp.o +.PHONY : src/setup_wizards.o + +# target to build an object file +src/setup_wizards.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/setup_wizards.cpp.o +.PHONY : src/setup_wizards.cpp.o + +src/setup_wizards.i: src/setup_wizards.cpp.i +.PHONY : src/setup_wizards.i + +# target to preprocess a source file +src/setup_wizards.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/setup_wizards.cpp.i +.PHONY : src/setup_wizards.cpp.i + +src/setup_wizards.s: src/setup_wizards.cpp.s +.PHONY : src/setup_wizards.s + +# target to generate assembly for a file +src/setup_wizards.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/CalChart.dir/build.make CMakeFiles/CalChart.dir/src/setup_wizards.cpp.s +.PHONY : src/setup_wizards.cpp.s + +# Help Target +help: + @echo "The following are some of the valid targets for this Makefile:" + @echo "... all (the default if no target is provided)" + @echo "... clean" + @echo "... depend" + @echo "... edit_cache" + @echo "... install" + @echo "... install/local" + @echo "... install/strip" + @echo "... list_install_components" + @echo "... package" + @echo "... package_source" + @echo "... rebuild_cache" + @echo "... test" + @echo "... Continuous" + @echo "... ContinuousBuild" + @echo "... ContinuousConfigure" + @echo "... ContinuousCoverage" + @echo "... ContinuousMemCheck" + @echo "... ContinuousStart" + @echo "... ContinuousSubmit" + @echo "... ContinuousTest" + @echo "... ContinuousUpdate" + @echo "... Experimental" + @echo "... ExperimentalBuild" + @echo "... ExperimentalConfigure" + @echo "... ExperimentalCoverage" + @echo "... ExperimentalMemCheck" + @echo "... ExperimentalStart" + @echo "... ExperimentalSubmit" + @echo "... ExperimentalTest" + @echo "... ExperimentalUpdate" + @echo "... Nightly" + @echo "... NightlyBuild" + @echo "... NightlyConfigure" + @echo "... NightlyCoverage" + @echo "... NightlyMemCheck" + @echo "... NightlyMemoryCheck" + @echo "... NightlyStart" + @echo "... NightlySubmit" + @echo "... NightlyTest" + @echo "... NightlyUpdate" + @echo "... all_pch" + @echo "... clean_cotire" + @echo "... example" + @echo "... uninstall" + @echo "... wxaui_pch" + @echo "... wxbase_pch" + @echo "... wxcore_pch" + @echo "... wxgl_pch" + @echo "... wxhtml_pch" + @echo "... wxnet_pch" + @echo "... wxpropgrid_pch" + @echo "... wxqa_pch" + @echo "... wxribbon_pch" + @echo "... wxrichtext_pch" + @echo "... wxscintilla_pch" + @echo "... wxstc_pch" + @echo "... wxwebview_pch" + @echo "... wxxml_pch" + @echo "... wxxrc_pch" + @echo "... CalChart" + @echo "... calchart_cmd" + @echo "... calchart_core" + @echo "... docopt" + @echo "... docopt_o" + @echo "... docopt_s" + @echo "... munkres" + @echo "... munkres.bin" + @echo "... wxadv" + @echo "... wxaui" + @echo "... wxbase" + @echo "... wxcore" + @echo "... wxgl" + @echo "... wxhtml" + @echo "... wxjpeg" + @echo "... wxmedia" + @echo "... wxnet" + @echo "... wxpng" + @echo "... wxpropgrid" + @echo "... wxqa" + @echo "... wxrc" + @echo "... wxregex" + @echo "... wxribbon" + @echo "... wxrichtext" + @echo "... wxscintilla" + @echo "... wxstc" + @echo "... wxtiff" + @echo "... wxwebview" + @echo "... wxxml" + @echo "... wxxrc" + @echo "... calchart_cmd/main.o" + @echo "... calchart_cmd/main.i" + @echo "... calchart_cmd/main.s" + @echo "... contgram.o" + @echo "... contgram.i" + @echo "... contgram.s" + @echo "... contscan.o" + @echo "... contscan.i" + @echo "... contscan.s" + @echo "... src/AnimationCanvas.o" + @echo "... src/AnimationCanvas.i" + @echo "... src/AnimationCanvas.s" + @echo "... src/AnimationErrorsPanel.o" + @echo "... src/AnimationErrorsPanel.i" + @echo "... src/AnimationErrorsPanel.s" + @echo "... src/AnimationPanel.o" + @echo "... src/AnimationPanel.i" + @echo "... src/AnimationPanel.s" + @echo "... src/AnimationView.o" + @echo "... src/AnimationView.i" + @echo "... src/AnimationView.s" + @echo "... src/BackgroundImages.o" + @echo "... src/BackgroundImages.i" + @echo "... src/BackgroundImages.s" + @echo "... src/CCOmniviewCanvas.o" + @echo "... src/CCOmniviewCanvas.i" + @echo "... src/CCOmniviewCanvas.s" + @echo "... src/CalChartApp.o" + @echo "... src/CalChartApp.i" + @echo "... src/CalChartApp.s" + @echo "... src/CalChartDoc.o" + @echo "... src/CalChartDoc.i" + @echo "... src/CalChartDoc.s" + @echo "... src/CalChartDocCommand.o" + @echo "... src/CalChartDocCommand.i" + @echo "... src/CalChartDocCommand.s" + @echo "... src/CalChartFrame.o" + @echo "... src/CalChartFrame.i" + @echo "... src/CalChartFrame.s" + @echo "... src/CalChartPreferences.o" + @echo "... src/CalChartPreferences.i" + @echo "... src/CalChartPreferences.s" + @echo "... src/CalChartSizes.o" + @echo "... src/CalChartSizes.i" + @echo "... src/CalChartSizes.s" + @echo "... src/CalChartSplash.o" + @echo "... src/CalChartSplash.i" + @echo "... src/CalChartSplash.s" + @echo "... src/CalChartToolBar.o" + @echo "... src/CalChartToolBar.i" + @echo "... src/CalChartToolBar.s" + @echo "... src/CalChartView.o" + @echo "... src/CalChartView.i" + @echo "... src/CalChartView.s" + @echo "... src/ColorPalette.o" + @echo "... src/ColorPalette.i" + @echo "... src/ColorPalette.s" + @echo "... src/ColorSetupCanvas.o" + @echo "... src/ColorSetupCanvas.i" + @echo "... src/ColorSetupCanvas.s" + @echo "... src/ColorSetupDialog.o" + @echo "... src/ColorSetupDialog.i" + @echo "... src/ColorSetupDialog.s" + @echo "... src/ContinuityBrowser.o" + @echo "... src/ContinuityBrowser.i" + @echo "... src/ContinuityBrowser.s" + @echo "... src/ContinuityBrowserPanel.o" + @echo "... src/ContinuityBrowserPanel.i" + @echo "... src/ContinuityBrowserPanel.s" + @echo "... src/ContinuityComposerDialog.o" + @echo "... src/ContinuityComposerDialog.i" + @echo "... src/ContinuityComposerDialog.s" + @echo "... src/ContinuityEditorPopup.o" + @echo "... src/ContinuityEditorPopup.i" + @echo "... src/ContinuityEditorPopup.s" + @echo "... src/CustomListViewPanel.o" + @echo "... src/CustomListViewPanel.i" + @echo "... src/CustomListViewPanel.s" + @echo "... src/FieldCanvas.o" + @echo "... src/FieldCanvas.i" + @echo "... src/FieldCanvas.s" + @echo "... src/FieldControlsToolBar.o" + @echo "... src/FieldControlsToolBar.i" + @echo "... src/FieldControlsToolBar.s" + @echo "... src/FieldThumbnailBrowser.o" + @echo "... src/FieldThumbnailBrowser.i" + @echo "... src/FieldThumbnailBrowser.s" + @echo "... src/HostAppInterface.o" + @echo "... src/HostAppInterface.i" + @echo "... src/HostAppInterface.s" + @echo "... src/PointPicker.o" + @echo "... src/PointPicker.i" + @echo "... src/PointPicker.s" + @echo "... src/PreferencesContCellSetup.o" + @echo "... src/PreferencesContCellSetup.i" + @echo "... src/PreferencesContCellSetup.s" + @echo "... src/PreferencesDrawingSetup.o" + @echo "... src/PreferencesDrawingSetup.i" + @echo "... src/PreferencesDrawingSetup.s" + @echo "... src/PreferencesGeneralSetup.o" + @echo "... src/PreferencesGeneralSetup.i" + @echo "... src/PreferencesGeneralSetup.s" + @echo "... src/PreferencesPSPrintingSetup.o" + @echo "... src/PreferencesPSPrintingSetup.i" + @echo "... src/PreferencesPSPrintingSetup.s" + @echo "... src/PreferencesShowModeSetup.o" + @echo "... src/PreferencesShowModeSetup.i" + @echo "... src/PreferencesShowModeSetup.s" + @echo "... src/PreferencesUtils.o" + @echo "... src/PreferencesUtils.i" + @echo "... src/PreferencesUtils.s" + @echo "... src/PrintContinuityEditor.o" + @echo "... src/PrintContinuityEditor.i" + @echo "... src/PrintContinuityEditor.s" + @echo "... src/PrintPostScriptDialog.o" + @echo "... src/PrintPostScriptDialog.i" + @echo "... src/PrintPostScriptDialog.s" + @echo "... src/SetupInstruments.o" + @echo "... src/SetupInstruments.i" + @echo "... src/SetupInstruments.s" + @echo "... src/SetupMarchers.o" + @echo "... src/SetupMarchers.i" + @echo "... src/SetupMarchers.s" + @echo "... src/TransitionSolverFrame.o" + @echo "... src/TransitionSolverFrame.i" + @echo "... src/TransitionSolverFrame.s" + @echo "... src/TransitionSolverProgressFrame.o" + @echo "... src/TransitionSolverProgressFrame.i" + @echo "... src/TransitionSolverProgressFrame.s" + @echo "... src/TransitionSolverView.o" + @echo "... src/TransitionSolverView.i" + @echo "... src/TransitionSolverView.s" + @echo "... src/basic_ui.o" + @echo "... src/basic_ui.i" + @echo "... src/basic_ui.s" + @echo "... src/confgr.o" + @echo "... src/confgr.i" + @echo "... src/confgr.s" + @echo "... src/cont_box_draw.o" + @echo "... src/cont_box_draw.i" + @echo "... src/cont_box_draw.s" + @echo "... src/core/CalChartAnimation.o" + @echo "... src/core/CalChartAnimation.i" + @echo "... src/core/CalChartAnimation.s" + @echo "... src/core/CalChartAnimationCommand.o" + @echo "... src/core/CalChartAnimationCommand.i" + @echo "... src/core/CalChartAnimationCommand.s" + @echo "... src/core/CalChartAnimationCompile.o" + @echo "... src/core/CalChartAnimationCompile.i" + @echo "... src/core/CalChartAnimationCompile.s" + @echo "... src/core/CalChartAnimationSheet.o" + @echo "... src/core/CalChartAnimationSheet.i" + @echo "... src/core/CalChartAnimationSheet.s" + @echo "... src/core/CalChartCoord.o" + @echo "... src/core/CalChartCoord.i" + @echo "... src/core/CalChartCoord.s" + @echo "... src/core/CalChartMovePointsTool.o" + @echo "... src/core/CalChartMovePointsTool.i" + @echo "... src/core/CalChartMovePointsTool.s" + @echo "... src/core/CalChartSelectTool.o" + @echo "... src/core/CalChartSelectTool.i" + @echo "... src/core/CalChartSelectTool.s" + @echo "... src/core/CalChartShapes.o" + @echo "... src/core/CalChartShapes.i" + @echo "... src/core/CalChartShapes.s" + @echo "... src/core/cc_continuity.o" + @echo "... src/core/cc_continuity.i" + @echo "... src/core/cc_continuity.s" + @echo "... src/core/cc_image.o" + @echo "... src/core/cc_image.i" + @echo "... src/core/cc_image.s" + @echo "... src/core/cc_point.o" + @echo "... src/core/cc_point.i" + @echo "... src/core/cc_point.s" + @echo "... src/core/cc_sheet.o" + @echo "... src/core/cc_sheet.i" + @echo "... src/core/cc_sheet.s" + @echo "... src/core/cc_show.o" + @echo "... src/core/cc_show.i" + @echo "... src/core/cc_show.s" + @echo "... src/core/cc_text.o" + @echo "... src/core/cc_text.i" + @echo "... src/core/cc_text.s" + @echo "... src/core/cont.o" + @echo "... src/core/cont.i" + @echo "... src/core/cont.s" + @echo "... src/core/e7_transition_solver.o" + @echo "... src/core/e7_transition_solver.i" + @echo "... src/core/e7_transition_solver.s" + @echo "... src/core/math_utils.o" + @echo "... src/core/math_utils.i" + @echo "... src/core/math_utils.s" + @echo "... src/core/modes.o" + @echo "... src/core/modes.i" + @echo "... src/core/modes.s" + @echo "... src/core/print_ps.o" + @echo "... src/core/print_ps.i" + @echo "... src/core/print_ps.s" + @echo "... src/core/viewer_translate.o" + @echo "... src/core/viewer_translate.i" + @echo "... src/core/viewer_translate.s" + @echo "... src/draw.o" + @echo "... src/draw.i" + @echo "... src/draw.s" + @echo "... src/mode_dialog.o" + @echo "... src/mode_dialog.i" + @echo "... src/mode_dialog.s" + @echo "... src/mode_dialog_canvas.o" + @echo "... src/mode_dialog_canvas.i" + @echo "... src/mode_dialog_canvas.s" + @echo "... src/setup_wizards.o" + @echo "... src/setup_wizards.i" + @echo "... src/setup_wizards.s" +.PHONY : help + + + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system -# DO NOT DELETE diff --git a/calchart_cmd/main.cpp b/calchart_cmd/main.cpp index 30ce6fbf..cc1d950e 100644 --- a/calchart_cmd/main.cpp +++ b/calchart_cmd/main.cpp @@ -6,8 +6,8 @@ // // -#include "cc_show.h" -#include "cc_sheet.h" +#include "CalChartShow.h" +#include "CalChartSheet.h" #include "CalChartAnimation.h" #include "CalChartAnimationCompile.h" #include "print_ps.h" @@ -47,7 +47,7 @@ using namespace CalChart; void AnimateShow(const char* show) { std::ifstream input(show); - std::unique_ptr p(Show::Create_CC_show(ShowMode::GetDefaultShowMode(), input)); + std::unique_ptr p(Show::Create(ShowMode::GetDefaultShowMode(), input)); Animation a(*p, [](const std::string& notice) { std::cout << notice << "\n"; }, [](const std::map&, unsigned, @@ -60,7 +60,7 @@ void AnimateShow(const char* show) void PrintShow(const char* show) { std::ifstream input(show); - std::unique_ptr p(Show::Create_CC_show(ShowMode::GetDefaultShowMode(), input)); + std::unique_ptr p(Show::Create(ShowMode::GetDefaultShowMode(), input)); Animation a(*p, [](const std::string& notice) { std::cout << notice << "\n"; }, [](const std::map&, unsigned, @@ -92,7 +92,7 @@ void PrintShow(const char* show) void DumpContinuity(const char* show) { std::ifstream input(show); - std::unique_ptr p(Show::Create_CC_show(ShowMode::GetDefaultShowMode(), input)); + std::unique_ptr p(Show::Create(ShowMode::GetDefaultShowMode(), input)); auto sheet_num = 0; for (auto i = p->GetSheetBegin(); i != p->GetSheetEnd(); ++i, ++sheet_num) { static const SYMBOL_TYPE k_symbols[] = { @@ -229,7 +229,7 @@ void PrintToPS(const char* show, bool landscape, bool cont, bool contsheet, bool overview, std::string const& outfile) { std::ifstream input(show); - std::unique_ptr p(Show::Create_CC_show(ShowMode::GetDefaultShowMode(), input)); + std::unique_ptr p(Show::Create(ShowMode::GetDefaultShowMode(), input)); std::ofstream output(outfile); @@ -292,7 +292,7 @@ bool ContinuityCountDifferentThanSymbol(const char* show) if (!input.is_open()) { throw std::runtime_error("could not open file"); } - std::unique_ptr p(Show::Create_CC_show(ShowMode::GetDefaultShowMode(), input)); + std::unique_ptr p(Show::Create(ShowMode::GetDefaultShowMode(), input)); return false; } diff --git a/src/AnimationView.cpp b/src/AnimationView.cpp index 0951011d..1437ecb5 100644 --- a/src/AnimationView.cpp +++ b/src/AnimationView.cpp @@ -27,7 +27,7 @@ #include "CalChartView.h" #include "CalChartAnimation.h" #include "CalChartShapes.h" -#include "cc_sheet.h" +#include "CalChartSheet.h" #include "confgr.h" #include "draw.h" #include "modes.h" diff --git a/src/BackgroundImage.h b/src/BackgroundImage.h deleted file mode 100644 index 8c265d71..00000000 --- a/src/BackgroundImage.h +++ /dev/null @@ -1,73 +0,0 @@ -#pragma once -/* - * BackgroundImage.h - * Maintains the background image data - */ -/* - Copyright (C) 1995-2011 Garrick Brian Meeker, Richard Michael Powell - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - */ - -#include -#include -#include -#include - -class BackgroundImage { -public: - BackgroundImage(wxImage const& image, int x, int y, int scaled_width, int scaled_height); - - bool MouseClickIsHit(wxMouseEvent const& event, wxDC const& dc) const; - void OnMouseLeftDown(wxMouseEvent const& event, wxDC const& dc); - // returns left, top, width, height - std::array OnMouseLeftUp(wxMouseEvent const& event, wxDC const& dc); - - void OnMouseMove(wxMouseEvent const& event, wxDC const& dc); - void OnPaint(wxDC& dc, bool drawPicAdjustDots, bool selected) const; - -private: - static constexpr auto kCircleSize = 6; - - wxImage mImage; - wxBitmap mBitmap; - wxPoint mBitmapPoint; - - // what type of background adjustments could we do - enum class BackgroundAdjustType { - kUpperLeft = 0, - kUpper, - kUpperRight, - kLeft, - kMove, - kRight, - kLowerLeft, - kLower, - kLowerRight, - kLast, - }; - BackgroundAdjustType mBackgroundAdjustType; - - struct CalculateScaleAndMove { - public: - CalculateScaleAndMove(wxPoint startClick, wxRect rect, BackgroundAdjustType adjustType); - - wxRect operator()(wxCoord x, wxCoord y, wxRect wxRect); - wxPoint mStartClick; - wxRect mRect; - float mAspectRatio; - BackgroundAdjustType mAdjustType; - }; - std::unique_ptr mScaleAndMove; -}; diff --git a/src/BackgroundImage.cpp b/src/BackgroundImages.cpp similarity index 71% rename from src/BackgroundImage.cpp rename to src/BackgroundImages.cpp index 1655e68a..aed8db27 100644 --- a/src/BackgroundImage.cpp +++ b/src/BackgroundImages.cpp @@ -1,5 +1,5 @@ /* - * BackgroundImage.cpp + * BackgroundImages.cpp * Maintains the background image data */ @@ -20,9 +20,57 @@ along with this program. If not, see . */ -#include "BackgroundImage.h" +#include "BackgroundImages.h" +#include "CalChartImage.h" #include +class BackgroundImage { +public: + BackgroundImage(wxImage const& image, int x, int y, int scaled_width, int scaled_height); + + bool MouseClickIsHit(wxMouseEvent const& event, wxDC const& dc) const; + void OnMouseLeftDown(wxMouseEvent const& event, wxDC const& dc); + // returns left, top, width, height + std::array OnMouseLeftUp(wxMouseEvent const& event, wxDC const& dc); + + void OnMouseMove(wxMouseEvent const& event, wxDC const& dc); + void OnPaint(wxDC& dc, bool drawPicAdjustDots, bool selected) const; + +private: + static constexpr auto kCircleSize = 6; + + wxImage mImage; + wxBitmap mBitmap; + wxPoint mBitmapPoint; + + // what type of background adjustments could we do + enum class BackgroundAdjustType { + kUpperLeft = 0, + kUpper, + kUpperRight, + kLeft, + kMove, + kRight, + kLowerLeft, + kLower, + kLowerRight, + kLast, + }; + BackgroundAdjustType mBackgroundAdjustType; + + struct CalculateScaleAndMove { + public: + CalculateScaleAndMove(wxPoint startClick, wxRect rect, BackgroundAdjustType adjustType); + + wxRect operator()(wxCoord x, wxCoord y, wxRect wxRect); + wxPoint mStartClick; + wxRect mRect; + float mAspectRatio; + BackgroundAdjustType mAdjustType; + }; + std::unique_ptr mScaleAndMove; +}; + BackgroundImage::BackgroundImage(const wxImage& image, int x, int y, int scaled_width, int scaled_height) : mImage(image) , mBitmapPoint(x, y) @@ -253,3 +301,72 @@ wxRect BackgroundImage::CalculateScaleAndMove::operator()(wxCoord x, wxCoord y, return rect; } } + +BackgroundImages::BackgroundImages() = default; +BackgroundImages::~BackgroundImages() = default; + +void BackgroundImages::SetBackgroundImages(std::vector const& images) +{ + mBackgroundImages.clear(); + mWhichBackgroundIndex = -1; + for (auto&& image : images) { + // ugh... not sure if there's a better way to pass data to image. + auto d = static_cast(malloc(sizeof(unsigned char) * image.image_width * image.image_height * 3)); + std::copy(image.data.begin(), image.data.end(), d); + auto a = static_cast(nullptr); + if (image.alpha.size()) { + a = static_cast(malloc(sizeof(unsigned char) * image.image_width * image.image_height)); + std::copy(image.alpha.begin(), image.alpha.end(), a); + wxImage img(image.image_width, image.image_height, d, a); + mBackgroundImages.emplace_back(img, image.left, image.top, image.scaled_width, image.scaled_height); + } else { + wxImage img(image.image_width, image.image_height, d); + mBackgroundImages.emplace_back(img, image.left, image.top, image.scaled_width, image.scaled_height); + } + } +} + +void BackgroundImages::OnPaint(wxDC& dc) const +{ + for (auto i = 0; i < static_cast(mBackgroundImages.size()); ++i) { + mBackgroundImages[i].OnPaint(dc, mAdjustBackgroundMode, mWhichBackgroundIndex == i); + } +} + +void BackgroundImages::OnMouseLeftDown(wxMouseEvent const& event, wxDC const& dc) +{ + if (!mAdjustBackgroundMode) { + return; + } + mWhichBackgroundIndex = -1; + for (auto i = 0; i < static_cast(mBackgroundImages.size()); ++i) { + if (mBackgroundImages[i].MouseClickIsHit(event, dc)) { + mWhichBackgroundIndex = i; + } + } + if (mWhichBackgroundIndex != -1) { + mBackgroundImages[mWhichBackgroundIndex].OnMouseLeftDown(event, dc); + } +} + +std::optional>> BackgroundImages::OnMouseLeftUp(wxMouseEvent const& event, wxDC const& dc) +{ + if (!mAdjustBackgroundMode) { + return {}; + } + if (mWhichBackgroundIndex >= 0 && mWhichBackgroundIndex < static_cast(mBackgroundImages.size())) { + return { { mWhichBackgroundIndex, mBackgroundImages[mWhichBackgroundIndex].OnMouseLeftUp(event, dc) } }; + } + return {}; +} + +void BackgroundImages::OnMouseMove(wxMouseEvent const& event, wxDC const& dc) +{ + if (!mAdjustBackgroundMode) { + return; + } + if (mWhichBackgroundIndex >= 0 && mWhichBackgroundIndex < static_cast(mBackgroundImages.size())) { + mBackgroundImages[mWhichBackgroundIndex].OnMouseMove(event, dc); + } +} + diff --git a/src/BackgroundImages.h b/src/BackgroundImages.h new file mode 100644 index 00000000..03c8d16b --- /dev/null +++ b/src/BackgroundImages.h @@ -0,0 +1,57 @@ +#pragma once +/* + * BackgroundImage.h + * Maintains the background image data + */ +/* + Copyright (C) 1995-2011 Garrick Brian Meeker, Richard Michael Powell + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +#include +#include +#include +#include + +namespace CalChart { + class ImageData; +} + +class BackgroundImage; + +class BackgroundImages { +public: + BackgroundImages(); + ~BackgroundImages(); + + void SetBackgroundImages(std::vector const& images); + + auto GetAdjustBackgroundMode() const { return mAdjustBackgroundMode; } + void SetAdjustBackgroundMode(bool adjustBackgroundMode) { mAdjustBackgroundMode = adjustBackgroundMode; } + + std::optional GetCurrentIndex() const { return mWhichBackgroundIndex == -1 ? std::optional{} : mWhichBackgroundIndex; } + + void OnMouseLeftDown(wxMouseEvent const& event, wxDC const& dc); + std::optional>> OnMouseLeftUp(wxMouseEvent const& event, wxDC const& dc); + void OnMouseMove(wxMouseEvent const& event, wxDC const& dc); + + void OnPaint(wxDC& dc) const; + +private: + std::vector mBackgroundImages; + bool mAdjustBackgroundMode{}; + int mWhichBackgroundIndex = -1; + +}; diff --git a/src/CalChartDoc.cpp b/src/CalChartDoc.cpp index fa61ffdf..4e722bf3 100644 --- a/src/CalChartDoc.cpp +++ b/src/CalChartDoc.cpp @@ -26,9 +26,9 @@ #include "cc_continuity.h" #include "cc_fileformat.h" #include "cc_parse_errors.h" -#include "cc_point.h" +#include "CalChartPoint.h" #include "CalChartShapes.h" -#include "cc_sheet.h" +#include "CalChartSheet.h" #include "confgr.h" #include "draw.h" #include "math_utils.h" @@ -52,7 +52,7 @@ IMPLEMENT_DYNAMIC_CLASS(CalChartDoc, CalChartDoc::super); // Create a new show CalChartDoc::CalChartDoc() - : mShow(Show::Create_CC_show(GetConfigShowMode(kShowModeStrings[0]))) + : mShow(Show::Create(GetConfigShowMode(kShowModeStrings[0]))) , mTimer(*this) { mTimer.Start(static_cast(CalChartConfiguration::GetGlobalConfig().Get_AutosaveInterval()) * 1000); @@ -228,7 +228,7 @@ T& CalChartDoc::LoadObjectGeneric(T& stream) return ContinuityEditorPopup::ProcessEditContinuity(GetDocumentWindow(), description, what, line, column).ToStdString(); } }; - mShow = Show::Create_CC_show(GetConfigShowMode(kShowModeStrings[0]), stream, &handlers); + mShow = Show::Create(GetConfigShowMode(kShowModeStrings[0]), stream, &handlers); } catch (std::exception const& e) { wxString message = wxT("Error encountered:\n"); message += e.what(); @@ -327,7 +327,7 @@ CalChartDoc::GetAnimation() const void CalChartDoc::WizardSetupNewShow(std::vector> const& labelsAndInstruments, int columns, ShowMode const& newmode) { - mShow = Show::Create_CC_show(newmode, labelsAndInstruments, columns); + mShow = Show::Create(newmode, labelsAndInstruments, columns); UpdateAllViews(); } @@ -367,6 +367,12 @@ void CalChartDoc::SetDrawBackground(bool drawBackground) UpdateAllViews(); } +void CalChartDoc::SetCurrentMove(CalChart::MoveMode move) +{ + mCurrentMove = move; + UpdateAllViews(); +} + const ShowMode& CalChartDoc::GetShowMode() const { return mShow->GetShowMode(); } int CalChartDoc::PrintToPS(std::ostream& buffer, bool overview, diff --git a/src/CalChartDoc.h b/src/CalChartDoc.h index a0d79269..0879f8b3 100644 --- a/src/CalChartDoc.h +++ b/src/CalChartDoc.h @@ -20,7 +20,7 @@ along with this program. If not, see . */ -#include "cc_show.h" +#include "CalChartShow.h" #include #include @@ -175,6 +175,8 @@ class CalChartDoc : public wxDocument { void SetDrawPaths(bool drawPaths); auto GetDrawBackground() const { return mDrawBackground; } void SetDrawBackground(bool drawBackground); + auto GetCurrentMove() const { return mCurrentMove; } + void SetCurrentMove(CalChart::MoveMode move); CalChart::ShowMode const& GetShowMode() const; // nullptr if there is no animation @@ -254,6 +256,7 @@ class CalChartDoc : public wxDocument { std::unique_ptr mShow; std::unique_ptr mAnimation; CalChart::Select mSelect = CalChart::Select::Box; + CalChart::MoveMode mCurrentMove = CalChart::MoveMode::Normal; int mCurrentReferencePoint{}; bool mDrawPaths{}; bool mDrawBackground{}; diff --git a/src/CalChartFrame.cpp b/src/CalChartFrame.cpp index d7844bcd..fd02e151 100644 --- a/src/CalChartFrame.cpp +++ b/src/CalChartFrame.cpp @@ -46,9 +46,9 @@ #include "TransitionSolverView.h" #include "CalChartCoord.h" #include "cc_fileformat.h" -#include "cc_point.h" -#include "cc_sheet.h" -#include "cc_show.h" +#include "CalChartPoint.h" +#include "CalChartSheet.h" +#include "CalChartShow.h" #include "ccvers.h" #include "confgr.h" #include "draw.h" diff --git a/src/CalChartView.cpp b/src/CalChartView.cpp index 6af68407..539a608f 100644 --- a/src/CalChartView.cpp +++ b/src/CalChartView.cpp @@ -31,10 +31,10 @@ #include "CalChartAnimation.h" #include "CalChartAnimationCommand.h" #include "CalChartAnimationCompile.h" -#include "BackgroundImage.h" +#include "BackgroundImages.h" #include "cc_drawcommand.h" #include "CalChartShapes.h" -#include "cc_sheet.h" +#include "CalChartSheet.h" #include "confgr.h" #include "draw.h" #include "setup_wizards.h" @@ -111,9 +111,7 @@ void CalChartView::OnDrawBackground(wxDC& dc) if (!mShow->GetDrawBackground()) { return; } - for (auto i = 0; i < static_cast(mBackgroundImages.size()); ++i) { - mBackgroundImages[i].OnPaint(dc, mAdjustBackgroundMode, mWhichBackgroundIndex == i); - } + mBackgroundImages.OnPaint(dc); } void CalChartView::OnUpdate(wxView* WXUNUSED(sender), wxObject* hint) @@ -560,12 +558,12 @@ bool CalChartView::DoingDrawBackground() const void CalChartView::DoPictureAdjustment(bool enable) { - mAdjustBackgroundMode = enable; + mBackgroundImages.SetAdjustBackgroundMode(enable); } bool CalChartView::DoingPictureAdjustment() const { - return mAdjustBackgroundMode; + return mBackgroundImages.GetAdjustBackgroundMode(); } bool CalChartView::AddBackgroundImage(const wxImage& image) @@ -595,71 +593,37 @@ bool CalChartView::AddBackgroundImage(const wxImage& image) void CalChartView::OnBackgroundMouseLeftDown(wxMouseEvent& event, wxDC& dc) { - if (!mAdjustBackgroundMode) { - return; - } - mWhichBackgroundIndex = -1; - for (auto i = 0; i < static_cast(mBackgroundImages.size()); ++i) { - if (mBackgroundImages[i].MouseClickIsHit(event, dc)) { - mWhichBackgroundIndex = i; - } - } - if (mWhichBackgroundIndex != -1) { - mBackgroundImages[mWhichBackgroundIndex].OnMouseLeftDown(event, dc); - } + mBackgroundImages.OnMouseLeftDown(event, dc); } void CalChartView::OnBackgroundMouseLeftUp(wxMouseEvent& event, wxDC& dc) { - if (!mAdjustBackgroundMode) { - return; - } - if (mWhichBackgroundIndex >= 0 && mWhichBackgroundIndex < static_cast(mBackgroundImages.size())) { - auto result = mBackgroundImages[mWhichBackgroundIndex].OnMouseLeftUp(event, dc); - auto cmd = mShow->Create_MoveBackgroundImageCommand(mWhichBackgroundIndex, std::get<0>(result), std::get<1>(result), std::get<2>(result), std::get<3>(result)); + if (auto result = mBackgroundImages.OnMouseLeftUp(event, dc); result) { + auto [ index, resultArray ] = *result; + auto cmd = mShow->Create_MoveBackgroundImageCommand(index, std::get<0>(resultArray), std::get<1>(resultArray), std::get<2>(resultArray), std::get<3>(resultArray)); GetDocument()->GetCommandProcessor()->Submit(cmd.release()); } } void CalChartView::OnBackgroundMouseMove(wxMouseEvent& event, wxDC& dc) { - if (!mAdjustBackgroundMode) { - return; - } - if (mWhichBackgroundIndex >= 0 && mWhichBackgroundIndex < static_cast(mBackgroundImages.size())) { - mBackgroundImages[mWhichBackgroundIndex].OnMouseMove(event, dc); - } + mBackgroundImages.OnMouseMove(event, dc); } void CalChartView::OnBackgroundImageDelete() { - if (!mAdjustBackgroundMode || !(mWhichBackgroundIndex >= 0 && mWhichBackgroundIndex < static_cast(mBackgroundImages.size()))) { + auto currentIndex = mBackgroundImages.GetCurrentIndex(); + if (!mBackgroundImages.GetAdjustBackgroundMode() || !currentIndex) { return; } // let the doc know we've removed a picture. - auto cmd = mShow->Create_RemoveBackgroundImageCommand(mWhichBackgroundIndex); + auto cmd = mShow->Create_RemoveBackgroundImageCommand(*currentIndex); GetDocument()->GetCommandProcessor()->Submit(cmd.release()); } void CalChartView::UpdateBackgroundImages() { - mBackgroundImages.clear(); if (mShow && mShow->GetNumSheets()) { - auto images = mShow->GetCurrentSheet()->GetBackgroundImages(); - for (auto&& image : images) { - // ugh... not sure if there's a better way to pass data to image. - auto d = static_cast(malloc(sizeof(unsigned char) * image.image_width * image.image_height * 3)); - std::copy(image.data.begin(), image.data.end(), d); - auto a = static_cast(nullptr); - if (image.alpha.size()) { - a = static_cast(malloc(sizeof(unsigned char) * image.image_width * image.image_height)); - std::copy(image.alpha.begin(), image.alpha.end(), a); - wxImage img(image.image_width, image.image_height, d, a); - mBackgroundImages.emplace_back(img, image.left, image.top, image.scaled_width, image.scaled_height); - } else { - wxImage img(image.image_width, image.image_height, d); - mBackgroundImages.emplace_back(img, image.left, image.top, image.scaled_width, image.scaled_height); - } - } + mBackgroundImages.SetBackgroundImages(mShow->GetCurrentSheet()->GetBackgroundImages()); } } diff --git a/src/CalChartView.h b/src/CalChartView.h index 3831d6c6..f796ac86 100644 --- a/src/CalChartView.h +++ b/src/CalChartView.h @@ -24,6 +24,7 @@ #include "CalChartAnimationCompile.h" #include "CalChartCoord.h" #include "CalChartTypes.h" +#include "BackgroundImages.h" #include "GhostModule.h" #include "modes.h" @@ -32,7 +33,7 @@ // CalChartView connects together the Frames and the Doc. -class BackgroundImage; +class BackgroundImages; class CalChartFrame; class AnimationFrame; class Animation; @@ -118,8 +119,8 @@ class CalChartView : public wxView { void SetSelectionList(const SelectionList& sl); auto GetSelect() const { return mShow->GetSelect(); } void SetSelect(CalChart::Select select); - auto GetCurrentMove() const { return mCurrentMove; } - void SetCurrentMove(CalChart::MoveMode move) { mCurrentMove = move; } + auto GetCurrentMove() const { return mShow->GetCurrentMove(); } + void SetCurrentMove(CalChart::MoveMode move) { mShow->SetCurrentMove(move); } void GoToSheetAndSetSelectionList(int which, const SelectionList& sl); auto IsSelected(int i) const { return mShow->IsSelected(i); } @@ -148,11 +149,7 @@ class CalChartView : public wxView { GhostModule mGhostModule{}; CalChartDoc* mShow{}; CalChartConfiguration& mConfig; - std::vector mBackgroundImages; - bool mDrawBackground{}; - bool mAdjustBackgroundMode{}; - int mWhichBackgroundIndex{}; - CalChart::MoveMode mCurrentMove = CalChart::MoveMode::Normal; + BackgroundImages mBackgroundImages; DECLARE_DYNAMIC_CLASS(CalChartView) }; diff --git a/src/ColorSetupCanvas.cpp b/src/ColorSetupCanvas.cpp index 6ab5fd42..cc7030be 100644 --- a/src/ColorSetupCanvas.cpp +++ b/src/ColorSetupCanvas.cpp @@ -27,7 +27,7 @@ #include "ContinuityComposerDialog.h" #include "cc_drawcommand.h" #include "CalChartShapes.h" -#include "cc_sheet.h" +#include "CalChartSheet.h" #include "confgr.h" #include "cont.h" #include "draw.h" @@ -55,7 +55,7 @@ END_EVENT_TABLE() ColorSetupCanvas::ColorSetupCanvas(CalChartConfiguration& config, wxWindow* parent) : super(parent, wxID_ANY, wxDefaultPosition, GetColorSetupCanvas()) - , mShow(Show::Create_CC_show(ShowMode::GetDefaultShowMode())) + , mShow(Show::Create(ShowMode::GetDefaultShowMode())) , mMode(ShowMode::CreateShowMode( Coord(Int2CoordUnits(160), Int2CoordUnits(84)), Coord(Int2CoordUnits(80), Int2CoordUnits(42)), diff --git a/src/ColorSetupDialog.cpp b/src/ColorSetupDialog.cpp index bd6d8a9c..202d10b3 100644 --- a/src/ColorSetupDialog.cpp +++ b/src/ColorSetupDialog.cpp @@ -27,7 +27,7 @@ #include "ContinuityComposerDialog.h" #include "cc_drawcommand.h" #include "CalChartShapes.h" -#include "cc_sheet.h" +#include "CalChartSheet.h" #include "confgr.h" #include "cont.h" #include "draw.h" diff --git a/src/ContinuityBrowser.cpp b/src/ContinuityBrowser.cpp index 443ec80f..6abfcad4 100644 --- a/src/ContinuityBrowser.cpp +++ b/src/ContinuityBrowser.cpp @@ -25,7 +25,7 @@ #include "CalChartView.h" #include "ContinuityBrowserPanel.h" #include "basic_ui.h" -#include "cc_sheet.h" +#include "CalChartSheet.h" #include "confgr.h" #include diff --git a/src/ContinuityEditorPopup.cpp b/src/ContinuityEditorPopup.cpp index aa04ad57..ed3d8afe 100644 --- a/src/ContinuityEditorPopup.cpp +++ b/src/ContinuityEditorPopup.cpp @@ -27,8 +27,8 @@ #include "ContinuityBrowser.h" #include "basic_ui.h" #include "cc_continuity.h" -#include "cc_sheet.h" -#include "cc_show.h" +#include "CalChartSheet.h" +#include "CalChartShow.h" #include "confgr.h" #include diff --git a/src/core/cc_point.cpp b/src/Core/CalChartPoint.cpp similarity index 95% rename from src/core/cc_point.cpp rename to src/Core/CalChartPoint.cpp index 5110e259..e98764ed 100644 --- a/src/core/cc_point.cpp +++ b/src/Core/CalChartPoint.cpp @@ -1,5 +1,5 @@ /* - * cc_point.cpp + * CalChartPoint.cpp * Definition for the point classes */ @@ -20,7 +20,7 @@ along with this program. If not, see . */ -#include "cc_point.h" +#include "CalChartPoint.h" #include "cc_fileformat.h" #include @@ -34,7 +34,7 @@ Point::Point() { } -Point::Point(const Coord& p) +Point::Point(Coord const& p) : mSym(SYMBOL_PLAIN) , mPos(p) { @@ -48,7 +48,7 @@ Point::Point(const Coord& p) // reference point ) , BigEndianInt16( x ) , BigEndianInt16( y ) }* ; // POINT_SYMBOL_DATA = BigEndianInt8( which symbol type ) ; // POINT_LABEL_FLIP_DATA = BigEndianInt8( label flipped ) ; -Point::Point(const std::vector& serialized_data) +Point::Point(std::vector const& serialized_data) : mSym(SYMBOL_PLAIN) { const uint8_t* d = &serialized_data[0]; @@ -136,7 +136,7 @@ Coord Point::GetPos(unsigned ref) const return mRef[ref - 1]; } -void Point::SetPos(const Coord& c, unsigned ref) +void Point::SetPos(Coord c, unsigned ref) { if (ref == 0) { mPos = c; @@ -160,7 +160,7 @@ struct Point_values { bool Visable; }; -bool Check_Point(const Point& underTest, const Point_values& values) +bool Check_Point(Point const& underTest, Point_values const& values) { bool running_value = true; for (unsigned i = 0; i < Point::kNumRefPoints; ++i) diff --git a/src/core/cc_point.h b/src/Core/CalChartPoint.h similarity index 94% rename from src/core/cc_point.h rename to src/Core/CalChartPoint.h index 7e63f123..b9e678b2 100644 --- a/src/core/cc_point.h +++ b/src/Core/CalChartPoint.h @@ -1,6 +1,6 @@ #pragma once /* - * cc_point.h + * CalChartPoint.h * Definitions for the point classes */ @@ -43,9 +43,9 @@ class Point { public: static constexpr auto kNumRefPoints = 3; Point(); - Point(const Coord& pos); + Point(Coord const& pos); - Point(const std::vector& serialized_data); + Point(std::vector const& serialized_data); std::vector Serialize() const; auto GetFlip() const { return mFlags.test(kPointLabelFlipped); } @@ -56,7 +56,7 @@ class Point { // reference points 0 is the point, refs are [1, kNumRefPoints] Coord GetPos(unsigned ref = 0) const; - void SetPos(const Coord& c, unsigned ref = 0); + void SetPos(Coord c, unsigned ref = 0); private: enum { kPointLabelFlipped, diff --git a/src/FieldCanvas.cpp b/src/FieldCanvas.cpp index dea14e80..22028226 100644 --- a/src/FieldCanvas.cpp +++ b/src/FieldCanvas.cpp @@ -24,7 +24,6 @@ #include "CalChartFrame.h" #include "CalChartView.h" -#include "BackgroundImage.h" #include "cc_drawcommand.h" #include "CalChartShapes.h" #include "confgr.h" diff --git a/src/FieldControlsToolBar.cpp b/src/FieldControlsToolBar.cpp index c74e374b..a5e27881 100644 --- a/src/FieldControlsToolBar.cpp +++ b/src/FieldControlsToolBar.cpp @@ -24,7 +24,7 @@ #include "CalChartToolBar.h" #include "ColorPalette.h" #include "basic_ui.h" -#include "cc_point.h" +#include "CalChartPoint.h" #include "platconf.h" #include "ui_enums.h" diff --git a/src/FieldThumbnailBrowser.cpp b/src/FieldThumbnailBrowser.cpp index 16f911bc..353e0703 100644 --- a/src/FieldThumbnailBrowser.cpp +++ b/src/FieldThumbnailBrowser.cpp @@ -23,7 +23,7 @@ #include "CalChartSizes.h" #include "CalChartView.h" #include "basic_ui.h" -#include "cc_show.h" +#include "CalChartShow.h" #include "confgr.h" #include "draw.h" #include "modes.h" diff --git a/src/GhostModule.h b/src/GhostModule.h index 2945b566..bc2120fd 100644 --- a/src/GhostModule.h +++ b/src/GhostModule.h @@ -5,7 +5,7 @@ */ #include "CalChartDoc.h" -#include "cc_sheet.h" +#include "CalChartSheet.h" namespace CalChart { class Sheet; diff --git a/src/PreferencesDrawingSetup.cpp b/src/PreferencesDrawingSetup.cpp index 0ac86fdc..1a7c7ba1 100644 --- a/src/PreferencesDrawingSetup.cpp +++ b/src/PreferencesDrawingSetup.cpp @@ -29,7 +29,7 @@ #include "PreferencesUtils.h" #include "cc_drawcommand.h" #include "CalChartShapes.h" -#include "cc_sheet.h" +#include "CalChartSheet.h" #include "confgr.h" #include "cont.h" #include "draw.h" diff --git a/src/PreferencesPSPrintingSetup.cpp b/src/PreferencesPSPrintingSetup.cpp index 874ffaa7..d499f7c8 100644 --- a/src/PreferencesPSPrintingSetup.cpp +++ b/src/PreferencesPSPrintingSetup.cpp @@ -29,7 +29,7 @@ #include "PreferencesUtils.h" #include "cc_drawcommand.h" #include "CalChartShapes.h" -#include "cc_sheet.h" +#include "CalChartSheet.h" #include "confgr.h" #include "cont.h" #include "draw.h" diff --git a/src/PreferencesShowModeSetup.cpp b/src/PreferencesShowModeSetup.cpp index 949f18d3..6d7f8de7 100644 --- a/src/PreferencesShowModeSetup.cpp +++ b/src/PreferencesShowModeSetup.cpp @@ -29,7 +29,7 @@ #include "PreferencesUtils.h" #include "cc_drawcommand.h" #include "CalChartShapes.h" -#include "cc_sheet.h" +#include "CalChartSheet.h" #include "confgr.h" #include "cont.h" #include "draw.h" diff --git a/src/PrintContinuityEditor.cpp b/src/PrintContinuityEditor.cpp index 3b55b8cb..d9d958c0 100644 --- a/src/PrintContinuityEditor.cpp +++ b/src/PrintContinuityEditor.cpp @@ -24,7 +24,7 @@ #include "CalChartApp.h" #include "CalChartView.h" #include "basic_ui.h" -#include "cc_sheet.h" +#include "CalChartSheet.h" #include "cc_text.h" #include "draw.h" #include "ui_enums.h" diff --git a/src/PrintPostScriptDialog.cpp b/src/PrintPostScriptDialog.cpp index 6fc5aa50..965eb784 100644 --- a/src/PrintPostScriptDialog.cpp +++ b/src/PrintPostScriptDialog.cpp @@ -24,8 +24,8 @@ #include "CalChartDoc.h" #include "basic_ui.h" -#include "cc_sheet.h" -#include "cc_show.h" +#include "CalChartSheet.h" +#include "CalChartShow.h" #include "confgr.h" #include "print_ps.h" diff --git a/src/SetupInstruments.cpp b/src/SetupInstruments.cpp index 08e606e0..cf67773d 100644 --- a/src/SetupInstruments.cpp +++ b/src/SetupInstruments.cpp @@ -22,7 +22,7 @@ #include "SetupInstruments.h" #include "CalChartToolBar.h" #include "basic_ui.h" -#include "cc_sheet.h" +#include "CalChartSheet.h" #include #include #include diff --git a/src/SetupMarchers.cpp b/src/SetupMarchers.cpp index e04ebaf1..f81a9655 100644 --- a/src/SetupMarchers.cpp +++ b/src/SetupMarchers.cpp @@ -22,7 +22,7 @@ #include "SetupMarchers.h" #include "CalChartToolBar.h" #include "basic_ui.h" -#include "cc_sheet.h" +#include "CalChartSheet.h" #include #include #include diff --git a/src/TransitionSolverFrame.cpp b/src/TransitionSolverFrame.cpp index 127e5daf..4adb51f2 100644 --- a/src/TransitionSolverFrame.cpp +++ b/src/TransitionSolverFrame.cpp @@ -14,8 +14,8 @@ #include "TransitionSolverView.h" #include "basic_ui.h" #include "cc_continuity.h" -#include "cc_sheet.h" -#include "cc_show.h" +#include "CalChartSheet.h" +#include "CalChartShow.h" #include "confgr.h" #include diff --git a/src/TransitionSolverProgressFrame.cpp b/src/TransitionSolverProgressFrame.cpp index e192ae83..c594c66d 100644 --- a/src/TransitionSolverProgressFrame.cpp +++ b/src/TransitionSolverProgressFrame.cpp @@ -13,8 +13,8 @@ #include "TransitionSolverView.h" #include "basic_ui.h" #include "cc_continuity.h" -#include "cc_sheet.h" -#include "cc_show.h" +#include "CalChartSheet.h" +#include "CalChartShow.h" #include "confgr.h" #include diff --git a/src/TransitionSolverView.cpp b/src/TransitionSolverView.cpp index 877bd0ce..3453347d 100644 --- a/src/TransitionSolverView.cpp +++ b/src/TransitionSolverView.cpp @@ -13,8 +13,8 @@ #include "TransitionSolverFrame.h" #include "basic_ui.h" #include "cc_continuity.h" -#include "cc_sheet.h" -#include "cc_show.h" +#include "CalChartSheet.h" +#include "CalChartShow.h" #include "confgr.h" #include @@ -43,9 +43,5 @@ void TransitionSolverView::ApplyTransitionSolution(CalChart::TransitionSolverRes void TransitionSolverView::SelectMarchers(std::set marchers) { - std::set selectionList; - for (unsigned marcher : marchers) { - selectionList.insert(marcher); - } - GetDocument()->GetCommandProcessor()->Submit(static_cast(GetDocument())->Create_SetSelectionListCommand(selectionList).release()); + GetDocument()->GetCommandProcessor()->Submit(static_cast(GetDocument())->Create_SetSelectionListCommand({marchers.begin(), marchers.end()}).release()); } diff --git a/src/core/CalChartAnimation.cpp b/src/core/CalChartAnimation.cpp index 4adcdf33..70e74169 100644 --- a/src/core/CalChartAnimation.cpp +++ b/src/core/CalChartAnimation.cpp @@ -26,9 +26,9 @@ #include "CalChartAnimationCompile.h" #include "cc_continuity.h" #include "cc_drawcommand.h" -#include "cc_point.h" -#include "cc_sheet.h" -#include "cc_show.h" +#include "CalChartPoint.h" +#include "CalChartSheet.h" +#include "CalChartShow.h" #include "cont.h" #include "math_utils.h" diff --git a/src/core/CalChartAnimationCompile.cpp b/src/core/CalChartAnimationCompile.cpp index 3a506cc3..038b7a7d 100644 --- a/src/core/CalChartAnimationCompile.cpp +++ b/src/core/CalChartAnimationCompile.cpp @@ -23,7 +23,7 @@ #include "CalChartAnimationCompile.h" #include "CalChartAnimationErrors.h" #include "CalChartAnimationCommand.h" -#include "cc_sheet.h" +#include "CalChartSheet.h" #include "cont.h" namespace CalChart { diff --git a/src/core/CalChartAnimationCompile.h b/src/core/CalChartAnimationCompile.h index 37e5903a..ec136bca 100644 --- a/src/core/CalChartAnimationCompile.h +++ b/src/core/CalChartAnimationCompile.h @@ -23,7 +23,7 @@ #include "CalChartAnimation.h" #include "animate_types.h" -#include "cc_show.h" +#include "CalChartShow.h" #include #include diff --git a/src/core/CalChartAnimationSheet.h b/src/core/CalChartAnimationSheet.h index c62a5891..43419f1b 100644 --- a/src/core/CalChartAnimationSheet.h +++ b/src/core/CalChartAnimationSheet.h @@ -43,7 +43,7 @@ class AnimationCommand; using AnimationCommands = std::vector>; -// AnimationSheet is a snapshot of CC_sheet +// AnimationSheet is a snapshot of CalChartSheet class AnimationSheet { public: AnimationSheet(std::vector const& thePoints, std::vector const& theCommands, std::string const& s, unsigned beats) diff --git a/src/core/cc_image.cpp b/src/core/CalChartImage.cpp similarity index 90% rename from src/core/cc_image.cpp rename to src/core/CalChartImage.cpp index 7cf05e5c..9dad5989 100644 --- a/src/core/cc_image.cpp +++ b/src/core/CalChartImage.cpp @@ -1,5 +1,5 @@ /* - * cc_image.cpp + * CalChartImage.cpp */ /* @@ -19,7 +19,7 @@ along with this program. If not, see . */ -#include "cc_image.h" +#include "CalChartImage.h" #include "cc_fileformat.h" namespace CalChart { @@ -36,7 +36,7 @@ ImageData::ImageData(int left, int top, int scaled_width, int scaled_height, int { } -ImageData::ImageData(uint8_t const*& d) +ImageData::ImageData(uint8_t const* d) { left = get_big_long(d); d += 4; @@ -58,6 +58,8 @@ ImageData::ImageData(uint8_t const*& d) d += 4; alpha.assign(d, d + alpha_size); d += alpha_size; + scaled_width = (scaled_width == 0) ? image_width : scaled_width; + scaled_height = (scaled_height == 0) ? image_height : scaled_height; } std::vector ImageData::Serialize() const diff --git a/src/core/cc_image.h b/src/core/CalChartImage.h similarity index 95% rename from src/core/cc_image.h rename to src/core/CalChartImage.h index 130eca82..558d5817 100644 --- a/src/core/cc_image.h +++ b/src/core/CalChartImage.h @@ -1,6 +1,6 @@ #pragma once /* - * cc_image.h + * CalChartImage.h */ /* @@ -31,7 +31,7 @@ struct ImageData { std::vector data; std::vector alpha; ImageData(int left, int top, int scaled_width, int scaled_height, int image_width, int image_height, std::vector const& data, std::vector const& alpha); - ImageData(uint8_t const*& d); + ImageData(uint8_t const* d); std::vector Serialize() const; }; } diff --git a/src/core/cc_sheet.cpp b/src/core/CalChartSheet.cpp similarity index 91% rename from src/core/cc_sheet.cpp rename to src/core/CalChartSheet.cpp index c3285627..a2d68ef4 100644 --- a/src/core/cc_sheet.cpp +++ b/src/core/CalChartSheet.cpp @@ -1,5 +1,5 @@ /* - * cc_sheet.cpp + * CalChartSheet.cpp * Defintion for calchart sheet class */ @@ -20,12 +20,12 @@ along with this program. If not, see . */ -#include "cc_sheet.h" +#include "CalChartSheet.h" #include "CalChartAnimationCommand.h" #include "cc_fileformat.h" #include "cc_parse_errors.h" -#include "cc_show.h" +#include "CalChartShow.h" #include "viewer_translate.h" #include @@ -37,11 +37,11 @@ namespace CalChart { -const std::string contnames[MAX_NUM_SYMBOLS] = { +std::string const contnames[MAX_NUM_SYMBOLS] = { "Plain", "Sol", "Bksl", "Sl", "X", "Solbksl", "Solsl", "Solx" }; -const std::string long_contnames[MAX_NUM_SYMBOLS] = { +std::string const long_contnames[MAX_NUM_SYMBOLS] = { "Plain", "Solid", "Backslash", "Slash", "Crossed", "Solid Backslash", "Solid Slash", "Solid Crossed" }; @@ -52,7 +52,7 @@ Sheet::Sheet(size_t numPoints) { } -Sheet::Sheet(size_t numPoints, const std::string& newname) +Sheet::Sheet(size_t numPoints, std::string const& newname) : mAnimationContinuity(MAX_NUM_SYMBOLS) , mBeats(1) , mPoints(numPoints) @@ -62,7 +62,7 @@ Sheet::Sheet(size_t numPoints, const std::string& newname) // -=-=-=-=-=- LEGACY CODE -=-=-=-=-=- // Recommend that you don't touch this unless you know what you are doing. -bool are_equal_helper(const std::string& a, const std::string& b) +bool are_equal_helper(std::string const& a, std::string const& b) { auto p = std::mismatch(a.begin(), a.end(), b.begin(), [](char c1, char c2) { return std::tolower(c1) == std::tolower(c2); @@ -70,12 +70,12 @@ bool are_equal_helper(const std::string& a, const std::string& b) return (p.first == a.end() && p.second == b.end()); } -bool are_equal(const std::string& a, const std::string& b) +bool are_equal(std::string const& a, std::string const& b) { return a.size() <= b.size() ? are_equal_helper(a, b) : are_equal_helper(b, a); } -SYMBOL_TYPE GetSymbolForName(const std::string& name) +SYMBOL_TYPE GetSymbolForName(std::string const& name) { for (auto i = contnames; i != (contnames + sizeof(contnames) / sizeof(contnames[0])); ++i) { @@ -109,7 +109,7 @@ static void CheckInconsistancy(SYMBOL_TYPE symbol, uint8_t cont_index, std::map& continity_for_symbol, std::map& symbol_for_continuity, - const std::string& sheet_name, uint32_t pointNum) + std::string const& sheet_name, uint32_t pointNum) { // need to check for symbol inconsistency here. if (continity_for_symbol.count(symbol) == 0) { @@ -260,12 +260,12 @@ Sheet::Sheet(size_t numPoints, std::istream& stream, ParseErrorHandlers const* c { throw CC_FileException("Bad cont chunk"); } - const char* d = (const char*)&data[0]; + auto d = (char const*)&data[0]; if (d[data.size() - 1] != '\0') { throw CC_FileException("Bad cont chunk"); } - const char* text = d + 1; + auto text = d + 1; size_t num = strlen(text); if (data.size() < num + 3) // check for room for text string { @@ -299,25 +299,25 @@ Sheet::Sheet(size_t numPoints, std::istream& stream, ParseErrorHandlers const* c } // -=-=-=-=-=- LEGACY CODE -=-=-=-=-=- -Sheet::Sheet(size_t numPoints, const uint8_t* ptr, size_t size, ParseErrorHandlers const* correction) +Sheet::Sheet(size_t numPoints, uint8_t const* ptr, size_t size, ParseErrorHandlers const* correction) : mAnimationContinuity(MAX_NUM_SYMBOLS) , mPoints(numPoints) { // construct the parser handlers - auto parse_INGL_NAME = [](Sheet* sheet, const uint8_t* ptr, size_t size) { - auto str = (const char*)ptr; + auto parse_INGL_NAME = [](Sheet* sheet, uint8_t const* ptr, size_t size) { + auto str = (char const*)ptr; if (size != (strlen(str) + 1)) { throw CC_FileException("Description the wrong size", INGL_NAME); } sheet->mName = str; }; - auto parse_INGL_DURA = [](Sheet* sheet, const uint8_t* ptr, size_t size) { + auto parse_INGL_DURA = [](Sheet* sheet, uint8_t const* ptr, size_t size) { if (4 != size) { throw CC_FileException("Incorrect size", INGL_DURA); } sheet->mBeats = get_big_long(ptr); }; - auto parse_INGL_PNTS = [](Sheet* sheet, const uint8_t* ptr, size_t size) { + auto parse_INGL_PNTS = [](Sheet* sheet, uint8_t const* ptr, size_t size) { for (auto i = 0u; i < sheet->mPoints.size(); ++i) { auto this_size = *ptr; if (this_size > size) { @@ -331,16 +331,16 @@ Sheet::Sheet(size_t numPoints, const uint8_t* ptr, size_t size, ParseErrorHandle throw CC_FileException("Incorrect size", INGL_PNTS); } }; - auto parse_INGL_ECNT = [correction](Sheet* sheet, const uint8_t* ptr, size_t size) { + auto parse_INGL_ECNT = [correction](Sheet* sheet, uint8_t const* ptr, size_t size) { if (size < 2) // one byte num + 1 nil minimum { throw CC_FileException("Bad cont chunk", INGL_ECNT); } - const char* d = (const char*)ptr; + auto d = (char const*)ptr; if (d[size - 1] != '\0') { throw CC_FileException("Cont chunk not NULL terminated", INGL_ECNT); } - const char* text = d + 1; + auto text = d + 1; size_t num = strlen(text); if (size < num + 2) // check for room for text string { @@ -353,9 +353,8 @@ Sheet::Sheet(size_t numPoints, const uint8_t* ptr, size_t size, ParseErrorHandle std::string textstr(text); sheet->mAnimationContinuity.at(symbol_index) = Continuity{ textstr, correction }; }; - auto parse_INGL_CONT = [parse_INGL_ECNT](Sheet* sheet, const uint8_t* ptr, - size_t size) { - const std::map> + auto parse_INGL_CONT = [parse_INGL_ECNT](Sheet* sheet, uint8_t const* ptr, size_t size) { + const std::map> parser = { { INGL_ECNT, parse_INGL_ECNT }, }; @@ -368,7 +367,7 @@ Sheet::Sheet(size_t numPoints, const uint8_t* ptr, size_t size, ParseErrorHandle } } }; - auto parse_INGL_EVCT = [](Sheet* sheet, const uint8_t* ptr, size_t size) { + auto parse_INGL_EVCT = [](Sheet* sheet, uint8_t const* ptr, size_t size) { auto begin = ptr; auto end = ptr + size; if (std::distance(begin, end) < 1) // one byte for symbol @@ -381,8 +380,8 @@ Sheet::Sheet(size_t numPoints, const uint8_t* ptr, size_t size, ParseErrorHandle } sheet->mAnimationContinuity.at(symbol_index) = Continuity{ std::vector{ begin, end } }; }; - auto parse_INGL_VCNT = [parse_INGL_EVCT](Sheet* sheet, const uint8_t* ptr, size_t size) { - const std::map> + auto parse_INGL_VCNT = [parse_INGL_EVCT](Sheet* sheet, uint8_t const* ptr, size_t size) { + std::map> const parser = { { INGL_EVCT, parse_INGL_EVCT }, }; @@ -395,15 +394,15 @@ Sheet::Sheet(size_t numPoints, const uint8_t* ptr, size_t size, ParseErrorHandle } } }; - auto parse_INGL_PCNT = [](Sheet* sheet, const uint8_t* ptr, size_t size) { - const char* print_name = (const char*)ptr; - const char* print_cont = print_name + strlen(print_name) + 1; + auto parse_INGL_PCNT = [](Sheet* sheet, uint8_t const* ptr, size_t size) { + auto print_name = (char const*)ptr; + auto print_cont = print_name + strlen(print_name) + 1; if ((strlen(print_name) + 1 + strlen(print_cont) + 1) != size) { throw CC_FileException("Bad Print cont chunk", INGL_PCNT); } sheet->mPrintableContinuity = Print_continuity(print_name, print_cont); }; - auto parse_INGL_BACK = [](Sheet* sheet, const uint8_t* ptr, size_t size) { + auto parse_INGL_BACK = [](Sheet* sheet, uint8_t const* ptr, size_t size) { auto end_ptr = ptr + size; auto num = get_big_long(ptr); ptr += 4; @@ -415,7 +414,7 @@ Sheet::Sheet(size_t numPoints, const uint8_t* ptr, size_t size, ParseErrorHandle } }; - const std::map> + std::map> const parser = { { INGL_NAME, parse_INGL_NAME }, { INGL_DURA, parse_INGL_DURA }, @@ -440,7 +439,7 @@ std::vector Sheet::SerializeAllPoints() const // for each of the points, serialize them. Don't need to wrap in block // because it's not specified that way std::vector result; - for (const auto& i : mPoints) { + for (auto&& i : mPoints) { Parser::Append(result, i.Serialize()); } return result; @@ -528,8 +527,7 @@ std::vector Sheet::SerializeSheet() const Sheet::~Sheet() = default; // Find point at certain coords -int Sheet::FindPoint(Coord where, Coord::units searchBound, - unsigned ref) const +int Sheet::FindPoint(Coord where, Coord::units searchBound, unsigned ref) const { for (auto i = 0; i < static_cast(mPoints.size()); i++) { Coord c = GetPosition(i, ref); @@ -551,7 +549,7 @@ SelectionList Sheet::MakeSelectPointsBySymbol(SYMBOL_TYPE i) const return select; } -std::vector Sheet::NewNumPointsPositions(int num, int columns, const Coord& new_march_position) const +std::vector Sheet::NewNumPointsPositions(int num, int columns, Coord new_march_position) const { std::vector newpts(mPoints.begin(), mPoints.begin() + std::min(mPoints.size(), num)); auto c = new_march_position; @@ -577,7 +575,7 @@ void Sheet::DeletePoints(SelectionList const& sl) } } -std::vector Sheet::RemapPoints(const std::vector& table) const +std::vector Sheet::RemapPoints(std::vector const& table) const { if (mPoints.size() != table.size()) { throw std::runtime_error("wrong size for Relabel"); @@ -589,7 +587,7 @@ std::vector Sheet::RemapPoints(const std::vector& table) const return newpts; } -const Continuity& Sheet::GetContinuityBySymbol(SYMBOL_TYPE i) const +Continuity const& Sheet::GetContinuityBySymbol(SYMBOL_TYPE i) const { return mAnimationContinuity.at(i); } @@ -614,7 +612,7 @@ bool Sheet::ContinuityInUse(SYMBOL_TYPE idx) const std::string Sheet::GetName() const { return mName; } -void Sheet::SetName(const std::string& newname) { mName = newname; } +void Sheet::SetName(std::string const& newname) { mName = newname; } std::string Sheet::GetNumber() const { @@ -637,7 +635,7 @@ Coord Sheet::GetPosition(unsigned i, unsigned ref) const } // Set position of point and all refs -void Sheet::SetAllPositions(const Coord& val, unsigned i) +void Sheet::SetAllPositions(Coord val, unsigned i) { for (unsigned j = 0; j <= Point::kNumRefPoints; j++) { mPoints[i].SetPos(val, j); @@ -645,7 +643,7 @@ void Sheet::SetAllPositions(const Coord& val, unsigned i) } // Set position of point -void Sheet::SetPosition(const Coord& val, unsigned i, unsigned ref) +void Sheet::SetPosition(Coord val, unsigned i, unsigned ref) { unsigned j; if (ref == 0) { @@ -679,8 +677,7 @@ void Sheet::SetPosition(const Coord& val, unsigned i, unsigned ref) * also, there are three tab stops set for standard continuity format */ -void Sheet::SetPrintableContinuity(const std::string& name, - const std::string& lines) +void Sheet::SetPrintableContinuity(std::string const & name, std::string const& lines) { mPrintableContinuity = Print_continuity(name, lines); } @@ -690,7 +687,7 @@ Textline_list Sheet::GetPrintableContinuity() const return mPrintableContinuity.GetChunks(); } -const Point& Sheet::GetPoint(unsigned i) const { return mPoints[i]; } +Point const& Sheet::GetPoint(unsigned i) const { return mPoints[i]; } Point& Sheet::GetPoint(unsigned i) { return mPoints[i]; } @@ -710,11 +707,11 @@ std::vector Sheet::GetSymbols() const return result; } -nlohmann::json Sheet::toOnlineViewerJSON(unsigned sheetNum, std::vector dotLabels, const AnimationSheet& compiledSheet) const +nlohmann::json Sheet::toOnlineViewerJSON(unsigned sheetNum, std::vector dotLabels, AnimationSheet const& compiledSheet) const { nlohmann::json j; // TODO; add printed continuities to viewer file manually for now - const auto boilerplate = std::vector{ + auto boilerplate = std::vector{ std::string("(MANUAL) first continuity instruction goes here for SS") + std::to_string(sheetNum), std::string("(MANUAL) second instruction"), std::string("(MANUAL) third instruction..."), @@ -754,7 +751,7 @@ nlohmann::json Sheet::toOnlineViewerJSON(unsigned sheetNum, std::vector& points) { mPoints = points; } +void Sheet::SetPoints(std::vector const& points) { mPoints = points; } // -=-=-=-=-=-=- Unit Tests -=-=-=-=-=-=-=- #include diff --git a/src/core/cc_sheet.h b/src/core/CalChartSheet.h similarity index 84% rename from src/core/cc_sheet.h rename to src/core/CalChartSheet.h index e766f28c..e8cb96b0 100644 --- a/src/core/cc_sheet.h +++ b/src/core/CalChartSheet.h @@ -1,6 +1,6 @@ #pragma once /* - * cc_sheet.h + * CalChartSheet.h * Definitions for the calchart sheet classes */ @@ -24,8 +24,8 @@ #include "CalChartAnimation.h" #include "cc_continuity.h" #include "cc_fileformat.h" -#include "cc_image.h" -#include "cc_point.h" +#include "CalChartImage.h" +#include "CalChartPoint.h" #include "cc_text.h" #include "CalChartTypes.h" @@ -36,8 +36,7 @@ // CalChart Sheet // The CalChart sheet object is a collection of CC_point locations, the number -// of -// beats and the different marcher's continuity. +// of beats and the different marcher's continuity. namespace CalChart { @@ -48,9 +47,9 @@ struct ParseErrorHandlers; class Sheet { public: Sheet(size_t numPoints); - Sheet(size_t numPoints, const std::string& newname); + Sheet(size_t numPoints, std::string const& newname); Sheet(size_t numPoints, std::istream& stream, ParseErrorHandlers const* correction = nullptr); - Sheet(size_t numPoints, const uint8_t* ptr, size_t size, ParseErrorHandlers const* correction = nullptr); + Sheet(size_t numPoints, uint8_t const* ptr, size_t size, ParseErrorHandlers const* correction = nullptr); ~Sheet(); private: @@ -69,7 +68,7 @@ class Sheet { void SetContinuity(SYMBOL_TYPE sym, Continuity const& new_cont); // print continuity - void SetPrintableContinuity(const std::string& name, const std::string& lines); + void SetPrintableContinuity(std::string const& name, std::string const& lines); Textline_list GetPrintableContinuity() const; std::string GetRawPrintContinuity() const; @@ -79,28 +78,28 @@ class Sheet { bool IsInAnimation() const { return (GetBeats() != 0); } // points - const Point& GetPoint(unsigned i) const; + Point const& GetPoint(unsigned i) const; Point& GetPoint(unsigned i); SYMBOL_TYPE GetSymbol(unsigned i) const; void SetSymbol(unsigned i, SYMBOL_TYPE sym); std::vector GetPoints() const; std::vector GetSymbols() const; - void SetPoints(const std::vector& points); + void SetPoints(std::vector const& points); int FindPoint(Coord where, Coord::units searchBound, unsigned ref = 0) const; - std::vector RemapPoints(const std::vector& table) const; + std::vector RemapPoints(std::vector const& table) const; Coord GetPosition(unsigned i, unsigned ref = 0) const; - void SetAllPositions(const Coord& val, unsigned i); - void SetPosition(const Coord& val, unsigned i, unsigned ref = 0); + void SetAllPositions(Coord val, unsigned i); + void SetPosition(Coord val, unsigned i, unsigned ref = 0); void SetAllPoints(std::vector const& newpts); SelectionList MakeSelectPointsBySymbol(SYMBOL_TYPE i) const; - std::vector NewNumPointsPositions(int num, int columns, const Coord& new_march_position) const; + std::vector NewNumPointsPositions(int num, int columns, Coord new_march_position) const; void DeletePoints(SelectionList const& sl); // titles std::string GetName() const; - void SetName(const std::string& newname); + void SetName(std::string const& newname); std::string GetNumber() const; - void SetNumber(const std::string& newnumber); + void SetNumber(std::string const& newnumber); // image std::vector const& GetBackgroundImages() const; @@ -119,7 +118,7 @@ class Sheet { * @return A JSON which could represent this sheet in * a '.viewer' file. */ - nlohmann::json toOnlineViewerJSON(unsigned sheetNum, std::vector dotLabels, const AnimationSheet& compiledSheet) const; + nlohmann::json toOnlineViewerJSON(unsigned sheetNum, std::vector dotLabels, AnimationSheet const& compiledSheet) const; private: std::vector mAnimationContinuity; diff --git a/src/core/cc_show.cpp b/src/core/CalChartShow.cpp similarity index 93% rename from src/core/cc_show.cpp rename to src/core/CalChartShow.cpp index ccc31247..9073a1a5 100644 --- a/src/core/cc_show.cpp +++ b/src/core/CalChartShow.cpp @@ -1,5 +1,5 @@ /* - * cc_show.cpp + * CalChartShow.cpp * Member functions for calchart show classes */ @@ -20,13 +20,13 @@ along with this program. If not, see . */ -#include "cc_show.h" +#include "CalChartShow.h" #include "cc_continuity.h" #include "cc_fileformat.h" -#include "cc_point.h" +#include "CalChartPoint.h" #include "CalChartShapes.h" -#include "cc_sheet.h" +#include "CalChartSheet.h" #include "ccvers.h" #include @@ -37,12 +37,12 @@ namespace CalChart { static constexpr auto kDefault = "default"; -static const std::string k_nofile_str = "Unable to open file"; -static const std::string k_badcont_str = "Error in continuity file"; -static const std::string k_contnohead_str = "Continuity file doesn't begin with header"; +static std::string const k_nofile_str = "Unable to open file"; +static std::string const k_badcont_str = "Error in continuity file"; +static std::string const k_contnohead_str = "Continuity file doesn't begin with header"; // you can create a show in two ways, from scratch, or from an input stream -std::unique_ptr Show::Create_CC_show(ShowMode const& mode) +std::unique_ptr Show::Create(ShowMode const& mode) { auto show = std::unique_ptr(new Show(mode)); show->InsertSheet(Sheet(show->GetNumPoints(), "1"), 0); @@ -50,14 +50,14 @@ std::unique_ptr Show::Create_CC_show(ShowMode const& mode) return show; } -std::unique_ptr Show::Create_CC_show(ShowMode const& mode, std::vector> const& labelsAndInstruments, unsigned columns) +std::unique_ptr Show::Create(ShowMode const& mode, std::vector> const& labelsAndInstruments, unsigned columns) { - auto show = Create_CC_show(mode); + auto show = Create(mode); show->SetNumPoints(labelsAndInstruments, columns, mode.FieldOffset()); return show; } -std::unique_ptr Show::Create_CC_show(ShowMode const& mode, std::istream& stream, ParseErrorHandlers const* correction) +std::unique_ptr Show::Create(ShowMode const& mode, std::istream& stream, ParseErrorHandlers const* correction) { ReadAndCheckID(stream, INGL_INGL); uint32_t version = ReadGurkSymbolAndGetVersion(stream, INGL_GURK); @@ -108,7 +108,7 @@ Show::Show(ShowMode const& mode, std::istream& stream, ParseErrorHandlers const* if (INGL_LABL == name) { std::vector data = FillData(stream); std::vector labels; - const char* str = (const char*)&data[0]; + auto str = (char const*)&data[0]; for (auto i = 0; i < GetNumPoints(); i++) { labels.push_back(str); str += strlen(str) + 1; @@ -126,7 +126,7 @@ Show::Show(ShowMode const& mode, std::istream& stream, ParseErrorHandlers const* // if (INGL_DESC == name) { std::vector data = FillData(stream); - auto str = (const char*)&data[0]; + auto str = (char const*)&data[0]; SetDescr(std::string(str, strlen(str))); // peek for the next name name = ReadLong(stream); @@ -153,27 +153,27 @@ Show::Show(ShowMode const& mode, std::istream& stream, ParseErrorHandlers const* } // -=-=-=-=-=- LEGACY CODE -=-=-=-=-=- -Show::Show(ShowMode const& mode, const uint8_t* ptr, size_t size, ParseErrorHandlers const* correction) +Show::Show(ShowMode const& mode, uint8_t const* ptr, size_t size, ParseErrorHandlers const* correction) : mMode(mode) { // caller should have stripped off INGL and GURK headers // construct the parser handlers // TODO: Why can't I capture this here? - auto parse_INGL_SIZE = [](Show* show, const uint8_t* ptr, size_t size) { + auto parse_INGL_SIZE = [](Show* show, uint8_t const* ptr, size_t size) { if (4 != size) { throw CC_FileException("Incorrect size", INGL_SIZE); } auto numpoints = get_big_long(ptr); show->mDotLabelAndInstrument.assign(numpoints, std::pair{ "", kDefault }); }; - auto parse_INGL_LABL = [](Show* show, const uint8_t* ptr, size_t size) { + auto parse_INGL_LABL = [](Show* show, uint8_t const* ptr, size_t size) { std::vector> labels; if (!size && show->GetNumPoints()) { throw CC_FileException("Label the wrong size", INGL_LABL); } // restrict search to the size we're given - auto str = (const char*)ptr; + auto str = (char const*)ptr; for (auto i = 0; i < show->GetNumPoints(); i++) { labels.push_back({ str, kDefault }); auto length = strlen(str) + 1; @@ -188,13 +188,13 @@ Show::Show(ShowMode const& mode, const uint8_t* ptr, size_t size, ParseErrorHand } show->SetPointLabelAndInstrument(labels); }; - auto parse_INGL_INST = [](Show* show, const uint8_t* ptr, size_t size) { + auto parse_INGL_INST = [](Show* show, uint8_t const* ptr, size_t size) { auto currentLabels = show->mDotLabelAndInstrument; if (!size && show->GetNumPoints()) { throw CC_FileException("Label the wrong size", INGL_LABL); } // restrict search to the size we're given - auto str = (const char*)ptr; + auto str = (char const*)ptr; for (auto i = 0; i < show->GetNumPoints(); i++) { auto thisInst = std::string{ str }; currentLabels.at(i).second = thisInst == "" ? kDefault : thisInst; @@ -210,20 +210,20 @@ Show::Show(ShowMode const& mode, const uint8_t* ptr, size_t size, ParseErrorHand } show->SetPointLabelAndInstrument(currentLabels); }; - auto parse_INGL_DESC = [](Show* show, const uint8_t* ptr, size_t size) { - auto str = (const char*)ptr; + auto parse_INGL_DESC = [](Show* show, uint8_t const* ptr, size_t size) { + auto str = (char const*)ptr; if (size != (strlen(str) + 1)) { throw CC_FileException("Description the wrong size", INGL_DESC); } show->SetDescr(std::string(str, strlen(str))); }; - auto parse_INGL_SHET = [correction](Show* show, const uint8_t* ptr, size_t size) { + auto parse_INGL_SHET = [correction](Show* show, uint8_t const* ptr, size_t size) { Sheet sheet(show->GetNumPoints(), ptr, size, correction); auto sheet_num = show->GetCurrentSheetNum(); show->InsertSheet(sheet, show->GetNumSheets()); show->SetCurrentSheet(sheet_num); }; - auto parse_INGL_SELE = [](Show* show, const uint8_t* ptr, size_t size) { + auto parse_INGL_SELE = [](Show* show, uint8_t const* ptr, size_t size) { if ((size % 4) != 0) { throw CC_FileException("Incorrect size", INGL_SIZE); } @@ -233,19 +233,18 @@ Show::Show(ShowMode const& mode, const uint8_t* ptr, size_t size, ParseErrorHand size -= 4; } }; - auto parse_INGL_CURR = [](Show* show, const uint8_t* ptr, size_t size) { + auto parse_INGL_CURR = [](Show* show, uint8_t const* ptr, size_t size) { if (4 != size) { throw CC_FileException("Incorrect size", INGL_SIZE); } show->mSheetNum = get_big_long(ptr); }; - auto parse_INGL_MODE = [](Show* show, const uint8_t* ptr, size_t size) { + auto parse_INGL_MODE = [](Show* show, uint8_t const* ptr, size_t size) { show->mMode = ShowMode::CreateShowMode({ ptr, ptr + size }); }; // [=] needed here to pull in the parse functions - auto parse_INGL_SHOW = [=](Show* show, const uint8_t* ptr, size_t size) { - const std::map> - parser = { + auto parse_INGL_SHOW = [=](Show* show, uint8_t const* ptr, size_t size) { + std::map> const parser = { { INGL_SIZE, parse_INGL_SIZE }, { INGL_LABL, parse_INGL_LABL }, { INGL_INST, parse_INGL_INST }, @@ -1085,11 +1084,11 @@ static auto Construct_show_zero_points_zero_labels_1_sheet_and_random() void Show::CC_show_round_trip_test() { - auto blank_show = Show::Create_CC_show(ShowMode::GetDefaultShowMode()); + auto blank_show = Show::Create(ShowMode::GetDefaultShowMode()); auto blank_show_data = blank_show->SerializeShow(); std::vector char_data{ blank_show_data.begin(), blank_show_data.end() }; std::istringstream is(std::string{ char_data.data(), char_data.size() }); - auto re_read_show = Show::Create_CC_show(ShowMode::GetDefaultShowMode(), is); + auto re_read_show = Show::Create(ShowMode::GetDefaultShowMode(), is); auto re_read_show_data = re_read_show->SerializeShow(); bool is_equal = blank_show_data.size() == re_read_show_data.size() && std::equal(blank_show_data.begin(), blank_show_data.end(), re_read_show_data.begin()); (void)is_equal; @@ -1137,7 +1136,7 @@ void Show::CC_show_round_trip_test_with_different_show_modes() // eat header show1_data.erase(show1_data.begin(), show1_data.begin() + 8); - Show show2(ShowMode::GetDefaultShowMode(), (const uint8_t*)show1_data.data(), show1_data.size()); + Show show2(ShowMode::GetDefaultShowMode(), (uint8_t const*)show1_data.data(), show1_data.size()); assert(show2.GetShowMode().HashW() == 36); } @@ -1145,7 +1144,7 @@ void Show::CC_show_blank_desc_test() { auto show_zero_points_zero_labels_zero_description = Construct_show_zero_points_zero_labels_zero_description(); Show show1(ShowMode::GetDefaultShowMode(), - (const uint8_t*)show_zero_points_zero_labels_zero_description.data(), + (uint8_t const*)show_zero_points_zero_labels_zero_description.data(), show_zero_points_zero_labels_zero_description.size()); auto show1_data = show1.SerializeShow(); // eat header @@ -1157,7 +1156,7 @@ void Show::CC_show_blank_desc_test() // now remove the description and they should be equal auto show_zero_points_zero_labels = Construct_show_zero_points_zero_labels(); - Show show2(ShowMode::GetDefaultShowMode(), (const uint8_t*)show_zero_points_zero_labels.data(), + Show show2(ShowMode::GetDefaultShowMode(), (uint8_t const*)show_zero_points_zero_labels.data(), show_zero_points_zero_labels.size()); auto show2_data = show2.SerializeShow(); show2_data.erase(show2_data.begin(), show2_data.begin() + 8); @@ -1173,14 +1172,14 @@ void Show::CC_show_future_show_test() // how? By creating a show from scratch, then modifying the version; make // sure that we load it, and it looks the same // except the data gets reverted - auto blank_show = Show::Create_CC_show(ShowMode::GetDefaultShowMode()); + auto blank_show = Show::Create(ShowMode::GetDefaultShowMode()); auto blank_show_data = blank_show->SerializeShow(); std::vector char_data{ blank_show_data.begin(), blank_show_data.end() }; assert(char_data.at(6) - '0' == CC_MAJOR_VERSION && char_data.at(7) - '0' == CC_MINOR_VERSION); ++char_data.at(6); ++char_data.at(7); std::istringstream is(std::string{ char_data.data(), char_data.size() }); - auto re_read_show = Show::Create_CC_show(ShowMode::GetDefaultShowMode(), is); + auto re_read_show = Show::Create(ShowMode::GetDefaultShowMode(), is); auto re_read_show_data = blank_show->SerializeShow(); --char_data.at(6); --char_data.at(7); @@ -1195,8 +1194,8 @@ void Show::CC_show_wrong_size_throws_exception() auto show_data = Construct_block(INGL_SHOW, points_3); bool hit_exception = false; try { - Show show1(ShowMode::GetDefaultShowMode(), (const uint8_t*)show_data.data(), show_data.size()); - } catch (const CC_FileException&) { + Show show1(ShowMode::GetDefaultShowMode(), (uint8_t const*)show_data.data(), show_data.size()); + } catch (CC_FileException const &) { hit_exception = true; } assert(hit_exception); @@ -1215,8 +1214,8 @@ void Show::CC_show_wrong_size_number_labels_throws() auto show_data = Construct_block(INGL_SHOW, t_show_data); bool hit_exception = false; try { - Show show1(ShowMode::GetDefaultShowMode(), (const uint8_t*)show_data.data(), show_data.size()); - } catch (const CC_FileException&) { + Show show1(ShowMode::GetDefaultShowMode(), (uint8_t const*)show_data.data(), show_data.size()); + } catch (CC_FileException const&) { hit_exception = true; } assert(hit_exception); @@ -1225,15 +1224,14 @@ void Show::CC_show_wrong_size_number_labels_throws() std::vector point_data(4); put_big_long(point_data.data(), 1); auto points(Construct_block(INGL_SIZE, point_data)); - auto labels( - Construct_block(INGL_LABL, std::vector{ 'a', '\0', 'b', '\0' })); + auto labels(Construct_block(INGL_LABL, std::vector{ 'a', '\0', 'b', '\0' })); auto t_show_data = points; t_show_data.insert(t_show_data.end(), labels.begin(), labels.end()); auto show_data = Construct_block(INGL_SHOW, t_show_data); bool hit_exception = false; try { - Show show1(ShowMode::GetDefaultShowMode(), (const uint8_t*)show_data.data(), show_data.size()); - } catch (const CC_FileException&) { + Show show1(ShowMode::GetDefaultShowMode(), (uint8_t const*)show_data.data(), show_data.size()); + } catch (CC_FileException const&) { hit_exception = true; } assert(hit_exception); @@ -1255,8 +1253,8 @@ void Show::CC_show_wrong_size_description() auto show_data = Construct_block(INGL_SHOW, t_show_data); bool hit_exception = false; try { - Show show1(ShowMode::GetDefaultShowMode(), (const uint8_t*)show_data.data(), show_data.size()); - } catch (const CC_FileException&) { + Show show1(ShowMode::GetDefaultShowMode(), (uint8_t const*)show_data.data(), show_data.size()); + } catch (CC_FileException const&) { hit_exception = true; } assert(hit_exception); @@ -1268,10 +1266,10 @@ void Show::CC_show_extra_cruft_ok() { // now remove the description and they should be equal auto extra_cruft = Construct_show_zero_points_zero_labels_1_sheet_and_random(); - Show show1(ShowMode::GetDefaultShowMode(), (const uint8_t*)extra_cruft.data(), extra_cruft.size()); + Show show1(ShowMode::GetDefaultShowMode(), (uint8_t const*)extra_cruft.data(), extra_cruft.size()); auto show1_data = show1.SerializeShow(); - auto blank_show = Show::Create_CC_show(ShowMode::GetDefaultShowMode()); + auto blank_show = Show::Create(ShowMode::GetDefaultShowMode()); auto blank_show_data = blank_show->SerializeShow(); auto is_equal = blank_show_data.size() == show1_data.size() && std::equal(blank_show_data.begin(), blank_show_data.end(), show1_data.begin()); (void)is_equal; @@ -1284,8 +1282,8 @@ void Show::CC_show_with_nothing_throws() std::vector empty{}; bool hit_exception = false; try { - Show show1(ShowMode::GetDefaultShowMode(), (const uint8_t*)empty.data(), empty.size()); - } catch (const CC_FileException&) { + Show show1(ShowMode::GetDefaultShowMode(), (uint8_t const*)empty.data(), empty.size()); + } catch (CC_FileException const&) { hit_exception = true; } assert(hit_exception); diff --git a/src/core/cc_show.h b/src/core/CalChartShow.h similarity index 89% rename from src/core/cc_show.h rename to src/core/CalChartShow.h index c63f39e8..9c0a27f7 100644 --- a/src/core/cc_show.h +++ b/src/core/CalChartShow.h @@ -1,6 +1,6 @@ #pragma once /* - * cc_show.h + * CalChartShow.h * Definitions for the calchart show classes */ @@ -28,7 +28,7 @@ #include "CalChartShapes.h" #include "CalChartAnimation.h" -#include "cc_sheet.h" +#include "CalChartSheet.h" #include "modes.h" #include @@ -48,7 +48,7 @@ using Show_command_pair = std::pair; // CalChart Show // The CalChart show object is what most parts of the system interact with -// It is essentially a collection of CC_sheets that you iterate through to +// It is essentially a collection of CalChartSheets that you iterate through to // either look at, or change. // A show can be loaded from a input stream @@ -59,9 +59,9 @@ class Show { using const_Sheet_iterator_t = Sheet_container_t::const_iterator; // you can create a show in two ways, from nothing, or from an input stream - static std::unique_ptr Create_CC_show(ShowMode const& mode); - static std::unique_ptr Create_CC_show(ShowMode const& mode, std::vector> const& labelsAndInstruments, unsigned columns); - static std::unique_ptr Create_CC_show(ShowMode const& mode, std::istream& stream, ParseErrorHandlers const* correction = nullptr); + static std::unique_ptr Create(ShowMode const& mode); + static std::unique_ptr Create(ShowMode const& mode, std::vector> const& labelsAndInstruments, unsigned columns); + static std::unique_ptr Create(ShowMode const& mode, std::istream& stream, ParseErrorHandlers const* correction = nullptr); private: Show(ShowMode const& mode); @@ -79,14 +79,14 @@ class Show { // Create command, consists of an action and undo action Show_command_pair Create_SetCurrentSheetCommand(int n) const; - Show_command_pair Create_SetSelectionListCommand(const SelectionList& sl) const; - Show_command_pair Create_SetCurrentSheetAndSelectionCommand(int n, const SelectionList& sl) const; + Show_command_pair Create_SetSelectionListCommand(SelectionList const& sl) const; + Show_command_pair Create_SetCurrentSheetAndSelectionCommand(int n, SelectionList const& sl) const; Show_command_pair Create_SetShowModeCommand(CalChart::ShowMode const& newmode) const; Show_command_pair Create_SetupMarchersCommand(std::vector> const& labelsAndInstruments, int numColumns, Coord const& new_march_position) const; Show_command_pair Create_SetInstrumentsCommand(std::map const& dotToInstrument) const; Show_command_pair Create_SetSheetTitleCommand(std::string const& newname) const; Show_command_pair Create_SetSheetBeatsCommand(int beats) const; - Show_command_pair Create_AddSheetsCommand(const Show::Sheet_container_t& sheets, int where) const; + Show_command_pair Create_AddSheetsCommand(Show::Sheet_container_t const& sheets, int where) const; Show_command_pair Create_RemoveSheetCommand(int where) const; Show_command_pair Create_ApplyRelabelMapping(int sheet_num_first, std::vector const& mapping) const; Show_command_pair Create_SetPrintableContinuity(std::map> const& data) const; @@ -96,7 +96,7 @@ class Show { Show_command_pair Create_RotatePointPositionsCommand(int rotateAmount, int ref) const; Show_command_pair Create_ResetReferencePointToRef0(int ref) const; Show_command_pair Create_SetSymbolCommand(SYMBOL_TYPE sym) const; - Show_command_pair Create_SetSymbolCommand(const SelectionList& whichDots, SYMBOL_TYPE sym) const; + Show_command_pair Create_SetSymbolCommand(SelectionList const& whichDots, SYMBOL_TYPE sym) const; Show_command_pair Create_SetContinuityCommand(SYMBOL_TYPE which_sym, Continuity const& cont) const; Show_command_pair Create_SetLabelFlipCommand(std::map const& new_flip) const; Show_command_pair Create_SetLabelRightCommand(bool right) const; @@ -127,7 +127,7 @@ class Show { bool WillMovePoints(std::map const& new_positions, int ref) const; - const ShowMode& GetShowMode() const; + ShowMode const& GetShowMode() const; // utility std::pair> GetRelabelMapping(const_Sheet_iterator_t source_sheet, const_Sheet_iterator_t target_sheets, CalChart::Coord::units tolerance) const; @@ -152,15 +152,15 @@ class Show { * @return A JSON which could represent this show in * a '.viewer' file. */ - nlohmann::json toOnlineViewerJSON(const Animation& compiledShow) const; + nlohmann::json toOnlineViewerJSON(Animation const& compiledShow) const; private: // modification of show is private, and externally done through create and exeucte commands Sheet_container_t RemoveNthSheet(int sheetidx); - void InsertSheet(const Sheet& nsheet, int sheetidx); - void InsertSheet(const Sheet_container_t& nsheet, int sheetidx); + void InsertSheet(Sheet const& nsheet, int sheetidx); + void InsertSheet(Sheet_container_t const& nsheet, int sheetidx); void SetCurrentSheet(int n); - void SetSelectionList(const SelectionList& sl); + void SetSelectionList(SelectionList const& sl); void SetNumPoints(std::vector> const& labelsAndInstruments, int columns, Coord const& new_march_position); void DeletePoints(SelectionList const& sl); diff --git a/src/core/cont.cpp b/src/core/cont.cpp index 54bd6f85..3c7b283b 100644 --- a/src/core/cont.cpp +++ b/src/core/cont.cpp @@ -24,7 +24,7 @@ #include "CalChartAnimationCommand.h" #include "CalChartAnimationCompile.h" #include "cc_fileformat.h" -#include "cc_sheet.h" +#include "CalChartSheet.h" #include "math_utils.h" #include "parse.h" diff --git a/src/core/e7_transition_solver.h b/src/core/e7_transition_solver.h index 7c4574ab..520ff570 100644 --- a/src/core/e7_transition_solver.h +++ b/src/core/e7_transition_solver.h @@ -11,7 +11,7 @@ #include #include "CalChartCoord.h" -#include "cc_sheet.h" +#include "CalChartSheet.h" namespace CalChart { diff --git a/src/core/print_ps.cpp b/src/core/print_ps.cpp index bc8f5396..fb2c94e7 100644 --- a/src/core/print_ps.cpp +++ b/src/core/print_ps.cpp @@ -21,8 +21,8 @@ */ #include "print_ps.h" -#include "cc_sheet.h" -#include "cc_show.h" +#include "CalChartSheet.h" +#include "CalChartShow.h" #include "modes.h" #include "prolog0.h" diff --git a/src/draw.cpp b/src/draw.cpp index 213ca742..504594e3 100644 --- a/src/draw.cpp +++ b/src/draw.cpp @@ -27,9 +27,9 @@ #include "CalChartAnimationCommand.h" #include "basic_ui.h" #include "cc_drawcommand.h" -#include "cc_point.h" -#include "cc_sheet.h" -#include "cc_show.h" +#include "CalChartPoint.h" +#include "CalChartSheet.h" +#include "CalChartShow.h" #include "cc_text.h" #include "confgr.h" #include "draw_utils.h" diff --git a/src/draw.h b/src/draw.h index d9dcd0c6..e9681d03 100644 --- a/src/draw.h +++ b/src/draw.h @@ -21,7 +21,7 @@ along with this program. If not, see . */ -#include "cc_show.h" +#include "CalChartShow.h" #include "confgr.h" #include #include