Corrected some errors in the reflections Has*** functions
This commit is contained in:
parent
62244759fc
commit
865bb26e54
|
@ -24,6 +24,9 @@
|
||||||
History
|
History
|
||||||
|
|
||||||
$Log: not supported by cvs2svn $
|
$Log: not supported by cvs2svn $
|
||||||
|
Revision 1.23 2006/10/27 11:08:18 ganovelli
|
||||||
|
added override to HasFFAdjacency , HasVFAdjacency for the optional attributes (see also complex/trimesh/allocate.h)
|
||||||
|
|
||||||
Revision 1.22 2006/07/10 14:26:22 cignoni
|
Revision 1.22 2006/07/10 14:26:22 cignoni
|
||||||
Minor. Added a disambiguating this at the constructor of trimesh
|
Minor. Added a disambiguating this at the constructor of trimesh
|
||||||
|
|
||||||
|
@ -313,6 +316,9 @@ ScalarType Volume()
|
||||||
|
|
||||||
}; // end class Mesh
|
}; // end class Mesh
|
||||||
|
|
||||||
|
template < class VertContainerType, class FaceContainerType >
|
||||||
|
bool HasPerVertexQuality (const TriMesh < VertContainerType , FaceContainerType> & /*m*/) {return VertContainerType::value_type::HasQuality();}
|
||||||
|
|
||||||
template < class VertContainerType, class FaceContainerType >
|
template < class VertContainerType, class FaceContainerType >
|
||||||
bool HasPerWedgeTexture (const TriMesh < VertContainerType , FaceContainerType> & /*m*/) {return FaceContainerType::value_type::HasWedgeTexture();}
|
bool HasPerWedgeTexture (const TriMesh < VertContainerType , FaceContainerType> & /*m*/) {return FaceContainerType::value_type::HasWedgeTexture();}
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,9 @@
|
||||||
History
|
History
|
||||||
|
|
||||||
$Log: not supported by cvs2svn $
|
$Log: not supported by cvs2svn $
|
||||||
|
Revision 1.17 2006/10/31 16:02:18 ganovelli
|
||||||
|
vesione 2005 compliant
|
||||||
|
|
||||||
Revision 1.16 2006/10/27 14:15:10 ganovelli
|
Revision 1.16 2006/10/27 14:15:10 ganovelli
|
||||||
added overrides to HasFFAddAdjacency and HasVFAddAdjacency
|
added overrides to HasFFAddAdjacency and HasVFAddAdjacency
|
||||||
|
|
||||||
|
@ -430,6 +433,8 @@ public:
|
||||||
static bool HasFaceNormalOcf() { return false; }
|
static bool HasFaceNormalOcf() { return false; }
|
||||||
static bool HasFaceMarkOcf() { return false; }
|
static bool HasFaceMarkOcf() { return false; }
|
||||||
static bool HasWedgeTextureOcf() { return false; }
|
static bool HasWedgeTextureOcf() { return false; }
|
||||||
|
static bool HasFFAdjacencyOcf() { return false; }
|
||||||
|
static bool HasVFAdjacencyOcf() { return false; }
|
||||||
|
|
||||||
inline int Index() const {
|
inline int Index() const {
|
||||||
typename T::FaceType const *tp=static_cast<typename T::FaceType const *>(this);
|
typename T::FaceType const *tp=static_cast<typename T::FaceType const *>(this);
|
||||||
|
|
|
@ -24,6 +24,9 @@
|
||||||
History
|
History
|
||||||
|
|
||||||
$Log: not supported by cvs2svn $
|
$Log: not supported by cvs2svn $
|
||||||
|
Revision 1.4 2006/10/31 16:02:59 ganovelli
|
||||||
|
vesione 2005 compliant
|
||||||
|
|
||||||
Revision 1.3 2006/02/28 11:59:55 ponchio
|
Revision 1.3 2006/02/28 11:59:55 ponchio
|
||||||
g++ compliance:
|
g++ compliance:
|
||||||
|
|
||||||
|
@ -66,6 +69,7 @@ class vector_ocf: public std::vector<VALUE_TYPE> {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
vector_ocf():std::vector<VALUE_TYPE>(){
|
vector_ocf():std::vector<VALUE_TYPE>(){
|
||||||
|
QualityEnabled=false;
|
||||||
ColorEnabled=false;
|
ColorEnabled=false;
|
||||||
NormalEnabled=false;
|
NormalEnabled=false;
|
||||||
VFAdjacencyEnabled=false;
|
VFAdjacencyEnabled=false;
|
||||||
|
@ -107,6 +111,20 @@ public:
|
||||||
////////////////////////////////////////
|
////////////////////////////////////////
|
||||||
// Enabling Eunctions
|
// Enabling Eunctions
|
||||||
|
|
||||||
|
bool IsQualityEnabled() const {return QualityEnabled;}
|
||||||
|
void EnableQuality() {
|
||||||
|
assert(VALUE_TYPE::HasQualityOcf());
|
||||||
|
QualityEnabled=true;
|
||||||
|
QV.resize((*this).size());
|
||||||
|
}
|
||||||
|
|
||||||
|
void DisableQuality() {
|
||||||
|
assert(VALUE_TYPE::HasQualityOcf());
|
||||||
|
QualityEnabled=false;
|
||||||
|
QV.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IsColorEnabled() const {return ColorEnabled;}
|
||||||
void EnableColor() {
|
void EnableColor() {
|
||||||
assert(VALUE_TYPE::HasColorOcf());
|
assert(VALUE_TYPE::HasColorOcf());
|
||||||
ColorEnabled=true;
|
ColorEnabled=true;
|
||||||
|
@ -119,6 +137,7 @@ void DisableColor() {
|
||||||
CV.clear();
|
CV.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsNormalEnabled() const {return NormalEnabled;}
|
||||||
void EnableNormal() {
|
void EnableNormal() {
|
||||||
assert(VALUE_TYPE::HasNormalOcf());
|
assert(VALUE_TYPE::HasNormalOcf());
|
||||||
NormalEnabled=true;
|
NormalEnabled=true;
|
||||||
|
@ -152,10 +171,12 @@ struct VFAdjType {
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
std::vector<typename VALUE_TYPE::QualityType> QV;
|
||||||
std::vector<typename VALUE_TYPE::ColorType> CV;
|
std::vector<typename VALUE_TYPE::ColorType> CV;
|
||||||
std::vector<typename VALUE_TYPE::NormalType> NV;
|
std::vector<typename VALUE_TYPE::NormalType> NV;
|
||||||
std::vector<struct VFAdjType> AV;
|
std::vector<struct VFAdjType> AV;
|
||||||
|
|
||||||
|
bool QualityEnabled;
|
||||||
bool ColorEnabled;
|
bool ColorEnabled;
|
||||||
bool NormalEnabled;
|
bool NormalEnabled;
|
||||||
bool VFAdjacencyEnabled;
|
bool VFAdjacencyEnabled;
|
||||||
|
@ -220,6 +241,19 @@ public:
|
||||||
|
|
||||||
template <class T> class Color4bOcf: public ColorOcf<vcg::Color4b, T> {};
|
template <class T> class Color4bOcf: public ColorOcf<vcg::Color4b, T> {};
|
||||||
|
|
||||||
|
///*-------------------------- QUALITY ----------------------------------*/
|
||||||
|
|
||||||
|
template <class A, class T> class QualityOcf: public T {
|
||||||
|
public:
|
||||||
|
typedef A QualityType;
|
||||||
|
QualityType &Q() { assert((*this).Base().QualityEnabled); return (*this).Base().QV[(*this).Index()()]; }
|
||||||
|
static bool HasQuality() { return true; }
|
||||||
|
static bool HasQualityOcf() { return true; }
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class T> class QualityfOcf: public QualityOcf<float, T> {};
|
||||||
|
|
||||||
|
|
||||||
///*-------------------------- InfoOpt ----------------------------------*/
|
///*-------------------------- InfoOpt ----------------------------------*/
|
||||||
|
|
||||||
template < class T> class InfoOcf: public T {
|
template < class T> class InfoOcf: public T {
|
||||||
|
@ -236,6 +270,17 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
} // end namespace vert
|
} // end namespace vert
|
||||||
|
|
||||||
|
namespace tri
|
||||||
|
{
|
||||||
|
template < class VertType, class FaceContainerType >
|
||||||
|
bool HasPerVertexQuality (const TriMesh < vert::vector_ocf< VertType > , FaceContainerType > & m)
|
||||||
|
{
|
||||||
|
if(VertType::HasQualityOcf()) return m.vert.IsQualityEnabled();
|
||||||
|
else return VertexType::HasQuality();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}// end namespace vcg
|
}// end namespace vcg
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue