Include :

- aggiunti prototipi per IntersTriaTria e IntersSurfTmSurfTm
- aggiunto a Triangle3d il metodo GetLocalBBox
- aggiornamenti vari dei prototipi.
This commit is contained in:
Dario Sassi
2018-08-30 07:31:28 +00:00
parent 77dd603b0c
commit ddd91b02eb
6 changed files with 91 additions and 14 deletions
-1
View File
@@ -14,7 +14,6 @@
#pragma once
#include "/EgtDev/Include/EGkSurfTriMesh.h"
#include "/EgtDev/Include/EGkCurve.h"
//----------------------- Macro per import/export ----------------------------
#undef EGK_EXPORT
+28
View File
@@ -0,0 +1,28 @@
//----------------------------------------------------------------------------
// EgalTech 2018-2018
//----------------------------------------------------------------------------
// File : EGkIntersSurfTmSurfTm.h Data : 27.08.18 Versione : 1.9h3
// Contenuto : Dichiarazione delle funzioni intersezione SurfTriMesh/SurfTriMesh.
//
//
//
// Modifiche : 27.08.18 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
#pragma once
#include "/EgtDev/Include/EGkSurfTriMesh.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
//-----------------------------------------------------------------------------
EGK_EXPORT bool IntersSurfTmSurfTm( const ISurfTriMesh& Stm1, const ISurfTriMesh& Stm2,
PNTVECTOR& vPnt, BIPNTVECTOR& vBpt, TRIA3DVECTOR& vTria) ;
+40
View File
@@ -0,0 +1,40 @@
//----------------------------------------------------------------------------
// EgalTech 2018-2018
//----------------------------------------------------------------------------
// File : EGkIntersTriaTria.h Data : 27.08.18 Versione : 1.9h3
// Contenuto : Dichiarazione della classe intersezione triangolo/triangolo.
//
//
//
// Modifiche : 27.08.18 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
#pragma once
#include "/EgtDev/Include/EGkPlane3d.h"
#include "/EgtDev/Include/EGkTriangle3d.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
//-----------------------------------------------------------------------------
EGK_EXPORT int IntersTriaTria( const Triangle3d& trTria1, const Triangle3d& trTria2,
Point3d& ptInt, Point3d& ptInt2, PNTVECTOR& vPnt) ;
//-----------------------------------------------------------------------------
// Tipo di intersezione triangolo-triangolo
enum IntTriaTriaType { ITTT_NO = 0, // non c'è intersezione
ITTT_OVERLAPS = 1, // i triangoli si sovrappongono (i vertici del poligono sono in vPnt)
ITTT_VERT = 2, // l'intersezione coincide con un vertice di un triangolo (ptInt)
ITTT_PNT = 3, // l'intersezione è un punto sui lati di entrambi i triangoli (ptInt)
ITTT_EDGE = 4, // l'intersezione coincide con un lato di un triangolo (ptInt, ptInt2)
ITTT_YES = 5} ; // l'intersezione è un segmento (ptInt, ptInt2)
+8 -8
View File
@@ -20,29 +20,29 @@
class SurfLocal
{
public :
SurfLocal( IGeomDB* pGeomDB, int nCrvId, const Frame3d& frLoc)
SurfLocal( IGeomDB* pGeomDB, int nSrfId, const Frame3d& frLoc)
: m_pSrf( nullptr), m_pCopy( nullptr)
{ // verifica dei parametri
if ( pGeomDB == nullptr || &frLoc == nullptr)
return ;
// recupero riferimento della curva
Frame3d frCrv ;
if ( ! pGeomDB->GetGlobFrame( nCrvId, frCrv))
// recupero riferimento della superficie
Frame3d frSrf ;
if ( ! pGeomDB->GetGlobFrame( nSrfId, frSrf))
return ;
// recupero la superficie
m_pSrf = GetSurf( pGeomDB->GetGeoObj( nCrvId)) ;
m_pSrf = GetSurf( pGeomDB->GetGeoObj( nSrfId)) ;
if ( m_pSrf == nullptr)
return ;
// se i riferimenti coincidono non devo fare altro
if ( AreSameFrame( frCrv, frLoc))
if ( AreSameFrame( frSrf, frLoc))
return ;
// copio la curva e la porto in locale
// copio la superficie e la porto in locale
m_pCopy = m_pSrf->Clone() ;
if ( m_pCopy == nullptr) {
m_pSrf = nullptr ;
return ;
}
m_pCopy->LocToLoc( frCrv, frLoc) ;
m_pCopy->LocToLoc( frSrf, frLoc) ;
m_pSrf = m_pCopy ;
}
SurfLocal( const SurfLocal& Other)
+12 -4
View File
@@ -14,7 +14,7 @@
#pragma once
#include "/EgtDev/Include/EGkPoint3d.h"
#include "/EgtDev/Include/EGkBBox3d.h"
#include <vector>
#include <list>
#include <algorithm>
@@ -70,7 +70,8 @@ class Triangle3d
}
bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dAngDeg)
{ double dAngRad = dAngDeg * DEGTORAD ;
return Rotate( ptAx, vtAx, cos( dAngRad), sin( dAngRad)) ; }
return Rotate( ptAx, vtAx, cos( dAngRad), sin( dAngRad)) ;
}
bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, double dSinAng)
{ m_ptP[0].Rotate( ptAx, vtAx, dCosAng, dSinAng) ;
m_ptP[1].Rotate( ptAx, vtAx, dCosAng, dSinAng) ;
@@ -103,7 +104,14 @@ class Triangle3d
{ return ( m_ptP[0].LocToLoc( frOri, frDest) &&
m_ptP[1].LocToLoc( frOri, frDest) &&
m_ptP[2].LocToLoc( frOri, frDest) &&
m_vtN.LocToLoc( frOri, frDest)) ; }
m_vtN.LocToLoc( frOri, frDest)) ;
}
bool GetLocalBBox( BBox3d& b3Loc) const
{ b3Loc.Reset() ;
for each ( const auto& ptP in m_ptP)
b3Loc.Add( ptP) ;
return true ;
}
const Point3d& GetP( int nInd) const
{ if ( nInd >= 0 && nInd < 3)
return m_ptP[nInd] ;
@@ -136,7 +144,7 @@ class Triangle3d
if ( dTwoArea < SQ_EPS_SMALL)
return INFINITO ;
else
return ( (std::max)( dSqDistA, (std::max)( dSqDistB, dSqDistC)) / dTwoArea) ;
return ( std::max( dSqDistA, std::max( dSqDistB, dSqDistC)) / dTwoArea) ;
}
protected :
+3 -1
View File
@@ -476,7 +476,9 @@ EXE_EXPORT int ExeExtractSurfTmFacetLoops( int nId, int nFacet, int nDestGrpId,
EXE_EXPORT int ExeCopySurfTmFacet( int nId, int nFacet, int nDestGrpId) ;
EXE_EXPORT int ExeGetSurfTmPlaneInters( int nId, const Point3d& ptOn, const Vector3d& vtN, int nDestGrpId, int nRefType,
int* pnPntCount, int* pnCrvCount, int* pnSrfCount) ;
EXE_EXPORT bool ExeCutSurfTm( int nId, const Point3d& ptOn, const Vector3d& vtN, bool bSaveOnEq, int nRefType) ;
EXE_EXPORT int ExeGetSurfTmSurfTmInters( int nId1, int nId2, int nDestGrpId,
int* pnPntCount, int* pnCrvCount, int* pnSrfCount) ;
EXE_EXPORT bool ExeCutSurfTmPlane( int nId, const Point3d& ptOn, const Vector3d& vtN, bool bSaveOnEq, int nRefType) ;
// GeomDb Volume Modify
EXE_EXPORT int ExeExplodeVolume( int nId, int* pnCount) ;