Include :
- aggiunti prototipi per Voronoi - aggiornamento prototipi.
This commit is contained in:
@@ -19,6 +19,8 @@
|
||||
#include "/EgtDev/Include/EGkPlane3d.h"
|
||||
#include "/EgtDev/Include/EgtPointerOwner.h"
|
||||
|
||||
class Voronoi ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
class __declspec( novtable) ICurve : public IGeoObj
|
||||
{
|
||||
@@ -92,6 +94,10 @@ class __declspec( novtable) ICurve : public IGeoObj
|
||||
virtual bool TrimEndAtLen( double dLenTrim) = 0 ;
|
||||
virtual bool ExtendStartByLen( double dLenExt) = 0 ;
|
||||
virtual bool ExtendEndByLen( double dLenExt) = 0 ;
|
||||
virtual Voronoi* GetVoronoiObject( void) const = 0 ;
|
||||
virtual bool CalcVoronoiDiagram( std::vector<PtrOwner<ICurve>>& vCrvs, int nBound = 3) const = 0 ;
|
||||
virtual bool CalcMedialAxis( std::vector<PtrOwner<ICurve>>& vCrvs, int nSide) const = 0 ;
|
||||
virtual bool CalcFatCurve( std::vector<PtrOwner<ICurve>>& vCrvs, double dRadius, bool bSquareEnds, bool bSquareMids) const = 0 ;
|
||||
} ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
+3
-1
@@ -41,7 +41,7 @@ class __declspec( novtable) ICurveComposite : public ICurve
|
||||
virtual const ICurve* GetLastCurve( void) const = 0 ;
|
||||
virtual const ICurve* GetPrevCurve( void) const = 0 ;
|
||||
virtual bool IsParamAtJoint( double dU) const = 0 ;
|
||||
virtual ICurve* RemoveFirstOrLastCurve( bool bLast = true) = 0 ;
|
||||
virtual ICurve* RemoveFirstOrLastCurve( bool bLast = true) = 0 ;
|
||||
virtual bool ChangeStartPoint( double dU) = 0 ;
|
||||
virtual bool AddPoint( const Point3d& ptStart) = 0 ;
|
||||
virtual bool AddLine( const Point3d& ptNew, bool bEndOrStart = true) = 0 ;
|
||||
@@ -68,6 +68,8 @@ class __declspec( novtable) ICurveComposite : public ICurve
|
||||
virtual bool IsATrapezoid( double dLinTol, Point3d& ptP, Vector3d& vtB1, Vector3d& vtL1, Vector3d& vtB2) const = 0 ;
|
||||
virtual bool SetCurveTempProp( int nCrv, int nProp, int nPropInd = 0) = 0 ;
|
||||
virtual bool GetCurveTempProp( int nCrv, int& nProp, int nPropInd = 0) const = 0 ;
|
||||
virtual bool SetCurveTempParam( int nCrv, double dParam, int nParamInd = 0) ;
|
||||
virtual bool GetCurveTempParam( int nCrv, double& dParam, int nParamInd = 0) const ;
|
||||
} ;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -56,6 +56,8 @@ class __declspec( novtable) IGeoObj
|
||||
virtual const IObjGraphics* GetObjGraphics( void) const = 0 ;
|
||||
virtual void SetTempProp( int nProp, int nPropInd = 0) = 0 ;
|
||||
virtual int GetTempProp( int nPropInd = 0) const = 0 ;
|
||||
virtual void SetTempParam( double dParam, int nParamInd = 0) = 0 ;
|
||||
virtual double GetTempParam( int nParamInd = 0) const = 0 ;
|
||||
} ;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ class OffsetCurve
|
||||
|
||||
public :
|
||||
EGK_EXPORT bool Reset( void) ;
|
||||
EGK_EXPORT bool Make( const ICurve* pCrv, double dDist, int nType) ;
|
||||
EGK_EXPORT bool Make( const ICurve* pCrv, double dDist, int nType, bool bUseVoronoi = false) ;
|
||||
EGK_EXPORT int GetCurveCount( void) { return int( m_CrvLst.size()) ; }
|
||||
EGK_EXPORT ICurve* GetCurve( void) ;
|
||||
EGK_EXPORT ICurve* GetLongerCurve( void) ;
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ EGK_EXPORT ISurfFlatRegion* GetSurfFlatRegionRectangle( double dWidth, double dL
|
||||
EGK_EXPORT ISurfFlatRegion* GetSurfFlatRegionStadium( double dWidth, double dLen) ;
|
||||
EGK_EXPORT ISurfFlatRegion* GetSurfFlatRegionDisk( double dRadius) ;
|
||||
EGK_EXPORT ISurfFlatRegion* GetSurfFlatRegionFromFatCurve( ICurve* pCrv, double dRadius,
|
||||
bool bSquareEnds, bool bSquareMids) ;
|
||||
bool bSquareEnds, bool bSquareMids, bool bUseVoronoi = false) ;
|
||||
// NB : la curva ingrassata non deve autointersecarsi
|
||||
EGK_EXPORT ISurfFlatRegion* GetSurfFlatRegionFromTriangle( const Triangle3d& Tria) ;
|
||||
EGK_EXPORT ISurfFlatRegion* GetSurfFlatRegionFromPolyLine( const PolyLine& ContourPolyLine) ;
|
||||
|
||||
+6
-1
@@ -17,6 +17,7 @@
|
||||
#include "/EgtDev/Include/EGkIntersCurves.h"
|
||||
#include "/EgtDev/Include/EgkCurveComposite.h"
|
||||
#include "/EgtDev/Include/EgtPointerOwner.h"
|
||||
#include "/EgtDev/Include/EGkVoronoi.h"
|
||||
|
||||
class ISurfTriMesh ;
|
||||
|
||||
@@ -35,7 +36,8 @@ class __declspec( novtable) ISurfFlatRegion : public ISurf
|
||||
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) = 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 ;
|
||||
@@ -49,6 +51,9 @@ class __declspec( novtable) ISurfFlatRegion : public ISurf
|
||||
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 ;
|
||||
} ;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// EgalTech 2015-2023
|
||||
//----------------------------------------------------------------------------
|
||||
// File : EGkVoronoi.h Data : 23.11.23 Versione : 2.5k5
|
||||
// Contenuto : Dichiarazione della classe Voronoi con libreria VRONI
|
||||
//
|
||||
//
|
||||
//
|
||||
// Modifiche : 23.11.23 SP Creazione modulo.
|
||||
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "/EgtDev/Include/EGkFrame3d.h"
|
||||
#include "/EgtDev/Include/EGkCurve.h"
|
||||
#include "/EgtDev/Include/EGkCurveArc.h"
|
||||
#include "/EgtDev/Include/EGkCurveBezier.h"
|
||||
#include "/EgtDev/Include/EGkCurveComposite.h"
|
||||
#include "/EgtDev/Include/EGkCurveLine.h"
|
||||
#include "/EgtDev/Extern/vroni/Include/vroni_object.h"
|
||||
|
||||
|
||||
//----------------------- Macro per import/export ----------------------------
|
||||
#undef EGK_EXPORT
|
||||
#if defined( I_AM_EGK) // da definirsi solo nella DLL
|
||||
#define EGK_EXPORT __declspec( dllexport)
|
||||
#else
|
||||
#define EGK_EXPORT __declspec( dllimport)
|
||||
#endif
|
||||
|
||||
static const int VORONOI_STD_BOUND = 3 ;
|
||||
static const double VRONI_OFFS_TOL = 1e-14 ;
|
||||
|
||||
//-------------------------- Forward Definitions -------------------------------
|
||||
class ISurfFlatRegion ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
class Voronoi
|
||||
{
|
||||
public :
|
||||
// costanti per il lato del medial axis
|
||||
enum WMATSide { WMAT_LEFT = 0,
|
||||
WMAT_RIGHT = 1,
|
||||
WMAT_BOTHSIDES = 2} ;
|
||||
public :
|
||||
EGK_EXPORT Voronoi( void) : m_vroni( nullptr), m_nBound( VORONOI_STD_BOUND), m_bVDComputed( false), m_bAllowAdd( true) {} ;
|
||||
EGK_EXPORT Voronoi( const ICurve* pCrv, bool bAllowAdd) ;
|
||||
EGK_EXPORT Voronoi( const ISurfFlatRegion* pSfr, bool bAllowAdd) ;
|
||||
EGK_EXPORT ~Voronoi( void) ;
|
||||
|
||||
public :
|
||||
EGK_EXPORT bool AddCurve( const ICurve* pCrv) ;
|
||||
EGK_EXPORT bool AddSurfFlatRegion( const ISurfFlatRegion* pSfr) ;
|
||||
EGK_EXPORT ICurve* GetCurve( int nId) ;
|
||||
EGK_EXPORT int GetCurveCount( void)
|
||||
{ return m_vpCrvs.size() ; } ;
|
||||
|
||||
EGK_EXPORT bool CalcVoronoiDiagram( ICURVEPOVECTOR& vCrvs, int nBound = VORONOI_STD_BOUND) ;
|
||||
EGK_EXPORT bool CalcOffset( ICURVEPOVECTOR& vOffs, double dOffs, int nType) ;
|
||||
EGK_EXPORT bool CalcFatCurve( ICURVEPOVECTOR& vOffs, double dOffs, bool bSquareEnds, bool bSquareMids) ;
|
||||
EGK_EXPORT bool CalcMedialAxis( ICURVEPOVECTOR& vCrvs, int nSide) ;
|
||||
|
||||
private :
|
||||
bool Clear( void) ;
|
||||
bool IsValid( void) const
|
||||
{ return m_vroni != nullptr ; } ;
|
||||
bool AddCurveToVroni( const ICurve * pCrv) ;
|
||||
bool AddLineToVroni( const ICurveLine* pLine, int& nVroniCrv, int nLoopId, int nCrvId = 0, Point3d ptForcedEnd = P_INVALID) ;
|
||||
bool AddArcToVroni( const ICurveArc* pArc, int& nVroniCrv, int nLoopId, int nCrvId = 0, Point3d ptForcedEnd = P_INVALID) ;
|
||||
bool AddCompoToVroni( const ICurveComposite* pCompo, int& nCrv, int nLoopId) ;
|
||||
bool AddBezierToVroni( const ICurveBezier* pBezier, int& nVroniCrv, int nLoopId) ;
|
||||
|
||||
bool CalcVoronoi( int nBound = VORONOI_STD_BOUND) ;
|
||||
bool CalcVroniOffset( ICRVCOMPOPLIST& vOffs, double dOffs, bool bRightOffs, bool bLeftOffs) ;
|
||||
bool UpdateVoronoi( double dOffs) ;
|
||||
bool VerifyCurvesValidityForOffset( void) ;
|
||||
bool AdjustOpenOffsetCurve( ICurveComposite& pCompo, double dOffs) ;
|
||||
bool AdjustOffsetStart( ICurveComposite& pCompo) ;
|
||||
int GetOffsetCurveSide( const ICurveComposite& pOffs, int nCrv) ;
|
||||
ICurve* GetBisectorCurve( int i) ;
|
||||
|
||||
private :
|
||||
vroniObject* m_vroni ; // oggetto base della libreria vroni
|
||||
Frame3d m_Frame ; // frame in cui è espresso l'oggetto vroni
|
||||
int m_nBound ; // bound associato al diagramma di Voronoi corrente
|
||||
CICURVEPVECTOR m_vpCrvs ; // curve associate al Voronoi ( espresse rispetto a m_Frame)
|
||||
BBox3d m_bBox ; // box degli oggetti associati al Voronoi
|
||||
bool m_bVDComputed ; // indica se il diagramma di Voronoi è stato calcolato
|
||||
bool m_bAllowAdd ; // indica se possibile aggiungere altre curve/superifici dopo aver creato l'oggetto Voronoi
|
||||
} ;
|
||||
@@ -678,6 +678,8 @@ EXE_EXPORT bool ExeCurveCompoCenter( int nId, int nSimpCrv, int nRefId, Point3d&
|
||||
EXE_EXPORT bool ExeCurveCompoRadius( int nId, int nSimpCrv, double& dRad) ;
|
||||
EXE_EXPORT bool ExeCurveCompoAngCenter( int nId, int nSimpCrv, double& dAngCen) ;
|
||||
EXE_EXPORT bool ExeCurveCompoNormVersor( int nId, int nSimpCrv, int nRefId, Vector3d& vtNorm) ;
|
||||
EXE_EXPORT int ExeCurveGetVoronoi( int nId, int nDestGrpId, int nBound, int* pnCount) ;
|
||||
EXE_EXPORT int ExeCurveGetFatCurve( int nId, int nDestGrpId, double dRad, bool bSquareEnds, bool bSquareMids, int* pnCount) ;
|
||||
|
||||
// GeomDb Surf Get
|
||||
EXE_EXPORT bool ExeSurfArea( int nId, double& dArea) ;
|
||||
|
||||
Reference in New Issue
Block a user