Carna Version 3.3.3
Loading...
Searching...
No Matches
SpatialMovement.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2010 - 2015 Leonid Kostrykin
3 *
4 * Chair of Medical Engineering (mediTEC)
5 * RWTH Aachen University
6 * Pauwelsstr. 20
7 * 52074 Aachen
8 * Germany
9 *
10 */
11
12#ifndef SPATIALMOVEMENT_H_6014714286
13#define SPATIALMOVEMENT_H_6014714286
14
15#include <Carna/Carna.h>
17#include <Carna/base/math.h>
18#include <memory>
19
24namespace Carna
25{
26
27namespace base
28{
29
30
31
32// ----------------------------------------------------------------------------------
33// SpatialMovement
34// ----------------------------------------------------------------------------------
35
52class CARNA_LIB SpatialMovement
53{
54
56
57 struct Details;
58 const std::unique_ptr< Details > pimpl;
59
60public:
61
63
86 ( Spatial& movedSpatial
87 , unsigned int frameX, unsigned int frameY
88 , const Viewport& vp
89 , const Camera& cam );
90
95
101
105 const Camera& cam;
106
112
127 bool update( unsigned int frameX, unsigned int frameY );
128
135 bool hasMovedSpatial() const;
136
143
144}; // SpatialMovement
145
146
147
148} // namespace Carna :: base
149
150} // namespace Carna
151
152#endif // SPATIALMOVEMENT_H_6014714286
Represents an association.
Definition Association.h:45
Represents the point-of-view and defines the 3D to 2D projection.
Definition Camera.h:40
Handles the displacement of a Spatial object in a drag-&-drop like manner.
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...
bool hasMovedSpatial() const
Tells true if the spatial given to the constructor is movable. Tells also true if it is not movable,...
const math::Matrix4f inverseProjection
Holds the inverse of the projection matrix that the frame was rendered with.
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 Viewport & viewport
References the root viewport that the frame was rendered with.
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.h:45
Defines a rendering viewport. The viewport is a property of the current OpenGL context.
Definition Viewport.h:49
Defines Carna::base::math namespace and CARNA_FOR_VECTOR3UI.
Eigen::Matrix< float, 4, 4, Eigen::ColMajor > Matrix4f
Defines matrix.
Definition math.h:193
#define NON_COPYABLE
Features class it is placed in as non-copyable.