From d8d34552e957bb71c42d8cb1b81813be93b7a991 Mon Sep 17 00:00:00 2001 From: SaraP Date: Thu, 29 Jan 2026 12:25:25 +0100 Subject: [PATCH] DataWindow : - pezzi con dimensioni variabili ( prima versione). --- Designing/Main.lua | 311 +++--- Designing/WinConst.lua | 3 +- Designing/WinLib/WinCalculate.lua | 1442 ++++++++++++++----------- Designing/WinLib/WinCreate.lua | 152 +-- Designing/WinLib/WinManageProject.lua | 33 +- 5 files changed, 1045 insertions(+), 896 deletions(-) diff --git a/Designing/Main.lua b/Designing/Main.lua index c6c3d6d..1b94f20 100644 --- a/Designing/Main.lua +++ b/Designing/Main.lua @@ -47,12 +47,14 @@ local SashJointType = WIN_JNT.FULL_V local vFrameJoints = { FrameJointType, FrameJointType, FrameJointType, FrameJointType} local vSashJoints = { SashJointType, SashJointType, SashJointType, SashJointType} +local dFrameDim = 78 +local dSashDim = 78 +local vFrameDims = { dFrameDim, dFrameDim, dFrameDim, dFrameDim} +local vSashDims = { dSashDim, dSashDim, dSashDim, dSashDim} local sProfilePath = 'C:\\EgtData\\EgtWindowMaker\\Profiles\\Profilo78.nge' --- local sProfilePath = 'C:\\EgtData\\EgtWindowMaker\\Profiles\\CambioProfilo.nge' -- local sProfilePath = 'C:\\EgtData\\EgtWindowMaker\\Profiles\\ProfiloSaomad.nge' --- local sProfilePath = 'C:\\EgtData\\EgtWindowMaker\\Profiles\\AlzanteScorrevole.nge' ------------------------------------------- ************** ------------------------------------------- @@ -65,15 +67,15 @@ WinCreate.ImportProfile( sProfilePath) -- creo telaio -local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, vFrameJoints, { WindowWidth, WindowHeight}) --- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.CHAMFER_SIDE, vFrameJoints, { WindowWidth, WindowHeight, WindowHeight + 800}) --- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.CHAMFER_SIDE, vFrameJoints, { WindowWidth, WindowHeight + 500, WindowHeight}) --- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.ROUND_ARC, vFrameJoints, WindowWidth, WindowHeight) --- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.SEGMENTAL_ARC, { FrameJointType, FrameJointType, FrameJointType, FrameJointType}, { 1500, 1800, 2200}) --- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.CHAMFER, { FrameJointType, FrameJointType, FrameJointType, FrameJointType, FrameJointType}, { WindowWidth, WindowHeight, WindowHeight + 500}) --- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.POINTED_ARC, { FrameJointType, FrameJointType, FrameJointType, FrameJointType, FrameJointType}, { 1500, 1500, 2400}) --- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.TRG, { FrameJointType, FrameJointType, FrameJointType}, { 1500, 1500, 500}) --- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.THREE_CENTER_ARC, { FrameJointType, FrameJointType, WIN_JNT.ANGLED, WIN_JNT.ANGLED, WIN_JNT.ANGLED, WIN_JNT.ANGLED}, { 1500, 1500, 1800, 200}) +local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, { WindowWidth, WindowHeight}, vFrameJoints, vFrameDims) +-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.CHAMFER_SIDE, { WindowWidth, WindowHeight, WindowHeight + 800}, vFrameJoints, vFrameDims) +-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.CHAMFER_SIDE, { WindowWidth, WindowHeight + 500, WindowHeight}, vFrameJoints, vFrameDims) +-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.ROUND_ARC, { WindowWidth, WindowHeight}, vFrameJoints, vFrameDims) +-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.SEGMENTAL_ARC, { 1500, 1800, 2200}, vFrameJoints, vFrameDims) +-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.CHAMFER, { WindowWidth, WindowHeight, WindowHeight + 500}, vFrameJoints, { dFrameDim, dFrameDim, dFrameDim, dFrameDim, dFrameDim}) +-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.POINTED_ARC, { 1500, 1500, 2400}, vFrameJoints, { dFrameDim, dFrameDim, dFrameDim, dFrameDim, dFrameDim}) +-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.TRG, { 1500, 1500, 500}, { FrameJointType, FrameJointType, FrameJointType}, { dFrameDim, dFrameDim, dFrameDim}) +-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.THREE_CENTER_ARC, { 1500, 1500, 1800, 200}, vFrameJoints, { dFrameDim, dFrameDim, dFrameDim, dFrameDim, dFrameDim, dFrameDim}) @@ -81,7 +83,7 @@ local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, vFrameJoints, { Wi -- WinCreate.AddGridSplits( nFrameId, { WIN_MEASURE.ABSOLUTE, WIN_MEASURE.ABSOLUTE, WIN_MEASURE.ABSOLUTE, WIN_MEASURE.ABSOLUTE}, { 150, 300, 150, 300}, -- { WIN_MEASURE.ABSOLUTE, WIN_MEASURE.ABSOLUTE, WIN_MEASURE.ABSOLUTE}, { 500, 600, 850}, false) --- WinCreate.AddGridSplits( nFrameId, { WIN_MEASURE.PERCENTAGE}, { 15}, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 50, 30}, false) +-- WinCreate.AddGridSplits( nFrameId, { WIN_MEASURE.PERCENTAGE}, { 25}, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 50, 30}, false) -- WinCreate.AddGridSplits( nFrameId, { WIN_MEASURE.PROPORTIONAL, WIN_MEASURE.PROPORTIONAL, WIN_MEASURE.PROPORTIONAL, WIN_MEASURE.PROPORTIONAL, WIN_MEASURE.PROPORTIONAL}, { 1, 4, 1, 2, 1}, -- { WIN_MEASURE.PROPORTIONAL, WIN_MEASURE.PROPORTIONAL, WIN_MEASURE.PROPORTIONAL, WIN_MEASURE.PROPORTIONAL, WIN_MEASURE.PROPORTIONAL}, { 1, 2, 1, 2, 1}, false) -- WinCreate.AddGridSplits( nFrameId, { WIN_MEASURE.PROPORTIONAL, WIN_MEASURE.PROPORTIONAL, WIN_MEASURE.ABSOLUTE}, { 2, 1, 200}, @@ -91,41 +93,41 @@ local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, vFrameJoints, { Wi ------------------------ Cambi profilo ------------------------ -- vetro / anta --- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 50}) +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 120}) -- WinCreate.AddFill( vAreas[1], WIN_FILLTYPES.GLASS) --- local nSashId = WinCreate.AddSash( vAreas[2], vSashJoints, WIN_OPENING_TYPES.TILTTURN_RIGHT) +-- local nSashId = WinCreate.AddSash( vAreas[2], vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_RIGHT) -- WinCreate.AddFill( nSashId, WIN_FILLTYPES.GLASS) -- vetro / anta in orizzontale --- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 50}) --- local nSashId = WinCreate.AddSash( vAreas[1], vSashJoints, WIN_OPENING_TYPES.TILTTURN_LEFT) +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 120}) +-- local nSashId = WinCreate.AddSash( vAreas[1], vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_LEFT) -- WinCreate.AddFill( nSashId, WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vAreas[2], WIN_FILLTYPES.GLASS) -- anta / vetro -- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 50}) --- local nSashId = WinCreate.AddSash( vAreas[1], vSashJoints, WIN_OPENING_TYPES.TILTTURN_LEFT) +-- local nSashId = WinCreate.AddSash( vAreas[1], vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_LEFT) -- WinCreate.AddFill( nSashId, WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vAreas[2], WIN_FILLTYPES.GLASS) -- vetro / anta / vetro --- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 33, 33}) +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 33.333, 33.333}, { 90, 120}) -- WinCreate.AddFill( vAreas[1], WIN_FILLTYPES.GLASS) --- local nSashId = WinCreate.AddSash( vAreas[2], vSashJoints) +-- local nSashId = WinCreate.AddSash( vAreas[2], vSashJoints, vSashDims) -- WinCreate.AddFill( nSashId, WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vAreas[3], WIN_FILLTYPES.GLASS) -- vetro / anta / anta -- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 33, 33}) -- WinCreate.AddFill( vAreas[1], WIN_FILLTYPES.GLASS) --- local nSashId1 = WinCreate.AddSash( vAreas[2], vSashJoints) --- local nSashId2 = WinCreate.AddSash( vAreas[3], vSashJoints) +-- local nSashId1 = WinCreate.AddSash( vAreas[2], vSashJoints, vSashDims) +-- local nSashId2 = WinCreate.AddSash( vAreas[3], vSashJoints, vSashDims) -- WinCreate.AddFill( nSashId1, WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( nSashId2, WIN_FILLTYPES.GLASS) -- anta battente / anta ricevente / vetro --- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 66}) --- local vSashes = WinCreate.AddSashGroup( vAreas[1], { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { WIN_SASHTYPES.ACTIVE, WIN_SASHTYPES.INACTIVE}, +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 66}, { 90}) +-- local vSashes = WinCreate.AddSashGroup( vAreas[1], { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { vSashDims, vSashDims}, { WIN_SASHTYPES.ACTIVE, WIN_SASHTYPES.INACTIVE}, -- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT}) -- WinCreate.AddFill( vSashes[1], WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vSashes[2], WIN_FILLTYPES.GLASS) @@ -143,45 +145,45 @@ local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, vFrameJoints, { Wi -- WinCreate.AddFill( nSashId2, WIN_FILLTYPES.GLASS) -- vetro / anta / vetro / anta (2) --- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 25, 25, 25}) +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 25, 25, 25}, { 90, 120, 90}) -- WinCreate.AddFill( vAreas[1], WIN_FILLTYPES.GLASS) --- local nSashId1 = WinCreate.AddSash( vAreas[2], vSashJoints) +-- local nSashId1 = WinCreate.AddSash( vAreas[2], vSashJoints, vSashDims) -- WinCreate.AddFill( nSashId1, WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vAreas[3], WIN_FILLTYPES.GLASS) --- local nSashId2 = WinCreate.AddSash( vAreas[4], vSashJoints) +-- local nSashId2 = WinCreate.AddSash( vAreas[4], vSashJoints, vSashDims) -- WinCreate.AddFill( nSashId2, WIN_FILLTYPES.GLASS) -- vetro / vetro / anta / anta --- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 25, 25, 25}) +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 25, 25, 25}, { 90, 90, 90}) -- WinCreate.AddFill( vAreas[1], WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vAreas[2], WIN_FILLTYPES.GLASS) --- local nSashId1 = WinCreate.AddSash( vAreas[3], vSashJoints) +-- local nSashId1 = WinCreate.AddSash( vAreas[3], vSashJoints, vSashDims) -- WinCreate.AddFill( nSashId1, WIN_FILLTYPES.GLASS) --- local nSashId2 = WinCreate.AddSash( vAreas[4], vSashJoints) +-- local nSashId2 = WinCreate.AddSash( vAreas[4], vSashJoints, vSashDims) -- WinCreate.AddFill( nSashId2, WIN_FILLTYPES.GLASS) -- anta / vetro con split --- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 50}) --- local nSashId = WinCreate.AddSash( vAreas[1], vSashJoints) +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 90}) +-- local nSashId = WinCreate.AddSash( vAreas[1], vSashJoints, vSashDims) -- WinCreate.AddFill( nSashId, WIN_FILLTYPES.GLASS) --- local vAreas2 = WinCreate.AddSplits( vAreas[2], WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 50}) +-- local vAreas2 = WinCreate.AddSplits( vAreas[2], WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 60}) -- WinCreate.AddFill( vAreas2[1], WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vAreas2[2], WIN_FILLTYPES.GLASS) -- anta con split / vetro --- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 50}) --- local nSashId = WinCreate.AddSash( vAreas[1], vSashJoints) --- local vAreasSash = WinCreate.AddSplits( nSashId, WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 50}) +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 90}) +-- local nSashId = WinCreate.AddSash( vAreas[1], vSashJoints, vSashDims) +-- local vAreasSash = WinCreate.AddSplits( nSashId, WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 80}) -- WinCreate.AddFill( vAreasSash[1], WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vAreasSash[2], WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vAreas[2], WIN_FILLTYPES.GLASS) -- ante ( divise da split orizzontale) / vetro --- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 50}) --- local vAreas2 = WinCreate.AddSplits( vAreas[1], WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 30}) --- local nSashId1 = WinCreate.AddSash( vAreas2[1], vSashJoints) +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 90}) +-- local vAreas2 = WinCreate.AddSplits( vAreas[1], WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 30}, { 95}) +-- local nSashId1 = WinCreate.AddSash( vAreas2[1], vSashJoints, vSashDims) -- WinCreate.AddFill( nSashId1, WIN_FILLTYPES.GLASS) --- local nSashId2 = WinCreate.AddSash( vAreas2[2], vSashJoints) +-- local nSashId2 = WinCreate.AddSash( vAreas2[2], vSashJoints, vSashDims) -- WinCreate.AddFill( nSashId2, WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vAreas[2], WIN_FILLTYPES.GLASS) @@ -189,45 +191,48 @@ local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, vFrameJoints, { Wi ------------------------ Alzante Scorrevole ------------------------ +-- vFrameDims = { 55, 55, 55, 55} +-- vSashDims = { 135, 80, 80, 80} +-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, { WindowWidth, WindowHeight}, vFrameJoints, vFrameDims) -- WinCreate.AddThreshold( nFrameId, 'Threshold') -- anta mobile a sx --- local vSash = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { WIN_SASHTYPES.SLIDE_MOVABLE, WIN_SASHTYPES.SLIDE_FIXED}, --- { WIN_OPENING_TYPES.COPLANARSLIDE_RIGHT, WIN_OPENING_TYPES.FIXED}) +-- local vSash = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { vSashDims, vSashDims}, +-- { WIN_SASHTYPES.SLIDE_MOVABLE, WIN_SASHTYPES.SLIDE_FIXED}, { WIN_OPENING_TYPES.COPLANARSLIDE_RIGHT, WIN_OPENING_TYPES.FIXED}) -- WinCreate.AddFill( vSash[1], WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vSash[2], WIN_FILLTYPES.GLASS) -- local nSashGrpId = EgtGetParent( vSash[1]) -- WinCreate.AddHardware( nSashGrpId, '000592', 'Sx') -- anta mobile a dx --- local vSash = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { WIN_SASHTYPES.SLIDE_FIXED, WIN_SASHTYPES.SLIDE_MOVABLE}, --- { WIN_OPENING_TYPES.FIXED, WIN_OPENING_TYPES.COPLANARSLIDE_LEFT}) +-- local vSash = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { vSashDims, vSashDims}, +-- { WIN_SASHTYPES.SLIDE_FIXED, WIN_SASHTYPES.SLIDE_MOVABLE}, { WIN_OPENING_TYPES.FIXED, WIN_OPENING_TYPES.COPLANARSLIDE_LEFT}) -- WinCreate.AddFill( vSash[1], WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vSash[2], WIN_FILLTYPES.GLASS) -- local nSashGrpId = EgtGetParent( vSash[1]) -- WinCreate.AddHardware( nSashGrpId, '000592', 'Dx') -- 2 ante mobili, sx davanti --- local vSash = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { WIN_SASHTYPES.SLIDE_MOVABLE, WIN_SASHTYPES.SLIDE_MOVABLE_BACK}, --- { WIN_OPENING_TYPES.COPLANARSLIDE_RIGHT, WIN_OPENING_TYPES.COPLANARSLIDE_LEFT}) +-- local vSash = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { vSashDims, vSashDims}, +-- { WIN_SASHTYPES.SLIDE_MOVABLE, WIN_SASHTYPES.SLIDE_MOVABLE_BACK}, { WIN_OPENING_TYPES.COPLANARSLIDE_RIGHT, WIN_OPENING_TYPES.COPLANARSLIDE_LEFT}) -- WinCreate.AddFill( vSash[1], WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vSash[2], WIN_FILLTYPES.GLASS) -- local nSashGrpId = EgtGetParent( vSash[1]) -- WinCreate.AddHardware( nSashGrpId, '000593', 'Sx') -- 2 ante mobili, dx davanti --- local vSash = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { WIN_SASHTYPES.SLIDE_MOVABLE_BACK, WIN_SASHTYPES.SLIDE_MOVABLE}, --- { WIN_OPENING_TYPES.COPLANARSLIDE_RIGHT, WIN_OPENING_TYPES.COPLANARSLIDE_LEFT}) +-- local vSash = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { vSashDims, vSashDims}, +-- { WIN_SASHTYPES.SLIDE_MOVABLE_BACK, WIN_SASHTYPES.SLIDE_MOVABLE}, { WIN_OPENING_TYPES.COPLANARSLIDE_RIGHT, WIN_OPENING_TYPES.COPLANARSLIDE_LEFT}) -- WinCreate.AddFill( vSash[1], WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vSash[2], WIN_FILLTYPES.GLASS) -- local nSashGrpId = EgtGetParent( vSash[1]) -- WinCreate.AddHardware( nSashGrpId, '000593', 'Dx') -- 4 ante, le centrali sono mobili --- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, vFrameJoints, { 4500, 2100}) +-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, { 4500, 2100}, vFrameJoints, vFrameDims) -- -- WinCreate.AddThreshold( nFrameId, 'Threshold') -- local vSash = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 25, 25, 25}, --- { vSashJoints, vSashJoints, vSashJoints, vSashJoints}, +-- { vSashJoints, vSashJoints, vSashJoints, vSashJoints}, { vSashDims, vSashDims, vSashDims, vSashDims}, -- { WIN_SASHTYPES.SLIDE_FIXED, WIN_SASHTYPES.SLIDE_MOVABLE, WIN_SASHTYPES.SLIDE_MOVABLE, WIN_SASHTYPES.SLIDE_FIXED}, -- { WIN_OPENING_TYPES.FIXED, WIN_OPENING_TYPES.COPLANARSLIDE_LEFT, WIN_OPENING_TYPES.COPLANARSLIDE_RIGHT, WIN_OPENING_TYPES.FIXED}) -- WinCreate.AddFill( vSash[1], WIN_FILLTYPES.GLASS) @@ -238,10 +243,10 @@ local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, vFrameJoints, { Wi -- WinCreate.AddHardware( nSashGrpId, '000594', 'Dx') -- 4 ante mobili --- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, vFrameJoints, { 4500, 2100}) +-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, { 4500, 2100}, vFrameJoints, vFrameDims) -- -- WinCreate.AddThreshold( nFrameId, 'Threshold') -- local vSash = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 25, 25, 25}, --- { vSashJoints, vSashJoints, vSashJoints, vSashJoints}, +-- { vSashJoints, vSashJoints, vSashJoints, vSashJoints}, { vSashDims, vSashDims, vSashDims, vSashDims}, -- { WIN_SASHTYPES.SLIDE_MOVABLE_BACK, WIN_SASHTYPES.SLIDE_MOVABLE, WIN_SASHTYPES.SLIDE_MOVABLE, WIN_SASHTYPES.SLIDE_MOVABLE_BACK}, -- { WIN_OPENING_TYPES.COPLANARSLIDE_RIGHT, WIN_OPENING_TYPES.COPLANARSLIDE_LEFT, WIN_OPENING_TYPES.COPLANARSLIDE_RIGHT, WIN_OPENING_TYPES.COPLANARSLIDE_LEFT}) -- WinCreate.AddFill( vSash[1], WIN_FILLTYPES.GLASS) @@ -256,21 +261,21 @@ local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, vFrameJoints, { Wi ------------------------ Finestre vetro fisso ------------------------ -- standard --- WinCreate.AddBottomRail( nFrameId, 2) +-- WinCreate.AddBottomRail( nFrameId, 2, { 90, 78}) -- WinCreate.AddFill( nFrameId, WIN_FILLTYPES.GLASS) -- divisione orizzontale / verticale -- WinCreate.AddBottomRail( nFrameId, 2) --- -- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 70}) --- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 70}) +-- -- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 70}, { 60}) +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 70}, { 60}) -- WinCreate.AddFill( vAreas[1], WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vAreas[2], WIN_FILLTYPES.GLASS) -- divisione verticale ed orizzontale (1) --- WinCreate.AddBottomRail( nFrameId, 1) --- local vAreas1 = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 50}) --- local vAreas2 = WinCreate.AddSplits( vAreas1[1], WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 50}) --- local vAreas3 = WinCreate.AddSplits( vAreas1[2], WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 50}) +-- WinCreate.AddBottomRail( nFrameId, 1, { 60}) +-- local vAreas1 = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 100}) +-- local vAreas2 = WinCreate.AddSplits( vAreas1[1], WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 60}) +-- local vAreas3 = WinCreate.AddSplits( vAreas1[2], WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 60}) -- WinCreate.AddFill( vAreas2[1], WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vAreas2[2], WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vAreas3[1], WIN_FILLTYPES.GLASS) @@ -278,7 +283,7 @@ local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, vFrameJoints, { Wi -- divisione verticale ed orizzontale (2) -- WinCreate.AddBottomRail( nFrameId, 1) --- local vAreas = WinCreate.AddGridSplits( nFrameId, { WIN_MEASURE.PERCENTAGE}, { 50}, { WIN_MEASURE.PERCENTAGE}, { 50}, true) +-- local vAreas = WinCreate.AddGridSplits( nFrameId, { WIN_MEASURE.PERCENTAGE}, { 50}, { WIN_MEASURE.PERCENTAGE}, { 50}, true, { 100, 60, 60}) -- WinCreate.AddFill( vAreas[1], WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vAreas[2], WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vAreas[3], WIN_FILLTYPES.GLASS) @@ -289,23 +294,23 @@ local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, vFrameJoints, { Wi ------------------------ Finestre con anta singola ------------------------ -- standard --- local nSashId = WinCreate.AddSash( nFrameId, vSashJoints, WIN_OPENING_TYPES.TILTTURN_LEFT) --- WinCreate.AddBottomRail( nSashId, 2) +-- local nSashId = WinCreate.AddSash( nFrameId, vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_LEFT) +-- WinCreate.AddBottomRail( nSashId, 2, { 90, 60}) -- WinCreate.AddFill( nSashId, WIN_FILLTYPES.GLASS) -- divisione orizzontale / verticale --- local nSashId = WinCreate.AddSash( nFrameId, vSashJoints, WIN_OPENING_TYPES.TILTTURN_LEFT) --- WinCreate.AddBottomRail( nSashId, 1) +-- local nSashId = WinCreate.AddSash( nFrameId, vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_LEFT) +-- WinCreate.AddBottomRail( nSashId, 1, { 100}) -- -- local vAreas = WinCreate.AddSplits( nSashId, WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 50}) -- local vAreas = WinCreate.AddSplits( nSashId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 50}) -- WinCreate.AddFill( vAreas[1], WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vAreas[2], WIN_FILLTYPES.GLASS) -- divisione verticale e orizzontale --- local nSashId = WinCreate.AddSash( nFrameId, vSashJoints, WIN_OPENING_TYPES.TILTTURN_LEFT) --- local vAreas1 = WinCreate.AddSplits( nSashId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 50}) --- local vAreas2 = WinCreate.AddSplits( vAreas1[1], WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 50}) --- local vAreas3 = WinCreate.AddSplits( vAreas1[2], WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 50}) +-- local nSashId = WinCreate.AddSash( nFrameId, vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_LEFT) +-- local vAreas1 = WinCreate.AddSplits( nSashId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 100}) +-- local vAreas2 = WinCreate.AddSplits( vAreas1[1], WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 60}) +-- local vAreas3 = WinCreate.AddSplits( vAreas1[2], WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 60}) -- WinCreate.AddFill( vAreas2[1], WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vAreas2[2], WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vAreas3[1], WIN_FILLTYPES.GLASS) @@ -316,70 +321,70 @@ local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, vFrameJoints, { Wi ------------------------ Finestre con più ante singole ------------------------ -- due ante divisione verticale --- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 50}) --- local nSash1Id = WinCreate.AddSash( vAreas[1], vSashJoints, WIN_OPENING_TYPES.TILTTURN_LEFT) +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 120}) +-- local nSash1Id = WinCreate.AddSash( vAreas[1], vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_LEFT) -- WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS) --- local nSash2Id = WinCreate.AddSash( vAreas[2], vSashJoints, WIN_OPENING_TYPES.TILTTURN_RIGHT) +-- local nSash2Id = WinCreate.AddSash( vAreas[2], vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_RIGHT) -- WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS) -- due ante divisione orizzontale --- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 50}) --- local nSash1Id = WinCreate.AddSash( vAreas[1], vSashJoints, WIN_OPENING_TYPES.TILTONLY_TOP) +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 120}) +-- local nSash1Id = WinCreate.AddSash( vAreas[1], vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTONLY_TOP) -- WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS) --- local nSash2Id = WinCreate.AddSash( vAreas[2], vSashJoints, WIN_OPENING_TYPES.TILTONLY_TOP) +-- local nSash2Id = WinCreate.AddSash( vAreas[2], vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTONLY_TOP) -- WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS) -- tre ante --- -- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.ABSOLUTE, WIN_MEASURE.ABSOLUTE}, { WindowWidth / 3, WindowWidth / 3}) --- -- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PROPORTIONAL, WIN_MEASURE.PROPORTIONAL, WIN_MEASURE.PROPORTIONAL}, { 1, 1, 1}) --- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 33, 33}) --- local nSash1Id = WinCreate.AddSash( vAreas[1], vSashJoints) +-- -- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.ABSOLUTE, WIN_MEASURE.ABSOLUTE}, { WindowWidth / 3, WindowWidth / 3}, { 95, 95}) +-- -- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PROPORTIONAL, WIN_MEASURE.PROPORTIONAL, WIN_MEASURE.PROPORTIONAL}, { 1, 1, 1}, { 95, 95}) +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 33.333, 33.333}, { 95, 95}) +-- local nSash1Id = WinCreate.AddSash( vAreas[1], vSashJoints, vSashDims) -- WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS) --- local nSash2Id = WinCreate.AddSash( vAreas[2], vSashJoints) +-- local nSash2Id = WinCreate.AddSash( vAreas[2], vSashJoints, vSashDims) -- WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS) --- local nSash3Id = WinCreate.AddSash( vAreas[3], vSashJoints) +-- local nSash3Id = WinCreate.AddSash( vAreas[3], vSashJoints, vSashDims) -- WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS) -- tre ante una sopra e due sotto --- local vAreas1 = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 50}) --- local vAreas2 = WinCreate.AddSplits( vAreas1[2], WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 50}) --- local nSash1Id = WinCreate.AddSash( vAreas1[1], vSashJoints, WIN_OPENING_TYPES.FIXED) +-- local vAreas1 = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 115}) +-- local vAreas2 = WinCreate.AddSplits( vAreas1[2], WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 95}) +-- local nSash1Id = WinCreate.AddSash( vAreas1[1], vSashJoints, vSashDims, WIN_OPENING_TYPES.FIXED) -- WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS) --- local nSash2Id = WinCreate.AddSash( vAreas2[1], vSashJoints, WIN_OPENING_TYPES.TILTTURN_LEFT) +-- local nSash2Id = WinCreate.AddSash( vAreas2[1], vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_LEFT) -- WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS) --- local nSash3Id = WinCreate.AddSash( vAreas2[2], vSashJoints, WIN_OPENING_TYPES.TILTTURN_RIGHT) +-- local nSash3Id = WinCreate.AddSash( vAreas2[2], vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_RIGHT) -- WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS) -- sei ante (1) --- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 50}) --- local vAreas1 = WinCreate.AddSplits( vAreas[1], WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 33, 33}) --- local vAreas2 = WinCreate.AddSplits( vAreas[2], WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 33, 33}) --- local nSash1Id = WinCreate.AddSash( vAreas1[1], vSashJoints) +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 105}) +-- local vAreas1 = WinCreate.AddSplits( vAreas[1], WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 33.333, 33.333}, { 95, 95}) +-- local vAreas2 = WinCreate.AddSplits( vAreas[2], WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 33.333, 33.333}, { 95, 95}) +-- local nSash1Id = WinCreate.AddSash( vAreas1[1], vSashJoints, vSashDims) -- WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS) --- local nSash2Id = WinCreate.AddSash( vAreas1[2], vSashJoints) +-- local nSash2Id = WinCreate.AddSash( vAreas1[2], vSashJoints, vSashDims) -- WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS) --- local nSash3Id = WinCreate.AddSash( vAreas1[3], vSashJoints) +-- local nSash3Id = WinCreate.AddSash( vAreas1[3], vSashJoints, vSashDims) -- WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS) --- local nSash4Id = WinCreate.AddSash( vAreas2[1], vSashJoints) +-- local nSash4Id = WinCreate.AddSash( vAreas2[1], vSashJoints, vSashDims) -- WinCreate.AddFill( nSash4Id, WIN_FILLTYPES.GLASS) --- local nSash5Id = WinCreate.AddSash( vAreas2[2], vSashJoints) +-- local nSash5Id = WinCreate.AddSash( vAreas2[2], vSashJoints, vSashDims) -- WinCreate.AddFill( nSash5Id, WIN_FILLTYPES.GLASS) --- local nSash6Id = WinCreate.AddSash( vAreas2[3], vSashJoints) +-- local nSash6Id = WinCreate.AddSash( vAreas2[3], vSashJoints, vSashDims) -- WinCreate.AddFill( nSash6Id, WIN_FILLTYPES.GLASS) -- sei ante (2) --- local vAreas = WinCreate.AddGridSplits( nFrameId, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 33, 33}, { WIN_MEASURE.PERCENTAGE}, { 50}, false) --- local nSash1Id = WinCreate.AddSash( vAreas[1], vSashJoints) +-- local vAreas = WinCreate.AddGridSplits( nFrameId, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 33.333, 33.333}, { WIN_MEASURE.PERCENTAGE}, { 50}, false, { 120, 100, 85, 100, 85}) +-- local nSash1Id = WinCreate.AddSash( vAreas[1], vSashJoints, vSashDims) -- WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS) --- local nSash2Id = WinCreate.AddSash( vAreas[2], vSashJoints) +-- local nSash2Id = WinCreate.AddSash( vAreas[2], vSashJoints, vSashDims) -- WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS) --- local nSash3Id = WinCreate.AddSash( vAreas[3], vSashJoints) +-- local nSash3Id = WinCreate.AddSash( vAreas[3], vSashJoints, vSashDims) -- WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS) --- local nSash4Id = WinCreate.AddSash( vAreas[4], vSashJoints) +-- local nSash4Id = WinCreate.AddSash( vAreas[4], vSashJoints, vSashDims) -- WinCreate.AddFill( nSash4Id, WIN_FILLTYPES.GLASS) --- local nSash5Id = WinCreate.AddSash( vAreas[5], vSashJoints) +-- local nSash5Id = WinCreate.AddSash( vAreas[5], vSashJoints, vSashDims) -- WinCreate.AddFill( nSash5Id, WIN_FILLTYPES.GLASS) --- local nSash6Id = WinCreate.AddSash( vAreas[6], vSashJoints) +-- local nSash6Id = WinCreate.AddSash( vAreas[6], vSashJoints, vSashDims) -- WinCreate.AddFill( nSash6Id, WIN_FILLTYPES.GLASS) @@ -387,13 +392,13 @@ local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, vFrameJoints, { Wi ------------------------ Finestre con ante battenti e riceventi ------------------------ -- battente / ricevente --- local vSashes = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { WIN_SASHTYPES.ACTIVE, WIN_SASHTYPES.INACTIVE}, +-- local vSashes = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { vSashDims, vSashDims}, { WIN_SASHTYPES.ACTIVE, WIN_SASHTYPES.INACTIVE}, -- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT}) -- WinCreate.AddFill( vSashes[1], WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vSashes[2], WIN_FILLTYPES.GLASS) -- battente / ricevente / ricevente --- local vSashes = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 33, 33}, { vSashJoints, vSashJoints, vSashJoints}, +-- local vSashes = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 33.333, 33.333}, { vSashJoints, vSashJoints, vSashJoints}, { vSashDims, vSashDims, vSashDims}, -- { WIN_SASHTYPES.ACTIVE, WIN_SASHTYPES.INACTIVE_IN, WIN_SASHTYPES.INACTIVE_OUT}, -- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT, WIN_OPENING_TYPES.TURNONLY_RIGHT}) -- WinCreate.AddFill( vSashes[1], WIN_FILLTYPES.GLASS) @@ -401,7 +406,7 @@ local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, vFrameJoints, { Wi -- WinCreate.AddFill( vSashes[3], WIN_FILLTYPES.GLASS) -- battente / battente / ricevente --- local vSashes = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 33, 33}, { vSashJoints, vSashJoints, vSashJoints}, +-- local vSashes = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 33.333, 33.333}, { vSashJoints, vSashJoints, vSashJoints}, { vSashDims, vSashDims, vSashDims}, -- { WIN_SASHTYPES.ACTIVE_OUT, WIN_SASHTYPES.ACTIVE_IN, WIN_SASHTYPES.INACTIVE}, -- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT}) -- WinCreate.AddFill( vSashes[1], WIN_FILLTYPES.GLASS) @@ -410,7 +415,7 @@ local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, vFrameJoints, { Wi -- battente / battente / ricevente / ricevente -- local vSashes = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PROPORTIONAL, WIN_MEASURE.PROPORTIONAL, WIN_MEASURE.PROPORTIONAL, WIN_MEASURE.PROPORTIONAL}, { 1, 1, 1, 1}, --- { vSashJoints, vSashJoints, vSashJoints, vSashJoints}, +-- { vSashJoints, vSashJoints, vSashJoints, vSashJoints}, { vSashDims, vSashDims, vSashDims, vSashDims}, -- { WIN_SASHTYPES.ACTIVE_OUT, WIN_SASHTYPES.ACTIVE_IN, WIN_SASHTYPES.INACTIVE_IN, WIN_SASHTYPES.INACTIVE_OUT}, -- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT, WIN_OPENING_TYPES.TURNONLY_RIGHT}) -- WinCreate.AddFill( vSashes[1], WIN_FILLTYPES.GLASS) @@ -423,64 +428,63 @@ local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, vFrameJoints, { Wi ------------------------ Finestre con ante singole e ante battenti/riceventi ------------------------ -- tre ante : singola / ricevente / battente --- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 33}) --- local nSash1Id = WinCreate.AddSash( vAreas[1], vSashJoints, WIN_OPENING_TYPES.TILTTURN_LEFT) +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 33}, { 115}) +-- local nSash1Id = WinCreate.AddSash( vAreas[1], vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_LEFT) -- WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS) --- local vSashes = WinCreate.AddSashGroup( vAreas[2], { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { WIN_SASHTYPES.INACTIVE, WIN_SASHTYPES.ACTIVE}, +-- local vSashes = WinCreate.AddSashGroup( vAreas[2], { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { vSashDims, vSashDims}, { WIN_SASHTYPES.INACTIVE, WIN_SASHTYPES.ACTIVE}, -- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT}) -- WinCreate.AddFill( vSashes[1], WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vSashes[2], WIN_FILLTYPES.GLASS) - -- tre ante ( singola / ricevente/ battente) con split nelle ante --- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 33}) --- local nSash1Id = WinCreate.AddSash( vAreas[1], vSashJoints, WIN_OPENING_TYPES.TILTTURN_LEFT) --- local vAreasSash1 = WinCreate.AddSplits( nSash1Id, WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.ABSOLUTE}, { WindowHeight * 3 / 5}) +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 33}, { 95}) +-- local nSash1Id = WinCreate.AddSash( vAreas[1], vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_LEFT) +-- local vAreasSash1 = WinCreate.AddSplits( nSash1Id, WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.ABSOLUTE}, { WindowHeight * 3 / 5}, { 60}) -- WinCreate.AddFill( vAreasSash1[1], WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vAreasSash1[2], WIN_FILLTYPES.GLASS) --- local vSashes2 = WinCreate.AddSashGroup( vAreas[2], { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { WIN_SASHTYPES.INACTIVE, WIN_SASHTYPES.ACTIVE}, +-- local vSashes2 = WinCreate.AddSashGroup( vAreas[2], { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { vSashDims, vSashDims}, { WIN_SASHTYPES.INACTIVE, WIN_SASHTYPES.ACTIVE}, -- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT}) --- local vAreasSash2 = WinCreate.AddSplits( vSashes2[1], WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.ABSOLUTE}, { WindowHeight * 3 / 5}) +-- local vAreasSash2 = WinCreate.AddSplits( vSashes2[1], WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.ABSOLUTE}, { WindowHeight * 3 / 5}, { 60}) -- WinCreate.AddFill( vAreasSash2[1], WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vAreasSash2[2], WIN_FILLTYPES.GLASS) --- local vAreasSash3 = WinCreate.AddSplits( vSashes2[2], WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.ABSOLUTE}, { WindowHeight * 3 / 5}) +-- local vAreasSash3 = WinCreate.AddSplits( vSashes2[2], WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.ABSOLUTE}, { WindowHeight * 3 / 5}, { 60}) -- WinCreate.AddFill( vAreasSash3[1], WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vAreasSash3[2], WIN_FILLTYPES.GLASS) -- 3 ante : sopra battente / ricevente, sotto singola --- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 70}) --- local nSash0Id = WinCreate.AddSash( vAreas[2], vSashJoints, WIN_OPENING_TYPES.FIXED) +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 70}, { 105}) +-- local nSash0Id = WinCreate.AddSash( vAreas[2], vSashJoints, vSashDims, WIN_OPENING_TYPES.FIXED) -- WinCreate.AddFill( nSash0Id, WIN_FILLTYPES.GLASS) --- local vSashes = WinCreate.AddSashGroup( vAreas[1], { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { WIN_SASHTYPES.ACTIVE, WIN_SASHTYPES.INACTIVE}, +-- local vSashes = WinCreate.AddSashGroup( vAreas[1], { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { vSashDims, vSashDims}, { WIN_SASHTYPES.ACTIVE, WIN_SASHTYPES.INACTIVE}, -- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT}) -- WinCreate.AddFill( vSashes[1], WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vSashes[2], WIN_FILLTYPES.GLASS) -- 4 ante : sopra anta singola e sotto singola ( con split) / battente / ricevente --- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 30}) --- local vAreas1 = WinCreate.AddSplits( vAreas[2], WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 30}) --- local nSash0Id = WinCreate.AddSash( vAreas[1], vSashJoints, WIN_OPENING_TYPES.TILTONLY_TOP) +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 30}, { 95}) +-- local vAreas1 = WinCreate.AddSplits( vAreas[2], WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 30}, { 95}) +-- local nSash0Id = WinCreate.AddSash( vAreas[1], vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTONLY_TOP) -- WinCreate.AddFill( nSash0Id, WIN_FILLTYPES.GLASS) --- local nSash1Id = WinCreate.AddSash( vAreas1[1], vSashJoints, WIN_OPENING_TYPES.TILTTURN_LEFT) --- local vSashAreas = WinCreate.AddSplits( nSash1Id, WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 60}) +-- local nSash1Id = WinCreate.AddSash( vAreas1[1], vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_LEFT) +-- local vSashAreas = WinCreate.AddSplits( nSash1Id, WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 60}, { 60}) -- WinCreate.AddFill( vSashAreas[1], WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vSashAreas[2], WIN_FILLTYPES.GLASS) --- local vSashes = WinCreate.AddSashGroup( vAreas1[2], { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { WIN_SASHTYPES.ACTIVE, WIN_SASHTYPES.INACTIVE}, +-- local vSashes = WinCreate.AddSashGroup( vAreas1[2], { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { vSashDims, vSashDims}, { WIN_SASHTYPES.ACTIVE, WIN_SASHTYPES.INACTIVE}, -- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT}) -- WinCreate.AddFill( vSashes[1], WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vSashes[2], WIN_FILLTYPES.GLASS) -- sei ante : divisione orizzontale e per ogni divisione anta singola / battente/ ricevente --- local vAreas = WinCreate.AddGridSplits( nFrameId, { WIN_MEASURE.PERCENTAGE}, { 33}, { WIN_MEASURE.PERCENTAGE}, { 50}, false) --- local nSash1Id = WinCreate.AddSash( vAreas[1], vSashJoints, WIN_OPENING_TYPES.TILTTURN_LEFT) +-- local vAreas = WinCreate.AddGridSplits( nFrameId, { WIN_MEASURE.PERCENTAGE}, { 33}, { WIN_MEASURE.PERCENTAGE}, { 50}, false, { 115, 95, 95}) +-- local nSash1Id = WinCreate.AddSash( vAreas[1], vSashJoints, vSashDims,WIN_OPENING_TYPES.TILTTURN_LEFT) -- WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS) --- local nSash2Id = WinCreate.AddSash( vAreas[3], vSashJoints, WIN_OPENING_TYPES.TILTTURN_LEFT) +-- local nSash2Id = WinCreate.AddSash( vAreas[3], vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_LEFT) -- WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS) --- local vSashes1 = WinCreate.AddSashGroup( vAreas[2], { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { WIN_SASHTYPES.ACTIVE, WIN_SASHTYPES.INACTIVE}, +-- local vSashes1 = WinCreate.AddSashGroup( vAreas[2], { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { vSashDims, vSashDims}, { WIN_SASHTYPES.ACTIVE, WIN_SASHTYPES.INACTIVE}, -- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT}) -- WinCreate.AddFill( vSashes1[1], WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vSashes1[2], WIN_FILLTYPES.GLASS) --- local vSashes2 = WinCreate.AddSashGroup( vAreas[4], { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { WIN_SASHTYPES.ACTIVE, WIN_SASHTYPES.INACTIVE}, +-- local vSashes2 = WinCreate.AddSashGroup( vAreas[4], { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { vSashDims, vSashDims}, { WIN_SASHTYPES.ACTIVE, WIN_SASHTYPES.INACTIVE}, -- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT}) -- WinCreate.AddFill( vSashes2[1], WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vSashes2[2], WIN_FILLTYPES.GLASS) @@ -489,14 +493,14 @@ local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, vFrameJoints, { Wi ------------------------ Ferramenta ------------------------ --- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, vFrameJoints, {1500, 2100}) --- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.ROUND_ARC, vFrameJoints, {1500, 2100}) --- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.SEGMENTAL_ARC, { FrameJointType, FrameJointType, FrameJointType, FrameJointType}, {1500, 1500, 1700}) --- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.CHAMFER_SIDE, vFrameJoints, {1500, 1800 + 1200, 1800}) --- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.CHAMFER, vFrameJoints, {1500, 1500, 1800}) +-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, { 1500, 2100}, vFrameJoints, vFrameDims) +-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.ROUND_ARC, { 1500, 2100}, vFrameJoints, vFrameDims) +-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.SEGMENTAL_ARC, { 1500, 1500, 1700}, vFrameJoints, vFrameDims) +-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.CHAMFER_SIDE, { 1500, 1800 + 1200, 1800}, vFrameJoints, vFrameDims) +-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.CHAMFER, { 1500, 1500, 1800}, vFrameJoints, vFrameDims) -- anta singola --- local nSashId = WinCreate.AddSash( nFrameId, vSashJoints, WIN_OPENING_TYPES.TILTTURN_LEFT) +-- local nSashId = WinCreate.AddSash( nFrameId, vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_LEFT) -- WinCreate.AddFill( nSashId, WIN_FILLTYPES.GLASS) -- WinCreate.AddHardware( nSashId, '000558', 'Sx') -- -- WinCreate.AddHardware( nSashId, '000545', 'Sx') -- aria 4, errato ma crea alcune lavorazioni in più @@ -505,9 +509,9 @@ local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, vFrameJoints, { Wi -- -- WinCreate.AddHardware( nSashId, '000604', 'Sx') -- trapezio -- 2 ante singole --- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 50}) --- local nSash1Id = WinCreate.AddSash( vAreas[1], vSashJoints, WIN_OPENING_TYPES.TILTTURN_LEFT) --- local nSash2Id = WinCreate.AddSash( vAreas[2], vSashJoints, WIN_OPENING_TYPES.TILTTURN_RIGHT) +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 95}) +-- local nSash1Id = WinCreate.AddSash( vAreas[1], vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_LEFT) +-- local nSash2Id = WinCreate.AddSash( vAreas[2], vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_RIGHT) -- WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS) -- WinCreate.AddHardware( nSash1Id, '000558', 'Sx') @@ -520,20 +524,20 @@ local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, vFrameJoints, { Wi -- -- WinCreate.AddHardware( nSash2Id, '000604', 'Dx') -- 2 ante singole con apertura sul montante --- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 50}) --- local nSash1Id = WinCreate.AddSash( vAreas[1], vSashJoints, WIN_OPENING_TYPES.TILTTURN_LEFT) --- local nSash2Id = WinCreate.AddSash( vAreas[2], vSashJoints, WIN_OPENING_TYPES.TILTTURN_LEFT) +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 120}) +-- local nSash1Id = WinCreate.AddSash( vAreas[1], vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_LEFT) +-- local nSash2Id = WinCreate.AddSash( vAreas[2], vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_LEFT) -- WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS) -- WinCreate.AddHardware( nSash1Id, '000558', 'Sx') -- WinCreate.AddHardware( nSash2Id, '000558', 'Sx') -- 3 ante : sotto singola, sopra battente / ricevente --- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 60}) --- local nSash1Id = WinCreate.AddSash( vAreas[2], vSashJoints, WIN_OPENING_TYPES.TILTTURN_LEFT) +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 60}, { 95}) +-- local nSash1Id = WinCreate.AddSash( vAreas[2], vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_LEFT) -- WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS) -- WinCreate.AddHardware( nSash1Id, '000558', 'Sx') --- local vSashes = WinCreate.AddSashGroup( vAreas[1], { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { WIN_SASHTYPES.ACTIVE, WIN_SASHTYPES.INACTIVE}, +-- local vSashes = WinCreate.AddSashGroup( vAreas[1], { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { vSashDims, vSashDims}, { WIN_SASHTYPES.ACTIVE, WIN_SASHTYPES.INACTIVE}, -- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT}) -- WinCreate.AddFill( vSashes[1], WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vSashes[2], WIN_FILLTYPES.GLASS) @@ -541,7 +545,7 @@ local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, vFrameJoints, { Wi -- WinCreate.AddHardware( nSashGrpId, '000559', 'Sx') -- 2 ante : battente / ricevente --- local vSashes = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { WIN_SASHTYPES.ACTIVE, WIN_SASHTYPES.INACTIVE}, +-- local vSashes = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { vSashDims, vSashDims}, { WIN_SASHTYPES.ACTIVE, WIN_SASHTYPES.INACTIVE}, -- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT}) -- WinCreate.AddFill( vSashes[1], WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vSashes[2], WIN_FILLTYPES.GLASS) @@ -551,7 +555,7 @@ local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, vFrameJoints, { Wi -- -- WinCreate.AddHardware( nSashGrpId, '000599', 'Sx') -- arco ribassato -- 2 ante : ricevente / battente --- local vSashes = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { WIN_SASHTYPES.INACTIVE, WIN_SASHTYPES.ACTIVE}, +-- local vSashes = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { vSashDims, vSashDims}, { WIN_SASHTYPES.INACTIVE, WIN_SASHTYPES.ACTIVE}, -- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT}) -- WinCreate.AddFill( vSashes[1], WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vSashes[2], WIN_FILLTYPES.GLASS) @@ -559,7 +563,7 @@ local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, vFrameJoints, { Wi -- WinCreate.AddHardware( nSashGrpId, '000559', 'Dx') -- 3 ante : battente / battente / ricevente --- local vSashes = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 33, 33}, { vSashJoints, vSashJoints, vSashJoints}, +-- local vSashes = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 33, 33}, { vSashJoints, vSashJoints, vSashJoints}, { vSashDims, vSashDims, vSashDims}, -- { WIN_SASHTYPES.ACTIVE_OUT, WIN_SASHTYPES.ACTIVE_IN, WIN_SASHTYPES.INACTIVE}, -- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT}) -- WinCreate.AddFill( vSashes[1], WIN_FILLTYPES.GLASS) @@ -569,7 +573,7 @@ local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, vFrameJoints, { Wi -- WinCreate.AddHardware( nSashGrpId, '000564', 'Sx') -- 3 ante : ricevente / battente / battente --- local vSashes = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 33, 33}, { vSashJoints, vSashJoints, vSashJoints}, +-- local vSashes = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 33, 33}, { vSashJoints, vSashJoints, vSashJoints}, { vSashDims, vSashDims, vSashDims}, -- { WIN_SASHTYPES.INACTIVE, WIN_SASHTYPES.ACTIVE_IN, WIN_SASHTYPES.ACTIVE_OUT}, -- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT, WIN_OPENING_TYPES.TURNONLY_RIGHT}) -- WinCreate.AddFill( vSashes[1], WIN_FILLTYPES.GLASS) @@ -579,7 +583,7 @@ local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, vFrameJoints, { Wi -- WinCreate.AddHardware( nSashGrpId, '000564', 'Dx') -- 3 ante : battente / ricevente / ricevente --- local vSashes = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 33, 33}, { vSashJoints, vSashJoints, vSashJoints}, +-- local vSashes = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 33, 33}, { vSashJoints, vSashJoints, vSashJoints}, { vSashDims, vSashDims, vSashDims}, -- { WIN_SASHTYPES.ACTIVE, WIN_SASHTYPES.INACTIVE_IN, WIN_SASHTYPES.INACTIVE_OUT}, -- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT, WIN_OPENING_TYPES.TURNONLY_RIGHT}) -- WinCreate.AddFill( vSashes[1], WIN_FILLTYPES.GLASS) @@ -589,7 +593,7 @@ local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, vFrameJoints, { Wi -- WinCreate.AddHardware( nSashGrpId, '000565', 'Sx') -- 3 ante : ricevente / ricevente / battente --- local vSashes = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 33, 33}, { vSashJoints, vSashJoints, vSashJoints}, +-- local vSashes = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 33, 33}, { vSashJoints, vSashJoints, vSashJoints}, { vSashDims, vSashDims, vSashDims}, -- { WIN_SASHTYPES.INACTIVE_OUT, WIN_SASHTYPES.INACTIVE_IN, WIN_SASHTYPES.ACTIVE}, -- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT}) -- WinCreate.AddFill( vSashes[1], WIN_FILLTYPES.GLASS) @@ -600,7 +604,7 @@ local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, vFrameJoints, { Wi -- 4 ante : battente / battente / ricevente / ricevente -- local vSashes = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 25, 25, 25}, --- { vSashJoints, vSashJoints, vSashJoints, vSashJoints}, +-- { vSashJoints, vSashJoints, vSashJoints, vSashJoints}, { vSashDims, vSashDims, vSashDims, vSashDims}, -- { WIN_SASHTYPES.ACTIVE_OUT, WIN_SASHTYPES.ACTIVE_IN, WIN_SASHTYPES.INACTIVE_IN, WIN_SASHTYPES.INACTIVE_OUT}, -- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT, WIN_OPENING_TYPES.TURNONLY_RIGHT}) -- WinCreate.AddFill( vSashes[1], WIN_FILLTYPES.GLASS) @@ -612,7 +616,7 @@ local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, vFrameJoints, { Wi -- 4 ante : ricevente / ricevente / battente / battente -- local vSashes = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 25, 25, 25}, --- { vSashJoints, vSashJoints, vSashJoints, vSashJoints}, +-- { vSashJoints, vSashJoints, vSashJoints, vSashJoints}, { vSashDims, vSashDims, vSashDims, vSashDims}, -- { WIN_SASHTYPES.INACTIVE_OUT, WIN_SASHTYPES.INACTIVE_IN, WIN_SASHTYPES.ACTIVE_IN, WIN_SASHTYPES.ACTIVE_OUT}, -- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT, WIN_OPENING_TYPES.TURNONLY_RIGHT}) -- WinCreate.AddFill( vSashes[1], WIN_FILLTYPES.GLASS) @@ -623,7 +627,7 @@ local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, vFrameJoints, { Wi -- WinCreate.AddHardware( nSashGrpId, '000575', 'Dx') -- vasistas --- local nSashId = WinCreate.AddSash( nFrameId, vSashJoints, WIN_OPENING_TYPES.TILTONLY_TOP) +-- local nSashId = WinCreate.AddSash( nFrameId, vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTONLY_TOP) -- WinCreate.AddFill( nSashId, WIN_FILLTYPES.GLASS) -- WinCreate.AddHardware( nSashId, '000573', 'Sx') @@ -665,8 +669,7 @@ WinCalculate.CreatePartFromArea( nFrameId) -- WinCalculate.CreateArcLogs( vParts[i], nLogsNbr, vSections, bAlign, dOverMatOut, dOverMatIn, dOverMatExt, dOverMatInt, bCutExtremities) -- end -- end - - + EgtZoom( SCE_ZM.ALL) diff --git a/Designing/WinConst.lua b/Designing/WinConst.lua index f490d98..6ac239f 100644 --- a/Designing/WinConst.lua +++ b/Designing/WinConst.lua @@ -176,6 +176,7 @@ WIN_TOP = 'Top' WIN_LEFT = 'Left' -- info varie su aree e curve +WIN_PART_DIM = 'PartDim' WIN_SOU = 'SOU' WIN_CHILD = 'CHILD' WIN_COPY = 'COPY' @@ -282,7 +283,7 @@ WIN_DELTA = 'Delta' WIN_FILLOVERLAP = 'FillOverlap' WIN_FILLDELTA = 'FillDelta' WIN_GLASSTHICKNESS = 'GlassThickness' -WIN_RAILDELTA = 'RailDelta' +WIN_RAILOFFS = 'RailOffs' -- per ferramenta WIN_GAPDELTA = 'GapDelta' WIN_GAPDELTAZ = 'GapDeltaZ' diff --git a/Designing/WinLib/WinCalculate.lua b/Designing/WinLib/WinCalculate.lua index 49a3559..5bcb00e 100644 --- a/Designing/WinLib/WinCalculate.lua +++ b/Designing/WinLib/WinCalculate.lua @@ -550,56 +550,41 @@ end -- funzione che data una curva di outline restituisce l'id del suo profilo local function GetOutlineProfileId( nOutlineId, bForceBottomRail, nBottomRail) - -- ciclo fino a trovare il primo parent che abbia un AreaType definito ( frame o sash) - local nParentId = EgtGetParent( EgtGetParent( nOutlineId)) - local nAreaType = EgtGetInfo( nParentId or GDB_ID.NULL, WIN_AREATYPE, 'i') or WIN_AREATYPES.NULL - while nParentId and ( nAreaType == WIN_AREATYPES.SPLIT or nAreaType == WIN_AREATYPES.NULL) do - nParentId = EgtGetParent( nParentId) - nAreaType = EgtGetInfo( nParentId or GDB_ID.NULL, WIN_AREATYPE, 'i') or WIN_AREATYPES.NULL - end + -- recupero il pezzo associato all'outline + local nPartId - -- recupero il gruppo contenente il profilo - local nProfilesGrpId = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_PROFILE) - local nLayerId - if nAreaType == WIN_AREATYPES.FRAME then - nLayerId = EgtGetFirstNameInGroup( nProfilesGrpId, WIN_FRAME) - elseif nAreaType == WIN_AREATYPES.SASH then - nLayerId = EgtGetFirstNameInGroup( nProfilesGrpId, WIN_SASH) - end - - -- recupero il nome del profilo - local sProfileName = EgtGetInfo( nOutlineId, WIN_PROFILETYPE) - - -- controlli per bottomrail if EgtGetName( nOutlineId) == WIN_BOTTOM then + -- controlli per bottomrail local nBottomRailTot = EgtGetInfo( nOutlineId, WIN_BOTTOMRAIL, 'i') or 0 if nBottomRailTot > 0 then + local vBottomRailParts = EgtGetInfo( nOutlineId, WIN_REF_BOTTOMRAIL_PART, 'vi') if bForceBottomRail then - sProfileName = WIN_FILL_RAIL - else - if nBottomRail then - if nBottomRail == nBottomRailTot then - sProfileName = WIN_FILL_RAIL - else - sProfileName = WIN_RAIL - end - end + -- devo recuperare l'ultimo bottomrail + nPartId = vBottomRailParts[#vBottomRailParts] + elseif nBottomRail then + -- devo recuperare il bottomrail indicato + nPartId = vBottomRailParts[nBottomRail] end end + + -- controllo per soglia : non avendo un pezzo associato, devo restituire il profilo teorico + local bThreshold = EgtGetInfo( nOutlineId, WIN_THRESHOLD, 'b') + if bThreshold then + local nProfileGrpId = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_PROFILE) + local nFrameProfileGrpId = EgtGetFirstNameInGroup( nProfileGrpId, WIN_FRAME) + local sThreshold = EgtGetInfo( nOutlineId, WIN_PROFILETYPE) + return EgtGetFirstNameInGroup( nFrameProfileGrpId, sThreshold) + end end - -- controlli per pezzi di cambio profilo sul telaio - local bChangeProfile = EgtGetInfo( nOutlineId, WIN_PRF_CHANGE, 'b') or false - if bChangeProfile and sProfileName ~= WIN_MIXED_SPLIT then - if EgtGetName( nOutlineId) == WIN_BOTTOM then - sProfileName = WIN_MIXED_BOTTOM - else - sProfileName = WIN_MIXED_TOP - end + if not nPartId then + nPartId = EgtGetInfo( nOutlineId, WIN_REF_PART, 'i') end -- recupero il profilo - return EgtGetFirstNameInGroup( nLayerId, sProfileName) + local nProfileGrpId = EgtGetFirstNameInGroup( nPartId, WIN_PROFILE) + local nMainProfileId = EgtGetFirstNameInGroup( nProfileGrpId, WIN_PRF_MAIN) + return nMainProfileId end --------------------------------------------------------------------- @@ -698,7 +683,7 @@ local function CreateProfileSurfById( nOutlineId, nProfileId, nSectionId, dExtra -- correzione nel caso di bottomrail local sProfileType = EgtGetInfo( nProfileId, WIN_PROFILETYPE) if sProfileType == WIN_RAIL or sProfileType == WIN_FILL_RAIL then - local dOffs = EgtGetInfo( nProfileId, WIN_RAILDELTA, 'd') + local dOffs = EgtGetInfo( nProfileId, WIN_RAILOFFS, 'd') EgtOffsetCurve( nGuideId, - dOffs) end @@ -748,8 +733,10 @@ local function IsSameSemiProfile( nSemiProfile1, nSemiProfile2) return ( sName1 == sName2 and EgtGetName( nSemiProfile1) == EgtGetName( nSemiProfile2)) end + + ---------------------------------------------------------------------------------- ------------------------------ CALCOLO DEI PROFILI ------------------------------ +---------------------- CALCOLO DEI PROFILI PER BASEOUTLINES --------------------- ---------------------------------------------------------------------------------- -- funzione che restituisce il primo tipo di area definito tra le sottoaree che si generano da nAreaId local function GetAreaChildrenType( nAreaId) @@ -1186,9 +1173,634 @@ end +---------------------------------------------------------------------------------- +----------------------------- PROFILI PEZZO ------------------------------------- +---------------------------------------------------------------------------------- +-- funzione che calcola l'offset da applicare alla curva di outline bottom per ottenere la curva di outline del bottomrail richiesto +local function CalcRailOffset( nOutlineId, nProfileId, nBottomRail) + + -- recupero la dimensioni dei pezzi bottom e bottomrails + local dDimBottom = EgtGetInfo( nOutlineId, WIN_PART_DIM, 'd') + local vDimBottomRails = EgtGetInfo( nOutlineId, WIN_BOTTOMRAIL .. WIN_PART_DIM, 'vd') + local dOverlap = EgtGetInfo( nProfileId, WIN_OVERLAP, 'd') + + local dRailOffs = dDimBottom + for i = 1, nBottomRail - 1 do + dRailOffs = dRailOffs + vDimBottomRails[i] + end + dRailOffs = dRailOffs - nBottomRail * dOverlap + + EgtSetInfo( nProfileId, WIN_RAILOFFS, dRailOffs) +end + +--------------------------------------------------------------------- +-- funzione che crea il profilo della dimensione corretta +local function AdjustProfileDimension( nOutlineId, nProfileId, dDimOld, dDim) + + local bSplit = ( EgtGetName( nOutlineId) == WIN_SPLIT) + local sProfileName = EgtGetInfo( nProfileId, WIN_PROFILETYPE) + local bMixed = EgtStartsWith( sProfileName, WIN_MIXED) + local dDeltaDim = dDim - dDimOld + + local nFrameId = EgtGetFirstNameInGroup( nProfileId, WIN_SECTIONFRAME) + local frSection = EgtFR( nFrameId, GDB_RT.GLOB) + local vtMove = - frSection:getVersX() + + -- traslo le curve "interne" + local vCurves = { WIN_IN, WIN_CTRIN, WIN_OFST .. WIN_CTRIN, WIN_STRIP, WIN_SIMPLIFIED .. WIN_IN, WIN_SIMPLIFIED .. WIN_OFST .. WIN_CTRIN, WIN_SIMPLIFIED .. WIN_STRIP} + if bSplit then + vCurves = { WIN_IN .. '2', WIN_CTRIN .. '2', WIN_OFST .. WIN_CTRIN .. '2', WIN_STRIP .. '2', + WIN_SIMPLIFIED .. WIN_IN .. '2', WIN_SIMPLIFIED .. WIN_OFST .. WIN_CTRIN .. '2', WIN_SIMPLIFIED .. WIN_STRIP .. '2'} + elseif bMixed then + vCurves = { WIN_SASH .. WIN_IN, WIN_FILL .. WIN_IN, WIN_SASH .. WIN_CTRIN, WIN_FILL .. WIN_CTRIN, WIN_OFST .. WIN_SASH .. WIN_CTRIN, WIN_OFST .. WIN_FILL .. WIN_CTRIN, WIN_STRIP, + WIN_SIMPLIFIED .. WIN_SASH .. WIN_IN, WIN_SIMPLIFIED .. WIN_FILL .. WIN_IN, WIN_SIMPLIFIED .. WIN_OFST .. WIN_SASH .. WIN_CTRIN, + WIN_SIMPLIFIED .. WIN_OFST .. WIN_FILL .. WIN_CTRIN, WIN_SIMPLIFIED .. WIN_STRIP, WIN_MIXED_COMMON .. WIN_IN} + end + + for i = 1, #vCurves do + local nCrvId = EgtGetFirstNameInGroup( nProfileId, vCurves[i]) or GDB_ID.NULL + EgtMove( nCrvId, dDeltaDim * vtMove, GDB_RT.GLOB) + end + + -- traslo i dowels + local vDowels = EgtGetNameInGroup( nProfileId, WIN_DOWEL .. '*') + EgtMove( vDowels, 0.5 * dDeltaDim * vtMove) + + -- ricostruisco la sezione ( i=1) e la sezione semplificata ( i=2) + for i = 1, 2 do + -- prefisso al nome delle curve per sezione standard o semplificata + local sSimplPrefix = EgtIf( i == 1, '', WIN_SIMPLIFIED) + -- prefisso al nome delle curve per gestire parte sash o fill ( cambio profilo) + local vsPartPrefix = EgtIf( bMixed and not bSplit, { WIN_SASH, WIN_FILL}, {''}) + -- nome dei semiprofili da combinare per creare la sezione + local vsProfiles = EgtIf( bSplit, { WIN_IN .. '1', WIN_IN .. '2'}, { WIN_IN, WIN_OUT}) + + for j = 1, #vsPartPrefix do + local nSectionId = EgtGetFirstNameInGroup( nProfileId, sSimplPrefix .. vsPartPrefix[j] .. WIN_SECTION) + EgtErase( nSectionId) + local vSemiProfileNames = { sSimplPrefix .. vsPartPrefix[j] .. vsProfiles[1], sSimplPrefix .. vsProfiles[2]} + local vSemiProfiles = { EgtGetFirstNameInGroup( nProfileId, vSemiProfileNames[1]), EgtGetFirstNameInGroup( nProfileId, vSemiProfileNames[2])} + nSectionId = EgtCurveCompo( nProfileId, vSemiProfiles[1], false) + EgtAddCurveCompoLine( nSectionId, EgtSP( vSemiProfiles[2])) + EgtAddCurveCompoCurve( nSectionId, vSemiProfiles[2], false) + EgtCloseCurveCompo( nSectionId) + EgtSetName( nSectionId, sSimplPrefix .. vsPartPrefix[j] .. WIN_SECTION) + end + end + + -- ricostruisco il box + local nRef = EgtGetFirstNameInGroup( nProfileId, WIN_REF) + local b3Profile = EgtGetBBoxRef( nRef, GDB_BB.STANDARD, frSection) + EgtErase( nRef) + nRef = EgtRectangle2P( nProfileId, b3Profile:getMin() - X_AX() * dDeltaDim, b3Profile:getMax()) + EgtTransform( nRef, EgtFR( nFrameId)) + EgtSetName( nRef, WIN_REF) + + if EgtGetName( nOutlineId) == WIN_SPLIT then + -- sposto il frame per lasciarlo posizionato come prima rispetto al box ( sono state spostate solo le curve interne) + local dMove = b3Profile:getMax():getX() / dDimOld * dDim - b3Profile:getMax():getX() + EgtMove( nFrameId, dMove * vtMove) + end +end + +--------------------------------------------------------------------- +local function CreatePartProfile( nPartId, nOutlineId, dDim, nBottomRail) + + -- gruppo per i profili + local nProfileLayerId = EgtGetFirstNameInGroup( nPartId, WIN_PROFILE) + if nProfileLayerId then + EgtEmptyGroup( nProfileLayerId) + else + nProfileLayerId = EgtGroup( nPartId) + EgtSetName( nProfileLayerId, WIN_PROFILE) + EgtSetStatus( nProfileLayerId, GDB_ST.OFF) + end + + -- profilo principale : + -- recupero se è pezzo di telaio o anta + local nParentId = EgtGetParent( EgtGetParent( nOutlineId)) + local nAreaType = EgtGetInfo( nParentId or GDB_ID.NULL, WIN_AREATYPE, 'i') or WIN_AREATYPES.NULL + while nParentId and ( nAreaType == WIN_AREATYPES.SPLIT or nAreaType == WIN_AREATYPES.NULL) do + nParentId = EgtGetParent( nParentId) + nAreaType = EgtGetInfo( nParentId or GDB_ID.NULL, WIN_AREATYPE, 'i') or WIN_AREATYPES.NULL + end + + -- recupero il gruppo contenente il profilo + local nProfilesGrpId = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_PROFILE) + local nLayerId + if nAreaType == WIN_AREATYPES.FRAME then + nLayerId = EgtGetFirstNameInGroup( nProfilesGrpId, WIN_FRAME) + elseif nAreaType == WIN_AREATYPES.SASH then + nLayerId = EgtGetFirstNameInGroup( nProfilesGrpId, WIN_SASH) + end + + -- recupero il nome del profilo + local sProfileName = EgtGetInfo( nOutlineId, WIN_PROFILETYPE) + -- controlli per bottomrail + if nBottomRail then + local nBottomRailTot = EgtGetInfo( nOutlineId, WIN_BOTTOMRAIL, 'i') or 0 + if nBottomRail == nBottomRailTot then + sProfileName = WIN_FILL_RAIL + else + sProfileName = WIN_RAIL + end + end + + -- recupero il profilo + local nOrigMainProfileId = EgtGetFirstNameInGroup( nLayerId, sProfileName) + + -- creo copia + local nMainProfileId = EgtCopy( nOrigMainProfileId, nProfileLayerId) + local sMainProfileType = EgtGetName( nMainProfileId) + EgtSetInfo( nMainProfileId, WIN_PROFILETYPE, sMainProfileType) + EgtSetName( nMainProfileId, WIN_PRF_MAIN) + -- se bottomrail salvo info per scostamento dall'outline + if nBottomRail then + CalcRailOffset( nOutlineId, nMainProfileId, nBottomRail) + end + + -- verifico se vanno modificate le dimensioni del profilo + local dDimStd = EgtGetInfo( nMainProfileId, WIN_DIM_STD, 'd') + if dDim then + if abs( dDimStd - dDim) > GEO.EPS_SMALL then + AdjustProfileDimension( nOutlineId, nMainProfileId, dDimStd, dDim) + end + else + -- se non ha dimensione imposto quella standard + if nBottomRail then + local vBottomRailDims = EgtGetInfo( nOutlineId, WIN_BOTTOMRAIL.. WIN_PART_DIM, 'vd') or {} + table.insert( vBottomRailDims, nBottomRail, dDimStd) + EgtSetInfo( nOutlineId, WIN_BOTTOMRAIL.. WIN_PART_DIM, vBottomRailDims) + else + EgtSetInfo( nOutlineId, WIN_PART_DIM, dDimStd) + end + end + + -- recupero le info di pinzaggio dal profilo di estrusione + CopyInfo( nPartId, nMainProfileId, WIN_PRC_OFFY_1, 0) + CopyInfo( nPartId, nMainProfileId, WIN_PRC_OFFZ_1, 0) + CopyInfo( nPartId, nMainProfileId, WIN_PRC_OFFY_2, 0) + CopyInfo( nPartId, nMainProfileId, WIN_PRC_OFFZ_2, 0) + CopyInfo( nPartId, nMainProfileId, WIN_PRC_CLAMPV_1, 0) + CopyInfo( nPartId, nMainProfileId, WIN_PRC_CLAMPV_2, 0) +end + +--------------------------------------------------------------------- +-- funzione che recupera i profili start ed end di un pezzo +local function CalcStartEndProfiles( nPartId, nOutlineId, vPrevOutlineId, vNextOutlineId) + + -- recupero il gruppo per i profili + local nProfileLayerId = EgtGetFirstNameInGroup( nPartId, WIN_PROFILE) + + -- recupero profili start/end e ne creo copia + for i = 1, #vPrevOutlineId do + -- se il tipo corrente è split il pezzo va tagliato con eventuale bottomrail, altrimenti con il bottom + local nOrigStartProfileId = GetOutlineProfileId( abs( vPrevOutlineId[i]), EgtGetName( nOutlineId) == WIN_SPLIT) + local nStartProfileId = EgtCopy( nOrigStartProfileId, nProfileLayerId) + EgtSetName( nStartProfileId, WIN_PRF_START) + end + + for i = 1, #vNextOutlineId do + local nOrigEndProfileId = GetOutlineProfileId( abs( vNextOutlineId[i]), EgtGetName( nOutlineId) == WIN_SPLIT) + local nEndProfileId = EgtCopy( nOrigEndProfileId, nProfileLayerId) + EgtSetName( nEndProfileId, WIN_PRF_END) + end + + return nProfileLayerId +end + + + +---------------------------------------------------------------------------------- +------------------------------ CREAZIONE PEZZI --------------------------------- +---------------------------------------------------------------------------------- +-- funzione che dato il tipo di giunzione e di pezzo ( orizzontale o verticale) restituisce se è corto, lungo o angolato +local function CalcPartJoint( nJointType, bHorizontal) + + if nJointType == WIN_JNT.ANGLED then + return WIN_PART_JNT.ANGLED + elseif nJointType == WIN_JNT.FULL_H then + if bHorizontal then + return WIN_PART_JNT.FULL + else + return WIN_PART_JNT.SHORT + end + elseif nJointType == WIN_JNT.FULL_V then + if bHorizontal then + return WIN_PART_JNT.SHORT + else + return WIN_PART_JNT.FULL + end + end +end + +--------------------------------------------------------------------- +local function GetOutlineJoints( vOutlineIds, vJoints) + + for i = 1, #vOutlineIds do + + local nPrevIdx = EgtIf( i == 1, #vOutlineIds, i - 1) + local nNextIdx = EgtIf( i == #vOutlineIds, 1, i + 1) + + local nStartJoint, nEndJoint + if EgtGetName( vOutlineIds[i]) == WIN_BOTTOM then + nStartJoint = CalcPartJoint( vJoints[1], true) + nEndJoint = CalcPartJoint( vJoints[2], true) + elseif EgtGetName( vOutlineIds[i]) == WIN_RIGHT then + nStartJoint = CalcPartJoint( vJoints[2], false) + nEndJoint = CalcPartJoint( vJoints[3], false) + elseif EgtGetName( vOutlineIds[i]) == WIN_TOP then + nStartJoint = CalcPartJoint( vJoints[3], true) + nEndJoint = CalcPartJoint( vJoints[4], true) + -- correzioni per caso a triangolo : se l'outline vicino è di tipo bottom, il corrente deve essere trattato come un pezzo verticale + if EgtGetName( vOutlineIds[nPrevIdx]) == WIN_BOTTOM then + nStartJoint = CalcPartJoint( vJoints[2], false) + nEndJoint = CalcPartJoint( vJoints[3], true) + end + if EgtGetName( vOutlineIds[nNextIdx]) == WIN_BOTTOM then + nStartJoint = CalcPartJoint( vJoints[3], true) + nEndJoint = CalcPartJoint( vJoints[1], false) + end + elseif EgtGetName( vOutlineIds[i]) == WIN_LEFT then + nStartJoint = CalcPartJoint( vJoints[4] or vJoints[3], false) -- ( vJoints[3] per gestire caso a triangolo) + nEndJoint = CalcPartJoint( vJoints[1], false) + end + + -- eventuali correzioni : + -- a) forzatura a bisettrice se elementi in tangenza ( entro 6°) o dello stesso tipo + if nStartJoint ~= WIN_PART_JNT.ANGLED then + if EgtEV( vOutlineIds[nPrevIdx]) * EgtSV( vOutlineIds[i]) > s_dAngledCos or EgtGetName( vOutlineIds[i]) == EgtGetName( vOutlineIds[nPrevIdx]) then + nStartJoint = WIN_PART_JNT.ANGLED + end + end + if nEndJoint ~= WIN_PART_JNT.ANGLED then + if EgtEV( vOutlineIds[i]) * EgtSV( vOutlineIds[nNextIdx]) > s_dAngledCos or EgtGetName( vOutlineIds[i]) == EgtGetName( vOutlineIds[nNextIdx]) then + nEndJoint = WIN_PART_JNT.ANGLED + end + end + + -- b) forzatura a short se incontro con soglia + if EgtGetInfo( vOutlineIds[nPrevIdx], WIN_THRESHOLD, 'b') then + nStartJoint = WIN_PART_JNT.SHORT + end + if EgtGetInfo( vOutlineIds[nNextIdx], WIN_THRESHOLD, 'b') then + nEndJoint = WIN_PART_JNT.SHORT + end + + -- salvo come info sulla curva + EgtSetInfo( vOutlineIds[i], WIN_STARTJOINT, nStartJoint) + EgtSetInfo( vOutlineIds[i], WIN_ENDJOINT, nEndJoint) + end +end + +--------------------------------------------------------------------- +-- funzione che stabilisce il nome del pezzo +local function CalcPartName( nAreaId, nAreaType) + + local sName = '' + if nAreaType == WIN_AREATYPES.FRAME then + sName = WIN_FRAME + EgtSetInfo( nAreaId, WIN_AREA_NAME, sName) + elseif nAreaType == WIN_AREATYPES.SASH then + s_nSashNbr = s_nSashNbr + 1 + sName = WIN_SASH .. '_'.. tostring( s_nSashNbr) + EgtSetInfo( nAreaId, WIN_AREA_NAME, sName) + else + -- per split o riempimento devo ricavare il nome del parent che lo contiene + local nParentId = EgtGetParent( nAreaId) + local nParentType = EgtGetInfo( nParentId, WIN_AREATYPE, 'i') + while nParentType ~= WIN_AREATYPES.FRAME and nParentType ~= WIN_AREATYPES.SASH do + nParentId = EgtGetParent( nParentId) + nParentType = EgtGetInfo( nParentId, WIN_AREATYPE, 'i') + end + sName = EgtGetInfo( nParentId, WIN_AREA_NAME, sName) + end + + return sName +end + +--------------------------------------------------------------------- +local function CreateOutlinePart( nOutlineId, sName, dDim, nBottomRail) + + -- se soglia ignoro + local bThreshold = EgtGetInfo( nOutlineId or GDB_ID.NULL, WIN_THRESHOLD, 'b') or false + if bThreshold then + return + end + + -- creo pezzo + local nPartId = EgtGroup( GDB_ID.ROOT) + + -- creo riferimenti tra pezzo e outline + EgtSetInfo( nPartId, WIN_REF_OUTLINE, nOutlineId) + if nBottomRail then + -- aggiorno i riferimenti del bottomrail + local vBottomRailParts = EgtGetInfo( nOutlineId, WIN_REF_BOTTOMRAIL_PART, 'vi') or {} + table.insert( vBottomRailParts, nPartId) + EgtSetInfo( nOutlineId, WIN_REF_BOTTOMRAIL_PART, vBottomRailParts) + EgtSetInfo( nPartId, WIN_PART_TYPE, WIN_PART_TYPES.BOTTOMRAIL) + EgtSetInfo( nPartId, WIN_BOTTOMRAIL, nBottomRail) + else + EgtSetInfo( nOutlineId, WIN_REF_PART, nPartId) + end + + -- imposto nome + local sOutlineName = EgtIf( nBottomRail, WIN_BOTTOMRAIL .. '_' .. tostring( nBottomRail), EgtGetName( nOutlineId)) + local sPartName = sName .. '_' .. sOutlineName + EgtSetName( nPartId, sPartName) + + -- imposto colore + if sOutlineName == WIN_BOTTOM or sOutlineName == WIN_TOP or nBottomRail then + EgtSetColor( nPartId, Color3d( 204, 102, 0)) + elseif sOutlineName == WIN_RIGHT or sOutlineName == WIN_LEFT then + EgtSetColor( nPartId, Color3d( 251, 128, 4)) + else + EgtSetColor( nPartId, Color3d( 255, 159, 57)) + end + + -- creo il profilo associato al pezzo con la dimensione opportuna + CreatePartProfile( nPartId, nOutlineId, dDim, nBottomRail) + + return nPartId +end + +--------------------------------------------------------------------- +local function CreatePartsFromOutlines( vOutlines, nAreaId, sName) + + local vPartsDim = EgtGetInfo( nAreaId, WIN_PART_DIM, 'vd') or {} + local nBottomRail = EgtGetInfo( nAreaId, WIN_BOTTOMRAIL, 'i') + + -- sistemo le dimensioni in modo che pezzi coinvolti da giunzione a bisettrice ( scelta o forzata) abbiano la stessa dimensione + for i = 2, #vOutlines do + local nStartJoint = EgtGetInfo( vOutlines[i], WIN_STARTJOINT, 'i') + if nStartJoint == WIN_PART_JNT.ANGLED then + vPartsDim[i] = vPartsDim[i-1] + end + end + if vPartsDim[1] ~= vPartsDim[#vOutlines] and EgtGetInfo( vOutlines[1], WIN_STARTJOINT, 'i') == WIN_PART_JNT.ANGLED then + for i = #vOutlines, 2, -1 do + local nEndJoint = EgtGetInfo( vOutlines[i], WIN_ENDJOINT, 'i') + if nEndJoint == WIN_PART_JNT.ANGLED then + vPartsDim[i] = vPartsDim[1] + else + break + end + end + end + + -- creo i pezzi per ogni curva + for i = 1, #vOutlines do + EgtSetInfo( vOutlines[i], WIN_PART_DIM, vPartsDim[i]) + CreateOutlinePart( vOutlines[i], sName, vPartsDim[i]) + + if nBottomRail and EgtGetName( vOutlines[i]) == WIN_BOTTOM then + EgtSetInfo( vOutlines[i], WIN_BOTTOMRAIL, nBottomRail) + local vBottomRailDim = EgtGetInfo( nAreaId, WIN_BOTTOMRAIL .. WIN_PART_DIM, 'vd') or {} + EgtSetInfo( vOutlines[i], WIN_BOTTOMRAIL .. WIN_PART_DIM, vBottomRailDim) + for j = 1, nBottomRail do + CreateOutlinePart( vOutlines[i], sName, vBottomRailDim[j], j) + end + end + end +end + +--------------------------------------------------------------------- +local function CreateFillPartFromArea( nAreaId, sName) + + local nPartId = EgtGroup( GDB_ID.ROOT) + -- inserisco riferimento alla sua area + EgtSetInfo( nPartId, WIN_AREA, nAreaId) + + -- imposto nome del pezzo + EgtSetName( nPartId, sName .. '_' .. WIN_FILL) + EgtSetInfo( nPartId, WIN_PART_TYPE, WIN_PART_TYPES.FILL) + + -- imposto colore e tipologia + local nFillType = EgtGetInfo( nAreaId, WIN_FILLTYPE, 'i') + if nFillType == WIN_FILLTYPES.GLASS then + EgtSetColor( nPartId, Color3d( 71, 161, 255)) + EgtSetAlpha( nPartId, 30) + EgtSetInfo( nPartId, WIN_FILLTYPE, WIN_GLASS) + elseif nFillType == WIN_FILLTYPES.WOOD then + EgtSetColor( nPartId, Color3d( 194, 148, 103)) + EgtSetInfo( nPartId, WIN_FILLTYPE, WIN_WOOD) + end + + return nPartId +end + + + ---------------------------------------------------------------------------------- ------------------------------ CALCOLO OUTLINE --------------------------------- ---------------------------------------------------------------------------------- +-- funzione che disegna l'apertura dell'anta +local function DrawOpening( nAreaId) + + local nOpeningType = EgtGetInfo( nAreaId, WIN_OPENING_TYPE, 'i') + if nOpeningType == WIN_OPENING_TYPES.NULL then + return + end + + -- creo gruppo per aperture + local nOpeningLayId = EgtGroup( nAreaId) + EgtSetName( nOpeningLayId, WIN_SASH_OPENING) + + -- verifico se anta ricevente per impostare tratteggio + local nFactor = 7 + local nPattern = 0xAAAA + local nType = EgtGetInfo( nAreaId, WIN_SASHTYPE, 'i') + local bStippled = ( nType == WIN_SASHTYPES.INACTIVE or nType == WIN_SASHTYPES.INACTIVE_IN or nType == WIN_SASHTYPES.INACTIVE_OUT) + + -- calcolo la curva di riferimento per il disegno dell'apertura + local nOutlineLayId = EgtGetFirstNameInGroup( nAreaId, WIN_OUTLINE) + local vOutlines = EgtGetAllInGroup( nOutlineLayId) + -- TODO gestire caso di triangolo + if #vOutlines == 3 then + return + end + local vCrvs = {} + for i = 1, #vOutlines do + local nCrv = EgtCopyGlob( vOutlines[i], nOpeningLayId) + table.insert( vCrvs, nCrv) + local nProfileId = GetOutlineProfileId( vCrvs[i], true) + local b3FrameProfile = GetProfileLocalBox( nProfileId) + local dDeltaOffs = EgtGetInfo( nProfileId, WIN_RAILOFFS , 'd') or 0 + local dOffs = b3FrameProfile:getMin():getX() - dDeltaOffs + EgtOffsetCurve( nCrv, dOffs) + end + vCrvs = TrimOrderedCurves( vCrvs) + local nGuideId = EgtCurveCompo( nOpeningLayId, vCrvs) + local _, dParE = EgtCurveDomain( nGuideId) + + -- ribalta + if nOpeningType == WIN_OPENING_TYPES.TILTONLY_TOP or nOpeningType == WIN_OPENING_TYPES.TILTTURN_LEFT or nOpeningType == WIN_OPENING_TYPES.TILTTURN_RIGHT then + -- ricavo il punto sul top + local ptMid = EgtUP( nGuideId, 2.5) + if not EgtCurveIsARectangle( nGuideId) then + -- per maggiore simmetria ricavo il punto sul top in corrispondenza del punto medio del bottom + local ptTest = EgtUP( nGuideId, 0.5) + local nLineTest = EgtLinePVL( nOpeningLayId, ptTest + Y_AX(), Y_AX(), 10000) + ptMid = EgtIP( nGuideId, nLineTest, ORIG()) + EgtErase( nLineTest) + end + EgtCurveCompoFromPoints( nOpeningLayId, { EgtSP( nGuideId), ptMid, EgtUP( nGuideId, 1)}) + elseif nOpeningType == WIN_OPENING_TYPES.TILTONLY_BOTTOM then + -- ricavo il punto sul bottom + local ptMid = EgtUP( nGuideId, 0.5) + EgtCurveCompoFromPoints( nOpeningLayId, { EgtUP( nGuideId, 2), ptMid, EgtUP( nGuideId, dParE - 1)}) + end + + -- altre tipologie + if nOpeningType == WIN_OPENING_TYPES.TILTTURN_LEFT or nOpeningType == WIN_OPENING_TYPES.TURNONLY_LEFT then + -- battente sx + local dLenRight = EgtCurveCompoLength( nGuideId, 1) + local dLenLeft = EgtCurveCompoLength( nGuideId, dParE - 1) + local dParMid = 1.5 + -- se lato sinistro è il più corto, prendo sul destro il corrispondente del suo punto medio + if dLenLeft < dLenRight - GEO.EPS_SMALL then + dParMid = EgtCurveParamAtLength( nGuideId, EgtCurveCompoLength( nGuideId, 0) + dLenLeft * 0.5) + end + local nCrv = EgtCurveCompoFromPoints( nOpeningLayId, { EgtSP( nGuideId), EgtUP( nGuideId, dParMid), EgtUP( nGuideId, dParE - 1)}) + -- tratteggio + if bStippled then + EgtSetStipple( nCrv, nFactor, nPattern) + end + + elseif nOpeningType == WIN_OPENING_TYPES.TILTTURN_RIGHT or nOpeningType == WIN_OPENING_TYPES.TURNONLY_RIGHT then + -- battente dx + local dLenRight = EgtCurveCompoLength( nGuideId, 1) + local dLenLeft = EgtCurveCompoLength( nGuideId, dParE - 1) + local dParMid = dParE - 0.5 + -- se lato destro è il più corto, prendo sul sinistro il corrispondente del suo punto medio + if dLenRight < dLenLeft - GEO.EPS_SMALL then + dParMid = EgtCurveParamAtLength( nGuideId, EgtCurveLength( nGuideId) - dLenRight * 0.5) + end + local nCrv = EgtCurveCompoFromPoints( nOpeningLayId, { EgtUP( nGuideId, 1), EgtUP( nGuideId, dParMid), EgtUP( nGuideId, 2)}) + -- tratteggio + if bStippled then + EgtSetStipple( nCrv, nFactor, nPattern) + end + + elseif nOpeningType == WIN_OPENING_TYPES.COPLANARSLIDE_LEFT or nOpeningType == WIN_OPENING_TYPES.COPLANARSLIDE_RIGHT or + nOpeningType == WIN_OPENING_TYPES.LIFTSLIDE_LEFT or nOpeningType == WIN_OPENING_TYPES.LIFTSLIDE_RIGHT then + -- scorrevole e alzante scorrevole ( solo forma rettangolare) + local bRight = ( nOpeningType == WIN_OPENING_TYPES.COPLANARSLIDE_RIGHT or nOpeningType == WIN_OPENING_TYPES.LIFTSLIDE_RIGHT) + local dLen0 = EgtCurveCompoLength( nGuideId, 0) + local dLen1 = EgtCurveCompoLength( nGuideId, 1) + local dCoeff = 0.15 + local ptS = EgtUP( nGuideId, 1.5) - dCoeff * dLen0 * X_AX() + local ptE = EgtUP( nGuideId, dParE - 0.5) + dCoeff * dLen0 * X_AX() + if bRight then + ptS, ptE = ptE, ptS + end + local nCompo = EgtCurveCompoFromPoints( nOpeningLayId, { ptS, ptE}) + if nOpeningType == WIN_OPENING_TYPES.COPLANARSLIDE_LEFT or nOpeningType == WIN_OPENING_TYPES.COPLANARSLIDE_RIGHT then + EgtAddCurveCompoLine( nCompo, ptS - dCoeff * dLen1 * Y_AX(), false) + end + local dAng = EgtIf( bRight, 135, 45) + EgtLinePDL( nOpeningLayId, ptE, dAng, dCoeff * dLen0) + EgtLinePDL( nOpeningLayId, ptE, - dAng, dCoeff * dLen0) + + elseif nOpeningType == WIN_OPENING_TYPES.FIXED then + -- nessun disegno + + elseif nOpeningType == WIN_OPENING_TYPES.PIVOT then + -- bilico rettangolare + local nCompo = EgtCurveCompoFromPoints( nOpeningLayId, { EgtUP( nGuideId, 0.5), EgtUP( nGuideId, 1.5), EgtUP( nGuideId, 2.5), EgtUP( nGuideId, 3.5)}) + EgtCloseCurveCompo( nCompo) + -- TODO oblò + end + + EgtErase( nGuideId) +end + +--------------------------------------------------------------------- +-- funzione che identifica la forma dell'anta/gruppo di ante +local function IdentifySashShape( nAreaId, nOutlineLayerId) + + local vOutlines = EgtGetAllInGroup( nOutlineLayerId) + local nCompoId = EgtCurveCompo( nOutlineLayerId, vOutlines, false) + + -- verifico se trapezio + local bTrap, ptOrig, vtB1, vtE1, vtB2 = EgtCurveIsATrapezoid( nCompoId) + if bTrap then + -- verifico se rettangolo controllando se lati sono paralleli + local vtE2 = vtB1 + vtE1 - vtB2 + if AreSameOrOppositeVectorApprox( vtE1, vtE2) then + EgtSetInfo( nAreaId, WIN_SASH_SHAPE, WIN_SASH_SHAPES.RECT) + else + EgtSetInfo( nAreaId, WIN_SASH_SHAPE, WIN_SASH_SHAPES.TRAP) + end + + else + -- verifico se cerchio + local bCircle = EgtCurveIsACircle( nCompoId) + if bCircle then + EgtSetInfo( nAreaId, WIN_SASH_SHAPE, WIN_SASH_SHAPES.CIRCLE) + + -- verifico se forma con arco + elseif #vOutlines == 4 and EgtGetType( vOutlines[3]) == GDB_TY.CRV_ARC then + local dAngCenter = EgtArcAngCenter( vOutlines[3]) + if abs( dAngCenter - 180) < GEO.EPS_SMALL then + EgtSetInfo( nAreaId, WIN_SASH_SHAPE, WIN_SASH_SHAPES.ROUND_ARC) + else + if abs( EgtCurveLength( vOutlines[2]) - EgtCurveLength( vOutlines[4])) < GEO.EPS_SMALL then + EgtSetInfo( nAreaId, WIN_SASH_SHAPE, WIN_SASH_SHAPES.SEGMENTAL_ARC) + else + -- verifico se metà di arco a tutto sesto o ribassato + if AreSameVectorApprox( EgtEV( vOutlines[2]), EgtSV( vOutlines[3])) or AreSameVectorApprox( EgtEV( vOutlines[3]), EgtSV( vOutlines[4])) then + EgtSetInfo( nAreaId, WIN_SASH_SHAPE, WIN_SASH_SHAPES.SEMI_ROUND_ARC) + else + EgtSetInfo( nAreaId, WIN_SASH_SHAPE, WIN_SASH_SHAPES.SEMI_SEGMENTAL_ARC) + end + end + end + else + EgtSetInfo( nAreaId, WIN_SASH_SHAPE, WIN_SASH_SHAPES.GENERIC) + end + end + + EgtErase( nCompoId) +end + +--------------------------------------------------------------------- +-- funzione che corregge i profili del telaio individuati di tipo mixed dallo split +local function AdjustMixedFrames( vOutlines) + -- pezzi consecutivi coinvolti da cambio profilo devono avere : profilo di tipo mixed, stesse dimensioni, separazione con giunzione a bisettrice + if vOutlines == 1 then return end + + -- fisso come dimensione quella del primo pezzo + local dDimRef = EgtGetInfo( vOutlines[1], WIN_PART_DIM, 'd') + + for i = 1, #vOutlines do + local bMixed = EgtGetInfo( vOutlines[i], WIN_PRF_CHANGE, 'b') or false + local dDim = EgtGetInfo( vOutlines[i], WIN_PART_DIM, 'd') + -- se non era stato individuato correttamente come profilo mixed oppure la dimensione va modificata ricalcolo il profilo + if not bMixed or abs( dDim - dDimRef) > GEO.EPS_SMALL then + if not bMixed then + EgtSetInfo( vOutlines[i], WIN_PRF_CHANGE, true) + local sRealProfile = EgtIf( EgtGetName( vOutlines[i]) == WIN_BOTTOM, WIN_MIXED_BOTTOM, WIN_MIXED_TOP) + EgtSetInfo( vOutlines[i], WIN_PROFILETYPE, sRealProfile) + end + if abs( dDim - dDimRef) > GEO.EPS_SMALL then + EgtSetInfo( vOutlines[i], WIN_PART_DIM, dDimRef) + end + local nPartId = EgtGetInfo( vOutlines[i], WIN_REF_PART, 'i') + CreatePartProfile( nPartId, vOutlines[i], dDimRef) + end + + -- imposto giunzione + if i ~= 1 then + EgtSetInfo( vOutlines[i], WIN_STARTJOINT, WIN_PART_JNT.ANGLED) + end + if i ~= #vOutlines then + EgtSetInfo( vOutlines[i], WIN_ENDJOINT, WIN_PART_JNT.ANGLED) + end + end +end + +--------------------------------------------------------------------- -- funzione che verifica gli outlines prev/next per lo split controllando l'interferenza tra i profili local function TestSplitTrimOutlines( nOutlineId, vBaseTrimOutlines, tabOutlines, nMainProfile, b3Profile, nGrpTmp, bPrevOrNext) @@ -1348,15 +1960,12 @@ local function GetSplitPrevNextOutline( nSplitId) local vNextOutlineId = TestSplitTrimOutlines( nSplitId, vNextBaseOutlineId, tabOutlines, nMainProfile, b3Profile, nGrpTmp, false) EgtSetInfo( nSplitId, WIN_NEXT_OUTLINES, vNextOutlineId) - -- se split di tipo mixed il pezzo che incontra deve essere di tipo cambio profilo anche se ha una sola tipologia di figli + -- se split di tipo mixed i pezzi che incontra deve essere di tipo mixed ( anche se avevo trovato una sola tipologia di figli), devono essere separati da giunzione + -- a bisettrice e devono avere le stesse dimensioni. Impongo queste condizioni eventualmente ricalcolando i profili local bChangeProfile = EgtGetInfo( nSplitId, WIN_PRF_CHANGE, 'b') or false if bChangeProfile then - for i = 1, #vPrevOutlineId do - EgtSetInfo( vPrevOutlineId[i], WIN_PRF_CHANGE, true) - end - for i = 1, #vNextOutlineId do - EgtSetInfo( vNextOutlineId[i], WIN_PRF_CHANGE, true) - end + AdjustMixedFrames( vPrevOutlineId) + AdjustMixedFrames( vNextOutlineId) end EgtErase( nGrpTmp) @@ -1442,7 +2051,7 @@ local function CalculateVirtualAreaOutline( nAreaId, dZmove) end --------------------------------------------------------------------- -local function CalculateSplitOutline( nAreaId) +local function CalculateSplitOutline( nAreaId, sName) -- copio il layer di base outline local nBaseSplitLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_BASESPLIT) @@ -1482,6 +2091,8 @@ local function CalculateSplitOutline( nAreaId) end -- sistemo gli outline degli split + local vSplitDim = EgtGetInfo( nAreaId, WIN_PART_DIM, 'vd') or {} + for i = 1, #vSplitIds do -- sistemo le info EgtSetInfo( vBaseSplitIds[i], WIN_COPY, vSplitIds[i]) @@ -1492,9 +2103,21 @@ local function CalculateSplitOutline( nAreaId) EgtMove( vSplitIds[i], Z_AX() * dZMove) if nSplitType ~= WIN_SPLITTYPES.FRENCH then + EgtSetInfo( vSplitIds[i], WIN_PART_DIM, vSplitDim[i]) + -- imposto le giunzioni + EgtSetInfo( vSplitIds[i], WIN_STARTJOINT, WIN_PART_JNT.SHORT) + EgtSetInfo( vSplitIds[i], WIN_ENDJOINT, WIN_PART_JNT.SHORT) + -- creo il pezzo + CreateOutlinePart( vSplitIds[i], sName, vSplitDim[i]) + -- ricavo prev e next GetSplitPrevNextOutline( vSplitIds[i]) end end + + if nSplitType == WIN_SPLITTYPES.FRENCH then + local nOutlineLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_OUTLINE) + IdentifySashShape( nAreaId, nOutlineLayerId) + end end --------------------------------------------------------------------- @@ -1514,8 +2137,7 @@ local function CalculateFillOutline( nAreaId, nAreaLayerId, nOutlineLayerId) -- 1) calcolo l'area complessiva di fill definita dal suo parent local nParentOutlineLayer = EgtGetFirstNameInGroup( nParentArea, WIN_OUTLINE) - local vAdjustIds = {} - local dRefOffs, dRefDelta + local dDeltaZ = 0 local nParentOutlineId = EgtGetFirstInGroup( nParentOutlineLayer) while nParentOutlineId do -- copio la curva di outline del parent @@ -1528,36 +2150,22 @@ local function CalculateFillOutline( nAreaId, nAreaLayerId, nOutlineLayerId) local dOverlap = EgtGetInfo( nParentProfileId, WIN_FILLOVERLAP, 'd') if dOverlap then local dDimRef = b3FrameProfile:getMin():getX() - local dFillPerpOffset = abs( dDimRef) - dOverlap - if EgtGetName( nParentProfileId) == WIN_FILL_RAIL then - -- se bottom rail considero la distanza necessaria per il numero di bottomrail richiesti - local nBottomRails = EgtGetInfo( nParentOutlineId, WIN_BOTTOMRAIL, 'i') - local dRailDelta1 = EgtGetInfo( nParentProfileId, WIN_RAILDELTA .. '1', 'd') - local dRailDelta2 = EgtGetInfo( nParentProfileId, WIN_RAILDELTA .. '2', 'd') - dFillPerpOffset = dFillPerpOffset + dRailDelta1 + ( nBottomRails - 1) * dRailDelta2 - end + -- verifico se contributo per bottomrail + local dRailOffs = EgtGetInfo( nParentProfileId, WIN_RAILOFFS, 'd') or 0 + local dFillPerpOffset = abs( dDimRef) - dOverlap + dRailOffs EgtOffsetCurve( nOutlineId, - dFillPerpOffset) -- movimento in z - local dFillZOffset = EgtGetInfo( nParentProfileId, WIN_FILLDELTA, 'd') - EgtMove( nOutlineId, Z_AX() * dFillZOffset) - -- salvo valori come riferimenti per eventuali correzioni - dRefOffs = - dFillPerpOffset - dRefDelta = dFillZOffset - else - -- se fill overlap non è definito ( come nel caso di alcuni pezzi di telaio con cambio profilo) salvo la curva per correggerla in seguito - table.insert( vAdjustIds, nOutlineId) + if dDeltaZ < GEO.EPS_SMALL then + dDeltaZ = EgtGetInfo( nParentProfileId, WIN_FILLDELTA, 'd') + end end nParentOutlineId = EgtGetNext( nParentOutlineId) end - -- sistemo tratti che non avevano valori definiti nel profilo - for i = 1, #vAdjustIds do - EgtOffsetCurve(vAdjustIds[i], dRefOffs) - EgtMove( vAdjustIds[i], dRefDelta * Z_AX()) - end -- accorcio gli offset local vCrvs = TrimOrderedCurves( EgtGetAllInGroup( nOutlineLayerId), 1) - + -- applico spostamento verticale + EgtMove( vCrvs, Z_AX() * dDeltaZ) -- 2) taglio con split if #vSplitAreas == 0 then @@ -1644,7 +2252,7 @@ local function CalculateFillOutline( nAreaId, nAreaLayerId, nOutlineLayerId) end --------------------------------------------------------------------- --- funzione che calcola l'outline dall'area outline ( base outline) +-- funzione che calcola l'outline dal base outline e i pezzi associati local function CalculateOutlineFromAreaOutline( nAreaId) local nAreaType = EgtGetInfo( nAreaId, WIN_AREATYPE, 'i') @@ -1653,24 +2261,25 @@ local function CalculateOutlineFromAreaOutline( nAreaId) local nOutlineLayerId = EgtGroup( nAreaId) EgtSetName( nOutlineLayerId, WIN_OUTLINE) EgtSetStatus( nOutlineLayerId, GDB_ST.OFF) - CopyInfo( nOutlineLayerId, nAreaOutlineLayerId, WIN_JOINTS) + + local sName = CalcPartName( nAreaId, nAreaType) -- FRAME if nAreaType == WIN_AREATYPES.FRAME then - -- sistemo le info - local nAreaOutlineId = EgtGetFirstInGroup( nAreaOutlineLayerId) - while nAreaOutlineId do - local nOutlineId = EgtCopyGlob( nAreaOutlineId, nOutlineLayerId) - EgtSetInfo( nAreaOutlineId, WIN_COPY, nOutlineId) - EgtSetInfo( nOutlineId, WIN_COPY, nAreaOutlineId) - -- se bottom riporto informazione dei bottomrail - if EgtGetName( nOutlineId) == WIN_BOTTOM then - CopyInfo( nOutlineId, nAreaId, WIN_BOTTOMRAIL) - end - nAreaOutlineId = EgtGetNext( nAreaOutlineId) + local vBaseOutlines = EgtGetAllInGroup( nAreaOutlineLayerId) + local vOutlines = {} + for i = 1, #vBaseOutlines do + vOutlines[i] = EgtCopyGlob( vBaseOutlines[i], nOutlineLayerId) + EgtSetInfo( vBaseOutlines[i], WIN_COPY, vOutlines[i]) + EgtSetInfo( vOutlines[i], WIN_COPY, vBaseOutlines[i]) end GetPrevNextOutline( nOutlineLayerId) - + -- sistemo le giunzioni + local vJoints = EgtGetInfo( nAreaId, WIN_JOINTS, 'vi') + GetOutlineJoints( vOutlines, vJoints) + -- creo i pezzi + CreatePartsFromOutlines( vOutlines, nAreaId, sName) + -- SPLIT / NULL elseif nAreaType == WIN_AREATYPES.SPLIT or nAreaType == WIN_AREATYPES.NULL then @@ -1711,7 +2320,7 @@ local function CalculateOutlineFromAreaOutline( nAreaId) -- b) split if nAreaType == WIN_AREATYPES.SPLIT then - CalculateSplitOutline( nAreaId) + CalculateSplitOutline( nAreaId, sName) end @@ -1719,45 +2328,36 @@ local function CalculateOutlineFromAreaOutline( nAreaId) elseif nAreaType == WIN_AREATYPES.SASH then -- recupero se anta battente ricevente local nSashType = EgtGetInfo( nAreaId, WIN_SASHTYPE, 'i') or WIN_SASHTYPES.NULL - - -- recupero gruppo profili anta e telaio + -- recupero gruppo profili anta local nProfileLayerId = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_PROFILE) local nSashProfileLayerId = EgtGetFirstNameInGroup( nProfileLayerId, WIN_SASH) - local nFrameProfileLayerId = EgtGetFirstNameInGroup( nProfileLayerId, WIN_FRAME) - -- ciclo su profilo disegnato anta - local nBaseOutlineId = EgtGetFirstInGroup( nAreaOutlineLayerId) - while nBaseOutlineId do + local vBaseOutlineIds = EgtGetAllInGroup( nAreaOutlineLayerId) + for i = 1, #vBaseOutlineIds do -- recupero la curva di outline del base outline da cui deriva e la copio - local nSouId = EgtGetInfo( nBaseOutlineId, WIN_SOU, 'i') + local nSouId = EgtGetInfo( vBaseOutlineIds[i], WIN_SOU, 'i') local nCopyId = EgtGetInfo( nSouId, WIN_COPY, 'i') or GDB_ID.NULL local nOutlineId = EgtCopy( nCopyId, nOutlineLayerId) if nOutlineId then - -- recupero profilo - local sSashProfile = EgtGetInfo( nBaseOutlineId, WIN_PROFILETYPE) + -- recupero profilo e ricavo l'offset in z dell'anta ( può essere fatto sui profili teorici perchè non cambia con le dimensioni) + local sSashProfile = EgtGetInfo( vBaseOutlineIds[i], WIN_PROFILETYPE) local nSashProfileId = EgtGetFirstNameInGroup( nSashProfileLayerId, sSashProfile) - - -- calcolo offset sulla z dell'anta local dSashZOffset = EgtGetInfo( nSashProfileId, WIN_DELTA, 'd') - - -- sposto anta in Z EgtMove( nOutlineId, Z_AX() * dSashZOffset) -- sistemo le info - EgtSetInfo( nBaseOutlineId, WIN_COPY, nOutlineId) - EgtSetInfo( nOutlineId, WIN_COPY, nBaseOutlineId) - EgtSetInfo( nOutlineId, WIN_PROFILETYPE, sSashProfile) - if EgtGetName( nOutlineId) == WIN_BOTTOM then - CopyInfo( nOutlineId, nAreaId, WIN_BOTTOMRAIL) - end EgtRemoveInfo( nOutlineId, WIN_PRF_CHANGE) EgtRemoveInfo( nOutlineId, WIN_REF_SPLIT) EgtRemoveInfo( nOutlineId, WIN_INV_SPLIT) EgtRemoveInfo( nOutlineId, WIN_THRESHOLD) - - -- verifico se outline e' segmento battente o ricevente ( che quindi deriva da split di tipo french) - local bOnFrenchSplit = EgtGetInfo( nBaseOutlineId, WIN_CRV_ON_FRENCH_SPLIT, 'b') or false + EgtRemoveInfo( nOutlineId, WIN_PART_DIM) + EgtSetInfo( vBaseOutlineIds[i], WIN_COPY, nOutlineId) + EgtSetInfo( nOutlineId, WIN_COPY, vBaseOutlineIds[i]) + EgtSetInfo( nOutlineId, WIN_PROFILETYPE, sSashProfile) + + -- verifico se outline è segmento battente o ricevente ( che quindi deriva da split di tipo french) + local bOnFrenchSplit = EgtGetInfo( vBaseOutlineIds[i], WIN_CRV_ON_FRENCH_SPLIT, 'b') or false if not bOnFrenchSplit then -- se outline non è segmento battente o ricevente necessita di offset -- recupero a ritroso il profilo dell'elemento del frame su cui poggia @@ -1767,43 +2367,51 @@ local function CalculateOutlineFromAreaOutline( nAreaId) nFrameBaseOutlineId = EgtGetInfo( nFrameBaseOutlineId, WIN_SOU , 'i') sFrameProfile = EgtGetInfo( nFrameBaseOutlineId or GDB_ID.NULL, WIN_PROFILETYPE) end - local nFrameProfileId = EgtGetFirstNameInGroup( nFrameProfileLayerId, sFrameProfile) + local nFrameOutlineId = EgtGetInfo( nFrameBaseOutlineId, WIN_COPY, 'i') + local nFrameProfileId = GetOutlineProfileId( nFrameOutlineId, false) - -- calcolo il box del riferimento del profilo del frame - local b3FrameProfile = GetProfileLocalBox( nFrameProfileId) -- calcolo offset perpendicolare + local b3FrameProfile = GetProfileLocalBox( nFrameProfileId) local sOverlapInfo = EgtIf( EgtGetName( nOutlineId) == WIN_BOTTOM, WIN_SASH_BOTTOM_OVERLAP, WIN_SASH_TOP_OVERLAP) local dOverlap = EgtGetInfo( nFrameProfileId, sOverlapInfo, 'd') local dSashPerpOffset = abs( b3FrameProfile:getMin():getX()) - dOverlap - - -- faccio offset EgtOffsetCurve( nOutlineId, - dSashPerpOffset) else -- se deriva da french split sistemo il nome - local sBaseName = EgtGetName( nBaseOutlineId) + local sBaseName = EgtGetName( vBaseOutlineIds[i]) EgtSetName( nOutlineId, sBaseName) -- controllo l'orientamento - local nCrvRef = EgtGetPrev( nBaseOutlineId) or EgtGetNext( nBaseOutlineId) + local nCrvRef = EgtGetPrev( vBaseOutlineIds[i]) or EgtGetNext( vBaseOutlineIds[i]) local _, _, nSide = EgtPointCurveDistSide( EgtMP( nCrvRef), nOutlineId, Z_AX()) if nSide == 1 then EgtInvertCurve( nOutlineId) end end end - - nBaseOutlineId = EgtGetNext( nBaseOutlineId) end + -- accorcio gli offset local vOutlines = TrimOrderedCurves( EgtGetAllInGroup( nOutlineLayerId), 1) -- assegno prev e next GetPrevNextOutline( nOutlineLayerId) + -- sistemo le giunzioni + local vJoints = EgtGetInfo( nAreaId, WIN_JOINTS, 'vi') + GetOutlineJoints( vOutlines, vJoints) + -- creo i pezzi + CreatePartsFromOutlines( vOutlines, nAreaId, sName) + -- identifico la forma + IdentifySashShape( nAreaId, nOutlineLayerId) + -- disegno apertura + DrawOpening( nAreaId) + -- FILL elseif nAreaType == WIN_AREATYPES.FILL then CalculateFillOutline( nAreaId, nAreaOutlineLayerId, nOutlineLayerId) + -- creo il pezzo associato + CreateFillPartFromArea( nAreaId, sName) end - end --------------------------------------------------------------------- @@ -2098,94 +2706,6 @@ local function CalcGeoRegion( vCrvs, nGrp) return nSurfId end ---------------------------------------------------------------------- --- funzione che dato il tipo di pezzo giunzione e di pezzo ( orizzontale o verticale) restituisce se è corto, lungo o angolato -local function CalcPartJoint( nJointType, bHorizontal) - - if nJointType == WIN_JNT.ANGLED then - return WIN_PART_JNT.ANGLED - elseif nJointType == WIN_JNT.FULL_H then - if bHorizontal then - return WIN_PART_JNT.FULL - else - return WIN_PART_JNT.SHORT - end - elseif nJointType == WIN_JNT.FULL_V then - if bHorizontal then - return WIN_PART_JNT.SHORT - else - return WIN_PART_JNT.FULL - end - end -end - ---------------------------------------------------------------------- --- funzione che calcola e salva nel profilo il delta del bottomrail corrente rispetto alla sua curva di outline -local function SaveRailDelta( nProfileId, nBottomRail) - local dDelta1 = EgtGetInfo( nProfileId, WIN_RAILDELTA .. '1', 'd') - local dDelta2 = EgtGetInfo( nProfileId, WIN_RAILDELTA .. '2', 'd') - local dOffs = dDelta1 + ( nBottomRail - 1) * dDelta2 - EgtSetInfo( nProfileId, WIN_RAILDELTA, dOffs) -end - ---------------------------------------------------------------------- --- funzione che crea il gruppo con i profili di un pezzo -local function CalcProfiles( nPartId, nOutlineId, vPrevOutlineId, vNextOutlineId, nBottomRail) - - -- creo gruppo per i profili - local nProfileLayerId = EgtGroup( nPartId) - EgtSetName( nProfileLayerId, WIN_PROFILE) - EgtSetStatus( nProfileLayerId, GDB_ST.OFF) - - -- recupero profilo principale e ne creo copia - local nOrigMainProfileId = GetOutlineProfileId( nOutlineId, false, nBottomRail) - local nMainProfileId = EgtCopy( nOrigMainProfileId, nProfileLayerId) - local sMainProfileType = EgtGetName( nMainProfileId) - EgtSetInfo( nMainProfileId, WIN_PROFILETYPE, sMainProfileType) - EgtSetName( nMainProfileId, WIN_PRF_MAIN) - -- se bottomrail salvo info per scostamento dall'outline - if sMainProfileType == WIN_FILL_RAIL or sMainProfileType == WIN_RAIL then - SaveRailDelta( nMainProfileId, nBottomRail) - end - - -- recupero profili start e ne creo copia - -- se il tipo corrente è split il pezzo va tagliato con il bottomrail, altrimenti con il bottom - for i = 1, #vPrevOutlineId do - local nOrigStartProfileId = GetOutlineProfileId( abs( vPrevOutlineId[i]), EgtGetName( nOutlineId) == WIN_SPLIT) - local nStartProfileId = EgtCopy( nOrigStartProfileId, nProfileLayerId) - local sStartProfileType = EgtGetName( nStartProfileId) - EgtSetInfo( nStartProfileId, WIN_PROFILETYPE, sStartProfileType) - EgtSetName( nStartProfileId, WIN_PRF_START) - if sStartProfileType == WIN_FILL_RAIL then - local nBottomRailTot = EgtGetInfo( abs( vPrevOutlineId[i]), WIN_BOTTOMRAIL, 'i') - SaveRailDelta( nStartProfileId, nBottomRailTot) - end - end - - -- recupero profili end e ne creo copia - for i = 1, #vNextOutlineId do - local nOrigEndProfileId = GetOutlineProfileId( abs( vNextOutlineId[i]), EgtGetName( nOutlineId) == WIN_SPLIT) - local nEndProfileId = EgtCopy( nOrigEndProfileId, nProfileLayerId) - local sEndProfileType = EgtGetName( nEndProfileId) - EgtSetInfo( nEndProfileId, WIN_PROFILETYPE, sEndProfileType) - EgtSetName( nEndProfileId, WIN_PRF_END) - if sEndProfileType == WIN_FILL_RAIL then - local nBottomRailTot = EgtGetInfo( abs( vNextOutlineId[i]), WIN_BOTTOMRAIL, 'i') - SaveRailDelta( nEndProfileId, nBottomRailTot) - end - end - - -- recupero le info di pinzaggio dal profilo di estrusione - CopyInfo( nPartId, nMainProfileId, WIN_PRC_OFFY_1, 0) - CopyInfo( nPartId, nMainProfileId, WIN_PRC_OFFZ_1, 0) - CopyInfo( nPartId, nMainProfileId, WIN_PRC_OFFY_2, 0) - CopyInfo( nPartId, nMainProfileId, WIN_PRC_OFFZ_2, 0) - CopyInfo( nPartId, nMainProfileId, WIN_PRC_CLAMPV_1, 0) - CopyInfo( nPartId, nMainProfileId, WIN_PRC_CLAMPV_2, 0) - - return nProfileLayerId -end - --------------------------------------------------------------------- local function GetDeltaProfile( nProfileId, sCtrIn) @@ -2202,7 +2722,7 @@ local function GetDeltaProfile( nProfileId, sCtrIn) -- se bottomrail considero anche scostamento dall'outline local sProfileType = EgtGetInfo( nProfileId, WIN_PROFILETYPE) if sProfileType == WIN_FILL_RAIL then - local dDelta = EgtGetInfo( nProfileId, WIN_RAILDELTA, 'd') + local dDelta = EgtGetInfo( nProfileId, WIN_RAILOFFS, 'd') dCPDelta = dCPDelta + dDelta end return dCPDelta @@ -2289,7 +2809,7 @@ local function CreateGeoCurves( nOutlineId, vPrevOutlineId, vNextOutlineId, nSta local sProfileType = EgtGetInfo( nCurrProfileId, WIN_PROFILETYPE) if sProfileType == WIN_FILL_RAIL or sProfileType == WIN_RAIL then -- scostamento extra legato al bottomrail - local dDelta = EgtGetInfo( nCurrProfileId, WIN_RAILDELTA, 'd') + local dDelta = EgtGetInfo( nCurrProfileId, WIN_RAILOFFS, 'd') dCurrOffset = dCurrOffset - dDelta end @@ -2498,82 +3018,24 @@ local function CalcGeo( nPartId, nOutlineId) -- creo layer per ingombro local nGeoLayerId = EgtGroup( nPartId) EgtSetName( nGeoLayerId, WIN_GEO) - - -- recupero outline precedenti e successivi - local vPrevOutlineId = EgtGetInfo( nOutlineId, WIN_PREV_OUTLINES, 'vi') - local vNextOutlineId = EgtGetInfo( nOutlineId, WIN_NEXT_OUTLINES, 'vi') - - local nBottomRail = EgtGetInfo( nPartId, WIN_BOTTOMRAIL, 'i') - local bMixed = EgtGetInfo( nOutlineId, WIN_PRF_CHANGE, 'b') or false -- recupero il tipo di giunzioni local nStartJoint local nEndJoint - - if EgtGetName( nOutlineId) == WIN_SPLIT or nBottomRail then - -- se split o bottomrail la giunzione deve essere short + local nBottomRail = EgtGetInfo( nPartId, WIN_BOTTOMRAIL, 'i') + if nBottomRail then + -- se bottomrail deve essere short ( l'info sulla curva di riferisce al pezzo bottom) nStartJoint = WIN_PART_JNT.SHORT nEndJoint = WIN_PART_JNT.SHORT - else - -- recupero i joints opportuni dal vettore - local nOutlineLayerId = EgtGetParent( nOutlineId) - local vJoints = EgtGetInfo( nOutlineLayerId, WIN_JOINTS, 'vi') - if EgtGetName( nOutlineId) == WIN_BOTTOM then - nStartJoint = CalcPartJoint( vJoints[1], true) - nEndJoint = CalcPartJoint( vJoints[2], true) - elseif EgtGetName( nOutlineId) == WIN_RIGHT then - nStartJoint = CalcPartJoint( vJoints[2], false) - nEndJoint = CalcPartJoint( vJoints[3], false) - elseif EgtGetName( nOutlineId) == WIN_TOP then - nStartJoint = CalcPartJoint( vJoints[3], true) - nEndJoint = CalcPartJoint( vJoints[4], true) - -- correzioni per caso a triangolo : se l'outline vicino è di tipo bottom, il corrente deve essere trattato come un pezzo verticale - if EgtGetName( abs( vPrevOutlineId[#vPrevOutlineId])) == WIN_BOTTOM then - nStartJoint = CalcPartJoint( vJoints[2], false) - nEndJoint = CalcPartJoint( vJoints[3], true) - end - if EgtGetName( abs( vNextOutlineId[1])) == WIN_BOTTOM then - nStartJoint = CalcPartJoint( vJoints[3], true) - nEndJoint = CalcPartJoint( vJoints[1], false) - end - elseif EgtGetName( nOutlineId) == WIN_LEFT then - nStartJoint = CalcPartJoint( vJoints[4] or vJoints[3], false) -- ( vJoints[3] per gestire caso a triangolo) - nEndJoint = CalcPartJoint( vJoints[1], false) - end - - -- se giunzione diversa da bisettrice ed elementi in tangenza ( entro 6°) o dello stesso tipo o entrambi con cambio profilo, forzo il tipo a bisettrice - if nStartJoint ~= WIN_PART_JNT.ANGLED then - local bMixedPrev = EgtGetInfo( vPrevOutlineId[1], WIN_PRF_CHANGE, 'b') or false - if EgtEV( abs( vPrevOutlineId[1])) * EgtSV( nOutlineId) > s_dAngledCos or EgtGetName( nOutlineId) == EgtGetName( abs( vPrevOutlineId[1])) or ( bMixed and bMixedPrev) then - nStartJoint = WIN_PART_JNT.ANGLED - end - end - if nEndJoint ~= WIN_PART_JNT.ANGLED then - local bMixedNext = EgtGetInfo( vNextOutlineId[1], WIN_PRF_CHANGE, 'b') or false - if EgtEV( nOutlineId) * EgtSV( abs( vNextOutlineId[1])) > s_dAngledCos or EgtGetName( nOutlineId) == EgtGetName( abs( vNextOutlineId[1])) or ( bMixed and bMixedNext) then - nEndJoint = WIN_PART_JNT.ANGLED - end - end - end - - -- nel caso di incontro con soglia la giunzione deve essere short - if EgtGetInfo( abs( vPrevOutlineId[1]), WIN_THRESHOLD, 'b') then - nStartJoint = WIN_PART_JNT.SHORT - end - if EgtGetInfo( abs( vNextOutlineId[1]), WIN_THRESHOLD, 'b') then - nEndJoint = WIN_PART_JNT.SHORT - end - - -- salvo il valore dei joints su outline - -- se bottomrail è sicuramente short quindi non salvo il valore che sovrascriverebbe quello del pezzo bottom ( che potrebbe essere short o full) - if not nBottomRail then - EgtSetInfo( nOutlineId, WIN_STARTJOINT, nStartJoint) - EgtSetInfo( nOutlineId, WIN_ENDJOINT, nEndJoint) + nStartJoint = EgtGetInfo( nOutlineId, WIN_STARTJOINT, 'i') + nEndJoint = EgtGetInfo( nOutlineId, WIN_ENDJOINT, 'i') end - -- creo il gruppo con i profili del pezzo - local nProfileLayerId = CalcProfiles( nPartId, nOutlineId, vPrevOutlineId, vNextOutlineId, nBottomRail) + -- aggiungo al gruppo profili quelli di trim + local vPrevOutlineId = EgtGetInfo( nOutlineId, WIN_PREV_OUTLINES, 'vi') + local vNextOutlineId = EgtGetInfo( nOutlineId, WIN_NEXT_OUTLINES, 'vi') + local nProfileLayerId = CalcStartEndProfiles( nPartId, nOutlineId, vPrevOutlineId, vNextOutlineId) -- creo lati dell'outline CreateGeoCurves( nOutlineId, vPrevOutlineId, vNextOutlineId, nStartJoint, nEndJoint, nGeoLayerId, nProfileLayerId) @@ -2636,26 +3098,28 @@ local function CalcMixedMillings( vOutlines, nOutlineProfileId, nSplitId, nSplit local ptRef = EgtIf( bPrev, EgtSP( nSplitId), EgtEP( nSplitId)) -- calcolo le curve di riferimento per lo split + local b3SplitProfile = GetProfileLocalBox( nSplitProfileId) local dSplitFixedOffs = EgtGetInfo( nSplitProfileId, WIN_FIXED_REF, 'd') - local nCrvSF = EgtOffsetCurveAdv( nSplitId, dSplitFixedOffs) + local nCrvSF = EgtOffsetCurveAdv( nSplitId, b3SplitProfile:getMax():getX() - dSplitFixedOffs) EgtRelocateGlob( nCrvSF, nGrpTmp) local dSplitSashOffs1 = EgtGetInfo( nSplitProfileId, WIN_SASH_REF .. '1', 'd') - local nCrvSS1 = EgtOffsetCurveAdv( nSplitId, - dSplitSashOffs1) + local nCrvSS1 = EgtOffsetCurveAdv( nSplitId, b3SplitProfile:getMin():getX() + dSplitSashOffs1) EgtRelocateGlob( nCrvSS1, nGrpTmp) local dSplitSashOffs2 = EgtGetInfo( nSplitProfileId, WIN_SASH_REF .. '2', 'd') - local nCrvSS2 = EgtOffsetCurveAdv( nSplitId, - dSplitSashOffs2) + local nCrvSS2 = EgtOffsetCurveAdv( nSplitId, b3SplitProfile:getMin():getX() + dSplitSashOffs2) EgtRelocateGlob( nCrvSS2, nGrpTmp) -- calcolo le curve di riferimento prev local nOutlineCompo = EgtCurveCompo( nGrpTmp, vOutlines, false) + local b3FrameProfile = GetProfileLocalBox( nOutlineProfileId) local dFrameFixedOffs = EgtGetInfo( nOutlineProfileId, WIN_FIXED_REF, 'd') - local nCrvFF = EgtOffsetCurveAdv( nOutlineCompo, - dFrameFixedOffs) + local nCrvFF = EgtOffsetCurveAdv( nOutlineCompo, b3FrameProfile:getMin():getX() + dFrameFixedOffs) local dFrameSashOffs1 = EgtGetInfo( nOutlineProfileId, WIN_SASH_REF .. '1', 'd') - local nCrvFS1 = EgtOffsetCurveAdv( nOutlineCompo, - dFrameSashOffs1) + local nCrvFS1 = EgtOffsetCurveAdv( nOutlineCompo, b3FrameProfile:getMin():getX() + dFrameSashOffs1) local dFrameSashOffs2 = EgtGetInfo( nOutlineProfileId, WIN_SASH_REF .. '2', 'd') - local nCrvFS2 = EgtOffsetCurveAdv( nOutlineCompo, - dFrameSashOffs2) + local nCrvFS2 = EgtOffsetCurveAdv( nOutlineCompo, b3FrameProfile:getMin():getX() + dFrameSashOffs2) local dFrameExtra = EgtGetInfo( nOutlineProfileId, WIN_EXTRA_DIST, 'd') - local nCrvFIn = EgtOffsetCurveAdv( nOutlineCompo, - dFrameSashOffs2 + dFrameExtra) + local nCrvFIn = EgtOffsetCurveAdv( nOutlineCompo, b3FrameProfile:getMin():getX() + dFrameSashOffs2 + dFrameExtra) local dDepth = EgtGetInfo( nOutlineProfileId, WIN_SASH_DEPTH .. '2', 'd') @@ -2691,7 +3155,7 @@ local function CalcMixedMillings( vOutlines, nOutlineProfileId, nSplitId, nSplit EgtOffsetCurve( nBisectTool, - dDim1 * 0.5) EgtExtendCurveStartByLen( nBisectTool, 10) EgtExtendCurveEndByLen( nBisectTool, 10) - local nCrvSash = EgtOffsetCurveAdv( nOutlineCompo, - dFrameSashOffs1 - dDim1 * 0.5) + local nCrvSash = EgtOffsetCurveAdv( nOutlineCompo, b3FrameProfile:getMin():getX() + dFrameSashOffs1 - dDim1 * 0.5) local ptEnd = EgtIP( nCrvSash, nBisectTool, ptRef) local nCircle = EgtCircle( nGrpTmp, ptEnd, dDim1 * 0.5) local nCircle2 = EgtCircle( nGrpTmp, ptEnd, dDim2 * 0.5) @@ -2706,7 +3170,7 @@ local function CalcMixedMillings( vOutlines, nOutlineProfileId, nSplitId, nSplit local _, _, dPar4 = EgtPointCurveDist( ptEnd, nCrvFS1) local nMill2 = EgtCopyParamRange( nCrvFS1, min( dPar4, dPar3), max( dPar3, dPar4), nGrpTmp) - local nMilling + local nMilling if bPrev then nMilling = EgtCurveCompo( nGrpTmp, { nMill2, nMill1}) else @@ -2878,7 +3342,6 @@ local function CreateProfilingProcessingCurve( vCrvs, nPrevCrv, nSurfGeo, nProcL else local nGrpTmp = EgtGroup( nProcLayerId) - local dGeoOffs = EgtGetInfo( vCrvs[1], WIN_GEO_OFFS, 'd') local nProfileId = EgtGetParent( nSemiProfileId) local nFrameId = EgtGetFirstNameInGroup( nProfileId, WIN_SECTIONFRAME) local frFrame = EgtFR( nFrameId, GDB_ID.ROOT) @@ -2897,6 +3360,7 @@ local function CreateProfilingProcessingCurve( vCrvs, nPrevCrv, nSurfGeo, nProcL if nRefOutlineId < 0 then EgtInvertCurve( nOutlineId) end + local dGeoOffs = EgtGetInfo( vCrvs[i], WIN_GEO_OFFS, 'd') local nOrigInnerProcId = EgtOffsetCurveAdv( nOutlineId, dGeoOffs - dOffs) -- adatto la curva di lavorazione interna al pezzo @@ -2919,9 +3383,11 @@ local function CreateProfilingProcessingCurve( vCrvs, nPrevCrv, nSurfGeo, nProcL end -- se ottengo più tratti considero quello che ha porzione in comune con la curva originale if nCnt > 1 then + local nTestCrv = EgtOffsetCurveAdv( vCrvs[i], - dOffs) + EgtRelocateGlob( nTestCrv, nGrpTmp) local vOverlapCrvs = {} for nId = nInId, nInId + nCnt - 1 do - if CheckExtensionOverlap( nId, nOrigInnerProcId) then + if CheckExtensionOverlap( nId, nTestCrv) then table.insert( vOverlapCrvs, nId) end end @@ -3377,7 +3843,7 @@ local function CalcSolidGuide( nOutlineId, nSolidLayerId, nProfileId) -- se bottomrail sposto opportunamente la guida local sProfileType = EgtGetInfo( nProfileId, WIN_PROFILETYPE) if sProfileType == WIN_RAIL or sProfileType == WIN_FILL_RAIL then - local dOffs = EgtGetInfo( nProfileId, WIN_RAILDELTA, 'd') + local dOffs = EgtGetInfo( nProfileId, WIN_RAILOFFS, 'd') EgtOffsetCurve( nGuideId, - dOffs) end @@ -3841,10 +4307,10 @@ local function CalcDowels( nOrigOutlineId, nOrigPrevOutlineId, bSashOrFrame, nBo local nRefCrv if EgtGetName( nOutlineId) == WIN_BOTTOM then nRefCrv = nOutlineId - dOffs = EgtGetInfo( nProfileId, WIN_RAILDELTA, 'd') + dOffs = EgtGetInfo( nProfileId, WIN_RAILOFFS, 'd') else nRefCrv = nPrevOutlineId - dOffs = EgtGetInfo( nPrevProfileId, WIN_RAILDELTA, 'd') + dOffs = EgtGetInfo( nPrevProfileId, WIN_RAILOFFS, 'd') end EgtOffsetCurve( nRefCrv, - dOffs) end @@ -4132,8 +4598,7 @@ local function CalcSplitDowels( nSplitId, bStartOrEnd) -- nel layer dei profili del pezzo aggiungo il profilo dello split posizionato correttamente local nProfileLayerId = EgtGetFirstNameInGroup( nPartId, WIN_PROFILE) local nSplitProfileCopyId = EgtCopy( nSplitProfile, nProfileLayerId) - local sSplitProfileType = EgtGetName( nSplitProfile) - EgtSetInfo( nSplitProfileCopyId, WIN_PROFILETYPE, sSplitProfileType) + CopyInfo( nSplitProfileCopyId, nSplitProfile, WIN_PROFILETYPE) EgtSetName( nSplitProfileCopyId, WIN_PRF_SPLIT) -- posiziono il profilo sulla curva di split EgtTransform( EgtGetAllInGroup( nSplitProfileCopyId), frOrig, GDB_RT.GLOB) @@ -4316,7 +4781,7 @@ local function CreateStripGuideLines( nOutlineId, nRefOutlineId, nStripId, nProf local b3MainStrip = EgtGetBBoxRef( nStripId, GDB_BB.STANDARD, frProfile) -- calcolo offset per strip - local dDelta = EgtGetInfo( nProfileId, WIN_RAILDELTA, 'd') or 0 + local dDelta = EgtGetInfo( nProfileId, WIN_RAILOFFS, 'd') or 0 local dMinOffs = b3MainStrip:getMin():getX() - dDelta local dMaxOffs = b3MainStrip:getMax():getX() - dDelta @@ -4417,7 +4882,7 @@ local function CalcAreaStrip( nGeoFillId) local nGuideId = EgtCurveCompo( nSolidLayerId, nOutlineId, false) local sProfileType = EgtGetInfo( nProfileId, WIN_PROFILETYPE) if sProfileType == WIN_FILL_RAIL then - local dOffs = EgtGetInfo( nProfileId, WIN_RAILDELTA, 'd') + local dOffs = EgtGetInfo( nProfileId, WIN_RAILOFFS, 'd') EgtOffsetCurve( nGuideId, - dOffs) end -- estensione : se in tangenza con le vicine estensione in tangenza altrimenti estensione standard @@ -4559,336 +5024,52 @@ end ---------------------------------------------------------------------------------- ----------------------------- CALCOLO PEZZI ------------------------------------ ---------------------------------------------------------------------------------- --- funzione che stabilisce il nome del pezzo -local function CalcPartName( nAreaId, nAreaType) - - local sName = '' - if nAreaType == WIN_AREATYPES.FRAME then - sName = WIN_FRAME - EgtSetInfo( nAreaId, WIN_AREA_NAME, sName) - elseif nAreaType == WIN_AREATYPES.SASH then - s_nSashNbr = s_nSashNbr + 1 - sName = WIN_SASH .. '_'.. tostring( s_nSashNbr) - EgtSetInfo( nAreaId, WIN_AREA_NAME, sName) - else - -- per split o riempimento devo ricavare il nome del parent che lo contiene - local nParentId = EgtGetParent( nAreaId) - local nParentType = EgtGetInfo( nParentId, WIN_AREATYPE, 'i') - while nParentType ~= WIN_AREATYPES.FRAME and nParentType ~= WIN_AREATYPES.SASH do - nParentId = EgtGetParent( nParentId) - nParentType = EgtGetInfo( nParentId, WIN_AREATYPE, 'i') - end - sName = EgtGetInfo( nParentId, WIN_AREA_NAME, sName) - end - - return sName -end - ---------------------------------------------------------------------- --- funzione che disegna l'apertura dell'anta -local function DrawOpening( nAreaId) - - local nOpeningType = EgtGetInfo( nAreaId, WIN_OPENING_TYPE, 'i') - if nOpeningType == WIN_OPENING_TYPES.NULL then - return - end - - -- creo gruppo per aperture - local nOpeningLayId = EgtGroup( nAreaId) - EgtSetName( nOpeningLayId, WIN_SASH_OPENING) - - -- verifico se anta ricevente per impostare tratteggio - local nFactor = 7 - local nPattern = 0xAAAA - local nType = EgtGetInfo( nAreaId, WIN_SASHTYPE, 'i') - local bStippled = ( nType == WIN_SASHTYPES.INACTIVE or nType == WIN_SASHTYPES.INACTIVE_IN or nType == WIN_SASHTYPES.INACTIVE_OUT) - - -- calcolo la curva di riferimento per il disegno dell'apertura - local nOutlineLayId = EgtGetFirstNameInGroup( nAreaId, WIN_OUTLINE) - local vOutlines = EgtGetAllInGroup( nOutlineLayId) - -- TODO gestire caso di triangolo - if #vOutlines == 3 then - return - end - local vCrvs = {} - for i = 1, #vOutlines do - local nCrv = EgtCopyGlob( vOutlines[i], nOpeningLayId) - table.insert( vCrvs, nCrv) - local nProfileId = GetOutlineProfileId( vCrvs[i], true) - local b3FrameProfile = GetProfileLocalBox( nProfileId) - local dOffs = b3FrameProfile:getMin():getX() - local nBottomRail = EgtGetInfo( nCrv, WIN_BOTTOMRAIL, 'i') or 0 - if nBottomRail > 0 then - -- aggiusto offset per bottomrail - local dDelta1 = EgtGetInfo( nProfileId, WIN_RAILDELTA .. '1', 'd') - local dDelta2 = EgtGetInfo( nProfileId, WIN_RAILDELTA .. '2', 'd') - dOffs = dOffs - dDelta1 - ( nBottomRail - 1) * dDelta2 - end - EgtOffsetCurve( nCrv, dOffs) - end - vCrvs = TrimOrderedCurves( vCrvs) - local nGuideId = EgtCurveCompo( nOpeningLayId, vCrvs) - local _, dParE = EgtCurveDomain( nGuideId) - - -- ribalta - if nOpeningType == WIN_OPENING_TYPES.TILTONLY_TOP or nOpeningType == WIN_OPENING_TYPES.TILTTURN_LEFT or nOpeningType == WIN_OPENING_TYPES.TILTTURN_RIGHT then - -- ricavo il punto sul top - local ptMid = EgtUP( nGuideId, 2.5) - if not EgtCurveIsARectangle( nGuideId) then - -- per maggiore simmetria ricavo il punto sul top in corrispondenza del punto medio del bottom - local ptTest = EgtUP( nGuideId, 0.5) - local nLineTest = EgtLinePVL( nOpeningLayId, ptTest + Y_AX(), Y_AX(), 10000) - ptMid = EgtIP( nGuideId, nLineTest, ORIG()) - EgtErase( nLineTest) - end - EgtCurveCompoFromPoints( nOpeningLayId, { EgtSP( nGuideId), ptMid, EgtUP( nGuideId, 1)}) - elseif nOpeningType == WIN_OPENING_TYPES.TILTONLY_BOTTOM then - -- ricavo il punto sul bottom - local ptMid = EgtUP( nGuideId, 0.5) - EgtCurveCompoFromPoints( nOpeningLayId, { EgtUP( nGuideId, 2), ptMid, EgtUP( nGuideId, dParE - 1)}) - end - - -- altre tipologie - if nOpeningType == WIN_OPENING_TYPES.TILTTURN_LEFT or nOpeningType == WIN_OPENING_TYPES.TURNONLY_LEFT then - -- battente sx - local dLenRight = EgtCurveCompoLength( nGuideId, 1) - local dLenLeft = EgtCurveCompoLength( nGuideId, dParE - 1) - local dParMid = 1.5 - -- se lato sinistro è il più corto, prendo sul destro il corrispondente del suo punto medio - if dLenLeft < dLenRight - GEO.EPS_SMALL then - dParMid = EgtCurveParamAtLength( nGuideId, EgtCurveCompoLength( nGuideId, 0) + dLenLeft * 0.5) - end - local nCrv = EgtCurveCompoFromPoints( nOpeningLayId, { EgtSP( nGuideId), EgtUP( nGuideId, dParMid), EgtUP( nGuideId, dParE - 1)}) - -- tratteggio - if bStippled then - EgtSetStipple( nCrv, nFactor, nPattern) - end - - elseif nOpeningType == WIN_OPENING_TYPES.TILTTURN_RIGHT or nOpeningType == WIN_OPENING_TYPES.TURNONLY_RIGHT then - -- battente dx - local dLenRight = EgtCurveCompoLength( nGuideId, 1) - local dLenLeft = EgtCurveCompoLength( nGuideId, dParE - 1) - local dParMid = dParE - 0.5 - -- se lato destro è il più corto, prendo sul sinistro il corrispondente del suo punto medio - if dLenRight < dLenLeft - GEO.EPS_SMALL then - dParMid = EgtCurveParamAtLength( nGuideId, EgtCurveLength( nGuideId) - dLenRight * 0.5) - end - local nCrv = EgtCurveCompoFromPoints( nOpeningLayId, { EgtUP( nGuideId, 1), EgtUP( nGuideId, dParMid), EgtUP( nGuideId, 2)}) - -- tratteggio - if bStippled then - EgtSetStipple( nCrv, nFactor, nPattern) - end - - elseif nOpeningType == WIN_OPENING_TYPES.COPLANARSLIDE_LEFT or nOpeningType == WIN_OPENING_TYPES.COPLANARSLIDE_RIGHT or - nOpeningType == WIN_OPENING_TYPES.LIFTSLIDE_LEFT or nOpeningType == WIN_OPENING_TYPES.LIFTSLIDE_RIGHT then - -- scorrevole e alzante scorrevole ( solo forma rettangolare) - local bRight = ( nOpeningType == WIN_OPENING_TYPES.COPLANARSLIDE_RIGHT or nOpeningType == WIN_OPENING_TYPES.LIFTSLIDE_RIGHT) - local dLen0 = EgtCurveCompoLength( nGuideId, 0) - local dLen1 = EgtCurveCompoLength( nGuideId, 1) - local dCoeff = 0.15 - local ptS = EgtUP( nGuideId, 1.5) - dCoeff * dLen0 * X_AX() - local ptE = EgtUP( nGuideId, dParE - 0.5) + dCoeff * dLen0 * X_AX() - if bRight then - ptS, ptE = ptE, ptS - end - local nCompo = EgtCurveCompoFromPoints( nOpeningLayId, { ptS, ptE}) - if nOpeningType == WIN_OPENING_TYPES.COPLANARSLIDE_LEFT or nOpeningType == WIN_OPENING_TYPES.COPLANARSLIDE_RIGHT then - EgtAddCurveCompoLine( nCompo, ptS - dCoeff * dLen1 * Y_AX(), false) - end - local dAng = EgtIf( bRight, 135, 45) - EgtLinePDL( nOpeningLayId, ptE, dAng, dCoeff * dLen0) - EgtLinePDL( nOpeningLayId, ptE, - dAng, dCoeff * dLen0) - - elseif nOpeningType == WIN_OPENING_TYPES.FIXED then - -- nessun disegno - - elseif nOpeningType == WIN_OPENING_TYPES.PIVOT then - -- bilico rettangolare - local nCompo = EgtCurveCompoFromPoints( nOpeningLayId, { EgtUP( nGuideId, 0.5), EgtUP( nGuideId, 1.5), EgtUP( nGuideId, 2.5), EgtUP( nGuideId, 3.5)}) - EgtCloseCurveCompo( nCompo) - -- TODO oblò - end - - EgtErase( nGuideId) -end - ---------------------------------------------------------------------- -local function CreatePartFromOutline( nAreaId, sName, nOutlineId, nBottomRail) - - -- se soglia ignoro - local bThreshold = EgtGetInfo( nOutlineId or GDB_ID.NULL, WIN_THRESHOLD, 'b') or false - if bThreshold then - return - end - - -- creo pezzo - local nPartId = EgtGroup( GDB_ID.ROOT) - - -- creo riferimenti tra pezzo e outline - EgtSetInfo( nPartId, WIN_REF_OUTLINE, nOutlineId) - if nBottomRail then - -- aggiorno i riferimenti del bottomrail - local vBottomRailParts = EgtGetInfo( nOutlineId, WIN_REF_BOTTOMRAIL_PART, 'vi') or {} - table.insert( vBottomRailParts, nPartId) - EgtSetInfo( nOutlineId, WIN_REF_BOTTOMRAIL_PART, vBottomRailParts) - EgtSetInfo( nPartId, WIN_PART_TYPE, WIN_PART_TYPES.BOTTOMRAIL) - EgtSetInfo( nPartId, WIN_BOTTOMRAIL, nBottomRail) - else - EgtSetInfo( nOutlineId, WIN_REF_PART, nPartId) - end - - -- imposto nome del pezzo - local sOutlineName = EgtIf( nBottomRail, WIN_BOTTOMRAIL .. '_' .. tostring( nBottomRail), EgtGetName( nOutlineId)) - local sPartName = sName .. '_' .. sOutlineName - EgtSetName( nPartId, sPartName) - - -- imposto il colore - if sOutlineName == WIN_BOTTOM or sOutlineName == WIN_TOP or nBottomRail then - EgtSetColor( nPartId, Color3d( 204, 102, 0)) - elseif sOutlineName == WIN_RIGHT or sOutlineName == WIN_LEFT then - EgtSetColor( nPartId, Color3d( 251, 128, 4)) - else - EgtSetColor( nPartId, Color3d( 255, 159, 57)) - end - - return nPartId -end - ---------------------------------------------------------------------- -local function CreateFillPartFromArea( nAreaId, sName) - - local nPartId = EgtGroup( GDB_ID.ROOT) - -- inserisco riferimento alla sua area - EgtSetInfo( nPartId, WIN_AREA, nAreaId) - - -- imposto nome del pezzo - EgtSetName( nPartId, sName .. '_' .. WIN_FILL) - EgtSetInfo( nPartId, WIN_PART_TYPE, WIN_PART_TYPES.FILL) - - -- imposto colore e tipologia - local nFillType = EgtGetInfo( nAreaId, WIN_FILLTYPE, 'i') - if nFillType == WIN_FILLTYPES.GLASS then - EgtSetColor( nPartId, Color3d( 71, 161, 255)) - EgtSetAlpha( nPartId, 30) - EgtSetInfo( nPartId, WIN_FILLTYPE, WIN_GLASS) - elseif nFillType == WIN_FILLTYPES.WOOD then - EgtSetColor( nPartId, Color3d( 194, 148, 103)) - EgtSetInfo( nPartId, WIN_FILLTYPE, WIN_WOOD) - end - - return nPartId -end - ---------------------------------------------------------------------- --- funzione che cicla ricorsivamente su aree e sottoaree per creare i layer dei pezzi -local function CreateParts( nAreaId, vParts, vFillParts) - - local nAreaType = EgtGetInfo( nAreaId, WIN_AREATYPE, 'i') - -- recupero nome dei pezzi in quest'area - local sName = CalcPartName( nAreaId, nAreaType) - if nAreaType == WIN_AREATYPES.FRAME or nAreaType == WIN_AREATYPES.SASH then - -- creo pezzo per ogni outline - local nOutlineLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_OUTLINE) - local vOutlines = EgtGetAllInGroup( nOutlineLayerId) - for i = 1, #vOutlines do - local nPartId = CreatePartFromOutline( nAreaId, sName, vOutlines[i]) - table.insert( vParts, nPartId) - -- se bottom verifico se ha bottomrails - if EgtGetName( vOutlines[i]) == WIN_BOTTOM then - local nBottomRail = EgtGetInfo( nAreaId, WIN_BOTTOMRAIL, 'i') or 0 - for j = 1, nBottomRail do - local nPartId = CreatePartFromOutline( nAreaId, sName, vOutlines[i], j) - table.insert( vParts, nPartId) - end - end - end - - -- se anta disegno apertura - if nAreaType == WIN_AREATYPES.SASH then - DrawOpening( nAreaId) - end - - elseif nAreaType == WIN_AREATYPES.FILL then - local nPartId = CreateFillPartFromArea( nAreaId, sName) - table.insert( vFillParts, nPartId) - - elseif nAreaType == WIN_AREATYPES.SPLIT then - -- se split non è di tipo french ha un pezzo associato - local nSplitLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_SPLIT) - local nSplitType = EgtGetInfo( nSplitLayerId, WIN_SPLITTYPE, 'i') or WIN_SPLITTYPES.NULL - if nSplitType ~= WIN_SPLITTYPES.FRENCH then - local vSplitIds = EgtGetAllInGroup( nSplitLayerId) - for i = 1, #vSplitIds do - local nPartId = CreatePartFromOutline( nAreaId, sName, vSplitIds[i]) - table.insert( vParts, nPartId) - end - end - end - - -- disegno area di selezione per programma - local nSelectionLayerId = EgtGroup( nAreaId) - EgtSetName( nSelectionLayerId, WIN_SELECTION) - EgtSetStatus( nSelectionLayerId, GDB_ST.OFF) - local nOutlineLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_OUTLINE) - local vOutlineList = EgtGetAllInGroup( nOutlineLayerId) - local nCompoId = EgtCurveCompo( nSelectionLayerId, vOutlineList, false) - local nSelectionArea = EgtSurfFlatRegion( nSelectionLayerId, nCompoId) - EgtSetColor( nSelectionArea, 'YELLOW') - EgtSetAlpha( nSelectionArea, 10) - EgtMove( nSelectionArea, 10 * Z_AX()) - EgtErase( nCompoId) - - -- calcolo i pezzi delle sottoaree - local nChildAreaId = EgtGetFirstNameInGroup( nAreaId, WIN_AREA .. '*') - while nChildAreaId do - CreateParts( nChildAreaId, vParts, vFillParts) - nChildAreaId = EgtGetNextName( nChildAreaId, WIN_AREA .. '*') - end -end - ---------------------------------------------------------------------- local function CalculateAreaParts( nFrameId) - -- creo i pezzi del serramento + -- recupero i pezzi del serramento local vParts = {} local vFillParts = {} - CreateParts( nFrameId, vParts, vFillParts) - - -- recupero gli outlines per ogni pezzo - local vOutlines = {} - for i = 1, #vParts do - vOutlines[i] = EgtGetInfo( vParts[i], WIN_REF_OUTLINE, 'i') + local nPartId = EgtGetFirstPart( GDB_ID.ROOT) + while nPartId do + local nType = EgtGetInfo( nPartId, WIN_PART_TYPE, 'i') + if nType == WIN_PART_TYPES.FILL then + table.insert( vFillParts, nPartId) + else + local nOutlineId = EgtGetInfo( nPartId, WIN_REF_OUTLINE, 'i') + table.insert( vParts, { nId = nPartId, nOutlineId = nOutlineId}) + end + nPartId = EgtGetNextPart( nPartId) end -- calcolo geo for i = 1, #vParts do - CalcGeo( vParts[i], vOutlines[i]) + CalcGeo( vParts[i].nId, vParts[i].nOutlineId) end -- calcolo cambio profilo sugli split di tipo mixed for i = 1, #vParts do - if EgtGetName( vOutlines[i]) == WIN_SPLIT then - local nSplitType = EgtGetInfo( vOutlines[i], WIN_SPLITTYPE, 'i') + if EgtGetName( vParts[i].nOutlineId) == WIN_SPLIT then + local nSplitType = EgtGetInfo( vParts[i].nOutlineId, WIN_SPLITTYPE, 'i') if nSplitType == WIN_SPLITTYPES.MIXED then - CalcMixedCurves( vParts[i], vOutlines[i]) + CalcMixedCurves( vParts[i].nId, vParts[i].nOutlineId) end end end -- calcolo le lavorazioni associate ai profili for i = 1, #vParts do - CalcProfilingProcessings( vParts[i], vOutlines[i]) + CalcProfilingProcessings( vParts[i].nId, vParts[i].nOutlineId) end -- calcolo il georaw per automatismo lavorazioni for i = 1, #vParts do - CalcGeoRaw( vParts[i], vOutlines[i]) + CalcGeoRaw( vParts[i].nId, vParts[i].nOutlineId) end -- disegno solido if s_bCalcSolid then for i = 1, #vParts do - CalcSolid( vParts[i], vOutlines[i]) + CalcSolid( vParts[i].nId, vParts[i].nOutlineId) end end @@ -5850,20 +6031,40 @@ local function DrawSashHardware( nAreaId, nRefAreaId, nLayerId, bPreview) -- recupero lato maniglia local vOptions = EgtGetInfo( nRefAreaId, WIN_HDW_OPTIONS, 'vs') or {} - local sHandleSide = 'Sx' - local nOutlineId = EgtGetFirstNameInGroup( nOutlineLayId, WIN_RIGHT) + local sOptionHandleSide for i = 1, #vOptions do local vString = EgtSplitString( vOptions[i], '=') if vString[1] == 'PosizioneManiglia' then - if vString[2] == 'destra' then - sHandleSide = 'Dx' - nOutlineId = EgtGetFirstNameInGroup( nOutlineLayId, WIN_LEFT) - elseif vString[2] == 'sopra' then - nOutlineId = EgtGetFirstNameInGroup( nOutlineLayId, WIN_TOP) - end + sOptionHandleSide = vString[2] break end end + -- se non ho trovato l'opzione la recupero dalle opzioni di default ( simile a GetHandleHeigt) + if not sOptionHandleSide then + local _, _, tOptions = WinCalculate.AddHardware( nAreaId, false, false, false, true) + if #tOptions > 0 then + -- lettura della stringa xml delle opzioni + local handler = XMLHandler:new() + local parser = XML.parser( handler) + parser:parse( tOptions[1]) + local tabOptions = handler.root + -- cerco parametro altezza maniglia + for i = 1, #tabOptions['ParametriOpzioni']['Parametri'] do + if tabOptions['ParametriOpzioni']['Parametri'][i]['NomeParametro'] == 'PosizioneManiglia' then + sOptionHandleSide = tabOptions['ParametriOpzioni']['Parametri'][i]['ValoreCorrente'] + end + end + end + end + local sHandleSide = 'Sx' + local nOutlineId = EgtGetFirstNameInGroup( nOutlineLayId, WIN_RIGHT) + if sOptionHandleSide == 'destra' then + sHandleSide = 'Dx' + nOutlineId = EgtGetFirstNameInGroup( nOutlineLayId, WIN_LEFT) + elseif sOptionHandleSide == 'sopra' then + nOutlineId = EgtGetFirstNameInGroup( nOutlineLayId, WIN_TOP) + end + -- altezza maniglia è fissata a metà del lato ( con compensazione per frame di riferimento della ferramenta) local nPartId = EgtGetInfo( nOutlineId, WIN_REF_PART, 'i') local nProfileLayId = EgtGetFirstNameInGroup( nPartId, WIN_PROFILE) @@ -5937,12 +6138,7 @@ local function SearchSash( nAreaId, SashList) -- creo gruppo temporaneo per i conti local nOutlineOffsetLayerId = EgtGroup( nAreaId) - - -- recupero gruppi dei profili - local nProfileId = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_PROFILE) - local nSashProfileLayerId = EgtGetFirstNameInGroup( nProfileId, WIN_SASH) - local nFrameProfileLayerId = EgtGetFirstNameInGroup( nProfileId, WIN_FRAME) - + -- creo gruppo per i riferimenti della ferramenta per l'anta local nHdwSashLayerId = EgtGroup( nAreaId) EgtSetName( nHdwSashLayerId, WIN_HDW_FRAME) @@ -5965,8 +6161,7 @@ local function SearchSash( nAreaId, SashList) local nOutlineLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_OUTLINE) local nOutlineId = EgtGetFirstInGroup( nOutlineLayerId) while nOutlineId do - local sProfileType = EgtGetInfo( nOutlineId, WIN_PROFILETYPE) - local nSashProfileId = EgtGetFirstNameInGroup( nSashProfileLayerId, sProfileType) + local nSashProfileId = GetOutlineProfileId( nOutlineId) local dGapDelta = EgtGetInfo( nSashProfileId, WIN_GAPDELTA, 'd') local nOutlineCopyId = EgtCopy( nOutlineId, nOutlineOffsetLayerId) EgtOffsetCurve( nOutlineCopyId, - dGapDelta) @@ -6012,7 +6207,8 @@ local function SearchSash( nAreaId, SashList) if nSouId then -- ricavo aria lato telaio - local nFrameProfileId = EgtGetFirstNameInGroup( nFrameProfileLayerId, sProfileFrame, 'i') + local nFrameOutlineId = EgtGetInfo( nSouId, WIN_COPY, 'i') + local nFrameProfileId = GetOutlineProfileId( nFrameOutlineId) local dGapDeltaOut = EgtGetInfo( nFrameProfileId, WIN_GAPDELTA, 'd') -- se deriva da split verifico il lato if EgtGetName( nSouId) == WIN_SPLIT then @@ -6315,11 +6511,12 @@ local function AddHardwareForSash( nFrameId, nReturnMode, OutputKitList, OutputP nOpeningType = EgtGetInfo( SashList[1].nAreaId, WIN_OPENING_TYPE, 'i') end -- recupero se scorrevole - local bSlide = EgtGetInfo( nFrameId, WIN_SLIDE_WINDOW, 'b') or false + local nFrameAreaId = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_AREA .. '*') + local bSlide = EgtGetInfo( nFrameAreaId, WIN_SLIDE_WINDOW, 'b') or false if bSlide then -- le dimensioni per alzante scorrevole sono quelle del telaio - local nOutlineLayId = EgtGetFirstInGroup( nFrameId, WIN_AREAOUTLINE) + local nOutlineLayId = EgtGetFirstNameInGroup( nFrameId, WIN_AREAOUTLINE) local nBottomId = EgtGetFirstNameInGroup( nOutlineLayId, WIN_BOTTOM) local dMet = EgtCurveLength( nBottomId) local nLeftId = EgtGetFirstNameInGroup( nOutlineLayId, WIN_LEFT) @@ -6988,9 +7185,16 @@ local function CalcBottomRailPreview( nPreviewGrp, nOutlineId, nBottomRail, nGeo if nBottomRail > 1 then local b3Surf = EgtGetBBoxGlob( nAreaId, GDB_BB.STANDARD) local dLen = b3Surf:getDimX() - local dStep = b3Surf:getDimY() / nBottomRail + local dH = b3Surf:getDimY() + local vBottomRailDims = EgtGetInfo( nOutlineId, WIN_BOTTOMRAIL .. WIN_PART_DIM, 'vd') + local dTotDim = 0 + for i = 1, #vBottomRailDims do + dTotDim = dTotDim + vBottomRailDims[i] + end + local dPos = 0 for i = 1, nBottomRail - 1 do - local pt = b3Surf:getMin() + i * dStep * Y_AX() + dPos = dPos + vBottomRailDims[i] * dH / dTotDim + local pt = b3Surf:getMin() + dPos * Y_AX() local nCrvId = EgtLinePVL( nPreviewGrp, pt, X_AX(), dLen) EgtSetColor( nCrvId, EgtStdColor( 'BLACK')) end @@ -7066,7 +7270,7 @@ local function CalcPartPreview( nPartId, nPreviewGrp) if nStartJoint == WIN_PART_JNT.SHORT then local b3Profile = GetProfileLocalBox( vPrevProfileId[i]) local nCrvId = EgtCopy( abs( vPrevOutlineId[i]), nGrpTmp) - local dRailDelta = EgtGetInfo( vPrevProfileId[i], WIN_RAILDELTA, 'd') or 0 + local dRailDelta = EgtGetInfo( vPrevProfileId[i], WIN_RAILOFFS, 'd') or 0 local dOffs = b3Profile:getMin():getX() - dRailDelta if vPrevOutlineId[i] < 0 then EgtInvertCurve( nCrvId) @@ -7133,7 +7337,7 @@ local function CalcPartPreview( nPartId, nPreviewGrp) if nEndJoint == WIN_PART_JNT.SHORT then nCrvId = EgtCopyGlob( abs( vNextOutlineId[i]), nGrpTmp) local b3Profile = GetProfileLocalBox( vNextProfileId[i]) - local dRailDelta = EgtGetInfo( vNextProfileId[i], WIN_RAILDELTA, 'd') or 0 + local dRailDelta = EgtGetInfo( vNextProfileId[i], WIN_RAILOFFS, 'd') or 0 local dOffs = b3Profile:getMin():getX() - dRailDelta if vNextOutlineId[i] < 0 then EgtInvertCurve( nCrvId) diff --git a/Designing/WinLib/WinCreate.lua b/Designing/WinLib/WinCreate.lua index 3c96a0f..e4d692a 100644 --- a/Designing/WinLib/WinCreate.lua +++ b/Designing/WinLib/WinCreate.lua @@ -222,30 +222,27 @@ end ---------------------------------------------------------------------------------- -- funzione che crea il telaio a partire da una specifica geometria ( rettangolo, chamfer...) -function WinCreate.CreateFrame( nType, vJoints, vDimensions, nAreaNbr) +function WinCreate.CreateFrame( nType, vDimensions, vJoints, vPartsDim, nAreaNbr) -- creo gruppo per telaio local nAreaId = EgtGroup( GDB_ID.ROOT) EgtSetName( nAreaId, WIN_AREA .. '(' .. WIN_FRAME .. ')') EgtSetLevel( nAreaId, GDB_LV.SYSTEM) - -- imposto il tipo + + -- imposto le info EgtSetInfo( nAreaId, WIN_AREATYPE, WIN_AREATYPES.FRAME) + EgtSetInfo( nAreaId, WIN_FRAME_TYPE, nType) + EgtSetInfo( nAreaId, WIN_JOINTS, vJoints) + EgtSetInfo( nAreaId, WIN_PART_DIM, vPartsDim) + EgtSetInfo( nAreaId, WIN_AREA_NBR, nAreaNbr) -- costruisco le curve di outline local nOutlineLayerId = EgtGroup( nAreaId) EgtSetName( nOutlineLayerId, WIN_AREAOUTLINE) if not CreateFrameCurves( nOutlineLayerId, nType, vDimensions) then return - end - EgtSetInfo( nAreaId, WIN_FRAME_TYPE, nType) - -- imposto tipo giunzioni - EgtSetInfo( nOutlineLayerId, WIN_JOINTS, vJoints) + end - -- numerazione - if nAreaNbr then - EgtSetInfo( nAreaId, WIN_AREA_NBR, nAreaNbr) - end - return nAreaId end @@ -253,58 +250,9 @@ end ---------------------------------------------------------------------------------- -------------------------------------- ANTA -------------------------------------- ----------------------------------------------------------------------------------- --- funzione che identifica la forma dell'anta/gruppo di ante -local function IdentifySashShape( nAreaId, nOutlineLayerId) - - local vOutlines = EgtGetAllInGroup( nOutlineLayerId) - local nCompoId = EgtCurveCompo( nOutlineLayerId, vOutlines, false) - - -- verifico se trapezio - local bTrap, ptOrig, vtB1, vtE1, vtB2 = EgtCurveIsATrapezoid( nCompoId) - if bTrap then - -- verifico se rettangolo controllando se lati sono paralleli - local vtE2 = vtB1 + vtE1 - vtB2 - if AreSameOrOppositeVectorApprox( vtE1, vtE2) then - EgtSetInfo( nAreaId, WIN_SASH_SHAPE, WIN_SASH_SHAPES.RECT) - else - EgtSetInfo( nAreaId, WIN_SASH_SHAPE, WIN_SASH_SHAPES.TRAP) - end - - else - -- verifico se cerchio - local bCircle = EgtCurveIsACircle( nCompoId) - if bCircle then - EgtSetInfo( nAreaId, WIN_SASH_SHAPE, WIN_SASH_SHAPES.CIRCLE) - - -- verifico se forma con arco - elseif #vOutlines == 4 and EgtGetType( vOutlines[3]) == GDB_TY.CRV_ARC then - local dAngCenter = EgtArcAngCenter( vOutlines[3]) - if abs( dAngCenter - 180) < GEO.EPS_SMALL then - EgtSetInfo( nAreaId, WIN_SASH_SHAPE, WIN_SASH_SHAPES.ROUND_ARC) - else - if abs( EgtCurveLength( vOutlines[2]) - EgtCurveLength( vOutlines[4])) < GEO.EPS_SMALL then - EgtSetInfo( nAreaId, WIN_SASH_SHAPE, WIN_SASH_SHAPES.SEGMENTAL_ARC) - else - -- verifico se metà di arco a tutto sesto o ribassato - if AreSameVectorApprox( EgtEV( vOutlines[2]), EgtSV( vOutlines[3])) or AreSameVectorApprox( EgtEV( vOutlines[3]), EgtSV( vOutlines[4])) then - EgtSetInfo( nAreaId, WIN_SASH_SHAPE, WIN_SASH_SHAPES.SEMI_ROUND_ARC) - else - EgtSetInfo( nAreaId, WIN_SASH_SHAPE, WIN_SASH_SHAPES.SEMI_SEGMENTAL_ARC) - end - end - end - else - EgtSetInfo( nAreaId, WIN_SASH_SHAPE, WIN_SASH_SHAPES.GENERIC) - end - end - - EgtErase( nCompoId) -end - ---------------------------------------------------------------------------------- -- funzione che aggiunge una singola anta -function WinCreate.AddSash( nParentAreaId, vJoints, nOpeningType, nAreaNbr) +function WinCreate.AddSash( nParentAreaId, vJoints, vPartsDim, nOpeningType, nAreaNbr) -- se già presente area errore if EgtGetFirstNameInGroup( nParentAreaId, WIN_AREA .. '*') then @@ -314,27 +262,22 @@ function WinCreate.AddSash( nParentAreaId, vJoints, nOpeningType, nAreaNbr) -- creo nuova area local nAreaId = EgtGroup( nParentAreaId) EgtSetName( nAreaId, WIN_AREA .. '(' .. WIN_SASH .. ')') - -- imposto il tipo + -- imposto le info EgtSetInfo( nAreaId, WIN_AREATYPE, WIN_AREATYPES.SASH) - -- copio outline dall'area parent - local nOutlineLayerId = CopyParentOutline( nAreaId, nParentAreaId) - IdentifySashShape( nAreaId, nOutlineLayerId) - EgtSetInfo( nOutlineLayerId, WIN_JOINTS, vJoints) - -- imposto apertura se presente - if nOpeningType then - EgtSetInfo( nAreaId, WIN_OPENING_TYPE, nOpeningType) - end - -- numerazione - if nAreaNbr then - EgtSetInfo( nAreaId, WIN_AREA_NBR, nAreaNbr) - EgtSetInfo( nAreaId, WIN_SASH_NBR, 1) - end + EgtSetInfo( nAreaId, WIN_JOINTS, vJoints) + EgtSetInfo( nAreaId, WIN_PART_DIM, vPartsDim) + EgtSetInfo( nAreaId, WIN_OPENING_TYPE, nOpeningType) + EgtSetInfo( nAreaId, WIN_AREA_NBR, nAreaNbr) + EgtSetInfo( nAreaId, WIN_SASH_NBR, 1) + -- copio outline dall'area parent + CopyParentOutline( nAreaId, nParentAreaId) + return nAreaId end ---------------------------------------------------------------------------------- -- funzione che aggiunge un gruppo di ante -function WinCreate.AddSashGroup( nParentAreaId, vMeasureTypes, vDimensions, vJoints, vSashTypes, vOpeningTypes, nAreaNbr, vSashNbrs) +function WinCreate.AddSashGroup( nParentAreaId, vMeasureTypes, vDimensions, vJoints, vPartsDim, vSashTypes, vOpeningTypes, nAreaNbr, vSashNbrs) -- se già presente sottoarea errore if EgtGetFirstNameInGroup( nParentAreaId, WIN_AREA .. '*') then @@ -342,25 +285,20 @@ function WinCreate.AddSashGroup( nParentAreaId, vMeasureTypes, vDimensions, vJoi end -- creo gli split di tipo french - local vAreas = WinCreate.AddSplits( nParentAreaId, WIN_SPLITORIENTATION.VERTICAL, vMeasureTypes, vDimensions, true, nAreaNbr) - - -- identifico la forma del gruppo di ante - local nAreaSplit = EgtGetParent( vAreas[1]) - local nOutlineLayerId = EgtGetFirstNameInGroup( nAreaSplit, WIN_AREAOUTLINE) - IdentifySashShape( nAreaSplit, nOutlineLayerId) - + local vAreas = WinCreate.AddSplits( nParentAreaId, WIN_SPLITORIENTATION.VERTICAL, vMeasureTypes, vDimensions, {}, true, nAreaNbr) -- trasformo le aree risultanti ( che sono null) nelle aree dell'anta settando le info opportune for i = 1, #vAreas do EgtSetName( vAreas[i], EgtGetName( vAreas[i]) .. '(' .. WIN_SASH .. ')') EgtSetInfo( vAreas[i], WIN_AREATYPE, WIN_AREATYPES.SASH) - local nOutlineLayId = EgtGetFirstNameInGroup( vAreas[i], WIN_AREAOUTLINE) - EgtSetInfo( nOutlineLayId, WIN_JOINTS, vJoints[i]) + EgtSetInfo( vAreas[i], WIN_JOINTS, vJoints[i]) + EgtSetInfo( vAreas[i], WIN_PART_DIM, vPartsDim[i]) EgtSetInfo( vAreas[i], WIN_SASHTYPE, vSashTypes[i]) EgtSetInfo( vAreas[i], WIN_OPENING_TYPE, vOpeningTypes[i]) if vSashNbrs then EgtSetInfo( vAreas[i], WIN_SASH_NBR, vSashNbrs[i]) end end + return vAreas end @@ -379,15 +317,12 @@ function WinCreate.AddFill( nParentAreaId, nFillType, nAreaNbr) local nAreaId = EgtGroup( nParentAreaId) EgtSetName( nAreaId, WIN_AREA .. '(' .. WIN_FILL .. ')') + -- setto le info EgtSetInfo( nAreaId, WIN_AREATYPE, WIN_AREATYPES.FILL) + EgtSetInfo( nAreaId, WIN_FILLTYPE, nFillType) + EgtSetInfo( nAreaId, WIN_AREA_NBR, nAreaNbr) -- copio outline dall'area parent CopyParentOutline( nAreaId, nParentAreaId) - -- imposto tipo di fill - EgtSetInfo( nAreaId, WIN_FILLTYPE, nFillType) - -- numerazione - if nAreaNbr then - EgtSetInfo( nAreaId, WIN_AREA_NBR, nAreaNbr) - end return nAreaId end @@ -651,7 +586,7 @@ end ---------------------------------------------------------------------------------- -- funzione che crea tagli split multipli -function WinCreate.AddSplits( nParentAreaId, nSplitType, vMeasureTypes, vValues, bFrench, nAreaNbr) +function WinCreate.AddSplits( nParentAreaId, nSplitType, vMeasureTypes, vValues, vPartsDim, bFrench, nAreaNbr) -- se area ha già sottoarea errore if EgtGetFirstNameInGroup( nParentAreaId, WIN_AREA .. '*') then @@ -663,15 +598,18 @@ function WinCreate.AddSplits( nParentAreaId, nSplitType, vMeasureTypes, vValues, -- creo area di split local nAreaId = EgtGroup( nParentAreaId) - EgtSetInfo( nAreaId, WIN_AREATYPE, WIN_AREATYPES.SPLIT) EgtSetName( nAreaId, WIN_AREA .. '(' .. WIN_SPLIT .. ')') - if nAreaNbr then - EgtSetInfo( nAreaId, WIN_AREA_NBR, nAreaNbr) - end + -- setto le info + EgtSetInfo( nAreaId, WIN_AREATYPE, WIN_AREATYPES.SPLIT) + EgtSetInfo( nAreaId, WIN_AREA_NBR, nAreaNbr) EgtSetInfo( nAreaId, WIN_SPLIT_DIR, nSplitType) EgtSetInfo( nAreaId, WIN_MEASURE_TYPE, vMeasureTypes) EgtSetInfo( nAreaId, WIN_MEASURE_VALUE, vValues) EgtSetInfo( nAreaId, WIN_SPLIT_REF_DIM, EgtIf( nSplitType == WIN_SPLITORIENTATION.VERTICAL, b3OutlineLayer:getDimX(), b3OutlineLayer:getDimY())) + EgtSetInfo( nAreaId, WIN_PART_DIM, vPartsDim) + + -- copio il contorno dall'area parent + CopyParentOutline( nAreaId, nParentAreaId) -- creo layer per split local nSplitLayerId = EgtGroup( nAreaId) @@ -680,19 +618,14 @@ function WinCreate.AddSplits( nParentAreaId, nSplitType, vMeasureTypes, vValues, if bFrench then EgtSetInfo( nSplitLayerId, WIN_SPLITTYPE, WIN_SPLITTYPES.FRENCH) end - -- creo le curve di split local vSplitCurves = CalcSplitCurves( nSplitLayerId, b3OutlineLayer, b3OutlineLayer, nSplitType, vMeasureTypes, vValues) - - -- se non ci sono curve valide cancello tutto ed esco if #vSplitCurves == 0 then + -- se non ci sono curve valide cancello tutto ed esco EgtErase( nAreaId) return end - -- copio il contorno dall'area parent e setto opportune corrispondenze sou/child - local nOutlineLayerId = CopyParentOutline( nAreaId, nParentAreaId) - -- creo le aree generate dagli split local vAreas = CreateAreasFromSplits( nAreaId, vSplitCurves) return vAreas @@ -700,7 +633,7 @@ end ---------------------------------------------------------------------------------- -- funzione che crea tagli split grid -function WinCreate.AddGridSplits( nParentAreaId, vVertMeasureTypes, vVertValues, vHorizMeasureTypes, vHorizValues, bStartVertical, nAreaNbr) +function WinCreate.AddGridSplits( nParentAreaId, vVertMeasureTypes, vVertValues, vHorizMeasureTypes, vHorizValues, bStartVertical, vPartsDim, nAreaNbr) local AreaResult = {} @@ -711,13 +644,13 @@ function WinCreate.AddGridSplits( nParentAreaId, vVertMeasureTypes, vVertValues, -- creo area di split local nAreaId = EgtGroup( nParentAreaId) - EgtSetInfo( nAreaId, WIN_AREATYPE, WIN_AREATYPES.SPLIT) EgtSetName( nAreaId, WIN_AREA .. '(' .. WIN_SPLIT .. ')') - if nAreaNbr then - EgtSetInfo( nAreaId, WIN_AREA_NBR, nAreaNbr) - end + -- setto info + EgtSetInfo( nAreaId, WIN_AREATYPE, WIN_AREATYPES.SPLIT) + EgtSetInfo( nAreaId, WIN_AREA_NBR, nAreaNbr) EgtSetInfo( nAreaId, WIN_GRID_SPLIT, true) - + EgtSetInfo( nAreaId, WIN_PART_DIM, vPartsDim) + -- copio il contorno dall'area parent e setto opportune corrispondenze sou/child local nOutlineLayerId = CopyParentOutline( nAreaId, nParentAreaId) local b3OutlineLayer = EgtGetBBox( nOutlineLayerId, GDB_BB.STANDARD) @@ -799,10 +732,11 @@ end ---------------------------------- BOTTOMRAIL ------------------------------------ ---------------------------------------------------------------------------------- -- funzione che aggiunge uno zoccolo -function WinCreate.AddBottomRail( nAreaId, nNbr) +function WinCreate.AddBottomRail( nAreaId, nNbr, vDim) local nAreaType = EgtGetInfo( nAreaId, WIN_AREATYPE, 'i') if nAreaType == WIN_AREATYPES.FRAME or nAreaType == WIN_AREATYPES.SASH then EgtSetInfo( nAreaId, WIN_BOTTOMRAIL, nNbr) + EgtSetInfo( nAreaId, WIN_BOTTOMRAIL .. WIN_PART_DIM, vDim) end end diff --git a/Designing/WinLib/WinManageProject.lua b/Designing/WinLib/WinManageProject.lua index 186e583..6e5afd3 100644 --- a/Designing/WinLib/WinManageProject.lua +++ b/Designing/WinLib/WinManageProject.lua @@ -37,6 +37,16 @@ local function GetJoints( tJoints) return vJoints end +--------------------------------------------------------------------- +local function GetDimensions( tDimensions) + local vDims = {} + for i = 1, #tDimensions do + local nIndex = tDimensions[i][JWD_INDEX] + vDims[nIndex] = tDimensions[i][JWD_VALUE] + end + return vDims +end + --------------------------------------------------------------------- local function GetFrameShape( sShape) @@ -181,15 +191,10 @@ local function ConvertTableToGeometry( AreaTable, nParentId) -- recupero i dati del telaio ( forma, giunzioni, dimensioni) local nType = GetFrameShape( AreaTable[JWD_FRAME_SHAPE]) local vJoints = GetJoints( AreaTable[JWD_JOINTS]) - local vDim = {} - local tDimensions = AreaTable[JWD_DIMENSION_LIST] - for i = 1, #tDimensions do - local nIndex = tDimensions[i][JWD_INDEX] - vDim[nIndex] = tDimensions[i][JWD_VALUE] - end - + local vDim = GetDimensions( AreaTable[JWD_DIMENSION_LIST]) + -- creo il telaio - local nAreaId = WinCreate.CreateFrame( nType, vJoints, vDim, nAreaNbr) + local nAreaId = WinCreate.CreateFrame( nType, vDim, vJoints, {}, nAreaNbr) if not nAreaId then return end @@ -234,7 +239,7 @@ local function ConvertTableToGeometry( AreaTable, nParentId) if #tSashes == 1 then local vJoints = GetJoints( tSashes[1][JWD_JOINTS]) local nOpeningType = GetOpeningType( tSashes[1][JWD_OPENING_TYPE]) - local nAreaId = WinCreate.AddSash( nParentId, vJoints, nOpeningType, nAreaNbr) + local nAreaId = WinCreate.AddSash( nParentId, vJoints, {}, nOpeningType, nAreaNbr) -- aggiungo ferramenta sull'anta local sHandleSide if nOpeningType == WIN_OPENING_TYPES.TURNONLY_LEFT or @@ -265,17 +270,19 @@ local function ConvertTableToGeometry( AreaTable, nParentId) local vMeasureType = {} local vSashNbrs = {} local vJoints = {} + local vPartsDim = {} for i = 1, #tSashes do vMeasureType[i] = GetMeasureType( tSashes[i][JWD_MEASURE_TYPE]) vDimensions[i] = tSashes[i][JWD_DIMENSION] vOpeningTypes[i] = GetOpeningType( tSashes[i][JWD_OPENING_TYPE]) vSashNbrs[i] = tSashes[i][JWD_ID_SASH] vJoints[i] = GetJoints( tSashes[i][JWD_JOINTS]) + vPartsDim[i] = {} end local vSashTypes, sHandleSide = GetSashTypes( tSashes, vOpeningTypes) -- aggiungo il gruppo di ante - local vAreas = WinCreate.AddSashGroup( nParentId, vMeasureType, vDimensions, vJoints, vSashTypes, vOpeningTypes, nAreaNbr, vSashNbrs) + local vAreas = WinCreate.AddSashGroup( nParentId, vMeasureType, vDimensions, vJoints, vPartsDim, vSashTypes, vOpeningTypes, nAreaNbr, vSashNbrs) -- aggiungo le ante for i = 1, #vAreas do -- bottomrail @@ -315,11 +322,11 @@ local function ConvertTableToGeometry( AreaTable, nParentId) end local vSplitAreas if AreaTable[JWD_SPLIT_TYPE] == 'GRID' then - vSplitAreas = WinCreate.AddGridSplits( nParentId, vVertMeasureType, vVertDimensions, vHorizMeasureType, vHorizDimensions, AreaTable[JWD_SPLIT_START_VERT], nAreaNbr) + vSplitAreas = WinCreate.AddGridSplits( nParentId, vVertMeasureType, vVertDimensions, vHorizMeasureType, vHorizDimensions, AreaTable[JWD_SPLIT_START_VERT], {}, nAreaNbr) elseif AreaTable[JWD_SPLIT_TYPE] == 'VERTICAL' then - vSplitAreas = WinCreate.AddSplits( nParentId, WIN_SPLITORIENTATION.VERTICAL, vVertMeasureType, vVertDimensions, false, nAreaNbr) + vSplitAreas = WinCreate.AddSplits( nParentId, WIN_SPLITORIENTATION.VERTICAL, vVertMeasureType, vVertDimensions, {}, false, nAreaNbr) else - vSplitAreas = WinCreate.AddSplits( nParentId, WIN_SPLITORIENTATION.HORIZONTAL, vHorizMeasureType, vHorizDimensions, false, nAreaNbr) + vSplitAreas = WinCreate.AddSplits( nParentId, WIN_SPLITORIENTATION.HORIZONTAL, vHorizMeasureType, vHorizDimensions, {}, false, nAreaNbr) end for i = 1, #vSplitAreas do ConvertTableToGeometry( AreaTable[JWD_AREA_LIST][i], vSplitAreas[i])