本文整理汇总了C++中BaseObject::InsertUnder方法的典型用法代码示例。如果您正苦于以下问题:C++ BaseObject::InsertUnder方法的具体用法?C++ BaseObject::InsertUnder怎么用?C++ BaseObject::InsertUnder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseObject
的用法示例。
在下文中一共展示了BaseObject::InsertUnder方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MouseInput
Bool LiquidToolData::MouseInput(BaseDocument* doc, BaseContainer& data, BaseDraw* bd, EditorWindow* win, const BaseContainer& msg)
{
Float mx = msg.GetFloat(BFM_INPUT_X);
Float my = msg.GetFloat(BFM_INPUT_Y);
Int32 button;
switch (msg.GetInt32(BFM_INPUT_CHANNEL))
{
case BFM_INPUT_MOUSELEFT: button = KEY_MLEFT; break;
case BFM_INPUT_MOUSERIGHT: button = KEY_MRIGHT; break;
default: return true;
}
BaseObject* cl = nullptr, *null = nullptr, *op = nullptr;
Float dx, dy, rad = 5.0;
Bool newmeta = false;
op = BaseObject::Alloc(Osphere);
if (!op)
return false;
null = BaseObject::Alloc(Ometaball);
{
null->GetDataInstance()->SetFloat(METABALLOBJECT_SUBEDITOR, 10.0);
null->MakeTag(Tphong);
}
newmeta = true;
if (newmeta)
{
doc->InsertObject(null, nullptr, nullptr);
doc->SetActiveObject(null);
doc->AddUndo(UNDOTYPE_NEW, null);
DrawViews(DRAWFLAGS_ONLY_ACTIVE_VIEW | DRAWFLAGS_NO_THREAD | DRAWFLAGS_NO_ANIMATION);
}
BaseContainer bc;
BaseContainer device;
win->MouseDragStart(button, mx, my, MOUSEDRAGFLAGS_DONTHIDEMOUSE | MOUSEDRAGFLAGS_NOMOVE);
while (win->MouseDrag(&dx, &dy, &device) == MOUSEDRAGRESULT_CONTINUE)
{
bc = BaseContainer();
win->BfGetInputEvent(BFM_INPUT_MOUSE, &bc);
if (bc.GetInt32(BFM_INPUT_CHANNEL) == BFM_INPUT_MOUSEWHEEL)
{
rad += bc.GetFloat(BFM_INPUT_VALUE) / 120.0;
rad = ClampValue(rad, (Float) 0.1, (Float) MAXRANGE);
GePrint(String::FloatToString(rad));
}
if (dx == 0.0 && dy == 0.0)
continue;
mx += dx;
my += dy;
cl = (BaseObject*)op->GetClone(COPYFLAGS_0, nullptr);
if (!cl)
break;
cl->GetDataInstance()->SetFloat(PRIM_SPHERE_RAD, rad);
cl->SetAbsPos(bd->SW(Vector(mx, my, 500.0)));
cl->InsertUnder(null);
DrawViews(DRAWFLAGS_ONLY_ACTIVE_VIEW | DRAWFLAGS_NO_THREAD | DRAWFLAGS_NO_ANIMATION);
}
if (win->MouseDragEnd() == MOUSEDRAGRESULT_ESCAPE)
{
doc->DoUndo(true);
}
BaseObject::Free(op);
EventAdd();
return true;
}