mirror of
http://gitlab.expertsoft.com.ua/git/expertcad
synced 2026-01-11 09:35:40 +02:00
Fitst commit
This commit is contained in:
parent
9fc3c97d9f
commit
125a2f2a0b
@ -530,8 +530,10 @@ type
|
||||
|
||||
FxObjects: TList;
|
||||
FNodes: TList;
|
||||
|
||||
Procedure UpdateFaces(Faces: TList; Yh: Double = 0);
|
||||
//Tolik 22/06/2025 --
|
||||
//Procedure UpdateFaces(Faces: TList; Yh: Double = 0);
|
||||
Procedure UpdateFaces(Faces: TList; Yh: Double = 0; aFirstLoad: boolean = true);
|
||||
//
|
||||
procedure UpdateModelTree;
|
||||
procedure UpdateScsModelTree;
|
||||
procedure UpdateModelTreeFromStream(Faces: TList);
|
||||
@ -2004,7 +2006,8 @@ begin
|
||||
my := y;
|
||||
end;
|
||||
|
||||
procedure Tfrm3D.UpdateFaces(Faces: TList; Yh: Double = 0);
|
||||
//procedure Tfrm3D.UpdateFaces(Faces: TList; Yh: Double = 0);
|
||||
Procedure Tfrm3D.UpdateFaces(Faces: TList; Yh: Double = 0; aFirstLoad: boolean = true);
|
||||
//const
|
||||
// clrBlack : TVector = (0, 0, 0, 1);
|
||||
var
|
||||
@ -12365,9 +12368,9 @@ var
|
||||
MoveDelta: Double; // Tolik
|
||||
CanMoveObj: Boolean;
|
||||
glObject: TGLFreeForm;
|
||||
MovedConn: T3DConnector;
|
||||
MovedConn, xConn: T3DConnector;
|
||||
MovedComponent: T3DComponent;
|
||||
ParentNode: TTreeNode;
|
||||
ParentNode : TTreeNode;
|
||||
Shift: TShiftState;
|
||||
OldAngle: Double;
|
||||
currNode: TTreeNode;
|
||||
@ -12376,6 +12379,9 @@ var
|
||||
SCSLine: TOrthoLine;
|
||||
SCSConnector: TConnectorObject;
|
||||
ConnToMove1, ConntoMove2: T3DConnector;
|
||||
dp1: T3dPoint;
|
||||
LineToMove: T3dLine; // Tolik 19/06/2025 --
|
||||
LastConnID: integer;//
|
||||
|
||||
function GetParentConnector(aNode: TTreeNode): T3DConnector;
|
||||
begin
|
||||
@ -12503,7 +12509,533 @@ var
|
||||
while Result.Level > 2 do
|
||||
Result := Result.Parent;
|
||||
end;
|
||||
//Tolik 18/06/2025 --
|
||||
Procedure CreateNewSCSLineOnMove(adp: T3DPoint; aLine: T3DLine);
|
||||
var SavedGCadForm: TF_Cad;
|
||||
CreatedConn1, CreatedConn2, SnapConn: TConnectorObject;
|
||||
SCSLine, JoinedLine: TOrthoLine;
|
||||
i, j: integer;
|
||||
FaceList, ObjList, Obj3dList: TList;//ñîáðàòü è óäàëèòü âñå îáúåêòû è ñâÿçàííûå ñíèìè óçëû äåðåâüåâ à òàêæå ôåéñû
|
||||
// ò.ê. èõ íåîáõîäèìî áóäåò ïåðåñîçäàòü
|
||||
TubeCompon: TSCSComponent;
|
||||
SCSList: TSCSList;
|
||||
LineCatalog: TSCSCatalog;
|
||||
|
||||
ComponNode, NewTraceNode, CadListNode, xScsNode: TTreeNode;
|
||||
LineToMove, xLine: T3dLine;
|
||||
SCSObjList: TList; // ñïèñîê îáúåêòîâ, êîòîðûå íóæíî áóäåò ïåðåïàðñèòü
|
||||
SelObj: TGLBaseSceneObject; // save selection
|
||||
IstubeSel: Boolean; // if is tube select on trace
|
||||
|
||||
procedure SynchronizeCoordsToCad(aPoint: TDoublePoint; aSide: integer);
|
||||
var SCSConn: TConnectorObject;
|
||||
begin
|
||||
if aSide = 1 then
|
||||
SCSConn := TConnectorObject(SCSLine.JoinConnector1)
|
||||
else
|
||||
SCSConn := TConnectorObject(SCSLine.JoinConnector2);
|
||||
//íà ïëîñêîñòè
|
||||
if ((CompareValue(SCSConn.ap1.x, aPoint.x) <> 0) or
|
||||
(CompareValue(SCSConn.ap1.y, aPoint.y) <> 0)) then
|
||||
SCSConn.Move(aPoint.x - SCSConn.ap1.x, aPoint.y - SCSConn.ap1.y);
|
||||
//ïî âûñîòå (òóò âîïðîñ... êàê ïîéäåò)...
|
||||
// if CompareValue(SCSConn.ActualZOrder[1], aPoint.z) <> 0 then
|
||||
end;
|
||||
begin
|
||||
//26/06/2025 -- save selection
|
||||
SelObj := nil;
|
||||
IstubeSel := False;
|
||||
|
||||
if FSelection.Count > 0 then
|
||||
SelObj := TGLBaseSceneObject(FSelection[i]);
|
||||
if SelObj.TagObject <> nil then
|
||||
begin
|
||||
if TObject(TTreeNode(SelObj.TagObject).Data).ClassName = 'T3DLineComponent' then
|
||||
IstubeSel := True;
|
||||
end;
|
||||
|
||||
DeselectGLObjectsT; // drop selection
|
||||
|
||||
SCSLine := nil;
|
||||
|
||||
if aLine.FSCSObject <> nil then
|
||||
SCSLine := aLine.FSCSObject; // ñàìà òðàññà íà êàäå
|
||||
|
||||
FaceList := TList.Create;
|
||||
ObjList := TList.Create;
|
||||
Obj3dList := TList.Create;
|
||||
//ñîáèðàåì îáúåêòû(êîòîðûå ïîòîì øëåïíåì)
|
||||
// ñ òðàññû
|
||||
ObjList.Add(aLine.FGLObject);
|
||||
FaceList.Add(aLine.FFace);
|
||||
Obj3dList.Add(aLine);
|
||||
|
||||
//ñ êîííåêòîðîâ
|
||||
ObjList.Add(aLine.FJoinConnector1.FGLObject);
|
||||
FaceList.Add(aLine.FJoinConnector1.FFace);
|
||||
Obj3dList.Add(aLine.FJoinConnector1);
|
||||
|
||||
ObjList.Add(aLine.FJoinConnector2.FGLObject);
|
||||
FaceList.Add(aLine.FJoinConnector2.FFace);
|
||||
Obj3dList.add(aLine.FJoinConnector2);
|
||||
|
||||
//ñáðîñ èç îñí. äåðåâà (âñå âìåñòå â îäíîì öèêëå íèççÿ, ò.ê. ïðè óäàëåíèè òðàññû óäàëèòñÿ íå îäèí óçåë à íåñê.,
|
||||
//ó÷èòûâàÿ äî÷åðíèå è íàåáíåòñÿ ñ÷åò÷èê öèêëà)
|
||||
SCSModelTree.Items.BeginUpdate;
|
||||
for i := SCSModelTree.Items.Count - 1 downto 0 do
|
||||
begin
|
||||
if TObject(SCSModelTree.Items[i].data).ClassName = 'T3DLine' then
|
||||
begin
|
||||
if T3dLine(SCSModelTree.Items[i].data).FSCSObject <> nil then
|
||||
begin
|
||||
if T3DLine(SCSModelTree.Items[i].data) = aLine then
|
||||
begin
|
||||
ComponNode := SCSModelTree.Items[i].getFirstChild;
|
||||
while ComponNode <> nil do
|
||||
begin
|
||||
if TObject(ComponNode.data).ClassName = 'T3DLineComponent' then
|
||||
begin
|
||||
if T3DLineComponent(ComponNode.data).FGLObject <> nil then
|
||||
begin
|
||||
if ObjList.IndexOf(T3DLineComponent(ComponNode.data).FGLObject) = -1 then
|
||||
ObjList.Add(T3DLineComponent(ComponNode.data).FGLObject);
|
||||
end;
|
||||
|
||||
if T3DLineComponent(ComponNode.data).FFace <> nil then
|
||||
begin
|
||||
if FaceList.IndexOf(T3DLineComponent(ComponNode.data).FFace) = -1 then
|
||||
FaceList.Add(T3DLineComponent(ComponNode.data).FFace);
|
||||
end;
|
||||
|
||||
if Obj3DList.IndexOf(T3DLineComponent(ComponNode.data)) = -1 then
|
||||
Obj3DList.Add(T3DLineComponent(ComponNode.data));
|
||||
end;
|
||||
ComponNode := SCSModelTree.Items[i].GetNextChild(ComponNode);
|
||||
end;
|
||||
|
||||
SCSModelTree.Items.Delete(SCSModelTree.Items[i]);
|
||||
break;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
for i := SCSModelTree.Items.Count - 1 downto 0 do
|
||||
begin
|
||||
if TObject(SCSModelTree.Items[i].data).ClassName = 'T3DConnector' then
|
||||
begin
|
||||
if ((T3DConnector(SCSModelTree.Items[i].data) = aLine.FJoinConnector1) or
|
||||
(T3DConnector(SCSModelTree.Items[i].data) = aLine.FJoinConnector2)) then
|
||||
begin
|
||||
SCSModelTree.Items.Delete(SCSModelTree.Items[i]);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
SCSModelTree.Items.EndUpdate;
|
||||
|
||||
//ñ îáîèõ êîííåêòîðîâ îäíèì öèêëîì
|
||||
DuplicateNodeTree.Items.BeginUpdate;
|
||||
for i := DuplicateNodeTree.Items.Count - 1 downto 0 do
|
||||
begin
|
||||
if TObject(DuplicateNodeTree.Items[i].Data).ClassName = 'T3DConnector' then
|
||||
begin
|
||||
if T3DConnector(DuplicateNodeTree.Items[i].Data).FisPipeElement then
|
||||
begin
|
||||
if T3DConnector(DuplicateNodeTree.Items[i].Data).FSCSObject <> nil then
|
||||
begin
|
||||
if ((T3DConnector(DuplicateNodeTree.Items[i].Data)= aLine.FJoinConnector1) or
|
||||
(T3DConnector(DuplicateNodeTree.Items[i].Data) = aLine.FJoinConnector2)) then
|
||||
begin
|
||||
if ObjList.IndexOf(T3DConnector(DuplicateNodeTree.Items[i].Data).FGLObject) = -1 then
|
||||
ObjList.Add(T3DConnector(DuplicateNodeTree.Items[i].Data).FGLObject);
|
||||
|
||||
if Obj3dList.IndexOf(T3DConnector(DuplicateNodeTree.Items[i].Data)) = -1 then
|
||||
Obj3dList.Add(T3DConnector(DuplicateNodeTree.Items[i].Data));
|
||||
|
||||
if FaceList.IndexOf(T3DConnector(DuplicateNodeTree.Items[i].Data).FFace) = -1 then
|
||||
FaceList.Add(T3DConnector(DuplicateNodeTree.Items[i].Data).FFace);
|
||||
|
||||
DuplicateNodeTree.Items.Delete(DuplicateNodeTree.Items[i]);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
DuplicateNodeTree.Items.EndUpdate;
|
||||
//
|
||||
//CAD
|
||||
SavedGCadForm := GCadForm;
|
||||
GCadForm := TF_CAD(TPowerCad(TOrthoLine(aLine.FSCSObject).Owner).Owner);
|
||||
//Tolik 24/06/2025 --\
|
||||
//Ñèíõðîíèçèðîâàòü êîîðäèíàòû ñ Êàäîì
|
||||
SynchronizeCoordsToCad(aLine.FPoint1, 1);
|
||||
SynchronizeCoordsToCad(aLine.FPoint2, 2);
|
||||
//
|
||||
|
||||
//ñîçäàòü äâà íîâûõ êîííåêòîðà
|
||||
//îñíîâíàÿ ïðîáëåìà çäåñü....
|
||||
aLine.FPoint1.x := Round2(aLine.FPoint1.x);
|
||||
aLine.FPoint1.y := Round2(aLine.FPoint1.y);
|
||||
aLine.FPoint1.z := Round2(aLine.FPoint1.z);
|
||||
|
||||
aLine.FPoint2.x := Round2(aLine.FPoint2.x);
|
||||
aLine.FPoint2.y := Round2(aLine.FPoint2.y);
|
||||
aLine.FPoint2.z := Round2(aLine.FPoint2.z);
|
||||
//
|
||||
|
||||
CreatedConn1 := TConnectorObject.Create(aLine.FPoint1.x, aLine.FPoint1.y, aLine.FPoint1.z, integer(GCadForm.PCad.Layers[2]),mydsNormal,GCadForm.PCad);
|
||||
CreatedConn1.ConnectorType := ct_Clear;
|
||||
GCadForm.PCad.AddCustomFigure (2, CreatedConn1, False);
|
||||
|
||||
CreatedConn2 := TConnectorObject.Create(aLine.FPoint2.x, aLine.FPoint2.y, aLine.FPoint2.z, integer(GCadForm.PCad.Layers[2]),mydsNormal,GCadForm.PCad);
|
||||
CreatedConn2.ConnectorType := ct_Clear;
|
||||
GCadForm.PCad.AddCustomFigure (2, CreatedConn2, False);
|
||||
//ïåðåñîåäèíèòü òðàññû(åñëè åñòü åùå, êðîìå òåêóùåé) íà ñîçäàííûå êîííåêòîðû
|
||||
SCSLine := TOrthoLine(aLine.FSCSObject);
|
||||
|
||||
if TConnectorObject(SCSLine.JoinConnector1).JoinedOrtholinesList.Count > 1 then
|
||||
begin
|
||||
for i := (TConnectorObject(SCSLine.JoinConnector1).JoinedOrtholinesList.Count - 1) downto 0 do
|
||||
begin
|
||||
JoinedLine := TOrthoLine(TConnectorObject(SCSLine.JoinConnector1).JoinedOrtholinesList[i]);
|
||||
if JoinedLine.ID <> SCSLine.ID then
|
||||
begin
|
||||
//CreatedConn1.JoinedOrtholinesList.Add(JoinedLine);
|
||||
TConnectorObject(SCSLine.JoinConnector1).JoinedOrtholinesList.Delete(i);
|
||||
{
|
||||
if JoinedLine.JoinConnector1.ID = SCSLine.JoinConnector1.ID then
|
||||
JoinedLine.JoinConnector1 := CreatedConn1
|
||||
else
|
||||
JoinedLine.JoinConnector2 := CreatedConn1;
|
||||
}
|
||||
if JoinedLine.JoinConnector1.ID = SCSLine.JoinConnector1.ID then
|
||||
JoinedLine.SetJConnector1(CreatedConn1)
|
||||
else
|
||||
JoinedLine.SetJConnector2(CreatedConn1);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
if TConnectorObject(SCSLine.JoinConnector2).JoinedOrtholinesList.Count > 1 then
|
||||
begin
|
||||
for i := (TConnectorObject(SCSLine.JoinConnector2).JoinedOrtholinesList.Count - 1) downto 0 do
|
||||
begin
|
||||
JoinedLine := TOrthoLine(TConnectorObject(SCSLine.JoinConnector2).JoinedOrtholinesList[i]);
|
||||
if JoinedLine.ID <> SCSLine.ID then
|
||||
begin
|
||||
//CreatedConn2.JoinedOrtholinesList.Add(JoinedLine);
|
||||
TConnectorObject(SCSLine.JoinConnector2).JoinedOrtholinesList.Delete(i);
|
||||
{
|
||||
if JoinedLine.JoinConnector1.ID = SCSLine.JoinConnector2.ID then
|
||||
JoinedLine.JoinConnector1 := CreatedConn2
|
||||
else
|
||||
JoinedLine.JoinConnector2 := CreatedConn2;
|
||||
}
|
||||
if JoinedLine.JoinConnector1.ID = SCSLine.JoinConnector2.ID then
|
||||
JoinedLine.SetJConnector1(CreatedConn2)
|
||||
else
|
||||
JoinedLine.SetJConnector2(CreatedConn2);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
//Äâèíóòü òðàññó ïî ïëîñêîñòè
|
||||
if adp.y = 0 then
|
||||
begin
|
||||
TConnectorObject(SCSLine.JoinConnector1).Move(adp.x, adp.z);
|
||||
TConnectorObject(SCSLine.JoinConnector2).Move(adp.x, adp.z);
|
||||
|
||||
CreateTraceByConnectors(GCadForm, CreatedConn1, TConnectorObject(SCSLine.JoinConnector1), false, true, false);
|
||||
CreateTraceByConnectors(GCadForm, CreatedConn2, TConnectorObject(SCSLine.JoinConnector2), false, true, false);
|
||||
end
|
||||
else
|
||||
begin //åñëè ïî âåðòèêàëè
|
||||
//SCSLine.ActualZOrder[1] := SCSLine.ActualZOrder[1] + adp.y;
|
||||
//SCSLine.ActualZOrder[2] := SCSLine.ActualZOrder[2] + adp.y;
|
||||
|
||||
SCSLine.ActualZOrder[1] := Round2(SCSLine.ActualZOrder[1] + adp.y);
|
||||
SCSLine.ActualZOrder[2] := Round2(SCSLine.ActualZOrder[2] + adp.y);
|
||||
|
||||
TConnectorObject(SCSLine.JoinConnector1).ActualZOrder[1] := Round2(TConnectorObject(SCSLine.JoinConnector1).ActualZOrder[1] + adp.y);
|
||||
TConnectorObject(SCSLine.JoinConnector2).ActualZOrder[1] := Round2(TConnectorObject(SCSLine.JoinConnector2).ActualZOrder[1] + adp.y);
|
||||
{
|
||||
SnapConnectorToConnector(CreatedConn1, TConnectorObject(SCSLine.JoinConnector1));
|
||||
SnapConnectorToConnector(CreatedConn2, TConnectorObject(SCSLine.JoinConnector2));
|
||||
}
|
||||
{
|
||||
CreateVerticalOnTwoPointObjects(CreatedConn1, TConnectorObject(SCSLine.JoinConnector1), TConnectorObject(SCSLine.JoinConnector1).ActualZOrder[1]);
|
||||
CreateVerticalOnTwoPointObjects(CreatedConn2, TConnectorObject(SCSLine.JoinConnector2), TConnectorObject(SCSLine.JoinConnector2).ActualZOrder[1]);
|
||||
}
|
||||
JoinedLine := CreateVerticalOnConnector(CreatedConn1, TConnectorObject(SCSLine.JoinConnector1).ActualZOrder[1]);
|
||||
if JoinedLine.JoinConnector1.ID = CreatedConn1.ID then
|
||||
SnapConn := TConnectorObject(JoinedLine.JoinConnector2)
|
||||
else
|
||||
SnapConn := TConnectorObject(JoinedLine.JoinConnector1);
|
||||
SnapConn := SnapConnectorToConnector(TConnectorObject(SCSLine.JoinConnector1), SnapConn);
|
||||
|
||||
JoinedLine := CreateVerticalOnConnector(CreatedConn2, TConnectorObject(SCSLine.JoinConnector2).ActualZOrder[1]);
|
||||
if JoinedLine.JoinConnector1.ID = CreatedConn2.ID then
|
||||
SnapConn := TConnectorObject(JoinedLine.JoinConnector2)
|
||||
else
|
||||
SnapConn := TConnectorObject(JoinedLine.JoinConnector1);
|
||||
SnapConn := SnapConnectorToConnector(TConnectorObject(SCSLine.JoinConnector2), SnapConn);
|
||||
end;
|
||||
//Ñêîïèðîâàòü òðóáó
|
||||
SCSList := F_ProjMan.GSCSBase.CurrProject.GetListByID(TF_CAD(TPowerCad(SCSLine.Owner).Owner).FCADListID);
|
||||
TubeCompon := nil;
|
||||
if SCSList <> nil then
|
||||
begin
|
||||
LineCatalog := SCSList.GetCatalogFromReferencesBySCSID(SCSLine.ID);
|
||||
if LineCatalog <> nil then
|
||||
begin
|
||||
for i := 0 to LineCatalog.ComponentReferences.Count - 1 do
|
||||
begin
|
||||
if LineCatalog.ComponentReferences[i].ComponentType.SysName = ctsntube then
|
||||
begin
|
||||
TubeCompon := LineCatalog.ComponentReferences[i];
|
||||
break;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
//åñëè åñòü òðóáà (èëè ìîæíî áóäåò ïîòîì è äðóãèå êîìïîíåíòû)
|
||||
if TubeCompon <> nil then
|
||||
begin
|
||||
//Òðóáó â ñïèñêè - ïîòîì òîæå øëåïíåì
|
||||
|
||||
ComponNode := F_ProjMan.FindComponOrDirInTreeByList(SCSList.Id, TubeCompon.ID, true); //
|
||||
if ComponNode <> nil then
|
||||
begin
|
||||
JoinedLine := nil;
|
||||
for i := 0 to TConnectorObject(SCSLine.JoinConnector1).JoinedOrtholinesList.Count - 1 do
|
||||
begin
|
||||
if TOrthoLine(TConnectorObject(SCSLine.JoinConnector1).JoinedOrtholinesList[i]).ID <> SCSLine.ID then
|
||||
begin
|
||||
JoinedLine := TOrthoLine(TConnectorObject(SCSLine.JoinConnector1).JoinedOrtholinesList[i]);
|
||||
break;
|
||||
end;
|
||||
end;
|
||||
|
||||
if JoinedLine <> nil then
|
||||
begin
|
||||
NewTraceNode := F_ProjMan.FindComponOrDirInTreeByList(SCSList.Id, JoinedLine.ID, False); //
|
||||
if NewTraceNode <> nil then
|
||||
begin
|
||||
//Ñêîïèðîâàòü òðóáó
|
||||
F_ProjMan.RollBackCut;
|
||||
F_ProjMan.GSDat.ObjectID := PObjectData(ComponNode.Data).ObjectID;
|
||||
F_ProjMan.GSDat.ItemType := PObjectData(ComponNode.Data).ItemType;
|
||||
F_ProjMan.GEditKind := ekCopy;
|
||||
|
||||
F_ProjMan.Act_ClearCopyBuf.Enabled := true;
|
||||
F_ProjMan.EnablePaste;
|
||||
//âñòàâèòü íà òðàññó
|
||||
F_ProjMan.GTNode := NewTraceNode;
|
||||
F_ProjMan.GSNode := ComponNode;
|
||||
F_ProjMan.PasteNode(F_ProjMan.GSNode, F_ProjMan.GTNode, @F_ProjMan.GSDat, F_ProjMan.GEditKind);
|
||||
end;
|
||||
end;
|
||||
//òðàññà ñî âòîðîé ñòîðîíû, åñëè åñòü
|
||||
JoinedLine := nil;
|
||||
for i := 0 to TConnectorObject(SCSLine.JoinConnector2).JoinedOrtholinesList.Count - 1 do
|
||||
begin
|
||||
if TOrthoLine(TConnectorObject(SCSLine.JoinConnector2).JoinedOrtholinesList[i]).ID <> SCSLine.ID then
|
||||
begin
|
||||
JoinedLine := TOrthoLine(TConnectorObject(SCSLine.JoinConnector2).JoinedOrtholinesList[i]);
|
||||
break;
|
||||
end;
|
||||
end;
|
||||
|
||||
if JoinedLine <> nil then
|
||||
begin
|
||||
NewTraceNode := F_ProjMan.FindComponOrDirInTreeByList(SCSList.Id, JoinedLine.ID, False); //
|
||||
if NewTraceNode <> nil then
|
||||
begin
|
||||
//Ñêîïèðîâàòü òðóáó
|
||||
F_ProjMan.RollBackCut;
|
||||
F_ProjMan.GSDat.ObjectID := PObjectData(ComponNode.Data).ObjectID;
|
||||
F_ProjMan.GSDat.ItemType := PObjectData(ComponNode.Data).ItemType;
|
||||
F_ProjMan.GEditKind := ekCopy;
|
||||
|
||||
F_ProjMan.Act_ClearCopyBuf.Enabled := true;
|
||||
F_ProjMan.EnablePaste;
|
||||
//âñòàâèòü íà òðàññó
|
||||
F_ProjMan.GTNode := NewTraceNode;
|
||||
F_ProjMan.GSNode := ComponNode;
|
||||
F_ProjMan.PasteNode(F_ProjMan.GSNode, F_ProjMan.GTNode, @F_ProjMan.GSDat, F_ProjMan.GEditKind);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
//
|
||||
//øëåïàåì îáúåêòû
|
||||
for i := 0 to FaceList.Count - 1 do
|
||||
begin
|
||||
GCadForm.PCad.Faces.Remove(TFaceRecord(FaceList[i]));
|
||||
TfaceRecord(FaceList[i]).Free;
|
||||
end;
|
||||
FaceList.clear;
|
||||
for i := 0 to ObjList.Count - 1 do
|
||||
begin
|
||||
DummyCube.Remove(TGLBaseSceneObject(ObjList[i]), false);
|
||||
TGLBaseSceneObject(ObjList[i]).Free;
|
||||
end;
|
||||
ObjList.Clear;
|
||||
for i := 0 to Obj3dList.Count - 1 do
|
||||
begin
|
||||
if frm3d.F3DModel.FScsObjects.IndexOf(Obj3dList[i]) <> -1 then
|
||||
frm3d.F3DModel.FScsObjects.Remove(Obj3dList[i]);
|
||||
|
||||
TObject(Obj3dList[i]).Free;
|
||||
end;
|
||||
Obj3dList.Free;
|
||||
|
||||
//ñîáðàòü ÑÊÑ-îáúåêòû, êîòîðûå çàäåë ñäâèã
|
||||
SCSObjList := TList.Create;
|
||||
SCSObjList.Add(SCSLine);
|
||||
SCSObjList.Add(SCSLine.JoinConnector1);
|
||||
SCSObjList.Add(SCSLine.JoinConnector2);
|
||||
|
||||
if TConnectorObject(SCSLine.JoinConnector1).JoinedOrtholinesList.Count > 1 then
|
||||
begin
|
||||
for i := 0 to TConnectorObject(SCSLine.JoinConnector1).JoinedOrtholinesList.Count - 1 do
|
||||
begin
|
||||
JoinedLine := TOrthoLine(TConnectorObject(SCSLine.JoinConnector1).JoinedOrtholinesList[i]);
|
||||
if JoinedLine <> SCSLine then
|
||||
begin
|
||||
if SCSObjList.IndexOf(JoinedLine) = -1 then
|
||||
begin
|
||||
SCSObjList.Add(JoinedLine);
|
||||
if JoinedLine.JoinConnector1 = SCSLine.JoinConnector1 then
|
||||
begin
|
||||
if SCSObjList.IndexOf(JoinedLine.JoinConnector2) = -1 then
|
||||
SCSObjList.Add(JoinedLine.JoinConnector2);
|
||||
end
|
||||
else
|
||||
begin
|
||||
if SCSObjList.IndexOf(JoinedLine.JoinConnector1) = -1 then
|
||||
SCSObjList.Add(JoinedLine.JoinConnector1);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
if TConnectorObject(SCSLine.JoinConnector2).JoinedOrtholinesList.Count > 1 then
|
||||
begin
|
||||
for i := 0 to TConnectorObject(SCSLine.JoinConnector2).JoinedOrtholinesList.Count - 1 do
|
||||
begin
|
||||
JoinedLine := TOrthoLine(TConnectorObject(SCSLine.JoinConnector2).JoinedOrtholinesList[i]);
|
||||
if JoinedLine <> SCSLine then
|
||||
begin
|
||||
if SCSObjList.IndexOf(JoinedLine) = -1 then
|
||||
begin
|
||||
SCSObjList.Add(JoinedLine);
|
||||
if JoinedLine.JoinConnector1 = SCSLine.JoinConnector2 then
|
||||
begin
|
||||
if SCSObjList.IndexOf(JoinedLine.JoinConnector2) = -1 then
|
||||
SCSObjList.Add(JoinedLine.JoinConnector2);
|
||||
end
|
||||
else
|
||||
begin
|
||||
if SCSObjList.IndexOf(JoinedLine.JoinConnector1) = -1 then
|
||||
SCSObjList.Add(JoinedLine.JoinConnector1);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
//ïåðåïàðñèòü
|
||||
j := frm3d.F3DModel.FScsObjects.Count;
|
||||
Frm3D.F3DModel.CollectScsModel(FaceList, SCSObjList);
|
||||
|
||||
//Çàêèíóòü äåðåâî Tolik 22/06/2025 --
|
||||
CadListNode := nil;
|
||||
for i := 0 to SCSModelTree.Items.Count - 1 do
|
||||
begin
|
||||
if TObject(SCSModelTree.Items[i].Data).ClassNAme = 'TF_CAD' then
|
||||
begin
|
||||
if TF_Cad(SCSModelTree.Items[i].Data).FCADListID = TF_CAD(TPowercad(SCSLine.Owner).Owner).FCADListID then
|
||||
begin
|
||||
CadListNode := SCSModelTree.Items[i];
|
||||
break;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
if CadListNode <> nil then
|
||||
begin
|
||||
LastConnID := -1;
|
||||
for i := frm3d.F3DModel.FScsObjects.Count - 1 downto j do
|
||||
begin
|
||||
if TObject(frm3d.F3DModel.FScsObjects[i]) is T3DConnector then
|
||||
begin
|
||||
xConn := T3DConnector(frm3d.F3DModel.FScsObjects[i]);
|
||||
if (xConn.FListID <> GCadForm.FCADListID) then
|
||||
Continue;
|
||||
if (xConn.FConnType = ct_Empty) then
|
||||
begin
|
||||
// Tolik 24/09/2018 - -
|
||||
//xConn.FFace.F3DObject := xConn;
|
||||
//Continue;
|
||||
if not xConn.FisPipeElement then
|
||||
begin
|
||||
xConn.FFace.F3DObject := xConn;
|
||||
Continue;
|
||||
end
|
||||
else
|
||||
begin
|
||||
//Tolik 07/05/2025 --
|
||||
if ((xConn.FSCSComponID <> -1) and (xConn.FSCSComponID = LastConnID)) then
|
||||
begin
|
||||
xScsNode := DuplicateNodeTree.Items.AddChild(nil, xConn.FName);;
|
||||
xScsNode.Data := xConn;
|
||||
xScsNode.ImageIndex := 3;
|
||||
xScsNode.SelectedIndex := xScsNode.ImageIndex;
|
||||
xConn.FFace.FTreeNode := xScsNode;
|
||||
end
|
||||
else
|
||||
begin
|
||||
LastConnID := xConn.FSCSComponID;
|
||||
xScsNode := ScsModelTree.Items.AddChild(CadListNode, xConn.FName);
|
||||
xScsNode.Data := xConn;
|
||||
xScsNode.ImageIndex := 3;
|
||||
xScsNode.SelectedIndex := xScsNode.ImageIndex;
|
||||
xConn.FFace.FTreeNode := xScsNode;
|
||||
end;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
xScsNode := ScsModelTree.Items.AddChild(CadListNode, xConn.FName);
|
||||
xScsNode.Data := xConn;
|
||||
xScsNode.ImageIndex := 3;
|
||||
xScsNode.SelectedIndex := xScsNode.ImageIndex;
|
||||
xConn.FFace.FTreeNode := xScsNode;
|
||||
//Tolik 15/10/2018 --
|
||||
// if xConn.F3dModelFileName <> '' then
|
||||
xConn.FFace.F3DObject := xConn;
|
||||
end;
|
||||
end;
|
||||
if TObject(frm3d.F3DModel.FScsObjects[i]) is T3DLine then
|
||||
begin
|
||||
xLine := T3DLine(frm3d.F3DModel.FScsObjects[i]);
|
||||
if (xLine.FListID <> FCAD.FCADListID) then
|
||||
Continue;
|
||||
xScsNode:= ScsModelTree.Items.AddChild(CadListNode, xLine.FName);
|
||||
xScsNode.Data := xLine;
|
||||
xScsNode.ImageIndex := 2;
|
||||
xScsNode.SelectedIndex := xScsNode.ImageIndex;
|
||||
xLine.FFace.FTreeNode := xScsNode;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
//3D
|
||||
UpdateFaces(FaceList);
|
||||
|
||||
GCadForm := SavedGCadForm;
|
||||
end;
|
||||
//
|
||||
begin
|
||||
//if not GLSceneViewer.Focused then
|
||||
//begin
|
||||
@ -12606,6 +13138,7 @@ begin
|
||||
if CTrlDown then
|
||||
MoveDelta := 0.1;
|
||||
|
||||
|
||||
if FMode = F3DFirstPerson then
|
||||
begin
|
||||
case klPress of
|
||||
@ -12882,6 +13415,52 @@ begin
|
||||
//MovedConn: T3DConnector;
|
||||
//MovedComponent: T3DComponent;
|
||||
|
||||
//Tolik 17/06/2025 -- åñëè çàæàòî è SHIFT è CTRL òî ïðîáóåì ñîçäàòü íîâûé îáúåêò
|
||||
//(ïîêà ÷òî, åñëè âûáðàíà òðàññà èëè òðóáà)
|
||||
if (shiftDown and CTrlDown) then
|
||||
begin
|
||||
if FSelection.Count = 1 then
|
||||
begin
|
||||
//âûáðàííûé îáúåêò äîëæåí áûòü òîëüêî îäèí
|
||||
glObject := TGLFreeForm(FSelection[0]);
|
||||
LineToMove := nil;
|
||||
//åñëè âûáðàíà òðóáà
|
||||
if TObject(TTreeNode(glObject.tagObject).Data).ClassName = 'T3DLineComponent' then
|
||||
begin //ïîêà áåç ïðîâåðêè
|
||||
ParentNode := TTreeNode(glObject.tagObject).Parent;
|
||||
while ParentNode <> nil do
|
||||
begin
|
||||
if TObject(ParentNode.data).ClassName = 'T3DLine' then
|
||||
begin
|
||||
LineToMove := T3dLine(ParentNode.Data);
|
||||
ParentNode := nil;
|
||||
end
|
||||
else
|
||||
ParentNode := ParentNode.Parent;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin //åñëè âûáðàíà òðàññà
|
||||
if TObject(TTreeNode(glObject.tagObject).Data).ClassName = 'T3DLine' then
|
||||
LineToMove := T3dLine(TTreeNode(glObject.tagObject).Data);
|
||||
end;
|
||||
if LineToMove <> nil then
|
||||
begin
|
||||
if LineToMove.FSCSObject <> nil then
|
||||
begin
|
||||
if LineToMove.FSCSObject.ClassNAme = ctOrtholine then
|
||||
begin
|
||||
dp1.x := ((dp.x*0.25)/factor)*10;
|
||||
dp1.y := ((dp.y*0.25)/factor);
|
||||
dp1.z := ((dp.z*0.25)/factor)*10;
|
||||
CreateNewSCSLineOnMove(dp1, LineToMove);
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
//
|
||||
if TglBaseSceneObject(FSelection[0]).TagObject <> nil then
|
||||
begin
|
||||
currNode := TTreeNode(TglBaseSceneObject(FSelection[0]).TagObject);
|
||||
|
||||
@ -5874,9 +5874,6 @@ begin
|
||||
FScsObjects.free;
|
||||
//
|
||||
|
||||
|
||||
|
||||
|
||||
FGroupNet := nil;
|
||||
FHashs.free;
|
||||
F3DSHashs.free;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
object F_CAD: TF_CAD
|
||||
Left = 274
|
||||
Top = 261
|
||||
Left = 254
|
||||
Top = 27
|
||||
Margins.Left = 0
|
||||
Margins.Top = 0
|
||||
Margins.Right = 0
|
||||
|
||||
@ -1754,6 +1754,7 @@
|
||||
cMakeEditComponentType_Msg7 = 'Îïèñ';
|
||||
cMakeEditComponentType_Msg8 = 'Ïåðåä òèì, ÿê çàäàòè øàáëîí, íåîáõ³äíî âèçíà÷èòè ñèñòåìíå ³ì'+''''+'ÿ';
|
||||
cMakeEditComponentType_Msg9 = 'Âèñîòà ðîçì³ùåííÿ êîìïîíåíò³â';
|
||||
cMakeEditComponentType_Msg10 = 'Ëîòîê ïðîâîëî÷íèé';
|
||||
|
||||
//------------------------------
|
||||
cMakeEditCrossConnection_Msg1_1 = 'Ïî êàáåëÿì';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user