mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-06 01:12:26 +01:00
refactor(editor): split the track mode into its gizmo, kept records, switch drive, switch slide and track bed files; path geometry shared in editorGeometry instead of four copies of the reversed path, track shape rules (stretching, rolls at joints, middle, switch axis, drive spot) in editor_track, fitting the track to the ground in ground_follow with the terrain query passed in, the record layer and the switch classification in the stores; long gizmo, record watch and switch slide functions broken up, out-parameters replaced by optional results
This commit is contained in:
47
editor/editorGroundFollow.hpp
Normal file
47
editor/editorGroundFollow.hpp
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
This Source Code Form is subject to the
|
||||
terms of the Mozilla Public License, v.
|
||||
2.0. If a copy of the MPL was not
|
||||
distributed with this file, You can
|
||||
obtain one at
|
||||
http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
#include <vector>
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
#include "world/Segment.h"
|
||||
|
||||
namespace ground_follow
|
||||
{
|
||||
|
||||
using bed_query = std::function<std::vector<double>(std::vector<glm::dvec3> const &, std::vector<glm::dvec2> const &)>;
|
||||
|
||||
struct ends
|
||||
{
|
||||
double height0{0.0};
|
||||
double grade0{0.0};
|
||||
double height1{0.0};
|
||||
double grade1{0.0};
|
||||
};
|
||||
|
||||
struct knot_line
|
||||
{
|
||||
std::vector<double> knots;
|
||||
std::vector<double> heights;
|
||||
std::vector<double> slopes;
|
||||
double grade0{0.0};
|
||||
double grade1{0.0};
|
||||
|
||||
void refresh();
|
||||
void insert(double const Chainage, double const Height);
|
||||
double at(double const Chainage, double &Grade) const;
|
||||
bool room(double const Chainage, double const Spacing) const;
|
||||
};
|
||||
|
||||
void follow(std::vector<segment_data> &Pieces, ends const &Ends, bed_query const &Bed);
|
||||
|
||||
} // namespace ground_follow
|
||||
Reference in New Issue
Block a user