Files
EgtExchange/Polygon3d.h
T
Dario Sassi a982c80926 EgtExchange 1.8c2 :
- in BTL aggiunta gestione Tenone, Mortasa e Mortasa Frontale
- migliorata elaborazione outline.
2017-03-14 12:05:28 +00:00

57 lines
2.5 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"
//----------------------------------------------------------------------------
class Polygon3d
{
public :
bool FromRectangle( double dDimX, double dDimY) ;
bool FromPolyLine( const PolyLine& PL) ;
bool FromPlaneTrimmedWithBox( const Plane3d& plPlane, const Point3d& ptMin, const Point3d& ptMax) ;
bool FromPlaneTrimmedWithBox( const Point3d& ptOn, const Vector3d& vtN,
const Point3d& ptMin, const Point3d& ptMax) ;
bool Trim( const Plane3d& plPlane, bool bInVsOut, bool bOnEq) ;
bool Trim( const Polygon3d& plyOther, bool bInVsOut, bool bOnEq) ;
bool IsValid( void) const
{ return ! m_Plane.vtN.IsSmall() ; }
Vector3d GetVersN( void)
{ return m_Plane.vtN ; }
int GetSideCount( void) const
{ return ( IsValid() ? int( m_vVert.size()) : 0) ; }
PolyLine GetPolyLine( void) const ;
public :
void Translate( const Vector3d& vtMove) ;
bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dAngDeg)
{ double dAngRad = dAngDeg * DEGTORAD ;
return Rotate( ptAx, vtAx, cos( dAngRad), sin( dAngRad)) ; }
bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, double dSinAng) ;
bool Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ) ;
bool Mirror( const Point3d& ptOn, const Vector3d& vtNorm) ;
bool Shear( const Point3d& ptOn, const Vector3d& vtNorm, const Vector3d& vtDir, double dCoeff) ;
bool ToGlob( const Frame3d& frRef) ;
bool ToLoc( const Frame3d& frRef) ;
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)
} ;