- aggiunte funzioni per creare telai con forme non rettangolari
- modifiche varie per gestire correttamente le nuove forme (prima versione).
This commit is contained in:
+190
-75
@@ -59,73 +59,141 @@ function WinCreate.ImportProfile( sProfilePath)
|
||||
return true
|
||||
end
|
||||
|
||||
-- funzione che crea il buco rettangolare per la finestra
|
||||
function WinCreate.CreateFrame( dWidth, dHeight, nJointBL, nJointBR, nJointTR, nJointTL)
|
||||
----------------------------------------------------------------------------------
|
||||
------------------------------------- TELAIO -------------------------------------
|
||||
----------------------------------------------------------------------------------
|
||||
-- funzione che crea il buco per la finestra a partire da curve generiche
|
||||
-- TO DO rendere i joints un vettore con un numero variabile a seconda del tipo di finestra
|
||||
function WinCreate.CreateGenFrame( vFrameCrvs, nJointBL, nJointBR, nJointTL, nJointTR)
|
||||
-- creo gruppo per telaio
|
||||
local nFrameAreaId = EgtGroup( GDB_ID.ROOT)
|
||||
EgtSetName( nFrameAreaId, WIN_AREA .. '(' .. WIN_FRAME .. ')')
|
||||
-- imposto il tipo
|
||||
EgtSetInfo( nFrameAreaId, WIN_AREATYPE, WIN_AREATYPES.FRAME)
|
||||
-- creo il gruppo con le curve di outline
|
||||
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)
|
||||
local nFrameRightId = EgtLine( nAreaOutlineLayerId, Point3d( dWidth, 0, 0), Point3d( dWidth, dHeight, 0))
|
||||
EgtSetName( nFrameRightId, WIN_RIGHT)
|
||||
local nFrameTopId = EgtLine( nAreaOutlineLayerId, Point3d( dWidth, dHeight, 0), Point3d( 0, dHeight, 0))
|
||||
EgtSetName( nFrameTopId, WIN_TOP)
|
||||
local nFrameLeftId = EgtLine( nAreaOutlineLayerId, Point3d( 0, dHeight, 0), Point3d( 0, 0, 0))
|
||||
EgtSetName( nFrameLeftId, WIN_LEFT)
|
||||
for i = 1, #vFrameCrvs do
|
||||
EgtRelocateGlob( vFrameCrvs[i], nAreaOutlineLayerId)
|
||||
end
|
||||
-- imposto tipo giunzioni
|
||||
EgtSetInfo( nAreaOutlineLayerId, WIN_JOINT_BL, nJointBL)
|
||||
EgtSetInfo( nAreaOutlineLayerId, WIN_JOINT_BR, nJointBR)
|
||||
EgtSetInfo( nAreaOutlineLayerId, WIN_JOINT_TL, nJointTL)
|
||||
EgtSetInfo( nAreaOutlineLayerId, WIN_JOINT_TR, nJointTR)
|
||||
return nFrameAreaId
|
||||
|
||||
return nFrameAreaId
|
||||
end
|
||||
-- funzione che crea il buco per la finestra
|
||||
function WinCreate.CreateGenFrame( nFrameBottomId, nFrameRightId, nFrameTopId, nFrameLeftId, nJointBL, nJointBR, nJointTR, nJointTL)
|
||||
-- creo gruppo per telaio
|
||||
local nFrameAreaId = EgtGroup( GDB_ID.ROOT)
|
||||
EgtSetName( nFrameAreaId, WIN_AREA .. '(' .. WIN_FRAME .. ')')
|
||||
-- imposto il tipo
|
||||
EgtSetInfo( nFrameAreaId, WIN_AREATYPE, WIN_AREATYPES.FRAME)
|
||||
local nAreaOutlineLayerId = EgtGroup( nFrameAreaId)
|
||||
EgtSetName( nAreaOutlineLayerId, WIN_AREAOUTLINE)
|
||||
|
||||
----------------------------------------------------------------------------------
|
||||
-- funzione che crea le curve che definiscono il telaio in base alla geometria richiesta
|
||||
local function CreateFrameCurves( nLayerId, nType, dWidth, dHeight, dVal)
|
||||
|
||||
if nType == WIN_FRAME_TYPE.RECT then
|
||||
-- telaio rettangolare
|
||||
local nFrameBottomId = EgtLine( nLayerId, Point3d( 0, 0, 0), Point3d( dWidth, 0, 0))
|
||||
EgtSetName( nFrameBottomId, WIN_BOTTOM)
|
||||
local nFrameRightId = EgtLine( nLayerId, Point3d( dWidth, 0, 0), Point3d( dWidth, dHeight, 0))
|
||||
EgtSetName( nFrameRightId, WIN_RIGHT)
|
||||
local nFrameTopId = EgtLine( nLayerId, Point3d( dWidth, dHeight, 0), Point3d( 0, dHeight, 0))
|
||||
EgtSetName( nFrameTopId, WIN_TOP)
|
||||
local nFrameLeftId = EgtLine( nLayerId, Point3d( 0, dHeight, 0), Point3d( 0, 0, 0))
|
||||
EgtSetName( nFrameLeftId, WIN_LEFT)
|
||||
|
||||
elseif nType == WIN_FRAME_TYPE.CHAMFER_SIDE then
|
||||
-- dHeight è l'altezza del lato sx, dVal è l'altezza del lato dx
|
||||
local nFrameBottomId = EgtLine( nLayerId, Point3d( 0, 0, 0), Point3d( dWidth, 0, 0))
|
||||
EgtSetName( nFrameBottomId, WIN_BOTTOM)
|
||||
local nFrameRightId = EgtLine( nLayerId, Point3d( dWidth, 0, 0), Point3d( dWidth, dVal, 0))
|
||||
EgtSetName( nFrameRightId, WIN_RIGHT)
|
||||
local nFrameTopId = EgtLine( nLayerId, Point3d( dWidth, dVal, 0), Point3d( 0, dHeight, 0))
|
||||
EgtSetName( nFrameTopId, WIN_TOP)
|
||||
local nFrameLeftId = EgtLine( nLayerId, Point3d( 0, dHeight, 0), Point3d( 0, 0, 0))
|
||||
EgtSetName( nFrameLeftId, WIN_LEFT)
|
||||
|
||||
|
||||
elseif nType == WIN_FRAME_TYPE.CHAMFER then
|
||||
-- dHeight è l'altezza dei lati verticali, dVal è l'altezza complessiva della finestra
|
||||
local nFrameBottomId = EgtLine( nLayerId, Point3d( 0, 0, 0), Point3d( dWidth, 0, 0))
|
||||
EgtSetName( nFrameBottomId, WIN_BOTTOM)
|
||||
local nFrameRightId = EgtLine( nLayerId, Point3d( dWidth, 0, 0), Point3d( dWidth, dHeight, 0))
|
||||
EgtSetName( nFrameRightId, WIN_RIGHT)
|
||||
local nFrameTop1Id = EgtLine( nLayerId, Point3d( dWidth, dHeight, 0), Point3d( dWidth / 2, dVal, 0))
|
||||
local nFrameTop2Id = EgtLine( nLayerId, Point3d( dWidth / 2, dVal, 0), Point3d( 0, dHeight, 0))
|
||||
EgtSetName( nFrameTop1Id, WIN_TOP)
|
||||
EgtSetName( nFrameTop2Id, WIN_TOP)
|
||||
local nFrameLeftId = EgtLine( nLayerId, Point3d( 0, dHeight, 0), Point3d( 0, 0, 0))
|
||||
EgtSetName( nFrameLeftId, WIN_LEFT)
|
||||
|
||||
elseif nType == WIN_FRAME_TYPE.ROUND_ARC then
|
||||
-- arco a tutto sesto
|
||||
local nFrameBottomId = EgtLine( nLayerId, Point3d( 0, 0, 0), Point3d( dWidth, 0, 0))
|
||||
EgtSetName( nFrameBottomId, WIN_BOTTOM)
|
||||
local nFrameRightId = EgtLine( nLayerId, Point3d( dWidth, 0, 0), Point3d( dWidth, dHeight - 0.5 * dWidth, 0))
|
||||
EgtSetName( nFrameRightId, WIN_RIGHT)
|
||||
local nFrameTopId = EgtArcCPA( nLayerId, Point3d( 0.5 * dWidth, dHeight - 0.5 * dWidth, 0), Point3d( dWidth, dHeight - 0.5 * dWidth, 0), 180, 0)
|
||||
EgtSetName( nFrameTopId, WIN_TOP)
|
||||
local nFrameLeftId = EgtLine( nLayerId, Point3d( 0, dHeight - 0.5 * dWidth, 0), Point3d( 0, 0, 0))
|
||||
EgtSetName( nFrameLeftId, WIN_LEFT)
|
||||
|
||||
elseif nType == WIN_FRAME_TYPE.SEGMENTAL_ARC then
|
||||
-- arco ribassato
|
||||
-- dHeight è l'altezza dei lati verticali, dVal è l'altezza complessiva della finestra
|
||||
local nFrameBottomId = EgtLine( nLayerId, Point3d( 0, 0, 0), Point3d( dWidth, 0, 0))
|
||||
EgtSetName( nFrameBottomId, WIN_BOTTOM)
|
||||
local nFrameRightId = EgtLine( nLayerId, Point3d( dWidth, 0, 0), Point3d( dWidth, dHeight, 0))
|
||||
EgtSetName( nFrameRightId, WIN_RIGHT)
|
||||
local nFrameTopId = EgtArc3P( nLayerId, Point3d( dWidth, dHeight, 0), Point3d( 0.5 * dWidth, dVal, 0), Point3d( 0, dHeight, 0))
|
||||
EgtSetName( nFrameTopId, WIN_TOP)
|
||||
local nFrameLeftId = EgtLine( nLayerId, Point3d( 0, dHeight, 0), Point3d( 0, 0, 0))
|
||||
EgtSetName( nFrameLeftId, WIN_LEFT)
|
||||
|
||||
elseif nType == WIN_FRAME_TYPE.POINTED_ARC then
|
||||
-- arco a tutto sesto
|
||||
-- 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
|
||||
if dVal - dHeight < 0.5 * dWidth then
|
||||
return
|
||||
end
|
||||
local nFrameBottomId = EgtLine( nLayerId, Point3d( 0, 0, 0), Point3d( dWidth, 0, 0))
|
||||
EgtSetName( nFrameBottomId, WIN_BOTTOM)
|
||||
local nFrameRightId = EgtLine( nLayerId, Point3d( dWidth, 0, 0), Point3d( dWidth, dHeight, 0))
|
||||
EgtSetName( nFrameRightId, WIN_RIGHT)
|
||||
local nFrameTop1Id = EgtArc2PV( nLayerId, Point3d( dWidth, dHeight, 0), Point3d( 0.5 * dWidth, dVal, 0), Y_AX())
|
||||
EgtSetName( nFrameTop1Id, WIN_TOP)
|
||||
local nFrameTop2Id = EgtArc2PV( nLayerId, Point3d( 0, dHeight, 0), Point3d( 0.5 * dWidth, dVal, 0), Y_AX())
|
||||
EgtInvertCurve( nFrameTop2Id)
|
||||
EgtSetName( nFrameTop2Id, WIN_TOP)
|
||||
local nFrameLeftId = EgtLine( nLayerId, Point3d( 0, dHeight, 0), Point3d( 0, 0, 0))
|
||||
EgtSetName( nFrameLeftId, WIN_LEFT)
|
||||
|
||||
elseif nType == WIN_FRAME_TYPE.TRG then
|
||||
local nFrameBottomId = EgtLine( nLayerId, Point3d( 0, 0, 0), Point3d( dWidth, 0, 0))
|
||||
EgtSetName( nFrameBottomId, WIN_BOTTOM)
|
||||
local nFrameRightId = EgtLine( nLayerId, Point3d( dWidth, 0, 0), Point3d( dVal, dHeight, 0))
|
||||
EgtSetName( nFrameRightId, WIN_RIGHT)
|
||||
local nFrameLeftId = EgtLine( nLayerId, Point3d( dVal, dHeight, 0), Point3d( 0, 0, 0))
|
||||
EgtSetName( nFrameLeftId, WIN_LEFT)
|
||||
end
|
||||
end
|
||||
|
||||
----------------------------------------------------------------------------------
|
||||
-- funzione che crea il telaio a partire da una specifica geometria ( rettangolo, chamfer...)
|
||||
function WinCreate.CreateFrame( nType, nJointBL, nJointBR, nJointTL, nJointTR, dWidth, dHeight, dHeight2)
|
||||
|
||||
-- creo un gruppo temporaneo per le curve di outline
|
||||
local nTmpLay = EgtGroup( GDB_ID.ROOT)
|
||||
-- disegno outline
|
||||
EgtRelocateGlob( nFrameBottomId, nAreaOutlineLayerId)
|
||||
EgtSetName( nFrameBottomId, WIN_BOTTOM)
|
||||
EgtRelocateGlob( nFrameRightId, nAreaOutlineLayerId)
|
||||
EgtSetName( nFrameRightId, WIN_RIGHT)
|
||||
EgtRelocateGlob( nFrameTopId, nAreaOutlineLayerId)
|
||||
EgtSetName( nFrameTopId, WIN_TOP)
|
||||
EgtRelocateGlob( nFrameLeftId, nAreaOutlineLayerId)
|
||||
EgtSetName( nFrameLeftId, WIN_LEFT)
|
||||
-- imposto tipo giunzioni
|
||||
EgtSetInfo( nAreaOutlineLayerId, WIN_JOINT_BL, nJointBL)
|
||||
EgtSetInfo( nAreaOutlineLayerId, WIN_JOINT_BR, nJointBR)
|
||||
EgtSetInfo( nAreaOutlineLayerId, WIN_JOINT_TL, nJointTL)
|
||||
EgtSetInfo( nAreaOutlineLayerId, WIN_JOINT_TR, nJointTR)
|
||||
CreateFrameCurves( nTmpLay, nType, dWidth, dHeight, dHeight2)
|
||||
local nFrameAreaId = WinCreate.CreateGenFrame( EgtGetAllInGroup( nTmpLay), nJointBL, nJointBR, nJointTL, nJointTR)
|
||||
EgtErase( nTmpLay)
|
||||
|
||||
return nFrameAreaId
|
||||
end
|
||||
|
||||
-- -- funzione che crea il telaio a partire dal buco
|
||||
-- function WinCreate.CreateFrameOnHole( nHoleLayerId, dWidth, dHeight)
|
||||
-- local nAreaOutlineLayerId = EgtGroup( nHoleLayerId)
|
||||
-- EgtSetName( nAreaOutlineLayerId, WIN_OUTLINE)
|
||||
-- -- disegno outline
|
||||
-- local nHoleBottomId = EgtLine( nAreaOutlineLayerId, Point3d( 0, 0, 0), Point3d( dWidth, 0, 0))
|
||||
-- EgtSetName( nHoleBottomId, WIN_BOTTOM)
|
||||
-- local nHoleRightId = EgtLine( nAreaOutlineLayerId, Point3d( dWidth, 0, 0), Point3d( dWidth, dHeight, 0))
|
||||
-- EgtSetName( nHoleRightId, WIN_RIGHT)
|
||||
-- local nHoleTopId = EgtLine( nAreaOutlineLayerId, Point3d( dWidth, dHeight, 0), Point3d( 0, dHeight, 0))
|
||||
-- EgtSetName( nHoleTopId, WIN_TOP)
|
||||
-- local nHoleLeftId = EgtLine( nAreaOutlineLayerId, Point3d( 0, dHeight, 0), Point3d( 0, 0, 0))
|
||||
-- EgtSetName( nHoleLeftId, WIN_LEFT)
|
||||
-- end
|
||||
|
||||
----------------------------------------------------------------------------------
|
||||
-------------------------------------- ANTA --------------------------------------
|
||||
----------------------------------------------------------------------------------
|
||||
-- funzione che aggiunge una anta
|
||||
function WinCreate.AddSash( nAreaId, nJointBL, nJointBR, nJointTR, nJointTL, nSashType)
|
||||
-- creo nuova area
|
||||
@@ -158,6 +226,9 @@ function WinCreate.AddSash( nAreaId, nJointBL, nJointBR, nJointTR, nJointTL, nSa
|
||||
return nSashAreaId
|
||||
end
|
||||
|
||||
----------------------------------------------------------------------------------
|
||||
-------------------------------------- FILL --------------------------------------
|
||||
----------------------------------------------------------------------------------
|
||||
-- funzione che aggiunge un riempimento
|
||||
function WinCreate.AddFill( nAreaId, FillType)
|
||||
-- creo nuova area
|
||||
@@ -176,32 +247,29 @@ function WinCreate.AddFill( nAreaId, FillType)
|
||||
EgtSetInfo( nOutlineId, WIN_SOU, nAreaOutlineId)
|
||||
EgtRemoveInfo( nOutlineId, WIN_CHILD)
|
||||
AddInfo( nAreaOutlineId, WIN_CHILD, nOutlineId)
|
||||
EgtRemoveInfo( nAreaOutlineLayerId, WIN_JOINT_BL)
|
||||
EgtRemoveInfo( nAreaOutlineLayerId, WIN_JOINT_BR)
|
||||
EgtRemoveInfo( nAreaOutlineLayerId, WIN_JOINT_TL)
|
||||
EgtRemoveInfo( nAreaOutlineLayerId, WIN_JOINT_TR)
|
||||
nAreaOutlineId = EgtGetNext( nAreaOutlineId)
|
||||
end
|
||||
-- rimuovo eventuali info di giunzioni
|
||||
EgtRemoveInfo( nAreaOutlineLayerId, WIN_JOINT_BL)
|
||||
EgtRemoveInfo( nAreaOutlineLayerId, WIN_JOINT_BR)
|
||||
EgtRemoveInfo( nAreaOutlineLayerId, WIN_JOINT_TL)
|
||||
EgtRemoveInfo( nAreaOutlineLayerId, WIN_JOINT_TR)
|
||||
-- imposto tipo di fill
|
||||
EgtSetInfo( nFillAreaId, WIN_FILLTYPE, FillType)
|
||||
return nFillAreaId
|
||||
end
|
||||
|
||||
----------------------------------------------------------------------------------
|
||||
------------------------------------- SPLIT --------------------------------------
|
||||
----------------------------------------------------------------------------------
|
||||
-- funzione che crea un taglio split
|
||||
function WinCreate.AddSplit( nAreaLayerId, SplitType, MeasureType, nPosition, nProportion, nSplitType)
|
||||
function WinCreate.AddSplit( nAreaLayerId, SplitType, MeasureType, nPosition, nProportion, nSplitType)
|
||||
-- creo layer temporaneo per split
|
||||
local nTempSplitLayerId = EgtGroup( nAreaLayerId)
|
||||
EgtSetName( nTempSplitLayerId, WIN_TEMPSPLIT)
|
||||
-- recupero contorno area precedente
|
||||
local nOutlineLayerId = EgtGetFirstNameInGroup( nAreaLayerId, WIN_AREAOUTLINE)
|
||||
local b3OutlineLayer = EgtGetBBox( nOutlineLayerId, GDB_BB.STANDARD)
|
||||
local OutlineIds = {}
|
||||
local nOutlineId = EgtGetFirstInGroup( nOutlineLayerId)
|
||||
while nOutlineId do
|
||||
local sName = EgtGetName( nOutlineId)
|
||||
table.insert( OutlineIds, nOutlineId)
|
||||
nOutlineId = EgtGetNext( nOutlineId)
|
||||
end
|
||||
local nTotSplitId
|
||||
if SplitType == WIN_SPLITORIENTATION.VERTICAL then
|
||||
-- creo linea
|
||||
@@ -232,6 +300,7 @@ function WinCreate.AddSplit( nAreaLayerId, SplitType, MeasureType, nPosition, n
|
||||
return nArea1Id, nArea2Id
|
||||
end
|
||||
|
||||
----------------------------------------------------------------------------------
|
||||
-- funzione che crea tagli split multipli
|
||||
function WinCreate.AddSplits( nAreaLayerId, SplitType, MeasureType, PositionList, nProportion, nSplitType)
|
||||
local AreaList = {}
|
||||
@@ -285,6 +354,7 @@ function WinCreate.AddSplits( nAreaLayerId, SplitType, MeasureType, PositionList
|
||||
return AreaList
|
||||
end
|
||||
|
||||
----------------------------------------------------------------------------------
|
||||
-- funzione che crea un taglio split da una curva generica
|
||||
function WinCreate.AddGenSplit( nAreaLayerId, nSplitId, nSplitType)
|
||||
-- se area nulla diventa di tipo split
|
||||
@@ -320,8 +390,8 @@ function WinCreate.AddGenSplit( nAreaLayerId, nSplitId, nSplitType)
|
||||
local EndInters
|
||||
for nIndex = 1, #OutlineInters do
|
||||
local CurrOutInters = OutlineInters[nIndex]
|
||||
CurrOutInters.StartDistance = (CurrOutInters.IntersPoint - ptStartSplit):sqlen()
|
||||
CurrOutInters.EndDistance = (CurrOutInters.IntersPoint - ptEndSplit):sqlen()
|
||||
CurrOutInters.StartDistance = dist( CurrOutInters.IntersPoint, ptStartSplit)
|
||||
CurrOutInters.EndDistance = dist( CurrOutInters.IntersPoint, ptEndSplit)
|
||||
if not StartInters or CurrOutInters.StartDistance < StartInters.StartDistance then
|
||||
StartInters = CurrOutInters
|
||||
end
|
||||
@@ -334,8 +404,36 @@ function WinCreate.AddGenSplit( nAreaLayerId, nSplitId, nSplitType)
|
||||
EgtTrimCurveStartAtParam( nSplitId, dStartSplitInters)
|
||||
local dEndSplitInters = EgtCurveParamAtPoint( nSplitId, EndInters.IntersPoint)
|
||||
EgtTrimCurveEndAtParam( nSplitId, dEndSplitInters)
|
||||
EgtSetInfo( nSplitId, WIN_SPLIT_STARTINTERS, StartInters.Id)
|
||||
EgtSetInfo( nSplitId, WIN_SPLIT_ENDINTERS, EndInters.Id)
|
||||
|
||||
-- sistemo le info di intersezione
|
||||
local dPar1 = EgtCurveParamAtPoint( StartInters.Id, StartInters.IntersPoint, 100 * GEO.EPS_SMALL)
|
||||
local _, dParE1 = EgtCurveDomain( StartInters.Id)
|
||||
if dPar1 < GEO.EPS_SMALL then
|
||||
-- intersezione coinvolge anche curva precedente
|
||||
local nOther = EgtGetPrev( StartInters.Id) or EgtGetLastInGroup( nOutlineLayerId)
|
||||
EgtSetInfo( nSplitId, WIN_SPLIT_STARTINTERS, { nOther, StartInters.Id})
|
||||
elseif abs( dPar1 - dParE1) < GEO.EPS_SMALL then
|
||||
-- intersezione coinvolge anche curva successiva
|
||||
local nOther = EgtGetNext( StartInters.Id) or EgtGetFirstInGroup( nOutlineLayerId)
|
||||
EgtSetInfo( nSplitId, WIN_SPLIT_STARTINTERS, { StartInters.Id, nOther})
|
||||
else
|
||||
EgtSetInfo( nSplitId, WIN_SPLIT_STARTINTERS, { StartInters.Id})
|
||||
end
|
||||
|
||||
local dPar2 = EgtCurveParamAtPoint( EndInters.Id, EndInters.IntersPoint, 100 * GEO.EPS_SMALL)
|
||||
local _, dParE2 = EgtCurveDomain( EndInters.Id)
|
||||
if dPar2 < GEO.EPS_SMALL then
|
||||
-- intersezione coinvolge anche curva precedente
|
||||
local nOther = EgtGetPrev( EndInters.Id) or EgtGetLastInGroup( nOutlineLayerId)
|
||||
EgtSetInfo( nSplitId, WIN_SPLIT_ENDINTERS, { nOther, EndInters.Id})
|
||||
elseif abs( dPar2 - dParE2) < GEO.EPS_SMALL then
|
||||
-- intersezione coinvolge anche curva successiva
|
||||
local nOther = EgtGetNext( EndInters.Id) or EgtGetFirstInGroup( nOutlineLayerId)
|
||||
EgtSetInfo( nSplitId, WIN_SPLIT_ENDINTERS, { EndInters.Id, nOther})
|
||||
else
|
||||
EgtSetInfo( nSplitId, WIN_SPLIT_ENDINTERS, { EndInters.Id})
|
||||
end
|
||||
|
||||
-- assegno nome profilo
|
||||
EgtSetName( nSplitId, WIN_SPLIT)
|
||||
-- creo aree
|
||||
@@ -356,6 +454,7 @@ function WinCreate.AddGenSplit( nAreaLayerId, nSplitId, nSplitType)
|
||||
return nArea1Id, nArea2Id
|
||||
end
|
||||
|
||||
----------------------------------------------------------------------------------
|
||||
-- funzione che crea tagli split da curve generiche
|
||||
function WinCreate.AddGenSplits( nAreaLayerId, SplitList)
|
||||
for nIndex = 1, #SplitList do
|
||||
@@ -363,6 +462,7 @@ function WinCreate.AddGenSplits( nAreaLayerId, SplitList)
|
||||
end
|
||||
end
|
||||
|
||||
----------------------------------------------------------------------------------
|
||||
-- funzione che crea le aree da un taglio split
|
||||
function WinCreate.CreateAreaFromSplit( nAreaLayerId, nSplitId)
|
||||
-- creo layer per le due aree
|
||||
@@ -386,13 +486,18 @@ function WinCreate.CreateAreaFromSplit( nAreaLayerId, nSplitId)
|
||||
if ptInters then
|
||||
if nInters == 0 then
|
||||
-- trovato primo punto di intersezione - inizio area 2
|
||||
nInters = 1
|
||||
local nCopyId = EgtCopy( nOutlineId, nArea2OutlineLayerId)
|
||||
EgtSetInfo( nCopyId, WIN_SOU, nOutlineId)
|
||||
EgtRemoveInfo( nCopyId, WIN_CHILD)
|
||||
AddInfo( nOutlineId, WIN_CHILD, nCopyId)
|
||||
local dStartIntersParam = EgtCurveParamAtPoint( nCopyId, ptInters)
|
||||
EgtTrimCurveStartAtParam( nCopyId, dStartIntersParam)
|
||||
local dStartIntersParam = EgtCurveParamAtPoint( nOutlineId, ptInters)
|
||||
local _, dParE = EgtCurveDomain( nOutlineId)
|
||||
if abs( dStartIntersParam - dParE) < GEO.EPS_SMALL then
|
||||
-- se intersezione nel punto finale della curva la ignoro, la ritroverò analizzando l'outline successivo
|
||||
else
|
||||
nInters = 1
|
||||
local nCopyId = EgtCopy( nOutlineId, nArea2OutlineLayerId)
|
||||
EgtSetInfo( nCopyId, WIN_SOU, nOutlineId)
|
||||
EgtRemoveInfo( nCopyId, WIN_CHILD)
|
||||
AddInfo( nOutlineId, WIN_CHILD, nCopyId)
|
||||
EgtTrimCurveStartAtParam( nCopyId, dStartIntersParam)
|
||||
end
|
||||
elseif nInters == 1 then
|
||||
-- trovato secondo punto di intersezione - fine area 2
|
||||
nInters = 2
|
||||
@@ -423,6 +528,11 @@ function WinCreate.CreateAreaFromSplit( nAreaLayerId, nSplitId)
|
||||
EgtSetName( nSplitCopyId, WIN_LEFT)
|
||||
end
|
||||
-- inizio area 1
|
||||
local _, dEnd = EgtCurveDomain( nOutlineId)
|
||||
if abs( dEndIntersParam - dEnd) < GEO.EPS_SMALL then
|
||||
-- l'intersezione è sul punto finale della curva di outline, quindi è la curva successiva che dà inizio all'area 1
|
||||
nOutlineId = EgtGetNext( nOutlineId) or EgtGetFirstInGroup( nOutlineLayerId)
|
||||
end
|
||||
nCopyId = EgtCopy( nOutlineId, nArea1OutlineLayerId)
|
||||
EgtSetInfo( nCopyId, WIN_SOU, nOutlineId)
|
||||
EgtRemoveInfo( nCopyId, WIN_CHILD)
|
||||
@@ -495,10 +605,12 @@ function WinCreate.CreateAreaFromSplit( nAreaLayerId, nSplitId)
|
||||
nFirstInAreaId = EgtGetFirstInGroup( nArea2OutlineLayerId)
|
||||
sFirstInAreaName = EgtGetName( nFirstInAreaId)
|
||||
end
|
||||
-- error('qqq')
|
||||
return nArea1Id, nArea2Id
|
||||
end
|
||||
|
||||
----------------------------------------------------------------------------------
|
||||
---------------------------------- BOTTOMRAIL ------------------------------------
|
||||
----------------------------------------------------------------------------------
|
||||
-- funzione che aggiunge uno zoccolo
|
||||
function WinCreate.AddBottomRail( nAreaId)
|
||||
local nAreaType = EgtGetInfo( nAreaId, WIN_AREATYPE, 'i')
|
||||
@@ -510,8 +622,11 @@ function WinCreate.AddBottomRail( nAreaId)
|
||||
end
|
||||
end
|
||||
|
||||
----------------------------------------------------------------------------------
|
||||
---------------------------------- FERRAMENTA ------------------------------------
|
||||
----------------------------------------------------------------------------------
|
||||
function WinCreate.AddHardware( nFrameId, sFavourite)
|
||||
EgtSetInfo( nFrameId, WIN_HDW_FAVOURITE, sFavourite )
|
||||
EgtSetInfo( nFrameId, WIN_HDW_FAVOURITE, sFavourite)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user