Files
EgtNesting/AutoNester.h
T
Dario Sassi aca30f1a44 EgtNesting 2.3b2 :
- aggiunta funzione SetStartCorner.
2021-02-14 14:44:17 +00:00

70 lines
3.0 KiB
C++

//----------------------------------------------------------------------------
// EgalTech 2019-2020
//----------------------------------------------------------------------------
// File : AutoNester.h Data : 29.01.20 Versione : 2.2a2
// Contenuto : Dichiarazione della classe AutoNester.
//
//
//
// Modifiche : 28.11.19 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
#pragma once
#include "/EgtDev/Include/ENsAutoNester.h"
#include <unordered_map>
struct CNS_LaunchingOrder ;
struct CNS_Computation ;
struct CNS_Sheet ;
struct CNS_Part ;
//----------------------------------------------------------------------------
class AutoNester : public IAutoNester
{
public :
~AutoNester( void) override ;
bool Start( void) override ;
bool SetGuillotineMode( void) override ;
bool SetStartCorner( int nCorner) override ;
bool AddSheet( int nSheetId, const PolyArc& Outline, double dKerf, int nPriority, int nCount, bool* pbIsRect = nullptr) override ;
bool AddDefectToSheet( int nSheetId, const PolyArc& Outline) override ;
bool AddPart( int nPartId, const PolyArc& Outline, bool bCanFlip, bool bCanRotate, double dRotStep, int nPriority, int nCount) override ;
bool AddHoleToPart( int nPartId, const PolyArc& Hole) override ;
bool AddAnotherOutlineToPart( int nPartId, const PolyArc& AnotherOutline) override ;
bool AddToolOutlineToPart( int nPartId, const PolyArc& ToolOutline) override ;
bool SetInterpartGap( double dGap) override ;
bool SetReportFile( const std::string& sReportFile) override ;
bool Compute( bool bMinimizeOnXvsY, int nMaxTime) override ;
bool CancelComputation( void) override ;
bool GetComputationStatus( int& nStatus) override ;
bool GetResults( double& dTotFillRatio, ANIVECT& vANI) override ;
bool PrintResults( const std::string& sHtmlFile) override ;
public :
AutoNester( void) ;
private :
bool Clear( void) ;
private :
struct SheetInfo {
CNS_Sheet* pSheet ;
double dOffsX ;
double dOffsY ;
SheetInfo( CNS_Sheet* pS, double dX, double dY) : pSheet( pS), dOffsX( dX), dOffsY( dY) {}
} ;
typedef std::unordered_map< int, SheetInfo> IDSHEETINFO_UMAP ;
typedef std::unordered_map< int, CNS_Part*> IDPARTPTR_UMAP ;
private :
CNS_LaunchingOrder* m_pOrder ; // ordine di esecuzione per OptaLog
CNS_Computation* m_pComp ; // calcolo di ottimizzazione
IDSHEETINFO_UMAP m_IdSheetInfo ; // map dei pannelli basato su identificativi
IDPARTPTR_UMAP m_IdPartPtr ; // map dei pannelli basato su identificativi
double m_dInterpartGap ; // distanza minima tra i pezzi
std::string m_sReportFile ; // file di report dei dati da inviare a Optalog in caso di problemi
} ;