Skip to content
Snippets Groups Projects
Select Git revision
  • feature/234_Continuous_Delivery
  • stable default protected
  • MA_Pape_2018
  • MA_2018_Lopatin
  • feature/mesh_viewer
  • feature/#468_access_isosurface_scalar
  • feature/#459_default_primitives
  • master protected
  • feature/#470_Create_a_color_lookup_table
  • feature/#473_resize_companion_window
  • feature/#462_do_not_use_arb_extensions
  • feature/#495_Provide_data_for_larger_isosurfaces
  • feature/#323_default_image
  • feature/#480_Create_a_smaller_test_mesh_for_combustion_demo
  • feature/#236_Get_Integration_tests_running_on_CI
  • feature/#447_Copy_standard_assets_to_build_folder
  • 447-copy-standard-assets-to-build-folder-and-remove-resource-path
  • feature/#445_mesh_render_settings_component
  • feature/#251_Make_sure_tests_cpp_is_compiled_once
  • feature/#455_Remove_navigation_and_improve_interaction_for_combustion_demo
  • feature/446_strange_txt_files
  • v18.06.0
  • v18.05.0
  • #251_bad
  • #251_good
  • v18.03.0
  • v18.02.0
  • v18.01.0
  • v17.12.0
  • v17.11.0
  • v17.10.0
  • v17.09.0
  • v17.07.0
33 results

CMakeLists.txt

Blame
  • CenterGrid.hpp 4.59 KiB
    #pragma once
    
    #include <QGraphicsScene>
    #include <QGraphicsView>
    #include <QMessageBox>
    #include <QPixmap>
    #include <QTimer>
    #include <QVBoxLayout>
    #include <QWidget>
    
    #include "GridItem.hpp"
    
    namespace editor
    {
    
    /**
     * @brief Central widget of the Editor, contains editable grid representing a room
     */
    class CenterGrid : public QWidget
    {
        Q_OBJECT
      public:
        /**
         * @brief Creates a new CenterGrid
         * @param parent parent widget of CenterGrid
         */
        CenterGrid(QWidget *parent = nullptr);
    
        /**
         * @brief Setter function to update which sprite is currently selected and needs to be places when grid clicked
         * @param message TEMPORARY message that is shown when tile is clicked replace with sprite data
         */
        void setCurrentSprite(const QPixmap pixmap, const int id);
    
        /**
         * @brief Function for drawing the currently selected sprite on a tile when tile is clicked
         * @param row row of the clicked tile (y coordiante)
         * @param col column of the clicked tile (x coordinate)
         */
        void onTileClicked(int row, int col);
    
        /**
         * @brief draws room presets on the grid
         * @param index index of room preset that needs to be drawn
         */
        void drawPreset(int index);
    
        /**
         * @brief gets GridItem by row and column
         * @param row row (y coordinate) of the GridItem to return
         * @param col column (x coordinate) of the GridItem to return
         * @return GridItem* of the GridItem at row/col, or nullptr when out of bounds
         */
        GridItem *getTile(int row, int col) const;
    
        /**
         * @brief getter function for Vector of TileIDs
         * @return QVector<QVector<int>> of TileIDs
         */
        QVector<QVector<int>> getTileIDs();
    
        /**
         * @brief getter function for Vector of MobIDs
         * @return QVector<QVector<int>> of MobIDs
         */
        QVector<QVector<int>> getMobIDs();
    
        /**
         * @brief getter function for Vector of ObjectsIDs
         * @return QVector<QVector<int>> of ObjectIDs