EgtGraphics 1.6c3 :

- possibilità di filtrare selezione per tipologia di entità
- filtro per snap punto ricondotto al caso precedente.
This commit is contained in:
Dario Sassi
2015-03-18 13:54:57 +00:00
parent f3eb14ff8f
commit ff8c9fa37c
6 changed files with 58 additions and 50 deletions
+15 -33
View File
@@ -32,24 +32,6 @@
using namespace std ;
//----------------------------------------------------------------------------
bool
Scene::SetObjFilterForSnap( bool bZerodim, bool bCurve, bool bSurf, bool bVolume, bool bExtra)
{
m_nObjFilterForSnap = 0 ;
if ( bZerodim)
m_nObjFilterForSnap |= GEO_ZERODIM ;
if ( bCurve)
m_nObjFilterForSnap |= GEO_CURVE ;
if ( bSurf)
m_nObjFilterForSnap |= GEO_SURF ;
if ( bVolume)
m_nObjFilterForSnap |= GEO_VOLUME ;
if ( bExtra)
m_nObjFilterForSnap |= GEO_EXTRA ;
return true ;
}
//----------------------------------------------------------------------------
bool
Scene::GetGraphicSnapPoint( int nSnap, const Point3d& ptWin, int nW, int nH, Point3d& ptSel)
@@ -222,7 +204,7 @@ Scene::FindSelectedIntersectionPoint( const Point3d& ptWin, int nW, int nH)
bool
Scene::FindSelectedSnapPoint( int nSnap, const Point3d& ptWin, int nW, int nH)
{
// verifico siano state selezionate delle entità
// seleziono e verifico siano state selezionate delle entità
int nSel ;
Select( ptWin, nW, nH, nSel) ;
if ( nSel <= 0)
@@ -239,8 +221,8 @@ Scene::FindSelectedSnapPoint( int nSnap, const Point3d& ptWin, int nW, int nH)
Frame3d frEnt ;
if ( ! m_pGeomDB->GetGlobFrame( nId, frEnt))
continue ;
// se punto e abilitato
if ( pGObj->GetType() == GEO_PNT3D && ( m_nObjFilterForSnap & GEO_ZERODIM) != 0) {
// se punto
if ( pGObj->GetType() == GEO_PNT3D) {
// recupero il geo-punto
const IGeoPoint3d* pGP = GetGeoPoint3d( pGObj) ;
// recupero il punto
@@ -253,8 +235,8 @@ Scene::FindSelectedSnapPoint( int nSnap, const Point3d& ptWin, int nW, int nH)
m_bLastSnapDirOk = false ;
}
}
// se vettore e abilitato
else if ( pGObj->GetType() == GEO_VECT3D && ( m_nObjFilterForSnap & GEO_ZERODIM) != 0) {
// se vettore
else if ( pGObj->GetType() == GEO_VECT3D) {
// recupero il geo-vettore
const IGeoVector3d* pGV = GetGeoVector3d( pGObj) ;
// recupero il punto base
@@ -269,8 +251,8 @@ Scene::FindSelectedSnapPoint( int nSnap, const Point3d& ptWin, int nW, int nH)
m_vtLastSnapDir.ToGlob( frEnt) ;
}
}
// se frame e abilitato
else if ( pGObj->GetType() == GEO_FRAME3D && ( m_nObjFilterForSnap & GEO_ZERODIM) != 0) {
// se frame
else if ( pGObj->GetType() == GEO_FRAME3D) {
// recupero il geo-frame
const IGeoFrame3d* pGF = GetGeoFrame3d( pGObj) ;
// recupero l'origine del riferimento
@@ -283,32 +265,32 @@ Scene::FindSelectedSnapPoint( int nSnap, const Point3d& ptWin, int nW, int nH)
m_bLastSnapDirOk = false ;
}
}
// se curva composita e abilitata
else if ( pGObj->GetType() == CRV_COMPO && ( m_nObjFilterForSnap & GEO_CURVE) != 0) {
// se curva composita
else if ( pGObj->GetType() == CRV_COMPO) {
// recupero la curva composita
const ICurveComposite* pCrvCompo = GetCurveComposite( pGObj) ;
// verifico i punti notevoli della curva composita
if ( FindCurveCompoSnapPoint( nSnap, ptWin, nId, frEnt, pCrvCompo, dMinSqDist))
bFound = true ;
}
// se curva semplice e abilitata
else if ( ( pGObj->GetType() & GEO_CURVE) != 0 && ( m_nObjFilterForSnap & GEO_CURVE) != 0) {
// se curva semplice
else if ( ( pGObj->GetType() & GEO_CURVE) != 0) {
// recupero la curva
const ICurve* pCrv = GetCurve( pGObj) ;
// verifico i punti notevoli della curva
if ( FindCurveSnapPoint( nSnap, ptWin, nId, frEnt, pCrv, dMinSqDist))
bFound = true ;
}
// se superficie trimesh e abilitata
else if ( pGObj->GetType() == SRF_TRIMESH && ( m_nObjFilterForSnap & GEO_SURF) != 0) {
// se superficie trimesh
else if ( pGObj->GetType() == SRF_TRIMESH) {
// recupero la superficie
const ISurfTriMesh* pStm = GetSurfTriMesh( pGObj) ;
// verifico i punti notevoli della superficie
if ( FindSurfTMSnapPoint( nSnap, ptWin, nId, frEnt, pStm, dMinSqDist))
bFound = true ;
}
// se testo e abilitato
else if ( pGObj->GetType() == EXT_TEXT && ( m_nObjFilterForSnap & GEO_EXTRA) != 0) {
// se testo
else if ( pGObj->GetType() == EXT_TEXT) {
// recupero il testo
const IExtText* pTxt = GetExtText( pGObj) ;
// verifico i punti notevoli del testo