51 #ifndef OFFIMPORTER_HH 52 #define OFFIMPORTER_HH 63 #include <OpenMesh/Core/Geometry/VectorT.hh> 70 typedef int VertexHandle;
71 typedef int FaceHandle;
72 typedef std::vector<VertexHandle> VHandles;
73 typedef std::vector<OpenMesh::VertexHandle> OMVHandles;
91 VERTEXNORMAL = 1 << 3,
92 VERTEXTEXCOORDS = 1 << 4,
96 FORCE_NOCOLOR = 1 << 8,
97 FORCE_NONORMALS = 1 << 9,
98 FORCE_NOTEXTURES = 1 << 10
101 typedef uint ObjectOptions;
112 unsigned int maxFaceValence()
const {
return maxFaceValence_; }
114 void maxFaceValence(
unsigned int _maxValence) { maxFaceValence_ = _maxValence; }
141 void setNormal(VertexHandle _vh,
int _normalID);
150 int addFace(
const VHandles& _indices);
154 bool hasTextureCoords();
155 bool hasVertexColors();
156 bool hasFaceColors();
157 bool isTriangleMesh();
167 void reserve(
unsigned int _nv,
unsigned int _ne,
unsigned int _nf);
171 void setPath(QString _path);
203 std::vector< Vec3f > vertices_;
204 std::vector< Vec3f > normals_;
205 std::vector< Vec2f > texCoords_;
206 std::vector< Vec4f > colors_;
212 std::map< int, PolyMesh::VertexHandle > vertexMapPoly_;
214 std::vector< PolyMesh::FaceHandle > faceMapPoly_;
219 std::map< int, TriMesh::VertexHandle > vertexMapTri_;
221 std::vector< TriMesh::FaceHandle > faceMapTri_;
227 ObjectOptions objectOptions_;
230 std::vector<OMVHandles> invalidFaces_;
233 unsigned int maxFaceValence_;
237 #endif // OFFIMPORTER_HH
void setObjectOptions(ObjectOptions _options)
void setFaceColor(FaceHandle _fh, int _colorIndex)
set face color
Vec3f vertex(uint _index)
get vertex with given index
int addColor(const Vec4f &_color)
add a color
void setVertexColor(VertexHandle _vh, int _colorIndex)
set vertex color
int addTexCoord(const Vec2f &_coord)
add texture coordinates
BaseObject * getObject()
get BaseObject data of object
bool hasVertexNormals()
Query Object Options.
~OFFImporter()
base class needs virtual destructor
void setNormal(VertexHandle _vh, int _normalID)
set vertex normal
void removeOption(ObjectOptionsE _option)
remove an option
int addFace(const VHandles &_indices)
add a face with indices _indices refering to vertices
uint n_vertices()
Global Properties.
void setVertexTexCoord(VertexHandle _vh, int _texCoordID)
set vertex texture coordinate
ObjectOptions & objectOptions()
get Object Options
int addNormal(const Vec3f &_normal)
add a normal
void addObject(BaseObject *_object)
add initial object
PolyMesh * polyMesh()
get a pointer to the active polyMesh
TriMesh * triMesh()
get a pointer to the active triMesh
void setObjectName(QString _name)
change the name of an object
bool hasOption(ObjectOptionsE _option)
test if object has a certain option
QString path()
Path of the OFF file.
void addOption(ObjectOptionsE _option)
add an option
VertexHandle addVertex(const Vec3f &_point)
add a vertex with coordinate _point