* Added X/Y boundaries

This commit is contained in:
Andreas Schneider 2015-05-11 19:30:23 +02:00
parent ffd0cc1028
commit 609ff53253
4 changed files with 289 additions and 102 deletions

View File

@ -18,7 +18,7 @@
<UseVersionInfo Value="True"/> <UseVersionInfo Value="True"/>
<AutoIncrementBuild Value="True"/> <AutoIncrementBuild Value="True"/>
<MinorVersionNr Value="7"/> <MinorVersionNr Value="7"/>
<BuildNr Value="257"/> <BuildNr Value="260"/>
<StringTable CompanyName="AKS DataBasis" FileDescription="UO CentrED" InternalName="CentrED" LegalCopyright="(c) 2015 Andreas Schneider and StaticZ" OriginalFilename="CentrED.exe" ProductName="CentrED" ProductVersion="0.7.0"/> <StringTable CompanyName="AKS DataBasis" FileDescription="UO CentrED" InternalName="CentrED" LegalCopyright="(c) 2015 Andreas Schneider and StaticZ" OriginalFilename="CentrED.exe" ProductName="CentrED" ProductVersion="0.7.0"/>
</VersionInfo> </VersionInfo>
<BuildModes Count="7"> <BuildModes Count="7">
@ -371,6 +371,7 @@
<Filename Value="Tools/UfrmBoundaries.pas"/> <Filename Value="Tools/UfrmBoundaries.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<ComponentName Value="frmBoundaries"/> <ComponentName Value="frmBoundaries"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
</Unit8> </Unit8>
<Unit9> <Unit9>
@ -474,6 +475,7 @@
<Filename Value="Tools/UfrmToolWindow.pas"/> <Filename Value="Tools/UfrmToolWindow.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<ComponentName Value="frmToolWindow"/> <ComponentName Value="frmToolWindow"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
</Unit28> </Unit28>
<Unit29> <Unit29>

View File

@ -1,109 +1,243 @@
inherited frmBoundaries: TfrmBoundaries inherited frmBoundaries: TfrmBoundaries
Left = 290 Left = 1831
Height = 164 Height = 164
Top = 171 Top = 239
Width = 205 Width = 402
Caption = 'Boundaries' Caption = 'Boundaries'
ClientHeight = 164 ClientHeight = 164
ClientWidth = 205 ClientWidth = 402
object lblMaxZ: TLabel[0] OnCreate = FormCreate
object gbZRestriction: TGroupBox[0]
AnchorSideLeft.Control = Owner AnchorSideLeft.Control = Owner
AnchorSideTop.Control = seMaxZ AnchorSideTop.Control = Owner
AnchorSideTop.Side = asrCenter Left = 4
Left = 8 Height = 156
Height = 16 Top = 4
Top = 89 Width = 196
Width = 68 BorderSpacing.Left = 4
BorderSpacing.Left = 8 BorderSpacing.Top = 4
Caption = 'Maximum Z:' Caption = 'Restrict Height'
Layout = tlCenter ClientHeight = 141
ParentColor = False ClientWidth = 192
end
object lblMinZ: TLabel[1]
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = seMinZ
AnchorSideTop.Side = asrCenter
Left = 8
Height = 16
Top = 12
Width = 67
BorderSpacing.Left = 8
Caption = 'Minimum Z:'
Layout = tlCenter
ParentColor = False
end
object tbMinZ: TTrackBar[2]
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = seMinZ
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 8
Height = 36
Top = 41
Width = 189
Frequency = 10
Max = 127
Min = -128
OnChange = tbMinZChange
PageSize = 1
Position = -128
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Around = 8
TabOrder = 0 TabOrder = 0
object lblMinZ: TLabel
AnchorSideLeft.Control = tbMinZ
AnchorSideTop.Control = seMinZ
AnchorSideTop.Side = asrCenter
Left = 4
Height = 13
Top = 8
Width = 68
Caption = 'Minimum Z:'
Layout = tlCenter
ParentColor = False
end
object seMinZ: TSpinEdit
AnchorSideTop.Control = gbZRestriction
AnchorSideRight.Control = gbZRestriction
AnchorSideRight.Side = asrBottom
Left = 136
Height = 21
Top = 4
Width = 52
Anchors = [akTop, akRight]
BorderSpacing.Top = 4
BorderSpacing.Right = 4
MaxValue = 127
MinValue = -128
OnChange = seMinZChange
TabOrder = 0
Value = -128
end
object tbMinZ: TTrackBar
AnchorSideLeft.Control = gbZRestriction
AnchorSideTop.Control = seMinZ
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = gbZRestriction
AnchorSideRight.Side = asrBottom
Left = 4
Height = 36
Top = 29
Width = 184
Frequency = 10
Max = 127
Min = -128
OnChange = tbMinZChange
PageSize = 1
Position = -128
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Around = 4
TabOrder = 1
end
object lblMaxZ: TLabel
AnchorSideLeft.Control = tbMaxZ
AnchorSideTop.Control = seMaxZ
AnchorSideTop.Side = asrCenter
Left = 4
Height = 13
Top = 73
Width = 71
Caption = 'Maximum Z:'
Layout = tlCenter
ParentColor = False
end
object seMaxZ: TSpinEdit
AnchorSideTop.Control = tbMinZ
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = seMinZ
AnchorSideRight.Side = asrBottom
Left = 136
Height = 21
Top = 69
Width = 52
Anchors = [akTop, akRight]
MaxValue = 127
MinValue = -128
OnChange = seMaxZChange
TabOrder = 2
Value = 127
end
object tbMaxZ: TTrackBar
AnchorSideLeft.Control = gbZRestriction
AnchorSideTop.Control = seMaxZ
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = gbZRestriction
AnchorSideRight.Side = asrBottom
Left = 4
Height = 36
Top = 94
Width = 184
Frequency = 10
Max = 127
Min = -128
OnChange = tbMaxZChange
PageSize = 1
Position = 127
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Around = 4
TabOrder = 3
end
end end
object tbMaxZ: TTrackBar[3] object gbViewRestriction: TGroupBox[1]
AnchorSideLeft.Control = Owner AnchorSideLeft.Control = gbZRestriction
AnchorSideTop.Control = seMaxZ AnchorSideLeft.Side = asrBottom
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 8
Height = 36
Top = 118
Width = 189
Frequency = 10
Max = 127
Min = -128
OnChange = tbMaxZChange
PageSize = 1
Position = 127
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Around = 8
TabOrder = 1
end
object seMaxZ: TSpinEdit[4]
AnchorSideTop.Control = tbMinZ
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 149
Height = 25
Top = 85
Width = 48
Anchors = [akTop, akRight]
BorderSpacing.Right = 8
MaxValue = 127
MinValue = -128
OnChange = seMaxZChange
TabOrder = 2
Value = 127
end
object seMinZ: TSpinEdit[5]
AnchorSideTop.Control = Owner AnchorSideTop.Control = Owner
AnchorSideRight.Control = Owner AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 149 AnchorSideBottom.Control = Owner
Height = 25 AnchorSideBottom.Side = asrBottom
Top = 8 Left = 204
Width = 48 Height = 156
Anchors = [akTop, akRight] Top = 4
BorderSpacing.Top = 8 Width = 194
BorderSpacing.Right = 8 Anchors = [akTop, akLeft, akRight, akBottom]
MaxValue = 127 BorderSpacing.Around = 4
MinValue = -128 Caption = 'Restrict View Range'
OnChange = seMinZChange ClientHeight = 141
TabOrder = 3 ClientWidth = 190
Value = -128 TabOrder = 1
object seMinX: TSpinEdit
AnchorSideLeft.Control = lblX
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = seMaxX
Left = 19
Height = 21
Top = 4
Width = 74
BorderSpacing.Left = 4
OnChange = seMinXChange
TabOrder = 0
end
object seMaxX: TSpinEdit
AnchorSideTop.Control = gbViewRestriction
AnchorSideRight.Control = gbViewRestriction
AnchorSideRight.Side = asrBottom
Left = 112
Height = 21
Top = 4
Width = 74
Anchors = [akTop, akRight]
BorderSpacing.Top = 4
BorderSpacing.Right = 4
OnChange = seMaxXChange
TabOrder = 1
end
object seMinY: TSpinEdit
AnchorSideLeft.Control = seMinX
AnchorSideTop.Control = seMinX
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = seMinX
AnchorSideRight.Side = asrBottom
Left = 19
Height = 21
Top = 33
Width = 74
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 8
OnChange = seMinYChange
TabOrder = 2
end
object seMaxY: TSpinEdit
AnchorSideLeft.Control = seMaxX
AnchorSideTop.Control = seMinY
AnchorSideRight.Control = seMaxX
AnchorSideRight.Side = asrBottom
Left = 112
Height = 21
Top = 33
Width = 74
Anchors = [akTop, akLeft, akRight]
OnChange = seMaxYChange
TabOrder = 3
end
object lblX: TLabel
AnchorSideLeft.Control = gbViewRestriction
AnchorSideTop.Control = seMinX
AnchorSideTop.Side = asrCenter
Left = 4
Height = 13
Top = 8
Width = 11
BorderSpacing.Left = 4
Caption = 'X:'
ParentColor = False
end
object lblY: TLabel
AnchorSideLeft.Control = lblX
AnchorSideTop.Control = seMinY
AnchorSideTop.Side = asrCenter
Left = 4
Height = 13
Top = 37
Width = 10
Caption = 'Y:'
ParentColor = False
end
object lblXSep: TLabel
AnchorSideLeft.Control = seMinX
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = seMaxX
AnchorSideTop.Side = asrCenter
Left = 97
Height = 13
Top = 8
Width = 11
BorderSpacing.Left = 4
Caption = '—'
ParentColor = False
end
object lblYSep: TLabel
AnchorSideLeft.Control = lblXSep
AnchorSideTop.Control = seMinY
AnchorSideTop.Side = asrCenter
Left = 97
Height = 13
Top = 37
Width = 11
Caption = '—'
ParentColor = False
end
end
inherited tmClose: TTimer[2]
end end
end end

View File

@ -21,7 +21,8 @@
* CDDL HEADER END * CDDL HEADER END
* *
* *
* Portions Copyright 2009 Andreas Schneider * Portions Copyright 2015 Andreas Schneider
* Portions Copyright 2015 StaticZ
*) *)
unit UfrmBoundaries; unit UfrmBoundaries;
@ -38,13 +39,28 @@ type
{ TfrmBoundaries } { TfrmBoundaries }
TfrmBoundaries = class(TfrmToolWindow) TfrmBoundaries = class(TfrmToolWindow)
gbZRestriction: TGroupBox;
gbViewRestriction: TGroupBox;
lblYSep: TLabel;
lblXSep: TLabel;
lblY: TLabel;
lblX: TLabel;
lblMaxZ: TLabel; lblMaxZ: TLabel;
lblMinZ: TLabel; lblMinZ: TLabel;
seMaxZ: TSpinEdit; seMaxZ: TSpinEdit;
seMinZ: TSpinEdit; seMinZ: TSpinEdit;
tbMinZ: TTrackBar; seMinX: TSpinEdit;
seMaxX: TSpinEdit;
seMinY: TSpinEdit;
seMaxY: TSpinEdit;
tbMaxZ: TTrackBar; tbMaxZ: TTrackBar;
tbMinZ: TTrackBar;
procedure FormCreate(Sender: TObject);
procedure seMaxXChange(Sender: TObject);
procedure seMaxYChange(Sender: TObject);
procedure seMaxZChange(Sender: TObject); procedure seMaxZChange(Sender: TObject);
procedure seMinXChange(Sender: TObject);
procedure seMinYChange(Sender: TObject);
procedure seMinZChange(Sender: TObject); procedure seMinZChange(Sender: TObject);
procedure tbMaxZChange(Sender: TObject); procedure tbMaxZChange(Sender: TObject);
procedure tbMinZChange(Sender: TObject); procedure tbMinZChange(Sender: TObject);
@ -62,12 +78,43 @@ uses
{ TfrmBoundaries } { TfrmBoundaries }
procedure TfrmBoundaries.FormCreate(Sender: TObject);
begin
seMinX.MaxValue := frmMain.Landscape.CellWidth - 1;
seMaxX.MaxValue := seMinX.MaxValue;
seMaxX.Value := seMaxX.MaxValue;
seMinY.MaxValue := frmMain.Landscape.CellHeight - 1;
seMaxY.MaxValue := seMinY.MaxValue;
seMaxY.Value := seMaxX.MaxValue;
end;
procedure TfrmBoundaries.seMaxXChange(Sender: TObject);
begin
frmMain.InvalidateFilter;
end;
procedure TfrmBoundaries.seMaxYChange(Sender: TObject);
begin
frmMain.InvalidateFilter;
end;
procedure TfrmBoundaries.seMaxZChange(Sender: TObject); procedure TfrmBoundaries.seMaxZChange(Sender: TObject);
begin begin
tbMaxZ.Position := seMaxZ.Value; tbMaxZ.Position := seMaxZ.Value;
frmMain.InvalidateFilter; frmMain.InvalidateFilter;
end; end;
procedure TfrmBoundaries.seMinXChange(Sender: TObject);
begin
frmMain.InvalidateFilter;
end;
procedure TfrmBoundaries.seMinYChange(Sender: TObject);
begin
frmMain.InvalidateFilter;
end;
procedure TfrmBoundaries.seMinZChange(Sender: TObject); procedure TfrmBoundaries.seMinZChange(Sender: TObject);
begin begin
tbMinZ.Position := seMinZ.Value; tbMinZ.Position := seMinZ.Value;

View File

@ -37,7 +37,7 @@ uses
LCLIntf, UOverlayUI, UStatics, UEnhancedMemoryStream, ActnList, LCLIntf, UOverlayUI, UStatics, UEnhancedMemoryStream, ActnList,
XMLPropStorage, ImagingClasses, dateutils, UPlatformTypes, UMap, UPacket, XMLPropStorage, ImagingClasses, dateutils, UPlatformTypes, UMap, UPacket,
UGLFont, DOM, XMLRead, XMLWrite, strutils, ULightManager, heContnrs, UGLFont, DOM, XMLRead, XMLWrite, strutils, ULightManager, heContnrs,
UContnrExt, UTiledata; UContnrExt, UTiledata, Types;
type type
TAccessChangedListener = procedure(AAccessLevel: TAccessLevel) of object; TAccessChangedListener = procedure(AAccessLevel: TAccessLevel) of object;
@ -2833,7 +2833,11 @@ begin
begin begin
blockInfo^.State := ssNormal; blockInfo^.State := ssNormal;
if (blockInfo^.Item.Z < frmBoundaries.tbMinZ.Position) or if (blockInfo^.Item.Z < frmBoundaries.tbMinZ.Position) or
(blockInfo^.Item.Z > frmBoundaries.tbMaxZ.Position) then (blockInfo^.Item.Z > frmBoundaries.tbMaxZ.Position) or
(blockInfo^.Item.X < frmBoundaries.seMinX.Value) or
(blockInfo^.Item.X > frmBoundaries.seMaxX.Value) or
(blockInfo^.Item.Y < frmBoundaries.seMinY.Value) or
(blockInfo^.Item.Y > frmBoundaries.seMaxY.Value) then
begin begin
blockInfo^.State := ssFiltered; blockInfo^.State := ssFiltered;
end else end else