Skip to content

Commit

Permalink
* Починена отрисовка в конструкторской области
Browse files Browse the repository at this point in the history
  • Loading branch information
zamtmn committed Jan 14, 2025
1 parent 1e3862b commit 31573a5
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 12 deletions.
11 changes: 7 additions & 4 deletions cad_source/components/zcontainers/gzctnrbinaryseparatedtree.pas
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ interface
constructor initnul;
procedure AddObjToNul(var Entity:TEntity);
procedure updateenttreeadress;
procedure CorrectNodeBoundingBox(var Entity:TEntity); inline;
procedure CorrectNodeBoundingBox(var AEntity:TEntity;ASetToThis:Boolean=False);inline;
procedure AddObjectToNodeTree(var Entity:TEntity);
procedure SetSize(ns:integer);
procedure Lock;
Expand Down Expand Up @@ -400,9 +400,12 @@ procedure GZBInarySeparatedGeometry<TBoundingBox,TSeparator,TNodeData,TEntsManip
TEntsManipulator.SetSizeInArray(ns,nul);
end;

procedure GZBInarySeparatedGeometry<TBoundingBox,TSeparator,TNodeData,TEntsManipulator,TEntity,TEntityArrayIterateResult,TEntityArray>.CorrectNodeBoundingBox(var Entity:TEntity);
procedure GZBInarySeparatedGeometry<TBoundingBox,TSeparator,TNodeData,TEntsManipulator,TEntity,TEntityArrayIterateResult,TEntityArray>.CorrectNodeBoundingBox(var AEntity:TEntity;ASetToThis:Boolean=False);
begin
TEntsManipulator.CorrectNodeBoundingBox(BoundingBox,Entity);
if ASetToThis then
BoundingBox:=TEntsManipulator.GetEntityBoundingBox(AEntity)
else
TEntsManipulator.CorrectNodeBoundingBox(BoundingBox,AEntity)
end;
procedure GZBInarySeparatedGeometry<TBoundingBox,TSeparator,TNodeData,TEntsManipulator,TEntity,TEntityArrayIterateResult,TEntityArray>.updateenttreeadress;
var pobj:PTEntity;
Expand Down Expand Up @@ -450,7 +453,7 @@ procedure GZBInarySeparatedGeometry<TBoundingBox,TSeparator,TNodeData,TEntsManip
BoundingBox:=default(TBoundingBox);
//NodeDir:TNodeDir;
Root:=nil;
NodeData.CreateDef;
NodeData.Clear;
nul.Clear;
if assigned(pplusnode) then
begin
Expand Down
8 changes: 4 additions & 4 deletions cad_source/zcad/core/utils/uzcutils.pas
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ interface
uzestyleslayers,sysutils,uzbtypes,uzcdrawings,varmandef,
uzeconsts,UGDBVisibleOpenArray,uzeentgenericsubentry,uzeentity,
uzegeometrytypes,uzeentblockinsert,uzcinterface,gzctnrVectorTypes,uzeentitiesmanager,
uzegeometry,zcmultiobjectchangeundocommand,uzeEntBase;
uzegeometry,zcmultiobjectchangeundocommand,uzeEntBase,UGDBVisibleTreeArray;

{**Добавление в чертеж примитива с обвязкой undo
@param(PEnt Указатель на добавляемый примитив)
Expand Down Expand Up @@ -98,12 +98,12 @@ function GDBInsertBlock(own:PGDBObjGenericSubEntry;BlockName:String;p_insert:GDB
scale:GDBVertex;rotate:Double;needundo:Boolean=false
):PGDBObjBlockInsert;

function old_ENTF_CreateBlockInsert(owner:PGDBObjGenericSubEntry;ownerarray: PGDBObjEntityOpenArray;
function old_ENTF_CreateBlockInsert(owner:PGDBObjGenericSubEntry;ownerarray: PGDBObjEntityTreeArray;
layeraddres:PGDBLayerProp;LTAddres:PGDBLtypeProp;LW:TGDBLineWeight;color:TGDBPaletteColor;
point: gdbvertex; scale, angle: Double; AName: String):PGDBObjBlockInsert;
function zcGetRealSelEntsCount:integer;
implementation
function old_ENTF_CreateBlockInsert(owner:PGDBObjGenericSubEntry;ownerarray: PGDBObjEntityOpenArray;
function old_ENTF_CreateBlockInsert(owner:PGDBObjGenericSubEntry;ownerarray: PGDBObjEntityTreeArray;
layeraddres:PGDBLayerProp;LTAddres:PGDBLtypeProp;LW:TGDBLineWeight;color:TGDBPaletteColor;
point: gdbvertex; scale, angle: Double; AName: String):PGDBObjBlockInsert;
var
Expand All @@ -119,7 +119,7 @@ function old_ENTF_CreateBlockInsert(owner:PGDBObjGenericSubEntry;ownerarray: PGD
Result^.BuildVarGeometry(drawings.GetCurrentDWG^);
DC:=drawings.GetCurrentDWG^.CreateDrawingRC;
Result^.formatEntity(drawings.GetCurrentDWG^,dc);
owner.ObjArray.ObjTree.CorrectNodeBoundingBox(Result^);
ownerarray.ObjTree.CorrectNodeBoundingBox(Result^,ownerarray.Count=1);
end;
function zcGetRealSelEntsCount:integer;
var
Expand Down
8 changes: 4 additions & 4 deletions cad_source/zcad/electrotech/uzccomops.pas
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ interface
gzctnrVectorTypes,uzccomelectrical,URecordDescriptor,TypeDescriptors,uzcLog,
uzcstrconsts,uzccmdfloatinsert,//uzctnrvectorpgdbaseobjects,
zUndoCmdChgTypes,zUndoCmdChgVariable,
uzcdrawing,uzCtnrVectorpBaseEntity;
uzcdrawing,uzCtnrVectorpBaseEntity,UGDBVisibleTreeArray;

type
TPlaceParam=record
Expand Down Expand Up @@ -217,7 +217,7 @@ function GetPlaceParam(count:integer;length,sd,dd:Double;DMC:TOPSMinDatCount;ps:
end;
end;
end;
procedure place2(pva:PGDBObjEntityOpenArray;basepoint, dir: gdbvertex; count: integer; length,sd,dd: Double; name: pansichar;angle:Double;norm:Boolean;scaleblock:Double;ps:TPlaceSensorsStrategy);
procedure place2(pva:PGDBObjEntityTreeArray;basepoint, dir: gdbvertex; count: integer; length,sd,dd: Double; name: pansichar;angle:Double;norm:Boolean;scaleblock:Double;ps:TPlaceSensorsStrategy);
var //line2: GDBLineOps;
i: integer;
d: TPlaceParam;
Expand Down Expand Up @@ -248,7 +248,7 @@ procedure place2(pva:PGDBObjEntityOpenArray;basepoint, dir: gdbvertex; count: in
end;
end;
end;
procedure placedatcic(pva:PGDBObjEntityOpenArray;p1, p2: gdbvertex; InitialSD, InitialDD: Double; name: pansichar;norm:Boolean;scaleblock: Double;ps:TPlaceSensorsStrategy);
procedure placedatcic(pva:PGDBObjEntityTreeArray;p1, p2: gdbvertex; InitialSD, InitialDD: Double; name: pansichar;norm:Boolean;scaleblock: Double;ps:TPlaceSensorsStrategy);
var dx, dy: Double;
FirstLine, SecondLine: GDBLineOps;
FirstCount, SecondCount, i: integer;
Expand Down Expand Up @@ -1203,7 +1203,7 @@ function PlBeforeClick(const Context:TZCADCommandContext;wc: GDBvertex; mc: GDBv
t3dp:=wc;
end
end;
procedure placedev(pva:PGDBObjEntityOpenArray;p1, p2: gdbvertex; nmax, nmin: Integer; name: pansichar;a:Double;aa:Boolean;Norm:Boolean);
procedure placedev(pva:PGDBObjEntityTreeArray;p1, p2: gdbvertex; nmax, nmin: Integer; name: pansichar;a:Double;aa:Boolean;Norm:Boolean);
var dx, dy: Double;
line1, line2: GDBLineOps;
l1, l2, i: integer;
Expand Down
8 changes: 8 additions & 0 deletions cad_source/zengine/core/objects/uzeentitiestree.pas
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ TEntTreeNodeData=record
//nodedepth:Integer;
//pluscount,minuscount:Integer;
procedure CreateDef;
procedure Clear;
procedure Destroy;
procedure AfterSeparateNode(var nul:TEntityArray);
end;
Expand Down Expand Up @@ -88,6 +89,13 @@ procedure TEntTreeNodeData.CreateDef;
InFrustumBoundingBox:=default(TBoundingBox);
NeedToSeparated.initnul;
end;
procedure TEntTreeNodeData.Clear;
begin
infrustum:=0;
nuldrawpos:=0;
FulDraw:=TDTFulDraw;
NeedToSeparated.clear;
end;
procedure TEntTreeNodeData.Destroy;
begin
NeedToSeparated.Clear;
Expand Down
4 changes: 4 additions & 0 deletions cad_source/zengine/geomlib/uzegeomentitiestree.pas
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ TFirstStageData=record
end;
TGeomTreeNodeData=record
procedure CreateDef;
procedure Clear;
procedure Destroy;
procedure AfterSeparateNode(var nul:TEntityArray);
end;
Expand Down Expand Up @@ -65,6 +66,9 @@ implementation
procedure TGeomTreeNodeData.CreateDef;
begin
end;
procedure TGeomTreeNodeData.Clear;
begin
end;
procedure TGeomTreeNodeData.Destroy;
begin
end;
Expand Down

0 comments on commit 31573a5

Please sign in to comment.