Files
SaraP 918481ee67 EgtNesting 2.7i2 :
- aggiunte funzioni per calcolo shear sequence.
2025-09-12 10:16:47 +02:00

82 lines
4.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_RestrictedZoneConstraint ;
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 AddRestrictedZoneToSheet( int nRzConstrId, 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 SetRestrictedZoneToPart( int nPartId, int nRzConstrId) override ;
bool SetStripYconstraintToPart( int nPartId, const Point3d& ptRef, double dStripStart, double dStripRepeat) override ;
bool SetStripXconstraintToPart( int nPartId, const Point3d& ptRef, double dStripStart, double dStripRepeat) override ;
bool SetInterpartGap( double dGap) override ;
bool SetShearGap( double dShearGap) 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 CalcShearSequence( int nNesting, std::vector<Point3d>& vPtStart, std::vector<Point3d>& vPtEnd) 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 ;
double dKerf ;
SheetInfo( CNS_Sheet* pS, double dX, double dY, double dKerf) : pSheet( pS), dOffsX( dX), dOffsY( dY), dKerf( dKerf) {}
} ;
typedef std::unordered_map< int, SheetInfo> IDSHEETINFO_UMAP ;
typedef std::unordered_map< int, CNS_RestrictedZoneConstraint*> IDRZCSTRPTR_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
IDRZCSTRPTR_UMAP m_IdRzCstrPtr ; // map dei vincoli di zone ristrette basato su identificativi
IDPARTPTR_UMAP m_IdPartPtr ; // map dei pezzi basato su identificativi
double m_dInterpartGap ; // distanza minima tra i pezzi
double m_dShearGap ;
bool m_bGuillotine ; // flag per indicare se è impostata modalità a ghigliottina
std::string m_sReportFile ; // file di report dei dati da inviare a Optalog in caso di problemi
} ;