//ROMTEAM WorldEditor
////////////////////////////////////////////////////////////////////////////////////////
// File        : Symbolical3D.cpp: implementation file for the Symbolical3D class
// Author      : Viorel Preoteasa
// Date        : 97.11
// Description :
////////////////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "ACP_Base.h"

#include "ITF.h"
#include "incGAM.h"
#include "GLI.h"
#include "DPT.h"

#undef CPA_WANTS_IMPORT
#undef CPA_EXPORT
#define CPA_WANTS_EXPORT
    #include "OGD.h"
#undef CPA_WANTS_EXPORT
#define CPA_WANTS_IMPORT


//////////////////////////////////////////////////////////////////////////////////////////////////////
// Method : Construction/Destruction of Plane3D
// Date   : 97-11
//////////////////////////////////////////////////////////////////////////////////////////////////////
// Description : 
// Author      : Viorel Preoteasa - CPA2
//////////////////////////////////////////////////////////////////////////////////////////////////////
// Modification :
// Date         :
// By           :
//////////////////////////////////////////////////////////////////////////////////////////////////////
Symbolical3D::Symbolical3D (BOOL bModifiable, CPA_EditorBase *_p_oEditor, /*ACP_tdxIndex xNbPoints, ACP_tdxIndex xNbElements,*/ const CString _csName , tdeSaveStatus _eStatus )
	: Shape3D (bModifiable, _p_oEditor, 4, 1, _csName , _eStatus)
{
	CommonSymbolical3D ();
}

Symbolical3D::Symbolical3D (BOOL bModifiable, CPA_EditorBase *_p_oEditor, /*ACP_tdxIndex xNbPoints, ACP_tdxIndex xNbElements,*/ CPA_BaseObject *_p_oOwnerFile, const CString _csName /*= ""*/, char *_p_cRefPath /*= NULL*/, tdeSaveStatus _eStatus /*= E_ss_Responsible*/)
	: Shape3D (bModifiable, _p_oEditor, 4, 1, _p_oOwnerFile, _csName, _p_cRefPath, _eStatus)
{
	CommonSymbolical3D ();
}

Symbolical3D::Symbolical3D (BOOL bModifiable, CPA_EditorBase *_p_oEditor, CPA_BaseObject *_p_oOwnerFile, ACP_tdxHandleOfObject _hObject, const CString _csName /*= ""*/, char *_p_cRefPath /*= NULL*/, tdeSaveStatus _eStatus /*= E_ss_Modify*/)
	: Shape3D (bModifiable, _p_oEditor, _p_oOwnerFile, _hObject, _csName, _p_cRefPath, _eStatus)
{
	CommonSymbolical3D ();
}

Symbolical3D::~Symbolical3D()
{

}

//////////////////////////////////////////////////////////////////////////////////////////////////////
// Method : Symbolical3D
// Date   : 97-11
//////////////////////////////////////////////////////////////////////////////////////////////////////
// Description : Common initialisation
// Author      : Viorel Preoteasa - CPA2
//////////////////////////////////////////////////////////////////////////////////////////////////////
// Modification :
// Date         :
// By           :
//////////////////////////////////////////////////////////////////////////////////////////////////////
void Symbolical3D::CommonSymbolical3D()
{
	MTH3D_tdstVector a4_stPoint [4];
	
	MTH3D_M_vSetVectorElements ( a4_stPoint,	-0.30516f, 0.f, -0.15258f);
	MTH3D_M_vSetVectorElements ( a4_stPoint+1,	0.30516f,  0.f, -0.15258f);
	MTH3D_M_vSetVectorElements ( a4_stPoint+2,	0.f,  0.f, 0.30516f);
	MTH3D_M_vSetVectorElements ( a4_stPoint+3,	0.f, -0.45776f, 0.f);

	fn_vSetListOfPoints(4, a4_stPoint);
	
	m_hElement = fn_hCreateElementIndexedTriangle(4,0);
	fn_eSetIndexedTriangle ( m_hElement, 0, 0, 1, 3 );
	fn_eSetIndexedTriangle ( m_hElement, 1, 1, 2, 3 );
	fn_eSetIndexedTriangle ( m_hElement, 2, 0, 3, 2 );
	fn_eSetIndexedTriangle ( m_hElement, 3, 0, 2, 1 );

	EndCreate();
}
