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


C++ CModelerView类代码示例

本文整理汇总了C++中CModelerView的典型用法代码示例。如果您正苦于以下问题:C++ CModelerView类的具体用法?C++ CModelerView怎么用?C++ CModelerView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CModelerView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: BrowseAttachement

BOOL CDlgPgInfoAttachingPlacement::BrowseAttachement( CAttachedModel *pam)
{
  CModelerView *pModelerView = CModelerView::GetActiveView();
  if(pModelerView == NULL) return FALSE;
  CModelerDoc* pDoc = pModelerView->GetDocument();

  CTFileName fnOldModel = pam->am_moAttachedModel.GetName();
  CTFileName fnModel = _EngineGUI.FileRequester( "Select model to attach",
				  FILTER_MDL FILTER_END, "Attaching models directory",
				  _fnmApplicationPath + fnOldModel.FileDir(),
				  fnOldModel.FileName()+fnOldModel.FileExt());
  if( fnModel == "") return FALSE;

  try
  {
    pam->SetModel_t( fnModel);
  }
  catch( char *strError)
  {
    (void) strError;
    return FALSE;
  }
  pam->am_bVisible = TRUE;

  pDoc->ClearAttachments();
  pDoc->SetupAttachments();

  pDoc->SetModifiedFlag();
  pDoc->UpdateAllViews( NULL);

  UpdateData(FALSE);
  return TRUE;
}
开发者ID:ArcticPheenix,项目名称:Serious-Engine,代码行数:33,代码来源:DlgPgInfoAttachingPlacement.cpp

示例2: GetDocument

void CScriptView::OnScriptUpdateMipmodels() 
{
	// find document with same name
  CModelerDoc *pDoc = (CModelerDoc *) GetDocument();
  CTFileName fnScriptName = CTString(pDoc->GetPathName());
  CTFileName fnModelName = fnScriptName.FileDir() + fnScriptName.FileName() + ".mdl";

	POSITION pos = theApp.m_pdtModelDocTemplate->GetFirstDocPosition();
  while (pos!=NULL)
  {
    CModelerDoc *pmdCurrent = (CModelerDoc *)theApp.m_pdtModelDocTemplate->GetNextDoc(pos);
    if( CTFileName( CTString(pmdCurrent->GetPathName())) == fnModelName)
    {
      POSITION pos = pmdCurrent->GetFirstViewPosition();
      CView *pView = pmdCurrent->GetNextView( pos);
      if( DYNAMIC_DOWNCAST(CModelerView, pView) != NULL)
      {
        CModelerView* pModelerView = (CModelerView *) pView;
        if(pModelerView != NULL)
        {
          pModelerView->OnScriptUpdateMipmodels();
          pModelerView->SetActiveWindow();
          pModelerView->SetFocus();
          CMainFrame* pMainFrame = STATIC_DOWNCAST(CMainFrame, AfxGetMainWnd());
          pMainFrame->MDIActivate(pModelerView->GetParentFrame());
        }
      }
      break;
    }
  }
}
开发者ID:RocketersAlex,项目名称:LCSource,代码行数:31,代码来源:ScriptView.cpp

示例3: GetFirstViewPosition

void CModelerDoc::OnIdle(void)
{
  POSITION pos = GetFirstViewPosition();

  while ( pos !=NULL) {
    CModelerView *pmvCurrent = (CModelerView *) GetNextView(pos);
    pmvCurrent->OnIdle();
  }
}
开发者ID:RocketersAlex,项目名称:LCSource,代码行数:9,代码来源:ModelerDoc.cpp

示例4: OnChangeCollisionBoxName

void CDlgPgCollision::OnChangeCollisionBoxName() 
{
  CModelerView *pModelerView = CModelerView::GetActiveView();
  if(pModelerView == NULL) return;
  CModelerDoc* pDoc = pModelerView->GetDocument();  
  // document has been changed
  pDoc->SetModifiedFlag();
	UpdateData( TRUE);
}
开发者ID:RocketersAlex,项目名称:LCSource,代码行数:9,代码来源:DlgPgCollision.cpp

示例5: OnPreviousCollisionBox

void CDlgPgCollision::OnPreviousCollisionBox() 
{
  CModelerView *pModelerView = CModelerView::GetActiveView();
  if(pModelerView == NULL) return;
  CModelerDoc* pDoc = pModelerView->GetDocument();  
  pDoc->m_emEditModel.ActivatePreviousCollisionBox();
  UpdateData(FALSE);
  // update all views
  pDoc->UpdateAllViews( NULL);
}
开发者ID:RocketersAlex,项目名称:LCSource,代码行数:10,代码来源:DlgPgCollision.cpp

示例6: OnCollideAsBox

void CDlgPgCollision::OnCollideAsBox() 
{
  CModelerView *pModelerView = CModelerView::GetActiveView();
  if(pModelerView == NULL) return;
  CModelerDoc* pDoc = pModelerView->GetDocument();
  pDoc->m_emEditModel.edm_md.md_bCollideAsCube = !pDoc->m_emEditModel.edm_md.md_bCollideAsCube;
  UpdateData(TRUE);
  UpdateData(FALSE);
  pDoc->SetModifiedFlag();
  pDoc->UpdateAllViews( NULL);
}
开发者ID:RocketersAlex,项目名称:LCSource,代码行数:11,代码来源:DlgPgCollision.cpp

示例7: OnAllignToSize

void CDlgPgCollision::OnAllignToSize() 
{
  CModelerView *pModelerView = CModelerView::GetActiveView();
  if(pModelerView == NULL) return;
  CModelerDoc* pDoc = pModelerView->GetDocument();
  FLOATaabbox3D MaxBB;
  pDoc->m_emEditModel.edm_md.GetAllFramesBBox( MaxBB);
  pDoc->m_emEditModel.SetCollisionBox( MaxBB.Min(), MaxBB.Max());
  UpdateData(FALSE);
  pDoc->SetModifiedFlag();
  pDoc->UpdateAllViews( NULL);
}
开发者ID:RocketersAlex,项目名称:LCSource,代码行数:12,代码来源:DlgPgCollision.cpp

示例8: OnRemoveCollisionBox

void CDlgPgCollision::OnRemoveCollisionBox() 
{
  CModelerView *pModelerView = CModelerView::GetActiveView();
  if(pModelerView == NULL) return;
  CModelerDoc* pDoc = pModelerView->GetDocument();  
  pDoc->m_emEditModel.DeleteCurrentCollisionBox();
  UpdateData(FALSE);

  // document has been changed
  pDoc->SetModifiedFlag();
  // update all views
  pDoc->UpdateAllViews( NULL);
}
开发者ID:RocketersAlex,项目名称:LCSource,代码行数:13,代码来源:DlgPgCollision.cpp

示例9: OnBrowseModel

void CDlgPgInfoAttachingPlacement::OnBrowseModel()
{
  CModelerView *pModelerView = CModelerView::GetActiveView();
  if(pModelerView == NULL) return;
  CModelerDoc* pDoc = pModelerView->GetDocument();
  CModelData *pMD = &pDoc->m_emEditModel.edm_md;

  if( m_iActivePlacement != -1)
  {
    pDoc->m_emEditModel.edm_aamAttachedModels.Lock();
    BrowseAttachement( &pDoc->m_emEditModel.edm_aamAttachedModels[ m_iActivePlacement]);
    pDoc->m_emEditModel.edm_aamAttachedModels.Unlock();
  }
}
开发者ID:ArcticPheenix,项目名称:Serious-Engine,代码行数:14,代码来源:DlgPgInfoAttachingPlacement.cpp

示例10: GetDC

void CPatchPaletteButton::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) 
{
  CDC *pDC = GetDC();
  CMainFrame* pMainFrame = STATIC_DOWNCAST(CMainFrame, AfxGetMainWnd());
  
  CModelerView *pModelerView = CModelerView::GetActiveMappingNormalView();
  if( pModelerView == NULL)
  {
    pDC->FillSolidRect( &lpDrawItemStruct->rcItem, 0x00aaaaaa);
    pDC->DrawEdge( &lpDrawItemStruct->rcItem, EDGE_RAISED, BF_RECT);
  }
  else
  {
    INDEX iButtonNo = lpDrawItemStruct->CtlID - IDC_PATCH_BUTTON_BASE;
    ULONG ulCurrentMask = pModelerView->m_ModelObject.GetPatchesMask();
    CModelerDoc* pDoc = pModelerView->GetDocument();
    ULONG ulExistingMask = pDoc->m_emEditModel.GetExistingPatchesMask();
    pDC->FillSolidRect( &lpDrawItemStruct->rcItem, 0x00aaaaaa);
    // If this patch doesn't exist
    if( (ulExistingMask & (1UL << iButtonNo)) == 0)
    {
      pDC->DrawEdge( &lpDrawItemStruct->rcItem, EDGE_RAISED, BF_RECT);
    }
    // If this patch exists but it is not turned on
    else if( (ulCurrentMask & (1UL << iButtonNo)) == 0)
    {
      // If this is active patch
      if( iButtonNo == pModelerView->m_iActivePatchBitIndex)
        pDC->DrawIcon( 2, 2, pMainFrame->m_dlgPatchesPalette->m_PatchActiveIcon);
      else
        pDC->DrawIcon( 2, 2, pMainFrame->m_dlgPatchesPalette->m_PatchExistIcon);
      pDC->DrawEdge( &lpDrawItemStruct->rcItem, EDGE_RAISED, BF_RECT);
    }
    // If this patch is turned on and it is active patch
    else if( iButtonNo == pModelerView->m_iActivePatchBitIndex)
    {
      pDC->DrawIcon( 2, 2, pMainFrame->m_dlgPatchesPalette->m_PatchActiveIcon);
      pDC->DrawEdge( &lpDrawItemStruct->rcItem, EDGE_SUNKEN, BF_RECT);
    }
    // If this patch is turned on and it is not active patch
    else
    {
      pDC->DrawIcon( 2 ,2, pMainFrame->m_dlgPatchesPalette->m_PatchInactiveIcon);
      pDC->DrawEdge( &lpDrawItemStruct->rcItem, EDGE_SUNKEN, BF_RECT);
    }
  }
  ReleaseDC( pDC);
}          
开发者ID:RocketersAlex,项目名称:LCSource,代码行数:48,代码来源:PatchPaletteButton.cpp

示例11: OnAddAttachingPlacement

void CDlgPgInfoAttachingPlacement::OnAddAttachingPlacement()
{
  CModelerView *pModelerView = CModelerView::GetActiveView();
  if(pModelerView == NULL) return;
  CModelerDoc* pDoc = pModelerView->GetDocument();
  CModelData *pMD = &pDoc->m_emEditModel.edm_md;
  CAttachedModelPosition *ampModelPosition = pMD->md_aampAttachedPosition.New();
  CAttachedModel *pAttachedModel = pDoc->m_emEditModel.edm_aamAttachedModels.New();
  if( !BrowseAttachement( pAttachedModel))
  {
    pMD->md_aampAttachedPosition.Delete( ampModelPosition);
    pDoc->m_emEditModel.edm_aamAttachedModels.Delete( pAttachedModel);
    return;
  }
  m_iActivePlacement = pMD->md_aampAttachedPosition.Count()-1;
}
开发者ID:ArcticPheenix,项目名称:Serious-Engine,代码行数:16,代码来源:DlgPgInfoAttachingPlacement.cpp

示例12: GetDlgCtrlID

void CPatchPaletteButton::OnLButtonDown(UINT nFlags, CPoint point) 
{
	INDEX iButtonNo = GetDlgCtrlID()-IDC_PATCH_BUTTON_BASE;
  CModelerView *pModelerView = CModelerView::GetActiveMappingNormalView();
  if( pModelerView != NULL)
  {
    ULONG ulCurrentMask = pModelerView->m_ModelObject.GetPatchesMask();
    CModelerDoc* pDoc = pModelerView->GetDocument();
    ULONG ulExistingMask = pDoc->m_emEditModel.GetExistingPatchesMask();
    if( (ulExistingMask & (1UL << iButtonNo)) != 0)
    {
      pModelerView->m_iActivePatchBitIndex = iButtonNo;
      CMainFrame* pMainFrame = STATIC_DOWNCAST(CMainFrame, AfxGetMainWnd());
      pMainFrame->m_dlgPatchesPalette->UpdateData( FALSE);
      pMainFrame->m_dlgPatchesPalette->Invalidate( FALSE);
    }
  }

	CButton::OnLButtonDown(nFlags, point);
}
开发者ID:RocketersAlex,项目名称:LCSource,代码行数:20,代码来源:PatchPaletteButton.cpp

示例13: OnFileAddTexture

void CModelerDoc::OnFileAddTexture() 
{
  CModelerView *pModelerView = CModelerView::GetActiveView();
  if( pModelerView == NULL)
    return;

  // call file requester for adding textures
  CDynamicArray<CTFileName> afnTextures;
  CTFileName fnDocName = CTString(GetPathName());
  theApp.WriteProfileString( "Scape", "Add texture directory", fnDocName.FileDir());
  _EngineGUI.FileRequester( "Choose textures to add", FILTER_TEX FILTER_END,
    "Add texture directory", "Textures\\", fnDocName.FileName()+".tex", &afnTextures);
  MEX mexWidth, mexHeight;
  m_emEditModel.edm_md.GetTextureDimensions( mexWidth, mexHeight);
  // add selected textures
  FOREACHINDYNAMICARRAY( afnTextures, CTFileName, itTexture)
  {
    CTextureDataInfo *pNewTDI;
    // add texture
    CTFileName fnTexName = itTexture.Current();
    try
    {
      pNewTDI =m_emEditModel.AddTexture_t( fnTexName, mexWidth, mexHeight);
    }
    catch( char *err_str)
    {
      pNewTDI = NULL;
      AfxMessageBox( err_str);
    }
    if( pNewTDI != NULL)
    {
      SetModifiedFlag();
      pModelerView->m_ptdiTextureDataInfo = pNewTDI;
      // switch to texture mode
      pModelerView->OnRendUseTexture();
      UpdateAllViews( NULL);
    }
  }
开发者ID:RocketersAlex,项目名称:LCSource,代码行数:38,代码来源:ModelerDoc.cpp

示例14: ToggleMipFlag

void CDlgInfoPgMip::ToggleMipFlag( ULONG ulFlag)
{
  CModelerView *pModelerView = CModelerView::GetActiveMappingNormalView();
  ASSERT(pModelerView != NULL);
  CModelerDoc *pDoc = pModelerView->GetDocument();
  ASSERT(pDoc != NULL);

  ModelMipInfo *pMMIFirst = &pDoc->m_emEditModel.edm_md.md_MipInfos[ pDoc->m_iCurrentMip];
  BOOL bSetting = (pMMIFirst->mmpi_ulFlags & ulFlag) == 0;
  // if setting, set just for this mip model
  if( bSetting)
  {
    pMMIFirst->mmpi_ulFlags |= ulFlag;
  }
  // if clearing, clear for all further mip models
  else
  {
    for( INDEX iMip=pDoc->m_iCurrentMip; iMip<pDoc->m_emEditModel.edm_md.md_MipCt; iMip++)
    {
      // get requested mip model
      ModelMipInfo *pMMI = &pDoc->m_emEditModel.edm_md.md_MipInfos[ iMip];
      // if setting, set just for this mip model
      pMMI->mmpi_ulFlags &= ~ulFlag;
    }
  }
  
  // for patcehs
  if( ulFlag == MM_PATCHES_VISIBLE)
  {
    // reaclculate patch-polygon connections
    pDoc->m_emEditModel.CalculatePatchesPerPolygon();
  }
  
  pDoc->UpdateAllViews(NULL);
  UpdateData( FALSE);
}
开发者ID:RocketersAlex,项目名称:LCSource,代码行数:36,代码来源:DlgInfoPgMip.cpp

示例15: OnFileCreateTexture

void CMainFrame::OnFileCreateTexture() 
{
  CModelerView *pView = (CModelerView *) CModelerView::GetActiveView();
  CModelerDoc *pDoc = NULL;
  if( pView != NULL)
  {
    pDoc = pView->GetDocument();
    // setup create texture directory
    theApp.WriteProfileString("Scape", KEY_NAME_CREATE_TEXTURE_DIR, 
      _fnmApplicationPath+pDoc->GetModelDirectory());
  }
  // call create texture dialog
  CTFileName fnCreated = _EngineGUI.CreateTexture();
  if( (fnCreated != "") && pDoc != NULL)
  {
    CTextureDataInfo *pNewTDI;
    try
    {
      pNewTDI = pDoc->m_emEditModel.AddTexture_t( fnCreated, 
                pDoc->m_emEditModel.GetWidth(),
                pDoc->m_emEditModel.GetHeight() );
    }
    catch( char *err_str)
    {
      AfxMessageBox( err_str);
      pNewTDI = NULL;
    }
    if( pNewTDI != NULL)
    {
      pDoc->SetModifiedFlag();
      pView->m_ptdiTextureDataInfo = pNewTDI;
      // switch to texture mode
      pView->OnRendUseTexture();
    }
  }
}
开发者ID:RocketersAlex,项目名称:LCSource,代码行数:36,代码来源:MainFrm.cpp


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