本文整理汇总了C++中Stroke::addPoint方法的典型用法代码示例。如果您正苦于以下问题:C++ Stroke::addPoint方法的具体用法?C++ Stroke::addPoint怎么用?C++ Stroke::addPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stroke
的用法示例。
在下文中一共展示了Stroke::addPoint方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseXML
void CReadXML::parseXML(TiXmlDocument* document){
TiXmlElement* rootElement = document->RootElement();
const char* name = rootElement->Attribute("name");
character.setName(name);
const char* seq = rootElement->Attribute("stroke_seq_id");
character.setStrokeSeq(seq);
TiXmlElement* outlineElement = rootElement->FirstChildElement();
TiXmlElement* strokeElement = outlineElement->FirstChildElement();
Bujian bujian;
for (strokeElement;strokeElement;strokeElement = strokeElement->NextSiblingElement())
{
TiXmlElement* trunpoint = strokeElement->FirstChildElement();
Stroke stroke;
for (trunpoint;trunpoint;trunpoint = trunpoint->NextSiblingElement())
{
const char* x = trunpoint->Attribute("x");
const char* y = trunpoint->Attribute("y");
const char* statusPoint = trunpoint->Attribute("status");
stroke.addStatus(statusPoint);
stroke.addPoint(ccp(atof(x),atof(y)));
}
bujian.addStroke(stroke);
}
character.addBujian(bujian);
}
示例2: lastPoint
GList * EraseableStroke::getStroke(Stroke * original) {
XOJ_CHECK_TYPE(EraseableStroke);
GList * list = NULL;
Stroke * s = NULL;
Point lastPoint(NAN, NAN);
for (GList * l = this->parts->data; l != NULL; l = l->next) {
EraseableStrokePart * p = (EraseableStrokePart *) l->data;
GList * points = p->getPoints();
if (g_list_length(points) < 2) {
continue;
}
Point a = *((Point *) g_list_first(points)->data);
Point b = *((Point *) g_list_last(points)->data);
a.z = p->width;
if (!lastPoint.equalsPos(a) || s == NULL) {
if (s) {
s->addPoint(lastPoint);
}
s = new Stroke();
s->setColor(original->getColor());
s->setToolType(original->getToolType());
s->setWidth(original->getWidth());
list = g_list_append(list, s);
}
s->addPoint(a);
lastPoint = b;
}
if (s) {
s->addPoint(lastPoint);
}
return list;
}
示例3: makeCircleShape
/**
* Create circle stroke for inertia
*/
Stroke* CircleRecognizer::makeCircleShape(Stroke* originalStroke, Inertia& inertia)
{
int npts = (int) (2 * inertia.rad());
if (npts < 12)
{
npts = 12; // min. number of points
}
Stroke* s = new Stroke();
s->applyStyleFrom(originalStroke);
for (int i = 0; i <= npts; i++)
{
double x = inertia.centerX() + inertia.rad() * cos((2 * M_PI * i) / npts);
double y = inertia.centerY() + inertia.rad() * sin((2 * M_PI * i) / npts);
s->addPoint(Point(x, y));
}
return s;
}