Developer Documentation
OFFImporter Class Reference

Public Types

enum  ObjectOptionsE {
  NONE = 0 , BINARY = 1 , TRIMESH = 1 << 1 , POLYMESH = 1 << 2 ,
  VERTEXNORMAL = 1 << 3 , VERTEXTEXCOORDS = 1 << 4 , VERTEXCOLOR = 1 << 5 , FACECOLOR = 1 << 6 ,
  COLORALPHA = 1 << 7 , FORCE_NOCOLOR = 1 << 8 , FORCE_NONORMALS = 1 << 9 , FORCE_NOTEXTURES = 1 << 10
}
 
typedef uint ObjectOptions
 

Public Member Functions

 OFFImporter ()
 constructor More...
 
 ~OFFImporter ()
 base class needs virtual destructor More...
 
void addObject (BaseObject *_object)
 add initial object More...
 
unsigned int maxFaceValence () const
 
void maxFaceValence (unsigned int _maxValence)
 
VertexHandle addVertex (const Vec3f &_point)
 add a vertex with coordinate _point More...
 
Vec3f vertex (uint _index)
 get vertex with given index More...
 
int addTexCoord (const Vec2f &_coord)
 add texture coordinates More...
 
int addColor (const Vec4f &_color)
 add a color More...
 
int addNormal (const Vec3f &_normal)
 add a normal More...
 
PolyMeshpolyMesh ()
 get a pointer to the active polyMesh More...
 
TriMeshtriMesh ()
 get a pointer to the active triMesh More...
 
void setVertexTexCoord (VertexHandle _vh, int _texCoordID)
 set vertex texture coordinate More...
 
void setNormal (VertexHandle _vh, int _normalID)
 set vertex normal More...
 
void setVertexColor (VertexHandle _vh, int _colorIndex)
 set vertex color More...
 
void setFaceColor (FaceHandle _fh, int _colorIndex)
 set face color More...
 
int addFace (const VHandles &_indices)
 add a face with indices _indices refering to vertices More...
 
bool hasVertexNormals ()
 Query Object Options. More...
 
bool hasTextureCoords ()
 
bool hasVertexColors ()
 
bool hasFaceColors ()
 
bool isTriangleMesh ()
 
bool isPolyMesh ()
 
bool isBinary ()
 
uint n_vertices ()
 Global Properties. More...
 
uint n_normals ()
 
uint n_texCoords ()
 
void reserve (unsigned int _nv, unsigned int _ne, unsigned int _nf)
 
QString path ()
 Path of the OFF file. More...
 
void setPath (QString _path)
 
void setObjectOptions (ObjectOptions _options)
 
void addOption (ObjectOptionsE _option)
 add an option More...
 
void removeOption (ObjectOptionsE _option)
 remove an option More...
 
bool hasOption (ObjectOptionsE _option)
 test if object has a certain option More...
 
ObjectOptions & objectOptions ()
 get Object Options More...
 
void setObjectName (QString _name)
 change the name of an object More...
 
BaseObjectgetObject ()
 get BaseObject data of object More...
 
void finish ()
 

Private Attributes

std::vector< Vec3fvertices_
 
std::vector< Vec3fnormals_
 
std::vector< Vec2ftexCoords_
 
std::vector< Vec4fcolors_
 
QString path_
 
std::map< int, PolyMesh::VertexHandlevertexMapPoly_
 
std::vector< PolyMesh::FaceHandlefaceMapPoly_
 
PolyMeshpolyMesh_
 
std::map< int, TriMesh::VertexHandlevertexMapTri_
 
std::vector< TriMesh::FaceHandlefaceMapTri_
 
TriMeshtriMesh_
 
BaseObjectobject_
 
ObjectOptions objectOptions_
 
std::vector< OMVHandles > invalidFaces_
 
unsigned int maxFaceValence_
 

Detailed Description

Definition at line 75 of file OFFImporter.hh.

Member Typedef Documentation

◆ ObjectOptions

typedef uint OFFImporter::ObjectOptions

Definition at line 95 of file OFFImporter.hh.

Member Enumeration Documentation

◆ ObjectOptionsE

enum OFFImporter::ObjectOptionsE

Definition at line 79 of file OFFImporter.hh.

Constructor & Destructor Documentation

◆ OFFImporter()

OFFImporter::OFFImporter ( )

constructor

Definition at line 56 of file OFFImporter.cc.

◆ ~OFFImporter()

OFFImporter::~OFFImporter ( )

base class needs virtual destructor

Definition at line 49 of file OFFImporter.cc.

Member Function Documentation

◆ addColor()

int OFFImporter::addColor ( const Vec4f _color)

add a color

Definition at line 122 of file OFFImporter.cc.

◆ addFace()

int OFFImporter::addFace ( const VHandles &  _indices)

add a face with indices _indices refering to vertices

Definition at line 261 of file OFFImporter.cc.

◆ addNormal()

int OFFImporter::addNormal ( const Vec3f _normal)

add a normal

Definition at line 113 of file OFFImporter.cc.

◆ addObject()

void OFFImporter::addObject ( BaseObject _object)

add initial object

add a mesh

Definition at line 66 of file OFFImporter.cc.

◆ addOption()

void OFFImporter::addOption ( ObjectOptionsE  _option)

add an option

Definition at line 524 of file OFFImporter.cc.

◆ addTexCoord()

int OFFImporter::addTexCoord ( const Vec2f _coord)

add texture coordinates

Definition at line 104 of file OFFImporter.cc.

◆ addVertex()

VertexHandle OFFImporter::addVertex ( const Vec3f _point)

add a vertex with coordinate _point

Definition at line 236 of file OFFImporter.cc.

◆ finish()

void OFFImporter::finish ( )

Finish up importing process: Duplicate vertices of non-manifold faces and add these faces as isolated ones

Definition at line 329 of file OFFImporter.cc.

◆ getObject()

BaseObject * OFFImporter::getObject ( )

get BaseObject data of object

Definition at line 499 of file OFFImporter.cc.

◆ hasFaceColors()

bool OFFImporter::hasFaceColors ( )

Definition at line 451 of file OFFImporter.cc.

◆ hasOption()

bool OFFImporter::hasOption ( ObjectOptionsE  _option)

test if object has a certain option

Definition at line 457 of file OFFImporter.cc.

◆ hasTextureCoords()

bool OFFImporter::hasTextureCoords ( )

Definition at line 439 of file OFFImporter.cc.

◆ hasVertexColors()

bool OFFImporter::hasVertexColors ( )

Definition at line 445 of file OFFImporter.cc.

◆ hasVertexNormals()

bool OFFImporter::hasVertexNormals ( )

Query Object Options.

Definition at line 432 of file OFFImporter.cc.

◆ isBinary()

bool OFFImporter::isBinary ( )

Definition at line 426 of file OFFImporter.cc.

◆ isPolyMesh()

bool OFFImporter::isPolyMesh ( )

Definition at line 420 of file OFFImporter.cc.

◆ isTriangleMesh()

bool OFFImporter::isTriangleMesh ( )

Definition at line 414 of file OFFImporter.cc.

◆ maxFaceValence() [1/2]

unsigned int OFFImporter::maxFaceValence ( ) const
inline

Definition at line 106 of file OFFImporter.hh.

◆ maxFaceValence() [2/2]

void OFFImporter::maxFaceValence ( unsigned int  _maxValence)
inline

Definition at line 108 of file OFFImporter.hh.

◆ n_normals()

uint OFFImporter::n_normals ( )

Definition at line 469 of file OFFImporter.cc.

◆ n_texCoords()

uint OFFImporter::n_texCoords ( )

Definition at line 475 of file OFFImporter.cc.

◆ n_vertices()

uint OFFImporter::n_vertices ( )

Global Properties.

Definition at line 463 of file OFFImporter.cc.

◆ objectOptions()

OFFImporter::ObjectOptions & OFFImporter::objectOptions ( )

get Object Options

Definition at line 536 of file OFFImporter.cc.

◆ path()

QString OFFImporter::path ( )

Path of the OFF file.

Definition at line 506 of file OFFImporter.cc.

◆ polyMesh()

PolyMesh * OFFImporter::polyMesh ( )

get a pointer to the active polyMesh

get mesh as polyMesh

Definition at line 131 of file OFFImporter.cc.

◆ removeOption()

void OFFImporter::removeOption ( ObjectOptionsE  _option)

remove an option

Definition at line 530 of file OFFImporter.cc.

◆ reserve()

void OFFImporter::reserve ( unsigned int  _nv,
unsigned int  _ne,
unsigned int  _nf 
)

Definition at line 481 of file OFFImporter.cc.

◆ setFaceColor()

void OFFImporter::setFaceColor ( FaceHandle  _fh,
int  _colorIndex 
)

set face color

set RGBA color of face

Definition at line 591 of file OFFImporter.cc.

◆ setNormal()

void OFFImporter::setNormal ( VertexHandle  _vh,
int  _normalID 
)

set vertex normal

Definition at line 196 of file OFFImporter.cc.

◆ setObjectName()

void OFFImporter::setObjectName ( QString  _name)

change the name of an object

Definition at line 542 of file OFFImporter.cc.

◆ setObjectOptions()

void OFFImporter::setObjectOptions ( ObjectOptions  _options)

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

Definition at line 518 of file OFFImporter.cc.

◆ setPath()

void OFFImporter::setPath ( QString  _path)

Definition at line 512 of file OFFImporter.cc.

◆ setVertexColor()

void OFFImporter::setVertexColor ( VertexHandle  _vh,
int  _colorIndex 
)

set vertex color

set RGBA color of vertex

Definition at line 551 of file OFFImporter.cc.

◆ setVertexTexCoord()

void OFFImporter::setVertexTexCoord ( VertexHandle  _vh,
int  _texCoordID 
)

set vertex texture coordinate

Definition at line 151 of file OFFImporter.cc.

◆ triMesh()

TriMesh * OFFImporter::triMesh ( )

get a pointer to the active triMesh

get mesh as triMesh

Definition at line 141 of file OFFImporter.cc.

◆ vertex()

Vec3f OFFImporter::vertex ( uint  _index)

get vertex with given index

Definition at line 93 of file OFFImporter.cc.

Member Data Documentation

◆ colors_

std::vector< Vec4f > OFFImporter::colors_
private

Definition at line 200 of file OFFImporter.hh.

◆ faceMapPoly_

std::vector< PolyMesh::FaceHandle > OFFImporter::faceMapPoly_
private

Definition at line 208 of file OFFImporter.hh.

◆ faceMapTri_

std::vector< TriMesh::FaceHandle > OFFImporter::faceMapTri_
private

Definition at line 215 of file OFFImporter.hh.

◆ invalidFaces_

std::vector<OMVHandles> OFFImporter::invalidFaces_
private

Definition at line 224 of file OFFImporter.hh.

◆ maxFaceValence_

unsigned int OFFImporter::maxFaceValence_
private

Definition at line 227 of file OFFImporter.hh.

◆ normals_

std::vector< Vec3f > OFFImporter::normals_
private

Definition at line 198 of file OFFImporter.hh.

◆ object_

BaseObject* OFFImporter::object_
private

Definition at line 220 of file OFFImporter.hh.

◆ objectOptions_

ObjectOptions OFFImporter::objectOptions_
private

Definition at line 221 of file OFFImporter.hh.

◆ path_

QString OFFImporter::path_
private

Definition at line 203 of file OFFImporter.hh.

◆ polyMesh_

PolyMesh* OFFImporter::polyMesh_
private

Definition at line 210 of file OFFImporter.hh.

◆ texCoords_

std::vector< Vec2f > OFFImporter::texCoords_
private

Definition at line 199 of file OFFImporter.hh.

◆ triMesh_

TriMesh* OFFImporter::triMesh_
private

Definition at line 217 of file OFFImporter.hh.

◆ vertexMapPoly_

std::map< int, PolyMesh::VertexHandle > OFFImporter::vertexMapPoly_
private

Definition at line 206 of file OFFImporter.hh.

◆ vertexMapTri_

std::map< int, TriMesh::VertexHandle > OFFImporter::vertexMapTri_
private

Definition at line 213 of file OFFImporter.hh.

◆ vertices_

std::vector< Vec3f > OFFImporter::vertices_
private

Definition at line 197 of file OFFImporter.hh.


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