From 5e4a0b2cb1c13285231ace54379c9dd21ad7ca8b Mon Sep 17 00:00:00 2001 From: SaraP Date: Wed, 15 Oct 2025 13:01:06 +0200 Subject: [PATCH] DataWindow : - modifiche per uniformare struttura jwd con struttura del progetto - gestione numerazione delle aree - correzioni varie. --- Designing/Main.lua | 1028 +++++++++++-------------- Designing/WinConst.lua | 10 +- Designing/WinJWDConst.lua | 2 + Designing/WinLib/WinCalculate.lua | 955 ++++++++++++----------- Designing/WinLib/WinCreate.lua | 801 ++++++++++--------- Designing/WinLib/WinManageProject.lua | 35 +- Designing/WinProject.lua | 98 ++- 7 files changed, 1404 insertions(+), 1525 deletions(-) diff --git a/Designing/Main.lua b/Designing/Main.lua index 8ba1b0e..4d1c884 100644 --- a/Designing/Main.lua +++ b/Designing/Main.lua @@ -16,7 +16,6 @@ require( 'EgtBase') _ENV = EgtProtectGlobal() EgtEnableDebug( false) --- EgtEnableDebug( false) -- Imposto direttorio per librerie local sBaseDir = EgtGetSourceDir() @@ -34,681 +33,579 @@ _G.package.loaded.WinManageProject = nil local WinManageProject = require( 'WinManageProject') ------------------------------------------- PARAMETERS ------------------------------------------- -local DebugCode = false +local WindowWidth = 1500 +local WindowHeight = 1800 -local HoleWidth = 1835 -local HoleHeight = 1516 -local WindowWidth = 2500 -local WindowHeight = 2000 +local FrameJointType = WIN_JNT.FULL_H +local SashJointType = WIN_JNT.FULL_V +local vFrameJoints = { FrameJointType, FrameJointType, FrameJointType, FrameJointType} +local vSashJoints = { SashJointType, SashJointType, SashJointType, SashJointType} + -local WindowTree local sProfilePath = 'C:\\EgtData\\EgtWindowMaker\\Profiles\\Profilo78.nge' +-- local sProfilePath = 'C:\\EgtData\\EgtWindowMaker\\Profiles\\ProfiloSaomad.nge' +-- local sProfilePath = 'C:\\EgtData\\EgtWindowMaker\\Profiles\\AlzanteScorrevole.nge' ------------------------------------------- ************** ------------------------------------------- --- ciclo principale - +EgtNewFile() EgtStartCounter() -EgtNewFile() -- importo profilo prescelto WinCreate.ImportProfile( sProfilePath) --- creo telaio generico -local FrameJointType = WIN_JNT.FULL_H -local vFrameJoints = { FrameJointType, FrameJointType, FrameJointType, FrameJointType} -local SashJointType = WIN_JNT.FULL_V -local vSashJoints = { SashJointType, SashJointType, SashJointType, SashJointType} +-- 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 + 500) +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}, 900, 1500, 2100) - local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.POINTED_ARC, { FrameJointType, FrameJointType, FrameJointType, FrameJointType, FrameJointType}, 1500, 1500, 2400) +-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.POINTED_ARC, { FrameJointType, FrameJointType, FrameJointType, FrameJointType, FrameJointType}, 1500, 1500, 2400) + + + ------------------------ Aggiunta split a griglia ------------------------ + -- WinCreate.AddGridSplits( nFrameId, WIN_MEASURE.ABSOLUT, {100, 300, 100, 300}, {500, 600, 850}, false) --- WinCreate.AddGridSplits( nFrameId, WIN_MEASURE.PERCENTAGE, {0.15}, {0.5, 0.45}, false) - WinCreate.AddGridSplits( nFrameId, WIN_MEASURE.PROPORTIONAL, {1, 4, 1, 2, 1}, {1, 2, 1, 2, 1}, false) +-- WinCreate.AddGridSplits( nFrameId, WIN_MEASURE.PERCENTAGE, {0.15}, {0.5, 0.3}, false) +-- WinCreate.AddGridSplits( nFrameId, WIN_MEASURE.PROPORTIONAL, {1, 4, 1, 2, 1}, {1, 2, 1, 2, 1}, false) + + ------------------------ Cambi profilo ------------------------ --- vetro/anta --- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}, 1) --- WinCreate.AddFill( vAreas[1], WIN_FILLTYPES.GLASS) --- WinCreate.AddSash( vAreas[2], vSashJoints) --- vetro/anta orizzontale --- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.PERCENTAGE, { 0.5}, 1) +-- vetro / anta +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}) -- WinCreate.AddFill( vAreas[1], WIN_FILLTYPES.GLASS) --- WinCreate.AddSash( vAreas[2], vSashJoints) +-- local nSashId = WinCreate.AddSash( vAreas[2], vSashJoints, WIN_OPENING_TYPES.TILTTURN_RIGHT) +-- WinCreate.AddFill( nSashId, WIN_FILLTYPES.GLASS) --- anta/vetro --- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}, 1) +-- vetro / anta in orizzontale +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.PERCENTAGE, { 0.5}) +-- local nSashId = WinCreate.AddSash( vAreas[1], vSashJoints, WIN_OPENING_TYPES.TILTTURN_LEFT) +-- WinCreate.AddFill( nSashId, WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vAreas[2], WIN_FILLTYPES.GLASS) --- WinCreate.AddSash( vAreas[1], vSashJoints) --- vetro/anta/vetro --- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.33, 0.33}, 1) +-- anta / vetro +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}) +-- local nSashId = WinCreate.AddSash( vAreas[1], vSashJoints, 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, { 0.33, 0.33}) -- WinCreate.AddFill( vAreas[1], WIN_FILLTYPES.GLASS) --- WinCreate.AddSash( vAreas[2], vSashJoints) +-- local nSashId = WinCreate.AddSash( vAreas[2], vSashJoints) +-- 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, { 0.33, 0.33}, 1) +-- vetro / anta / anta +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.33, 0.33}) -- WinCreate.AddFill( vAreas[1], WIN_FILLTYPES.GLASS) --- WinCreate.AddSash( vAreas[2], vSashJoints) --- WinCreate.AddSash( vAreas[3], vSashJoints) +-- local nSashId1 = WinCreate.AddSash( vAreas[2], vSashJoints) +-- local nSashId2 = WinCreate.AddSash( vAreas[3], vSashJoints) +-- 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, { 0.66}, 1) --- local vAreas2 = WinCreate.AddSplits( vAreas[1], WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}, 1, WIN_SPLITTYPES.FRENCH) --- WinCreate.AddSash( vAreas2[1], vSashJoints, WIN_SASHTYPES.ACTIVE) --- WinCreate.AddSash( vAreas2[2], vSashJoints, WIN_SASHTYPES.INACTIVE) +-- anta battente / anta ricevente / vetro +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.66}) +-- local vSashes = WinCreate.AddSashGroup( vAreas[1], WIN_MEASURE.PERCENTAGE, {0.5}, vSashJoints, { 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) -- WinCreate.AddFill( vAreas[2], WIN_FILLTYPES.GLASS) --- vetro/anta/vetro/anta --- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}, 1) --- local vAreas2 = WinCreate.AddSplits( vAreas[1], WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}, 1) --- local vAreas3 = WinCreate.AddSplits( vAreas[2], WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}, 1) +-- vetro / anta / vetro / anta (1) +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}) +-- local vAreas2 = WinCreate.AddSplits( vAreas[1], WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}) +-- local vAreas3 = WinCreate.AddSplits( vAreas[2], WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}) -- WinCreate.AddFill( vAreas2[1], WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vAreas3[1], WIN_FILLTYPES.GLASS) --- WinCreate.AddSash( vAreas2[2], vSashJoints) --- WinCreate.AddSash( vAreas3[2], vSashJoints) +-- local nSashId1 = WinCreate.AddSash( vAreas2[2], vSashJoints) +-- local nSashId2 = WinCreate.AddSash( vAreas3[2], vSashJoints) +-- WinCreate.AddFill( nSashId1, WIN_FILLTYPES.GLASS) +-- WinCreate.AddFill( nSashId2, WIN_FILLTYPES.GLASS) --- vetro/anta/vetro/anta --- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.25}, 1) +-- vetro / anta / vetro / anta (2) +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.25, 0.25, 0.25}) -- WinCreate.AddFill( vAreas[1], WIN_FILLTYPES.GLASS) --- local vAreas2 = WinCreate.AddSplits( vAreas[2], WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.75}, 1) --- WinCreate.AddSash( vAreas2[2], vSashJoints) --- local vAreas3 = WinCreate.AddSplits( vAreas2[1], WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}, 1) --- WinCreate.AddSash( vAreas3[1], vSashJoints) --- WinCreate.AddFill( vAreas3[2], WIN_FILLTYPES.GLASS) +-- local nSashId1 = WinCreate.AddSash( vAreas[2], vSashJoints) +-- WinCreate.AddFill( nSashId1, WIN_FILLTYPES.GLASS) +-- WinCreate.AddFill( vAreas[3], WIN_FILLTYPES.GLASS) +-- local nSashId2 = WinCreate.AddSash( vAreas[4], vSashJoints) +-- WinCreate.AddFill( nSashId2, WIN_FILLTYPES.GLASS) --- con split --- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}, 1) --- WinCreate.AddSash( vAreas[1], vSashJoints) --- local vAreas2 = WinCreate.AddSplits( vAreas[2], WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.PERCENTAGE, { 0.5}, 1) +-- vetro / vetro / anta / anta +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.25, 0.25, 0.25}) +-- WinCreate.AddFill( vAreas[1], WIN_FILLTYPES.GLASS) +-- WinCreate.AddFill( vAreas[2], WIN_FILLTYPES.GLASS) +-- local nSashId1 = WinCreate.AddSash( vAreas[3], vSashJoints) +-- WinCreate.AddFill( nSashId1, WIN_FILLTYPES.GLASS) +-- local nSashId2 = WinCreate.AddSash( vAreas[4], vSashJoints) +-- WinCreate.AddFill( nSashId2, WIN_FILLTYPES.GLASS) + +-- anta / vetro con split +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}) +-- local nSashId = WinCreate.AddSash( vAreas[1], vSashJoints) +-- WinCreate.AddFill( nSashId, WIN_FILLTYPES.GLASS) +-- local vAreas2 = WinCreate.AddSplits( vAreas[2], WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.PERCENTAGE, { 0.5}) -- WinCreate.AddFill( vAreas2[1], WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vAreas2[2], WIN_FILLTYPES.GLASS) --- con split nell'anta --- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}, 1) --- local nSash = WinCreate.AddSash( vAreas[1], vSashJoints) +-- anta con split / vetro +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}) +-- local nSashId = WinCreate.AddSash( vAreas[1], vSashJoints) +-- local vAreasSash = WinCreate.AddSplits( nSashId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.PERCENTAGE, { 0.5}) +-- 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, { 0.5}) +-- local vAreas2 = WinCreate.AddSplits( vAreas[1], WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.PERCENTAGE, { 0.5}) +-- local nSashId1 = WinCreate.AddSash( vAreas2[1], vSashJoints) +-- WinCreate.AddFill( nSashId1, WIN_FILLTYPES.GLASS) +-- local nSashId2 = WinCreate.AddSash( vAreas2[2], vSashJoints) +-- WinCreate.AddFill( nSashId2, WIN_FILLTYPES.GLASS) -- WinCreate.AddFill( vAreas[2], WIN_FILLTYPES.GLASS) --- WinCreate.AddSplits( nSash, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.PERCENTAGE, { 0.5}, 1) ------------------------ Alzante Scorrevole ------------------------ +-- WinCreate.AddThreshold( nFrameId, 'Threshold') + -- anta mobile a sx --- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}, 1, WIN_SPLITTYPES.FRENCH) --- local nSash1 = WinCreate.AddSash( vAreas[1], vSashJoints, WIN_SASHTYPES.SLIDE_MOVABLE) --- local nSash2 = WinCreate.AddSash( vAreas[2], vSashJoints, WIN_SASHTYPES.SLIDE_FIXED) --- WinCreate.AddFill( nSash1, WIN_FILLTYPES.GLASS) --- WinCreate.AddFill( nSash2, WIN_FILLTYPES.GLASS) +-- local vSash = WinCreate.AddSashGroup( nFrameId, WIN_MEASURE.PERCENTAGE, {0.5}, vSashJoints, { 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) +-- WinCreate.AddHardware( nFrameId, '000592', 'Sx') -- anta mobile a dx --- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}, 1, WIN_SPLITTYPES.FRENCH) --- local nSash1 = WinCreate.AddSash( vAreas[1], vSashJoints, WIN_SASHTYPES.SLIDE_FIXED) --- local nSash2 = WinCreate.AddSash( vAreas[2], vSashJoints, WIN_SASHTYPES.SLIDE_MOVABLE) --- WinCreate.AddFill( nSash1, WIN_FILLTYPES.GLASS) --- WinCreate.AddFill( nSash2, WIN_FILLTYPES.GLASS) +-- local vSash = WinCreate.AddSashGroup( nFrameId, WIN_MEASURE.PERCENTAGE, {0.5}, vSashJoints, { 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) +-- WinCreate.AddHardware( nFrameId, '000592', 'Dx') -- 2 ante mobili, sx davanti --- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}, 1, WIN_SPLITTYPES.FRENCH) --- local nSash1 = WinCreate.AddSash( vAreas[1], vSashJoints, WIN_SASHTYPES.SLIDE_MOVABLE) --- local nSash2 = WinCreate.AddSash( vAreas[2], vSashJoints, WIN_SASHTYPES.SLIDE_MOVABLE_BACK) --- WinCreate.AddFill( nSash1, WIN_FILLTYPES.GLASS) --- WinCreate.AddFill( nSash2, WIN_FILLTYPES.GLASS) +-- local vSash = WinCreate.AddSashGroup( nFrameId, WIN_MEASURE.PERCENTAGE, {0.5}, vSashJoints, { 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) +-- WinCreate.AddHardware( nFrameId, '000593', 'Sx') -- 2 ante mobili, dx davanti --- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}, 1, WIN_SPLITTYPES.FRENCH) --- local nSash1 = WinCreate.AddSash( vAreas[1], vSashJoints, WIN_SASHTYPES.SLIDE_MOVABLE_BACK) --- local nSash2 = WinCreate.AddSash( vAreas[2], vSashJoints, WIN_SASHTYPES.SLIDE_MOVABLE) --- WinCreate.AddFill( nSash1, WIN_FILLTYPES.GLASS) --- WinCreate.AddFill( nSash2, WIN_FILLTYPES.GLASS) +-- local vSash = WinCreate.AddSashGroup( nFrameId, WIN_MEASURE.PERCENTAGE, {0.5}, vSashJoints, { 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) +-- WinCreate.AddHardware( nFrameId, '000593', 'Dx') -- 4 ante, le centrali sono mobili --- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.25, 0.25, 0.25}, 1, WIN_SPLITTYPES.FRENCH) --- local nSash1 = WinCreate.AddSash( vAreas[1], vSashJoints, WIN_SASHTYPES.SLIDE_FIXED) --- local nSash2 = WinCreate.AddSash( vAreas[2], vSashJoints, WIN_SASHTYPES.SLIDE_MOVABLE) --- local nSash3 = WinCreate.AddSash( vAreas[3], vSashJoints, WIN_SASHTYPES.SLIDE_MOVABLE) --- local nSash4 = WinCreate.AddSash( vAreas[4], vSashJoints, WIN_SASHTYPES.SLIDE_FIXED) --- WinCreate.AddFill( nSash1, WIN_FILLTYPES.GLASS) --- WinCreate.AddFill( nSash2, WIN_FILLTYPES.GLASS) --- WinCreate.AddFill( nSash3, WIN_FILLTYPES.GLASS) --- WinCreate.AddFill( nSash4, WIN_FILLTYPES.GLASS) +-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, vFrameJoints, 4500, 2100) +-- local vSash = WinCreate.AddSashGroup( nFrameId, WIN_MEASURE.PERCENTAGE, {0.25, 0.25, 0.25}, vSashJoints, { 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) +-- WinCreate.AddFill( vSash[2], WIN_FILLTYPES.GLASS) +-- WinCreate.AddFill( vSash[3], WIN_FILLTYPES.GLASS) +-- WinCreate.AddFill( vSash[4], WIN_FILLTYPES.GLASS) +-- WinCreate.AddHardware( nFrameId, '000594', 'Dx') -- 4 ante mobili --- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.25, 0.25, 0.25}, 1, WIN_SPLITTYPES.FRENCH) --- local nSash1 = WinCreate.AddSash( vAreas[1], vSashJoints, WIN_SASHTYPES.SLIDE_MOVABLE_BACK) --- local nSash2 = WinCreate.AddSash( vAreas[2], vSashJoints, WIN_SASHTYPES.SLIDE_MOVABLE) --- local nSash3 = WinCreate.AddSash( vAreas[3], vSashJoints, WIN_SASHTYPES.SLIDE_MOVABLE) --- local nSash4 = WinCreate.AddSash( vAreas[4], vSashJoints, WIN_SASHTYPES.SLIDE_MOVABLE_BACK) --- WinCreate.AddFill( nSash1, WIN_FILLTYPES.GLASS) --- WinCreate.AddFill( nSash2, WIN_FILLTYPES.GLASS) --- WinCreate.AddFill( nSash3, WIN_FILLTYPES.GLASS) --- WinCreate.AddFill( nSash4, WIN_FILLTYPES.GLASS) +-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, vFrameJoints, 4500, 2100) +-- local vSash = WinCreate.AddSashGroup( nFrameId, WIN_MEASURE.PERCENTAGE, {0.25, 0.25, 0.25}, vSashJoints, { 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) +-- WinCreate.AddFill( vSash[2], WIN_FILLTYPES.GLASS) +-- WinCreate.AddFill( vSash[3], WIN_FILLTYPES.GLASS) +-- WinCreate.AddFill( vSash[4], WIN_FILLTYPES.GLASS) +-- WinCreate.AddHardware( nFrameId, '000595', 'Dx') ------------------------- Finestra vetro fisso ------------------------ --- -- aggiungo zoccolo --- WinCreate.AddBottomRail( nFrameId) --- -- aggiungo vetro --- local nFillId = WinCreate.AddFill( nFrameId, WIN_FILLTYPES.GLASS) +------------------------ Finestre vetro fisso ------------------------ ------------------------- Finestra vetro fisso con divisione orizzontale ------------------------ +-- standard +-- WinCreate.AddBottomRail( nFrameId, 2) +-- WinCreate.AddFill( nFrameId, WIN_FILLTYPES.GLASS) --- -- aggiungo zoccolo --- WinCreate.AddBottomRail( nFrameId) --- --- -- definisco prima divisione --- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2) --- --- -- aggiungo vetri --- local nFill1Id = WinCreate.AddFill( nArea1Id, WIN_FILLTYPES.GLASS) --- local nFill2Id = WinCreate.AddFill( nArea2Id, WIN_FILLTYPES.GLASS) +-- divisione orizzontale / verticale +-- WinCreate.AddBottomRail( nFrameId, 2) +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.PERCENTAGE, { 0.7}) +-- -- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.7}) +-- WinCreate.AddFill( vAreas[1], WIN_FILLTYPES.GLASS) +-- WinCreate.AddFill( vAreas[2], WIN_FILLTYPES.GLASS) ------------------------- Finestra vetro fisso con divisione verticale ------------------------ +-- divisione verticale ed orizzontale (1) +-- WinCreate.AddBottomRail( nFrameId, 1) +-- local vAreas1 = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}) +-- local vAreas2 = WinCreate.AddSplits( vAreas1[1], WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.PERCENTAGE, { 0.5}) +-- local vAreas3 = WinCreate.AddSplits( vAreas1[2], WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.PERCENTAGE, { 0.5}) +-- WinCreate.AddFill( vAreas2[1], WIN_FILLTYPES.GLASS) +-- WinCreate.AddFill( vAreas2[2], WIN_FILLTYPES.GLASS) +-- WinCreate.AddFill( vAreas3[1], WIN_FILLTYPES.GLASS) +-- WinCreate.AddFill( vAreas3[2], WIN_FILLTYPES.GLASS) --- -- aggiungo zoccolo --- WinCreate.AddBottomRail( nFrameId) --- --- -- definisco prima divisione --- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 2) --- --- -- aggiungo vetri --- local nFill1Id = WinCreate.AddFill( nArea1Id, WIN_FILLTYPES.GLASS) --- local nFill2Id = WinCreate.AddFill( nArea2Id, WIN_FILLTYPES.GLASS) - ------------------------- Finestra vetro fisso con divisione orizzontale e verticale ------------------------ - --- -- aggiungo zoccolo --- WinCreate.AddBottomRail( nFrameId) --- --- -- definisco divisioni --- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 2) --- local nArea11Id, nArea12Id = WinCreate.AddSplit( nArea1Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2) --- local nArea21Id, nArea22Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2) --- --- -- aggiungo vetri --- local nFill1Id = WinCreate.AddFill( nArea11Id, WIN_FILLTYPES.GLASS) --- local nFill2Id = WinCreate.AddFill( nArea12Id, WIN_FILLTYPES.GLASS) --- local nFill3Id = WinCreate.AddFill( nArea21Id, WIN_FILLTYPES.GLASS) --- local nFill4Id = WinCreate.AddFill( nArea22Id, WIN_FILLTYPES.GLASS) - ------------------------- Finestra anta singola ------------------------ - --- -- aggiungo anta --- local nSashId = WinCreate.AddSash( nFrameId, vSashJoints) --- --- -- aggiungo vetro --- local nFillId = WinCreate.AddFill( nSashId, WIN_FILLTYPES.GLASS) - ------------------------- Finestra anta singola con divisione orizzontale ------------------------ - --- -- aggiungo anta --- local nSashId = WinCreate.AddSash( nFrameId, vSashJoints) --- --- -- definisco prima divisione --- local nArea1Id, nArea2Id = WinCreate.AddSplit( nSashId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 3) --- --- -- aggiungo vetri --- local nFill1Id = WinCreate.AddFill( nArea1Id, WIN_FILLTYPES.GLASS) --- local nFill2Id = WinCreate.AddFill( nArea2Id, WIN_FILLTYPES.GLASS) - ------------------------- Finestra anta singola con divisione verticale ------------------------ - --- -- aggiungo anta --- local nSashId = WinCreate.AddSash( nFrameId, vSashJoints) --- --- -- definisco prima divisione --- local nArea1Id, nArea2Id = WinCreate.AddSplit( nSashId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 2) --- --- -- aggiungo vetri --- local nFill1Id = WinCreate.AddFill( nArea1Id, WIN_FILLTYPES.GLASS) --- local nFill2Id = WinCreate.AddFill( nArea2Id, WIN_FILLTYPES.GLASS) - ------------------------- Finestra anta singola con divisione orizzontale e verticale ------------------------ - --- -- aggiungo anta --- local nSashId = WinCreate.AddSash( nFrameId, vSashJoints) --- --- -- definisco divisioni --- local nArea1Id, nArea2Id = WinCreate.AddSplit( nSashId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 2) --- local nArea11Id, nArea12Id = WinCreate.AddSplit( nArea1Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2) --- local nArea21Id, nArea22Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2) --- --- -- aggiungo vetri --- local nFill1Id = WinCreate.AddFill( nArea11Id, WIN_FILLTYPES.GLASS) --- local nFill2Id = WinCreate.AddFill( nArea12Id, WIN_FILLTYPES.GLASS) --- local nFill3Id = WinCreate.AddFill( nArea21Id, WIN_FILLTYPES.GLASS) --- local nFill4Id = WinCreate.AddFill( nArea22Id, WIN_FILLTYPES.GLASS) - ------------------------- Finestra anta singola con divisione custom ------------------------ - --- -- aggiungo anta --- local nSashId = WinCreate.AddSash( nFrameId, vSashJoints) - --- local nTempSplitLayerId = EgtGroup( nFrameId) --- EgtSetName( nTempSplitLayerId, WIN_TEMPSPLIT) - --- -- creo decoro --- local nRectangleId = EgtRectangle2P( nTempSplitLayerId, Point3d( WindowWidth / 3, WindowHeight / 3, 0), Point3d( WindowWidth * 2 / 3, WindowHeight * 2 / 3, 0)) +-- divisione verticale ed orizzontale (2) +-- WinCreate.AddBottomRail( nFrameId, 1) +-- local vAreas = WinCreate.AddGridSplits( nFrameId, WIN_MEASURE.PERCENTAGE, { 0.5}, {0.5}, true) +-- WinCreate.AddFill( vAreas[1], WIN_FILLTYPES.GLASS) +-- WinCreate.AddFill( vAreas[2], WIN_FILLTYPES.GLASS) +-- WinCreate.AddFill( vAreas[3], WIN_FILLTYPES.GLASS) +-- WinCreate.AddFill( vAreas[4], WIN_FILLTYPES.GLASS) --- -- definisco prima divisione --- local nArea1Id, nArea2Id = WinCreate.AddGenSplit( nSashId, nRectangleId) --- EgtErase( nTempSplitLayerId) +------------------------ Finestre con anta singola ------------------------ --- -- aggiungo vetri --- local nFill1Id = WinCreate.AddFill( nArea1Id, WIN_FILLTYPES.GLASS) --- local nFill2Id = WinCreate.AddFill( nArea2Id, WIN_FILLTYPES.GLASS) +-- standard +-- local nSashId = WinCreate.AddSash( nFrameId, vSashJoints, WIN_OPENING_TYPES.TILTTURN_LEFT) +-- WinCreate.AddBottomRail( nSashId, 2) +-- WinCreate.AddFill( nSashId, WIN_FILLTYPES.GLASS) ------------------------- Finestra doppia anta con montante verticale ------------------------ +-- divisione orizzontale / verticale +-- local nSashId = WinCreate.AddSash( nFrameId, vSashJoints, WIN_OPENING_TYPES.TILTTURN_LEFT) +-- WinCreate.AddBottomRail( nSashId, 1) +-- -- local vAreas = WinCreate.AddSplits( nSashId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.PERCENTAGE, { 0.5}) +-- local vAreas = WinCreate.AddSplits( nSashId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}) +-- WinCreate.AddFill( vAreas[1], WIN_FILLTYPES.GLASS) +-- WinCreate.AddFill( vAreas[2], WIN_FILLTYPES.GLASS) --- -- definisco prima divisione --- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 2) --- --- -- aggiungo prima anta --- local nSash1Id = WinCreate.AddSash( nArea1Id, vSashJoints) --- -- aggiungo vetro --- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS) --- --- -- aggiungo seconda anta --- local nSash2Id = WinCreate.AddSash( nArea2Id, vSashJoints) --- -- aggiungo vetro --- local nFill2Id = WinCreate.AddFill( nSash2Id, 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, { 0.5}) +-- local vAreas2 = WinCreate.AddSplits( vAreas1[1], WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.PERCENTAGE, { 0.5}) +-- local vAreas3 = WinCreate.AddSplits( vAreas1[2], WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.PERCENTAGE, { 0.5}) +-- WinCreate.AddFill( vAreas2[1], WIN_FILLTYPES.GLASS) +-- WinCreate.AddFill( vAreas2[2], WIN_FILLTYPES.GLASS) +-- WinCreate.AddFill( vAreas3[1], WIN_FILLTYPES.GLASS) +-- WinCreate.AddFill( vAreas3[2], WIN_FILLTYPES.GLASS) ------------------------- Finestra doppia anta battente ricevente ------------------------ --- -- definisco prima divisione --- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 2, _, WIN_SPLITTYPES.FRENCH) --- --- -- aggiungo prima anta --- local nSash1Id = WinCreate.AddSash( nArea1Id, vSashJoints, WIN_SASHTYPES.INACTIVE) --- -- aggiungo vetro --- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS) --- --- -- aggiungo seconda anta --- local nSash2Id = WinCreate.AddSash( nArea2Id, vSashJoints, WIN_SASHTYPES.ACTIVE) --- -- aggiungo vetro --- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS) ------------------------- Finestra doppia anta con montante orizzontale ------------------------ +------------------------ Finestre con più ante singole ------------------------ --- -- definisco prima divisione --- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2) --- --- -- aggiungo prima anta --- local nSash1Id = WinCreate.AddSash( nArea1Id, vSashJoints) --- -- aggiungo vetro --- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS) --- --- -- aggiungo seconda anta --- local nSash2Id = WinCreate.AddSash( nArea2Id, vSashJoints) --- -- aggiungo vetro --- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS) +-- due ante divisione verticale +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}) +-- local nSash1Id = WinCreate.AddSash( vAreas[1], vSashJoints, WIN_OPENING_TYPES.TILTTURN_LEFT) +-- WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS) +-- local nSash2Id = WinCreate.AddSash( vAreas[2], vSashJoints, WIN_OPENING_TYPES.TILTTURN_RIGHT) +-- WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS) ------------------------- Finestra tripla anta con montanti verticali ------------------------ +-- due ante divisione orizzontale +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.PERCENTAGE, { 0.5}) +-- local nSash1Id = WinCreate.AddSash( vAreas[1], vSashJoints, WIN_OPENING_TYPES.TILTONLY_TOP) +-- WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS) +-- local nSash2Id = WinCreate.AddSash( vAreas[2], vSashJoints, WIN_OPENING_TYPES.TILTONLY_TOP) +-- WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS) --- -- definisco prima divisione --- local nArea1Id, nArea0Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3) --- -- definisco seconda divisione --- local nArea2Id, nArea3Id = WinCreate.AddSplit( nArea0Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3) --- --- -- aggiungo prima anta --- local nSash1Id = WinCreate.AddSash( nArea1Id, vSashJoints) --- -- aggiungo vetro --- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS) --- --- -- aggiungo seconda anta --- local nSash2Id = WinCreate.AddSash( nArea2Id, vSashJoints) --- -- aggiungo vetro --- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS) --- --- -- aggiungo terza anta --- local nSash3Id = WinCreate.AddSash( nArea3Id, vSashJoints) --- -- aggiungo vetro --- local nFill3Id = WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS) +-- tre ante +-- -- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, { WindowWidth / 3, WindowWidth / 3}) +-- -- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PROPORTIONAL, { 1, 1, 1}) +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.33, 0.33}) +-- local nSash1Id = WinCreate.AddSash( vAreas[1], vSashJoints) +-- WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS) +-- local nSash2Id = WinCreate.AddSash( vAreas[2], vSashJoints) +-- WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS) +-- local nSash3Id = WinCreate.AddSash( vAreas[3], vSashJoints) +-- WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS) ------------------------- Finestra tripla anta con montanti verticali(2) ------------------------ +-- tre ante orizzontale e verticale +-- local vAreas1 = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.PERCENTAGE, { 0.5}) +-- local vAreas2 = WinCreate.AddSplits( vAreas1[2], WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}) +-- local nSash1Id = WinCreate.AddSash( vAreas1[1], vSashJoints, WIN_OPENING_TYPES.FIXED) +-- WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS) +-- local nSash2Id = WinCreate.AddSash( vAreas2[1], vSashJoints, WIN_OPENING_TYPES.TILTTURN_LEFT) +-- WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS) +-- local nSash3Id = WinCreate.AddSash( vAreas2[2], vSashJoints, WIN_OPENING_TYPES.TILTTURN_RIGHT) +-- WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS) --- -- definisco divisioni --- local nAreaList = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, { WindowWidth / 3, WindowWidth / 3}) --- -- local nAreaList = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PROPORTIONAL, { 1, 1}, 3) --- -- local nAreaList = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.33, 0.33}, 1) --- --- -- aggiungo prima anta --- local nSash1Id = WinCreate.AddSash( nAreaList[1], vSashJoints) --- -- aggiungo vetro --- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS) --- --- -- aggiungo seconda anta --- local nSash2Id = WinCreate.AddSash( nAreaList[2], vSashJoints) --- -- aggiungo vetro --- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS) --- --- -- aggiungo terza anta --- local nSash3Id = WinCreate.AddSash( nAreaList[3], vSashJoints) --- -- aggiungo vetro --- local nFill3Id = WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS) ------------------------- Finestra tripla anta con montante verticale e ante battente e ricevente ------------------------ +-- sei ante (1) +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.PERCENTAGE, { 0.5}) +-- local vAreas1 = WinCreate.AddSplits( vAreas[1], WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.33, 0.33}) +-- local vAreas2 = WinCreate.AddSplits( vAreas[2], WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.33, 0.33}) +-- local nSash1Id = WinCreate.AddSash( vAreas1[1], vSashJoints) +-- WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS) +-- local nSash2Id = WinCreate.AddSash( vAreas1[2], vSashJoints) +-- WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS) +-- local nSash3Id = WinCreate.AddSash( vAreas1[3], vSashJoints) +-- WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS) +-- local nSash4Id = WinCreate.AddSash( vAreas2[1], vSashJoints) +-- WinCreate.AddFill( nSash4Id, WIN_FILLTYPES.GLASS) +-- local nSash5Id = WinCreate.AddSash( vAreas2[2], vSashJoints) +-- WinCreate.AddFill( nSash5Id, WIN_FILLTYPES.GLASS) +-- local nSash6Id = WinCreate.AddSash( vAreas2[3], vSashJoints) +-- WinCreate.AddFill( nSash6Id, WIN_FILLTYPES.GLASS) --- -- definisco prima divisione --- local nArea1Id, nArea0Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3) --- -- definisco seconda divisione --- local nArea2Id, nArea3Id = WinCreate.AddSplit( nArea0Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3, _, WIN_SPLITTYPES.FRENCH) --- --- -- aggiungo prima anta --- local nSash1Id = WinCreate.AddSash( nArea1Id, vSashJoints) --- -- aggiungo vetro --- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS) --- --- -- aggiungo seconda anta --- local nSash2Id = WinCreate.AddSash( nArea2Id, vSashJoints, WIN_SASHTYPES.INACTIVE) --- -- aggiungo vetro --- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS) --- --- -- aggiungo terza anta --- local nSash3Id = WinCreate.AddSash( nArea3Id, vSashJoints, WIN_SASHTYPES.ACTIVE) --- -- aggiungo vetro --- local nFill3Id = WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS) ------------------------- Finestra tripla anta con montanti orizzontali ------------------------ +-- sei ante (2) +-- local vAreas = WinCreate.AddGridSplits( nFrameId, WIN_MEASURE.PERCENTAGE, {0.33, 0.33}, {0.5}, false) +-- local nSash1Id = WinCreate.AddSash( vAreas[1], vSashJoints) +-- WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS) +-- local nSash2Id = WinCreate.AddSash( vAreas[2], vSashJoints) +-- WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS) +-- local nSash3Id = WinCreate.AddSash( vAreas[3], vSashJoints) +-- WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS) +-- local nSash4Id = WinCreate.AddSash( vAreas[4], vSashJoints) +-- WinCreate.AddFill( nSash4Id, WIN_FILLTYPES.GLASS) +-- local nSash5Id = WinCreate.AddSash( vAreas[5], vSashJoints) +-- WinCreate.AddFill( nSash5Id, WIN_FILLTYPES.GLASS) +-- local nSash6Id = WinCreate.AddSash( vAreas[6], vSashJoints) +-- WinCreate.AddFill( nSash6Id, WIN_FILLTYPES.GLASS) --- -- definisco prima divisione --- local nArea1Id, nArea0Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 3) --- -- definisco seconda divisione --- local nArea2Id, nArea3Id = WinCreate.AddSplit( nArea0Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, 2 / 3 * WindowHeight) --- --- -- aggiungo prima anta --- local nSash1Id = WinCreate.AddSash( nArea1Id, vSashJoints) --- -- aggiungo vetro --- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS) --- --- -- aggiungo seconda anta --- local nSash2Id = WinCreate.AddSash( nArea2Id, vSashJoints) --- -- aggiungo vetro --- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS) --- --- -- aggiungo terza anta --- local nSash3Id = WinCreate.AddSash( nArea3Id, vSashJoints) --- -- aggiungo vetro --- local nFill3Id = WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS) ----------------------- Finestra tripla anta con montante orizzontale e verticale ------------------------ --- -- definisco divisioni --- local nArea1Id, nArea0Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2) --- local nArea2Id, nArea3Id = WinCreate.AddSplit( nArea0Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 2) --- --- -- aggiungo prima anta --- local nSash1Id = WinCreate.AddSash( nArea1Id, vSashJoints) --- -- aggiungo vetro --- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS) --- --- -- aggiungo seconda anta --- local nSash2Id = WinCreate.AddSash( nArea2Id, vSashJoints) --- -- aggiungo vetro --- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS) --- --- -- aggiungo terza anta --- local nSash3Id = WinCreate.AddSash( nArea3Id, vSashJoints) --- -- aggiungo vetro --- local nFill3Id = WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS) +------------------------ Finestre con ante battenti e riceventi ------------------------ ------------------------- Finestra tripla anta battente / ricevente / ricevente ------------------------ +-- battente / ricevente +-- local vSashes = WinCreate.AddSashGroup( nFrameId, WIN_MEASURE.PERCENTAGE, {0.5}, vSashJoints, { 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) --- -- definisco divisioni --- local nArea1Id, nArea0Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3, _, WIN_SPLITTYPES.FRENCH) --- local nArea2Id, nArea3Id = WinCreate.AddSplit( nArea0Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3, _, WIN_SPLITTYPES.FRENCH) --- --- -- aggiungo prima anta --- local nSash1Id = WinCreate.AddSash( nArea1Id, vSashJoints, WIN_SASHTYPES.ACTIVE) --- -- aggiungo vetro --- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS) --- --- -- aggiungo seconda anta --- local nSash2Id = WinCreate.AddSash( nArea2Id, vSashJoints, WIN_SASHTYPES.INACTIVE_IN) --- -- aggiungo vetro --- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS) --- --- -- aggiungo terza anta --- local nSash3Id = WinCreate.AddSash( nArea3Id, vSashJoints, WIN_SASHTYPES.INACTIVE_OUT) --- -- aggiungo vetro --- local nFill3Id = WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS) +-- battente / ricevente / ricevente +-- local vSashes = WinCreate.AddSashGroup( nFrameId, WIN_MEASURE.PERCENTAGE, { 0.33, 0.33}, vSashJoints, {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) +-- WinCreate.AddFill( vSashes[2], WIN_FILLTYPES.GLASS) +-- WinCreate.AddFill( vSashes[3], WIN_FILLTYPES.GLASS) ------------------------- Finestra tripla anta battente / battente / ricevente ------------------------ +-- battente / battente / ricevente +-- local vSashes = WinCreate.AddSashGroup( nFrameId, WIN_MEASURE.PERCENTAGE, { 0.33, 0.33}, vSashJoints, {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) +-- WinCreate.AddFill( vSashes[2], WIN_FILLTYPES.GLASS) +-- WinCreate.AddFill( vSashes[3], WIN_FILLTYPES.GLASS) --- -- definisco divisioni --- local nArea1Id, nArea0Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3, _, WIN_SPLITTYPES.FRENCH) --- local nArea2Id, nArea3Id = WinCreate.AddSplit( nArea0Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3, _, WIN_SPLITTYPES.FRENCH) --- --- -- aggiungo prima anta --- local nSash1Id = WinCreate.AddSash( nArea1Id, vSashJoints, WIN_SASHTYPES.ACTIVE_OUT) --- -- aggiungo vetro --- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS) --- --- -- aggiungo seconda anta --- local nSash2Id = WinCreate.AddSash( nArea2Id, vSashJoints, WIN_SASHTYPES.ACTIVE_IN) --- -- aggiungo vetro --- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS) --- --- -- aggiungo terza anta --- local nSash3Id = WinCreate.AddSash( nArea3Id, vSashJoints, WIN_SASHTYPES.INACTIVE) --- -- aggiungo vetro --- local nFill3Id = WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS) +-- battente / battente / ricevente / ricevente +-- local vSashes = WinCreate.AddSashGroup( nFrameId, WIN_MEASURE.PROPORTIONAL, { 1, 1, 1, 1}, vSashJoints, {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) +-- WinCreate.AddFill( vSashes[2], WIN_FILLTYPES.GLASS) +-- WinCreate.AddFill( vSashes[3], WIN_FILLTYPES.GLASS) +-- WinCreate.AddFill( vSashes[4], WIN_FILLTYPES.GLASS) ------------------------- Finestra quattro ante battente / battente / ricevente / ricevente ------------------------ --- -- definisco divisioni --- local nArea1Id, nAreaTmpId = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 4, _, WIN_SPLITTYPES.FRENCH) --- local nArea2Id, nAreaTmp1Id = WinCreate.AddSplit( nAreaTmpId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 4, _, WIN_SPLITTYPES.FRENCH) --- local nArea3Id, nArea4Id = WinCreate.AddSplit( nAreaTmp1Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 4, _, WIN_SPLITTYPES.FRENCH) --- --- -- aggiungo prima anta --- local nSash1Id = WinCreate.AddSash( nArea1Id, vSashJoints, WIN_SASHTYPES.ACTIVE_OUT) --- -- aggiungo vetro --- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS) --- --- -- aggiungo seconda anta --- local nSash2Id = WinCreate.AddSash( nArea2Id, vSashJoints, WIN_SASHTYPES.ACTIVE_IN) --- -- aggiungo vetro --- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS) --- --- -- aggiungo terza anta --- local nSash3Id = WinCreate.AddSash( nArea3Id, vSashJoints, WIN_SASHTYPES.INACTIVE_IN) --- -- aggiungo vetro --- local nFill3Id = WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS) --- --- -- aggiungo quarta anta --- local nSash4Id = WinCreate.AddSash( nArea4Id, vSashJoints, WIN_SASHTYPES.INACTIVE_OUT) --- -- aggiungo vetro --- local nFill4Id = WinCreate.AddFill( nSash4Id, WIN_FILLTYPES.GLASS) ------------------------- Finestra sei ante con montanti verticali e orizzontale ------------------------ +------------------------ Finestre con ante singole e ante battenti/riceventi ------------------------ --- -- definisco divisione orizzontale --- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2) --- -- definisco divisioni verticali --- local nArea11Id, nArea0Id = WinCreate.AddSplit( nArea1Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3) --- local nArea12Id, nArea13Id = WinCreate.AddSplit( nArea0Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3) --- local nArea21Id, nArea00Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3) --- local nArea22Id, nArea23Id = WinCreate.AddSplit( nArea00Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3) --- --- -- aggiungo prima anta --- local nSash1Id = WinCreate.AddSash( nArea11Id, vSashJoints) --- -- aggiungo vetro --- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS) --- --- -- aggiungo seconda anta --- local nSash2Id = WinCreate.AddSash( nArea12Id, vSashJoints) --- -- aggiungo vetro --- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS) --- --- -- aggiungo terza anta --- local nSash3Id = WinCreate.AddSash( nArea13Id, vSashJoints) --- -- aggiungo vetro --- local nFill3Id = WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS) --- --- -- aggiungo quarta anta --- local nSash4Id = WinCreate.AddSash( nArea21Id, vSashJoints) --- -- aggiungo vetro --- local nFill4Id = WinCreate.AddFill( nSash4Id, WIN_FILLTYPES.GLASS) --- --- -- aggiungo quinta anta --- local nSash5Id = WinCreate.AddSash( nArea22Id, vSashJoints) --- -- aggiungo vetro --- local nFill5Id = WinCreate.AddFill( nSash5Id, WIN_FILLTYPES.GLASS) --- --- -- aggiungo sesta anta --- local nSash6Id = WinCreate.AddSash( nArea23Id, vSashJoints) --- -- aggiungo vetro --- local nFill6Id = WinCreate.AddFill( nSash6Id, WIN_FILLTYPES.GLASS) +-- tre ante : singola / ricevente / battente +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, { WindowWidth / 3}) +-- local nSash1Id = WinCreate.AddSash( vAreas[1], vSashJoints, WIN_OPENING_TYPES.TILTTURN_LEFT) +-- WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS) +-- local vSashes = WinCreate.AddSashGroup( vAreas[2], WIN_MEASURE.PERCENTAGE, {0.5}, vSashJoints, { 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) ------------------------- Finestra sei ante con montante verticale e orizzontale ed ante battente ricevente ------------------------ --- -- definisco divisione orizzontale --- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2) --- -- definisco divisioni verticali --- local nArea11Id, nArea0Id = WinCreate.AddSplit( nArea1Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3) --- local nArea12Id, nArea13Id = WinCreate.AddSplit( nArea0Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3, _, WIN_SPLITTYPES.FRENCH) --- local nArea21Id, nArea00Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3) --- local nArea22Id, nArea23Id = WinCreate.AddSplit( nArea00Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3, _, WIN_SPLITTYPES.FRENCH) --- --- -- aggiungo prima anta --- local nSash1Id = WinCreate.AddSash( nArea11Id, vSashJoints) --- -- aggiungo vetro --- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS) --- --- -- aggiungo seconda anta --- local nSash2Id = WinCreate.AddSash( nArea12Id, vSashJoints, WIN_SASHTYPES.INACTIVE) --- -- aggiungo vetro --- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS) --- --- -- aggiungo terza anta --- local nSash3Id = WinCreate.AddSash( nArea13Id, vSashJoints, WIN_SASHTYPES.ACTIVE) --- -- aggiungo vetro --- local nFill3Id = WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS) --- --- -- aggiungo quarta anta --- local nSash4Id = WinCreate.AddSash( nArea21Id, vSashJoints) --- -- aggiungo vetro --- local nFill4Id = WinCreate.AddFill( nSash4Id, WIN_FILLTYPES.GLASS) --- --- -- aggiungo quinta anta --- local nSash5Id = WinCreate.AddSash( nArea22Id, vSashJoints, WIN_SASHTYPES.INACTIVE) --- -- aggiungo vetro --- local nFill5Id = WinCreate.AddFill( nSash5Id, WIN_FILLTYPES.GLASS) --- --- -- aggiungo sesta anta --- local nSash6Id = WinCreate.AddSash( nArea23Id, vSashJoints, WIN_SASHTYPES.ACTIVE) --- -- aggiungo vetro --- local nFill6Id = WinCreate.AddFill( nSash6Id, WIN_FILLTYPES.GLASS) +-- tre ante ( singola / ricevente/ battente) con split nelle ante +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.33}) +-- local nSash1Id = WinCreate.AddSash( vAreas[1], vSashJoints, WIN_OPENING_TYPES.TILTTURN_LEFT) +-- local vAreasSash1 = WinCreate.AddSplits( nSash1Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, { WindowHeight * 3 / 5}) +-- WinCreate.AddFill( vAreasSash1[1], WIN_FILLTYPES.GLASS) +-- WinCreate.AddFill( vAreasSash1[2], WIN_FILLTYPES.GLASS) +-- local vSashes2 = WinCreate.AddSashGroup( vAreas[2], WIN_MEASURE.PERCENTAGE, { 0.5}, vSashJoints, {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.ABSOLUT, { WindowHeight * 3 / 5}) +-- 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.ABSOLUT, { WindowHeight * 3 / 5}) +-- WinCreate.AddFill( vAreasSash3[1], WIN_FILLTYPES.GLASS) +-- WinCreate.AddFill( vAreasSash3[2], WIN_FILLTYPES.GLASS) ------------------------- Finestra tre ante con montante verticale, ante battente ricevente e split di tutte le ante ------------------------ +-- 4 ante : sopra anta singola e sotto singola ( con split) / battente / ricevente +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.PERCENTAGE, { 0.3}) +-- local vAreas1 = WinCreate.AddSplits( vAreas[2], WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.3}) +-- local nSash0Id = WinCreate.AddSash( vAreas[1], vSashJoints, 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, { 0.6}) +-- WinCreate.AddFill( vSashAreas[1], WIN_FILLTYPES.GLASS) +-- WinCreate.AddFill( vSashAreas[2], WIN_FILLTYPES.GLASS) +-- local vSashes = WinCreate.AddSashGroup( vAreas1[2], WIN_MEASURE.PERCENTAGE, { 0.5}, vSashJoints, {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) --- -- definisco prima divisione --- local nArea1Id, nArea0Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3) --- -- definisco seconda divisione --- local nArea2Id, nArea3Id = WinCreate.AddSplit( nArea0Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3, _, WIN_SPLITTYPES.FRENCH) --- --- -- aggiungo prima anta --- local nSash1Id = WinCreate.AddSash( nArea1Id, vSashJoints) --- -- definisco divisione --- local nArea11Id, nArea12Id = WinCreate.AddSplit( nSash1Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight * 2 / 5) --- -- aggiungo vetri --- local nFill11Id = WinCreate.AddFill( nArea11Id, WIN_FILLTYPES.GLASS) --- local nFill12Id = WinCreate.AddFill( nArea12Id, WIN_FILLTYPES.GLASS) --- --- -- aggiungo seconda anta --- local nSash2Id = WinCreate.AddSash( nArea2Id, vSashJoints, WIN_SASHTYPES.INACTIVE) --- -- definisco divisione --- local nArea21Id, nArea22Id = WinCreate.AddSplit( nSash2Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight * 2 / 5) --- -- aggiungo vetri --- local nFill21Id = WinCreate.AddFill( nArea21Id, WIN_FILLTYPES.GLASS) --- local nFill22Id = WinCreate.AddFill( nArea22Id, WIN_FILLTYPES.GLASS) --- --- -- aggiungo terza anta --- local nSash3Id = WinCreate.AddSash( nArea3Id, vSashJoints, WIN_SASHTYPES.ACTIVE) --- -- definisco divisione --- local nArea31Id, nArea32Id = WinCreate.AddSplit( nSash3Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight * 2 / 5) --- -- aggiungo vetri --- local nFill31Id = WinCreate.AddFill( nArea31Id, WIN_FILLTYPES.GLASS) --- local nFill32Id = WinCreate.AddFill( nArea32Id, WIN_FILLTYPES.GLASS) +-- sei ante : divisione orizzontale e per ogni divisione anta singola / battente/ ricevente +-- local vAreas = WinCreate.AddGridSplits( nFrameId, WIN_MEASURE.ABSOLUT, {WindowWidth / 3}, {WindowHeight / 2}, false) +-- local nSash1Id = WinCreate.AddSash( vAreas[1], vSashJoints, WIN_OPENING_TYPES.TILTTURN_LEFT) +-- WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS) +-- local nSash2Id = WinCreate.AddSash( vAreas[3], vSashJoints, WIN_OPENING_TYPES.TILTTURN_LEFT) +-- WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS) +-- local vSashes1 = WinCreate.AddSashGroup( vAreas[2], WIN_MEASURE.PERCENTAGE, { 0.5}, vSashJoints, {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, { 0.5}, vSashJoints, {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) ------------------------- Finestra tre ante con montante orizzontale e verticale, ante battente ricevente e split di tutte le ante ------------------------ --- -- definisco prima divisione --- local nArea1Id, nArea0Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, 2 * WindowHeight / 3) --- local nArea2Id, nArea00Id = WinCreate.AddSplit( nArea1Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3) --- local nArea3Id, nArea4Id = WinCreate.AddSplit( nArea00Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3, _, WIN_SPLITTYPES.FRENCH) --- --- -- aggiungo anta sopra --- local nSash0Id = WinCreate.AddSash( nArea0Id, vSashJoints) --- -- aggiungo vetri --- local nFill0Id = WinCreate.AddFill( nSash0Id, WIN_FILLTYPES.GLASS) --- --- -- aggiungo prima anta --- local nSash1Id = WinCreate.AddSash( nArea2Id, vSashJoints) --- -- definisco divisione --- local nArea11Id, nArea12Id = WinCreate.AddSplit( nSash1Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight * 2 / 5) --- -- aggiungo vetri --- local nFill11Id = WinCreate.AddFill( nArea11Id, WIN_FILLTYPES.GLASS) --- local nFill12Id = WinCreate.AddFill( nArea12Id, WIN_FILLTYPES.GLASS) --- --- -- aggiungo seconda anta --- local nSash2Id = WinCreate.AddSash( nArea3Id, vSashJoints, WIN_SASHTYPES.INACTIVE) --- -- definisco divisione --- local nArea21Id, nArea22Id = WinCreate.AddSplit( nSash2Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight * 2 / 5) --- -- aggiungo vetri --- local nFill21Id = WinCreate.AddFill( nArea21Id, WIN_FILLTYPES.GLASS) --- local nFill22Id = WinCreate.AddFill( nArea22Id, WIN_FILLTYPES.GLASS) --- --- -- aggiungo terza anta --- local nSash3Id = WinCreate.AddSash( nArea4Id, vSashJoints, WIN_SASHTYPES.ACTIVE) --- -- definisco divisione --- local nArea31Id, nArea32Id = WinCreate.AddSplit( nSash3Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight * 2 / 5) --- -- aggiungo vetri --- local nFill31Id = WinCreate.AddFill( nArea31Id, WIN_FILLTYPES.GLASS) --- local nFill32Id = WinCreate.AddFill( nArea32Id, WIN_FILLTYPES.GLASS) + +------------------------ 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) + + +-- anta singola +-- local nSashId = WinCreate.AddSash( nFrameId, vSashJoints, 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ù +-- -- WinCreate.AddHardware( nSashId, '000596', 'Sx') -- arco a tutto sesto +-- -- WinCreate.AddHardware( nSashId, '000597', 'Sx') -- arco ribassato +-- -- WinCreate.AddHardware( nSashId, '000604', 'Sx') -- trapezio + +-- 2 ante singole +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}) +-- local nSash1Id = WinCreate.AddSash( vAreas[1], vSashJoints, WIN_OPENING_TYPES.TILTTURN_LEFT) +-- local nSash2Id = WinCreate.AddSash( vAreas[2], vSashJoints, WIN_OPENING_TYPES.TILTTURN_RIGHT) +-- WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS) +-- WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS) +-- WinCreate.AddHardware( nSash1Id, '000558', 'Sx') +-- WinCreate.AddHardware( nSash2Id, '000558', 'Dx') +-- -- WinCreate.AddHardware( nSash1Id, '000610', 'Sx') -- arco a tutto sesto +-- -- WinCreate.AddHardware( nSash2Id, '000610', 'Dx') +-- -- WinCreate.AddHardware( nSash1Id, '000611', 'Sx') -- arco ribassato +-- -- WinCreate.AddHardware( nSash2Id, '000611', 'Dx') +-- -- WinCreate.AddHardware( nSash1Id, '000604', 'Sx') -- trapezio +-- -- WinCreate.AddHardware( nSash2Id, '000604', 'Dx') + +-- 2 ante singole con apertura sul montante +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}) +-- local nSash1Id = WinCreate.AddSash( vAreas[1], vSashJoints, WIN_OPENING_TYPES.TILTTURN_LEFT) +-- local nSash2Id = WinCreate.AddSash( vAreas[2], vSashJoints, 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 : singola / battente / ricevente +-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}) +-- local nSash1Id = WinCreate.AddSash( vAreas[1], vSashJoints, WIN_OPENING_TYPES.TILTTURN_LEFT) +-- WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS) +-- WinCreate.AddHardware( nSash1Id, '000558', 'Sx') +-- local vSashes = WinCreate.AddSashGroup( vAreas[2], WIN_MEASURE.PERCENTAGE, { 0.5}, vSashJoints, { 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) +-- WinCreate.AddHardware( vAreas[2], '000559', 'Sx') + +-- 2 ante : battente / ricevente +-- local vSashes = WinCreate.AddSashGroup( nFrameId, WIN_MEASURE.PERCENTAGE, { 0.5}, vSashJoints, { 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) +-- WinCreate.AddHardware( nFrameId, '000559', 'Sx') +-- -- WinCreate.AddHardware( nFrameId, '000598', 'Sx') -- arco tutto sesto +-- -- WinCreate.AddHardware( nFrameId, '000599', 'Sx') -- arco ribassato + +-- 2 ante : ricevente / battente +-- local vSashes = WinCreate.AddSashGroup( nFrameId, WIN_MEASURE.PERCENTAGE, { 0.5}, vSashJoints, { 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) +-- WinCreate.AddHardware( nFrameId, '000559', 'Dx') + +-- 3 ante : battente / battente / ricevente +-- local vSashes = WinCreate.AddSashGroup( nFrameId, WIN_MEASURE.PERCENTAGE, { 0.33, 0.33}, vSashJoints, { 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) +-- WinCreate.AddFill( vSashes[2], WIN_FILLTYPES.GLASS) +-- WinCreate.AddFill( vSashes[3], WIN_FILLTYPES.GLASS) +-- WinCreate.AddHardware( nFrameId, '000564', 'Sx') + +-- 3 ante : ricevente / battente / battente +-- local vSashes = WinCreate.AddSashGroup( nFrameId, WIN_MEASURE.PERCENTAGE, { 0.33, 0.33}, vSashJoints, { 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) +-- WinCreate.AddFill( vSashes[2], WIN_FILLTYPES.GLASS) +-- WinCreate.AddFill( vSashes[3], WIN_FILLTYPES.GLASS) +-- WinCreate.AddHardware( nFrameId, '000564', 'Dx') + +-- 3 ante : battente / ricevente / ricevente +-- local vSashes = WinCreate.AddSashGroup( nFrameId, WIN_MEASURE.PERCENTAGE, { 0.33, 0.33}, vSashJoints, { 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) +-- WinCreate.AddFill( vSashes[2], WIN_FILLTYPES.GLASS) +-- WinCreate.AddFill( vSashes[3], WIN_FILLTYPES.GLASS) +-- WinCreate.AddHardware( nFrameId, '000565', 'Sx') + +-- 3 ante : ricevente / ricevente / battente +-- local vSashes = WinCreate.AddSashGroup( nFrameId, WIN_MEASURE.PERCENTAGE, { 0.33, 0.33}, vSashJoints, { 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) +-- WinCreate.AddFill( vSashes[2], WIN_FILLTYPES.GLASS) +-- WinCreate.AddFill( vSashes[3], WIN_FILLTYPES.GLASS) +-- WinCreate.AddHardware( nFrameId, '000565', 'Dx') + +-- 4 ante : battente / battente / ricevente / ricevente +-- local vSashes = WinCreate.AddSashGroup( nFrameId, WIN_MEASURE.PERCENTAGE, { 0.25, 0.25, 0.25}, vSashJoints, { 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) +-- WinCreate.AddFill( vSashes[2], WIN_FILLTYPES.GLASS) +-- WinCreate.AddFill( vSashes[3], WIN_FILLTYPES.GLASS) +-- WinCreate.AddFill( vSashes[4], WIN_FILLTYPES.GLASS) +-- WinCreate.AddHardware( nFrameId, '000575', 'Sx') + +-- 4 ante : ricevente / ricevente / battente / battente +-- local vSashes = WinCreate.AddSashGroup( nFrameId, WIN_MEASURE.PERCENTAGE, { 0.25, 0.25, 0.25}, vSashJoints, { 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) +-- WinCreate.AddFill( vSashes[2], WIN_FILLTYPES.GLASS) +-- WinCreate.AddFill( vSashes[3], WIN_FILLTYPES.GLASS) +-- WinCreate.AddFill( vSashes[4], WIN_FILLTYPES.GLASS) +-- WinCreate.AddHardware( nFrameId, '000575', 'Dx') + +-- vasistas +-- local nSashId = WinCreate.AddSash( nFrameId, vSashJoints, WIN_OPENING_TYPES.TILTONLY_TOP) +-- WinCreate.AddFill( nSashId, WIN_FILLTYPES.GLASS) +-- WinCreate.AddHardware( nSashId, '000573', 'Sx') ----------------------------------------------------------------------------------- --- aggiungo ferramenta --- WinCreate.AddHardware( nFrameId, '000545') --- imposto se calcolare i solidi o meno --- WinCalculate.SetCalcSolid( true) +-- imposto se calcolare solidi/preview o meno +WinCalculate.SetCalcSolid( true) +WinCalculate.SetCalcPreview( true) -- creo i pezzi --- WinCalculate.CreatePartFromArea( nFrameId) +WinCalculate.CreatePartFromArea( nFrameId) -- WinCalculate.AddHardware( nFrameId) - +WinCalculate.AddAccessories( nFrameId, true) + + -- tronchetti --- local nLogsNbr = 4 -- 0 per numero minimo +-- local nLogsNbr = 7 -- local vSections = { 100, 150, 80, 130, 120, 180} +-- -- local nLogsNbr = 0 -- numero minimo +-- -- local vSections = { 120} -- local bAlign = false -- local dOverMatOut = 10 -- local dOverMatIn = 7 -- local dOverMatExt = 5 -- local dOverMatInt = 3 -- local bCutExtremities = true --- -- cero i pezzi top ad arco --- local vTops = EgtGetNameInGroup( 0, WIN_TOP) --- for i = 1, #vTops do --- local nOutline = EgtGetInfo( vTops[i], WIN_REF_OUTLINE, 'i') +-- -- cerco i pezzi ad arco +-- local vParts = EgtGetAllInGroup( 0) +-- for i = 1, #vParts do +-- local nOutline = EgtGetInfo( vParts[i], WIN_REF_OUTLINE, 'i') or GDB_ID.NULL -- if EgtGetType( nOutline) == GDB_TY.CRV_ARC then -- -- se anta richiedo allineamento con telaio -- local nAreaId = EgtGetParent( EgtGetParent( nOutline)) @@ -717,26 +614,13 @@ local vSashJoints = { SashJointType, SashJointType, SashJointType, SashJointType -- bAlign = true -- nLogsNbr = 0 -- end --- WinCalculate.CreateArcLogs( vTops[i], nLogsNbr, vSections, bAlign, dOverMatOut, dOverMatIn, dOverMatExt, dOverMatInt, bCutExtremities) +-- WinCalculate.CreateArcLogs( vParts[i], nLogsNbr, vSections, bAlign, dOverMatOut, dOverMatIn, dOverMatExt, dOverMatInt, bCutExtremities) -- end -- end - - --- preparo per automatismo lavorazioni --- WinCalculate.PrepareProject() - - --- -- creo tabella per salvataggio --- local sSaveFilePath = 'c:\\Temp\\WindowTest1.txt' --- local WinTable = WinManageProject.WriteToFile( nFrameId, sSaveFilePath) - --- assemblo i pezzi ---WinLib.AssembleFrame() - EgtZoom( SCE_ZM.ALL) -- riporto tempi di esecuzione diff --git a/Designing/WinConst.lua b/Designing/WinConst.lua index a82b0e5..db72247 100644 --- a/Designing/WinConst.lua +++ b/Designing/WinConst.lua @@ -84,9 +84,11 @@ WIN_AREATYPES = { WIN_SPLITTYPE = 'SplitType' WIN_SPLITTYPES = { NULL = 0, - MULLION = 1, -- montante - FRENCH = 2, -- battente / ricevente + MULLION = 1, -- montante nel telaio che separa due ante + FRENCH = 2, -- per ante battente / ricevente MIXED = 3, -- cambio profilo + INSASH = 4, -- divisione nell'anta + INFRAME = 5, -- divisione nel telaio che separa due vetri fissi } -- tipi di riempimento interno @@ -149,6 +151,7 @@ WIN_SPLITSELECTION = 'SplitSelection' WIN_SASH_OPENING = 'Opening' WIN_AUX = 'Aux' WIN_PREVIEW = 'Preview' +WIN_VIRTUAL_AREA = 'VirtualArea' WIN_BOTTOM = 'Bottom' WIN_BOTTOMRAIL = 'BottomRail' @@ -167,7 +170,6 @@ WIN_PREV_OUTLINES = 'PrevOutlines' WIN_NEXT_OUTLINES = 'NextOutlines' WIN_REF_SPLIT = 'RefSplit' WIN_INV_SPLIT = 'InvSplit' -WIN_PRJ_ORIGSPLIT = 'OrigSplit' WIN_CRV_ON_FRENCH_SPLIT = 'OutlineOnFrenchSplit' WIN_SPLIT_STARTINTERS = 'SplitStartInters' WIN_SPLIT_ENDINTERS = 'SplitEndInters' @@ -175,6 +177,8 @@ WIN_SASH_CHILDREN = 'SashChildren' WIN_FILL_CHILDREN = 'FillChildren' WIN_THRESHOLD_PROFILE = 'ThresholdProfile' WIN_SLIDE_WINDOW = 'SlideWindow' +WIN_SASH_NBR = 'SashNbr' +WIN_AREA_NBR = 'AreaNbr' -- PROFILI diff --git a/Designing/WinJWDConst.lua b/Designing/WinJWDConst.lua index e2142ad..2e478b4 100644 --- a/Designing/WinJWDConst.lua +++ b/Designing/WinJWDConst.lua @@ -26,6 +26,8 @@ JWD_BOTTOMRAIL = 'BottomRail' JWD_BOTTOMRAIL_QTY = 'BottomRailQty' JWD_DIMENSION = 'dDimension' JWD_VALUE = 'dValue' +JWD_ID_GROUP = 'IdGroup' +JWD_ID_SASH = 'nSashId' JWD_FRAME_SHAPE = 'Shape' JWD_DIMENSION_LIST = 'DimensionList' diff --git a/Designing/WinLib/WinCalculate.lua b/Designing/WinLib/WinCalculate.lua index 49ba54f..c07f0c3 100644 --- a/Designing/WinLib/WinCalculate.lua +++ b/Designing/WinLib/WinCalculate.lua @@ -177,15 +177,13 @@ local function CalcIntersectionRegion( vCrvs, nGrp) local vArcs = EgtTableFill( nCrv, nCnt) for j = nCrv, nCrv + nCnt - 1 do local nInters, nPntCnt, nCrvCnt = EgtCurveCurveInters( j, nCrvBorder, nGrpTmp) - if nPntCnt > 2 then - local nCurrCrv = j - for nPntId = nInters, nInters + nPntCnt - 1 do - local dPar = EgtCurveParamAtPoint( nCurrCrv, EgtSP( nPntId)) - local nNewCrv = EgtSplitCurveAtParam( nCurrCrv, dPar) - if nNewCrv then - table.insert( vArcs, nNewCrv) - nCurrCrv = nNewCrv - end + local nCurrCrv = j + for nPntId = nInters, nInters + nPntCnt - 1 do + local dPar = EgtCurveParamAtPoint( nCurrCrv, EgtSP( nPntId)) + local nNewCrv = EgtSplitCurveAtParam( nCurrCrv, dPar) + if nNewCrv then + table.insert( vArcs, nNewCrv) + nCurrCrv = nNewCrv end end end @@ -258,6 +256,11 @@ local function AdjustExtraCurvesForTrim( nCrvId, nSurfId, nMode) local nTestCrv = EgtCopyGlob( nCrvId, EgtGetParent( nSurfId)) local nTmp, nCnt = EgtTrimCurveWithRegion( nTestCrv, nSurfId, true, true) if nCnt > 0 then + -- se la curva è on o in non ha senso considerarla, il suo contributo è lo stesso di un'altra curva di bordo + -- elimino il profilo corrispondente + local nSemiProfileId = EgtGetInfo( nCrvId, WIN_SEMI_PROFILE, 'i') + EgtErase( EgtGetParent( nSemiProfileId)) + -- elimino la curva EgtErase( nCrvId) else EgtSetInfo( nCrvId, WIN_GEO_EXTRA, true) @@ -540,113 +543,53 @@ local function GetChildrenType( nCrvId) end --------------------------------------------------------------------- --- funzione che identifica il tipo di split ( null, mullion, french, mixed) -local function GetSplitType( nSplitLayerId) - +-- funzione che identifica il tipo di split ( mullion, mixed, ...) +local function GetSplitType( nSplitId, nSplitLayerId) + local nSplitType = EgtGetInfo( nSplitLayerId, WIN_SPLITTYPE, 'i') - -- se non ha split specifico impostato verifico se ha sash prima o dopo per capire se è di tipo mullion - if not nSplitType or nSplitType == WIN_SPLITTYPES.NULL then + -- la tipologia è salvata nel layer solo se si tratta di un french split, negli altri casi va calcolata + if not nSplitType then + -- controllo se è dentro anta o telaio local nParentAreaId = EgtGetParent( nSplitLayerId) local nParentAreaType = EgtGetInfo( nParentAreaId, WIN_AREATYPE, 'i') or WIN_AREATYPES.NULL - while nParentAreaId and nParentAreaType ~= WIN_AREATYPES.SASH do + while nParentAreaId and nParentAreaType ~= WIN_AREATYPES.SASH and nParentAreaType ~= WIN_AREATYPES.FRAME do nParentAreaId = EgtGetParent( nParentAreaId) nParentAreaType = EgtGetInfo( nParentAreaId or GDB_ID.NULL, WIN_AREATYPE, 'i') or WIN_AREATYPES.NULL end - -- se dentro anta è di tipo null, se non è dentro anta devo verificare le tipologie dei figli - if not nParentAreaId or nParentAreaType ~= WIN_AREATYPES.SASH then - local nSplitId = EgtGetFirstInGroup( nSplitLayerId) + + if nParentAreaType == WIN_AREATYPES.SASH then + -- se dentro anta + nSplitType = WIN_SPLITTYPES.INSASH + else + -- se dentro telaio verifico la tipologia dei figli local nChildrenType = GetChildrenType( nSplitId) if nChildrenType == WIN_CHILDREN_TYPES.MIXED then nSplitType = WIN_SPLITTYPES.MIXED - elseif nChildrenType == WIN_CHILDREN_TYPES.SASH or nChildrenType == WIN_CHILDREN_TYPES.NULL then + elseif nChildrenType == WIN_CHILDREN_TYPES.FILL then + nSplitType = WIN_SPLITTYPES.INFRAME + else -- sash o non definiti nSplitType = WIN_SPLITTYPES.MULLION end end + + if not nSplitType then + nSplitType = WIN_SPLITTYPES.NULL + end end - if not nSplitType then - nSplitType = WIN_SPLITTYPES.NULL - end - EgtSetInfo( nSplitLayerId, WIN_SPLITTYPE, nSplitType) + -- salvo la tipologia come info sulla curva + EgtSetInfo( nSplitId, WIN_SPLITTYPE, nSplitType) return nSplitType end --------------------------------------------------------------------- --- funzione che imposta i tipi di profilo per gli split -local function CalcSplitProfileType( nSplitLayerId, nAreaId) - - local nSplitId = EgtGetFirstInGroup( nSplitLayerId) - -- verifico il tipo di split - local nSplitType = GetSplitType( nSplitLayerId) - if nSplitType == WIN_SPLITTYPES.MULLION then - -- verifico direzione per dare nome - local vtMedia = ( ( EgtEV( nSplitId) - EgtSV( nSplitId)) / 2) - if not vtMedia:normalize() then - vtMedia = EgtSV( nSplitId) - end - if abs( vtMedia:getX()) > abs( vtMedia:getY()) then - EgtSetInfo( nSplitId, WIN_PROFILETYPE, WIN_SASH_HORIZONTAL) - else - EgtSetInfo( nSplitId, WIN_PROFILETYPE, WIN_SASH_VERTICAL) - end - - elseif nSplitType == WIN_SPLITTYPES.NULL then - -- verifico se interno ad anta o a frame - local nParentAreaId = nAreaId - local nParentAreaType = EgtGetInfo( nParentAreaId, WIN_AREATYPE, 'i') - while nParentAreaType ~= WIN_AREATYPES.FRAME and nParentAreaType ~= WIN_AREATYPES.SASH do - nParentAreaId = EgtGetParent( nParentAreaId) - nParentAreaType = EgtGetInfo( nParentAreaId, WIN_AREATYPE, 'i') - end - -- assegno tipo di profilo allo split - if nParentAreaType == WIN_AREATYPES.SASH then - EgtSetInfo( nSplitId, WIN_PROFILETYPE, WIN_SASH_SPLIT) - else - EgtSetInfo( nSplitId, WIN_PROFILETYPE, WIN_FRAME_SPLIT) - end - - elseif nSplitType == WIN_SPLITTYPES.MIXED then - EgtSetInfo( nSplitId, WIN_PROFILETYPE, WIN_MIXED_SPLIT) - EgtSetInfo( nSplitId, WIN_PRF_CHANGE, true) - - -- verifico se l'orientamento dello split è coerente con il cambio profilo ( vetro fisso a destra e anta a sinistra) : - -- recupero il lato da cui si trova il figlio di tipo anta - local nSashChild = EgtGetInfo( nSplitId, WIN_SASH_CHILDREN, 'i') - local nRefCrv = EgtGetNext( nSashChild) or EgtGetPrev( nSashChild) - local _, _, nSide = EgtPointCurveDistSide( EgtMP( nRefCrv), nSplitId, Z_AX()) - -- se si trova a destra, lo split va invertito - if nSide == 1 then - EgtInvertCurve( nSplitId) - -- scambio le info di intersezione - local vStartInters = EgtGetInfo( nSplitId, WIN_SPLIT_STARTINTERS, 'vi') - local vEndInters = EgtGetInfo( nSplitId, WIN_SPLIT_ENDINTERS, 'vi') - EgtSetInfo( nSplitId, WIN_SPLIT_STARTINTERS, vEndInters) - EgtSetInfo( nSplitId, WIN_SPLIT_ENDINTERS, vStartInters) - end - end - - -- se split di tipo french non ha profilo assegnato perchè non ha un pezzo associato -end - ---------------------------------------------------------------------- -local function FindAdjacentSashType( nSplitId, nSouId) - +local function FindAdjacentSashType( nSplitId, nCurrId) -- recupero l'altro child dello split local vSplitChildren = EgtGetInfo( nSplitId, WIN_CHILD, 'vi') - local vChildren = EgtIf( vSplitChildren[1] == nSouId, {vSplitChildren[2]}, {vSplitChildren[1]}) - -- cerco il suo primo figlio di tipo sash - local nAreaType - local nArea - repeat - vChildren = EgtGetInfo( vChildren[1], WIN_CHILD, 'vi') - if vChildren then - nArea = EgtGetParent( EgtGetParent( vChildren[1])) - nAreaType = EgtGetInfo( nArea or GDB_ID.NULL, WIN_AREATYPE, 'i') - end - until not vChildren or nAreaType == WIN_AREATYPES.SASH - - -- recupero il sash type - local nSashType = EgtGetInfo( nArea or GDB_ID.NULL, WIN_SASHTYPE, 'i') - return nSashType + local nAdjChild = EgtIf( vSplitChildren[1] == nCurrId, vSplitChildren[2], vSplitChildren[1]) + -- recupero la sua tipologia dalla sua area + local nAdjSash = EgtGetParent( EgtGetParent( nAdjChild)) + local nAdjType = EgtGetInfo( nAdjSash, WIN_SASHTYPE, 'i') + return nAdjType end --------------------------------------------------------------------- @@ -765,19 +708,54 @@ local function CalcProfileType( nAreaId) if bThreshold then EgtSetInfo( nAreaId, WIN_THRESHOLD, true) end - - -- verifico se ci sono split e ne assegno il profilo - local nSplitLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_BASESPLIT) - if nSplitLayerId then - CalcSplitProfileType( nSplitLayerId, nAreaId) - end + -- SPLIT - elseif nAreaType == WIN_AREATYPES.SPLIT or nAreaType == WIN_AREATYPES.NULL then - -- verifico se ci sono split e ne assegno il profilo + elseif nAreaType == WIN_AREATYPES.SPLIT then local nSplitLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_BASESPLIT) - if nSplitLayerId then - CalcSplitProfileType( nSplitLayerId, nAreaId) + local vSplitIds = EgtGetAllInGroup( nSplitLayerId) + for i = 1, #vSplitIds do + -- ricavo il tipo di split + local nSplitType = GetSplitType( vSplitIds[i], nSplitLayerId) + + if nSplitType == WIN_SPLITTYPES.MULLION then + -- verifico direzione per assengare il profilo + local vtMedia = ( ( EgtEV( vSplitIds[i]) - EgtSV( vSplitIds[i])) / 2) + if not vtMedia:normalize() then + vtMedia = EgtSV( vSplitIds[i]) + end + if abs( vtMedia:getX()) > abs( vtMedia:getY()) then + EgtSetInfo( vSplitIds[i], WIN_PROFILETYPE, WIN_SASH_HORIZONTAL) + else + EgtSetInfo( vSplitIds[i], WIN_PROFILETYPE, WIN_SASH_VERTICAL) + end + + elseif nSplitType == WIN_SPLITTYPES.INSASH then + EgtSetInfo( vSplitIds[i], WIN_PROFILETYPE, WIN_SASH_SPLIT) + + elseif nSplitType == WIN_SPLITTYPES.INFRAME then + EgtSetInfo( vSplitIds[i], WIN_PROFILETYPE, WIN_FRAME_SPLIT) + + elseif nSplitType == WIN_SPLITTYPES.MIXED then + EgtSetInfo( vSplitIds[i], WIN_PROFILETYPE, WIN_MIXED_SPLIT) + EgtSetInfo( vSplitIds[i], WIN_PRF_CHANGE, true) + + -- verifico se l'orientamento dello split è coerente con il cambio profilo ( vetro fisso a destra e anta a sinistra) : + -- recupero il lato da cui si trova il figlio di tipo anta + local nSashChild = EgtGetInfo( vSplitIds[i], WIN_SASH_CHILDREN, 'i') + local nRefCrv = EgtGetNext( nSashChild) or EgtGetPrev( nSashChild) + local _, _, nSide = EgtPointCurveDistSide( EgtMP( nRefCrv), vSplitIds[i], Z_AX()) + -- se si trova a destra, lo split va invertito + if nSide == 1 then + EgtInvertCurve( vSplitIds[i]) + -- scambio le info di intersezione + local vStartInters = EgtGetInfo( vSplitIds[i], WIN_SPLIT_STARTINTERS, 'vi') + local vEndInters = EgtGetInfo( vSplitIds[i], WIN_SPLIT_ENDINTERS, 'vi') + EgtSetInfo( vSplitIds[i], WIN_SPLIT_STARTINTERS, vEndInters) + EgtSetInfo( vSplitIds[i], WIN_SPLIT_ENDINTERS, vStartInters) + end + end + -- se split di tipo french non ha profilo assegnato perchè non ha un pezzo associato end -- SASH @@ -805,24 +783,10 @@ local function CalcProfileType( nAreaId) end else - -- verifico se deriva da una curva di split di tipo french ( e quindi deve avere profilo speciale e.g. battente/ricevente) + -- verifico se deriva da una curva di split ( e quindi deve avere profilo speciale e.g. battente/ricevente) local nSouId = EgtGetInfo( nOutlineId, WIN_SOU, 'i') - local nSouPrevId - local nSplitType - repeat - nSouPrevId = nSouId - nSouId = EgtGetInfo( nSouId, WIN_SOU, 'i') - if nSouId then - local sName = EgtGetName( nSouId) - if sName == WIN_SPLIT then - local nParentId = EgtGetParent( nSouId) - nSplitType = EgtGetInfo( nParentId, WIN_SPLITTYPE, 'i') - end - end - until not nSouId or nSplitType == WIN_SPLITTYPES.FRENCH - - if nSplitType == WIN_SPLITTYPES.FRENCH then - -- setto info sulla curva per ricordare che deriva da un french split ( utile nel calcolo degli outlines) + if EgtGetName( nSouId) == WIN_SPLIT then + -- setto info sulla curva per ricordare che deriva da un french split EgtSetInfo( nOutlineId, WIN_CRV_ON_FRENCH_SPLIT, true) -- a) battente/ricevente @@ -834,7 +798,7 @@ local function CalcProfileType( nAreaId) EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_FRENCH_OUT) elseif nSashType == WIN_SASHTYPES.ACTIVE_IN or nSashType == WIN_SASHTYPES.INACTIVE_IN then -- devo verificare il tipo dell'anta adiacente - local nAdjSashType = FindAdjacentSashType( nSouId, nSouPrevId) + local nAdjSashType = FindAdjacentSashType( nSouId, nOutlineId) if nSashType == WIN_SASHTYPES.ACTIVE_IN then if nAdjSashType == WIN_SASHTYPES.ACTIVE_OUT then EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_FRENCH_IN) @@ -851,7 +815,7 @@ local function CalcProfileType( nAreaId) -- b) alzante scorrevole elseif nSashType == WIN_SASHTYPES.SLIDE_MOVABLE then - local nAdjSashType = FindAdjacentSashType( nSouId, nSouPrevId) + local nAdjSashType = FindAdjacentSashType( nSouId, nOutlineId) if nAdjSashType == WIN_SASHTYPES.SLIDE_MOVABLE then EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SLIDE_ACTIVE_IN) else @@ -907,14 +871,6 @@ local function CalcProfileType( nAreaId) end nOutlineId = EgtGetNext( nOutlineId) end - - -- verifico se ci sono split - local nSplitLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_BASESPLIT) - if nSplitLayerId then - -- assegno tipo di profilo - local nSplitId = EgtGetFirstInGroup( nSplitLayerId) - EgtSetInfo( nSplitId, WIN_PROFILETYPE, WIN_SASH_SPLIT) - end end end @@ -953,6 +909,104 @@ local function TrimSplitWithOutline( nSplitId) EgtTrimCurveEndAtParam( nSplitId, dEndInters) end +--------------------------------------------------------------------- +-- funzione che calcola l'outline per aree virtuali ausiliarie di split a griglia +local function CalculateVirtualAreaOutline( nAreaId, dZmove) + + local nOutlineLayerId = EgtGroup( nAreaId) + EgtSetName( nOutlineLayerId, WIN_OUTLINE) + EgtSetStatus( nOutlineLayerId, GDB_ST.OFF) + + local nBaseOutlineLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_AREAOUTLINE) + local nBaseOutlineId = EgtGetFirstInGroup( nBaseOutlineLayerId) + while nBaseOutlineId do + local nSouId = EgtGetInfo( nBaseOutlineId, WIN_SOU, 'i') + local nOutlineId + + if EgtGetName( nSouId) == WIN_SPLIT then + -- se deriva da split lo copio e lo traslo + nOutlineId = EgtCopy( nSouId, nOutlineLayerId) + EgtMove( nOutlineId, Z_AX() * dZmove) + EgtSetName( nOutlineId, EgtGetName( nBaseOutlineId)) + -- salvo riferimento dello split da cui deriva + EgtSetInfo( nOutlineId, WIN_REF_SPLIT, nSouId) + -- verifico orientamento + local nCrvRef = EgtGetPrev( nBaseOutlineId) or EgtGetNext( nBaseOutlineId) + local _, _, nSide = EgtPointCurveDistSide( EgtMP( nCrvRef), nOutlineId, Z_AX()) + if nSide == 1 then + EgtInvertCurve( nOutlineId) + EgtSetInfo( nOutlineId, WIN_INV_SPLIT, true) + end + else + local nCopyId = EgtGetInfo( nSouId, WIN_COPY, 'i') or GDB_ID.NULL + nOutlineId = EgtCopy( nCopyId, nOutlineLayerId) + end + + if nOutlineId then + -- sistemo le info + EgtSetInfo( nOutlineId, WIN_COPY, nBaseOutlineId) + EgtSetInfo( nBaseOutlineId, WIN_COPY, nOutlineId) + EgtRemoveInfo( nOutlineId, WIN_CHILD) + end + + nBaseOutlineId = EgtGetNext( nBaseOutlineId) + end + -- taglio tutti i contorni + TrimOrderedCurves( EgtGetAllInGroup( nOutlineLayerId), 1) +end + +--------------------------------------------------------------------- +local function CalculateSplitOutline( nAreaId) + + -- copio il layer di base outline + local nBaseSplitLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_BASESPLIT) + local nSplitLayerId = EgtCopy( nBaseSplitLayerId, nAreaId) + EgtSetName( nSplitLayerId, WIN_SPLIT) + EgtSetStatus( nSplitLayerId, GDB_ST.OFF) + + local vBaseSplitIds = EgtGetAllInGroup( nBaseSplitLayerId) + local vSplitIds = EgtGetAllInGroup( nSplitLayerId) + + -- se split interni ad anta ricavo quota in z dal suo profilo + local dZMove = 0 + local nSplitType = EgtGetInfo( vSplitIds[1], WIN_SPLITTYPE, 'i') + if nSplitType == WIN_SPLITTYPES.INSASH then + -- recupero area sash che lo contiene + local nSashAreaId = nAreaId + local nAreaType = EgtGetInfo( nSashAreaId, WIN_AREATYPE, 'i') + while nAreaType ~= WIN_AREATYPES.SASH do + nSashAreaId = EgtGetParent( nSashAreaId) + nAreaType = EgtGetInfo( nSashAreaId, WIN_AREATYPE, 'i') + end + -- recupero il profilo dell'anta da una curva dell'outline + local nSashBaseOutlineLayerId = EgtGetFirstNameInGroup( nSashAreaId, WIN_AREAOUTLINE) + local nSashBaseOutlineId = EgtGetFirstInGroup( nSashBaseOutlineLayerId) + local sSashProfile = EgtGetInfo( nSashBaseOutlineId, WIN_PROFILETYPE) + local nProfileLayerId = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_PROFILE) + local nSashProfileLayerId = EgtGetFirstNameInGroup( nProfileLayerId, WIN_SASH) + local nSashProfileId = EgtGetFirstNameInGroup( nSashProfileLayerId, sSashProfile) + -- calcolo offset sulla z dell'anta + dZMove = EgtGetInfo( nSashProfileId, WIN_DELTA, 'd') + end + + -- verifico se presenti aree ausiliarie per split a griglia + local vAuxAreas = EgtGetNameInGroup( nAreaId, WIN_VIRTUAL_AREA) or {} + for i = 1, #vAuxAreas do + CalculateVirtualAreaOutline( vAuxAreas[i], dZMove) + end + + -- sistemo gli outline degli split + for i = 1, #vSplitIds do + -- sistemo le info + EgtSetInfo( vBaseSplitIds[i], WIN_COPY, vSplitIds[i]) + EgtSetInfo( vSplitIds[i], WIN_COPY, vBaseSplitIds[i]) + -- taglio con outline + TrimSplitWithOutline( vSplitIds[i]) + -- aggiusto quota + EgtMove( vSplitIds[i], Z_AX() * dZMove) + end +end + --------------------------------------------------------------------- -- funzione che calcola l'outline dall'area outline ( base outline) local function CalculateOutlineFromAreaOutline( nAreaId) @@ -981,22 +1035,11 @@ local function CalculateOutlineFromAreaOutline( nAreaId) nAreaOutlineId = EgtGetNext( nAreaOutlineId) end - -- se presente, copio split - local nBaseSplitLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_BASESPLIT) - if nBaseSplitLayerId then - local nSplitLayerId = EgtCopy( nBaseSplitLayerId, nAreaId) - EgtSetName( nSplitLayerId, WIN_SPLIT) - EgtSetStatus( nSplitLayerId, GDB_ST.OFF) - local nBaseSplitId = EgtGetFirstInGroup( nBaseSplitLayerId) - local nSplitId = EgtGetFirstInGroup( nSplitLayerId) - EgtSetInfo( nBaseSplitId, WIN_COPY, nSplitId) - EgtSetInfo( nSplitId, WIN_COPY, nBaseSplitId) - end - -- SPLIT elseif nAreaType == WIN_AREATYPES.SPLIT or nAreaType == WIN_AREATYPES.NULL then - -- recupero outline di livello precedente e lo copio pezzo per pezzo + + -- a) outline dell'area local nBaseOutlineId = EgtGetFirstInGroup( nAreaOutlineLayerId) while nBaseOutlineId do -- recupero la curva di outline corrispondente alla curva del base outline da cui deriva e la copio @@ -1030,43 +1073,10 @@ local function CalculateOutlineFromAreaOutline( nAreaId) end -- taglio tutti i contorni TrimOrderedCurves( EgtGetAllInGroup( nOutlineLayerId), 1) - - -- se presente, copio split - local nBaseSplitLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_BASESPLIT) - if nBaseSplitLayerId then - local nSplitLayerId = EgtCopy( nBaseSplitLayerId, nAreaId) - EgtSetName( nSplitLayerId, WIN_SPLIT) - EgtSetStatus( nSplitLayerId, GDB_ST.OFF) - local nBaseSplitId = EgtGetFirstInGroup( nBaseSplitLayerId) - local nSplitId = EgtGetFirstInGroup( nSplitLayerId) - EgtSetInfo( nBaseSplitId, WIN_COPY, nSplitId) - EgtSetInfo( nSplitId, WIN_COPY, nBaseSplitId) - EgtRemoveInfo( nSplitId, WIN_SOU) - -- lo taglio con outline - TrimSplitWithOutline( nSplitId) - -- recupero tipo di profilo - local sSplitProfile = EgtGetInfo( nSplitId, WIN_PROFILETYPE) - -- se split interno ad anta devo alzarlo in z come l'anta che lo contiene - if sSplitProfile == WIN_SASH_SPLIT then - -- recupero l'anta - local nSashAreaId = EgtGetParent( nAreaId) - local nAreaType = EgtGetInfo( nSashAreaId, WIN_AREATYPE, 'i') - while nAreaType ~= WIN_AREATYPES.SASH do - nSashAreaId = EgtGetParent( nSashAreaId) - nAreaType = EgtGetInfo( nSashAreaId, WIN_AREATYPE, 'i') - end - local nSashBaseOutlineLayerId = EgtGetFirstNameInGroup( nSashAreaId, WIN_AREAOUTLINE) - local nSashBaseOutlineId = EgtGetFirstInGroup( nSashBaseOutlineLayerId) - -- recupero il profilo dell'anta - local sSashProfile = EgtGetInfo( nSashBaseOutlineId, WIN_PROFILETYPE) - local nProfileLayerId = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_PROFILE) - local nSashProfileLayerId = EgtGetFirstNameInGroup( nProfileLayerId, WIN_SASH) - local nSashProfileId = EgtGetFirstNameInGroup( nSashProfileLayerId, sSashProfile) - -- calcolo offset sulla z dell'anta - local dSashZOffset = EgtGetInfo( nSashProfileId, WIN_DELTA, 'd') - -- sposto Split in Z - EgtMove( nSplitId, Z_AX() * dSashZOffset) - end + + -- b) split + if nAreaType == WIN_AREATYPES.SPLIT then + CalculateSplitOutline( nAreaId) end @@ -1113,10 +1123,8 @@ local function CalculateOutlineFromAreaOutline( nAreaId) -- 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 - - -- se outline non è segmento battente o ricevente necessita di offset 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 local nFrameBaseOutlineId = nSouId local sFrameProfile = EgtGetInfo( nFrameBaseOutlineId, WIN_PROFILETYPE) @@ -1135,6 +1143,17 @@ local function CalculateOutlineFromAreaOutline( nAreaId) -- faccio offset EgtOffsetCurve( nOutlineId, - dSashPerpOffset) + + else + -- se deriva da french split sistemo il nome + local sBaseName = EgtGetName( nBaseOutlineId) + EgtSetName( nOutlineId, sBaseName) + -- controllo l'orientamento + local nCrvRef = EgtGetPrev( nBaseOutlineId) or EgtGetNext( nBaseOutlineId) + local _, _, nSide = EgtPointCurveDistSide( EgtMP( nCrvRef), nOutlineId, Z_AX()) + if nSide == 1 then + EgtInvertCurve( nOutlineId) + end end end @@ -1143,31 +1162,6 @@ local function CalculateOutlineFromAreaOutline( nAreaId) -- accorcio gli offset TrimOrderedCurves( EgtGetAllInGroup( nOutlineLayerId), 1) - -- se presente, copio split - local nBaseSplitLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_BASESPLIT) - if nBaseSplitLayerId then - local nBaseSplitId = EgtGetFirstInGroup( nBaseSplitLayerId) - -- creo copia - local nSplitLayerId = EgtCopy( nBaseSplitLayerId, nAreaId) - EgtSetName( nSplitLayerId, WIN_SPLIT) - EgtSetStatus( nSplitLayerId, GDB_ST.OFF) - local nSplitId = EgtGetFirstInGroup( nSplitLayerId) - EgtSetInfo( nBaseSplitId, WIN_COPY, nSplitId) - EgtSetInfo( nSplitId, WIN_COPY, nBaseSplitId) - EgtRemoveInfo( nSplitId, WIN_SOU) - -- la taglio con outline - TrimSplitWithOutline( nSplitId) - - -- calcolo offset sulla z dal profilo dell'anta - local nPrevId = EgtGetInfo( nBaseSplitId, WIN_SPLIT_STARTINTERS, 'i') - local sSashProfile = EgtGetInfo( nPrevId, WIN_PROFILETYPE) - local nSashProfileId = EgtGetFirstNameInGroup( nSashProfileLayerId, sSashProfile) - local dSplitZOffset = EgtGetInfo( nSashProfileId, WIN_DELTA, 'd') - - -- sposto split in Z - EgtMove( nSplitId, Z_AX() * dSplitZOffset) - end - -- FILL elseif nAreaType == WIN_AREATYPES.FILL then @@ -1680,8 +1674,8 @@ local function CreateFrameGeo( nOutlineId, vPrevOutlineId, vNextOutlineId, nStar end EgtSetName( nPrevCurveId, WIN_GEO_LEFT) EgtSetInfo( nPrevCurveId, WIN_SEMI_PROFILE, nPrevSemiProfile) - EgtSetInfo( nPrevCurveId, WIN_REF_OUTLINE, abs( vPrevOutlineId[i])) - EgtRelocateGlob( nPrevCurveId, nGeoLayerId, GDB_IN.LAST_SON) + EgtSetInfo( nPrevCurveId, WIN_REF_OUTLINE, vPrevOutlineId[i]) + EgtRelocateGlob( nPrevCurveId, nGeoLayerId, GDB_IN.LAST_SON) end -- curve right @@ -1714,7 +1708,7 @@ local function CreateFrameGeo( nOutlineId, vPrevOutlineId, vNextOutlineId, nStar end EgtSetName( nNextCurveId, WIN_GEO_RIGHT) EgtSetInfo( nNextCurveId, WIN_SEMI_PROFILE, nNextSemiProfile) - EgtSetInfo( nNextCurveId, WIN_REF_OUTLINE, abs( vNextOutlineId[i])) + EgtSetInfo( nNextCurveId, WIN_REF_OUTLINE, vNextOutlineId[i]) EgtRelocateGlob( nNextCurveId, nInId, GDB_IN.BEFORE) end @@ -1837,7 +1831,7 @@ local function AddFillGeoCurve( nTestOutlineId, nOtherGeoId, nGeoLayerId) -- verifico se la curva da testare è quella già presente nell'outline local bAdd = true local nRef = EgtGetInfo( abs( nTestOutlineId), WIN_COPY, 'i') - local nOtherOutlineId = EgtGetInfo( nOtherGeoId, WIN_REF_OUTLINE, 'i') + local nOtherOutlineId = abs( EgtGetInfo( nOtherGeoId, WIN_REF_OUTLINE, 'i')) local nOtherBaseOutlineId = EgtGetInfo( nOtherOutlineId, WIN_COPY, 'i') local nOtherSouId = EgtGetInfo( nOtherBaseOutlineId, WIN_SOU, 'i') while nOtherSouId and bAdd do @@ -1856,7 +1850,7 @@ local function AddFillGeoCurve( nTestOutlineId, nOtherGeoId, nGeoLayerId) EgtSetInfo( nNewCrv, WIN_REF_OUTLINE, abs( nTestOutlineId)) -- recupero offset dal profilo - local nRefPart = FindAssociatedPart( abs( nTestOutlineId)) + local nRefPart = FindAssociatedPart( abs( nTestOutlineId), true) local nProfileLayId = EgtGetFirstNameInGroup( nRefPart, WIN_PROFILE) local nProfileId = EgtGetFirstNameInGroup( nProfileLayId, WIN_PRF_MAIN) local b3Profile = GetProfileLocalBox( nProfileId) @@ -1991,7 +1985,10 @@ local function CalcMixedOutlines( nPartId, nOutlineId) end local nCrvS, nCntS = EgtCurveCompoByReorder( nGrp, vSash, EgtSP( nOutlineId)) for nId = nCrvS, nCrvS + nCntS - 1 do - EgtSetName( nId, WIN_SASH) + -- da curva compo ricavo la curva linea/arco corrispondente + EgtMergeCurvesInCurveCompo( nId) + local nNewId = EgtExplodeCurveCompo( nId) + EgtSetName( nNewId, WIN_SASH) end -- recupero i tratti di tipo fill e li concateno @@ -2003,7 +2000,9 @@ local function CalcMixedOutlines( nPartId, nOutlineId) end local nCrvF, nCntF = EgtCurveCompoByReorder( nGrp, vFill, EgtSP( nOutlineId)) for nId = nCrvF, nCrvF + nCntF - 1 do - EgtSetName( nId, WIN_FILL) + EgtMergeCurvesInCurveCompo( nId) + local nNewId = EgtExplodeCurveCompo( nId) + EgtSetName( nNewId, WIN_FILL) end -- riordino le curve nel gruppo per ricostruire l'outline @@ -2020,11 +2019,15 @@ local function CalcMixedOutlines( nPartId, nOutlineId) local nAreaId = EgtGetParent( EgtGetParent( vStack[i])) local nAreaType = EgtGetInfo( nAreaId, WIN_AREATYPE, 'i') if nAreaType ~= WIN_AREATYPES.SASH and nAreaType ~= WIN_AREATYPES.FILL then - -- salvo il suo eventuale split + -- salvo i suo eventuali split mixed local nSplitLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_SPLIT) if nSplitLayerId then - local nSplitId = EgtGetFirstInGroup( nSplitLayerId) - table.insert( vSplitIds, nSplitId) + local vCurrSplits = EgtGetAllInGroup( nSplitLayerId) + for j = 1, #vCurrSplits do + if EgtGetInfo( vCurrSplits[j], WIN_SPLITTYPE, 'i') == WIN_SPLITTYPES.MIXED then + table.insert( vSplitIds, vCurrSplits[j]) + end + end end -- analizzo eventuali figli local vChildren = EgtGetInfo( vStack[i], WIN_CHILD, 'vi') or {} @@ -2650,7 +2653,7 @@ local function CreateTrimSurf( nGeoId, nProfileId, dGeoWidth, nLayerId) local sTrimProfileName = EgtGetName( nOrigTrimProfileId) sTrimProfileName = EgtIf( s_bSimplSolid, WIN_SIMPLIFIED, '') .. WIN_OFST .. sTrimProfileName -- recupero la curva di outline associata alla curva di geo - local nRefOutline = EgtGetInfo( nGeoId, WIN_REF_OUTLINE, 'i') + local nRefOutline = abs( EgtGetInfo( nGeoId, WIN_REF_OUTLINE, 'i')) -- calcolo la superficie di estrusione return CreateProfileSurf( nRefOutline, nProfileId, sTrimProfileName, 4 * dGeoWidth, nLayerId) end @@ -3389,7 +3392,7 @@ local function CalcSplitDowels( nSplitId, bStartOrEnd) for i = 1, #vGeoCrvs do - local nOrigOutline = EgtGetInfo( vGeoCrvs[i], WIN_REF_OUTLINE, 'i') + local nOrigOutline = abs( EgtGetInfo( vGeoCrvs[i], WIN_REF_OUTLINE, 'i')) -- verifico se soglia ( in quel caso non ci sono dowels quindi va ignorato) local bThreshold = EgtGetInfo( nOrigOutline, WIN_THRESHOLD, 'b') or false @@ -3541,22 +3544,22 @@ local function CalculateAreaDowels( nAreaId) nPrevOutline = nOutline nOutline = EgtGetNext( nOutline) end - end - - -- verifico se c'e' uno split - local nSplitLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_SPLIT) - if nSplitLayerId then + + elseif nAreaType == WIN_AREATYPES.SPLIT then + local nSplitLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_SPLIT) local nSplitType = EgtGetInfo( nSplitLayerId, WIN_SPLITTYPE, 'i') or WIN_SPLITTYPES.NULL -- se split non è di tipo french ha un pezzo associato per il quale vanno calcolate le spine if nSplitType ~= WIN_SPLITTYPES.FRENCH then - local nSplitId = EgtGetFirstInGroup( nSplitLayerId) - -- start - CalcSplitDowels( nSplitId, true) - -- end - CalcSplitDowels( nSplitId, false) + local vSplitIds = EgtGetAllInGroup( nSplitLayerId) + for i = 1, #vSplitIds do + -- start + CalcSplitDowels( vSplitIds[i], true) + -- end + CalcSplitDowels( vSplitIds[i], false) + end end - end - + end + -- calcolo le spine delle sottoaree local nChildAreaId = EgtGetFirstNameInGroup( nAreaId, WIN_AREA .. '*') while nChildAreaId do @@ -3659,7 +3662,7 @@ local function CalcAreaStrip( nGeoFillId) local tabStrip = {} for i = 1, #vGeoCrvs do - local nCrvId = EgtGetInfo( vGeoCrvs[i], WIN_REF_OUTLINE, 'i') + local nCrvId = abs( EgtGetInfo( vGeoCrvs[i], WIN_REF_OUTLINE, 'i')) local nPartId = FindAssociatedPart( nCrvId, true) local nOutlineId = EgtGetInfo( nPartId, WIN_REF_OUTLINE, 'i') @@ -4061,41 +4064,48 @@ local function CalculateAreaParts( nAreaId) end end end + + -- se anta disegno apertura + if nAreaType == WIN_AREATYPES.SASH then + DrawOpening( nAreaId) + end + elseif nAreaType == WIN_AREATYPES.FILL then -- creo riempimento CreatePartFromOutline( nAreaId, sName) - end - - -- verifico se c'e' uno split da realizzare - local nSplitLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_SPLIT) - if nSplitLayerId then + + elseif nAreaType == WIN_AREATYPES.SPLIT then + local nSplitLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_SPLIT) local nSplitType = EgtGetInfo( nSplitLayerId, WIN_SPLITTYPE, 'i') or WIN_SPLITTYPES.NULL -- se split non è di tipo french ha un pezzo associato if nSplitType ~= WIN_SPLITTYPES.FRENCH then - local nSplitId = EgtGetFirstInGroup( nSplitLayerId) - if nSplitId then + -- creo gruppo per area di selezione per programma + local nSelectionLayerId = EgtGroup( nAreaId) + EgtSetName( nSelectionLayerId, WIN_SPLITSELECTION) + EgtSetStatus( nSelectionLayerId, GDB_ST.OFF) + EgtSetColor( nSelectionLayerId, 'YELLOW') + EgtSetAlpha( nSelectionLayerId, 10) + local nSelectionArea + + local vSplitIds = EgtGetAllInGroup( nSplitLayerId) + for i = 1, #vSplitIds do -- creo pezzo split - local nSplitPartId = CreatePartFromOutline( nAreaId, sName, nSplitId) - -- disegno area di selezione per programma - local nSelectionLayerId = EgtGroup( nAreaId) - EgtSetName( nSelectionLayerId, WIN_SPLITSELECTION) - EgtSetStatus( nSelectionLayerId, GDB_ST.OFF) + local nSplitPartId = CreatePartFromOutline( nAreaId, sName, vSplitIds[i]) + + -- aggiorno area di selezione local nSplitPartGeoId = EgtGetFirstNameInGroup( nSplitPartId, WIN_GEO) local nSplitArea = EgtGetFirstNameInGroup( nSplitPartGeoId, WIN_GEO_SURF) - local nSelectionArea = EgtCopyGlob( nSplitArea, nSelectionLayerId) - EgtSetStatus( nSelectionArea, GDB_ST.ON) - EgtSetColor( nSelectionArea, 'YELLOW') - EgtSetAlpha( nSelectionArea, 10) - EgtMove( nSelectionArea, 10 * Z_AX()) + if not nSelectionArea then + nSelectionArea = EgtCopyGlob( nSplitArea, nSelectionLayerId) + EgtSetStatus( nSelectionArea, GDB_ST.ON) + else + EgtSurfFrAdd( nSelectionArea, nSplitArea) + end end + EgtMove( nSelectionArea, 10 * Z_AX()) end end - - -- se anta disegno apertura - if nAreaType == WIN_AREATYPES.SASH then - DrawOpening( nAreaId) - end - + -- disegno area di selezione per programma local nSelectionLayerId = EgtGroup( nAreaId) EgtSetName( nSelectionLayerId, WIN_SELECTION) @@ -4674,6 +4684,8 @@ local function CalcGeoRawFromLogs( nPartId) end vPtInters[#vPtInters + 1] = vPtInters[1] for i = 1, #vCrvs do + EgtExtendCurveStartByLen( vCrvs[i], 100) + EgtExtendCurveEndByLen( vCrvs[i], 100) local dParS = EgtCurveParamAtPoint( vCrvs[i], vPtInters[i]) local dParE = EgtCurveParamAtPoint( vCrvs[i], vPtInters[i+1]) EgtTrimCurveStartEndAtParam( vCrvs[i], dParS, dParE) @@ -5825,15 +5837,9 @@ function WinCalculate.AddHardware( nAreaId) end function WinCalculate.AddHardwareRec( nAreaId) - -- verifico il tipo - local nAreaType = EgtGetInfo( nAreaId, WIN_AREATYPE, 'i') - local nSplitLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_SPLIT) - local nSplitType = WIN_SPLITTYPES.NULL - if nSplitLayerId then - nSplitType = EgtGetInfo( nSplitLayerId, WIN_SPLITTYPE, 'i') - end - if nAreaType == WIN_AREATYPES.SASH or ( nSplitLayerId and nSplitType == WIN_SPLITTYPES.FRENCH) then - -- lancio calcolo sash + + if EgtExistsInfo( nAreaId, WIN_HDW_FAVOURITE) then + -- se area ha un preferito definito allora devo calcolare la ferramenta sulle sue ante return WinCalculate.AddHardwareForSash( nAreaId) else -- verifico se ci sono sotto-aree @@ -5851,48 +5857,31 @@ end local function DrawHardware( nAreaId, nAuxLayerId) -- verifico il tipo local nAreaType = EgtGetInfo( nAreaId, WIN_AREATYPE, 'i') - -- se anta disegno la ferramenta + if nAreaType == WIN_AREATYPES.SASH then - -- se è stato definito un preferito disegno la ferramenta + -- se anta disegno la ferramenta se è stato definito un preferito local sFavourite = EgtGetInfo( nAreaId, WIN_HDW_FAVOURITE) or WIN_HDW_NULL if sFavourite ~= WIN_HDW_NULL then DrawSashHardware( nAreaId, nAreaId, nAuxLayerId) end return - - else - -- verifico se contiene un french split - local nSplitLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_SPLIT) - local nSplitType = WIN_SPLITTYPES.NULL - if nSplitLayerId then - nSplitType = EgtGetInfo( nSplitLayerId, WIN_SPLITTYPE, 'i') - end + + elseif nAreaType == WIN_AREATYPES.SPLIT then + local nSplitLayerId = EgtGetFirstNameInGroup( vStack[i], WIN_SPLIT) or GDB_ID.NULL + local nSplitType = EgtGetInfo( nSplitLayerId, WIN_SPLITTYPE, 'i') or WIN_SPLITTYPES.NULL if nSplitType == WIN_SPLITTYPES.FRENCH then - -- se ha definito un preferito devo disegnare la ferramenta - local sFavourite = EgtGetInfo( nAreaId, WIN_HDW_FAVOURITE) or WIN_HDW_NULL - if sFavourite ~= WIN_HDW_NULL then - -- recupero tutte le sottoaree di tipo anta - local vSashes = {} - local vStack = EgtGetNameInGroup( nAreaId, WIN_AREA .. '*') - local i = 1 - while vStack[i] do - local nType = EgtGetInfo( vStack[i], WIN_AREATYPE, 'i') - if nType == WIN_AREATYPES.SASH then - table.insert( vSashes, vStack[i]) - else - local vChildren = EgtGetNameInGroup( vStack[i], WIN_AREA .. '*') - vStack = EgtJoinTables( vStack, vChildren) - end - end - -- disegno la ferramenta su tutte le ante - for i = 1, #vSashes do - DrawSashHardware( vSashes[i], nAreaId, nAuxLayerId) + -- il gruppo con le info per la ferramenta è il suo parent + local nInfoArea = EgtGetParent( nAreaId) + local sHdwFavourite = EgtGetInfo( nInfoArea, WIN_HDW_FAVOURITE) + if sHdwFavourite and sHdwFavourite ~= WIN_HDW_NULL then + -- disegno ferramenta per tutte le ante avendo come gruppo di riferimento delle info il parent dell'area split french + local vSashes = EgtGetNameInGroup( nAreaId, WIN_AREA .. '*') + for j = 1, #vSashes do + DrawSashHardware( vSashes[j], nInfoArea, nAuxLayerId) end end return - else - -- verifico se ci sono sotto-aree local nChildAreaId = EgtGetFirstNameInGroup( nAreaId, WIN_AREA .. '*') while nChildAreaId do -- lancio verifica di quell'area @@ -5900,51 +5889,38 @@ local function DrawHardware( nAreaId, nAuxLayerId) nChildAreaId = EgtGetNextName( nChildAreaId, WIN_AREA .. '*') end end + + else + -- verifico se ci sono sotto-aree + local nChildAreaId = EgtGetFirstNameInGroup( nAreaId, WIN_AREA .. '*') + while nChildAreaId do + -- lancio verifica di quell'area + DrawHardware( nChildAreaId, nAuxLayerId) + nChildAreaId = EgtGetNextName( nChildAreaId, WIN_AREA .. '*') + end end end + ---------------------------------------------------------------------------------- ----------------------------------- ACCESSORI ---------------------------------- ---------------------------------------------------------------------------------- --- funzione che indidivua i parametri di trim della curva nCrvId in base al geo delle curve prev e next ( ricavate dalle info di nAuxCrv) -local function GetTrimParamsByPrevAndNext( nCrvId, nAuxCrvId, sGeoRef) +-- funzione che individua l'intersezione tra nOutlineId e la curva del geo indicata da sGeoRef del pezzo avente come outline nRefCrvId +local function GetTrimParamByGeo( nOutlineId, nRefCrvId, sGeoRef) - local nAuxGrp = EgtGetParent( nCrvId) - -- recupero curve prev e next di riferimento - local nPrevCrv = abs( EgtGetInfo( nAuxCrvId, WIN_PREV_OUTLINES, 'i')) - local nNextCrv = abs( EgtGetInfo( nAuxCrvId, WIN_NEXT_OUTLINES, 'i')) - if not nPrevCrv or not nNextCrv then - -- gestione speciale per soglia dove prev e next non sono settati - local nRefGrp = EgtGetParent( nAuxCrvId) - nPrevCrv = EgtGetLastInGroup( nRefGrp) - nNextCrv = EgtGetNext( nAuxCrvId) - end + -- recupero la curva di interessa del geo + local nRefPart = EgtGetInfo( nRefCrvId, WIN_REF_PART, 'i') + local nRefGeo = EgtGetFirstNameInGroup( nRefPart, WIN_GEO) + local nGeoCrv = EgtGetFirstNameInGroup( nRefGeo, sGeoRef) - -- recupero le curve del geo di interesse - local nPrevPart = EgtGetInfo( nPrevCrv, WIN_REF_PART, 'i') - local nPrevGeo = EgtGetFirstNameInGroup( nPrevPart, WIN_GEO) - local nPrevRef = EgtGetFirstNameInGroup( nPrevGeo, sGeoRef) - local nPrevCopy = EgtCopyGlob( nPrevRef, nAuxGrp) - EgtExtendCurveStartByLen( nPrevCopy, 1000) - EgtExtendCurveEndByLen( nPrevCopy, 1000) - local nNextPart = EgtGetInfo( nNextCrv, WIN_REF_PART, 'i') - local nNextGeo = EgtGetFirstNameInGroup( nNextPart, WIN_GEO) - local nNextRef = EgtGetFirstNameInGroup( nNextGeo, sGeoRef) - local nNextCopy = EgtCopyGlob( nNextRef, nAuxGrp) - EgtExtendCurveStartByLen( nNextCopy, 1000) - EgtExtendCurveEndByLen( nNextCopy, 1000) + -- recupero punto di intersezione ( con eventuale estensione delle curve) + local ptInt = FindIntersectionPoint( nOutlineId, nGeoCrv, ORIG()) - -- recupero punti di intersezione - local ptS = EgtIP( nCrvId, nPrevCopy, ORIG()) - local dParS = EgtCurveParamAtPoint( nCrvId, ptS) - local ptE = EgtIP( nCrvId, nNextCopy, ORIG()) - local dParE = EgtCurveParamAtPoint( nCrvId, ptE) - - EgtErase( { nPrevCopy, nNextCopy}) - - return dParS, dParE + -- ricavo il parametro di intersezione sulla curva di outline ( senza estensione) + local dPar = EgtCurveParamAtPoint( nOutlineId, ptInt) + return dPar end ---------------------------------------------------------------------------------- @@ -5968,8 +5944,13 @@ local function CalcThreshold( nOutlineId, nAreaId) if bSlideWindow then -- 1) soglia extra per parte mobile local nGuideId = EgtCopyGlob( nOutlineId, nAuxGrp) - local dParS, dParE = GetTrimParamsByPrevAndNext( nGuideId, nOutlineId, WIN_IN) + -- taglio la curva guida con i pezzi di telaio vicini + local nPrevCrv = EgtGetLastInGroup( EgtGetParent( nOutlineId)) + local dParS = GetTrimParamByGeo( nGuideId, nPrevCrv, WIN_GEO_IN) + local nNextCrv = EgtGetNext( nOutlineId) + local dParE = GetTrimParamByGeo( nGuideId, nNextCrv, WIN_GEO_IN) EgtTrimCurveStartEndAtParam( nGuideId, dParS, dParE) + local vMovableSections = EgtGetNameInGroup( nProfileId, WIN_MOVABLE .. WIN_SECTION) for i = 1, #vMovableSections do local nStmExtra = CreateProfileSurfById( nGuideId, nProfileId, vMovableSections[i], 0, nAuxGrp) @@ -5993,10 +5974,12 @@ local function CalcThreshold( nOutlineId, nAreaId) local nGuideId = EgtCopyGlob( vChildren[i], nAuxGrp) EgtExtendCurveStartByLen( nGuideId, 1000) EgtExtendCurveEndByLen( nGuideId, 1000) - -- trim della guida con il geo dei pezzi vicini local nOutlineId = EgtGetInfo( vChildren[i], WIN_COPY, 'i') - local dParS, dParE = GetTrimParamsByPrevAndNext( nGuideId, nOutlineId, WIN_OUT) + local nPrevCrv = EgtGetInfo( nOutlineId, WIN_PREV_OUTLINES, 'i') + local dParS = GetTrimParamByGeo( nGuideId, nPrevCrv, WIN_GEO_OUT) + local nNextCrv = EgtGetInfo( nOutlineId, WIN_NEXT_OUTLINES, 'i') + local dParE = GetTrimParamByGeo( nGuideId, nNextCrv, WIN_GEO_OUT) EgtTrimCurveStartEndAtParam( nGuideId, dParS, dParE) for j = 1, #vExtraSections do @@ -6029,89 +6012,115 @@ local function CalcWaterdrip( nPartId, nOutlineId, nAreaId, bDraw) return end - -- gruppi per i conti - local nGrp = EgtGroup( nPartId) - - -- recupero parametri di intersezione con i pezzi vicini - local dParPrev, dParNext = GetTrimParamsByPrevAndNext( nOutlineId, nOutlineId, WIN_IN) - local vParams = { dParPrev, dParNext} - - -- verifico se outline va spezzato ulteriormente a causa di montanti - local nBottomRail = EgtGetInfo( nOutlineId, WIN_REF_BOTTOMRAIL_PART, 'i') - if not nBottomRail then -- se ha bottomrail gli split non causano interruzioni nel gocciolatoio - local vStack = {nAreaId} - local i = 1 - while vStack[i] do - local nAreaType = EgtGetInfo( vStack[i], WIN_AREATYPE, 'i') - if nAreaType == WIN_AREATYPES.FRAME or nAreaType == WIN_AREATYPES.SPLIT then - local nSplitId = EgtGetFirstNameInGroup( vStack[i], WIN_SPLIT) - if nSplitId then - local nSplitType = EgtGetInfo( nSplitId, WIN_SPLITTYPE, 'i') - if nSplitType ~= WIN_SPLITTYPES.FRENCH then - -- recupero il pezzo associato allo split - local nSplitOutline = EgtGetFirstInGroup( nSplitId) - local nSplitPart = EgtGetInfo( nSplitOutline, WIN_REF_PART, 'i') - -- recupero le intersezioni con la curva di outline - local nSplitGeo = EgtGetFirstNameInGroup( nSplitPart, WIN_GEO) - local nCrv1 = EgtGetFirstNameInGroup( nSplitGeo, WIN_IN) - local nCopy1 = EgtCopyGlob( nCrv1, nGrp) - EgtExtendCurveStartByLen( nCopy1, 200) - EgtExtendCurveEndByLen( nCopy1, 200) - local nCrv2 = EgtGetFirstNameInGroup( nSplitGeo, WIN_OUT) - local nCopy2 = EgtCopyGlob( nCrv2, nGrp) - EgtExtendCurveStartByLen( nCopy2, 200) - EgtExtendCurveEndByLen( nCopy2, 200) - local pt1 = EgtIP( nOutlineId, nCopy1, ORIG()) - local pt2 = EgtIP( nOutlineId, nCopy2, ORIG()) - if pt1 and pt2 then - -- salvo i parametri di intersezione - local dPar1 = EgtCurveParamAtPoint( nOutlineId, pt1, 100 * GEO.EPS_SMALL) - local dPar2 = EgtCurveParamAtPoint( nOutlineId, pt2, 100 * GEO.EPS_SMALL) - table.insert( vParams, dPar1) - table.insert( vParams, dPar2) - end - - -- salvo le sue sottoaree per analizzarle - local vChildren = EgtGetNameInGroup( vStack[i], WIN_AREA .. '*') or {} - vStack = EgtJoinTables( vStack, vChildren) - end - end - end - i = i + 1 - end - end - - -- riordino i parametri ( non dovrebbero mai capitare parametri coincidenti) - table.sort( vParams) - + local dLenTot = 0 -- recupero il gruppo per il disegno dei solidi local nSolidLayId if bDraw and s_bCalcSolid then nSolidLayId = GetAuxLayer() end - local dLenTot = 0 - for i = 1, #vParams, 2 do - -- creo la guida di estrusione per il gocciolatoio - local nGuideId = EgtCopyGlob( nOutlineId, nGrp) - -- trim della curva - EgtTrimCurveStartEndAtParam( nGuideId, vParams[i], vParams[i+1]) - -- aggiorno la lunghezza - dLenTot = dLenTot + EgtCurveLength( nGuideId) - -- disegno - if bDraw and s_bCalcSolid then - -- estrudo la superficie - local nStm = CreateProfileSurf( nGuideId, nProfileId, WIN_WATERDRIP, 0, nSolidLayId) - EgtSetColor( nStm, Color3d( 128, 128, 128)) - EgtSetName( nStm, WIN_WATERDRIP) + -- recupero tutti gli split che possono creare interruzioni nel gocciolatoio + local vSplits = {} + local nBottomRail = EgtGetInfo( nOutlineId, WIN_REF_BOTTOMRAIL_PART, 'i') + if not nBottomRail then -- se ha bottomrail gli split non causano interruzioni nel gocciolatoio + local vStack = {nAreaId} + local i = 1 + while vStack[i] do + local nAreaType = EgtGetInfo( vStack[i], WIN_AREATYPE, 'i') + if nAreaType == WIN_AREATYPES.SPLIT then + local nSplitId = EgtGetFirstNameInGroup( vStack[i], WIN_SPLIT) + local nSplitType = EgtGetInfo( nSplitId, WIN_SPLITTYPE, 'i') + if nSplitType ~= WIN_SPLITTYPES.FRENCH then + local vCurrSplits = EgtGetAllInGroup( nSplitId) + for j = 1, #vCurrSplits do + -- verifico se lo split poggia sulla curva bottom + local dDist1 = EgtPointCurveDist( EgtSP( vCurrSplits[j]), nOutlineId) + local dDist2 = EgtPointCurveDist( EgtEP( vCurrSplits[j]), nOutlineId) + if dDist1 < GEO.EPS_SMALL or dDist2 < GEO.EPS_SMALL then + table.insert( vSplits, vCurrSplits[j]) + end + end + end + end + + -- se non è anta o vetro ( che interrompono la cascata di pezzi relativi al telaio) salvo le sottaree per analizzarle + if nAreaType ~= WIN_AREATYPES.SASH and nAreaType ~= WIN_AREATYPES.FILL then + local vChildren = EgtGetNameInGroup( vStack[i], WIN_AREA .. '*') or {} + vStack = EgtJoinTables( vStack, vChildren) + end + -- passo all'area successiva + i = i + 1 + end + end + + -- recupero le curve sulle quali costruire il gocciolatoio: in generale è solo l'outline bottom, nel caso di cambio profilo sono solo i suoi sottotratti che poggiano + -- contro le ante + local vBottomOutlines = { nOutlineId} + local bProfileChange = EgtGetInfo( nOutlineId, WIN_PRF_CHANGE, 'b') or false + if bProfileChange then + local nMixedOutlinesLay = EgtGetFirstNameInGroup( nPartId, WIN_MIXED_OUTLINES) + local vSashOutlines = EgtGetNameInGroup( nMixedOutlinesLay, WIN_SASH) + vBottomOutlines = vSashOutlines + end + + -- recupero curve vicine + local nPrevCrv = EgtGetLastInGroup( EgtGetParent( nOutlineId)) + local nNextCrv = EgtGetNext( nOutlineId) + + for i = 1, #vBottomOutlines do + local vParams = {} + + -- verifico se interruzioni per i pezzi vicini del telaio + if AreSamePointApprox( EgtSP( vBottomOutlines[i]), EgtEP( nPrevCrv)) then + local dPar = GetTrimParamByGeo( vBottomOutlines[i], nPrevCrv, WIN_GEO_IN) + table.insert( vParams, dPar) + end + if AreSamePointApprox( EgtEP( vBottomOutlines[i]), EgtSP( nNextCrv)) then + local dPar = GetTrimParamByGeo( vBottomOutlines[i], nNextCrv, WIN_GEO_IN) + table.insert( vParams, dPar) + end + + -- verifico se interruzioni per split + for j = 1, #vSplits do + -- verifico se lo split poggia sulla curva + local dDist1 = EgtPointCurveDist( EgtSP( vSplits[j]), vBottomOutlines[i]) + local dDist2 = EgtPointCurveDist( EgtEP( vSplits[j]), vBottomOutlines[i]) + if dDist1 < GEO.EPS_SMALL or dDist2 < GEO.EPS_SMALL then + -- recupero i parametri di intersezione con il geo dello split + local dParIn = GetTrimParamByGeo( vBottomOutlines[i], vSplits[j], WIN_GEO_IN) + if dParIn then + table.insert( vParams, dParIn) + end + local dParOut = GetTrimParamByGeo( vBottomOutlines[i], vSplits[j], WIN_GEO_OUT) + if dParOut then + table.insert( vParams, dParOut) + end + end + end + + -- riordino i parametri ( non dovrebbero mai capitare parametri coincidenti) + table.sort( vParams) + + for j = 1, #vParams, 2 do + -- creo la guida di estrusione per il gocciolatoio + local nGuideId = EgtCopyGlob( vBottomOutlines[i], nSolidLayId) + -- trim della curva + EgtTrimCurveStartEndAtParam( nGuideId, vParams[j], vParams[j+1]) + -- aggiorno la lunghezza + dLenTot = dLenTot + EgtCurveLength( nGuideId) + -- disegno + if bDraw and s_bCalcSolid then + -- estrudo la superficie + local nStm = CreateProfileSurf( nGuideId, nProfileId, WIN_WATERDRIP, 0, nSolidLayId) + EgtSetColor( nStm, Color3d( 128, 128, 128)) + EgtSetName( nStm, WIN_WATERDRIP) + end + EgtErase( nGuideId) end end -- salvo la lunghezza del gocciolatoio EgtSetInfo( nAreaId, WIN_WATERDRIP_LEN, dLenTot) - - EgtErase( nGrp) - end --------------------------------------------------------------------- @@ -6273,7 +6282,7 @@ function WinCalculate.AddAccessories( nAreaId, bDraw) if nAreaType == WIN_AREATYPES.FRAME then local nOutlineLayId = EgtGetFirstNameInGroup( nAreaId, WIN_OUTLINE) - -- accessori del pezzo inferiore: soglia e gocciolatioio + -- accessori del pezzo inferiore: soglia e gocciolatoio local nBottomId = EgtGetFirstNameInGroup( nOutlineLayId, WIN_BOTTOM) local bThreshold = EgtGetInfo( nAreaId, WIN_THRESHOLD, 'b') or false if bThreshold then @@ -6285,42 +6294,32 @@ function WinCalculate.AddAccessories( nAreaId, bDraw) CalcWaterdrip( nPartId, nBottomId, nAreaId, bDraw) end - -- guarnizioni se definisce un french split o se definisce direttamente anta - local nSplitId = EgtGetFirstNameInGroup( nAreaId, WIN_SPLIT) or GDB_ID.NULL - local nSplitType = EgtGetInfo( nSplitId, WIN_SPLITTYPE, 'i') - if nSplitId == GDB_ID.NULL or nSplitType == WIN_SPLITTYPES.FRENCH then + -- guarnizioni se definisce direttamente anta + local nChildAreaId = EgtGetFirstNameInGroup( nAreaId, WIN_AREA .. '*') or GDB_ID.NULL + local nChildType = EgtGetInfo( nChildAreaId, WIN_AREATYPE, 'i') or WIN_AREATYPES.NULL + if nChildType == WIN_AREATYPES.SASH then CalcGaskets( nAreaId, bDraw) end -- TODO guarnizioni per gocciolatoio elseif nAreaType == WIN_AREATYPES.SASH then - -- guarnizioni anta + -- guarnizioni CalcGaskets( nAreaId, bDraw) elseif nAreaType == WIN_AREATYPES.SPLIT then - -- guarnizioni se è french split che non deriva da un french split + -- guarnizioni se è french split local nSplitId = EgtGetFirstNameInGroup( nAreaId, WIN_SPLIT) - local nSplitType = EgtGetInfo( nSplitId, WIN_SPLITTYPE, 'i') + local nSplitType = EgtGetInfo( nSplitId, WIN_SPLITTYPE, 'i') or WIN_SPLITTYPES.NULL if nSplitType == WIN_SPLITTYPES.FRENCH then - local nParentArea = EgtGetParent( nAreaId) - local nParentSplit = EgtGetFirstNameInGroup( nParentArea, WIN_SPLIT) or GDB_ID.NULL - local nSplitType = EgtGetInfo( nParentSplit, WIN_SPLITTYPE, 'i') - if nSplitType ~= WIN_SPLITTYPES.FRENCH then - CalcGaskets( nAreaId, bDraw) - end + CalcGaskets( nAreaId, bDraw) end elseif nAreaType == WIN_AREATYPES.NULL then - -- guarnizioni se non deriva da french split e ha come sottoarea un'anta - local nParentArea = EgtGetParent( nAreaId) - local nParentSplit = EgtGetFirstNameInGroup( nParentArea, WIN_SPLIT) or GDB_ID.NULL - local nSplitType = EgtGetInfo( nParentSplit, WIN_SPLITTYPE, 'i') - if nSplitType == WIN_SPLITTYPES.MULLION then - local nChildArea = EgtGetFirstNameInGroup( nAreaId, WIN_AREA .. '*') or GDB_ID.NULL - local nChildType = EgtGetInfo( nChildArea, WIN_AREATYPE, 'i') - if nChildType == WIN_AREATYPES.SASH then - CalcGaskets( nAreaId, bDraw) - end + -- guarnizioni se ha come sottoarea un'anta + local nChildArea = EgtGetFirstNameInGroup( nAreaId, WIN_AREA .. '*') or GDB_ID.NULL + local nChildType = EgtGetInfo( nChildArea, WIN_AREATYPE, 'i') or WIN_AREATYPES.NULL + if nChildType == WIN_AREATYPES.SASH then + CalcGaskets( nAreaId, bDraw) end end @@ -6425,24 +6424,24 @@ local function CalcPartPreview( nPartId, nPreviewGrp) end -- curva right + local vGeoRight = EgtGetNameInGroup( nGeoGrp, WIN_GEO_RIGHT) if nEndJoint == WIN_PART_JNT.SHORT then -- se giunzione short per evitare sovrapposizioni devo fermarla al box del pezzo adiacente - local vNextOutlines = EgtGetInfo( nOutlineId, WIN_NEXT_OUTLINES, 'vi') local vEndProfiles = EgtGetNameInGroup( nProfileGrp, WIN_PRF_END) - for i = 1, #vNextOutlines do - local nCrv = EgtCopyGlob( abs( vNextOutlines[i]), nGrpTmp) + for i = 1, #vGeoRight do + local nNextOutline = EgtGetInfo( vGeoRight[i], WIN_REF_OUTLINE, 'i') + local nCrv = EgtCopyGlob( abs( nNextOutline), nGrpTmp) local b3Profile = GetProfileLocalBox( vEndProfiles[i]) local dRailDelta = EgtGetInfo( vEndProfiles[i], WIN_RAILDELTA, 'd') or 0 local dOffs = b3Profile:getMin():getX() - dRailDelta - if vNextOutlines[i] < 0 then + if nNextOutline < 0 then EgtInvertCurve( nCrv) - dOffs = - ( b3Profile:getMax():getX() - dRailDelta) + dOffs = - ( b3Profile:getMax():getX() - dRailDelta) end EgtOffsetCurve( nCrv, dOffs) end else - -- altrimenti posso utilizzare la curva del geo - local vGeoRight = EgtGetNameInGroup( nGeoGrp, WIN_RIGHT) + -- altrimenti posso utilizzare direttamente la curva del geo for i = 1, #vGeoRight do EgtCopyGlob( vGeoRight[i], nGrpTmp) end @@ -6453,22 +6452,22 @@ local function CalcPartPreview( nPartId, nPreviewGrp) EgtCopyGlob( nGeoIn, nGrpTmp) -- curva left + local vGeoLeft = EgtGetNameInGroup( nGeoGrp, WIN_LEFT) if nStartJoint == WIN_PART_JNT.SHORT then - local vPrevOutlines = EgtGetInfo( nOutlineId, WIN_PREV_OUTLINES, 'vi') local vStartProfiles = EgtGetNameInGroup( nProfileGrp, WIN_PRF_START) - for i = 1, #vPrevOutlines do - local nCrv = EgtCopyGlob( abs( vPrevOutlines[i]), nGrpTmp) + for i = 1, #vGeoLeft do + local nPrevOutline = EgtGetInfo( vGeoLeft[i], WIN_REF_OUTLINE, 'i') + local nCrv = EgtCopyGlob( abs( nPrevOutline), nGrpTmp) local b3Profile = GetProfileLocalBox( vStartProfiles[i]) local dRailDelta = EgtGetInfo( vStartProfiles[i], WIN_RAILDELTA, 'd') or 0 local dOffs = b3Profile:getMin():getX() - dRailDelta - if vPrevOutlines[i] < 0 then + if nPrevOutline < 0 then EgtInvertCurve( nCrv) dOffs = - ( b3Profile:getMax():getX() - dRailDelta) end EgtOffsetCurve( nCrv, dOffs) end else - local vGeoLeft = EgtGetNameInGroup( nGeoGrp, WIN_LEFT) for i = 1, #vGeoLeft do EgtCopyGlob( vGeoLeft[i], nGrpTmp) end @@ -6510,45 +6509,45 @@ local function CalcFillPreview( nPartId, nPreviewGrp) end ---------------------------------------------------------------------------------- -local function CalcHardwarePreview( nFrameId, nPreviewGrp) - -- scorro tutte le aree alla ricerca della ferramenta - local vStack = { nFrameId} - local i = 1 - while i <= #vStack do - local nAreaType = EgtGetInfo( vStack[i], WIN_AREATYPE, 'i') - local nSplitLayerId = EgtGetFirstNameInGroup( vStack[i], WIN_SPLIT) or GDB_ID.NULL +local function CalcHardwarePreview( nAreaId, nPreviewGrp) + + local nAreaType = EgtGetInfo( nAreaId, WIN_AREATYPE, 'i') + if nAreaType == WIN_AREATYPES.SASH then + -- se anta disegno la ferramenta se è definita + local sHdwFavourite = EgtGetInfo( nAreaId, WIN_HDW_FAVOURITE) + if sHdwFavourite and sHdwFavourite ~= WIN_HDW_NULL then + DrawSashHardware( nAreaId, nAreaId, nPreviewGrp, true) + end + return + + elseif nAreaType == WIN_AREATYPES.SPLIT then + local nSplitLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_SPLIT) or GDB_ID.NULL local nSplitType = EgtGetInfo( nSplitLayerId, WIN_SPLITTYPE, 'i') or WIN_SPLITTYPES.NULL - if nAreaType == WIN_AREATYPES.SASH then - local sHdwFavourite = EgtGetInfo( vStack[i], WIN_HDW_FAVOURITE) + if nSplitType == WIN_SPLITTYPES.FRENCH then + -- il gruppo con le info per la ferramenta è il suo parent + local nInfoArea = EgtGetParent( nAreaId) + local sHdwFavourite = EgtGetInfo( nInfoArea, WIN_HDW_FAVOURITE) if sHdwFavourite and sHdwFavourite ~= WIN_HDW_NULL then - -- disegno la ferramenta per l'anta se definita - DrawSashHardware( vStack[i], vStack[i], nPreviewGrp, true) - end - - elseif nSplitType == WIN_SPLITTYPES.FRENCH then - local sHdwFavourite = EgtGetInfo( vStack[i], WIN_HDW_FAVOURITE) - if sHdwFavourite and sHdwFavourite ~= WIN_HDW_NULL then - -- disegno la ferramenta per tutte le sue sottaree di tipo anta tenendo come gruppo di riferimento per le info della ferramenta il corrente - local vStack2 = { vStack[i]} - local j = 1 - while j <= #vStack2 do - local nAreaType2 = EgtGetInfo( vStack2[j], WIN_AREATYPE, 'i') - if nAreaType2 == WIN_AREATYPES.SASH then - DrawSashHardware( vStack2[j], vStack[i], nPreviewGrp, true) - else - local vChildrenAreas = EgtGetNameInGroup( vStack2[j], WIN_AREA .. '*') or {} - vStack2 = EgtJoinTables( vStack2, vChildrenAreas) - end - j = j + 1 + -- disegno ferramenta per tutte le ante avendo come gruppo di riferimento delle info il parent dell'area split french + local vSashes = EgtGetNameInGroup( nAreaId, WIN_AREA .. '*') + for j = 1, #vSashes do + DrawSashHardware( vSashes[j], nInfoArea, nPreviewGrp, true) end end - + return else - -- aggiungo allo stack di aree da controllare le sue aree figlie - local vChildrenAreas = EgtGetNameInGroup( vStack[i], WIN_AREA .. '*') or {} - vStack = EgtJoinTables( vStack, vChildrenAreas) + -- se non è split french devo controllare le sue sottoaree + local vChildrenAreas = EgtGetNameInGroup( nAreaId, WIN_AREA .. '*') or {} + for i = 1, #vChildrenAreas do + CalcHardwarePreview( vChildrenAreas[i], nPreviewGrp) + end + end + else + -- controllo le sue sottoaree + local vChildrenAreas = EgtGetNameInGroup( nAreaId, WIN_AREA .. '*') or {} + for i = 1, #vChildrenAreas do + CalcHardwarePreview( vChildrenAreas[i], nPreviewGrp) end - i = i + 1 end end diff --git a/Designing/WinLib/WinCreate.lua b/Designing/WinLib/WinCreate.lua index a530698..94e5c17 100644 --- a/Designing/WinLib/WinCreate.lua +++ b/Designing/WinLib/WinCreate.lua @@ -28,6 +28,27 @@ local function AddInfo( nId, sInfo, nVal) EgtSetInfo( nId, sInfo, vInfo) end +---------------------------------------------------------------------------------- +local function CopyParentOutline( nAreaId, nParentAreaId) + -- recupero outline del parent + local nParentOutlineLayerId = EgtGetFirstNameInGroup( nParentAreaId, WIN_AREAOUTLINE) + local vParentCrvs = EgtGetAllInGroup( nParentOutlineLayerId) + -- creo outline per area corrente + local nOutlineLayerId = EgtGroup( nAreaId) + EgtSetName( nOutlineLayerId, WIN_AREAOUTLINE) + -- copio le curve di outline del parent e setto le corrispondenze sou/child + for i = 1, #vParentCrvs do + local nOutlineId = EgtCopy( vParentCrvs[i], nOutlineLayerId) + EgtSetInfo( nOutlineId, WIN_SOU, vParentCrvs[i]) + EgtSetInfo( vParentCrvs[i], WIN_CHILD, nOutlineId) + end + return nOutlineLayerId +end + + + +---------------------------------------------------------------------------------- +------------------------------------ PROFILO ------------------------------------- ---------------------------------------------------------------------------------- -- funzione che importa il profilo function WinCreate.ImportProfile( sProfilePath) @@ -61,6 +82,8 @@ function WinCreate.ImportProfile( sProfilePath) return true end + + ---------------------------------------------------------------------------------- ------------------------------------- TELAIO ------------------------------------- ---------------------------------------------------------------------------------- @@ -79,7 +102,7 @@ local function CreateFrameCurves( nLayerId, nType, dWidth, dHeight, dVal) local nLeftId = EgtLine( nLayerId, Point3d( 0, dHeight, 0), ORIG()) EgtSetName( nLeftId, WIN_LEFT) - -- lato top inclinato + -- lato top inclinato elseif nType == WIN_FRAME_TYPES.CHAMFER_SIDE then -- dHeight è l'altezza del lato sx, dVal è l'altezza del lato dx local nBottomId = EgtLine( nLayerId, ORIG(), Point3d( dWidth, 0, 0)) @@ -91,7 +114,7 @@ local function CreateFrameCurves( nLayerId, nType, dWidth, dHeight, dVal) local nLeftId = EgtLine( nLayerId, Point3d( 0, dHeight, 0), ORIG()) EgtSetName( nLeftId, WIN_LEFT) - -- triangular arch + -- triangular arch elseif nType == WIN_FRAME_TYPES.CHAMFER then -- dHeight è l'altezza dei lati verticali, dVal è l'altezza complessiva della finestra local nBottomId = EgtLine( nLayerId, ORIG(), Point3d( dWidth, 0, 0)) @@ -105,7 +128,7 @@ local function CreateFrameCurves( nLayerId, nType, dWidth, dHeight, dVal) local nLeftId = EgtLine( nLayerId, Point3d( 0, dHeight, 0), ORIG()) EgtSetName( nLeftId, WIN_LEFT) - -- arco a tutto sesto + -- arco a tutto sesto elseif nType == WIN_FRAME_TYPES.ROUND_ARC then local nBottomId = EgtLine( nLayerId, ORIG(), Point3d( dWidth, 0, 0)) EgtSetName( nBottomId, WIN_BOTTOM) @@ -116,7 +139,7 @@ local function CreateFrameCurves( nLayerId, nType, dWidth, dHeight, dVal) local nLeftId = EgtLine( nLayerId, Point3d( 0, dHeight - 0.5 * dWidth, 0), ORIG()) EgtSetName( nLeftId, WIN_LEFT) - -- arco ribassato + -- arco ribassato elseif nType == WIN_FRAME_TYPES.SEGMENTAL_ARC then -- dHeight è l'altezza dei lati verticali, dVal è l'altezza complessiva della finestra local nBottomId = EgtLine( nLayerId, ORIG(), Point3d( dWidth, 0, 0)) @@ -128,7 +151,7 @@ local function CreateFrameCurves( nLayerId, nType, dWidth, dHeight, dVal) local nLeftId = EgtLine( nLayerId, Point3d( 0, dHeight, 0), ORIG()) EgtSetName( nLeftId, WIN_LEFT) - -- arco a tutto sesto + -- arco a tutto sesto elseif nType == WIN_FRAME_TYPES.POINTED_ARC then -- dHeight è l'altezza dei lati verticali, dVal è l'altezza complessiva della finestra -- verifico che le due altezze abbiano valori sensati per realizzare i due archi @@ -147,7 +170,7 @@ local function CreateFrameCurves( nLayerId, nType, dWidth, dHeight, dVal) local nLeftId = EgtLine( nLayerId, Point3d( 0, dHeight, 0), ORIG()) EgtSetName( nLeftId, WIN_LEFT) - -- triangolo + -- triangolo elseif nType == WIN_FRAME_TYPES.TRG then local nBottomId = EgtLine( nLayerId, ORIG(), Point3d( dWidth, 0, 0)) EgtSetName( nBottomId, WIN_BOTTOM) @@ -168,8 +191,8 @@ local function CreateFrameCurves( nLayerId, nType, dWidth, dHeight, dVal) end ---------------------------------------------------------------------------------- --- funzione che crea il telaio a partire da una specifica geometria ( rettangolo, chamfer...) -function WinCreate.CreateFrame( nType, vJoints, dWidth, dHeight, dHeight2) +-- funzione che crea il telaio a partire da una specifica geometria ( rettangolo, chamfer...) +function WinCreate.CreateFrame( nType, vJoints, dWidth, dHeight, dHeight2, nAreaNbr) -- creo gruppo per telaio local nAreaId = EgtGroup( GDB_ID.ROOT) @@ -185,264 +208,108 @@ function WinCreate.CreateFrame( nType, vJoints, dWidth, dHeight, dHeight2) EgtSetInfo( nAreaId, WIN_FRAME_TYPE, nType) -- imposto tipo giunzioni EgtSetInfo( nOutlineLayerId, WIN_JOINTS, vJoints) + + -- numerazione + if nAreaNbr then + EgtSetInfo( nAreaId, WIN_AREA_NBR, nAreaNbr) + end return nAreaId end + + ---------------------------------------------------------------------------------- -------------------------------------- ANTA -------------------------------------- ---------------------------------------------------------------------------------- -- funzione che aggiunge una anta -function WinCreate.AddSash( nAreaId, vJoints, nSashType, nOpeningType) +function WinCreate.AddSash( nParentAreaId, vJoints, nOpeningType, nAreaNbr) + + -- se già presente area errore + if EgtGetFirstNameInGroup( nParentAreaId, WIN_AREA .. '*') then + return + end + -- creo nuova area - local nSashAreaId = EgtGroup( nAreaId) - EgtSetName( nSashAreaId, WIN_AREA .. '(' .. WIN_SASH .. ')') + local nAreaId = EgtGroup( nParentAreaId) + EgtSetName( nAreaId, WIN_AREA .. '(' .. WIN_SASH .. ')') -- imposto il tipo - EgtSetInfo( nSashAreaId, WIN_AREATYPE, WIN_AREATYPES.SASH) - -- recupero outline area precedente - local nPrevAreaOutlineId = EgtGetFirstNameInGroup( nAreaId, WIN_AREAOUTLINE) - -- lo copio per outline area dell'anta - local nAreaOutlineLayerId = EgtGroup( nSashAreaId) - EgtSetName( nAreaOutlineLayerId, WIN_AREAOUTLINE) - local nAreaOutlineId = EgtGetFirstInGroup( nPrevAreaOutlineId) - while nAreaOutlineId do - local nOutlineId = EgtCopy( nAreaOutlineId, nAreaOutlineLayerId) - EgtSetInfo( nOutlineId, WIN_SOU, nAreaOutlineId) - EgtRemoveInfo( nOutlineId, WIN_CHILD) - AddInfo( nAreaOutlineId, WIN_CHILD, nOutlineId) - nAreaOutlineId = EgtGetNext( nAreaOutlineId) - end + EgtSetInfo( nAreaId, WIN_AREATYPE, WIN_AREATYPES.SASH) + -- copio outline dall'area parent + local nOutlineLayerId = CopyParentOutline( nAreaId, nParentAreaId) -- imposto tipo giunzioni - EgtSetInfo( nAreaOutlineLayerId, WIN_JOINTS, vJoints) - -- imposto tipo di anta e di apertura se presente - if nSashType then - EgtSetInfo( nSashAreaId, WIN_SASHTYPE, nSashType) - end + EgtSetInfo( nOutlineLayerId, WIN_JOINTS, vJoints) + -- imposto apertura se presente if nOpeningType then - EgtSetInfo( nSashAreaId, WIN_OPENING_TYPE, nOpeningType) + EgtSetInfo( nAreaId, WIN_OPENING_TYPE, nOpeningType) end - return nSashAreaId + -- numerazione + if nAreaNbr then + EgtSetInfo( nAreaId, WIN_AREA_NBR, nAreaNbr) + EgtSetInfo( nAreaId, WIN_SASH_NBR, 1) + end + return nAreaId end +---------------------------------------------------------------------------------- +-- funzione che aggiunge un gruppo di ante +function WinCreate.AddSashGroup( nParentAreaId, nMeasureType, vDimensions, vJoints, vSashTypes, vOpeningTypes, nAreaNbr, vSashNbrs) + + -- se già presente sottoarea errore + if EgtGetFirstNameInGroup( nParentAreaId, WIN_AREA .. '*') then + return + end + + -- creo gli split di tipo french + local vAreas = WinCreate.AddSplits( nParentAreaId, WIN_SPLITORIENTATION.VERTICAL, nMeasureType, 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) + 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 + + + ---------------------------------------------------------------------------------- -------------------------------------- FILL -------------------------------------- ---------------------------------------------------------------------------------- -- funzione che aggiunge un riempimento -function WinCreate.AddFill( nAreaId, FillType) - -- creo nuova area - local nFillAreaId = EgtGroup( nAreaId) - EgtSetName( nFillAreaId, WIN_AREA .. '(' .. WIN_FILL .. ')') - -- imposto il tipo - EgtSetInfo( nFillAreaId, WIN_AREATYPE, WIN_AREATYPES.FILL) - -- recupero outline area precedente - local nPrevAreaOutlineId = EgtGetFirstNameInGroup( nAreaId, WIN_AREAOUTLINE) - -- lo copio per outline area del riempimento - local nAreaOutlineLayerId = EgtGroup( nFillAreaId) - EgtSetName( nAreaOutlineLayerId, WIN_AREAOUTLINE) - local nAreaOutlineId = EgtGetFirstInGroup( nPrevAreaOutlineId) - while nAreaOutlineId do - local nOutlineId = EgtCopy( nAreaOutlineId, nAreaOutlineLayerId) - EgtSetInfo( nOutlineId, WIN_SOU, nAreaOutlineId) - EgtRemoveInfo( nOutlineId, WIN_CHILD) - AddInfo( nAreaOutlineId, WIN_CHILD, nOutlineId) - nAreaOutlineId = EgtGetNext( nAreaOutlineId) +function WinCreate.AddFill( nParentAreaId, nFillType, nAreaNbr) + + -- se area ha già sottoarea errore + if EgtGetFirstNameInGroup( nParentAreaId, WIN_AREA .. '*') then + return end - -- rimuovo eventuali info di giunzioni - EgtRemoveInfo( nAreaOutlineLayerId, WIN_JOINTS) - + + local nAreaId = EgtGroup( nParentAreaId) + EgtSetName( nAreaId, WIN_AREA .. '(' .. WIN_FILL .. ')') + EgtSetInfo( nAreaId, WIN_AREATYPE, WIN_AREATYPES.FILL) + -- copio outline dall'area parent + CopyParentOutline( nAreaId, nParentAreaId) -- imposto tipo di fill - EgtSetInfo( nFillAreaId, WIN_FILLTYPE, FillType) - return nFillAreaId + EgtSetInfo( nAreaId, WIN_FILLTYPE, nFillType) + -- numerazione + if nAreaNbr then + EgtSetInfo( nAreaId, WIN_AREA_NBR, nAreaNbr) + end + + return nAreaId end + + ---------------------------------------------------------------------------------- ------------------------------------- SPLIT -------------------------------------- ----------------------------------------------------------------------------------- --- funzione che crea un taglio split -function WinCreate.AddSplit( nAreaLayerId, SplitType, MeasureType, nPosition, nProportion, nSplitType) - -- creo layer temporaneo per split - local nTempSplitLayerId = EgtGroup( nAreaLayerId) - -- recupero contorno area precedente - local nOutlineLayerId = EgtGetFirstNameInGroup( nAreaLayerId, WIN_AREAOUTLINE) - local b3OutlineLayer = EgtGetBBox( nOutlineLayerId, GDB_BB.STANDARD) - local nTotSplitId - if SplitType == WIN_SPLITORIENTATION.VERTICAL then - -- creo linea - local nCalcPosition = 0 - if MeasureType == WIN_MEASURE.ABSOLUT then - nCalcPosition = nPosition - elseif MeasureType == WIN_MEASURE.PROPORTIONAL then - nCalcPosition = b3OutlineLayer:getDimX() / nProportion * nPosition - elseif MeasureType == WIN_MEASURE.PERCENTAGE then - nCalcPosition = b3OutlineLayer:getDimX() * nPosition - end - if nCalcPosition > b3OutlineLayer:getDimX() - GEO.EPS_SMALL then - EgtErase( nTempSplitLayerId) - return - end - nTotSplitId = EgtLine( nTempSplitLayerId, b3OutlineLayer:getMin() + X_AX() * nCalcPosition, b3OutlineLayer:getMin() + X_AX() * nCalcPosition + Y_AX() * b3OutlineLayer:getDimY()) - elseif SplitType == WIN_SPLITORIENTATION.HORIZONTAL then - -- creo linea - local nCalcPosition = 0 - if MeasureType == WIN_MEASURE.ABSOLUT then - nCalcPosition = nPosition - elseif MeasureType == WIN_MEASURE.PROPORTIONAL then - nCalcPosition = b3OutlineLayer:getDimY() / nProportion * nPosition - elseif MeasureType == WIN_MEASURE.PERCENTAGE then - nCalcPosition = b3OutlineLayer:getDimY() * nPosition - end - if nCalcPosition > b3OutlineLayer:getDimY() - GEO.EPS_SMALL then - EgtErase( nTempSplitLayerId) - return - end - nTotSplitId = EgtLine( nTempSplitLayerId, b3OutlineLayer:getMin() + Y_AX() * nCalcPosition, b3OutlineLayer:getMin() + Y_AX() * nCalcPosition + X_AX() * b3OutlineLayer:getDimX()) - end - -- calcolo split - local nArea1Id, nArea2Id = WinCreate.AddGenSplit( nAreaLayerId, nTotSplitId, nSplitType) - EgtErase( nTempSplitLayerId) - return nArea1Id, nArea2Id -end - ----------------------------------------------------------------------------------- --- funzione che crea tagli split multipli -function WinCreate.AddSplits( nAreaLayerId, SplitType, MeasureType, PositionList, nProportion, nSplitType) - local AreaList = {} - if MeasureType == WIN_MEASURE.ABSOLUT then - local nResArea1 - local nResArea2 = nAreaLayerId - for nIndex = 1, #PositionList do - if nIndex > 1 then - EgtSetInfo( nResArea2, WIN_PRJ_ORIGSPLIT, nAreaLayerId) - end - local nCurrentResArea2 = nResArea2 - nResArea1, nResArea2 = WinCreate.AddSplit( nResArea2, SplitType, MeasureType, PositionList[nIndex], nProportion, nSplitType) - if not nResArea2 then - table.insert( AreaList, nCurrentResArea2) - break - end - table.insert( AreaList, nResArea1) - if nIndex == #PositionList then - table.insert( AreaList, nResArea2) - end - end - elseif MeasureType == WIN_MEASURE.PROPORTIONAL then - local nResArea1 - local nResArea2 = nAreaLayerId - local dAddPosition = 0 - for nIndex = 1, #PositionList - 1 do - if nIndex > 1 then - EgtSetInfo( nResArea2, WIN_PRJ_ORIGSPLIT, nAreaLayerId) - end - local nCurrentResArea2 = nResArea2 - nResArea1, nResArea2 = WinCreate.AddSplit( nResArea2, SplitType, MeasureType, PositionList[nIndex], nProportion - dAddPosition, nSplitType) - if not nResArea2 then - table.insert( AreaList, nCurrentResArea2) - break - end - table.insert( AreaList, nResArea1) - if nIndex == #PositionList -1 then - table.insert( AreaList, nResArea2) - end - dAddPosition = dAddPosition + PositionList[nIndex] - end - elseif MeasureType == WIN_MEASURE.PERCENTAGE then - local nResArea1 - local nResArea2 = nAreaLayerId - local dAddPosition = 0 - local sChildAreas = '' - for nIndex = 1, #PositionList do - if nIndex > 1 then - EgtSetInfo( nResArea2, WIN_PRJ_ORIGSPLIT, nAreaLayerId) - sChildAreas = sChildAreas .. nResArea2 .. EgtIf( nIndex < #PositionList, ',', '') - end - local nCurrentResArea2 = nResArea2 - nResArea1, nResArea2 = WinCreate.AddSplit( nResArea2, SplitType, MeasureType, EgtIf( nIndex == 1, PositionList[nIndex], PositionList[nIndex] / ( 1 - dAddPosition)), nProportion, nSplitType) - if not nResArea2 then - table.insert( AreaList, nCurrentResArea2) - break - end - table.insert( AreaList, nResArea1) - if nIndex == #PositionList then - table.insert( AreaList, nResArea2) - end - dAddPosition = dAddPosition + PositionList[nIndex] - end - EgtSetInfo( nAreaLayerId, 'ChildSplit', sChildAreas) - end - return AreaList -end - ----------------------------------------------------------------------------------- --- funzione che crea tagli split grid -function WinCreate.AddGridSplits( nAreaLayerId, MeasureType, PositionListVert, PositionListHoriz, bStartVertical, nSplitType) - local AreaResult = {} - -- recupero contorno area precedente - local nOutlineLayerId = EgtGetFirstNameInGroup( nAreaLayerId, WIN_AREAOUTLINE) - local b3OutlineLayer = EgtGetBBox( nOutlineLayerId, GDB_BB.STANDARD) - -- calcolo numero parti totali nel caso di misura proporzionale - local nProportionVert = 0 - local nProportionHoriz = 0 - if MeasureType == WIN_MEASURE.PROPORTIONAL then - for i = 1, #PositionListVert do - nProportionVert = nProportionVert + PositionListVert[i] - end - for i = 1, #PositionListHoriz do - nProportionHoriz = nProportionHoriz + PositionListHoriz[i] - end - end - -- calcolo gli split nella direzione secondaria - local PositionAbs = {} - local PositionList = EgtIf( bStartVertical, PositionListHoriz, PositionListVert) - local nProportion = EgtIf( bStartVertical, nProportionHoriz, nProportionVert) - local dDim = EgtIf( bStartVertical, b3OutlineLayer:getDimY(), b3OutlineLayer:getDimX()) - for i = 1, #PositionList do - if MeasureType == WIN_MEASURE.ABSOLUT then - PositionAbs[i] = PositionList[i] - elseif MeasureType == WIN_MEASURE.PROPORTIONAL then - PositionAbs[i] = dDim / nProportion * PositionList[i] - elseif MeasureType == WIN_MEASURE.PERCENTAGE then - PositionAbs[i] = dDim * PositionList[i] - end - end - if bStartVertical then - local AreaList = WinCreate.AddSplits( nAreaLayerId, WIN_SPLITORIENTATION.VERTICAL, MeasureType, PositionListVert, nProportionVert, nSplitType) - for i = 1, #AreaList do - local AreaTemp = WinCreate.AddSplits( AreaList[i], WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, PositionAbs, nProportionHoriz, nSplitType) or {} - for j = 1, #AreaTemp do - table.insert( AreaResult, AreaTemp[j]) - end - end - else - local AreaList = WinCreate.AddSplits( nAreaLayerId, WIN_SPLITORIENTATION.HORIZONTAL, MeasureType, PositionListHoriz, nProportionHoriz, nSplitType) - for i = 1, #AreaList do - -- recupero contorno area corrente - local nCurrentOutlineLayerId = EgtGetFirstNameInGroup( AreaList[i], WIN_AREAOUTLINE) - local b3CurrentOutlineLayer = EgtGetBBox( nCurrentOutlineLayerId, GDB_BB.STANDARD) - local dDiff = b3OutlineLayer:getMin():getX() - b3CurrentOutlineLayer:getMin():getX() - if dDiff < - GEO.EPS_SMALL then - local nFirstIndex = #PositionAbs + 1 - for k = 1, #PositionAbs do - if PositionAbs[k] + dDiff > GEO.EPS_SMALL then - PositionAbs[k] = PositionAbs[k] + dDiff - nFirstIndex = k - break - elseif k ~= #PositionAbs then - PositionAbs[k + 1] = PositionAbs[k] + PositionAbs[k + 1] - end - end - for k = 1, nFirstIndex - 1 do - table.remove( PositionAbs, 1) - end - end - local AreaTemp = WinCreate.AddSplits( AreaList[i], WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, PositionAbs, nProportionVert, nSplitType) or {} - for j = 1, #AreaTemp do - table.insert( AreaResult, AreaTemp[j]) - end - end - end - return AreaResult -end - ---------------------------------------------------------------------------------- -- funzione che assegna il nome alla curva di split nella sottoarea in base alla sua direzione local function SetSplitName( nSplitId) @@ -467,155 +334,21 @@ local function SetSplitName( nSplitId) end ---------------------------------------------------------------------------------- --- funzione che crea le aree da un taglio split -local function CreateAreaFromSplit( nAreaLayerId, nCompo, nSplitId, dPar1, dPar2, vOutlineCrvs) - - -- creo layer per le due sottoaree - local nArea1Id = EgtGroup( nAreaLayerId) - EgtSetName( nArea1Id , WIN_AREA .. '1') - EgtSetInfo( nArea1Id, WIN_AREATYPE, WIN_AREATYPES.NULL) - local nArea1OutlineLayerId = EgtGroup( nArea1Id) - EgtSetName( nArea1OutlineLayerId , WIN_AREAOUTLINE) - local nArea2Id = EgtGroup( nAreaLayerId) - EgtSetName( nArea2Id , WIN_AREA .. '2') - EgtSetInfo( nArea2Id, WIN_AREATYPE, WIN_AREATYPES.NULL) - local nArea2OutlineLayerId = EgtGroup( nArea2Id) - EgtSetName( nArea2OutlineLayerId , WIN_AREAOUTLINE) - - -- ad ogni sottoarea associo la porzione di curva composita corrispondente - local nCrv1 = EgtCopyGlob( nCompo, nArea1OutlineLayerId) - local nCrv2 = EgtCopyGlob( nCompo, nArea2OutlineLayerId) - EgtTrimCurveStartEndAtParam( nCrv1, dPar2, dPar1) - EgtTrimCurveStartEndAtParam( nCrv2, dPar1, dPar2) - - -- copio curva di split - local nSplitId1 = EgtCopyGlob( nSplitId, nArea1OutlineLayerId) - local nSplitId2 = EgtCopyGlob( nSplitId, nArea2OutlineLayerId) - -- verifico se necessaria inversione - if AreSamePointApprox( EgtSP( nSplitId1), EgtSP( nCrv1)) then - EgtInvertCurve( nSplitId1) - end - if AreSamePointApprox( EgtSP( nSplitId2), EgtSP( nCrv2)) then - EgtInvertCurve( nSplitId2) - end - -- assegno il nome in base alla direzione - SetSplitName( nSplitId1) - SetSplitName( nSplitId2) - -- assengo le info di source e child - EgtSetInfo( nSplitId, WIN_CHILD, { nSplitId1, nSplitId2}) - EgtSetInfo( nSplitId1, WIN_SOU, nSplitId) - EgtSetInfo( nSplitId2, WIN_SOU, nSplitId) - - -- spezzo le curve composite per riottenere le curve originarie di partenza - local nFirst1, nCnt1 = EgtExplodeCurveCompo( nCrv1) - local nFirst2, nCnt2 = EgtExplodeCurveCompo( nCrv2) - -- assegno nome e info - local vCrvs = EgtTableFill( nFirst1, nCnt1) - EgtTableAdd( vCrvs, nFirst2, nCnt2) - for i = 1, #vCrvs do - -- ricavo la curva di outline originale da cui deriva - local ptM = EgtMP( vCrvs[i]) - for j = 1, #vOutlineCrvs do - if EgtCurveParamAtPoint( vOutlineCrvs[j], ptM, 100 * GEO.EPS_SMALL) then - -- ne prendo il nome - EgtSetName( vCrvs[i], EgtGetName( vOutlineCrvs[j])) - -- assegno le info di child e source - EgtSetInfo( vCrvs[i], WIN_SOU, vOutlineCrvs[j]) - AddInfo( vOutlineCrvs[j], WIN_CHILD, vCrvs[i]) - break - end - end - end - - -- scorro pezzi del primo e secondo outline per avere bottom come primo - local nFirstInAreaId = EgtGetFirstInGroup( nArea1OutlineLayerId) - local sFirstInAreaName = EgtGetName( nFirstInAreaId) - while sFirstInAreaName ~= WIN_BOTTOM do - EgtRelocate( nFirstInAreaId, nArea1OutlineLayerId) - nFirstInAreaId = EgtGetFirstInGroup( nArea1OutlineLayerId) - sFirstInAreaName = EgtGetName( nFirstInAreaId) - end - nFirstInAreaId = EgtGetFirstInGroup( nArea2OutlineLayerId) - sFirstInAreaName = EgtGetName( nFirstInAreaId) - while sFirstInAreaName ~= WIN_BOTTOM do - EgtRelocate( nFirstInAreaId, nArea2OutlineLayerId) - nFirstInAreaId = EgtGetFirstInGroup( nArea2OutlineLayerId) - sFirstInAreaName = EgtGetName( nFirstInAreaId) - end - - return nArea1Id, nArea2Id -end - ----------------------------------------------------------------------------------- --- funzione che crea un taglio split da una curva generica -function WinCreate.AddGenSplit( nAreaLayerId, nSplitId, nSplitType) - -- se area nulla diventa di tipo split - local nAreaType = EgtGetInfo( nAreaLayerId, WIN_AREATYPE, 'i') - if nAreaType == WIN_AREATYPES.NULL then - EgtSetInfo( nAreaLayerId, WIN_AREATYPE, WIN_AREATYPES.SPLIT) - end - -- creo layer per split - local nSplitLayerId = EgtGroup( nAreaLayerId) - EgtSetName( nSplitLayerId, WIN_BASESPLIT) - -- sposto curva split nel layer - EgtRelocateGlob( nSplitId, nSplitLayerId) - -- assegno nome profilo - EgtSetName( nSplitId, WIN_SPLIT) - - -- verifico se devo impostare tipo di split ( solo se deriva da tipo frame) - if nSplitType then - local nParentAreaId = nAreaLayerId - local nParentAreaType = nAreaType - -- recupero parent fino a trovare frame o sash - while nParentAreaType ~= WIN_AREATYPES.FRAME and nParentAreaType ~= WIN_AREATYPES.SASH do - nParentAreaId = EgtGetParent( nParentAreaId) - nParentAreaType = EgtGetInfo( nParentAreaId, WIN_AREATYPE, 'i') - end - if nParentAreaType == WIN_AREATYPES.FRAME then - -- imposto tipo di split - EgtSetInfo( nSplitLayerId, WIN_SPLITTYPE, nSplitType) - end - end - - -- Ricerca delle intersezioni : - -- creo una curva composita a partire da tutte le curve di outline - local nOutlineLayerId = EgtGetFirstNameInGroup( nAreaLayerId, WIN_AREAOUTLINE) - local vOutlineCrvs = EgtGetAllInGroup( nOutlineLayerId) - local nCompo = EgtCurveCompo( nSplitLayerId, vOutlineCrvs, false) - -- allungo curva split per cercare intersezioni +-- funzione che taglia lo split con il bordo della regione +local function AdjustSplitCurve( nSplitId, nCompo, vOutlineCrvs, nOutlineLayerId) + + -- trimmo lo split a filo con l'outline EgtExtendCurveStartByLen( nSplitId, 10) EgtExtendCurveEndByLen( nSplitId, 10) - -- trovo intersezioni tra composita e lo split - local nFirst, nPntCnt, nCrvCnt = EgtCurveCurveInters( nCompo, nSplitId, nSplitLayerId) - if nCrvCnt ~= 0 or nPntCnt ~= 2 then - -- errore - return - end - -- recupero i due punti di intersezione - local pt1 = EgtSP( nFirst) - local pt2 = EgtSP( nFirst + 1) - EgtErase( { nFirst, nFirst + 1}) - - -- recupero i parametri di intersezione sulla curva di split - local dSplitParS = EgtCurveParamAtPoint( nSplitId, pt1, 100 * GEO.EPS_SMALL) - local dSplitParE = EgtCurveParamAtPoint( nSplitId, pt2, 100 * GEO.EPS_SMALL) - -- recupero i parametri di intersezione sulla curva composita - local dPar1 = EgtCurveParamAtPoint( nCompo, pt1, 100 * GEO.EPS_SMALL) - local dPar2 = EgtCurveParamAtPoint( nCompo, pt2, 100 * GEO.EPS_SMALL) - - -- ricavo i parametri di intersezione legati a start ed end dello split - local dParCrvS = dPar1 - local dParCrvE = dPar2 - if dSplitParS > dSplitParE then - dSplitParS, dSplitParE = dSplitParE, dSplitParS - dParCrvS, dParCrvE = dParCrvE, dParCrvS - end - - -- taglio la curva di split nei punti di intersezione - EgtTrimCurveStartEndAtParam( nSplitId, dSplitParS, dSplitParE) - - -- setto info per intersezione start - -- se il parametro è intero allora l'intersezione coinvolge due curve successive + local ptS = EgtIP( nSplitId, nCompo, EgtSP( nSplitId)) + local ptE = EgtIP( nSplitId, nCompo, EgtEP( nSplitId)) + local dParS = EgtCurveParamAtPoint( nSplitId, ptS) + local dParE = EgtCurveParamAtPoint( nSplitId, ptE) + EgtTrimCurveStartEndAtParam( nSplitId, dParS, dParE) + + -- recupero le curve con cui avviene l'intersezione e le salvo come info + -- start + local dParCrvS = EgtCurveParamAtPoint( nCompo, ptS) if abs( dParCrvS - ceil( dParCrvS)) < GEO.EPS_SMALL then local nCrv = vOutlineCrvs[ ceil( dParCrvS) + 1] local nOther = EgtGetPrev( nCrv) or EgtGetLastInGroup( nOutlineLayerId) @@ -629,8 +362,9 @@ function WinCreate.AddGenSplit( nAreaLayerId, nSplitId, nSplitType) local nCrv = vOutlineCrvs[ floor( dParCrvS) + 1] EgtSetInfo( nSplitId, WIN_SPLIT_STARTINTERS, { nCrv}) end - - -- setto info per intersezione end + + -- end + local dParCrvE = EgtCurveParamAtPoint( nCompo, ptE) if abs( dParCrvE - ceil( dParCrvE)) < GEO.EPS_SMALL then local nCrv = vOutlineCrvs[ ceil( dParCrvE) + 1] local nOther = EgtGetPrev( nCrv) or EgtGetLastInGroup( nOutlineLayerId) @@ -643,24 +377,287 @@ function WinCreate.AddGenSplit( nAreaLayerId, nSplitId, nSplitType) local nCrv = vOutlineCrvs[ floor( dParCrvE) + 1] EgtSetInfo( nSplitId, WIN_SPLIT_ENDINTERS, { nCrv}) end - - -- creo sottoaree - local nArea1, nArea2 = CreateAreaFromSplit( nAreaLayerId, nCompo, nSplitId, dPar1, dPar2, vOutlineCrvs) - - EgtErase( nCompo) - - return nArea1, nArea2 - end ---------------------------------------------------------------------------------- --- funzione che crea tagli split da curve generiche -function WinCreate.AddGenSplits( nAreaLayerId, SplitList) - for nIndex = 1, #SplitList do - WinCreate.AddSplit( nAreaLayerId, SplitList[nIndex]) +-- funzione che restituisce il bordo delle due regioni definite da uno split +local function GetBorderRegions( nSplitId, nCompo, nAreaId) + + -- taglio il bordo in due in corrispondenza dello split + local nCrv1 = EgtCopyGlob( nCompo, nAreaId) + local nCrv2 = EgtCopyGlob( nCompo, nAreaId) + local dPar1 = EgtCurveParamAtPoint( nCompo, EgtSP( nSplitId), 100 * GEO.EPS_SMALL) + local dPar2 = EgtCurveParamAtPoint( nCompo, EgtEP( nSplitId), 100 * GEO.EPS_SMALL) + EgtTrimCurveStartEndAtParam( nCrv1, dPar2, dPar1) + EgtTrimCurveStartEndAtParam( nCrv2, dPar1, dPar2) + + -- aggiungo la curva di split al bordo per chiuderlo orientandola opportunamente + local nSplitId1 = EgtCopyGlob( nSplitId, nAreaId) + if AreSamePointApprox( EgtSP( nSplitId1), EgtSP( nCrv1)) then + EgtInvertCurve( nSplitId1) end + EgtAddCurveCompoCurve( nCrv1, nSplitId1) + local _, dParE1 = EgtCurveDomain( nCrv1) + EgtCurveCompoSetTempProp( nCrv1, dParE1 - 1, nSplitId) + + local nSplitId2 = EgtCopyGlob( nSplitId, nAreaId) + if AreSamePointApprox( EgtSP( nSplitId2), EgtSP( nCrv2)) then + EgtInvertCurve( nSplitId2) + end + EgtAddCurveCompoCurve( nCrv2, nSplitId2) + local _, dParE2 = EgtCurveDomain( nCrv2) + EgtCurveCompoSetTempProp( nCrv2, dParE2 - 1, nSplitId) + + return nCrv1, nCrv2 end +---------------------------------------------------------------------------------- +-- funzione che crea le aree generate da una sequenza di curve di split +local function CreateAreasFromSplits( nAreaId, vSplitCrvs) + + local nGrpTmp = EgtGroup( nAreaId) + + -- creo la curva composita dell'outline + local nOutlineLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_AREAOUTLINE) + local vOutlineCrvs = EgtGetAllInGroup( nOutlineLayerId) + local nCompo = EgtCurveCompo( nGrpTmp, vOutlineCrvs, false) + for i = 1, #vOutlineCrvs do + EgtCurveCompoSetTempProp( nCompo, i - 1, vOutlineCrvs[i]) + end + + -- creo le curve associate ad ogni regione degli split + local vBorders = {} + local nCompoRef = nCompo + for i = 1, #vSplitCrvs do + + -- aggiusto lo split per averlo a filo con l'outline + AdjustSplitCurve( vSplitCrvs[i], nCompo, vOutlineCrvs, nOutlineLayerId) + + -- calcolo i bordi delle due regioni definite dallo split + local nCrv1, nCrv2 = GetBorderRegions( vSplitCrvs[i], nCompoRef, nGrpTmp) + table.insert( vBorders, nCrv1) + -- il secondo bordo è quello da suddividere con lo split successivo ( se esiste) + nCompoRef = nCrv2 + if i == #vSplitCrvs then + table.insert( vBorders, nCrv2) + end + end + + -- creo le sottoaree a partire dai contorni + local vAreas = {} + for i = 1, #vBorders do + -- creo area + local nSplitAreaId = EgtGroup( nAreaId) + EgtSetName( nSplitAreaId , WIN_AREA .. tostring( i)) + EgtSetInfo( nSplitAreaId, WIN_AREATYPE, WIN_AREATYPES.NULL) + vAreas[i] = nSplitAreaId + + -- creo outline con la curva di bordo + local nOutlineLayerId = EgtGroup( nSplitAreaId) + EgtSetName( nOutlineLayerId, WIN_AREAOUTLINE) + EgtRelocateGlob( vBorders[i], nOutlineLayerId) + local vOrigCrvs = EgtCurveCompoGetTempProp( vBorders[i]) + local nFirst, nCnt = EgtExplodeCurveCompo( vBorders[i]) + + -- assegno nome e info a tutte le curve di bordo a partire dalla curva da cui derviano ( salvata nella temp prop della curva) + for j = 0, nCnt - 1 do + -- assegno le info di child e source + EgtSetInfo( nFirst + j, WIN_SOU, vOrigCrvs[j+1]) + AddInfo( vOrigCrvs[j+1], WIN_CHILD, nFirst + j) + -- assengo il nome : se deriva da outline lo copio, se deriva da split lo scelgo in base all'orientamento + if EgtGetName( vOrigCrvs[j+1]) == WIN_SPLIT then + SetSplitName( nFirst + j) + else + EgtSetName( nFirst + j, EgtGetName( vOrigCrvs[j+1])) + end + end + + -- riordino le curve dell'outline per avere bottom come primo + local nCrvId = EgtGetFirstInGroup( nOutlineLayerId) + while EgtGetName( nCrvId) ~= WIN_BOTTOM do + EgtRelocate( nCrvId, nOutlineLayerId) + nCrvId = EgtGetFirstInGroup( nOutlineLayerId) + end + end + + EgtErase( nGrpTmp) + return vAreas +end + +---------------------------------------------------------------------------------- +local function CalcSplitCurves( nLayerId, b3OutlineLayer, b3Limit, nSplitType, nMeasureType, PositionList) + + local vSplitCurves = {} + local nProportion = 0 + if nMeasureType == WIN_MEASURE.PROPORTIONAL then + for i = 1, #PositionList do + nProportion = nProportion + PositionList[i] + end + end + local dCurrPosition = 0 + for i = 1, #PositionList do + -- calcolo la posizione corrente + dCurrPosition = dCurrPosition + PositionList[i] + local dCalcPosition + local nSplitCrv + + if nSplitType == WIN_SPLITORIENTATION.VERTICAL then + -- aree ordinate da sx a dx + if nMeasureType == WIN_MEASURE.ABSOLUT then + dCalcPosition = dCurrPosition + elseif nMeasureType == WIN_MEASURE.PROPORTIONAL then + dCalcPosition = b3OutlineLayer:getDimX() * dCurrPosition / nProportion + elseif nMeasureType == WIN_MEASURE.PERCENTAGE then + dCalcPosition = b3OutlineLayer:getDimX() * dCurrPosition + end + -- creo la linea se rientra nella regione limite + local dX = b3OutlineLayer:getMin():getX() + dCalcPosition + if dX > b3Limit:getMin():getX() + GEO.EPS_SMALL and dX < b3Limit:getMax():getX() - GEO.EPS_SMALL then + nSplitCrv = EgtLinePVL( nLayerId, b3OutlineLayer:getMin() + X_AX() * dCalcPosition, Y_AX(), b3OutlineLayer:getDimY()) + end + + elseif nSplitType == WIN_SPLITORIENTATION.HORIZONTAL then + -- aree ordinate dall'alto al basso + if nMeasureType == WIN_MEASURE.ABSOLUT then + dCalcPosition = b3OutlineLayer:getDimY() - dCurrPosition + elseif nMeasureType == WIN_MEASURE.PROPORTIONAL then + dCalcPosition = b3OutlineLayer:getDimY() * ( 1 - dCurrPosition / nProportion) + elseif nMeasureType == WIN_MEASURE.PERCENTAGE then + dCalcPosition = b3OutlineLayer:getDimY() * ( 1 - dCurrPosition) + end + -- creo la linea se rientra nella regione limite + local dY = b3OutlineLayer:getMin():getY() + dCalcPosition + if dY > b3Limit:getMin():getY() + GEO.EPS_SMALL and dY < b3Limit:getMax():getY() - GEO.EPS_SMALL then + nSplitCrv = EgtLinePVL( nLayerId, b3OutlineLayer:getMin() + Y_AX() * dCalcPosition, X_AX(), b3OutlineLayer:getDimX()) + end + end + + if nSplitCrv then + EgtSetName( nSplitCrv, WIN_SPLIT) + table.insert( vSplitCurves, nSplitCrv) + end + end + + return vSplitCurves +end + +---------------------------------------------------------------------------------- +-- funzione che crea tagli split multipli +function WinCreate.AddSplits( nParentAreaId, nSplitType, nMeasureType, PositionList, bFrench, nAreaNbr) + + -- se area ha già sottoarea errore + if EgtGetFirstNameInGroup( nParentAreaId, WIN_AREA .. '*') then + return + end + + -- 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 + + -- copio il contorno dall'area parent e setto opportune corrispondenze sou/child + local nOutlineLayerId = CopyParentOutline( nAreaId, nParentAreaId) + local b3OutlineLayer = EgtGetBBox( nOutlineLayerId, GDB_BB.STANDARD) + + -- creo layer per split + local nSplitLayerId = EgtGroup( nAreaId) + EgtSetName( nSplitLayerId, WIN_BASESPLIT) + -- verifico se va impostato il tipo french + if bFrench then + EgtSetInfo( nSplitLayerId, WIN_SPLITTYPE, WIN_SPLITTYPES.FRENCH) + end + + -- creo le curve di split + local vSplitCurves = CalcSplitCurves( nSplitLayerId, b3OutlineLayer, b3OutlineLayer, nSplitType, nMeasureType, PositionList) + + -- se non ci sono curve valide cancello tutto ed esco + if #vSplitCurves == 0 then + EgtErase( nAreaId) + return + end + + -- creo le aree generate dagli split + local vAreas = CreateAreasFromSplits( nAreaId, vSplitCurves) + return vAreas +end + +---------------------------------------------------------------------------------- +-- funzione che crea tagli split grid +function WinCreate.AddGridSplits( nParentAreaId, nMeasureType, PositionListVert, PositionListHoriz, bStartVertical, nAreaNbr) + + local AreaResult = {} + + -- se area ha già sottoarea errore + if EgtGetFirstNameInGroup( nParentAreaId, WIN_AREA .. '*') then + return + end + + -- 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 + + -- copio il contorno dall'area parent e setto opportune corrispondenze sou/child + local nOutlineLayerId = CopyParentOutline( nAreaId, nParentAreaId) + local b3OutlineLayer = EgtGetBBox( nOutlineLayerId, GDB_BB.STANDARD) + + -- creo layer per split + local nSplitLayerId = EgtGroup( nAreaId) + EgtSetName( nSplitLayerId, WIN_BASESPLIT) + + -- stabilisco direzione principale e secondaria + local PositionListMain, PositionListOther, nSplitOrientationMain, nSplitOrientationOther + if bStartVertical then + PositionListMain = PositionListVert + PositionListOther = PositionListHoriz + nSplitOrientationMain = WIN_SPLITORIENTATION.VERTICAL + nSplitOrientationOther = WIN_SPLITORIENTATION.HORIZONTAL + else + PositionListMain = PositionListHoriz + PositionListOther = PositionListVert + nSplitOrientationMain = WIN_SPLITORIENTATION.HORIZONTAL + nSplitOrientationOther = WIN_SPLITORIENTATION.VERTICAL + end + + -- calcolo la suddivisione nella direzione principale + local vMainSplit = CalcSplitCurves( nSplitLayerId, b3OutlineLayer, b3OutlineLayer, nSplitOrientationMain, nMeasureType, PositionListMain) + local vMainAreas = CreateAreasFromSplits( nAreaId, vMainSplit) + + -- per ogni area della direzione principale calcolo la suddivisione nella direzione secondaria + for i = 1, #vMainAreas do + -- recupero outline per calcolare il limite delle curve di split + local nAreaOutlineLayerId = EgtGetFirstNameInGroup( vMainAreas[i], WIN_AREAOUTLINE) + local b3Limit = EgtGetBBox( nAreaOutlineLayerId, GDB_BB.STANDARD) + + -- calcolo gli split nella direzione secondaria + local vOtherSplit = CalcSplitCurves( nSplitLayerId, b3OutlineLayer, b3Limit, nSplitOrientationOther, nMeasureType, PositionListOther) + if #vOtherSplit > 0 then + local vNewAreas = CreateAreasFromSplits( vMainAreas[i], vOtherSplit) + AreaResult = EgtJoinTables( AreaResult, vNewAreas) + end + end + + -- sposto le aree secondarie nell'area di split e le rinomino + for i = 1, #AreaResult do + EgtRelocateGlob( AreaResult[i], nAreaId) + EgtSetName( AreaResult[i], WIN_AREA .. EgtNumToString( i)) + end + -- le aree dello split principale diventano aree virtuali ausiliarie per i conti + for i = 1, #vMainAreas do + EgtSetName( vMainAreas[i], WIN_VIRTUAL_AREA) + end + + return AreaResult +end + + + ---------------------------------------------------------------------------------- ---------------------------------- BOTTOMRAIL ------------------------------------ ---------------------------------------------------------------------------------- diff --git a/Designing/WinLib/WinManageProject.lua b/Designing/WinLib/WinManageProject.lua index 8c06b36..30ab237 100644 --- a/Designing/WinLib/WinManageProject.lua +++ b/Designing/WinLib/WinManageProject.lua @@ -160,7 +160,10 @@ local function ConvertTableToGeometry( AreaTable, nParentId) if not AreaTable then return end - + + -- recupero numerazione + local nAreaNbr = AreaTable[JWD_ID_GROUP] + -- TELAIO if AreaTable[JWD_AREA_TYPE] == 'FRAME' then @@ -174,7 +177,7 @@ local function ConvertTableToGeometry( AreaTable, nParentId) end -- creo il telaio - local nAreaId = WinCreate.CreateFrame( nType, vJoints, vDim[1], vDim[2], vDim[3]) + local nAreaId = WinCreate.CreateFrame( nType, vJoints, vDim[1], vDim[2], vDim[3], nAreaNbr) -- verifico presenza bottomrail if AreaTable[JWD_BOTTOMRAIL] then @@ -202,7 +205,7 @@ local function ConvertTableToGeometry( AreaTable, nParentId) -- anta singola if #tSashes == 1 then local nOpeningType = GetOpeningType( tSashes[1][JWD_OPENING_TYPE]) - local nAreaId = WinCreate.AddSash( nParentId, vJoints, WIN_SASHTYPES.NULL, nOpeningType) + local nAreaId = WinCreate.AddSash( nParentId, vJoints, nOpeningType, nAreaNbr) -- aggiungo ferramenta sull'anta if nOpeningType == WIN_OPENING_TYPES.TURNONLY_LEFT or nOpeningType == WIN_OPENING_TYPES.TILTTURN_LEFT or @@ -231,24 +234,24 @@ local function ConvertTableToGeometry( AreaTable, nParentId) -- recupero dati delle ante local vDimensions = {} local vOpeningTypes = {} + local vSashNbrs = {} for i = 1, #tSashes do vDimensions[i] = tSashes[i][JWD_DIMENSION] / 100 vOpeningTypes[i] = GetOpeningType( tSashes[i][JWD_OPENING_TYPE]) + vSashNbrs[i] = tSashes[i][JWD_ID_SASH] end table.remove( vDimensions) local vSashTypes, sHandleSide = GetSashTypes( tSashes, vOpeningTypes) EgtSetInfo( nParentId, WIN_HDW_HANDLE, sHandleSide) - -- aggiungo gli split - local vSplitAreas = WinCreate.AddSplits( nParentId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, vDimensions, 1, WIN_SPLITTYPES.FRENCH) - + -- aggiungo il gruppo di ante + local vAreas = WinCreate.AddSashGroup( nParentId, WIN_MEASURE.PERCENTAGE, vDimensions, vJoints, vSashTypes, vOpeningTypes, nAreaNbr, vSashNbrs) -- aggiungo le ante - for i = 1, #vSplitAreas do - local nAreaId = WinCreate.AddSash( vSplitAreas[i], vJoints, vSashTypes[i], vOpeningTypes[i]) + for i = 1, #vAreas do -- bottomrail - WinCreate.AddBottomRail( nAreaId, nBottomRailNbr) + WinCreate.AddBottomRail( vAreas[i], nBottomRailNbr) -- analizzo sottaree - ConvertTableToGeometry( AreaTable[JWD_AREA_LIST][i], nAreaId) + ConvertTableToGeometry( AreaTable[JWD_AREA_LIST][i], vAreas[i]) end end @@ -256,11 +259,11 @@ local function ConvertTableToGeometry( AreaTable, nParentId) -- FILL elseif AreaTable[JWD_AREA_TYPE] == 'FILL' then local nFillType = EgtIf( AreaTable[JWD_FILL_TYPE] == 'GLASS', WIN_FILLTYPES.GLASS, WIN_FILLTYPES.WOOD) - WinCreate.AddFill( nParentId, nFillType) + WinCreate.AddFill( nParentId, nFillType, nAreaNbr) -- SPLIT -elseif AreaTable[JWD_AREA_TYPE] == 'SPLIT' then + elseif AreaTable[JWD_AREA_TYPE] == 'SPLIT' then local vVertDimensions = {} local vSplitVertDimensions = AreaTable[JWD_SPLIT_VERT_POS] for i = 1, #vSplitVertDimensions - 1 do @@ -273,11 +276,11 @@ elseif AreaTable[JWD_AREA_TYPE] == 'SPLIT' then end local vSplitAreas if AreaTable[JWD_SPLIT_TYPE] == 'GRID' then - vSplitAreas = WinCreate.AddGridSplits( nParentId, WIN_MEASURE.PERCENTAGE, vVertDimensions, vHorizDimensions, AreaTable[JWD_SPLIT_START_VERT]) + vSplitAreas = WinCreate.AddGridSplits( nParentId, WIN_MEASURE.PERCENTAGE, vVertDimensions, vHorizDimensions, AreaTable[JWD_SPLIT_START_VERT], nAreaNbr) elseif AreaTable[JWD_SPLIT_TYPE] == 'VERTICAL' then - vSplitAreas = WinCreate.AddSplits( nParentId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, vVertDimensions) + vSplitAreas = WinCreate.AddSplits( nParentId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, vVertDimensions, false, nAreaNbr) else - vSplitAreas = WinCreate.AddSplits( nParentId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.PERCENTAGE, vHorizDimensions) + vSplitAreas = WinCreate.AddSplits( nParentId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.PERCENTAGE, vHorizDimensions, false, nAreaNbr) end for i = 1, #vSplitAreas do ConvertTableToGeometry( AreaTable[JWD_AREA_LIST][i], vSplitAreas[i]) @@ -286,6 +289,7 @@ elseif AreaTable[JWD_AREA_TYPE] == 'SPLIT' then -- NULL elseif AreaTable[JWD_AREA_TYPE] == 'SPLITTED' then + EgtSetInfo( nParentId, WIN_AREA_NBR, nAreaNbr) if AreaTable[JWD_AREA_LIST] then ConvertTableToGeometry( AreaTable[JWD_AREA_LIST][1], nParentId) end @@ -317,6 +321,7 @@ function WinManageProject.ReadFromFile( sFilePath, sProfileDir) return true end +--------------------------------------------------------------------- -- funzione che apre un file jwd function WinManageProject.ReadFromJwd( sJwd) local tData = JSON:decode( sJwd) diff --git a/Designing/WinProject.lua b/Designing/WinProject.lua index 0706646..bd3e666 100644 --- a/Designing/WinProject.lua +++ b/Designing/WinProject.lua @@ -40,7 +40,7 @@ local function GetVariableList( sName) local List = {} local nIndex = 1 while WDG[sName .. nIndex] do - table.insert(List, WDG['JOINT' .. nIndex]) + table.insert(List, WDG[sName .. nIndex]) nIndex = nIndex + 1 end return List @@ -55,6 +55,14 @@ local function CleanVariableList( sName) end end +---------------------------------------------------------------------------------- +local function FillVariableList( sName, List) + CleanVariableList( sName) + for i = 1, #List do + WDG[sName .. i] = List[i] + end +end + ---------------------------------------------------------------------------------- local function SetProfilePath() _G.sProfilePath = WDG.PROFILEPATH @@ -123,7 +131,7 @@ _G.GetProfileThresholdsList = GetProfileThresholdsList ---------------------------------------------------------------------------------- local function WinCreate_CreateFrame() local JointList = GetVariableList( 'JOINT') - WDG.AREAID = WinCreate.CreateFrame( WDG.FRAMETYPE, JointList, WDG.WIDTH, WDG.HEIGHT, WDG.HEIGHT2) + WDG.AREAID = WinCreate.CreateFrame( WDG.FRAMETYPE, JointList, WDG.WIDTH, WDG.HEIGHT, WDG.HEIGHT2, WDG.AREANBR) CleanVariableList('JOINT') end _G.WinCreate_CreateFrame = WinCreate_CreateFrame @@ -131,11 +139,30 @@ _G.WinCreate_CreateFrame = WinCreate_CreateFrame ---------------------------------------------------------------------------------- local function WinCreate_AddSash() local JointList = GetVariableList( 'JOINT') - WDG.AREAID = WinCreate.AddSash( WDG.AREAID, JointList, WDG.SASHTYPE, WDG.OPENINGTYPE) + WDG.AREAID = WinCreate.AddSash( WDG.AREAID, JointList, WDG.OPENINGTYPE, WDG.AREANBR) CleanVariableList( 'JOINT') end _G.WinCreate_AddSash = WinCreate_AddSash +---------------------------------------------------------------------------------- +local function WinCreate_AddSashGroup() + local DimensionList = GetVariableList( 'DIMENSION') + local JointList = GetVariableList( 'JOINT') + local SashTypeList = GetVariableList( 'SASHTYPE') + local OpeningTypeList = GetVariableList( 'OPENINGTYPE') + local SashNbrList = GetVariableList( 'SASHNBR') + + local AreaList = WinCreate.AddSashGroup( WDG.AREAID, WDG.MEASURETYPE, DimensionList, JointList, SashTypeList, OpeningTypeList, WDG.AREANBR, SashNbrList) + FillVariableList( 'AREAID', AreaList) + + CleanVariableList( 'DIMENSION') + CleanVariableList( 'JOINT') + CleanVariableList( 'SASHTYPE') + CleanVariableList( 'OPENINGTYPE') + CleanVariableList( 'SASHNBR') +end +_G.WinCreate_AddSashGroup = WinCreate_AddSashGroup + ---------------------------------------------------------------------------------- local function WinCreate_AddHardware() WinCreate.AddHardware( WDG.AREAID, WDG.FAVOURITE, WDG.HANDLE) @@ -144,7 +171,7 @@ _G.WinCreate_AddHardware = WinCreate_AddHardware ---------------------------------------------------------------------------------- local function WinCreate_AddFill() - WDG.AREAID = WinCreate.AddFill( WDG.AREAID, WDG.FILLTYPE) + WDG.AREAID = WinCreate.AddFill( WDG.AREAID, WDG.FILLTYPE, WDG.AREANBR) end _G.WinCreate_AddFill = WinCreate_AddFill @@ -162,62 +189,23 @@ _G.WinCreate_AddThreshold = WinCreate_AddThreshold ---------------------------------------------------------------------------------- local function WinCreate_AddSplits() - local AreaIndex = 1 - while WDG['AREAID' .. AreaIndex] do - WDG['AREAID' .. AreaIndex] = nil - AreaIndex = AreaIndex + 1 - end - local PositionList = {} - local PositionIndex = 1 - while WDG['POSITION' .. PositionIndex] do - table.insert( PositionList, WDG['POSITION' .. PositionIndex]) - PositionIndex = PositionIndex + 1 - end - local AreaList = WinCreate.AddSplits(WDG.AREAID, WDG.SPLITORIENTATION, WDG.MEASURETYPE, PositionList, WDG.PROPORTION, WDG.SPLITTYPE) - for AreaIndex = 1, #AreaList do - WDG['AREAID' .. AreaIndex] = AreaList[ AreaIndex] - end - PositionIndex = 1 - while WDG['POSITION' .. PositionIndex] do - WDG['POSITION' .. PositionIndex] = nil - PositionIndex = PositionIndex + 1 - end + local PositionList = GetVariableList( 'POSITION') + local AreaList = WinCreate.AddSplits( WDG.AREAID, WDG.SPLITORIENTATION, WDG.MEASURETYPE, PositionList, false, WDG.AREANBR) + FillVariableList( 'AREAID', AreaList) + CleanVariableList( 'POSITION') end _G.WinCreate_AddSplits = WinCreate_AddSplits ---------------------------------------------------------------------------------- local function WinCreate_AddGridSplits() - local AreaIndex = 1 - while WDG['AREAID' .. AreaIndex] do - WDG['AREAID' .. AreaIndex] = nil - AreaIndex = AreaIndex + 1 - end - local PositionListVert = {} - local PositionIndex = 1 - while WDG['POSITION_VERT' .. PositionIndex] do - table.insert( PositionListVert, WDG['POSITION' .. PositionIndex]) - PositionIndex = PositionIndex + 1 - end - local PositionListHoriz = {} - PositionIndex = 1 - while WDG['POSITION_HORIZ' .. PositionIndex] do - table.insert( PositionListHoriz, WDG['POSITION' .. PositionIndex]) - PositionIndex = PositionIndex + 1 - end - local AreaList = WinCreate.AddGridSplits(WDG.AREAID, WDG.MEASURETYPE, PositionListVert, PositionListHoriz, WDG.STARTVERTICAL, WDG.SPLITTYPE) - for AreaIndex = 1, #AreaList do - WDG['AREAID' .. AreaIndex] = AreaList[ AreaIndex] - end - PositionIndex = 1 - while WDG['POSITION_VERT' .. PositionIndex] do - WDG['POSITION_VERT' .. PositionIndex] = nil - PositionIndex = PositionIndex + 1 - end - PositionIndex = 1 - while WDG['POSITION_HORIZ' .. PositionIndex] do - WDG['POSITION_HORIZ' .. PositionIndex] = nil - PositionIndex = PositionIndex + 1 - end + local PositionListVert = GetVariableList( 'POSITION_VERT') + local PositionListHoriz = GetVariableList( 'POSITION_HORIZ') + + local AreaList = WinCreate.AddGridSplits( WDG.AREAID, WDG.MEASURETYPE, PositionListVert, PositionListHoriz, WDG.STARTVERTICAL, WDG.AREANBR) + FillVariableList( 'AREAID', AreaList) + + CleanVariableList( 'POSITION_VERT') + CleanVariableList( 'POSITION_HORIZ') end _G.WinCreate_AddGridSplits = WinCreate_AddGridSplits