当前位置: 首页>>代码示例>>C++>>正文


C++ Point2f::getX方法代码示例

本文整理汇总了C++中Point2f::getX方法的典型用法代码示例。如果您正苦于以下问题:C++ Point2f::getX方法的具体用法?C++ Point2f::getX怎么用?C++ Point2f::getX使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Point2f的用法示例。


在下文中一共展示了Point2f::getX方法的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);
	}
开发者ID:jonathanhook,项目名称:Waves,代码行数:13,代码来源:ControlPoint.cpp

示例2: 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;
	}
开发者ID:jonathanhook,项目名称:Waves,代码行数:15,代码来源:SplineControl.cpp

示例3: 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();
	}
开发者ID:jonathanhook,项目名称:Waves,代码行数:15,代码来源:SplineControl.cpp

示例4: 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);
	}
开发者ID:jonathanhook,项目名称:Waves,代码行数:7,代码来源:SplineControl.cpp

示例5: 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);
		}
	}
开发者ID:jonathanhook,项目名称:PhysicsSynth,代码行数:10,代码来源:WMTouchEventSource.cpp

示例6: 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;
		}
	}
开发者ID:jonathanhook,项目名称:PhysicsSynth,代码行数:11,代码来源:PressAndHold.cpp

示例7:

	void Point2f::setPosition(const Point2f &position)
	{
		this->x = position.getX();
		this->y = position.getY();
	}
开发者ID:jonathanhook,项目名称:PhysicsSynth,代码行数:5,代码来源:Point2f.cpp

示例8: 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;
		}
	}
开发者ID:jonathanhook,项目名称:Waves,代码行数:20,代码来源:ScrollMenu.cpp


注:本文中的Point2f::getX方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。