本文整理汇总了C++中CModelerView::GetDocument方法的典型用法代码示例。如果您正苦于以下问题:C++ CModelerView::GetDocument方法的具体用法?C++ CModelerView::GetDocument怎么用?C++ CModelerView::GetDocument使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CModelerView
的用法示例。
在下文中一共展示了CModelerView::GetDocument方法的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;
}
示例2: OnChangeCollisionBoxName
void CDlgPgCollision::OnChangeCollisionBoxName()
{
CModelerView *pModelerView = CModelerView::GetActiveView();
if(pModelerView == NULL) return;
CModelerDoc* pDoc = pModelerView->GetDocument();
// document has been changed
pDoc->SetModifiedFlag();
UpdateData( TRUE);
}
示例3: 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);
}
示例4: 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);
}
示例5: 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);
}
示例6: 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);
}
示例7: 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();
}
}
示例8: DrawItem
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);
}
示例9: 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;
}
示例10: OnLButtonDown
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);
}
示例11: 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);
}
示例12: 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();
}
}
}
示例13: DoDataExchange
void CPatchPalette::DoDataExchange(CDataExchange* pDX)
{
CModelerView *pModelerView = CModelerView::GetActiveMappingNormalView();
m_PatchName = "";
m_strPatchFile = "";
m_fStretch = 1.0f;
if( pModelerView != NULL)
{
CModelerDoc* pDoc = (CModelerDoc *) pModelerView->GetDocument();
if( !pDX->m_bSaveAndValidate &&
(pDoc->m_emEditModel.CountPatches() != 0) )
{
GetDlgItem( IDC_EDIT_PATCH_NAME)->EnableWindow( TRUE);
GetDlgItem( IDC_EDIT_PATCH_STRETCH)->EnableWindow( TRUE);
GetDlgItem( IDC_PATCH_FILE_T)->EnableWindow( TRUE);
GetDlgItem( IDC_PATCH_NAME_T)->EnableWindow( TRUE);
GetDlgItem( IDC_PATCH_STRETCH_T)->EnableWindow( TRUE);
CModelPatch &mp = pDoc->m_emEditModel.edm_md.md_mpPatches[ pModelerView->m_iActivePatchBitIndex];
m_strPatchFile = mp.mp_toTexture.GetName().FileName();
m_PatchName = mp.mp_strName;
m_fStretch = mp.mp_fStretch;
}
}
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPatchPalette)
DDX_Control(pDX, IDC_PATCH_BUTTON9, m_PatchButton9);
DDX_Control(pDX, IDC_PATCH_BUTTON8, m_PatchButton8);
DDX_Control(pDX, IDC_PATCH_BUTTON7, m_PatchButton7);
DDX_Control(pDX, IDC_PATCH_BUTTON6, m_PatchButton6);
DDX_Control(pDX, IDC_PATCH_BUTTON5, m_PatchButton5);
DDX_Control(pDX, IDC_PATCH_BUTTON4, m_PatchButton4);
DDX_Control(pDX, IDC_PATCH_BUTTON32, m_PatchButton32);
DDX_Control(pDX, IDC_PATCH_BUTTON31, m_PatchButton31);
DDX_Control(pDX, IDC_PATCH_BUTTON30, m_PatchButton30);
DDX_Control(pDX, IDC_PATCH_BUTTON3, m_PatchButton3);
DDX_Control(pDX, IDC_PATCH_BUTTON29, m_PatchButton29);
DDX_Control(pDX, IDC_PATCH_BUTTON28, m_PatchButton28);
DDX_Control(pDX, IDC_PATCH_BUTTON27, m_PatchButton27);
DDX_Control(pDX, IDC_PATCH_BUTTON26, m_PatchButton26);
DDX_Control(pDX, IDC_PATCH_BUTTON25, m_PatchButton25);
DDX_Control(pDX, IDC_PATCH_BUTTON24, m_PatchButton24);
DDX_Control(pDX, IDC_PATCH_BUTTON23, m_PatchButton23);
DDX_Control(pDX, IDC_PATCH_BUTTON22, m_PatchButton22);
DDX_Control(pDX, IDC_PATCH_BUTTON21, m_PatchButton21);
DDX_Control(pDX, IDC_PATCH_BUTTON20, m_PatchButton20);
DDX_Control(pDX, IDC_PATCH_BUTTON2, m_PatchButton2);
DDX_Control(pDX, IDC_PATCH_BUTTON19, m_PatchButton19);
DDX_Control(pDX, IDC_PATCH_BUTTON18, m_PatchButton18);
DDX_Control(pDX, IDC_PATCH_BUTTON17, m_PatchButton17);
DDX_Control(pDX, IDC_PATCH_BUTTON16, m_PatchButton16);
DDX_Control(pDX, IDC_PATCH_BUTTON15, m_PatchButton15);
DDX_Control(pDX, IDC_PATCH_BUTTON14, m_PatchButton14);
DDX_Control(pDX, IDC_PATCH_BUTTON13, m_PatchButton13);
DDX_Control(pDX, IDC_PATCH_BUTTON12, m_PatchButton12);
DDX_Control(pDX, IDC_PATCH_BUTTON11, m_PatchButton11);
DDX_Control(pDX, IDC_PATCH_BUTTON10, m_PatchButton10);
DDX_Control(pDX, IDC_PATCH_BUTTON1, m_PatchButton1);
DDX_Text(pDX, IDC_EDIT_PATCH_NAME, m_PatchName);
DDX_SkyFloat(pDX, IDC_EDIT_PATCH_STRETCH, m_fStretch);
DDX_Text(pDX, IDC_PATCH_FILE_T, m_strPatchFile);
//}}AFX_DATA_MAP
if( (pDX->m_bSaveAndValidate) && ( pModelerView != NULL) )
{
CModelerDoc* pDoc = (CModelerDoc *) pModelerView->GetDocument();
if( pDoc->m_emEditModel.CountPatches() != 0)
{
CModelPatch &mp = pDoc->m_emEditModel.edm_md.md_mpPatches[ pModelerView->m_iActivePatchBitIndex];
pDoc->m_emEditModel.SetPatchStretch(pModelerView->m_iActivePatchBitIndex, m_fStretch);
mp.mp_strName = CStringA(m_PatchName);
pDoc->m_emEditModel.edm_md.md_bPreparedForRendering = FALSE;
pDoc->SetModifiedFlag();
}
}
}
示例14: DoDataExchange
void CDlgPgCollision::DoDataExchange(CDataExchange* pDX)
{
CModelerView *pModelerView = CModelerView::GetActiveView();
if(pModelerView == NULL) return;
CModelerDoc* pDoc = pModelerView->GetDocument();
// if transfering data from document to dialog
if( !pDX->m_bSaveAndValidate)
{
// get collision min vector
FLOAT3D vMinCollisionBox = pDoc->m_emEditModel.GetCollisionBoxMin();
// get collision max vector
FLOAT3D vMaxCollisionBox = pDoc->m_emEditModel.GetCollisionBoxMax();
FLOATaabbox3D bboxCollision = FLOATaabbox3D( vMinCollisionBox, vMaxCollisionBox);
m_fWidth = bboxCollision.Size()(1);
m_fHeight = bboxCollision.Size()(2);
m_fLenght = bboxCollision.Size()(3);
m_fXCenter = bboxCollision.Center()(1);
m_fYDown = vMinCollisionBox(2);
m_fZCenter = bboxCollision.Center()(3);
// set equality radio initial value
INDEX iEqualityType = pDoc->m_emEditModel.GetCollisionBoxDimensionEquality();
// get index of curently selected collision box
char achrString[ 256];
sprintf( achrString, "%d.", pDoc->m_emEditModel.GetActiveCollisionBoxIndex());
m_strCollisionBoxIndex = achrString;
// get name of curently selected collision box
sprintf( achrString, "%s", pDoc->m_emEditModel.GetCollisionBoxName());
m_strCollisionBoxName = achrString;
// enable all controls
GetDlgItem( IDC_STATIC_WIDTH)->EnableWindow( TRUE);
GetDlgItem( IDC_EDIT_WIDTH)->EnableWindow( TRUE);
GetDlgItem( IDC_STATIC_HEIGHT)->EnableWindow( TRUE);
GetDlgItem( IDC_EDIT_HEIGHT)->EnableWindow( TRUE);
GetDlgItem( IDC_STATIC_LENGHT)->EnableWindow( TRUE);
GetDlgItem( IDC_EDIT_LENGHT)->EnableWindow( TRUE);
m_bCollideAsBox = pDoc->m_emEditModel.edm_md.md_bCollideAsCube;
// if we are colliding using sphere approximation
switch( iEqualityType)
{
case HEIGHT_EQ_WIDTH:
{
m_EqualityRadio = 0;
if( !m_bCollideAsBox)
{
GetDlgItem( IDC_STATIC_HEIGHT)->EnableWindow( FALSE);
GetDlgItem( IDC_EDIT_HEIGHT)->EnableWindow( FALSE);
m_fHeight = m_fWidth;
}
break;
}
case LENGTH_EQ_WIDTH:
{
m_EqualityRadio = 1;
if( !m_bCollideAsBox)
{
GetDlgItem( IDC_STATIC_LENGHT)->EnableWindow( FALSE);
GetDlgItem( IDC_EDIT_LENGHT)->EnableWindow( FALSE);
m_fLenght = m_fWidth;
}
break;
}
case LENGTH_EQ_HEIGHT:
{
m_EqualityRadio = 2;
if( !m_bCollideAsBox)
{
GetDlgItem( IDC_STATIC_LENGHT)->EnableWindow( FALSE);
GetDlgItem( IDC_EDIT_LENGHT)->EnableWindow( FALSE);
m_fLenght = m_fHeight;
}
break;
}
default:
{
ASSERTALWAYS( "None of collision dimensions are the same and that can't be.");
}
}
// mark that the values have been updated to reflect the state of the view
m_udAllValues.MarkUpdated();
}
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgPgCollision)
DDX_SkyFloat(pDX, IDC_EDIT_WIDTH, m_fWidth);
DDX_SkyFloat(pDX, IDC_EDIT_HEIGHT, m_fHeight);
DDX_SkyFloat(pDX, IDC_EDIT_LENGHT, m_fLenght);
DDX_SkyFloat(pDX, IDC_EDIT_XCENTER, m_fXCenter);
DDX_SkyFloat(pDX, IDC_EDIT_YDOWN, m_fYDown);
DDX_SkyFloat(pDX, IDC_EDIT_ZCENTER, m_fZCenter);
DDX_Radio(pDX, IDC_H_EQ_W, m_EqualityRadio);
DDX_Text(pDX, IDC_COLLISION_BOX_NAME, m_strCollisionBoxName);
DDX_Text(pDX, IDC_COLLISION_BOX_INDEX, m_strCollisionBoxIndex);
DDX_Check(pDX, IDC_COLLIDE_AS_BOX, m_bCollideAsBox);
//.........这里部分代码省略.........
示例15: SetPlacementReferenceVertex
void CDlgPgInfoAttachingPlacement::SetPlacementReferenceVertex(INDEX iCenter, INDEX iFront, INDEX iUp)
{
// patch for calling before page is refreshed
if(this == NULL) return;
CModelerView *pModelerView = CModelerView::GetActiveView();
if(pModelerView == NULL) return;
CModelerDoc* pDoc = pModelerView->GetDocument();
CModelData *pMD = &pDoc->m_emEditModel.edm_md;
pMD->md_aampAttachedPosition.Lock();
CAttachedModelPosition & = pMD->md_aampAttachedPosition[ m_iActivePlacement];
// --------- Set axis-defining vertices, but swap if owerlaping
// Center vertex
if( iCenter != -1)
{
if(amp.amp_iFrontVertex == iCenter)
{
amp.amp_iFrontVertex = amp.amp_iCenterVertex;
}
else if(amp.amp_iUpVertex == iCenter)
{
amp.amp_iUpVertex = amp.amp_iCenterVertex;
}
amp.amp_iCenterVertex = iCenter;
}
// Front vertex
if( iFront != -1)
{
if(amp.amp_iCenterVertex == iFront)
{
amp.amp_iCenterVertex = amp.amp_iFrontVertex;
}
else if(amp.amp_iUpVertex == iFront)
{
amp.amp_iUpVertex = amp.amp_iFrontVertex;
}
amp.amp_iFrontVertex = iFront;
}
// Up vertex
if( iUp != -1)
{
if(amp.amp_iCenterVertex == iUp)
{
amp.amp_iCenterVertex = amp.amp_iUpVertex;
}
else if(amp.amp_iFrontVertex == iUp)
{
amp.amp_iFrontVertex = amp.amp_iUpVertex;
}
amp.amp_iUpVertex = iUp;
}
pMD->md_aampAttachedPosition.Unlock();
theApp.m_chGlobal.MarkChanged();
pDoc->ClearAttachments();
pDoc->SetupAttachments();
pDoc->SetModifiedFlag();
pDoc->UpdateAllViews( NULL);
}