Files
Include/EGkSurfFlatRegion.h
T
SaraP a645be8f7d Include :
- aggiunti prototipi per Voronoi
- aggiornamento prototipi.
2023-11-23 13:01:37 +01:00

90 lines
5.2 KiB
C++

//----------------------------------------------------------------------------
// EgalTech 2015-2015
//----------------------------------------------------------------------------
// File : EGkSurfFlatRegion.h Data : 05.08.15 Versione : 1.6h2
// Contenuto : Dichiarazione della interfaccia ISurfFlatRegion.
//
//
//
// Modifiche : 05.08.15 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
#pragma once
#include "/EgtDev/Include/EGkSurf.h"
#include "/EgtDev/Include/EGkIntersCurves.h"
#include "/EgtDev/Include/EgkCurveComposite.h"
#include "/EgtDev/Include/EgtPointerOwner.h"
#include "/EgtDev/Include/EGkVoronoi.h"
class ISurfTriMesh ;
//----------------------------------------------------------------------------
class __declspec( novtable) ISurfFlatRegion : public ISurf
{
public : // IGeoObj
ISurfFlatRegion* Clone( void) const override = 0 ;
public :
virtual bool CopyFrom( const IGeoObj* pGObjSrc) = 0 ;
virtual bool Clear( void) ;
virtual bool AddExtLoop( const ICurve& cCrv) = 0 ;
virtual bool AddExtLoop( ICurve* pCrv) = 0 ;
virtual bool AddIntLoop( const ICurve& cCrv) = 0 ;
virtual bool AddIntLoop( ICurve* pCrv) = 0 ;
virtual bool Add( const ISurfFlatRegion& Other) = 0 ;
virtual bool Subtract( const ISurfFlatRegion& Other) = 0 ;
virtual bool Intersect( const ISurfFlatRegion& Other) = 0 ;
virtual bool Offset( double dDist, int nType, bool bUseVoronoi = false) = 0 ;
virtual ISurfFlatRegion* CreateOffsetSurf( double dDist, int nType, bool bUseVoronoi = false) const = 0 ;
virtual bool GetGrossArea( double& dArea) const = 0 ;
virtual const Point3d& GetPlanePoint( void) const = 0 ;
virtual const Vector3d& GetNormVersor( void) const = 0 ;
virtual int GetChunkCount( void) const = 0 ;
virtual int GetLoopCount( int nChunk) const = 0 ;
virtual ICurve* GetLoop( int nChunk, int nLoop) const = 0 ; // nChunk 0-based, nLoop 0-based (1°esterno, successivi interni)
virtual bool ApproxLoopWithLines( int nChunk, int nLoop, double dLinTol, double dAngTolDeg, int nType, PolyLine& PL) const = 0 ;
virtual const ISurfTriMesh* GetAuxSurf( void) const = 0 ;
virtual ISurfFlatRegion* CloneChunk( int nChunk) const = 0 ;
virtual bool GetChunkCentroid( int nChunk, Point3d& ptCen) const ;
virtual bool GetCurveClassification( const ICurve& Crv, double dLenMin, CRVCVECTOR& ccClass) const = 0 ;
virtual int GetChunkSimpleClassification( int nChunk, const ISurfFlatRegion& Other, int nOthChunk) const ; // compare only outsides
virtual bool GetZigZagInfill( double dSideStep, bool bAllowStepCorrection, bool bInvert, ICRVCOMPOPOVECTOR& vpCrvs) const = 0 ;
virtual Voronoi* GetVoronoiObject( void) const = 0 ;
virtual bool CalcVoronoiDiagram( ICURVEPOVECTOR& vCrvs, int nBound = VORONOI_STD_BOUND) const = 0 ;
virtual bool CalcMedialAxis( ICURVEPOVECTOR& vCrvs, int nSide = Voronoi::WMAT_LEFT) const = 0 ;
} ;
//-----------------------------------------------------------------------------
inline ISurfFlatRegion* CreateSurfFlatRegion( void)
{ return (static_cast<ISurfFlatRegion*>( CreateGeoObj( SRF_FLATRGN))) ; }
inline ISurfFlatRegion* CloneSurfFlatRegion( const IGeoObj* pGObj)
{ if ( pGObj == nullptr || pGObj->GetType() != SRF_FLATRGN)
return nullptr ;
return (static_cast<ISurfFlatRegion*>(pGObj->Clone())) ; }
inline const ISurfFlatRegion* GetSurfFlatRegion( const IGeoObj* pGObj)
{ if ( pGObj == nullptr || pGObj->GetType() != SRF_FLATRGN)
return nullptr ;
return (static_cast<const ISurfFlatRegion*>(pGObj)) ; }
inline ISurfFlatRegion* GetSurfFlatRegion( IGeoObj* pGObj)
{ if ( pGObj == nullptr || pGObj->GetType() != SRF_FLATRGN)
return nullptr ;
return (static_cast<ISurfFlatRegion*>(pGObj)) ; }
//----------------------------------------------------------------------------
// Raccolte di puntatori a ISurfFlatRegion
typedef std::vector<const ISurfFlatRegion*> CISURFFRPVECTOR ; // vettore di puntatori a const ISurfFlatRegion
typedef std::vector<ISurfFlatRegion*> ISURFFRPVECTOR ; // vettore di puntatori a ISurfFlatRegion
typedef std::list<ISurfFlatRegion*> ISURFFRPLIST ; // lista di puntatori a ISurfFlatRegion
typedef std::vector<PtrOwner<ISurfFlatRegion>> ISURFFRPOVECTOR ; // vettore di puntatori esclusivi a ISurfFlatRegion
//-----------------------------------------------------------------------------
// Costanti per classificazione di regioni
const int REGC_NULL = 0 ; //!< Non classificabili
const int REGC_IN1 = 1 ; //!< La prima regione è inclusa nella seconda
const int REGC_IN2 = 2 ; //!< La seconda regione è inclusa nella prima
const int REGC_SAME = 3 ; //!< Le due regioni coincidono
const int REGC_OUT = 4 ; //!< Le due regioni sono esterne
const int REGC_INTERS = 5 ; //!< Le due regioni si intersecano