Class AbstractShapeInfo<TShapeInfo, TGrid, TPoint, TVectorPoint, TShapeOp>
The base class of shape info classes
[Version(1, 0, 0)]
public abstract class AbstractShapeInfo<TShapeInfo, TGrid, TPoint, TVectorPoint, TShapeOp> : IShapeInfo<TShapeInfo, TGrid, TPoint, TVectorPoint, TShapeOp> where TShapeInfo : IShapeInfo<TShapeInfo, TGrid, TPoint, TVectorPoint, TShapeOp> where TGrid : IGridSpace<TPoint> where TPoint : ISplicedVectorPoint<TPoint, TVectorPoint>, IGridPoint<TPoint> where TVectorPoint : IVectorPoint<TVectorPoint>
Type Parameters
TShapeInfoTGridTPointTVectorPointTShapeOp
- Inheritance
-
AbstractShapeInfo<TShapeInfo, TGrid, TPoint, TVectorPoint, TShapeOp>
- Implements
-
IShapeInfo<TShapeInfo, TGrid, TPoint, TVectorPoint, TShapeOp>
- Derived
- Inherited Members
- Extension Methods
Constructors
AbstractShapeInfo(ShapeStorageInfo<TPoint>)
protected AbstractShapeInfo(ShapeStorageInfo<TPoint> info)
Parameters
infoShapeStorageInfo<TPoint>
Fields
shapeStorageStorageInfo
protected ShapeStorageInfo<TPoint> shapeStorageStorageInfo
Field Value
- ShapeStorageInfo<TPoint>
Properties
ShapeStorageStorageInfo
public ShapeStorageInfo<TPoint> ShapeStorageStorageInfo { get; }
Property Value
- ShapeStorageInfo<TPoint>
Methods
ArrayPointFromGridPoint(TVectorPoint)
protected abstract ArrayPoint ArrayPointFromGridPoint(TVectorPoint point)
Parameters
pointTVectorPoint
Returns
Difference()
Provides a shape operator that will form the difference of the shape describe by this instance and the shape info generated by one of the shape functions of the shape operator returned by this function.
public TShapeOp Difference()
Returns
- TShapeOp
EndShape()
This functions is called to end shape construction and returned a grid described by this shape info.
public TGrid EndShape()
Returns
- TGrid
Filter(Func<TPoint, bool>)
public TShapeInfo Filter(Func<TPoint, bool> filter)
Parameters
Returns
- TShapeInfo
GridPointFromArrayPoint(ArrayPoint)
protected abstract TVectorPoint GridPointFromArrayPoint(ArrayPoint point)
Parameters
pointArrayPoint
Returns
- TVectorPoint
If(bool)
public TShapeOp If(bool condition)
Parameters
conditionbool
Returns
- TShapeOp
IfTranslate(bool, int, int)
public TShapeInfo IfTranslate(bool condition, int x, int y)
Parameters
Returns
- TShapeInfo
Intersection()
Provides a shape operator that will form the intersection of the shape describe by this instance and the shape info generated by one of the shape functions of the shape operator returned by this function.
public TShapeOp Intersection()
Returns
- TShapeOp
MakeOp(ShapeStorageInfo<TPoint>, Func<ShapeStorageInfo<TPoint>, ShapeStorageInfo<TPoint>, ShapeStorageInfo<TPoint>>)
protected abstract TShapeOp MakeOp(ShapeStorageInfo<TPoint> shapeInfo, Func<ShapeStorageInfo<TPoint>, ShapeStorageInfo<TPoint>, ShapeStorageInfo<TPoint>> combineInfo)
Parameters
shapeInfoShapeStorageInfo<TPoint>combineInfoFunc<ShapeStorageInfo<TPoint>, ShapeStorageInfo<TPoint>, ShapeStorageInfo<TPoint>>
Returns
- TShapeOp
MakePoint(int, int)
protected abstract TVectorPoint MakePoint(int x, int y)
Parameters
Returns
- TVectorPoint
MakeShape(int, int, Func<TPoint, bool>, TVectorPoint)
protected abstract TGrid MakeShape(int x, int y, Func<TPoint, bool> isInside, TVectorPoint offset)
Parameters
Returns
- TGrid
MakeShapeInfo(ShapeStorageInfo<TPoint>)
protected abstract TShapeInfo MakeShapeInfo(ShapeStorageInfo<TPoint> shapeStorageInfo)
Parameters
shapeStorageInfoShapeStorageInfo<TPoint>
Returns
- TShapeInfo
SymmetricDifference()
Calculates the symmetric difference of all storged shape info.
[Version(1, 1, 0)]
public TShapeOp SymmetricDifference()
Returns
- TShapeOp
The resulting shape is the union of the first and immediately following shape, minus the intersection of the two shapes.
Translate(int, int)
public TShapeInfo Translate(int x, int y)
Parameters
Returns
- TShapeInfo
Translate(TVectorPoint)
Assumption: ArrayFromGridPoint(p1 + offset) == ArrayFromGridPoint(p1) + ArrayFromGridPoint(offset)
public TShapeInfo Translate(TVectorPoint offset)
Parameters
offsetTVectorPoint
Returns
- TShapeInfo
Union()
Provides a shape operator that will form the union of the shape describe by this instance and the shape info generated by one of the shape functions of the shape operator returned by this function.
public TShapeOp Union()
Returns
- TShapeOp