本文整理汇总了C++中MgShape::shapec方法的典型用法代码示例。如果您正苦于以下问题:C++ MgShape::shapec方法的具体用法?C++ MgShape::shapec怎么用?C++ MgShape::shapec使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MgShape
的用法示例。
在下文中一共展示了MgShape::shapec方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _hitTest
float MgComposite::_hitTest(const Point2d& pt, float tol, MgHitResult& res) const
{
void* it;
MgHitResult tmpRes;
Box2d limits(pt, 2 * tol, 0);
res.segment = 0;
res.dist = _FLT_MAX;
for (MgShape* sp = _shapes->getFirstShape(it); sp;
sp = _shapes->getNextShape(it))
{
if (limits.isIntersect(sp->shapec()->getExtent())) {
float d = sp->shapec()->hitTest(pt, tol, tmpRes);
if (res.dist > d - _MGZERO)
{
res = tmpRes;
res.dist = d;
res.segment = sp->getID();
}
}
}
_shapes->freeIterator(it);
return res.segment != 0;
}
示例2: _hitTest
float MgComposite::_hitTest(const Point2d& pt, float tol, Point2d& nearpt,
int& segment, bool& inside) const
{
void* it;
float mindist = 1e10f;
Point2d tmpNear;
int tmpseg;
bool tmpIn;
Box2d limits(pt, 2 * tol, 0);
segment = 0;
for (MgShape* sp = _shapes->getFirstShape(it); sp;
sp = _shapes->getNextShape(it))
{
if (limits.isIntersect(sp->shapec()->getExtent())) {
float d = sp->shapec()->hitTest(pt, tol, tmpNear, tmpseg, tmpIn);
if (mindist > d - _MGZERO) {
mindist = d;
nearpt = tmpNear;
segment = sp->getID();
inside = tmpIn;
}
}
}
_shapes->freeIterator(it);
return mindist;
}
示例3: _update
void MgComposite::_update()
{
void* it;
_extent.empty();
for (MgShape* sp = _shapes->getFirstShape(it); sp;
sp = _shapes->getNextShape(it)) {
sp->shape()->update();
_extent.unionWith(sp->shapec()->getExtent());
}
_shapes->freeIterator(it);
}
示例4: _getPoint
Point2d MgComposite::_getPoint(int index) const
{
MgShape* sp = _shapes->getHeadShape();
return sp ? sp->shapec()->getPoint(index) : Point2d();
}
示例5: _getPointCount
int MgComposite::_getPointCount() const
{
MgShape* sp = _shapes->getHeadShape();
return sp ? sp->shapec()->getPointCount() : 0;
}
示例6: _getHandleType
int MgComposite::_getHandleType(int index) const
{
MgShape* sp = _shapes->getHeadShape();
return sp ? sp->shapec()->getHandleType(index) : kMgHandleOutside;
}