Radium Engine
1.5.20
Loading...
Searching...
No Matches
VolumeObject.hpp
1
#pragma once
2
3
#include <Engine/Data/DisplayableObject.hpp>
4
#include <Engine/Data/Mesh.hpp>
5
#include <Engine/Data/Texture.hpp>
6
#include <Engine/RaEngine.hpp>
7
8
namespace
Ra
{
9
namespace
Core {
10
namespace
Geometry
{
11
class
AbstractVolume;
12
}
// namespace Geometry
13
}
// namespace Core
14
namespace
Engine {
15
namespace
Data {
22
class
RA_ENGINE_API
VolumeObject
:
public
Displayable
23
{
24
25
public
:
26
explicit
VolumeObject
(
const
std::string
& name );
27
VolumeObject
(
const
VolumeObject
& rhs ) =
delete
;
28
void
operator=(
const
VolumeObject
& rhs ) =
delete
;
29
30
~VolumeObject
()
override
;
31
32
using
Displayable::getName;
33
36
inline
const
Core::Geometry::AbstractGeometry
& getAbstractGeometry()
const override
;
37
inline
Core::Geometry::AbstractGeometry
& getAbstractGeometry()
override
;
38
40
inline
const
Core::Geometry::AbstractVolume
& getVolume()
const
;
41
inline
Core::Geometry::AbstractVolume
& getVolume();
42
44
void
loadGeometry(
Core::Geometry::AbstractVolume
* volume );
45
48
void
loadGeometry(
Core::Geometry::AbstractVolume
* volume,
const
Core::Aabb& aabb );
49
51
inline
void
setDirty
() { m_isDirty =
true
; }
52
54
const
Texture
&
getDataTexture
() {
return
m_tex; }
55
60
void
updateGL()
override
;
61
63
void
render(
const
ShaderProgram
* prog )
override
;
64
66
size_t
getNumFaces
()
const override
{
return
12; }
68
inline
size_t
getNumVertices
()
const override
{
return
8; }
69
70
private
:
71
std::unique_ptr<Core::Geometry::AbstractVolume>
m_volume;
72
Texture
m_tex { {} };
74
Mesh m_mesh;
75
77
bool
m_isDirty {
false
};
78
};
79
80
const
Core::Geometry::AbstractGeometry
&
VolumeObject::getAbstractGeometry
()
const
{
81
CORE_ASSERT( m_volume,
"Volume is not initialized"
);
82
return
*(
Core::Geometry::AbstractGeometry
*)( m_volume.get() );
83
}
84
85
Core::Geometry::AbstractGeometry
&
VolumeObject::getAbstractGeometry
() {
86
CORE_ASSERT( m_volume,
"Volume is not initialized"
);
87
return
*(
Core::Geometry::AbstractGeometry
*)( m_volume.get() );
88
}
89
91
const
Core::Geometry::AbstractVolume
&
VolumeObject::getVolume
()
const
{
92
CORE_ASSERT( m_volume,
"Volume is not initialized"
);
93
return
*m_volume.get();
94
}
95
96
Core::Geometry::AbstractVolume
&
VolumeObject::getVolume
() {
97
CORE_ASSERT( m_volume,
"Volume is not initialized"
);
98
return
*m_volume.get();
99
}
100
101
}
// namespace Data
102
}
// namespace Engine
103
}
// namespace Ra
std::string
Ra::Core::Geometry::AbstractVolume
Definition
Volume.hpp:31
Ra::Engine::Data::Displayable
Definition
DisplayableObject.hpp:22
Ra::Engine::Data::ShaderProgram
Definition
ShaderProgram.hpp:35
Ra::Engine::Data::Texture
Represent a Texture of the engine.
Definition
Texture.hpp:120
Ra::Engine::Data::VolumeObject
Definition
VolumeObject.hpp:23
Ra::Engine::Data::VolumeObject::getDataTexture
const Texture & getDataTexture()
get read access to the 3d texture storing the data
Definition
VolumeObject.hpp:54
Ra::Engine::Data::VolumeObject::getAbstractGeometry
const Core::Geometry::AbstractGeometry & getAbstractGeometry() const override
Definition
VolumeObject.hpp:80
Ra::Engine::Data::VolumeObject::getVolume
const Core::Geometry::AbstractVolume & getVolume() const
Returns the underlying AbstractVolume.
Definition
VolumeObject.hpp:91
Ra::Engine::Data::VolumeObject::setDirty
void setDirty()
Mark the data types as dirty, forcing an update of the openGL buffer.
Definition
VolumeObject.hpp:51
Ra::Engine::Data::VolumeObject::getNumFaces
size_t getNumFaces() const override
6 quad faces of the cube, thus 12 triangles.
Definition
VolumeObject.hpp:66
Ra::Engine::Data::VolumeObject::getNumVertices
size_t getNumVertices() const override
8 vertices of the cube
Definition
VolumeObject.hpp:68
Ra::Engine::Rendering::RenderObjectType::Geometry
@ Geometry
"Geometry" render objects are those loaded using Radium::IO and generated by GeometrySystem
Ra
hepler function to manage enum as underlying types in VariableSet
Definition
Cage.cpp:3
Ra::Core::Geometry::AbstractGeometry
Definition
AbstractGeometry.hpp:17
std::unique_ptr
src
Engine
Data
VolumeObject.hpp
Generated by
1.12.0