1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: 188: 189:
| unit UFigures;
interface
uses URegulars, Math, ExtCtrls, Graphics, Windows, UPosition, Classes, Dialogs, SysUtils, Forms;
function GetIntersection(ALine1, ALine2: TLine): TPoint;
type TFigure = class private procedure CalculateCharacteristics; virtual; abstract; public procedure Paint(APBox: TPaintbox); virtual; abstract; function ConditionsFulfilled(const ARegular: Array of TRegular): Boolean; virtual; abstract; end;
TBar = class(TFigure) private FFrom, FTo: TPoint; FAngleToX, FLength: Double; procedure CalculateCharacteristics; override; public procedure Paint(APBox: TPaintbox); override; function ConditionsFulfilled(const ARegular: Array of TRegular): Boolean; override;
property GetAngleToX: Double read FAngleToX; property GetLength: Double read FLength; property GetFrom: TPoint read FFrom; property GetTo: TPoint read FTo; end;
TAngle = class(TFigure) private FLine1, FLine2: TLine; FAngle, FAngleToX, FLength1, FLength2: Double; procedure CalculateCharacteristics; override; public procedure Paint(APBox: TPaintbox); override; function ConditionsFulfilled(const ARegular: Array of TRegular): Boolean; override;
property GetAngleToX: Double read FAngleToX; property GetAngle: Double read FAngle; property GetLength1: Double read FLength1; property GetLength2: Double read FLength2; function GetFrom: TPoint; function GetCentre: TPoint; function GetTo: TPoint; end;
TArc = class(TFigure) private FRadius,FAngleFrom, FAngleTo:Double; FCentre: TPoint; FCurvature,FCurvatureSum: Double; FFrom, FTo: TPoint; procedure CalculateCharacteristics; override; public procedure Paint(APBox: TPaintbox); override; function ConditionsFulfilled(const ARegular: Array of TRegular): Boolean; override; end;
THelix = class(TFigure)
end;
TLetter = class(TFigure) end;
TNumber = class(TFigure) end;
implementation
function GetIntersection(ALine1, ALine2: TLine): TPoint; var s1x, s1y, s2x, s2y, r1x, r1y, r2x, r2y: Integer; l: Double; begin *censored* end;
procedure TBar.CalculateCharacteristics; begin FAngleToX := Angle(FFrom, FTo, Point(0, 0), Point(1, 0)); FLength := SQRT(SQR(FTo.X - FFrom.X) + SQR(FTo.Y - FFrom.Y)); end;
procedure TBar.Paint(APBox: TPaintbox); begin *censored* end;
function TBar.ConditionsFulfilled(const ARegular: Array of TRegular): Boolean; var MaxCurvature, AngleToX, MaxAngleToX, MinAngleToX: Double; k: Integer; begin *censored* end;
procedure TAngle.CalculateCharacteristics; begin *censored* end;
procedure TAngle.Paint(APBox: TPaintbox); begin *censored* end;
function TAngle.ConditionsFulfilled(const ARegular: Array of TRegular): Boolean; var k, SumBigCurvatures, SumEdges, IndexEdge: Integer; LCurvature: Array of Double; TotalCurvature, MaxBowCurvature: Double; Intersection: TPoint; Line1,Line2:TLine; begin *censored* end;
function TAngle.GetFrom; begin *censored* end;
function TAngle.GetCentre; begin *censored* end;
function TAngle.GetTo; begin *censored* end;
procedure TArc.CalculateCharacteristics; var n,d:TPoint; k:Double; begin *censored* end;
procedure TArc.Paint(APBox: TPaintbox); begin *censored* end;
function TArc.ConditionsFulfilled(const ARegular: array of TRegular): Boolean; var MaxRadius,MinRadius:Double; BowExists:Boolean; k,AmountOfBows: Integer; Line1,Line2:TLine; HCentre,HFrom,HTo:TPoint; begin *censored* end;
end. |