gramods
Classes | Public Member Functions | Static Public Attributes | List of all members
gramods::gmGraphics::ObjRenderer Class Reference

A renderer that draws an obj file. More...

#include <ObjRenderer.hh>

Inheritance diagram for gramods::gmGraphics::ObjRenderer:
Inheritance graph
[legend]
Collaboration diagram for gramods::gmGraphics::ObjRenderer:
Collaboration graph
[legend]

Classes

struct  Impl
 
struct  Material
 Data struct for material data used in the obj file rendering. More...
 

Public Member Functions

void initialize () override
 Called to initialize the Object. More...
 
void render (const Camera &camera, const Eigen::Affine3f &Mm) override
 Performs rendering of 3D objects in the scene. More...
 
void getNearFar (const Camera &camera, const Eigen::Affine3f &Mm, float &near, float &far) override
 Extracts the currently optimal near and far plane distances. More...
 
void setFile (std::filesystem::path file)
 Set the obj file to render. More...
 
void setRecenter (bool on)
 Set to true if the model should be recentered after loading. More...
 
std::vector< MaterialgetMaterials () const
 Returns the currently loaded materials. More...
 
void setMaterials (const std::vector< Material > &materials)
 Sets the materials to use. More...
 
std::vector< float > getIntersections (const IntersectionLine &line) override
 Check and return intersections between the provided line and the shape represented by this node. More...
 
- Public Member Functions inherited from gramods::gmGraphics::Renderer
void addEye (Eye e)
 Add an eye to render to. More...
 
- Public Member Functions inherited from gramods::gmGraphics::Node
virtual std::string getDefaultKey () override
 Returns the default key, in Configuration, for the Object. More...
 
- Public Member Functions inherited from gramods::gmCore::Object
 Object ()
 Initializes internal data. More...
 
virtual ~Object ()
 Cleaning up internal data. More...
 
virtual void accept (Visitor *visitor)
 Calls the visitors apply method with this as argument. More...
 
virtual void traverse (Visitor *visitor)
 Calls the child Object's accept method, if such exist. More...
 
bool isInitialized ()
 Returns true if the Object is initialized. More...
 

Static Public Attributes

static gramods::gmCore::OFactory::OFactoryInformation _gm_ofi
 
- Static Public Attributes inherited from gramods::gmGraphics::Renderer
static gramods::gmCore::OFactory::OFactoryInformation _gm_ofi
 

Additional Inherited Members

- Public Types inherited from gramods::gmGraphics::Node
typedef std::vector< std::shared_ptr< Node > > list
 
- Protected Attributes inherited from gramods::gmGraphics::Renderer
std::set< Eyeeyes
 Eyes to render. More...
 

Detailed Description

A renderer that draws an obj file.

Member Function Documentation

◆ getIntersections()

std::vector< float > gramods::gmGraphics::ObjRenderer::getIntersections ( const IntersectionLine line)
overridevirtual

Check and return intersections between the provided line and the shape represented by this node.

Reimplemented from gramods::gmGraphics::Node.

◆ getMaterials()

std::vector< ObjRenderer::Material > gramods::gmGraphics::ObjRenderer::getMaterials ( ) const

Returns the currently loaded materials.

◆ getNearFar()

void gramods::gmGraphics::ObjRenderer::getNearFar ( const Camera camera,
const Eigen::Affine3f &  Mm,
float &  near,
float &  far 
)
overridevirtual

Extracts the currently optimal near and far plane distances.

This is typically used by a View if there are multiple renderers that need to be rendered with the same near and far planes for correct depth testing.

Implements gramods::gmGraphics::Renderer.

◆ initialize()

void gramods::gmGraphics::ObjRenderer::initialize ( )
overridevirtual

Called to initialize the Object.

This should be called once only!

Reimplemented from gramods::gmCore::Object.

◆ render()

void gramods::gmGraphics::ObjRenderer::render ( const Camera camera,
const Eigen::Affine3f &  Mm 
)
overridevirtual

Performs rendering of 3D objects in the scene.

Implements gramods::gmGraphics::Renderer.

◆ setFile()

void gramods::gmGraphics::ObjRenderer::setFile ( std::filesystem::path  file)

Set the obj file to render.

XML-attribute: file

◆ setMaterials()

void gramods::gmGraphics::ObjRenderer::setMaterials ( const std::vector< Material > &  materials)

Sets the materials to use.

The specified list must have the same length as the loaded material list.

◆ setRecenter()

void gramods::gmGraphics::ObjRenderer::setRecenter ( bool  on)

Set to true if the model should be recentered after loading.

Default is false.

XML-attribute: recenter


The documentation for this class was generated from the following files: