/*=============================================================================
 *
 *  Filename:           CPATstPt.hpp
 *  Version:            2.0     (VSS5)
 *  Date:               28/07/97
 *  Author:             Marc Trabucato
 *
 *  Description:        description of CPA_TestPoint class
 *
 *===========================================================================*/
 
#ifndef __CPATSTPT_HPP__
#define __CPATSTPT_HPP__
 
/******************************************/
#if _MSC_VER >= 1000
#pragma once
#endif
/******************************************/
 
#ifdef ACTIVE_EDITOR
 
#include "ITF.h"
/*3dos*/
 
class ZDx_Object;
class CPA_TestPointsList;
 
/*=============================================================================
 * class CPA_TestPointNode:
 =============================================================================*/
class CPA_TestPointNode : public CPA_EdElement<CPA_TestPointNode,tdxHandleToTestPointNode,LST2_M_StaticAnchorTo(tdxHandleToTestPointNode)*>
{
  protected:
    ZDx_Object                  *m_p_oZdxObject;
    CPA_TestPointsList          *m_p_oOwnerList;
  public:
    /* to create a new Point or use an existing engine TestPointNode*/
    CPA_TestPointNode( CPA_TestPointsList *_p_oList, tdxHandleToTestPointNode _hTestPointNode = NULL );
    ~CPA_TestPointNode(void);
 
    void SetZdxObject   ( ZDx_Object *_p_oObject )              { m_p_oZdxObject = _p_oObject; }
    void SetOwnerList   ( CPA_TestPointsList *_p_oList )        { m_p_oOwnerList = _p_oList; }
    void SetPosition    ( MTH3D_tdstVector *_p_stVector )       { fn_vSetTestPointNodePosition( GetStruct(), _p_stVector ); }
/* ANNECY AV CLEAN_MEC {*/
/*    void SetKindOfPoint ( DNM_tdeKindOfPoint _eKindOfPoint )    { fn_vSetTestPointNodeIdentifier( GetStruct(), _eKindOfPoint ); }*/
/* END ANNECY AV }*/
 
    ZDx_Object                 *mfn_p_oGetZdxObject ( void )                            { return m_p_oZdxObject; }
    CPA_TestPointsList         *mfn_p_oGetList      ( void )                            { return m_p_oOwnerList; }
    void                        mfn_vGetPosition    ( MTH3D_tdstVector *_p_stVector )   { MTH3D_M_vCopyVector( _p_stVector, fn_p_stGetTestPointNodePosition( GetStruct() ) ); }
/* ANNECY AV CLEAN_MEC {*/
/*    DNM_tdeKindOfPoint          mfn_eGetKindOfPoint ( void )                            { return fn_eGetTestPointNodeIdentifier( GetStruct() ); }*/
/* END ANNECY AV }*/
 
    static void Init();
};
 
/*=============================================================================
 * class CPA_TestPointsList:
 =============================================================================*/
class CPA_TestPointsList : public CPA_SaveObject,
                           public CPA_EdMot<tdxHandleToTestPointsList>
{
public:
    CPA_EdList<CPA_TestPointNode,tdxHandleToTestPointNode,LST2_M_StaticAnchorTo(tdxHandleToTestPointNode)*> m_oListOfTestPoints;
public:
    /* to create a new TestPointsList or to use an existing engine TestPointsList*/
    CPA_TestPointsList(CPA_EditorBase *_p_oDLL, CPA_BaseObject *_p_oOwnerFamily, tdxHandleToTestPointsList _hTestPointsList = NULL,
                       CString _csListName = "");
    ~CPA_TestPointsList(void);
 
    /* overloaded functions*/
    long    GetDataType     ( void )    { return 0; }
    void*   GetData         ( void )    { return (void*)GetStruct(); }
 
    tdeMissingCriteria  fn_eCheckUnicity ( const CString _csNewName )       { return fn_eCheckUnicityWithOwner( _csNewName ); }
 
    /* new functions*/
    static void Init();
    static void fn_vCallBackSave        ( SCR_tdst_File_Description *_p_stFile, char *_p_szSectionName, void *_p_vData, SCR_tde_Ntfy_Action _eAction);
 
    /* access functions*/
/* ANNECY AV CLEAN_MEC {*/
/*    inline CPA_TestPointNode *mfn_p_oGetNodeByKind  ( DNM_tdeKindOfPoint _eKindOfPoint );*/
/*    inline CString            GetKindOfPointName    ( DNM_tdeKindOfPoint _eKindOfPoint );*/
/* END ANNECY AV }*/
protected:
    inline void SetStruct(tdxHandleToTestPointsList _hEngineList);
};
 
/*=============================================================================
 * class CPA_TestPointsList: inline implementation
 =============================================================================*/
inline void CPA_TestPointsList::SetStruct(tdxHandleToTestPointsList _hEngineList)
{
    CPA_EdMot<tdxHandleToTestPointsList>::SetStruct( _hEngineList );
    m_oListOfTestPoints . SetEngineAnchor( GetStruct() ? & GetStruct() -> hForTestPointArray : NULL );
}
 
/* ANNECY AV CLEAN_MEC {*/
/*
inline CPA_TestPointNode *CPA_TestPointsList::mfn_p_oGetNodeByKind( DNM_tdeKindOfPoint _eKindOfPoint )
{
    POSITION xPos = m_oListOfTestPoints . GetHeadPosition();
    while( xPos )
    {
        CPA_TestPointNode *p_oNode = m_oListOfTestPoints . GetNext( xPos );
        if( p_oNode -> mfn_eGetKindOfPoint() == _eKindOfPoint )
            return p_oNode;
    }
    return NULL;
}
 
inline CString CPA_TestPointsList::GetKindOfPointName(DNM_tdeKindOfPoint _eKindOfPoint)
{
    switch (_eKindOfPoint)
    {
        case DNM_Point_Head     : return "Head";
        case DNM_Point_Clavicle : return "Clavicle";
        case DNM_Point_Sternum  : return "Sternum";
        case DNM_Point_Coccyx   : return "Coccyx";
        case DNM_Point_Patella  : return "Patella";
        case DNM_Point_Feet     : return "Feet";
        default                 : ASSERT (0);
                                  return "";
    }
}
*/
/* END ANNECY AV }*/
 
#endif /* ACTIVE_EDITOR*/
#endif /* __CPATSTPT_HPP__*/
