本文整理汇总了C++中Point2f::SetX方法的典型用法代码示例。如果您正苦于以下问题:C++ Point2f::SetX方法的具体用法?C++ Point2f::SetX怎么用?C++ Point2f::SetX使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Point2f
的用法示例。
在下文中一共展示了Point2f::SetX方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TestHalfspace2D
void TestHalfspace2D(void) {
#define DO_TEST(res) \
desc.Format("p = (%3.1f, %3.1f), n = (%3.1f, %3.1f), t = (%3.1f, %3.1f)", \
planePt.X(), planePt.Y(), \
normal.X(), normal.Y(), \
testPt.X(), testPt.Y()); \
AssertEqual(desc.PeekBuffer(), planePt.Halfspace(normal, testPt), vislib::math::res)
using vislib::math::HalfSpace;
vislib::StringA desc;
Point2f planePt;
Vector2f normal;
Point2f testPt;
planePt.Set(0.0f, 0.0f);
normal.Set(1.0f, 0.0f);
testPt.Set(0.0f, 0.0f);
DO_TEST(HALFSPACE_IN_PLANE);
testPt.SetY(1.0f);
DO_TEST(HALFSPACE_IN_PLANE);
testPt.SetY(-1.0f);
DO_TEST(HALFSPACE_IN_PLANE);
testPt.SetX(1.0f);
DO_TEST(HALFSPACE_POSITIVE);
testPt.SetX(-1.0f);
DO_TEST(HALFSPACE_NEGATIVE);
testPt.Set(0.5f, 0.5f);
DO_TEST(HALFSPACE_POSITIVE);
testPt.SetX(-1.0f);
DO_TEST(HALFSPACE_NEGATIVE);
normal.Set(0.0f, 1.0f);
testPt.Set(0.0f, 0.0f);
DO_TEST(HALFSPACE_IN_PLANE);
testPt.SetX(1.0f);
DO_TEST(HALFSPACE_IN_PLANE);
testPt.SetX(-1.0f);
DO_TEST(HALFSPACE_IN_PLANE);
testPt.SetY(1.0f);
DO_TEST(HALFSPACE_POSITIVE);
testPt.SetY(-1.0f);
DO_TEST(HALFSPACE_NEGATIVE);
normal.Set(0.5f, 0.5f);
testPt.Set(0.0f, 0.0f);
DO_TEST(HALFSPACE_IN_PLANE);
testPt.Set(0.5f, -0.5f);
DO_TEST(HALFSPACE_IN_PLANE);
testPt.Set(-0.5f, 0.5f);
DO_TEST(HALFSPACE_IN_PLANE);
testPt.Set(1.0f, 1.0f);
DO_TEST(HALFSPACE_POSITIVE);
testPt.Set(-1.0f, -1.0f);
DO_TEST(HALFSPACE_NEGATIVE);
testPt.Set(1.0f, 0.0f);
DO_TEST(HALFSPACE_POSITIVE);
testPt.Set(-1.0f, 0.0f);
DO_TEST(HALFSPACE_NEGATIVE);
planePt.Set(1.0f, 0.0f);
normal.Set(1.0f, 0.0f);
testPt.Set(0.0f, 0.0f);
DO_TEST(HALFSPACE_NEGATIVE);
testPt.SetY(1.0f);
DO_TEST(HALFSPACE_NEGATIVE);
testPt.SetY(-1.0f);
DO_TEST(HALFSPACE_NEGATIVE);
testPt.SetX(1.0f);
DO_TEST(HALFSPACE_IN_PLANE);
testPt.SetX(-1.0f);
DO_TEST(HALFSPACE_NEGATIVE);
testPt.SetX(2.0f);
//.........这里部分代码省略.........