Class Figure
The figure. A container for shapes.
public class Figure : ObjectWithBounds
- Inheritance
-
Figure
- Inherited Members
Constructors
Figure()
Initializes a new Figure instance. A constructor required for a JSON deserialization.
public Figure()
Properties
Bounds
Gets or sets the object's bounds.
public override RectangleF Bounds { get; }
Property Value
- RectangleF
The object's bounds.
IsClosed
Gets or sets a value indicating whether this figure is closed. A closed figure will make a difference only in case where the first and the last figure's shapes are continuous shapes. In such case the first point of the first shape will be connected by a straight line from the last point of the last shape.
public bool IsClosed { get; set; }
Property Value
- bool
True
if this figure is closed; otherwise,false
.
Segments
Gets the whole figure segments.
public ShapeSegment[] Segments { get; }
Property Value
- ShapeSegment[]
The figure segments.
Shapes
Gets the shapes.
public Shape[] Shapes { get; }
Property Value
- Shape[]
The shapes.
Methods
AddShape(Shape)
Adds a shape to the figure.
public void AddShape(Shape shape)
Parameters
shape
ShapeThe shape to add.
AddShapes(Shape[])
Adds a range of shapes to the figure.
public void AddShapes(Shape[] shapes)
Parameters
shapes
Shape[]The shapes to add.
Equals(object)
Determines whether the specified object is equal to the current object.
public override bool Equals(object obj)
Parameters
obj
objectThe compared object.
Returns
- bool
The result of equals
GetBounds(Matrix)
Gets the object's bounds.
public override RectangleF GetBounds(Matrix matrix)
Parameters
matrix
MatrixThe matrix to apply before bounds will be calculated.
Returns
- RectangleF
The estimated object's bounds.
GetBounds(Matrix, Pen)
Gets the object's bounds.
public override RectangleF GetBounds(Matrix matrix, Pen pen)
Parameters
matrix
MatrixThe matrix to apply before bounds will be calculated.
pen
PenThe pen to use for object. This can influence the object's bounds size.
Returns
- RectangleF
The estimated object's bounds.
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
RemoveShape(Shape)
Removes a shape from the figure.
public void RemoveShape(Shape shape)
Parameters
shape
ShapeThe shape to remove.
RemoveShapes(Shape[])
Removes a range of shapes from the figure.
public void RemoveShapes(Shape[] shapes)
Parameters
shapes
Shape[]The shapes range to remove.
Reverse()
Reverses this figure shapes order and shapes point order.
public void Reverse()
Transform(Matrix)
Applies the specified transformation to the shape.
public override void Transform(Matrix transform)
Parameters
transform
MatrixThe transformation to apply.