1f9cf63048
- aggiornamenti.
96 lines
5.5 KiB
C++
96 lines
5.5 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2014-2014
|
|
//----------------------------------------------------------------------------
|
|
// File : EgkSurfTriMesh.h Data : 26.03.14 Versione : 1.5c9
|
|
// Contenuto : Dichiarazione della interfaccia ISurfTriMesh.
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 26.03.14 DS Creazione modulo.
|
|
//
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#include "/EgtDev/Include/EGkSurf.h"
|
|
#include "/EgtDev/Include/EGkTriangle3d.h"
|
|
#include "/EgtDev/Include/EGkPolyLine.h"
|
|
|
|
//----------------------------------------------------------------------------
|
|
const int SVT_NULL = - 1 ; // vertice o triangolo nullo
|
|
const int SVT_DEL = - 2 ; // vertice o triangolo cancellato
|
|
|
|
//----------------------------------------------------------------------------
|
|
class __declspec( novtable) ISurfTriMesh : public ISurf
|
|
{
|
|
public :
|
|
virtual bool CopyFrom( const IGeoObj* pGObjSrc) = 0 ;
|
|
virtual bool Init( int nNumVert, int nNumTria, int nNumFacet = 0) = 0 ;
|
|
virtual void SetLinearTolerance( double dLinTol) = 0 ;
|
|
virtual void SetBoundaryAngle( double dBoundaryAngDeg) = 0 ;
|
|
virtual void SetSmoothAngle( double dSmoothAngDeg) = 0 ;
|
|
virtual int AddVertex( const Point3d& ptVert) = 0 ;
|
|
virtual int AddTriangle( const int nIdVert[3]) = 0 ;
|
|
virtual bool RemoveTriangle( int nId) = 0 ;
|
|
virtual bool AdjustTopology( void) = 0 ;
|
|
virtual bool CreateByFlatContour( const PolyLine& PL) = 0 ;
|
|
virtual bool CreateByRegion( const POLYLINEVECTOR& vPL) = 0 ;
|
|
virtual bool CreateByExtrusion( const PolyLine& PL, const Vector3d& vtExtr) = 0 ;
|
|
virtual bool CreateByPointCurve( const Point3d& ptP, const PolyLine& PL) = 0 ;
|
|
virtual bool CreateByTwoCurves( const PolyLine& PL1, const PolyLine& PL2) = 0 ;
|
|
virtual bool CreateByRevolution( const PolyLine& PL, const Point3d& ptAx, const Vector3d& vtAx,
|
|
double dAngRot, double dStepRot) = 0 ;
|
|
virtual bool CreateByScrewing( const PolyLine& PL, const Point3d& ptAx, const Vector3d& vtAx,
|
|
double dAngRot, double dStepRot, double dMove) = 0 ;
|
|
virtual bool DoCompacting( void) = 0 ;
|
|
virtual bool DoSewing( const ISurfTriMesh& stmOther, const Frame3d& frOther = GLOB_FRM) = 0 ;
|
|
virtual int GetVertexCount( void) const = 0 ;
|
|
virtual int GetTriangleCount( void) const = 0 ;
|
|
virtual int GetVertexSize( void) const = 0 ;
|
|
virtual int GetTriangleSize( void) const = 0 ;
|
|
virtual double GetLinearTolerance( void) = 0 ;
|
|
virtual double GetSmoothAngle( void) = 0 ;
|
|
virtual bool GetVertex( int nId, Point3d& ptP) const = 0 ;
|
|
virtual int GetFirstVertex( Point3d& ptP) const = 0 ;
|
|
virtual int GetNextVertex( int nId, Point3d& ptP) const = 0 ;
|
|
virtual bool GetTriangle( int nId, int nIdVert[3]) const = 0 ;
|
|
virtual int GetFirstTriangle( int nIdVert[3]) const = 0 ;
|
|
virtual int GetNextTriangle( int nId, int nIdVert[3]) const = 0 ;
|
|
virtual bool GetTriangle( int nId, Triangle3d& Tria) const = 0 ;
|
|
virtual int GetFirstTriangle( Triangle3d& Tria) const = 0 ;
|
|
virtual int GetNextTriangle( int nId, Triangle3d& Tria) const = 0 ;
|
|
virtual int GetAllTriaAroundVertex( int nV, INTVECTOR& vT, bool& bCirc) const = 0 ;
|
|
virtual bool GetVertexSmoothNormal( int nV, int nT, Vector3d& vtN) const = 0 ;
|
|
virtual bool GetTriangleBoundaryEdges( int nId, TriFlags3d& TFlags) const = 0 ;
|
|
virtual bool GetTriangleSmoothNormals( int nId, TriNormals3d& TNrms) const = 0 ;
|
|
virtual bool GetLoops( POLYLINEVECTOR& vPL) const = 0 ;
|
|
virtual bool GetSilhouette( const Vector3d& vtDir, POLYLINEVECTOR& vPL) const = 0 ;
|
|
virtual int GetFacetCount( void) const = 0 ;
|
|
virtual int GetFacetSize( void) const = 0 ;
|
|
virtual int GetFacetFromTria( int nT) const = 0 ;
|
|
virtual bool GetAllTriaInFacet( int nF, INTVECTOR& vT) const = 0 ;
|
|
virtual bool GetFacetLoops( int nF, POLYLINEVECTOR& vPL) const = 0 ;
|
|
virtual bool GetFacetNearestEndPoint( int nF, const Point3d& ptNear, Point3d& ptEnd, Vector3d& vtN) const = 0 ;
|
|
virtual bool GetFacetNearestMidPoint( int nF, const Point3d& ptNear, Point3d& ptMid, Vector3d& vtN) const = 0 ;
|
|
virtual bool GetFacetCenter( int nF, Point3d& ptCen, Vector3d& vtN) const = 0 ;
|
|
virtual bool GetFacetNormal( int nF, Vector3d& vtN) const = 0 ;
|
|
virtual ISurfTriMesh* CloneFacet( int nF) const = 0 ;
|
|
} ;
|
|
|
|
//-----------------------------------------------------------------------------
|
|
inline ISurfTriMesh* CreateSurfTriMesh( void)
|
|
{ return (static_cast<ISurfTriMesh*>( CreateGeoObj( SRF_TRIMESH))) ; }
|
|
inline ISurfTriMesh* CloneSurfTriMesh( const IGeoObj* pGObj)
|
|
{ if ( pGObj == nullptr || pGObj->GetType() != SRF_TRIMESH)
|
|
return nullptr ;
|
|
return (static_cast<ISurfTriMesh*>(pGObj->Clone())) ; }
|
|
inline const ISurfTriMesh* GetSurfTriMesh( const IGeoObj* pGObj)
|
|
{ if ( pGObj == nullptr || pGObj->GetType() != SRF_TRIMESH)
|
|
return nullptr ;
|
|
return (static_cast<const ISurfTriMesh*>(pGObj)) ; }
|
|
inline ISurfTriMesh* GetSurfTriMesh( IGeoObj* pGObj)
|
|
{ if ( pGObj == nullptr || pGObj->GetType() != SRF_TRIMESH)
|
|
return nullptr ;
|
|
return (static_cast<ISurfTriMesh*>(pGObj)) ; }
|