mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-21 13:39:18 +02:00
reformat: functions can be made static
This commit is contained in:
@@ -27,7 +27,7 @@ class TPoKeys55
|
|||||||
TPoKeys55();
|
TPoKeys55();
|
||||||
~TPoKeys55();
|
~TPoKeys55();
|
||||||
bool Connect();
|
bool Connect();
|
||||||
void Close();
|
static void Close();
|
||||||
bool Write(unsigned char c, unsigned char b3, unsigned char b4 = 0, unsigned char b5 = 0);
|
bool Write(unsigned char c, unsigned char b3, unsigned char b4 = 0, unsigned char b5 = 0);
|
||||||
bool Read();
|
bool Read();
|
||||||
bool ReadLoop(int i);
|
bool ReadLoop(int i);
|
||||||
|
|||||||
@@ -2569,9 +2569,9 @@ class TMoverParameters
|
|||||||
void LoadFIZ_DimmerList(std::string const &Input);
|
void LoadFIZ_DimmerList(std::string const &Input);
|
||||||
void LoadFIZ_CompressorList(std::string const &Input);
|
void LoadFIZ_CompressorList(std::string const &Input);
|
||||||
void LoadFIZ_PowerParamsDecode(TPowerParameters &Powerparameters, std::string Prefix, std::string const &Input);
|
void LoadFIZ_PowerParamsDecode(TPowerParameters &Powerparameters, std::string Prefix, std::string const &Input);
|
||||||
TPowerType LoadFIZ_PowerDecode(std::string const &Power);
|
static TPowerType LoadFIZ_PowerDecode(std::string const &Power);
|
||||||
TPowerSource LoadFIZ_SourceDecode(std::string const &Source);
|
static TPowerSource LoadFIZ_SourceDecode(std::string const &Source);
|
||||||
TEngineType LoadFIZ_EngineDecode(std::string const &Engine);
|
static TEngineType LoadFIZ_EngineDecode(std::string const &Engine);
|
||||||
bool readMPT0(std::string const &line);
|
bool readMPT0(std::string const &line);
|
||||||
bool readMPT(std::string const &line); // Q 20160717
|
bool readMPT(std::string const &line); // Q 20160717
|
||||||
bool readMPTElectricSeries(std::string const &line);
|
bool readMPTElectricSeries(std::string const &line);
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ class TNESt3 : public TBrake {
|
|||||||
{}
|
{}
|
||||||
void Init( double PP, double HPP, double LPP, double BP, int BDF ) /*override*/;
|
void Init( double PP, double HPP, double LPP, double BP, int BDF ) /*override*/;
|
||||||
virtual double GetPF( double PP, double dt, double Vel ) /*override*/; // przeplyw miedzy komora wstepna i PG
|
virtual double GetPF( double PP, double dt, double Vel ) /*override*/; // przeplyw miedzy komora wstepna i PG
|
||||||
void EStParams(double i_crc); // parametry charakterystyczne dla ESt
|
static void EStParams(double i_crc); // parametry charakterystyczne dla ESt
|
||||||
virtual double GetCRP() /*override*/;
|
virtual double GetCRP() /*override*/;
|
||||||
void CheckState(double BCP, double &dV1); // glowny przyrzad rozrzadczy
|
void CheckState(double BCP, double &dV1); // glowny przyrzad rozrzadczy
|
||||||
void CheckReleaser(double dt); // odluzniacz
|
void CheckReleaser(double dt); // odluzniacz
|
||||||
|
|||||||
@@ -582,7 +582,7 @@ class TESt : public TBrake
|
|||||||
double GetPF(double PP, double dt, double Vel) /*override*/; // przeplyw miedzy komora wstepna i PG
|
double GetPF(double PP, double dt, double Vel) /*override*/; // przeplyw miedzy komora wstepna i PG
|
||||||
/// <summary>Sets ESt-specific characteristic parameters (placeholder; used by some variants).</summary>
|
/// <summary>Sets ESt-specific characteristic parameters (placeholder; used by some variants).</summary>
|
||||||
/// <param name="i_crc">Characteristic value.</param>
|
/// <param name="i_crc">Characteristic value.</param>
|
||||||
void EStParams(double i_crc); // parametry charakterystyczne dla ESt
|
static void EStParams(double i_crc); // parametry charakterystyczne dla ESt
|
||||||
/// <summary>Returns the control reservoir (ZS) pressure.</summary>
|
/// <summary>Returns the control reservoir (ZS) pressure.</summary>
|
||||||
double GetCRP() /*override*/;
|
double GetCRP() /*override*/;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -877,7 +877,7 @@ class TCV1 : public TBrake
|
|||||||
/// <param name="dV1">In/out brake pipe flow correction.</param>
|
/// <param name="dV1">In/out brake pipe flow correction.</param>
|
||||||
void CheckState(double BCP, double &dV1);
|
void CheckState(double BCP, double &dV1);
|
||||||
/// <summary>Returns the ZS-filling slide valve opening factor for the given cylinder pressure.</summary>
|
/// <summary>Returns the ZS-filling slide valve opening factor for the given cylinder pressure.</summary>
|
||||||
double CVs(double BP);
|
static double CVs(double BP);
|
||||||
/// <summary>Returns the ZP-filling slide valve opening factor for the given cylinder pressure.</summary>
|
/// <summary>Returns the ZP-filling slide valve opening factor for the given cylinder pressure.</summary>
|
||||||
double BVs(double BCP);
|
double BVs(double BCP);
|
||||||
/// <summary>Vents valve, brake and control reservoirs to zero.</summary>
|
/// <summary>Vents valve, brake and control reservoirs to zero.</summary>
|
||||||
@@ -1143,9 +1143,9 @@ class TFV4aM : public TDriverHandle
|
|||||||
/// Returns the brake pipe pressure target interpolated from BPT[] for the given handle position.
|
/// Returns the brake pipe pressure target interpolated from BPT[] for the given handle position.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="pos">Handle position.</param>
|
/// <param name="pos">Handle position.</param>
|
||||||
double LPP_RP(double pos);
|
static double LPP_RP(double pos);
|
||||||
/// <summary>Returns true if pos is within ±0.5 of i_pos (detent comparison).</summary>
|
/// <summary>Returns true if pos is within ±0.5 of i_pos (detent comparison).</summary>
|
||||||
bool EQ(double pos, double i_pos);
|
static bool EQ(double pos, double i_pos);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// <summary>Computes brake pipe flow for the FV4a/M handle (interpolated BPT, wave modelling, accelerator).</summary>
|
/// <summary>Computes brake pipe flow for the FV4a/M handle (interpolated BPT, wave modelling, accelerator).</summary>
|
||||||
@@ -1193,9 +1193,9 @@ class TMHZ_EN57 : public TDriverHandle
|
|||||||
static double const pos_table[11]; //= { -2, 10, -1, 0, 0, 2, 9, 10, 0, 0, 0 };
|
static double const pos_table[11]; //= { -2, 10, -1, 0, 0, 2, 9, 10, 0, 0, 0 };
|
||||||
|
|
||||||
/// <summary>Returns the brake pipe pressure target for the given handle position (piecewise).</summary>
|
/// <summary>Returns the brake pipe pressure target for the given handle position (piecewise).</summary>
|
||||||
double LPP_RP(double pos);
|
static double LPP_RP(double pos);
|
||||||
/// <summary>Returns true if pos is within ±0.5 of i_pos.</summary>
|
/// <summary>Returns true if pos is within ±0.5 of i_pos.</summary>
|
||||||
bool EQ(double pos, double i_pos);
|
static bool EQ(double pos, double i_pos);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// <summary>Computes brake pipe flow for MHZ_EN57 (covers handle positions -1..10 with EP/pneumatic mix).</summary>
|
/// <summary>Computes brake pipe flow for MHZ_EN57 (covers handle positions -1..10 with EP/pneumatic mix).</summary>
|
||||||
@@ -1249,7 +1249,7 @@ class TMHZ_K5P : public TDriverHandle
|
|||||||
static double const pos_table[11]; //= { -2, 10, -1, 0, 0, 2, 9, 10, 0, 0, 0 };
|
static double const pos_table[11]; //= { -2, 10, -1, 0, 0, 2, 9, 10, 0, 0, 0 };
|
||||||
|
|
||||||
/// <summary>Returns true if pos is within ±0.5 of i_pos.</summary>
|
/// <summary>Returns true if pos is within ±0.5 of i_pos.</summary>
|
||||||
bool EQ(double pos, double i_pos);
|
static bool EQ(double pos, double i_pos);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// <summary>Computes brake pipe flow for the K5P 5-position handle (release / cut-off / brake / emergency).</summary>
|
/// <summary>Computes brake pipe flow for the K5P 5-position handle (release / cut-off / brake / emergency).</summary>
|
||||||
@@ -1302,7 +1302,7 @@ class TMHZ_6P : public TDriverHandle
|
|||||||
static double const pos_table[11]; //= { -2, 10, -1, 0, 0, 2, 9, 10, 0, 0, 0 };
|
static double const pos_table[11]; //= { -2, 10, -1, 0, 0, 2, 9, 10, 0, 0, 0 };
|
||||||
|
|
||||||
/// <summary>Returns true if pos is within ±0.5 of i_pos.</summary>
|
/// <summary>Returns true if pos is within ±0.5 of i_pos.</summary>
|
||||||
bool EQ(double pos, double i_pos);
|
static bool EQ(double pos, double i_pos);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// <summary>Computes brake pipe flow for the 6P handle.</summary>
|
/// <summary>Computes brake pipe flow for the 6P handle.</summary>
|
||||||
|
|||||||
@@ -960,7 +960,7 @@ GLFWmonitor *eu07_application::find_monitor(const std::string &str) const
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string eu07_application::describe_monitor(GLFWmonitor *monitor) const
|
std::string eu07_application::describe_monitor(GLFWmonitor *monitor)
|
||||||
{
|
{
|
||||||
std::string name(glfwGetMonitorName(monitor));
|
std::string name(glfwGetMonitorName(monitor));
|
||||||
std::replace(std::begin(name), std::end(name), ' ', '_');
|
std::replace(std::begin(name), std::end(name), ' ', '_');
|
||||||
@@ -973,7 +973,7 @@ std::string eu07_application::describe_monitor(GLFWmonitor *monitor) const
|
|||||||
|
|
||||||
// private:
|
// private:
|
||||||
|
|
||||||
bool eu07_application::needs_ogl() const
|
bool eu07_application::needs_ogl()
|
||||||
{
|
{
|
||||||
return !Global.NvRenderer;
|
return !Global.NvRenderer;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,14 +66,14 @@ public:
|
|||||||
set_progress( float Progress = 0.f, float Subtaskprogress = 0.f );
|
set_progress( float Progress = 0.f, float Subtaskprogress = 0.f );
|
||||||
void
|
void
|
||||||
set_tooltip( std::string const &Tooltip );
|
set_tooltip( std::string const &Tooltip );
|
||||||
void
|
static void
|
||||||
set_cursor( int Mode );
|
set_cursor( int Mode );
|
||||||
void
|
void
|
||||||
set_cursor_pos( double Horizontal, double Vertical );
|
set_cursor_pos( double Horizontal, double Vertical );
|
||||||
void queue_screenshot();
|
void queue_screenshot();
|
||||||
// input handlers
|
// input handlers
|
||||||
void on_key( int Key, int Scancode, int Action, int Mods );
|
void on_key( int Key, int Scancode, int Action, int Mods );
|
||||||
void on_char( unsigned int Char );
|
static void on_char( unsigned int Char );
|
||||||
void on_cursor_pos( double Horizontal, double Vertical );
|
void on_cursor_pos( double Horizontal, double Vertical );
|
||||||
void on_mouse_button( int Button, int Action, int Mods );
|
void on_mouse_button( int Button, int Action, int Mods );
|
||||||
void on_scroll( double Xoffset, double Yoffset );
|
void on_scroll( double Xoffset, double Yoffset );
|
||||||
@@ -83,9 +83,9 @@ public:
|
|||||||
GLFWwindow *
|
GLFWwindow *
|
||||||
window( int Windowindex = 0, bool visible = false, int width = 1, int height = 1, GLFWmonitor *monitor = nullptr, bool keep_ownership = true, bool share_ctx = true );
|
window( int Windowindex = 0, bool visible = false, int width = 1, int height = 1, GLFWmonitor *monitor = nullptr, bool keep_ownership = true, bool share_ctx = true );
|
||||||
GLFWmonitor * find_monitor( const std::string &str ) const;
|
GLFWmonitor * find_monitor( const std::string &str ) const;
|
||||||
std::string describe_monitor( GLFWmonitor *monitor ) const;
|
static std::string describe_monitor( GLFWmonitor *monitor );
|
||||||
// generate network sync verification number
|
// generate network sync verification number
|
||||||
double
|
static double
|
||||||
generate_sync();
|
generate_sync();
|
||||||
void
|
void
|
||||||
queue_quit(bool direct);
|
queue_quit(bool direct);
|
||||||
@@ -99,19 +99,19 @@ private:
|
|||||||
using modeptr_array = std::array<std::shared_ptr<application_mode>, static_cast<std::size_t>( count_ )>;
|
using modeptr_array = std::array<std::shared_ptr<application_mode>, static_cast<std::size_t>( count_ )>;
|
||||||
using mode_stack = std::stack<mode>;
|
using mode_stack = std::stack<mode>;
|
||||||
// methods
|
// methods
|
||||||
bool needs_ogl() const;
|
static bool needs_ogl();
|
||||||
void init_debug();
|
void init_debug();
|
||||||
void init_console();
|
static void init_console();
|
||||||
void init_files();
|
void init_files();
|
||||||
int init_settings( int Argc, char *Argv[] );
|
static int init_settings( int Argc, char *Argv[] );
|
||||||
int init_locale();
|
static int init_locale();
|
||||||
int init_glfw();
|
int init_glfw();
|
||||||
void init_callbacks();
|
void init_callbacks();
|
||||||
int init_ogl();
|
static int init_ogl();
|
||||||
int init_ui();
|
int init_ui();
|
||||||
int init_gfx();
|
int init_gfx();
|
||||||
int init_audio();
|
static int init_audio();
|
||||||
int init_data();
|
static int init_data();
|
||||||
int init_modes();
|
int init_modes();
|
||||||
bool init_network();
|
bool init_network();
|
||||||
int run_crashgui();
|
int run_crashgui();
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ std::unordered_map<user_command, std::pair<user_command, user_command>> commandf
|
|||||||
{user_command::batterydisable, {user_command::batterytoggle, user_command::none}},
|
{user_command::batterydisable, {user_command::batterytoggle, user_command::none}},
|
||||||
};
|
};
|
||||||
|
|
||||||
std::pair<user_command, user_command> driver_mode::drivermode_input::command_fallback(user_command const Command) const
|
std::pair<user_command, user_command> driver_mode::drivermode_input::command_fallback(user_command const Command)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (Command == user_command::none)
|
if (Command == user_command::none)
|
||||||
|
|||||||
@@ -85,8 +85,8 @@ private:
|
|||||||
void poll();
|
void poll();
|
||||||
std::string
|
std::string
|
||||||
binding_hints( std::pair<user_command, user_command> const &Commands ) const;
|
binding_hints( std::pair<user_command, user_command> const &Commands ) const;
|
||||||
std::pair<user_command, user_command>
|
static std::pair<user_command, user_command>
|
||||||
command_fallback( user_command Command ) const;
|
command_fallback( user_command Command );
|
||||||
};
|
};
|
||||||
|
|
||||||
// methods
|
// methods
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ protected:
|
|||||||
private:
|
private:
|
||||||
// methods
|
// methods
|
||||||
// sets visibility of the cursor
|
// sets visibility of the cursor
|
||||||
void
|
static void
|
||||||
set_cursor( bool Visible );
|
set_cursor( bool Visible );
|
||||||
// render() subclass details
|
// render() subclass details
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -84,23 +84,23 @@ private:
|
|||||||
void update_section_engine( std::vector<text_line> &Output );
|
void update_section_engine( std::vector<text_line> &Output );
|
||||||
void update_section_ai( std::vector<text_line> &Output );
|
void update_section_ai( std::vector<text_line> &Output );
|
||||||
void update_section_scantable( std::vector<text_line> &Output );
|
void update_section_scantable( std::vector<text_line> &Output );
|
||||||
void update_section_scenario( std::vector<text_line> &Output );
|
static void update_section_scenario( std::vector<text_line> &Output );
|
||||||
void update_section_eventqueue( std::vector<text_line> &Output );
|
void update_section_eventqueue( std::vector<text_line> &Output );
|
||||||
void update_section_powergrid( std::vector<text_line> &Output );
|
static void update_section_powergrid( std::vector<text_line> &Output );
|
||||||
void update_section_camera( std::vector<text_line> &Output );
|
void update_section_camera( std::vector<text_line> &Output );
|
||||||
void update_section_renderer( std::vector<text_line> &Output );
|
static void update_section_renderer( std::vector<text_line> &Output );
|
||||||
#ifdef WITH_UART
|
#ifdef WITH_UART
|
||||||
void update_section_uart( std::vector<text_line> &Output );
|
static void update_section_uart( std::vector<text_line> &Output );
|
||||||
#endif
|
#endif
|
||||||
// section update helpers
|
// section update helpers
|
||||||
std::string update_vehicle_coupler( int Side );
|
std::string update_vehicle_coupler( int Side );
|
||||||
std::string update_vehicle_brake() const;
|
std::string update_vehicle_brake() const;
|
||||||
// renders provided lines, under specified collapsing header
|
// renders provided lines, under specified collapsing header
|
||||||
bool render_section( std::string const &Header, std::vector<text_line> const &Lines );
|
bool render_section( std::string const &Header, std::vector<text_line> const &Lines );
|
||||||
bool render_section( std::vector<text_line> const &Lines );
|
static bool render_section( std::vector<text_line> const &Lines );
|
||||||
bool render_section_scenario();
|
bool render_section_scenario();
|
||||||
bool render_section_eventqueue();
|
bool render_section_eventqueue();
|
||||||
bool render_section_settings();
|
static bool render_section_settings();
|
||||||
bool render_section_developer();
|
bool render_section_developer();
|
||||||
// members
|
// members
|
||||||
std::array<char, 1024> m_buffer;
|
std::array<char, 1024> m_buffer;
|
||||||
|
|||||||
@@ -186,9 +186,9 @@ class editor_mode : public application_mode
|
|||||||
bool m_stream_persist{true}; // save edited chunks to disk and load them back
|
bool m_stream_persist{true}; // save edited chunks to disk and load them back
|
||||||
|
|
||||||
// hierarchy management
|
// hierarchy management
|
||||||
void add_to_hierarchy(scene::basic_node *node);
|
static void add_to_hierarchy(scene::basic_node *node);
|
||||||
void remove_from_hierarchy(scene::basic_node *node);
|
static void remove_from_hierarchy(scene::basic_node *node);
|
||||||
scene::basic_node* find_in_hierarchy(const std::string &uuid_str);
|
static scene::basic_node* find_in_hierarchy(const std::string &uuid_str);
|
||||||
scene::basic_node* find_node_by_any(scene::basic_node *node_ptr, const std::string &uuid_str, const std::string &name);
|
scene::basic_node* find_node_by_any(scene::basic_node *node_ptr, const std::string &uuid_str, const std::string &name);
|
||||||
|
|
||||||
// clear history/redo pointers that reference the given node (prevent dangling pointers)
|
// clear history/redo pointers that reference the given node (prevent dangling pointers)
|
||||||
|
|||||||
@@ -599,7 +599,7 @@ const std::string *nodebank_panel::get_active_template()
|
|||||||
return m_selectedtemplate.get();
|
return m_selectedtemplate.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string nodebank_panel::generate_node_label(std::string Input) const
|
std::string nodebank_panel::generate_node_label(std::string Input)
|
||||||
{
|
{
|
||||||
|
|
||||||
auto tokenizer{cParser(Input)};
|
auto tokenizer{cParser(Input)};
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ class nodebank_panel : public ui_panel
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
// methods:
|
// methods:
|
||||||
std::string generate_node_label(std::string Input) const;
|
static std::string generate_node_label(std::string Input);
|
||||||
// members:
|
// members:
|
||||||
std::vector<std::pair<std::string, std::shared_ptr<std::string>>> m_nodebank;
|
std::vector<std::pair<std::string, std::shared_ptr<std::string>>> m_nodebank;
|
||||||
char m_nodesearch[128];
|
char m_nodesearch[128];
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ public:
|
|||||||
static void render_internal();
|
static void render_internal();
|
||||||
// begins new UI frame
|
// begins new UI frame
|
||||||
// (this is separate from render() to allow for debug GUI outside of proper UI framework)
|
// (this is separate from render() to allow for debug GUI outside of proper UI framework)
|
||||||
void begin_ui_frame();
|
static void begin_ui_frame();
|
||||||
static void begin_ui_frame_internal();
|
static void begin_ui_frame_internal();
|
||||||
//
|
//
|
||||||
static void set_cursor( int Mode );
|
static void set_cursor( int Mode );
|
||||||
|
|||||||
@@ -182,7 +182,8 @@ buffer_manager::find_buffer( std::string const &Buffername ) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
buffer_manager::find_file( std::string const &Filename ) const {
|
buffer_manager::find_file( std::string const &Filename )
|
||||||
|
{
|
||||||
|
|
||||||
auto const lookup {
|
auto const lookup {
|
||||||
FileExists(
|
FileExists(
|
||||||
|
|||||||
@@ -69,8 +69,8 @@ private:
|
|||||||
buffer_handle
|
buffer_handle
|
||||||
find_buffer( std::string const &Buffername ) const;
|
find_buffer( std::string const &Buffername ) const;
|
||||||
// checks whether specified file exists. returns: name of the located file, or empty string.
|
// checks whether specified file exists. returns: name of the located file, or empty string.
|
||||||
std::string
|
static std::string
|
||||||
find_file( std::string const &Filename ) const;
|
find_file( std::string const &Filename );
|
||||||
// members
|
// members
|
||||||
buffer_sequence m_buffers;
|
buffer_sequence m_buffers;
|
||||||
index_map m_buffermappings;
|
index_map m_buffermappings;
|
||||||
|
|||||||
@@ -306,7 +306,8 @@ cMoon::phase() {
|
|||||||
|
|
||||||
// normalize values to range 0...1
|
// normalize values to range 0...1
|
||||||
float
|
float
|
||||||
cMoon::normalize( const float Value ) const {
|
cMoon::normalize( const float Value )
|
||||||
|
{
|
||||||
|
|
||||||
float value = Value - floor( Value );
|
float value = Value - floor( Value );
|
||||||
if( value < 0.f ) { ++value; }
|
if( value < 0.f ) { ++value; }
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ public:
|
|||||||
// methods:
|
// methods:
|
||||||
void init();
|
void init();
|
||||||
void update( bool Includephase = false );
|
void update( bool Includephase = false );
|
||||||
void render();
|
static void render();
|
||||||
// returns vector pointing at the sun
|
// returns vector pointing at the sun
|
||||||
glm::vec3 getDirection() const;
|
glm::vec3 getDirection() const;
|
||||||
// returns current elevation above horizon
|
// returns current elevation above horizon
|
||||||
@@ -50,7 +50,7 @@ protected:
|
|||||||
void irradiance();
|
void irradiance();
|
||||||
void phase();
|
void phase();
|
||||||
// helper, normalize values to range 0...1
|
// helper, normalize values to range 0...1
|
||||||
float normalize(float Value ) const;
|
static float normalize(float Value );
|
||||||
|
|
||||||
// members:
|
// members:
|
||||||
|
|
||||||
|
|||||||
@@ -59,9 +59,9 @@ private:
|
|||||||
static float m_zenithymatrix[ 3 ][ 4 ];
|
static float m_zenithymatrix[ 3 ][ 4 ];
|
||||||
|
|
||||||
// coloring
|
// coloring
|
||||||
void GetPerez( float *Perez, float Distribution[ 5 ][ 2 ], float Turbidity );
|
static void GetPerez( float *Perez, float Distribution[ 5 ][ 2 ], float Turbidity );
|
||||||
float GetZenith( float Zenithmatrix[ 3 ][ 4 ], float Theta, float Turbidity );
|
static float GetZenith( float Zenithmatrix[ 3 ][ 4 ], float Theta, float Turbidity );
|
||||||
float PerezFunctionO1( float Perezcoeffs[ 5 ], float Thetasun, float Zenithval );
|
static float PerezFunctionO1( float Perezcoeffs[ 5 ], float Thetasun, float Zenithval );
|
||||||
float PerezFunctionO2( float Perezcoeffs[ 5 ], float Icostheta, float Gamma, float Cosgamma2, float Zenithval );
|
static float PerezFunctionO2( float Perezcoeffs[ 5 ], float Icostheta, float Gamma, float Cosgamma2, float Zenithval );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ public:
|
|||||||
// methods:
|
// methods:
|
||||||
void init();
|
void init();
|
||||||
void update();
|
void update();
|
||||||
void render();
|
static void render();
|
||||||
/*
|
/*
|
||||||
// returns location of the sun in the 3d scene
|
// returns location of the sun in the 3d scene
|
||||||
glm::vec3 getPosition();
|
glm::vec3 getPosition();
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ private:
|
|||||||
thread_local static query* active_queries[6];
|
thread_local static query* active_queries[6];
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
GLenum glenum_target(targets target);
|
static GLenum glenum_target(targets target);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
query(targets target);
|
query(targets target);
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ namespace gl
|
|||||||
void parse_texture_entries(std::string &str);
|
void parse_texture_entries(std::string &str);
|
||||||
void parse_param_entries(std::string &str);
|
void parse_param_entries(std::string &str);
|
||||||
|
|
||||||
std::string read_file(const std::string &filename);
|
static std::string read_file(const std::string &filename);
|
||||||
|
|
||||||
static std::unordered_map<std::string, components_e> components_mapping;
|
static std::unordered_map<std::string, components_e> components_mapping;
|
||||||
static std::unordered_map<std::string, defaultparam_e> defaultparams_mapping;
|
static std::unordered_map<std::string, defaultparam_e> defaultparams_mapping;
|
||||||
|
|||||||
@@ -2148,14 +2148,14 @@ struct ImFontAtlas
|
|||||||
// Helpers to retrieve list of common Unicode ranges (2 value per range, values are inclusive, zero-terminated list)
|
// Helpers to retrieve list of common Unicode ranges (2 value per range, values are inclusive, zero-terminated list)
|
||||||
// NB: Make sure that your string are UTF-8 and NOT in your local code page. In C++11, you can create UTF-8 string literal using the u8"Hello world" syntax. See FAQ for details.
|
// NB: Make sure that your string are UTF-8 and NOT in your local code page. In C++11, you can create UTF-8 string literal using the u8"Hello world" syntax. See FAQ for details.
|
||||||
// NB: Consider using ImFontGlyphRangesBuilder to build glyph ranges from textual data.
|
// NB: Consider using ImFontGlyphRangesBuilder to build glyph ranges from textual data.
|
||||||
IMGUI_API const ImWchar* GetGlyphRangesDefault(); // Basic Latin, Extended Latin
|
IMGUI_API static const ImWchar* GetGlyphRangesDefault(); // Basic Latin, Extended Latin
|
||||||
IMGUI_API const ImWchar* GetGlyphRangesKorean(); // Default + Korean characters
|
IMGUI_API static const ImWchar* GetGlyphRangesKorean(); // Default + Korean characters
|
||||||
IMGUI_API const ImWchar* GetGlyphRangesJapanese(); // Default + Hiragana, Katakana, Half-Width, Selection of 1946 Ideographs
|
IMGUI_API static const ImWchar* GetGlyphRangesJapanese(); // Default + Hiragana, Katakana, Half-Width, Selection of 1946 Ideographs
|
||||||
IMGUI_API const ImWchar* GetGlyphRangesChineseFull(); // Default + Half-Width + Japanese Hiragana/Katakana + full set of about 21000 CJK Unified Ideographs
|
IMGUI_API static const ImWchar* GetGlyphRangesChineseFull(); // Default + Half-Width + Japanese Hiragana/Katakana + full set of about 21000 CJK Unified Ideographs
|
||||||
IMGUI_API const ImWchar* GetGlyphRangesChineseSimplifiedCommon();// Default + Half-Width + Japanese Hiragana/Katakana + set of 2500 CJK Unified Ideographs for common simplified Chinese
|
IMGUI_API static const ImWchar* GetGlyphRangesChineseSimplifiedCommon();// Default + Half-Width + Japanese Hiragana/Katakana + set of 2500 CJK Unified Ideographs for common simplified Chinese
|
||||||
IMGUI_API const ImWchar* GetGlyphRangesCyrillic(); // Default + about 400 Cyrillic characters
|
IMGUI_API static const ImWchar* GetGlyphRangesCyrillic(); // Default + about 400 Cyrillic characters
|
||||||
IMGUI_API const ImWchar* GetGlyphRangesThai(); // Default + Thai characters
|
IMGUI_API static const ImWchar* GetGlyphRangesThai(); // Default + Thai characters
|
||||||
IMGUI_API const ImWchar* GetGlyphRangesVietnamese(); // Default + Vietnamese characters
|
IMGUI_API static const ImWchar* GetGlyphRangesVietnamese(); // Default + Vietnamese characters
|
||||||
|
|
||||||
//-------------------------------------------
|
//-------------------------------------------
|
||||||
// [BETA] Custom Rectangles/Glyphs API
|
// [BETA] Custom Rectangles/Glyphs API
|
||||||
|
|||||||
@@ -877,7 +877,8 @@ void command_queue::push_commands(const commands_map &commands) {
|
|||||||
|
|
||||||
void
|
void
|
||||||
command_relay::post(user_command const Command, double const Param1, double const Param2,
|
command_relay::post(user_command const Command, double const Param1, double const Param2,
|
||||||
int const Action, uint16_t Recipient, glm::vec3 Position, const std::string *Payload) const {
|
int const Action, uint16_t Recipient, glm::vec3 Position, const std::string *Payload)
|
||||||
|
{
|
||||||
|
|
||||||
auto const &command = simulation::Commands_descriptions[ static_cast<std::size_t>( Command ) ];
|
auto const &command = simulation::Commands_descriptions[ static_cast<std::size_t>( Command ) ];
|
||||||
|
|
||||||
|
|||||||
@@ -468,7 +468,7 @@ public:
|
|||||||
void
|
void
|
||||||
update();
|
update();
|
||||||
// checks if given command must be scheduled on server
|
// checks if given command must be scheduled on server
|
||||||
bool
|
static bool
|
||||||
is_network_target(uint32_t Recipient);
|
is_network_target(uint32_t Recipient);
|
||||||
|
|
||||||
// pops commands from intercept queue
|
// pops commands from intercept queue
|
||||||
@@ -527,9 +527,9 @@ class command_relay {
|
|||||||
public:
|
public:
|
||||||
// methods
|
// methods
|
||||||
// posts specified command for the specified recipient
|
// posts specified command for the specified recipient
|
||||||
void
|
static void
|
||||||
post(user_command Command, double Param1, double Param2,
|
post(user_command Command, double Param1, double Param2,
|
||||||
int Action, uint16_t Recipient, glm::vec3 Position = glm::vec3(0.0f) , const std::string *Payload = nullptr) const;
|
int Action, uint16_t Recipient, glm::vec3 Position = glm::vec3(0.0f) , const std::string *Payload = nullptr);
|
||||||
private:
|
private:
|
||||||
// types
|
// types
|
||||||
// members
|
// members
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ private:
|
|||||||
void
|
void
|
||||||
default_bindings();
|
default_bindings();
|
||||||
// potentially replaces supplied command with a more relevant one
|
// potentially replaces supplied command with a more relevant one
|
||||||
user_command
|
static user_command
|
||||||
adjust_command( user_command Command );
|
adjust_command( user_command Command );
|
||||||
|
|
||||||
// members
|
// members
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ public:
|
|||||||
editormouse_input() = default;
|
editormouse_input() = default;
|
||||||
|
|
||||||
// methods
|
// methods
|
||||||
bool
|
static bool
|
||||||
init();
|
init();
|
||||||
void
|
void
|
||||||
position( double Horizontal, double Vertical );
|
position( double Horizontal, double Vertical );
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ private:
|
|||||||
using inputaxis_sequence = std::vector<input_axis>;
|
using inputaxis_sequence = std::vector<input_axis>;
|
||||||
// methods
|
// methods
|
||||||
bool recall_bindings();
|
bool recall_bindings();
|
||||||
void bind( std::vector< std::reference_wrapper<user_command> > &Targets, cParser &Input, std::unordered_map<std::string, user_command> const &Translator, std::string Point );
|
static void bind( std::vector< std::reference_wrapper<user_command> > &Targets, cParser &Input, std::unordered_map<std::string, user_command> const &Translator, std::string Point );
|
||||||
void on_button( int Button, int Action );
|
void on_button( int Button, int Action );
|
||||||
void process_axes();
|
void process_axes();
|
||||||
|
|
||||||
|
|||||||
@@ -323,7 +323,8 @@ keyboard_input::key( int const Key, int const Action ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
keyboard_input::key( int const Key ) const {
|
keyboard_input::key( int const Key )
|
||||||
|
{
|
||||||
|
|
||||||
return input::keys[ Key ];
|
return input::keys[ Key ];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,8 +51,8 @@ public:
|
|||||||
init() { return true; }
|
init() { return true; }
|
||||||
bool
|
bool
|
||||||
key( int Key, int Action );
|
key( int Key, int Action );
|
||||||
int
|
static int
|
||||||
key( int Key ) const;
|
key( int Key );
|
||||||
void
|
void
|
||||||
poll();
|
poll();
|
||||||
user_command const
|
user_command const
|
||||||
|
|||||||
@@ -61,12 +61,12 @@ private:
|
|||||||
void draw_launch_box();
|
void draw_launch_box();
|
||||||
void draw_trainset_box();
|
void draw_trainset_box();
|
||||||
bool launch_simulation();
|
bool launch_simulation();
|
||||||
void add_replace_entry(const trainset_desc &trainset);
|
static void add_replace_entry(const trainset_desc &trainset);
|
||||||
void draw_summary_tooltip(const dynamic_desc &dyn_desc);
|
static void draw_summary_tooltip(const dynamic_desc &dyn_desc);
|
||||||
|
|
||||||
void open_link(const std::string &link);
|
static void open_link(const std::string &link);
|
||||||
void draw_trainset(trainset_desc &trainset);
|
void draw_trainset(trainset_desc &trainset);
|
||||||
void draw_droptarget(trainset_desc &trainset, int position);
|
static void draw_droptarget(trainset_desc &trainset, int position);
|
||||||
void purge_selected_trainset();
|
void purge_selected_trainset();
|
||||||
};
|
};
|
||||||
} // namespace ui
|
} // namespace ui
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ private:
|
|||||||
void parse_texture_rule(const std::string &target, const std::string ¶m);
|
void parse_texture_rule(const std::string &target, const std::string ¶m);
|
||||||
void parse_texture_info(const std::string &target, const std::string ¶m, std::shared_ptr<skin_meta> meta);
|
void parse_texture_info(const std::string &target, const std::string ¶m, std::shared_ptr<skin_meta> meta);
|
||||||
|
|
||||||
std::shared_ptr<skin_meta> parse_meta(const std::string &str);
|
static std::shared_ptr<skin_meta> parse_meta(const std::string &str);
|
||||||
std::shared_ptr<vehicle_desc> get_vehicle(const std::string &name);
|
std::shared_ptr<vehicle_desc> get_vehicle(const std::string &name);
|
||||||
|
|
||||||
vehicle_type ctx_type = vehicle_type::unknown;
|
vehicle_type ctx_type = vehicle_type::unknown;
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class vehiclepicker_panel : public ui_panel
|
|||||||
void render_contents() override;
|
void render_contents() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool selectable_image(const char *desc, bool selected, const deferred_image *image, const skin_set *pickable = nullptr);
|
static bool selectable_image(const char *desc, bool selected, const deferred_image *image, const skin_set *pickable = nullptr);
|
||||||
|
|
||||||
vehicle_type selected_type = vehicle_type::none;
|
vehicle_type selected_type = vehicle_type::none;
|
||||||
std::shared_ptr<const vehicle_desc> selected_vehicle;
|
std::shared_ptr<const vehicle_desc> selected_vehicle;
|
||||||
@@ -59,7 +59,7 @@ private:
|
|||||||
int number;
|
int number;
|
||||||
};
|
};
|
||||||
|
|
||||||
std::vector<search_info> parse_search_query(const std::string &str);
|
static std::vector<search_info> parse_search_query(const std::string &str);
|
||||||
bool skin_filter(const skin_set *skin, std::vector<search_info> &info_list);
|
static bool skin_filter(const skin_set *skin, std::vector<search_info> &info_list);
|
||||||
};
|
};
|
||||||
} // namespace ui
|
} // namespace ui
|
||||||
|
|||||||
@@ -267,7 +267,8 @@ bool TAnimModel::Init(std::string const &asName, std::string const &asReplacable
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
TAnimModel::is_keyword( std::string const &Token ) const {
|
TAnimModel::is_keyword( std::string const &Token )
|
||||||
|
{
|
||||||
|
|
||||||
return Token == "endmodel"
|
return Token == "endmodel"
|
||||||
|| Token == "lights"
|
|| Token == "lights"
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ public:
|
|||||||
// export() subclass details, sends basic content of the class in legacy (text) format to provided stream
|
// export() subclass details, sends basic content of the class in legacy (text) format to provided stream
|
||||||
void export_as_text_( std::ostream &Output ) const;
|
void export_as_text_( std::ostream &Output ) const;
|
||||||
// checks whether provided token is a legacy (text) format keyword
|
// checks whether provided token is a legacy (text) format keyword
|
||||||
bool is_keyword( std::string const &Token ) const;
|
static bool is_keyword( std::string const &Token );
|
||||||
|
|
||||||
// members
|
// members
|
||||||
std::shared_ptr<TAnimContainer> pRoot; // pojemniki sterujące, tylko dla aniomowanych submodeli
|
std::shared_ptr<TAnimContainer> pRoot; // pojemniki sterujące, tylko dla aniomowanych submodeli
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ struct opengl_texture : public ITexture {
|
|||||||
public:
|
public:
|
||||||
// methods
|
// methods
|
||||||
void make_request();
|
void make_request();
|
||||||
void load_PNG();
|
static void load_PNG();
|
||||||
void load_DDS();
|
void load_DDS();
|
||||||
void load_KTX();
|
void load_KTX();
|
||||||
void load_TEX();
|
void load_TEX();
|
||||||
@@ -143,7 +143,7 @@ public:
|
|||||||
~texture_manager() { delete_textures(); }
|
~texture_manager() { delete_textures(); }
|
||||||
|
|
||||||
// activates specified texture unit
|
// activates specified texture unit
|
||||||
void
|
static void
|
||||||
unit( GLint Textureunit );
|
unit( GLint Textureunit );
|
||||||
// creates texture object out of data stored in specified file
|
// creates texture object out of data stored in specified file
|
||||||
texture_handle
|
texture_handle
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ namespace network::tcp
|
|||||||
std::string m_header_buffer;
|
std::string m_header_buffer;
|
||||||
std::string m_body_buffer;
|
std::string m_body_buffer;
|
||||||
|
|
||||||
void write_message(const message &msg, std::ostream &stream);
|
static void write_message(const message &msg, std::ostream &stream);
|
||||||
void send_data(std::shared_ptr<std::string> buffer);
|
void send_data(std::shared_ptr<std::string> buffer);
|
||||||
void read_header();
|
void read_header();
|
||||||
void handle_header(const asio::error_code &err, size_t bytes_transferred);
|
void handle_header(const asio::error_code &err, size_t bytes_transferred);
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ struct opengl33_light : public basic_light {
|
|||||||
float factor;
|
float factor;
|
||||||
|
|
||||||
void apply_intensity(float Factor = 1.0f);
|
void apply_intensity(float Factor = 1.0f);
|
||||||
void apply_angle();
|
static void apply_angle();
|
||||||
|
|
||||||
opengl33_light &operator=(basic_light const &Right) {
|
opengl33_light &operator=(basic_light const &Right) {
|
||||||
basic_light::operator=(Right);
|
basic_light::operator=(Right);
|
||||||
|
|||||||
@@ -254,15 +254,15 @@ class opengl33_renderer : public gfx_renderer {
|
|||||||
typedef std::vector<opengl33_light> opengllight_array;
|
typedef std::vector<opengl33_light> opengllight_array;
|
||||||
|
|
||||||
// methods
|
// methods
|
||||||
std::unique_ptr<gl::program> make_shader(std::string v, std::string f);
|
static std::unique_ptr<gl::program> make_shader(std::string v, std::string f);
|
||||||
bool Init_caps();
|
bool Init_caps();
|
||||||
void setup_pass(viewport_config &Viewport, renderpass_config &Config, rendermode Mode, float Znear = 0.f, float Zfar = 1.f, bool Ignoredebug = false);
|
void setup_pass(viewport_config &Viewport, renderpass_config &Config, rendermode Mode, float Znear = 0.f, float Zfar = 1.f, bool Ignoredebug = false);
|
||||||
void setup_matrices();
|
void setup_matrices();
|
||||||
void setup_drawing(bool Alpha = false);
|
void setup_drawing(bool Alpha = false);
|
||||||
void setup_shadow_unbind_map();
|
static void setup_shadow_unbind_map();
|
||||||
void setup_shadow_bind_map();
|
void setup_shadow_bind_map();
|
||||||
void setup_shadow_color( glm::vec4 const &Shadowcolor );
|
void setup_shadow_color( glm::vec4 const &Shadowcolor );
|
||||||
void setup_env_map(gl::cubemap *tex);
|
static void setup_env_map(gl::cubemap *tex);
|
||||||
void setup_environment_light(TEnvironmentType Environment = e_flat);
|
void setup_environment_light(TEnvironmentType Environment = e_flat);
|
||||||
void setup_sunlight_intensity( float Factor = 1.f);
|
void setup_sunlight_intensity( float Factor = 1.f);
|
||||||
// runs jobs needed to generate graphics for specified render pass
|
// runs jobs needed to generate graphics for specified render pass
|
||||||
@@ -310,8 +310,8 @@ class opengl33_renderer : public gfx_renderer {
|
|||||||
bool Render_Alpha(TModel3d *Model, material_data const *Material, float Squaredistance);
|
bool Render_Alpha(TModel3d *Model, material_data const *Material, float Squaredistance);
|
||||||
void Render_Alpha(TSubModel *Submodel);
|
void Render_Alpha(TSubModel *Submodel);
|
||||||
void Update_Lights(light_array &Lights);
|
void Update_Lights(light_array &Lights);
|
||||||
glm::vec3 pick_color(std::size_t Index);
|
static glm::vec3 pick_color(std::size_t Index);
|
||||||
std::size_t pick_index(glm::ivec3 const &Color);
|
static std::size_t pick_index(glm::ivec3 const &Color);
|
||||||
|
|
||||||
bool init_viewport(viewport_config &vp);
|
bool init_viewport(viewport_config &vp);
|
||||||
|
|
||||||
@@ -394,10 +394,10 @@ class opengl33_renderer : public gfx_renderer {
|
|||||||
|
|
||||||
double m_precipitationrotation;
|
double m_precipitationrotation;
|
||||||
|
|
||||||
glm::mat4 perspective_projection_raw(float fovy, float aspect, float znear, float zfar);
|
static glm::mat4 perspective_projection_raw(float fovy, float aspect, float znear, float zfar);
|
||||||
glm::mat4 perspective_projection(const viewport_proj_config &c, float n, float f, glm::mat4 &frustum);
|
static glm::mat4 perspective_projection(const viewport_proj_config &c, float n, float f, glm::mat4 &frustum);
|
||||||
glm::mat4 ortho_projection(float left, float right, float bottom, float top, float z_near, float z_far);
|
static glm::mat4 ortho_projection(float left, float right, float bottom, float top, float z_near, float z_far);
|
||||||
glm::mat4 ortho_frustumtest_projection(float left, float right, float bottom, float top, float z_near, float z_far);
|
static glm::mat4 ortho_frustumtest_projection(float left, float right, float bottom, float top, float z_near, float z_far);
|
||||||
|
|
||||||
std::vector<std::function<void(TSubModel const *, glm::vec2)>> m_control_pick_requests;
|
std::vector<std::function<void(TSubModel const *, glm::vec2)>> m_control_pick_requests;
|
||||||
std::vector<std::function<void(scene::basic_node *)>> m_node_pick_requests;
|
std::vector<std::function<void(scene::basic_node *)>> m_node_pick_requests;
|
||||||
|
|||||||
@@ -273,9 +273,9 @@ private:
|
|||||||
Update_Lights( light_array &Lights );
|
Update_Lights( light_array &Lights );
|
||||||
bool
|
bool
|
||||||
Init_caps();
|
Init_caps();
|
||||||
glm::vec3
|
static glm::vec3
|
||||||
pick_color( std::size_t Index );
|
pick_color( std::size_t Index );
|
||||||
std::size_t
|
static std::size_t
|
||||||
pick_index( glm::ivec3 const &Color );
|
pick_index( glm::ivec3 const &Color );
|
||||||
|
|
||||||
// members
|
// members
|
||||||
|
|||||||
@@ -1093,7 +1093,8 @@ basic_region::update_traction( TDynamicObject *Vehicle, int const Pantographinde
|
|||||||
|
|
||||||
// checks whether specified file is a valid region data file
|
// checks whether specified file is a valid region data file
|
||||||
bool
|
bool
|
||||||
basic_region::is_scene( std::string const &Scenariofile ) const {
|
basic_region::is_scene( std::string const &Scenariofile )
|
||||||
|
{
|
||||||
|
|
||||||
auto filename { Scenariofile };
|
auto filename { Scenariofile };
|
||||||
while( filename[ 0 ] == '$' ) {
|
while( filename[ 0 ] == '$' ) {
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ public:
|
|||||||
using eventlauncher_sequence = std::vector<TEventLauncher *>;
|
using eventlauncher_sequence = std::vector<TEventLauncher *>;
|
||||||
using memorycell_sequence = std::vector<TMemCell *>;
|
using memorycell_sequence = std::vector<TMemCell *>;
|
||||||
// methods
|
// methods
|
||||||
void
|
static void
|
||||||
launch_event(TEventLauncher *Launcher, bool local_only);
|
launch_event(TEventLauncher *Launcher, bool local_only);
|
||||||
void
|
void
|
||||||
enclose_area( basic_node *Node );
|
enclose_area( basic_node *Node );
|
||||||
@@ -387,8 +387,8 @@ public:
|
|||||||
void
|
void
|
||||||
update_sounds();
|
update_sounds();
|
||||||
// checks whether specified file is a valid region data file
|
// checks whether specified file is a valid region data file
|
||||||
bool
|
static bool
|
||||||
is_scene( std::string const &Scenariofile ) const;
|
is_scene( std::string const &Scenariofile );
|
||||||
// stores content of the class in file with specified name
|
// stores content of the class in file with specified name
|
||||||
void
|
void
|
||||||
serialize( std::string const &Scenariofile ) const;
|
serialize( std::string const &Scenariofile ) const;
|
||||||
@@ -475,7 +475,7 @@ public:
|
|||||||
|
|
||||||
// methods
|
// methods
|
||||||
// checks whether specified point is within boundaries of the region
|
// checks whether specified point is within boundaries of the region
|
||||||
bool
|
static bool
|
||||||
point_inside( glm::dvec3 const &Location );
|
point_inside( glm::dvec3 const &Location );
|
||||||
// legacy method, trims provided shape to fit into a section. adds trimmed part at the end of provided list, returns true if changes were made
|
// legacy method, trims provided shape to fit into a section. adds trimmed part at the end of provided list, returns true if changes were made
|
||||||
static
|
static
|
||||||
|
|||||||
@@ -45,17 +45,17 @@ private:
|
|||||||
translate_node( basic_node *Node, glm::dvec3 const &Location );
|
translate_node( basic_node *Node, glm::dvec3 const &Location );
|
||||||
void
|
void
|
||||||
translate_node( basic_node *Node, float Offset );
|
translate_node( basic_node *Node, float Offset );
|
||||||
void
|
static void
|
||||||
translate_instance( TAnimModel *Instance, glm::dvec3 const &Location );
|
translate_instance( TAnimModel *Instance, glm::dvec3 const &Location );
|
||||||
void
|
static void
|
||||||
translate_instance( TAnimModel *Instance, float Offset );
|
translate_instance( TAnimModel *Instance, float Offset );
|
||||||
void
|
static void
|
||||||
translate_memorycell( TMemCell *Memorycell, glm::dvec3 const &Location );
|
translate_memorycell( TMemCell *Memorycell, glm::dvec3 const &Location );
|
||||||
void
|
static void
|
||||||
translate_memorycell( TMemCell *Memorycell, float Offset );
|
translate_memorycell( TMemCell *Memorycell, float Offset );
|
||||||
void
|
void
|
||||||
rotate_node( basic_node *Node, glm::vec3 const &Angle );
|
rotate_node( basic_node *Node, glm::vec3 const &Angle );
|
||||||
void
|
static void
|
||||||
rotate_instance( TAnimModel *Instance, glm::vec3 const &Angle );
|
rotate_instance( TAnimModel *Instance, glm::vec3 const &Angle );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ private:
|
|||||||
// creates handle for a new group
|
// creates handle for a new group
|
||||||
group_handle
|
group_handle
|
||||||
create_handle();
|
create_handle();
|
||||||
bool
|
static bool
|
||||||
assign_cross_switch(map::track_switch&sw, std::string &sw_name, const std::string &id, size_t idx);
|
assign_cross_switch(map::track_switch&sw, std::string &sw_name, const std::string &id, size_t idx);
|
||||||
// members
|
// members
|
||||||
group_map m_groupmap; // map of established node groups
|
group_map m_groupmap; // map of established node groups
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ class render_task
|
|||||||
// methods
|
// methods
|
||||||
void run();
|
void run();
|
||||||
void upload();
|
void upload();
|
||||||
void cancel();
|
static void cancel();
|
||||||
auto target() const -> std::shared_ptr<python_rt>
|
auto target() const -> std::shared_ptr<python_rt>
|
||||||
{
|
{
|
||||||
return m_target;
|
return m_target;
|
||||||
@@ -110,19 +110,19 @@ class python_taskqueue
|
|||||||
python_taskqueue() = default;
|
python_taskqueue() = default;
|
||||||
// methods
|
// methods
|
||||||
// initializes the module. returns true on success
|
// initializes the module. returns true on success
|
||||||
auto init() -> bool;
|
static auto init() -> bool;
|
||||||
// shuts down the module
|
// shuts down the module
|
||||||
void exit();
|
static void exit();
|
||||||
// adds specified task along with provided collection of data to the work queue. returns true on success
|
// adds specified task along with provided collection of data to the work queue. returns true on success
|
||||||
auto insert(task_request const &Task) -> bool;
|
static auto insert(task_request const &Task) -> bool;
|
||||||
// executes python script stored in specified file. returns true on success
|
// executes python script stored in specified file. returns true on success
|
||||||
auto run_file(std::string const &File, std::string const &Path = "") -> bool;
|
static auto run_file(std::string const &File, std::string const &Path = "") -> bool;
|
||||||
// acquires the python gil and sets the main thread as current
|
// acquires the python gil and sets the main thread as current
|
||||||
void acquire_lock();
|
static void acquire_lock();
|
||||||
// releases the python gil and swaps the main thread out
|
// releases the python gil and swaps the main thread out
|
||||||
void release_lock();
|
static void release_lock();
|
||||||
|
|
||||||
void update();
|
static void update();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// types
|
// types
|
||||||
|
|||||||
@@ -380,7 +380,7 @@ basic_controller::log_error( std::string const &Error, int const Line ) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto
|
auto
|
||||||
basic_controller::guess_element_type_from_name( std::string const &Name ) const -> basic_element::type_e {
|
basic_controller::guess_element_type_from_name( std::string const &Name ) -> basic_element::type_e {
|
||||||
|
|
||||||
auto const name { split_string_and_number( Name ) };
|
auto const name { split_string_and_number( Name ) };
|
||||||
|
|
||||||
|
|||||||
@@ -104,8 +104,8 @@ private:
|
|||||||
// runs one cycle of current program. returns: error code or 0 if there's no error
|
// runs one cycle of current program. returns: error code or 0 if there's no error
|
||||||
auto run() -> int;
|
auto run() -> int;
|
||||||
void log_error( std::string const &Error, int Line = -1 ) const;
|
void log_error( std::string const &Error, int Line = -1 ) const;
|
||||||
auto guess_element_type_from_name( std::string const &Name ) const->basic_element::type_e;
|
static auto guess_element_type_from_name( std::string const &Name ) -> basic_element::type_e;
|
||||||
auto inverse( int const Value ) const -> int {
|
static auto inverse( int const Value ) -> int {
|
||||||
return Value == 0 ? 1 : 0; }
|
return Value == 0 ? 1 : 0; }
|
||||||
// element access
|
// element access
|
||||||
auto element( element_handle const Element ) const -> basic_element const {
|
auto element( element_handle const Element ) const -> basic_element const {
|
||||||
|
|||||||
@@ -25,17 +25,17 @@ class state_manager {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
// methods
|
// methods
|
||||||
void
|
static void
|
||||||
init_scripting_interface();
|
init_scripting_interface();
|
||||||
// legacy method, calculates changes in simulation state over specified time
|
// legacy method, calculates changes in simulation state over specified time
|
||||||
void
|
static void
|
||||||
update( double Deltatime, int Iterationcount );
|
update( double Deltatime, int Iterationcount );
|
||||||
void
|
static void
|
||||||
update_clocks();
|
update_clocks();
|
||||||
void
|
void
|
||||||
update_scripting_interface();
|
update_scripting_interface();
|
||||||
// process input commands
|
// process input commands
|
||||||
void
|
static void
|
||||||
process_commands();
|
process_commands();
|
||||||
// create model from node string
|
// create model from node string
|
||||||
TAnimModel *
|
TAnimModel *
|
||||||
@@ -44,10 +44,10 @@ public:
|
|||||||
TEventLauncher *
|
TEventLauncher *
|
||||||
create_eventlauncher(const std::string &src, const std::string &name, const glm::dvec3 &position);
|
create_eventlauncher(const std::string &src, const std::string &name, const glm::dvec3 &position);
|
||||||
// delete TAnimModel instance
|
// delete TAnimModel instance
|
||||||
void
|
static void
|
||||||
delete_model(TAnimModel *model);
|
delete_model(TAnimModel *model);
|
||||||
// delete TEventLauncher instance
|
// delete TEventLauncher instance
|
||||||
void
|
static void
|
||||||
delete_eventlauncher(TEventLauncher *launcher);
|
delete_eventlauncher(TEventLauncher *launcher);
|
||||||
// starts deserialization from specified file, returns context pointer on success, throws otherwise
|
// starts deserialization from specified file, returns context pointer on success, throws otherwise
|
||||||
std::shared_ptr<deserializer_state>
|
std::shared_ptr<deserializer_state>
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ public:
|
|||||||
// calculates current season of the year based on set simulation date
|
// calculates current season of the year based on set simulation date
|
||||||
void compute_season( int Yearday );
|
void compute_season( int Yearday );
|
||||||
// calculates current weather
|
// calculates current weather
|
||||||
void compute_weather();
|
static void compute_weather();
|
||||||
// data access
|
// data access
|
||||||
auto const &
|
auto const &
|
||||||
sun() const {
|
sun() const {
|
||||||
|
|||||||
@@ -1281,7 +1281,8 @@ state_serializer::export_as_text(std::string const &Scenariofile) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
state_serializer::export_nodes_to_stream(std::ostream &scmfile, bool Dirty) const {
|
state_serializer::export_nodes_to_stream(std::ostream &scmfile, bool Dirty)
|
||||||
|
{
|
||||||
// groups
|
// groups
|
||||||
scmfile << "// groups\n";
|
scmfile << "// groups\n";
|
||||||
scene::Groups.export_as_text( scmfile, Dirty );
|
scene::Groups.export_as_text( scmfile, Dirty );
|
||||||
|
|||||||
@@ -49,33 +49,33 @@ public:
|
|||||||
private:
|
private:
|
||||||
// methods
|
// methods
|
||||||
// restores class data from provided stream
|
// restores class data from provided stream
|
||||||
void deserialize_area( cParser &Input, scene::scratch_data &Scratchpad );
|
static void deserialize_area( cParser &Input, scene::scratch_data &Scratchpad );
|
||||||
void deserialize_isolated( cParser &Input, scene::scratch_data &Scratchpad );
|
static void deserialize_isolated( cParser &Input, scene::scratch_data &Scratchpad );
|
||||||
void deserialize_assignment( cParser &Input, scene::scratch_data &Scratchpad );
|
static void deserialize_assignment( cParser &Input, scene::scratch_data &Scratchpad );
|
||||||
void deserialize_atmo( cParser &Input, scene::scratch_data &Scratchpad );
|
static void deserialize_atmo( cParser &Input, scene::scratch_data &Scratchpad );
|
||||||
void deserialize_camera( cParser &Input, scene::scratch_data &Scratchpad );
|
static void deserialize_camera( cParser &Input, scene::scratch_data &Scratchpad );
|
||||||
void deserialize_config( cParser &Input, scene::scratch_data &Scratchpad );
|
static void deserialize_config( cParser &Input, scene::scratch_data &Scratchpad );
|
||||||
void deserialize_description( cParser &Input, scene::scratch_data &Scratchpad );
|
void deserialize_description( cParser &Input, scene::scratch_data &Scratchpad );
|
||||||
void deserialize_event( cParser &Input, scene::scratch_data &Scratchpad );
|
void deserialize_event( cParser &Input, scene::scratch_data &Scratchpad );
|
||||||
void deserialize_lua( cParser &Input, scene::scratch_data &Scratchpad );
|
static void deserialize_lua( cParser &Input, scene::scratch_data &Scratchpad );
|
||||||
void deserialize_firstinit( cParser &Input, scene::scratch_data &Scratchpad );
|
void deserialize_firstinit( cParser &Input, scene::scratch_data &Scratchpad );
|
||||||
void deserialize_group( cParser &Input, scene::scratch_data &Scratchpad );
|
static void deserialize_group( cParser &Input, scene::scratch_data &Scratchpad );
|
||||||
void deserialize_endgroup( cParser &Input, scene::scratch_data &Scratchpad );
|
static void deserialize_endgroup( cParser &Input, scene::scratch_data &Scratchpad );
|
||||||
void deserialize_light( cParser &Input, scene::scratch_data &Scratchpad );
|
void deserialize_light( cParser &Input, scene::scratch_data &Scratchpad );
|
||||||
void deserialize_node( cParser &Input, scene::scratch_data &Scratchpad );
|
void deserialize_node( cParser &Input, scene::scratch_data &Scratchpad );
|
||||||
void deserialize_origin( cParser &Input, scene::scratch_data &Scratchpad );
|
static void deserialize_origin( cParser &Input, scene::scratch_data &Scratchpad );
|
||||||
void deserialize_endorigin( cParser &Input, scene::scratch_data &Scratchpad );
|
static void deserialize_endorigin( cParser &Input, scene::scratch_data &Scratchpad );
|
||||||
void deserialize_scale( cParser &Input, scene::scratch_data &Scratchpad );
|
static void deserialize_scale( cParser &Input, scene::scratch_data &Scratchpad );
|
||||||
void deserialize_endscale( cParser &Input, scene::scratch_data &Scratchpad );
|
static void deserialize_endscale( cParser &Input, scene::scratch_data &Scratchpad );
|
||||||
void deserialize_rotate( cParser &Input, scene::scratch_data &Scratchpad );
|
static void deserialize_rotate( cParser &Input, scene::scratch_data &Scratchpad );
|
||||||
void deserialize_sky( cParser &Input, scene::scratch_data &Scratchpad );
|
void deserialize_sky( cParser &Input, scene::scratch_data &Scratchpad );
|
||||||
void deserialize_test( cParser &Input, scene::scratch_data &Scratchpad );
|
void deserialize_test( cParser &Input, scene::scratch_data &Scratchpad );
|
||||||
void deserialize_time( cParser &Input, scene::scratch_data &Scratchpad );
|
void deserialize_time( cParser &Input, scene::scratch_data &Scratchpad );
|
||||||
void deserialize_trainset( cParser &Input, scene::scratch_data &Scratchpad );
|
void deserialize_trainset( cParser &Input, scene::scratch_data &Scratchpad );
|
||||||
void deserialize_terrain( cParser &Input, scene::scratch_data &Scratchpad );
|
void deserialize_terrain( cParser &Input, scene::scratch_data &Scratchpad );
|
||||||
void deserialize_editorterrain( cParser &Input, scene::scratch_data &Scratchpad );
|
void deserialize_editorterrain( cParser &Input, scene::scratch_data &Scratchpad );
|
||||||
void deserialize_endtrainset( cParser &Input, scene::scratch_data &Scratchpad );
|
static void deserialize_endtrainset( cParser &Input, scene::scratch_data &Scratchpad );
|
||||||
TTrack * deserialize_path( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata );
|
static TTrack * deserialize_path( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata );
|
||||||
TTraction * deserialize_traction( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata );
|
TTraction * deserialize_traction( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata );
|
||||||
TTractionPowerSource * deserialize_tractionpowersource( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata );
|
TTractionPowerSource * deserialize_tractionpowersource( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata );
|
||||||
TMemCell * deserialize_memorycell( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata );
|
TMemCell * deserialize_memorycell( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata );
|
||||||
@@ -83,12 +83,12 @@ private:
|
|||||||
TAnimModel * deserialize_model( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata );
|
TAnimModel * deserialize_model( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata );
|
||||||
TDynamicObject * deserialize_dynamic( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata );
|
TDynamicObject * deserialize_dynamic( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata );
|
||||||
sound_source * deserialize_sound( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata );
|
sound_source * deserialize_sound( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata );
|
||||||
void init_time();
|
static void init_time();
|
||||||
// skips content of stream until specified token
|
// skips content of stream until specified token
|
||||||
void skip_until( cParser &Input, std::string const &Token );
|
static void skip_until( cParser &Input, std::string const &Token );
|
||||||
// transforms provided location by specifed rotation and offset
|
// transforms provided location by specifed rotation and offset
|
||||||
glm::dvec3 transform( glm::dvec3 Location, scene::scratch_data const &Scratchpad );
|
static glm::dvec3 transform( glm::dvec3 Location, scene::scratch_data const &Scratchpad );
|
||||||
void export_nodes_to_stream( std::ostream &, bool Dirty ) const;
|
static void export_nodes_to_stream( std::ostream &, bool Dirty );
|
||||||
};
|
};
|
||||||
|
|
||||||
} // simulation
|
} // simulation
|
||||||
|
|||||||
@@ -194,7 +194,8 @@ void scenario_time::set_time(int yearday, int minute) {
|
|||||||
|
|
||||||
// calculates day of week for provided date
|
// calculates day of week for provided date
|
||||||
int
|
int
|
||||||
scenario_time::day_of_week( int const Day, int const Month, int const Year ) const {
|
scenario_time::day_of_week( int const Day, int const Month, int const Year )
|
||||||
|
{
|
||||||
|
|
||||||
// using Zeller's congruence, http://en.wikipedia.org/wiki/Zeller%27s_congruence
|
// using Zeller's congruence, http://en.wikipedia.org/wiki/Zeller%27s_congruence
|
||||||
int const q = Day;
|
int const q = Day;
|
||||||
@@ -234,7 +235,8 @@ scenario_time::day_of_month( int const Week, int const Weekday, int const Month,
|
|||||||
|
|
||||||
// returns number of days between specified days of week
|
// returns number of days between specified days of week
|
||||||
int
|
int
|
||||||
scenario_time::weekdays( int const First, int const Second ) const {
|
scenario_time::weekdays( int const First, int const Second )
|
||||||
|
{
|
||||||
|
|
||||||
if( Second >= First ) { return Second - First; }
|
if( Second >= First ) { return Second - First; }
|
||||||
else { return 7 - First + Second; }
|
else { return 7 - First + Second; }
|
||||||
@@ -249,7 +251,8 @@ scenario_time::convert_transition_time( SYSTEMTIME &Time ) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
scenario_time::is_leap( int const Year ) const {
|
scenario_time::is_leap( int const Year )
|
||||||
|
{
|
||||||
|
|
||||||
return Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0);
|
return Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0);
|
||||||
|
|
||||||
|
|||||||
@@ -56,17 +56,17 @@ private:
|
|||||||
int
|
int
|
||||||
year_day( int Day, int Month, int Year ) const;
|
year_day( int Day, int Month, int Year ) const;
|
||||||
// calculates day of week for provided date
|
// calculates day of week for provided date
|
||||||
int
|
static int
|
||||||
day_of_week( int Day, int Month, int Year ) const;
|
day_of_week( int Day, int Month, int Year );
|
||||||
// calculates day of month for specified weekday of specified month of the year
|
// calculates day of month for specified weekday of specified month of the year
|
||||||
int
|
int
|
||||||
day_of_month( int Week, int Weekday, int Month, int Year ) const;
|
day_of_month( int Week, int Weekday, int Month, int Year ) const;
|
||||||
// returns number of days between specified days of week
|
// returns number of days between specified days of week
|
||||||
int
|
static int
|
||||||
weekdays( int First, int Second ) const;
|
weekdays( int First, int Second );
|
||||||
// returns true if specified year is a leap year, false otherwise
|
// returns true if specified year is a leap year, false otherwise
|
||||||
bool
|
static bool
|
||||||
is_leap( int Year ) const;
|
is_leap( int Year );
|
||||||
|
|
||||||
SYSTEMTIME m_time;
|
SYSTEMTIME m_time;
|
||||||
double m_milliseconds{ 0.0 };
|
double m_milliseconds{ 0.0 };
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ class headtrack
|
|||||||
int joy_id = -1;
|
int joy_id = -1;
|
||||||
|
|
||||||
void find_joy();
|
void find_joy();
|
||||||
float get_axis(const float *data, int count, int axis, float mul);
|
static float get_axis(const float *data, int count, int axis, float mul);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
headtrack();
|
headtrack();
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
bool parse_translation(std::istream &stream);
|
bool parse_translation(std::istream &stream);
|
||||||
std::string parse_c_literal(const std::string &str);
|
static std::string parse_c_literal(const std::string &str);
|
||||||
|
|
||||||
std::unordered_map<std::string, std::string> lang_mapping;
|
std::unordered_map<std::string, std::string> lang_mapping;
|
||||||
std::unordered_map<const void*, const void*> pointer_cache;
|
std::unordered_map<const void*, const void*> pointer_cache;
|
||||||
|
|||||||
@@ -452,7 +452,7 @@ void TController::TableClear()
|
|||||||
eSignSkip = nullptr; // nic nie pomijamy
|
eSignSkip = nullptr; // nic nie pomijamy
|
||||||
};
|
};
|
||||||
|
|
||||||
std::vector<basic_event *> TController::CheckTrackEvent( TTrack *Track, double const fDirection ) const
|
std::vector<basic_event *> TController::CheckTrackEvent( TTrack *Track, double const fDirection )
|
||||||
{ // sprawdzanie eventów na podanym torze do podstawowego skanowania
|
{ // sprawdzanie eventów na podanym torze do podstawowego skanowania
|
||||||
std::vector<basic_event *> events;
|
std::vector<basic_event *> events;
|
||||||
auto const &eventsequence { ( fDirection > 0 ? Track->m_events2 : Track->m_events1 ) };
|
auto const &eventsequence { ( fDirection > 0 ? Track->m_events2 : Track->m_events1 ) };
|
||||||
@@ -1918,7 +1918,8 @@ TController::~TController()
|
|||||||
};
|
};
|
||||||
|
|
||||||
// zamiana kodu rozkazu na opis
|
// zamiana kodu rozkazu na opis
|
||||||
std::string TController::Order2Str(TOrders Order) const {
|
std::string TController::Order2Str(TOrders Order)
|
||||||
|
{
|
||||||
|
|
||||||
if( (Order & Change_direction) != 0
|
if( (Order & Change_direction) != 0
|
||||||
&& Order != Change_direction ) {
|
&& Order != Change_direction ) {
|
||||||
|
|||||||
@@ -471,7 +471,7 @@ private:
|
|||||||
void OrdersInit( double fVel );
|
void OrdersInit( double fVel );
|
||||||
void OrdersClear();
|
void OrdersClear();
|
||||||
void OrdersDump( std::string Neworder, bool Verbose = true );
|
void OrdersDump( std::string Neworder, bool Verbose = true );
|
||||||
std::string Order2Str( TOrders Order ) const;
|
static std::string Order2Str( TOrders Order );
|
||||||
// members
|
// members
|
||||||
std::string m_assignment;
|
std::string m_assignment;
|
||||||
glm::dvec3 vCommandLocation; // polozenie wskaznika, sygnalizatora lub innego obiektu do ktorego odnosi sie komenda // NOTE: not used
|
glm::dvec3 vCommandLocation; // polozenie wskaznika, sygnalizatora lub innego obiektu do ktorego odnosi sie komenda // NOTE: not used
|
||||||
@@ -488,7 +488,7 @@ public:
|
|||||||
} //jak jedzie do tyłu to trzeba uwzględniać, że distance jest ujemna
|
} //jak jedzie do tyłu to trzeba uwzględniać, że distance jest ujemna
|
||||||
private:
|
private:
|
||||||
// Ra: metody obsługujące skanowanie toru
|
// Ra: metody obsługujące skanowanie toru
|
||||||
std::vector<basic_event *> CheckTrackEvent( TTrack *Track, double fDirection ) const;
|
static std::vector<basic_event *> CheckTrackEvent( TTrack *Track, double fDirection );
|
||||||
bool TableAddNew();
|
bool TableAddNew();
|
||||||
bool TableNotFound( basic_event const *Event, double Distance ) const;
|
bool TableNotFound( basic_event const *Event, double Distance ) const;
|
||||||
void TableTraceRoute( double fDistance, TDynamicObject *pVehicle );
|
void TableTraceRoute( double fDistance, TDynamicObject *pVehicle );
|
||||||
@@ -511,7 +511,7 @@ private:
|
|||||||
int TableDirection() { return iTableDirection; }
|
int TableDirection() { return iTableDirection; }
|
||||||
// Ra: stare funkcje skanujące, używane do szukania sygnalizatora z tyłu
|
// Ra: stare funkcje skanujące, używane do szukania sygnalizatora z tyłu
|
||||||
bool IsOccupiedByAnotherConsist( TTrack *Track, double Distance );
|
bool IsOccupiedByAnotherConsist( TTrack *Track, double Distance );
|
||||||
basic_event *CheckTrackEventBackward( double fDirection, TTrack *Track, TDynamicObject *Vehicle, int Eventdirection = 1, end End = rear );
|
static basic_event *CheckTrackEventBackward( double fDirection, TTrack *Track, TDynamicObject *Vehicle, int Eventdirection = 1, end End = rear );
|
||||||
TTrack *BackwardTraceRoute( double &fDistance, double &fDirection, TDynamicObject *Vehicle, basic_event *&Event, int Eventdirection = 1, end End = rear, bool Untiloccupied = true );
|
TTrack *BackwardTraceRoute( double &fDistance, double &fDirection, TDynamicObject *Vehicle, basic_event *&Event, int Eventdirection = 1, end End = rear, bool Untiloccupied = true );
|
||||||
void SetProximityVelocity( double dist, double vel, glm::dvec3 const *pos );
|
void SetProximityVelocity( double dist, double vel, glm::dvec3 const *pos );
|
||||||
TCommandType BackwardScan( double Range );
|
TCommandType BackwardScan( double Range );
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ public:
|
|||||||
int iAxleFirst; // numer pierwszej osi w kierunku ruchu (oś wiążąca pojazd z torem i wyzwalająca eventy)
|
int iAxleFirst; // numer pierwszej osi w kierunku ruchu (oś wiążąca pojazd z torem i wyzwalająca eventy)
|
||||||
float fAxleDist; // rozstaw wózków albo osi do liczenia proporcji zacienienia
|
float fAxleDist; // rozstaw wózków albo osi do liczenia proporcji zacienienia
|
||||||
glm::vec3 modelRot; // obrot pudła względem świata - do przeanalizowania, czy potrzebne!!!
|
glm::vec3 modelRot; // obrot pudła względem świata - do przeanalizowania, czy potrzebne!!!
|
||||||
TDynamicObject * ABuFindNearestObject(glm::vec3 pos, TTrack *Track, TDynamicObject *MyPointer, int &CouplNr );
|
static TDynamicObject * ABuFindNearestObject(glm::vec3 pos, TTrack *Track, TDynamicObject *MyPointer, int &CouplNr );
|
||||||
|
|
||||||
glm::dvec3 m_future_movement;
|
glm::dvec3 m_future_movement;
|
||||||
glm::dvec3 m_future_wheels_angle;
|
glm::dvec3 m_future_wheels_angle;
|
||||||
@@ -290,7 +290,7 @@ private:
|
|||||||
void UpdateDoorRotate(TAnim *pAnim); // animacja drzwi - obrót
|
void UpdateDoorRotate(TAnim *pAnim); // animacja drzwi - obrót
|
||||||
void UpdateDoorFold(TAnim *pAnim); // animacja drzwi - składanie
|
void UpdateDoorFold(TAnim *pAnim); // animacja drzwi - składanie
|
||||||
void UpdateDoorPlug(TAnim *pAnim); // animacja drzwi - odskokowo-przesuwne
|
void UpdateDoorPlug(TAnim *pAnim); // animacja drzwi - odskokowo-przesuwne
|
||||||
void UpdatePant(TAnim *pAnim); // animacja pantografu
|
static void UpdatePant(TAnim *pAnim); // animacja pantografu
|
||||||
void UpdatePlatformTranslate(TAnim *pAnim); // doorstep animation, shift
|
void UpdatePlatformTranslate(TAnim *pAnim); // doorstep animation, shift
|
||||||
void UpdatePlatformRotate(TAnim *pAnim); // doorstep animation, rotate
|
void UpdatePlatformRotate(TAnim *pAnim); // doorstep animation, rotate
|
||||||
void UpdateMirror(TAnim *pAnim); // mirror animation
|
void UpdateMirror(TAnim *pAnim); // mirror animation
|
||||||
@@ -460,7 +460,7 @@ private:
|
|||||||
// methods
|
// methods
|
||||||
void ABuLittleUpdate(double ObjSqrDist);
|
void ABuLittleUpdate(double ObjSqrDist);
|
||||||
void ABuBogies();
|
void ABuBogies();
|
||||||
void ABuModelRoll();
|
static void ABuModelRoll();
|
||||||
void TurnOff();
|
void TurnOff();
|
||||||
// update state of load exchange operation
|
// update state of load exchange operation
|
||||||
void update_exchange( double Deltatime );
|
void update_exchange( double Deltatime );
|
||||||
@@ -869,7 +869,7 @@ public:
|
|||||||
void
|
void
|
||||||
update( double dt, int iter );
|
update( double dt, int iter );
|
||||||
// legacy method, checks for presence and height of traction wire for specified vehicle
|
// legacy method, checks for presence and height of traction wire for specified vehicle
|
||||||
void
|
static void
|
||||||
update_traction( TDynamicObject *Vehicle );
|
update_traction( TDynamicObject *Vehicle );
|
||||||
// legacy method, sends list of vehicles over network
|
// legacy method, sends list of vehicles over network
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -214,7 +214,8 @@ class TTrain {
|
|||||||
void update_sounds_runningnoise( sound_source &Sound );
|
void update_sounds_runningnoise( sound_source &Sound );
|
||||||
void update_sounds_resonancenoise( sound_source &Sound );
|
void update_sounds_resonancenoise( sound_source &Sound );
|
||||||
void update_sounds_radio();
|
void update_sounds_radio();
|
||||||
end cab_to_end( int const End ) const {
|
static end cab_to_end( int const End )
|
||||||
|
{
|
||||||
return End == 2 ? rear : front; }
|
return End == 2 ? rear : front; }
|
||||||
end cab_to_end() const {
|
end cab_to_end() const {
|
||||||
return cab_to_end( iCabn ); }
|
return cab_to_end( iCabn ); }
|
||||||
|
|||||||
@@ -123,9 +123,9 @@ class map_panel : public ui_panel
|
|||||||
float zoom = 1.0f / 1000.0f;
|
float zoom = 1.0f / 1000.0f;
|
||||||
enum { MODE_MANUAL = 0, MODE_CAMERA, MODE_VEHICLE } mode = MODE_MANUAL;
|
enum { MODE_MANUAL = 0, MODE_CAMERA, MODE_VEHICLE } mode = MODE_MANUAL;
|
||||||
|
|
||||||
float get_vehicle_rotation();
|
static float get_vehicle_rotation();
|
||||||
void render_map_texture(glm::mat4 transform, glm::vec2 surface_size);
|
void render_map_texture(glm::mat4 transform, glm::vec2 surface_size);
|
||||||
void render_labels(glm::mat4 transform, ImVec2 origin, glm::vec2 surface_size);
|
static void render_labels(glm::mat4 transform, ImVec2 origin, glm::vec2 surface_size);
|
||||||
|
|
||||||
bool init_done = false;
|
bool init_done = false;
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class vehicleparams_panel : public ui_panel
|
|||||||
command_relay m_relay;
|
command_relay m_relay;
|
||||||
texture_handle vehicle_mini;
|
texture_handle vehicle_mini;
|
||||||
|
|
||||||
void draw_infobutton(const char *str, ImVec2 pos = ImVec2(-1.0f, -1.0f), ImVec4 color = ImVec4(1.0f, 1.0f, 0.0f, 1.0f));
|
static void draw_infobutton(const char *str, ImVec2 pos = ImVec2(-1.0f, -1.0f), ImVec4 color = ImVec4(1.0f, 1.0f, 0.0f, 1.0f));
|
||||||
void draw_mini(const TMoverParameters &mover);
|
void draw_mini(const TMoverParameters &mover);
|
||||||
public:
|
public:
|
||||||
vehicleparams_panel(const std::string &vehicle);
|
vehicleparams_panel(const std::string &vehicle);
|
||||||
|
|||||||
@@ -829,7 +829,8 @@ putvalues_event::export_as_text_( std::ostream &Output ) const {
|
|||||||
|
|
||||||
//determines whether provided input should be passed to consist owner
|
//determines whether provided input should be passed to consist owner
|
||||||
bool
|
bool
|
||||||
putvalues_event::is_command_for_owner( input_data const &Input ) const {
|
putvalues_event::is_command_for_owner( input_data const &Input )
|
||||||
|
{
|
||||||
|
|
||||||
if (Input.data_text.starts_with("Load=") || Input.data_text.starts_with("UnLoad=")) {
|
if (Input.data_text.starts_with("Load=") || Input.data_text.starts_with("UnLoad=")) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -278,8 +278,8 @@ private:
|
|||||||
void run_() override;
|
void run_() override;
|
||||||
// export_as_text() subclass details
|
// export_as_text() subclass details
|
||||||
void export_as_text_( std::ostream &Output ) const override;
|
void export_as_text_( std::ostream &Output ) const override;
|
||||||
//determines whether provided input should be passed to consist owner
|
// determines whether provided input should be passed to consist owner
|
||||||
bool is_command_for_owner( input_data const &Input ) const;
|
static bool is_command_for_owner( input_data const &Input );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3594,7 +3594,8 @@ path_table::TrackBusyList() const {
|
|||||||
|
|
||||||
// legacy method, sends list of occupied path sections over network
|
// legacy method, sends list of occupied path sections over network
|
||||||
void
|
void
|
||||||
path_table::IsolatedBusyList() const {
|
path_table::IsolatedBusyList()
|
||||||
|
{
|
||||||
// wysłanie informacji o wszystkich odcinkach izolowanych
|
// wysłanie informacji o wszystkich odcinkach izolowanych
|
||||||
TIsolated *Current;
|
TIsolated *Current;
|
||||||
for( Current = TIsolated::Root(); Current; Current = Current->Next() ) {
|
for( Current = TIsolated::Root(); Current; Current = Current->Next() ) {
|
||||||
@@ -3607,7 +3608,8 @@ path_table::IsolatedBusyList() const {
|
|||||||
|
|
||||||
// legacy method, sends state of specified path section over network
|
// legacy method, sends state of specified path section over network
|
||||||
void
|
void
|
||||||
path_table::IsolatedBusy( std::string const &Name ) const {
|
path_table::IsolatedBusy( std::string const &Name )
|
||||||
|
{
|
||||||
// wysłanie informacji o odcinku izolowanym (t)
|
// wysłanie informacji o odcinku izolowanym (t)
|
||||||
// Ra 2014-06: do wyszukania użyć drzewka nazw
|
// Ra 2014-06: do wyszukania użyć drzewka nazw
|
||||||
TIsolated *Current;
|
TIsolated *Current;
|
||||||
|
|||||||
@@ -274,8 +274,8 @@ public:
|
|||||||
void Load(cParser *parser, glm::dvec3 const &pOrigin);
|
void Load(cParser *parser, glm::dvec3 const &pOrigin);
|
||||||
bool AssignEvents();
|
bool AssignEvents();
|
||||||
bool AssignForcedEvents(basic_event *NewEventPlus, basic_event *NewEventMinus);
|
bool AssignForcedEvents(basic_event *NewEventPlus, basic_event *NewEventMinus);
|
||||||
void QueueEvents( event_sequence const &Events, TDynamicObject const *Owner );
|
static void QueueEvents( event_sequence const &Events, TDynamicObject const *Owner );
|
||||||
void QueueEvents( event_sequence const &Events, TDynamicObject const *Owner, double Delaylimit );
|
static void QueueEvents( event_sequence const &Events, TDynamicObject const *Owner, double Delaylimit );
|
||||||
bool CheckDynamicObject(TDynamicObject *Dynamic);
|
bool CheckDynamicObject(TDynamicObject *Dynamic);
|
||||||
bool AddDynamicObject(TDynamicObject *Dynamic);
|
bool AddDynamicObject(TDynamicObject *Dynamic);
|
||||||
bool RemoveDynamicObject(TDynamicObject *Dynamic);
|
bool RemoveDynamicObject(TDynamicObject *Dynamic);
|
||||||
@@ -381,11 +381,11 @@ public:
|
|||||||
void
|
void
|
||||||
TrackBusyList() const;
|
TrackBusyList() const;
|
||||||
// legacy method, sends list of occupied path sections over network
|
// legacy method, sends list of occupied path sections over network
|
||||||
void
|
static void
|
||||||
IsolatedBusyList() const;
|
IsolatedBusyList();
|
||||||
// legacy method, sends state of specified path section over network
|
// legacy method, sends state of specified path section over network
|
||||||
void
|
static void
|
||||||
IsolatedBusy( std::string const &Name ) const;
|
IsolatedBusy( std::string const &Name );
|
||||||
};
|
};
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ class basic_station {
|
|||||||
public:
|
public:
|
||||||
// methods
|
// methods
|
||||||
// exchanges load with consist attached to specified vehicle, operating on specified schedule; returns: time needed for exchange, in seconds
|
// exchanges load with consist attached to specified vehicle, operating on specified schedule; returns: time needed for exchange, in seconds
|
||||||
double
|
static double
|
||||||
update_load( TDynamicObject *First, Mtable::TTrainParameters &Schedule, int Platform );
|
update_load( TDynamicObject *First, Mtable::TTrainParameters &Schedule, int Platform );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user