本文整理汇总了C++中Point2D::getTime方法的典型用法代码示例。如果您正苦于以下问题:C++ Point2D::getTime方法的具体用法?C++ Point2D::getTime怎么用?C++ Point2D::getTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Point2D
的用法示例。
在下文中一共展示了Point2D::getTime方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawPoint
void ViewportPainter::drawPoint(Point2D & point) {
if(point.getTime() != "-1") {
QString text("t = " + point.getTime());
QRect rect(point.x()+TEXT_OFFSET_X, point.y()-TEXT_OFFSET_Y,10*text.length()+2*TEXT_MARGIN,15+2*TEXT_MARGIN);
this->setBrush(QColor(255, 255, 255, 255));
this->drawRect(rect);
this->drawText(rect,Qt::AlignHCenter|Qt::AlignVCenter,text);
}
if(point.selected())
this->setBrush(QColor(255, 0, 0, 255));
else
this->setBrush(QColor(255, 248, 133, 255));
this->drawEllipse(point.x()-POINT_SIZE/2,point.y()-POINT_SIZE/2,POINT_SIZE,POINT_SIZE);
}
示例2: enterTime
void Viewport::enterTime(Point2D * point) {
double time, min_time = 0, max_time = 2147483647;
list<Point2D>::iterator itp = points.begin();
if(point != &(points.front())) {
Point2D * previous = NULL;
for(itp = points.begin(); itp != points.end() && &(*itp) != point; itp++)
previous = &(*itp);
min_time = previous->getTime().toDouble()+0.1;
}
if(point != &(points.back())) {
itp++;
max_time = (*itp).getTime().toDouble();
if(max_time >= 0.1)
max_time -= 0.1;
}
time = QInputDialog::getDouble(this, "Time", "Please enter the time you want to apply this position (in seconds)", min_time, min_time, max_time);
ostringstream out;
out << time;
string text = out.str();
point->setTime(QString(text.data()));
}