//---------------------------------------------------------------------------- // EgalS //---------------------------------------------------------------------------- // File : GeoObjTypeFun.h Data : 30.04.13 Versione : 1.1d3 // Contenuto : Definizione funzioni per conversione di Oggetti Geometrici. // // // // Modifiche : 30.04.13 DS Creazione modulo. // // //---------------------------------------------------------------------------- #pragma once #include "GeoVector3d.h" #include "GeoPoint3d.h" #include "CurveLine.h" #include "CurveArc.h" #include "CurveBezier.h" #include "CurveComposite.h" //----------------- Funzioni conversione oggetti geometrici ------------------ inline const GeoVector3d* GetGeoVector3d( const GeoObj* pGObj) { if ( pGObj == nullptr || pGObj->GetType() != GEO_VECT3D) return nullptr ; return (static_cast(pGObj)) ; } inline GeoVector3d* GetGeoVector3d( GeoObj* pGObj) { if ( pGObj == nullptr || pGObj->GetType() != GEO_VECT3D) return nullptr ; return (static_cast(pGObj)) ; } inline const GeoPoint3d* GetGeoPoint3d( const GeoObj* pGObj) { if ( pGObj == nullptr || pGObj->GetType() != GEO_PNT3D) return nullptr ; return (static_cast(pGObj)) ; } inline GeoPoint3d* GetGeoPoint3d( GeoObj* pGObj) { if ( pGObj == nullptr || pGObj->GetType() != GEO_PNT3D) return nullptr ; return (static_cast(pGObj)) ; } inline const Curve* GetCurve( const GeoObj* pGObj) { if ( pGObj == nullptr || ( pGObj->GetType() & GEO_CURVE) == 0) return nullptr ; return (static_cast(pGObj)) ; } inline Curve* GetCurve( GeoObj* pGObj) { if ( pGObj == nullptr || ( pGObj->GetType() & GEO_CURVE) == 0) return nullptr ; return (static_cast(pGObj)) ; } inline const CurveLine* GetCurveLine( const GeoObj* pGObj) { if ( pGObj == nullptr || pGObj->GetType() != CRV_LINE) return nullptr ; return (static_cast(pGObj)) ; } inline CurveLine* GetCurveLine( GeoObj* pGObj) { if ( pGObj == nullptr || pGObj->GetType() != CRV_LINE) return nullptr ; return (static_cast(pGObj)) ; } inline const CurveArc* GetCurveArc( const GeoObj* pGObj) { if ( pGObj == nullptr || pGObj->GetType() != CRV_ARC) return nullptr ; return (static_cast(pGObj)) ; } inline CurveArc* GetCurveArc( GeoObj* pGObj) { if ( pGObj == nullptr || pGObj->GetType() != CRV_ARC) return nullptr ; return (static_cast< CurveArc*>(pGObj)) ; } inline const CurveBezier* GetCurveBezier( const GeoObj* pGObj) { if ( pGObj == nullptr || pGObj->GetType() != CRV_BEZ) return nullptr ; return (static_cast(pGObj)) ; } inline CurveBezier* GetCurveBezier( GeoObj* pGObj) { if ( pGObj == nullptr || pGObj->GetType() != CRV_BEZ) return nullptr ; return (static_cast(pGObj)) ; } inline const CurveComposite* GetCurveComposite( const GeoObj* pGObj) { if ( pGObj == nullptr || pGObj->GetType() != CRV_COMPO) return nullptr ; return (static_cast(pGObj)) ; } inline CurveComposite* GetCurveComposite( GeoObj* pGObj) { if ( pGObj == nullptr || pGObj->GetType() != CRV_COMPO) return nullptr ; return (static_cast< CurveComposite*>(pGObj)) ; }