本文整理汇总了C#中Vector2d.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Vector2d.ToString方法的具体用法?C# Vector2d.ToString怎么用?C# Vector2d.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vector2d
的用法示例。
在下文中一共展示了Vector2d.ToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetOpenGLPNameInfo
public List<KeyValuePair<string, string>> GetOpenGLPNameInfo()
{
List<KeyValuePair<string, string>> info =
new List<KeyValuePair<string, string>>();
foreach (GetPName pname in Enum.GetValues(typeof(GetPName)))
{
double[] buff = new double[32];
GL.GetDouble(pname, buff);
int last = 0;
for (int i = 0; i < 32; i++)
{
if (buff[i] != 0.0)
{
last = i + 1;
}
}
string str = null;
switch (last)
{
case 0:
str = "0";
break;
case 1:
str = buff[0].ToString();
break;
case 2:
Vector2d v2 = new Vector2d(buff[0], buff[1]);
str = v2.ToString();
break;
case 3:
Vector3d v3 = new Vector3d(buff[0], buff[1], buff[2]);
str = v3.ToString();
break;
case 4:
Vector4d v4 = new Vector4d(buff[0], buff[1], buff[2], buff[3]);
str = v4.ToString();
break;
case 16:
Matrix4d m4 = new Matrix4d(buff[0], buff[1], buff[2], buff[3],
buff[4], buff[5], buff[6], buff[7],
buff[8], buff[9], buff[10], buff[11],
buff[12], buff[13], buff[14], buff[15]);
str = m4.ToString();
break;
default:
StringBuilder sb = new StringBuilder();
for (int i = 0; i < last; i++)
{
sb.Append(buff[i]);
sb.Append(',');
}
str = sb.ToString();
break;
}
info.Add(new KeyValuePair<string, string>(pname.ToString(), str));
}
return info;
}
示例2: WriteVector2d
public override void WriteVector2d(Vector2d value)
{
Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
ed.WriteMessage(MethodInfo.GetCurrentMethod().Name + " = ");
ed.WriteMessage(value.ToString()+"\n");
}