component_ocf are now part of the standard inclusion sequence of complex.h

No more need of including them.
It was needed to avoid the issue of wrong inclusion order that could trigger a failure in the partial specialization of the reflection functions that should say if a component is present or not...
This commit is contained in:
Paolo Cignoni 2012-10-15 09:17:48 +00:00
parent 42252b04b4
commit fb60087ee4
3 changed files with 58 additions and 107 deletions

View File

@ -11,8 +11,10 @@
#include <vcg/container/derivation_chain.h> #include <vcg/container/derivation_chain.h>
#include <vcg/complex/all_types.h> #include <vcg/complex/all_types.h>
#include <vcg/simplex/vertex/component.h> #include <vcg/simplex/vertex/component.h>
#include <vcg/simplex/vertex/component_ocf.h>
#include <vcg/simplex/vertex/base.h> #include <vcg/simplex/vertex/base.h>
#include <vcg/simplex/face/component.h> #include <vcg/simplex/face/component.h>
#include <vcg/simplex/face/component_ocf.h>
#include <vcg/simplex/face/component_polygon.h> #include <vcg/simplex/face/component_polygon.h>
#include <vcg/simplex/face/base.h> #include <vcg/simplex/face/base.h>
#include <vcg/simplex/edge/component.h> #include <vcg/simplex/edge/component.h>

View File

@ -31,11 +31,9 @@ Mainly the trick here is to store a base pointer in each simplex...
****************************************************************************/ ****************************************************************************/
#ifndef __VCG_FACE_PLUS_COMPONENT_OCF #ifndef __VCG_FACE_PLUS_COMPONENT_OCF
#define __VCG_FACE_PLUS_COMPONENT_OCF #define __VCG_FACE_PLUS_COMPONENT_OCF
#ifndef __VCG_MESH
#include <vcg/simplex/face/component.h> #error "This file should not be included alone. It is automatically included by complex.h"
#include <vector> #endif
#include <limits>
namespace vcg { namespace vcg {
namespace face { namespace face {
@ -50,17 +48,18 @@ class vector_ocf: public std::vector<VALUE_TYPE> {
typedef typename vector_ocf<VALUE_TYPE>::iterator ThisTypeIterator; typedef typename vector_ocf<VALUE_TYPE>::iterator ThisTypeIterator;
public: public:
vector_ocf():std::vector<VALUE_TYPE>(){ vector_ocf():std::vector<VALUE_TYPE>()
ColorEnabled=false; {
QualityEnabled=false; ColorEnabled=false;
MarkEnabled=false; CurvatureDirEnabled = false;
NormalEnabled=false; MarkEnabled=false;
CurvatureDirEnabled = false; NormalEnabled=false;
WedgeTexEnabled=false; QualityEnabled=false;
VFAdjacencyEnabled=false; WedgeTexEnabled=false;
FFAdjacencyEnabled=false; WedgeColorEnabled=false;
WedgeColorEnabled=false; WedgeNormalEnabled=false;
WedgeNormalEnabled=false; VFAdjacencyEnabled=false;
FFAdjacencyEnabled=false;
} }
// Auxiliary types to build internal vectors // Auxiliary types to build internal vectors
@ -125,9 +124,10 @@ public:
}; };
// override di tutte le funzioni che possono spostare ////////////////////////////////////////
// l'allocazione in memoria del container // All the standard methods of std::vector that can change the reallocation are
void push_back(const VALUE_TYPE & v) // redefined in order to manage the additional data.
void push_back(const VALUE_TYPE & v)
{ {
BaseType::push_back(v); BaseType::push_back(v);
BaseType::back()._ovp = this; BaseType::back()._ovp = this;
@ -375,27 +375,27 @@ void DisableWedgeNormal() {
} }
public: public:
std::vector<float> QV;
std::vector<typename VALUE_TYPE::ColorType> CV; std::vector<typename VALUE_TYPE::ColorType> CV;
std::vector<typename VALUE_TYPE::CurvatureDirType> CDV;
std::vector<int> MV; std::vector<int> MV;
std::vector<typename VALUE_TYPE::NormalType> NV; std::vector<typename VALUE_TYPE::NormalType> NV;
std::vector<typename VALUE_TYPE::CurvatureDirType> CDV; std::vector<float> QV;
std::vector<struct AdjTypePack> AV;
std::vector<struct AdjTypePack> AF;
std::vector<class WedgeTexTypePack> WTV;
std::vector<class WedgeColorTypePack> WCV; std::vector<class WedgeColorTypePack> WCV;
std::vector<class WedgeNormalTypePack> WNV; std::vector<class WedgeNormalTypePack> WNV;
std::vector<class WedgeTexTypePack> WTV;
std::vector<struct AdjTypePack> AV;
std::vector<struct AdjTypePack> AF;
bool QualityEnabled;
bool ColorEnabled; bool ColorEnabled;
bool CurvatureDirEnabled;
bool MarkEnabled; bool MarkEnabled;
bool NormalEnabled; bool NormalEnabled;
bool CurvatureDirEnabled; bool QualityEnabled;
bool WedgeColorEnabled;
bool WedgeNormalEnabled;
bool WedgeTexEnabled; bool WedgeTexEnabled;
bool VFAdjacencyEnabled; bool VFAdjacencyEnabled;
bool FFAdjacencyEnabled; bool FFAdjacencyEnabled;
bool WedgeColorEnabled;
bool WedgeNormalEnabled;
}; // end class vector_ocf }; // end class vector_ocf
@ -826,6 +826,12 @@ public:
else return FaceType::HasCurvatureDir(); else return FaceType::HasCurvatureDir();
} }
template < class FaceType > template < class FaceType >
bool FaceVectorHasPerFaceNormal(const face::vector_ocf<FaceType> &fv)
{
if(FaceType::HasFaceNormalOcf()) return fv.IsNormalEnabled();
else return FaceType::HasFaceNormal();
}
template < class FaceType >
void ReorderFace( std::vector<size_t> &newFaceIndex, face::vector_ocf< FaceType > &faceVec) void ReorderFace( std::vector<size_t> &newFaceIndex, face::vector_ocf< FaceType > &faceVec)
{ {
faceVec.ReorderFace(newFaceIndex); faceVec.ReorderFace(newFaceIndex);

View File

@ -19,65 +19,6 @@
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) *
* for more details. * * for more details. *
* * * *
****************************************************************************/
/****************************************************************************
History
$Log: not supported by cvs2svn $
Revision 1.16 2008/04/03 23:15:40 cignoni
added optional mark and cleaned up some nasty type bugs.
Revision 1.15 2008/03/17 11:39:15 ganovelli
added curvature and curvatruredir (compiled .net 2005 and gcc)
Revision 1.14 2008/03/11 09:22:07 cignoni
Completed the garbage collecting functions CompactVertexVector and CompactFaceVector.
Revision 1.13 2008/02/05 20:42:43 cignoni
Other small typos
Revision 1.12 2008/02/04 21:26:49 ganovelli
added ImportData which imports all local attributes into vertexplus and faceplus.
A local attribute is everything (N(), C(), Q()....) except pointers to other simplices
(i.e. FFAdj, VFAdj, VertexRef) which are set to NULL.
Added some function for const attributes
Revision 1.11 2007/12/11 18:25:31 cignoni
added missing include limits
Revision 1.10 2007/12/11 11:36:03 cignoni
Added the CompactVertexVector garbage collecting function.
Revision 1.9 2006/12/11 23:42:00 ganovelli
bug Index()() instead of Index()
Revision 1.8 2006/12/04 11:17:42 ganovelli
added forward declaration of TriMesh
Revision 1.7 2006/11/07 17:22:52 cignoni
many gcc compiling issues
Revision 1.6 2006/11/07 15:13:57 zifnab1974
Necessary changes for compilation with gcc 3.4.6. Especially the hash function is a problem
Revision 1.5 2006/11/07 11:29:24 cignoni
Corrected some errors in the reflections Has*** functions
Revision 1.4 2006/10/31 16:02:59 ganovelli
vesione 2005 compliant
Revision 1.3 2006/02/28 11:59:55 ponchio
g++ compliance:
begin() -> (*this).begin() and for end(), size(), Base(), Index()
Revision 1.2 2005/12/12 11:17:32 cignoni
Corrected update function, now only the needed simplexes should be updated.
Revision 1.1 2005/10/14 15:07:59 cignoni
First Really Working version
****************************************************************************/ ****************************************************************************/
/* /*
@ -90,11 +31,9 @@ Mainly the trick here is to store a base pointer in each simplex...
****************************************************************************/ ****************************************************************************/
#ifndef __VCG_VERTEX_PLUS_COMPONENT_OCF #ifndef __VCG_VERTEX_PLUS_COMPONENT_OCF
#define __VCG_VERTEX_PLUS_COMPONENT_OCF #define __VCG_VERTEX_PLUS_COMPONENT_OCF
#ifndef __VCG_MESH
#include <vcg/simplex/vertex/component.h> #error "This file should not be included alone. It is automatically included by complex.h"
#endif
#include <vector>
#include <limits>
namespace vcg { namespace vcg {
namespace vertex { namespace vertex {
@ -108,21 +47,23 @@ class vector_ocf: public std::vector<VALUE_TYPE> {
typedef typename vector_ocf<VALUE_TYPE>::iterator ThisTypeIterator; typedef typename vector_ocf<VALUE_TYPE>::iterator ThisTypeIterator;
public: public:
vector_ocf():std::vector<VALUE_TYPE>(){ vector_ocf():std::vector<VALUE_TYPE>()
ColorEnabled = false; {
ColorEnabled = false;
CurvatureEnabled = false; CurvatureEnabled = false;
CurvatureDirEnabled = false; CurvatureDirEnabled = false;
MarkEnabled = false; MarkEnabled = false;
NormalEnabled = false; NormalEnabled = false;
QualityEnabled = false; QualityEnabled = false;
RadiusEnabled = false; RadiusEnabled = false;
TexCoordEnabled = false; TexCoordEnabled = false;
VFAdjacencyEnabled = false; VFAdjacencyEnabled = false;
} }
// override di tutte le funzioni che possono spostare ////////////////////////////////////////
// l'allocazione in memoria del container // All the standard methods of std::vector that can change the reallocation are
void push_back(const VALUE_TYPE & v) // redefined in order to manage the additional data.
void push_back(const VALUE_TYPE & v)
{ {
BaseType::push_back(v); BaseType::push_back(v);
BaseType::back()._ovp = this; BaseType::back()._ovp = this;
@ -135,7 +76,9 @@ public:
if (CurvatureDirEnabled) CuDV.push_back(typename VALUE_TYPE::CurvatureDirType()); if (CurvatureDirEnabled) CuDV.push_back(typename VALUE_TYPE::CurvatureDirType());
if (RadiusEnabled) RadiusV.push_back(typename VALUE_TYPE::RadiusType()); if (RadiusEnabled) RadiusV.push_back(typename VALUE_TYPE::RadiusType());
} }
void pop_back(); void pop_back();
void resize(const unsigned int & _size) void resize(const unsigned int & _size)
{ {
const unsigned int oldsize = BaseType::size(); const unsigned int oldsize = BaseType::size();
@ -304,21 +247,21 @@ struct VFAdjType {
public: public:
std::vector<typename VALUE_TYPE::ColorType> CV; std::vector<typename VALUE_TYPE::ColorType> CV;
std::vector<typename VALUE_TYPE::CurvatureType> CuV; std::vector<typename VALUE_TYPE::CurvatureType> CuV;
std::vector<typename VALUE_TYPE::CurvatureDirType> CuDV; std::vector<typename VALUE_TYPE::CurvatureDirType> CuDV;
std::vector<int> MV; std::vector<int> MV;
std::vector<typename VALUE_TYPE::NormalType> NV; std::vector<typename VALUE_TYPE::NormalType> NV;
std::vector<typename VALUE_TYPE::QualityType> QV; std::vector<typename VALUE_TYPE::QualityType> QV;
std::vector<typename VALUE_TYPE::RadiusType> RadiusV; std::vector<typename VALUE_TYPE::RadiusType> RadiusV;
std::vector<typename VALUE_TYPE::TexCoordType> TV; std::vector<typename VALUE_TYPE::TexCoordType> TV;
std::vector<struct VFAdjType> AV; std::vector<struct VFAdjType> AV;
bool ColorEnabled; bool ColorEnabled;
bool CurvatureEnabled; bool CurvatureEnabled;
bool CurvatureDirEnabled; bool CurvatureDirEnabled;
bool MarkEnabled; bool MarkEnabled;
bool NormalEnabled; bool NormalEnabled;
bool QualityEnabled; bool QualityEnabled;
bool RadiusEnabled; bool RadiusEnabled;
bool TexCoordEnabled; bool TexCoordEnabled;
bool VFAdjacencyEnabled; bool VFAdjacencyEnabled;
}; };