OBJ file loader filter.
More...
#include <WavefrontObjFileLoader.h>
|
| WavefrontObjFileLoader () |
| Constructor for OBJ file loader filter. More...
|
|
ScenePart * | run () |
|
Vertex | readVertex (std::vector< std::string > const &lineParts, bool const yIsUp) |
| Load a vertice from a given line. More...
|
|
glm::dvec3 | readNormalVector (std::vector< std::string > const &lineParts, bool const yIsUp) |
| Read a normal vector from a given line. More...
|
|
void | readPrimitive (WavefrontObj *loadedObj, std::vector< std::string > const &lineParts, std::vector< Vertex > const &vertices, std::vector< glm::dvec2 > const &texcoords, std::vector< glm::dvec3 > const &normals, std::string const ¤tMat, std::string const &pathString) |
| Reads a face from a given line. More...
|
|
WavefrontObj * | loadObj (std::string const &pathString, bool const yIsUp) |
| Load an OBJ file.
|
|
| AbstractGeometryFilter (ScenePart *parts_) |
| Base constructor for asset loading filters. More...
|
|
std::shared_ptr< Material > | getMaterial (std::string materialName) |
| Retrieve requested material by name. More...
|
|
std::vector< std::shared_ptr< Material > > | parseMaterials () |
| Parse materials specified through "matfile", which can be concreted through "matname" parameter. It can also handle random materials when parameter "randomMaterials" is set. More...
|
|
|
static void | buildPrimitiveVertex (Vertex &dstVert, Vertex const &srcVert, int const texIdx, int const normalIdx, std::vector< glm::dvec2 > const &texcoords, std::vector< glm::dvec3 > const &normals) |
| Build dstVertex considering data of srcVert. More...
|
|
|
OGRSpatialReference * | sourceCRS |
|
std::map< std::string, ObjectT > | params |
| Available parameters.
|
|
std::map< std::string, Material > | materials |
| Available materials.
|
|
ScenePart * | primsOut = nullptr |
| ScenePart used to build the output. Not strictly necessary for any filter.
|
|
◆ WavefrontObjFileLoader()
WavefrontObjFileLoader::WavefrontObjFileLoader |
( |
| ) |
|
|
inline |
◆ buildPrimitiveVertex()
void WavefrontObjFileLoader::buildPrimitiveVertex |
( |
Vertex & |
dstVert, |
|
|
Vertex const & |
srcVert, |
|
|
int const |
texIdx, |
|
|
int const |
normalIdx, |
|
|
std::vector< glm::dvec2 > const & |
texcoords, |
|
|
std::vector< glm::dvec3 > const & |
normals |
|
) |
| |
|
static |
Build dstVertex considering data of srcVert.
- Parameters
-
| dstVert | Vertex to be built. It belongs to a primitive. |
[in] | srcVert | Vertex used to built. It comes from the set of vertices in obj file. |
| texIdx | Index of texture to be used |
| normalIdx | Index of normal to be used. |
| texcoords | Vector of texture coordinates. |
| normals | Vector of normals. It contains the normal for each vertex. |
◆ readNormalVector()
glm::dvec3 WavefrontObjFileLoader::readNormalVector |
( |
std::vector< std::string > const & |
lineParts, |
|
|
bool const |
yIsUp |
|
) |
| |
Read a normal vector from a given line.
- Parameters
-
lineParts | Vector containing each normal coordinate in string format |
◆ readPrimitive()
void WavefrontObjFileLoader::readPrimitive |
( |
WavefrontObj * |
loadedObj, |
|
|
std::vector< std::string > const & |
lineParts, |
|
|
std::vector< Vertex > const & |
vertices, |
|
|
std::vector< glm::dvec2 > const & |
texcoords, |
|
|
std::vector< glm::dvec3 > const & |
normals, |
|
|
std::string const & |
currentMat, |
|
|
std::string const & |
pathString |
|
) |
| |
Reads a face from a given line.
- Parameters
-
lineParts | Vector of strings containing the primitive indices |
vertices | Vertices used to build. They come from the set of vertices in the obj file |
texcoords | Coordinates of the texture to be loaded in the face |
normals | Vector of normales of every face in the .obj file |
currentMat | Current material to be used in the primitive |
pathString | Path to the primitive |
◆ readVertex()
Vertex WavefrontObjFileLoader::readVertex |
( |
std::vector< std::string > const & |
lineParts, |
|
|
bool const |
yIsUp |
|
) |
| |
Load a vertice from a given line.
- Parameters
-
lineParts | Vector containing each vertex coordinate in string format |
◆ run()
The documentation for this class was generated from the following files: