void PolyLineNode::setPos(const vector<glm::vec2>& pts) { m_Pts = pts; m_TexCoords.clear(); m_EffTexCoords.clear(); calcPolyLineCumulDist(m_CumulDist, m_Pts, false); setDrawNeeded(); }
PolyLineNode::PolyLineNode(const ArgList& args) : VectorNode(args) { args.setMembers(this); if (m_TexCoords.size() > m_Pts.size()) { throw(Exception(AVG_ERR_OUT_OF_RANGE, "Too many texture coordinates in polyline")); } setLineJoin(args.getArgVal<string>("linejoin")); calcPolyLineCumulDist(m_CumulDist, m_Pts, false); }
PolygonNode::PolygonNode(const ArgList& args) : FilledVectorNode(args) { args.setMembers(this); if (m_TexCoords.size() > m_Pts.size()+1) { throw(Exception(AVG_ERR_OUT_OF_RANGE, "Too many texture coordinates in polygon")); } if (m_Pts.size() != 0 && m_Pts.size() < 3) { throw(Exception(AVG_ERR_UNSUPPORTED, "A polygon must have min. tree points.")); } if (m_Holes.size() > 0) { for (unsigned int i = 0; i < m_Holes.size(); i++) { if (m_Holes[i].size() < 3) { throw(Exception(AVG_ERR_UNSUPPORTED, "A hole of a polygon must have min. tree points.")); } } } setLineJoin(args.getArgVal<string>("linejoin")); calcPolyLineCumulDist(m_CumulDist, m_Pts, true); }