本文整理匯總了C#中System.Windows.Media.Media3D.Point3D.ToString方法的典型用法代碼示例。如果您正苦於以下問題:C# Point3D.ToString方法的具體用法?C# Point3D.ToString怎麽用?C# Point3D.ToString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Windows.Media.Media3D.Point3D
的用法示例。
在下文中一共展示了Point3D.ToString方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ShowVars
// Displays the values of the variables
public void ShowVars()
{
Point3D p1 = new Point3D(10, 5, 1);
Vector3D v1 = new Vector3D(20, 30, 40);
Size3D s1 = new Size3D(2, 4, 6);
Size3D s2 = new Size3D(5, 10, 15);
// Displaying values in Text objects
txtPoint1.Text = p1.ToString();
txtVector1.Text = v1.ToString();
txtSize1.Text = s1.ToString();
txtSize2.Text = s2.ToString();
}
示例2: BuildSlice
public void BuildSlice( string imageSrc, double offsetZ )
{
Point3D p3D = new Point3D(0, 0, offsetZ);
for (int x = 0; x < 3; x++)
{
for (int y = -1; y < 2; y++)
{
Ball ball = new Ball();
ball.ImageSource = imageSrc;
p3D.X = (x * 2.0) - 2.0;
p3D.Y = (y * 2.0);
ball.Offset = p3D;
Console.WriteLine(p3D.ToString());
_mv3D.Children.Add(ball);
}
}
}
示例3: SpaceCanvas_FingerUp
private void SpaceCanvas_FingerUp(object sender, FingerEventArgs e)
{
if (grabButton.IsChecked)
{
if (e.FingerTracker.OnSurfaceFingers.Count() == 0)
{
if (lastFingerUpPosition.HasValue)
{
Point3D center = new Point3D((lastFingerUpPosition.Value.X + e.Position.X) / 2, (lastFingerUpPosition.Value.Y + e.Position.Y) / 2, 0);
Canvas.SetLeft(highlightRect, Canvas.GetLeft(selectionRect));
Canvas.SetTop(highlightRect, Canvas.GetTop(selectionRect));
highlightRect.Width = selectionRect.Width;
highlightRect.Height = selectionRect.Height;
highlightRect.Opacity = 1.0;
SpaceProvider.GrabAt(center, (Action)delegate()
{
Trace.WriteLine("Grabbed image at " + center.ToString());
//move to somewhere else!!!
byte[] data;
string mime;
SpaceProvider.GetLastGrabbedImageData(out data, out mime);
Dispatcher.BeginInvoke((Action)delegate()
{
highlightRect.Opacity = 0;
gallery.AddImage(data, mime);
}, null);
});
//grabButton.IsChecked = false;
}
selectionRect.Opacity = 0;
lastFingerUpPosition = null;
}
else
{
lastFingerUpPosition = e.Position;
}
}
//Trace.WriteLine("FingerUp: " + e.ID.ToString() + " @ " + e.Position.ToString());
}
示例4: addRowTeeth
public void addRowTeeth(TeethVisual3D teeth, string type)
{
measurement.Type = Smile.TEETH;
string modified_date = DateTime.Today.ToString("dd-MM-yyyy");
if (type == "man")
{
string[] separators = { ";" };
string[] _startpoint = teeth.Model.StartPosition.Split(separators, StringSplitOptions.RemoveEmptyEntries);
string[] _endpoint = teeth.Model.EndPosition.Split(separators, StringSplitOptions.RemoveEmptyEntries);
//string spoint = String.Concat(String.Format("{0:0.00}", _startpoint[0]), ";", String.Format("{0:0.00}", _startpoint[1]), ";", String.Format("{0:0.00}", _startpoint[2]));
//string epoint = String.Concat(String.Format("{0:0.00}", _endpoint[0]), ";", String.Format("{0:0.00}", _endpoint[1]), ";", String.Format("{0:0.00}", _endpoint[2]));
Point3D spoint = new Point3D(Math.Round(Convert.ToDouble(_startpoint[0]), 2), Math.Round(Convert.ToDouble(_startpoint[1]), 2), Math.Round(Convert.ToDouble(_startpoint[2]), 2));
Point3D epoint = new Point3D(Math.Round(Convert.ToDouble(_endpoint[0]), 2), Math.Round(Convert.ToDouble(_endpoint[1]), 2), Math.Round(Convert.ToDouble(_endpoint[2]), 2));
MeasurementTeeth m = new MeasurementTeeth(teeth.Id, Math.Round(teeth.Model.Length, 2), spoint.ToString(), epoint.ToString(), type, modified_date, false);
Mantooth.Add(m);
resultDataGridMan.ItemsSource = null;
resultDataGridMan.ItemsSource = Mantooth;
resultDataGridMan.Columns[1].IsReadOnly = false;
}
else
{
string spoint = null; string epoint = null;
MeasurementTeeth m = new MeasurementTeeth(teeth.Id, Math.Round(teeth.Model.Length, 2), spoint, epoint, type, modified_date, false);
Autotooth.Add(m);
resultDataGridAuto.ItemsSource = null;
resultDataGridAuto.ItemsSource = Autotooth;
}
this.Show();
return;
}
示例5: PerformOperation
// This method performs the Point operations
public void PerformOperation(object sender, RoutedEventArgs e)
{
RadioButton li = (sender as RadioButton);
// Strings used to display the results
String syntaxString, resultType, operationString;
// The local variables point1, point2, vector2, etc are defined in each
// case block for readability reasons. Each variable is contained within
// the scope of each case statement.
switch (li.Name)
{ //begin switch
case "rb1":
{
// Converts a String to a Point using a PointConverter
// Returns a Point.
PointConverter pConverter = new PointConverter();
Point pointResult = new Point();
string string1 = "10,20";
pointResult = (Point)pConverter.ConvertFromString(string1);
// pointResult is equal to (10, 20)
// Displaying Results
syntaxString = "pointResult = (Point)pConverter1.ConvertFromString(string1);";
resultType = "Point";
operationString = "Converting a String to a Point";
ShowResults(pointResult.ToString(), syntaxString, resultType, operationString);
break;
}
case "rb2":
{
// Converts a String to a Vector using a VectorConverter
// Returns a Vector.
VectorConverter vConverter = new VectorConverter();
Vector vectorResult = new Vector();
string string1 = "10,20";
vectorResult = (Vector)vConverter.ConvertFromString(string1);
// vectorResult is equal to (10, 20)
// Displaying Results
syntaxString = "vectorResult = (Vector)vConverter.ConvertFromString(string1);";
resultType = "Vector";
operationString = "Converting a String into a Vector";
ShowResults(vectorResult.ToString(), syntaxString, resultType, operationString);
break;
}
case "rb3":
{
// Converts a String to a Matrix using a MatrixConverter
// Returns a Matrix.
MatrixConverter mConverter = new MatrixConverter();
Matrix matrixResult = new Matrix();
string string2 = "10,20,30,40,50,60";
matrixResult = (Matrix)mConverter.ConvertFromString(string2);
// matrixResult is equal to (10, 20, 30, 40, 50, 60)
// Displaying Results
syntaxString = "matrixResult = (Vector)mConverter.ConvertFromString(string2);";
resultType = "Matrix";
operationString = "Converting a String into a Matrix";
ShowResults(matrixResult.ToString(), syntaxString, resultType, operationString);
break;
}
case "rb4":
{
// Converts a String to a Point3D using a Point3DConverter
// Returns a Point3D.
Point3DConverter p3DConverter = new Point3DConverter();
Point3D point3DResult = new Point3D();
string string3 = "10,20,30";
point3DResult = (Point3D)p3DConverter.ConvertFromString(string3);
// point3DResult is equal to (10, 20, 30)
// Displaying Results
syntaxString = "point3DResult = (Point3D)p3DConverter.ConvertFromString(string3);";
resultType = "Point3D";
operationString = "Converting a String into a Point3D";
ShowResults(point3DResult.ToString(), syntaxString, resultType, operationString);
break;
}
case "rb5":
{
// Converts a String to a Vector3D using a Vector3DConverter
// Returns a Vector3D.
Vector3DConverter v3DConverter = new Vector3DConverter();
//.........這裏部分代碼省略.........
示例6: ShowVars
// Displays the values of the variables
public void ShowVars()
{
Point3D p1 = new Point3D(10, 5, 1);
Point3D p2 = new Point3D(15, 40, 60);
Vector3D v1 = new Vector3D(20, 30, 40);
Vector3D v2 = new Vector3D(45, 70, 80);
Matrix3D m1 = new Matrix3D(10,10,10,0,20,20,20,0,30,30,30,0,5,10,15,1);
// Displaying values in Text objects
txtPoint1.Text = p1.ToString();
txtPoint2.Text = p2.ToString();
txtVector1.Text = v1.ToString();
txtVector2.Text = v2.ToString();
txtMatrix1.Text = m1.ToString();
}
示例7: PerformOperation
// This method performs the Point3D operations
private void PerformOperation(object sender, RoutedEventArgs e)
{
RadioButton li = (sender as RadioButton);
// Strings used to display the results
String syntaxString, resultType, operationString;
// The local variables point1, point2, vector2, etc are defined in each
// case block for readability reasons. Each variable is contained within
// the scope of each case statement.
switch (li.Name)
{ //begin switch
case "rb1":
{
// Translates a Point3D by a Vector3D using the overloaded + operator.
// Returns a Point3D.
Point3D point1 = new Point3D(10, 5, 1);
Vector3D vector1 = new Vector3D(20, 30, 40);
Point3D pointResult = new Point3D();
pointResult = point1 + vector1;
// point3DResult is equal to (30, 35, 41)
// Displaying Results
syntaxString = "pointResult = point1 + vector1;";
resultType = "Point3D";
operationString = "Adding a 3D Point and a 3D Vector";
ShowResults(pointResult.ToString(), syntaxString, resultType, operationString);
break;
}
case "rb2":
{
// Translates a Point3D by a Vector3D using the static Add method.
// Returns a Point3D.
Point3D point1 = new Point3D(10, 5, 1);
Vector3D vector1 = new Vector3D(20, 30, 40);
Point3D pointResult = new Point3D();
pointResult = Point3D.Add(point1, vector1);
// pointResult is equal to (30, 35, 41)
// Displaying Results
syntaxString = "pointResult = Point3D.Add(point1, vector1);";
resultType = "Point3D";
operationString = "Adding a 3D Point and a 3D Vector";
ShowResults(pointResult.ToString(), syntaxString, resultType, operationString);
break;
}
case "rb3":
{
// Subtracts a Vector3D from a Point3D using the overloaded - operator.
// Returns a Point3D.
Point3D point1 = new Point3D(10, 5, 1);
Vector3D vector1 = new Vector3D(20, 30, 40);
Point3D pointResult = new Point3D();
pointResult = point1 - vector1;
// pointResult is equal to (-10, -25, -39)
// Displaying Results
syntaxString = "pointResult = point1 - vector1;";
resultType = "Point3D";
operationString = "Subtracting a Vector3D from a Point3D";
ShowResults(pointResult.ToString(), syntaxString, resultType, operationString);
break;
}
case "rb4":
{
// Subtracts a Vector3D from a Point3D using the static Subtract method.
// Returns a Point3D.
Point3D point1 = new Point3D(10, 5, 1);
Vector3D vector1 = new Vector3D(20, 30, 40);
Point3D pointResult = new Point3D();
pointResult = Point3D.Subtract(point1, vector1);
// pointResult is equal to (-10, -25, -39)
// Displaying Results
syntaxString = "pointResult = Point3D.Subtract(point1, vector1);";
resultType = "Point3D";
operationString = "Subtracting a Vector3D from a Point3D";
ShowResults(pointResult.ToString(), syntaxString, resultType, operationString);
break;
}
case "rb5":
{
// Subtracts a Point3D from a Point3D using the overloaded - operator.
// Returns a Vector3D.
Point3D point1 = new Point3D(10, 5, 1);
//.........這裏部分代碼省略.........
示例8: PerformOperation
private void PerformOperation(object sender, RoutedEventArgs e)
{
RadioButton li = (sender as RadioButton);
// Strings used to display the results
String syntaxString, resultType, operationString;
// The local variables point1, point2, vector2, etc are defined in each
// case block for readability reasons. Each variable is contained within
// the scope of each case statement.
switch (li.Name)
{ //begin switch
case "rb1":
{
// Checks if two Size3D structures are equal using the static Equals method.
// Returns a Boolean.
// Declaring Size3D structure without initializing x,y,z values
Size3D size1 = new Size3D();
// Declaring Size3D structure and initializing x,y,z values
Size3D size2 = new Size3D(5, 10, 15);
Boolean areEqual;
// Assigning values to size1
size1.X = 2;
size1.Y = 4;
size1.Z = 6;
// checking for equality
areEqual = Size3D.Equals(size1, size2);
// areEqual is False
// Displaying Results
syntaxString = "areEqual = Size3D.Equals(size1, size2);";
resultType = "Boolean";
operationString = "Checking if two Size3D structures are equal";
ShowResults(areEqual.ToString(), syntaxString, resultType, operationString);
break;
}
case "rb2":
{
// Checks if an Object and a Size3D structure are equal using the non-static Equals method.
// Returns a Boolean.
// Declaring Size3D structure without initializing x,y,z values
Size3D size1 = new Size3D();
// Declaring Size3D structure and initializing x,y,z values
Size3D size2 = new Size3D(5, 10, 15);
Boolean areEqual;
// Assigning values to size1
size1.X = 2;
size1.Y = 4;
size1.Z = 6;
areEqual = size1.Equals(size2);
// areEqual is False
// Displaying Results
syntaxString = "areEqual = Size3D.Equals(size1, size2);";
resultType = "Boolean";
operationString = "Checking if an object and a Size3D structure are equal";
ShowResults(areEqual.ToString(), syntaxString, resultType, operationString);
break;
}
case "rb3":
{
// Checks if two Size3D structures are equal using the overloaded == operator.
// Returns a Boolean.
// Declaring Size3D structure without initializing x,y,z values
Size3D size1 = new Size3D();
// Declaring Size3D structure and initializing x,y,z values
Size3D size2 = new Size3D(5, 10, 15);
Boolean areEqual;
// Assigning values to size1
size1.X = 2;
size1.Y = 4;
size1.Z = 6;
// Checking for equality
areEqual = size1 == size2;
// areEqual is False
// Displaying Results
syntaxString = " areEqual = size1 == size2;";
resultType = "Boolean";
operationString = "Checking if two Size3D structures are equal";
ShowResults(areEqual.ToString(), syntaxString, resultType, operationString);
break;
}
//.........這裏部分代碼省略.........
示例9: Write
/// <summary>
/// XmlWriterに要素を書き出します。
/// </summary>
/// <param name="writer"></param>
/// <param name="localName"></param>
/// <param name="value"></param>
public static void Write(XmlWriter writer, string localName, Point3D value)
{
if (value.X == double.NaN) return;
writer.WriteAttributeString(localName, value.ToString());
}
示例10: BuildTree
private void BuildTree(Point3D currentPoint)
{
++_CurrentDepth;
Point3D startPoint = currentPoint;
foreach (MovingDirection direction in Directions)
{
if (MovingActions[direction](ref currentPoint))
{
_CurrentNode.Nodes.Add(new TreeNode(direction.ToString()) { Tag = currentPoint.ToString() });
lock (SynchronizationObject)
{
if (_CurrentDepth < MaxDepth)
{
_CurrentNode = _CurrentNode.LastNode;
BuildTree(currentPoint);
_CurrentNode = _CurrentNode.Parent;
--_CurrentDepth;
}
else if (IsCanseRequested) return;
}
}
currentPoint = startPoint;
}
}
示例11: LoadMeasurementGrid
private void LoadMeasurementGrid(string measurement_id)
{
List<MeasurementTeeth> t = DB.SelectTeethById(measurement_id);
MainWindow mw = new MainWindow();
for (int i = 0; i < t.Count; i++)
{
if (t[i].Type == "man")
{
string[] separators = { ";" };
string[] _startpoint = t[i].SPoint.Split(separators, StringSplitOptions.RemoveEmptyEntries);
string[] _endpoint = t[i].EPoint.Split(separators, StringSplitOptions.RemoveEmptyEntries);
Point3D spoint = new Point3D(Convert.ToDouble(_startpoint[0]), Convert.ToDouble(_startpoint[1]), Convert.ToDouble(_startpoint[2]));
Point3D epoint = new Point3D(Convert.ToDouble(_endpoint[0]), Convert.ToDouble(_endpoint[1]), Convert.ToDouble(_endpoint[2]));
Mantooth.Add(new MeasurementTeeth(t[i].Identity, Math.Round(t[i].Length, 2), spoint.ToString(), epoint.ToString(), t[i].Type,t[i].ModifiedDate.ToString(),true));
}
else
{
string spoint = null; string epoint = null;
Autotooth.Add(new MeasurementTeeth(t[i].Identity, Math.Round(t[i].Length, 2), spoint, epoint, t[i].Type, t[i].ModifiedDate.ToString(), true));
}
//mw.createLine(spoint,epoint);
}
resultDataGridMan.ItemsSource = null;
resultDataGridMan.ItemsSource = Mantooth;
resultDataGridAuto.ItemsSource = null;
resultDataGridAuto.ItemsSource = Autotooth;
}
示例12: GetCurrentValueCore
//.........這裏部分代碼省略.........
case AnimationType.To:
from = defaultOriginValue;
to = _keyValues[0];
validateOrigin = true;
break;
case AnimationType.By:
// According to the SMIL specification, a By animation is
// always additive. But we don't force this so that a
// user can re-use a By animation and have it replace the
// animations that precede it in the list without having
// to manually set the From value to the base value.
to = _keyValues[0];
foundation = defaultOriginValue;
validateOrigin = true;
break;
case AnimationType.FromTo:
from = _keyValues[0];
to = _keyValues[1];
if (IsAdditive)
{
foundation = defaultOriginValue;
validateOrigin = true;
}
break;
case AnimationType.FromBy:
from = _keyValues[0];
to = AnimatedTypeHelpers.AddPoint3D(_keyValues[0], _keyValues[1]);
if (IsAdditive)
{
foundation = defaultOriginValue;
validateOrigin = true;
}
break;
default:
Debug.Fail("Unknown animation type.");
break;
}
if (validateOrigin
&& !AnimatedTypeHelpers.IsValidAnimationValuePoint3D(defaultOriginValue))
{
throw new InvalidOperationException(
SR.Get(
SRID.Animation_Invalid_DefaultValue,
this.GetType(),
"origin",
defaultOriginValue.ToString(CultureInfo.InvariantCulture)));
}
if (validateDestination
&& !AnimatedTypeHelpers.IsValidAnimationValuePoint3D(defaultDestinationValue))
{
throw new InvalidOperationException(
SR.Get(
SRID.Animation_Invalid_DefaultValue,
this.GetType(),
"destination",
defaultDestinationValue.ToString(CultureInfo.InvariantCulture)));
}
if (IsCumulative)
{
double currentRepeat = (double)(animationClock.CurrentIteration - 1);
if (currentRepeat > 0.0)
{
Point3D accumulator = AnimatedTypeHelpers.SubtractPoint3D(to, from);
accumulated = AnimatedTypeHelpers.ScalePoint3D(accumulator, currentRepeat);
}
}
// return foundation + accumulated + from + ((to - from) * progress)
return AnimatedTypeHelpers.AddPoint3D(
foundation,
AnimatedTypeHelpers.AddPoint3D(
accumulated,
AnimatedTypeHelpers.InterpolatePoint3D(from, to, progress)));
}