ee01a02292
- aggiunti prototipi per calcolo shear sequence nel nesting - aggiunta funzione LuaSetParam per vettore di punti.
87 lines
4.0 KiB
C++
87 lines
4.0 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2019-2020
|
|
//----------------------------------------------------------------------------
|
|
// File : ENsAutoNester.h Data : 29.01.20 Versione : 2.2a2
|
|
// Contenuto : Dichiarazione della interfaccia IAutoNester.
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 28.11.19 DS Creazione modulo.
|
|
//
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
//----------------------- Macro per import/export ----------------------------
|
|
#undef ENS_EXPORT
|
|
#if defined( I_AM_ENS) // da definirsi solo nella DLL
|
|
#define ENS_EXPORT __declspec( dllexport)
|
|
#else
|
|
#define ENS_EXPORT __declspec( dllimport)
|
|
#endif
|
|
|
|
class Point3d ;
|
|
class PolyArc ;
|
|
|
|
//-----------------------------------------------------------------------------
|
|
struct ANestInfo {
|
|
int nType ; // se > 0 allora pannello e quindi molteplicità, se == 0 è pezzo
|
|
int nId ; // identificativo
|
|
int nFlag ; // per pannello numero di pezzi contenuti, per pezzo flip (0=no/1=si)
|
|
double dX ; // per pannello fill ratio, per pezzo traslazione in X dell'origine pezzo
|
|
double dY ; // solo per pezzo, traslazione in Y dell'origine pezzo
|
|
double dAngRot ; // solo per pezzo, rotazione del pezzo attorno all'origine
|
|
} ;
|
|
typedef std::vector<ANestInfo> ANIVECT ;
|
|
|
|
//-----------------------------------------------------------------------------
|
|
class __declspec( novtable) IAutoNester
|
|
{
|
|
public :
|
|
virtual ~IAutoNester( void) {}
|
|
virtual bool Start( void) = 0 ;
|
|
virtual bool SetGuillotineMode( void) = 0 ;
|
|
virtual bool SetStartCorner( int nCorner) = 0 ;
|
|
virtual bool AddSheet( int nSheetId, const PolyArc& Outline, double dKerf, int nPriority, int nCount, bool* pbIsRect = nullptr) = 0 ;
|
|
virtual bool AddDefectToSheet( int nSheetId, const PolyArc& Outline) = 0 ;
|
|
virtual bool AddRestrictedZoneToSheet( int nRzConstrId, int nSheetId, const PolyArc& Outline) = 0 ;
|
|
virtual bool AddPart( int nPartId, const PolyArc& Outline, bool bCanFlip, bool bCanRotate, double dRotStep, int nPriority, int nCount) = 0 ;
|
|
virtual bool AddHoleToPart( int nPartId, const PolyArc& Hole) = 0 ;
|
|
virtual bool AddAnotherOutlineToPart( int nPartId, const PolyArc& AnotherOutline) = 0 ;
|
|
virtual bool AddToolOutlineToPart( int nPartId, const PolyArc& ToolOutline) = 0 ;
|
|
virtual bool SetRestrictedZoneToPart( int nPartId, int nRzConstrId) = 0 ;
|
|
virtual bool SetStripYconstraintToPart( int nPartId, const Point3d& ptRef, double dStripStart, double dStripRepeat) = 0 ;
|
|
virtual bool SetStripXconstraintToPart( int nPartId, const Point3d& ptRef, double dStripStart, double dStripRepeat) = 0 ;
|
|
virtual bool SetInterpartGap( double dGap) = 0 ;
|
|
virtual bool SetShearGap( double dShearGap) = 0 ;
|
|
virtual bool SetReportFile( const std::string& sReportFile) = 0 ;
|
|
virtual bool Compute( bool bMinimizeOnXvsY, int nMaxTime) = 0 ;
|
|
virtual bool CancelComputation( void) = 0 ;
|
|
virtual bool GetComputationStatus( int& nStatus) = 0 ;
|
|
virtual bool GetResults( double& dTotFillRatio, ANIVECT& vANI) = 0 ;
|
|
virtual bool CalcShearSequence( int nNesting, std::vector<Point3d>& vPtStart, std::vector<Point3d>& vPtEnd) = 0 ;
|
|
virtual bool PrintResults( const std::string& sHtmlFile) = 0 ;
|
|
} ;
|
|
|
|
//-----------------------------------------------------------------------------
|
|
extern "C" {
|
|
ENS_EXPORT IAutoNester* CreateAutoNester(void) ;
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
const int NST_CORNER_BL = 0 ;
|
|
const int NST_CORNER_TL = 1 ;
|
|
const int NST_CORNER_BR = 2 ;
|
|
const int NST_CORNER_TR = 3 ;
|
|
|
|
//-----------------------------------------------------------------------------
|
|
const int NST_STATUS_ERR = -1 ;
|
|
const int NST_STATUS_CANC = 0 ;
|
|
const int NST_STATUS_COMP = 1 ;
|
|
const int NST_STATUS_INTRES = 2 ;
|
|
const int NST_STATUS_OK = 3 ;
|