Class HatchStyleLines
- Namespace
- CADability.Attribute
- Assembly
- CADability.dll
An implementation of a HatchStyle, that defines a style consisting of parallel lines.
public class HatchStyleLines : HatchStyle, IPropertyEntry, IShowProperty, INamedAttribute, ICommandHandler, ISerializable
- Inheritance
-
HatchStyleLines
- Implements
- Inherited Members
Constructors
HatchStyleLines()
Creates a line hatch style with all values zero: no line distance, angle 0, a single set of lines and no colour, line width or line pattern. Set at least LineDistance and LineAngle before the style is used; a hatch style created from the control center gets sensible defaults instead.
public HatchStyleLines()
HatchStyleLines(SerializationInfo, StreamingContext)
Constructor required by deserialization
protected HatchStyleLines(SerializationInfo info, StreamingContext context)
Parameters
infoSerializationInfoSerializationInfo
contextStreamingContextStreamingContext
Properties
AOffset
The same value as Offset typed as an Angle, so that the control center can edit it with an AngleProperty, which finds the property by its name via reflection. Internal use.
protected Angle AOffset { get; set; }
Property Value
Alternate
When true, every second line is reversed so that consecutive lines run in opposite directions (a zigzag). This makes no difference to the display, but matters when the lines are used as tool paths.
public bool Alternate { get; set; }
Property Value
ColorDef
Gets or sets the color of the lines of this hatch style
public ColorDef ColorDef { get; set; }
Property Value
LineAngle
Sets or gets the lina angle for this hatch style.
public Angle LineAngle { get; set; }
Property Value
LineDistance
Sets or gets the line distance for this hatchstyle.
public double LineDistance { get; set; }
Property Value
LinePattern
Gets or sets the line pattern for the lines of this hatch style
public LinePattern LinePattern { get; set; }
Property Value
LineWidth
Gets or sets the line width for the lines of this hatch style
public LineWidth LineWidth { get; set; }
Property Value
MarginOffset
Sets or gets the distance from the shapes border
public double MarginOffset { get; set; }
Property Value
Number
The number of sets of parallel lines that are generated. The first set runs at LineAngle, each further set is turned by Offset against the previous one, so 2 with an offset of 90° gives a cross hatch. Values below 1 are treated as 1.
public int Number { get; set; }
Property Value
Offset
The angle between two consecutive sets of lines, only relevant when Number is greater than 1. The i-th set runs at LineAngle plus i times this angle.
public SweepAngle Offset { get; set; }
Property Value
SubItems
Must be overridden, when Flags contains PropertyEntryType.HasSubEntries. See SubItems
public override IPropertyEntry[] SubItems { get; }
Property Value
Methods
Clone()
Creates a copy of this hatch style of the same type, with the same name and the same settings. The copy refers to the same colour, line width and line pattern objects and is not contained in a list. Used when a HatchStyleList is cloned and when hatch styles are copied between the project and the global settings.
public override HatchStyle Clone()
Returns
- HatchStyle
the copy
GenerateContent(CompoundShape, Plane)
This method is used by a Hatch object to calculate its contents. It generates a set of parallel lines according to LineDistance and LineAngle and clips them with the given shape. The lines are projected into the 3D world by the given plane. Clip(ICurve2D, bool)
public override GeoObjectList GenerateContent(CompoundShape shape, Plane plane)
Parameters
shapeCompoundShapeshape of the hatch object
planePlanelocal plane of the hatch object
Returns
GetObjectData(SerializationInfo, StreamingContext)
Writes the data of this object for the legacy binary serialization (ISerializable). Files are written in the JSON format (IJsonSerialize) now; the binary format is still read.
public void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
infoSerializationInforeceives the data
contextStreamingContextthe destination of the serialization
GetShowProperty()
Returns an object to display the properties of the HatchStyle
public override IShowProperty GetShowProperty()
Returns
Removed(IPropertyPage)
Overrides Removed(IPropertyPage)
public override void Removed(IPropertyPage pp)
Parameters
ppIPropertyPagethe IPropertyPage from which it was removed