EgtExecutor 1.8d4 :
- aggiunta gestione BBox3d e Frame3d in Exe e Lua SetInfo e GetInfo.
This commit is contained in:
@@ -534,6 +534,18 @@ ExeSetInfo( int nId, const string& sKey, const Point3d& ptP)
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeSetInfo( int nId, const string& sKey, const BBox3d& b3Box)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, false)
|
||||
// assegno la info
|
||||
bool bOk = pGeomDB->SetInfo( nId, sKey, b3Box) ;
|
||||
ExeSetModified() ;
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeSetInfo( int nId, const string& sKey, const Frame3d& frFrame)
|
||||
@@ -606,6 +618,16 @@ ExeGetInfo( int nId, const string& sKey, Point3d& ptP)
|
||||
return pGeomDB->GetInfo( nId, sKey, ptP) ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeGetInfo( int nId, const string& sKey, BBox3d& b3Box)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, false)
|
||||
// recupero la info
|
||||
return pGeomDB->GetInfo( nId, sKey, b3Box) ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeGetInfo( int nId, const string& sKey, Frame3d& frFrame)
|
||||
|
||||
Binary file not shown.
+26
-2
@@ -471,7 +471,7 @@ LuaRemoveName( lua_State* L)
|
||||
static int
|
||||
LuaSetInfo( lua_State* L)
|
||||
{
|
||||
// 3 parametri : Id, Key, bVal|nVal|dVal|sVal|vtVal|ptVal
|
||||
// 3 parametri : Id, Key, bVal|nVal|dVal|sVal|vtVal|ptVal|b3Val|frVal
|
||||
int nId ;
|
||||
LuaCheckParam( L, 1, nId)
|
||||
string sKey ;
|
||||
@@ -496,8 +496,18 @@ LuaSetInfo( lua_State* L)
|
||||
bOk = ExeSetInfo( nId, sKey, sVal) ;
|
||||
}
|
||||
else if ( lua_istable( L, 3)) {
|
||||
Frame3d frVal ;
|
||||
BBox3d b3Val ;
|
||||
Vector3d vtVal ; // va bene anche per Point3d
|
||||
if ( LuaGetParam( L, 3, vtVal)) {
|
||||
if ( LuaGetParam( L, 3, frVal)) {
|
||||
LuaClearStack( L) ;
|
||||
bOk = ExeSetInfo( nId, sKey, frVal) ;
|
||||
}
|
||||
else if ( LuaGetParam( L, 3, b3Val)) {
|
||||
LuaClearStack( L) ;
|
||||
bOk = ExeSetInfo( nId, sKey, b3Val) ;
|
||||
}
|
||||
else if ( LuaGetParam( L, 3, vtVal)) {
|
||||
LuaClearStack( L) ;
|
||||
bOk = ExeSetInfo( nId, sKey, vtVal) ;
|
||||
}
|
||||
@@ -555,6 +565,20 @@ LuaGetInfo( lua_State* L)
|
||||
else
|
||||
LuaSetParam( L) ;
|
||||
}
|
||||
else if ( sType == "x" || sType == "X") {
|
||||
BBox3d b3Val ;
|
||||
if ( ExeGetInfo( nId, sKey, b3Val))
|
||||
LuaSetParam( L, b3Val) ;
|
||||
else
|
||||
LuaSetParam( L) ;
|
||||
}
|
||||
else if ( sType == "f" || sType == "F") {
|
||||
Frame3d frVal ;
|
||||
if ( ExeGetInfo( nId, sKey, frVal))
|
||||
LuaSetParam( L, frVal) ;
|
||||
else
|
||||
LuaSetParam( L) ;
|
||||
}
|
||||
else { // "s" "S"
|
||||
string sInfo ;
|
||||
if ( ExeGetInfo( nId, sKey, sInfo))
|
||||
|
||||
Reference in New Issue
Block a user