Include :

- cambio nome di alcuni include di base
- aggiornamento prototipi.
This commit is contained in:
Dario Sassi
2015-05-11 21:11:49 +00:00
parent aaa369064c
commit 75dac0c620
17 changed files with 134 additions and 51 deletions
+6
View File
@@ -107,6 +107,9 @@ class __declspec( novtable) IGdbIterator
virtual bool SetInfo( const std::string& sKey, const Point3d& ptInfo) = 0 ;
virtual bool SetInfo( const std::string& sKey, const Vector3d& vtInfo) = 0 ;
virtual bool SetInfo( const std::string& sKey, const Frame3d& frInfo) = 0 ;
virtual bool SetInfo( const std::string& sKey, const INTVECTOR& vnInfo) = 0 ;
virtual bool SetInfo( const std::string& sKey, const DBLVECTOR& vdInfo) = 0 ;
virtual bool SetInfo( const std::string& sKey, const STRVECTOR& vsInfo) = 0 ;
virtual bool GetInfo( const std::string& sKey, std::string& sInfo) const = 0 ;
virtual bool GetInfo( const std::string& sKey, bool& bInfo) const = 0 ;
virtual bool GetInfo( const std::string& sKey, int& nInfo) const = 0 ;
@@ -114,6 +117,9 @@ class __declspec( novtable) IGdbIterator
virtual bool GetInfo( const std::string& sKey, Point3d& ptInfo) const = 0 ;
virtual bool GetInfo( const std::string& sKey, Vector3d& vtInfo) const = 0 ;
virtual bool GetInfo( const std::string& sKey, Frame3d& frInfo) const = 0 ;
virtual bool GetInfo( const std::string& sKey, INTVECTOR& vnInfo) const = 0 ;
virtual bool GetInfo( const std::string& sKey, DBLVECTOR& vdInfo) const = 0 ;
virtual bool GetInfo( const std::string& sKey, STRVECTOR& vsInfo) const = 0 ;
virtual bool ExistsInfo( const std::string& sKey) const = 0 ;
virtual bool RemoveInfo( const std::string& sKey) = 0 ;
} ;
+3
View File
@@ -21,6 +21,7 @@
#include "/EgtDev/Include/EGkGeoObj.h"
#include "/EgtDev/Include/EGkMaterial.h"
#include "/EgtDev/Include/EgtNumCollection.h"
#include "/EgtDev/Include/EgtStringBase.h"
#include "/EgtDev/Include/EgtILogger.h"
#include <string>
@@ -154,6 +155,7 @@ class __declspec( novtable) IGeomDB
virtual bool SetInfo( int nId, const std::string& sKey, const Frame3d& frInfo) = 0 ;
virtual bool SetInfo( int nId, const std::string& sKey, const INTVECTOR& vnInfo) = 0 ;
virtual bool SetInfo( int nId, const std::string& sKey, const DBLVECTOR& vdInfo) = 0 ;
virtual bool SetInfo( int nId, const std::string& sKey, const STRVECTOR& vsInfo) = 0 ;
virtual bool GetInfo( int nId, const std::string& sKey, std::string& sInfo) const = 0 ;
virtual bool GetInfo( int nId, const std::string& sKey, bool& bInfo) const = 0 ;
virtual bool GetInfo( int nId, const std::string& sKey, int& nInfo) const = 0 ;
@@ -164,6 +166,7 @@ class __declspec( novtable) IGeomDB
virtual bool GetInfo( int nId, const std::string& sKey, Frame3d& frInfo) const = 0 ;
virtual bool GetInfo( int nId, const std::string& sKey, INTVECTOR& vnInfo) const = 0 ;
virtual bool GetInfo( int nId, const std::string& sKey, DBLVECTOR& vdInfo) const = 0 ;
virtual bool GetInfo( int nId, const std::string& sKey, STRVECTOR& vsInfo) const = 0 ;
virtual bool ExistsInfo( int nId, const std::string& sKey) const = 0 ;
virtual bool RemoveInfo( int nId, const std::string& sKey) = 0 ;
// Material library
+2 -24
View File
@@ -25,34 +25,12 @@ using namespace std ;
//----------------------------------------------------------------------------
inline bool
LuaGetParam( lua_State* L, int nInd, Vector3d& vtPar)
{
if ( ! lua_istable( L, nInd))
return false ;
for ( int i = 1 ; i <= 3 ; ++ i) {
lua_rawgeti( L, nInd, i) ;
if ( ! lua_isnumber( L, -1))
return false ;
vtPar.v[i-1] = lua_tonumber( L, -1) ;
lua_pop( L, 1) ;
}
return true ;
}
{ return LuaGetParam( L, nInd, vtPar.v) ; }
//----------------------------------------------------------------------------
inline bool
LuaGetParam( lua_State* L, int nInd, Point3d& ptPar)
{
if ( ! lua_istable( L, nInd))
return false ;
for ( int i = 1 ; i <= 3 ; ++ i) {
lua_rawgeti( L, nInd, i) ;
if ( ! lua_isnumber( L, -1))
return false ;
ptPar.v[i-1] = lua_tonumber( L, -1) ;
lua_pop( L, 1) ;
}
return true ;
}
{ return LuaGetParam( L, nInd, ptPar.v) ; }
//----------------------------------------------------------------------------
inline bool
+1 -1
View File
@@ -13,7 +13,7 @@
#pragma once
#include "/EgtDev/Include/EgnStringBase.h"
#include "/EgtDev/Include/EgtStringBase.h"
class ICmdParser ;
+65 -1
View File
@@ -16,7 +16,10 @@
#include "/EgtDev/Extern/Lua/Include/lua.hpp"
//----------------------------------------------------------------------------
#define LuaCheckParam(L,I,P) { if ( ! LuaGetParam(L,I,P)) return luaL_error( L, " Invalid Parameter # " #I) ;}
#define LuaCheckParam(L,I,P) { if ( ! LuaGetParam(L,I,P)) \
return luaL_error( L, " Invalid Parameter # " #I) ;}
#define LuaCheckTabFieldParam(L,I,F,P) { if ( ! LuaGetTabFieldParam(L,I,F,P)) \
return luaL_error( L, " Invalid Parameter # " #I " (field %s)", F) ;}
//----------------------------------------------------------------------------
inline bool
@@ -59,6 +62,23 @@ LuaGetParam( lua_State* L, int nInd, std::string& sPar)
return true ;
}
//----------------------------------------------------------------------------
template <size_t size>
bool
LuaGetParam( lua_State* L, int nInd, double (&dVal)[size])
{
if ( ! lua_istable( L, nInd))
return false ;
for ( int i = 1 ; i <= size ; ++ i) {
lua_rawgeti( L, nInd, i) ;
if ( ! lua_isnumber( L, -1))
return false ;
dVal[i-1] = lua_tonumber( L, -1) ;
lua_pop( L, 1) ;
}
return true ;
}
//----------------------------------------------------------------------------
inline bool
LuaGetParam( lua_State* L, int nInd, INTVECTOR& vPar)
@@ -91,6 +111,50 @@ LuaGetParam( lua_State* L, int nInd, INTVECTOR& vPar)
return false ;
}
//----------------------------------------------------------------------------
inline bool
LuaGetParam( lua_State* L, int nInd, DBLVECTOR& vPar)
{
vPar.clear() ;
if ( lua_isnumber( L, nInd)) {
double dVal = lua_tonumber( L, nInd) ;
vPar.push_back( dVal) ;
return true ;
}
else if ( lua_istable( L, nInd)) {
// lunghezza della tavola
lua_len( L, nInd) ;
if ( ! lua_isnumber( L, -1))
return false ;
int nLen = int( lua_tointeger( L, -1)) ;
lua_pop( L, 1) ;
vPar.reserve( nLen) ;
for ( int i = 1 ; i <= nLen ; ++ i) {
lua_rawgeti( L, nInd, i) ;
if ( ! lua_isnumber( L, -1))
return false ;
double dVal = lua_tonumber( L, -1) ;
vPar.push_back( dVal) ;
lua_pop( L, 1) ;
}
return true ;
}
else
return false ;
}
//----------------------------------------------------------------------------
template <class T>
bool
LuaGetTabFieldParam( lua_State* L, int nInd, const char* szField, T& Val)
{
lua_getfield( L, nInd, szField) ;
if ( ! LuaGetParam( L, -1, Val))
return false ;
lua_pop( L, 1) ;
return true ;
}
//----------------------------------------------------------------------------
inline bool
LuaClearStack( lua_State* L)
+8 -1
View File
@@ -45,9 +45,16 @@ class LuaMgr
EGN_EXPORT bool EvalStringExpr( const std::string& sExpr, std::string& sVal) ;
EGN_EXPORT bool ExecLine( const std::string& sLine) ;
EGN_EXPORT bool ExecFile( const std::string& sFile) ;
EGN_EXPORT const std::string& GetLastError( void) ;
EGN_EXPORT const std::string& GetLastError( void)
{ return m_sLastError ; }
EGN_EXPORT const std::string& GetLuaLibsDir( void)
{ return m_sLuaLibsDir ; }
EGN_EXPORT const std::string& GetLastRequire( void)
{ return m_sLastRequire ; }
private :
lua_State* m_pL ;
std::string m_sLastError ;
std::string m_sLuaLibsDir ;
std::string m_sLastRequire ;
} ;
+10 -1
View File
@@ -13,7 +13,7 @@
#pragma once
#include "/EgtDev/Include/EgnStringBase.h"
#include "/EgtDev/Include/EgtStringBase.h"
#include "/EgtDev/Include/EgtNumCollection.h"
#include <algorithm>
@@ -142,6 +142,7 @@ bool FromString( const std::string& sVal, double (&dVal)[size])
}
EGN_EXPORT bool FromString( const std::string& sVal, INTVECTOR& vnVal) ;
EGN_EXPORT bool FromString( const std::string& sVal, DBLVECTOR& vdVal) ;
EGN_EXPORT bool FromString( const std::string& sVal, STRVECTOR& vsVal) ;
//----------------------------------------------------------------------------
inline const std::string
@@ -168,8 +169,16 @@ inline const std::string
ToString( bool bVal)
{ return std::string( ( bVal ? "1" : "0")) ; }
EGN_EXPORT const std::string ToString( double dVal, int nPrec = 6) ;
template <size_t size>
const std::string ToString( const double (&dVal)[size], int nPrec = 6)
{ std::string sDest ; sDest.reserve( 14 * size) ;
for ( int i = 0 ; i < size ; ++ i)
sDest += ToString( dVal[i], nPrec) + "," ;
sDest.pop_back() ;
return sDest ; }
EGN_EXPORT const std::string ToString( const INTVECTOR& vnVal, int nPrec = 1) ;
EGN_EXPORT const std::string ToString( const DBLVECTOR& vdVal, int nPrec = 6) ;
EGN_EXPORT const std::string ToString( const STRVECTOR& vsVal) ;
//----------------------------------------------------------------------------
EGN_EXPORT void Split( const std::string& sString, const std::string& sSeparator, bool bFirstVsLast,
+1
View File
@@ -64,6 +64,7 @@ class IEGrScene
virtual bool PanCamera( const Point3d& ptWinOld, const Point3d& ptWinNew) = 0 ;
virtual bool RotateCamera( const Point3d& ptWinOld, const Point3d& ptWinNew) = 0 ;
virtual bool ZoomAll( void) = 0 ;
virtual bool ZoomRadius( double dRadius) = 0 ;
virtual bool ZoomChange( double dCoeff) = 0 ;
virtual bool ZoomOnPoint( const Point3d& ptWin, double dCoeff) = 0 ;
virtual bool ZoomWin( const Point3d& ptWin1, const Point3d& ptWin2) = 0 ;
+2 -2
View File
@@ -316,7 +316,7 @@ EIN_EXPORT BOOL __stdcall EgtExtendCurveStartByLen( int nId, double dLen) ;
EIN_EXPORT BOOL __stdcall EgtExtendCurveEndByLen( int nId, double dLen) ;
EIN_EXPORT BOOL __stdcall EgtTrimExtendCurveByLen( int nId, double dLen, const double ptNear[3], int nRefType) ;
EIN_EXPORT int __stdcall EgtSplitCurve( int nId, int nParts) ;
EIN_EXPORT int __stdcall EgtSplitCurveAtPoint( int nId, double ptOn[3], int nRefType) ;
EIN_EXPORT int __stdcall EgtSplitCurveAtPoint( int nId, const double ptOn[3], int nRefType) ;
EIN_EXPORT BOOL __stdcall EgtOffsetCurve( int nId, double dDist, int nType) ;
EIN_EXPORT BOOL __stdcall EgtModifyCurveCircleCPN( int nId, const double ptOn[3], int nRefType) ;
EIN_EXPORT BOOL __stdcall EgtModifyCurveArcRadius( int nId, double dRad) ;
@@ -351,7 +351,7 @@ EIN_EXPORT BOOL __stdcall EgtCurveLengthAtPoint( int nId, const double ptOn[3],
EIN_EXPORT BOOL __stdcall EgtCurveExtrusion( int nId, int nRefId, double vtExtr[3]) ;
EIN_EXPORT BOOL __stdcall EgtCurveThickness( int nId, double* pdThick) ;
EIN_EXPORT BOOL __stdcall EgtGetMinDistPointCurve( const double ptP[3], int nId, double* pdDist) ;
EIN_EXPORT BOOL __stdcall EgtGetMinDistPntSidePointCurve( const double ptP[3], int nId, double vtN[3],
EIN_EXPORT BOOL __stdcall EgtGetMinDistPntSidePointCurve( const double ptP[3], int nId, const double vtN[3],
double* pdDist, double ptMin[3], int* pnSide) ;
EIN_EXPORT BOOL __stdcall EgtCurveArcRadius( int nId, double* pdRad) ;
EIN_EXPORT BOOL __stdcall EgtCurveArcNormVersor( int nId, int nRefId, double vtNorm[3]) ;
+18 -10
View File
@@ -29,7 +29,8 @@ class __declspec( novtable) IMachMgr
public :
// Basic
virtual ~IMachMgr( void) {}
virtual bool Init( int nContextId, IGeomDB* pGeomDB, const std::string& sMachinesDir) = 0 ;
virtual bool Init( const std::string& sMachinesDir, IGeomDB* pGeomDB,
int nContextId, const std::string& sLuaLibsDir, const std::string& sLuaLastRequire) = 0 ;
virtual bool Update( void) = 0 ;
virtual bool Insert( int nInsGrp) = 0 ;
// MachGroups
@@ -64,6 +65,13 @@ class __declspec( novtable) IMachMgr
virtual bool RemovePartFromRawPart( int nPartId) = 0 ;
virtual bool TranslatePartInRawPart( int nPartId, const Vector3d& vtMove) = 0 ;
virtual bool RotatePartInRawPart( int nPartId, const Vector3d& vtAx, double dAngRotDeg) = 0 ;
// Machine
virtual bool SetAxisPos( const std::string& sAxis, double dVal) = 0 ;
virtual bool GetAxisPos( const std::string& sAxis, double& dVal) = 0 ;
virtual bool GetAxisHomePos( const std::string& sAxis, double& dHomeVal) = 0 ;
virtual bool ResetAxisPos( const std::string& sAxis) = 0 ;
virtual bool LoadTool( const std::string& sHead, int nExit, const std::string& sTool) = 0 ;
virtual bool ResetHeadSet( const std::string& sHead) = 0 ;
} ;
//-----------------------------------------------------------------------------
@@ -73,15 +81,15 @@ extern "C" {
//------------------------ Costanti per flag MoveToCorner ---------------------
// indica la posizione del corner rispetto al grezzo
enum RawPartCornerPos { RPCR_TL = 1, // top left
RPCR_TR = 2, // top right
RPCR_BL = 3, // bottom left
RPCR_BR = 4} ; // bottom right
enum RawPartCornerPos { MCH_CR_TL = 1, // top left
MCH_CR_TR = 2, // top right
MCH_CR_BL = 3, // bottom left
MCH_CR_BR = 4} ; // bottom right
//------------------------ Costanti per flag MoveToCenter ---------------------
// indica la posizione del centro rispetto al grezzo
enum RawPartCenterPos { RPCE_TC = 1, // top center
RPCE_ML = 2, // middle left
RPCE_MR = 3, // middle right
RPCE_BC = 4, // bottom center
RPCE_MC = 5} ; // middle center under
enum RawPartCenterPos { MCH_CE_TC = 1, // top center
MCH_CE_ML = 2, // middle left
MCH_CE_MR = 3, // middle right
MCH_CE_BC = 4, // bottom center
MCH_CE_MC = 5} ; // middle center under
+7
View File
@@ -413,6 +413,12 @@ EXE_EXPORT bool ExeAddPartToRawPart( int nPartId, const Point3d& ptPos, int nRaw
EXE_EXPORT bool ExeRemovePartFromRawPart( int nPartId) ;
EXE_EXPORT bool ExeTranslatePartInRawPart( int nPartId, const Vector3d& vtMove) ;
EXE_EXPORT bool ExeRotatePartInRawPart( int nPartId, const Vector3d& vtAx, double dAngRotDeg) ;
EXE_EXPORT bool ExeSetAxisPos( const std::string& sAxis, double dVal) ;
EXE_EXPORT bool ExeGetAxisPos( const std::string& sAxis, double* pdVal) ;
EXE_EXPORT bool ExeGetAxisHomePos( const std::string& sAxis, double* pdHomeVal) ;
EXE_EXPORT bool ExeResetAxisPos( const std::string& sAxis) ;
EXE_EXPORT bool ExeLoadTool( const std::string& sHead, int nExit, const std::string& sTool) ;
EXE_EXPORT bool ExeResetHeadSet( const std::string& sHead) ;
// Scene
EXE_EXPORT bool ExeInitScene( HWND hWnd, int nDriver, bool b2Buff, int nColorBits, int nDepthBits) ;
@@ -447,6 +453,7 @@ EXE_EXPORT bool ExeSetShowCurveDirection( bool bShow, bool bRedraw) ;
EXE_EXPORT bool ExeGetShowCurveDirection( void) ;
EXE_EXPORT bool ExeSetShowTriaAdv( bool bAdvanced, bool bRedraw) ;
EXE_EXPORT bool ExeGetShowTriaAdv( void) ;
EXE_EXPORT bool ExeZoomRadius( double dRadius, bool bRedraw) ;
EXE_EXPORT bool ExeZoom( int nZoom, bool bRedraw) ;
EXE_EXPORT bool ExeZoomOnPoint( int nWinX, int nWinY, double dCoeff, bool bRedraw) ;
EXE_EXPORT bool ExeSetGeoLine( const Point3d& ptP1, const Point3d& ptP2, bool bRedraw) ;
+1 -1
View File
@@ -14,7 +14,7 @@
#pragma once
#include "/EgtDev/Include/EGnStringUtils.h"
#include "/EgtDev/Include/EGnStringConverter.h"
#include "/EgtDev/Include/EgtStringConverter.h"
#include <Winbase.h>
//----------------------------------------------------------------------------
+2 -2
View File
@@ -33,5 +33,5 @@ typedef std::list<unsigned int> UINT_LIST ; // lista di interi senza seg
//----------------------------------------------------------------------------
// Raccolte di double
typedef std::vector<double> DBLVECTOR ; // vettore di double
typedef std::list<double> DBLLIST ; // lista di double
typedef std::vector<double> DBLVECTOR ; // vettore di double
typedef std::list<double> DBLLIST ; // lista di double
+1 -1
View File
@@ -1,7 +1,7 @@
//----------------------------------------------------------------------------
// EgalTech 2013-2013
//----------------------------------------------------------------------------
// File : EgnStringBase.h Data : 25.11.13 Versione : 1.3a1
// File : EgtStringBase.h Data : 25.11.13 Versione : 1.3a1
// Contenuto : Dichiarazioni di base (costanti, tipi, ...) per le stringhe.
//
//
@@ -1,7 +1,7 @@
//----------------------------------------------------------------------------
// EgalTech 2013-2013
//----------------------------------------------------------------------------
// File : EgnStringConverter.h Data : 10.02.13 Versione : 1.3a1
// File : EgtStringConverter.h Data : 10.02.13 Versione : 1.3a1
// Contenuto : Insieme di classi per convertire stringhe tra vari formati.
//
//
+3 -3
View File
@@ -1,7 +1,7 @@
//----------------------------------------------------------------------------
// EgalTech 2014-2014
//----------------------------------------------------------------------------
// File : EgnStringDecoder.h Data : 01.06.14 Versione : 1.5f1
// File : EgtStringDecoder.h Data : 01.06.14 Versione : 1.5f1
// Contenuto : Insieme di funzioni per decodificare stringhe UTF-8.
//
//
@@ -13,8 +13,8 @@
#pragma once
#include "/EgtDev/Include/EGnStringBase.h"
#include "/EgtDev/Include/EGtNumCollection.h"
#include "/EgtDev/Include/EgtStringBase.h"
#include "/EgtDev/Include/EgtNumCollection.h"
//-----------------------------------------------------------------------------
typedef unsigned char uint8_t ;
+3 -3
View File
@@ -1,7 +1,7 @@
//----------------------------------------------------------------------------
// EgalTech 2014-2014
//----------------------------------------------------------------------------
// File : EgnStringEncoder.h Data : 08.06.14 Versione : 1.5f3
// File : EgtStringEncoder.h Data : 08.06.14 Versione : 1.5f3
// Contenuto : Insieme di funzioni per codificare stringhe UTF-8.
//
//
@@ -13,8 +13,8 @@
#pragma once
#include "/EgtDev/Include/EGnStringConverter.h"
#include "/EgtDev/Include/EGtNumCollection.h"
#include "/EgtDev/Include/EgtStringConverter.h"
#include "/EgtDev/Include/EgtNumCollection.h"
//-----------------------------------------------------------------------------
bool inline