Loading [MathJax]/extensions/TeX/AMSmath.js
Radium Engine  1.5.26
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
VolumeObject.hpp
1#pragma once
2
3#include <Core/Geometry/AbstractGeometry.hpp>
4#include <Core/Types.hpp>
5#include <Engine/Data/DisplayableObject.hpp>
6#include <Engine/Data/Mesh.hpp>
7#include <Engine/Data/Texture.hpp>
8#include <Engine/RaEngine.hpp>
9#include <memory>
10#include <string>
11
12namespace Ra {
13namespace Engine {
14namespace Data {
15class ShaderProgram;
16} // namespace Data
17} // namespace Engine
18
19namespace Core {
20namespace Geometry {
21class AbstractVolume;
22} // namespace Geometry
23} // namespace Core
24namespace Engine {
25namespace Data {
32class RA_ENGINE_API VolumeObject : public Displayable
33{
34
35 public:
36 explicit VolumeObject( const std::string& name );
37 VolumeObject( const VolumeObject& rhs ) = delete;
38 void operator=( const VolumeObject& rhs ) = delete;
39
40 ~VolumeObject() override;
41
42 using Displayable::getName;
43
46 inline const Core::Geometry::AbstractGeometry& getAbstractGeometry() const override;
47 inline Core::Geometry::AbstractGeometry& getAbstractGeometry() override;
48
50 inline const Core::Geometry::AbstractVolume& getVolume() const;
51 inline Core::Geometry::AbstractVolume& getVolume();
52
54 void loadGeometry( Core::Geometry::AbstractVolume* volume );
55
58 void loadGeometry( Core::Geometry::AbstractVolume* volume, const Core::Aabb& aabb );
59
61 inline void setDirty() { m_isDirty = true; }
62
64 const Texture& getDataTexture() { return m_tex; }
65
70 void updateGL() override;
71
73 void render( const ShaderProgram* prog ) override;
74
76 size_t getNumFaces() const override { return 12; }
78 inline size_t getNumVertices() const override { return 8; }
79
80 private:
82 Texture m_tex { {} };
84 Mesh m_mesh;
85
87 bool m_isDirty { false };
88};
89
91 CORE_ASSERT( m_volume, "Volume is not initialized" );
92 return *(Core::Geometry::AbstractGeometry*)( m_volume.get() );
93}
94
96 CORE_ASSERT( m_volume, "Volume is not initialized" );
97 return *(Core::Geometry::AbstractGeometry*)( m_volume.get() );
98}
99
102 CORE_ASSERT( m_volume, "Volume is not initialized" );
103 return *m_volume.get();
104}
105
107 CORE_ASSERT( m_volume, "Volume is not initialized" );
108 return *m_volume.get();
109}
110
111} // namespace Data
112} // namespace Engine
113} // namespace Ra
Represent a Texture of the engine.
Definition Texture.hpp:120
const Texture & getDataTexture()
get read access to the 3d texture storing the data
const Core::Geometry::AbstractGeometry & getAbstractGeometry() const override
const Core::Geometry::AbstractVolume & getVolume() const
Returns the underlying AbstractVolume.
void setDirty()
Mark the data types as dirty, forcing an update of the openGL buffer.
size_t getNumFaces() const override
6 quad faces of the cube, thus 12 triangles.
size_t getNumVertices() const override
8 vertices of the cube
@ Geometry
"Geometry" render objects are those loaded using Radium::IO and generated by GeometrySystem
hepler function to manage enum as underlying types in VariableSet
Definition Cage.cpp:4