Include :
- aggiornamento prototipi - aggiunta funzione LuaSetParam con INTMATRIX.
This commit is contained in:
+2
-2
@@ -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) ;
|
||||
|
||||
@@ -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) ;
|
||||
|
||||
@@ -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) ;
|
||||
|
||||
@@ -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 ;
|
||||
} ;
|
||||
|
||||
+29
@@ -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)
|
||||
|
||||
@@ -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) ;
|
||||
|
||||
+3
-2
@@ -23,8 +23,9 @@ typedef std::list<bool> BOOLLIST ; // lista di bool
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Raccolte di interi
|
||||
typedef std::vector<int> INTVECTOR ; // vettore di interi
|
||||
typedef std::list<int> INT_LIST ; // lista di interi (con _ per non collidere con Win)
|
||||
typedef std::vector<int> INTVECTOR ; // vettore di interi
|
||||
typedef std::list<int> INT_LIST ; // lista di interi (con _ per non collidere con Win)
|
||||
typedef std::vector<std::vector<int>> INTMATRIX ; // matrice di interi
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Raccolte di interi senza segno
|
||||
|
||||
Reference in New Issue
Block a user