Commit 34bf64a2 authored by untereiner's avatar untereiner

Merge cgogn:~cgogn/CGoGN

Conflicts:
	include/Algo/Render/GL2/topo3Render.h
parents 9ea79e65 bfceabf5
......@@ -149,6 +149,17 @@ void MyQT::operation(int x)
m_selected=NIL;
}
break;
case 9:
CGoGNout <<"delete face"<<CGoGNendl;
if (m_selected != NIL)
{
myMap.deleteFace(m_selected);
updateMap();
m_selected=NIL;
m_selected2=NIL;
}
break;
default:
break;
}
......@@ -325,6 +336,11 @@ void MyQT::cb_keyPress(int keycode)
void MyQT::svg()
{
if (m_selected!=NIL)
m_render_topo->setDartColor(m_selected,0.8f,0.0f,0.0f);
if (m_selected2!=NIL)
m_render_topo->setDartColor(m_selected2,0.0f,0.8f,0.0f);
std::string filename = selectFileSave("snapshot file", ".", "(*.svg)");
m_render_topo->svgout2D(filename, modelViewMatrix(),projectionMatrix());
}
......
......@@ -94,6 +94,11 @@
<string>mergeFace</string>
</property>
</item>
<item>
<property name="text">
<string>deleteFace</string>
</property>
</item>
</widget>
</item>
<item>
......
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: http://cgogn.unistra.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#ifndef __DECIMATION_BASIC_H_
#define __DECIMATION_BASIC_H_
namespace CGoGN
{
namespace Algo
{
namespace Decimation
{
template <typename PFP>
bool edgeCanCollapse(typename PFP::MAP& map, Dart d, AttributeHandler<unsigned int>& valences)
{
Dart dd = map.phi2(d);
Dart dp = map.phi_1(d);
Dart ddp = map.phi_1(dd);
// Check valency conditions
unsigned int val_vd = valences[d];
unsigned int val_vdd = valences[dd];
unsigned int val_vd1 = valences[dp];
unsigned int val_vdd1 = valences[ddp];
if(val_vd + val_vdd < 8 || val_vd + val_vdd > 11 || val_vd1 < 5 || val_vdd1 < 5)
return false;
// Check vertex sharing condition
unsigned int vu1[32]; // pas de vector mais un tableau (find a la main, mais pas d'allocation par reserve)
val_vd -= 3; // evite le -3 dans la boucle
val_vdd -= 3;
Dart vit1 = map.phi2_1(map.phi2_1(d));
for (unsigned int i = 0; i< val_vd; ++i)
{
unsigned int ve = map.getEmbedding(map.phi2(vit1),VERTEX);
vu1[i] = ve;
vit1 = map.phi2_1(vit1);
}
val_vd--; // pour le parcours avec while >=0
Dart vit2 = map.phi2_1(map.phi2_1(dd));
for (unsigned int i = 0; i< val_vdd; ++i)
{
unsigned int ve = map.getEmbedding(map.phi2(vit2),VERTEX);
int j = val_vd;
while ( j>=0)
{
if (vu1[j] == ve)
return false;
--j;
}
vit2 = map.phi2_1(vit2);
}
return true;
}
template <typename PFP>
bool edgeCanCollapse(typename PFP::MAP& map, Dart d)
{
Dart dd = map.phi2(d);
Dart dp = map.phi_1(d);
Dart ddp = map.phi_1(dd);
// Check valency conditions
int val_vd = 0 ;
Dart tmp = d ;
do { ++val_vd ; tmp = map.phi2_1(tmp) ; } while(tmp != d) ;
int val_vdd = 0 ;
tmp = dd ;
do { ++val_vdd ; tmp = map.phi2_1(tmp) ; } while(tmp != dd) ;
int val_vdp = 0 ;
tmp = dp ;
do { ++val_vdp ; tmp = map.phi2_1(tmp) ; } while(tmp != dp) ;
int val_vddp = 0 ;
tmp = ddp ;
do { ++val_vddp ; tmp = map.phi2_1(tmp) ; } while(tmp != ddp) ;
if(val_vd + val_vdd < 8 || val_vd + val_vdd > 11 || val_vdp < 5 || val_vddp < 5)
return false;
// Check vertex sharing condition
unsigned int vu1[32]; // pas de vector mais un tableau (find a la main, mais pas d'allocation par reserve)
val_vd -= 3; // evite le -3 dans la boucle
val_vdd -= 3;
Dart vit1 = map.phi2_1(map.phi2_1(d));
for (int i = 0; i < val_vd; ++i)
{
unsigned int ve = map.getEmbedding(map.phi2(vit1),VERTEX);
vu1[i] = ve;
vit1 = map.phi2_1(vit1);
}
val_vd--; // pour le parcours avec while >=0
Dart vit2 = map.phi2_1(map.phi2_1(dd));
for (int i = 0; i < val_vdd; ++i)
{
unsigned int ve = map.getEmbedding(map.phi2(vit2),VERTEX);
int j = val_vd;
while (j >= 0)
{
if (vu1[j] == ve)
return false;
--j;
}
vit2 = map.phi2_1(vit2);
}
return true;
}
} // namespace Decimation
} // namespace Algo
} // namespace CGoGN
#endif
......@@ -30,7 +30,9 @@
#include "Utils/img3D_IO.h"
#ifdef WITH_ZINRI
#include "Zinrimage.h"
#endif
namespace CGoGN
{
......@@ -121,11 +123,12 @@ protected:
*/
//bool correct(const gmtl::Vec3i& _V);
#ifdef WITH_ZINRI
/**
* internal inrimage prt
*/
PTRINRIMAGE mImage;
#endif
public:
......
......@@ -29,9 +29,6 @@
#include <math.h>
#include <typeinfo>
#include "Utils/img3D_IO.h"
#include "Zinrimage.h"
namespace CGoGN
{
......@@ -177,6 +174,7 @@ void Image<DataType>::loadVox(char *filename)
m_Alloc=true;
}
#ifdef WITH_QT
template< typename DataType >
bool Image<DataType>::loadPNG3D(const char* filename)
{
......@@ -199,8 +197,9 @@ bool Image<DataType>::loadPNG3D(const char* filename)
return true;
}
#endif
#ifdef WITH_ZINRI
template< typename DataType >
bool Image<DataType>::loadInrgz(const char* filename)
{
......@@ -230,7 +229,7 @@ bool Image<DataType>::loadInrgz(const char* filename)
return true;
}
#endif
......@@ -472,9 +471,52 @@ Image<DataType>* Image<DataType>::Blur3()
return newImg;
}
//template<typename DataType>
//void Image<DataType>::createMaskOffsetSphere(std::vector<int>& table, int _i32radius)
//{
// // compute the width of the sphere for memory allocation
// int i32Width = 2*_i32radius + 1;
// // squared radius
// float fRad2 = (float)(_i32radius*_i32radius);
//
// // memory allocation
// // difficult to know how many voxels before computing,
// // so the reserve for the BB
// table.reserve(i32Width*i32Width*i32Width);
// table.clear();
//
// // scan all the BB of the sphere
// for (int z = -_i32radius; z<=_i32radius; z++)
// {
// for (int y = -_i32radius; y<=_i32radius; y++)
// {
// for (int x = -_i32radius; x<=_i32radius; x++)
// {
// Geom::Vec3f v((float)x,(float)y,(float)z);
// float fLength = v.norm2();
// // if inside the sphere
// if (fLength<=fRad2)
// {
// // the the index of the voxel
// int index = z * m_WXY + y * m_WX + x;
// table.push_back(index);
// }
// }
// }
// }
//}
template<typename DataType>
void Image<DataType>::createMaskOffsetSphere(std::vector<int>& table, int _i32radius)
{
float smin = std::min(m_SX, std::min(m_SY,m_SZ));
float xs = m_SX/smin;
float ys = m_SY/smin;
float zs = m_SZ/smin;
// compute the width of the sphere for memory allocation
int i32Width = 2*_i32radius + 1;
// squared radius
......@@ -493,7 +535,7 @@ void Image<DataType>::createMaskOffsetSphere(std::vector<int>& table, int _i32ra
{
for (int x = -_i32radius; x<=_i32radius; x++)
{
Geom::Vec3f v((float)x,(float)y,(float)z);
Geom::Vec3f v(float(x)*xs,float(y)*ys,float(z)*zs);
float fLength = v.norm2();
// if inside the sphere
if (fLength<=fRad2)
......@@ -507,6 +549,7 @@ void Image<DataType>::createMaskOffsetSphere(std::vector<int>& table, int _i32ra
}
}
template<typename DataType>
float Image<DataType>::computeCurvatureCount(const DataType *ptrVox, const std::vector<int>& sphere, DataType val)
{
......
......@@ -189,14 +189,7 @@ protected:
void setNeighbour(L_DART d1, L_DART d2);
L_DART createTriEmb(unsigned int e1, unsigned int e2, unsigned int e3) {
L_DART d = m_map->newFace(3);
//TODO change this which work only with 2-maps
m_map->setDartEmbedding(VERTEX,d,e1); d = m_map->phi1(d);
m_map->setDartEmbedding(VERTEX,d,e2); d = m_map->phi1(d);
m_map->setDartEmbedding(VERTEX,d,e3); d = m_map->phi1(d);
return d;
}
L_DART createTriEmb(unsigned int e1, unsigned int e2, unsigned int e3);
public:
/**
......@@ -261,7 +254,7 @@ public:
void removeFacesOfBoundary(AttributeHandler<unsigned char>& boundVertices, unsigned int frameWidth);
void recalPoints();
void recalPoints(const Geom::Vec3f& origin);
};
......
......@@ -100,6 +100,29 @@ void MarchingCube<DataType, Windowing, PFP>::deleteMesh()
}
}
template< typename DataType, template < typename D2 > class Windowing, typename PFP >
Dart MarchingCube<DataType, Windowing, PFP>::createTriEmb(unsigned int e1, unsigned int e2, unsigned int e3)
{
L_DART d = m_map->newFace(3,false);
//TODO change this which work only with 2-maps
// m_map->setDartEmbedding(VERTEX,d,e1); d = m_map->phi1(d);
// m_map->setDartEmbedding(VERTEX,d,e2); d = m_map->phi1(d);
// m_map->setDartEmbedding(VERTEX,d,e3); d = m_map->phi1(d);
FunctorSetEmb<GenericMap> fsetemb(*m_map, VERTEX, e1);
m_map->foreach_dart_of_orbit(PFP::MAP::ORBIT_IN_PARENT(VERTEX), d, fsetemb);
d = m_map->phi1(d);
fsetemb.changeEmb(e2);
m_map->foreach_dart_of_orbit(PFP::MAP::ORBIT_IN_PARENT(VERTEX), d, fsetemb);
d = m_map->phi1(d);
fsetemb.changeEmb(e3);
m_map->foreach_dart_of_orbit(PFP::MAP::ORBIT_IN_PARENT(VERTEX), d, fsetemb);
d = m_map->phi1(d);
return d;
}
template< typename DataType, template < typename D2 > class Windowing, typename PFP >
void MarchingCube<DataType, Windowing, PFP>::simpleMeshing()
{
......@@ -120,7 +143,7 @@ void MarchingCube<DataType, Windowing, PFP>::simpleMeshing()
// compute value to transform points directly to final system coordinate
// m_fOrigin = typename PFP::VEC3((float)(m_Image->getOrigin()[0]),(float)(m_Image->getOrigin()[1]),(float)(m_Image->getOrigin()[2]));
m_fOrigin = typename PFP::VEC3((float)(m_Image->getOrigin()[0]),(float)(m_Image->getOrigin()[1]),(float)(m_Image->getOrigin()[2]));
m_fScal[0] = m_Image->getVoxSizeX();
m_fScal[1] = m_Image->getVoxSizeY();
......@@ -483,7 +506,9 @@ void MarchingCube<DataType, Windowing, PFP>::createFaces_1(DataType *vox, const
unsigned int lVertTable[12];
typename PFP::VEC3 vPos((float)_lX + 0.5f, (float)_lY + 0.5f, (float)_lZ + 0.5f);
// typename PFP::VEC3 vPos(float(_lX) , float(_lY) , float(_lZ) );
// typename PFP::VEC3 vPos(float(_lX) + 0.5f, float(_lY) + 0.5f, (float)_lZ + 0.5f);
typename PFP::VEC3 vPos(_lX, _lY, _lZ);
// create the new vertices
......@@ -545,8 +570,7 @@ void MarchingCube<DataType, Windowing, PFP>::createFaces_2(DataType *vox, const
return;
unsigned int lVertTable[12];
// typename PFP::VEC3 vPos((float)_lX , (float)_lY, (float)_lZ);
typename PFP::VEC3 vPos((float)_lX + 0.5f, (float)_lY + 0.5f, (float)_lZ + 0.5f);
typename PFP::VEC3 vPos(_lX, _lY, _lZ);
// create the new vertices
int lX = _lX;
......@@ -603,8 +627,7 @@ void MarchingCube<DataType, Windowing, PFP>::createFaces_3(DataType *vox, const
return;
unsigned int lVertTable[12];
// typename PFP::VEC3 vPos((float)_lX , (float)_lY, (float)_lZ);
typename PFP::VEC3 vPos((float)_lX + 0.5f, (float)_lY + 0.5f, (float)_lZ + 0.5f);
typename PFP::VEC3 vPos(_lX, _lY, _lZ);
// create the new vertices
int lX = _lX;
......@@ -659,8 +682,7 @@ void MarchingCube<DataType, Windowing, PFP>::createFaces_4(DataType *vox, const
return;
unsigned int lVertTable[12];
// typename PFP::VEC3 vPos((float)_lX , (float)_lY, (float)_lZ);
typename PFP::VEC3 vPos((float)_lX + 0.5f, (float)_lY + 0.5f, (float)_lZ + 0.5f);
typename PFP::VEC3 vPos(_lX, _lY, _lZ);
// create the new vertices
int lX = _lX;
......@@ -718,8 +740,7 @@ void MarchingCube<DataType, Windowing, PFP>::createFaces_5(DataType *vox, const
return;
unsigned int lVertTable[12];
// typename PFP::VEC3 vPos((float)_lX , (float)_lY, (float)_lZ);
typename PFP::VEC3 vPos((float)_lX + 0.5f, (float)_lY + 0.5f, (float)_lZ + 0.5f);
typename PFP::VEC3 vPos(_lX, _lY, _lZ);
// create the new vertices
int lX = _lX;
......@@ -775,8 +796,7 @@ void MarchingCube<DataType, Windowing, PFP>::createFaces_6(DataType *vox, const
return;
unsigned int lVertTable[12];
// typename PFP::VEC3 vPos((float)_lX , (float)_lY, (float)_lZ);
typename PFP::VEC3 vPos((float)_lX + 0.5f, (float)_lY + 0.5f, (float)_lZ + 0.5f);
typename PFP::VEC3 vPos(_lX, _lY, _lZ);
// create the new vertices
int lX = _lX+1;
......@@ -837,8 +857,7 @@ void MarchingCube<DataType, Windowing, PFP>::createFaces_7(DataType *vox, const
return;
unsigned int lVertTable[12];
// typename PFP::VEC3 vPos((float)_lX , (float)_lY, (float)_lZ);
typename PFP::VEC3 vPos((float)_lX + 0.5f, (float)_lY + 0.5f, (float)_lZ + 0.5f);
typename PFP::VEC3 vPos(_lX, _lY, _lZ);
// create the new vertices
int lX = _lX+1;
......@@ -899,8 +918,7 @@ void MarchingCube<DataType, Windowing, PFP>::createFaces_8(DataType *vox, const
return;
unsigned int lVertTable[12];
// typename PFP::VEC3 vPos((float)_lX , (float)_lY, (float)_lZ);
typename PFP::VEC3 vPos((float)_lX + 0.5f, (float)_lY + 0.5f, (float)_lZ + 0.5f);
typename PFP::VEC3 vPos(_lX, _lY, _lZ);
// create the new vertices
int lX = _lX+1;
......@@ -953,14 +971,14 @@ template< typename DataType, template < typename D2 > class Windowing, typename
void MarchingCube<DataType, Windowing, PFP>::setNeighbourSimple(L_DART d1, L_DART d2)
{
if (m_map->phi2(d1) != d2)
m_map->sewFaces(d1,d2);
m_map->sewFaces(d1,d2,false);
}
template< typename DataType, template < typename D2 > class Windowing, typename PFP >
void MarchingCube<DataType, Windowing, PFP>::setNeighbour(L_DART d1, L_DART d2)
{
if (m_map->phi2(d1) != d2)
m_map->sewFaces(d1,d2);
m_map->sewFaces(d1,d2,false);
}
template< typename DataType, template < typename D2 > class Windowing, typename PFP >
......@@ -1241,7 +1259,7 @@ void MarchingCube<DataType, Windowing, PFP>::removeFacesOfBoundary(AttributeHand
}
template< typename DataType, template < typename D2 > class Windowing, typename PFP >
void MarchingCube<DataType, Windowing, PFP>::recalPoints()
void MarchingCube<DataType, Windowing, PFP>::recalPoints(const Geom::Vec3f& origin)
{
for(unsigned int i=m_positions.begin(); i != m_positions.end(); m_positions.next(i))
......@@ -1251,7 +1269,7 @@ void MarchingCube<DataType, Windowing, PFP>::recalPoints()
P[0] = P[0] * m_fScal[0];
P[1] = P[1] * m_fScal[1];
P[2] = P[2] * m_fScal[2];
P+=origin;
}
}
......
......@@ -302,8 +302,8 @@ void catmullClarkVol(typename PFP::MAP& map, EMBV& attributs, const FunctorSelec
attributs[e] += attributs[f];
attributs[e] *= 0.5;
travE.mark(d) ;
travE.mark(e) ;
travE.skip(d) ;
travE.skip(e) ;
}
//2. split faces - quadrangule faces
......@@ -318,7 +318,7 @@ void catmullClarkVol(typename PFP::MAP& map, EMBV& attributs, const FunctorSelec
Dart ne = map.phi2(map.phi_1(dd)) ;
map.cutEdge(ne) ;
travF.mark(dd) ;
travF.skip(dd) ;
attributs[map.phi1(ne)] = center;
......@@ -327,11 +327,11 @@ void catmullClarkVol(typename PFP::MAP& map, EMBV& attributs, const FunctorSelec
{
Dart tmp = map.phi1(ne) ;
map.splitFace(tmp, dd) ;
travF.mark(tmp) ;
travF.skip(tmp) ;
dd = map.phi1(map.phi1(dd)) ;
}
travF.mark(ne) ;
travF.skip(ne) ;
}
//3. create inside volumes
......
......@@ -36,6 +36,7 @@
#include "Geometry/vector_gen.h"
#include "Utils/vbo.h"
#include "Utils/svg.h"
// forward
namespace CGoGN { namespace Utils { class ShaderSimpleColor; } }
......@@ -83,6 +84,11 @@ protected:
*/
GLuint m_nbDarts;
/**
* number of relations 2 to draw
*/
GLuint m_nbRel1;
/**
* number of relations 2 to draw
*/
......@@ -266,8 +272,6 @@ public:
void dartToCol(Dart d, float& r, float& g, float& b);
/**
* update all drawing buffers to render a dual map
* @param map the map
......@@ -280,6 +284,14 @@ public:
template<typename PFP>
void updateData(typename PFP::MAP& map, const typename PFP::TVEC3& positions, float ke, float kf, float kv, const FunctorSelect& good = allDarts);
/**
* update color buffer with color attributte handler
* @param map the map
* @param good selector
* @param colors attribute of dart's colors
*/
template<typename PFP>
void updateColors(typename PFP::MAP& map, const typename PFP::TVEC3& colors, const FunctorSelect& good = allDarts);
/**
* Get back middle position of drawed darts
......@@ -290,8 +302,15 @@ public:
template<typename PFP>
void computeDartMiddlePositions(typename PFP::MAP& map, typename PFP::TVEC3& posExpl, const FunctorSelect& good = allDarts);
template<typename PFP>
void updateDataMap3OldFashioned(typename PFP::MAP& mapx, const typename PFP::TVEC3& positions, float ke, float kf, float kv, const FunctorSelect& good);
/**
* render to svg struct
*/
void toSVG(Utils::SVG::SVGOut& svg);
/**
* render svg into svg file
*/
void svgout2D(const std::string& filename, const glm::mat4& model, const glm::mat4& proj);
protected:
/**
......@@ -304,7 +323,7 @@ protected:
* @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);
void updateDataMap3(typename PFP::MAP& map, const typename PFP::TVEC3& positions, float ke, float kf, float kv, const FunctorSelect& good);
/**
* update all drawing buffers to render a gmap
......@@ -316,7 +335,7 @@ protected:
* @param good selector
*/
template<typename PFP>
void updateDataGMap3(typename PFP::MAP& map, const typename PFP::TVEC3& positions, float ke, float kf, float kv, const FunctorSelect& good = allDarts);
void updateDataGMap3(typename PFP::MAP& map, const typename PFP::TVEC3& positions, float ke, float kf, float kv, const FunctorSelect& good);
};
......
......@@ -33,8 +33,6 @@
#include "Topology/generic/traversorCell.h"
#include "Algo/Geometry/centroid.h"
#include <sys/time.h>
namespace CGoGN
{
......@@ -65,10 +63,6 @@ void Topo3Render::updateData(typename PFP::MAP& map, const typename PFP::TVEC3&
template<typename PFP>
void Topo3Render::updateDataMap3(typename PFP::MAP& mapx, const typename PFP::TVEC3& positions, float ke, float kf, float kv, const FunctorSelect& good)
{
typedef typename PFP::VEC3 VEC3;
typedef typename PFP::REAL REAL;
// Map3& map = dynamic_cast<Map3&>(mapx);
typedef typename PFP::VEC3 VEC3;
typedef typename PFP::REAL REAL;
......@@ -92,8 +86,7 @@ void Topo3Render::updateDataMap3(typename PFP::MAP& mapx, const typename PFP::TV
CellMarker cmv(mapx,VOLUME);
AutoAttributeHandler<VEC3> centerVolumes(mapx,VOLUME,"centerVolumes");
Algo::Geometry::computeCentroidVolumes<PFP>(mapx,positions,centerVolumes,good);
Algo::Geometry::computeCentroidVolumes<PFP>(mapx,positions,centerVolumes, allDarts);
// debut phi1
AutoAttributeHandler<VEC3> fv1(mapx, DART);
......@@ -120,7 +113,7 @@ void Topo3Render::updateDataMap3(typename PFP::MAP& mapx, const typename PFP::TV
unsigned int posDBI=0;
// traverse each face of each volume
TraversorCell<typename PFP::MAP> traFace(mapx, PFP::MAP::ORBIT_IN_PARENT(FACE),good);
TraversorCell<typename PFP::MAP> traFace(mapx, PFP::MAP::ORBIT_IN_PARENT(FACE),allDarts);
for (Dart d=traFace.begin(); d!=traFace.end(); d=traFace.next())
{
vecDartFaces.push_back(d);
......@@ -159,22 +152,25 @@ void Topo3Render::updateDataMap3(typename PFP::MAP& mapx, const typename PFP::TV
float oke = 1.0f - ke;
for (unsigned int i = 0; i < nb; ++i)
{
VEC3 P = vecPos[i]*ke + vecPos[i+1]*oke;
VEC3 Q = vecPos[i+1]*ke + vecPos[i]*oke;
if (good(d))
{
VEC3 P = vecPos[i]*ke + vecPos[i+1]*oke;
VEC3 Q = vecPos[i+1]*ke + vecPos[i]*oke;
m_attIndex[d] = posDBI;
posDBI+=2;
m_attIndex[d] = posDBI;
posDBI+=2;
*positionDartBuf++ = P;
*positionDartBuf++ = Q;
*colorDartBuf++ = m_dartsColor;
*colorDartBuf++ = m_dartsColor;
*positionDartBuf++ = P;
*positionDartBuf++ = Q;
*colorDartBuf++ = m_dartsColor;
*colorDartBuf++ = m_dartsColor;
fv1[d] = P*0.1f + Q*0.9f;
fv11[d] = P*0.9f + Q*0.1f;
fv1[d] = P*0.1f + Q*0.9f;
fv11[d] = P*0.9f + Q*0.1f;
fv2[d] = P*0.52f + Q*0.48f;
fv2x[d] = P*0.48f + Q*0.52f;
fv2[d] = P*0.52f + Q*0.48f;
fv2x[d] = P*0.48f + Q*0.52f;
}
d = mapx.phi1(d);
}
......@@ -186,25 +182,16 @@ void Topo3Render::updateDataMap3(typename PFP::MAP& mapx, const typename PFP::TV
m_vbo4->bind();
glUnmapBuffer(GL_ARRAY_BUFFER);
// phi1
m_vbo1->bind();
glBufferData(GL_ARRAY_BUFFER, 2*m_nbDarts*sizeof(typename PFP::VEC3), 0, GL_STREAM_DRAW);
GLvoid* PositionBuffer1 = glMapBufferARB(GL_ARRAY_BUFFER, GL_READ_WRITE);
//phi2
m_vbo2->bind();
glBufferData(GL_ARRAY_BUFFER, 2*m_nbDarts*sizeof(typename PFP::VEC3), 0, GL_STREAM_DRAW);
GLvoid* PositionBuffer2 = glMapBufferARB(GL_ARRAY_BUFFER, GL_READ_WRITE);
//phi3
m_vbo3->bind();
glBufferData(GL_ARRAY_BUFFER, 2*m_nbDarts*sizeof(typename PFP::VEC3), 0, GL_STREAM_DRAW);
GLvoid* PositionBuffer3 = glMapBufferARB(GL_ARRAY_BUFFER, GL_READ_WRITE);
VEC3* positioniF1 = new VEC3[ 2*m_nbDarts];
VEC3* positioniF2 = new VEC3[ 2*m_nbDarts];
VEC3* positioniF3 = new VEC3[ 2*m_nbDarts];
VEC3* positionF1 = reinterpret_cast<VEC3*>(PositionBuffer1);