本文整理汇总了C++中Point2f::getY方法的典型用法代码示例。如果您正苦于以下问题:C++ Point2f::getY方法的具体用法?C++ Point2f::getY怎么用?C++ Point2f::getY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Point2f
的用法示例。
在下文中一共展示了Point2f::getY方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: contains
/* PUBLIC MEMBER FUNCTIONS */
bool ControlPoint::contains(const FingerEventArgs &e) const
{
Point2f p = e.getPosition();
assert(modelview != NULL);
modelview->unTranslatePoint(p);
modelview->unScalePoint(p);
float distance = sqrt((p.getX() * p.getX()) + (p.getY() * p.getY()));
return distance <= (width * BOUNDING_SPHERE);
}
示例2: isClose
bool SplineControl::isClose(const Point2f &p)
{
float val = getValue(p.getX());
float distance = fabs((p.getY() / height) - (1.0f - val));
return distance < (1.0f * FINGER_RANGE_FACTOR);
}
示例3: touchUp
void WMTouchEventSource::touchUp(TOUCHINPUT *ti)
{
assert(ti);
if(eventCallback != NULL)
{
Point2f p = convert(ti);
eventCallback(ti->dwID, p.getX(),p.getY(), FingerEventArgs::EventType::FINGER_REMOVED);
}
}
示例4: updateFingerPosition
void PressAndHold::updateFingerPosition(const Point2f &newPosition)
{
float dx = position.getX() - newPosition.getX();
float dy = position.getY() - newPosition.getY();
float d = sqrt((dx * dx) + (dy * dy));
if(d >= THRESHOLD)
{
markedForDelete = true;
}
}
示例5: contains
/* PUBLIC MEMBER FUNCTIONS */
bool SplineControl::contains(const FingerEventArgs &e) const
{
assert(modelview != NULL);
Point2f p = e.getPosition();
modelview->unTranslatePoint(p);
float legendDim = (height * LEGEND_DIM) * modelview->getYScale();
return p.getX() >= 0.0f &&
p.getX() <= (width * modelview->getXScale()) &&
p.getY() >= legendDim &&
p.getY() <= (height * modelview->getYScale()) - legendDim;
}
示例6: controlPointContains
bool SplineControl::controlPointContains(const FingerEventArgs &e) const
{
assert(modelview != NULL);
Point2f p = e.getPosition();
modelview->unTranslatePoint(p);
// use legend dim on left and right as a buffer to prevent deletion near edge
float legendDim = (height * LEGEND_DIM) * modelview->getYScale();
return p.getX() >= -legendDim &&
p.getX() <= (width * modelview->getXScale()) + legendDim &&
p.getY() >= 0.0f &&
p.getY() <= height * modelview->getYScale();
}
示例7: update
void ScrollMenu::update(void)
{
assert(modelview != NULL);
if(!selected && fingerDown && !moved)
{
Point2f p = down;
modelview->unTranslatePoint(p);
modelview->unScalePoint(p);
selected = true;
selectedIndex = (scrollDirection == VERTICAL) ? (unsigned int)((p.getY() / height) * (float)displayCount) : (unsigned int)((p.getX() / width) * (float)displayCount);
dirty = true;
}
else if(selected && moved)
{
selected = false;
dirty = true;
}
}
示例8:
void Point2f::setPosition(const Point2f &position)
{
this->x = position.getX();
this->y = position.getY();
}