Developer Documentation
OBJImporter Class Reference

Public Types

enum  ObjectOptionsE {
  NONE = 0, TRIMESH = 1, POLYMESH = 1 << 1, CURVE = 1 << 2,
  SURFACE = 1 << 3, NORMALS = 1 << 4, TEXCOORDS = 1 << 5, FACECOLOR = 1 << 6,
  TEXTURE = 1 << 7, FORCE_NOCOLOR = 1 << 8, FORCE_NONORMALS = 1 << 9, FORCE_NOTEXTURES = 1 << 10
typedef unsigned int ObjectOptions

Public Member Functions

 OBJImporter ()
 ~OBJImporter ()
 base class needs virtual destructor
VertexHandle addVertex (const Vec3f &_point)
 add a vertex with coordinate _point
Vec3f vertex (unsigned int _index)
 get vertex with given index
int addTexCoord (const Vec2f &_coord)
 add texture coordinates
int addNormal (const Vec3f &_normal)
 add a normal
void setDegreeU (int _degree)
 set degree More...
void setDegreeV (int _degree)
 set degree V direction
int degreeU ()
 get current degree
int degreeV ()
 get current degree
void setObject (BaseObject *_object, int _groupId)
 add an object More...
int currentObject ()
 get id of the active object
PolyMeshcurrentPolyMesh ()
 get a pointer to the active polyMesh More...
TriMeshcurrentTriMesh ()
 get a pointer to the active triMesh More...
void addUsedVertices (int _groupId)
 add all vertices that are used to the mesh (in correct order)
void setVertexTexCoord (VertexHandle _vh, int _texCoordID)
 set vertex texture coordinate
void setNormal (int _index, int _normalID)
 set vertex normal
void addFace (const VHandles &_indices)
 add a face with indices _indices refering to vertices
void addFace (const VHandles &_indices, const std::vector< int > &_face_texcoords)
 add face and texture coordinates
void forceMeshType (ObjectOptions _meshType)
 force all meshes to be opened with specific type
bool hasNormals (int _objectID)
 Query Object Options.
bool hasTexture (int _objectID)
bool hasTextureCoords (int _objectID)
bool isTriangleMesh (int _objectID)
bool isPolyMesh (int _objectID)
bool isCurve (int _objectID)
bool isSurface (int _objectID)
unsigned int n_vertices ()
 Global Properties.
unsigned int n_normals ()
unsigned int n_texCoords ()
unsigned int objectCount ()
BaseObjectobject (int _objectID)
 return object with given index
MaterialList & materials ()
 return all loaded materials
void addMaterial (std::string _materialName)
 Add a material.
const std::vector< std::string > usedMaterials (unsigned int _objectID)
 used materials
void useMaterial (std::string _materialName)
void useVertex (int _vertex_index)
 used vertices
QString path ()
 Path of the OBJ file.
void setPath (QString _path)
void setObjectOptions (ObjectOptions _options)
std::vector< ObjectOptions > & objectOptions ()
 Object Options for all objects.
bool hasOption (unsigned int _id, ObjectOptions _option)
 check if object with given id has given option
void setObjectName (int _objectID, QString _name)
 change the name of an object
int addGroup (const QString &_groupName)
int groupId (const QString &_groupName) const
unsigned int numGroups () const
const QString groupName (const int _grpId) const
void setGroupName (const int _grp, const QString &_name)
void setCurrentGroup (const int _current)
int currentGroup () const
void finish ()

Private Member Functions

bool addFace (const VHandles &_indices, OpenMesh::FaceHandle &_outFH, std::vector< TriMesh::VertexHandle > &_outTriVertices, std::vector< PolyMesh::VertexHandle > &_outPolyVertices)
bool vertexListIsManifold (const std::vector< PolyMesh::VertexHandle > &_vertices) const

Private Attributes

std::vector< Vec3fvertices_
std::vector< Vec3fnormals_
std::vector< Vec2ftexCoords_
std::map< TriMesh::VertexHandle, TriMesh::NormalstoredTriHENormals_
std::map< TriMesh::VertexHandle, PolyMesh::NormalstoredPolyHENormals_
int degreeU_
int degreeV_
MaterialList materials_
QString path_
std::vector< QString > groupNames_
int currentGroup_
std::vector< std::map< int, PolyMesh::VertexHandle > > vertexMapPoly_
PolyMesh::FaceHandle addedFacePoly_
std::vector< std::map< int, TriMesh::VertexHandle > > vertexMapTri_
std::vector< std::vector< TriMesh::FaceHandle > > addedFacesTri_
std::vector< TriMeshObject * > triMeshes_
std::vector< PolyMeshObject * > polyMeshes_
std::vector< ObjectOptions > objectOptions_
std::vector< std::vector< std::string > > usedMaterials_
std::vector< std::map< int, VertexHandle > > usedVertices_
std::vector< std::vector< OMVHandles > > invalidFaces_

Detailed Description

Definition at line 93 of file OBJImporter.hh.

Member Function Documentation

PolyMesh * OBJImporter::currentPolyMesh ( )

get a pointer to the active polyMesh

get the active polyMesh

Definition at line 173 of file

TriMesh * OBJImporter::currentTriMesh ( )

get a pointer to the active triMesh

get the active triMesh

Definition at line 181 of file

void OBJImporter::finish ( )

Finish up importing: Duplicate vertices of non-manifold faces and add new face as isolated one

Definition at line 925 of file

void OBJImporter::setDegreeU ( int  _degree)

set degree

set degree U direction

Definition at line 99 of file

void OBJImporter::setObject ( BaseObject _object,
int  _groupId 

add an object

add a mesh

Definition at line 128 of file

void OBJImporter::setObjectOptions ( ObjectOptions  _options)

store an initial options object for an object containing info about the meshType

Definition at line 818 of file

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