阅读:2198回复:1
改变点对象的符号
int _change_layer(GLayer *pLayer,UINT nCommandID)
{ if(pLayer==NULL) return 0; if(pLayer->IsEditable()==false) return 0; if(pLayer->GetLayerType()!=coLayerPoint) return 0; GFPoints pPoints; char szData[1024],szName[256]; GIPoint pInfo,lNewInfo; int iDataSize,iNameSize,id,iCount = pLayer->GetEntityCount(coPnt); iDataSize = sizeof(szData); iNameSize = sizeof(szName); for(id=1;id<=iCount;id++){ memset(szData,0,iDataSize); if(pLayer->GetPoint(id,;pPoints,szData,iDataSize,;pInfo)!=1) continue; iNameSize = sizeof(szName); szName[0] = 0; pLayer->GetEntityName(id,szName,iNameSize,coPnt); if(nCommandID == IDMN_EDIT_CHANGE1){ if(pInfo.m_i32Type==coNot){ lNewInfo.SetType(coCir); lNewInfo.m_i32Color = pInfo.m_i32Color; lNewInfo.m_i16Mode = pInfo.m_i16Mode; lNewInfo.m_i16Theme = pInfo.m_i16Theme; lNewInfo.m_i16Grade = pInfo.m_i16Grade; lNewInfo.m_circle.m_fRadius = pInfo.m_note.m_fFontWidth; pLayer->UpdatePoint(id,;pPoints[0],NULL,0,;lNewInfo); if(strlen(szName)==0){ pLayer->SetEntityName(id,szData,coPnt); } } }else if(nCommandID == IDMN_EDIT_CHANGE2){ if(pInfo.m_i32Type==coCir){ lNewInfo.SetType(coSym); lNewInfo.m_i32Color = pInfo.m_i32Color; lNewInfo.m_i16Mode = pInfo.m_i16Mode; lNewInfo.m_i16Theme = pInfo.m_i16Theme; lNewInfo.m_i16Grade = pInfo.m_i16Grade; lNewInfo.m_symbol.m_i32SymbolNo = 0; lNewInfo.m_symbol.m_fSymbolHeight= pInfo.m_circle.m_fRadius;//高度 lNewInfo.m_symbol.m_fSymbolWidth = pInfo.m_circle.m_fRadius;//宽度 pLayer->UpdatePoint(id,;pPoints[0],NULL,0,;lNewInfo); } }else{ if(pInfo.m_i32Type==coSym){ lNewInfo.SetType(coNot); lNewInfo.m_i32Color = pInfo.m_i32Color; lNewInfo.m_i16Mode = pInfo.m_i16Mode; lNewInfo.m_i16Theme = pInfo.m_i16Theme; lNewInfo.m_i16Grade = pInfo.m_i16Grade; lNewInfo.m_note.m_fFontHeight= pInfo.m_symbol.m_fSymbolHeight;//高度 lNewInfo.m_note.m_fFontWidth = pInfo.m_symbol.m_fSymbolWidth;//宽度 pLayer->UpdatePoint(id,;pPoints[0],szName,strlen(szName),;lNewInfo); } } } return 1; } |
|