You've already forked lazarus-ccr
fpvectorial: Removes unused Z coordinates and makes the entity classes smarter, adds support for searching for elements
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1808 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -590,7 +590,7 @@ begin
|
|||||||
WriteLn(Format('Adding Arc Center=%f,%f Radius=%f StartAngle=%f EndAngle=%f',
|
WriteLn(Format('Adding Arc Center=%f,%f Radius=%f StartAngle=%f EndAngle=%f',
|
||||||
[CenterX, CenterY, Radius, StartAngle, EndAngle]));
|
[CenterX, CenterY, Radius, StartAngle, EndAngle]));
|
||||||
{$endif}
|
{$endif}
|
||||||
AData.AddCircularArc(CenterX, CenterY, CenterZ, Radius, StartAngle, EndAngle, LColor);
|
AData.AddCircularArc(CenterX, CenterY, Radius, StartAngle, EndAngle, LColor);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -638,8 +638,7 @@ begin
|
|||||||
CircleCenterX := CircleCenterX - DOC_OFFSET.X;
|
CircleCenterX := CircleCenterX - DOC_OFFSET.X;
|
||||||
CircleCenterY := CircleCenterY - DOC_OFFSET.Y;
|
CircleCenterY := CircleCenterY - DOC_OFFSET.Y;
|
||||||
|
|
||||||
AData.AddCircle(CircleCenterX, CircleCenterY,
|
AData.AddCircle(CircleCenterX, CircleCenterY, CircleRadius);
|
||||||
CircleCenterZ, CircleRadius);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -845,7 +844,7 @@ begin
|
|||||||
CenterY := CenterY - DOC_OFFSET.Y;
|
CenterY := CenterY - DOC_OFFSET.Y;
|
||||||
|
|
||||||
//
|
//
|
||||||
AData.AddEllipse(CenterX, CenterY, CenterZ, MajorHalfAxis, MinorHalfAxis, Angle);
|
AData.AddEllipse(CenterX, CenterY, MajorHalfAxis, MinorHalfAxis, Angle);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -916,7 +915,7 @@ begin
|
|||||||
PosY := PosY - DOC_OFFSET.Y;
|
PosY := PosY - DOC_OFFSET.Y;
|
||||||
|
|
||||||
//
|
//
|
||||||
AData.AddText(PosX, PosY, PosZ, '', Round(FontSize), Str);
|
AData.AddText(PosX, PosY, '', Round(FontSize), Str);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{.$define FPVECTORIALDEBUG_LWPOLYLINE}
|
{.$define FPVECTORIALDEBUG_LWPOLYLINE}
|
||||||
@ -1141,7 +1140,7 @@ begin
|
|||||||
PosY := PosY - DOC_OFFSET.Y;
|
PosY := PosY - DOC_OFFSET.Y;
|
||||||
|
|
||||||
//
|
//
|
||||||
AData.AddText(PosX, PosY, PosZ, '', Round(FontSize), Str);
|
AData.AddText(PosX, PosY, '', Round(FontSize), Str);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TvDXFVectorialReader.ReadENTITIES_POINT(ATokens: TDXFTokens;
|
procedure TvDXFVectorialReader.ReadENTITIES_POINT(ATokens: TDXFTokens;
|
||||||
@ -1179,8 +1178,7 @@ begin
|
|||||||
CircleCenterX := CircleCenterX - DOC_OFFSET.X;
|
CircleCenterX := CircleCenterX - DOC_OFFSET.X;
|
||||||
CircleCenterY := CircleCenterY - DOC_OFFSET.Y;
|
CircleCenterY := CircleCenterY - DOC_OFFSET.Y;
|
||||||
|
|
||||||
AData.AddCircle(CircleCenterX, CircleCenterY,
|
AData.AddCircle(CircleCenterX, CircleCenterY, CircleRadius);
|
||||||
CircleCenterZ, CircleRadius);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TvDXFVectorialReader.GetCoordinateValue(AStr: shortstring): Double;
|
function TvDXFVectorialReader.GetCoordinateValue(AStr: shortstring): Double;
|
||||||
|
@ -139,6 +139,8 @@ type
|
|||||||
X3, Y3, Z3: Double;
|
X3, Y3, Z3: Double;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
TvFindEntityResult = (vfrNotFound, vfrFound, vfrSubpartFound);
|
||||||
|
|
||||||
{ Now all elements }
|
{ Now all elements }
|
||||||
|
|
||||||
{@@
|
{@@
|
||||||
@ -150,6 +152,7 @@ type
|
|||||||
|
|
||||||
TvEntity = class
|
TvEntity = class
|
||||||
public
|
public
|
||||||
|
X, Y: Double;
|
||||||
{@@ The global Pen for the entire entity. In the case of paths, individual
|
{@@ The global Pen for the entire entity. In the case of paths, individual
|
||||||
elements might be able to override this setting. }
|
elements might be able to override this setting. }
|
||||||
Pen: TvPen;
|
Pen: TvPen;
|
||||||
@ -159,6 +162,7 @@ type
|
|||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
procedure CalculateBoundingBox(var ALeft, ATop, ARight, ABottom: Double); virtual;
|
procedure CalculateBoundingBox(var ALeft, ATop, ARight, ABottom: Double); virtual;
|
||||||
procedure ExpandBoundingBox(var ALeft, ATop, ARight, ABottom: Double);
|
procedure ExpandBoundingBox(var ALeft, ATop, ARight, ABottom: Double);
|
||||||
|
function TryToSelect(APos: TPoint): TvFindEntityResult; virtual;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TvClipMode = (vcmNonzeroWindingRule, vcmEvenOddRule);
|
TvClipMode = (vcmNonzeroWindingRule, vcmEvenOddRule);
|
||||||
@ -174,30 +178,34 @@ type
|
|||||||
procedure PrepareForSequentialReading;
|
procedure PrepareForSequentialReading;
|
||||||
function Next(): TPathSegment;
|
function Next(): TPathSegment;
|
||||||
procedure CalculateBoundingBox(var ALeft, ATop, ARight, ABottom: Double); override;
|
procedure CalculateBoundingBox(var ALeft, ATop, ARight, ABottom: Double); override;
|
||||||
|
procedure AppendSegment(ASegment: TPathSegment);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{@@
|
{@@
|
||||||
TvText represents a text entity.
|
TvText represents a text entity.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{ TvText }
|
||||||
|
|
||||||
TvText = class(TvEntity)
|
TvText = class(TvEntity)
|
||||||
public
|
public
|
||||||
X, Y, Z: Double; // Z is ignored in 2D formats
|
|
||||||
Value: utf8string;
|
Value: utf8string;
|
||||||
Font: TvFont;
|
Font: TvFont;
|
||||||
|
function TryToSelect(APos: TPoint): TvFindEntityResult; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{@@
|
{@@
|
||||||
}
|
}
|
||||||
TvCircle = class(TvEntity)
|
TvCircle = class(TvEntity)
|
||||||
public
|
public
|
||||||
CenterX, CenterY, CenterZ, Radius: Double;
|
Radius: Double;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{@@
|
{@@
|
||||||
}
|
}
|
||||||
TvCircularArc = class(TvEntity)
|
TvCircularArc = class(TvEntity)
|
||||||
public
|
public
|
||||||
CenterX, CenterY, CenterZ, Radius: Double;
|
Radius: Double;
|
||||||
{@@ The Angle is measured in degrees in relation to the positive X axis }
|
{@@ The Angle is measured in degrees in relation to the positive X axis }
|
||||||
StartAngle, EndAngle: Double;
|
StartAngle, EndAngle: Double;
|
||||||
end;
|
end;
|
||||||
@ -207,7 +215,7 @@ type
|
|||||||
TvEllipse = class(TvEntity)
|
TvEllipse = class(TvEntity)
|
||||||
public
|
public
|
||||||
// Mandatory fields
|
// Mandatory fields
|
||||||
CenterX, CenterY, CenterZ, MajorHalfAxis, MinorHalfAxis: Double;
|
MajorHalfAxis, MinorHalfAxis: Double;
|
||||||
{@@ The Angle is measured in degrees in relation to the positive X axis }
|
{@@ The Angle is measured in degrees in relation to the positive X axis }
|
||||||
Angle: Double;
|
Angle: Double;
|
||||||
// Calculated fields
|
// Calculated fields
|
||||||
@ -272,6 +280,8 @@ type
|
|||||||
Name: string;
|
Name: string;
|
||||||
// User-Interface information
|
// User-Interface information
|
||||||
ZoomLevel: Double; // 1 = 100%
|
ZoomLevel: Double; // 1 = 100%
|
||||||
|
{ Selection fields }
|
||||||
|
SelectedvElement: TvEntity;
|
||||||
{ Base methods }
|
{ Base methods }
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
@ -294,10 +304,11 @@ type
|
|||||||
function GetPathCount: Integer;
|
function GetPathCount: Integer;
|
||||||
function GetEntity(ANum: Cardinal): TvEntity;
|
function GetEntity(ANum: Cardinal): TvEntity;
|
||||||
function GetEntitiesCount: Integer;
|
function GetEntitiesCount: Integer;
|
||||||
|
function FindAndSelectEntity(Pos: TPoint): TvFindEntityResult;
|
||||||
{ Data removing methods }
|
{ Data removing methods }
|
||||||
procedure Clear; virtual;
|
procedure Clear; virtual;
|
||||||
{ Data writing methods }
|
{ Data writing methods }
|
||||||
procedure AddEntity(AEntity: TvEntity);
|
function AddEntity(AEntity: TvEntity): Integer;
|
||||||
procedure AddPathCopyMem(APath: TPath);
|
procedure AddPathCopyMem(APath: TPath);
|
||||||
procedure StartPath(AX, AY: Double); overload;
|
procedure StartPath(AX, AY: Double); overload;
|
||||||
procedure StartPath(); overload;
|
procedure StartPath(); overload;
|
||||||
@ -315,11 +326,11 @@ type
|
|||||||
procedure SetPenWidth(AWidth: Integer);
|
procedure SetPenWidth(AWidth: Integer);
|
||||||
procedure SetClipPath(AClipPath: TPath; AClipMode: TvClipMode);
|
procedure SetClipPath(AClipPath: TPath; AClipMode: TvClipMode);
|
||||||
procedure EndPath();
|
procedure EndPath();
|
||||||
procedure AddText(AX, AY, AZ: Double; FontName: string; FontSize: integer; AText: utf8string); overload;
|
procedure AddText(AX, AY: Double; FontName: string; FontSize: integer; AText: utf8string); overload;
|
||||||
procedure AddText(AX, AY, AZ: Double; AStr: utf8string); overload;
|
procedure AddText(AX, AY: Double; AStr: utf8string); overload;
|
||||||
procedure AddCircle(ACenterX, ACenterY, ACenterZ, ARadius: Double);
|
procedure AddCircle(ACenterX, ACenterY, ARadius: Double);
|
||||||
procedure AddCircularArc(ACenterX, ACenterY, ACenterZ, ARadius, AStartAngle, AEndAngle: Double; AColor: TFPColor);
|
procedure AddCircularArc(ACenterX, ACenterY, ARadius, AStartAngle, AEndAngle: Double; AColor: TFPColor);
|
||||||
procedure AddEllipse(CenterX, CenterY, CenterZ, MajorHalfAxis, MinorHalfAxis, Angle: Double);
|
procedure AddEllipse(CenterX, CenterY, MajorHalfAxis, MinorHalfAxis, Angle: Double);
|
||||||
// Dimensions
|
// Dimensions
|
||||||
procedure AddAlignedDimension(BaseLeft, BaseRight, DimLeft, DimRight: T3DPoint);
|
procedure AddAlignedDimension(BaseLeft, BaseRight, DimLeft, DimRight: T3DPoint);
|
||||||
{ properties }
|
{ properties }
|
||||||
@ -476,6 +487,19 @@ begin
|
|||||||
Result.Z := 0;
|
Result.Z := 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TvText }
|
||||||
|
|
||||||
|
function TvText.TryToSelect(APos: TPoint): TvFindEntityResult;
|
||||||
|
var
|
||||||
|
lProximityFactor: Integer;
|
||||||
|
begin
|
||||||
|
lProximityFactor := 5;
|
||||||
|
if (APos.X > X - lProximityFactor) and (APos.X < X + lProximityFactor)
|
||||||
|
and (APos.Y > Y - lProximityFactor) and (APos.Y < Y + lProximityFactor) then
|
||||||
|
Result := vfrFound
|
||||||
|
else Result := vfrNotFound;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TvEntity }
|
{ TvEntity }
|
||||||
|
|
||||||
constructor TvEntity.Create;
|
constructor TvEntity.Create;
|
||||||
@ -505,6 +529,11 @@ begin
|
|||||||
if lBottom > ABottom then ABottom := lBottom;
|
if lBottom > ABottom then ABottom := lBottom;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TvEntity.TryToSelect(APos: TPoint): TvFindEntityResult;
|
||||||
|
begin
|
||||||
|
Result := vfrNotFound;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TvEllipse }
|
{ TvEllipse }
|
||||||
|
|
||||||
procedure TvEllipse.CalculateBoundingRectangle;
|
procedure TvEllipse.CalculateBoundingRectangle;
|
||||||
@ -533,7 +562,7 @@ begin
|
|||||||
tan(t) = b*cot(phi)/a
|
tan(t) = b*cot(phi)/a
|
||||||
}
|
}
|
||||||
t := cotan(-MinorHalfAxis*tan(Angle)/MajorHalfAxis);
|
t := cotan(-MinorHalfAxis*tan(Angle)/MajorHalfAxis);
|
||||||
tmp := CenterX + MajorHalfAxis*cos(t)*cos(Angle) - MinorHalfAxis*sin(t)*sin(Angle);
|
tmp := X + MajorHalfAxis*cos(t)*cos(Angle) - MinorHalfAxis*sin(t)*sin(Angle);
|
||||||
BoundingRect.Right := Round(tmp);
|
BoundingRect.Right := Round(tmp);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -791,7 +820,7 @@ begin
|
|||||||
ClearTmpPath();
|
ClearTmpPath();
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TvVectorialDocument.AddText(AX, AY, AZ: Double; FontName: string; FontSize: integer; AText: utf8string);
|
procedure TvVectorialDocument.AddText(AX, AY: Double; FontName: string; FontSize: integer; AText: utf8string);
|
||||||
var
|
var
|
||||||
lText: TvText;
|
lText: TvText;
|
||||||
begin
|
begin
|
||||||
@ -799,38 +828,35 @@ begin
|
|||||||
lText.Value := AText;
|
lText.Value := AText;
|
||||||
lText.X := AX;
|
lText.X := AX;
|
||||||
lText.Y := AY;
|
lText.Y := AY;
|
||||||
lText.Z := AZ;
|
|
||||||
lText.Font.Name := FontName;
|
lText.Font.Name := FontName;
|
||||||
lText.Font.Size := FontSize;
|
lText.Font.Size := FontSize;
|
||||||
AddEntity(lText);
|
AddEntity(lText);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TvVectorialDocument.AddText(AX, AY, AZ: Double; AStr: utf8string);
|
procedure TvVectorialDocument.AddText(AX, AY: Double; AStr: utf8string);
|
||||||
begin
|
begin
|
||||||
AddText(AX, AY, AZ, '', 10, AStr);
|
AddText(AX, AY, '', 10, AStr);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TvVectorialDocument.AddCircle(ACenterX, ACenterY, ACenterZ, ARadius: Double);
|
procedure TvVectorialDocument.AddCircle(ACenterX, ACenterY, ARadius: Double);
|
||||||
var
|
var
|
||||||
lCircle: TvCircle;
|
lCircle: TvCircle;
|
||||||
begin
|
begin
|
||||||
lCircle := TvCircle.Create;
|
lCircle := TvCircle.Create;
|
||||||
lCircle.CenterX := ACenterX;
|
lCircle.X := ACenterX;
|
||||||
lCircle.CenterY := ACenterY;
|
lCircle.Y := ACenterY;
|
||||||
lCircle.CenterZ := ACenterZ;
|
|
||||||
lCircle.Radius := ARadius;
|
lCircle.Radius := ARadius;
|
||||||
AddEntity(lCircle);
|
AddEntity(lCircle);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TvVectorialDocument.AddCircularArc(ACenterX, ACenterY, ACenterZ,
|
procedure TvVectorialDocument.AddCircularArc(ACenterX, ACenterY,
|
||||||
ARadius, AStartAngle, AEndAngle: Double; AColor: TFPColor);
|
ARadius, AStartAngle, AEndAngle: Double; AColor: TFPColor);
|
||||||
var
|
var
|
||||||
lCircularArc: TvCircularArc;
|
lCircularArc: TvCircularArc;
|
||||||
begin
|
begin
|
||||||
lCircularArc := TvCircularArc.Create;
|
lCircularArc := TvCircularArc.Create;
|
||||||
lCircularArc.CenterX := ACenterX;
|
lCircularArc.X := ACenterX;
|
||||||
lCircularArc.CenterY := ACenterY;
|
lCircularArc.Y := ACenterY;
|
||||||
lCircularArc.CenterZ := ACenterZ;
|
|
||||||
lCircularArc.Radius := ARadius;
|
lCircularArc.Radius := ARadius;
|
||||||
lCircularArc.StartAngle := AStartAngle;
|
lCircularArc.StartAngle := AStartAngle;
|
||||||
lCircularArc.EndAngle := AEndAngle;
|
lCircularArc.EndAngle := AEndAngle;
|
||||||
@ -838,15 +864,14 @@ begin
|
|||||||
AddEntity(lCircularArc);
|
AddEntity(lCircularArc);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TvVectorialDocument.AddEllipse(CenterX, CenterY, CenterZ,
|
procedure TvVectorialDocument.AddEllipse(CenterX, CenterY,
|
||||||
MajorHalfAxis, MinorHalfAxis, Angle: Double);
|
MajorHalfAxis, MinorHalfAxis, Angle: Double);
|
||||||
var
|
var
|
||||||
lEllipse: TvEllipse;
|
lEllipse: TvEllipse;
|
||||||
begin
|
begin
|
||||||
lEllipse := TvEllipse.Create;
|
lEllipse := TvEllipse.Create;
|
||||||
lEllipse.CenterX := CenterX;
|
lEllipse.X := CenterX;
|
||||||
lEllipse.CenterY := CenterY;
|
lEllipse.Y := CenterY;
|
||||||
lEllipse.CenterZ := CenterZ;
|
|
||||||
lEllipse.MajorHalfAxis := MajorHalfAxis;
|
lEllipse.MajorHalfAxis := MajorHalfAxis;
|
||||||
lEllipse.MinorHalfAxis := MinorHalfAxis;
|
lEllipse.MinorHalfAxis := MinorHalfAxis;
|
||||||
lEllipse.Angle := Angle;
|
lEllipse.Angle := Angle;
|
||||||
@ -854,10 +879,11 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{@@
|
{@@
|
||||||
Don't free the passed TvText because it will be added directly to the list
|
Adds an entity to the document and returns it's current index
|
||||||
}
|
}
|
||||||
procedure TvVectorialDocument.AddEntity(AEntity: TvEntity);
|
function TvVectorialDocument.AddEntity(AEntity: TvEntity): Integer;
|
||||||
begin
|
begin
|
||||||
|
Result := FEntities.Count;
|
||||||
FEntities.Add(Pointer(AEntity));
|
FEntities.Add(Pointer(AEntity));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -933,28 +959,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TvVectorialDocument.AppendSegmentToTmpPath(ASegment: TPathSegment);
|
procedure TvVectorialDocument.AppendSegmentToTmpPath(ASegment: TPathSegment);
|
||||||
var
|
|
||||||
L: Integer;
|
|
||||||
begin
|
begin
|
||||||
// Check if we are the first segment in the tmp path
|
FTmpPath.AppendSegment(ASegment);
|
||||||
if FTmpPath.PointsEnd = nil then
|
|
||||||
begin
|
|
||||||
if FTmpPath.Len <> 0 then
|
|
||||||
Exception.Create('[TvVectorialDocument.AppendSegmentToTmpPath]' + Str_Error_Nil_Path);
|
|
||||||
|
|
||||||
FTmpPath.Points := ASegment;
|
|
||||||
FTmpPath.PointsEnd := ASegment;
|
|
||||||
FTmpPath.Len := 1;
|
|
||||||
Exit;
|
|
||||||
end;
|
|
||||||
|
|
||||||
L := FTmpPath.Len;
|
|
||||||
Inc(FTmpPath.Len);
|
|
||||||
|
|
||||||
// Adds the element to the end of the list
|
|
||||||
FTmpPath.PointsEnd.Next := ASegment;
|
|
||||||
ASegment.Previous := FTmpPath.PointsEnd;
|
|
||||||
FTmpPath.PointsEnd := ASegment;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{@@
|
{@@
|
||||||
@ -1170,6 +1176,27 @@ begin
|
|||||||
Result := FEntities.Count;
|
Result := FEntities.Count;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TvVectorialDocument.FindAndSelectEntity(Pos: TPoint): TvFindEntityResult;
|
||||||
|
var
|
||||||
|
lEntity: TvEntity;
|
||||||
|
i: Integer;
|
||||||
|
begin
|
||||||
|
Result := vfrNotFound;
|
||||||
|
|
||||||
|
for i := 0 to GetEntitiesCount() - 1 do
|
||||||
|
begin
|
||||||
|
lEntity := GetEntity(i);
|
||||||
|
|
||||||
|
Result := lEntity.TryToSelect(Pos);
|
||||||
|
|
||||||
|
if Result <> vfrNotFound then
|
||||||
|
begin
|
||||||
|
SelectedvElement := lEntity;
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
{@@
|
{@@
|
||||||
Clears all data in the document
|
Clears all data in the document
|
||||||
}
|
}
|
||||||
@ -1347,6 +1374,31 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TPath.AppendSegment(ASegment: TPathSegment);
|
||||||
|
var
|
||||||
|
L: Integer;
|
||||||
|
begin
|
||||||
|
// Check if we are the first segment in the tmp path
|
||||||
|
if PointsEnd = nil then
|
||||||
|
begin
|
||||||
|
if Len <> 0 then
|
||||||
|
Exception.Create('[TPath.AppendSegment] Assertion failed Len <> 0 with PointsEnd = nil');
|
||||||
|
|
||||||
|
Points := ASegment;
|
||||||
|
PointsEnd := ASegment;
|
||||||
|
Len := 1;
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
L := Len;
|
||||||
|
Inc(Len);
|
||||||
|
|
||||||
|
// Adds the element to the end of the list
|
||||||
|
PointsEnd.Next := ASegment;
|
||||||
|
ASegment.Previous := PointsEnd;
|
||||||
|
PointsEnd := ASegment;
|
||||||
|
end;
|
||||||
|
|
||||||
finalization
|
finalization
|
||||||
|
|
||||||
SetLength(GvVectorialFormats, 0);
|
SetLength(GvVectorialFormats, 0);
|
||||||
|
@ -65,8 +65,8 @@ begin
|
|||||||
y2 := CurEllipse.BoundingRect.Bottom;
|
y2 := CurEllipse.BoundingRect.Bottom;
|
||||||
|
|
||||||
dk := Round(0.654 * Abs(y2-y1));
|
dk := Round(0.654 * Abs(y2-y1));
|
||||||
f.x := Round(CurEllipse.CenterX);
|
f.x := Round(CurEllipse.X);
|
||||||
f.y := Round(CurEllipse.CenterY - 1);
|
f.y := Round(CurEllipse.Y - 1);
|
||||||
PointList[0] := Rotate2DPoint(Point(x1, f.y), f, CurEllipse.Angle) ; // Startpoint
|
PointList[0] := Rotate2DPoint(Point(x1, f.y), f, CurEllipse.Angle) ; // Startpoint
|
||||||
PointList[1] := Rotate2DPoint(Point(x1, f.y - dk), f, CurEllipse.Angle);
|
PointList[1] := Rotate2DPoint(Point(x1, f.y - dk), f, CurEllipse.Angle);
|
||||||
//Controlpoint of Startpoint first part
|
//Controlpoint of Startpoint first part
|
||||||
@ -353,10 +353,10 @@ begin
|
|||||||
begin
|
begin
|
||||||
CurCircle := CurEntity as TvCircle;
|
CurCircle := CurEntity as TvCircle;
|
||||||
ADest.Ellipse(
|
ADest.Ellipse(
|
||||||
CoordToCanvasX(CurCircle.CenterX - CurCircle.Radius),
|
CoordToCanvasX(CurCircle.X - CurCircle.Radius),
|
||||||
CoordToCanvasY(CurCircle.CenterY - CurCircle.Radius),
|
CoordToCanvasY(CurCircle.Y - CurCircle.Radius),
|
||||||
CoordToCanvasX(CurCircle.CenterX + CurCircle.Radius),
|
CoordToCanvasX(CurCircle.X + CurCircle.Radius),
|
||||||
CoordToCanvasY(CurCircle.CenterY + CurCircle.Radius)
|
CoordToCanvasY(CurCircle.Y + CurCircle.Radius)
|
||||||
);
|
);
|
||||||
end
|
end
|
||||||
else if CurEntity is TvEllipse then
|
else if CurEntity is TvEllipse then
|
||||||
@ -370,10 +370,10 @@ begin
|
|||||||
{$ifdef USE_LCL_CANVAS}
|
{$ifdef USE_LCL_CANVAS}
|
||||||
// ToDo: Consider a X axis inversion
|
// ToDo: Consider a X axis inversion
|
||||||
// If the Y axis is inverted, then we need to mirror our angles as well
|
// If the Y axis is inverted, then we need to mirror our angles as well
|
||||||
BoundsLeft := CoordToCanvasX(CurArc.CenterX - CurArc.Radius);
|
BoundsLeft := CoordToCanvasX(CurArc.X - CurArc.Radius);
|
||||||
BoundsTop := CoordToCanvasY(CurArc.CenterY - CurArc.Radius);
|
BoundsTop := CoordToCanvasY(CurArc.Y - CurArc.Radius);
|
||||||
BoundsRight := CoordToCanvasX(CurArc.CenterX + CurArc.Radius);
|
BoundsRight := CoordToCanvasX(CurArc.X + CurArc.Radius);
|
||||||
BoundsBottom := CoordToCanvasY(CurArc.CenterY + CurArc.Radius);
|
BoundsBottom := CoordToCanvasY(CurArc.Y + CurArc.Radius);
|
||||||
{if AMulY > 0 then
|
{if AMulY > 0 then
|
||||||
begin}
|
begin}
|
||||||
FinalStartAngle := CurArc.StartAngle;
|
FinalStartAngle := CurArc.StartAngle;
|
||||||
|
Reference in New Issue
Block a user