本文整理汇总了C++中Point2::toString方法的典型用法代码示例。如果您正苦于以下问题:C++ Point2::toString方法的具体用法?C++ Point2::toString怎么用?C++ Point2::toString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Point2
的用法示例。
在下文中一共展示了Point2::toString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: assertEqualsImpl
void TestCase::assertEqualsImpl(const Point2 &actual, const Point2 &expected, Float epsilon, const char *file, int line) {
bool match = true;
for (int i=0; i<2; ++i)
if (std::abs(actual[i]-expected[i]) > epsilon)
match = false;
if (!match)
Thread::getThread()->getLogger()->log(EError, NULL, file, line, "Assertion failure: "
"expected point %s, got %s.", expected.toString().c_str(), actual.toString().c_str());
}
示例2: generateRay
void generateRay(const Point2 &dirSample, const Point2 &lensSample,
Float timeSample, Ray &ray) const {
++cameraRays;
Float u = dirSample.x * m_invResolution.x,
v = dirSample.y * m_invResolution.y;
Vector direction = squareToSphereY(u, v);
Point2 uvPrime = sphereToSquareY(direction);
if ((std::abs(uvPrime.x-u) > Epsilon || std::abs(uvPrime.y-v)>Epsilon) && u < 1 && v < 1 && u > 0 && v > 0)
cout << uvPrime.toString() << " vs " << u << ", " << v << endl;
/* Construct ray in camera space */
Ray localRay(Point(0.0f), direction,
m_shutterOpen + m_shutterOpenTime * timeSample);
/* Transform into world space */
m_cameraToWorld(localRay, ray);
}