- removed compiler time errors
This commit is contained in:
parent
73ee392537
commit
1dc8a067ac
|
|
@ -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))
|
||||||
|
|
|
||||||
|
|
@ -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))
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cstdint>
|
//#include <cstdint>
|
||||||
|
|
||||||
namespace vcg {
|
namespace vcg {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,14 +40,14 @@
|
||||||
|
|
||||||
namespace vcg
|
namespace vcg
|
||||||
{
|
{
|
||||||
struct GLFeederInfo
|
struct GLFeederInfo
|
||||||
{
|
{
|
||||||
struct GLFeederException : public std::exception
|
struct GLFeederException : public std::exception
|
||||||
{
|
{
|
||||||
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;
|
||||||
|
|
@ -151,13 +151,13 @@ namespace vcg
|
||||||
bool _atts[_size];
|
bool _atts[_size];
|
||||||
PRIMITIVE_MODALITY _pm;
|
PRIMITIVE_MODALITY _pm;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
//WARNING! member functions of this class should be called by the host application using concurrency
|
//WARNING! member functions of this class should be called by the host application using concurrency
|
||||||
template <typename MESHTYPE>
|
template <typename MESHTYPE>
|
||||||
class GLMeshAttributesFeeder : public GLFeederInfo
|
class GLMeshAttributesFeeder : public GLFeederInfo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GLMeshAttributesFeeder(/*const*/ MESHTYPE& mesh,MemoryInfo& meminfo, size_t perbatchprimitives)
|
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)
|
:_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;
|
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)
|
||||||
|
|
@ -315,7 +324,7 @@ namespace vcg
|
||||||
return (!isReplicatedPipeline(rqatt) && (pm != PR_POINTS) && (pm != PR_NONE));
|
return (!isReplicatedPipeline(rqatt) && (pm != PR_POINTS) && (pm != PR_NONE));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
struct GLBufferObject
|
struct GLBufferObject
|
||||||
{
|
{
|
||||||
GLBufferObject(size_t components,GLenum gltype,GLenum clientstatetag,GLenum target)
|
GLBufferObject(size_t components,GLenum gltype,GLenum clientstatetag,GLenum target)
|
||||||
|
|
@ -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])
|
||||||
|
|
@ -1342,7 +1350,7 @@ namespace vcg
|
||||||
size_t _perbatchprim;
|
size_t _perbatchprim;
|
||||||
bool _rendermodinitialized;
|
bool _rendermodinitialized;
|
||||||
ChunkMap _chunkmap;
|
ChunkMap _chunkmap;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue