Visualization Library 2.1.0

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
vl::DaeLoader Class Reference

COLLADA loader. More...

#include <DaeLoader.hpp>

Public Member Functions

 DaeLoader ()
 
bool load (VirtualFile *file)
 
const ResourceDatabaseresources () const
 
ResourceDatabaseresources ()
 
void setLoadOptions (const LoadWriterDae::LoadOptions *options)
 
const LoadWriterDae::LoadOptionsloadOptions () const
 

Protected Member Functions

void reset ()
 
void parseInputs (Dae::Primitive *dae_primitive, const domInputLocalOffset_Array &input_arr, const std::vector< ref< Dae::Input > > &vertex_inputs)
 
ref< Dae::MeshparseGeometry (daeElement *geometry)
 
Dae::SourcegetSource (daeElement *source_el)
 
void bindMaterials (Dae::Node *dae_node, Dae::Mesh *dae_mesh, domBind_materialRef bind_material)
 
void parseNode (daeElement *el, Dae::Node *parent)
 
void parseAsset (domElement *root)
 
void loadImages (const domImage_Array &images)
 
void parseImages (daeElement *library)
 
void parseEffects (daeElement *library)
 
void prepareTexture2D (Dae::Sampler2D *sampler2D)
 
void parseMaterials (daeElement *library)
 
ref< LightparseLight (domLight *, Transform *)
 
void setupLights ()
 
ref< Effectsetup_vl_Effect (Dae::Material *mat)
 
template<class T_color_or_texture >
void parseColor (const domProfile_COMMON *common, const T_color_or_texture &color_or_texture, Dae::ColorOrTexture *out_col)
 
void generateGeometry (Dae::Primitive *primitive, const char *name)
 

Static Protected Member Functions

static std::string percentDecode (const char *uri)
 
static Dae::EInputSemantic getSemantic (const char *semantic)
 
static const char * getSemanticString (Dae::EInputSemantic semantic)
 
static ETexParamFilter translateSampleFilter (domFx_sampler_filter_common filter)
 
static ETexParamWrap translateWrapMode (domFx_sampler_wrap_common wrap)
 

Protected Attributes

const LoadWriterDae::LoadOptionsmLoadOptions
 
ref< ResourceDatabasemResources
 
std::vector< ref< Light > > mLights
 
std::map< daeElementRef, ref< Dae::Material > > mMaterials
 
std::map< daeElementRef, ref< Dae::Effect > > mEffects
 
std::map< daeElementRef, ref< Dae::Mesh > > mMeshes
 
std::vector< ref< Dae::Node > > mNodes
 
std::map< daeElementRef, ref< Dae::Source > > mSources
 
std::map< daeElementRef, ref< Image > > mImages
 
std::map< daeElementRef, ref< Dae::NewParam > > mDaeNewParams
 
ref< EffectmDefaultFX
 
ref< Dae::NodemScene
 
DAE mDAE
 
String mFilePath
 
mat4 mUpMatrix
 
bool mInvertTransparency
 
bool mAssumeOpaque
 

Detailed Description

COLLADA loader.

Definition at line 41 of file DaeLoader.hpp.

Constructor & Destructor Documentation

◆ DaeLoader()

DaeLoader::DaeLoader ( )

Definition at line 77 of file DaeLoader.cpp.

References vl::EN_LIGHTING, mDefaultFX, vl::PM_LINE, and reset().

Member Function Documentation

◆ bindMaterials()

void DaeLoader::bindMaterials ( Dae::Node dae_node,
Dae::Mesh dae_mesh,
domBind_materialRef  bind_material 
)
protected

◆ generateGeometry()

void DaeLoader::generateGeometry ( Dae::Primitive primitive,
const char *  name 
)
protected

◆ getSemantic()

Dae::EInputSemantic DaeLoader::getSemantic ( const char *  semantic)
staticprotected

Definition at line 1526 of file DaeLoader.cpp.

References vl::Dae::IS_UNKNOWN.

Referenced by loadOptions(), parseGeometry(), and parseInputs().

◆ getSemanticString()

const char * DaeLoader::getSemanticString ( Dae::EInputSemantic  semantic)
staticprotected

Definition at line 1537 of file DaeLoader.cpp.

References NULL.

Referenced by generateGeometry(), and loadOptions().

◆ getSource()

Dae::Source * DaeLoader::getSource ( daeElement *  source_el)
protected

◆ load()

bool DaeLoader::load ( VirtualFile file)

◆ loadImages()

void DaeLoader::loadImages ( const domImage_Array &  images)
protected

Definition at line 910 of file DaeLoader.cpp.

References vl::Log::error(), vl::loadImage(), mImages, and percentDecode().

Referenced by loadOptions(), parseEffects(), and parseImages().

◆ loadOptions()

const LoadWriterDae::LoadOptions* vl::DaeLoader::loadOptions ( ) const
inline

◆ parseAsset()

void DaeLoader::parseAsset ( domElement *  root)
protected

◆ parseColor()

template<class T_color_or_texture >
void DaeLoader::parseColor ( const domProfile_COMMON *  common,
const T_color_or_texture &  color_or_texture,
Dae::ColorOrTexture out_col 
)
protected

◆ parseEffects()

void DaeLoader::parseEffects ( daeElement *  library)
protected

◆ parseGeometry()

ref< Dae::Mesh > DaeLoader::parseGeometry ( daeElement *  geometry)
protected

◆ parseImages()

void DaeLoader::parseImages ( daeElement *  library)
protected

Definition at line 927 of file DaeLoader.cpp.

References loadImages().

Referenced by load(), and loadOptions().

◆ parseInputs()

void DaeLoader::parseInputs ( Dae::Primitive dae_primitive,
const domInputLocalOffset_Array &  input_arr,
const std::vector< ref< Dae::Input > > &  vertex_inputs 
)
protected

◆ parseLight()

ref< Light > DaeLoader::parseLight ( domLight *  dom_light,
Transform transform 
)
protected

◆ parseMaterials()

void DaeLoader::parseMaterials ( daeElement *  library)
protected

Definition at line 1293 of file DaeLoader.cpp.

References vl::Dae::Material::mDaeEffect, mEffects, mMaterials, and VL_LOG_DEBUG.

Referenced by load(), and loadOptions().

◆ parseNode()

void DaeLoader::parseNode ( daeElement *  el,
Dae::Node parent 
)
protected

◆ percentDecode()

std::string DaeLoader::percentDecode ( const char *  uri)
staticprotected

Definition at line 859 of file DaeLoader.cpp.

Referenced by loadImages(), and loadOptions().

◆ prepareTexture2D()

void DaeLoader::prepareTexture2D ( Dae::Sampler2D sampler2D)
protected

◆ reset()

void DaeLoader::reset ( )
protected

Definition at line 91 of file DaeLoader.cpp.

References mAssumeOpaque, mInvertTransparency, mResources, mScene, and NULL.

Referenced by DaeLoader(), load(), and loadOptions().

◆ resources() [1/2]

const ResourceDatabase* vl::DaeLoader::resources ( ) const
inline

Definition at line 48 of file DaeLoader.hpp.

References mResources.

Referenced by vl::LoadWriterDae::load().

◆ resources() [2/2]

ResourceDatabase* vl::DaeLoader::resources ( )
inline

Definition at line 50 of file DaeLoader.hpp.

References mResources.

◆ setLoadOptions()

void vl::DaeLoader::setLoadOptions ( const LoadWriterDae::LoadOptions options)
inline

Definition at line 54 of file DaeLoader.hpp.

References mLoadOptions.

Referenced by vl::LoadWriterDae::load().

◆ setup_vl_Effect()

ref< Effect > DaeLoader::setup_vl_Effect ( Dae::Material mat)
protected

◆ setupLights()

void DaeLoader::setupLights ( )
protected

◆ translateSampleFilter()

ETexParamFilter DaeLoader::translateSampleFilter ( domFx_sampler_filter_common  filter)
staticprotected

◆ translateWrapMode()

ETexParamWrap DaeLoader::translateWrapMode ( domFx_sampler_wrap_common  wrap)
staticprotected

Member Data Documentation

◆ mAssumeOpaque

bool vl::DaeLoader::mAssumeOpaque
protected

Definition at line 126 of file DaeLoader.hpp.

Referenced by parseAsset(), parseEffects(), reset(), and setup_vl_Effect().

◆ mDAE

DAE vl::DaeLoader::mDAE
protected

Definition at line 122 of file DaeLoader.hpp.

Referenced by generateGeometry(), load(), and parseGeometry().

◆ mDaeNewParams

std::map< daeElementRef, ref<Dae::NewParam> > vl::DaeLoader::mDaeNewParams
protected

Definition at line 119 of file DaeLoader.hpp.

Referenced by parseColor(), and parseEffects().

◆ mDefaultFX

ref<Effect> vl::DaeLoader::mDefaultFX
protected

Definition at line 120 of file DaeLoader.hpp.

Referenced by bindMaterials(), and DaeLoader().

◆ mEffects

std::map< daeElementRef, ref<Dae::Effect> > vl::DaeLoader::mEffects
protected

Definition at line 114 of file DaeLoader.hpp.

Referenced by parseEffects(), and parseMaterials().

◆ mFilePath

String vl::DaeLoader::mFilePath
protected

Definition at line 123 of file DaeLoader.hpp.

Referenced by load().

◆ mImages

std::map< daeElementRef, ref<Image> > vl::DaeLoader::mImages
protected

Definition at line 118 of file DaeLoader.hpp.

Referenced by loadImages(), parseColor(), and parseEffects().

◆ mInvertTransparency

bool vl::DaeLoader::mInvertTransparency
protected

Definition at line 125 of file DaeLoader.hpp.

Referenced by parseAsset(), parseEffects(), and reset().

◆ mLights

std::vector< ref<Light> > vl::DaeLoader::mLights
protected

Definition at line 112 of file DaeLoader.hpp.

Referenced by load(), parseNode(), and setupLights().

◆ mLoadOptions

const LoadWriterDae::LoadOptions* vl::DaeLoader::mLoadOptions
protected

Definition at line 108 of file DaeLoader.hpp.

Referenced by loadOptions(), and setLoadOptions().

◆ mMaterials

std::map< daeElementRef, ref<Dae::Material> > vl::DaeLoader::mMaterials
protected

Definition at line 113 of file DaeLoader.hpp.

Referenced by bindMaterials(), and parseMaterials().

◆ mMeshes

std::map< daeElementRef, ref<Dae::Mesh> > vl::DaeLoader::mMeshes
protected

Definition at line 115 of file DaeLoader.hpp.

Referenced by parseGeometry().

◆ mNodes

std::vector< ref<Dae::Node> > vl::DaeLoader::mNodes
protected

Definition at line 116 of file DaeLoader.hpp.

Referenced by load(), and parseNode().

◆ mResources

ref<ResourceDatabase> vl::DaeLoader::mResources
protected

Definition at line 111 of file DaeLoader.hpp.

Referenced by load(), reset(), resources(), and setupLights().

◆ mScene

ref<Dae::Node> vl::DaeLoader::mScene
protected

Definition at line 121 of file DaeLoader.hpp.

Referenced by load(), and reset().

◆ mSources

std::map< daeElementRef, ref<Dae::Source> > vl::DaeLoader::mSources
protected

Definition at line 117 of file DaeLoader.hpp.

Referenced by getSource().

◆ mUpMatrix

mat4 vl::DaeLoader::mUpMatrix
protected

Definition at line 124 of file DaeLoader.hpp.

Referenced by load(), and parseAsset().


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