5580700af2
- modifiche a interfaccia di EgtCreateSurfTmSwept.
196 lines
7.6 KiB
C++
196 lines
7.6 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2014-2014
|
|
//----------------------------------------------------------------------------
|
|
// File : API_GdbCreateSurf.cpp Data : 02.11.14 Versione : 1.5j7
|
|
// Contenuto : Funzioni di creazione superfici del DB geometrico per API.
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 02.11.14 DS Creazione modulo.
|
|
//
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
//--------------------------- Include ----------------------------------------
|
|
#include "stdafx.h"
|
|
#include "API.h"
|
|
#include "/EgtDev/Include/EInAPI.h"
|
|
#include "/EgtDev/Include/EXeExecutor.h"
|
|
|
|
using namespace std ;
|
|
|
|
//-------------------------------------------------------------------------------
|
|
int
|
|
__stdcall EgtCreateSurfFrRectangle( int nParentId, const double ptIni[3], const double ptCross[3], int nRefType)
|
|
{
|
|
return ExeCreateSurfFrRectangle( nParentId, ptIni, ptCross, nRefType) ;
|
|
}
|
|
|
|
//-------------------------------------------------------------------------------
|
|
int
|
|
__stdcall EgtCreateSurfFlatRegion( int nParentId, int nNumId, const int nCrvIds[])
|
|
{
|
|
INTVECTOR vCrvIds ;
|
|
vCrvIds.reserve( nNumId) ;
|
|
for ( int i = 0 ; i < nNumId ; ++i) {
|
|
vCrvIds.push_back( nCrvIds[i]) ;
|
|
}
|
|
return ExeCreateSurfFlatRegion( nParentId, vCrvIds, nullptr) ;
|
|
}
|
|
|
|
//-------------------------------------------------------------------------------
|
|
int
|
|
__stdcall EgtCreateSurfTmBBox( int nParentId, const double ptMin[3], const double ptMax[3], int nRefType)
|
|
{
|
|
BBox3d b3Box ;
|
|
// per conservare un box vuoto
|
|
if ( ptMin[0] < ( ptMax[0] + EPS_SMALL) &&
|
|
ptMin[1] < ( ptMax[1] + EPS_SMALL) &&
|
|
ptMin[2] < ( ptMax[2] + EPS_SMALL))
|
|
b3Box.Set( ptMin, ptMax) ;
|
|
// eseguo
|
|
return ExeCreateSurfTmBBox( nParentId, b3Box, false, nRefType) ;
|
|
}
|
|
|
|
//-------------------------------------------------------------------------------
|
|
int
|
|
__stdcall EgtCreateSurfTmBox( int nParentId, const double ptIni[3], const double ptCross[3],
|
|
const double ptDir[3], double dHeight, int nRefType)
|
|
{
|
|
return ExeCreateSurfTmBox( nParentId, ptIni, ptCross, ptDir, dHeight, false, nRefType) ;
|
|
}
|
|
|
|
//-------------------------------------------------------------------------------
|
|
int
|
|
__stdcall EgtCreateSurfTmPyramid( int nParentId, const double ptIni[3], const double ptCross[3],
|
|
const double ptDir[3], double dHeight, int nRefType)
|
|
{
|
|
return ExeCreateSurfTmPyramid( nParentId, ptIni, ptCross, ptDir, dHeight, nRefType) ;
|
|
}
|
|
|
|
//-------------------------------------------------------------------------------
|
|
int
|
|
__stdcall EgtCreateSurfTmCylinder( int nParentId, const double ptOrig[3], const double vtN[3],
|
|
double dRad, double dHeight, double dLinTol, int nRefType)
|
|
{
|
|
return ExeCreateSurfTmCylinder( nParentId, ptOrig, vtN, dRad, dHeight, dLinTol, nRefType) ;
|
|
}
|
|
|
|
//-------------------------------------------------------------------------------
|
|
int
|
|
__stdcall EgtCreateSurfTmCone( int nParentId, const double ptOrig[3], const double vtN[3],
|
|
double dRad, double dHeight, double dLinTol, int nRefType)
|
|
{
|
|
return ExeCreateSurfTmCone( nParentId, ptOrig, vtN, dRad, dHeight, dLinTol, nRefType) ;
|
|
}
|
|
|
|
//-------------------------------------------------------------------------------
|
|
int
|
|
__stdcall EgtCreateSurfTmSphere( int nParentId, const double ptOrig[3],
|
|
double dRad, double dLinTol, int nRefType)
|
|
{
|
|
return ExeCreateSurfTmSphere( nParentId, ptOrig, dRad, dLinTol, nRefType) ;
|
|
}
|
|
|
|
//-------------------------------------------------------------------------------
|
|
int
|
|
__stdcall EgtCreateSurfTmByFlatContour( int nParentId, int nCrvId, double dLinTol)
|
|
{
|
|
return ExeCreateSurfTmByFlatContour( nParentId, nCrvId, dLinTol) ;
|
|
}
|
|
|
|
//-------------------------------------------------------------------------------
|
|
int
|
|
__stdcall EgtCreateSurfTmByRegion( int nParentId, int nNumId, const int nCrvIds[], double dLinTol)
|
|
{
|
|
INTVECTOR vCrvIds ;
|
|
vCrvIds.reserve( nNumId) ;
|
|
for ( int i = 0 ; i < nNumId ; ++i) {
|
|
vCrvIds.push_back( nCrvIds[i]) ;
|
|
}
|
|
return ExeCreateSurfTmByRegion( nParentId, vCrvIds, dLinTol) ;
|
|
}
|
|
|
|
//-------------------------------------------------------------------------------
|
|
int
|
|
__stdcall EgtCreateSurfTmByExtrusion( int nParentId, int nNumId, const int nCrvIds[],
|
|
const double vtExtr[3], double dLinTol, int nRefType)
|
|
{
|
|
INTVECTOR vCrvIds ;
|
|
vCrvIds.reserve( nNumId) ;
|
|
for ( int i = 0 ; i < nNumId ; ++i) {
|
|
vCrvIds.push_back( nCrvIds[i]) ;
|
|
}
|
|
return ExeCreateSurfTmByExtrusion( nParentId, vCrvIds, vtExtr, dLinTol, nRefType) ;
|
|
}
|
|
|
|
//-------------------------------------------------------------------------------
|
|
int
|
|
__stdcall EgtCreateSurfTmByRegionExtrusion( int nParentId, int nNumId, const int nCrvIds[],
|
|
const double vtExtr[3], double dLinTol, int nRefType)
|
|
{
|
|
INTVECTOR vCrvIds ;
|
|
vCrvIds.reserve( nNumId) ;
|
|
for ( int i = 0 ; i < nNumId ; ++i) {
|
|
vCrvIds.push_back( nCrvIds[i]) ;
|
|
}
|
|
return ExeCreateSurfTmByRegionExtrusion( nParentId, vCrvIds, vtExtr, dLinTol, nRefType) ;
|
|
}
|
|
|
|
//-------------------------------------------------------------------------------
|
|
int
|
|
__stdcall EgtCreateSurfTmByRevolve( int nParentId, int nCrvId,
|
|
const double ptAx[3], const double vtAx[3],
|
|
BOOL bCapEnds, double dLinTol, int nRefType)
|
|
{
|
|
return ExeCreateSurfTmByRevolve( nParentId, nCrvId, ptAx, vtAx, ( bCapEnds != FALSE), dLinTol, nRefType) ;
|
|
}
|
|
|
|
//-------------------------------------------------------------------------------
|
|
int
|
|
__stdcall EgtCreateSurfTmByScrewing( int nParentId, int nCrvId,
|
|
const double ptAx[3], const double vtAx[3],
|
|
double dAngRotDeg, double dMove, BOOL bCapEnds, double dLinTol, int nRefType)
|
|
{
|
|
return ExeCreateSurfTmByScrewing( nParentId, nCrvId, ptAx, vtAx, dAngRotDeg, dMove, ( bCapEnds != FALSE), dLinTol, nRefType) ;
|
|
}
|
|
|
|
//-------------------------------------------------------------------------------
|
|
int
|
|
__stdcall EgtCreateSurfTmSwept( int nParentId, int nSectId, int nGuideId, const double vtAx[3],
|
|
BOOL bCapEnds, double dLinTol, int nRefType)
|
|
{
|
|
return ExeCreateSurfTmSwept( nParentId, nSectId, nGuideId, vtAx, ( bCapEnds != FALSE), dLinTol, nRefType) ;
|
|
}
|
|
|
|
//-------------------------------------------------------------------------------
|
|
int
|
|
__stdcall EgtCreateSurfTmRuled( int nParentId, int nPtOrCrvId1, int nPtOrCrvId2, int nType, double dLinTol)
|
|
{
|
|
return ExeCreateSurfTmRuled( nParentId, nPtOrCrvId1, nPtOrCrvId2, nType, dLinTol) ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
int
|
|
__stdcall EgtCreateSurfTmByTriangles( int nParentId, int nNumId, const int nIds[], BOOL bErase)
|
|
{
|
|
INTVECTOR vIds ;
|
|
vIds.reserve( nNumId) ;
|
|
for ( int i = 0 ; i < nNumId ; ++i) {
|
|
vIds.push_back( nIds[i]) ;
|
|
}
|
|
return ExeCreateSurfTmByTriangles( nParentId, vIds, ( bErase != FALSE)) ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
int
|
|
__stdcall EgtCreateSurfTmBySewing( int nParentId, int nNumId, const int nIds[], BOOL bErase)
|
|
{
|
|
INTVECTOR vIds ;
|
|
vIds.reserve( nNumId) ;
|
|
for ( int i = 0 ; i < nNumId ; ++i) {
|
|
vIds.push_back( nIds[i]) ;
|
|
}
|
|
return ExeCreateSurfTmBySewing( nParentId, vIds, ( bErase != FALSE)) ;
|
|
}
|