diff --git a/EGkLuaAux.h b/EGkLuaAux.h index 39117a2..e561a7a 100644 --- a/EGkLuaAux.h +++ b/EGkLuaAux.h @@ -405,9 +405,9 @@ LuaSetParam( lua_State* L, const SELVECTOR& vSel) for ( int i = 1 ; i <= nDim ; ++ i) { // creo tavola lua_createtable( L, 2, 0) ; - lua_pushnumber( L, vSel[i-1].nId) ; + lua_pushinteger( L, vSel[i-1].nId) ; lua_rawseti( L, -2, 1) ; - lua_pushnumber( L, vSel[i-1].nSub) ; + lua_pushinteger( L, vSel[i-1].nSub) ; lua_rawseti( L, -2, 2) ; // la metto nel vettore lua_rawseti( L, -2, i) ; diff --git a/EGkPolyArc.h b/EGkPolyArc.h index 9446ce8..301a66f 100644 --- a/EGkPolyArc.h +++ b/EGkPolyArc.h @@ -35,6 +35,7 @@ class PolyArc EGK_EXPORT bool Clear( void) ; EGK_EXPORT bool SetExtrusion( const Vector3d& vtExtr) ; EGK_EXPORT bool AddUPoint( double dPar, const Point3d& ptP, double dBulge) ; + EGK_EXPORT bool ModifyLastParam( double dPar) ; EGK_EXPORT bool ModifyLastBulge( double dBulge) ; EGK_EXPORT bool Close( void) ; EGK_EXPORT bool EraseFirstUPoint( void) ; diff --git a/EGkPolyLine.h b/EGkPolyLine.h index 4a8e956..3b7484f 100644 --- a/EGkPolyLine.h +++ b/EGkPolyLine.h @@ -35,6 +35,7 @@ class PolyLine EGK_EXPORT bool Clear( void) ; EGK_EXPORT bool AddUPoint( double dPar, const Point3d& ptP) ; EGK_EXPORT bool Close( void) ; + EGK_EXPORT bool ModifyLastParam( double dPar) ; EGK_EXPORT bool EraseFirstUPoint( void) ; EGK_EXPORT bool EraseLastUPoint( void) ; EGK_EXPORT bool AddOffsetToU( double dOffset) ; diff --git a/EGkSurfTriMesh.h b/EGkSurfTriMesh.h index e71cba3..0741114 100644 --- a/EGkSurfTriMesh.h +++ b/EGkSurfTriMesh.h @@ -75,11 +75,13 @@ class __declspec( novtable) ISurfTriMesh : public ISurf virtual int GetFacetFromTria( int nT) const = 0 ; virtual bool GetAllTriaInFacet( int nF, INTVECTOR& vT) const = 0 ; virtual bool GetFacetLoops( int nF, POLYLINEVECTOR& vPL) const = 0 ; + virtual bool GetFacetAdjacencies( int nF, INTMATRIX& vAdj) const = 0 ; virtual bool GetFacetNearestEndPoint( int nF, const Point3d& ptNear, Point3d& ptEnd, Vector3d& vtN) const = 0 ; virtual bool GetFacetNearestMidPoint( int nF, const Point3d& ptNear, Point3d& ptMid, Vector3d& vtN) const = 0 ; virtual bool GetFacetCenter( int nF, Point3d& ptCen, Vector3d& vtN) const = 0 ; virtual bool GetFacetNormal( int nF, Vector3d& vtN) const = 0 ; virtual bool GetFacetArea( int nF, double& dArea) const = 0 ; + virtual bool GetFacetsContact( int nF1, int nF2, bool& bAdjac, Point3d& ptP1, Point3d& ptP2, double& dAng) const = 0 ; virtual ISurfTriMesh* CloneFacet( int nF) const = 0 ; virtual bool Cut( const Plane3d& plPlane, bool bSaveOnEq) = 0 ; } ; diff --git a/EGnLuaAux.h b/EGnLuaAux.h index 0698829..6846e04 100644 --- a/EGnLuaAux.h +++ b/EGnLuaAux.h @@ -341,6 +341,35 @@ LuaSetParam( lua_State* L, const INTVECTOR& vPar) return true ; } +//------------------------------------------------------------------------------- +inline bool +LuaSetParam( lua_State* L, const INTMATRIX& vPar) +{ + try { + // recupero prima dimensione + int nDim1 = int( vPar.size()) ; + // creo tavola principale + lua_createtable( L, nDim1, 0) ; + // creo e inserisco tavola per ogni componente + for ( int i = 1 ; i <= nDim1 ; ++ i) { + // recupero seconda dimensione + int nDim2 = int( vPar[i-1].size()) ; + // creo tavola componente + lua_createtable( L, nDim2, 0) ; + for ( int j = 1 ; j <= nDim2 ; ++ j) { + lua_pushinteger( L, vPar[i-1][j-1]) ; + lua_rawseti( L, -2, j) ; + } + // la metto nel vettore + lua_rawseti( L, -2, i) ; + } + } + catch( ...) { + return false ; + } + return true ; +} + //---------------------------------------------------------------------------- inline bool LuaSetParam( lua_State* L, const DBLVECTOR& vPar) diff --git a/EXeExecutor.h b/EXeExecutor.h index e6bef6c..8ac787a 100644 --- a/EXeExecutor.h +++ b/EXeExecutor.h @@ -516,12 +516,14 @@ EXE_EXPORT int ExeSurfFrChunkCount( int nId) ; EXE_EXPORT int ExeSurfFrChunkSimpleClassify( int nId1, int nChunk1, int nId2, int nChunk2) ; EXE_EXPORT int ExeSurfTmFacetCount( int nId) ; EXE_EXPORT int ExeSurfTmFacetFromTria( int nId, int nT) ; +EXE_EXPORT bool ExeSurfTmFacetAdjacencies( int nId, int nFacet, INTMATRIX& vAdj) ; EXE_EXPORT bool ExeSurfTmFacetNearestEndPoint( int nId, int nFacet, const Point3d& ptNear, int nRefId, Point3d& ptEnd, Vector3d& vtN) ; EXE_EXPORT bool ExeSurfTmFacetNearestMidPoint( int nId, int nFacet, const Point3d& ptNear, int nRefId, Point3d& ptMid, Vector3d& vtN) ; EXE_EXPORT bool ExeSurfTmFacetCenter( int nId, int nFacet, int nRefId, Point3d& ptCen, Vector3d& vtN) ; EXE_EXPORT bool ExeSurfTmFacetNormVersor( int nId, int nFacet, int nRefId, Vector3d& vtNorm) ; +EXE_EXPORT bool ExeSurfTmFacetsContact( int nId, int nF1, int nF2, int nRefId, bool& bAdjac, Point3d& ptP1, Point3d& ptP2, double& dAng) ; EXE_EXPORT bool ExeTextNormVersor( int nId, int nRefId, Vector3d& vtNorm) ; EXE_EXPORT bool ExeTextGetContent( int nId, std::string& sText) ; EXE_EXPORT bool ExePointToIdGlob( Point3d& ptP, int nId) ; diff --git a/EgtNumCollection.h b/EgtNumCollection.h index cb950c4..d21bf46 100644 --- a/EgtNumCollection.h +++ b/EgtNumCollection.h @@ -23,8 +23,9 @@ typedef std::list BOOLLIST ; // lista di bool //---------------------------------------------------------------------------- // Raccolte di interi -typedef std::vector INTVECTOR ; // vettore di interi -typedef std::list INT_LIST ; // lista di interi (con _ per non collidere con Win) +typedef std::vector INTVECTOR ; // vettore di interi +typedef std::list INT_LIST ; // lista di interi (con _ per non collidere con Win) +typedef std::vector> INTMATRIX ; // matrice di interi //---------------------------------------------------------------------------- // Raccolte di interi senza segno