#include "StdAfx.h"
#include "2DObject.h"

/************************************************************************
  ¶þÎ¬»­Í¼»ùÀà
************************************************************************/
C2DObject::C2DObject(void)
{
	m_dwID = g_dwID++;
}

C2DObject::~C2DObject(void)
{
}

C2DObject* C2DObject::CreateObject( enum enumDrawClass enumClassType )
{
	switch(enumClassType)
	{
	case CLASS_DRAW_POINT:
		{
			C2DPoint* pPt = new C2DPoint;
			return pPt;
		}
		break;
	case CLASS_DRAW_BEELINE:
		{
			C2DBeeLine* pLine = new C2DBeeLine;
			return pLine;
		}
		break;
	case CLASS_DRAW_POLYLINE:
		{
			C2DPolyLine* pPolyLine = new C2DPolyLine;
			return pPolyLine;
		}
		break;
	case CLASS_DRAW_CURVE:
		{
			C2DCurve* pCurve = new C2DCurve;
            return pCurve;
		}
		break;
	case CLASS_DRAW_TRIANGLE:
		{
			C2DTriangle* pTriangle = new C2DTriangle;
			return pTriangle;
		}
		break;
	case CLASS_DRAW_CIRCLE:
		{
			C2DCircle* pCircle = new C2DCircle;
			return pCircle;
		}
		break;
	default:
		TRACE("Error ClassType:%d in C2DObject::CreateObject!\n",enumClassType);
		return NULL;
	}
}

DWORD C2DObject::GetID()
{
	return m_dwID;
}

void C2DObject::SetID( DWORD dwID )
{
	m_dwID = dwID;
}

