Skip to content

Commit

Permalink
Cleanup2
Browse files Browse the repository at this point in the history
  • Loading branch information
zamtmn committed Sep 18, 2024
1 parent c2855d4 commit c7a7150
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 23 deletions.
6 changes: 3 additions & 3 deletions cad_source/components/zcontainers/gzctnrvectorclass.pas
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
unit gzctnrVectorClass;

interface
uses gzctnrVectorTypes,gzctnrVectorc,gvector;
uses gzctnrVectorTypes,gzctnrVector,gvector;
type
{Export+}
{----REGISTEROBJECTTYPE GZVectorClass}
GZVectorClass{-}<T:class>{//}=class
(GZVectorc{-}<T>{//})
GZVectorClass{-}<T:class>{//}=object
(GZVector{-}<T>{//})
procedure cleareraseobjfrom2(n:Integer);
end;
{Export-}
Expand Down
8 changes: 4 additions & 4 deletions cad_source/components/zundostack/zeundostack.pas
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ interface
URRNoCommandsToRedo);
TOnUndoRedoProc=procedure of object;
PTZctnrVectorUndoCommands=^TZctnrVectorUndoCommands;
TZctnrVectorUndoCommands=class(specialize GZVectorClass{-}<{PTElementaryCommand,}TUCmdBase>{//})
TZctnrVectorUndoCommands=object(specialize GZVectorClass<TUCmdBase>)
public
CurrentCommand:TArrayIndex;
currentcommandstartmarker:TArrayIndex;
Expand All @@ -42,7 +42,7 @@ TZctnrVectorUndoCommands=class(specialize GZVectorClass{-}<{PTElementaryCommand,
function undo(out msg:string;prevheap:TArrayIndex;overlay:Boolean):TUndoRedoResult;
procedure KillLastCommand;
function redo(out msg:string):TUndoRedoResult;
constructor Create;
constructor init;
procedure doOnUndoRedo;
function PushBackData(const data:TUCmdBase):TArrayIndex;virtual;
Procedure ClearFrom(cc:TArrayIndex);
Expand Down Expand Up @@ -216,9 +216,9 @@ function TZctnrVectorUndoCommands.redo(out msg:string):TUndoRedoResult;
doOnUndoRedo;
end;

constructor TZctnrVectorUndoCommands.Create;
constructor TZctnrVectorUndoCommands.init;
begin
inherited Create(1);
inherited init(1);
CurrentCommand:=0;
onUndoRedo:=nil;;
end;
Expand Down
2 changes: 1 addition & 1 deletion cad_source/zcad/commands/uzccommand_move.pas
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ function Move_com.Move(const dispmatr:DMatrix4D;UndoMaker:String): Integer;
uzegeometry.MatrixInvert(im);
PTZCADDrawing(drawings.GetCurrentDWG)^.UndoStack.PushStartMarker(UndoMaker);
dc:=drawings.GetCurrentDWG^.CreateDrawingRC;
with PushCreateTGMultiObjectChangeCommand(PTZCADDrawing(drawings.GetCurrentDWG)^.UndoStack,dispmatr,im,pcoa^.Count) do
with PushCreateTGMultiObjectChangeCommand(@PTZCADDrawing(drawings.GetCurrentDWG)^.UndoStack,dispmatr,im,pcoa^.Count) do
begin
pcd:=pcoa^.beginiterate(ir);
if pcd<>nil then
Expand Down
2 changes: 1 addition & 1 deletion cad_source/zcad/commands/uzccommand_rotate.pas
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ procedure rotate_com.rot(a:Double; button: Byte);
im:=dispmatr;
uzegeometry.MatrixInvert(im);
PTZCADDrawing(drawings.GetCurrentDWG)^.UndoStack.PushStartMarker('Rotate');
with PushCreateTGMultiObjectChangeCommand(PTZCADDrawing(drawings.GetCurrentDWG)^.UndoStack,dispmatr,im,pcoa^.Count) do
with PushCreateTGMultiObjectChangeCommand(@PTZCADDrawing(drawings.GetCurrentDWG)^.UndoStack,dispmatr,im,pcoa^.Count) do
begin
pcd:=pcoa^.beginiterate(ir);
if pcd<>nil then
Expand Down
2 changes: 1 addition & 1 deletion cad_source/zcad/commands/uzccommand_rotateents.pas
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function RotateEnts_com(const Context:TZCADCommandContext;operands:TCommandOpera
im:=dispmatr;
uzegeometry.MatrixInvert(im);

with PushCreateTGMultiObjectChangeCommand(PTZCADDrawing(drawings.GetCurrentDWG)^.UndoStack,dispmatr,im,1) do
with PushCreateTGMultiObjectChangeCommand(@PTZCADDrawing(drawings.GetCurrentDWG)^.UndoStack,dispmatr,im,1) do
begin
m:=TMethod(@pv^.Transform);
AddMethod(m);
Expand Down
2 changes: 1 addition & 1 deletion cad_source/zcad/commands/uzccommand_scale.pas
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ procedure scale_com.scale(a:Double; button: Byte);
im:=dispmatr;
uzegeometry.MatrixInvert(im);
PTZCADDrawing(drawings.GetCurrentDWG)^.UndoStack.PushStartMarker('Scale');
with PushCreateTGMultiObjectChangeCommand(PTZCADDrawing(drawings.GetCurrentDWG)^.UndoStack,dispmatr,im,pcoa^.Count) do
with PushCreateTGMultiObjectChangeCommand(@PTZCADDrawing(drawings.GetCurrentDWG)^.UndoStack,dispmatr,im,pcoa^.Count) do
begin
pcd:=pcoa^.beginiterate(ir);
if pcd<>nil then
Expand Down
2 changes: 1 addition & 1 deletion cad_source/zcad/core/drawings/uzcdrawing.pas
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ constructor TZCADDrawing.init;
Pointer(FileName):=nil;
FileName:=rsHardUnnamed;
Changed:=False;
UndoStack:=TZctnrVectorUndoCommands.Create;
UndoStack.init;//:=TZctnrVectorUndoCommands.Create;
UndoStack.onUndoRedo:=self.onUndoRedo;
zebaseundocommands.onUndoRedoDataOwner:=self.onUndoRedoDataOwner;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ generic TGMultiObjectChangeCommand<_T> =class(TUCmdBase)

{IFDEF CLASSDECLARATION}
function CreateTGMultiObjectChangeCommand(const data,undodata:DMatrix4D;const objcount:Integer):TGDBTransformChangeCommand;overload;
function PushCreateTGMultiObjectChangeCommand(const us:TZctnrVectorUndoCommands; const data,undodata:DMatrix4D;const objcount:Integer):TGDBTransformChangeCommand;overload;
function PushCreateTGMultiObjectChangeCommand(const us:PTZctnrVectorUndoCommands; const data,undodata:DMatrix4D;const objcount:Integer):TGDBTransformChangeCommand;overload;
{ENDIF}

implementation
Expand Down Expand Up @@ -116,10 +116,10 @@ function {TZctnrVectorUndoCommands.}CreateTGMultiObjectChangeCommand(const data,
//Getmem(result,sizeof(TGDBTransformChangeCommand));
result:=TGDBTransformChangeCommand.Create(data,undodata,objcount);
end;
function {TZctnrVectorUndoCommands.}PushCreateTGMultiObjectChangeCommand(const us:TZctnrVectorUndoCommands; const data,undodata:DMatrix4D;const objcount:Integer):TGDBTransformChangeCommand;overload;
function {TZctnrVectorUndoCommands.}PushCreateTGMultiObjectChangeCommand(const us:PTZctnrVectorUndoCommands; const data,undodata:DMatrix4D;const objcount:Integer):TGDBTransformChangeCommand;overload;
begin
result:=CreateTGMultiObjectChangeCommand(data,undodata,objcount);
us.PushBackData(result);
inc(us.CurrentCommand);
us^.PushBackData(result);
inc(us^.CurrentCommand);
end;
end.
2 changes: 1 addition & 1 deletion cad_source/zcad/core/utils/uzcutils.pas
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ procedure zcTransformSelectedEntsInDrawingWithUndo(CommandName:String;Transform:
uzegeometry.MatrixInvert(im);
pcd^.UndoStack.PushStartMarker(CommandName);
dc:=pcd^.CreateDrawingRC;
with PushCreateTGMultiObjectChangeCommand(pcd^.UndoStack,Transform,im,Count) do begin
with PushCreateTGMultiObjectChangeCommand(@pcd^.UndoStack,Transform,im,Count) do begin
pobj:=pcd^.GetCurrentROOT.ObjArray.beginiterate(ir);
if pobj<>nil then
repeat
Expand Down
3 changes: 0 additions & 3 deletions cad_source/zengine/containers/UGDBNamedObjectsArray.pas
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ interface
{EXPORT-}
PTGenericNamedObjectsArray=^TGenericNamedObjectsArray;
TGenericNamedObjectsArray=GDBNamedObjectsArray{-}<PGDBNamedObject,GDBNamedObject>{//};
TNamedObjectsArray{-}<TCls:Class>{//}
= class(GZVectorClass{-}<TCls>{//})
end;
implementation
procedure GDBNamedObjectsArray<PTObj,TObj>.IterateCounter(PCounted:Pointer;var Counter:Integer;proc:TProcCounter);
var p:PGDBNamedObject;
Expand Down
3 changes: 0 additions & 3 deletions cad_source/zengine/styles/uzestyleslayers.pas
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ interface
{EXPORT-}
TLayerProp=class(TNamedObject)
end;
TLayerPropClass=class of TLayerProp;
TLayers=GZVectorClass<TLayerProp>;
TLayersClass=class of TLayers;
function GetLTName(LT:PGDBLayerProp):String;
var
DefaultErrorLayer:GDBLayerProp;
Expand Down

0 comments on commit c7a7150

Please sign in to comment.