本文整理汇总了C#中G25.IsConstant方法的典型用法代码示例。如果您正苦于以下问题:C# G25.IsConstant方法的具体用法?C# G25.IsConstant怎么用?C# G25.IsConstant使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类G25
的用法示例。
在下文中一共展示了G25.IsConstant方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SMVtoXmlString
/// <summary>
/// Converts a G25.SMV to an XML string representation.
/// </summary>
/// <param name="S"></param>
/// <param name="smv"></param>
/// <returns>XML string representation of 'smv'.</returns>
public static string SMVtoXmlString(Specification S, G25.SMV smv)
{
StringBuilder SB = new StringBuilder();
bool constant = smv.IsConstant() && (S.GetMatchingConstant(smv) != null);
string name = smv.Name;
// remove the extra constant suffix?
if (constant && name.EndsWith(Specification.CONSTANT_TYPE_SUFFIX))
name = name.Substring(0, name.Length - Specification.CONSTANT_TYPE_SUFFIX.Length);
SB.Append("<" + XML_SMV);
// name
SB.Append(" " + XML_NAME + "=\"" + name + "\"");
// constant?
if (constant)
SB.Append(" " + XML_CONST + "=\"" + XML_TRUE + "\"");
// type
SB.Append(" " + XML_TYPE + "=\"" + smv.MvTypeString + "\"");
// end of XML_SMV tag
SB.Append(">");
{ // emit coordinate order:
string[] bvNames = (string[])S.m_basisVectorNames.ToArray();
// loop over all basis blades
for (int b = 0; b < smv.Group(0).Length; b++)
{
if (b > 0) SB.Append(" ");
string bbStr = BasisBladeToString(smv.BasisBlade(0, b), bvNames);
SB.Append(bbStr);
// if constant, add '=....'
if (smv.IsCoordinateConstant(b))
SB.Append("=" + smv.ConstBasisBladeValue(smv.BladeIdxToConstBladeIdx(b)).ToString());
}
if (smv.Comment.Length > 0)
SB.Append(" <" + XML_COMMENT + ">" + smv.Comment + "</" + XML_COMMENT + ">");
}
SB.Append("</" + XML_SMV + ">\n");
return SB.ToString();
}