EgtGraphics 2.2c3 :
- aggiunta gestione superfici di Bezier.
This commit is contained in:
Binary file not shown.
+4
-1
@@ -27,6 +27,7 @@
|
||||
#include "/EgtDev/Include/EGkCurveComposite.h"
|
||||
#include "/EgtDev/Include/EGkSurfTriMesh.h"
|
||||
#include "/EgtDev/Include/EGkSurfFlatRegion.h"
|
||||
#include "/EgtDev/Include/EGkSurfBezier.h"
|
||||
#include "/EgtDev/Include/EGkVolZmap.h"
|
||||
#include "/EgtDev/Include/EGkExtText.h"
|
||||
#include "/EgtDev/Include/EGkExtDimension.h"
|
||||
@@ -227,6 +228,7 @@ Scene::DrawGeoObj( const IGdbIterator& iIter, int nPass, const MdStMkCol& siObj)
|
||||
switch ( nGeoType) {
|
||||
case SRF_TRIMESH : pSTM = GetSurfTriMesh( pGeoObj) ; break ;
|
||||
case SRF_FLATRGN : pSTM = GetSurfFlatRegion( pGeoObj)->GetAuxSurf() ; break ;
|
||||
case SRF_BEZIER : pSTM = GetSurfBezier( pGeoObj)->GetAuxSurf() ; break ;
|
||||
}
|
||||
if ( pSTM != nullptr && pSTM->GetTriangleCount() > N_MIN_TRIA_NEWWAY)
|
||||
bNewWay = true ;
|
||||
@@ -318,7 +320,7 @@ Scene::DrawGeoObj( const IGdbIterator& iIter, int nPass, const MdStMkCol& siObj)
|
||||
pCurve->GetThickness( dTh) && abs( dTh) > EPS_SMALL) {
|
||||
// segmenti di raccordo
|
||||
PNTVECTOR vPnt ;
|
||||
bool bDense = ( nGeoType == CRV_ARC || nGeoType == CRV_BEZ) ;
|
||||
bool bDense = ( nGeoType == CRV_ARC || nGeoType == CRV_BEZIER) ;
|
||||
if ( CalcConnectingLines( PL, dTh * vtExtr, bDense, vPnt))
|
||||
pGraphics->AddLines( vPnt) ;
|
||||
// percorso traslato
|
||||
@@ -333,6 +335,7 @@ Scene::DrawGeoObj( const IGdbIterator& iIter, int nPass, const MdStMkCol& siObj)
|
||||
switch (nGeoType) {
|
||||
case SRF_TRIMESH : pSTM = GetSurfTriMesh( pGeoObj) ; break ;
|
||||
case SRF_FLATRGN : pSTM = GetSurfFlatRegion( pGeoObj)->GetAuxSurf() ; break ;
|
||||
case SRF_BEZIER : pSTM = GetSurfBezier( pGeoObj)->GetAuxSurf() ; break ;
|
||||
}
|
||||
if ( pSTM == nullptr)
|
||||
return false ;
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "/EgtDev/Include/EGkDistPointCurve.h"
|
||||
#include "/EgtDev/Include/EGkSurfTriMesh.h"
|
||||
#include "/EgtDev/Include/EGkSurfFlatRegion.h"
|
||||
#include "/EgtDev/Include/EGkSurfBezier.h"
|
||||
#include "/EgtDev/Include/EGkExtText.h"
|
||||
#include "/EgtDev/Include/EGkExtDimension.h"
|
||||
#include "/EgtDev/Include/EGkIntersLinePlane.h"
|
||||
@@ -415,6 +416,41 @@ Scene::GetPointFromSelect( int nSelId, const Point3d& ptView, Point3d& ptSel, in
|
||||
}
|
||||
}
|
||||
}
|
||||
// se superficie di Bezier
|
||||
else if ( pGObj->GetType() == SRF_BEZIER) {
|
||||
// recupero la superficie
|
||||
const ISurfBezier* pSbz = GetSurfBezier( pGObj) ;
|
||||
const ISurfTriMesh* pStm = pSbz->GetAuxSurf() ;
|
||||
// il punto di riferimento deriva da XY su viewport e Z da selezione
|
||||
Point3d ptWinZ( ptView.x, ptView.y, GetSelectedObjWinZ()) ;
|
||||
// lo porto da spazio grafico a spazio geometrico globale
|
||||
Point3d ptRef ;
|
||||
UnProject( ptWinZ, ptRef) ;
|
||||
// lo porto nel frame della superficie
|
||||
ptRef.ToLoc( frEnt) ;
|
||||
// recupero la direzione di mira e la porto nel riferimento della superficie
|
||||
Vector3d vtDir = - m_vtDirCamera ;
|
||||
vtDir.ToLoc( frEnt) ;
|
||||
// recupero il raggio del box di ingombro
|
||||
double dBlRad = 1000 ;
|
||||
const ObjEGrGraphics* pGraphics = GetObjEGrGraphics( pStm) ;
|
||||
if ( pGraphics != nullptr) {
|
||||
BBox3d b3Loc ;
|
||||
if ( pGraphics->GetLocalBBox( b3Loc))
|
||||
b3Loc.GetRadius( dBlRad) ;
|
||||
}
|
||||
// punto davanti all'oggetto lungo il raggio di mira
|
||||
Point3d ptMir = ptRef - vtDir * 2 * dBlRad ;
|
||||
double dLenMir = 4 * dBlRad ;
|
||||
// cerco i triangoli intersecati dalla linea di mira
|
||||
ILSIVECTOR vInfo ;
|
||||
if ( ! IntersLineSurfTm( ptMir, vtDir, dLenMir, *pStm, vInfo) || vInfo.size() == 0)
|
||||
return false ;
|
||||
// recupero il primo punto
|
||||
ptSel = vInfo[0].ptI ;
|
||||
ptSel.ToGlob( frEnt) ;
|
||||
nAux = 0 ;
|
||||
}
|
||||
// se testo
|
||||
else if ( pGObj->GetType() == EXT_TEXT) {
|
||||
// recupero il testo
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "/EgtDev/Include/EGkDistPointCurve.h"
|
||||
#include "/EgtDev/Include/EGkSurfTriMesh.h"
|
||||
#include "/EgtDev/Include/EGkSurfFlatRegion.h"
|
||||
#include "/EgtDev/Include/EGkSurfBezier.h"
|
||||
#include "/EgtDev/Include/EGkVolZmap.h"
|
||||
#include "/EgtDev/Include/EGkExtText.h"
|
||||
#include "/EgtDev/Include/EGkExtDimension.h"
|
||||
@@ -343,6 +344,15 @@ Scene::FindSelectedSnapPoint( int nSnap, const Point3d& ptWin, int nW, int nH)
|
||||
if ( FindSurfFRSnapPoint( nSnap, ptWin, nId, frEnt, pReg, dMinSqDist))
|
||||
bFound = true ;
|
||||
}
|
||||
// se superficie di Bezier
|
||||
else if ( pGObj->GetType() == SRF_BEZIER) {
|
||||
// recupero la superficie
|
||||
const ISurfBezier* pSbz = GetSurfBezier( pGObj) ;
|
||||
const ISurfTriMesh* pStm = pSbz->GetAuxSurf() ;
|
||||
// verifico i punti notevoli della superficie ausiliaria associata
|
||||
if ( FindSurfTMSnapPoint( nSnap, ptWin, nId, frEnt, pStm, dMinSqDist))
|
||||
bFound = true ;
|
||||
}
|
||||
// se solido Zmap
|
||||
else if ( pGObj->GetType() == VOL_ZMAP) {
|
||||
// recupero il solido
|
||||
|
||||
Reference in New Issue
Block a user