MEPP2 Project
Classes | Functions
MeshLoading.inl File Reference
#include "Visualization/Helpers/OSGDebug.hpp"
#include <osg/ShadeModel>
#include <osgUtil/Optimizer>
#include <memory>
#include "Visualization/SimpleWindow.h"
#include "FEVV/Types/Material.h"
Include dependency graph for MeshLoading.inl:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  CameraPosCallback
 
struct  CameraTargetCallback
 
struct  ModelMatrixCallback
 
struct  ViewMatrixCallback
 
struct  InverseViewMatrixCallback
 
struct  ProjectionMatrixCallback
 
struct  MVPMatrixCallback
 

Functions

std::string recoverBaseDirectory ()
 
osg::ref_ptr< osg::Texture2D > createDefaultTexture (uint8_t value=255)
 
void print_osg_img_info (const osg::Image &osgimg)
 
void print_cimg_info (const cimg_library::CImg< unsigned char > &cimg)
 
osg::Image * cimg_to_osgimg (const cimg_library::CImg< unsigned char > &cimg)
 
osg::ref_ptr< osg::Texture2D > createTexture (const std::string &filename, const FEVV::Types::Material &material)
 
void loadMaterialStandard (const osg::ref_ptr< osg::Geometry > &geometry, const FEVV::Types::Material &material)
 
void loadMaterialPBR (const osg::ref_ptr< osg::Geometry > &geometry, const FEVV::Types::Material &material)
 
template<typename VertexNormalMap , typename VertexTangentMap , typename FaceMaterialMap >
osg::ref_ptr< osg::Program > loadTexturedMesh (const std::vector< osg::ref_ptr< osg::Geometry > > &_geometries, const std::vector< osg::ref_ptr< osg::Vec3Array > > &, const std::vector< osg::ref_ptr< osg::Vec3Array > > &, const std::vector< osg::ref_ptr< osg::Vec3Array > > &_tangentsArrays, const std::vector< osg::ref_ptr< osg::Vec2Array > > &_texcoordsArrays, bool _useSmoothShading, VertexNormalMap *, VertexTangentMap *_vt_tm, FaceMaterialMap *_m_mm, std::size_t unit_ii)
 
template<typename VertexNormalMap , typename VertexColorMap >
osg::ref_ptr< osg::Program > loadColoredMesh (const std::vector< osg::ref_ptr< osg::Geometry > > &_geometries, const std::vector< osg::ref_ptr< osg::Vec3Array > > &, const std::vector< osg::ref_ptr< osg::Vec3Array > > &, const std::vector< osg::ref_ptr< osg::Vec4Array > > &_colorsArrays, VertexNormalMap *, VertexColorMap *_vt_cm, std::size_t unit_ii)
 

Function Documentation

◆ cimg_to_osgimg()

osg::Image* cimg_to_osgimg ( const cimg_library::CImg< unsigned char > &  cimg)
inline

Convert a CImg image into an OSG image. The caller must release memory after use.

Definition at line 240 of file MeshLoading.inl.

Here is the caller graph for this function:

◆ createDefaultTexture()

osg::ref_ptr< osg::Texture2D > createDefaultTexture ( uint8_t  value = 255)
inline

Definition at line 139 of file MeshLoading.inl.

Here is the caller graph for this function:

◆ createTexture()

osg::ref_ptr< osg::Texture2D > createTexture ( const std::string &  filename,
const FEVV::Types::Material material 
)
inline

Definition at line 319 of file MeshLoading.inl.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadColoredMesh()

template<typename VertexNormalMap , typename VertexColorMap >
osg::ref_ptr< osg::Program > loadColoredMesh ( const std::vector< osg::ref_ptr< osg::Geometry > > &  _geometries,
const std::vector< osg::ref_ptr< osg::Vec3Array > > &  ,
const std::vector< osg::ref_ptr< osg::Vec3Array > > &  ,
const std::vector< osg::ref_ptr< osg::Vec4Array > > &  _colorsArrays,
VertexNormalMap *  ,
VertexColorMap *  _vt_cm,
std::size_t  unit_ii 
)
inline

Definition at line 568 of file MeshLoading.inl.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadMaterialPBR()

void loadMaterialPBR ( const osg::ref_ptr< osg::Geometry > &  geometry,
const FEVV::Types::Material material 
)
inline

Definition at line 412 of file MeshLoading.inl.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadMaterialStandard()

void loadMaterialStandard ( const osg::ref_ptr< osg::Geometry > &  geometry,
const FEVV::Types::Material material 
)
inline

Definition at line 369 of file MeshLoading.inl.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadTexturedMesh()

template<typename VertexNormalMap , typename VertexTangentMap , typename FaceMaterialMap >
osg::ref_ptr< osg::Program > loadTexturedMesh ( const std::vector< osg::ref_ptr< osg::Geometry > > &  _geometries,
const std::vector< osg::ref_ptr< osg::Vec3Array > > &  ,
const std::vector< osg::ref_ptr< osg::Vec3Array > > &  ,
const std::vector< osg::ref_ptr< osg::Vec3Array > > &  _tangentsArrays,
const std::vector< osg::ref_ptr< osg::Vec2Array > > &  _texcoordsArrays,
bool  _useSmoothShading,
VertexNormalMap *  ,
VertexTangentMap *  _vt_tm,
FaceMaterialMap *  _m_mm,
std::size_t  unit_ii 
)
inline

Definition at line 458 of file MeshLoading.inl.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_cimg_info()

void print_cimg_info ( const cimg_library::CImg< unsigned char > &  cimg)
inline

Print information about a CImg image in the console.

Definition at line 203 of file MeshLoading.inl.

◆ print_osg_img_info()

void print_osg_img_info ( const osg::Image &  osgimg)
inline

Print information about an OSG image in the console.

Definition at line 164 of file MeshLoading.inl.

◆ recoverBaseDirectory()

std::string recoverBaseDirectory ( )
inline

Definition at line 122 of file MeshLoading.inl.

Here is the caller graph for this function: