LibCarna Version 3.4.0
Loading...
Searching...
No Matches
SpatialMovement.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2010 - 2016 Leonid Kostrykin
3 *
4 * Chair of Medical Engineering (mediTEC)
5 * RWTH Aachen University
6 * Pauwelsstr. 20
7 * 52074 Aachen
8 * Germany
9 *
10 *
11 * Copyright (C) 2021 - 2025 Leonid Kostrykin
12 *
13 */
14
15#ifndef SPATIALMOVEMENT_H_6014714286
16#define SPATIALMOVEMENT_H_6014714286
17
18#include <LibCarna/LibCarna.hpp>
21#include <memory>
22
28namespace LibCarna
29{
30
31namespace base
32{
33
34
35
36// ----------------------------------------------------------------------------------
37// SpatialMovement
38// ----------------------------------------------------------------------------------
39
55class LIBCARNA SpatialMovement
56{
57
59
60 struct Details;
61 const std::unique_ptr< Details > pimpl;
62
63public:
64
66
89 ( Spatial& movedSpatial
90 , unsigned int frameX, unsigned int frameY
91 , const Viewport& vp
92 , const Camera& cam );
93
98
104
108 const Camera& cam;
109
115
130 bool update( unsigned int frameX, unsigned int frameY );
131
138 bool hasMovedSpatial() const;
139
146
147}; // SpatialMovement
148
149
150
151} // namespace LibCarna :: base
152
153} // namespace LibCarna
154
155#endif // SPATIALMOVEMENT_H_6014714286
Contains forward-declarations.
Represents an association.
Represents the point-of-view and defines the 3D to 2D projection.
Definition Camera.hpp:43
Handles the displacement of a Spatial object in a drag-&-drop like manner.
bool hasMovedSpatial() const
Tells true if the spatial given to the constructor is movable. Tells also true if it is not movable,...
Spatial & movedSpatial() const
References the actually moved spatial.
SpatialMovement(Spatial &movedSpatial, unsigned int frameX, unsigned int frameY, const Viewport &vp, const Camera &cam)
Starts the spatial movement. This corresponds to "picking up" the spatial.
const math::Matrix4f inverseProjection
Holds the inverse of the projection matrix that the frame was rendered with.
const Viewport & viewport
References the root viewport that the frame was rendered with.
bool update(unsigned int frameX, unsigned int frameY)
Updates the moved spatial object's location. Returns true if and only if the object's location change...
const Camera & cam
References the camera that the frame was rendered with.
Represents a spatial scene element. It's location is determined relatively to another spatial that is...
Definition Spatial.hpp:48
Defines a rendering viewport. The viewport is a property of the current OpenGL context.
Definition Viewport.hpp:52
Defines LibCarna::base::math namespace and LIBCARNA_FOR_VECTOR3UI.
Eigen::Matrix< float, 4, 4, Eigen::ColMajor > Matrix4f
Defines matrix.
Definition math.hpp:197
Defines LibCarna::base::noncopyable and NON_COPYABLE.
#define NON_COPYABLE
Marks the class that it is placed in as non-copyable.