Class Rect3D
Represents a 3-D rectangle: for example, a cube.
Inheritance
Namespace: Telerik.Windows.Media.Media3D
Assembly: Telerik.Windows.Controls.Charting.dll
Syntax
public sealed class Rect3D : ValueType
Remarks
Rect3D is defined as a location (Point3D) and a size structure (Size3D). Because the X, Y, and Z values specified for the size are magnitudes and not coordinates, they cannot be negative except in the case of an empty rectangle.
Constructors
Rect3D(Double, Double, Double, Double, Double, Double)
Initializes a new instance of the Rect3D struct.
Declaration
public Rect3D(double x, double y, double z, double sizeX, double sizeY, double sizeZ)
Parameters
System.Double
x
X-axis coordinate of the new Rect3D. |
System.Double
y
Y-axis coordinate of the new Rect3D. |
System.Double
z
Z-axis coordinate of the new Rect3D. |
System.Double
sizeX
Size of the new Rect3D in the X dimension. |
System.Double
sizeY
Size of the new Rect3D in the Y dimension. |
System.Double
sizeZ
Size of the new Rect3D in the Z dimension. |
Rect3D(Point3D, Size3D)
Initializes a new instance of the Rect3D struct.
Declaration
public Rect3D(Point3D location, Size3D size)
Parameters
Point3D
location
Location of the new Rect3D. |
Size3D
size
Size of the new Rect3D. |
Properties
Empty
IsEmpty
Gets a value that indicates whether this Rect3D is the Empty rectangle.
Declaration
public bool IsEmpty { get; }
Property Value
System.Boolean
|
Remarks
If Size is zero, this Rect3D still contains a zero- or 1-dimensional set of points; therefore, this property should not be used to check for zero area.
Location
Gets or sets a Point3D that represents the origin of the Rect3D.
Declaration
public Point3D Location { get; set; }
Property Value
Point3D
|
Size
Gets or sets the area of the Rect3D.
Declaration
public Size3D Size { get; set; }
Property Value
Size3D
|
SizeX
Gets or sets the size of the Rect3D in the X dimension.
Declaration
public double SizeX { get; set; }
Property Value
System.Double
|
SizeY
Gets or sets the size of the Rect3D in the Y dimension.
Declaration
public double SizeY { get; set; }
Property Value
System.Double
|
SizeZ
Gets or sets the size of the Rect3D in the Z dimension.
Declaration
public double SizeZ { get; set; }
Property Value
System.Double
|
X
Gets or sets the value of the X coordinate of the rectangle.
Declaration
public double X { get; set; }
Property Value
System.Double
|
Y
Gets or sets the value of the Y coordinate of the rectangle.
Declaration
public double Y { get; set; }
Property Value
System.Double
|
Z
Gets or sets the value of the Z coordinate of the rectangle.
Declaration
public double Z { get; set; }
Property Value
System.Double
|
Methods
Contains(Double, Double, Double)
Gets a value that indicates whether a specified Point3D is within the Rect3D, including its edges.
Declaration
public bool Contains(double x, double y, double z)
Parameters
System.Double
x
X-axis coordinate of the Point3D to be tested. |
System.Double
y
Y-axis coordinate of the Point3D to be tested. |
System.Double
z
Z-axis coordinate of the Point3D to be tested. |
Returns
System.Boolean
|
Contains(Point3D)
Gets a value that indicates whether a specified Point3D is within the Rect3D, including its edges.
Declaration
public bool Contains(Point3D point)
Parameters
Point3D
point
Point to be tested. |
Returns
System.Boolean
True if the specified point or rectangle is within the Rect3D, including its edges; false otherwise. |
Contains(Rect3D)
Gets a value that indicates whether a specified Point3D is within the Rect3D, including its edges.
Declaration
public bool Contains(Rect3D rect)
Parameters
Rect3D
rect
Rect3D to be tested. |
Returns
System.Boolean
True if the specified point or rectangle is within the Rect3D, including its edges; false otherwise. |
Equals(Object)
Determines whether the specified Object is a Rect3D structure and if so, whether the location and size of the specified Object are equal to the location and size of this Rect3D structure.
Declaration
public override bool Equals(object obj)
Parameters
System.Object
obj
The Object to compare. |
Returns
System.Boolean
true if o (the passed Object) is a Rect3D structure and if it is also identical to this Rect3D structure; otherwise, false. |
Equals(Rect3D)
Compares two Rect3D structures for equality.
Declaration
public bool Equals(Rect3D rect)
Parameters
Rect3D
rect
The instance of Rect3D to compare to this instance. |
Returns
System.Boolean
true if instances are equal; otherwise, false. |
Equals(Rect3D, Rect3D)
Compares two Rect3D structures for equality.
Declaration
public static bool Equals(Rect3D rect1, Rect3D rect2)
Parameters
Rect3D
rect1
The first Rect3D structure to compare. |
Rect3D
rect2
The second Rect3D structure to compare. |
Returns
System.Boolean
true if the location and size for |
Remarks
Note that values of type Double might acquire error when operated upon; an exact comparison between two logically-equal values might fail.
GetHashCode()
Gets a hash code for this Rect3D structure.
Declaration
public override int GetHashCode()
Returns
System.Int32
A hash code for this Rect3D structure. |
Intersect(Rect3D)
Rect3D that is the intersection of the current and specified rectangles.
Declaration
public void Intersect(Rect3D rect)
Parameters
Rect3D rect |
Intersect(Rect3D, Rect3D)
Rect3D that is the intersection of the two specified rectangles.
Declaration
public static Rect3D Intersect(Rect3D rect1, Rect3D rect2)
Parameters
Rect3D
rect1
First Rect3D. |
Rect3D
rect2
Second Rect3D. |
Returns
Rect3D
Result of the intersection of |
IntersectsWith(Rect3D)
Returns a value that indicates whether the specified rectangle intersects with this rectangle.
Declaration
public bool IntersectsWith(Rect3D rect)
Parameters
Rect3D
rect
Rectangle to evaluate. |
Returns
System.Boolean
True if the specified rectangle intersects with this rectangle; false otherwise. |
Offset(Double, Double, Double)
Sets the offset translation of the Rect3D to the provided value, specified as a Vector3D.
Declaration
public void Offset(double offsetX, double offsetY, double offsetZ)
Parameters
System.Double
offsetX
Offset along the X axis. |
System.Double
offsetY
Offset along the Y axis. |
System.Double
offsetZ
Offset along the Z axis. |
Offset(Rect3D, Double, Double, Double)
Sets the offset translation of the Rect3D to the provided value, specified as a Vector3D.
Declaration
public static Rect3D Offset(Rect3D rect, double offsetX, double offsetY, double offsetZ)
Parameters
Rect3D
rect
Rect3D to be translated. |
System.Double
offsetX
Offset along the X axis. |
System.Double
offsetY
Offset along the Y axis. |
System.Double
offsetZ
Offset along the Z axis. |
Returns
Rect3D
Rect3D that represents the result of the offset. |
Offset(Rect3D, Vector3D)
Translate location of the rectangle by vector specified.
Declaration
public static Rect3D Offset(Rect3D rect, Vector3D offsetVector)
Parameters
Rect3D
rect
Rect3D to be translated. |
Vector3D
offsetVector
Rect3D that specifies the offset translation. |
Returns
Rect3D
Rect3D that represents the result of the offset. |
Offset(Vector3D)
Sets the offset translation of the Rect3D to the provided value, specified as a Vector3D.
Declaration
public void Offset(Vector3D offsetVector)
Parameters
Vector3D
offsetVector
Vector3D that specifies the offset translation. |
Parse(String)
Converts a String representation of a 3-D size into the equivalent Rect3D structure.
Declaration
public static Rect3D Parse(string source)
Parameters
System.String
source
The String representation of the 3-D size. |
Returns
Rect3D
The equivalent Rect3D structure. |
ToString()
Creates a String representation of this Rect3D structure.
Declaration
public override string ToString()
Returns
System.String
A String containing the X, Y, and Z values of this Rect3D structure. |
ToString(IFormatProvider)
Creates a String representation of this Rect3D structure.
Declaration
public string ToString(IFormatProvider provider)
Parameters
System.IFormatProvider
provider
The culture-specific formatting information. |
Returns
System.String
A String containing the location and size values of this Rect3D structure. |
Union(Point3D)
Declaration
public void Union(Point3D point)
Parameters
Point3D
point
The Point3D whose union with the specified Rect3D is to be evaluated. |
Union(Rect3D)
Declaration
public void Union(Rect3D rect)
Parameters
Rect3D
rect
The Rect3D whose union with the current Rect3D is to be evaluated. |
Union(Rect3D, Point3D)
Declaration
public static Rect3D Union(Rect3D rect, Point3D point)
Parameters
Rect3D
rect
The Rect3D whose union with the current Rect3D is to be evaluated. |
Point3D
point
The Point3D whose union with the specified Rect3D is to be evaluated. |
Returns
Rect3D
Result of the union of Rect3D and point. |
Union(Rect3D, Rect3D)
Declaration
public static Rect3D Union(Rect3D rect1, Rect3D rect2)
Parameters
Rect3D
rect1
First Rect3D. |
Rect3D
rect2
Second Rect3D. |
Returns
Rect3D
Rect3D that represents the result of the union of |
Operators
Equality(Rect3D, Rect3D)
Compares two Rect3D structures for equality.
Declaration
public static bool operator ==(Rect3D rect1, Rect3D rect2)
Parameters
Rect3D
rect1
The first Rect3D structure to compare. |
Rect3D
rect2
The second Rect3D structure to compare. |
Returns
System.Boolean
true if the location and size for |
Remarks
Note that values of type Double might acquire error when operated upon; an exact comparison between two logically-equal values might fail.
Inequality(Rect3D, Rect3D)
Compares two Rect3D structures for inequality.
Declaration
public static bool operator !=(Rect3D rect1, Rect3D rect2)
Parameters
Rect3D
rect1
The first Rect3D structure to compare. |
Rect3D
rect2
The second Rect3D structure to compare. |
Returns
System.Boolean
true if the location and size for |
Remarks
Note that values of type Double might acquire error when operated upon; an exact comparison between two logically-equal values might fail.