|
@@ -36,7 +36,9 @@ type
|
|
function GetContextualToolbars: TContextualToolbars; override;
|
|
function GetContextualToolbars: TContextualToolbars; override;
|
|
function Render(VirtualScreen: TBGRABitmap; {%H-}VirtualScreenWidth, {%H-}VirtualScreenHeight: integer; BitmapToVirtualScreen: TBitmapToVirtualScreenFunction): TRect; override;
|
|
function Render(VirtualScreen: TBGRABitmap; {%H-}VirtualScreenWidth, {%H-}VirtualScreenHeight: integer; BitmapToVirtualScreen: TBitmapToVirtualScreenFunction): TRect; override;
|
|
procedure BeforeGridSizeChange; override;
|
|
procedure BeforeGridSizeChange; override;
|
|
- procedure AfterGridSizeChange(NewNbX,NewNbY: Integer); override;
|
|
|
|
|
|
+ procedure AfterGridSizeChange({%H-}NewNbX,{%H-}NewNbY: Integer); override;
|
|
|
|
+ function ToolCommand(ACommand: TToolCommand): boolean; override;
|
|
|
|
+ function ToolProvideCommand(ACommand: TToolCommand): boolean; override;
|
|
destructor Destroy; override;
|
|
destructor Destroy; override;
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -84,6 +86,8 @@ type
|
|
function ToolUp: TRect; override;
|
|
function ToolUp: TRect; override;
|
|
function GetContextualToolbars: TContextualToolbars; override;
|
|
function GetContextualToolbars: TContextualToolbars; override;
|
|
function Render(VirtualScreen: TBGRABitmap; {%H-}VirtualScreenWidth, {%H-}VirtualScreenHeight: integer; BitmapToVirtualScreen: TBitmapToVirtualScreenFunction):TRect; override;
|
|
function Render(VirtualScreen: TBGRABitmap; {%H-}VirtualScreenWidth, {%H-}VirtualScreenHeight: integer; BitmapToVirtualScreen: TBitmapToVirtualScreenFunction):TRect; override;
|
|
|
|
+ function ToolProvideCommand(ACommand: TToolCommand): boolean; override;
|
|
|
|
+ function ToolCommand(ACommand: TToolCommand): boolean; override;
|
|
destructor Destroy; override;
|
|
destructor Destroy; override;
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -717,6 +721,29 @@ begin
|
|
DrawPoints(quad,192);
|
|
DrawPoints(quad,192);
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+function TToolTextureMapping.ToolProvideCommand(ACommand: TToolCommand
|
|
|
|
+ ): boolean;
|
|
|
|
+begin
|
|
|
|
+ case ACommand of
|
|
|
|
+ tcFinish: result := quadDefined;
|
|
|
|
+ else result := false;
|
|
|
|
+ end;
|
|
|
|
+end;
|
|
|
|
+
|
|
|
|
+function TToolTextureMapping.ToolCommand(ACommand: TToolCommand): boolean;
|
|
|
|
+begin
|
|
|
|
+ case ACommand of
|
|
|
|
+ tcFinish: if quadDefined then
|
|
|
|
+ begin
|
|
|
|
+ ValidateQuad;
|
|
|
|
+ Manager.QueryExitTool;
|
|
|
|
+ result := true;
|
|
|
|
+ end else
|
|
|
|
+ result := false;
|
|
|
|
+ else result := false;
|
|
|
|
+ end;
|
|
|
|
+end;
|
|
|
|
+
|
|
destructor TToolTextureMapping.Destroy;
|
|
destructor TToolTextureMapping.Destroy;
|
|
begin
|
|
begin
|
|
ValidateAction;
|
|
ValidateAction;
|
|
@@ -758,12 +785,32 @@ begin
|
|
DeformationGridTexCoord := nil;
|
|
DeformationGridTexCoord := nil;
|
|
end;
|
|
end;
|
|
|
|
|
|
-{$hints off}
|
|
|
|
procedure TToolDeformationGrid.AfterGridSizeChange(NewNbX,NewNbY: Integer);
|
|
procedure TToolDeformationGrid.AfterGridSizeChange(NewNbX,NewNbY: Integer);
|
|
begin
|
|
begin
|
|
//grid will be created when needed
|
|
//grid will be created when needed
|
|
end;
|
|
end;
|
|
-{$hints on}
|
|
|
|
|
|
+
|
|
|
|
+function TToolDeformationGrid.ToolCommand(ACommand: TToolCommand): boolean;
|
|
|
|
+begin
|
|
|
|
+ case ACommand of
|
|
|
|
+ tcFinish: if DoingDeformation then
|
|
|
|
+ begin
|
|
|
|
+ ValidateDeformationGrid;
|
|
|
|
+ result := true;
|
|
|
|
+ end
|
|
|
|
+ else result := false;
|
|
|
|
+ else result := false;
|
|
|
|
+ end;
|
|
|
|
+end;
|
|
|
|
+
|
|
|
|
+function TToolDeformationGrid.ToolProvideCommand(ACommand: TToolCommand
|
|
|
|
+ ): boolean;
|
|
|
|
+begin
|
|
|
|
+ case ACommand of
|
|
|
|
+ tcFinish: result := DoingDeformation;
|
|
|
|
+ else result := false;
|
|
|
|
+ end;
|
|
|
|
+end;
|
|
|
|
|
|
destructor TToolDeformationGrid.Destroy;
|
|
destructor TToolDeformationGrid.Destroy;
|
|
begin
|
|
begin
|
|
@@ -1012,7 +1059,7 @@ begin
|
|
result := EmptyRect;
|
|
result := EmptyRect;
|
|
if Key = VK_RETURN then
|
|
if Key = VK_RETURN then
|
|
begin
|
|
begin
|
|
- if Action <> nil then
|
|
|
|
|
|
+ if DoingDeformation then
|
|
begin
|
|
begin
|
|
ValidateDeformationGrid;
|
|
ValidateDeformationGrid;
|
|
result := EmptyRect;
|
|
result := EmptyRect;
|
|
@@ -1022,7 +1069,7 @@ begin
|
|
end else
|
|
end else
|
|
if Key = VK_ESCAPE then
|
|
if Key = VK_ESCAPE then
|
|
begin
|
|
begin
|
|
- if Action <> nil then
|
|
|
|
|
|
+ if DoingDeformation then
|
|
begin
|
|
begin
|
|
CancelActionPartially;
|
|
CancelActionPartially;
|
|
result := OnlyRenderChange;
|
|
result := OnlyRenderChange;
|