- 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

View File

@ -1837,7 +1837,7 @@ public:
{
std::vector<typename MeshType::VertexPointer> 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++)
{
if ((*iter) != f->V1(j) && (*iter) != f->V2(j))

View File

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

View File

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

View File

@ -40,14 +40,14 @@
namespace vcg
{
struct GLFeederInfo
{
struct GLFeederInfo
{
struct GLFeederException : public std::exception
{
GLFeederException(const char* text)
:std::exception(),_text(text) {}
~GLFeederException() {}
~GLFeederException() throw() {}
inline const char* what() const throw() {return _text.c_str();}
private:
std::string _text;
@ -151,13 +151,13 @@ namespace vcg
bool _atts[_size];
PRIMITIVE_MODALITY _pm;
};
};
};
//WARNING! member functions of this class should be called by the host application using concurrency
template <typename MESHTYPE>
class GLMeshAttributesFeeder : public GLFeederInfo
{
public:
//WARNING! member functions of this class should be called by the host application using concurrency
template <typename MESHTYPE>
class GLMeshAttributesFeeder : public GLFeederInfo
{
public:
GLMeshAttributesFeeder(/*const*/ MESHTYPE& mesh,MemoryInfo& meminfo, size_t perbatchprimitives)
:_mesh(mesh),_gpumeminfo(meminfo),_bo(ATT_NAMES_ARITY,NULL),_currboatt(),_allreqattsmap(),_lastfeedingusedreplicatedpipeline(false),_perbatchprim(perbatchprimitives),_chunkmap(),_borendering(false),_rendermodinitialized(false)
{
@ -272,6 +272,15 @@ namespace vcg
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()
{
for(typename std::vector<GLBufferObject*>::iterator it = _bo.begin();it != _bo.end();++it)
@ -315,7 +324,7 @@ namespace vcg
return (!isReplicatedPipeline(rqatt) && (pm != PR_POINTS) && (pm != PR_NONE));
}
protected:
protected:
struct GLBufferObject
{
GLBufferObject(size_t components,GLenum gltype,GLenum clientstatetag,GLenum target)
@ -371,7 +380,7 @@ namespace vcg
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();
}
@ -392,7 +401,7 @@ namespace vcg
rqatt[ATT_MESHCOLOR] = rqatt[ATT_MESHCOLOR];
rqatt[ATT_VERTTEXTURE] = rqatt[ATT_VERTTEXTURE] && vcg::tri::HasPerVertexTexCoord(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)
@ -499,7 +508,7 @@ namespace vcg
//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*/
bool notvalidbuttoberegenerated = (cbo != NULL) && (!cbo->_isvalid) && (cbo->_bohandle != 0) && (importatt);
bool notvalidbuttoberegenerated = (cbo != NULL) && (!cbo->_isvalid) && (cbo->_bohandle == 0) && (importatt);
if (notvalidbuttoberegenerated)
{
cbo->_size = boExpectedSize(boname,replicated,_currboatt[GLFeederInfo::ATT_VERTINDEX]);
@ -529,12 +538,12 @@ namespace vcg
else
{
attributestobeupdated[boname] = false;
if ((!cbo->_isvalid) && (cbo->_bohandle != 0) && (importatt))
if ((cbo != NULL) && (!cbo->_isvalid) && (cbo->_bohandle != 0) && (importatt))
{
attributestobeupdated[boname] = true;
cbo->_isvalid = true;
}
if (!importatt)
if ((cbo != NULL) && (!importatt))
cbo->_isvalid = false;
}
@ -907,14 +916,13 @@ namespace vcg
{
if (isPossibleToUseBORendering())
{
updateClientState(req);
switch(req.primitiveModality())
{
case(PR_TRIANGLES):
drawTriangles(req,textid);
break;
case(PR_POINTS):
drawPoints();
drawPoints(req);
break;
case (PR_QUADS):
break;
@ -1015,7 +1023,6 @@ namespace vcg
}
glEnd();
glPopMatrix();
glPopAttrib();
return true;
}
@ -1025,7 +1032,7 @@ namespace vcg
//isBORenderingPossible(
if(!isPossibleToUseBORendering())
return;
updateClientState(req);
bool replicated = isReplicatedPipeline(_currboatt);
if (replicated)
@ -1082,11 +1089,11 @@ namespace vcg
glBindBuffer(GL_ARRAY_BUFFER,0);
}
void drawPoints()
void drawPoints(const ReqAtts& req)
{
if(!isPossibleToUseBORendering())
return;
updateClientState(req);
glDisable(GL_TEXTURE_2D);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _bo[GLFeederInfo::ATT_VERTINDEX]->_bohandle);
glDrawArrays(GL_POINTS,0,_mesh.vn);
@ -1096,7 +1103,7 @@ namespace vcg
void updateClientState(const ReqAtts& req)
{
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);
if(boname != GLFeederInfo::ATT_VERTINDEX)
@ -1106,6 +1113,7 @@ namespace vcg
else
disableClientState(boname,req);
}
++ii;
}
}
@ -1204,7 +1212,7 @@ namespace vcg
long long unsigned int result(0);
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);
if (rqatt[nm])
@ -1342,7 +1350,7 @@ namespace vcg
size_t _perbatchprim;
bool _rendermodinitialized;
ChunkMap _chunkmap;
};
};
}
#endif