Added sim folder and skeleton atmospheric, wind, and gravity models. Cleaned up main window a little
This commit is contained in:
parent
afb2ff85cf
commit
2d0980fdd6
@ -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})
|
||||
|
@ -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);
|
||||
windowSplitter->SetMinimumPaneSize(200);
|
||||
//wxSplitterWindow* topSplitter = new wxSplitterWindow(this);
|
||||
wxSplitterWindow* designSplitter = new wxSplitterWindow(mainSplitter,
|
||||
wxID_ANY,
|
||||
wxDefaultPosition,
|
||||
wxDefaultSize,
|
||||
wxSP_BORDER | wxSP_LIVE_UPDATE);
|
||||
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);
|
||||
|
14
src/sim/AtmosphericModel.cpp
Normal file
14
src/sim/AtmosphericModel.cpp
Normal file
@ -0,0 +1,14 @@
|
||||
#include "AtmosphericModel.h"
|
||||
|
||||
namespace sim
|
||||
{
|
||||
|
||||
AtmosphericModel::AtmosphericModel()
|
||||
{
|
||||
}
|
||||
|
||||
AtmosphericModel::~AtmosphericModel()
|
||||
{
|
||||
}
|
||||
|
||||
} // namespace sim
|
17
src/sim/AtmosphericModel.h
Normal file
17
src/sim/AtmosphericModel.h
Normal file
@ -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
|
5
src/sim/CMakeLists.txt
Normal file
5
src/sim/CMakeLists.txt
Normal file
@ -0,0 +1,5 @@
|
||||
add_library(sim
|
||||
AtmosphericModel.cpp
|
||||
GravityModel.cpp
|
||||
WindModel.cpp)
|
||||
|
14
src/sim/GravityModel.cpp
Normal file
14
src/sim/GravityModel.cpp
Normal file
@ -0,0 +1,14 @@
|
||||
#include "GravityModel.h"
|
||||
|
||||
namespace sim
|
||||
{
|
||||
|
||||
GravityModel::GravityModel()
|
||||
{
|
||||
}
|
||||
|
||||
GravityModel::~GravityModel()
|
||||
{
|
||||
}
|
||||
|
||||
} // namespace sim
|
19
src/sim/GravityModel.h
Normal file
19
src/sim/GravityModel.h
Normal file
@ -0,0 +1,19 @@
|
||||
#ifndef SIM_GRAVITYMODEL_H
|
||||
#define SIM_GRAVITYMODEL_H
|
||||
|
||||
#include <tuple>
|
||||
|
||||
namespace sim
|
||||
{
|
||||
|
||||
class GravityModel
|
||||
{
|
||||
public:
|
||||
GravityModel();
|
||||
virtual ~GravityModel();
|
||||
|
||||
virtual std::tuple<double, double, double> getAccel(double x, double y, double z) = 0;
|
||||
};
|
||||
|
||||
} // namespace sim
|
||||
#endif // SIM_GRAVITYMODEL_H
|
19
src/sim/WindModel.cpp
Normal file
19
src/sim/WindModel.cpp
Normal file
@ -0,0 +1,19 @@
|
||||
#include "WindModel.h"
|
||||
|
||||
namespace sim
|
||||
{
|
||||
|
||||
WindModel::WindModel()
|
||||
{
|
||||
}
|
||||
|
||||
WindModel::~WindModel()
|
||||
{
|
||||
}
|
||||
|
||||
std::tuple<double, double, double> WindModel::getWindSpeed(double x, double y, double z)
|
||||
{
|
||||
return std::make_tuple<double, double, double>(0.0, 0.0, 0.0);
|
||||
}
|
||||
|
||||
} // namespace sim
|
21
src/sim/WindModel.h
Normal file
21
src/sim/WindModel.h
Normal file
@ -0,0 +1,21 @@
|
||||
#ifndef SIM_WINDMODEL_H
|
||||
#define SIM_WINDMODEL_H
|
||||
|
||||
#include <tuple>
|
||||
|
||||
namespace sim
|
||||
{
|
||||
|
||||
class WindModel
|
||||
{
|
||||
public:
|
||||
WindModel();
|
||||
virtual ~WindModel();
|
||||
|
||||
virtual std::tuple<double, double, double> getWindSpeed(double x, double y, double z);
|
||||
|
||||
};
|
||||
|
||||
} // namespace sim
|
||||
|
||||
#endif // SIM_WINDMODEL_H
|
Loading…
x
Reference in New Issue
Block a user