Radium Engine  1.5.0
DisplayableObject.hpp
1 #pragma once
2 #include <Engine/RaEngine.hpp>
3 
4 #include <array>
5 #include <map>
6 #include <vector>
7 
8 #include <Core/Containers/VectorArray.hpp>
9 #include <Core/Geometry/TriangleMesh.hpp>
10 #include <Core/Utils/Color.hpp>
11 
12 namespace Ra {
13 namespace Engine {
14 namespace Data {
15 
16 class ShaderProgram;
17 
21 class RA_ENGINE_API Displayable
22 {
23  public:
24  enum PickingRenderMode {
25  PKM_POINTS = 0,
26  PKM_LINES = 1,
27  PKM_LINE_ADJ = 2,
28  PKM_TRI = 3,
29  NO_PICKING
30  };
31 
32  inline Displayable( const std::string& name ) : m_name( name ) {}
33  Displayable( const Displayable& rhs ) = delete;
34  void operator=( const Displayable& rhs ) = delete;
35 
36  virtual ~Displayable() = default;
37 
39  inline PickingRenderMode pickingRenderMode() const { return m_pickingRenderMode; }
40 
42  inline const std::string& getName() const { return m_name; }
43 
48  virtual Core::Geometry::AbstractGeometry& getAbstractGeometry() = 0;
49 
54  virtual void updateGL() = 0;
55 
58  virtual void render( const ShaderProgram* prog ) = 0;
59 
61  virtual size_t getNumFaces() const { return 0; }
62  virtual size_t getNumVertices() const { return 0; }
63 
64  protected:
65  PickingRenderMode m_pickingRenderMode { NO_PICKING };
66 
67  private:
68  std::string m_name {};
69 };
70 
71 } // namespace Data
72 } // namespace Engine
73 } // namespace Ra
virtual void render(const ShaderProgram *prog)=0
const std::string & getName() const
Returns the name of the mesh.
PickingRenderMode pickingRenderMode() const
Returns the picking rendermode advised by the object (default PickingRenderMode::NO_PICKING)
virtual const Core::Geometry::AbstractGeometry & getAbstractGeometry() const =0
Definition: Cage.cpp:3