diff --git a/Profiles/Main.lua b/Profiles/Main.lua index 242b897..9a0f1c9 100644 --- a/Profiles/Main.lua +++ b/Profiles/Main.lua @@ -39,7 +39,7 @@ local DebugCode = false local HoleWidth = 1835 local HoleHeight = 1516 -local WindowWidth = 1800 +local WindowWidth = 900 local WindowHeight = 1500 local WindowTree @@ -122,12 +122,12 @@ local nFrameId = WinCreate.CreateFrame( WindowWidth, WindowHeight, FrameJointTyp -- ------------------------ Finestra anta singola ------------------------ ----- aggiungo anta ---local SashJointType = WIN_JNT.FULL_V ---local nSashId = WinCreate.AddSash( nFrameId, SashJointType, SashJointType, SashJointType, SashJointType) --- ----- aggiungo vetro ---local nFillId = WinCreate.AddFill( nSashId, WIN_FILLTYPES.GLASS) +-- aggiungo anta +local SashJointType = WIN_JNT.FULL_V +local nSashId = WinCreate.AddSash( nFrameId, SashJointType, SashJointType, SashJointType, SashJointType) + +-- aggiungo vetro +local nFillId = WinCreate.AddFill( nSashId, WIN_FILLTYPES.GLASS) ------------------------ Finestra anta singola con divisione orizzontale ------------------------ @@ -280,7 +280,7 @@ local nFrameId = WinCreate.CreateFrame( WindowWidth, WindowHeight, FrameJointTyp -- definisco prima divisione --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}, 3) -local nAreaList = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.33}) +--local nAreaList = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.33}) -- definisco seconda divisione --local nArea2Id, nArea3Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3) @@ -649,7 +649,7 @@ local nAreaList = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, -- WinLib.CreatePartFromOutline( nFrameLayerId, nCurrOutlineId) -- imposto se calcolare i solidi o meno -WinCalculate.SetCalcSolid( false) +WinCalculate.SetCalcSolid( true) -- -- creo i pezzi WinCalculate.CreatePartFromArea( nFrameId) diff --git a/Profiles/New1.nge b/Profiles/New1.nge new file mode 100644 index 0000000..3d19904 Binary files /dev/null and b/Profiles/New1.nge differ diff --git a/Profiles/TestLavorazioni.nge b/Profiles/TestLavorazioni.nge new file mode 100644 index 0000000..111386c Binary files /dev/null and b/Profiles/TestLavorazioni.nge differ diff --git a/Profiles/WinConst.lua b/Profiles/WinConst.lua index 56d70cb..e04c8ec 100644 --- a/Profiles/WinConst.lua +++ b/Profiles/WinConst.lua @@ -98,6 +98,7 @@ WIN_PROFILEPATH = 'ProfilePath' WIN_FRAME = 'Frame' WIN_AREAOUTLINE = 'BaseOutline' WIN_OUTLINE = 'Outline' +WIN_SELECTION = 'Selection' WIN_ORIGOUTLINE = 'OrigOutline' WIN_GEO = 'Geo' WIN_SOLID = 'Solid' diff --git a/Profiles/WinLib/WinCalculate.lua b/Profiles/WinLib/WinCalculate.lua index e0bb4e8..40fb25f 100644 --- a/Profiles/WinLib/WinCalculate.lua +++ b/Profiles/WinLib/WinCalculate.lua @@ -307,6 +307,7 @@ function WinCalculate.CalculateOutlineFromAreaOutline( nAreaId) local nAreaOutlineLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_AREAOUTLINE) local nOutlineLayerId = EgtCopy( nAreaOutlineLayerId, nAreaId) EgtSetName( nOutlineLayerId, WIN_OUTLINE) + EgtSetStatus( nOutlineLayerId, GDB_ST.OFF) local nAreaOutlineId = EgtGetFirstInGroup( nAreaOutlineLayerId) local nOutlineId = EgtGetFirstInGroup( nOutlineLayerId) while nAreaOutlineId do @@ -320,6 +321,7 @@ function WinCalculate.CalculateOutlineFromAreaOutline( nAreaId) 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) @@ -331,6 +333,7 @@ function WinCalculate.CalculateOutlineFromAreaOutline( nAreaId) local nOutlineLayerId = EgtCopy( nAreaOutlineLayerId, nAreaId) EgtSetName( nOutlineLayerId, WIN_OUTLINE) EgtEmptyGroup( nOutlineLayerId) + EgtSetStatus( nOutlineLayerId, GDB_ST.OFF) -- recupero outline di livello precedente e lo copio pezzo per pezzo local nSplitId local nBaseOutlineId = EgtGetFirstInGroup( nAreaOutlineLayerId) @@ -345,6 +348,7 @@ function WinCalculate.CalculateOutlineFromAreaOutline( nAreaId) if sSouParentName == WIN_BASESPLIT then -- aggiorno nome EgtSetName( nNewOutlineId, sBaseName) + EgtSetStatus( nNewOutlineId, GDB_ST.OFF) nSplitId = nNewOutlineId end EgtSetInfo( nNewOutlineId, WIN_SOU, nBaseOutlineId) @@ -368,6 +372,7 @@ function WinCalculate.CalculateOutlineFromAreaOutline( nAreaId) 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) @@ -402,6 +407,7 @@ function WinCalculate.CalculateOutlineFromAreaOutline( nAreaId) local nSashOutlineLayerId = EgtCopy( nSashAreaOutlineLayerId, nAreaId) EgtSetName( nSashOutlineLayerId, WIN_OUTLINE) EgtEmptyGroup( nSashOutlineLayerId) + EgtSetStatus( nSashOutlineLayerId, GDB_ST.OFF) -- recupero se anta battente ricevente local nSashType = EgtGetInfo( nAreaId, WIN_SASHTYPE, 'i') -- ciclo su profilo disegnato anta @@ -500,6 +506,7 @@ function WinCalculate.CalculateOutlineFromAreaOutline( nAreaId) -- creo copia local nSplitLayerId = EgtCopy( nBaseSplitLayerId, nAreaId) EgtSetName( nSplitLayerId, WIN_SPLIT) + EgtSetStatus( nSplitLayerId, GDB_ST.OFF) local nSplitId = EgtGetFirstInGroup( nSplitLayerId) -- la taglio con outline WinCalculate.TrimSplitWithOutline( nSplitId) @@ -515,6 +522,7 @@ function WinCalculate.CalculateOutlineFromAreaOutline( nAreaId) local nFillOutlineLayerId = EgtCopy( nFillBaseAreaLayerId, nAreaId) EgtSetName( nFillOutlineLayerId, WIN_OUTLINE) EgtEmptyGroup( nFillOutlineLayerId) + EgtSetStatus( nFillOutlineLayerId, GDB_ST.OFF) -- ciclo su BaseArea riempimento local nFillAreaOutlineId = EgtGetFirstInGroup( nFillBaseAreaLayerId) while nFillAreaOutlineId do @@ -594,6 +602,23 @@ function WinCalculate.CalculateOutlineFromAreaOutline( nAreaId) -- elseif ... end + -- disegno area di selezione per programma + local nSelectionLayerId = EgtGroup( nAreaId) + EgtSetName( nSelectionLayerId, WIN_SELECTION) + EgtSetStatus( nSelectionLayerId, GDB_ST.OFF) + local OutlineList = {} + local nOutlineLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_OUTLINE) + local nOutlineId = EgtGetFirstInGroup(nOutlineLayerId) + while nOutlineId do + table.insert( OutlineList, nOutlineId) + nOutlineId = EgtGetNext(nOutlineId) + end + local nCompoId = EgtCurveCompo( nSelectionLayerId, OutlineList, false) + local nSelectionArea = EgtSurfFlatRegion( nSelectionLayerId, nCompoId) + EgtSetColor( nSelectionArea, 'YELLOW') + EgtSetAlpha( nSelectionArea, 10) + EgtMove( nSelectionArea, 10 * Z_AX()) + EgtErase( nCompoId) end -- funzione che verifica se ci sono Sash dopo diff --git a/Profiles/WinLib/WinCreate.lua b/Profiles/WinLib/WinCreate.lua index d805335..271d11a 100644 --- a/Profiles/WinLib/WinCreate.lua +++ b/Profiles/WinLib/WinCreate.lua @@ -57,12 +57,12 @@ end function WinCreate.CreateFrame( dWidth, dHeight, nJointBL, nJointBR, nJointTR, nJointTL) -- creo gruppo per telaio local nFrameAreaId = EgtGroup( GDB_ID.ROOT) - EgtSetStatus( nFrameAreaId, GDB_ST.OFF) EgtSetName( nFrameAreaId, WIN_AREA .. '(' .. WIN_FRAME .. ')') -- imposto il tipo EgtSetInfo( nFrameAreaId, WIN_AREATYPE, WIN_AREATYPES.FRAME) local nAreaOutlineLayerId = EgtGroup( nFrameAreaId) EgtSetName( nAreaOutlineLayerId, WIN_AREAOUTLINE) + EgtSetStatus( nAreaOutlineLayerId, GDB_ST.OFF) -- disegno outline local nFrameBottomId = EgtLine( nAreaOutlineLayerId, Point3d( 0, 0, 0), Point3d( dWidth, 0, 0)) EgtSetName( nFrameBottomId, WIN_BOTTOM) diff --git a/Profiles/WinProject.lua b/Profiles/WinProject.lua index e1603d8..a79f6b6 100644 --- a/Profiles/WinProject.lua +++ b/Profiles/WinProject.lua @@ -15,7 +15,7 @@ require( 'EgtBase') _ENV = EgtProtectGlobal() -EgtEnableDebug( true) +EgtEnableDebug( false) -- EgtEnableDebug( false) -- Imposto direttorio per librerie diff --git a/Projects/Rect_SixSash_Vertical&HorizontalMullion.jwd b/Projects/Rect_SixSash_Horizontal&VerticalSplit_Mullion.jwd similarity index 100% rename from Projects/Rect_SixSash_Vertical&HorizontalMullion.jwd rename to Projects/Rect_SixSash_Horizontal&VerticalSplit_Mullion.jwd index 6530efc..4e61fcc 100644 --- a/Projects/Rect_SixSash_Vertical&HorizontalMullion.jwd +++ b/Projects/Rect_SixSash_Horizontal&VerticalSplit_Mullion.jwd @@ -66,6 +66,22 @@ }, "Area2": { "Area1": { + "Area1": { + "Area1": { + "AreaType": 3, + "FillType": 1 + }, + "AreaType": 2, + "Joint": { + "JointBL": 3, + "JointBR": 3, + "JointTL": 3, + "JointTR": 3 + } + }, + "AreaType": 0 + }, + "Area2": { "Area1": { "Area1": { "Area1": { @@ -105,22 +121,6 @@ "ptStart": [ 1200.0, 750.0, 0.0 ] } ] }, - "Area2": { - "Area1": { - "Area1": { - "AreaType": 3, - "FillType": 1 - }, - "AreaType": 2, - "Joint": { - "JointBL": 3, - "JointBR": 3, - "JointTL": 3, - "JointTR": 3 - } - }, - "AreaType": 0 - }, "AreaType": 4, "Split": [ { "CurveType": 256, diff --git a/Projects/Rect_SixSash_Vertical&HorizontalMullion2.jwd b/Projects/Rect_SixSash_Vertical&HorizontalSplit_Mullion.jwd similarity index 100% rename from Projects/Rect_SixSash_Vertical&HorizontalMullion2.jwd rename to Projects/Rect_SixSash_Vertical&HorizontalSplit_Mullion.jwd diff --git a/Projects/TestJson.jwd b/Projects/TestJson.jwd new file mode 100644 index 0000000..8d58e85 --- /dev/null +++ b/Projects/TestJson.jwd @@ -0,0 +1,78 @@ +{ + "ProfilePath": "c:\\EgtData\\EgwWindowLua\\Profiles\\Profilo78 - Offset.nge", + "Area1": { + "Area1": { + "Area1": null, + "Area2": null, + "AreaType": 3, + "FillType": 1, + "BottomRail": false, + "Outline": null, + "Joint": null + }, + "Area2": null, + "AreaType": 1, + "FillType": 0, + "BottomRail": true, + "Outline": [ + { + "CurveType": 256, + "ptStart": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "ptEnd": { + "x": 1800.0, + "y": 0.0, + "z": 0.0 + } + }, + { + "CurveType": 256, + "ptStart": { + "x": 1800.0, + "y": 0.0, + "z": 0.0 + }, + "ptEnd": { + "x": 1800.0, + "y": 1500.0, + "z": 0.0 + } + }, + { + "CurveType": 256, + "ptStart": { + "x": 1800.0, + "y": 1500.0, + "z": 0.0 + }, + "ptEnd": { + "x": 0.0, + "y": 1500.0, + "z": 0.0 + } + }, + { + "CurveType": 256, + "ptStart": { + "x": 0.0, + "y": 1500.0, + "z": 0.0 + }, + "ptEnd": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + } + } + ], + "Joint": [ + 2, + 2, + 2, + 2 + ] + } +} \ No newline at end of file