257 lines
8.2 KiB
C++
257 lines
8.2 KiB
C++
/*
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Description : WayObj.hpp
|
|
//
|
|
// Definition of the way editors objects
|
|
//
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// inherit from : CPA_Object
|
|
// CPA_EdMot<ACP_tdxHandleOfLink>
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Creation date: 21 jan 1997 Author: J Thénoz
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Modification date: Author:
|
|
//
|
|
//
|
|
//
|
|
//
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
*/
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
|
|
#ifndef __WayOBJECT_HPP__
|
|
#define __WayOBJECT_HPP__
|
|
|
|
|
|
#define c_Way_Normal 0
|
|
#define c_Way_InsertWP 1
|
|
#define c_Way_Add 2
|
|
|
|
|
|
class DiaWay;
|
|
class WayPoint;
|
|
class Link;
|
|
class Waypoint_Interface;
|
|
class EdtList;
|
|
|
|
typedef enum
|
|
{
|
|
eWayDisplayOn,
|
|
eWayDisplayOff,
|
|
eWayDisplaySelected
|
|
} tdeWayDisplay;
|
|
|
|
class Way : public CPA_SaveObject, public CPA_EdMot<WP_tdhWay>
|
|
{
|
|
protected :
|
|
static DiaWay* ms_poDiaWay; // Dialog
|
|
static WayPoint* m_poVirtualWP; // Virtual WP
|
|
static CPA_List<Way> ms_oListOfWay; // list of all the ways
|
|
static Waypoint_Interface* ms_poInterface; // dll interface
|
|
static tdeWayDisplay ms_eWayDisplay; // display all ways state
|
|
static Way* ms_poCopyWay; // buffer used to copy/paste ways
|
|
|
|
CPA_SuperObject* m_poSuperObject; // super object
|
|
|
|
CPA_List<WayPoint> m_WaypointList; // List of the WP of the way
|
|
CPA_List<Link> m_LinkList; // List of links
|
|
long m_lSelectWP; // Select WP in the dialog
|
|
long m_lMode; // Current mode
|
|
BOOL m_bRecreate; // this way is delete but can be recrete
|
|
BOOL m_bRotationMode; // rotation edition mode
|
|
|
|
//---- Used only in creation and insertion mode
|
|
long m_lWPInsertBefore; // We insert the new WP here
|
|
Link *m_pLinkBefore, *m_pLinkAfter; // Elastic links
|
|
Link *m_pOldLink; // Deleted link for edition
|
|
//----
|
|
|
|
tdeWayDisplay m_eWayDisplay; // display all ways state
|
|
|
|
// style
|
|
char m_cDefaultLink;
|
|
GLI_tdxValue m_xLBeam;
|
|
|
|
public:
|
|
//----- static
|
|
static void fn_vInitObject (Waypoint_Interface* poInterface);
|
|
static void fn_vSetDialog ( DiaWay* poDiaWay );
|
|
static DiaWay* fn_pGetDialog ( void ) { return ms_poDiaWay; }
|
|
static void fn_vSetVirtualWP (WayPoint* poVirtualWP) { m_poVirtualWP = poVirtualWP; }
|
|
static WayPoint* fn_pGetVirtualWP (void) { return m_poVirtualWP; }
|
|
|
|
// display
|
|
static void fn_vRefreshWay (void);
|
|
static void fn_vDisplayWayOfActor ( CPA_BaseObject* poInstance );
|
|
|
|
static void fn_vResetRecreate (void);
|
|
static CPA_List<Way>* fn_poGetListOfWay (void) { return &ms_oListOfWay; }
|
|
static Waypoint_Interface* GetInterface (void) { return ms_poInterface; }
|
|
static BOOL fn_oGetListOfWayUnderParent (CPA_List<Way>* poList, CPA_BaseObject* poParent);
|
|
static void fn_vCallbackSave ( SCR_tdst_File_Description *_p_stFile, char *_p_szSectionName, void *_p_vData,SCR_tde_Ntfy_Action _eAction );
|
|
static void fn_vSetDisplayAllWay (tdeWayDisplay eWayDisplay) { ms_eWayDisplay=eWayDisplay; }
|
|
static tdeWayDisplay fn_eGetDisplayAllWay (void) { return ms_eWayDisplay; }
|
|
static Way* fn_pGetCopyWay (void) { return ms_poCopyWay; }
|
|
static BOOL fn_bCheckWayCoherence ( CPA_List<Way>* poWayList=NULL );
|
|
|
|
Way ( CPA_ObjectDLLBase *p_oDLL, CPA_BaseObject* poFamilly );
|
|
Way( CPA_ObjectDLLBase *p_oDLL, WP_tdhWay hWayEngine, CPA_BaseObject* poOwner, CString csName, CString csReferencedSectionName );
|
|
Way ( Way& rWay );
|
|
~Way (void);
|
|
Way& operator= ( Way& );
|
|
|
|
//--- data
|
|
long GetDataType (void);
|
|
void* GetData (void);
|
|
|
|
// Unicity
|
|
tdeMissingCriteria fn_eCheckUnicity (const CString csNewName) { return fn_eCheckUnicityWithOwner(csNewName); }
|
|
|
|
|
|
// Load
|
|
void fn_vLoadFromEngine (void);
|
|
|
|
// Save
|
|
void fn_vNotifySave (void);
|
|
void fn_vNotifyUnSave (void);
|
|
void fn_vNotifyRestore (void);
|
|
void fn_vNotifyRename (void);
|
|
void fn_vUpdateReference (CPA_SaveObject *pReferencedObject);
|
|
|
|
void fn_vNotifyAllEdtList (void);
|
|
|
|
// Dialog
|
|
inline BOOL fn_bIsDialog (void); // the dialog of this instance is open ?
|
|
|
|
// Set
|
|
void fn_vSetSelectWayPoint (long lPosSelectWP);
|
|
void fn_vSetLBeam (GLI_tdxValue xLBeam ) { m_xLBeam=xLBeam; }
|
|
void fn_vSetSpeed (GLI_tdxValue xSpeed);
|
|
void fn_vSetDefaultLink (char cTypeLink) { m_cDefaultLink=cTypeLink; }
|
|
void fn_vSetRecreate ( BOOL bRecreate ) { m_bRecreate = bRecreate; }
|
|
void fn_vSetDisplayWay (tdeWayDisplay eWayDisplay) { m_eWayDisplay=eWayDisplay; }
|
|
void fn_vSetRotationMode (BOOL bRotationMode);
|
|
void SetSuperObject ( CPA_SuperObject* poSuperObject) { m_poSuperObject=poSuperObject; }
|
|
|
|
// Get
|
|
long fn_lGetSelectWayPoint (void);
|
|
GLI_tdxValue fn_xGetLBeam (void) { return m_xLBeam; }
|
|
GLI_tdxValue fn_xGetSpeed (void);
|
|
long fn_lGetWPName (char (**dszName)[30]); // this function allocate the array
|
|
WayPoint* fn_pGetWayPoint (char* pszNameWP);
|
|
WayPoint* fn_pGetWayPoint (long lIndice);
|
|
Link* fn_pGetLink (long lIndice);
|
|
tdeWayDisplay fn_eGetDisplayWay (void) { return m_eWayDisplay; }
|
|
BOOL fn_bGetRotationMode (void) { return m_bRotationMode; }
|
|
CPA_SuperObject* GetSuperObject (void) { return m_poSuperObject; }
|
|
|
|
WP_tdhLink fn_pGetLinkInfo (long lIndice);
|
|
char fn_cGetDefaultLink (void) { return m_cDefaultLink; }
|
|
|
|
// get lists
|
|
CPA_List<WayPoint>* GetListWaypoint (void) { return &m_WaypointList; }
|
|
CPA_List<Link>* GetListLink (void) { return &m_LinkList; }
|
|
|
|
void *GetEngineStruct (void) { return GetStruct(); };
|
|
|
|
// insert functions
|
|
BOOL fn_vAddWayPoint (WayPoint* poWP);
|
|
BOOL fn_vInsertWayPoint(WayPoint* poWP, BOOL bBlock=FALSE);
|
|
BOOL fn_vInsBeforeWP (WayPoint* poInsWP, long lBeforeWP, BOOL bDialog1stRefresh=TRUE, BOOL bBlock=FALSE);
|
|
void fn_vInsertNewWayPoint (MTH3D_tdstVector* pAbsolutePosition);
|
|
|
|
// remove functions
|
|
void fn_vRemoveWayPoint (WayPoint* poWP);
|
|
void fn_vDeleteWayPoint(void);
|
|
void fn_vSupWP (long lPosDelWP, BOOL bBlock=FALSE);
|
|
|
|
// search
|
|
int fn_iIsWayPointInNet (WayPoint* poSearchWP,WayPoint* poNextSearchWP=NULL);
|
|
int fn_iSearchLinkInWay (Link* poSearchLink);
|
|
|
|
// Change Link
|
|
BOOL fn_bChangeLink ( Link* pOldLink, Link* pNewLink );
|
|
void fn_vChangeAllOrientationTangent (MTH3D_tdstVector* pTangentVertex);
|
|
|
|
// return previous or next links
|
|
Link* fn_pPrevLink (Link* pLink);
|
|
Link* fn_pNextLink (Link* pLink);
|
|
|
|
// select WP in way
|
|
BOOL fn_vClicWayPoint (WayPoint* poWP1, WayPoint* poWP2=NULL);
|
|
|
|
// If the WP poWP has moved, must we redraw the way ?
|
|
// and if so compute the links to redraw
|
|
BOOL fn_bIsRedrawWay (WayPoint* poWP);
|
|
|
|
// DRAW
|
|
// Redraw just the 'elastics'
|
|
void fn_vDrawMouseLine (MTH3D_tdstVector* pxPosMouse);
|
|
// Draw the creation elastic
|
|
void fn_vDrawElastic (MTH3D_tdstVector* pxPosMouse);
|
|
void fn_vRefresh (BOOL bDeleteMark=TRUE, BOOL bDraw=TRUE);
|
|
void fn_vDraw (void);
|
|
|
|
// this way must be on screen ?
|
|
BOOL fn_bIsWayDrawable (void);
|
|
|
|
// Selection
|
|
void fn_vSelectAllWP (void);
|
|
void fn_vUnselectAllWP (void);
|
|
|
|
// Copy/Paste
|
|
BOOL fn_bCanPaste (void) { return ms_poCopyWay!=NULL && IsWayEmpty(); }
|
|
void fn_vCopy (void);
|
|
void fn_vPaste (void);
|
|
|
|
// New Link
|
|
CPA_SuperObject* fn_pCreateLink (char cType);
|
|
|
|
// Change mode
|
|
void fn_vModeNormal (void);
|
|
BOOL fn_vModeAdd (MTH3D_tdstVector* pxPosMouse=NULL);
|
|
void fn_vModeInsert (Link* poLink, MTH3D_tdstVector* pxPosMouse);
|
|
|
|
// Premature end of the creation mode
|
|
void fn_vStopModeAdd (void);
|
|
void fn_vAddAtTheEnd (void);
|
|
|
|
// Is the way ok ?
|
|
// if bCorrec modify the Net to make it ok
|
|
BOOL fn_bIsValid (BOOL bCorrec);
|
|
|
|
// the way share waypoint with poWay ?
|
|
BOOL fn_bConnect ( Way* poWay, CPA_List<WayPoint>* poList );
|
|
|
|
// Is the net empty
|
|
BOOL IsWayEmpty (void) { return m_WaypointList.GetCount()==0; }
|
|
void fn_vEmptyWay (void); // clear the way
|
|
|
|
// Share mode ?
|
|
long fn_lGetShareMode (void);
|
|
BOOL fn_bIsCommon (void);
|
|
|
|
// number of EdtList that use this way
|
|
long fn_lUsedInEdtList (void);
|
|
EdtList* fn_pGetEdtList (void);
|
|
BOOL fn_bWayInEdtList (EdtList* poEdtList);
|
|
CString fn_csGetNameInNameList (void);
|
|
|
|
// Tools
|
|
void fn_vSetWaypointOnScreen (BOOL bOnScreen);
|
|
void fn_vComputeLocation (void);
|
|
|
|
// Dialog edition
|
|
void fn_vDialogAddWp (void);
|
|
void fn_vDialogDeleteWp (void);
|
|
};
|
|
|
|
|
|
#endif //__WayOBJECT_HPP__
|
|
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|