Texture coord name change! "TCoord" and "Texture" are BAD. "TexCoord" is GOOD.

This commit is contained in:
mtarini 2007-03-12 15:37:19 +00:00
parent 8fed8aeed3
commit 22fd220c6f
6 changed files with 51 additions and 36 deletions

View File

@ -1,4 +1,4 @@
/**************************************************************************** /***********F*****************************************************************
* VCGLib o o * * VCGLib o o *
* Visual and Computer Graphics Library o o * * Visual and Computer Graphics Library o o *
* _ O _ * * _ O _ *
@ -24,6 +24,9 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.15 2007/01/18 18:15:14 cignoni
added missing typenames
Revision 1.14 2007/01/17 14:31:47 giec Revision 1.14 2007/01/17 14:31:47 giec
Added TrSplit function. Added TrSplit function.
@ -77,7 +80,7 @@ first working version
#include <vector> #include <vector>
#include <vcg/space/sphere3.h> #include <vcg/space/sphere3.h>
#include <vcg/space/plane3.h> #include <vcg/space/plane3.h>
#include <vcg/space/tcoord2.h> #include <vcg/space/texcoord2.h>
#include <vcg/space/color4.h> #include <vcg/space/color4.h>
#include <vcg/simplex/face/pos.h> #include <vcg/simplex/face/pos.h>
#include<vcg/complex/trimesh/allocate.h> #include<vcg/complex/trimesh/allocate.h>
@ -149,9 +152,9 @@ struct MidPoint : public std::unary_function<face::Pos<typename MESH_TYPE::Fac
} }
template<class FL_TYPE> template<class FL_TYPE>
TCoord2<FL_TYPE,1> WedgeInterp(TCoord2<FL_TYPE,1> &t0, TCoord2<FL_TYPE,1> &t1) TexCoord2<FL_TYPE,1> WedgeInterp(TexCoord2<FL_TYPE,1> &t0, TexCoord2<FL_TYPE,1> &t1)
{ {
TCoord2<FL_TYPE,1> tmp; TexCoord2<FL_TYPE,1> tmp;
assert(t0.n()== t1.n()); assert(t0.n()== t1.n());
tmp.n()=t0.n(); tmp.n()=t0.n();
tmp.t()=(t0.t()+t1.t())/2.0; tmp.t()=(t0.t()+t1.t())/2.0;
@ -209,9 +212,9 @@ struct MidPointArc : public std::unary_function<face::Pos<typename MESH_TYPE::Fa
} }
template<class FL_TYPE> template<class FL_TYPE>
TCoord2<FL_TYPE,1> WedgeInterp(TCoord2<FL_TYPE,1> &t0, TCoord2<FL_TYPE,1> &t1) TexCoord2<FL_TYPE,1> WedgeInterp(TexCoord2<FL_TYPE,1> &t0, TexCoord2<FL_TYPE,1> &t1)
{ {
TCoord2<FL_TYPE,1> tmp; TexCoord2<FL_TYPE,1> tmp;
assert(t0.n()== t1.n()); assert(t0.n()== t1.n());
tmp.n()=t0.n(); tmp.n()=t0.n();
tmp.t()=(t0.t()+t1.t())/2.0; tmp.t()=(t0.t()+t1.t())/2.0;
@ -434,7 +437,7 @@ bool RefineE(MESH_TYPE &m, MIDPOINT mid, EDGEPRED ep,bool RefineSelected=false,
if(RefineSelected) (*nf[i]).SetS(); if(RefineSelected) (*nf[i]).SetS();
} }
if(tri::HasPerWedgeTexture(m)) if(tri::HasPerWedgeTexCoord(m))
for(i=0;i<3;++i) { for(i=0;i<3;++i) {
wtt[i]=(*fi).WT(i); wtt[i]=(*fi).WT(i);
wtt[3+i]=mid.WedgeInterp((*fi).WT(i),(*fi).WT((i+1)%3)); wtt[3+i]=mid.WedgeInterp((*fi).WT(i),(*fi).WT((i+1)%3));
@ -445,7 +448,7 @@ bool RefineE(MESH_TYPE &m, MIDPOINT mid, EDGEPRED ep,bool RefineSelected=false,
for(j=0;j<3;++j){ for(j=0;j<3;++j){
(*nf[i]).V(j)=&*vv[SplitTab[ind].TV[i][j]]; (*nf[i]).V(j)=&*vv[SplitTab[ind].TV[i][j]];
if(tri::HasPerWedgeTexture(m)) //analogo ai vertici... if(tri::HasPerWedgeTexCoord(m)) //analogo ai vertici...
(*nf[i]).WT(j)=wtt[SplitTab[ind].TV[i][j]]; (*nf[i]).WT(j)=wtt[SplitTab[ind].TV[i][j]];
assert((*nf[i]).V(j)!=0); assert((*nf[i]).V(j)!=0);
@ -464,7 +467,7 @@ bool RefineE(MESH_TYPE &m, MIDPOINT mid, EDGEPRED ep,bool RefineSelected=false,
{ // swap the last two triangles { // swap the last two triangles
(*nf[2]).V(1)=(*nf[1]).V(0); (*nf[2]).V(1)=(*nf[1]).V(0);
(*nf[1]).V(1)=(*nf[2]).V(0); (*nf[1]).V(1)=(*nf[2]).V(0);
if(tri::HasPerWedgeTexture(m)){ //analogo ai vertici... if(tri::HasPerWedgeTexCoord(m)){ //analogo ai vertici...
(*nf[2]).WT(1)=(*nf[1]).WT(0); (*nf[2]).WT(1)=(*nf[1]).WT(0);
(*nf[1]).WT(1)=(*nf[2]).WT(0); (*nf[1]).WT(1)=(*nf[2]).WT(0);
} }
@ -568,9 +571,9 @@ struct MidPointButterfly : public std::unary_function<face::Pos<typename MESH_TY
} }
template<class FL_TYPE> template<class FL_TYPE>
TCoord2<FL_TYPE,1> WedgeInterp(TCoord2<FL_TYPE,1> &t0, TCoord2<FL_TYPE,1> &t1) TexCoord2<FL_TYPE,1> WedgeInterp(TexCoord2<FL_TYPE,1> &t0, TexCoord2<FL_TYPE,1> &t1)
{ {
TCoord2<FL_TYPE,1> tmp; TexCoord2<FL_TYPE,1> tmp;
assert(t0.n()== t1.n()); assert(t0.n()== t1.n());
tmp.n()=t0.n(); tmp.n()=t0.n();
tmp.t()=(t0.t()+t1.t())/2.0; tmp.t()=(t0.t()+t1.t())/2.0;
@ -733,9 +736,9 @@ struct MidPointPlane : public std::unary_function<face::Pos<typename MESH_TYPE::
} }
template<class FL_TYPE> template<class FL_TYPE>
TCoord2<FL_TYPE,1> WedgeInterp(TCoord2<FL_TYPE,1> &t0, TCoord2<FL_TYPE,1> &t1) TexCoord2<FL_TYPE,1> WedgeInterp(TexCoord2<FL_TYPE,1> &t0, TexCoord2<FL_TYPE,1> &t1)
{ {
TCoord2<FL_TYPE,1> tmp; TexCoord2<FL_TYPE,1> tmp;
assert(t0.n()== t1.n()); assert(t0.n()== t1.n());
tmp.n()=t0.n(); tmp.n()=t0.n();
tmp.t()=(t0.t()+t1.t())/2.0; tmp.t()=(t0.t()+t1.t())/2.0;
@ -780,9 +783,9 @@ struct MidPointSphere : public std::unary_function<face::Pos<typename MESH_TYPE:
} }
template<class FL_TYPE> template<class FL_TYPE>
TCoord2<FL_TYPE,1> WedgeInterp(TCoord2<FL_TYPE,1> &t0, TCoord2<FL_TYPE,1> &t1) TexCoord2<FL_TYPE,1> WedgeInterp(TexCoord2<FL_TYPE,1> &t0, TexCoord2<FL_TYPE,1> &t1)
{ {
TCoord2<FL_TYPE,1> tmp; TexCoord2<FL_TYPE,1> tmp;
assert(t0.n()== t1.n()); assert(t0.n()== t1.n());
tmp.n()=t0.n(); tmp.n()=t0.n();
tmp.t()=(t0.t()+t1.t())/2.0; tmp.t()=(t0.t()+t1.t())/2.0;

View File

@ -24,6 +24,9 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.11 2006/10/07 10:02:16 cignoni
Added missing typename for interp.parameters
Revision 1.10 2005/11/30 14:05:04 ponchio Revision 1.10 2005/11/30 14:05:04 ponchio
Fixed some UberZ fuynctions and non defined _flags Fixed some UberZ fuynctions and non defined _flags
@ -60,7 +63,7 @@ created
#define __VCGLIB__EDGE_TYPE_BASE #define __VCGLIB__EDGE_TYPE_BASE
#include <vcg/space/box3.h> #include <vcg/space/box3.h>
#include <vcg/space/tcoord2.h> #include <vcg/space/texcoord2.h>
namespace vcg { namespace vcg {
@ -71,7 +74,7 @@ namespace vcg {
This is the base class for definition of a face of the mesh. This is the base class for definition of a face of the mesh.
@param SVTYPE (Templete Parameter) Specifies the vertex class type. @param SVTYPE (Templete Parameter) Specifies the vertex class type.
*/ */
template <class EDGENAME, class SVTYPE, class TCTYPE = TCoord2<float,1> > class EDGE_TYPE template <class EDGENAME, class SVTYPE, class TCTYPE = TexCoord2<float,1> > class EDGE_TYPE
{ {
public: public:
/// The base type of the segment /// The base type of the segment

View File

@ -24,6 +24,9 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.42 2007/02/20 14:07:53 ganovelli
added QualityType to comply faceplus type
Revision 1.41 2007/01/13 00:25:36 cignoni Revision 1.41 2007/01/13 00:25:36 cignoni
Added #ifdefs to guarantee that ComputeNormal would be defined only once Added #ifdefs to guarantee that ComputeNormal would be defined only once
@ -154,7 +157,7 @@ First commit...
#include <vcg/math/base.h> #include <vcg/math/base.h>
#include <vcg/space/box3.h> #include <vcg/space/box3.h>
#include <vcg/space/tcoord2.h> #include <vcg/space/texcoord2.h>
#include <vcg/space/triangle3.h> #include <vcg/space/triangle3.h>
#include <vcg/space/sphere3.h> #include <vcg/space/sphere3.h>
#include <vcg/space/color4.h> #include <vcg/space/color4.h>
@ -176,7 +179,7 @@ class DUMMYTETRATYPE;
* directory. Each file specify a class type with the desired fields. So for example * directory. Each file specify a class type with the desired fields. So for example
* including 'vcg/simplex/face/with/FCFN.h' allow you to use the class FaceFCFN that has per-face color and normal stored inside. * including 'vcg/simplex/face/with/FCFN.h' allow you to use the class FaceFCFN that has per-face color and normal stored inside.
*/ */
template <class FVTYPE, class FETYPE, class FFTYPE, class TCTYPE = TCoord2<float,1> > class FACE_TYPE template <class FVTYPE, class FETYPE, class FFTYPE, class TCTYPE = TexCoord2<float,1> > class FACE_TYPE
{ {
public: public:
/// The base type of the face /// The base type of the face
@ -1051,7 +1054,7 @@ static bool HasWedgeColor() {
return false; return false;
#endif #endif
} }
static bool HasWedgeTexture() { static bool HasWedgeTexCoord() {
#ifdef __VCGLIB_FACE_WT #ifdef __VCGLIB_FACE_WT
return true; return true;
#else #else

View File

@ -24,6 +24,9 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.9 2007/02/12 19:01:23 ganovelli
added Name(std:vector<std::string>& n) that fills n with the names of the attribute of the face type
Revision 1.8 2006/10/09 20:20:18 cignoni Revision 1.8 2006/10/09 20:20:18 cignoni
Increased the maximum number of possible template args from 8 to 9 Increased the maximum number of possible template args from 8 to 9
@ -60,7 +63,7 @@ First working version!
#define __VCG_FACE_PLUS #define __VCG_FACE_PLUS
#include <vcg/space/point3.h> #include <vcg/space/point3.h>
#include <vcg/space/tcoord2.h> #include <vcg/space/texcoord2.h>
#include <vcg/space/color4.h> #include <vcg/space/color4.h>
#include <vcg/simplex/faceplus/component.h> #include <vcg/simplex/faceplus/component.h>
@ -111,7 +114,7 @@ class FaceBase: public face::EmptyVertexRef<
face::EmptyNormal< face::EmptyNormal<
face::EmptyBitFlags< face::EmptyBitFlags<
face::EmptyMark< face::EmptyMark<
face::EmptyWedgeTexture< face::EmptyWedgeTexCoord<
FaceTypeHolder <BVT, BET, BFT, BTT> > > > > > > >{ FaceTypeHolder <BVT, BET, BFT, BTT> > > > > > > >{
}; };
@ -331,7 +334,7 @@ A summary of the components that can be added to a face (see components.h for de
VertexRef VertexRef
NormalFromVert, WedgeNormal NormalFromVert, WedgeNormal
Normal3s, Normal3f, Normal3d Normal3s, Normal3f, Normal3d
WedgeTexture2s, WedgeTexture2f, WedgeTexture2d WedgeTexCoord2s, WedgeTexCoord2f, WedgeTexCoord2d
BitFlags BitFlags
WedgeColor, Color4b WedgeColor, Color4b
Qualitys, Qualityf, Qualityd Qualitys, Qualityf, Qualityd

View File

@ -24,6 +24,9 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.14 2007/02/27 09:32:00 cignoni
Added constructor to the VFadj component to comply to the allocator needs
Revision 1.13 2007/02/12 19:01:23 ganovelli Revision 1.13 2007/02/12 19:01:23 ganovelli
added Name(std:vector<std::string>& n) that fills n with the names of the attribute of the face type added Name(std:vector<std::string>& n) that fills n with the names of the attribute of the face type
@ -226,39 +229,39 @@ public: static void Name(std::vector<std::string> & name){name.push_back(std::st
}; };
/*-------------------------- Texture ----------------------------------------*/ /*-------------------------- TexCoord ----------------------------------------*/
template <class TT> class EmptyWedgeTexture: public TT { template <class TT> class EmptyWedgeTexCoord: public TT {
public: public:
typedef int WedgeTextureType; typedef int WedgeTexCoordType;
typedef vcg::TCoord2<float,1> TexCoordType; typedef vcg::TexCoord2<float,1> TexCoordType;
TexCoordType &WT(const int) { static TexCoordType dummy_texture; return dummy_texture;} TexCoordType &WT(const int) { static TexCoordType dummy_texture; return dummy_texture;}
TexCoordType const &cWT(const int) const { static TexCoordType dummy_texture; return dummy_texture;} TexCoordType const &cWT(const int) const { static TexCoordType dummy_texture; return dummy_texture;}
static bool HasWedgeTexture() { return false; } static bool HasWedgeTexCoord() { return false; }
static bool HasWedgeTextureOcc() { return false; } static bool HasWedgeTexCoordOcc() { return false; }
static void Name(std::vector<std::string> & name){TT::Name(name);} static void Name(std::vector<std::string> & name){TT::Name(name);}
}; };
template <class A, class TT> class WedgeTexture: public TT { template <class A, class TT> class WedgeTexCoord: public TT {
public: public:
typedef int WedgeTextureType; typedef int WedgeTexCoordType;
typedef A TexCoordType; typedef A TexCoordType;
TexCoordType &WT(const int i) { return _wt[i]; } TexCoordType &WT(const int i) { return _wt[i]; }
TexCoordType const &cWT(const int i) const { return _wt[i]; } TexCoordType const &cWT(const int i) const { return _wt[i]; }
static bool HasWedgeTexture() { return true; } static bool HasWedgeTexCoord() { return true; }
static void Name(std::vector<std::string> & name){name.push_back(std::string("WedgeTexture"));TT::Name(name);} static void Name(std::vector<std::string> & name){name.push_back(std::string("WedgeTexture"));TT::Name(name);}
private: private:
TexCoordType _wt[3]; TexCoordType _wt[3];
}; };
template <class TT> class WedgeTexture2s: public WedgeTexture<TCoord2<short,1>, TT> { template <class TT> class WedgeTexCoord2s: public WedgeTexCoord<TexCoord2<short,1>, TT> {
public: static void Name(std::vector<std::string> & name){name.push_back(std::string("WedgeTexture2s"));TT::Name(name);} public: static void Name(std::vector<std::string> & name){name.push_back(std::string("WedgeTexture2s"));TT::Name(name);}
}; };
template <class TT> class WedgeTexture2f: public WedgeTexture<TCoord2<float,1>, TT> { template <class TT> class WedgeTexCoord2f: public WedgeTexCoord<TexCoord2<float,1>, TT> {
public: static void Name(std::vector<std::string> & name){name.push_back(std::string("WedgeTexture2f"));TT::Name(name);} public: static void Name(std::vector<std::string> & name){name.push_back(std::string("WedgeTexture2f"));TT::Name(name);}
}; };
template <class TT> class WedgeTexture2d: public WedgeTexture<TCoord2<double,1>, TT> { template <class TT> class WedgeTexCoord2d: public WedgeTexCoord<TexCoord2<double,1>, TT> {
public: static void Name(std::vector<std::string> & name){name.push_back(std::string("WedgeTexture2d"));TT::Name(name);} public: static void Name(std::vector<std::string> & name){name.push_back(std::string("WedgeTexture2d"));TT::Name(name);}
}; };