#include "X3D_IndexedLineSet.h" #include "X3D_X3DColorNode.h" #include "X3D_X3DCoordinateNode.h" #include using namespace std; namespace X3DTK { namespace X3D { IndexedLineSet::IndexedLineSet() : X3DGeometryNode() { define(Recorder::getTypeName("IndexedLineSet", "Rendering")); define(Recorder::getAttribute("colorIndex", &IndexedLineSet::_colorIndex, MFInt32())); define(Recorder::getAttribute("colorPerVertex", &IndexedLineSet::_colorPerVertex, true)); define(Recorder::getAttribute("coordIndex", &IndexedLineSet::_coordIndex, MFInt32())); define(Recorder::getAttribute("lineWidth", &IndexedLineSet::_lineWidth, 1.0f)); define(Recorder::getSFNode("color", &IndexedLineSet::_color)); define(Recorder::getSFNode("coord", &IndexedLineSet::_coord)); } IndexedLineSet::~IndexedLineSet() { removeChildren(); } void IndexedLineSet::setColorIndex(const MFInt32 &colorIndex) { _colorIndex = colorIndex; } void IndexedLineSet::setColorPerVertex(const SFBool &colorPerVertex) { _colorPerVertex = colorPerVertex; } void IndexedLineSet::setCoordIndex(const MFInt32 &coordIndex) { _coordIndex = coordIndex; if ((!coordIndex.empty()) && (coordIndex.back() != -1)) _coordIndex.push_back(-1); } void IndexedLineSet::setLineWidth(const SFFloat &lineWidth) { _lineWidth = lineWidth; } } }