Fixed wrong typedefs in the per vertex CurvatureDir component (ScalarType).

Added missing typedef in EmptyCore.
Added typedef WedgeColorType and WedgeNormalType.
This commit is contained in:
Gianpaolo Palma 2015-10-26 12:52:44 +00:00
parent d015efca10
commit 684fe8d464
5 changed files with 75 additions and 71 deletions

View File

@ -47,10 +47,11 @@ public:
static bool HasFVAdjacency() { return false; }
typedef typename T::VertexType::NormalType NormalType;
typedef NormalType WedgeNormalType;
NormalType &N() { static NormalType dummy_normal(0, 0, 0); assert(0); return dummy_normal; }
NormalType cN() const { static NormalType dummy_normal(0, 0, 0); return dummy_normal; }
NormalType &WN(int) { static NormalType dummy_normal(0, 0, 0); assert(0); return dummy_normal; }
NormalType cWN(int) const { static NormalType dummy_normal(0, 0, 0); return dummy_normal; }
WedgeNormalType &WN(int) { static NormalType dummy_normal(0, 0, 0); assert(0); return dummy_normal; }
WedgeNormalType cWN(int) const { static NormalType dummy_normal(0, 0, 0); return dummy_normal; }
typedef int WedgeTexCoordType;
@ -58,7 +59,7 @@ public:
TexCoordType &WT(const int) { static TexCoordType dummy_texture; assert(0); return dummy_texture;}
TexCoordType const &cWT(const int) const { static TexCoordType dummy_texture; return dummy_texture;}
typedef int FlagType;
int &Flags() { static int dummyflags(0); assert(0); return dummyflags; }
int cFlags() const { return 0; }
static bool HasFlags() { return false; }
@ -71,11 +72,11 @@ public:
typedef float QualityType;
typedef Point3f Quality3Type;
typedef vcg::Color4b ColorType;
typedef ColorType WedgeColorType;
ColorType &C() { static ColorType dumcolor(vcg::Color4b::White); assert(0); return dumcolor; }
ColorType cC() const { static ColorType dumcolor(vcg::Color4b::White); assert(0); return dumcolor; }
ColorType &WC(const int) { static ColorType dumcolor(vcg::Color4b::White); assert(0); return dumcolor; }
ColorType cWC(const int) const { static ColorType dumcolor(vcg::Color4b::White); assert(0); return dumcolor; }
WedgeColorType &WC(const int) { static ColorType dumcolor(vcg::Color4b::White); assert(0); return dumcolor; }
WedgeColorType cWC(const int) const { static ColorType dumcolor(vcg::Color4b::White); assert(0); return dumcolor; }
QualityType &Q() { static QualityType dummyQuality(0); assert(0); return dummyQuality; }
QualityType cQ() const { static QualityType dummyQuality(0); assert(0); return dummyQuality; }
Quality3Type &Q3() { static Quality3Type dummyQuality3(0,0,0); assert(0); return dummyQuality3; }
@ -128,17 +129,18 @@ public:
static bool HasFEAdjacency() { return false; }
static bool HasFHAdjacency() { return false; }
typedef int CurvatureDirType;
typedef typename T::VertexType::CurvatureDirType CurvatureDirType;
typedef typename T::CoordType CurVecType;
typedef typename T::ScalarType CurScalarType;
typename CurVecType &PD1() { static typename T::CoordType dummy(0, 0, 0); assert(0); return dummy; }
typename CurVecType &PD2() { static typename T::CoordType dummy(0, 0, 0); assert(0); return dummy; }
typename CurVecType cPD1() const { static typename T::CoordType dummy(0, 0, 0); assert(0); return dummy; }
typename CurVecType cPD2() const { static typename T::CoordType dummy(0, 0, 0); assert(0); return dummy; }
typename T::CoordType &PD1() { static typename T::CoordType dummy(0,0,0); assert(0); return dummy;}
typename T::CoordType &PD2() { static typename T::CoordType dummy(0,0,0); assert(0); return dummy;}
typename T::CoordType cPD1() const { static typename T::CoordType dummy(0,0,0); assert(0); return dummy;}
typename T::CoordType cPD2() const { static typename T::CoordType dummy(0,0,0); assert(0); return dummy;}
typename T::ScalarType &K1() { static typename T::ScalarType dummy(0); assert(0); return dummy;}
typename T::ScalarType &K2() { static typename T::ScalarType dummy(0); assert(0); return dummy;}
typename T::ScalarType cK1() const { static typename T::ScalarType dummy(0); assert(0); return dummy;}
typename T::ScalarType cK2() const { static typename T::ScalarType dummy(0); assert(0); return dummy;}
typename CurScalarType &K1() { static typename T::ScalarType dummy(0); assert(0); return dummy; }
typename CurScalarType &K2() { static typename T::ScalarType dummy(0); assert(0); return dummy; }
typename CurScalarType cK1() const { static typename T::ScalarType dummy(0); assert(0); return dummy; }
typename CurScalarType cK2() const { static typename T::ScalarType dummy(0); assert(0); return dummy; }
static bool HasCurvatureDir() { return false; }
@ -230,9 +232,9 @@ private:
template <class T> class WedgeNormal: public T {
public:
typedef typename T::VertexType::NormalType NormalType;
inline NormalType &WN(int j) { return _wnorm[j]; }
inline NormalType cWN(int j) const { return _wnorm[j]; }
typedef typename T::VertexType::NormalType WedgeNormalType;
inline WedgeNormalType &WN(int j) { return _wnorm[j]; }
inline WedgeNormalType cWN(int j) const { return _wnorm[j]; }
template <class RightValueType>
void ImportData(const RightValueType & rightF){ if(rightF.IsWedgeNormalEnabled()) for (int i=0; i<3; ++i) { WN(i) = rightF.cWN(i); } T::ImportData(rightF);}
inline void Alloc(const int & ns){T::Alloc(ns);}
@ -241,14 +243,14 @@ public:
static void Name(std::vector<std::string> & name){name.push_back(std::string("WedgeNormal"));T::Name(name);}
private:
NormalType _wnorm[3];
WedgeNormalType _wnorm[3];
};
template <class A, class T> class WedgeRealNormal: public T {
public:
typedef A NormalType;
inline NormalType &WN(int i) { return _wn[i]; }
inline NormalType cWN(int i) const { return _wn[i]; }
typedef A WedgeNormalType;
inline WedgeNormalType &WN(int i) { return _wn[i]; }
inline WedgeNormalType cWN(int i) const { return _wn[i]; }
template <class RightValueType>
void ImportData(const RightValueType & rightF){ if(RightValueType::HasWedgeNormal()) for (int i=0; i<3; ++i) { WN(i) = rightF.cWN(i); } T::ImportData(rightF);}
inline void Alloc(const int & ns){T::Alloc(ns);}
@ -257,7 +259,7 @@ public:
static void Name(std::vector<std::string> & name){name.push_back(std::string("WedgeRealNormal"));T::Name(name);}
private:
NormalType _wn[3];
WedgeNormalType _wn[3];
};
template <class TT> class WedgeRealNormal3s: public WedgeRealNormal<vcg::Point3s, TT> {
@ -319,6 +321,7 @@ This component stores a 32 bit array of bit flags. These bit flags are used for
template <class T> class BitFlags: public T {
public:
BitFlags():_flags(0) {}
typedef int FlagType;
int &Flags() {return _flags; }
int cFlags() const {return _flags; }
template <class RightValueType>
@ -359,9 +362,9 @@ private:
template <class A, class T> class WedgeColor: public T {
public:
typedef A ColorType;
ColorType &WC(int i) { return _color[i]; }
ColorType cWC(int i) const { return _color[i]; }
typedef A WedgeColorType;
WedgeColorType &WC(int i) { return _color[i]; }
WedgeColorType cWC(int i) const { return _color[i]; }
template <class RightValueType>
void ImportData(const RightValueType & rightF){
@ -376,7 +379,7 @@ public:
static void Name(std::vector<std::string> & name){name.push_back(std::string("WedgeColor"));T::Name(name);}
private:
ColorType _color[3];
WedgeColorType _color[3];
};
template <class T> class WedgeColor4b: public WedgeColor<vcg::Color4b, T> {

View File

@ -641,9 +641,9 @@ template <class T> class WedgeTexCoordfOcf: public WedgeTexCoordOcf<TexCoord2<fl
template <class A, class TT> class WedgeColorOcf: public TT {
public:
WedgeColorOcf(){ }
typedef A ColorType;
ColorType &WC(const int i) { assert((*this).Base().WedgeColorEnabled); return (*this).Base().WCV[(*this).Index()].wc[i]; }
const ColorType cWC(const int i) const { assert((*this).Base().WedgeColorEnabled); return (*this).Base().WCV[(*this).Index()].wc[i]; }
typedef A WedgeColorType;
WedgeColorType &WC(const int i) { assert((*this).Base().WedgeColorEnabled); return (*this).Base().WCV[(*this).Index()].wc[i]; }
const WedgeColorType cWC(const int i) const { assert((*this).Base().WedgeColorEnabled); return (*this).Base().WCV[(*this).Index()].wc[i]; }
template <class RightFaceType>
void ImportData(const RightFaceType & rightF){
if(this->IsWedgeColorEnabled() && rightF.IsWedgeColorEnabled())
@ -661,9 +661,9 @@ template <class T> class WedgeColor4bOcf: public WedgeColorOcf<vcg::Color4b, T>
template <class A, class TT> class WedgeNormalOcf: public TT {
public:
WedgeNormalOcf(){ }
typedef A NormalType;
NormalType &WN(const int i) { assert((*this).Base().WedgeNormalEnabled); return (*this).Base().WNV[(*this).Index()].wn[i]; }
NormalType const &cWN(const int i) const { assert((*this).Base().WedgeNormalEnabled); return (*this).Base().WNV[(*this).Index()].wn[i]; }
typedef A WedgeNormalType;
WedgeNormalType &WN(const int i) { assert((*this).Base().WedgeNormalEnabled); return (*this).Base().WNV[(*this).Index()].wn[i]; }
WedgeNormalType const &cWN(const int i) const { assert((*this).Base().WedgeNormalEnabled); return (*this).Base().WNV[(*this).Index()].wn[i]; }
template <class RightFaceType>
void ImportData(const RightFaceType & rightF){
if(this->IsWedgeNormalEnabled() && rightF.IsWedgeNormalEnabled())

View File

@ -128,6 +128,7 @@ public:
static bool HasVHAdjacency() { return false; }
typedef float CurScalarType;
typedef float ScalarTypeCur;
typedef Point3f CurVecType;
typedef Point2f CurvatureType;
float &Kh() { static float dummy = 0.f; assert(0);return dummy;}
@ -399,13 +400,13 @@ public: static void Name(std::vector<std::string> & name){name.push_back(std::st
template <class A, class TT> class Curvature: public TT {
public:
typedef Point2<A> CurvatureType;
typedef typename CurvatureType::ScalarType ScalarType;
const ScalarType &Kh() const { return _hk[0];}
const ScalarType &Kg() const { return _hk[1];}
ScalarType &Kh() { return _hk[0];}
ScalarType &Kg() { return _hk[1];}
ScalarType cKh() const { return _hk[0];}
ScalarType cKg() const { return _hk[1];}
typedef typename CurvatureType::ScalarType ScalarTypeCur;
const ScalarTypeCur &Kh() const { return _hk[0]; }
const ScalarTypeCur &Kg() const { return _hk[1]; }
ScalarTypeCur &Kh() { return _hk[0]; }
ScalarTypeCur &Kg() { return _hk[1]; }
ScalarTypeCur cKh() const { return _hk[0]; }
ScalarTypeCur cKg() const { return _hk[1]; }
template < class RightValueType>
void ImportData(const RightValueType & rVert ) {
@ -440,18 +441,18 @@ public: static void Name(std::vector<std::string> & name){name.push_back(std::st
template <class A, class TT> class CurvatureDir: public TT {
public:
typedef A CurvatureDirType;
typedef typename CurvatureDirType::VecType VecType;
typedef typename CurvatureDirType::ScalarType ScalarType;
typedef typename CurvatureDirType::VecType CurVecType;
typedef typename CurvatureDirType::ScalarType CurScalarType;
VecType &PD1(){ return _curv.max_dir;}
VecType &PD2(){ return _curv.min_dir;}
const VecType &cPD1() const {return _curv.max_dir;}
const VecType &cPD2() const {return _curv.min_dir;}
CurVecType &PD1(){ return _curv.max_dir; }
CurVecType &PD2(){ return _curv.min_dir; }
const CurVecType &cPD1() const { return _curv.max_dir; }
const CurVecType &cPD2() const { return _curv.min_dir; }
ScalarType &K1(){ return _curv.k1;}
ScalarType &K2(){ return _curv.k2;}
const ScalarType &cK1() const {return _curv.k1;}
const ScalarType &cK2() const {return _curv.k2;}
CurScalarType &K1(){ return _curv.k1; }
CurScalarType &K2(){ return _curv.k2; }
const CurScalarType &cK1() const { return _curv.k1; }
const CurScalarType &cK2() const { return _curv.k2; }
template < class RightValueType>
void ImportData(const RightValueType & rVert ) {
if(rVert.IsCurvatureDirEnabled()) {

View File

@ -144,12 +144,12 @@ template <class A, class TT> class CurvatureOcc: public TT {
public:
typedef Point2<A> CurvatureTypeOcc;
typedef typename TT::VertType VertType;
typedef typename CurvatureTypeOcc::ScalarType ScalarType;
typedef typename CurvatureTypeOcc::ScalarType ScalarTypeCur;
ScalarType &H(){ return CAT< vector_occ<VertType>,CurvatureTypeOcc>::Instance()->Get((VertType*)this)[0];}
ScalarType &K(){ return CAT< vector_occ<VertType>,CurvatureTypeOcc>::Instance()->Get((VertType*)this)[1];}
const ScalarType &cH() const { return CAT< vector_occ<VertType>,CurvatureTypeOcc>::Instance()->Get((VertType*)this)[0];}
const ScalarType &cK() const { return CAT< vector_occ<VertType>,CurvatureTypeOcc>::Instance()->Get((VertType*)this)[1];}
ScalarTypeCur &H(){ return CAT< vector_occ<VertType>, CurvatureTypeOcc>::Instance()->Get((VertType*)this)[0]; }
ScalarTypeCur &K(){ return CAT< vector_occ<VertType>, CurvatureTypeOcc>::Instance()->Get((VertType*)this)[1]; }
const ScalarTypeCur &cH() const { return CAT< vector_occ<VertType>, CurvatureTypeOcc>::Instance()->Get((VertType*)this)[0]; }
const ScalarTypeCur &cK() const { return CAT< vector_occ<VertType>, CurvatureTypeOcc>::Instance()->Get((VertType*)this)[1]; }
template <class LeftV>
void ImportData(const LeftV & leftV){
@ -188,19 +188,19 @@ struct CurvatureDirTypeOcc{
template <class A, class TT> class CurvatureDirOcc: public TT {
public:
typedef A CurvatureDirTypeOcc;
typedef typename CurvatureDirTypeOcc::VecType VecType;
typedef typename CurvatureDirTypeOcc::ScalarType ScalarType;
typedef typename CurvatureDirTypeOcc::VecType CurVecType;
typedef typename CurvatureDirTypeOcc::ScalarType CurScalarType;
typedef typename TT::VertType VertType;
VecType &PD1(){ return CAT< vector_occ<VertType>,CurvatureDirTypeOcc>::Instance()->Get((VertType*)this).max_dir;}
VecType &PD2(){ return CAT< vector_occ<VertType>,CurvatureDirTypeOcc>::Instance()->Get((VertType*)this).min_dir;}
const VecType &cPD1() const {return CAT< vector_occ<VertType>,CurvatureDirTypeOcc>::Instance()->Get((VertType*)this).max_dir;}
const VecType &cPD2() const {return CAT< vector_occ<VertType>,CurvatureDirTypeOcc>::Instance()->Get((VertType*)this).min_dir;}
CurVecType &PD1(){ return CAT< vector_occ<VertType>,CurvatureDirTypeOcc>::Instance()->Get((VertType*)this).max_dir;}
CurVecType &PD2(){ return CAT< vector_occ<VertType>,CurvatureDirTypeOcc>::Instance()->Get((VertType*)this).min_dir;}
const CurVecType &cPD1() const {return CAT< vector_occ<VertType>,CurvatureDirTypeOcc>::Instance()->Get((VertType*)this).max_dir;}
const CurVecType &cPD2() const {return CAT< vector_occ<VertType>,CurvatureDirTypeOcc>::Instance()->Get((VertType*)this).min_dir;}
ScalarType &K1(){ return CAT< vector_occ<VertType>,CurvatureDirTypeOcc>::Instance()->Get((VertType*)this).k1;}
ScalarType &K2(){ return CAT< vector_occ<VertType>,CurvatureDirTypeOcc>::Instance()->Get((VertType*)this).k2;}
const ScalarType &cK1() const {return CAT< vector_occ<VertType>,CurvatureDirTypeOcc>::Instance()->Get((VertType*)this).k1;}
const ScalarType &cK2()const {return CAT< vector_occ<VertType>,CurvatureDirTypeOcc>::Instance()->Get((VertType*)this).k2;}
CurScalarType &K1(){ return CAT< vector_occ<VertType>,CurvatureDirTypeOcc>::Instance()->Get((VertType*)this).k1;}
CurScalarType &K2(){ return CAT< vector_occ<VertType>,CurvatureDirTypeOcc>::Instance()->Get((VertType*)this).k2;}
const CurScalarType &cK1() const {return CAT< vector_occ<VertType>,CurvatureDirTypeOcc>::Instance()->Get((VertType*)this).k1;}
const CurScalarType &cK2()const {return CAT< vector_occ<VertType>,CurvatureDirTypeOcc>::Instance()->Get((VertType*)this).k2;}
static bool HasCurvatureDir() { return true; }
static bool HasCurvatureDirOcc() { return true; }

View File

@ -431,12 +431,12 @@ public:
template <class A, class TT> class CurvatureOcf: public TT {
public:
typedef Point2<A> CurvatureType;
typedef typename CurvatureType::ScalarType CurScalarType;
typedef typename CurvatureType::ScalarType ScalarTypeCur;
CurScalarType &Kh(){ assert((*this).Base().CurvatureEnabled); return (*this).Base().CuV[(*this).Index()][0];}
CurScalarType &Kg(){ assert((*this).Base().CurvatureEnabled); return (*this).Base().CuV[(*this).Index()][1];}
CurScalarType cKh() const { assert((*this).Base().CurvatureEnabled); return (*this).Base().CuV[(*this).Index()][0];}
CurScalarType cKg() const { assert((*this).Base().CurvatureEnabled); return (*this).Base().CuV[(*this).Index()][1];}
ScalarTypeCur &Kh(){ assert((*this).Base().CurvatureEnabled); return (*this).Base().CuV[(*this).Index()][0]; }
ScalarTypeCur &Kg(){ assert((*this).Base().CurvatureEnabled); return (*this).Base().CuV[(*this).Index()][1]; }
ScalarTypeCur cKh() const { assert((*this).Base().CurvatureEnabled); return (*this).Base().CuV[(*this).Index()][0]; }
ScalarTypeCur cKg() const { assert((*this).Base().CurvatureEnabled); return (*this).Base().CuV[(*this).Index()][1]; }
template <class RightVertexType>
void ImportData(const RightVertexType & rightV){