Merge branch 'devel' of github.com:cnr-isti-vclab/vcglib into devel
This commit is contained in:
commit
bd1b1a937b
|
@ -207,12 +207,19 @@ public:
|
|||
typedef SimpleTempData<std::vector<VertexType>, TempData > TempDataType;
|
||||
|
||||
|
||||
struct pred: public std::binary_function<VertDist,VertDist,bool>{
|
||||
pred(){}
|
||||
bool operator()(const VertDist& v0, const VertDist& v1) const
|
||||
{return (v0.d > v1.d);}
|
||||
class pred {
|
||||
public:
|
||||
pred () {};
|
||||
bool operator()(const VertDist& v0, const VertDist& v1) const
|
||||
{return (v0.d > v1.d);}
|
||||
};
|
||||
|
||||
//struct pred: public std::binary_function<VertDist,VertDist,bool>{
|
||||
// pred(){}
|
||||
// bool operator()(const VertDist& v0, const VertDist& v1) const
|
||||
// {return (v0.d > v1.d);}
|
||||
//};
|
||||
|
||||
/*
|
||||
*
|
||||
curr: vertex for which distance should be estimated
|
||||
|
|
|
@ -250,7 +250,7 @@ public:
|
|||
return V;
|
||||
}
|
||||
|
||||
static ScalarType ComputeMeshVolume(const MeshType & m)
|
||||
static ScalarType ComputeMeshVolume(MeshType & m)
|
||||
{
|
||||
Inertia<MeshType> I(m);
|
||||
return I.Mass();
|
||||
|
|
|
@ -2049,7 +2049,7 @@ public:
|
|||
}
|
||||
|
||||
template <class ATTR_TYPE>
|
||||
static typename MeshType::template ConstPerTetraAttributeHandle<ATTR_TYPE> FindPerTetraAttribute(MeshType &m, const std::string &name)
|
||||
static typename MeshType::template ConstPerTetraAttributeHandle<ATTR_TYPE> FindPerTetraAttribute(const MeshType &m, const std::string &name)
|
||||
{
|
||||
if(!name.empty()){
|
||||
PointerToAttribute h1;
|
||||
|
|
|
@ -48,7 +48,7 @@ template <class T> class EmptyCore : public T {
|
|||
public:
|
||||
//Empty vertexref
|
||||
inline typename T::VertexType * & V( const int ) { assert(0); static typename T::VertexType *vp=0; return vp; }
|
||||
inline typename T::VertexType * const & V( const int ) const { assert(0); static typename T::VertexType *vp=0; return vp; }
|
||||
inline const typename T::VertexType * V( const int ) const { assert(0); static typename T::VertexType *vp=0; return vp; }
|
||||
inline const typename T::VertexType * cV( const int ) const { assert(0); static typename T::VertexType *vp=0; return vp; }
|
||||
inline typename T::CoordType & P( const int ) { assert(0); static typename T::CoordType coord(0, 0, 0); return coord; }
|
||||
inline const typename T::CoordType & P( const int ) const { assert(0); static typename T::CoordType coord(0, 0, 0); return coord; }
|
||||
|
@ -181,7 +181,8 @@ public:
|
|||
typedef typename T::VertexType::ScalarType ScalarType;
|
||||
|
||||
inline typename T::VertexType * & V( const int j ) { assert(j>=0 && j<4); return v[j]; }
|
||||
inline const typename T::VertexType * cV( const int j ) { assert(j>=0 && j<4); return v[j]; }
|
||||
inline const typename T::VertexType * V( const int j ) const { assert(j>=0 && j<4); return v[j]; }
|
||||
inline const typename T::VertexType * cV( const int j ) const { assert(j>=0 && j<4); return v[j]; }
|
||||
|
||||
inline size_t cFtoVi (const int f, const int j) const { assert(f >= 0 && f < 4); assert(j >= 0 && j < 3); return findices[f][j]; }
|
||||
|
||||
|
@ -457,7 +458,8 @@ public:
|
|||
typename T::TetraPointer const cVTp( const int j ) const { assert( j >= 0 && j < 4 ); return _vtp[j]; }
|
||||
|
||||
char & VTi( const int j ) { return _vti[j]; }
|
||||
const char & cVTi( const int j ) const { return _vti[j]; }
|
||||
char VTi( const int j ) const { return _vti[j]; }
|
||||
char cVTi( const int j ) const { return _vti[j]; }
|
||||
|
||||
static bool HasVTAdjacency() { return true; }
|
||||
static bool HasVTAdjacencyOcc() { return false; }
|
||||
|
|
|
@ -572,6 +572,7 @@ public:
|
|||
typename T::TetraPointer &VTp() { return _tp; }
|
||||
typename T::TetraPointer cVTp() const { return _tp; }
|
||||
int &VTi() {return _zp; }
|
||||
int VTi() const { return _zp; }
|
||||
int cVTi() const { return _zp; }
|
||||
static bool HasVTAdjacency() { return true; }
|
||||
static void Name( std::vector< std::string > & name ) { name.push_back( std::string("VTAdj") ); T::Name(name); }
|
||||
|
|
|
@ -142,20 +142,20 @@ public:
|
|||
static const PropDescriptor &VertDesc(int i)
|
||||
{
|
||||
const static PropDescriptor pv[13]={
|
||||
/*00*/ {"vertex", "x", ply::T_FLOAT, PlyType<ScalarType>(), offsetof(LoadPly_VertAux<ScalarType>,p),0,0,0,0,0},
|
||||
/*01*/ {"vertex", "y", ply::T_FLOAT, PlyType<ScalarType>(), offsetof(LoadPly_VertAux<ScalarType>,p) + sizeof(ScalarType),0,0,0,0,0},
|
||||
/*02*/ {"vertex", "z", ply::T_FLOAT, PlyType<ScalarType>(), offsetof(LoadPly_VertAux<ScalarType>,p) + 2 * sizeof(ScalarType),0,0,0,0,0},
|
||||
/*03*/ {"vertex", "flags", ply::T_INT, ply::T_INT, offsetof(LoadPly_VertAux<ScalarType>,flags),0,0,0,0,0},
|
||||
/*04*/ {"vertex", "quality", ply::T_FLOAT, ply::T_FLOAT, offsetof(LoadPly_VertAux<ScalarType>,q),0,0,0,0,0},
|
||||
/*05*/ {"vertex", "red" , ply::T_UCHAR, ply::T_UCHAR, offsetof(LoadPly_VertAux<ScalarType>,r),0,0,0,0,0},
|
||||
/*06*/ {"vertex", "green", ply::T_UCHAR, ply::T_UCHAR, offsetof(LoadPly_VertAux<ScalarType>,g),0,0,0,0,0},
|
||||
/*07*/ {"vertex", "blue" , ply::T_UCHAR, ply::T_UCHAR, offsetof(LoadPly_VertAux<ScalarType>,b),0,0,0,0,0},
|
||||
/*08*/ {"vertex", "alpha" , ply::T_UCHAR, ply::T_UCHAR, offsetof(LoadPly_VertAux<ScalarType>,a),0,0,0,0,0},
|
||||
/*00*/ {"vertex", "x", ply::T_FLOAT, PlyType<ScalarType>(), offsetof(LoadPly_VertAux<ScalarType>,p), 0, 0, 0, 0, 0, 0},
|
||||
/*01*/ {"vertex", "y", ply::T_FLOAT, PlyType<ScalarType>(), offsetof(LoadPly_VertAux<ScalarType>,p) + sizeof(ScalarType), 0, 0, 0, 0, 0, 0},
|
||||
/*02*/ {"vertex", "z", ply::T_FLOAT, PlyType<ScalarType>(), offsetof(LoadPly_VertAux<ScalarType>,p) + 2*sizeof(ScalarType), 0, 0, 0, 0, 0, 0},
|
||||
/*03*/ {"vertex", "flags", ply::T_INT, ply::T_INT, offsetof(LoadPly_VertAux<ScalarType>,flags), 0, 0, 0, 0, 0, 0},
|
||||
/*04*/ {"vertex", "quality", ply::T_FLOAT, PlyType<ScalarType>(), offsetof(LoadPly_VertAux<ScalarType>,q), 0, 0, 0, 0, 0, 0},
|
||||
/*05*/ {"vertex", "red" , ply::T_UCHAR, ply::T_UCHAR, offsetof(LoadPly_VertAux<ScalarType>,r), 0, 0, 0, 0, 0, 0},
|
||||
/*06*/ {"vertex", "green", ply::T_UCHAR, ply::T_UCHAR, offsetof(LoadPly_VertAux<ScalarType>,g), 0, 0, 0, 0, 0, 0},
|
||||
/*07*/ {"vertex", "blue" , ply::T_UCHAR, ply::T_UCHAR, offsetof(LoadPly_VertAux<ScalarType>,b), 0, 0, 0, 0, 0, 0},
|
||||
/*08*/ {"vertex", "alpha" , ply::T_UCHAR, ply::T_UCHAR, offsetof(LoadPly_VertAux<ScalarType>,a), 0, 0, 0, 0, 0, 0},
|
||||
// DOUBLE
|
||||
/*09*/ {"vertex", "x", ply::T_DOUBLE, PlyType<ScalarType>(),offsetof(LoadPly_VertAux<ScalarType>,p),0,0,0,0,0 ,0},
|
||||
/*10*/ {"vertex", "y", ply::T_DOUBLE, PlyType<ScalarType>(),offsetof(LoadPly_VertAux<ScalarType>,p) + sizeof(ScalarType) ,0,0,0,0,0 ,0},
|
||||
/*11*/ {"vertex", "z", ply::T_DOUBLE, PlyType<ScalarType>(),offsetof(LoadPly_VertAux<ScalarType>,p) + 2*sizeof(ScalarType),0,0,0,0,0 ,0},
|
||||
/*12*/ {"vertex", "quality", ply::T_DOUBLE, PlyType<ScalarType>(),offsetof(LoadPly_VertAux<ScalarType>,q),0,0,0,0,0 ,0}
|
||||
/*09*/ {"vertex", "x", ply::T_DOUBLE, PlyType<ScalarType>(),offsetof(LoadPly_VertAux<ScalarType>,p), 0, 0, 0, 0, 0, 0},
|
||||
/*10*/ {"vertex", "y", ply::T_DOUBLE, PlyType<ScalarType>(),offsetof(LoadPly_VertAux<ScalarType>,p) + sizeof(ScalarType), 0, 0, 0, 0, 0, 0},
|
||||
/*11*/ {"vertex", "z", ply::T_DOUBLE, PlyType<ScalarType>(),offsetof(LoadPly_VertAux<ScalarType>,p) + 2*sizeof(ScalarType), 0, 0, 0, 0, 0, 0},
|
||||
/*12*/ {"vertex", "quality", ply::T_DOUBLE, PlyType<ScalarType>(),offsetof(LoadPly_VertAux<ScalarType>,q), 0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
return pv[i];
|
||||
}
|
||||
|
@ -165,16 +165,16 @@ public:
|
|||
{
|
||||
const static PropDescriptor qf[10]=
|
||||
{
|
||||
{"tetra", "vertex_indices", ply::T_INT, ply::T_INT, offsetof(LoadPly_TetraAux,v), 1,0,ply::T_UCHAR,ply::T_UCHAR,offsetof(LoadPly_TetraAux,size) },
|
||||
{"tetra", "flags", ply::T_INT, ply::T_INT, offsetof(LoadPly_TetraAux,flags), 0,0,0,0,0},
|
||||
{"tetra", "quality", ply::T_FLOAT, ply::T_FLOAT, offsetof(LoadPly_TetraAux,q), 0,0,0,0,0},
|
||||
{"tetra", "texcoord", ply::T_FLOAT, ply::T_FLOAT, offsetof(LoadPly_TetraAux,texcoord), 1,0,ply::T_UCHAR,ply::T_UCHAR,offsetof(LoadPly_TetraAux,ntexcoord) },
|
||||
{"tetra", "color", ply::T_FLOAT, ply::T_FLOAT, offsetof(LoadPly_TetraAux,colors), 1,0,ply::T_UCHAR,ply::T_UCHAR,offsetof(LoadPly_TetraAux,ncolors) },
|
||||
{"tetra", "texnumber", ply::T_INT, ply::T_INT, offsetof(LoadPly_TetraAux,texcoordind), 0,0,0,0,0},
|
||||
{"tetra", "red" , ply::T_UCHAR, ply::T_UCHAR, offsetof(LoadPly_TetraAux,r), 0,0,0,0,0},
|
||||
{"tetra", "green", ply::T_UCHAR, ply::T_UCHAR, offsetof(LoadPly_TetraAux,g), 0,0,0,0,0},
|
||||
{"tetra", "blue" , ply::T_UCHAR, ply::T_UCHAR, offsetof(LoadPly_TetraAux,b), 0,0,0,0,0},
|
||||
{"tetra", "alpha" , ply::T_UCHAR, ply::T_UCHAR, offsetof(LoadPly_TetraAux,a), 0,0,0,0,0},
|
||||
{"tetra", "vertex_indices", ply::T_INT, ply::T_INT, offsetof(LoadPly_TetraAux,v), 1, 0, ply::T_UCHAR,ply::T_UCHAR,offsetof(LoadPly_TetraAux,size), 0},
|
||||
{"tetra", "flags", ply::T_INT, ply::T_INT, offsetof(LoadPly_TetraAux,flags), 0, 0, 0, 0, 0, 0},
|
||||
{"tetra", "quality", ply::T_FLOAT, ply::T_FLOAT, offsetof(LoadPly_TetraAux,q), 0, 0, 0, 0, 0, 0},
|
||||
{"tetra", "texcoord", ply::T_FLOAT, ply::T_FLOAT, offsetof(LoadPly_TetraAux,texcoord), 1, 0, ply::T_UCHAR,ply::T_UCHAR,offsetof(LoadPly_TetraAux,ntexcoord), 0},
|
||||
{"tetra", "color", ply::T_FLOAT, ply::T_FLOAT, offsetof(LoadPly_TetraAux,colors), 1, 0, ply::T_UCHAR,ply::T_UCHAR,offsetof(LoadPly_TetraAux,ncolors), 0},
|
||||
{"tetra", "texnumber", ply::T_INT, ply::T_INT, offsetof(LoadPly_TetraAux,texcoordind), 0, 0, 0, 0, 0, 0},
|
||||
{"tetra", "red" , ply::T_UCHAR, ply::T_UCHAR, offsetof(LoadPly_TetraAux,r), 0, 0, 0, 0, 0, 0},
|
||||
{"tetra", "green", ply::T_UCHAR, ply::T_UCHAR, offsetof(LoadPly_TetraAux,g), 0, 0, 0, 0, 0, 0},
|
||||
{"tetra", "blue" , ply::T_UCHAR, ply::T_UCHAR, offsetof(LoadPly_TetraAux,b), 0, 0, 0, 0, 0, 0},
|
||||
{"tetra", "alpha" , ply::T_UCHAR, ply::T_UCHAR, offsetof(LoadPly_TetraAux,a), 0, 0, 0, 0, 0, 0},
|
||||
|
||||
};
|
||||
return qf[i];
|
||||
|
|
Loading…
Reference in New Issue