本文整理汇总了C++中MgShape::shape方法的典型用法代码示例。如果您正苦于以下问题:C++ MgShape::shape方法的具体用法?C++ MgShape::shape怎么用?C++ MgShape::shape使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MgShape
的用法示例。
在下文中一共展示了MgShape::shape方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: eraseWnd
void MgCmdManagerImpl::eraseWnd(const MgMotion* sender)
{
Box2d snap(sender->view->xform()->getWndRectM());
std::vector<int> delIds;
void *it = NULL;
MgShapes* s = sender->view->shapes();
for (MgShape* shape = s->getFirstShape(it); shape; shape = s->getNextShape(it)) {
if (shape->shape()->hitTestBox(snap)) {
delIds.push_back(shape->getID());
}
}
s->freeIterator(it);
if (!delIds.empty()
&& sender->view->shapeWillDeleted(s->findShape(delIds.front()))) {
MgShapesLock locker(MgShapesLock::Remove, sender->view);
for (std::vector<int>::iterator i = delIds.begin(); i != delIds.end(); ++i) {
MgShape* shape = s->findShape(*i);
if (shape && sender->view->removeShape(shape)) {
shape->release();
}
}
sender->view->regenAll();
}
}
示例2: touchMoved
bool MgCmdErase::touchMoved(const MgMotion* sender)
{
Box2d snap(sender->startPointM, sender->pointM);
void *it = NULL;
MgShape* shape = m_boxsel ? sender->view->shapes()->getFirstShape(it) : NULL;
m_delIds.clear();
for (; shape; shape = sender->view->shapes()->getNextShape(it)) {
if (isIntersectMode(sender) ? shape->shape()->hitTestBox(snap)
: snap.contains(shape->shape()->getExtent())) {
m_delIds.push_back(shape->getID());
}
}
sender->view->shapes()->freeIterator(it);
sender->view->redraw(false);
return true;
}
示例3: _transform
void MgComposite::_transform(const Matrix2d& mat)
{
void* it;
for (MgShape* sp = _shapes->getFirstShape(it); sp;
sp = _shapes->getNextShape(it)) {
sp->shape()->transform(mat);
}
_shapes->freeIterator(it);
}
示例4: _offset
bool MgGroup::_offset(const Vector2d& vec, int segment)
{
MgShape* sp = _shapes->findShape(segment);
if (sp && canOffsetShapeAlone(sp)) {
return sp->shape()->offset(vec, -1);
}
return __super::_offset(vec, segment);
}
示例5: _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);
}
示例6: _offset
bool MgComposite::_offset(const Vector2d& vec, int)
{
void* it;
int n = 0;
for (MgShape* sp = _shapes->getFirstShape(it); sp;
sp = _shapes->getNextShape(it)) {
n += sp->shape()->offset(vec, -1) ? 1 : 0;
}
_shapes->freeIterator(it);
return n > 0;
}