Include :

- aggiornamento e aggiunta prototipi.
This commit is contained in:
Dario Sassi
2014-11-18 16:19:42 +00:00
parent 4788ed59f9
commit a902b4ceb7
6 changed files with 35 additions and 89 deletions
+4 -2
View File
@@ -89,14 +89,16 @@ class __declspec( novtable) IGeomDB
virtual bool ShearGlob( int nId, const Point3d& ptOn, const Vector3d& vtNorm, const Vector3d& vtDir, double dCoeff) = 0 ;
virtual bool ShearGroup( int nId, const Point3d& ptOn, const Vector3d& vtNorm, const Vector3d& vtDir, double dCoeff) = 0 ;
// selection
virtual bool SelectObj( int nId) = 0 ;
virtual bool SelectObj( int nId, bool bOnlyIfVisible = false) = 0 ;
virtual bool DeselectObj( int nId) = 0 ;
virtual bool SelectGroupObjs( int nId, int nFilter = 0) = 0 ;
virtual bool SelectGroupObjs( int nId, int nFilter = 0, bool bOnlyIfVisible = false) = 0 ;
virtual bool DeselectGroupObjs( int nId) = 0 ;
virtual bool IsSelectedObj( int nId) const = 0 ;
virtual int GetSelectedObjNbr( void) const = 0 ;
virtual int GetFirstSelectedObj( void) const = 0 ;
virtual int GetNextSelectedObj( void) const = 0 ;
virtual int GetLastSelectedObj( void) const = 0 ;
virtual int GetPrevSelectedObj( void) const = 0 ;
virtual bool ClearSelection( void) = 0 ;
// attributes
virtual bool DumpAttributes( int nId, std::string& sOut, const char* szNewLine) const = 0 ;
+5 -5
View File
@@ -54,19 +54,19 @@ class EGK_EXPORT Point3d
bool IsZero( void) const
{ return ( ( x * x + y * y + z * z) < ( EPS_ZERO * EPS_ZERO)) ; }
//! Somma sul posto con un vettore
const Point3d& operator +=( const Vector3d& vtV)
Point3d& operator +=( const Vector3d& vtV)
{ this->x += vtV.x ; this->y += vtV.y ; this->z += vtV.z ; return *this ; }
//! Sottrazione sul posto con un vettore
const Point3d& operator -=( const Vector3d& vtV)
Point3d& operator -=( const Vector3d& vtV)
{ this->x -= vtV.x ; this->y -= vtV.y ; this->z -= vtV.z ; return *this ; }
//! Somma sul posto con un altro punto (valida solo se equivalente ad una combinazione baricentrica)
const Point3d& operator +=( const Point3d& ptP)
Point3d& operator +=( const Point3d& ptP)
{ this->x += ptP.x ; this->y += ptP.y ; this->z += ptP.z ; return *this ; }
//! Moltiplicazione sul posto con un numero
const Point3d& operator *=( double dMul)
Point3d& operator *=( double dMul)
{ this->x *= dMul ; this->y *= dMul ; this->z *= dMul ; return *this ; }
//! Divisione sul posto con un numero
const Point3d& operator /=( double dDiv)
Point3d& operator /=( double dDiv)
{ double dMul = 1 / dDiv ; this->x *= dMul ; this->y *= dMul ; this->z *= dMul ; return *this ; }
//! Traslazione dato il vettore di movimento
void Translate( const Vector3d& vtMove) ;
+2 -1
View File
@@ -133,4 +133,5 @@ enum SnapPoint { SP_SKETCH = 0,
SP_END = 2,
SP_MID = 3,
SP_CENTER = 4,
SP_NEAR = 5} ;
SP_NEAR = 5,
SP_INTERS = 6} ;
+14
View File
@@ -154,6 +154,7 @@ EIN_EXPORT int __stdcall EgtCreateSurfTriMeshByExtrusion( int nParentId, int nC
EIN_EXPORT int __stdcall EgtCreateSurfTriMeshByScrewing( int nParentId, int nCrvId,
const double ptAx[3], const double vtAx[3],
double dAngRotDeg, double dMove, double dLinTol) ;
EIN_EXPORT int __stdcall EgtCreateSurfTriMeshRuled( int nParentId, int nCrvId1, int nCrvId2, double dLinTol) ;
// GeomDB Objects
EIN_EXPORT BOOL __stdcall EgtExistsObj( int nId) ;
@@ -214,11 +215,18 @@ EIN_EXPORT BOOL __stdcall EgtRemoveInfo( int nId, const wchar_t* wsKey) ;
// GeomDb Obj Selection
EIN_EXPORT BOOL __stdcall EgtSelectObj( int nId) ;
EIN_EXPORT BOOL __stdcall EgtDeselectObj( int nId) ;
EIN_EXPORT BOOL __stdcall EgtSelectAll( bool bOnlyIfVisible) ;
EIN_EXPORT BOOL __stdcall EgtDeselectAll( void) ;
EIN_EXPORT BOOL __stdcall EgtSelectPartObjs( int nPartId) ;
EIN_EXPORT BOOL __stdcall EgtDeselectPartObjs( int nPartId) ;
EIN_EXPORT BOOL __stdcall EgtSelectLayerObjs( int nLayerId) ;
EIN_EXPORT BOOL __stdcall EgtDeselectLayerObjs( int nLayerId) ;
EIN_EXPORT BOOL __stdcall EgtIsSelectedObj( int nId) ;
EIN_EXPORT int __stdcall EgtGetSelectedObjNbr( void) ;
EIN_EXPORT int __stdcall EgtGetFirstSelectedObj( void) ;
EIN_EXPORT int __stdcall EgtGetNextSelectedObj( void) ;
EIN_EXPORT int __stdcall EgtGetLastSelectedObj( void) ;
EIN_EXPORT int __stdcall EgtGetPrevSelectedObj( void) ;
// GeomDB Modify
EIN_EXPORT BOOL __stdcall EgtChangeGroupFrame( int nId,
@@ -230,6 +238,7 @@ EIN_EXPORT BOOL __stdcall EgtChangeTextFont( int nId, const wchar_t* wsNewFont)
EIN_EXPORT BOOL __stdcall EgtFlipText( int nId) ;
EIN_EXPORT BOOL __stdcall EgtMirrorText( int nId, BOOL bOnL) ;
EIN_EXPORT BOOL __stdcall EgtTextToOutline( int nId, int nDestGroupId) ;
EIN_EXPORT BOOL __stdcall EgtExplodeText( int nId) ;
EIN_EXPORT BOOL __stdcall EgtSplitText( int nId, int nDestGroupId) ;
// GeomDb CurveModif
@@ -243,11 +252,15 @@ EIN_EXPORT BOOL __stdcall EgtTrimCurveEndAtLen( int nId, double dLen) ;
EIN_EXPORT BOOL __stdcall EgtTrimCurveStartAtParam( int nId, double dPar) ;
EIN_EXPORT BOOL __stdcall EgtTrimCurveEndAtParam( int nId, double dPar) ;
EIN_EXPORT BOOL __stdcall EgtTrimCurveStartEndAtParam( int nId, double dParS, double dParE) ;
EIN_EXPORT BOOL __stdcall EgtExtendCurveStartByLen( int nId, double dLen) ;
EIN_EXPORT BOOL __stdcall EgtExtendCurveEndByLen( int nId, double dLen) ;
EIN_EXPORT BOOL __stdcall EgtExtendCurveByLen( int nId, double dLen, const double ptNear[3]) ;
EIN_EXPORT BOOL __stdcall EgtSplitCurveAtPoint( int nId, double ptOn[3]) ;
EIN_EXPORT BOOL __stdcall EgtModifyCurveCircleCPN( int nId, const double ptOn[3]) ;
EIN_EXPORT BOOL __stdcall EgtModifyCurveArcC2PN( int nId, const double ptEnd[3]) ;
EIN_EXPORT BOOL __stdcall EgtModifyCurveArc3P( int nId, const double ptMid[3]) ;
EIN_EXPORT BOOL __stdcall EgtSeparateCurveCompo( int nId) ;
EIN_EXPORT BOOL __stdcall EgtExplodeCurveBezier( int nId, double dLinTol, BOOL bArcsVsLines) ;
// Geo Snap Vector/Point/Frame
EIN_EXPORT BOOL __stdcall EgtStartPoint( int nId, double ptP[3]) ;
@@ -255,6 +268,7 @@ EIN_EXPORT BOOL __stdcall EgtEndPoint( int nId, double ptP[3]) ;
EIN_EXPORT BOOL __stdcall EgtMidPoint( int nId, double ptP[3]) ;
EIN_EXPORT BOOL __stdcall EgtCenterPoint( int nId, double ptP[3]) ;
EIN_EXPORT BOOL __stdcall EgtAtParamPoint( int nId, double dU, double ptP[3]) ;
EIN_EXPORT BOOL __stdcall EgtIntersectionPoint( int nId1, int nId2, const double ptNear[3], double ptP[3]) ;
EIN_EXPORT BOOL __stdcall EgtStartVector( int nId, double vtV[3]) ;
EIN_EXPORT BOOL __stdcall EgtEndVector( int nId, double vtV[3]) ;
EIN_EXPORT BOOL __stdcall EgtMidVector( int nId, double vtV[3]) ;
+8 -81
View File
@@ -30,11 +30,15 @@ class Polynomial
{
public :
ENK_EXPORT Polynomial( void) : m_nDegree( -1) {}
ENK_EXPORT Polynomial( const Polynomial& polS)
{ SetDegree( polS.m_nDegree) ;
for ( int i = 0 ; i <= m_nDegree ; ++ i)
m_Coeff[i] = polS.m_Coeff[i] ; }
ENK_EXPORT bool SetDegree( int nDegree) ;
ENK_EXPORT bool SetCoeff( int nPower, double dC) ;
ENK_EXPORT bool Set( int nDegree, const DBLVECTOR& vC) ;
ENK_EXPORT bool SetToConstant( double dC) ;
ENK_EXPORT const Polynomial& operator =( const Polynomial& polS)
ENK_EXPORT Polynomial& operator =( const Polynomial& polS)
{ if ( &polS != this) {
SetDegree( polS.m_nDegree) ;
for ( int i = 0 ; i <= m_nDegree ; ++ i)
@@ -47,9 +51,9 @@ class Polynomial
{ if ( nPower < 0 || nPower > m_nDegree)
return 0 ;
return m_Coeff[nPower] ; }
ENK_EXPORT const Polynomial& operator +=( const Polynomial& polP) ;
ENK_EXPORT const Polynomial& operator -=( const Polynomial& polP) ;
ENK_EXPORT const Polynomial& operator *=( const Polynomial& polP) ;
ENK_EXPORT Polynomial& operator +=( const Polynomial& polP) ;
ENK_EXPORT Polynomial& operator -=( const Polynomial& polP) ;
ENK_EXPORT Polynomial& operator *=( const Polynomial& polP) ;
ENK_EXPORT void Derive( void) ;
ENK_EXPORT void Derive( const Polynomial& polP) ;
ENK_EXPORT void AdjustDegree( void) ;
@@ -102,80 +106,3 @@ operator*( const Polynomial& polP1, const Polynomial& polP2)
// Filtro sulle radici
//----------------------------------------------------------------------------
ENK_EXPORT int FilterMultipleAndOutOfRangeRoots( DBLVECTOR& vRoots, double dMin, double dMax, double dEps) ;
#if 0
//----------------------------------------------------------------------------
void
PolynomialSumm( DBLVECTOR& vSou1, DBLVECTOR& vSou2, DBLVECTOR& vSumm)
{
int nDeg1 = vSou1.size() - 1 ;
int nDeg2 = vSou2.size() - 1 ;
int nMin = (( nDeg1 <= nDeg2) ? nDeg1 : nDeg2) ;
int nMax = (( nDeg1 >= nDeg2) ? nDeg1 : nDeg2) ;
vSumm.clear() ;
vSumm.reserve( nMax + 1) ;
for ( int i = 0 ; i < nMin ; ++ i)
vSumm.push_back( vSou1[i] + vSou2[i]) ;
if ( nDeg1 > nDeg2) {
for ( int i = nMin ; i < nDeg1 ; ++ i)
vSumm.push_back( vSou1[i]) ;
}
else if ( nDeg1 < nDeg2) {
for ( int i = nMin ; i < nDeg2 ; ++ i)
vSumm.push_back( vSou2[i]) ;
}
}
//----------------------------------------------------------------------------
void
PolynomialDiff( DBLVECTOR& vSou1, DBLVECTOR& vSou2, DBLVECTOR& vSumm)
{
int nDeg1 = vSou1.size() - 1 ;
int nDeg2 = vSou2.size() - 1 ;
int nMin = (( nDeg1 <= nDeg2) ? nDeg1 : nDeg2) ;
int nMax = (( nDeg1 >= nDeg2) ? nDeg1 : nDeg2) ;
vSumm.clear() ;
vSumm.reserve( nMax + 1) ;
for ( int i = 0 ; i < nMin ; ++ i)
vSumm.push_back( vSou1[i] - vSou2[i]) ;
if ( nDeg1 > nDeg2) {
for ( int i = nMin ; i < nDeg1 ; ++ i)
vSumm.push_back( vSou1[i]) ;
}
else if ( nDeg1 < nDeg2) {
for ( int i = nMin ; i < nDeg2 ; ++ i)
vSumm.push_back( - vSou2[i]) ;
}
}
//----------------------------------------------------------------------------
void
PolynomialMult( DBLVECTOR& vSou1, DBLVECTOR& vSou2, DBLVECTOR& vMult)
{
int nDeg1 = vSou1.size() - 1 ;
int nDeg2 = vSou2.size() - 1 ;
int nDim = nDeg1 + nDeg2 + 1 ;
vMult.clear() ;
vMult.reserve( nDim) ;
for ( int i = 0 ; i < nDim ; ++ i)
vMult.push_back( 0) ;
for ( int i = 0 ; i <= nDeg1 ; ++ i) {
for ( int j = 0 ; j <= nDeg2 ; ++ j)
vMult[i+j] += vSou1[i] * vSou2[j] ;
}
}
//----------------------------------------------------------------------------
void
PolynomialDerive( DBLVECTOR& vSou, DBLVECTOR& vDer)
{
int nDeg = vSou.size() - 1 ;
vDer.clear() ;
vDer.reserve( nDeg) ;
for ( int i = 0 ; i < nDeg ; ++ i)
vDer.push_back( ( i + 1) * vSou[i+1]) ;
}
#endif
+2
View File
@@ -74,6 +74,8 @@ class __declspec( novtable) ICurve : public IGeoObj
virtual bool TrimStartEndAtParam( double dUStartTrim, double dUEndTrim) = 0 ;
virtual bool TrimStartAtLen( double dLenTrim) = 0 ;
virtual bool TrimEndAtLen( double dLenTrim) = 0 ;
virtual bool ExtendStartByLen( double dLenExt) = 0 ;
virtual bool ExtendEndByLen( double dLenExt) = 0 ;
} ;
//----------------------------------------------------------------------------