DataWindow :
- se non definita altezza maniglia, richiesta delle opzioni della ferramenta per ricavarne valore di default - aggiunta forma dell'anta.
This commit is contained in:
@@ -221,6 +221,62 @@ end
|
||||
|
||||
----------------------------------------------------------------------------------
|
||||
-------------------------------------- ANTA --------------------------------------
|
||||
----------------------------------------------------------------------------------
|
||||
-- funzione che identifica la forma dell'anta/gruppo di ante
|
||||
local function IdentifySashShape( nAreaId, nOutlineLayerId)
|
||||
|
||||
local vOutlines = EgtGetAllInGroup( nOutlineLayerId)
|
||||
local nCompoId = EgtCurveCompo( nOutlineLayerId, vOutlines, false)
|
||||
|
||||
-- verifico se trapezio
|
||||
local bTrap, ptOrig, vtB1, vtE1, vtB2 = EgtCurveIsATrapezoid( nCompoId)
|
||||
if bTrap then
|
||||
-- verifico se rettangolo controllando se lati sono paralleli
|
||||
local vtE2 = vtB1 + vtE1 - vtB2
|
||||
if AreSameOrOppositeVectorApprox( vtE1, vtE2) then
|
||||
EgtSetInfo( nAreaId, WIN_SASH_SHAPE, WIN_SASH_SHAPES.RECT)
|
||||
else
|
||||
EgtSetInfo( nAreaId, WIN_SASH_SHAPE, WIN_SASH_SHAPES.TRAP)
|
||||
end
|
||||
|
||||
else
|
||||
-- verifico se cerchio
|
||||
local bCircle = EgtCurveIsACircle( nCompoId)
|
||||
if bCircle then
|
||||
EgtSetInfo( nAreaId, WIN_SASH_SHAPE, WIN_SASH_SHAPES.CIRCLE)
|
||||
|
||||
-- verifico se forma con arco
|
||||
elseif #vOutlines == 4 and EgtGetType( vOutlines[3]) == GDB_TY.CRV_ARC then
|
||||
local dAngCenter = EgtArcAngCenter( vOutlines[3])
|
||||
if abs( dAngCenter - 180) < GEO.EPS_SMALL then
|
||||
EgtSetInfo( nAreaId, WIN_SASH_SHAPE, WIN_SASH_SHAPES.ROUND_ARC)
|
||||
else
|
||||
if abs( EgtCurveLength( vOutlines[2]) - EgtCurveLength( vOutlines[4])) < GEO.EPS_SMALL then
|
||||
EgtSetInfo( nAreaId, WIN_SASH_SHAPE, WIN_SASH_SHAPES.SEGMENTAL_ARC)
|
||||
else
|
||||
-- verifico se metà di arco a tutto sesto o ribassato
|
||||
if abs( dAngCenter - 90) < GEO.EPS_SMALL then
|
||||
EgtSetInfo( nAreaId, WIN_SASH_SHAPE, WIN_SASH_SHAPES.SEMI_ROUND_ARC)
|
||||
else
|
||||
local ptS = EgtSP( vOutlines[3])
|
||||
local ptE = EgtEP( vOutlines[3])
|
||||
local ptC = EgtCP( vOutlines[3])
|
||||
if abs( ptS:getX() - ptC:getX()) < GEO.EPS_SMALL or abs( ptE:getX() - ptC:getX()) < GEO.EPS_SMALL then
|
||||
EgtSetInfo( nAreaId, WIN_SASH_SHAPE, WIN_SASH_SHAPES.SEMI_SEGMENTAL_ARC)
|
||||
else
|
||||
EgtSetInfo( nAreaId, WIN_SASH_SHAPE, WIN_SASH_SHAPES.GENERIC)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
EgtSetInfo( nAreaId, WIN_SASH_SHAPE, WIN_SASH_SHAPES.GENERIC)
|
||||
end
|
||||
end
|
||||
|
||||
EgtErase( nCompoId)
|
||||
end
|
||||
|
||||
----------------------------------------------------------------------------------
|
||||
-- funzione che aggiunge una anta
|
||||
function WinCreate.AddSash( nParentAreaId, vJoints, nOpeningType, nAreaNbr)
|
||||
@@ -237,7 +293,7 @@ function WinCreate.AddSash( nParentAreaId, vJoints, nOpeningType, nAreaNbr)
|
||||
EgtSetInfo( nAreaId, WIN_AREATYPE, WIN_AREATYPES.SASH)
|
||||
-- copio outline dall'area parent
|
||||
local nOutlineLayerId = CopyParentOutline( nAreaId, nParentAreaId)
|
||||
-- imposto tipo giunzioni
|
||||
IdentifySashShape( nAreaId, nOutlineLayerId)
|
||||
EgtSetInfo( nOutlineLayerId, WIN_JOINTS, vJoints)
|
||||
-- imposto apertura se presente
|
||||
if nOpeningType then
|
||||
@@ -263,6 +319,11 @@ function WinCreate.AddSashGroup( nParentAreaId, nMeasureType, vDimensions, vJoin
|
||||
-- creo gli split di tipo french
|
||||
local vAreas = WinCreate.AddSplits( nParentAreaId, WIN_SPLITORIENTATION.VERTICAL, nMeasureType, vDimensions, true, nAreaNbr)
|
||||
|
||||
-- identifico la forma del gruppo di ante
|
||||
local nAreaSplit = EgtGetParent( vAreas[1])
|
||||
local nOutlineLayerId = EgtGetFirstNameInGroup( nAreaSplit, WIN_AREAOUTLINE)
|
||||
IdentifySashShape( nAreaSplit, nOutlineLayerId)
|
||||
|
||||
-- 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 .. ')')
|
||||
|
||||
Reference in New Issue
Block a user