EgtInterface 1.6i5 :

- estensione Nesting di rettangoli.
This commit is contained in:
Dario Sassi
2015-09-10 21:45:18 +00:00
parent 10e170916e
commit bb67fd65d7
2 changed files with 63 additions and 2 deletions
+63 -2
View File
@@ -28,7 +28,68 @@ __stdcall EgtCreateFlatParts( int nType)
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtPackPart( int nId, double dXmin, double dYmin, double dXmax, double dOffs)
__stdcall EgtPackPart( int nId, double dXmin, double dYmin,
double dXmax, double dYmax, double dOffs, BOOL bBottomUp)
{
return ( ExePackPart( nId, dXmin, dYmin, dXmax, dOffs) ? TRUE : FALSE) ;
return ( ExePackPart( nId, dXmin, dYmin, dXmax, dYmax, dOffs, bBottomUp != FALSE) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtPackCluster( int nId[], int nCount, double dXmin, double dYmin,
double dXmax, double dYmax, double dOffs, BOOL bBottomUp)
{
// verifico
if ( nId == nullptr || nCount <= 0)
return false ;
// riempio il vettore
INTVECTOR vIds ;
vIds.reserve( nCount) ;
for ( int i = 0 ; i < nCount ; ++ i)
vIds.push_back( nId[i]) ;
// eseguo
return ( ExePackCluster( vIds, dXmin, dYmin, dXmax, dYmax, dOffs, bBottomUp != FALSE) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtGetClusterBBoxGlob( int nId[], int nCount, double ptMin[3], double ptMax[3])
{
// verifico
if ( nId == nullptr || nCount <= 0)
return false ;
// riempio il vettore
INTVECTOR vIds ;
vIds.reserve( nCount) ;
for ( int i = 0 ; i < nCount ; ++ i)
vIds.push_back( nId[i]) ;
// recupero il bounding box dell'oggetto in globale
BBox3d b3Box ;
if ( ! ExeGetClusterBBoxGlob( vIds, b3Box))
return FALSE ;
// converto il risultato
ptMin[0] = b3Box.GetMin().x ;
ptMin[1] = b3Box.GetMin().y ;
ptMin[2] = b3Box.GetMin().z ;
ptMax[0] = b3Box.GetMax().x ;
ptMax[1] = b3Box.GetMax().y ;
ptMax[2] = b3Box.GetMax().z ;
return TRUE ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtMoveCluster( int nId[], int nCount, const double vtMove[3],
double dXmin, double dYmin, double dXmax, double dYmax, double dOffs)
{
// verifico
if ( nId == nullptr || nCount <= 0)
return false ;
// riempio il vettore
INTVECTOR vIds ;
vIds.reserve( nCount) ;
for ( int i = 0 ; i < nCount ; ++ i)
vIds.push_back( nId[i]) ;
// eseguo
return ( ExeMoveCluster( vIds, vtMove, dXmin, dYmin, dXmax, dYmax, dOffs) ? TRUE : FALSE) ;
}