- removed compiler time errors

This commit is contained in:
granzuglia 2015-07-06 02:38:32 +00:00
parent 73ee392537
commit 1dc8a067ac
4 changed files with 1380 additions and 1372 deletions
vcg
complex/algorithms
space/index/kdtree
wrap/gl

View File

@ -1837,7 +1837,7 @@ public:
{ {
std::vector<typename MeshType::VertexPointer> temp; std::vector<typename MeshType::VertexPointer> temp;
vcg::face::VVStarVF<typename MeshType::FaceType>(f->V(j), temp); vcg::face::VVStarVF<typename MeshType::FaceType>(f->V(j), temp);
std::vector<typename MeshType::VertexPointer>::iterator iter = temp.begin(); typename std::vector<typename MeshType::VertexPointer>::iterator iter = temp.begin();
for (; iter != temp.end(); iter++) for (; iter != temp.end(); iter++)
{ {
if ((*iter) != f->V1(j) && (*iter) != f->V2(j)) if ((*iter) != f->V1(j) && (*iter) != f->V2(j))

View File

@ -351,7 +351,7 @@ static void FaceFaceFromTexCoord(MeshType &m)
bool isBorder = false; bool isBorder = false;
if (!vcg::face::IsBorder((*fi), i)) if (!vcg::face::IsBorder((*fi), i))
{ {
MeshType::FacePointer nextFace = (*fi).FFp(i); typename MeshType::FacePointer nextFace = (*fi).FFp(i);
int nextEdgeIndex = (*fi).FFi(i); int nextEdgeIndex = (*fi).FFi(i);
bool border = false; bool border = false;
if ((*fi).cV(i) == nextFace->cV(nextEdgeIndex)) if ((*fi).cV(i) == nextFace->cV(nextEdgeIndex))

View File

@ -31,7 +31,7 @@
#include <vector> #include <vector>
#include <limits> #include <limits>
#include <iostream> #include <iostream>
#include <cstdint> //#include <cstdint>
namespace vcg { namespace vcg {

View File

@ -47,7 +47,7 @@ namespace vcg
GLFeederException(const char* text) GLFeederException(const char* text)
:std::exception(),_text(text) {} :std::exception(),_text(text) {}
~GLFeederException() {} ~GLFeederException() throw() {}
inline const char* what() const throw() {return _text.c_str();} inline const char* what() const throw() {return _text.c_str();}
private: private:
std::string _text; std::string _text;
@ -272,6 +272,15 @@ namespace vcg
return false; return false;
} }
bool getRequestedAttributes(unsigned int viewid,ReqAtts& rq)
{
std::map<unsigned int,ReqAtts>::iterator it = _allreqattsmap.find(viewid);
if (it == _allreqattsmap.end())
return false;
rq = it->second;
return true;
}
void buffersDeAllocationRequested() void buffersDeAllocationRequested()
{ {
for(typename std::vector<GLBufferObject*>::iterator it = _bo.begin();it != _bo.end();++it) for(typename std::vector<GLBufferObject*>::iterator it = _bo.begin();it != _bo.end();++it)
@ -371,7 +380,7 @@ namespace vcg
tomerge[name] = tomerge[name] || newone[name]; tomerge[name] = tomerge[name] || newone[name];
} }
if (unsigned int(tomerge.primitiveModality()) <= unsigned int(newone.primitiveModality())) if ((unsigned int) tomerge.primitiveModality() <= (unsigned int) newone.primitiveModality())
tomerge.primitiveModality() = newone.primitiveModality(); tomerge.primitiveModality() = newone.primitiveModality();
} }
@ -392,7 +401,7 @@ namespace vcg
rqatt[ATT_MESHCOLOR] = rqatt[ATT_MESHCOLOR]; rqatt[ATT_MESHCOLOR] = rqatt[ATT_MESHCOLOR];
rqatt[ATT_VERTTEXTURE] = rqatt[ATT_VERTTEXTURE] && vcg::tri::HasPerVertexTexCoord(mesh); rqatt[ATT_VERTTEXTURE] = rqatt[ATT_VERTTEXTURE] && vcg::tri::HasPerVertexTexCoord(mesh);
rqatt[ATT_WEDGETEXTURE] = rqatt[ATT_WEDGETEXTURE] && vcg::tri::HasPerWedgeTexCoord(mesh); rqatt[ATT_WEDGETEXTURE] = rqatt[ATT_WEDGETEXTURE] && vcg::tri::HasPerWedgeTexCoord(mesh);
rqatt[ATT_VERTINDEX] = rqatt[ATT_VERTINDEX]; rqatt[ATT_VERTINDEX] = isVertexIndexingRequired(rqatt);
} }
static bool isReplicatedPipeline(const ReqAtts& rqatt) static bool isReplicatedPipeline(const ReqAtts& rqatt)
@ -499,7 +508,7 @@ namespace vcg
//glBindVertexArray(vaohandlespecificperopenglcontext); //glBindVertexArray(vaohandlespecificperopenglcontext);
/*if a bo is not valid but at this point has a valid handle means that attribute values have been updated but the arity of the vertices/faces didn't change. i can use the already allocated space*/ /*if a bo is not valid but at this point has a valid handle means that attribute values have been updated but the arity of the vertices/faces didn't change. i can use the already allocated space*/
bool notvalidbuttoberegenerated = (cbo != NULL) && (!cbo->_isvalid) && (cbo->_bohandle != 0) && (importatt); bool notvalidbuttoberegenerated = (cbo != NULL) && (!cbo->_isvalid) && (cbo->_bohandle == 0) && (importatt);
if (notvalidbuttoberegenerated) if (notvalidbuttoberegenerated)
{ {
cbo->_size = boExpectedSize(boname,replicated,_currboatt[GLFeederInfo::ATT_VERTINDEX]); cbo->_size = boExpectedSize(boname,replicated,_currboatt[GLFeederInfo::ATT_VERTINDEX]);
@ -529,12 +538,12 @@ namespace vcg
else else
{ {
attributestobeupdated[boname] = false; attributestobeupdated[boname] = false;
if ((!cbo->_isvalid) && (cbo->_bohandle != 0) && (importatt)) if ((cbo != NULL) && (!cbo->_isvalid) && (cbo->_bohandle != 0) && (importatt))
{ {
attributestobeupdated[boname] = true; attributestobeupdated[boname] = true;
cbo->_isvalid = true; cbo->_isvalid = true;
} }
if (!importatt) if ((cbo != NULL) && (!importatt))
cbo->_isvalid = false; cbo->_isvalid = false;
} }
@ -907,14 +916,13 @@ namespace vcg
{ {
if (isPossibleToUseBORendering()) if (isPossibleToUseBORendering())
{ {
updateClientState(req);
switch(req.primitiveModality()) switch(req.primitiveModality())
{ {
case(PR_TRIANGLES): case(PR_TRIANGLES):
drawTriangles(req,textid); drawTriangles(req,textid);
break; break;
case(PR_POINTS): case(PR_POINTS):
drawPoints(); drawPoints(req);
break; break;
case (PR_QUADS): case (PR_QUADS):
break; break;
@ -1015,7 +1023,6 @@ namespace vcg
} }
glEnd(); glEnd();
glPopMatrix();
glPopAttrib(); glPopAttrib();
return true; return true;
} }
@ -1025,7 +1032,7 @@ namespace vcg
//isBORenderingPossible( //isBORenderingPossible(
if(!isPossibleToUseBORendering()) if(!isPossibleToUseBORendering())
return; return;
updateClientState(req);
bool replicated = isReplicatedPipeline(_currboatt); bool replicated = isReplicatedPipeline(_currboatt);
if (replicated) if (replicated)
@ -1082,11 +1089,11 @@ namespace vcg
glBindBuffer(GL_ARRAY_BUFFER,0); glBindBuffer(GL_ARRAY_BUFFER,0);
} }
void drawPoints() void drawPoints(const ReqAtts& req)
{ {
if(!isPossibleToUseBORendering()) if(!isPossibleToUseBORendering())
return; return;
updateClientState(req);
glDisable(GL_TEXTURE_2D); glDisable(GL_TEXTURE_2D);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _bo[GLFeederInfo::ATT_VERTINDEX]->_bohandle); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _bo[GLFeederInfo::ATT_VERTINDEX]->_bohandle);
glDrawArrays(GL_POINTS,0,_mesh.vn); glDrawArrays(GL_POINTS,0,_mesh.vn);
@ -1096,7 +1103,7 @@ namespace vcg
void updateClientState(const ReqAtts& req) void updateClientState(const ReqAtts& req)
{ {
int ii = 0; int ii = 0;
for(std::vector<GLBufferObject*>::const_iterator it = _bo.begin();it != _bo.end();++it) for(typename std::vector<GLBufferObject*>::const_iterator it = _bo.begin();it != _bo.end();++it)
{ {
ATT_NAMES boname = static_cast<ATT_NAMES>(ii); ATT_NAMES boname = static_cast<ATT_NAMES>(ii);
if(boname != GLFeederInfo::ATT_VERTINDEX) if(boname != GLFeederInfo::ATT_VERTINDEX)
@ -1106,6 +1113,7 @@ namespace vcg
else else
disableClientState(boname,req); disableClientState(boname,req);
} }
++ii;
} }
} }
@ -1204,7 +1212,7 @@ namespace vcg
long long unsigned int result(0); long long unsigned int result(0);
bool generateindex = isVertexIndexingRequired(rqatt); bool generateindex = isVertexIndexingRequired(rqatt);
for(unsigned int ii = 0;ii < unsigned int(ATT_NAMES_ARITY);++ii) for(unsigned int ii = 0;ii < (unsigned int)ATT_NAMES_ARITY;++ii)
{ {
ATT_NAMES nm = static_cast<ATT_NAMES>(ii); ATT_NAMES nm = static_cast<ATT_NAMES>(ii);
if (rqatt[nm]) if (rqatt[nm])