本文整理汇总了C++中Selection::GetPolys方法的典型用法代码示例。如果您正苦于以下问题:C++ Selection::GetPolys方法的具体用法?C++ Selection::GetPolys怎么用?C++ Selection::GetPolys使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Selection
的用法示例。
在下文中一共展示了Selection::GetPolys方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnModifyUVMap
void MagicView::OnModifyUVMap()
{
Selection* seln = GetDocument()->GetSelection();
view_mode = VIEW_UV_MAP;
SetupModelViews();
if (seln && uvmap_view) {
auto p = seln->GetPolys().begin();
if (p) {
uvmap_view->UseMaterial(p->material);
uvmap_view->UsePolys(seln->GetPolys());
}
}
}
示例2: OnTextureMap
void MagicView::OnTextureMap()
{
TextureMapDialog dlg(this);
if (dlg.DoModal() == IDOK) {
MagicDoc* doc = GetDocument();
Solid* solid = doc->GetSolid();
Selection* seln = doc->GetSelection();
Selector* selector = doc->GetSelector();
Editor* editor = doc->GetEditor();
Material* mtl = 0;
if (dlg.mMaterialIndex >= 0) {
mtl = &solid->GetModel()->GetMaterials()[dlg.mMaterialIndex];
}
editor->UseModel(solid->GetModel());
editor->ApplyMaterial(mtl, seln->GetPolys(),
dlg.mMapType, 2-dlg.mAxis, (float) dlg.mScaleU, (float) dlg.mScaleV,
dlg.mFlip, dlg.mMirror, dlg.mRotate);
selector->Reselect();
Invalidate();
doc->SetModifiedFlag(TRUE);
doc->UpdateAllViews(this);
}
}
示例3: OnUpdateTextureMap
void MagicView::OnUpdateTextureMap(CCmdUI* pCmdUI)
{
Solid* solid = GetDocument()->GetSolid();
Selection* seln = GetDocument()->GetSelection();
pCmdUI->Enable(solid && solid->GetModel() && seln && seln->GetPolys().size() > 0);
}
示例4: OnMouseMove
void MagicView::OnMouseMove(UINT nFlags, CPoint point)
{
if (drag_right) {
CPoint offset = point - drag_start;
if (view_focus == VIEW_PERSPECTIVE) {
ModelView* view = GetModelViewByIndex(view_focus);
view->SpinBy(offset.x * 0.5 * DEGREES,
offset.y * 0.5 * DEGREES);
}
else if (IsUVEdit()) {
uvmap_view->MoveBy(offset.x, offset.y);
}
else {
ModelView* view = GetModelViewByIndex(view_focus);
view->MoveBy(offset.x, offset.y);
}
drag_start = point;
Invalidate();
}
else if (drag_left) {
CPoint offset = point - drag_start;
MagicDoc* pDoc = GetDocument();
Selector* selector = pDoc->GetSelector();
if (IsUVEdit()) {
if (uvmap_view->IsActive()) {
uvmap_view->AddMark(point);
}
else {
uvmap_view->DragBy(offset.x, offset.y);
drag_start = point;
}
}
else if (selector && selector->IsActive()) {
selector->AddMark(point);
}
}
// xy status message:
if (view_focus != VIEW_PERSPECTIVE) {
char xy[80];
CPoint mouse = LPtoWP(point);
Selection* seln = GetDocument()->GetSelection();
int nv = seln ? seln->GetVerts().size() : 0;
int np = seln ? seln->GetPolys().size() : 0;
if (np || nv)
sprintf_s(xy, "(%05d,%05d) Verts:%d Polys:%d", mouse.x, mouse.y, nv, np);
else
sprintf_s(xy, "(%05d,%05d)", mouse.x, mouse.y);
MainFrame::StatusXY(xy);
}
CView::OnMouseMove(nFlags, point);
}