diff --git a/CMakeLists.txt b/CMakeLists.txt index 9b4a285..d89694d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,6 +24,7 @@ endif() enable_testing() add_subdirectory(src/gui) +add_subdirectory(src/sim) #find_package(wxWidgets REQUIRED gl core base) #include(${wxWidgets_USE_FILE}) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 5c659e3..fe9616e 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -41,52 +41,40 @@ MainWindowFrame::MainWindowFrame() // Create the layout // Create the splitter window, then we can add panels to it - wxSplitterWindow* windowSplitter = new wxSplitterWindow(this, + wxSplitterWindow* mainSplitter = new wxSplitterWindow(this, + wxID_ANY, + wxDefaultPosition, + wxDefaultSize, + wxSP_BORDER | wxSP_LIVE_UPDATE); + wxSplitterWindow* designSplitter = new wxSplitterWindow(mainSplitter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_BORDER | wxSP_LIVE_UPDATE); - windowSplitter->SetMinimumPaneSize(200); - //wxSplitterWindow* topSplitter = new wxSplitterWindow(this); + designSplitter->SetMinimumPaneSize(200); // NOTE, we never call delete manually on the panel since setting the parent pointer (this) // will put the onus on the parent to manage the resource. It'll get deleted // when the parent gets deleted. In this case the MainWindowFrame - wxPanel* rocketTreePanel = new wxPanel(windowSplitter, + wxPanel* rocketTreePanel = new wxPanel(designSplitter, wxID_ANY, wxDefaultPosition, wxSize(200, 100)); rocketTreePanel->SetBackgroundColour(wxColor(100, 100, 200)); - wxPanel* rocketComponentPanel = new wxPanel(windowSplitter, + wxPanel* rocketComponentPanel = new wxPanel(designSplitter, wxID_ANY, wxDefaultPosition, wxSize(200, 100)); rocketComponentPanel->SetBackgroundColour(wxColor(200, 100, 100)); - windowSplitter->SplitVertically(rocketTreePanel, rocketComponentPanel); -/* - wxSizer* rocketDesignSizer = new wxBoxSizer(wxHORIZONTAL); - rocketDesignSizer->Add(rocketTreePanel, 1, wxEXPAND | wxRIGHT, 2); - rocketDesignSizer->Add(rocketComponentPanel, 1, wxEXPAND); -*/ + designSplitter->SplitVertically(rocketTreePanel, rocketComponentPanel); -/* - wxPanel* rocketVisPanel = new wxPanel(this, wxID_ANY); + wxPanel* rocketVisPanel = new wxPanel(mainSplitter, wxID_ANY); rocketVisPanel->SetBackgroundColour(wxColor(100, 200, 100)); -*/ - -// wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL); -// mainSizer->Add(rocketDesignSizer, 2, wxEXPAND | wxALL, 2); -// mainSizer->Add(rocketVisPanel, 1, wxEXPAND | wxLEFT | wxBOTTOM | wxRIGHT, 2); -// this->SetSizerAndFit(mainSizer); - /* - SetSizer(mainSizer); - wxTextCtrl* firstNameBox = new wxTextCtrl(this, wxID_ANY); - mainSizer->Add(firstNameBox, 1, wxEXPAND); - */ + mainSplitter->SplitHorizontally(designSplitter, rocketVisPanel); Bind(wxEVT_MENU, &MainWindowFrame::onAbout, this, wxID_ABOUT); Bind(wxEVT_MENU, &MainWindowFrame::onExit, this, wxID_EXIT); diff --git a/src/sim/AtmosphericModel.cpp b/src/sim/AtmosphericModel.cpp new file mode 100644 index 0000000..bc621ec --- /dev/null +++ b/src/sim/AtmosphericModel.cpp @@ -0,0 +1,14 @@ +#include "AtmosphericModel.h" + +namespace sim +{ + +AtmosphericModel::AtmosphericModel() +{ +} + +AtmosphericModel::~AtmosphericModel() +{ +} + +} // namespace sim \ No newline at end of file diff --git a/src/sim/AtmosphericModel.h b/src/sim/AtmosphericModel.h new file mode 100644 index 0000000..8d3a7a9 --- /dev/null +++ b/src/sim/AtmosphericModel.h @@ -0,0 +1,17 @@ +#ifndef SIM_ATMOSPHERICMODEL_H +#define SIM_ATMOSPHERICMODEL_H + +namespace sim +{ + +class AtmosphericModel +{ +public: + AtmosphericModel(); + virtual ~AtmosphericModel(); + + virtual double getDensity(double altitude) = 0; +}; + +} // namespace sim +#endif // SIM_ATMOSPHERICMODEL_H \ No newline at end of file diff --git a/src/sim/CMakeLists.txt b/src/sim/CMakeLists.txt new file mode 100644 index 0000000..cdb8487 --- /dev/null +++ b/src/sim/CMakeLists.txt @@ -0,0 +1,5 @@ +add_library(sim + AtmosphericModel.cpp + GravityModel.cpp + WindModel.cpp) + diff --git a/src/sim/GravityModel.cpp b/src/sim/GravityModel.cpp new file mode 100644 index 0000000..36d4207 --- /dev/null +++ b/src/sim/GravityModel.cpp @@ -0,0 +1,14 @@ +#include "GravityModel.h" + +namespace sim +{ + +GravityModel::GravityModel() +{ +} + +GravityModel::~GravityModel() +{ +} + +} // namespace sim \ No newline at end of file diff --git a/src/sim/GravityModel.h b/src/sim/GravityModel.h new file mode 100644 index 0000000..b81a729 --- /dev/null +++ b/src/sim/GravityModel.h @@ -0,0 +1,19 @@ +#ifndef SIM_GRAVITYMODEL_H +#define SIM_GRAVITYMODEL_H + +#include + +namespace sim +{ + +class GravityModel +{ +public: + GravityModel(); + virtual ~GravityModel(); + + virtual std::tuple getAccel(double x, double y, double z) = 0; +}; + +} // namespace sim +#endif // SIM_GRAVITYMODEL_H \ No newline at end of file diff --git a/src/sim/WindModel.cpp b/src/sim/WindModel.cpp new file mode 100644 index 0000000..6d0c065 --- /dev/null +++ b/src/sim/WindModel.cpp @@ -0,0 +1,19 @@ +#include "WindModel.h" + +namespace sim +{ + +WindModel::WindModel() +{ +} + +WindModel::~WindModel() +{ +} + +std::tuple WindModel::getWindSpeed(double x, double y, double z) +{ + return std::make_tuple(0.0, 0.0, 0.0); +} + +} // namespace sim \ No newline at end of file diff --git a/src/sim/WindModel.h b/src/sim/WindModel.h new file mode 100644 index 0000000..22c3462 --- /dev/null +++ b/src/sim/WindModel.h @@ -0,0 +1,21 @@ +#ifndef SIM_WINDMODEL_H +#define SIM_WINDMODEL_H + +#include + +namespace sim +{ + +class WindModel +{ +public: + WindModel(); + virtual ~WindModel(); + + virtual std::tuple getWindSpeed(double x, double y, double z); + +}; + +} // namespace sim + +#endif // SIM_WINDMODEL_H \ No newline at end of file