Files
EgtInterface/API.h
T
Dario Sassi 18bf9c19e1 EgtInterface 1.6c8 :
- gestione inserimento in testa ad un gruppo
- gestione Machinings.
2015-03-25 14:34:53 +00:00

158 lines
8.9 KiB
C++

//----------------------------------------------------------------------------
// EgalTech 2014-2014
//----------------------------------------------------------------------------
// File : API.h Data : 01.09.14 Versione : 1.5l1
// Contenuto : Dichiarazioni locali per moduli API.
//
//
//
// Modifiche : 01.09.14 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
#pragma once
#include "GseContext.h"
#include "/EgtDev/Include/EGkGeoCollection.h"
#include "/EgtDev/Include/EGkPolyArc.h"
#include "/EgtDev/Include/EgtILogger.h"
//----------------------------------------------------------------------------
ILogger* GetLogger( void) ;
ILogger* GetCmdLogger( void) ;
bool SetCmdLog( bool bVal) ;
bool IsCmdLog( void) ;
//--------------------------- General ----------------------------------------
bool EgtGetVersionInfo( std::string& sVer, const char* szNewLine) ;
//--------------------------- GeomDB -----------------------------------------
bool EgtSetGridFrame( const Frame3d& frFrame) ;
bool EgtGetGridFrame( int nRefId, Frame3d& frFrame) ;
bool EgtGetGridVersZ( int nRefId, Vector3d& vtVersZ) ;
bool EgtSetCurrFilePath( const std::string& sFilePath) ;
bool EgtGetCurrFilePath( std::string& sFilePath) ;
bool EgtOpenFile( const std::string& sFilePath) ;
bool EgtInsertFile( const std::string& sFilePath) ;
bool EgtSaveFile( const std::string& sFilePath, int nFlag) ;
//--------------------------- GeomDBCreate -----------------------------------
int EgtCreateText( int nParentId, const Point3d& ptP, double dAngRotDeg,
const std::string& sText, double dH, int nRefType) ;
int EgtCreateTextEx( int nParentId, const Point3d& ptP, const Vector3d& vtN, const Vector3d& vtD,
const std::string& sText, const std::string& sFont, bool bItalic, double dH, int nRefType) ;
int EgtCreateTextAdv( int nParentId, const Point3d& ptP, const Vector3d& vtN, const Vector3d& vtD,
const std::string& sText, const std::string& sFont,
int nW, bool bItalic, double dH, double dRat, double dAddAdv, int nInsPos, int nRefType) ;
//--------------------------- GeomDBCreateCurve ------------------------------
int EgtCreateCurveBezier( int nParentId, int nDegree, const PNTVECTOR& vPnt, int nRefType) ;
int EgtCreateCurveBezierRational( int nParentId, int nDegree, const PNTUVECTOR& vPntW, int nRefType) ;
int EgtCreateCurveCompo( int nParentId, const INTVECTOR& vIds, bool bErase) ;
int EgtCreateCurveCompoByChain( int nParentId, const INTVECTOR& vIds,
const Point3d& ptNear, bool bErase, int nRefType) ;
int EgtCreateCurveCompoFromPoints( int nParentId, const PolyLine& PL, int nRefType) ;
int EgtCreateCurveCompoFromPointBulges( int nParentId, const PolyArc& PA, int nRefType) ;
//--------------------------- GeomDBCreateSurface ----------------------------
int EgtCreateSurfTmByRegion( int nParentId, INTVECTOR& vCrvIds, double dLinTol) ;
int EgtCreateSurfTmByExtrusion( int nParentId, INTVECTOR& vCrvIds, const Vector3d& vtExtr,
double dLinTol, int nRefType) ;
int EgtCreateSurfTmByRegionExtrusion( int nParentId, INTVECTOR& vCrvIds, const Vector3d& vtExtr,
double dLinTol, int nRefType) ;
int EgtCreateSurfTmByTriangles( int nParentId, const INTVECTOR& vIds, bool bErase) ;
int EgtCreateSurfTmBySewing( int nParentId, const INTVECTOR& vIds, bool bErase) ;
//--------------------------- GdbModify --------------------------------------
bool EgtChangeGroupFrame( int nId, const Frame3d& frNewRef, int nRefType) ;
bool EgtModifyText( int nId, const std::string& sNewText) ;
bool EgtChangeTextFont( int nId, const std::string& sNewFont) ;
//--------------------------- GdbModifyCurve ---------------------------------
bool EgtInvertCurve( const INTVECTOR& vIds) ;
bool EgtModifyCurveExtrusion( const INTVECTOR& vIds, const Vector3d& vtExtr, int nRefType) ;
bool EgtModifyCurveThickness( const INTVECTOR& vIds, double dThick) ;
//--------------------------- GdbModifySurf ----------------------------------
bool EgtInvertSurface( const INTVECTOR& vIds) ;
//--------------------------- GdbObjects -------------------------------------
int EgtGetFirstNameInGroup( int nGroupId, const std::string& sName) ;
int EgtGetNextName( int nId, const std::string& sName) ;
bool EgtErase( const INTVECTOR& vIds) ;
//--------------------------- GdbObjAttribs ----------------------------------
bool EgtSetStatus( const INTVECTOR& vIds, int nStat) ;
bool EgtSetColor( const INTVECTOR& vIds, const Color& cCol, bool bSetAlpha) ;
bool EgtSetAlpha( const INTVECTOR& vIds, int nAlpha) ;
bool EgtResetColor( const INTVECTOR& vIds) ;
bool EgtSetName( int nId, const std::string& sName) ;
bool EgtGetName( int nId, std::string& sName) ;
bool EgtSetInfo( int nId, const std::string& sKey, const std::string& sInfo) ;
bool EgtSetInfo( int nId, const std::string& sKey, int nInfo) ;
bool EgtGetInfo( int nId, const std::string& sKey, std::string& sInfo) ;
bool EgtGetInfo( int nId, const std::string& sKey, int& nInfo) ;
bool EgtExistsInfo( int nId, const std::string& sKey) ;
bool EgtRemoveInfo( int nId, const std::string& sKey) ;
//--------------------------- GeoSnap ----------------------------------------
bool EgtStartPoint( int nId, int nRefId, Point3d& ptP) ;
bool EgtEndPoint( int nId, int nRefId, Point3d& ptP) ;
bool EgtMidPoint( int nId, int nRefId, Point3d& ptP) ;
bool EgtCenterPoint( int nId, int nRefId, Point3d& ptP) ;
bool EgtCentroid( int nId, int nRefId, Point3d& ptP) ;
bool EgtAtParamPoint( int nId, double dU, int nRefId, Point3d& ptP) ;
bool EgtNearPoint( int nId, const Point3d& ptNear, int nRefId, Point3d& ptP) ;
bool EgtIntersectionPoint( int nId1, int nId2, const Point3d& ptNear, int nRefId, Point3d& ptP) ;
bool EgtStartVector( int nId, int nRefId, Vector3d& vtV) ;
bool EgtEndVector( int nId, int nRefId, Vector3d& vtV) ;
bool EgtMidVector( int nId, int nRefId, Vector3d& vtV) ;
bool EgtAtParamVector( int nId, double dU, int nSide, int nRefId, Vector3d& vtV) ;
bool EgtFrame( int nId, int nRefId, Frame3d& frFrame) ;
bool EgtCurveExtrusion( int nId, int nRefId, Vector3d& vtExtr) ;
// EgtCurveThickness vedi EinAPI.h
bool EgtCurveArcNormVersor( int nId, int nRefId, Vector3d& vtNorm) ;
bool EgtCurveCompoCenter( int nId, int nSimpCrv, int nRefId, Point3d& ptCen) ;
bool EgtSurfTmFacetNearestEndPoint( int nId, int nFacet, const Point3d& ptNear, int nRefId,
Point3d& ptEnd, Vector3d& vtN) ;
bool EgtSurfTmFacetNearestMidPoint( int nId, int nFacet, const Point3d& ptNear, int nRefId,
Point3d& ptMid, Vector3d& vtN) ;
bool EgtSurfTmFacetCenter( int nId, int nFacet, int nRefId, Point3d& ptCen, Vector3d& vtN) ;
bool EgtSurfTmFacetNormVersor( int nId, int nFacet, int nRefId, Vector3d& vtNorm) ;
bool EgtExtTextNormVersor( int nId, int nRefId, Vector3d& vtNorm) ;
bool EgtPointToIdGlob( Point3d& ptP, int nId) ;
bool EgtPointToIdLoc( Point3d& ptP, int nId) ;
bool EgtVectorToIdGlob( Vector3d& vtV, int nId) ;
bool EgtVectorToIdLoc( Vector3d& vtV, int nId) ;
//--------------------------- GeoTransform -----------------------------------
bool EgtMove( INTVECTOR& vIds, const Vector3d& vtMove, int nRefType) ;
bool EgtRotate( INTVECTOR& vIds, const Point3d& ptAx, const Vector3d& vtAx, double dAngRotDeg, int nRefType) ;
bool EgtScale( INTVECTOR& vIds, const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ, int nRefType) ;
bool EgtMirror( INTVECTOR& vIds, const Point3d& ptP, const Vector3d& vtN, int nRefType) ;
bool EgtShear( INTVECTOR& vIds, const Point3d& ptP, const Vector3d& vtN,
const Vector3d& vtDir, double dCoeff, int nRefType) ;
//--------------------------- Machining --------------------------------------
int EgtAddMachGroup( const std::string& sName, const std::string& sMachineName) ;
//--------------------------- Scene ------------------------------------------
bool EgtSetBackground( Color TopCol, Color BottomCol, bool bRedraw) ;
bool EgtSetMarkAttribs( Color MarkCol) ;
bool EgtSetSelSurfAttribs( Color SelSurfCol) ;
bool EgtSetGeoLineAttribs( Color GlCol) ;
bool EgtSetGeoTriaAttribs( Color GtCol) ;
bool EgtSetWinRectAttribs( bool bOutline, Color WrCol) ;
//--------------------------- Exchange ---------------------------------------
int EgtGetFileType( const std::string& sFilePath) ;
bool EgtImportDxf( const std::string& sFilePath) ;
bool EgtImportStl( const std::string& sFilePath) ;
bool EgtImportCnc( const std::string& sFilePath) ;
bool EgtExportDxf( int nId, const std::string& sFilePath) ;
bool EgtExportStl( int nId, const std::string& sFilePath) ;
//--------------------------- TscExec ----------------------------------------
bool EgtTscExecFile( const std::string& sFilePath) ;