23bb013dec
- aggiunti prototipi per Polygon3d, per IntersPlanePlane e per Inters3Planes - aggiornati Plane3d e IntersLinePlane.
64 lines
3.1 KiB
C++
64 lines
3.1 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2015-2015
|
|
//----------------------------------------------------------------------------
|
|
// File : Polygon3d.h Data : 30.08.15 Versione : 1.6h5
|
|
// Contenuto : Dichiarazione della classe Polygon3d (poligono nello spazio).
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 30.08.15 DS Creazione modulo.
|
|
//
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#include "/EgtDev/Include/EGkPlane3d.h"
|
|
#include "/EgtDev/Include/EGkPolyLine.h"
|
|
#include "/EgtDev/Include/EGkGeoCollection.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
|
|
|
|
//----------------------------------------------------------------------------
|
|
class Polygon3d
|
|
{
|
|
public :
|
|
EGK_EXPORT bool FromRectangle( double dDimX, double dDimY) ;
|
|
EGK_EXPORT bool FromPolyLine( const PolyLine& PL) ;
|
|
EGK_EXPORT bool FromPlaneTrimmedWithBox( const Plane3d& plPlane, const Point3d& ptMin, const Point3d& ptMax) ;
|
|
EGK_EXPORT bool FromPlaneTrimmedWithBox( const Point3d& ptOn, const Vector3d& vtN,
|
|
const Point3d& ptMin, const Point3d& ptMax) ;
|
|
EGK_EXPORT bool Trim( const Plane3d& plPlane, bool bInVsOut, bool bOnEq) ;
|
|
EGK_EXPORT bool Trim( const Polygon3d& plyOther, bool bInVsOut, bool bOnEq) ;
|
|
EGK_EXPORT bool IsValid( void) const
|
|
{ return ! m_Plane.GetVersN().IsSmall() ; }
|
|
EGK_EXPORT Vector3d GetVersN( void)
|
|
{ return m_Plane.GetVersN() ; }
|
|
EGK_EXPORT int GetSideCount( void) const
|
|
{ return ( IsValid() ? int( m_vVert.size()) : 0) ; }
|
|
EGK_EXPORT PolyLine GetPolyLine( void) const ;
|
|
|
|
public :
|
|
EGK_EXPORT void Translate( const Vector3d& vtMove) ;
|
|
EGK_EXPORT bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dAngDeg)
|
|
{ double dAngRad = dAngDeg * DEGTORAD ;
|
|
return Rotate( ptAx, vtAx, cos( dAngRad), sin( dAngRad)) ; }
|
|
EGK_EXPORT bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, double dSinAng) ;
|
|
EGK_EXPORT bool Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ) ;
|
|
EGK_EXPORT bool Mirror( const Point3d& ptOn, const Vector3d& vtNorm) ;
|
|
EGK_EXPORT bool Shear( const Point3d& ptOn, const Vector3d& vtNorm, const Vector3d& vtDir, double dCoeff) ;
|
|
EGK_EXPORT bool ToGlob( const Frame3d& frRef) ;
|
|
EGK_EXPORT bool ToLoc( const Frame3d& frRef) ;
|
|
EGK_EXPORT bool LocToLoc( const Frame3d& frOri, const Frame3d& frDest) ;
|
|
|
|
private :
|
|
Plane3d m_Plane ; // piano in cui giace il poligono
|
|
PNTVECTOR m_vVert ; // elenco ordinato dei vertici del poligono (CCW da Z+ piano)
|
|
} ;
|