Commit 1517fd39 authored by Sylvain Thery's avatar Sylvain Thery

Modification of topological rendering

TopoRender & Topo3Render can now directly render Map & GMap (see tuto1 & tuto5)
Correction of bug in gmap2 (face of boundary was not marked)
parent 5835f74c
......@@ -88,7 +88,7 @@ void MyQT::createMap()
// initialization GL callback
void MyQT::cb_initGL()
{
m_render_topo = new Algo::Render::GL2::TopoRenderMapD() ;
m_render_topo = new Algo::Render::GL2::TopoRender() ;
}
// redraw GL callback (clear and swap already done)
......
......@@ -25,14 +25,20 @@
#ifndef _TUTO1_
#define _TUTO1_
#define USE_GMAP
#include "Utils/Qt/qtSimple.h"
#include "Utils/cgognStream.h"
#include "Topology/generic/parameters.h"
#include "Topology/map/embeddedMap2.h"
#include "Algo/Render/GL2/topoRender.h"
#ifdef USE_GMAP
#include "Topology/gmap/embeddedGMap2.h"
#else
#include "Topology/map/embeddedMap2.h"
#endif
#include "Algo/Render/GL2/topoRender.h"
using namespace CGoGN ;
......@@ -43,10 +49,15 @@ using namespace CGoGN ;
struct PFP: public PFP_STANDARD
{
// definition of the type of the map
#ifdef USE_GMAP
typedef EmbeddedGMap2 MAP;
#else
typedef EmbeddedMap2 MAP;
#endif
};
class MyQT: public Utils::QT::SimpleQT
{
Q_OBJECT
......@@ -61,7 +72,7 @@ protected:
PFP::MAP myMap;
// render (for the topo)
Algo::Render::GL2::TopoRenderMapD* m_render_topo;
Algo::Render::GL2::TopoRender* m_render_topo;
// just for more compact writing
inline Dart PHI1(Dart d) {return myMap.phi1(d);}
......
......@@ -25,12 +25,18 @@
#ifndef _TUTO2_
#define _TUTO2_
#define USE_GMAP
#include "Utils/Qt/qtSimple.h"
#include "Utils/cgognStream.h"
#include "Topology/generic/parameters.h"
#include "Topology/map/embeddedMap2.h"
#ifdef USE_GMAP
#include "Topology/gmap/embeddedGMap2.h"
#else
#include "Topology/map/embeddedMap2.h"
#endif
#include "Algo/Render/GL2/mapRender.h"
#include "Utils/Shaders/shaderSimpleColor.h"
......@@ -46,7 +52,11 @@ using namespace CGoGN ;
struct PFP: public PFP_STANDARD
{
// definition of the type of the map
#ifdef USE_GMAP
typedef EmbeddedGMap2 MAP;
#else
typedef EmbeddedMap2 MAP;
#endif
};
......
......@@ -157,7 +157,7 @@ void MyQT::createMap()
// initialization GL callback
void MyQT::cb_initGL()
{
m_render_topo = new Algo::Render::GL2::TopoRenderMapD() ;
m_render_topo = new Algo::Render::GL2::TopoRender();
}
// redraw GL callback (clear and swap already done)
......
......@@ -65,7 +65,7 @@ protected:
PFP::TVEC3 position;
// render (for the topo)
Algo::Render::GL2::TopoRenderMapD* m_render_topo;
Algo::Render::GL2::TopoRender* m_render_topo;
// selected dart (mouse click)
Dart dart_selected;
......
......@@ -165,7 +165,7 @@ void MyQT::createMap()
// initialization GL callback
void MyQT::cb_initGL()
{
m_render_topo = new Algo::Render::GL2::TopoRenderMapD() ;
m_render_topo = new Algo::Render::GL2::TopoRender() ;
}
// redraw GL callback (clear and swap already done)
......
......@@ -63,7 +63,7 @@ protected:
PFP::TVEC3 position;
// render (for the topo)
Algo::Render::GL2::TopoRenderMapD* m_render_topo;
Algo::Render::GL2::TopoRender* m_render_topo;
// selected dart (mouse click)
std::vector<Dart> dart_selected;
......
......@@ -22,13 +22,18 @@
* *
*******************************************************************************/
#include "tuto5.h"
#define WITH_GMAP 1
#include "tuto5.h"
#include <iostream>
#include "Topology/generic/parameters.h"
#include "Topology/map/embeddedMap3.h"
#ifdef WITH_GMAP
#include "Topology/gmap/embeddedGMap3.h"
#else
#include "Topology/map/embeddedMap3.h"
#endif
#include "Geometry/vector_gen.h"
#include "Algo/Geometry/boundingbox.h"
......@@ -55,7 +60,11 @@ using namespace CGoGN ;
struct PFP: public PFP_STANDARD
{
// definition de la carte
#ifdef WITH_GMAP
typedef EmbeddedGMap3 MAP;
#else
typedef EmbeddedMap3 MAP;
#endif
};
PFP::MAP myMap;
......@@ -143,7 +152,7 @@ void MyQT::cb_initGL()
// create the render
m_render = new Algo::Render::GL2::MapRender();
m_render_topo = new Algo::Render::GL2::Topo3RenderMapD();
m_render_topo = new Algo::Render::GL2::Topo3Render();
// create VBO for position
m_positionVBO = new Utils::VBO();
......@@ -190,7 +199,7 @@ void MyQT::cb_initGL()
m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::POINTS);
SelectorDartNoBoundary<PFP::MAP> nb(myMap);
m_render_topo->updateData<PFP>(myMap, nb, position, 0.9f, 0.9f, 0.9f);
m_render_topo->updateData<PFP>(myMap, position, 0.9f, 0.9f, 0.9f, nb);
// timer example for animation
......
......@@ -36,7 +36,7 @@
// forward definitions (minimize includes)
namespace CGoGN { namespace Algo { namespace Render { namespace GL2 { class MapRender; } } } }
namespace CGoGN { namespace Algo { namespace Render { namespace GL2 { class Topo3RenderMapD; } } } }
namespace CGoGN { namespace Algo { namespace Render { namespace GL2 { class Topo3Render; } } } }
namespace CGoGN { namespace Utils { class VBO; } }
namespace CGoGN { namespace Utils { class ShaderSimpleColor; } }
namespace CGoGN { namespace Utils { class Strings3D; } }
......@@ -63,7 +63,7 @@ class MyQT: public Utils::QT::SimpleQT
bool render_topo;
Algo::Render::GL2::MapRender* m_render;
Algo::Render::GL2::Topo3RenderMapD* m_render_topo;
Algo::Render::GL2::Topo3Render* m_render_topo;
Utils::VBO* m_positionVBO;
Utils::VBO* m_dataVBO;
......
......@@ -60,9 +60,9 @@ protected:
/**
* vbo buffers
* 0: vertices darts
* 1: vertices phi1
* 2: vertices phi2
* 3: vertices phi3
* 1: vertices phi1 / beta1
* 2: vertices phi2 / beta2
* 3: vertices phi3 / beta3
* 4: colors
*/
Utils::VBO* m_vbo0;
......@@ -238,8 +238,6 @@ public:
*/
void overdrawDart(Dart d, float width, float r, float g, float b);
/*
* store darts in color for picking
* @param map the map (must be the same than during updating data)
......@@ -248,8 +246,6 @@ public:
template<typename PFP>
void setDartsIdColor(typename PFP::MAP& map, const FunctorSelect& good);
/**
* pick dart with color set bey setDartsIdColor
* Do not forget to apply same transformation to scene before picking than before drawing !
......@@ -262,13 +258,6 @@ public:
template<typename PFP>
Dart picking(typename PFP::MAP& map, const FunctorSelect& good, int x, int y);
};
class Topo3RenderMapD: public Topo3Render
{
public:
/**
* update all drawing buffers to render a dual map
* @param map the map
......@@ -279,27 +268,37 @@ public:
* @param kv exploding coef for face
*/
template<typename PFP>
void updateData(typename PFP::MAP& map, const FunctorSelect& good, const typename PFP::TVEC3& positions, float ke, float kf, float kv);
};
void updateData(typename PFP::MAP& map, const typename PFP::TVEC3& positions, float ke, float kf, float kv, const FunctorSelect& good = allDarts);
protected:
/**
* update all drawing buffers to render a dual map
* @param map the map
* @param positions attribute of position vertices
* @param ke exploding coef for edge
* @param kf exploding coef for face
* @param kv exploding coef for face
* @param good selector
*/
template<typename PFP>
void updateDataMap3(typename PFP::MAP& map, const typename PFP::TVEC3& positions, float ke, float kf, float kv, const FunctorSelect& good = allDarts);
class Topo3RenderGMap: public Topo3Render
{
public:
/**
* update all drawing buffers to render a gmap
* @param map the map
* @param good selector
* @param positions attribute of position vertices
* @param ke exploding coef for edge
* @param kf exploding coef for face
* @param kv exploding coef for face
* @param good selector
*/
template<typename PFP>
void updateData(typename PFP::MAP& map, const FunctorSelect& good, const typename PFP::TVEC3& positions, float kd, float ke, float kf, float kv);
void updateDataGMap3(typename PFP::MAP& map, const typename PFP::TVEC3& positions, float ke, float kf, float kv, const FunctorSelect& good = allDarts);
};
}//end namespace VBO
}//end namespace GL2
}//end namespace Algo
......
This diff is collapsed.
......@@ -199,39 +199,23 @@ public:
*/
template<typename PFP>
Dart picking(typename PFP::MAP& map, const FunctorSelect& good, int x, int y);
};
class TopoRenderMapD : public TopoRender
{
public:
/**
* update all drawing buffers to render a dual map
* @param map the map
* @param positions attribute of position vertices
* @param ke exploding coef for edge
* @param kf exploding coef for face
* @param good selector
*/
template <typename PFP>
void updateData(typename PFP::MAP& map, const typename PFP::TVEC3& positions, float ke, float kf, const FunctorSelect& good = allDarts);
};
class TopoRenderGMap : public TopoRender
{
public:
/**
* update all drawing buffers to render a gmap
* @param map the map
* @param positions attribute of position vertices
* @param ke exploding coef for edge
* @param kf exploding coef for face
* @param good selector
*/
template <typename PFP>
void updateData(typename PFP::MAP& map, const typename PFP::TVEC3& positions, float ke, float kf, const FunctorSelect& good = allDarts);
void updateDataMap(typename PFP::MAP& map, const typename PFP::TVEC3& positions, float ke, float kf, const FunctorSelect& good = allDarts);
template <typename PFP>
void updateDataGMap(typename PFP::MAP& map, const typename PFP::TVEC3& positions, float ke, float kf, const FunctorSelect& good = allDarts);
};
} // namespace VBO
// just for compatibility with old code
typedef TopoRender TopoMapRenderMapD;
typedef TopoRender TopoMapRenderGMap;
} // namespace GL2
} // namespace Render
......
......@@ -25,27 +25,47 @@
#include "Geometry/vector_gen.h"
#include "Topology/generic/autoAttributeHandler.h"
#include "Topology/generic/dartmarker.h"
#include "Topology/generic/parameters.h"
#include "Topology/map/embeddedMap2.h"
#include "Topology/gmap/embeddedGmap2.h"
namespace CGoGN
{
namespace Algo
{
namespace Render
{
namespace GL2
{
template<typename PFP>
void TopoRenderMapD::updateData(typename PFP::MAP& map, const typename PFP::TVEC3& positions, float ke, float kf, const FunctorSelect& good)
void TopoRender::updateData(typename PFP::MAP& map, const typename PFP::TVEC3& positions, float ke, float kf, const FunctorSelect& good)
{
Map2* ptrMap2 = dynamic_cast<Map2*>(&map);
if (ptrMap2 != NULL)
{
updateDataMap<PFP>(map,positions,ke,kf,good);
}
GMap2* ptrGMap2 = dynamic_cast<GMap2*>(&map);
if (ptrGMap2 != NULL)
{
updateDataGMap<PFP>(map,positions,ke,kf,good);
}
}
template<typename PFP>
//void TopoRenderMapD::updateData(typename PFP::MAP& map, const typename PFP::TVEC3& positions, float ke, float kf, const FunctorSelect& good)
void TopoRender::updateDataMap(typename PFP::MAP& mapx, const typename PFP::TVEC3& positions, float ke, float kf, const FunctorSelect& good)
{
Map2& map = reinterpret_cast<Map2&>(mapx);
typedef typename PFP::VEC3 VEC3;
typedef typename PFP::REAL REAL;
std::vector<Dart> vecDarts;
vecDarts.reserve(map.getNbDarts()/4); // not too big but not too many reallocation
vecDarts.reserve(map.getNbDarts()); // no problem dart is int: no problem of memory
if (m_attIndex.map() != &map)
{
......@@ -79,15 +99,17 @@ void TopoRenderMapD::updateData(typename PFP::MAP& map, const typename PFP::TVEC
VEC3* positionDartBuf = reinterpret_cast<VEC3*>(PositionDartsBuffer);
unsigned int posDBI = 0;
std::vector<VEC3> vecPos;
vecPos.reserve(16);
DartMarker mf(map);
for(std::vector<Dart>::iterator id = vecDarts.begin(); id!= vecDarts.end(); id++)
{
Dart d = *id;
if (!mf.isMarked(d))
{
std::vector<VEC3> vecPos;
vecPos.reserve(16);
vecPos.clear();
// store the face & center
VEC3 center(0.0f,0.0f,0.0f);
Dart dd = d;
......@@ -181,14 +203,16 @@ void TopoRenderMapD::updateData(typename PFP::MAP& map, const typename PFP::TVEC
template<typename PFP>
void TopoRenderGMap::updateData(typename PFP::MAP& map, const typename PFP::TVEC3& positions, float ke, float kf, const FunctorSelect& good)
//void TopoRenderGMap::updateData(typename PFP::MAP& map, const typename PFP::TVEC3& positions, float ke, float kf, const FunctorSelect& good)
void TopoRender::updateDataGMap(typename PFP::MAP& mapx, const typename PFP::TVEC3& positions, float ke, float kf, const FunctorSelect& good)
{
/*
GMap2& map = reinterpret_cast<GMap2&>(mapx);
typedef typename PFP::VEC3 VEC3;
typedef typename PFP::REAL REAL;
std::vector<Dart> vecDarts;
vecDarts.reserve(map.getNbDarts()/4); // not too big but not too many reallocation
vecDarts.reserve(map.getNbDarts()); // no problem dart is int: no problem of memory
if (m_attIndex.map() != &map)
{
......@@ -204,25 +228,26 @@ void TopoRenderGMap::updateData(typename PFP::MAP& map, const typename PFP::TVEC
}
m_nbDarts = vecDarts.size();
// beta1
// debut phi1
AutoAttributeHandler<VEC3> fv1(map, DART);
// beta2
// fin phi1
AutoAttributeHandler<VEC3> fv11(map, DART);
// phi2
AutoAttributeHandler<VEC3> fv2(map, DART);
// sommets du brin
// AutoAttributeHandler<VEC3> vert(map, DART);
// 2ieme sommet du brin
// AutoAttributeHandler<VEC3> vert2(map, DART);
glBindBufferARB(GL_ARRAY_BUFFER, m_VBOBuffers[3]);
glBufferDataARB(GL_ARRAY_BUFFER, 2*m_nbDarts*sizeof(VEC3), 0, GL_STREAM_DRAW);
GLvoid* ColorDartsBuffer = glMapBufferARB(GL_ARRAY_BUFFER, GL_READ_WRITE);
m_vbo3->bind();
glBufferData(GL_ARRAY_BUFFER, 4*m_nbDarts*sizeof(VEC3), 0, GL_STREAM_DRAW);
GLvoid* ColorDartsBuffer = glMapBuffer(GL_ARRAY_BUFFER, GL_READ_WRITE);
VEC3* colorDartBuf = reinterpret_cast<VEC3*>(ColorDartsBuffer);
glBindBufferARB(GL_ARRAY_BUFFER, m_VBOBuffers[0]);
glBufferDataARB(GL_ARRAY_BUFFER, 2*m_nbDarts*sizeof(VEC3), 0, GL_STREAM_DRAW);
GLvoid* PositionDartsBuffer = glMapBufferARB(GL_ARRAY_BUFFER, GL_READ_WRITE);
m_vbo0->bind();
glBufferData(GL_ARRAY_BUFFER, 4*m_nbDarts*sizeof(VEC3), 0, GL_STREAM_DRAW);
GLvoid* PositionDartsBuffer = glMapBuffer(GL_ARRAY_BUFFER, GL_READ_WRITE);
VEC3* positionDartBuf = reinterpret_cast<VEC3*>(PositionDartsBuffer);
unsigned int posDBI=0;
unsigned int posDBI = 0;
std::vector<VEC3> vecPos;
vecPos.reserve(16);
DartMarker mf(map);
for(std::vector<Dart>::iterator id = vecDarts.begin(); id!= vecDarts.end(); id++)
......@@ -230,9 +255,7 @@ void TopoRenderGMap::updateData(typename PFP::MAP& map, const typename PFP::TVEC
Dart d = *id;
if (!mf.isMarked(d))
{
std::vector<VEC3> vecPos;
vecPos.reserve(16);
vecPos.clear();
// store the face & center
VEC3 center(0.0f,0.0f,0.0f);
Dart dd = d;
......@@ -240,11 +263,9 @@ void TopoRenderGMap::updateData(typename PFP::MAP& map, const typename PFP::TVEC
{
const VEC3& P = positions[d];
vecPos.push_back(P);
center += P;
m_attIndex[d] = posDBI;
posDBI+=2;
m_attIndex[map.beta0(d)] = posDBI;
posDBI+=2;
center += P;
d = map.phi1(d);
} while (d != dd);
center /= REAL(vecPos.size());
......@@ -267,76 +288,74 @@ void TopoRenderGMap::updateData(typename PFP::MAP& map, const typename PFP::TVEC
VEC3 QQ = REAL(0.52)*Q + REAL(0.48)*P;
*positionDartBuf++ = P;
*positionDartBuf++ = PP;
*colorDartBuf++ = VEC3(1.,1.,1.);
*positionDartBuf++ = PP;
*colorDartBuf++ = VEC3(1.,1.,1.);
*positionDartBuf++ = Q;
*positionDartBuf++ = QQ;
*colorDartBuf++ = VEC3(1.,1.,1.);
*positionDartBuf++ = QQ;
*colorDartBuf++ = VEC3(1.,1.,1.);
Dart d0 = map.beta0(d);
VEC3 f = Q*REAL(0.5) + QQ*REAL(0.5);
fv2[d0] = f;
f = QQ*REAL(0.2) + Q*REAL(0.8);
fv1[d0] = f;
f = P*REAL(0.5) + PP*REAL(0.5);
VEC3 f = P*0.5f + PP*0.5f;
fv2[d] = f;
f = PP*REAL(0.2) + P*REAL(0.8);
f = P*0.9f + PP*0.1f;
fv1[d] = f;
dd = map.beta0(d);
f = Q*0.5f + QQ*0.5f;
fv2[dd] = f;
f = Q*0.9f + QQ*0.1f;
fv1[dd] = f;
d = map.phi1(d);
}
mf.markOrbit(FACE, d);
}
}
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER, m_VBOBuffers[0]);
glUnmapBufferARB(GL_ELEMENT_ARRAY_BUFFER);
m_vbo0->bind();
glUnmapBuffer(GL_ARRAY_BUFFER);
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER, m_VBOBuffers[3]);
glUnmapBufferARB(GL_ELEMENT_ARRAY_BUFFER);
m_vbo3->bind();
glUnmapBuffer(GL_ARRAY_BUFFER);
glBindBufferARB(GL_ARRAY_BUFFER, m_VBOBuffers[1]);
glBufferDataARB(GL_ARRAY_BUFFER, 2*m_nbDarts*sizeof(typename PFP::VEC3), 0, GL_STREAM_DRAW);
GLvoid* PositionBuffer1 = glMapBufferARB(GL_ARRAY_BUFFER, GL_READ_WRITE);
m_vbo1->bind();
glBufferData(GL_ARRAY_BUFFER, 2*m_nbDarts*sizeof(typename PFP::VEC3), 0, GL_STREAM_DRAW);
GLvoid* PositionBuffer1 = glMapBuffer(GL_ARRAY_BUFFER, GL_READ_WRITE);
glBindBufferARB(GL_ARRAY_BUFFER, m_VBOBuffers[2]);
glBufferDataARB(GL_ARRAY_BUFFER, 2*m_nbDarts*sizeof(typename PFP::VEC3), 0, GL_STREAM_DRAW);
GLvoid* PositionBuffer2 = glMapBufferARB(GL_ARRAY_BUFFER, GL_READ_WRITE);
m_vbo2->bind();
glBufferData(GL_ARRAY_BUFFER, 2*m_nbDarts*sizeof(typename PFP::VEC3), 0, GL_STREAM_DRAW);
GLvoid* PositionBuffer2 = glMapBuffer(GL_ARRAY_BUFFER, GL_READ_WRITE);
VEC3* positionF1 = reinterpret_cast<VEC3*>(PositionBuffer1);
VEC3* positionF2 = reinterpret_cast<VEC3*>(PositionBuffer2);
m_nbRel2=0;
m_nbRel2 =0;
for(std::vector<Dart>::iterator id = vecDarts.begin(); id!= vecDarts.end(); id++)
{
Dart d = *id;
Dart e = map.beta2(d);
if (e.index > d.index)
if (good(e) && (e.index > d.index))
{
*positionF2++ = fv2[d];
*positionF2++ = fv2[e];
m_nbRel2++;
}
e = map.beta1(d);
*positionF1++ = fv1[d];
*positionF1++ = fv1[e];
}
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER, m_VBOBuffers[1]);
glUnmapBufferARB(GL_ELEMENT_ARRAY_BUFFER);
m_vbo1->bind();
glUnmapBuffer(GL_ARRAY_BUFFER);
m_vbo2->bind();
glUnmapBuffer(GL_ARRAY_BUFFER);
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER, m_VBOBuffers[2]);
glUnmapBufferARB(GL_ELEMENT_ARRAY_BUFFER);
*/
}
......
......@@ -43,6 +43,7 @@ namespace GL2
{
Topo3Render::Topo3Render():
m_nbDarts(0),m_nbRel2(0),m_nbRel3(0),
m_topo_dart_width(2.0f), m_topo_relation_width(3.0f),m_color_save(NULL)
{
m_vbo0 = new Utils::VBO();
......@@ -132,6 +133,9 @@ void Topo3Render::setAllDartsColor(float r, float g, float b)
void Topo3Render::drawDarts()
{
if (m_nbDarts==0)
return;
m_shader2->enableVertexAttribs();
glLineWidth(m_topo_dart_width);
......@@ -174,6 +178,9 @@ void Topo3Render::drawDarts()
void Topo3Render::drawRelation1()
{
if (m_nbDarts==0)
return;
glLineWidth(m_topo_relation_width);
m_shader1->changeVA_VBO(m_vaId, m_vbo1);
......@@ -197,6 +204,9 @@ void Topo3Render::drawRelation1()
void Topo3Render::drawRelation2()
{
if (m_nbRel2==0)
return;
m_shader1->changeVA_VBO(m_vaId, m_vbo2);
m_shader1->setColor(Geom::Vec4f(1.0f,0.0f,0.0f,0.0f));
m_shader1->enableVertexAttribs();
......@@ -218,6 +228,9 @@ void Topo3Render::drawRelation2()
void Topo3Render::drawRelation3()
{
if (m_nbRel3==0)
return;
m_shader1->changeVA_VBO(m_vaId, m_vbo3);
m_shader1->setColor(Geom::Vec4f(1.0f,1.0f,0.0f,0.0f));
m_shader1->enableVertexAttribs();
......
......@@ -40,7 +40,8 @@ namespace GL2
{
TopoRender::TopoRender():
m_topo_dart_width(2.0f), m_topo_relation_width(3.0f)
m_nbDarts(0),m_nbRel2(0),
m_topo_dart_width(2.0f),m_topo_relation_width(3.0f)
{
m_vbo0 = new Utils::VBO();
m_vbo1 = new Utils::VBO();
......@@ -121,6 +122,9 @@ void TopoRender::setAllDartsColor(float r, float g, float b)
void TopoRender::drawDarts()
{
if (m_nbDarts==0)
return;
m_shader2->enableVertexAttribs();
glLineWidth(m_topo_dart_width);
......@@ -137,6 +141,9 @@ void TopoRender::drawDarts()
void TopoRender::drawRelation1()
{
if (m_nbDarts==0)
return;
glLineWidth(m_topo_relation_width);
m_shader1->changeVA_VBO(m_vaId, m_vbo1);
......@@ -150,6 +157,9 @@ void TopoRender::drawRelation1()
void TopoRender::drawRelation2()
{
if (m_nbRel2==0)
return;
glLineWidth(m_topo_relation_width);
m_shader1->changeVA_VBO(m_vaId, m_vbo2);
......