Removed the ReorderVert function used for permutating the accessory attributes of OCF components. IT should not be used.
This commit is contained in:
parent
8446d9f566
commit
5a21c7cd76
|
|
@ -34,7 +34,7 @@
|
||||||
#include <vcg/container/simple_temporary_data.h>
|
#include <vcg/container/simple_temporary_data.h>
|
||||||
|
|
||||||
namespace vcg {
|
namespace vcg {
|
||||||
namespace tri {
|
namespace tri {
|
||||||
/** \addtogroup trimesh */
|
/** \addtogroup trimesh */
|
||||||
|
|
||||||
template<class MeshType>
|
template<class MeshType>
|
||||||
|
|
@ -54,16 +54,6 @@ namespace vcg {
|
||||||
size_t Index(MeshType &m, typename MeshType::EdgeType* e) {return e-&*m.edge.begin();}
|
size_t Index(MeshType &m, typename MeshType::EdgeType* e) {return e-&*m.edge.begin();}
|
||||||
template<class MeshType>
|
template<class MeshType>
|
||||||
size_t Index(MeshType &m, typename MeshType::HEdgeType* h) {return h-&*m.hedge.begin();}
|
size_t Index(MeshType &m, typename MeshType::HEdgeType* h) {return h-&*m.hedge.begin();}
|
||||||
|
|
||||||
// Placeholder.
|
|
||||||
// this one is called by the Compact and overridden by more specialized functions for OCF classes.
|
|
||||||
// that manage also the additional types
|
|
||||||
template <class face_type>
|
|
||||||
void ReorderFace( std::vector<size_t> & /*newVertIndex*/, std::vector<face_type> & /*vert*/)
|
|
||||||
{}
|
|
||||||
template <class vertex_type>
|
|
||||||
void ReorderVert( std::vector<size_t> &/*newVertIndex*/, std::vector<vertex_type> &/*vert*/)
|
|
||||||
{}
|
|
||||||
|
|
||||||
template <class MeshType, class ATTR_CONT>
|
template <class MeshType, class ATTR_CONT>
|
||||||
void ReorderAttribute(ATTR_CONT &c,std::vector<size_t> & newVertIndex, MeshType & /* m */){
|
void ReorderAttribute(ATTR_CONT &c,std::vector<size_t> & newVertIndex, MeshType & /* m */){
|
||||||
|
|
@ -599,11 +589,7 @@ namespace vcg {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// call a templated reordering function that manage any additional data internally stored by the vector
|
|
||||||
// for the default std::vector no work is needed (some work is typically needed for the OCF stuff)
|
|
||||||
ReorderVert<typename MeshType::VertexType>(pu.remap,m.vert);
|
|
||||||
|
|
||||||
// reorder the optional atttributes in m.vert_attr to reflect the changes
|
// reorder the optional atttributes in m.vert_attr to reflect the changes
|
||||||
ReorderAttribute(m.vert_attr,pu.remap,m);
|
ReorderAttribute(m.vert_attr,pu.remap,m);
|
||||||
|
|
||||||
|
|
@ -721,11 +707,7 @@ namespace vcg {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
assert((int)pos==m.fn);
|
assert((int)pos==m.fn);
|
||||||
|
|
||||||
// call a templated reordering function that manage any additional data internally stored by the vector
|
|
||||||
// for the default std::vector no work is needed (some work is typically needed for the OCF stuff)
|
|
||||||
ReorderFace<typename MeshType::FaceType>(pu.remap,m.face);
|
|
||||||
|
|
||||||
// reorder the optional atttributes in m.face_attr to reflect the changes
|
// reorder the optional atttributes in m.face_attr to reflect the changes
|
||||||
ReorderAttribute(m.face_attr,pu.remap,m);
|
ReorderAttribute(m.face_attr,pu.remap,m);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -175,47 +175,6 @@ public:
|
||||||
(*vi)._ovp=this;
|
(*vi)._ovp=this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// this function is called by the specialized Reorder function, that is called whenever someone call the allocator::CompactVertVector
|
|
||||||
void ReorderVert(std::vector<size_t> &newVertIndex )
|
|
||||||
{
|
|
||||||
size_t i=0;
|
|
||||||
assert( (!ColorEnabled) || ( CV.size() == newVertIndex.size() ) );
|
|
||||||
assert( (!MarkEnabled) || ( MV.size() == newVertIndex.size() ) );
|
|
||||||
assert( (!NormalEnabled) || ( NV.size() == newVertIndex.size() ) );
|
|
||||||
assert( (!VFAdjacencyEnabled) || ( AV.size() == newVertIndex.size() ) );
|
|
||||||
assert( (!CurvatureEnabled) || ( CuV.size() == newVertIndex.size() ) );
|
|
||||||
assert( (!CurvatureDirEnabled) || ( CuDV.size() == newVertIndex.size() ) );
|
|
||||||
assert( (!RadiusEnabled) || ( RadiusV.size() == newVertIndex.size() ) );
|
|
||||||
assert( (!TexCoordEnabled) || ( TV.size() == newVertIndex.size() ) );
|
|
||||||
|
|
||||||
for(i=0;i<newVertIndex.size();++i)
|
|
||||||
{
|
|
||||||
if(newVertIndex[i] != std::numeric_limits<size_t>::max() )
|
|
||||||
{
|
|
||||||
assert(newVertIndex[i] <= i);
|
|
||||||
if (ColorEnabled) CV[newVertIndex[i]] = CV[i];
|
|
||||||
if (MarkEnabled) MV[newVertIndex[i]] = MV[i];
|
|
||||||
if (NormalEnabled) NV[newVertIndex[i]] = NV[i];
|
|
||||||
if (VFAdjacencyEnabled) AV[newVertIndex[i]] = AV[i];
|
|
||||||
if (CurvatureEnabled) CuV[newVertIndex[i]] = CuV[i];
|
|
||||||
if (CurvatureDirEnabled) CuDV[newVertIndex[i]] =CuDV[i];
|
|
||||||
if (RadiusEnabled) RadiusV[newVertIndex[i]] = RadiusV[i];
|
|
||||||
if (TexCoordEnabled) TV[newVertIndex[i]] = TV[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ColorEnabled) CV.resize(BaseType::size());
|
|
||||||
if (MarkEnabled) MV.resize(BaseType::size());
|
|
||||||
if (NormalEnabled) NV.resize(BaseType::size());
|
|
||||||
if (VFAdjacencyEnabled) AV.resize(BaseType::size());
|
|
||||||
if (CurvatureEnabled) CuV.resize(BaseType::size());
|
|
||||||
if (CurvatureDirEnabled) CuDV.resize(BaseType::size());
|
|
||||||
if (RadiusEnabled) RadiusV.resize(BaseType::size());
|
|
||||||
if (TexCoordEnabled) TV.resize(BaseType::size());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////
|
////////////////////////////////////////
|
||||||
// Enabling Eunctions
|
// Enabling Eunctions
|
||||||
|
|
||||||
|
|
@ -741,11 +700,6 @@ namespace tri
|
||||||
else return VertexType::HasCurvatureDir();
|
else return VertexType::HasCurvatureDir();
|
||||||
}
|
}
|
||||||
|
|
||||||
template < class VertexType >
|
|
||||||
void ReorderVert( std::vector<size_t> &newVertIndex, vertex::vector_ocf< VertexType > &vertVec)
|
|
||||||
{
|
|
||||||
vertVec.ReorderVert(newVertIndex);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}// end namespace vcg
|
}// end namespace vcg
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue