45 #ifndef OFFIMPORTER_HH 46 #define OFFIMPORTER_HH 57 #include <OpenMesh/Core/Geometry/VectorT.hh> 64 typedef int VertexHandle;
65 typedef int FaceHandle;
66 typedef std::vector<VertexHandle> VHandles;
67 typedef std::vector<OpenMesh::VertexHandle> OMVHandles;
85 VERTEXNORMAL = 1 << 3,
86 VERTEXTEXCOORDS = 1 << 4,
90 FORCE_NOCOLOR = 1 << 8,
91 FORCE_NONORMALS = 1 << 9,
92 FORCE_NOTEXTURES = 1 << 10
95 typedef uint ObjectOptions;
106 unsigned int maxFaceValence()
const {
return maxFaceValence_; }
108 void maxFaceValence(
unsigned int _maxValence) { maxFaceValence_ = _maxValence; }
135 void setNormal(VertexHandle _vh,
int _normalID);
144 int addFace(
const VHandles& _indices);
148 bool hasTextureCoords();
149 bool hasVertexColors();
150 bool hasFaceColors();
151 bool isTriangleMesh();
161 void reserve(
unsigned int _nv,
unsigned int _ne,
unsigned int _nf);
165 void setPath(QString _path);
197 std::vector< Vec3f > vertices_;
198 std::vector< Vec3f > normals_;
199 std::vector< Vec2f > texCoords_;
200 std::vector< Vec4f > colors_;
206 std::map< int, PolyMesh::VertexHandle > vertexMapPoly_;
208 std::vector< PolyMesh::FaceHandle > faceMapPoly_;
213 std::map< int, TriMesh::VertexHandle > vertexMapTri_;
215 std::vector< TriMesh::FaceHandle > faceMapTri_;
221 ObjectOptions objectOptions_;
224 std::vector<OMVHandles> invalidFaces_;
227 unsigned int maxFaceValence_;
231 #endif // OFFIMPORTER_HH
TriMesh * triMesh()
get a pointer to the active triMesh
Vec3f vertex(uint _index)
get vertex with given index
BaseObject * getObject()
get BaseObject data of object
bool hasVertexNormals()
Query Object Options.
void setObjectOptions(ObjectOptions _options)
void setVertexTexCoord(VertexHandle _vh, int _texCoordID)
set vertex texture coordinate
int addNormal(const Vec3f &_normal)
add a normal
bool hasOption(ObjectOptionsE _option)
test if object has a certain option
PolyMesh * polyMesh()
get a pointer to the active polyMesh
void addObject(BaseObject *_object)
add initial object
void setNormal(VertexHandle _vh, int _normalID)
set vertex normal
QString path()
Path of the OFF file.
~OFFImporter()
base class needs virtual destructor
void setVertexColor(VertexHandle _vh, int _colorIndex)
set vertex color
int addTexCoord(const Vec2f &_coord)
add texture coordinates
void setObjectName(QString _name)
change the name of an object
VertexHandle addVertex(const Vec3f &_point)
add a vertex with coordinate _point
int addColor(const Vec4f &_color)
add a color
void addOption(ObjectOptionsE _option)
add an option
int addFace(const VHandles &_indices)
add a face with indices _indices refering to vertices
ObjectOptions & objectOptions()
get Object Options
void removeOption(ObjectOptionsE _option)
remove an option
uint n_vertices()
Global Properties.
void setFaceColor(FaceHandle _fh, int _colorIndex)
set face color