Export (0) Print
Expand All

Point4D Structure

Represents an x-, y-, z-, and w-coordinate point in world space used in performing transformations with non-affine 3-D matrices.

Namespace:  System.Windows.Media.Media3D
Assembly:  PresentationCore (in PresentationCore.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation

[SerializableAttribute]
[TypeConverterAttribute(typeof(Point4DConverter))]
public struct Point4D : IFormattable
<object property="x,y,z,w"/>
-or-
<object property="x y z w"/>

XAML Values

x

The X component of this Point4D structure.

y

The Y component of this Point4D structure.

z

The Z component of this Point4D structure.

w

The W component of this Point4D structure.

The Point4D type exposes the following members.

  NameDescription
Public methodPoint4DInitializes a new instance of a Point4D structure.
Top

  NameDescription
Public propertyWGets or sets the W component of this Point4D structure.
Public propertyXGets or sets the X component of this Point4D structure.
Public propertyYGets or sets the Y component of this Point4D structure.
Public propertyZGets or sets the Z component of this Point4D structure.
Top

  NameDescription
Public methodStatic memberAddAdds a Point4D structure to a Point4D.
Public methodEquals(Object)Determines whether the specified Object is a Point4D structure and if the X, Y, Z, and W properties of the specified Object are equal to the X, Y, Z, and W properties of this Point4D structure. (Overrides ValueType.Equals(Object).)
Public methodEquals(Point4D)Compares two Point4D structures for equality.
Public methodStatic memberEquals(Point4D, Point4D)Compares two Point4D structures for equality.
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeReturns a hash code for this Point4D structure. (Overrides ValueType.GetHashCode().)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodStatic memberMultiplyTransforms the specified Point4D structure by the specified Matrix3D structure.
Public methodOffsetTranslates the Point4D structure by the specified amounts.
Public methodStatic memberParseConverts a String representation of a point4D structure into the equivalent Point4D structure.
Public methodStatic memberSubtractSubtracts a Point4D structure from a Point4D structure.
Public methodToString()Creates a String representation of this Point4D structure. (Overrides ValueType.ToString().)
Public methodToString(IFormatProvider)Creates a String representation of this Point4D structure.
Top

  NameDescription
Public operatorStatic memberAdditionAdds a Point4D structure to a Point4D.
Public operatorStatic memberEqualityCompares two Point4D structures for equality.
Public operatorStatic memberInequalityCompares two Point4D structures for inequality.
Public operatorStatic memberMultiplyTransforms the specified Point4D structure by the specified Matrix3D structure.
Public operatorStatic memberSubtractionSubtracts a Point4D structure from a Point4D structure and returns the result as a Point4D structure.
Top

  NameDescription
Explicit interface implemetationPrivate methodIFormattable.ToStringThis member supports the Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code. For a description of this member, see ToString.
Top

In XAML, the delimiter between the values of a Point4D can be either a comma or a space.

Some cultures might use the comma character as the decimal delimiter instead of the period character. XAML processing for invariant culture defaults to en-US in most XAML processor implementations, and expects the period to be the decimal delimiter. You should avoid using the comma character as the decimal delimiter if specifying a Point4D in XAML, because that will clash with the string type conversion of a Point4D attribute value into its components.

This example shows how to test Point4D structures for equality and inequality.

The following code illustrates how to test Point4D structures for equality and inequality using the Point4D equality methods. The Point4D structures are tested for equality using the overloaded equality (==) operator, then for inequality using the overloaded inequality (!=) operator, and finally a Point3D structure and a Point4D structure are checked for equality using the static Equals method.


// instantiate Points
Point4D point4D1 = new Point4D();
Point4D point4D2 = new Point4D(15, 40, 60, 75);
Point3D point3D1 = new Point3D(15, 40, 60);

// result variables
Boolean areEqual;
Boolean areNotEqual;
String stringResult;

// defining x,y,z,w of point1
point4D1.X = 10;
point4D1.Y = 5;
point4D1.Z = 1;
point4D1.W = 4;

// checking if Points are equal
areEqual = point4D1 == point4D2;

// areEqual is False

// checking if Points are not equal
areNotEqual = point4D1 != point4D2;
// areNotEqual is True

if (Point4D.Equals(point4D1, point3D1))
{
    // the if condition is not true, so this block will not execute
    stringResult = "Both objects are Point4D structures and they are equal";
}

else
{
    // the if condition is false, so this branch will execute
    stringResult = "Parameters are not both Point4D strucutres, or they are but are not equal";
}


.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

ADD
Show:
© 2014 Microsoft