fpvectorial: Further improvements in LAS support

git-svn-id: trunk@35057 -
This commit is contained in:
sekelsenmat 2012-01-31 13:51:07 +00:00
parent 042ccc0b8d
commit 4e2a956745
3 changed files with 17 additions and 5 deletions

View File

@ -44,6 +44,7 @@ var
i: Integer;
lPoint1, lPoint2, lPoint3: TvPoint;
lEntity: TvEntity;
lPos: T3DPoint;
begin
glClearColor(1.0, 1.0, 1.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT);
@ -120,9 +121,12 @@ begin
lPoint3 := lEntity as TvPoint;
glBegin(GL_TRIANGLES); // Drawing Using Triangles
glVertex3f(lPoint1.X, lPoint1.Y, lPoint1.Z); // Top
glVertex3f(lPoint2.X, lPoint2.Y, lPoint2.Z); // Bottom Left
glVertex3f(lPoint3.X, lPoint3.Y, lPoint3.Z); // Top
lPos := lPoint1.GetNormalizedPos(VecPage);
glVertex3f(lPos.X, lPos.Y, lPos.Z);
lPos := lPoint2.GetNormalizedPos(VecPage);
glVertex3f(lPos.X, lPos.Y, lPos.Z);
lPos := lPoint3.GetNormalizedPos(VecPage);
glVertex3f(lPos.X, lPos.Y, lPos.Z);
glEnd(); // Finished Drawing
end;

View File

@ -562,8 +562,8 @@ end;
function TvPoint.GetNormalizedPos(APage: TvVectorialPage): T3DPoint;
begin
Result.X := (X - APage.MinX) / (APage.MaxX - APage.MinX);
Result.Y := (Y - APage.MinY) / (APage.MaxX - APage.MinY);
Result.Z := (Z - APage.MinZ) / (APage.MaxX - APage.MinZ);
Result.Y := (Y - APage.MinY) / (APage.MaxY - APage.MinY);
Result.Z := (Z - APage.MinZ) / (APage.MaxZ - APage.MinZ);
end;
constructor TvEntityWithPen.Create;

View File

@ -278,6 +278,14 @@ begin
begin
AStream.ReadBuffer(lRecord1, SizeOf(TLASPointDataRecordFormat1));
lPage.AddPoint(lRecord1.X, lRecord1.Y, lRecord1.Z);
// Correct the min and max
if lPage.MinX > lRecord1.X then lPage.MinX := lRecord1.X;
if lPage.MinY > lRecord1.Y then lPage.MinY := lRecord1.Y;
if lPage.MinZ > lRecord1.Z then lPage.MinZ := lRecord1.Z;
if lPage.MaxX < lRecord1.X then lPage.MaxX := lRecord1.X;
if lPage.MaxY < lRecord1.Y then lPage.MaxY := lRecord1.Y;
if lPage.MaxZ < lRecord1.Z then lPage.MaxZ := lRecord1.Z;
end;
end;
end;