当前位置: 首页>>代码示例>>C++>>正文


C++ Selection::GetPolys方法代码示例

本文整理汇总了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());
      }
   }
}
开发者ID:The-E,项目名称:Starshatter-Experimental,代码行数:16,代码来源:MagicView.cpp

示例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);
   }
}
开发者ID:The-E,项目名称:Starshatter-Experimental,代码行数:27,代码来源:MagicView.cpp

示例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);
}
开发者ID:The-E,项目名称:Starshatter-Experimental,代码行数:7,代码来源:MagicView.cpp

示例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);
}
开发者ID:The-E,项目名称:Starshatter-Experimental,代码行数:62,代码来源:MagicView.cpp


注:本文中的Selection::GetPolys方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。