Files
EgtGeomKernel/GeoObjTypeFun.h
T
2013-11-21 13:30:00 +00:00

80 lines
3.9 KiB
C

//----------------------------------------------------------------------------
// 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<const GeoVector3d*>(pGObj)) ; }
inline GeoVector3d* GetGeoVector3d( GeoObj* pGObj)
{ if ( pGObj == nullptr || pGObj->GetType() != GEO_VECT3D)
return nullptr ;
return (static_cast<GeoVector3d*>(pGObj)) ; }
inline const GeoPoint3d* GetGeoPoint3d( const GeoObj* pGObj)
{ if ( pGObj == nullptr || pGObj->GetType() != GEO_PNT3D)
return nullptr ;
return (static_cast<const GeoPoint3d*>(pGObj)) ; }
inline GeoPoint3d* GetGeoPoint3d( GeoObj* pGObj)
{ if ( pGObj == nullptr || pGObj->GetType() != GEO_PNT3D)
return nullptr ;
return (static_cast<GeoPoint3d*>(pGObj)) ; }
inline const Curve* GetCurve( const GeoObj* pGObj)
{ if ( pGObj == nullptr || ( pGObj->GetType() & GEO_CURVE) == 0)
return nullptr ;
return (static_cast<const Curve*>(pGObj)) ; }
inline Curve* GetCurve( GeoObj* pGObj)
{ if ( pGObj == nullptr || ( pGObj->GetType() & GEO_CURVE) == 0)
return nullptr ;
return (static_cast<Curve*>(pGObj)) ; }
inline const CurveLine* GetCurveLine( const GeoObj* pGObj)
{ if ( pGObj == nullptr || pGObj->GetType() != CRV_LINE)
return nullptr ;
return (static_cast<const CurveLine*>(pGObj)) ; }
inline CurveLine* GetCurveLine( GeoObj* pGObj)
{ if ( pGObj == nullptr || pGObj->GetType() != CRV_LINE)
return nullptr ;
return (static_cast<CurveLine*>(pGObj)) ; }
inline const CurveArc* GetCurveArc( const GeoObj* pGObj)
{ if ( pGObj == nullptr || pGObj->GetType() != CRV_ARC)
return nullptr ;
return (static_cast<const CurveArc*>(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<const CurveBezier*>(pGObj)) ; }
inline CurveBezier* GetCurveBezier( GeoObj* pGObj)
{ if ( pGObj == nullptr || pGObj->GetType() != CRV_BEZ)
return nullptr ;
return (static_cast<CurveBezier*>(pGObj)) ; }
inline const CurveComposite* GetCurveComposite( const GeoObj* pGObj)
{ if ( pGObj == nullptr || pGObj->GetType() != CRV_COMPO)
return nullptr ;
return (static_cast<const CurveComposite*>(pGObj)) ; }
inline CurveComposite* GetCurveComposite( GeoObj* pGObj)
{ if ( pGObj == nullptr || pGObj->GetType() != CRV_COMPO)
return nullptr ;
return (static_cast< CurveComposite*>(pGObj)) ; }