Compare commits

...

13 Commits

Author SHA1 Message Date
Riccardo Elitropi 7b90347b3f EgtExecutor (ModelessDialog) :
- Aggiunta gestione dialoghi non modali.
2026-06-23 12:28:54 +02:00
Dario Sassi 58093bda7f EgtExecutor 3.1f3 :
- ricompilazione con cambio versione.
2026-06-19 18:57:42 +02:00
Riccardo Elitropi e9439f04aa EgtExecutor (ModeLessDialog) :
- prima versione di dialogo non modale.
2026-06-19 10:45:31 +02:00
Riccardo Elitropi d569c7d8ee EgtExecutor (ModelessDialog) :
- aggiunti e aggiornati file persi durante merge.
2026-06-19 09:37:02 +02:00
Riccardo Elitropi 69e42f8e50 Merge commit '9ca84312b4f6c0ca6820cfaabcfa5911b8bfd352' into ModelessDialog 2026-06-19 09:00:39 +02:00
Riccardo Elitropi 9ca84312b4 EgtExecutor :
- Aggiunto parametro in CalcPocketing.
2026-06-19 08:56:08 +02:00
Dario Sassi a4a27a6d44 EgtExecutor :
- in ExePocketing aggiunta gestione lati OPEN (aperti) e OPEN2 (aperti da non oltrepassare).
2026-06-17 09:21:12 +02:00
Daniele Bariletti 58a86feccc EgtExecutor 3.1f2 :
- cambio versione.
2026-06-15 08:48:37 +02:00
Daniele Bariletti 20de52bf58 EgtExecutor :
- spostate le funzioni di offset.
- aggiunta la funzione di offset 3d delle curve.
2026-06-15 08:39:46 +02:00
Dario Sassi 62a8693ce5 EgtExecutor 3.1f1 :
- ricompilazione con cambio versione.
2026-06-08 18:37:24 +02:00
Daniele Bariletti 6015609ade Merge branch '5AxTrimming' 2026-05-26 11:28:04 +02:00
Riccardo Elitropi 5d5a8bd01e Merge commit 'e31fcee3386361d8265e138accf2b6bf49858643' into ModelessDialog 2026-05-08 08:44:13 +02:00
Riccardo Elitropi 292361139a EgtExecutor (ModelessDialog) :
- primo commit.
2026-05-08 08:40:01 +02:00
17 changed files with 1168 additions and 520 deletions
+91
View File
@@ -0,0 +1,91 @@
//----------------------------------------------------------------------------
// EgalTech 2026-2026
//----------------------------------------------------------------------------
// File : AuxDialogBox.cpp Data : 24.04.26 Versione : 3.1d4
// Contenuto : Funzioni DialogBox.
//
//
// Modifiche : 24.04.26 RE Creazione modulo.
//
//
//----------------------------------------------------------------------------
//--------------------------- Include ----------------------------------------
#include "stdafx.h"
#include "EXE.h"
#include "EXE_Macro.h"
#include "AuxDialogBox.h"
#include "/EgtDev/Include/EGnStringUtils.h"
#include "/EgtDev/Include/EXeExecutor.h"
#include "/EgtDev/Include/EGkStringUtils3d.h"
#include "/EgtDev/Include/EgtStringConverter.h"
using namespace std ;
#pragma comment( lib, "Comctl32.lib") // per funzioni LRESULT CALLBACK
HWND phDlgModeless = nullptr ;
int nDlgModelessItem = -1 ;
//-----------------------------------------------------------------------------
bool
UpdateIdsModelessDialog( HWND phDlgModeless, int nDlgModelessItem)
{
// se DialogBox Modeless non inizializzato, esco
if ( phDlgModeless == nullptr)
return false ;
// se Id del controllo da aggiornare non valido, esco
if ( nDlgModelessItem == -1)
return false ;
// recupero tutti gli elementi selezionati
string sIds ;
int nId = ExeGetFirstSelectedObj() ;
while ( nId != GDB_ID_NULL) {
sIds.append( ToString( nId) + string{","}) ;
nId = ExeGetNextSelectedObj() ;
}
if ( ! sIds.empty())
sIds.pop_back() ;
// aggiorno il contenuto nel dialogo
return ( SetDlgItemText( phDlgModeless, nDlgModelessItem, stringtoW( sIds))) ;
}
//-----------------------------------------------------------------------------
LRESULT
CALLBACK UpdateSelectionModelessDialog( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData)
{
if ( msg == WM_GETDLGCODE)
return DLGC_WANTALLKEYS ;
if ( msg == WM_KEYDOWN && wParam == VK_RETURN) {
// dwRefData contiene l'ID dell'EDIT
int nEditId = int( dwRefData) ;
HWND hwndDlg = GetParent(hwnd) ;
if ( hwndDlg == nullptr)
return FALSE ;
// recupero il testo dell'EDIT corretto
string sIds ;
AtoWEX<128> wsEdit( "") ;
if ( GetDlgItemText( hwndDlg, nEditId, LPWSTR( wsEdit), 128) > 0)
sIds = wstrztoA( wsEdit) ;
// deseleziono tutto
ExeDeselectAll() ;
// seleziono gli ID contenuti
if ( ! sIds.empty()) {
STRVECTOR vsIds;
Tokenize( sIds, ",", vsIds) ;
for ( const string& s : vsIds) {
int nId = GDB_ID_NULL ;
if ( FromString( s, nId) && nId != GDB_ID_NULL)
ExeSelectObj( nId) ;
}
}
// aggiorno la grafica ed esco
ExeDraw() ;
return TRUE ;
}
return ( DefSubclassProc( hwnd, msg, wParam, lParam)) ;
}
+31
View File
@@ -0,0 +1,31 @@
//----------------------------------------------------------------------------
// EgalTech 2026-2026
//----------------------------------------------------------------------------
// File : AuxDialogBox.h Data : 24.04.2026 Versione : 3.1d4
// Contenuto : Prototipi funzioni DialogBox.
//
//
//
// Modifiche : 22.04.26 RE Creazione modulo.
//
//
//----------------------------------------------------------------------------
#pragma once
#include "stdafx.h"
#include "resource.h"
#include "/EgtDev/Include/ExeExecutor.h"
#include "/EgtDev/Include/EGkLuaAux.h"
#include <shlobj.h>
//----------------------------------------------------------------------------
// Identificativo della finestra ModeLess corrente ( nullptr se non esiste)
extern HWND phDlgModeless ;
extern int nDlgModelessItem ;
// Funzione per passaggi di parametri tra Selezione DB e dialogo non modale
bool UpdateIdsModelessDialog( HWND phDlgModeless, int UpdateIdsModelessDialog) ;
//Funzione per selezionare gli Id presenti all'interno dei un EditText
LRESULT CALLBACK UpdateSelectionModelessDialog( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData) ;
+4
View File
@@ -28,6 +28,10 @@ const double ANG_TOL_MAX_DEG = 60 ;
// Curve originali di composite o curva originale di area danneggiata
const std::string CRV_ORIG = "ORIG" ;
// Per lati aperti di contorni per pocketing
const std::string PCK_KEY_OPEN = "OPEN" ;
const std::string PCK_KEY_OPEN2 = "OPEN2" ;
// Per FlatParts (Nesting)
const std::string NST_PARTREG_LAYER = "Region" ;
const std::string NST_PARTREG_ORIG_LAYER = "Region.orig" ;
+176
View File
@@ -20,6 +20,7 @@
#include "GeoTools.h"
#include "/EgtDev/Include/EXeExecutor.h"
#include "/EgtDev/Include/EXeConst.h"
#include "/EgtDev/Include/EGkGeoCollection.h"
#include "/EgtDev/Include/EGkCurveLine.h"
#include "/EgtDev/Include/EGkLinePntTgCurve.h"
#include "/EgtDev/Include/EGkLinePntPerpCurve.h"
@@ -42,9 +43,11 @@
#include "/EgtDev/Include/EGkCurveByApprox.h"
#include "/EgtDev/Include/EGkCurveAux.h"
#include "/EgtDev/Include/EGkOffsetCurve.h"
#include "/EgtDev/Include/EGkOffsetCurve3d.h"
#include "/EgtDev/Include/EGkCurveLocal.h"
#include "/EgtDev/Include/EGkSurfTriMesh.h"
#include "/EgtDev/Include/EGkDistPointCurve.h"
#include "/EgtDev/Include/EGkProjectCurveSurf.h"
#include "/EgtDev/Include/EGkStringUtils3d.h"
#include "/EgtDev/Include/EgtPointerOwner.h"
@@ -2634,3 +2637,176 @@ CalcExtrusion( IGeomDB* pGeomDB, int nParentId, int nRefType)
vtExtr.LocToLoc( pGeomDB->GetGridFrame(), frEnt) ;
return vtExtr ;
}
//----------------------------------------------------------------------------
int
ExeOffsetCurveAdv( int nId, double dDist, int nType, int* pnCount, double dLinTol)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
// recupero la curva
const ICurve* pCurve = GetCurve( pGeomDB->GetGeoObj( nId)) ;
// eseguo l'offset
OffsetCurve OffsCrv( dLinTol) ;
bool bOk = OffsCrv.Make( pCurve, dDist, nType) ;
// salvo le curve di offset
int nRefId = nId ;
int nCount = 0 ;
int nFirstId = GDB_ID_NULL ;
PtrOwner<ICurve> pOffs( OffsCrv.GetLongerCurve()) ;
while ( bOk && ! IsNull( pOffs)) {
// inserisco la curva nel DB geometrico
int nNewId = pGeomDB->InsertGeoObj( GDB_ID_NULL, nRefId, GDB_AFTER, Release( pOffs)) ;
// copio gli attributi
pGeomDB->CopyAttributes( nId, nNewId) ;
// aggiorno contatori
if ( nNewId != GDB_ID_NULL)
++ nCount ;
if ( nFirstId == GDB_ID_NULL)
nFirstId = nNewId ;
// aggiorno Id di riferimento per inserimento
if ( nNewId != GDB_ID_NULL)
nRefId = nNewId ;
// passo alla successiva
pOffs.Set( OffsCrv.GetLongerCurve()) ;
}
if ( bOk)
ExeSetModified() ;
else
nCount = - 1 ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua ;
sLua = "EgtOffsetCurveAdv(" + ToString( nId) + "," +
ToString( dDist) + "," +
OffsTypeToString( nType) + ")" +
" -- Id1=" + ToString( nFirstId) + ",Nbr=" + ToString( nCount) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco risultato
if ( pnCount != nullptr)
*pnCount = nCount ;
return nFirstId ;
}
//----------------------------------------------------------------------------
int
ExeCurveGetFatCurve( int nId, int nDestGrpId, double dRad, bool bSquareEnds, bool bSquareMids, int* pnCount)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
// recupero la curva
const ICurve* pCrv = GetCurve( pGeomDB->GetGeoObj( nId)) ;
if ( pCrv == nullptr)
return GDB_ID_NULL ;
// recupero il riferimento della curva
Frame3d frCrv ;
if ( ! pGeomDB->GetGlobFrame( nId, frCrv))
return GDB_ID_NULL ;
// recupero il riferimento di destinazione
Frame3d frDest ;
if ( ! pGeomDB->GetGroupGlobFrame( nDestGrpId, frDest))
return GDB_ID_NULL ;
// Calcolo la curva ingrossata
ICURVEPOVECTOR vCrv ;
CalcCurveFatCurve( *pCrv, vCrv, dRad, bSquareEnds, bSquareMids) ;
// inserisco i risultati nel DB geometrico
int nFirstId = GDB_ID_NULL ;
int nCount = 0 ;
for ( int i = 0 ; i < int( vCrv.size()) ; i++) {
vCrv[i]->LocToLoc( frCrv, frDest) ;
int nId = pGeomDB->AddGeoObj( GDB_ID_NULL, nDestGrpId, Release( vCrv[i])) ;
if ( nId != GDB_ID_NULL) {
nCount ++ ;
if ( nFirstId == GDB_ID_NULL)
nFirstId = nId ;
}
}
ExeSetModified() ;
if ( IsCmdLog()) {
string sLua = "EgtCurveGetFatCurve(" + ToString( nId) + "," +
ToString( nDestGrpId) + ")" +
" FirstId=" + ToString( nFirstId) + " nCurveCount=" + ToString( nCount) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco risultati
if ( pnCount != nullptr)
*pnCount = nCount ;
return nFirstId ;
}
//----------------------------------------------------------------------------
int
ExeOffsetCurve3d( int nId, int nSurfId, double dDist, int nType, int* pnCount, double dLinTol)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
// recupero la curva
const ICurve* pCurve = GetCurve( pGeomDB->GetGeoObj( nId)) ;
if ( pCurve == nullptr)
return GDB_ID_NULL ;
// recupero la superficie
const ISurf* pSurf = GetSurf( pGeomDB->GetGeoObj( nSurfId)) ;
if ( pSurf == nullptr)
return GDB_ID_NULL ;
// proietto la curva sulla superficie in modo da ottenere tutte le normali della superficie lungo la curva proiettata
CISURFPVECTOR vpSurf ;
vpSurf.push_back( pSurf) ;
double dMaxSegLen = 2.5 ;
bool bSharpEdges = true ;
PNT5AXVECTOR vPt5ax ;
if ( ! ProjectCurveOnSurf( *pCurve, vpSurf, dLinTol, dMaxSegLen, bSharpEdges, vPt5ax))
return GDB_ID_NULL ;
PolyLine PL ;
VCT3DVECTOR vOffDir ;
for ( int i = 0 ; i < ssize( vPt5ax) ; ++i) {
PL.AddUPoint( i, vPt5ax[i].ptP) ;
vOffDir.push_back( vPt5ax[i].vtDir1) ;
}
// eseguo l'offset
OffsetCurve3d OffsCrv( dLinTol) ;
bool bOk = OffsCrv.Make( PL, vOffDir, dDist, nType) ;
// salvo le curve di offset
int nRefId = nId ;
int nCount = 0 ;
int nFirstId = GDB_ID_NULL ;
PtrOwner<ICurve> pOffs( OffsCrv.GetLongerCurve()) ;
while ( bOk && ! IsNull( pOffs)) {
// inserisco la curva nel DB geometrico
int nNewId = pGeomDB->InsertGeoObj( GDB_ID_NULL, nRefId, GDB_AFTER, Release( pOffs)) ;
// copio gli attributi
pGeomDB->CopyAttributes( nId, nNewId) ;
// aggiorno contatori
if ( nNewId != GDB_ID_NULL)
++ nCount ;
if ( nFirstId == GDB_ID_NULL)
nFirstId = nNewId ;
// aggiorno Id di riferimento per inserimento
if ( nNewId != GDB_ID_NULL)
nRefId = nNewId ;
// passo alla successiva
pOffs.Set( OffsCrv.GetLongerCurve()) ;
}
if ( bOk)
ExeSetModified() ;
else
nCount = - 1 ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua ;
sLua = "EgtOffsetCurveAdv(" + ToString( nId) + "," +
ToString( dDist) + "," +
OffsTypeToString( nType) + ")" +
" -- Id1=" + ToString( nFirstId) + ",Nbr=" + ToString( nCount) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco risultato
if ( pnCount != nullptr)
*pnCount = nCount ;
return nFirstId ;
}
+186 -1
View File
@@ -22,12 +22,13 @@
#include "/EgtDev/Include/EXeExecutor.h"
#include "/EgtDev/Include/EXeConst.h"
#include "/EgtDev/Include/EGkGeoPoint3d.h"
#include "/EgtDev/Include/EGkGeoPoint3d.h"
#include "/EgtDev/Include/EGkCurve.h"
#include "/EgtDev/Include/EGkCurveLocal.h"
#include "/EgtDev/Include/EGkCurveArc.h"
#include "/EgtDev/Include/EGkCurveBezier.h"
#include "/EgtDev/Include/EGkCurveComposite.h"
#include "/EgtDev/Include/EGkCurveAux.h"
#include "/EgtDev/Include/EGkMedialAxis.h"
#include "/EgtDev/Include/EGkDistPointCurve.h"
#include "/EgtDev/Include/EGkIntersCurves.h"
#include "/EgtDev/Include/EGkSurfFlatRegion.h"
@@ -923,4 +924,188 @@ ExeCopyParamRange( int nCrvId, double dUStart, double dUEnd, int nDestGrpId)
ExeSetModified() ;
return nSubCrvId ;
}
//----------------------------------------------------------------------------
int
ExeCurveMedialAxis( int nId)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
// recupero la curva
const ICurve* pCurve = GetCurve( pGeomDB->GetGeoObj( nId)) ;
// eseguo il calcolo
PolyLine PL ;
if ( ! CurveSimpleMedialAxis( pCurve, PL))
return GDB_ID_NULL ;
// creo la curva
PtrOwner<ICurveComposite> pCompo( CreateCurveComposite()) ;
if ( IsNull( pCompo) || ! pCompo->FromPolyLine( PL))
return GDB_ID_NULL ;
// la inserisco nel DB geometrico
int nNewId = pGeomDB->InsertGeoObj( GDB_ID_NULL, nId, GDB_AFTER, Release( pCompo)) ;
// copio gli attributi
pGeomDB->CopyAttributes( nId, nNewId) ;
// notifico la modifica
if ( nNewId != GDB_ID_NULL)
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua ;
sLua = "EgtCurveMedialAxis(" + ToString( nId) + ")" +
" -- Id=" + ToString( nNewId) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
return nNewId ;
}
//----------------------------------------------------------------------------
int
ExeCurveGetVoronoi( const INTVECTOR& vIds, int nDestGrpId, int nBound, int* pnCount)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
if ( vIds.empty())
return false ;
// recupero il riferimento della prima curva che sarà utilizzato da Voronoi
Frame3d frCrv ;
if ( ! pGeomDB->GetGlobFrame( vIds[0], frCrv))
return GDB_ID_NULL ;
// recupero il riferimento di destinazione
Frame3d frDest ;
if ( ! pGeomDB->GetGroupGlobFrame( nDestGrpId, frDest))
return GDB_ID_NULL ;
// Calcolo diagramma di Voronoi
ICURVEPOVECTOR vCrv ;
if ( int( vIds.size()) == 1) {
// recupero la curva
const ICurve* pCrv = GetCurve( pGeomDB->GetGeoObj( vIds[0])) ;
if ( pCrv == nullptr)
return GDB_ID_NULL ;
// calcolo
CalcCurveVoronoiDiagram( *pCrv, vCrv, nBound) ;
}
else {
// recupero le curve e le porto in locale al frame della prima curva
CICURVEPVECTOR vOrigCrvs ;
for ( int i = 0 ; i < int( vIds.size()) ; i ++) {
CurveLocal CrvLoc( pGeomDB, vIds[i], frCrv) ;
if ( CrvLoc.Get() == nullptr) {
for ( auto pCrv : vOrigCrvs)
delete( pCrv) ;
return GDB_ID_NULL ;
}
vOrigCrvs.emplace_back( CrvLoc->Clone()) ;
}
// calcolo
CalcCurvesVoronoiDiagram( vOrigCrvs, vCrv, nBound) ;
// libero la memoria
for ( auto pCrv : vOrigCrvs)
delete( pCrv) ;
}
// inserisco i risultati nel DB geometrico
int nFirstId = GDB_ID_NULL ;
int nCount = 0 ;
for ( int i = 0 ; i < int( vCrv.size()) ; i++) {
vCrv[i]->LocToLoc( frCrv, frDest) ;
int nId = pGeomDB->AddGeoObj( GDB_ID_NULL, nDestGrpId, Release( vCrv[i])) ;
if ( nId != GDB_ID_NULL) {
nCount ++ ;
if ( nFirstId == GDB_ID_NULL)
nFirstId = nId ;
}
}
ExeSetModified() ;
if ( IsCmdLog()) {
string sLua = "EgtCurveGetVoronoi({" + ToString( vIds) + "}," +
ToString( nDestGrpId) + ")" +
" FirstId=" + ToString( nFirstId) + " nCurveCount=" + ToString( nCount) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco risultati
if ( pnCount != nullptr)
*pnCount = nCount ;
return nFirstId ;
}
//----------------------------------------------------------------------------
int
ExeCurveGetMedialAxis( const INTVECTOR& vIds, int nDestGrpId, int nSide, int* pnCount)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
if ( vIds.empty())
return false ;
// recupero il riferimento della prima curva che sarà utilizzato da Voronoi
Frame3d frCrv ;
if ( ! pGeomDB->GetGlobFrame( vIds[0], frCrv))
return GDB_ID_NULL ;
// recupero il riferimento di destinazione
Frame3d frDest ;
if ( ! pGeomDB->GetGroupGlobFrame( nDestGrpId, frDest))
return GDB_ID_NULL ;
// Calcolo il Medial Axis
ICURVEPOVECTOR vCrv ;
if ( int( vIds.size()) == 1) {
// recupero la curva
const ICurve* pCrv = GetCurve( pGeomDB->GetGeoObj( vIds[0])) ;
if ( pCrv == nullptr)
return GDB_ID_NULL ;
// calcolo
CalcCurveMedialAxis( *pCrv, vCrv, nSide) ;
}
else {
// recupero le curve e le porto in locale al frame della prima curva
CICURVEPVECTOR vOrigCrvs ;
for ( int i = 0 ; i < int( vIds.size()) ; i ++) {
CurveLocal CrvLoc( pGeomDB, vIds[i], frCrv) ;
if ( CrvLoc.Get() == nullptr) {
for ( auto pCrv : vOrigCrvs)
delete( pCrv) ;
return GDB_ID_NULL ;
}
vOrigCrvs.emplace_back( CrvLoc->Clone()) ;
}
// calcolo
CalcCurvesMedialAxis( vOrigCrvs, vCrv, nSide) ;
// libero la memoria
for ( auto pCrv : vOrigCrvs)
delete( pCrv) ;
}
// inserisco i risultati nel DB geometrico
int nFirstId = GDB_ID_NULL ;
int nCount = 0 ;
for ( int i = 0 ; i < int( vCrv.size()) ; i++) {
vCrv[i]->LocToLoc( frCrv, frDest) ;
int nId = pGeomDB->AddGeoObj( GDB_ID_NULL, nDestGrpId, Release( vCrv[i])) ;
if ( nId != GDB_ID_NULL) {
nCount ++ ;
if ( nFirstId == GDB_ID_NULL)
nFirstId = nId ;
}
}
ExeSetModified() ;
if ( IsCmdLog()) {
string sLua = "EgtCurveMedialAxisAdv(" + ToString( vIds[0]) + "," +
ToString( nSide) + "," +
ToString( nDestGrpId) + ")" +
" FirstId=" + ToString( nFirstId) + " nCurveCount=" + ToString( nCount) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco risultati
if ( pnCount != nullptr)
*pnCount = nCount ;
return nFirstId ;
}
+21 -4
View File
@@ -14,6 +14,7 @@
//--------------------------- Include ----------------------------------------
#include "stdafx.h"
#include "EXE.h"
#include "EXE_Const.h"
#include "EXE_Macro.h"
#include "/EgtDev/Include/EXeExecutor.h"
#include "/EgtDev/Include/EGkSfrCreate.h"
@@ -31,16 +32,32 @@ ExePocketing( int nId, double dRad, double dStep, double dAngle, int nType, bool
VERIFY_GEOMDB( pGeomDB, false) ;
// recupero la FlatRegion da svuotare
PtrOwner<ISurfFlatRegion> pMySfr ;
const ISurfFlatRegion* pSfr = GetSurfFlatRegion( pGeomDB->GetGeoObj( nId)) ;
PtrOwner<ISurfFlatRegion> pMySfr ;
// altrimenti verifico se curva chiusa e piana
if ( pSfr == nullptr) {
// verifico se è una curva chiusa e piana che permette di definire una regione
const ICurve* pCrv = GetCurve( pGeomDB->GetGeoObj( nId)) ;
Plane3d plPlane ;
if ( pCrv == nullptr || ! pCrv->IsFlat( plPlane, true, 10 * EPS_SMALL))
return false ;
// ne faccio una copia
PtrOwner<ICurveComposite> pCompo( ConvertCurveToComposite( pCrv->Clone())) ;
for ( int i = 0 ; i < pCompo->GetCurveCount() ; ++ i)
pCompo->SetCurveTempProp( i, 0) ;
// recupero eventuali info sui lati aperti
INTVECTOR vOpen ;
if ( pGeomDB->GetInfo( nId, PCK_KEY_OPEN, vOpen)) {
for ( int i : vOpen)
pCompo->SetCurveTempProp( i, 1) ;
}
else if ( pGeomDB->GetInfo( nId, PCK_KEY_OPEN2, vOpen)) {
for ( int i : vOpen)
pCompo->SetCurveTempProp( i, 2) ;
}
// creo la flat region
SurfFlatRegionByContours SfrCntr ;
SfrCntr.AddCurve( pCrv->Clone()) ;
SfrCntr.AddCurve( Release( pCompo)) ;
pMySfr.Set( SfrCntr.GetSurf()) ;
if ( IsNull( pMySfr))
return false ;
@@ -59,8 +76,8 @@ ExePocketing( int nId, double dRad, double dStep, double dAngle, int nType, bool
// eseguo Pocketing
ICRVCOMPOPOVECTOR vCrvCompoRes ;
bool bOk = CalcPocketing( pSfr, dRad, 0, dStep, dAngle, 5., nType, bSmooth, true, false, false, true, false, true, P_INVALID, nullptr, false,
dStep, 0, INFINITO, 0, 0, INFINITO, false, 0., 0., false, vCrvCompoRes) ;
bool bOk = CalcPocketing( pSfr, dRad, 0, dStep, dAngle, 0, nType, bSmooth, true, false, false, true, false, false, true, P_INVALID, nullptr,
false, dStep, 0, INFINITO, 0, 0, INFINITO, false, 0., 0., false, vCrvCompoRes) ;
nFirstId = GDB_ID_NULL ;
nCrvCount = int( vCrvCompoRes.size()) ;
if ( bOk && nCrvCount > 0) {
+3 -288
View File
@@ -32,7 +32,6 @@
#include "/EgtDev/Include/EGkSurfLocal.h"
#include "/EgtDev/Include/EGkCurveAux.h"
#include "/EgtDev/Include/EGkOffsetCurve.h"
#include "/EgtDev/Include/EGkMedialAxis.h"
#include "/EgtDev/Include/EGkChainCurves.h"
#include "/EgtDev/Include/EGkProjectCurveSurf.h"
#include "/EgtDev/Include/EGkSurfFlatRegion.h"
@@ -103,90 +102,6 @@ ExeOffsetCurve( int nId, double dDist, int nType)
return bOk ;
}
//----------------------------------------------------------------------------
int
ExeOffsetCurveAdv( int nId, double dDist, int nType, int* pnCount, double dLinTol)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
// recupero la curva
const ICurve* pCurve = GetCurve( pGeomDB->GetGeoObj( nId)) ;
// eseguo l'offset
OffsetCurve OffsCrv( dLinTol) ;
bool bOk = OffsCrv.Make( pCurve, dDist, nType) ;
// salvo le curve di offset
int nRefId = nId ;
int nCount = 0 ;
int nFirstId = GDB_ID_NULL ;
PtrOwner<ICurve> pOffs( OffsCrv.GetLongerCurve()) ;
while ( bOk && ! IsNull( pOffs)) {
// inserisco la curva nel DB geometrico
int nNewId = pGeomDB->InsertGeoObj( GDB_ID_NULL, nRefId, GDB_AFTER, Release( pOffs)) ;
// copio gli attributi
pGeomDB->CopyAttributes( nId, nNewId) ;
// aggiorno contatori
if ( nNewId != GDB_ID_NULL)
++ nCount ;
if ( nFirstId == GDB_ID_NULL)
nFirstId = nNewId ;
// aggiorno Id di riferimento per inserimento
if ( nNewId != GDB_ID_NULL)
nRefId = nNewId ;
// passo alla successiva
pOffs.Set( OffsCrv.GetLongerCurve()) ;
}
if ( bOk)
ExeSetModified() ;
else
nCount = - 1 ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua ;
sLua = "EgtOffsetCurveAdv(" + ToString( nId) + "," +
ToString( dDist) + "," +
OffsTypeToString( nType) + ")" +
" -- Id1=" + ToString( nFirstId) + ",Nbr=" + ToString( nCount) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco risultato
if ( pnCount != nullptr)
*pnCount = nCount ;
return nFirstId ;
}
//----------------------------------------------------------------------------
int
ExeCurveMedialAxis( int nId)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
// recupero la curva
const ICurve* pCurve = GetCurve( pGeomDB->GetGeoObj( nId)) ;
// eseguo il calcolo
PolyLine PL ;
if ( ! CurveSimpleMedialAxis( pCurve, PL))
return GDB_ID_NULL ;
// creo la curva
PtrOwner<ICurveComposite> pCompo( CreateCurveComposite()) ;
if ( IsNull( pCompo) || ! pCompo->FromPolyLine( PL))
return GDB_ID_NULL ;
// la inserisco nel DB geometrico
int nNewId = pGeomDB->InsertGeoObj( GDB_ID_NULL, nId, GDB_AFTER, Release( pCompo)) ;
// copio gli attributi
pGeomDB->CopyAttributes( nId, nNewId) ;
// notifico la modifica
if ( nNewId != GDB_ID_NULL)
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua ;
sLua = "EgtCurveMedialAxis(" + ToString( nId) + ")" +
" -- Id=" + ToString( nNewId) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
return nNewId ;
}
//-------------------------------------------------------------------------------
bool
ExeApproxCurve( int nId, int nApprType, double dLinTol, double dMaxSegmLen)
@@ -2462,8 +2377,9 @@ MyProjectCurveOnSurf( int nCurveId, const INTVECTOR& vnSurfId, int nDestGrpId,
return false ;
// recupero il riferimento della prima superficie
Frame3d frSurf ;
if ( ! pGeomDB->GetGlobFrame( vnSurfId[0], frSurf))
return false ;
//if ( ! pGeomDB->GetGlobFrame( vnSurfId[0], frSurf))
// return false ;
// recupero le superfici e le porto tutte in locale alla prima
SURFLOCALVECTOR vSurfL ; vSurfL.reserve( vnSurfId.size()) ;
CISURFPVECTOR vpSurf ; vpSurf.reserve( vnSurfId.size()) ;
@@ -2785,207 +2701,6 @@ ExeProjectCurveOnSurfExt( int nCurveId, const INTVECTOR& vnSurfId, int nGuideId,
return bOk ;
}
//----------------------------------------------------------------------------
int
ExeCurveGetVoronoi( const INTVECTOR& vIds, int nDestGrpId, int nBound, int* pnCount)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
if ( vIds.empty())
return false ;
// recupero il riferimento della prima curva che sarà utilizzato da Voronoi
Frame3d frCrv ;
if ( ! pGeomDB->GetGlobFrame( vIds[0], frCrv))
return GDB_ID_NULL ;
// recupero il riferimento di destinazione
Frame3d frDest ;
if ( ! pGeomDB->GetGroupGlobFrame( nDestGrpId, frDest))
return GDB_ID_NULL ;
// Calcolo diagramma di Voronoi
ICURVEPOVECTOR vCrv ;
if ( int( vIds.size()) == 1) {
// recupero la curva
const ICurve* pCrv = GetCurve( pGeomDB->GetGeoObj( vIds[0])) ;
if ( pCrv == nullptr)
return GDB_ID_NULL ;
// calcolo
CalcCurveVoronoiDiagram( *pCrv, vCrv, nBound) ;
}
else {
// recupero le curve e le porto in locale al frame della prima curva
CICURVEPVECTOR vOrigCrvs ;
for ( int i = 0 ; i < int( vIds.size()) ; i ++) {
CurveLocal CrvLoc( pGeomDB, vIds[i], frCrv) ;
if ( CrvLoc.Get() == nullptr) {
for ( auto pCrv : vOrigCrvs)
delete( pCrv) ;
return GDB_ID_NULL ;
}
vOrigCrvs.emplace_back( CrvLoc->Clone()) ;
}
// calcolo
CalcCurvesVoronoiDiagram( vOrigCrvs, vCrv, nBound) ;
// libero la memoria
for ( auto pCrv : vOrigCrvs)
delete( pCrv) ;
}
// inserisco i risultati nel DB geometrico
int nFirstId = GDB_ID_NULL ;
int nCount = 0 ;
for ( int i = 0 ; i < int( vCrv.size()) ; i++) {
vCrv[i]->LocToLoc( frCrv, frDest) ;
int nId = pGeomDB->AddGeoObj( GDB_ID_NULL, nDestGrpId, Release( vCrv[i])) ;
if ( nId != GDB_ID_NULL) {
nCount ++ ;
if ( nFirstId == GDB_ID_NULL)
nFirstId = nId ;
}
}
ExeSetModified() ;
if ( IsCmdLog()) {
string sLua = "EgtCurveGetVoronoi({" + ToString( vIds) + "}," +
ToString( nDestGrpId) + ")" +
" FirstId=" + ToString( nFirstId) + " nCurveCount=" + ToString( nCount) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco risultati
if ( pnCount != nullptr)
*pnCount = nCount ;
return nFirstId ;
}
//----------------------------------------------------------------------------
int
ExeCurveGetMedialAxis( const INTVECTOR& vIds, int nDestGrpId, int nSide, int* pnCount)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
if ( vIds.empty())
return false ;
// recupero il riferimento della prima curva che sarà utilizzato da Voronoi
Frame3d frCrv ;
if ( ! pGeomDB->GetGlobFrame( vIds[0], frCrv))
return GDB_ID_NULL ;
// recupero il riferimento di destinazione
Frame3d frDest ;
if ( ! pGeomDB->GetGroupGlobFrame( nDestGrpId, frDest))
return GDB_ID_NULL ;
// Calcolo il Medial Axis
ICURVEPOVECTOR vCrv ;
if ( int( vIds.size()) == 1) {
// recupero la curva
const ICurve* pCrv = GetCurve( pGeomDB->GetGeoObj( vIds[0])) ;
if ( pCrv == nullptr)
return GDB_ID_NULL ;
// calcolo
CalcCurveMedialAxis( *pCrv, vCrv, nSide) ;
}
else {
// recupero le curve e le porto in locale al frame della prima curva
CICURVEPVECTOR vOrigCrvs ;
for ( int i = 0 ; i < int( vIds.size()) ; i ++) {
CurveLocal CrvLoc( pGeomDB, vIds[i], frCrv) ;
if ( CrvLoc.Get() == nullptr) {
for ( auto pCrv : vOrigCrvs)
delete( pCrv) ;
return GDB_ID_NULL ;
}
vOrigCrvs.emplace_back( CrvLoc->Clone()) ;
}
// calcolo
CalcCurvesMedialAxis( vOrigCrvs, vCrv, nSide) ;
// libero la memoria
for ( auto pCrv : vOrigCrvs)
delete( pCrv) ;
}
// inserisco i risultati nel DB geometrico
int nFirstId = GDB_ID_NULL ;
int nCount = 0 ;
for ( int i = 0 ; i < int( vCrv.size()) ; i++) {
vCrv[i]->LocToLoc( frCrv, frDest) ;
int nId = pGeomDB->AddGeoObj( GDB_ID_NULL, nDestGrpId, Release( vCrv[i])) ;
if ( nId != GDB_ID_NULL) {
nCount ++ ;
if ( nFirstId == GDB_ID_NULL)
nFirstId = nId ;
}
}
ExeSetModified() ;
if ( IsCmdLog()) {
string sLua = "EgtCurveMedialAxisAdv(" + ToString( vIds[0]) + "," +
ToString( nSide) + "," +
ToString( nDestGrpId) + ")" +
" FirstId=" + ToString( nFirstId) + " nCurveCount=" + ToString( nCount) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco risultati
if ( pnCount != nullptr)
*pnCount = nCount ;
return nFirstId ;
}
//----------------------------------------------------------------------------
int
ExeCurveGetFatCurve( int nId, int nDestGrpId, double dRad, bool bSquareEnds, bool bSquareMids, int* pnCount)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
// recupero la curva
const ICurve* pCrv = GetCurve( pGeomDB->GetGeoObj( nId)) ;
if ( pCrv == nullptr)
return GDB_ID_NULL ;
// recupero il riferimento della curva
Frame3d frCrv ;
if ( ! pGeomDB->GetGlobFrame( nId, frCrv))
return GDB_ID_NULL ;
// recupero il riferimento di destinazione
Frame3d frDest ;
if ( ! pGeomDB->GetGroupGlobFrame( nDestGrpId, frDest))
return GDB_ID_NULL ;
// Calcolo la curva ingrossata
ICURVEPOVECTOR vCrv ;
CalcCurveFatCurve( *pCrv, vCrv, dRad, bSquareEnds, bSquareMids) ;
// inserisco i risultati nel DB geometrico
int nFirstId = GDB_ID_NULL ;
int nCount = 0 ;
for ( int i = 0 ; i < int( vCrv.size()) ; i++) {
vCrv[i]->LocToLoc( frCrv, frDest) ;
int nId = pGeomDB->AddGeoObj( GDB_ID_NULL, nDestGrpId, Release( vCrv[i])) ;
if ( nId != GDB_ID_NULL) {
nCount ++ ;
if ( nFirstId == GDB_ID_NULL)
nFirstId = nId ;
}
}
ExeSetModified() ;
if ( IsCmdLog()) {
string sLua = "EgtCurveGetFatCurve(" + ToString( nId) + "," +
ToString( nDestGrpId) + ")" +
" FirstId=" + ToString( nFirstId) + " nCurveCount=" + ToString( nCount) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco risultati
if ( pnCount != nullptr)
*pnCount = nCount ;
return nFirstId ;
}
//----------------------------------------------------------------------------
bool
ExeCurveBezierIncreaseDegree( int nCrvId)
+16
View File
@@ -15,6 +15,7 @@
#include "stdafx.h"
#include "EXE.h"
#include "EXE_Macro.h"
#include "AuxDialogBox.h"
#include "/EgtDev/Include/EXeExecutor.h"
#include "/EgtDev/Include/EGkStringUtils3d.h"
#include "/EgtDev/Include/EgtStringConverter.h"
@@ -76,6 +77,9 @@ ExeSelectObj( int nId)
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// verifico se presente un dialogo modeless per aggiornare i valori
if ( bOk && phDlgModeless != nullptr && nDlgModelessItem != -1)
UpdateIdsModelessDialog( phDlgModeless, nDlgModelessItem) ;
// restituisco risultato
return bOk ;
}
@@ -100,6 +104,9 @@ ExeDeselectObj( int nId)
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// verifico se presente un dialogo modeless per aggiornare i valori
if ( bOk && phDlgModeless != nullptr && nDlgModelessItem != -1)
UpdateIdsModelessDialog( phDlgModeless, nDlgModelessItem) ;
// restituisco risultato
return bOk ;
}
@@ -160,6 +167,9 @@ ExeDeselectAll( void)
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// verifico se presente un dialogo modeless per aggiornare i valori
if ( bOk && phDlgModeless != nullptr && nDlgModelessItem != -1)
UpdateIdsModelessDialog( phDlgModeless, nDlgModelessItem) ;
// restituisco risultato
return bOk ;
}
@@ -186,6 +196,9 @@ ExeSelectGroupObjs( int nGroupId)
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// verifico se presente un dialogo modeless per aggiornare i valori
if ( bOk && phDlgModeless != nullptr && nDlgModelessItem != -1)
UpdateIdsModelessDialog( phDlgModeless, nDlgModelessItem) ;
// restituisco risultato
return bOk ;
}
@@ -209,6 +222,9 @@ ExeDeselectGroupObjs( int nGroupId)
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// verifico se presente un dialogo modeless per aggiornare i valori
if ( bOk && phDlgModeless != nullptr && nDlgModelessItem != -1)
UpdateIdsModelessDialog( phDlgModeless, nDlgModelessItem) ;
// restituisco risultato
return bOk ;
}
BIN
View File
Binary file not shown.
+2
View File
@@ -228,6 +228,7 @@ copy $(TargetPath) \EgtProg\Dll64</Command>
<ClInclude Include="..\Include\EXeConst.h" />
<ClInclude Include="..\Include\EXeDllMain.h" />
<ClInclude Include="..\Include\EXeExecutor.h" />
<ClInclude Include="AuxDialogBox.h" />
<ClInclude Include="DllExch3dm.h" />
<ClInclude Include="DllMain.h" />
<ClInclude Include="DllNesting.h" />
@@ -249,6 +250,7 @@ copy $(TargetPath) \EgtProg\Dll64</Command>
<ClInclude Include="stdafx.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="AuxDialogBox.cpp" />
<ClCompile Include="DllExch3dm.cpp" />
<ClCompile Include="DllNesting.cpp" />
<ClCompile Include="EXE_Base64.cpp" />
+6
View File
@@ -111,6 +111,9 @@
<ClInclude Include="DllExch3dm.h">
<Filter>File di intestazione</Filter>
</ClInclude>
<ClInclude Include="AuxDialogBox.h">
<Filter>File di intestazione</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="LUA_Exchange.cpp">
@@ -431,6 +434,9 @@
<ClCompile Include="LUA_Base64.cpp">
<Filter>File di origine\LUA</Filter>
</ClCompile>
<ClCompile Include="AuxDialogBox.cpp">
<Filter>File di origine\Global</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="EgtExecutor.rc">
+90
View File
@@ -18,6 +18,7 @@
#include "/EgtDev/Include/EXeConst.h"
#include "/EgtDev/Include/EGkGdbConst.h"
#include "/EgtDev/Include/EGkLuaAux.h"
#include "/EgtDev/Include/EGkCurve.h"
using namespace std ;
@@ -1112,6 +1113,92 @@ LuaCreateCirclesAlongCurve( lua_State* L)
return 2 ;
}
//-------------------------------------------------------------------------------
static int
LuaOffsetCurveAdv( lua_State* L)
{
// 2 o 3 o 4 parametri : Id, dDist [, nType] [, dLinTol]
int nId ;
LuaCheckParam( L, 1, nId)
double dDist ;
LuaCheckParam( L, 2, dDist)
int nType = ICurve::OFF_FILLET ;
LuaGetParam( L, 3, nType) ;
double dLinTol = 10 * EPS_SMALL ;
LuaGetParam( L, 4, dLinTol) ;
LuaClearStack( L) ;
// offset della curva
int nCount ;
int nNewId = ExeOffsetCurveAdv( nId, dDist, nType, &nCount, dLinTol) ;
if ( nCount >= 0) {
LuaSetParam( L, nNewId) ;
LuaSetParam( L, nCount) ;
}
else {
LuaSetParam( L) ;
LuaSetParam( L, nCount) ;
}
return 2 ;
}
//----------------------------------------------------------------------------
static int
LuaCurveGetFatCurve( lua_State* L)
{
// 4 o 5 parametri : Id, nDestGrpId, dRad, bSquare [, bSquareMids]
int nId ;
LuaCheckParam( L, 1, nId)
int nDestGrpId ;
LuaCheckParam( L, 2, nDestGrpId)
double dRad ;
LuaCheckParam( L, 3, dRad)
bool bSquareEnds ;
LuaCheckParam( L, 4, bSquareEnds)
bool bSquareMids = bSquareEnds ;
LuaGetParam( L, 5, bSquareMids) ;
LuaClearStack( L) ;
// eseguo
int nCount = 0 ;
int nNewId = ExeCurveGetFatCurve( nId, nDestGrpId, dRad, bSquareEnds, bSquareMids, &nCount) ;
if ( nNewId != GDB_ID_NULL)
LuaSetParam( L, nNewId) ;
else
LuaSetParam( L) ;
LuaSetParam( L, nCount) ;
return 2 ;
}
//-------------------------------------------------------------------------------
static int
LuaOffsetCurve3d( lua_State* L)
{
// 3 o 4 o 5 parametri : Id, SurfId, dDist [, nType] [, dLinTol]
int nId ;
LuaCheckParam( L, 1, nId)
int nSurfId ;
LuaCheckParam( L, 2, nSurfId)
double dDist ;
LuaCheckParam( L, 3, dDist)
int nType = ICurve::OFF_FILLET ;
LuaGetParam( L, 4, nType) ;
double dLinTol = 10 * EPS_SMALL ;
LuaGetParam( L, 5, dLinTol) ;
LuaClearStack( L) ;
// offset della curva
int nCount ;
int nNewId = ExeOffsetCurve3d( nId, nSurfId, dDist, nType, &nCount, dLinTol) ;
if ( nCount >= 0) {
LuaSetParam( L, nNewId) ;
LuaSetParam( L, nCount) ;
}
else {
LuaSetParam( L) ;
LuaSetParam( L, nCount) ;
}
return 2 ;
}
//-------------------------------------------------------------------------------
bool
LuaInstallGdbCreateCurve( LuaMgr& luaMgr)
@@ -1157,5 +1244,8 @@ LuaInstallGdbCreateCurve( LuaMgr& luaMgr)
bOk = bOk && luaMgr.RegisterFunction( "EgtPolygonFromApothem", LuaCreatePolygonFromApothem) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtPolygonFromSide", LuaCreatePolygonFromSide) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCirclesAlongCurve", LuaCreateCirclesAlongCurve) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtOffsetCurveAdv", LuaOffsetCurveAdv) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveGetFatCurve", LuaCurveGetFatCurve) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtOffsetCurve3d", LuaOffsetCurve3d) ;
return bOk ;
}
+68
View File
@@ -673,6 +673,71 @@ LuaCopyParamRange( lua_State* L)
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaCurveMedialAxis( lua_State* L)
{
// 1 parametro : Id
int nId ;
LuaCheckParam( L, 1, nId)
LuaClearStack( L) ;
// calcolo del Medial Axis della curva
int nNewId = ExeCurveMedialAxis( nId) ;
if ( nNewId != GDB_ID_NULL)
LuaSetParam( L, nNewId) ;
else
LuaSetParam( L) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaCurveMedialAxisAdv( lua_State* L)
{
// 2 o 3 parametri : Id/s, nDestGrpId [, nSide]
INTVECTOR vIds ;
LuaCheckParam( L, 1, vIds)
int nDestGrpId ;
LuaCheckParam( L, 2, nDestGrpId)
int nSide = 1 ; // WMAT_LEFT
LuaGetParam( L, 3, nSide) ;
LuaClearStack( L) ;
// eseguo
int nCount = 0 ;
int nNewId = ExeCurveGetMedialAxis( vIds, nDestGrpId, nSide, &nCount) ;
if ( nNewId != GDB_ID_NULL)
LuaSetParam( L, nNewId) ;
else
LuaSetParam( L) ;
LuaSetParam( L, nCount) ;
return 2 ;
}
//----------------------------------------------------------------------------
static int
LuaCurveGetVoronoi( lua_State* L)
{
// 2 o 3 parametri : Id/s, nDestGrpId [, nBound]
INTVECTOR vIds ;
LuaCheckParam( L, 1, vIds)
int nDestGrpId ;
LuaCheckParam( L, 2, nDestGrpId)
int nBound = 3 ; // VORONOI_STD_BOUND
LuaGetParam( L, 3, nBound) ;
LuaClearStack( L) ;
// eseguo
int nCount = 0 ;
int nNewId = ExeCurveGetVoronoi( vIds, nDestGrpId, nBound, &nCount) ;
if ( nNewId != GDB_ID_NULL)
LuaSetParam( L, nNewId) ;
else
LuaSetParam( L) ;
LuaSetParam( L, nCount) ;
return 2 ;
}
//-------------------------------------------------------------------------------
bool
LuaInstallGdbGetCurve( LuaMgr& luaMgr)
@@ -711,5 +776,8 @@ LuaInstallGdbGetCurve( LuaMgr& luaMgr)
bOk = bOk && luaMgr.RegisterFunction( "EgtShowCurveBezierControlPoints", LuaShowCurveBezierControlPoints) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCopyCompoSubCurve", LuaCopyCompoSubCurve) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCopyParamRange", LuaCopyParamRange) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveMedialAxis", LuaCurveMedialAxis) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveGetVoronoi", LuaCurveGetVoronoi) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveMedialAxisAdv", LuaCurveMedialAxisAdv) ;
return bOk ;
}
-126
View File
@@ -56,51 +56,6 @@ LuaOffsetCurve( lua_State* L)
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaOffsetCurveAdv( lua_State* L)
{
// 2 o 3 o 4 parametri : Id, dDist [, nType] [, dLinTol]
int nId ;
LuaCheckParam( L, 1, nId)
double dDist ;
LuaCheckParam( L, 2, dDist)
int nType = ICurve::OFF_FILLET ;
LuaGetParam( L, 3, nType) ;
double dLinTol = 10 * EPS_SMALL ;
LuaGetParam( L, 4, dLinTol) ;
LuaClearStack( L) ;
// offset della curva
int nCount ;
int nNewId = ExeOffsetCurveAdv( nId, dDist, nType, &nCount, dLinTol) ;
if ( nCount >= 0) {
LuaSetParam( L, nNewId) ;
LuaSetParam( L, nCount) ;
}
else {
LuaSetParam( L) ;
LuaSetParam( L, nCount) ;
}
return 2 ;
}
//-------------------------------------------------------------------------------
static int
LuaCurveMedialAxis( lua_State* L)
{
// 1 parametro : Id
int nId ;
LuaCheckParam( L, 1, nId)
LuaClearStack( L) ;
// calcolo del Medial Axis della curva
int nNewId = ExeCurveMedialAxis( nId) ;
if ( nNewId != GDB_ID_NULL)
LuaSetParam( L, nNewId) ;
else
LuaSetParam( L) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaApproxCurve( lua_State* L)
@@ -1089,82 +1044,6 @@ LuaProjectCurveOnSurfExt( lua_State* L)
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaCurveGetVoronoi( lua_State* L)
{
// 2 o 3 parametri : Id/s, nDestGrpId [, nBound]
INTVECTOR vIds ;
LuaCheckParam( L, 1, vIds)
int nDestGrpId ;
LuaCheckParam( L, 2, nDestGrpId)
int nBound = 3 ; // VORONOI_STD_BOUND
LuaGetParam( L, 3, nBound) ;
LuaClearStack( L) ;
// eseguo
int nCount = 0 ;
int nNewId = ExeCurveGetVoronoi( vIds, nDestGrpId, nBound, &nCount) ;
if ( nNewId != GDB_ID_NULL)
LuaSetParam( L, nNewId) ;
else
LuaSetParam( L) ;
LuaSetParam( L, nCount) ;
return 2 ;
}
//----------------------------------------------------------------------------
static int
LuaCurveMedialAxisAdv( lua_State* L)
{
// 2 o 3 parametri : Id/s, nDestGrpId [, nSide]
INTVECTOR vIds ;
LuaCheckParam( L, 1, vIds)
int nDestGrpId ;
LuaCheckParam( L, 2, nDestGrpId)
int nSide = 1 ; // WMAT_LEFT
LuaGetParam( L, 3, nSide) ;
LuaClearStack( L) ;
// eseguo
int nCount = 0 ;
int nNewId = ExeCurveGetMedialAxis( vIds, nDestGrpId, nSide, &nCount) ;
if ( nNewId != GDB_ID_NULL)
LuaSetParam( L, nNewId) ;
else
LuaSetParam( L) ;
LuaSetParam( L, nCount) ;
return 2 ;
}
//----------------------------------------------------------------------------
static int
LuaCurveGetFatCurve( lua_State* L)
{
// 4 o 5 parametri : Id, nDestGrpId, dRad, bSquare [, bSquareMids]
int nId ;
LuaCheckParam( L, 1, nId)
int nDestGrpId ;
LuaCheckParam( L, 2, nDestGrpId)
double dRad ;
LuaCheckParam( L, 3, dRad)
bool bSquareEnds ;
LuaCheckParam( L, 4, bSquareEnds)
bool bSquareMids = bSquareEnds ;
LuaGetParam( L, 5, bSquareMids) ;
LuaClearStack( L) ;
// eseguo
int nCount = 0 ;
int nNewId = ExeCurveGetFatCurve( nId, nDestGrpId, dRad, bSquareEnds, bSquareMids, &nCount) ;
if ( nNewId != GDB_ID_NULL)
LuaSetParam( L, nNewId) ;
else
LuaSetParam( L) ;
LuaSetParam( L, nCount) ;
return 2 ;
}
//----------------------------------------------------------------------------
static int
LuaCurveBezierIncreaseDegree( lua_State* L)
@@ -1236,8 +1115,6 @@ LuaInstallGdbModifyCurve( LuaMgr& luaMgr)
bool bOk = ( &luaMgr != nullptr) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtInvertCurve", LuaInvertCurve) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtOffsetCurve", LuaOffsetCurve) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtOffsetCurveAdv", LuaOffsetCurveAdv) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveMedialAxis", LuaCurveMedialAxis) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtApproxCurve", LuaApproxCurve) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtProjectCurveOnPlane", LuaProjectCurveOnPlane) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtChangeClosedCurveStart", LuaChangeClosedCurveStart) ;
@@ -1290,9 +1167,6 @@ LuaInstallGdbModifyCurve( LuaMgr& luaMgr)
bOk = bOk && luaMgr.RegisterFunction( "EgtProjectCurveOnSurf", LuaProjectCurveOnSurf) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtProjectCurveOnSurfDir", LuaProjectCurveOnSurfDir) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtProjectCurveOnSurfExt", LuaProjectCurveOnSurfExt) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveGetVoronoi", LuaCurveGetVoronoi) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveMedialAxisAdv", LuaCurveMedialAxisAdv) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveGetFatCurve", LuaCurveGetFatCurve) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveBezierIncreaseDeg", LuaCurveBezierIncreaseDegree) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveBezierDecreaseDeg", LuaCurveBezierDecreaseDegree) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveBezierApproxToNonRat", LuaCurveBezierApproxToNonRat) ;
+455 -96
View File
@@ -1,4 +1,4 @@
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
// EgalTech 2014-2014
//----------------------------------------------------------------------------
// File : LUA_General.cpp Data : 27.09.14 Versione : 1.5i5
@@ -18,6 +18,7 @@
#include "LUA.h"
#include "GenTools.h"
#include "resource.h"
#include "AuxDialogBox.h"
#include "/EgtDev/Include/ExeExecutor.h"
#include "/EgtDev/Include/EGkLuaAux.h"
#include "/EgtDev/Include/EGkStringUtils3d.h"
@@ -118,7 +119,7 @@ LuaGetKeyPressed( lua_State* L)
int nKeyCode ;
LuaCheckParam( L, 1, nKeyCode)
LuaClearStack( L) ;
// se abilitata UI, controllo se il tasto indicato è premuto
// se abilitata UI, controllo se il tasto indicato è premuto
bool bPressed = false ;
if ( ExeGetEnableUI()) {
bPressed = (( GetAsyncKeyState( nKeyCode) & 0x8000) != 0) ;
@@ -181,7 +182,7 @@ LuaSplitString( lua_State* L)
LuaClearStack( L) ;
// se ricevuta stringa, la divido in parti separate da sSep
if ( bFound) {
// eseguo separazione (se tra i separatori c'è spazio ora tokenize collassa eventuali spazi consecutivi in uno solo)
// eseguo separazione (se tra i separatori c'è spazio ora tokenize collassa eventuali spazi consecutivi in uno solo)
STRVECTOR vsVal ;
Tokenize( sVal, sSep, vsVal) ;
// ritorno il risultato
@@ -516,7 +517,7 @@ LuaOutLog( lua_State* L)
LuaClearStack( L) ;
// accodo il messaggio nel file di log
ExeOutLog( sOut, nDbgLev) ;
// non c'è risultato
// non c'è risultato
return 0 ;
}
@@ -1178,7 +1179,7 @@ LuaCloseExe( lua_State* L)
// eseguo chiusura forzata
if ( ExeOnTerminateProcess( nExitCode))
TerminateProcess( GetCurrentProcess(), abs( nExitCode)) ;
// restituisco il risultato (se arrivo qui vuol dire che non è consnetito terminare l'esecuzione)
// restituisco il risultato (se arrivo qui vuol dire che non è consnetito terminare l'esecuzione)
LuaSetParam( L, false) ;
return 1 ;
}
@@ -1212,22 +1213,154 @@ LuaReleaseMutex( lua_State* L)
}
//-------------------------------------------------------------------------------
const int MAX_CTRLS = IDC_TEXT8 -IDC_TEXT1 + 1 ;
// =================================== DIALOG ===================================
// Variabili Globali
const int OFFS_CTRLS = 40 ;
enum TYPE_CTRLS { CTRL_NONE = 0, CTRL_CHECK = 1, CTRL_COMBO = 2, CTRL_EDIT = 3, CTRL_COLOR = 4} ;
static int s_nCtrls = 0 ;
static string s_sCaption ;
static string s_sText[MAX_CTRLS] ;
static string s_sEdit[MAX_CTRLS] ;
static int s_nType[MAX_CTRLS] ;
enum TYPE_CTRLS { CTRL_NONE = 0, CTRL_CHECK = 1, CTRL_COMBO = 2, CTRL_EDIT = 3, CTRL_COLOR = 4, CTRL_BUTTON = 5} ;
static COLORREF s_CustomColors[16] = {12632256} ; // 16 colori GRAY
static bool s_bCustomColorsInit = false ; // flag di inizializzazione colori
const char* SEC_SCENE = "Scene" ;
const char* KEY_CUSTOMCOLORS = "CustomColors" ;
// Dialogo Modeless
const int MAX_CTRLS = IDC_TEXT8 - IDC_TEXT1 + 1 ;
static int s_nCtrls = 0 ;
static string s_sCaption ;
static string s_sText[MAX_CTRLS] ;
static string s_sEdit[MAX_CTRLS] ;
static int s_nType[MAX_CTRLS] ;
struct DialogContext {
bool bDone = false ; // flag per chiusura dialogo (X/Ok/Cancel)
bool bCancelled = false ; // true se X/Cancel
bool bSelecting = false ; // true quando un BS + in modalità selezione
int nLastBS = -1 ; // indice dell'ultimo BS premuto
STRVECTOR vsResult ; // valori finali da ritornare a Lua
} ;
static string s_sIdSel_ML ;
static bool s_bSelectionMode = false ; // se true allora diventa dialogo "Modeless"
static int s_nActiveRow = - 1 ; // indice della riga di "BS:" attiva
//-------------------------------------------------------------------------------
// OnClosingDialog
//
// Scopo:
// Gestisce la chiusura del dialogo modeless in modo centralizzato e sicuro.
// Questa funzione viene chiamata quando lutente chiude il dialogo tramite:
// - OK
// - Cancel
// - pulsante X
// - WM_CLOSE
//
// Comportamento:
// - Riabilita la finestra principale (Main Window), che era stata disabilitata durante il funzionamento
// modale del dialogo.
//
// - Distrugge la finestra del dialogo.
//
// - Riporta il focus alla finestra principale, garantendo continuità nellinterazione dellutente.
//
// - Deseleziona tutti gli oggetti nella scena e aggiorna la vista, in modo che nessuna selezione residua
// rimanga attiva dopo la chiusura.
//-------------------------------------------------------------------------------
static void
OnClosingDialog( HWND hwndDlg) {
// reset stato globale
s_bSelectionMode = false ;
s_nActiveRow = -1 ;
nDlgModelessItem = -1 ;
// il controllo passa al Main
HWND hMain = GetParent( hwndDlg) ;
EnableWindow( hMain, TRUE) ;
DestroyWindow( hwndDlg) ;
phDlgModeless = nullptr ;
SetFocus( hMain) ;
// deseleziono tutto
ExeDeselectAll() ;
ExeDraw() ;
}
//-------------------------------------------------------------------------------
// StartSelectionMode
//
// Scopo:
// Attiva la modalità di selezione (modeless) del dialogo. Questa modalità permette allutente di interagire
// con la scena mentre il dialogo rimane aperto e attivo.
//
// Parametri:
// hDlg → handle del dialogo
// nEditId → ID delledit associato al pulsante BS premuto
// nActiveRow → indice della riga BS attiva (0..MAX_CTRLS-1)
//-------------------------------------------------------------------------------
static void
StartSelectionMode( HWND hDlg, int nEditId, int nActiveRow)
{
// il dialogo torna modeless rispetto alla scena
HWND hMain = GetParent( hDlg) ;
EnableWindow( hMain, TRUE) ;
// resta comunque in primo piano
SetWindowPos( hDlg, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE) ;
// disabilito tutti gli edit associati ai BS tranne che quello attivo
for ( int i = 0; i < s_nCtrls ; ++ i) {
if (s_sEdit[i].find( "BS:") == 0) {
int idEdit = IDC_EDIT1 + i ;
EnableWindow( GetDlgItem( hDlg, idEdit), ( i == nActiveRow ? TRUE : FALSE)) ;
}
}
// seleziono solo gli elementi presenti nell'edit corrispondente
nDlgModelessItem = - 1 ; // !<-- Temporaneo [***]
ExeDeselectAll() ; // !<-- NB. avendo messo nDlgModelessItem = -1 il testo non viene rimosso
s_bSelectionMode = true ;
s_nActiveRow = nActiveRow ;
nDlgModelessItem = nEditId ; // !<-- Aggiorno [***]
AtoWEX<128> wsEdit( "") ;
GetDlgItemText( hDlg, nEditId, LPWSTR( wsEdit), 128) ;
string sIds = wstrztoA( wsEdit) ;
STRVECTOR vsIds ;
Tokenize( sIds, ",", vsIds) ;
for ( const string& sId : vsIds) {
int nId = GDB_ID_NULL ;
if ( FromString( sId, nId) && nId != GDB_ID_NULL)
ExeSelectObj( nId) ;
}
ExeDraw() ;
}
//-------------------------------------------------------------------------------
// EndSelectionMode
//
// Scopo:
// Termina la modalità di selezione e riporta il dialogo in stato modale.
//-------------------------------------------------------------------------------
static void
EndSelectionMode( HWND hDlg)
{
s_bSelectionMode = false ;
s_nActiveRow = -1 ;
nDlgModelessItem = -1 ;
// disabilito tutti gli edit associati ai BS
for ( int i = 0; i < s_nCtrls ; ++ i) {
if ( s_sEdit[i].find( "BS:") == 0) {
int idEdit = IDC_EDIT1 + i ;
EnableWindow( GetDlgItem( hDlg, idEdit), FALSE) ;
SetDlgItemText( hDlg, IDC_BUTTON_SEL1 + i, stringtoW( string{ "-"})) ;
}
}
// il dialogo torna modale
HWND hMain = GetParent( hDlg) ;
EnableWindow( hMain, FALSE) ;
SetFocus( hDlg) ;
// deseleziono tutto
ExeDeselectAll() ; //!<-- NB. avendo messo nDlgModelessItem = -1 il testo non viene rimosso
ExeDraw() ;
}
//-------------------------------------------------------------------------------
BOOL
CALLBACK DialogBoxProc( HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)
CALLBACK DialogBoxModelessProc( HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
// variabili static locali per mantenere lo stato tra chiamate per selezione colori
static COLORREF selectedColor[MAX_CTRLS] = {0} ; // BLACK
@@ -1236,6 +1369,14 @@ CALLBACK DialogBoxProc( HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam
switch ( message) {
case WM_INITDIALOG :
{
// imposto il dialogo come modale
HWND hMain = GetParent( hwndDlg) ;
EnableWindow( hMain, FALSE) ;
SetFocus( hwndDlg) ;
// imposto il contesto della funzione per recuperalo in futuro (per la funzione di CallBack Lua)
SetWindowLongPtr( hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam) ;
// colore di default
COLORREF defaultColor = RGB( 255, 0, 0) ;
// inizializzazione colori e brush
@@ -1259,60 +1400,61 @@ CALLBACK DialogBoxProc( HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam
POINT ptLR{ rcLR.left, rcLR.top} ;
ScreenToClient( hwndDlg, &ptLR) ;
// centro e scalo il dialogo
int nNewH = rcLR.top - rcOwner.top + 2 * OFFS_CTRLS ; // non chiaro perchè va sottratto rcOwner.top ma funziona sempre
SetWindowPos( hwndDlg,
HWND_TOP,
int nNewH = rcLR.top - rcOwner.top + 2 * OFFS_CTRLS ; // non chiaro perchè va sottratto rcOwner.top ma funziona sempre
SetWindowPos( hwndDlg, HWND_TOP,
( rcOwner.left + rcOwner.right - ( rcDlg.right - rcDlg.left)) / 2,
( rcOwner.top + rcOwner.bottom - nNewH) / 2,
( rcDlg.right - rcDlg.left),
nNewH,
0) ;
nNewH, 0) ;
// riposiziono il bottone Ok
HWND hwndOk = GetDlgItem( hwndDlg, IDOK) ;
RECT rcOk ;
GetWindowRect( hwndOk, &rcOk) ;
POINT ptOk{ rcOk.left, rcOk.top} ;
ScreenToClient( hwndDlg, &ptOk) ;
SetWindowPos( hwndOk,
hwndDlg,
ptOk.x,
ptLR.y + OFFS_CTRLS,
0, 0,
SWP_NOSIZE | SWP_NOZORDER) ;
SetWindowPos( hwndOk, hwndDlg, ptOk.x, ptLR.y + OFFS_CTRLS, 0, 0, SWP_NOSIZE | SWP_NOZORDER) ;
// riposiziono il bottone Cancel
HWND hwndCl = GetDlgItem( hwndDlg, IDCANCEL) ;
RECT rcCl ;
GetWindowRect( hwndCl, &rcCl) ;
POINT ptCl{ rcCl.left, rcCl.top} ;
ScreenToClient( hwndDlg, &ptCl) ;
SetWindowPos( hwndCl,
hwndDlg,
ptCl.x,
ptLR.y + OFFS_CTRLS,
0, 0,
SWP_NOSIZE | SWP_NOZORDER) ;
SetWindowPos( hwndCl, hwndDlg, ptCl.x, ptLR.y + OFFS_CTRLS, 0, 0, SWP_NOSIZE | SWP_NOZORDER) ;
// stile finestra
LONG style = GetWindowLong( hwndDlg, GWL_STYLE) ;
style |= WS_SYSMENU ;
SetWindowLong( hwndDlg, GWL_STYLE, style) ;
}
// assegno titolo del dialogo
SetWindowText( hwndDlg, stringtoW( s_sCaption)) ;
// assegno testi e valori di default e nascondo linee dei controlli non usati
for ( int i = 0 ; i < MAX_CTRLS ; ++ i) {
if ( i < s_nCtrls) {
// imposto il testo nella riga corrente
SetDlgItemText( hwndDlg, IDC_TEXT1 + i, stringtoW( s_sText[i])) ;
// --- se CheckBox
if ( s_sEdit[i].find( "CK:") == 0) {
bool bChecked = false ;
FromString( s_sEdit[i].substr( 3), bChecked) ;
CheckDlgButton( hwndDlg, IDC_CHECK1 + i, ( bChecked ? BST_CHECKED : BST_UNCHECKED)) ;
ShowWindow( GetDlgItem( hwndDlg, IDC_EDIT1 + i), SW_HIDE) ;
ShowWindow( GetDlgItem( hwndDlg, IDC_COMBO1 + i), SW_HIDE) ;
ShowWindow( GetDlgItem( hwndDlg, IDC_EDIT1 + i), SW_HIDE) ; // nascondo Edit
ShowWindow( GetDlgItem( hwndDlg, IDC_COMBO1 + i), SW_HIDE) ; // nascondo Combo
ShowWindow( GetDlgItem( hwndDlg, IDC_BUTTON_SEL1 + i), SW_HIDE) ; // nascondo Button di selezione
s_nType[i] = CTRL_CHECK ;
}
// --- se ComboBox
else if ( s_sEdit[i].find( "CB:") == 0) {
string sList = s_sEdit[i].substr( 3) ;
STRVECTOR vsVal ;
Tokenize( sList, ",", vsVal) ;
int nSel = 0 ;
HWND hwndCBox = GetDlgItem( hwndDlg, IDC_COMBO1 + i) ;
for ( int j = 0 ; j < int( vsVal.size()) ; ++ j) {
for ( int j = 0 ; j < ssize( vsVal) ; ++ j) {
string sItem ;
if ( vsVal[j][0] == '*') {
nSel = j ;
@@ -1323,10 +1465,19 @@ CALLBACK DialogBoxProc( HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam
ComboBox_AddString( hwndCBox, stringtoW( sItem)) ;
}
ComboBox_SetCurSel( hwndCBox, nSel) ;
ShowWindow( GetDlgItem( hwndDlg, IDC_EDIT1 + i), SW_HIDE) ;
ShowWindow( GetDlgItem( hwndDlg, IDC_CHECK1 + i), SW_HIDE) ;
int nEditHeight = int( SendMessage( hwndCBox, CB_GETITEMHEIGHT, (WPARAM)-1, 0)) ;
int nItemHeight = int( SendMessage( hwndCBox, CB_GETITEMHEIGHT, 0, 0)) ;
int nTotalHeight = nEditHeight + nItemHeight * ( ssize( vsVal) + 1) ;
RECT rc ; GetWindowRect( hwndCBox, &rc) ;
HWND parent = GetParent(hwndCBox) ; MapWindowPoints( NULL, parent, (LPPOINT)&rc, 2) ;
SetWindowPos( hwndCBox, NULL, rc.left, rc.top, rc.right - rc.left, nTotalHeight, SWP_NOZORDER) ;
ShowWindow( GetDlgItem( hwndDlg, IDC_EDIT1 + i), SW_HIDE) ; // nascondo Edit
ShowWindow( GetDlgItem( hwndDlg, IDC_CHECK1 + i), SW_HIDE) ; // nascondo CheckBox
ShowWindow( GetDlgItem( hwndDlg, IDC_BUTTON_SEL1 + i), SW_HIDE) ; // nascondo Button di selezione
s_nType[i] = CTRL_COMBO ;
}
// --- se ColorPicker
else if ( s_sEdit[i].find( "CP:") == 0) {
string sVal = s_sEdit[i].substr( 3) ;
Color CColor ;
@@ -1355,28 +1506,28 @@ CALLBACK DialogBoxProc( HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam
}
s_bCustomColorsInit = true ;
}
// nascondo qualsiasi tipo di componente ( per sicurezza)
ShowWindow( GetDlgItem( hwndDlg, IDC_EDIT1 + i), SW_HIDE) ;
ShowWindow( GetDlgItem( hwndDlg, IDC_COMBO1 + i), SW_HIDE) ;
ShowWindow( GetDlgItem( hwndDlg, IDC_CHECK1 + i), SW_HIDE) ;
// nascondo qualsiasi tipo di componente
ShowWindow( GetDlgItem( hwndDlg, IDC_EDIT1 + i), SW_HIDE) ; // nascondo Edit
ShowWindow( GetDlgItem( hwndDlg, IDC_COMBO1 + i), SW_HIDE) ; // nascondo Combo
ShowWindow( GetDlgItem( hwndDlg, IDC_CHECK1 + i), SW_HIDE) ; // nascondo Check
ShowWindow( GetDlgItem( hwndDlg, IDC_BUTTON_SEL1 + i), SW_HIDE) ; // nascondo Button di selezione
// margini per dimensione del rettangolo preview pickColor
const int MARGIN_RIGHT = 8 ; // spazio tra preview e bordo destro dialog
const int PREVIEW_HEIGHT = 20 ; // altezza del rettangolo
const int PREVIEW_MIN_WIDTH = 40 ; // larghezza minima
// ottieni o crea la static preview (allargata fino al bordo destro del dialog)
// creazione della static preview
HWND hwndPreview = NULL ;
RECT rcLabel ;
HWND hwndLabel = GetDlgItem( hwndDlg, IDC_TEXT1 + i) ;
RECT rcClient ; GetClientRect( hwndDlg, &rcClient) ; // coordinate client del dialog
if ( hwndLabel && GetWindowRect( hwndLabel, &rcLabel)) {
HWND hwndEdit = GetDlgItem( hwndDlg, IDC_EDIT1 + i) ;
RECT rcEdit ; GetClientRect( hwndDlg, &rcEdit) ; // coordinate client del dialog
if ( hwndEdit != nullptr && GetWindowRect( hwndEdit, &rcEdit)) {
// converti rcLabel in coordinate client
POINT ptLabel = { rcLabel.right, rcLabel.top } ;
ScreenToClient( hwndDlg, &ptLabel) ;
int x = ptLabel.x + 8 ; // distanza dal label
int y = ptLabel.y ;
int width = rcClient.right - x - MARGIN_RIGHT ;
POINT ptEdit = { rcEdit.left, rcEdit.top } ;
ScreenToClient( hwndDlg, &ptEdit) ;
int x = ptEdit.x ;
int y = ptEdit.y ;
int width = rcEdit.right - rcEdit.left ;
if ( width < PREVIEW_MIN_WIDTH)
width = PREVIEW_MIN_WIDTH ;
hwndPreview = CreateWindowEx( 0, L"STATIC", NULL,
@@ -1394,22 +1545,42 @@ CALLBACK DialogBoxProc( HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam
}
s_nType[i] = CTRL_COLOR ;
}
// --- se Button di selezione
else if ( s_sEdit[i].find( "BS:") == 0) {
ShowWindow( GetDlgItem( hwndDlg, IDC_COMBO1 + i), SW_HIDE) ; // nascondo la Combo
ShowWindow( GetDlgItem( hwndDlg, IDC_CHECK1 + i), SW_HIDE) ; // nascondo la Check
SetDlgItemText( hwndDlg, IDC_BUTTON_SEL1 + i, stringtoW( string{ "-"})) ; // modalità non Selezione
EnableWindow( GetDlgItem( hwndDlg, IDC_EDIT1 + i), FALSE) ; // disattivo la Edit
// associo alla casella di testo la funzione di KeyPress su Enter
HWND hEdit = GetDlgItem( hwndDlg, IDC_EDIT1 + i) ;
if ( hEdit != nullptr)
SetWindowSubclass( hEdit, UpdateSelectionModelessDialog, 1, (DWORD_PTR)( IDC_EDIT1 + i)) ;
s_nType[i] = CTRL_BUTTON ;
}
// --- se Testo
else {
SetDlgItemText( hwndDlg, IDC_EDIT1 + i, stringtoW( s_sEdit[i])) ;
ShowWindow( GetDlgItem( hwndDlg, IDC_COMBO1 + i), SW_HIDE) ;
ShowWindow( GetDlgItem( hwndDlg, IDC_CHECK1 + i), SW_HIDE) ;
ShowWindow( GetDlgItem( hwndDlg, IDC_COMBO1 + i), SW_HIDE) ; // nascondo Combo
ShowWindow( GetDlgItem( hwndDlg, IDC_CHECK1 + i), SW_HIDE) ; // nascondo Check
ShowWindow( GetDlgItem( hwndDlg, IDC_BUTTON_SEL1 + i), SW_HIDE) ; // nascondo Button di selezione
s_nType[i] = CTRL_EDIT ;
}
}
// se numero di controllo superiore al massimo, non visualizzo nullo ( in questo caso aggiungere elementi a Dialog in .rc)
else {
// nascondo tutto
ShowWindow( GetDlgItem( hwndDlg, IDC_TEXT1 + i), SW_HIDE) ;
ShowWindow( GetDlgItem( hwndDlg, IDC_EDIT1 + i), SW_HIDE) ;
ShowWindow( GetDlgItem( hwndDlg, IDC_COMBO1 + i), SW_HIDE) ;
ShowWindow( GetDlgItem( hwndDlg, IDC_CHECK1 + i), SW_HIDE) ;
ShowWindow( GetDlgItem( hwndDlg, IDC_BUTTON_SEL1 + i), SW_HIDE) ;
s_nType[i] = CTRL_NONE ;
}
}
break ;
case WM_CTLCOLORSTATIC :
{
HDC hdcStatic = ( HDC)wParam ;
@@ -1425,11 +1596,58 @@ CALLBACK DialogBoxProc( HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam
}
}
break ;
case WM_COMMAND : {
int id = LOWORD( wParam) ;
int code = HIWORD( wParam) ;
// comando di Preview per brush di colori mediante click del mouse
if ( code == STN_CLICKED && id >= IDC_COLOR1 && id <= IDC_COLOR8) {
// --- se click di un Button di selezione
if ( id >= IDC_BUTTON_SEL1 && id < IDC_BUTTON_SEL1 + MAX_CTRLS) {
int nBtnId = id ;
int nEditId = IDC_EDIT1 + ( id - IDC_BUTTON_SEL1) ;
int nActiveRow = nEditId - IDC_EDIT1 ;
// se il bottone premuto è lo stesso
if ( nDlgModelessItem == nEditId) {
// se selezione attiva, allora deve terminare
if ( s_bSelectionMode) {
SetDlgItemText( hwndDlg, nBtnId, stringtoW( string{ "-"})) ;
EndSelectionMode( hwndDlg) ;
}
// se selezione non attiva, allora viene attivata
else {
SetDlgItemText( hwndDlg, nBtnId, stringtoW( string{ "S"})) ;
StartSelectionMode( hwndDlg, nEditId, nActiveRow) ;
}
}
// se nuovo buttone premuto
else {
// se esisteva una selezione precedente, questa viene annullata
if ( nDlgModelessItem != -1) {
// recupero il Button di selezione precedente e modifico il suo testo
int nPrevBtnId = IDC_BUTTON_SEL1 + ( nDlgModelessItem - IDC_EDIT1) ;
SetDlgItemText( hwndDlg, nPrevBtnId, stringtoW( string{ "-"})) ;
}
// la selezione passa al comando corrente
nDlgModelessItem = nEditId ;
SetDlgItemText( hwndDlg, nBtnId, stringtoW( string{ "S"})) ;
// il dialogo diventa "Modeless" temporaneamente
s_nActiveRow = nEditId - IDC_EDIT1 ;
StartSelectionMode( hwndDlg, nEditId, nActiveRow) ;
}
return TRUE ; // !<-- esco
}
// --- se comando di Preview per brush di colori mediante click del mouse
else if ( code == STN_CLICKED && id >= IDC_COLOR1 && id <= IDC_COLOR8) {
// se selezione attiva, allora deve terminare
if ( s_bSelectionMode) {
// se esisteva una selezione precedente, questa viene annullata
if ( nDlgModelessItem != -1) {
// recupero il Button di selezione precedente e modifico il suo testo
int nPrevBtnId = IDC_BUTTON_SEL1 + ( nDlgModelessItem - IDC_EDIT1) ;
SetDlgItemText( hwndDlg, nPrevBtnId, stringtoW( string{ "-"})) ;
}
EndSelectionMode( hwndDlg) ;
}
int idx = id - IDC_COLOR1 ;
HWND hwndPreview = GetDlgItem( hwndDlg, IDC_COLOR1 + idx) ;
if ( ! hwndPreview)
@@ -1458,38 +1676,62 @@ CALLBACK DialogBoxProc( HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam
InvalidateRect(hwndPreview, NULL, TRUE) ;
UpdateWindow( hwndPreview) ;
}
return TRUE ;
return TRUE ; // !<-- Esco
}
switch ( LOWORD( wParam)) {
case IDOK :
for ( int i = 0 ; i < s_nCtrls ; ++ i) {
AtoWEX<128> wsEdit( "") ;
s_sEdit[i] = "" ;
switch ( s_nType[i]) {
case CTRL_CHECK :
s_sEdit[i] = ( IsDlgButtonChecked( hwndDlg, IDC_CHECK1 + i) == BST_CHECKED ? "1" : "0") ;
break ;
case CTRL_COMBO :
if ( GetDlgItemText( hwndDlg, IDC_COMBO1 + i, LPWSTR( wsEdit), 128) > 0)
s_sEdit[i] = wstrztoA( wsEdit) ;
break ;
case CTRL_EDIT :
if ( GetDlgItemText( hwndDlg, IDC_EDIT1 + i, LPWSTR( wsEdit), 128) > 0)
s_sEdit[i] = wstrztoA( wsEdit) ;
break ;
case CTRL_COLOR :
{
COLORREF col = selectedColor[i] ;
BYTE r = GetRValue( col), g = GetGValue( col), b = GetBValue( col) ;
char buf[16] ;
sprintf_s( buf, sizeof( buf), "%u,%u,%u", r, g, b) ;
s_sEdit[i] = buf ;
case IDOK : {
// recupero il contesto impostato alla creazione della finestra (durante esecuzione WM_INITDIALOG)
DialogContext* ctx = (DialogContext*)GetWindowLongPtr( hwndDlg, GWLP_USERDATA) ;
if ( ctx != nullptr) {
// inizializzo i risultati
ctx->vsResult.clear() ;
ctx->vsResult.reserve( s_nCtrls) ;
// recupero i valori degli Item
for ( int i = 0 ; i < s_nCtrls ; ++ i) {
AtoWEX<128> wsEdit( "") ;
s_sEdit[i] = "" ;
switch ( s_nType[i]) {
case CTRL_CHECK :
s_sEdit[i] = ( IsDlgButtonChecked( hwndDlg, IDC_CHECK1 + i) == BST_CHECKED ? "1" : "0") ;
break ;
case CTRL_COMBO :
if ( GetDlgItemText( hwndDlg, IDC_COMBO1 + i, LPWSTR( wsEdit), 128) > 0)
s_sEdit[i] = wstrztoA( wsEdit) ;
break ;
case CTRL_EDIT :
if ( GetDlgItemText( hwndDlg, IDC_EDIT1 + i, LPWSTR( wsEdit), 128) > 0)
s_sEdit[i] = wstrztoA( wsEdit) ;
break ;
case CTRL_COLOR :
{
COLORREF col = selectedColor[i] ;
BYTE r = GetRValue( col), g = GetGValue( col), b = GetBValue( col) ;
char buf[16] ;
sprintf_s( buf, sizeof( buf), "%u,%u,%u", r, g, b) ;
s_sEdit[i] = buf ;
}
break ;
case CTRL_BUTTON :
if ( GetDlgItemText( hwndDlg, IDC_EDIT1 + i, LPWSTR( wsEdit), 128) > 0)
s_sEdit[i] = wstrztoA( wsEdit) ;
break ;
}
// inserisco i valori all'interno della tabella Lua
ctx->vsResult.push_back( s_sEdit[i]) ;
}
ctx->bCancelled = false ;
ctx->bDone = true ;
}
[[fallthrough]] ;
// chiudo il dialogo
OnClosingDialog( hwndDlg) ;
return TRUE ;
}
[[fallthrough]] ;
case IDCANCEL : {
// pulizia brush colori
for ( int i = 0 ; i < MAX_CTRLS ; ++ i) {
@@ -1498,16 +1740,96 @@ CALLBACK DialogBoxProc( HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam
hColorBrush[i] = NULL ;
}
}
EndDialog( hwndDlg, wParam) ;
// recupero il contesto impostato alla creazione della finestra ( durante esecuzione WM_INITDIALOG) e se esiste lo rimuovo
DialogContext* ctx = (DialogContext*)GetWindowLongPtr( hwndDlg, GWLP_USERDATA) ;
if ( ctx != nullptr) {
ctx->bCancelled = true ;
ctx->bDone = true ;
}
// chiudo il dialogo
OnClosingDialog( hwndDlg) ;
return TRUE ;
}
}
// se siamo in modalità di Selezione e il comando attivo non si riferisce ad un button di Selezione (BS), il dialogo torna modale
if ( s_bSelectionMode) {
bool bIsBS = ( id >= IDC_BUTTON_SEL1 && id < IDC_BUTTON_SEL1 + MAX_CTRLS) ;
bool bIsActiveEdit = ( id == IDC_EDIT1 + s_nActiveRow) ;
// il dialogo torna modale
if ( ! bIsBS && ! bIsActiveEdit)
EndSelectionMode( hwndDlg) ;
}
break ;
}
case WM_CLOSE : {
// recupero il contesto impostato alla creazione della finestra ( durante esecuzione WM_INITDIALOG) e se esiste lo rimuovo
DialogContext* ctx = (DialogContext*)GetWindowLongPtr( hwndDlg, GWLP_USERDATA) ;
if ( ctx != nullptr) {
ctx->bCancelled = true ;
ctx->bDone = true ;
}
// chiudo il dialogo
OnClosingDialog( hwndDlg) ;
return TRUE ;
}
}
return FALSE ;
}
//-------------------------------------------------------------------------------
// LuaDialogBox (Modeless)
//
// Scopo:
// ------
// Questa funzione implementa un dialogo "modale" dal punto di vista del codice Lua, ma "modeless" dal punto di vista della
// UI Windows quando necessario. Lobiettivo è permettere al codice Lua di rimanere sospeso finché lutente non chiude il
// dialogo (OK/Cancel/X), mantenendo però la UI attiva e permettendo selezioni nella scena quando lutente preme un pulsante
// BS (Button Selection).
//
// Perché serve:
// -------------
// - I dialoghi modali standard (DialogBox) bloccano completamente la UI, mentre i dialoghi modeless standard (CreateDialog)
// NON bloccano il codice Lua.
// - Le coroutine Lua (lua_yield/lua_resume) non sono utilizzabili in questo contesto perché il thread principale
// dellapplicazione non può essere sospeso tramite yield: il codice Lua non riprende correttamente e la UI non si
// aggiorna coerentemente)
//
// Come funziona:
// --------------
// 1) Il dialogo viene creato con CreateDialogParam(), quindi la UI rimane attiva.
// 2) La funzione NON ritorna subito: entra in un message loop locale (Esattamente equivalente al loop all'interno di
// DialogBox()). Il cuore del loop è GetMessage(), che è una chiamata BLOCCANTE. Significa che il thread rimane in
// attesa senza consumare CPU finché non arriva un messaggio. Non c’è polling, non c’è busy loop. Il comportamento è
// identico a quello di un dialogo modale nativo.
// 3) Il ciclo rimane attivo finché:
// - lutente non chiude il dialogo (OK/Cancel/X)
// - oppure la finestra viene distrutta
// In quel momento ctx->bDone viene impostato a true.
// 4) Durante la vita del dialogo, se lutente preme un pulsante BS, il dialogo diventa temporaneamente "modeless":
// - la main window viene abilitata
// - il dialogo rimane abilitato ma passa in secondo piano logico
// - lutente può selezionare oggetti nella scena
// Quando la selezione termina, il dialogo torna modale.
// 5) Quando il dialogo chiude, i valori vengono copiati in ctx->vsResult e ritornati a Lua come risultato della funzione.
//
// Vantaggi della soluzione:
// -------------------------
// - Lua rimane bloccato come con un dialogo modale tradizionale.
// - La UI rimane completamente attiva.
// - Le selezioni BS (mediante Button Selection) funzionano senza bloccare il programma.
// - Nessun uso di coroutine Lua (che non erano affidabili in questo contesto).
// - Nessun consumo CPU anomalo.
// - Comportamento stabile e prevedibile.
//
// Nota importante:
// ----------------
// Il dialogo NON viene mai disabilitato durante la selezione BS (Button Selection). Solo la main window viene
// abilitata temporaneamente.
// Questo è fondamentale: disabilitare il dialogo impedirebbe allutente di poterlo riselezionare dopo la selezione nella scena.
//
static int
LuaDialogBox( lua_State* L)
{
@@ -1516,7 +1838,7 @@ LuaDialogBox( lua_State* L)
s_nCtrls = 0 ;
for ( int i = 0 ; i < MAX_CTRLS ; ++ i) {
STRVECTOR vData ;
if ( LuaGetParam( L, 2 + i, vData) && vData.size() >= 2) {
if ( LuaGetParam( L, 2 + i, vData) && ssize( vData) >= 2) {
s_sText[i] = Trim( vData[0]) ;
s_sEdit[i] = Trim( vData[1]) ;
++ s_nCtrls ;
@@ -1525,24 +1847,62 @@ LuaDialogBox( lua_State* L)
break ;
}
LuaClearStack( L) ;
// se abilitata UI, lancio dialogo
if ( ExeGetEnableUI()) {
// lancio dialogo
HWND hTopWnd = ExeGetMainWindowHandle() ;
bool bOk = ( DialogBox( GetModuleIstance(), MAKEINTRESOURCE( IDD_LUADLG), hTopWnd, (DLGPROC)DialogBoxProc) == IDOK) ;
// restituzione parametri
if ( bOk) {
STRVECTOR vRes ;
for ( int i = 0 ; i < s_nCtrls ; ++ i)
vRes.emplace_back( s_sEdit[i]) ;
LuaSetParam( L, vRes) ;
}
else {
LuaSetParam( L) ;
// se UI disabilitata, esco
if ( ! ExeGetEnableUI()) {
LuaSetParam( L) ;
return 1 ;
}
// se dialogo Modeless già aperto, errore
if ( phDlgModeless != nullptr) {
LuaSetParam( L) ;
return 1 ;
}
// creazione del contesto e della Coroutine da gestire
DialogContext* ctx = new DialogContext() ;
if ( ctx == nullptr) {
LuaSetParam( L) ;
return 1 ;
}
// creazione di un dialogo Modeless
HWND hTopWnd = ExeGetMainWindowHandle() ;
nDlgModelessItem = -1 ;
phDlgModeless = ( CreateDialogParam( GetModuleIstance(), MAKEINTRESOURCE( IDD_LUADLG), hTopWnd,
(DLGPROC)DialogBoxModelessProc, (LPARAM)ctx)) ;
if ( phDlgModeless == nullptr) {
delete( ctx) ;
ctx = nullptr ;
LuaSetParam( L) ;
return 1 ;
}
// porto la finestra in primo piano
ShowWindow( phDlgModeless, SW_SHOW) ;
SetForegroundWindow( phDlgModeless) ;
// message Loop Modale (ripresa del Loop come da dialogo modale)
MSG msg ;
while ( ! ctx->bDone && IsWindow( phDlgModeless)) {
if ( GetMessage( &msg, NULL, 0, 0) <= 0)
break ;
if ( ! IsDialogMessage( phDlgModeless, &msg)) {
TranslateMessage( &msg) ;
DispatchMessage( &msg) ;
}
}
// ritorno i valori lua
if ( ctx->bCancelled)
LuaSetParam( L, false) ;
else
LuaSetParam( L) ;
LuaSetParam( L, ctx->vsResult) ;
// libero la memoria
delete ctx ;
ctx = nullptr ;
return 1 ;
}
@@ -1607,6 +1967,5 @@ LuaInstallGeneral( LuaMgr& luaMgr)
bOk = bOk && luaMgr.RegisterFunction( "EgtCreateMutex", LuaCreateMutex) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtReleaseMutex", LuaReleaseMutex) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtDialogBox", LuaDialogBox) ;
return bOk ;
}
+1 -1
View File
@@ -377,7 +377,7 @@ LuaRegolarizeSurfaceLocally( lua_State* L)
LuaCheckParam( L, 5, dLinTol)
int nType = 0 ;
LuaCheckParam( L, 6, nType)
int nId = ExeRegolarizeSurfaceLocally( nParentId, nSurfId, nSyncStartId, nSyncEndId, dLinTol, nType) ;
LuaSetParam( L, nId) ;
return 1 ;
+18 -4
View File
@@ -1,6 +1,6 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by EgtExecutor.rc
// File di inclusione generato con Microsoft Visual C++.
// Utilizzato da EgtExecutor.rc
//
#define VS_VERSION_INFO 1
#define IDD_LUADLG 101
@@ -13,6 +13,7 @@
#define IDC_TEXT6 1006
#define IDC_TEXT7 1007
#define IDC_TEXT8 1008
#define IDC_EDIT1 1011
#define IDC_EDIT2 1012
#define IDC_EDIT3 1013
@@ -21,6 +22,7 @@
#define IDC_EDIT6 1016
#define IDC_EDIT7 1017
#define IDC_EDIT8 1018
#define IDC_COMBO1 1021
#define IDC_COMBO2 1022
#define IDC_COMBO3 1023
@@ -29,6 +31,7 @@
#define IDC_COMBO6 1026
#define IDC_COMBO7 1027
#define IDC_COMBO8 1028
#define IDC_CHECK1 1031
#define IDC_CHECK2 1032
#define IDC_CHECK3 1033
@@ -37,6 +40,7 @@
#define IDC_CHECK6 1036
#define IDC_CHECK7 1037
#define IDC_CHECK8 1038
#define IDC_COLOR1 1041
#define IDC_COLOR2 1042
#define IDC_COLOR3 1043
@@ -45,15 +49,25 @@
#define IDC_COLOR6 1046
#define IDC_COLOR7 1047
#define IDC_COLOR8 1048
#define IDC_BUTTON_SEL1 1051
#define IDC_BUTTON_SEL2 1052
#define IDC_BUTTON_SEL3 1053
#define IDC_BUTTON_SEL4 1054
#define IDC_BUTTON_SEL5 1055
#define IDC_BUTTON_SEL6 1056
#define IDC_BUTTON_SEL7 1057
#define IDC_BUTTON_SEL8 1058
#define IDC_PICTURE1 1101
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 103
#define _APS_NEXT_RESOURCE_VALUE 109
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1030
#define _APS_NEXT_CONTROL_VALUE 1074
#define _APS_NEXT_SYMED_VALUE 115
#endif
#endif