本文整理汇总了C++中CXmlNode::GetFloatAttrib方法的典型用法代码示例。如果您正苦于以下问题:C++ CXmlNode::GetFloatAttrib方法的具体用法?C++ CXmlNode::GetFloatAttrib怎么用?C++ CXmlNode::GetFloatAttrib使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CXmlNode
的用法示例。
在下文中一共展示了CXmlNode::GetFloatAttrib方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Load
BOOL CXMLVecLS::Load(LPCTSTR pcszFileName,stVecParam ¶m,CElems &elems)
{
CXmlDoc file;
if (!file.Load(pcszFileName))
return FALSE;
CElem *pElem;
CXmlNode n;
CXmlNode node = file.Root;
param.strBkgndImage = node.GetStringAttrib(_T("BkgndImage"));
param.clrBk = node.GetUIntAttrib(_T("BkColor"));
param.dwCustomData = node.GetBigUIntAttrib(_T("CustomData"));
param.strDesc = node.GetStringAttrib(_T("Desc"));
param.scale.cx = node.GetFloatAttrib(_T("XScale"));
param.scale.cy = node.GetFloatAttrib(_T("YScale"));
BOOL err = FALSE;
for (int i=0,cnt=node.ChildCount; i<cnt && !err; ++i)
{
n = node.Child[i];
pElem = LoadElem(n);
if (pElem != NULL)
elems.Add(pElem);
else
err = TRUE;
}
if (!err)
return TRUE;
for (int i=0; i<elems.GetCount(); ++i)
delete elems[i];
elems.RemoveAll();
return FALSE;
}
示例2: LoadElem
CElem* CXMLVecLS::LoadElem(CXmlNode &node)
{
CString str;
int nType = GetType(node.GetName());
CPointF pt;
CRectF rc;
CElem *elem = NULL;
switch (nType)
{
case CElem::Line:
{
CLine *pElem = new CLine();
TEST_FREE_RETURNNULL(!LoadNonFillVecElem(pElem,node),pElem);
pt.x = node.GetFloatAttrib(_T("StartPointX"));
pt.y = node.GetFloatAttrib(_T("StartPointY"));
pElem->SetStartPoint(pt);
pt.x = node.GetFloatAttrib(_T("EndPointX"));
pt.y = node.GetFloatAttrib(_T("EndPointY"));
pElem->SetEndPoint(pt);
elem = pElem;
}
break;
case CElem::Bezier:
{
CBezier *pElem = new CBezier();
TEST_FREE_RETURNNULL(!LoadNonFillVecElem(pElem,node),pElem);
CXmlNode n;
CPointF pt;
CFPoints pts;
for (int i=0,cnt=node.ChildCount; i<cnt; ++i)
{
n = node.Child[i];
if (n.GetName() == _T("Point"))
{
pt.x = n.GetFloatAttrib(_T("X"));
pt.y = n.GetFloatAttrib(_T("Y"));
pts.Add(pt);
}
}
pElem->SetPoints(pts);
elem = pElem;
}
break;
case CElem::FreeLine:
{
CFreeLine *pElem = new CFreeLine();
TEST_FREE_RETURNNULL(!LoadNonFillVecElem(pElem,node),pElem);
CXmlNode n;
CPointF pt;
CFPoints pts;
for (int i=0,cnt=node.ChildCount; i<cnt; ++i)
{
n = node.Child[i];
if (n.GetName() == _T("Point"))
{
pt.x = n.GetFloatAttrib(_T("X"));
pt.y = n.GetFloatAttrib(_T("Y"));
pts.Add(pt);
}
}
pElem->SetPoints(pts);
elem = pElem;
}
break;
case CElem::Arc:
{
CArc *pElem = new CArc();
TEST_FREE_RETURNNULL(!LoadNonFillVecElem(pElem,node),pElem);
rc.left = node.GetFloatAttrib(_T("RectLeft"));
rc.top = node.GetFloatAttrib(_T("RectTop"));
rc.right = node.GetFloatAttrib(_T("RectRight"));
rc.bottom = node.GetFloatAttrib(_T("RectBottom"));
pElem->SetBoundsRect(rc);
pElem->SetStartAngel(node.GetFloatAttrib(_T("StartAngel")));
pElem->SetEndAngel(node.GetFloatAttrib(_T("EndAngel")));
elem = pElem;
}
break;
case CElem::Chord:
{
CChord *pElem = new CChord();
TEST_FREE_RETURNNULL(!LoadFilledVecElem(pElem,node),pElem);
rc.left = node.GetFloatAttrib(_T("RectLeft"));
rc.top = node.GetFloatAttrib(_T("RectTop"));
rc.right = node.GetFloatAttrib(_T("RectRight"));
//.........这里部分代码省略.........