Commit b1f66b66 authored by Jan Möbius's avatar Jan Möbius
Browse files

Created infrastructure for index property processing

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@8439 383ad7c9-94d9-4d36-a494-682f7c89f535
parent bcebb092
......@@ -69,7 +69,7 @@ mesh_(_mesh),
triangulated_(false),
updatePerEdgeBuffers_(true),
updatePerFaceBuffers_(true),
indexPropertyName_("f:textureindex")
textureIndexProperty_(-1)
{
}
......@@ -261,7 +261,18 @@ buildStripsTriMesh()
processed(f_it) = used(f_it) = false;
}
/// \todo check for texture index here
// Check if we have to take care of textures
// If this property is not available, we do not have texture info and will therefore
// skip texture handling in strip generation
bool textureHandling = false;
if ( textureIndexProperty_.is_valid() ) {
std::cerr << "Stripprocessor ; Handle Textures trimesh" << std::endl;
textureHandling = true;
} else {
std::cerr << "Stripprocessor ; No Textures trimesh" << std::endl;
}
/// \todo Implement texture processing here
for (f_it=mesh_.faces_begin(); true; )
{
......@@ -331,21 +342,19 @@ buildStripPolyMesh(typename Mesh::HalfedgeHandle _start_hh,
strip.push_back(mesh_.from_vertex_handle(_start_hh).idx());
strip.push_back(mesh_.to_vertex_handle(_start_hh).idx());
// Don't update face map here! See below why
// Check if we have to take care of textures
// If this property is not available, we do not have texture info and will therefore
// skip texture handling in strip generation
bool textureHandling = false;
OpenMesh::FPropHandleT< int > texture_index_property;
if ( mesh_.get_property_handle(texture_index_property,indexPropertyName_) ) {
std::cerr << "Texture index property found!" << std::endl;
if ( textureIndexProperty_.is_valid() ) {
std::cerr << "Stripprocessor ; Handle Textures polymesh" << std::endl;
textureHandling = true;
} else {
std::cerr << "No textures" << std::endl;
std::cerr << "Stripprocessor ; No Textures polymesh" << std::endl;
}
/// \todo Implement texture processing here
// Walk along the strip: 1st direction
// We construct the strip by using alternating vertices
// of each side.
......@@ -937,10 +946,12 @@ perFaceColorBuffer() {
template <class Mesh>
void
StripProcessorT<Mesh>::
setIndexPropertyName( std::string _index_property_name ) {
indexPropertyName_ = _index_property_name;
setIndexPropertyName( std::string _indexPropertyName ) {
std::cerr << "setIndexPropertyName " << _index_property_name << std::endl;
if ( !mesh_.get_property_handle(textureIndexProperty_,_indexPropertyName) ) {
textureIndexProperty_.invalidate();
std::cerr << "StripProcessor: Unable to get per face texture Index property named " << _indexPropertyName << std::endl;
}
// mark the buffers as invalid as we have a new per face index array
invalidatePerFaceBuffers();
......
......@@ -408,17 +408,18 @@ public:
* property and generates strips which contain only the same index. If the property is not
* found, strips will be independend of this property
*/
void setIndexPropertyName( std::string _index_property_name );
void setIndexPropertyName( std::string _indexPropertyName );
private:
/** \brief Property name of the per face texture index.
/** \brief Property for the per face texture index.
*
* This name is used by the mesh for texture index specification.
* If this is empty, Then it is assumed that there is one or no active
* This property is used by the mesh for texture index specification.
* If this is invalid, then it is assumed that there is one or no active
* texture. This means that the generated strips will be independent of texture
* information.
*/
std::string indexPropertyName_;
OpenMesh::FPropHandleT< int > textureIndexProperty_;
/** @} */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment