17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 08:39:19 +02:00
Files
maszyna/scene/sceneeditor.cppm
maj00r b8f040e6fd propagate template headers transitively, import Console where used
AnimModel.cpp reaches cParser through the simulation core, not a direct
import, so the previous pass missed it; the propagation now follows the
whole import closure. Train.cpp, drivermode.cpp and Globals.cpp call
Console:: inside _WIN32 guards without importing eu07.console - invisible
on Linux, where those blocks are skipped.
2026-09-10 01:41:24 +02:00

84 lines
2.2 KiB
C++

/*
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/.
*/
module;
#include <array>
#include <chrono>
#include <cstddef>
#include <deque>
#include <limits>
#include <mutex>
#include <ostream>
#include <sstream>
#include <type_traits>
#include <unordered_map>
#include <utility>
#include <vector>
#include <string>
export module eu07.scene.sceneeditor;
import eu07.glm;
import eu07.simcore;
export {
namespace scene {
// TODO: move the snapshot to history stack
struct node_snapshot {
scene::basic_node *node;
std::string data;
node_snapshot( scene::basic_node *Node ) :
node( Node ) {
if( Node != nullptr ) {
Node->export_as_text( data ); } };
};
inline bool operator==( node_snapshot const &Left, node_snapshot const &Right ) { return Left.node == Right.node && Left.data == Right.data; }
inline bool operator!=( node_snapshot const &Left, node_snapshot const &Right ) { return !(Left == Right); }
class basic_editor {
public:
// methods
void
translate( scene::basic_node *Node, glm::dvec3 const &Location, bool const Snaptoground );
void
translate( scene::basic_node *Node, float const Offset );
void
rotate( scene::basic_node *Node, glm::vec3 const &Angle, float const Quantization );
private:
// methods
void
translate_node( scene::basic_node *Node, glm::dvec3 const &Location );
void
translate_node( scene::basic_node *Node, float const Offset );
void
translate_instance( TAnimModel *Instance, glm::dvec3 const &Location );
void
translate_instance( TAnimModel *Instance, float const Offset );
void
translate_memorycell( TMemCell *Memorycell, glm::dvec3 const &Location );
void
translate_memorycell( TMemCell *Memorycell, float const Offset );
void
rotate_node( scene::basic_node *Node, glm::vec3 const &Angle );
void
rotate_instance( TAnimModel *Instance, glm::vec3 const &Angle );
};
} // scene
//---------------------------------------------------------------------------
} // export