Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

OBJFace Class Reference

A class to represent a face in a .obj file. More...

List of all members.

Public Member Functions

 OBJFace (long mtl_index_in=-1)
unsigned long num_vertices () const
unsigned long num_texcoords () const
unsigned long num_normals () const
unsigned long get_vertex_idx (unsigned long idx) const
unsigned long get_texcoord_idx (unsigned long idx) const
unsigned long get_normal_idx (unsigned long idx) const
bool has_texcoords () const
bool has_normals () const
bool add_vertex (long vertex, unsigned long total_vertices)
bool add_texcoord (long texcoord, unsigned long total_texcoords)
bool add_normal (long normal, unsigned long total_normals)
bool good () const
 Checks ot see if this face has consistent numbers of vertices, texture coordinates, and normals.

Private Member Functions

bool process_index (long index, unsigned long max_val, vector< unsigned long > &index_list)
 Process a vertex position, texture coordinate or normal index to see if it is valid and, if so, to normalize it and add it to the given vector.

Private Attributes

long mtl_index
vector< unsigned long > vertices
vector< unsigned long > texcoords
vector< unsigned long > normals


Detailed Description

A class to represent a face in a .obj file.

Definition at line 256 of file objreader.C.


Constructor & Destructor Documentation

OBJFace::OBJFace long  mtl_index_in = -1  )  [inline]
 

Definition at line 260 of file objreader.C.


Member Function Documentation

bool OBJFace::add_normal long  normal,
unsigned long  total_normals
 

Definition at line 316 of file objreader.C.

References normals, and process_index().

Referenced by OBJReaderImpl::read_f().

bool OBJFace::add_texcoord long  texcoord,
unsigned long  total_texcoords
 

Definition at line 308 of file objreader.C.

References process_index(), and texcoords.

Referenced by OBJReaderImpl::read_f().

bool OBJFace::add_vertex long  vertex,
unsigned long  total_vertices
 

Definition at line 300 of file objreader.C.

References process_index(), and vertices.

Referenced by OBJReaderImpl::read_f().

unsigned long OBJFace::get_normal_idx unsigned long  idx  )  const [inline]
 

Definition at line 272 of file objreader.C.

References normals.

Referenced by OBJReaderImpl::add_tri().

unsigned long OBJFace::get_texcoord_idx unsigned long  idx  )  const [inline]
 

Definition at line 270 of file objreader.C.

References texcoords.

Referenced by OBJReaderImpl::add_tri().

unsigned long OBJFace::get_vertex_idx unsigned long  idx  )  const [inline]
 

Definition at line 268 of file objreader.C.

References vertices.

Referenced by OBJReaderImpl::add_tri().

bool OBJFace::good  )  const
 

Checks ot see if this face has consistent numbers of vertices, texture coordinates, and normals.

Definition at line 324 of file objreader.C.

References normals, texcoords, and vertices.

Referenced by OBJReaderImpl::read_f().

bool OBJFace::has_normals  )  const [inline]
 

Definition at line 276 of file objreader.C.

References num_normals().

Referenced by OBJReaderImpl::add_tri().

bool OBJFace::has_texcoords  )  const [inline]
 

Definition at line 275 of file objreader.C.

References num_texcoords().

Referenced by OBJReaderImpl::add_tri().

unsigned long OBJFace::num_normals  )  const [inline]
 

Definition at line 266 of file objreader.C.

References normals.

Referenced by has_normals().

unsigned long OBJFace::num_texcoords  )  const [inline]
 

Definition at line 265 of file objreader.C.

References texcoords.

Referenced by has_texcoords().

unsigned long OBJFace::num_vertices  )  const [inline]
 

Definition at line 264 of file objreader.C.

References vertices.

bool OBJFace::process_index long  index,
unsigned long  max_val,
vector< unsigned long > &  index_list
[private]
 

Process a vertex position, texture coordinate or normal index to see if it is valid and, if so, to normalize it and add it to the given vector.

Parameters:
[in] index The index to check and add (if the check succeeds).
[in] max_val The maximum value that the index can take (this should be equal to the number of elements (vertices, texture coordinates, or normals) that have been read in the .obj file at the time this face is read.
[in,out] index_list The vector of indices to add the vertex to if it is valid.
Returns:
true if the index is valid and false otherwise.

Definition at line 348 of file objreader.C.

Referenced by add_normal(), add_texcoord(), and add_vertex().


Member Data Documentation

long OBJFace::mtl_index [private]
 

Definition at line 291 of file objreader.C.

vector<unsigned long> OBJFace::normals [private]
 

Definition at line 295 of file objreader.C.

Referenced by add_normal(), get_normal_idx(), good(), and num_normals().

vector<unsigned long> OBJFace::texcoords [private]
 

Definition at line 294 of file objreader.C.

Referenced by add_texcoord(), get_texcoord_idx(), good(), and num_texcoords().

vector<unsigned long> OBJFace::vertices [private]
 

Definition at line 293 of file objreader.C.

Referenced by add_vertex(), get_vertex_idx(), good(), and num_vertices().


The documentation for this class was generated from the following file:
Generated on Mon Sep 18 11:46:47 2006 for jot by  doxygen 1.4.4