diff --git a/EGkCurveBezier.h b/EGkCurveBezier.h index 8231cba..f39bc44 100644 --- a/EGkCurveBezier.h +++ b/EGkCurveBezier.h @@ -39,16 +39,16 @@ class __declspec( novtable) ICurveBezier : public ICurve //----------------------------------------------------------------------------- inline ICurveBezier* CreateCurveBezier( void) - { return (static_cast( CreateGeoObj( CRV_BEZ))) ; } + { return (static_cast( CreateGeoObj( CRV_BEZIER))) ; } inline ICurveBezier* CloneCurveBezier( const IGeoObj* pGObj) - { if ( pGObj == nullptr || pGObj->GetType() != CRV_BEZ) + { if ( pGObj == nullptr || pGObj->GetType() != CRV_BEZIER) return nullptr ; return (static_cast(pGObj->Clone())) ; } inline const ICurveBezier* GetCurveBezier( const IGeoObj* pGObj) - { if ( pGObj == nullptr || pGObj->GetType() != CRV_BEZ) + { if ( pGObj == nullptr || pGObj->GetType() != CRV_BEZIER) return nullptr ; return (static_cast(pGObj)) ; } inline ICurveBezier* GetCurveBezier( IGeoObj* pGObj) - { if ( pGObj == nullptr || pGObj->GetType() != CRV_BEZ) + { if ( pGObj == nullptr || pGObj->GetType() != CRV_BEZIER) return nullptr ; return (static_cast(pGObj)) ; } diff --git a/EGkGeoObjType.h b/EGkGeoObjType.h index dcc29db..124b489 100644 --- a/EGkGeoObjType.h +++ b/EGkGeoObjType.h @@ -31,10 +31,11 @@ enum GeoObjType { GEO_NONE = 0, GEO_FRAME3D = ( GEO_ZERODIM + 2), CRV_LINE = ( GEO_CURVE + 0), CRV_ARC = ( GEO_CURVE + 1), - CRV_BEZ = ( GEO_CURVE + 2), + CRV_BEZIER = ( GEO_CURVE + 2), CRV_COMPO = ( GEO_CURVE + 3), SRF_TRIMESH = ( GEO_SURF + 0), SRF_FLATRGN = ( GEO_SURF + 1), + SRF_BEZIER = ( GEO_SURF + 2), VOL_ZMAP = ( GEO_VOLUME + 0), EXT_TEXT = ( GEO_EXTRA + 0), EXT_DIMENSION = ( GEO_EXTRA + 1)} ; diff --git a/EGkSurfBezier.h b/EGkSurfBezier.h new file mode 100644 index 0000000..6681723 --- /dev/null +++ b/EGkSurfBezier.h @@ -0,0 +1,74 @@ +//---------------------------------------------------------------------------- +// EgalTech 2020-2020 +//---------------------------------------------------------------------------- +// File : EGkSurfBezier.h Data : 22.03.20 Versione : 2.2c3 +// Contenuto : Dichiarazione della interfaccia ISurfBezier. +// +// +// +// Modifiche : 22.03.20 DS Creazione modulo. +// +// +//---------------------------------------------------------------------------- + +#pragma once + +#include "/EgtDev/Include/EGkSurf.h" +#include "/EgtDev/Include/EgtPointerOwner.h" + +class PolyLine ; +class ISurfTriMesh ; + +//---------------------------------------------------------------------------- +class __declspec( novtable) ISurfBezier : public ISurf +{ + public : // IGeoObj + ISurfBezier* Clone( void) const override = 0 ; + public : + virtual bool CopyFrom( const IGeoObj* pGObjSrc) = 0 ; + virtual bool Init( int nDegU, int nDegV, bool bIsRational) = 0 ; + virtual bool SetControlPoint( int nIndU, int nIndV, const Point3d& ptCtrl) = 0 ; + virtual bool SetControlPoint( int nInd, const Point3d& ptCtrl) = 0 ; + virtual bool SetControlPoint( int nIndU, int nIndV, const Point3d& ptCtrl, double dW) = 0 ; + virtual bool SetControlPoint( int nInd, const Point3d& ptCtrl, double dW) = 0 ; + virtual bool GetInfo( int& nDegU, int& nDegV, bool& bIsRat) const = 0 ; + virtual const Point3d& GetControlPoint( int nIndU, int nIndV, bool* pbOk) const = 0 ; + virtual const Point3d& GetControlPoint( int nInd, bool* pbOk) const = 0 ; + virtual double GetControlWeight( int nIndU, int nIndV, bool* pbOk) const = 0 ; + virtual double GetControlWeight( int nInd, bool* pbOk) const = 0 ; + virtual bool IsAPoint( void) const = 0 ; + virtual bool GetPointD1D2( double dU, double dV, Point3d& ptPos, + Vector3d* pvtDerU = nullptr, Vector3d* pvtDerV = nullptr, + Vector3d* pvtDerUU = nullptr, Vector3d* pvtDerVV = nullptr, Vector3d* pvtDerUV = nullptr) const = 0 ; + virtual bool GetPointNrmD1D2( double dU, double dV, Point3d& ptPos, Vector3d& vtN, + Vector3d* pvtDerU = nullptr, Vector3d* pvtDerV = nullptr, + Vector3d* pvtDerUU = nullptr, Vector3d* pvtDerVV = nullptr, Vector3d* pvtDerUV = nullptr) const = 0 ; + virtual bool GetControlCurveOnU( int nIndV, PolyLine& plCtrlU) const = 0 ; + virtual bool GetControlCurveOnV( int nIndU, PolyLine& plCtrlV) const = 0 ; + virtual bool GetCurveOnU( double dV, PolyLine& plCtrlU) const = 0 ; + virtual bool GetCurveOnV( double dU, PolyLine& plCtrlV) const = 0 ; + virtual const ISurfTriMesh* GetAuxSurf( void) const = 0 ; +} ; + +//----------------------------------------------------------------------------- +inline ISurfBezier* CreateSurfBezier( void) + { return (static_cast( CreateGeoObj( SRF_BEZIER))) ; } +inline ISurfBezier* CloneSurfBezier( const IGeoObj* pGObj) + { if ( pGObj == nullptr || pGObj->GetType() != SRF_BEZIER) + return nullptr ; + return (static_cast(pGObj->Clone())) ; } +inline const ISurfBezier* GetSurfBezier( const IGeoObj* pGObj) + { if ( pGObj == nullptr || pGObj->GetType() != SRF_BEZIER) + return nullptr ; + return (static_cast(pGObj)) ; } +inline ISurfBezier* GetSurfBezier( IGeoObj* pGObj) + { if ( pGObj == nullptr || pGObj->GetType() != SRF_BEZIER) + return nullptr ; + return (static_cast(pGObj)) ; } + +//---------------------------------------------------------------------------- +// Raccolte di puntatori a ISurfBezier +typedef std::vector CISURFBEZPVECTOR ; // vettore di puntatori a const ISurfBezier +typedef std::vector ISURFBEZPVECTOR ; // vettore di puntatori a ISurfBezier +typedef std::list ISURFBEZPLIST ; // lista di puntatori a ISurfBezier +typedef std::vector> ISURFBEZPOVECTOR ; // vettore di puntatori esclusivi a ISurfBezier diff --git a/EXeExecutor.h b/EXeExecutor.h index 364aaac..4f829c5 100644 --- a/EXeExecutor.h +++ b/EXeExecutor.h @@ -289,6 +289,8 @@ EXE_EXPORT int ExeCreateSurfTmRuled( int nParentId, int nPtOrCrvId1, int nPtOrC EXE_EXPORT int ExeCreateSurfTmByTriangles( int nParentId, const INTVECTOR& vIds, bool bErase) ; EXE_EXPORT int ExeCreateSurfTmBySewing( int nParentId, const INTVECTOR& vIds, bool bErase) ; EXE_EXPORT int ExeCreateSurfTmByVolZmap( int nParentId, int nZmapId, int nPart) ; +EXE_EXPORT int ExeCreateSurfBezier( int nParentId, int nDegU, int nDegV, const PNTVECTOR& vPnt, int nRefType) ; +EXE_EXPORT int ExeCreateSurfBezierRational( int nParentId, int nDegU, int nDegV, const PNTUVECTOR& vPntW, int nRefType) ; // GeomDB Create Volume EXE_EXPORT int ExeCreateVolZmap( int nParentId, const Point3d& ptIni, double dDimX, @@ -541,20 +543,14 @@ EXE_EXPORT bool ExeVolZmapGetDepth( int nId, const Point3d& ptP, const Vector3d& EXE_EXPORT int ExeVolZmapGetEdges( int nId, int nDestGrpId, int* pnCount) ; EXE_EXPORT bool ExeCutVolZmapPlane( int nId, const Point3d& ptOn, const Vector3d& vtN, int nRefType) ; -// Geo Snap Vector/Point/Frame -EXE_EXPORT bool ExeStartPoint( int nId, int nRefId, Point3d& ptP) ; -EXE_EXPORT bool ExeEndPoint( int nId, int nRefId, Point3d& ptP) ; -EXE_EXPORT bool ExeMidPoint( int nId, int nRefId, Point3d& ptP) ; -EXE_EXPORT bool ExeCenterPoint( int nId, int nRefId, Point3d& ptP) ; -EXE_EXPORT bool ExeCentroid( int nId, int nRefId, Point3d& ptP) ; -EXE_EXPORT bool ExeAtParamPoint( int nId, double dU, int nRefId, Point3d& ptP) ; -EXE_EXPORT bool ExeNearPoint( int nId, const Point3d& ptNear, int nRefId, Point3d& ptP) ; -EXE_EXPORT bool ExeIntersectionPoint( int nId1, int nId2, const Point3d& ptNear, int nRefId, Point3d& ptP) ; -EXE_EXPORT bool ExeStartVector( int nId, int nRefId, Vector3d& vtV) ; -EXE_EXPORT bool ExeEndVector( int nId, int nRefId, Vector3d& vtV) ; -EXE_EXPORT bool ExeMidVector( int nId, int nRefId, Vector3d& vtV) ; -EXE_EXPORT bool ExeAtParamVector( int nId, double dU, int nSide, int nRefId, Vector3d& vtV) ; -EXE_EXPORT bool ExeFrame( int nId, int nRefId, Frame3d& frFrame) ; +// GeomDB Get +EXE_EXPORT bool ExeTextNormVersor( int nId, int nRefId, Vector3d& vtNorm) ; +EXE_EXPORT bool ExeTextGetContent( int nId, std::string& sText) ; +EXE_EXPORT bool ExeTextGetFont( int nId, std::string& sFont) ; +EXE_EXPORT bool ExeTextGetHeight( int nId, double& dH) ; +EXE_EXPORT bool ExeTextGetItalic( int nId, bool& bItl) ; + +// GeomDb Curve Get EXE_EXPORT bool ExeCurveDomain( int nId, double* pdStart, double* pdEnd) ; EXE_EXPORT bool ExeCurveLength( int nId, double* pdLen) ; EXE_EXPORT bool ExeCurveLengthAtPoint( int nId, const Point3d& ptOn, double dExtend, double* pdLen) ; @@ -575,6 +571,8 @@ EXE_EXPORT bool ExeArcDeltaN( int nId, double* pdDeltaN) ; EXE_EXPORT bool ExeArcNormVersor( int nId, int nRefId, Vector3d& vtNorm) ; EXE_EXPORT bool ExeCurveCompoCenter( int nId, int nSimpCrv, int nRefId, Point3d& ptCen) ; EXE_EXPORT bool ExeCurveCompoRadius( int nId, int nSimpCrv, double& dRad) ; + +// GeomDb Surf Get EXE_EXPORT bool ExeSurfArea( int nId, double& dArea) ; EXE_EXPORT bool ExeSurfVolume( int nId, double& dVol) ; EXE_EXPORT bool ExeSurfFrNormVersor( int nId, int nRefId, Vector3d& vtNorm) ; @@ -596,14 +594,34 @@ EXE_EXPORT bool ExeSurfTmFacetOppositeSide( int nId, int nFacet, const Vector3d& EXE_EXPORT bool ExeSurfTmFacetOppositeSideEx( int nId, int nFacet, const Vector3d& vtDir, int nRefId, Point3d& ptP1, Point3d& ptPm, Point3d& ptP2, Vector3d& vtIn1, Vector3d& vtOut2, double& dLen, double& dWidth) ; EXE_EXPORT bool ExeSurfTmFacetsContact( int nId, int nF1, int nF2, int nRefId, bool& bAdjac, Point3d& ptP1, Point3d& ptP2, double& dAng) ; +EXE_EXPORT bool ExeSurfBezierGetPoint( int nSurfId, double dU, double dV, int nRefId, Point3d& ptP) ; +EXE_EXPORT bool ExeSurfBezierGetPointD1( int nSurfId, double dU, double dV, int nRefId, Point3d& ptP, Vector3d& vtDerU, Vector3d& vtDerV) ; +EXE_EXPORT bool ExeSurfBezierGetPointNrmD1( int nSurfId, double dU, double dV, int nRefId, Point3d& ptP, Vector3d& vtN, Vector3d& vtDerU, Vector3d& vtDerV) ; +EXE_EXPORT int ExeSurfBezierGetCurveU( int nSurfId, double dV, int nDestGrpId) ; +EXE_EXPORT int ExeSurfBezierGetCurveV( int nSurfId, double dU, int nDestGrpId) ; +EXE_EXPORT bool ExeSurfBezierGetInfo( int nSurfId, int& nDegU, int& nDegV, bool& bIsRat) ; +EXE_EXPORT int ExeSurfBezierGetControlCurveU( int nSurfId, int nIndV, int nDestGrpId) ; +EXE_EXPORT int ExeSurfBezierGetControlCurveV( int nSurfId, int nIndU, int nDestGrpId) ; + +// GeomDb Volume Get EXE_EXPORT bool ExeVolZmapVolume( int nId, double& dVol) ; EXE_EXPORT int ExeVolZmapPartCount( int nId) ; EXE_EXPORT bool ExeVolZmapPartVolume( int nId, int nPart, double& dVol) ; -EXE_EXPORT bool ExeTextNormVersor( int nId, int nRefId, Vector3d& vtNorm) ; -EXE_EXPORT bool ExeTextGetContent( int nId, std::string& sText) ; -EXE_EXPORT bool ExeTextGetFont( int nId, std::string& sFont) ; -EXE_EXPORT bool ExeTextGetHeight( int nId, double& dH) ; -EXE_EXPORT bool ExeTextGetItalic( int nId, bool& bItl) ; + +// Geo Snap Vector/Point/Frame +EXE_EXPORT bool ExeStartPoint( int nId, int nRefId, Point3d& ptP) ; +EXE_EXPORT bool ExeEndPoint( int nId, int nRefId, Point3d& ptP) ; +EXE_EXPORT bool ExeMidPoint( int nId, int nRefId, Point3d& ptP) ; +EXE_EXPORT bool ExeCenterPoint( int nId, int nRefId, Point3d& ptP) ; +EXE_EXPORT bool ExeCentroid( int nId, int nRefId, Point3d& ptP) ; +EXE_EXPORT bool ExeAtParamPoint( int nId, double dU, int nRefId, Point3d& ptP) ; +EXE_EXPORT bool ExeNearPoint( int nId, const Point3d& ptNear, int nRefId, Point3d& ptP) ; +EXE_EXPORT bool ExeIntersectionPoint( int nId1, int nId2, const Point3d& ptNear, int nRefId, Point3d& ptP) ; +EXE_EXPORT bool ExeStartVector( int nId, int nRefId, Vector3d& vtV) ; +EXE_EXPORT bool ExeEndVector( int nId, int nRefId, Vector3d& vtV) ; +EXE_EXPORT bool ExeMidVector( int nId, int nRefId, Vector3d& vtV) ; +EXE_EXPORT bool ExeAtParamVector( int nId, double dU, int nSide, int nRefId, Vector3d& vtV) ; +EXE_EXPORT bool ExeFrame( int nId, int nRefId, Frame3d& frFrame) ; EXE_EXPORT bool ExePointToIdGlob( Point3d& ptP, int nId) ; EXE_EXPORT bool ExePointToIdLoc( Point3d& ptP, int nId) ; EXE_EXPORT bool ExeVectorToIdGlob( Vector3d& vtV, int nId) ;