Commit f1fbd43f authored by untereiner's avatar untereiner

- svg output supports groups / inkscape:layers

- renderTopoSurface with colorComboBox to choose darts/phi1/phi2 colors
parent b72caf85
......@@ -163,15 +163,15 @@ void MyQT::cb_Save()
Utils::SVG::SVGOut svg1(modelViewMatrix(), projectionMatrix());
m_drawer.toSVG(svg1);
svg1.addOpacityAnimation(1.0f);
svg1.addOpacityAnimation(1.0f);
svg1.addOpacityAnimation(0.0f);
// svg1.addOpacityAnimation(1.0f);
// svg1.addOpacityAnimation(1.0f);
// svg1.addOpacityAnimation(0.0f);
Utils::SVG::SVGOut svg2(modelViewMatrix(), projectionMatrix());
m_render_topo->toSVG(svg2);
svg2.addOpacityAnimation(1.0f);
svg2.addOpacityAnimation(0.0f);
svg2.addOpacityAnimation(1.0f);
// svg2.addOpacityAnimation(1.0f);
// svg2.addOpacityAnimation(0.0f);
// svg2.addOpacityAnimation(1.0f);
Utils::SVG::AnimatedSVGOut anim;
......
......@@ -237,13 +237,13 @@ void MyQT::cb_keyPress(int code)
{
std::string filename = selectFileSave("Export SVG file ",".","(*.svg)");
Utils::SVG::SVGOut svg(filename, modelViewMatrix(), projectionMatrix());
svg.setWidth(1.0f);
svg.setColor(Geom::Vec3f(0.0f,0.0f,0.5f));
// svg.setWidth(1.0f);
// svg.setColor(Geom::Vec3f(0.0f,0.0f,0.5f));
Algo::Render::SVG::renderEdges<PFP>(svg, myMap, position);
svg.setColor(Geom::Vec3f(0.0f,0.8f,0.0f));
svg.setWidth(5.0f);
// svg.setColor(Geom::Vec3f(0.0f,0.8f,0.0f));
// svg.setWidth(5.0f);
Algo::Render::SVG::renderVertices<PFP>(svg, myMap, position);
svg.setColor(Geom::Vec3f(1.0f,0.0f,0.0f));
// svg.setColor(Geom::Vec3f(1.0f,0.0f,0.0f));
m_strings->toSVG(svg);
//svg destruction close the file
}
......
......@@ -235,6 +235,16 @@ void MyQT::operation(int x)
std::cout << "nb darts after = " << myMap.getNbDarts() << std::endl;
}
break;
case 11 :
CGoGNout <<"unsew volumes"<<CGoGNendl;
if (m_selected != NIL)
{
myMap.unsewVolumes(m_selected);
dm.markAll();
m_selected = NIL;
updateMap();
}
break;
default:
break;
}
......
......@@ -145,6 +145,11 @@
<string>splitVertex</string>
</property>
</item>
<item>
<property name="text">
<string>unsewVolumes</string>
</property>
</item>
</widget>
</item>
<item row="6" column="0">
......
......@@ -134,6 +134,7 @@ SET(SCHNApps_QOBJECT_FILES
${SCHNApps_ROOT_DIR}/include/dialogs/cameraViewDialog.h
${SCHNApps_ROOT_DIR}/include/dialogs/pluginsViewDialog.h
${SCHNApps_ROOT_DIR}/include/dialogs/mapsViewDialog.h
${SCHNApps_ROOT_DIR}/include/colorComboBox.h
)
......
......@@ -6,14 +6,14 @@
<rect>
<x>0</x>
<y>0</y>
<width>204</width>
<width>206</width>
<height>547</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
<widget class="QListWidget" name="mapList"/>
</item>
......@@ -55,8 +55,14 @@
</item>
<item row="0" column="1">
<widget class="QSlider" name="slider_edgesScaleFactor">
<property name="maximum">
<number>100</number>
</property>
<property name="value">
<number>50</number>
<number>100</number>
</property>
<property name="sliderPosition">
<number>100</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
......@@ -72,9 +78,15 @@
</item>
<item row="1" column="1">
<widget class="QSlider" name="slider_facesScaleFactor">
<property name="value">
<property name="minimum">
<number>50</number>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="value">
<number>100</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
......@@ -83,6 +95,68 @@
</layout>
</item>
<item row="4" column="0">
<widget class="Line" name="line_2"/>
</item>
<item row="5" column="0">
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QCheckBox" name="checkBox_3">
<property name="text">
<string>draw darts</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="tristate">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="ColorComboBox" name="comboBox_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="checkBox">
<property name="text">
<string>draw phi1</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="tristate">
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="ColorComboBox" name="comboBox"/>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="checkBox_2">
<property name="text">
<string>draw phi2</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="tristate">
<bool>false</bool>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="ColorComboBox" name="comboBox_2"/>
</item>
</layout>
</item>
<item row="6" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
......@@ -97,6 +171,13 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ColorComboBox</class>
<extends>QComboBox</extends>
<header location="global">colorComboBox.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
......@@ -215,7 +215,8 @@ void RenderTopoSurfacePlugin::changeEdgesScaleFactor(View* view, MapHandlerGen*
{
ParameterSet* params = h_viewParams[view];
PerMapParameterSet* perMap = params->perMap[map->getName()];
perMap->edgesScaleFactor = i / 50.0;
perMap->edgesScaleFactor = i / 100.0;
std::cout << "i = " << perMap->edgesScaleFactor << std::endl;
perMap->updateRender();
if(view->isCurrentView())
......@@ -230,7 +231,7 @@ void RenderTopoSurfacePlugin::changeFacesScaleFactor(View* view, MapHandlerGen*
{
ParameterSet* params = h_viewParams[view];
PerMapParameterSet* perMap = params->perMap[map->getName()];
perMap->facesScaleFactor = i / 50.0;
perMap->facesScaleFactor = i / 100.0;
perMap->updateRender();
if(view->isCurrentView())
......@@ -243,7 +244,21 @@ void RenderTopoSurfacePlugin::changeFacesScaleFactor(View* view, MapHandlerGen*
void RenderTopoSurfacePlugin::attributeModified(unsigned int orbit, QString nameAttr)
{
// if(orbit == VERTEX)
// {
// MapHandlerGen* map = static_cast<MapHandlerGen*>(QObject::sender());
// if(h_viewParams.contains(map->getName()))
// {
// ParameterSet* params = h_viewParams[view];
//
// if(params->perMap.contains(map->getName()))
// PerMapParameterSet* perMap = params->perMap[map->getName()];
// perMap->updateRender();
//
// //if(params.positionName == nameAttr && params.autoUpdate)
// // computeNormal(map->getName(), params.positionName, params.normalName);
// }
// }
}
void RenderTopoSurfacePlugin::connectivityModified()
......
......@@ -63,8 +63,8 @@ void RenderTopoSurfaceDockTab::refreshUI(ParameterSet* params)
}
}
slider_edgesScaleFactor->setSliderPosition(p->edgesScaleFactor * 50.0);
slider_facesScaleFactor->setSliderPosition(p->facesScaleFactor * 50.0);
slider_edgesScaleFactor->setSliderPosition(p->edgesScaleFactor * 100.0);
slider_facesScaleFactor->setSliderPosition(p->facesScaleFactor * 100.0);
}
++i;
}
......
......@@ -4,6 +4,7 @@ renderVectorPlugin = schnapps.loadPlugin("RenderVectorD");
differentialPropertiesPlugin = schnapps.loadPlugin("DifferentialProperties");
subdivisionPlugin = schnapps.loadPlugin("SubdivideSurface");
surfaceDeformationPlugin = schnapps.loadPlugin("SurfaceDeformation");
renderTopoSurface = schnapps.loadPlugin("RenderTopoSurface");
obj = importPlugin.importFromFile("/home/kraemer/Media/Data/surface/lowRes/iphi_good_9k.off");
......@@ -12,6 +13,7 @@ v = schnapps.getView("view_0");
schnapps.linkViewAndPlugin(v.getName(), renderPlugin.getName());
schnapps.linkViewAndPlugin(v.getName(), renderVectorPlugin.getName());
schnapps.linkViewAndPlugin(v.getName(), surfaceDeformationPlugin.getName());
schnapps.linkViewAndPlugin(v.getName(), renderTopoSurface.getName());
schnapps.linkViewAndMap(v.getName(), obj.getName());
......
#ifndef COLORCOMBOBOX_H
#define COLORCOMBOBOX_H
#include <QComboBox>
class QColor;
class QWidget;
class ColorComboBox : public QComboBox
{
Q_OBJECT
Q_PROPERTY(QColor color READ color WRITE setColor USER true)
public:
QColor color() const;
void setColor(QColor c);
public:
ColorComboBox(QWidget *widget = 0);
private:
void populateList();
public slots:
void slotHighlight(int index);
};
#endif
#include <QtGui>
#include "colorComboBox.h"
ColorComboBox::ColorComboBox(QWidget *widget) : QComboBox(widget)
{
//connect( this, SIGNAL(highlighted(int)), this, SLOT(slotHighlight(int)) );
populateList();
}
QColor ColorComboBox::color() const
{
return qvariant_cast<QColor>(itemData(currentIndex(), Qt::DecorationRole));
}
void ColorComboBox::setColor(QColor color)
{
setCurrentIndex(findData(color, int(Qt::DecorationRole)));
}
void ColorComboBox::populateList()
{
//QStringList colorNames = QColor::colorNames();
QStringList colorNames;
colorNames <<"darkGreen"<<"green"<<"gray"<<"red"<<"white"<<"blue"<<"cyan"<<"darkMagenta"<<"yellow"<<"darkRed"<<"black"<<"magenta";
for (int i = 0; i < colorNames.size(); ++i) {
QColor color(colorNames[i]);
insertItem(i, colorNames[i]);
setItemData(i, color, Qt::DecorationRole);
}
}
void ColorComboBox::slotHighlight(int index)
{
const QStringList colorNames = QColor::colorNames();
QColor color(colorNames.at(index));
QPalette palette = this->palette();
palette.setColor(QPalette::Highlight, color);
setPalette(palette);
}
......@@ -37,41 +37,49 @@ namespace SVG
template <typename PFP>
void renderVertices(Utils::SVG::SVGOut& svg, typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3>& position, unsigned int thread)
{
Utils::SVG::SvgGroup* svg1 = new Utils::SVG::SvgGroup("vertices", svg.m_model, svg.m_proj);
TraversorV<typename PFP::MAP> trac(map);
svg.beginPoints();
svg1->beginPoints();
for (Dart d = trac.begin(); d != trac.end(); d = trac.next())
svg.addPoint(position[d]);
svg.endPoints();
svg1->addPoint(position[d]);
svg1->endPoints();
svg.addGroup(svg1);
}
template <typename PFP>
void renderVertices(Utils::SVG::SVGOut& svg, typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3>& position, const VertexAttribute<typename PFP::VEC3>& color, unsigned int thread)
{
Utils::SVG::SvgGroup* svg1 = new Utils::SVG::SvgGroup("vertices", svg.m_model, svg.m_proj);
TraversorV<typename PFP::MAP> trac(map);
svg.beginPoints();
svg1->beginPoints();
for (Dart d = trac.begin(); d != trac.end(); d = trac.next())
svg.addPoint(position[d], color[d]);
svg.endPoints();
svg1->addPoint(position[d], color[d]);
svg1->endPoints();
svg.addGroup(svg1);
}
template <typename PFP>
void renderEdges(Utils::SVG::SVGOut& svg, typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3>& position, unsigned int thread)
{
Utils::SVG::SvgGroup* svg1 = new Utils::SVG::SvgGroup("edges", svg.m_model, svg.m_proj);
TraversorE<typename PFP::MAP> trac(map);
svg.beginLines();
svg1->beginLines();
for (Dart d = trac.begin(); d != trac.end(); d = trac.next())
svg.addLine(position[d], position[map.phi1(d)]);
svg.endLines();
svg1->addLine(position[d], position[map.phi1(d)]);
svg1->endLines();
svg.addGroup(svg1);
}
template <typename PFP>
void renderEdges(Utils::SVG::SVGOut& svg, typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3>& position, const VertexAttribute<typename PFP::VEC3>& color, unsigned int thread)
{
Utils::SVG::SvgGroup* svg1 = new Utils::SVG::SvgGroup("edges", svg.m_model, svg.m_proj);
TraversorE<typename PFP::MAP> trac(map);
svg.beginLines();
svg1->beginLines();
for (Dart d = trac.begin(); d != trac.end(); d = trac.next())
svg.addLine(position[d], position[map.phi1(d)], color[d]);
svg.endLines();
svg1->addLine(position[d], position[map.phi1(d)], color[d]);
svg1->endLines();
svg.addGroup(svg1);
}
} // namespace SVG
......
......@@ -157,13 +157,11 @@ public:
class AnimatedSVGOut;
class SVGOut
class SvgGroup
{
friend class AnimatedSVGOut;
protected:
std::ofstream* m_out;
public:
std::string m_name;
const glm::mat4& m_model;
const glm::mat4& m_proj;
glm::i32vec4 m_viewport;
......@@ -176,15 +174,9 @@ protected:
std::vector<float> m_opacities_animations;
unsigned int m_bbX0;
unsigned int m_bbY0;
unsigned int m_bbX1;
unsigned int m_bbY1;
bool m_isLayer;
protected:
void computeBB(unsigned int& a, unsigned int& b, unsigned int& c, unsigned& d);
public:
......@@ -194,7 +186,7 @@ public:
* @param model the modelview matrix
* @param proj the projection matrix
*/
SVGOut(const std::string& filename, const glm::mat4& model, const glm::mat4& proj);
SvgGroup(const std::string& name, const glm::mat4& model, const glm::mat4& proj);
/**
* Object that allow the rendering/exporting in svg file
......@@ -202,19 +194,18 @@ public:
* @param model the modelview matrix
* @param proj the projection matrix
*/
SVGOut(const glm::mat4& model, const glm::mat4& proj);
//SvgGroup(const glm::mat4& model, const glm::mat4& proj);
/**
* destructor
* flush and close the file
*/
~SVGOut();
~SvgGroup();
void setColor(const Geom::Vec3f& col);
void setWidth(float w);
void closeFile();
void beginPoints();
void endPoints();
......@@ -234,15 +225,63 @@ public:
void addString(const Geom::Vec3f& P, const Geom::Vec3f& Q, const std::string& str);
void addString(const Geom::Vec3f& P, const std::string& str, const Geom::Vec3f& C);
void sortSimpleDepth( std::vector<DepthSort>& vds);
void addOpacityAnimation(float val) { m_opacities_animations.push_back(val);}
void clearpacityAnimation() { m_opacities_animations.clear();}
static void animateSVG(const std::string& filename, const std::vector<SVGOut*>& outs, float timestep);
void setToLayer() { m_isLayer = true; }
//static void animateSVG(const std::string& filename, const std::vector<SVGOut*>& outs, float timestep);
};
class SVGOut
{
public:
std::ofstream* m_out;
const glm::mat4& m_model;
const glm::mat4& m_proj;
glm::i32vec4 m_viewport;
std::vector<SvgGroup*> m_groups;
unsigned int m_bbX0;
unsigned int m_bbY0;
unsigned int m_bbX1;
unsigned int m_bbY1;
protected:
void computeBB(unsigned int& a, unsigned int& b, unsigned int& c, unsigned& d);
public:
/**
* Object that allow the rendering/exporting in svg file
* @param filename file name ended by .svg
* @param model the modelview matrix
* @param proj the projection matrix
*/
SVGOut(const std::string& filename, const glm::mat4& model, const glm::mat4& proj);
/**
* Object that allow the rendering/exporting in svg file
* no file parameter for use in animateSVG
* @param model the modelview matrix
* @param proj the projection matrix
*/
SVGOut(const glm::mat4& model, const glm::mat4& proj);
~SVGOut();
void addGroup(SvgGroup* group) { m_groups.push_back(group); }
void write();
};
class AnimatedSVGOut
{
protected:
......
......@@ -384,71 +384,82 @@ void Topo3Render::svgout2D(const std::string& filename, const glm::mat4& model,
void Topo3Render::toSVG(Utils::SVG::SVGOut& svg)
{
svg.setWidth(m_topo_relation_width);
// PHI3 / beta3
Utils::SVG::SvgGroup* svg1 = new Utils::SVG::SvgGroup("phi3", svg.m_model, svg.m_proj);
const Geom::Vec3f* ptr = reinterpret_cast<Geom::Vec3f*>(m_vbo3->lockPtr());
svg.beginLines();
svg1->setWidth(m_topo_relation_width);
svg1->beginLines();
for (unsigned int i=0; i<m_nbRel3; ++i)
{
Geom::Vec3f P = (ptr[4*i]+ ptr[4*i+3])/2.0f;
Geom::Vec3f Q = (ptr[4*i+1]+ ptr[4*i+2])/2.0f;
svg.addLine(P, Q,Geom::Vec3f(0.8f,0.8f,0.0f));
svg1->addLine(P, Q,Geom::Vec3f(0.8f,0.8f,0.0f));
}
svg.endLines();
svg1->endLines();
m_vbo3->releasePtr();
svg.addGroup(svg1);
// PHI2 / beta2
Utils::SVG::SvgGroup* svg2 = new Utils::SVG::SvgGroup("phi2", svg.m_model, svg.m_proj);
ptr = reinterpret_cast<Geom::Vec3f*>(m_vbo2->lockPtr());
svg.beginLines();
svg2->setWidth(m_topo_relation_width);
svg2->beginLines();
for (unsigned int i=0; i<m_nbRel2; ++i)
{
Geom::Vec3f P = (ptr[4*i]+ ptr[4*i+3])/2.0f;
Geom::Vec3f Q = (ptr[4*i+1]+ ptr[4*i+2])/2.0f;
svg.addLine(P, Q,Geom::Vec3f(0.8f,0.0f,0.0f));
svg2->addLine(P, Q,Geom::Vec3f(0.8f,0.0f,0.0f));
}
svg.endLines();
svg2->endLines();
m_vbo2->releasePtr();
svg.addGroup(svg2);
//PHI1 /beta1
Utils::SVG::SvgGroup* svg3 = new Utils::SVG::SvgGroup("phi1", svg.m_model, svg.m_proj);
ptr = reinterpret_cast<Geom::Vec3f*>(m_vbo1->lockPtr());
svg.beginLines();
svg3->setWidth(m_topo_relation_width);
svg3->beginLines();
for (unsigned int i=0; i<m_nbRel1; ++i)
svg.addLine(ptr[2*i], ptr[2*i+1],Geom::Vec3f(0.0f,0.7f,0.7f));
svg.endLines();
svg3->addLine(ptr[2*i], ptr[2*i+1],Geom::Vec3f(0.0f,0.7f,0.7f));
svg3->endLines();
m_vbo1->releasePtr();
svg.addGroup(svg3);
const Geom::Vec3f* colorsPtr = reinterpret_cast<const Geom::Vec3f*>(m_vbo4->lockPtr());
ptr= reinterpret_cast<Geom::Vec3f*>(m_vbo0->lockPtr());
svg.setWidth(m_topo_dart_width);
Utils::SVG::SvgGroup* svg4 = new Utils::SVG::SvgGroup("darts", svg.m_model, svg.m_proj);
svg4->setWidth(m_topo_dart_width);
svg.beginLines();
svg4->beginLines();
for (unsigned int i=0; i<m_nbDarts; ++i)
{
Geom::Vec3f col = colorsPtr[2*i];
if (col.norm2()>2.9f)
col = Geom::Vec3f(1.0f,1.0f,1.0f) - col;
svg.addLine(ptr[2*i], ptr[2*i+1], col);
svg4->addLine(ptr[2*i], ptr[2*i+1], col);
}
svg.endLines();
svg4->endLines();
svg.beginPoints();
svg.addGroup(svg4);
Utils::SVG::SvgGroup* svg5 = new Utils::SVG::SvgGroup("dartEmb", svg.m_model, svg.m_proj);
svg5->setWidth(m_topo_dart_width);
svg5->beginPoints();
for (unsigned int i=0; i<m_nbDarts; ++i)
{
Geom::Vec3f col = colorsPtr[2*i];
if (col.norm2()>2.9f)
col = Geom::Vec3f(1.0f,1.0f,1.0f) - col;
svg.addPoint(ptr[2*i], col);
svg5->addPoint(ptr[2*i], col);
}
svg.endPoints();
svg5->endPoints();
svg.addGroup(svg5);
m_vbo0->releasePtr();
m_vbo4->releasePtr();
......
<
......@@ -297,48 +297,97 @@ void TopoRender::svgout2D(const std::string& filename, const glm::mat4& model, c
{
Utils::SVG::SVGOut svg(filename,model,proj);
toSVG(svg);
svg.write();
}
void TopoRender::toSVG(Utils::SVG::SVGOut& svg)
{
svg.setWidth(m_topo_relation_width);
// svg.setWidth(m_topo_relation_width);
//
// // PHI2 / beta2
// const Geom::Vec3f* ptr = reinterpret_cast<Geom::Vec3f*>(m_vbo2->lockPtr());
// svg.beginLines();
// for (unsigned int i=0; i<m_nbRel2; ++i)
// svg.addLine(ptr[2*i], ptr[2*i+1],Geom::Vec3f(0.8f,0.0f,0.0f));
// svg.endLines();
//
// m_vbo2->releasePtr();
//
// //PHI1 /beta1
// ptr = reinterpret_cast<Geom::Vec3f*>(m_vbo1->lockPtr());
// svg.beginLines();
// for (unsigned int i=0; i<m_nbRel1; ++i)
// svg.addLine(ptr[2*i], ptr[2*i+1],Geom::Vec3f(0.0f,0.7f,0.7f));
// svg.endLines();
// m_vbo1->releasePtr();
//
//
// const Geom::Vec3f* colorsPtr = reinterpret_cast<const Geom::Vec3f*>(m_vbo3->lockPtr());
// ptr= reinterpret_cast<Geom::Vec3f*>(m_vbo0->lockPtr());
//
// svg.setWidth(m_topo_dart_width);
// svg.beginLines();
// for (unsigned int i=0; i<m_nbDarts; ++i)
// svg.addLine(ptr[2*i], ptr[2*i+1], colorsPtr[2*i]);
// svg.endLines();
//
// svg.beginPoints();
// for (unsigned int i=0; i<m_nbDarts; ++i)
// svg.addPoint(ptr[2*i], colorsPtr[2*i]);
// svg.endPoints();
//
// m_vbo0->releasePtr();
// m_vbo3->releasePtr();
// PHI2 / beta2
// PHI2 / beta2
Utils::SVG::SvgGroup* svg1 = new Utils::SVG::SvgGroup("phi2", svg.m_model, svg.m_proj);
svg1->setToLayer();
const Geom::Vec3f* ptr = reinterpret_cast<Geom::Vec3f*>(m_vbo2->lockPtr());
svg.beginLines();
svg1->setWidth(m_topo_relation_width);
svg1->beginLines();
for (unsigned int i=0; i<m_nbRel2; ++i)
svg.addLine(ptr[2*i], ptr[2*i+1],Geom::Vec3f(0.8f,0.0f,0.0f));