Carna  Version 3.0.1
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>
16 #include <Carna/base/noncopyable.h>
17 #include <Carna/base/math.h>
18 #include <memory>
19 
24 namespace Carna
25 {
26 
27 namespace base
28 {
29 
30 
31 
32 // ----------------------------------------------------------------------------------
33 // SpatialMovement
34 // ----------------------------------------------------------------------------------
35 
52 class CARNA_LIB SpatialMovement
53 {
54 
56 
57  struct Details;
58  const std::unique_ptr< Details > pimpl;
59 
60 public:
61 
62  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
63 
86  ( Spatial& movedSpatial
87  , unsigned int frameX, unsigned int frameY
88  , const Viewport& vp
89  , const Camera& cam );
90 
94  ~SpatialMovement();
95 
101 
105  const Camera& cam;
106 
112 
127  bool update( unsigned int frameX, unsigned int frameY );
128 
135  bool hasMovedSpatial() const;
136 
142  Spatial& movedSpatial() const;
143 
144 }; // SpatialMovement
145 
146 
147 
148 } // namespace Carna :: base
149 
150 } // namespace Carna
151 
152 #endif // SPATIALMOVEMENT_H_6014714286
Defines Carna::base::math namespace and CARNA_FOR_VECTOR3UI.
Handles the displacement of a Spatial object in a drag-&-drop like manner.
Represents a spatial scene element. It's location is determined relatively to another spatial that is...
Definition: Spatial.h:44
const Camera & cam
References the camera that the frame was rendered with.
Eigen::Matrix< float, 4, 4, Eigen::ColMajor > Matrix4f
Defines matrix.
Definition: math.h:193
Defines a rendering viewport. The viewport is a property of the current OpenGL context.
Definition: Viewport.h:48
Represents the point-of-view and defines the 3D to 2D projection.
Definition: Camera.h:39
#define NON_COPYABLE
Features class it is placed in as non-copyable.
Definition: noncopyable.h:109
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.