hivemind 1.0.0
Loading...
Searching...
No Matches
Gui::MainWindow Class Reference

Handles the main window of Hivemind. More...

#include <main_window.h>

Inheritance diagram for Gui::MainWindow:
Inheritance graph
Collaboration diagram for Gui::MainWindow:
Collaboration graph

Signals

void ScenarioCompiled (std::pair< CompileScenario::Scenario::RouteMap::iterator, CompileScenario::Scenario::RouteMap::iterator >)
 
void ScenarioLoaded ()
 
void AgentAdded (std::pair< std::vector< Core::Agent >::iterator, std::vector< Core::Agent >::iterator >)
 
void SyncAgentColor ()
 

Public Member Functions

 MainWindow (QWidget *parent=nullptr)
 Constructs the main window.
 
 ~MainWindow ()
 Descructs the main window.
 

Private Slots

void SaveScenario (const std::string &filepath)
 
void LoadScenario (const std::string &filepath)
 
void UpdateScenario (float, float, float)
 
void CompileScenario ()
 
void CreateNewAgent ()
 

Private Member Functions

void ConnectSlotsAndSignals ()
 

Private Attributes

MenuBarm_MenuBar
 The menu bar of the main window.
 
MainContentm_MainContent
 The main content of the main window.
 
std::shared_ptr< CompileScenario::Scenariom_Scenario
 
MapDialogm_ScenarioSettingsDialog
 

Detailed Description

Handles the main window of Hivemind.

This class is responsible for handling the main window of Hivemind, which contains the core functionality such as scenario editing, simulation and launching.

Definition at line 17 of file main_window.h.

Constructor & Destructor Documentation

◆ MainWindow()

Gui::MainWindow::MainWindow ( QWidget *  parent = nullptr)

Constructs the main window.

Parameters
parentThe parent widget of main window

Definition at line 18 of file main_window.cpp.

References ConnectSlotsAndSignals(), CreateNewAgent(), m_MainContent, and m_MenuBar.

Here is the call graph for this function:

◆ ~MainWindow()

Gui::MainWindow::~MainWindow ( )

Descructs the main window.

Definition at line 37 of file main_window.cpp.

Member Function Documentation

◆ AgentAdded

void Gui::MainWindow::AgentAdded ( std::pair< std::vector< Core::Agent >::iterator, std::vector< Core::Agent >::iterator >  )
signal

Referenced by ConnectSlotsAndSignals(), CreateNewAgent(), and LoadScenario().

Here is the caller graph for this function:

◆ CompileScenario

void Gui::MainWindow::CompileScenario ( )
privateslot

Definition at line 161 of file main_window.cpp.

References m_Scenario, and ScenarioCompiled().

Referenced by ConnectSlotsAndSignals().

Here is the caller graph for this function:

◆ ConnectSlotsAndSignals()

◆ CreateNewAgent

void Gui::MainWindow::CreateNewAgent ( )
privateslot

Definition at line 169 of file main_window.cpp.

References AgentAdded(), getRandomColor(), m_Scenario, and SyncAgentColor().

Referenced by ConnectSlotsAndSignals(), and MainWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadScenario

void Gui::MainWindow::LoadScenario ( const std::string &  filepath)
privateslot

Definition at line 145 of file main_window.cpp.

References AgentAdded(), m_Scenario, and ScenarioLoaded().

Referenced by ConnectSlotsAndSignals().

Here is the caller graph for this function:

◆ SaveScenario

void Gui::MainWindow::SaveScenario ( const std::string &  filepath)
privateslot

Definition at line 139 of file main_window.cpp.

References m_Scenario.

Referenced by ConnectSlotsAndSignals().

Here is the caller graph for this function:

◆ ScenarioCompiled

void Gui::MainWindow::ScenarioCompiled ( std::pair< CompileScenario::Scenario::RouteMap::iterator, CompileScenario::Scenario::RouteMap::iterator >  )
signal

Referenced by CompileScenario(), and ConnectSlotsAndSignals().

Here is the caller graph for this function:

◆ ScenarioLoaded

void Gui::MainWindow::ScenarioLoaded ( )
signal

Referenced by ConnectSlotsAndSignals(), and LoadScenario().

Here is the caller graph for this function:

◆ SyncAgentColor

void Gui::MainWindow::SyncAgentColor ( )
signal

Referenced by ConnectSlotsAndSignals(), and CreateNewAgent().

Here is the caller graph for this function:

◆ UpdateScenario

void Gui::MainWindow::UpdateScenario ( float  latitude,
float  longitude,
float  size 
)
privateslot

Definition at line 154 of file main_window.cpp.

References m_Scenario.

Referenced by ConnectSlotsAndSignals().

Here is the caller graph for this function:

Member Data Documentation

◆ m_MainContent

MainContent* Gui::MainWindow::m_MainContent
private

The main content of the main window.

Basically all content other than the menubar.

Definition at line 55 of file main_window.h.

Referenced by MainWindow().

◆ m_MenuBar

MenuBar* Gui::MainWindow::m_MenuBar
private

The menu bar of the main window.

Definition at line 51 of file main_window.h.

Referenced by ConnectSlotsAndSignals(), and MainWindow().

◆ m_Scenario

std::shared_ptr<CompileScenario::Scenario> Gui::MainWindow::m_Scenario
private

◆ m_ScenarioSettingsDialog

MapDialog* Gui::MainWindow::m_ScenarioSettingsDialog
private

Definition at line 58 of file main_window.h.

Referenced by ConnectSlotsAndSignals().


The documentation for this class was generated from the following files: