Files
EgtInterface/API_GdbCreateCurve.cpp
T
Dario Sassi c2af8621bc EgtInterface 1.6f3 :
- eliminata EgtCreateCurveCompoByApprox
- riunite diverse EgtApproxCurve in una unica.
2015-06-21 17:02:35 +00:00

262 lines
11 KiB
C++

//----------------------------------------------------------------------------
// EgalTech 2014-2014
//----------------------------------------------------------------------------
// File : API_GdbCreateCurve.cpp Data : 02.11.14 Versione : 1.5j7
// Contenuto : Funzioni di creazione curve 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 EgtCreateCurveLine( int nParentId, const double ptIni[3], const double ptFin[3], int nRefType)
{
return ExeCreateCurveLine( nParentId, ptIni, ptFin, nRefType) ;
}
//-------------------------------------------------------------------------------
int
__stdcall EgtCreateCurveLineEx( int nParentId, const double ptIni[3], int nSepI, int nIdI,
const double ptFin[3], int nSepF, int nIdF, int nRefType)
{
return ExeCreateCurveLineEx( nParentId, ptIni, nSepI, nIdI, ptFin, nSepF, nIdF, nRefType) ;
}
//-------------------------------------------------------------------------------
int
__stdcall EgtCreateCurveLinePVL( int nParentId, const double ptIni[3],
const double vtDir[3], double dLen, int nRefType)
{
return ExeCreateCurveLinePVL( nParentId, ptIni, vtDir, dLen, nRefType) ;
}
//-------------------------------------------------------------------------------
int
__stdcall EgtCreateCurveLineMinPointCurve( int nParentId,
const double ptStart[3], int nCrvId, double dNearPar, int nRefType)
{
return ExeCreateCurveLineMinPointCurve( nParentId, ptStart, nCrvId, dNearPar, nRefType) ;
}
//-------------------------------------------------------------------------------
int
__stdcall EgtCreateCurveCircle( int nParentId, const double ptCen[3],
const double vtN[3], double dRad, int nRefType)
{
return ExeCreateCurveCircle( nParentId, ptCen, vtN, dRad, nRefType) ;
}
//-------------------------------------------------------------------------------
int
__stdcall EgtCreateCurveCircleCPN( int nParentId, const double ptCen[3],
const double ptOn[3], const double vtN[3], int nRefType)
{
return ExeCreateCurveCircleCPN( nParentId, ptCen, ptOn, vtN, nRefType) ;
}
//-------------------------------------------------------------------------------
int
__stdcall EgtCreateCurveCircleCPNEx( int nParentId, const double ptCen[3],
const double ptOn[3], int nSepO, int nIdO, const double vtN[3], int nRefType)
{
return ExeCreateCurveCircleCPNEx( nParentId, ptCen, ptOn, nSepO, nIdO, vtN, nRefType) ;
}
//-------------------------------------------------------------------------------
int
__stdcall EgtCreateCurveCircle3P( int nParentId, const double ptP1[3],
const double ptP2[3], const double ptP3[3], int nRefType)
{
return ExeCreateCurveCircle3P( nParentId, ptP1, ptP2, ptP3, nRefType) ;
}
//-------------------------------------------------------------------------------
int
__stdcall EgtCreateCurveArc( int nParentId,
const double ptCen[3], const double vtN[3], double dRad,
const double vtS[3], double dAngCenDeg, double dDeltaN, int nRefType)
{
return ExeCreateCurveArc( nParentId, ptCen, vtN, dRad, vtS, dAngCenDeg, dDeltaN, nRefType) ;
}
//-------------------------------------------------------------------------------
int
__stdcall EgtCreateCurveArcC2PN( int nParentId, const double ptCen[3], const double ptStart[3],
const double ptNearEnd[3], const double vtNorm[3], int nRefType)
{
return ExeCreateCurveArcC2PN( nParentId, ptCen, ptStart, ptNearEnd, vtNorm, nRefType) ;
}
int
__stdcall EgtCreateCurveArcC2PNEx( int nParentId, const double ptCen[3],
const double ptStart[3], int nSepS, int nIdS,
const double ptNearEnd[3], const double vtNorm[3], int nRefType)
{
return ExeCreateCurveArcC2PNEx( nParentId, ptCen, ptStart, nSepS, nIdS, ptNearEnd, vtNorm, nRefType) ;
}
//-------------------------------------------------------------------------------
int
__stdcall EgtCreateCurveArc3P( int nParentId, const double ptP1[3],
const double ptP2[3], const double ptP3[3], int nRefType)
{
return ExeCreateCurveArc3P( nParentId, ptP1, ptP2, ptP3, nRefType) ;
}
//-------------------------------------------------------------------------------
int
__stdcall EgtCreateCurveArc2PVN( int nParentId, const double ptStart[3], const double ptEnd[3],
const double vtDirS[3], const double vtNorm[3], int nRefType)
{
return ExeCreateCurveArc2PVN( nParentId, ptStart, ptEnd, vtDirS, vtNorm, nRefType) ;
}
//-------------------------------------------------------------------------------
int
__stdcall EgtCreateCurveArc2PVNEx( int nParentId, const double ptStart[3],
const double ptEnd[3], int nSep, int nId,
const double vtDirS[3], const double vtNorm[3], int nRefType)
{
return ExeCreateCurveArc2PVNEx( nParentId, ptStart, ptEnd, nSep, nId, vtDirS, vtNorm, nRefType) ;
}
//-------------------------------------------------------------------------------
int
__stdcall EgtCreateCurveFillet( int nParentId, int nCrv1, const double ptNear1[3],
int nCrv2, const double ptNear2[3],
const double vtNorm[3], double dRad, BOOL bTrim, int nRefType)
{
return ExeCreateCurveFillet( nParentId, nCrv1, ptNear1, nCrv2, ptNear2, vtNorm, dRad, ( bTrim != FALSE), nRefType) ;
}
//-------------------------------------------------------------------------------
int
__stdcall EgtCreateCurveChamfer( int nParentId, int nCrv1, const double ptNear1[3],
int nCrv2, const double ptNear2[3],
const double vtNorm[3], double dDist, BOOL bTrim, int nRefType)
{
return ExeCreateCurveChamfer( nParentId, nCrv1, ptNear1, nCrv2, ptNear2, vtNorm, dDist, ( bTrim != FALSE), nRefType) ;
}
//-------------------------------------------------------------------------------
int
__stdcall EgtCreateCurveBezier( int nParentId, int nDegree, const double ptCtrls[], int nRefType)
{
PNTVECTOR vPnt ;
vPnt.reserve( nDegree + 1) ;
for ( int i = 0 ; i <= nDegree ; ++i) {
vPnt.emplace_back( ptCtrls[3*i], ptCtrls[3*i+1], ptCtrls[3*i+2]) ;
}
return ExeCreateCurveBezier( nParentId, nDegree, vPnt, nRefType) ;
}
//-------------------------------------------------------------------------------
int
__stdcall EgtCreateCurveBezierRational( int nParentId, int nDegree, const double ptCtrlWs[], int nRefType)
{
PNTUVECTOR vPntW ;
vPntW.reserve( nDegree + 1) ;
for ( int i = 0 ; i <= nDegree ; ++i) {
vPntW.emplace_back( Point3d( ptCtrlWs[4*i], ptCtrlWs[4*i+1], ptCtrlWs[4*i+2]), ptCtrlWs[4*i+3]) ;
}
return ExeCreateCurveBezierRational( nParentId, nDegree, vPntW, nRefType) ;
}
//-------------------------------------------------------------------------------
int
__stdcall EgtCreateCurveBezierFromArc( int nParentId, int nArcId, BOOL bErase)
{
return ExeCreateCurveBezierFromArc( nParentId, nArcId, ( bErase != FALSE)) ;
}
//-------------------------------------------------------------------------------
int
__stdcall EgtCreateCurveCompo( 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 ExeCreateCurveCompo( nParentId, vIds, ( bErase != FALSE)) ;
}
//-------------------------------------------------------------------------------
int
__stdcall EgtCreateCurveCompoByChain( int nParentId, int nNumId, const int nIds[],
const double ptNear[3], BOOL bErase, int nRefType)
{
INTVECTOR vIds ;
vIds.reserve( nNumId) ;
for ( int i = 0 ; i < nNumId ; ++i) {
vIds.push_back( nIds[i]) ;
}
return ExeCreateCurveCompoByChain( nParentId, vIds, ptNear, ( bErase != FALSE), nRefType, nullptr) ;
}
//-------------------------------------------------------------------------------
int
__stdcall EgtCreateCurveCompoFromPoints( int nParentId, int nP, const double ptPs[], int nRefType)
{
PolyLine PL ;
for ( int i = 0 ; i < nP ; ++i) {
PL.AddUPoint( 0, Point3d( ptPs[3*i], ptPs[3*i+1], ptPs[3*i+2])) ;
}
return ExeCreateCurveCompoFromPoints( nParentId, PL, nRefType) ;
}
//-------------------------------------------------------------------------------
int
__stdcall EgtCreateCurveCompoFromPointBulges( int nParentId, int nPB, const double ptPBs[], int nRefType)
{
PolyArc PA ;
for ( int i = 0 ; i < nPB ; ++i) {
PA.AddUPoint( 0, Point3d( ptPBs[4*i], ptPBs[4*i+1], ptPBs[4*i+2]), ptPBs[4*i+3]) ;
}
return ExeCreateCurveCompoFromPointBulges( nParentId, PA, nRefType) ;
}
//-------------------------------------------------------------------------------
int
__stdcall EgtCreateRectangle3P( int nParentId, const double ptIni[3],
const double ptCross[3], const double ptDir[3], int nRefType)
{
return ExeCreateRectangle3P( nParentId, ptIni, ptCross, ptDir, nRefType) ;
}
//-------------------------------------------------------------------------------
int
__stdcall EgtCreatePolygonFromRadius( int nParentId, int nNumSides, const double ptCen[3],
const double ptCorn[3], const double vtN[3], int nRefType)
{
return ExeCreatePolygonFromRadius( nParentId, nNumSides, ptCen, ptCorn, vtN, nRefType) ;
}
//-------------------------------------------------------------------------------
int
__stdcall EgtCreatePolygonFromApothem( int nParentId, int nNumSides, const double ptCen[3],
const double ptMid[3], const double vtN[3], int nRefType)
{
return ExeCreatePolygonFromApothem( nParentId, nNumSides, ptCen, ptMid, vtN, nRefType) ;
}
//-------------------------------------------------------------------------------
int
__stdcall EgtCreatePolygonFromSide( int nParentId, int nNumSides, const double ptIni[3],
const double ptFin[3], const double vtN[3], int nRefType)
{
return ExeCreatePolygonFromSide( nParentId, nNumSides, ptIni, ptFin, vtN, nRefType) ;
}