You've already forked lazarus-ccr
Fixes the dxf reader floating point
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1469 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -66,6 +66,7 @@ type
|
|||||||
|
|
||||||
TvDXFVectorialReader = class(TvCustomVectorialReader)
|
TvDXFVectorialReader = class(TvCustomVectorialReader)
|
||||||
private
|
private
|
||||||
|
FPointSeparator: TFormatSettings;
|
||||||
//
|
//
|
||||||
function SeparateString(AString: string; ASeparator: Char): T10Strings;
|
function SeparateString(AString: string; ASeparator: Char): T10Strings;
|
||||||
procedure ReadENTITIES(ATokens: TDXFTokens; AData: TvVectorialDocument);
|
procedure ReadENTITIES(ATokens: TDXFTokens; AData: TvVectorialDocument);
|
||||||
@ -350,7 +351,7 @@ begin
|
|||||||
if (CurToken.GroupCode = DXF_ENTITIES_HANDLE) or
|
if (CurToken.GroupCode = DXF_ENTITIES_HANDLE) or
|
||||||
(CurToken.GroupCode = DXF_ENTITIES_AcDbEntity) then Continue;
|
(CurToken.GroupCode = DXF_ENTITIES_AcDbEntity) then Continue;
|
||||||
|
|
||||||
CurToken.FloatValue := StrToFloat(Trim(CurToken.StrValue));
|
CurToken.FloatValue := StrToFloat(Trim(CurToken.StrValue), FPointSeparator);
|
||||||
|
|
||||||
case CurToken.GroupCode of
|
case CurToken.GroupCode of
|
||||||
10: LineStartX := CurToken.FloatValue;
|
10: LineStartX := CurToken.FloatValue;
|
||||||
@ -406,7 +407,7 @@ begin
|
|||||||
if (CurToken.GroupCode = DXF_ENTITIES_HANDLE) or
|
if (CurToken.GroupCode = DXF_ENTITIES_HANDLE) or
|
||||||
(CurToken.GroupCode = DXF_ENTITIES_AcDbEntity) then Continue;
|
(CurToken.GroupCode = DXF_ENTITIES_AcDbEntity) then Continue;
|
||||||
|
|
||||||
CurToken.FloatValue := StrToFloat(Trim(CurToken.StrValue));
|
CurToken.FloatValue := StrToFloat(Trim(CurToken.StrValue), FPointSeparator);
|
||||||
|
|
||||||
case CurToken.GroupCode of
|
case CurToken.GroupCode of
|
||||||
10: CenterX := CurToken.FloatValue;
|
10: CenterX := CurToken.FloatValue;
|
||||||
@ -452,7 +453,7 @@ begin
|
|||||||
if (CurToken.GroupCode = DXF_ENTITIES_HANDLE) or
|
if (CurToken.GroupCode = DXF_ENTITIES_HANDLE) or
|
||||||
(CurToken.GroupCode = DXF_ENTITIES_AcDbEntity) then Continue;
|
(CurToken.GroupCode = DXF_ENTITIES_AcDbEntity) then Continue;
|
||||||
|
|
||||||
CurToken.FloatValue := StrToFloat(Trim(CurToken.StrValue));
|
CurToken.FloatValue := StrToFloat(Trim(CurToken.StrValue), FPointSeparator);
|
||||||
|
|
||||||
case CurToken.GroupCode of
|
case CurToken.GroupCode of
|
||||||
10: CircleCenterX := CurToken.FloatValue;
|
10: CircleCenterX := CurToken.FloatValue;
|
||||||
@ -494,7 +495,7 @@ begin
|
|||||||
if (CurToken.GroupCode = DXF_ENTITIES_HANDLE) or
|
if (CurToken.GroupCode = DXF_ENTITIES_HANDLE) or
|
||||||
(CurToken.GroupCode = DXF_ENTITIES_AcDbEntity) then Continue;
|
(CurToken.GroupCode = DXF_ENTITIES_AcDbEntity) then Continue;
|
||||||
|
|
||||||
CurToken.FloatValue := StrToFloat(Trim(CurToken.StrValue));
|
CurToken.FloatValue := StrToFloat(Trim(CurToken.StrValue), FPointSeparator);
|
||||||
|
|
||||||
case CurToken.GroupCode of
|
case CurToken.GroupCode of
|
||||||
10: CenterX := CurToken.FloatValue;
|
10: CenterX := CurToken.FloatValue;
|
||||||
@ -558,7 +559,7 @@ begin
|
|||||||
(CurToken.GroupCode = 1) or
|
(CurToken.GroupCode = 1) or
|
||||||
(CurToken.GroupCode = DXF_ENTITIES_AcDbEntity) then Continue;
|
(CurToken.GroupCode = DXF_ENTITIES_AcDbEntity) then Continue;
|
||||||
|
|
||||||
CurToken.FloatValue := StrToFloat(Trim(CurToken.StrValue));
|
CurToken.FloatValue := StrToFloat(Trim(CurToken.StrValue), FPointSeparator);
|
||||||
|
|
||||||
case CurToken.GroupCode of
|
case CurToken.GroupCode of
|
||||||
1: Str := CurToken.StrValue;
|
1: Str := CurToken.StrValue;
|
||||||
@ -586,6 +587,10 @@ constructor TvDXFVectorialReader.Create;
|
|||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
|
|
||||||
|
FPointSeparator := DefaultFormatSettings;
|
||||||
|
FPointSeparator.DecimalSeparator := '.';
|
||||||
|
FPointSeparator.ThousandSeparator := '#';// disable the thousand separator
|
||||||
|
|
||||||
Tokenizer := TDXFTokenizer.Create;
|
Tokenizer := TDXFTokenizer.Create;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user