5533 lines
173 KiB
C++
5533 lines
173 KiB
C++
/*
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Description : Inter.cpp
|
|
//
|
|
// Interface DLL class.
|
|
// This class is implement the DLL class.
|
|
//
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// inherit from CPA_ObjectDLLBase
|
|
//
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Creation date: 21 jan 1997 Author: J Thénoz
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Modification date: Author:
|
|
//
|
|
//
|
|
//
|
|
//
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
*/
|
|
|
|
#include "stdafx.h"
|
|
#include "acp_base.h"
|
|
#include "resource.h"
|
|
#include "incitf.h"
|
|
#include "incgam.h"
|
|
#include "incai.h"
|
|
#include "incgli.h"
|
|
#include "dpt.h"
|
|
#include "WpObj.hpp"
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
#include "WayObj.hpp"
|
|
#include "LinkObj.hpp"
|
|
#include "TanObj.hpp"
|
|
#include "Link2D.hpp"
|
|
#include "WayDia.hpp"
|
|
#include "LinkDia.hpp"
|
|
#include "RotDia.hpp"
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
//ROMTEAM Networks (Gabriela Dumitrascu 02/03/98)
|
|
#include "NtwObj.hpp"
|
|
#include "ntwdia.hpp"
|
|
//ENDROMTEAM Networks (Gabriela Dumitrascu)
|
|
#include "CurObj.hpp"
|
|
#include "Inter.hpp"
|
|
#include "WPDia.hpp"
|
|
#include "EditDia.h"
|
|
|
|
#include "ogd.h"
|
|
|
|
#include <direct.h>
|
|
|
|
#include "gam.h"
|
|
#include "x:\cpa\main\inc\_editid.h"
|
|
#include "tut.h"
|
|
|
|
#include "oac.h"
|
|
|
|
// infos
|
|
static CString g_csOWPName = "Waypoint";
|
|
static CString g_csOWPAuthor = "Jacques Thénoz & Chantal Oury";
|
|
static CString g_csOWPVersion = "V 4.0.4 30/03/99";
|
|
static CString g_csOWPFrenchHelpFile = "Waypoint.hlp";
|
|
static CString g_csOWPEnglishHelpFile = "";
|
|
|
|
BOOL g_bTipFirstTime = TRUE;
|
|
BOOL g_bBeforeEditor = FALSE;
|
|
|
|
//----------------------------------------------------------------------
|
|
// popup menu commands
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
#define c_Way_PopUp_DeleteWP 1516
|
|
#define c_Way_PopUp_AddWP 1517
|
|
#define c_Way_PopUp_Link_Hor 1518
|
|
#define c_Way_PopUp_Link_Ver 1519
|
|
#define c_Way_PopUp_Copy 1521
|
|
#define c_Way_PopUp_Paste 1522
|
|
#define c_Way_PopUp_Enter_Rotation_Mode 1523
|
|
#define c_Way_PopUp_Exit_Rotation_Mode 1524
|
|
#define c_Way_PopUp_Orient_All_Tangent 1525
|
|
#define c_Way_PopUp_Reinit_Tangent 1526
|
|
#define c_Way_PopUp_Orient_Tangent 1527
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
#define c_Way_PopUp_Exit 1520
|
|
// CPA2 Gabriela Dumitrascu 98-04-07
|
|
// Shaitan Correction {
|
|
#define c_WayPoint_PopUp_Show_Out_Links 1530
|
|
#define c_WayPoint_PopUp_Show_In_Links 1531
|
|
#define c_WayPoint_PopUp_Show_All_Links 1532
|
|
#define c_WayPoint_PopUp_Show_No_Links 1533
|
|
#define c_WayPoint_PopUp_Define_Next_WP 1540
|
|
#define c_WayPoint_PopUp_Define_Previous_WP 1541
|
|
#define c_WayPoint_PopUp_SetStatic 1542
|
|
//#define c_WayPoint_PopUp_Show_All_WP 1542
|
|
// End Shaitan Correction }
|
|
//End CPA2 Gabriela Dumitrascu 98-04-07
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
//----------------------------------------------------------------------
|
|
// submenu commands
|
|
#define c_Waypoint_Submenu_Activate 1939
|
|
#define c_Waypoint_Submenu_Preference 1945
|
|
//----------------------------------------------------------------------
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
// Definition of lists names
|
|
static CString csHierarchyList = "Hierarchy";
|
|
static CString csCurrentList = "Current model";
|
|
static CString csWPList = "Waypoint";
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
// static CString csListOfWay = "Way";
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
static CString csListOfFamilly = "Familly";
|
|
static CString csListOfActorModel = "Actor model";
|
|
static CString csListOfActorInstance = "Actor instance";
|
|
//----------------------------------------------------------------------
|
|
|
|
|
|
|
|
//---- provisoire
|
|
#define HIE_M_p_stGetSuperObject(_hSprObj) (_hSprObj)
|
|
#define HIE_M_xGetSuperObjectMember(_hSprObj,_member) ((_hSprObj)->_member)
|
|
#define HIE_M_vSetSuperObjectMember(_hSprObj,_member,_value) {(_hSprObj)->_member=(_value);}
|
|
//---- fin provisoire
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
|
// the DLL global definition
|
|
tdstDLLIdentity g_stWayPointIdentity;
|
|
|
|
#define C_szWaypointIniFile "Waypoint\\Waypoint.ini"
|
|
|
|
// Shaitan Correction {
|
|
//-----------Key Codes --------------------------------------
|
|
#define KA_ID_SHOWALL 1
|
|
#define KA_ID_SHOWOUT 2
|
|
#define KA_ID_SHOWIN 3
|
|
#define KA_ID_SHOWNONE 4
|
|
#define KA_ID_ADDORREMOVEWP 10
|
|
#define KA_ID_NEXTWP 11
|
|
#define KA_ID_PREVWP 12
|
|
#define KA_ID_NEXTWPCONTINUE 13
|
|
#define KA_ID_PREVWPCONTINUE 14
|
|
|
|
// keyboard
|
|
static tdstKeyboardActionDef g_OWPKeyboardAction[] =
|
|
{
|
|
// display
|
|
{ "Show All Links", KA_ID_SHOWALL },
|
|
{ "Show Out Links", KA_ID_SHOWOUT },
|
|
{ "Show In Links", KA_ID_SHOWIN },
|
|
{ "Show No Links", KA_ID_SHOWNONE },
|
|
// nodes
|
|
{ "Add or Remove Node", KA_ID_ADDORREMOVEWP },
|
|
// connections
|
|
{ "Select Next WP", KA_ID_NEXTWP },
|
|
{ "Select Prev WP", KA_ID_PREVWP },
|
|
{ "Select Next WP and continue", KA_ID_NEXTWPCONTINUE },
|
|
{ "Select Prev WP and continue", KA_ID_PREVWPCONTINUE },
|
|
// end of list
|
|
{ NULL, 0 }
|
|
};
|
|
//End Shaitan Correction }
|
|
|
|
CString g_csPreviousList;
|
|
|
|
|
|
//--------------------------------------------------------------------------------
|
|
// CONSTRUCTOR.
|
|
// You must put here all your DLL interface definitions.
|
|
//--------------------------------------------------------------------------------
|
|
Waypoint_Interface::Waypoint_Interface(void)
|
|
{
|
|
// ************************** private internal
|
|
m_p_stDLLIdentity = &g_stWayPointIdentity;
|
|
|
|
// Does your DLL can output in main game view ?
|
|
m_stBaseDLLDefinition.bCanOutputIn3DView = TRUE;
|
|
|
|
// Does your DLL can be refresh by engine ?
|
|
m_stBaseDLLDefinition.bCanBeRefreshedByEngine = TRUE;
|
|
|
|
//--- help menu
|
|
SetEditorInfo(g_csOWPName, g_csOWPAuthor, g_csOWPVersion, g_csOWPFrenchHelpFile, g_csOWPEnglishHelpFile);
|
|
|
|
m_bModifRadius=FALSE;
|
|
m_bStopDraw=FALSE;
|
|
m_bDialogOnScreen=FALSE;
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
m_pModifInsertWay=NULL;
|
|
m_pElasticWay=NULL;
|
|
m_poTangentMove=NULL;
|
|
m_poPlaneMove=NULL;
|
|
m_poCursorMove=NULL;
|
|
m_poWay=NULL;
|
|
m_poRButtonDownTangent=NULL;
|
|
m_bRButtonDownTangent=FALSE;
|
|
m_poRButtonDownWay=NULL;
|
|
m_bRButtonDownWay=FALSE;
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
m_bModifDeleteOk=FALSE;
|
|
m_bCreateMode=FALSE;
|
|
m_bModifInsertOk=FALSE;
|
|
m_bRunEngine=FALSE;
|
|
m_poWayList=NULL;
|
|
m_poActor=NULL;
|
|
m_bMainDll=FALSE;
|
|
m_bRefreshWay=FALSE;
|
|
m_bListAlreadyCreated=FALSE;
|
|
m_bCommandLink=FALSE;
|
|
m_bCommandWP=FALSE;
|
|
m_bAddLink=FALSE;
|
|
m_bComputeEngineWaypoint=TRUE;
|
|
m_bNextInstanceInWay=FALSE;
|
|
m_bFirstBeforeEditor=TRUE;
|
|
m_poActor=NULL;
|
|
m_poFamilly=NULL;
|
|
m_poModel=NULL;
|
|
//CPA2 Gabriela Dumitrascu 98-04-07
|
|
// Shaitan Correction {
|
|
// m_bRButtonDownWayPoint=FALSE;
|
|
// m_bGraphMove = FALSE;
|
|
//End Shaitan Correction }
|
|
// End CPA2 Gabriela Dumitrascu 98-04-07
|
|
|
|
m_bOrientTangent=FALSE;
|
|
m_bStopSelect=FALSE;
|
|
m_bFirstActivateEditor=FALSE;
|
|
m_bSkipOnModifDelete=FALSE;
|
|
m_bSkipOnModifInsert=FALSE;
|
|
|
|
// empty the list
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
// m_ListMovingWay.RemoveAll();
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
m_ListMovingWP.RemoveAll();
|
|
|
|
// init the load list
|
|
m_oLoadListOfWay.RemoveAll ();
|
|
|
|
// Shaitan Correction {
|
|
m_pSelectedGraph = NULL;
|
|
m_pDisplayedWayPoint = NULL;
|
|
m_eDisplayMode = E_dm_ShowNothing;
|
|
m_eSelectMode = E_sm_Normal;
|
|
m_bSymetricMode = FALSE;
|
|
|
|
// Keys
|
|
m_p_oKeyboard = new CPA_KeyActionConfiguration("Objects\\Waypoint\\OWPKeys.ini", g_OWPKeyboardAction);
|
|
m_p_oKeyboard->mfn_vSetObjectName("Waypoint Editor");
|
|
|
|
//End Shaitan Correction }
|
|
}
|
|
|
|
|
|
void Waypoint_Interface::fn_vJustAfterRegistered (void)
|
|
{
|
|
//----------------------------------------- declare the type name
|
|
//ROMTEAM Networks (Gabriela Dumitrascu 02/03/98)
|
|
CString apszName[] = { "Waypoint", C_szWayName, "Graph", "Link", "Tangent", "Cursor" };
|
|
fn_vRegisterObjectsType(apszName,6);
|
|
//ENDROMTEAM Networks (Gabriela Dumitrascu)
|
|
|
|
//----- static init of objects
|
|
WayPoint::fn_vInitObject (this);
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
Way::fn_vInitObject (this);
|
|
Link::fn_vInitObject (this);
|
|
Tangent::fn_vInitObject (this);
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
Cursor::fn_vInitObject (this);
|
|
//ROMTEAM Networks (Gabriela Dumitrascu 02/03/98)
|
|
Graph::fn_vInitObject (this);
|
|
//ENDROMTEAM Networks (Gabriela Dumitrascu)
|
|
|
|
}
|
|
|
|
|
|
void Waypoint_Interface::fn_vConstruct(void)
|
|
{
|
|
//------------------------ .ini file
|
|
int iDim;
|
|
char szDimension[256];
|
|
CString csFileName = M_GetMainApp()->m_csEditorDataPath + "Objects\\" + C_szWaypointIniFile;
|
|
|
|
|
|
//-------------------------------------------------------- splitters
|
|
HINSTANCE hOldInst = AfxGetResourceHandle();
|
|
AfxSetResourceHandle( m_p_stDLLIdentity->hModule );
|
|
|
|
m_p_oSplitFrameWP = new CSplitFrame();
|
|
m_p_oSplitFrameWP->CreateBase( "Edition", 1, 2, GetInterface()->GetMainWorld() );
|
|
//ROMTEAM Networks (Gabriela Dumitrascu 02/03/98)
|
|
m_p_oSplitFrameWP->CreateSplitter( C_cVerticalSplitter, 4 /*7*/);
|
|
//ENDROMTEAM Networks (Gabriela Dumitrascu)
|
|
|
|
GetPrivateProfileString ("Preference", "Display Control Dimension", "0", szDimension, 256, (char*)(LPCSTR)csFileName);
|
|
iDim = atoi(szDimension);
|
|
m_p_oSplitFrameWP->CreateView(1, RUNTIME_CLASS(EditDia), "display control", iDim>0 ? iDim :141);
|
|
|
|
GetPrivateProfileString ("Preference", "Waypoint Edit Dimension", "0", szDimension, 256, (char*)(LPCSTR)csFileName);
|
|
iDim = atoi(szDimension);
|
|
m_p_oSplitFrameWP->CreateView(2, RUNTIME_CLASS(DiaWP), "no waypoint to edit", iDim>0 ? iDim : 103);
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/* GetPrivateProfileString ("Preference", "Link Dimension", "0", szDimension, 256, (char*)(LPCSTR)csFileName);
|
|
iDim = atoi(szDimension);
|
|
m_p_oSplitFrameWP->CreateView(3, RUNTIME_CLASS(DiaLink), "no link to edit", iDim>0 ? iDim : 198);
|
|
|
|
GetPrivateProfileString ("Preference", "Orientation Dimension", "0", szDimension, 256, (char*)(LPCSTR)csFileName);
|
|
iDim = atoi(szDimension);
|
|
m_p_oSplitFrameWP->CreateView(4, RUNTIME_CLASS(RotationDia), "Orientation", iDim>0 ? iDim : 11);
|
|
|
|
GetPrivateProfileString ("Preference", "Way Dimension", "0", szDimension, 256, (char*)(LPCSTR)csFileName);
|
|
iDim = atoi(szDimension);
|
|
m_p_oSplitFrameWP->CreateView(5, RUNTIME_CLASS(DiaWay), "no way to edit", iDim>0 ? iDim : 181);
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
//ROMTEAM Networks (Gabriela Dumitrascu 02/03/98)
|
|
GetPrivateProfileString ("Preference", "Network Edit Dimension", "0", szDimension, 256, (char*)(LPCSTR)csFileName);
|
|
iDim = atoi(szDimension);
|
|
m_p_oSplitFrameWP->CreateView(3/*6*/, RUNTIME_CLASS(NtwDia), "Network to edit", iDim>0 ? iDim : 181);
|
|
//ENDROMTEAM Networks (Gabriela Dumitrascu)
|
|
|
|
m_p_oSplitFrameWP->mfn_vEnableCaption (FALSE);
|
|
m_p_oSplitFrameWP->m_stWinTop.cLinkSame=FRM_C_MoveRight;
|
|
|
|
GetPrivateProfileString ("Preference", "Waypoint Left Frame Width", "0", szDimension, 256, (char*)(LPCSTR)csFileName);
|
|
iDim = atoi(szDimension);
|
|
m_p_oSplitFrameWP->m_iInitWidth = iDim>0 ? iDim : 190;
|
|
|
|
AfxSetResourceHandle( hOldInst );
|
|
|
|
// set the pointer dialog of the netwyapoint dialog
|
|
WayPoint::fn_vSetDialog ((DiaWP*) m_p_oSplitFrameWP->m_fn_p_oGetPane(2));
|
|
|
|
/* // set the dialog of the waypoint window
|
|
Way::fn_vSetDialog ((DiaWay*) m_p_oSplitFrameWP->m_fn_p_oGetPane(5));
|
|
|
|
// set the dialog of the link window
|
|
Link::fn_vSetDialog ((DiaLink*) m_p_oSplitFrameWP->m_fn_p_oGetPane(3), (RotationDia*) m_p_oSplitFrameWP->m_fn_p_oGetPane(4));
|
|
*/
|
|
//ROMTEAM Networks (Gabriela Dumitrascu 02/03/98)
|
|
//set the dialog of the graph window
|
|
Graph::fn_vSetDialog ((NtwDia*) m_p_oSplitFrameWP->m_fn_p_oGetPane(3/*6*/));
|
|
//ENDROMTEAM Networks (Gabriela Dumitrascu)
|
|
|
|
// init the edit dialog
|
|
((EditDia*) m_p_oSplitFrameWP->m_fn_p_oGetPane(1))->fn_vSetInterface (this);
|
|
((EditDia*) m_p_oSplitFrameWP->m_fn_p_oGetPane(1))->fn_vInit ();
|
|
|
|
//----------------------------------------------------- Lists
|
|
m_p_oDialogList = new CPA_DialogList ();
|
|
m_p_oDialogList->fn_vInitDialog ( this, m_p_oSplitFrameWP );
|
|
m_p_oDialogList->SetPermanentHeaders (FALSE);
|
|
TUT_M_vGetTutDll();
|
|
TUT_M_vRegisterDialogList (m_p_oDialogList, "OWP_List", "OWP_Tree", "OWP_ListSelect", "OWP_ListFather");
|
|
|
|
|
|
GetPrivateProfileString ("Preference", "DialogList Dimension", "0", szDimension, 256, (char*)(LPCSTR)csFileName);
|
|
iDim = atoi(szDimension);
|
|
m_p_oSplitFrameWP->SetPaneView ( 0, m_p_oDialogList, "Lists", iDim >0 ? iDim : 104 );
|
|
|
|
// reduce orientation pane
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
// m_p_oSplitFrameWP->SetPaneSize (4,0);
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
m_poGeomDll = GetInterface()->GetMainWorld()->GetObjectDLLWithName (C_szDLLGeometryName);
|
|
|
|
// icons for way list
|
|
m_oIconWayList.Create(16, 16, ILC_MASK, 0, 4);
|
|
m_oIconWayList.Add(LoadIcon(GetDLLIdentity()->hModule, MAKEINTRESOURCE(IDI_COMMON_WAY)));
|
|
m_oIconWayList.Add(LoadIcon(GetDLLIdentity()->hModule, MAKEINTRESOURCE(IDI_SPECIFIC_WAY)));
|
|
m_oIconWayList.Add(LoadIcon(GetDLLIdentity()->hModule, MAKEINTRESOURCE(IDI_SHARED_WAY)));
|
|
|
|
}
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
// LISTS
|
|
//--------------------------------------------------------------------
|
|
|
|
// init the lists in the dialog
|
|
void Waypoint_Interface::GetListsForDialog ( CPA_DialogList * pDialog )
|
|
{
|
|
// construct the lists
|
|
pDialog->fn_vAddANewTree ( csHierarchyList, GetInterface()->GetMultiDevice3D()->GetWorld()->GetRoot() );
|
|
pDialog->fn_vAddANewList ( csCurrentList, GetInterface()->GetSortedListByType("All Types"));
|
|
pDialog->fn_vAddANewList ( csWPList, GetInterface()->GetSortedListByType ((char*)(LPCTSTR) csWPList) );
|
|
|
|
pDialog->fn_vAddANewList ( csListOfFamilly, &m_oSortedListOfFamilly );
|
|
|
|
// Begin Silviu Simen List by Sector and type
|
|
CPA_List<CPA_SuperObject>* poList = GetInterface()->GetObjectListByType (C_szSectorTypeName);
|
|
CPA_SuperObject * p_sector;
|
|
POSITION pos;
|
|
|
|
ASSERT (poList);
|
|
for (p_sector = poList -> GetHeadElement(pos); p_sector;
|
|
p_sector = poList -> GetNextElement(pos) ) {
|
|
pDialog->fn_vAddANewList(p_sector -> GetName(),
|
|
M_GetMainWorld()->m_stListObjectsInSectors.GetListOfSectorByType(p_sector,HIE_C_ulEDT_Waypoint) );
|
|
};
|
|
// End Silviu Simen List by Sector and type
|
|
|
|
}
|
|
|
|
|
|
CPA_BaseObject * Waypoint_Interface::GetDialogSelection (CPA_DialogList *pDialog, CString csTypeName, tdeListDrawMode eDrawMode)
|
|
{
|
|
if (csTypeName==csWPList)
|
|
{
|
|
WayPoint *pWP = WayPoint::fn_pGetDialog()->fn_pGetEditWP();
|
|
return (pWP ? pWP->GetSuperObject() : NULL);
|
|
}
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
// else if (csTypeName==csListOfWay) return Way::fn_pGetDialog()->fn_pGetEditWay();
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
else return NULL;
|
|
}
|
|
|
|
|
|
void Waypoint_Interface::fn_vInitDefaultParameters (CPA_DialogList *pDialog)
|
|
{
|
|
pDialog->fn_vInitButtonTest ( "^^^", TRUE, TRUE );
|
|
pDialog->SetPermanentOrder (E_lo_Edited);
|
|
}
|
|
|
|
|
|
BOOL Waypoint_Interface::fn_bOnSelChangeComboList (CPA_DialogList *pDialog, CString csTypeName)
|
|
{
|
|
CString csButtonMessage="";
|
|
BOOL bButtonState = FALSE;
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
if (csTypeName==csListOfWay)
|
|
{
|
|
csButtonMessage=m_poActor->GetName();
|
|
bButtonState=TRUE;
|
|
}
|
|
else
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
if (csTypeName==csListOfActorInstance)
|
|
{
|
|
csButtonMessage=m_poModel->GetName();
|
|
bButtonState=TRUE;
|
|
}
|
|
else if (csTypeName==csListOfActorModel)
|
|
{
|
|
csButtonMessage=m_poFamilly->GetName();
|
|
bButtonState=TRUE;
|
|
}
|
|
|
|
|
|
pDialog->fn_vInitButtonTest ( "^^^ " + csButtonMessage + " ^^^", bButtonState, TRUE );
|
|
|
|
// if the list is changed by the DLL, there's nothing else to do
|
|
if (m_bListAlreadyCreated)
|
|
{
|
|
m_bListAlreadyCreated=FALSE;
|
|
return FALSE;
|
|
}
|
|
|
|
// change in the combo
|
|
if (csTypeName==csListOfFamilly)
|
|
{
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
// pDialog->fn_vDeleteAList ( csListOfWay );
|
|
// m_poWay=NULL;
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
pDialog->fn_vDeleteAList ( csListOfActorInstance );
|
|
m_poActor=NULL;
|
|
m_poWayList=NULL;
|
|
|
|
pDialog->fn_vDeleteAList ( csListOfActorModel );
|
|
m_poModel=NULL;
|
|
|
|
|
|
fn_vEditListOfFamilly ( FALSE );
|
|
pDialog->fn_vReinitDialog ();
|
|
fn_vRefreshDisplayControl ();
|
|
return TRUE;
|
|
}
|
|
|
|
if (csTypeName==csListOfActorModel)
|
|
{
|
|
pDialog->fn_vDeleteAList ( csListOfActorInstance );
|
|
m_poActor=NULL;
|
|
m_poWayList=NULL;
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
pDialog->fn_vDeleteAList ( csListOfWay );
|
|
m_poWay=NULL;
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
fn_vEditListOfActorModel ( m_poModel, FALSE );
|
|
pDialog->fn_vReinitDialog ();
|
|
fn_vRefreshDisplayControl ();
|
|
return TRUE;
|
|
}
|
|
|
|
if (csTypeName==csListOfActorInstance)
|
|
{
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
pDialog->fn_vDeleteAList ( csListOfWay );
|
|
m_poWay=NULL;
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
fn_vEditListOfActorInstance ( m_poActor, FALSE );
|
|
pDialog->fn_vReinitDialog ();
|
|
fn_vRefreshDisplayControl ();
|
|
return TRUE;
|
|
}
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
if (csTypeName==csListOfWay)
|
|
{
|
|
fn_vEditListOfWay ( m_poActor );
|
|
pDialog->fn_vReinitDialog ();
|
|
fn_vRefreshDisplayControl ();
|
|
return TRUE;
|
|
}
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
return FALSE;
|
|
}
|
|
|
|
|
|
// filter the lists
|
|
BOOL Waypoint_Interface::fn_bTestFunction (CString csCurrentType, CString csTestName, CPA_BaseObject *pElem)
|
|
{
|
|
CPA_SuperObject *pEdObj;
|
|
if (csCurrentType==csCurrentList)
|
|
{
|
|
if ( pElem->GetType()==C_szFamilyTypeName
|
|
|| pElem->GetType()==C_szWayNameListType
|
|
) return TRUE;
|
|
|
|
pEdObj = (CPA_SuperObject *) pElem;
|
|
if ((GetInterface()->GetCurrentModel())&&(pEdObj->GetModelName()==GetInterface()->GetCurrentModel()->m_csName))
|
|
return TRUE;
|
|
else
|
|
return FALSE;
|
|
}
|
|
return TRUE;
|
|
}
|
|
|
|
|
|
// we select something in the tree
|
|
BOOL Waypoint_Interface::fn_bOnSelChangeHierarchyTree (CPA_DialogList *pDialog, CString csTypeName, CPA_BaseObject *pSelectedObject, CPA_BaseObject *pSelectedParent)
|
|
{
|
|
return fn_bOnSelChangeListObjects ( pDialog, csTypeName, pSelectedObject, TRUE );
|
|
}
|
|
|
|
|
|
// we select something in the list
|
|
BOOL Waypoint_Interface::fn_bOnSelChangeListObjects (CPA_DialogList *pDialog, CString csTypeName, CPA_BaseObject *pSelectedObject, BOOL bUnselect)
|
|
{
|
|
if (!pSelectedObject) return FALSE;
|
|
|
|
if ( pSelectedObject->GetType()==C_szFamilyTypeName )
|
|
{
|
|
m_poFamilly = pSelectedObject;
|
|
pDialog->fn_vAddANewList ( csListOfActorModel, &m_oSortedListOfActorModel );
|
|
fn_vEditListOfActorModel ( pSelectedObject );
|
|
fn_vRefreshDisplayControl ();
|
|
fn_vRefreshScreen ();
|
|
return FALSE;
|
|
}
|
|
|
|
if ( pSelectedObject->GetType()==C_szActorModelTypeName )
|
|
{
|
|
m_poModel = pSelectedObject;
|
|
pDialog->fn_vAddANewList ( csListOfActorInstance, &m_oSortedListOfActorInstance );
|
|
fn_vEditListOfActorInstance ( pSelectedObject );
|
|
fn_vRefreshDisplayControl ();
|
|
fn_vRefreshScreen ();
|
|
return FALSE;
|
|
}
|
|
|
|
if ( pSelectedObject->GetType()==C_szActorInstanceTypeName )
|
|
{
|
|
m_poActor = pSelectedObject;
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
pDialog->fn_vAddANewList ( csListOfWay, &m_oSortedListOfWay, NULL, &m_oIconWayList,E_lo_Edited, FALSE, C_lDrawState | C_lDrawName | C_lDrawInfo, FALSE );
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
fn_vEditListOfWay ( pSelectedObject );
|
|
fn_vRefreshDisplayControl ();
|
|
fn_vRefreshScreen ();
|
|
return FALSE;
|
|
}
|
|
|
|
// change in the combo
|
|
if (csTypeName==csListOfFamilly)
|
|
{
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
pDialog->fn_vDeleteAList ( csListOfWay );
|
|
m_poWay=NULL;
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
pDialog->fn_vDeleteAList ( csListOfActorModel );
|
|
m_poModel=NULL;
|
|
pDialog->fn_vDeleteAList ( csListOfActorInstance );
|
|
m_poActor=NULL;
|
|
m_poWayList=NULL;
|
|
pDialog->fn_vReinitDialog ();
|
|
fn_vEditListOfFamilly ();
|
|
fn_vRefreshDisplayControl ();
|
|
fn_vRefreshScreen ();
|
|
return FALSE;
|
|
}
|
|
|
|
if (csTypeName==csListOfActorModel)
|
|
{
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
pDialog->fn_vDeleteAList ( csListOfWay );
|
|
m_poWay=NULL;
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
pDialog->fn_vDeleteAList ( csListOfActorInstance );
|
|
m_poActor=NULL;
|
|
m_poWayList=NULL;
|
|
pDialog->fn_vReinitDialog ();
|
|
fn_vRefreshDisplayControl ();
|
|
fn_vRefreshScreen ();
|
|
return FALSE;
|
|
}
|
|
|
|
if (csTypeName==csListOfActorInstance)
|
|
{
|
|
pDialog->fn_vDeleteAList ( csListOfActorInstance );
|
|
m_poActor=NULL;
|
|
m_poWayList=NULL;
|
|
pDialog->fn_vReinitDialog ();
|
|
fn_vRefreshDisplayControl ();
|
|
fn_vRefreshScreen ();
|
|
return FALSE;
|
|
}
|
|
|
|
|
|
CPA_SuperObject* pSuperObject;
|
|
CPA_BaseObject* poBaseObject;
|
|
|
|
if ( pSelectedObject->GetType() != C_szSuperObjectTypeName )
|
|
poBaseObject = pSelectedObject;
|
|
else poBaseObject = ((CPA_SuperObject*)pSelectedObject)->GetObject ();
|
|
|
|
// root
|
|
if (!poBaseObject) return FALSE;
|
|
|
|
switch ( poBaseObject->GetDataType() )
|
|
|
|
{
|
|
case HIE_C_ulEDT_Waypoint : // we select a WP elsewhere in a list
|
|
pSuperObject = ((WayPoint*)poBaseObject)->GetSuperObject();
|
|
GetInterface()->fn_vCancelCurrentSelection (FALSE);
|
|
GetInterface()->fn_vAddSelectedObject (pSuperObject, FALSE);
|
|
WayPoint::fn_pGetDialog()->fn_vEdit ((WayPoint*)pSuperObject->GetObject());
|
|
// Shaitan Correction {
|
|
fn_vSetDisplayedWaypoint((WayPoint*)poBaseObject);
|
|
//End Shaitan Correction }
|
|
return FALSE;
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
case C_ucWay : // we select a way elsewhere in the list
|
|
pSuperObject = ((Way*)poBaseObject)->GetSuperObject();
|
|
GetInterface()->fn_vCancelCurrentSelection (FALSE);
|
|
GetInterface()->fn_vAddSelectedObject (pSuperObject, FALSE);
|
|
m_poWay = (Way*)pSuperObject->GetObject();
|
|
Way::fn_pGetDialog()->fn_vEdit ((Way*)pSuperObject->GetObject());
|
|
GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
|
|
fn_vRefreshDisplayControl ();
|
|
return FALSE;
|
|
case C_ucLink :
|
|
pSuperObject = ((Link*)poBaseObject)->GetSuperObject();
|
|
Link::fn_pGetDialog()->fn_vEdit ((Link*)pSuperObject->GetObject());
|
|
return FALSE;
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
}
|
|
return FALSE;
|
|
}
|
|
|
|
void Waypoint_Interface::fn_vUpdateObjectList (CPA_BaseObject *p_oObject, tdeUpdate eType)
|
|
{
|
|
}
|
|
|
|
|
|
BOOL Waypoint_Interface::fn_bOnDblClkHierarchyTree (CPA_DialogList *pDialog, CString csTypeName, CPA_BaseObject *pSelectedObject, CPA_BaseObject *pSelectedParent)
|
|
{
|
|
return fn_bOnDblClkListObjects (pDialog, csTypeName, pSelectedObject);
|
|
}
|
|
|
|
BOOL Waypoint_Interface::fn_bOnDblClkListObjects (CPA_DialogList *pDialog, CString csTypeName, CPA_BaseObject *pSelectedObject)
|
|
{
|
|
if (!pSelectedObject) return FALSE;
|
|
|
|
if (pSelectedObject->GetType()==C_szWayPointTypeName)
|
|
{
|
|
GetInterface()->fn_bSelectObject (((WayPoint*)pSelectedObject)->GetSuperObject(), TRUE );
|
|
// Shaitan Correction {
|
|
fn_vSetDisplayedWaypoint((WayPoint*)pSelectedObject);
|
|
//End Shaitan Correction }
|
|
return TRUE;
|
|
}
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
if (pSelectedObject->GetType()==C_szWayTypeName)
|
|
{
|
|
// center on the first waypoint
|
|
if (!((Way*)pSelectedObject)->IsWayEmpty())
|
|
{
|
|
WayPoint* poWaypoint = ((Way*)pSelectedObject)->fn_pGetWayPoint(0L);
|
|
GetInterface()->fn_bSelectObject ( poWaypoint->GetSuperObject(), TRUE );
|
|
|
|
|
|
// select the way
|
|
GetInterface()->fn_bSelectObject ( (CPA_SuperObject*)(poWaypoint->GetSuperObject()),FALSE );
|
|
}
|
|
return TRUE;
|
|
}
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
if (pSelectedObject->GetType()!=C_szSuperObjectTypeName)
|
|
return FALSE;
|
|
// Shaitan Correction {
|
|
else
|
|
{
|
|
CPA_SuperObject * pSupObj = (CPA_SuperObject*)pSelectedObject;
|
|
|
|
switch (pSupObj->GetObjectType())
|
|
{
|
|
case HIE_C_ulEDT_Waypoint :
|
|
GetInterface()->fn_bSelectObject (pSupObj, TRUE );
|
|
fn_vSetDisplayedWaypoint((WayPoint*)pSupObj->GetObject());
|
|
return TRUE;
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
case C_ucWay :
|
|
{
|
|
// center on the first waypoint
|
|
if (!((Way*)(((CPA_SuperObject*)pSelectedObject)->GetObject()))->IsWayEmpty())
|
|
{
|
|
WayPoint* poWaypoint = ((Way*)(((CPA_SuperObject*)pSelectedObject)->GetObject()))->fn_pGetWayPoint(0L);
|
|
GetInterface()->fn_bSelectObject ( poWaypoint->GetSuperObject(), TRUE );
|
|
|
|
|
|
// select the way
|
|
GetInterface()->fn_bSelectObject ( (CPA_SuperObject*)(poWaypoint->GetSuperObject()),FALSE );
|
|
}
|
|
return TRUE;
|
|
}
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
}
|
|
return TRUE;
|
|
}
|
|
//End Shaitan Correction }
|
|
}
|
|
|
|
BOOL Waypoint_Interface::fn_bOnButtonTest (CPA_DialogList *pDialog, CString csTypeName, tdeListDrawMode eDraw)
|
|
{
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
if (csTypeName==csListOfWay)
|
|
{
|
|
fn_vEditListOfActorInstance ( m_poActor->GetOwner() );
|
|
pDialog->fn_vDeleteAList ( csListOfWay );
|
|
m_poWay=NULL;
|
|
pDialog->fn_vReinitDialog();
|
|
fn_vRefreshDisplayControl ();
|
|
fn_vRefreshScreen ();
|
|
}
|
|
|
|
else
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
if (csTypeName==csListOfActorInstance)
|
|
{
|
|
CPA_BaseObject* pParent = fn_pGetOwnerOfList (csListOfActorInstance);
|
|
fn_vEditListOfActorModel ( pParent );
|
|
pDialog->fn_vDeleteAList ( csListOfActorInstance );
|
|
m_poActor=NULL;
|
|
m_poWayList=NULL;
|
|
pDialog->fn_vReinitDialog();
|
|
fn_vRefreshDisplayControl ();
|
|
fn_vRefreshScreen ();
|
|
}
|
|
|
|
else if (csTypeName==csListOfActorModel)
|
|
{
|
|
fn_vEditListOfFamilly ();
|
|
pDialog->fn_vDeleteAList ( csListOfActorModel );
|
|
m_poModel=NULL;
|
|
pDialog->fn_vReinitDialog();
|
|
fn_vRefreshDisplayControl ();
|
|
fn_vRefreshScreen ();
|
|
}
|
|
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
|
|
|
|
|
|
BOOL Waypoint_Interface::fn_bOnKeyDownInDialog (CPA_DialogList *pDialog, CString csTypeName, tdeListDrawMode eDraw, CPA_BaseObject *pSelectedObject, UINT nChar, UINT nRepCnt, UINT nFlags)
|
|
{
|
|
if (nChar==VK_DELETE)
|
|
{
|
|
if (pSelectedObject)
|
|
{
|
|
// only waypoint & way
|
|
if ( pSelectedObject->GetType()==C_szWayPointTypeName )
|
|
{
|
|
GetInterface()->fn_bDeleteObjectInHierarchy ( ((WayPoint*)pSelectedObject)->GetSuperObject() );
|
|
return TRUE;
|
|
}
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
if ( pSelectedObject->GetType()==C_szWayTypeName )
|
|
{
|
|
GetInterface()->fn_bDeleteObjectInHierarchy ( ((Way*)pSelectedObject)->GetSuperObject() );
|
|
return TRUE;
|
|
}
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
}
|
|
}
|
|
return FALSE;
|
|
}
|
|
|
|
|
|
ACP_tdxHandleOfObject Waypoint_Interface::fn_hGetBoundingVolume(CPA_BaseObject *_pObj)
|
|
{
|
|
if (_pObj->GetType()==C_szWayPointTypeName)
|
|
{
|
|
CPA_ObjectDLLBase * pGeomDll = GetInterface()->GetMainWorld()->GetObjectDLLWithName (C_szDLLGeometryName);
|
|
CPA_SuperObject* poGeomSuperObject = (CPA_SuperObject*) ((WayPoint*)_pObj)->GetSuperObject()->GetHeadElement();
|
|
return pGeomDll->fn_hGetBoundingVolume (poGeomSuperObject->GetObject());
|
|
}
|
|
else return NULL;
|
|
}
|
|
|
|
|
|
CString Waypoint_Interface::GetInfoForListItem (CPA_DialogList *pDialog, CString csListName, CPA_BaseObject *pObject)
|
|
{
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
if (csListName==csListOfWay )
|
|
{
|
|
Way* poWay = (Way*)pObject;
|
|
return poWay->fn_csGetNameInNameList();
|
|
}
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
return CPA_ObjectDLLBase::GetInfoForListItem (pDialog, csListName, pObject);
|
|
}
|
|
|
|
int Waypoint_Interface::GetStateForListItem (CPA_DialogList *pDialog, CString csListName, CPA_BaseObject *pObject)
|
|
{
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
if (csListName==csListOfWay )
|
|
{
|
|
Way* poWay = (Way*)pObject;
|
|
switch (poWay->fn_lGetShareMode())
|
|
{
|
|
case E_sm_Common : return 0;
|
|
case E_sm_Shared : return 2;
|
|
case E_sm_Virge : return 1;
|
|
}
|
|
}
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
return CPA_ObjectDLLBase::GetStateForListItem (pDialog, csListName, pObject);
|
|
}
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
// CURRENT DLL
|
|
//----------------------------------------------------------------------
|
|
tdePermission Waypoint_Interface::fn_eAcceptNewEditor (CPA_EditorBase *pNewDll)
|
|
{
|
|
if ( pNewDll->fn_bIsCurrentEditor () ) return C_Allow;
|
|
else
|
|
{
|
|
// Dialog will be delete by the hierarchy editor, so we unset the flag before
|
|
m_bDialogOnScreen = FALSE;
|
|
return C_CloseBefore;
|
|
}
|
|
}
|
|
|
|
|
|
void Waypoint_Interface::fn_vOnActivateEditor (CPA_List<CPA_BaseObject> *pParams, BOOL bBackActivated)
|
|
{
|
|
// Shaitan Correction {
|
|
Graph *pGraph = m_pSelectedGraph;
|
|
//End Shaitan Correction }
|
|
|
|
if (!m_bDialogOnScreen)
|
|
{ // Set the Dialog on the screen
|
|
// call the init lists functions
|
|
|
|
if (m_bFirstActivateEditor)
|
|
{
|
|
m_p_oDialogList->fn_vInitAllLists ();
|
|
m_p_oDialogList->fn_vReinitDialog ();
|
|
m_p_oDialogList->SetCurrentType ( csHierarchyList );
|
|
m_p_oDialogList->SetDefaultButtonState ( FALSE );
|
|
m_bFirstActivateEditor=FALSE;
|
|
}
|
|
|
|
//----- Way
|
|
EDT_Model* pNewModelWay = new EDT_Model ( this, "Way", "Way", "objects\\waypoint\\way.bmp", GetInterface() );
|
|
GetInterface()-> fn_bAddANewModel (pNewModelWay, "Way", this);
|
|
|
|
|
|
// activate the frames of the editor
|
|
HWND WindowWithFocus = GetFocus ();
|
|
g_oFrameGest.mfn_vSetRefresh(FALSE);
|
|
g_oFrameGest.mfn_vActivateWindow (m_p_oSplitFrameWP);
|
|
g_oFrameGest.mfn_vActivateWindow ( GetInterface()->GetModelFrame() );
|
|
SetFocus (WindowWithFocus);
|
|
g_oFrameGest.mfn_vSetRefresh(TRUE);
|
|
|
|
// set the enter editor ( WP or way )
|
|
m_bDialogOnScreen=TRUE;
|
|
|
|
//ANNECY Shaitan Nettoyage (18/05/98) {
|
|
// fn_vCreateVirtualWaypoint ();
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
}
|
|
|
|
g_csPreviousList = GetInterface()->GetDialogInsert()->fn_csGetCurrentListModel();
|
|
GetInterface()->GetDialogInsert()->fn_vSetCurrentListModel("Waypoint");
|
|
|
|
// edit pParam
|
|
if (pParams)
|
|
{
|
|
CPA_BaseObject* p_oEditSuperWP = fn_pSelectWayPointParam ( pParams );
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
CPA_BaseObject* p_oEditSuperWay = fn_pSelectWayParam ( pParams );
|
|
CPA_BaseObject* p_oEditSuperLink = fn_pSelectLinkParam ( pParams );
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
if (p_oEditSuperWP)
|
|
{
|
|
WayPoint::fn_pGetDialog()->fn_vEdit ( (WayPoint*) ((CPA_SuperObject*)p_oEditSuperWP)->GetObject() );
|
|
}
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
if (p_oEditSuperWay)
|
|
{
|
|
fn_vEdit ( (Way*) ((CPA_SuperObject*)p_oEditSuperWay)->GetObject() );
|
|
}
|
|
if (p_oEditSuperLink)
|
|
{
|
|
((Link*) ((CPA_SuperObject*)p_oEditSuperLink)->GetObject())->fn_vEdit();
|
|
Link::fn_pGetDialog()->fn_vEdit ( (Link*) ((CPA_SuperObject*)p_oEditSuperLink)->GetObject() );
|
|
}
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
}
|
|
|
|
fn_vRefreshScreen ();
|
|
fn_vRefreshList ();
|
|
fn_vRefreshTestButton ();
|
|
// Shaitan Correction {
|
|
if (pGraph)
|
|
{
|
|
m_pSelectedGraph = NULL;
|
|
fn_vSelectGraph(pGraph);
|
|
}
|
|
//End Shaitan Correction }
|
|
|
|
// display Tip of the Day
|
|
GetInterface()->fn_vDisplayTipOfDay("Waypoints & Graphs", "OWP", g_bTipFirstTime);
|
|
g_bTipFirstTime = FALSE;
|
|
}
|
|
|
|
void Waypoint_Interface::fn_vOnCloseEditor (void)
|
|
{
|
|
// delete way model
|
|
GetInterface()->fn_bRemoveAModel ("Way", "Way");
|
|
|
|
// Shaitan Correction {
|
|
if (m_pSelectedGraph)
|
|
{
|
|
m_pSelectedGraph->fn_vDisplayAllLinks(FALSE, TRUE);
|
|
m_pSelectedGraph->fn_vShowWaypoints(FALSE);
|
|
}
|
|
//End Shaitan Correction }
|
|
|
|
// clean hierarchy
|
|
// fn_vCleanHierarchy();
|
|
|
|
GetInterface()->GetDialogInsert()->fn_vSetCurrentListModel(g_csPreviousList);
|
|
|
|
// desactivate the frames
|
|
g_oFrameGest.mfn_vSetRefresh(FALSE);
|
|
g_oFrameGest.mfn_vDisactivateWindow (m_p_oSplitFrameWP);
|
|
g_oFrameGest.mfn_vSetRefresh(TRUE);
|
|
m_bDialogOnScreen=FALSE;
|
|
|
|
fn_vDeleteVirtualWaypoint ();
|
|
}
|
|
|
|
BOOL Waypoint_Interface::fn_bAcceptToExit (void)
|
|
{
|
|
return TRUE;
|
|
}
|
|
|
|
|
|
|
|
BOOL Waypoint_Interface::fn_bCanActivateEditor (CPA_List<CPA_BaseObject> *pParams)
|
|
{
|
|
return TRUE;
|
|
}
|
|
|
|
void Waypoint_Interface::fn_vBeforeEngine (void)
|
|
{
|
|
m_bStopDraw=TRUE;
|
|
|
|
fn_vCleanHierarchy();
|
|
|
|
if (!fn_bIsCurrentEditor()) return;
|
|
g_oFrameGest.mfn_vDisactivateWindow (m_p_oSplitFrameWP);
|
|
m_bDialogOnScreen=FALSE;
|
|
}
|
|
|
|
|
|
void Waypoint_Interface::fn_vBeforeEditor (void)
|
|
{
|
|
g_bBeforeEditor = TRUE;
|
|
// Shaitan Correction {
|
|
Graph *pGraph = m_pSelectedGraph;
|
|
//End Shaitan Correction }
|
|
|
|
m_bStopDraw=FALSE;
|
|
|
|
// Restore Hierarchy links
|
|
fn_vRefreshScreen();
|
|
|
|
|
|
if (m_bFirstBeforeEditor)
|
|
{
|
|
/*
|
|
// update help file
|
|
if ((GetInterface()->fn_csGetCurrentLanguage() != "Français") && (GetInterface()->fn_csGetCurrentLanguage() != "French"))
|
|
GetEditorInfo()->csHelpFile = "Objects\\waypoint\\network_gr.hlp";
|
|
*/
|
|
// load waypoint and ways
|
|
fn_vLoadWaypoint ();
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
// fn_vLoadWay ();
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
//ROMTEAM Networks (Gabriela Dumitrascu 02/03/98)
|
|
fn_vLoadGraph();
|
|
//ENDROMTEAM Networks (Gabriela Dumitrascu)
|
|
|
|
// refresh the list
|
|
fn_vRefreshList ();
|
|
|
|
// draw the new objects
|
|
fn_vRefreshScreen ();
|
|
|
|
m_bFirstBeforeEditor=FALSE;
|
|
|
|
// init combo
|
|
m_p_oDialogList->fn_vInitAllLists ();
|
|
m_p_oDialogList->fn_vReinitDialog ();
|
|
m_p_oDialogList->SetCurrentType ( csHierarchyList );
|
|
m_p_oDialogList->SetDefaultButtonState ( FALSE );
|
|
}
|
|
|
|
if (!fn_bIsCurrentEditor()) return;
|
|
|
|
// activate the frames of the editor
|
|
HWND WindowWithFocus = GetFocus ();
|
|
g_oFrameGest.mfn_vSetRefresh(FALSE);
|
|
g_oFrameGest.mfn_vActivateWindow (m_p_oSplitFrameWP);
|
|
g_oFrameGest.mfn_vActivateWindow ( GetInterface()->GetModelFrame() );
|
|
SetFocus (WindowWithFocus);
|
|
g_oFrameGest.mfn_vSetRefresh(TRUE);
|
|
m_bDialogOnScreen=TRUE;
|
|
m_bRunEngine=FALSE;
|
|
|
|
GetInterface()->GetDialogInsert()->fn_vSetCurrentListModel("Waypoint");
|
|
// Shaitan Correction {
|
|
if (pGraph)
|
|
{
|
|
m_pSelectedGraph = NULL;
|
|
fn_vSelectGraph(pGraph);
|
|
}
|
|
//End Shaitan Correction }
|
|
g_bBeforeEditor = FALSE;
|
|
GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
|
|
|
|
}
|
|
|
|
|
|
void Waypoint_Interface::fn_vAddObjectsToDraw (GLD_tdstViewportAttributes *pViewportAttributes, GLI_tdxHandleToLight p2, DEV_ViewPort* p3)
|
|
{
|
|
if (m_bStopDraw) return;
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
POSITION xPos;
|
|
CPA_SuperObject* poSuperObject;
|
|
CPA_List<CPA_SuperObject> * p_oList = GetInterface()->GetObjectListByType("Link");
|
|
|
|
for (poSuperObject=p_oList->GetHeadElement(xPos); poSuperObject; poSuperObject=p_oList->GetNextElement(xPos))
|
|
{
|
|
Link* poLink = (Link*)(poSuperObject->GetObject());
|
|
if (poLink->fn_bCanDrawOutHierarchy())
|
|
poLink->fn_vDrawOutHierarchy (pViewportAttributes);
|
|
}
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
}
|
|
|
|
|
|
void Waypoint_Interface::fn_vLevelHasChanged (void)
|
|
{
|
|
fn_bExistWaypointSaveFile ();
|
|
fn_bExistWaySaveFile ();
|
|
}
|
|
|
|
|
|
void Waypoint_Interface::fn_vAfterSaveAll (void)
|
|
{
|
|
fn_bExistWaypointSaveFile ();
|
|
fn_bExistWaySaveFile ();
|
|
WayPoint::fn_vSetNotifyHeader (FALSE);
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
// Way::fn_vResetRecreate ();
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
//ROMTEAM Networks (Gabriela Dumitrascu 02/03/98)
|
|
Graph::fn_vSetNotifyHeader (FALSE);
|
|
//ENDROMTEAM Networks (Gabriela Dumitrascu)
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
// COMMAND
|
|
//----------------------------------------------------------------------
|
|
void Waypoint_Interface::fn_vRefreshWaypointCoordinate (void)
|
|
{
|
|
WayPoint::fn_pGetDialog()->fn_vRefreshCoordinate();
|
|
}
|
|
|
|
void Waypoint_Interface::fn_vRefreshList (void)
|
|
{
|
|
m_p_oDialogList->fn_vReinitDialog ();
|
|
}
|
|
|
|
void Waypoint_Interface::fn_vRefreshTestButton (void)
|
|
{
|
|
CString csTypeName = m_p_oDialogList->GetCurrentType();
|
|
CString csButtonMessage="";
|
|
BOOL bButtonState = FALSE;
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
if (csTypeName==csListOfWay)
|
|
{
|
|
csButtonMessage=m_poActor->GetName();
|
|
bButtonState=TRUE;
|
|
}
|
|
else
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
if (csTypeName==csListOfActorInstance)
|
|
{
|
|
csButtonMessage=m_poModel->GetName();
|
|
bButtonState=TRUE;
|
|
}
|
|
else if (csTypeName==csListOfActorModel)
|
|
{
|
|
csButtonMessage=m_poFamilly->GetName();
|
|
bButtonState=TRUE;
|
|
}
|
|
m_p_oDialogList->fn_vInitButtonTest ( "^^^ " + csButtonMessage + " ^^^", bButtonState, TRUE );
|
|
}
|
|
|
|
//----------------------------------------------------------------------
|
|
// Mouse events
|
|
//----------------------------------------------------------------------
|
|
BOOL Waypoint_Interface::_OnLButtonDown (UINT i, tdstMousePos *pMouse, ACP_tdxIndex xIndex, HIE_tdstPickInfo *pInfo)
|
|
{
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
// we are in create mode
|
|
if (m_bCreateMode)
|
|
{
|
|
m_stMouseVertex2DCreate = pMouse->stPos2D;
|
|
|
|
// Invalid click
|
|
if (!pInfo) return FALSE;
|
|
|
|
m_stMouseVertex3DCreate = (pInfo)->stPickedObject.aDEF_stDataOfElement[0].stHit;
|
|
|
|
CPA_SuperObject* psoWayPoint=NULL;
|
|
if (pInfo) // yes there's something under the mouse
|
|
psoWayPoint=fn_pExplorePicking (xIndex, pInfo, HIE_C_ulEDT_Waypoint);
|
|
if (psoWayPoint)
|
|
{
|
|
if (! m_pElasticWay->fn_vAddWayPoint ( (WayPoint*)(psoWayPoint->GetObject())) ) return TRUE;
|
|
}
|
|
else m_pElasticWay->fn_vInsertNewWayPoint ( &((pInfo)->stPickedObject.aDEF_stDataOfElement[0].stHit) );
|
|
m_pElasticWay->fn_vModeNormal ();
|
|
m_pElasticWay->fn_vModeAdd ();
|
|
return TRUE; // stop the event
|
|
}
|
|
|
|
if (m_bOrientTangent)
|
|
{
|
|
MTH3D_tdstVector v = (pInfo)->stPickedObject.aDEF_stDataOfElement[0].stHit;
|
|
m_poRButtonDownTangent->fn_vSetTangent ( &v );
|
|
GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
|
|
m_bOrientTangent = FALSE;
|
|
return TRUE;
|
|
}
|
|
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
if (i==(MK_CONTROL|MK_LBUTTON))
|
|
{
|
|
CPA_SuperObject* psoWayPoint;
|
|
psoWayPoint=fn_pExplorePicking (xIndex, pInfo, HIE_C_ulEDT_Waypoint);
|
|
|
|
if (psoWayPoint)
|
|
{
|
|
m_o_ModifRadiusWP = (WayPoint*)psoWayPoint->GetObject();
|
|
if (m_o_ModifRadiusWP->fn_bIsGeneralRealDraw()) // the WP is not represent by a spherical object, so there's nothing to do
|
|
{
|
|
fn_vSetCursor (IDC_RADIUS_MOVE);
|
|
|
|
// WP vertex
|
|
GEO_tdxHandleToMatrix hAbsoluteMatrix = HIE_fn_hGetSuperObjectGlobalMatrix (m_o_ModifRadiusWP->GetSuperObject()->GetStruct());
|
|
POS_fn_vGetTranslationVector
|
|
(
|
|
hAbsoluteMatrix,
|
|
&m_stdCenterWP
|
|
);
|
|
// mouse vertex
|
|
m_stdMouseVertex = pInfo->stPickedObject.aDEF_stDataOfElement[0].stHit;
|
|
|
|
// bidouille
|
|
m_stdMouseVertex.xY = m_stdCenterWP.xY;
|
|
|
|
m_bModifRadius=TRUE;
|
|
return TRUE;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
CPA_SuperObject* psoObject;
|
|
|
|
psoObject=fn_pExplorePicking (xIndex, pInfo, HIE_C_ulEDT_Waypoint);
|
|
|
|
if (psoObject)
|
|
{
|
|
// CPA2 Gabriela Dumitrascu 98-04-07
|
|
CPA_SuperObject* psoConnection = fn_pExplorePicking (xIndex, pInfo, HIE_C_ulEDT_Geometric);
|
|
// Shaitan Correction {
|
|
if (psoConnection && psoConnection->GetObject()->GetName() == "Connection")
|
|
{
|
|
Connection *pConnection = (Connection*) psoConnection->GetObject();
|
|
Graph::fn_pGetDialog()->fn_vSelectConnection(pConnection->GetGraph(), pConnection->GetSrcWayPoint(), pConnection->GetDstWayPoint());
|
|
}
|
|
// Graph::fn_pGetDialog()->fn_bSetCrtConnection((Connection*)psoConnection->GetObject());
|
|
else if (m_pSelectedGraph)
|
|
{
|
|
WayPoint *pWP = (WayPoint*) psoObject->GetObject();
|
|
|
|
// normal => select WP
|
|
if (m_eSelectMode == E_sm_Normal)
|
|
{
|
|
fn_vSetDisplayedWaypoint(pWP);
|
|
return FALSE;
|
|
}
|
|
// next WP => add connection
|
|
else if (m_eSelectMode == E_sm_NextWP_Popup)
|
|
{
|
|
if (m_pSelectedGraph->fn_bHasNode(pWP))
|
|
{
|
|
m_pSelectedGraph->fn_vAddArcToNode(m_pDisplayedWayPoint, pWP, !m_bSymetricMode, FALSE);
|
|
if (m_bSymetricMode)
|
|
m_pSelectedGraph->fn_vAddArcToNode(pWP, m_pDisplayedWayPoint, TRUE, TRUE);
|
|
}
|
|
m_eSelectMode = E_sm_Normal;
|
|
}
|
|
// previous WP => add connection
|
|
else if (m_eSelectMode == E_sm_PrevWP_Popup)
|
|
{
|
|
if (m_pSelectedGraph->fn_bHasNode(pWP))
|
|
{
|
|
m_pSelectedGraph->fn_vAddArcToNode(pWP, m_pDisplayedWayPoint, !m_bSymetricMode, FALSE);
|
|
if (m_bSymetricMode)
|
|
m_pSelectedGraph->fn_vAddArcToNode(m_pDisplayedWayPoint, pWP, TRUE, TRUE);
|
|
}
|
|
m_eSelectMode = E_sm_Normal;
|
|
}
|
|
else if (m_eSelectMode == E_sm_NextWP_Key)
|
|
{
|
|
if (m_pSelectedGraph->fn_bHasNode(pWP))
|
|
{
|
|
m_pSelectedGraph->fn_vAddArcToNode(m_pDisplayedWayPoint, pWP, !m_bSymetricMode, FALSE);
|
|
if (m_bSymetricMode)
|
|
m_pSelectedGraph->fn_vAddArcToNode(pWP, m_pDisplayedWayPoint, TRUE, TRUE);
|
|
}
|
|
}
|
|
// previous WP => add connection
|
|
else if (m_eSelectMode == E_sm_PrevWP_Key)
|
|
{
|
|
if (m_pSelectedGraph->fn_bHasNode(pWP))
|
|
{
|
|
m_pSelectedGraph->fn_vAddArcToNode(pWP, m_pDisplayedWayPoint, !m_bSymetricMode, FALSE);
|
|
if (m_bSymetricMode)
|
|
m_pSelectedGraph->fn_vAddArcToNode(m_pDisplayedWayPoint, pWP, TRUE, TRUE);
|
|
}
|
|
}
|
|
else if (m_eSelectMode == E_sm_NextWP_Continue)
|
|
{
|
|
if (m_pSelectedGraph->fn_bHasNode(pWP))
|
|
{
|
|
m_pSelectedGraph->fn_vAddArcToNode(m_pDisplayedWayPoint, pWP, !m_bSymetricMode, FALSE);
|
|
if (m_bSymetricMode)
|
|
m_pSelectedGraph->fn_vAddArcToNode(pWP, m_pDisplayedWayPoint, TRUE, TRUE);
|
|
}
|
|
fn_vSetDisplayedWaypoint(pWP);
|
|
}
|
|
// previous WP => add connection
|
|
else if (m_eSelectMode == E_sm_PrevWP_Continue)
|
|
{
|
|
if (m_pSelectedGraph->fn_bHasNode(pWP))
|
|
{
|
|
m_pSelectedGraph->fn_vAddArcToNode(pWP, m_pDisplayedWayPoint, !m_bSymetricMode, FALSE);
|
|
if (m_bSymetricMode)
|
|
m_pSelectedGraph->fn_vAddArcToNode(m_pDisplayedWayPoint, pWP, TRUE, TRUE);
|
|
}
|
|
fn_vSetDisplayedWaypoint(pWP);
|
|
}
|
|
else if (m_eSelectMode == E_sm_AddOrRemoveWP)
|
|
{
|
|
if (pWP->fn_bIsAlone() && !m_pSelectedGraph->fn_bHasNode(pWP))
|
|
m_pSelectedGraph->fn_vAddNode(pWP, FALSE);
|
|
else
|
|
m_pSelectedGraph->fn_bRemoveNode(pWP, FALSE);
|
|
}
|
|
return TRUE;
|
|
// m_bGraphMove = Graph::fn_pGetDialog()->fn_bSetCrtWaypoint((WayPoint*) psoObject->GetObject());
|
|
}
|
|
// End CPA2 Gabriela Dumitrascu 98-04-07
|
|
|
|
//CPA2 Gabriela Dumitrascu 98-05-04
|
|
// if(i==(MK_SHIFT|MK_LBUTTON))
|
|
// {
|
|
// Graph::fn_pGetDialog()->fn_bAddOrDeleteWaypoint((WayPoint*)(psoObject->GetObject()));
|
|
// }
|
|
//End CPA2 Gabriela Dumitrascu 98-05-04
|
|
//End Shaitan Correction }
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
if (i==(MK_CONTROL|MK_LBUTTON))
|
|
{
|
|
if (!Way::fn_pGetDialog()->fn_pGetEditWay ()) return FALSE;
|
|
|
|
m_poAddWP = (WayPoint*)(psoObject->GetObject());
|
|
fn_vAddWayPoint ();
|
|
|
|
m_pElasticWay = Way::fn_pGetDialog()->fn_pGetEditWay ();
|
|
// add a WP if we CTRL+Clic the first time on this net
|
|
if (!m_pElasticWay->GetListWaypoint()->GetCount())
|
|
m_pElasticWay->fn_vInsertNewWayPoint ( &((pInfo)->stPickedObject.aDEF_stDataOfElement[0].stHit) );
|
|
|
|
MTH3D_tdstVector v = (pInfo)->stPickedObject.aDEF_stDataOfElement[0].stHit;
|
|
m_pElasticWay->fn_vModeAdd (&v);
|
|
return TRUE;
|
|
}
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
else
|
|
{
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
if (Way::fn_pGetDialog()->fn_pGetEditWay())
|
|
{
|
|
if (!Way::fn_pGetDialog()->fn_pGetEditWay()->fn_vClicWayPoint((WayPoint*)(psoObject->GetObject()))) fn_vEdit ((WayPoint*)(psoObject->GetObject()));
|
|
}
|
|
else
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
fn_vEdit ((WayPoint*)(psoObject->GetObject()));
|
|
return FALSE;
|
|
}
|
|
|
|
|
|
}
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
psoObject=fn_pExplorePicking (xIndex, pInfo, C_ucTangent);
|
|
|
|
if (psoObject)
|
|
{
|
|
fn_vSetCursor (IDC_POINTER_TANGENT);
|
|
m_bStopSelect=TRUE;
|
|
m_poTangentMove = (Tangent*)(psoObject->GetObject());
|
|
MTH3D_tdstVector v = (pInfo)->stPickedObject.aDEF_stDataOfElement[0].stHit;
|
|
m_poTangentMove->fn_vStartMove ( &v, i==(MK_SHIFT|MK_LBUTTON), i==(MK_CONTROL|MK_LBUTTON) );
|
|
return TRUE;
|
|
}
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
psoObject=fn_pExplorePicking (xIndex, pInfo, HIE_C_ulActor);
|
|
|
|
if (psoObject)
|
|
{
|
|
// Edit Ways off this actor
|
|
m_poActor = psoObject->GetObject();
|
|
m_poModel = m_poActor->GetOwner();
|
|
m_poFamilly = m_poModel->GetOwner();
|
|
m_poWayList = fn_poGetEdtListUseByActor (m_poActor);
|
|
|
|
fn_vEditListOfWay ( m_poActor );
|
|
fn_vRefreshDisplayControl();
|
|
fn_vRefreshScreen ();
|
|
return FALSE;
|
|
}
|
|
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
// if (!Way::fn_pGetDialog()->fn_pGetEditWay()) return FALSE; // there's nothing to edit
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
if (!pInfo) return FALSE;
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
psoObject=fn_pExplorePicking (xIndex, pInfo, C_ucCursor);
|
|
|
|
|
|
if (psoObject)
|
|
{
|
|
fn_vSetCursor (IDC_POINTER_CURSOR);
|
|
m_poCursorMove = (Cursor*)(psoObject->GetObject());
|
|
MTH3D_tdstVector v = (pInfo)->stPickedObject.aDEF_stDataOfElement[0].stHit;
|
|
m_poCursorMove->fn_vStartMove ( &v );
|
|
return TRUE;
|
|
}
|
|
|
|
|
|
ACP_tdxIndex xFindIndex;
|
|
psoObject=fn_pExplorePicking (xIndex, pInfo, C_ucLink, &xFindIndex);
|
|
|
|
if (psoObject)
|
|
{
|
|
if ( ((Link*)psoObject->GetObject())->fn_bIsPlane() && (pInfo)->stPickedObject.aDEF_stDataOfElement[xFindIndex].xElements==2 )
|
|
{
|
|
fn_vSetCursor (IDC_POINTER_PLANE);
|
|
m_poPlaneMove = (Link2D*)(psoObject->GetObject());
|
|
MTH3D_tdstVector v = (pInfo)->stPickedObject.aDEF_stDataOfElement[0].stHit;
|
|
m_poPlaneMove->fn_vStartMove ( &v );
|
|
return TRUE;
|
|
}
|
|
}
|
|
|
|
|
|
psoObject=fn_pExplorePicking (xIndex, pInfo, C_ucLink);
|
|
|
|
if (psoObject)
|
|
{
|
|
if (i==(MK_CONTROL|MK_LBUTTON))
|
|
{
|
|
// change the mouse cursor
|
|
fn_vSetCursor (IDC_ADD_WP);
|
|
|
|
m_pModifInsertWay = (Way*)(((CPA_SuperObject*)(psoObject->GetParent()))->GetObject());
|
|
MTH3D_tdstVector v = (pInfo)->stPickedObject.aDEF_stDataOfElement[0].stHit;
|
|
m_pModifInsertWay->fn_vModeInsert ((Link*)(psoObject->GetObject()), &v );
|
|
return TRUE;
|
|
}
|
|
else
|
|
{
|
|
WayPoint *poFirstWaypoint, *poSecondWaypoint;
|
|
((Link*)(psoObject->GetObject()))->fn_vGetWaypoints ( &poFirstWaypoint, &poSecondWaypoint );
|
|
Way::fn_pGetDialog()->fn_pGetEditWay()->fn_vClicWayPoint(poFirstWaypoint,poSecondWaypoint);
|
|
return FALSE;
|
|
}
|
|
return FALSE;
|
|
}
|
|
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
if (i==(MK_CONTROL|MK_LBUTTON))
|
|
{
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
m_pElasticWay = Way::fn_pGetDialog()->fn_pGetEditWay ();
|
|
MTH3D_tdstVector v = (pInfo)->stPickedObject.aDEF_stDataOfElement[0].stHit;
|
|
m_pElasticWay->fn_vModeAdd (&v);
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
return TRUE;
|
|
}
|
|
return FALSE;
|
|
}
|
|
|
|
BOOL Waypoint_Interface::_OnRButtonDown (UINT i, tdstMousePos *_p_stMousePos, ACP_tdxIndex xIndex, HIE_tdstPickInfo *pInfo)
|
|
{
|
|
CPA_SuperObject* psoSuperObject=NULL;
|
|
|
|
psoSuperObject=fn_pExplorePicking (xIndex, pInfo, HIE_C_ulEDT_Waypoint);
|
|
|
|
if (psoSuperObject)
|
|
{
|
|
//CPA2 Gabriela Dumitrascu 98-04-07
|
|
// Shaitan Correction {
|
|
// m_bRButtonDownWayPoint = Graph::fn_pGetDialog()->fn_bSetCrtWaypoint((WayPoint*)(psoSuperObject->GetObject()));
|
|
if (m_pSelectedGraph)
|
|
fn_vSetDisplayedWaypoint((WayPoint*)(psoSuperObject->GetObject()));
|
|
//End Shaitan Correction }
|
|
// End CPA2 Gabriela Dumitrascu 98-04-07
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
m_poAddWP=(WayPoint*)psoSuperObject->GetObject();
|
|
if (!Way::fn_pGetDialog()->fn_pGetEditWay()) return FALSE;
|
|
Way::fn_pGetDialog()->fn_pGetEditWay()->fn_vClicWayPoint(m_poAddWP);
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
m_bCommandWP=TRUE;
|
|
}
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
psoSuperObject=fn_pExplorePicking (xIndex, pInfo, C_ucLink);
|
|
if (psoSuperObject)
|
|
{
|
|
m_poRButtonDownWay=((Link*)psoSuperObject->GetObject())->fn_pGetWay();
|
|
m_bRButtonDownWay=TRUE;
|
|
|
|
|
|
if ( ((Link*)psoSuperObject->GetObject())->fn_bIsPlane() )
|
|
{
|
|
m_poRButtonLink=(Link2D*)psoSuperObject->GetObject();
|
|
m_bCommandLink=TRUE;
|
|
}
|
|
}
|
|
|
|
psoSuperObject=fn_pExplorePicking (xIndex, pInfo, C_ucTangent);
|
|
if (psoSuperObject)
|
|
{
|
|
m_poRButtonDownTangent = (Tangent*)(psoSuperObject->GetObject());
|
|
m_bRButtonDownTangent=TRUE;
|
|
}
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
|
|
return FALSE;
|
|
}
|
|
|
|
|
|
BOOL Waypoint_Interface::_OnLButtonDblClk (UINT nFlags, tdstMousePos *p_stPos, ACP_tdxIndex xIndex, HIE_tdstPickInfo *pInfo)
|
|
{
|
|
if (m_bCreateMode)
|
|
{ // clear the create mode
|
|
m_bCreateMode=FALSE;
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
// m_pElasticWay->fn_vStopModeAdd ();
|
|
((DEV_ViewPort3D*) (GetInterface()->GetMultiDevice()->GetFocusDevice()->GetViewPort()))->DoneMouseMove ();
|
|
// m_pElasticWay=NULL;
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
return TRUE;
|
|
}
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
CPA_SuperObject* psoSuperObject = fn_pExplorePicking (xIndex, pInfo, C_ucLink);
|
|
if (psoSuperObject)
|
|
{
|
|
WayPoint *poFirstWaypoint, *poSecondWaypoint;
|
|
Link* poLink = (Link*) psoSuperObject->GetObject();
|
|
fn_vEdit ( poLink );
|
|
poLink->fn_vGetWaypoints ( &poFirstWaypoint, &poSecondWaypoint );
|
|
if (Way::fn_pGetDialog()->fn_pGetEditWay())
|
|
{
|
|
Way::fn_pGetDialog()->fn_pGetEditWay()->fn_vClicWayPoint(poFirstWaypoint,poSecondWaypoint);
|
|
m_poWay = Way::fn_pGetDialog()->fn_pGetEditWay();
|
|
fn_vRefreshDisplayControl();
|
|
}
|
|
return TRUE;
|
|
}
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
return FALSE;
|
|
}
|
|
|
|
|
|
BOOL Waypoint_Interface::_OnMouseMove (UINT i, tdstMousePos *p_stMousePos, MTH3D_tdstVector *pTranslation)
|
|
{
|
|
if (m_bModifRadius)
|
|
{
|
|
// we are modifying the radius in live !
|
|
MTH3D_tdstVector xRVector;
|
|
xRVector = m_stdCenterWP;
|
|
MTH3D_M_vAddVector(&m_stdMouseVertex, &m_stdMouseVertex, pTranslation);
|
|
MTH3D_M_vSubVector(&xRVector, &xRVector, &m_stdMouseVertex );
|
|
GLI_tdxValue xR = MTH3D_M_xNormVector(&xRVector);
|
|
xR = (GLI_tdxValue)(((int)(xR*1000.f))/1000.f);
|
|
m_o_ModifRadiusWP->fn_vSetRadius (&xR);
|
|
m_o_ModifRadiusWP->fn_vDrawNewRadius ();
|
|
WayPoint::fn_pGetDialog()->fn_vRefreshDialog();
|
|
return TRUE;
|
|
}
|
|
|
|
|
|
if (pTranslation)
|
|
{
|
|
// ANNECY MT 13-02-98 {
|
|
MTH_tdxReal xNorm = MTH3D_M_xNormVector( pTranslation );
|
|
if (MTH_M_bIsNullWithEpsilon(xNorm, (float)1.0e-3))
|
|
return FALSE;
|
|
// END ANNECY MT }
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
if (m_poTangentMove)
|
|
{
|
|
m_poTangentMove->fn_vMove ( pTranslation, i==(MK_SHIFT|MK_LBUTTON), i==(MK_CONTROL|MK_LBUTTON) );
|
|
return TRUE;
|
|
}
|
|
|
|
if (m_poCursorMove)
|
|
{
|
|
m_poCursorMove->fn_vMove ( pTranslation );
|
|
return TRUE;
|
|
}
|
|
|
|
if (m_poPlaneMove)
|
|
{
|
|
m_poPlaneMove->fn_vMove ( pTranslation );
|
|
return TRUE;
|
|
}
|
|
|
|
if (m_pModifInsertWay)
|
|
{
|
|
MTH3D_tdstVector vTranslation = *pTranslation;
|
|
m_pModifInsertWay->fn_vDrawMouseLine (&vTranslation);
|
|
return TRUE;
|
|
}
|
|
else if (m_pElasticWay)
|
|
{
|
|
MTH3D_tdstVector vTranslation = *pTranslation;
|
|
m_pElasticWay->fn_vDrawElastic (&vTranslation);
|
|
return TRUE;
|
|
}
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
// Shaitan Correction {
|
|
/*
|
|
//CPA2 Gabriela Dumitrascu 98-05-07
|
|
if (m_bGraphMove)
|
|
{
|
|
Graph::fn_pGetDialog()->fn_vMove ( pTranslation );
|
|
return FALSE;
|
|
}
|
|
// End CPA2 Gabriela Dumitrascu 98-05-07
|
|
return FALSE;
|
|
*/
|
|
//End Shaitan Correction }
|
|
}
|
|
return FALSE;
|
|
}
|
|
|
|
BOOL Waypoint_Interface::_OnLButtonUp (UINT, tdstMousePos *p_stPos)
|
|
{
|
|
m_bStopSelect=FALSE;
|
|
|
|
// end of the modif radius mode
|
|
if (m_bModifRadius)
|
|
{
|
|
m_bModifRadius=FALSE;
|
|
fn_vSetCursor (IDC_POINTER_WP);
|
|
return TRUE;
|
|
}
|
|
|
|
if (m_bCreateMode)
|
|
{
|
|
((DEV_ViewPort3D*) (GetInterface()->GetMultiDevice()->GetFocusDevice()->GetViewPort()))->InitMouseMove (&m_stMouseVertex3DCreate, &m_stMouseVertex2DCreate);
|
|
return TRUE;
|
|
}
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
if (m_poTangentMove)
|
|
{
|
|
m_poTangentMove->fn_vEndMove ();
|
|
m_poTangentMove=NULL;
|
|
fn_vSetCursor (IDC_POINTER_WP);
|
|
return TRUE;
|
|
}
|
|
|
|
if (m_poCursorMove)
|
|
{
|
|
m_poCursorMove->fn_vEndMove ();
|
|
m_poCursorMove=NULL;
|
|
fn_vSetCursor (IDC_POINTER_WP);
|
|
return TRUE;
|
|
}
|
|
|
|
if (m_poPlaneMove)
|
|
{
|
|
m_poPlaneMove->fn_vEndMove ();
|
|
m_poPlaneMove=NULL;
|
|
fn_vSetCursor (IDC_POINTER_WP);
|
|
return TRUE;
|
|
}
|
|
|
|
|
|
if (m_pModifInsertWay)
|
|
{
|
|
ACP_tdxIndex xNbPicked;
|
|
HIE_aDEF_stTabOfPickInfo a_stPickInfo;
|
|
|
|
fn_vPick ( &xNbPicked, a_stPickInfo, p_stPos);
|
|
|
|
CPA_SuperObject* psoWP;
|
|
|
|
psoWP = fn_pExplorePicking (xNbPicked, a_stPickInfo, C_ucWaypoint);
|
|
if (psoWP)
|
|
{
|
|
m_pModifInsertWay->fn_vInsertWayPoint((WayPoint*)(psoWP->GetObject()));
|
|
}
|
|
else m_pModifInsertWay->fn_vInsertNewWayPoint ( &(a_stPickInfo->stPickedObject.aDEF_stDataOfElement[0].stHit) );
|
|
m_pModifInsertWay->fn_vModeNormal();
|
|
m_pModifInsertWay=NULL;
|
|
return TRUE;
|
|
}
|
|
else if (m_pElasticWay && !m_bCreateMode)
|
|
{
|
|
ACP_tdxIndex xNbPicked;
|
|
HIE_aDEF_stTabOfPickInfo a_stPickInfo;
|
|
|
|
fn_vPick ( &xNbPicked, a_stPickInfo, p_stPos);
|
|
|
|
CPA_SuperObject* psoWP;
|
|
psoWP = fn_pExplorePicking (xNbPicked, a_stPickInfo, C_ucWaypoint);
|
|
// if there's a WP under the mouse
|
|
if (psoWP)
|
|
{
|
|
m_poAddWP = (WayPoint*)(psoWP->GetObject());
|
|
fn_vAddWayPoint ();
|
|
}
|
|
// else creation d'un WP ici peut-être ?
|
|
else m_pElasticWay->fn_vInsertNewWayPoint ( &(a_stPickInfo->stPickedObject.aDEF_stDataOfElement[0].stHit) );
|
|
m_pElasticWay->fn_vModeNormal();
|
|
m_pElasticWay=NULL;
|
|
return TRUE;
|
|
|
|
}
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
// Shaitan Correction {
|
|
/*
|
|
//CPA2 Gabriela Dumitrascu 98-05-07
|
|
if (m_bGraphMove)
|
|
{
|
|
m_bGraphMove = FALSE;
|
|
Graph::fn_pGetDialog()->fn_vMove ();
|
|
return FALSE;
|
|
}
|
|
// End CPA2 Gabriela Dumitrascu 98-05-07
|
|
*/
|
|
//End Shaitan Correction }
|
|
return FALSE;
|
|
}
|
|
|
|
//----------------------------------------------------------------------
|
|
// Copy - Paste
|
|
//----------------------------------------------------------------------
|
|
BOOL Waypoint_Interface::fn_bAcceptModifCopy (CPA_List<CPA_SuperObject> *pListObjects, tdeStatus eStatus)
|
|
{
|
|
if (eStatus!=C_AsConcernedDLL) return TRUE;
|
|
POSITION xPos;
|
|
CPA_SuperObject* poSuperObject;
|
|
|
|
for (poSuperObject=pListObjects->GetHeadElement(xPos); poSuperObject; poSuperObject=pListObjects->GetNextElement(xPos) )
|
|
{
|
|
if (poSuperObject->GetObjectType()==HIE_C_ulEDT_Waypoint) return TRUE;
|
|
}
|
|
return FALSE;
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
// MODELS
|
|
//----------------------------------------------------------------------
|
|
void Waypoint_Interface::fn_vInitListByType(CPA_World *pWorld)
|
|
{
|
|
pWorld->fn_vAddANewListByType ("Waypoint", this);
|
|
pWorld->fn_vAddANewListByType ("Way", this);
|
|
pWorld->fn_vAddANewListByType ("Link", this);
|
|
// CPA2 Gabriela Dumitrascu 98-04-07
|
|
pWorld->fn_vAddANewListByType ("Graph", this);
|
|
// End CPA2 Gabriela Dumitrascu 98-04-07
|
|
|
|
}
|
|
|
|
|
|
void Waypoint_Interface::fn_vInitListsOfModels (void)
|
|
{
|
|
|
|
//---- Waypoints
|
|
GetInterface()->fn_bAddANewModelList("Waypoint", this);
|
|
EDT_Model* pNewModelWaypoint = new EDT_Model ( this, "Waypoint", csWaypointModelName, "objects\\waypoint\\StatWP.bmp", GetInterface() );
|
|
GetInterface()-> fn_bAddANewModel (pNewModelWaypoint, "Waypoint", this);
|
|
|
|
//----- Way
|
|
GetInterface()->fn_bAddANewModelList("Way", this);
|
|
|
|
}
|
|
|
|
tdeTypeSO Waypoint_Interface::GetTypeInstance (CString csTypeName, CString csModelName)
|
|
{
|
|
if ( csTypeName=="Waypoint" )
|
|
{
|
|
if (csModelName==csStaticModelName)
|
|
{
|
|
return C_Dynamic; // eh oui
|
|
}
|
|
else if (csModelName==csDynamicModelName)
|
|
{
|
|
return C_Protected;
|
|
}
|
|
}
|
|
else if ( csTypeName=="Way" ) return C_Dynamic;
|
|
|
|
return C_Protected;
|
|
|
|
}
|
|
|
|
//ANNECY Shaitan EmptySectors 25/02/98
|
|
tdeSaveStatus Waypoint_Interface::GetStatusInstance (CString csTypeName, CString csModelName)
|
|
{
|
|
return E_ss_NoSave;
|
|
}
|
|
//ENDANNECY Shaitan EmptySectors
|
|
|
|
|
|
CPA_SuperObject* Waypoint_Interface::GetNewInstance (CString csTypeName, CString csModelName, CPA_SuperObject *pParent)
|
|
{
|
|
if (csTypeName=="Waypoint")
|
|
{
|
|
CPA_SuperObject* psoWP = GetInterface()->GetNewSuperObject (E_ss_NoSave);
|
|
|
|
WayPoint* poWP = new WayPoint (this, !m_bNextInstanceInWay);
|
|
|
|
m_bNextInstanceInWay=FALSE;
|
|
m_bAddLink=FALSE;
|
|
|
|
// init objet
|
|
poWP->SetSuperObject (psoWP);
|
|
|
|
// we recognize a static waypoint because its parent is the dynamic root
|
|
// I don't find something else better
|
|
if (!pParent || pParent==GetInterface()->GetSpecificInterface()->GetDynamicRoot())
|
|
{
|
|
// static waypoint
|
|
poWP->fn_vSetCoordinate (TRUE);
|
|
psoWP->SetTypeSO (C_Dynamic);
|
|
WP_fnv_WayPoint_SetSuperObject (poWP->GetStruct(), NULL);
|
|
}
|
|
else
|
|
{
|
|
// warning for the designer
|
|
MessageBox(NULL, " This waypoint is inserted as child of an actor. \n It will be created as a dynamic waypoint.",
|
|
"WARNING : dynamic insertion", MB_OK | MB_ICONEXCLAMATION);
|
|
// dynamic waypoint
|
|
poWP->fn_vSetCoordinate (FALSE);
|
|
psoWP->SetTypeSO (C_Protected);
|
|
WP_fnv_WayPoint_SetSuperObject (poWP->GetStruct(), NULL);
|
|
}
|
|
|
|
psoWP->SetObject(poWP);
|
|
psoWP->SetModelName (csWaypointModelName);
|
|
|
|
|
|
//---------------------------------- Static
|
|
// Shaitan Correction {
|
|
// CPA_SuperObject* spoGraphic = fn_pGetNewSymbolicalGraphicObject ();
|
|
// spoGraphic->SetEditProtected (TRUE);
|
|
// spoGraphic->SetSuperObjectOwner (psoWP);
|
|
// psoWP->AddTail (spoGraphic);
|
|
poWP->GetSymbolicalGraphic()->SetSuperObjectOwner (psoWP);
|
|
psoWP->AddTail(poWP->GetSymbolicalGraphic());
|
|
//End Shaitan Correction }
|
|
//-------------------------------------------------------------------
|
|
|
|
HIE_fn_vSetSuperObjectDrawMask(psoWP->GetStruct(), GLI_C_lAllIsEnable ^ GLI_C_lIsNotDrawCollideInformation);
|
|
|
|
return psoWP;
|
|
|
|
}
|
|
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
else if (csTypeName=="Way")
|
|
{
|
|
if (!Way::fn_pGetDialog()->fn_pGetEditWay()) return NULL;
|
|
|
|
Way* poWay = Way::fn_pGetDialog()->fn_pGetEditWay();
|
|
if (poWay->IsWayEmpty()) fn_bComputeRealWay (&poWay);
|
|
HIE_fn_vSetSuperObjectDrawMask(poWay->GetSuperObject()->GetStruct(), GLI_C_lAllIsEnable);
|
|
return poWay->GetSuperObject();
|
|
return NULL;
|
|
}
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
else return NULL;
|
|
}
|
|
|
|
//ROMTEAM Networks (Gabriela Dumitrascu 02/03/98)
|
|
void Waypoint_Interface::fn_vLoadGraph (void)
|
|
{
|
|
BOOL bIsLoadingWorld = GetInterface()->fn_bIsLoadingWorld();
|
|
GetInterface ()->SetLoadingWorld (TRUE);
|
|
|
|
SCR_tdst_Link_Table* pLinkTable = WPG_fnp_Graph_GetLinkTable ();
|
|
|
|
unsigned int uiPos;
|
|
SCR_tdst_Link_Value *pLinkValue;
|
|
|
|
// Get first element of array
|
|
uiPos = 0;
|
|
SCR_M_DyAr_GetNextElement
|
|
(
|
|
SCR_tdst_Link_Value,
|
|
uiPos,
|
|
pLinkValue,
|
|
SCR_M_st_Link_GetDynamicArray(pLinkTable)
|
|
)
|
|
while (pLinkValue)
|
|
{
|
|
if (SCR_M_e_Link_GetState(pLinkValue) != SCR_ELS_Link_NotInitialized)
|
|
{
|
|
CString csSectionName = SCR_M_p_sz_Link_GetKey(pLinkValue);
|
|
WP_tdHandleOfGraph hEngine = (WP_tdHandleOfGraph) SCR_M_ul_Link_GetValue (pLinkValue);
|
|
|
|
// get parameters and create object
|
|
char szFileName [SCR_CV_ui_Cfg_MaxLenName];
|
|
char szActionName [SCR_CV_ui_Cfg_MaxLenName];
|
|
char szName [SCR_CV_ui_Cfg_MaxLenName];
|
|
char* szSectionName;
|
|
|
|
long lSizePath = strlen ( fn_szGetLevelsDataPath() );
|
|
szSectionName = ((char*)(LPCSTR)csSectionName) + lSizePath + 1;
|
|
|
|
SCR_fn_v_RdL0_SplitSectionName(szSectionName, szFileName, szActionName, szName);
|
|
|
|
Graph* poGraph = new Graph( this, hEngine, szName, szFileName, szActionName );
|
|
}
|
|
// Get next element
|
|
uiPos++;
|
|
SCR_M_DyAr_GetNextElement
|
|
(
|
|
SCR_tdst_Link_Value,
|
|
uiPos,
|
|
pLinkValue,
|
|
SCR_M_st_Link_GetDynamicArray(pLinkTable)
|
|
)
|
|
|
|
}
|
|
|
|
GetInterface ()->SetLoadingWorld (bIsLoadingWorld);
|
|
}
|
|
//ENDROMTEAM Networks (Gabriela Dumitrascu)
|
|
|
|
void Waypoint_Interface::fn_vLoadWaypoint (void)
|
|
{
|
|
BOOL bIsLoadingWorld = GetInterface()->fn_bIsLoadingWorld();
|
|
GetInterface ()->SetLoadingWorld (TRUE);
|
|
|
|
SCR_tdst_Link_Table* pLinkTable = WP_fnp_WayPoint_GetLinkTable ();
|
|
|
|
unsigned int uiPos;
|
|
SCR_tdst_Link_Value *pLinkValue;
|
|
|
|
// Get first element of array
|
|
uiPos = 0;
|
|
SCR_M_DyAr_GetNextElement
|
|
(
|
|
SCR_tdst_Link_Value,
|
|
uiPos,
|
|
pLinkValue,
|
|
SCR_M_st_Link_GetDynamicArray(pLinkTable)
|
|
)
|
|
while (pLinkValue)
|
|
{
|
|
if (SCR_M_e_Link_GetState(pLinkValue) != SCR_ELS_Link_NotInitialized)
|
|
{
|
|
CString csSectionName = SCR_M_p_sz_Link_GetKey(pLinkValue);
|
|
WP_tdhWayPoint hEngine = (WP_tdhWayPoint) SCR_M_ul_Link_GetValue (pLinkValue);
|
|
|
|
BOOL bAlone = fn_bIsSubSectionInSection ( csSectionName, C_SubSectionIsolateWayPointDescription );
|
|
|
|
// get parameters and create object
|
|
char szFileName [SCR_CV_ui_Cfg_MaxLenName];
|
|
char szActionName [SCR_CV_ui_Cfg_MaxLenName];
|
|
char szName [SCR_CV_ui_Cfg_MaxLenName];
|
|
char* szSectionName;
|
|
|
|
long lSizePath = strlen ( fn_szGetLevelsDataPath() );
|
|
szSectionName = ((char*)(LPCSTR)csSectionName) + lSizePath + 1;
|
|
|
|
SCR_fn_v_RdL0_SplitSectionName(szSectionName, szFileName, szActionName, szName);
|
|
|
|
WayPoint* poWP = new WayPoint ( this, hEngine, szName, szFileName, szActionName );
|
|
|
|
CPA_SuperObject* psoWP = GetInterface()->GetNewSuperObject (E_ss_NoSave);
|
|
|
|
|
|
MTH3D_tdstVector stVertex;
|
|
// WP_fnv_WayPoint_ComputeLocation ( hEngine, &stVertex );
|
|
WP_fnv_WayPoint_GetVertex (hEngine,&stVertex);
|
|
|
|
poWP->fn_vSetAlone (bAlone);
|
|
|
|
// init objet-super object
|
|
poWP->SetSuperObject (psoWP);
|
|
psoWP->SetObject(poWP);
|
|
|
|
// static or dynamic ?
|
|
if (WP_fnb_WayPoint_IsStatic(hEngine))
|
|
{
|
|
// static waypoint
|
|
poWP->fn_vSetCoordinate (TRUE);
|
|
psoWP->SetTypeSO (C_Dynamic);
|
|
psoWP->SetModelName (csStaticModelName);
|
|
poWP->fn_vSetFather ( NULL );
|
|
poWP->fn_vSetDynamicFather ( NULL );
|
|
|
|
}
|
|
else
|
|
{
|
|
// dynamic waypoint
|
|
poWP->fn_vSetCoordinate (FALSE);
|
|
psoWP->SetTypeSO (C_Protected);
|
|
psoWP->SetModelName (csDynamicModelName);
|
|
|
|
// set father
|
|
HIE_tdxHandleToSuperObject hSuperObject = WP_fnh_WayPoint_GetSuperObject(poWP->GetStruct());
|
|
CPA_BaseObject* pBaseObject = GetInterface()->GetMainWorld()->fn_p_oFindObjectWithEngine (hSuperObject);
|
|
poWP->fn_vSetFather ( (CPA_SuperObject*)pBaseObject );
|
|
poWP->fn_vSetDynamicFather ( (CPA_SuperObject*)pBaseObject );
|
|
}
|
|
|
|
//---------------------------------- Attach graphic object
|
|
// Shaitan Correction {
|
|
// CPA_SuperObject* spoGraphic = fn_pGetNewSymbolicalGraphicObject ();
|
|
// spoGraphic->SetEditProtected (TRUE);
|
|
// spoGraphic->SetSuperObjectOwner (psoWP);
|
|
// psoWP->AddTail (spoGraphic);
|
|
poWP->GetSymbolicalGraphic()->SetSuperObjectOwner (psoWP);
|
|
psoWP->AddTail(poWP->GetSymbolicalGraphic());
|
|
//End Shaitan Correction }
|
|
//-------------------------------------------------------------------
|
|
|
|
// set draw mask
|
|
HIE_fn_vSetSuperObjectDrawMask(psoWP->GetStruct(), GLI_C_lAllIsEnable ^ GLI_C_lIsNotDrawCollideInformation);
|
|
|
|
m_bComputeEngineWaypoint=FALSE;
|
|
m_bComputeEngineWaypoint=TRUE;
|
|
|
|
// set location of superobject
|
|
// GEO_tdxHandleToMatrix hAbsoluteObjectMatrix = HIE_fn_hGetSuperObjectGlobalMatrix (psoWP->GetStruct());
|
|
GEO_tdxHandleToMatrix hAbsoluteObjectMatrix = HIE_fn_hGetSuperObjectMatrix (psoWP->GetStruct());
|
|
POS_fn_vSetTranslationVector( hAbsoluteObjectMatrix, &stVertex );
|
|
// fn_vComputeRelativeMatrix (psoWP, GetInterface()->GetSpecificInterface()->GetDynamicRoot());
|
|
}
|
|
// Get next element
|
|
uiPos++;
|
|
SCR_M_DyAr_GetNextElement
|
|
(
|
|
SCR_tdst_Link_Value,
|
|
uiPos,
|
|
pLinkValue,
|
|
SCR_M_st_Link_GetDynamicArray(pLinkTable)
|
|
)
|
|
|
|
}
|
|
|
|
GetInterface ()->SetLoadingWorld (bIsLoadingWorld);
|
|
|
|
|
|
}
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
void Waypoint_Interface::fn_vLoadWay (void)
|
|
{
|
|
POSITION xPos;
|
|
CPA_SuperObject* poSuperObject;
|
|
|
|
CPA_SuperObject* poDynamicRoot = GetInterface()->GetSpecificInterface()->GetDynamicRoot ();
|
|
|
|
// to allow the insertion by acceptmodifinsert
|
|
BOOL bOldRefreshWay = m_bRefreshWay;
|
|
m_bRefreshWay=TRUE;
|
|
|
|
for
|
|
(
|
|
poSuperObject=m_oLoadListOfWay.GetHeadElement(xPos);
|
|
poSuperObject;
|
|
poSuperObject=m_oLoadListOfWay.GetNextElement(xPos)
|
|
)
|
|
{
|
|
Way* poWay = (Way*) (poSuperObject->GetObject());
|
|
|
|
GetInterface()->fn_bInsertObjectInHierarchy (poSuperObject, poDynamicRoot, FALSE, FALSE, FALSE);
|
|
poWay->fn_vLoadFromEngine ();
|
|
}
|
|
|
|
m_bRefreshWay=bOldRefreshWay;
|
|
}
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
// Insert way sons in hierarchy
|
|
void Waypoint_Interface::fn_vInsertWaySon (void)
|
|
{
|
|
POSITION xPos;
|
|
CPA_SuperObject* poSuperObject;
|
|
|
|
for
|
|
(
|
|
poSuperObject=m_oLoadListOfWay.GetHeadElement(xPos);
|
|
poSuperObject;
|
|
poSuperObject=m_oLoadListOfWay.GetNextElement(xPos)
|
|
)
|
|
{
|
|
Way* poWay = (Way*) (poSuperObject->GetObject());
|
|
poWay->fn_vRefresh (TRUE,FALSE);
|
|
}
|
|
GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
|
|
}
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
Way* Waypoint_Interface::fn_pCreateWayFromEngine ( WP_tdhWay hWay, CPA_BaseObject* poOwner, CString csName, CString csReferencedSectionName )
|
|
{
|
|
CString csSectionName;
|
|
|
|
// Ne doit pas rentrer içi avec NULL. ( traitement dans EdtList )
|
|
ASSERT (hWay);
|
|
|
|
// This way exist ?
|
|
CPA_BaseObject * pEdObj = GetInterface()->GetMainWorld()->fn_p_oFindObjectWithEngine (hWay, "Way");
|
|
if (pEdObj) return (Way*)pEdObj;
|
|
|
|
Way* poWay = new Way ( this, hWay, poOwner, csName, csReferencedSectionName );
|
|
|
|
CPA_SuperObject* psoWay = GetInterface()->GetNewSuperObject (E_ss_NoSave);
|
|
|
|
// init objet-super object
|
|
poWay->SetSuperObject (psoWay);
|
|
psoWay->SetObject(poWay);
|
|
psoWay->SetTypeSO (C_Dynamic);
|
|
|
|
// set draw mask
|
|
HIE_fn_vSetSuperObjectDrawMask(psoWay->GetStruct(), GLI_C_lAllIsEnable ^ GLI_C_lIsNotDrawCollideInformation);
|
|
|
|
// insert in list
|
|
m_oLoadListOfWay.AddTail (psoWay);
|
|
|
|
return poWay;
|
|
}
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
|
|
|
|
CPA_SuperObject* Waypoint_Interface::GetParentForInsertion (CString csTypeName, CString csModelName, tdstPosition *p_stPosition)
|
|
{
|
|
|
|
if ( csTypeName=="Waypoint" )
|
|
{
|
|
|
|
if (csModelName==csWaypointModelName)
|
|
{
|
|
// this is the graphic object under the waypoint
|
|
CPA_SuperObject* poSuperObject = fn_pExplorePicking (p_stPosition->xIndex, p_stPosition->a_stPickInfo, HIE_C_ulPO);
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
// if we insert the wp on a link, we want to insert the wp in the way -> the wp is static
|
|
// m_bAddLink = fn_pExplorePicking (p_stPosition->xIndex, p_stPosition->a_stPickInfo, C_ucLink)!=NULL;
|
|
|
|
// This graphic object is static or dynamic ?
|
|
// search for its type of hierarchy
|
|
// if ( poSuperObject && !m_bAddLink )
|
|
if ( poSuperObject)
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
{
|
|
// in the dynamic hierarchy
|
|
|
|
// search the valid parent in the dynamic hierarchy
|
|
for (ACP_tdxIndex i=0; i<p_stPosition->xIndex; i++)
|
|
{
|
|
CPA_SuperObject* poSuperObject = GetInterface()->GetEditorObject(p_stPosition->a_stPickInfo[i].hSprObject);
|
|
CPA_SuperObject* pChild;
|
|
while (poSuperObject)
|
|
{
|
|
// if ( poSuperObject->GetObjectType()==HIE_C_ulPO )
|
|
if ( poSuperObject->GetRealTypeName()==C_szActorInstanceTypeName )
|
|
{
|
|
pChild=poSuperObject;
|
|
while ( pChild && pChild!=GetInterface()->GetSpecificInterface()->GetDynamicRoot() ) pChild=(CPA_SuperObject*)pChild->GetParent();
|
|
if (pChild) return poSuperObject;
|
|
}
|
|
poSuperObject = (CPA_SuperObject*)poSuperObject->GetParent();
|
|
}
|
|
}
|
|
return GetInterface()->GetSpecificInterface()->GetDynamicRoot();
|
|
}
|
|
else
|
|
{
|
|
// position is invalid ?
|
|
if (!p_stPosition->xIndex) return NULL;
|
|
|
|
//ANNECY Shaitan EmptySectors (25/02/98)
|
|
// else return GetInterface()->GetSpecificInterface()->GetDefaultParentFromPos (p_stPosition, C_Dynamic);
|
|
else return GetInterface()->GetSpecificInterface()->GetDefaultParentFromPos (p_stPosition, C_Dynamic, E_ss_NoSave);
|
|
//ENDANNECY Shaitan EmptySectors
|
|
}
|
|
}
|
|
}
|
|
else if ( csTypeName=="Way" )
|
|
{
|
|
return GetInterface()->GetSpecificInterface()->GetDynamicRoot();
|
|
}
|
|
else if ( csTypeName=="Cursor" )
|
|
{
|
|
CPA_SuperObject* poSuperObject = fn_pExplorePicking (p_stPosition->xIndex, p_stPosition->a_stPickInfo, 1 );
|
|
return poSuperObject;
|
|
}
|
|
|
|
return NULL;
|
|
}
|
|
|
|
|
|
EDT_Model* Waypoint_Interface::fn_pstLoadNewDescriptor (void)
|
|
{
|
|
return NULL;
|
|
}
|
|
|
|
CPA_BaseObject * Waypoint_Interface::Duplicate (CPA_BaseObject *pObject, CPA_SuperObject *pNewSuperObject)
|
|
{
|
|
if (pObject->GetType()==C_szWayPointTypeName)
|
|
{
|
|
WayPoint* poWP = new WayPoint ( *(WayPoint*)pObject );
|
|
// Shaitan Correction {
|
|
// CPA_SuperObject* spoGraphic = fn_pGetNewSymbolicalGraphicObject ();
|
|
// spoGraphic->SetEditProtected (TRUE);
|
|
// spoGraphic->SetSuperObjectOwner (pNewSuperObject);
|
|
// pNewSuperObject->AddTail (spoGraphic);
|
|
poWP->GetSymbolicalGraphic()->SetSuperObjectOwner (pNewSuperObject);
|
|
pNewSuperObject->AddTail(poWP->GetSymbolicalGraphic());
|
|
//End Shaitan Correction }
|
|
poWP->fn_vNotifySave();
|
|
return poWP;
|
|
}
|
|
if (pObject->GetType()==C_szWayTypeName)
|
|
{
|
|
MessageBeep (-1);
|
|
}
|
|
|
|
|
|
return NULL;
|
|
}
|
|
|
|
|
|
CPA_SuperObject* Waypoint_Interface::GetCopyOfProtectedChild (CPA_SuperObject *pInitialChild, CPA_SuperObject *pNewOwner)
|
|
{
|
|
return (CPA_SuperObject*)(pNewOwner->GetHead());
|
|
}
|
|
|
|
|
|
//-------------------------------------------------------------------
|
|
// MENU
|
|
//-------------------------------------------------------------------
|
|
|
|
|
|
//---------------------------- Popup
|
|
|
|
BOOL Waypoint_Interface::fn_bDefinePopupMenu(EDT_PopUpMenu *pPopup, CPA_List<CPA_SuperObject> *pSelection, BOOL bIsAlone)
|
|
{
|
|
BOOL bEntry=FALSE;
|
|
|
|
if (m_bMainDll)
|
|
{
|
|
m_bMainDll=FALSE;
|
|
return FALSE;
|
|
}
|
|
m_bMainDll=bIsAlone;
|
|
|
|
BOOL bDeleteWP=FALSE;
|
|
BOOL bAddWP=FALSE;
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
// Way* p_oEditWay = Way::fn_pGetDialog()->fn_pGetEditWay();
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
if(m_bRButtonDownWay)
|
|
{
|
|
char szCurrentWayName [100];
|
|
char szMes [200];
|
|
strcpy ( szCurrentWayName, m_poRButtonDownWay->GetName().GetBuffer(100) );
|
|
|
|
|
|
// copy
|
|
sprintf ( szMes, "Copy way %s", szCurrentWayName );
|
|
pPopup->AddAnEntry(this, szMes, c_Way_PopUp_Copy);
|
|
bEntry=TRUE;
|
|
|
|
if ( m_poRButtonDownWay->fn_bGetRotationMode() )
|
|
{
|
|
sprintf ( szMes, "Exit rotation mode for way %s", szCurrentWayName );
|
|
pPopup->AddAnEntry(this, szMes, c_Way_PopUp_Exit_Rotation_Mode);
|
|
bEntry=TRUE;
|
|
}
|
|
else
|
|
{
|
|
sprintf ( szMes, "Enter rotation mode for way %s", szCurrentWayName );
|
|
pPopup->AddAnEntry(this, szMes, c_Way_PopUp_Enter_Rotation_Mode);
|
|
bEntry=TRUE;
|
|
}
|
|
}
|
|
|
|
if (p_oEditWay)
|
|
{
|
|
char szCurrentWayName [100];
|
|
char szMes [200];
|
|
|
|
strcpy ( szCurrentWayName, p_oEditWay->GetName().GetBuffer(100) );
|
|
|
|
bDeleteWP = p_oEditWay->fn_iIsWayPointInNet (m_poAddWP)>=0;
|
|
|
|
// we can't add a WP in last position
|
|
if (p_oEditWay) bAddWP = m_bCommandWP && (p_oEditWay->fn_iIsWayPointInNet(m_poAddWP)!=p_oEditWay->GetListWaypoint()->GetCount()-1);
|
|
|
|
// paste
|
|
if ( p_oEditWay->fn_bCanPaste() )
|
|
{
|
|
sprintf ( szMes, "Paste way %s", p_oEditWay->GetName().GetBuffer(100) );
|
|
pPopup->AddAnEntry(this, szMes, c_Way_PopUp_Paste);
|
|
bEntry=TRUE;
|
|
}
|
|
|
|
|
|
if (bDeleteWP)
|
|
{
|
|
sprintf ( szMes, "Delete waypoint %s into way %s", m_poAddWP->GetName().GetBuffer(100), szCurrentWayName );
|
|
pPopup->AddAnEntry(this, szMes, c_Way_PopUp_DeleteWP);
|
|
bEntry=TRUE;
|
|
}
|
|
|
|
if (bAddWP)
|
|
{
|
|
sprintf ( szMes, "Add waypoint %s at the end of way %s", m_poAddWP->GetName().GetBuffer(100), szCurrentWayName );
|
|
pPopup->AddAnEntry(this, szMes, c_Way_PopUp_AddWP);
|
|
bEntry=TRUE;
|
|
}
|
|
|
|
}
|
|
|
|
if (m_bCommandLink)
|
|
{
|
|
pPopup->AddAnEntry(this, "Set plane horizontal", c_Way_PopUp_Link_Hor);
|
|
pPopup->AddAnEntry(this, "Set plane vertical", c_Way_PopUp_Link_Ver);
|
|
bEntry=TRUE;
|
|
}
|
|
|
|
if (m_bRButtonDownTangent)
|
|
{
|
|
if (m_poRButtonDownTangent->fn_pGetParent()->fn_bIsRotationMode())
|
|
{
|
|
pPopup->AddAnEntry(this, "Orient all tangents like this", c_Way_PopUp_Orient_All_Tangent);
|
|
pPopup->AddAnEntry(this, "Reinit tangent", c_Way_PopUp_Reinit_Tangent);
|
|
pPopup->AddAnEntry(this, "Orient tangent", c_Way_PopUp_Orient_Tangent);
|
|
bEntry=TRUE;
|
|
}
|
|
}
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
if ((pSelection->GetCount() == 1) && (pSelection->GetHeadElement()->GetObjectType()==HIE_C_ulEDT_Waypoint))
|
|
{
|
|
if (pSelection->GetHeadElement()->GetTypeSO() == C_Protected)
|
|
{
|
|
pPopup->AddAnEntry(this, "Waypoint : Set Static", c_WayPoint_PopUp_SetStatic);
|
|
bEntry = TRUE;
|
|
}
|
|
}
|
|
|
|
|
|
//CPA2 Gabriela Dumitrascu 98-04-07
|
|
// Shaitan Correction {
|
|
if (fn_bIsCurrentEditor() && m_pSelectedGraph)
|
|
{
|
|
if (bEntry)
|
|
pPopup->AddASeparator();
|
|
pPopup->AddAnEntry(this, "Show Out Links", c_WayPoint_PopUp_Show_Out_Links, (m_eDisplayMode == E_dm_ShowOutLinks));
|
|
pPopup->AddAnEntry(this, "Show In Links", c_WayPoint_PopUp_Show_In_Links, (m_eDisplayMode == E_dm_ShowInLinks));
|
|
pPopup->AddAnEntry(this, "Show All Links", c_WayPoint_PopUp_Show_All_Links, (m_eDisplayMode == E_dm_ShowAllLinks));
|
|
pPopup->AddAnEntry(this, "Show No Links", c_WayPoint_PopUp_Show_No_Links, (m_eDisplayMode == E_dm_ShowNothing));
|
|
if (m_pDisplayedWayPoint)
|
|
{
|
|
pPopup->AddAnEntry(this, "Define Next WayPoint",c_WayPoint_PopUp_Define_Next_WP );
|
|
pPopup->AddAnEntry(this, "Define Previous WayPoint", c_WayPoint_PopUp_Define_Previous_WP);
|
|
//pPopup->AddAnEntry(this, "Show All WP of Graph", c_WayPoint_PopUp_Show_All_WP);
|
|
}
|
|
bEntry=TRUE;
|
|
}
|
|
//End Shaitan Correction }
|
|
//End CPA2 Gabriela Dumitrascu 98-04-07
|
|
|
|
if (fn_bIsCurrentEditor())
|
|
{
|
|
if (bEntry)
|
|
pPopup->AddASeparator();
|
|
pPopup->AddAnEntry (this, "Exit WayPoint editor", c_Way_PopUp_Exit);
|
|
bEntry=TRUE;
|
|
}
|
|
|
|
m_bCommandWP=FALSE;
|
|
m_bCommandLink=FALSE;
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
m_bRButtonDownTangent=FALSE;
|
|
m_bRButtonDownWay=FALSE;
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
//CPA2 Gabriela Dumitrascu 98-04-07
|
|
// Shaitan Correction {
|
|
// m_bRButtonDownWayPoint = FALSE;
|
|
//End Shaitan Correction }
|
|
//End CPA2 Gabriela Dumitrascu 98-04-07
|
|
return bEntry;
|
|
}
|
|
|
|
void Waypoint_Interface::_OnPopUpMenuCommand(UINT m_IDCmdMsg)
|
|
{
|
|
switch (m_IDCmdMsg)
|
|
{
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
case c_Way_PopUp_DeleteWP:
|
|
Way::fn_pGetDialog()->fn_pGetEditWay()->fn_vDeleteWayPoint();
|
|
break;
|
|
|
|
case c_Way_PopUp_AddWP:
|
|
fn_vAddWayPoint ();
|
|
break;
|
|
|
|
case c_Way_PopUp_Link_Hor:
|
|
m_poRButtonLink->fn_vSetPlaneHorizontal ();
|
|
break;
|
|
|
|
case c_Way_PopUp_Link_Ver:
|
|
m_poRButtonLink->fn_vSetPlaneVertical ();
|
|
break;
|
|
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
case c_Way_PopUp_Exit:
|
|
GetMainWorld ( ) -> fn_bCloseEditor ( this );
|
|
break;
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
case c_Way_PopUp_Copy:
|
|
m_poRButtonDownWay->fn_vCopy();
|
|
break;
|
|
|
|
case c_Way_PopUp_Paste:
|
|
Way::fn_pGetDialog()->fn_pGetEditWay()->fn_vPaste();
|
|
break;
|
|
|
|
case c_Way_PopUp_Enter_Rotation_Mode:
|
|
m_poRButtonDownWay->fn_vSetRotationMode (TRUE);
|
|
break;
|
|
|
|
case c_Way_PopUp_Exit_Rotation_Mode:
|
|
m_poRButtonDownWay->fn_vSetRotationMode (FALSE);
|
|
break;
|
|
|
|
case c_Way_PopUp_Orient_All_Tangent:
|
|
m_poRButtonDownTangent->fn_vChangeAllTangent ();
|
|
break;
|
|
|
|
case c_Way_PopUp_Reinit_Tangent:
|
|
m_poRButtonDownTangent->fn_pGetParent()->fn_vReinitOrientationTangent (m_poRButtonDownTangent);
|
|
break;
|
|
|
|
case c_Way_PopUp_Orient_Tangent:
|
|
m_bOrientTangent=TRUE;
|
|
break;
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
//CPA2 Gabriela Dumitrascu 98-04-07
|
|
// Shaitan Correction {
|
|
case c_WayPoint_PopUp_Show_Out_Links:
|
|
//Graph::fn_pGetDialog()->fn_vShowOutLinks ();
|
|
SetDisplayMode(E_dm_ShowOutLinks);
|
|
break;
|
|
case c_WayPoint_PopUp_Show_In_Links:
|
|
//Graph::fn_pGetDialog()->fn_vShowInLinks ();
|
|
SetDisplayMode(E_dm_ShowInLinks);
|
|
break;
|
|
case c_WayPoint_PopUp_Show_All_Links:
|
|
//Graph::fn_pGetDialog()->fn_vShowAllLinks ();
|
|
SetDisplayMode(E_dm_ShowAllLinks);
|
|
break;
|
|
case c_WayPoint_PopUp_Show_No_Links:
|
|
//Graph::fn_pGetDialog()->fn_vCancelDisplayLinks ();
|
|
SetDisplayMode(E_dm_ShowNothing);
|
|
break;
|
|
case c_WayPoint_PopUp_Define_Next_WP:
|
|
// Graph::fn_pGetDialog()->fn_vDefineNextWP ();
|
|
m_eSelectMode = E_sm_NextWP_Popup;
|
|
break;
|
|
case c_WayPoint_PopUp_Define_Previous_WP:
|
|
// Graph::fn_pGetDialog()->fn_vDefinePreviousWP ();
|
|
m_eSelectMode = E_sm_PrevWP_Popup;
|
|
break;
|
|
// case c_WayPoint_PopUp_Show_All_WP:
|
|
// Graph::fn_pGetDialog()->fn_vShowAllWP ();
|
|
// break;
|
|
//End Shaitan Correction }
|
|
//CPA2 Gabriela Dumitrascu 98-04-07
|
|
|
|
case c_WayPoint_PopUp_SetStatic:
|
|
// get selection and father
|
|
CPA_SuperObject *pSelectedObject = M_GetWorld()->GetSingleSelection();
|
|
CPA_SuperObject *pParent = pSelectedObject->GetSuperObjectFather();
|
|
// remove waypoint from hierarchy
|
|
GetInterface()->fn_bDeleteObjectInHierarchy (pSelectedObject, FALSE, FALSE, FALSE, FALSE);
|
|
// update type
|
|
pSelectedObject->SetTypeSO(C_Dynamic);
|
|
((WayPoint *)pSelectedObject->GetObject())->fn_vSetCoordinate(TRUE);
|
|
// update position
|
|
POS_tdstCompletePosition *pParentMatrix = HIE_fn_hGetSuperObjectGlobalMatrix(pParent->GetStruct());
|
|
POS_tdstCompletePosition *pInstanceMatrix = HIE_fn_hGetSuperObjectMatrix(pSelectedObject->GetStruct());
|
|
POS_fn_vMulMatrixMatrix(pInstanceMatrix, pParentMatrix, pInstanceMatrix);
|
|
// reinsert it in hierarchy
|
|
GetInterface()->fn_bInsertObjectInHierarchy (pSelectedObject, GetInterface()->GetSpecificInterface()->GetDynamicRoot(), FALSE, TRUE, FALSE, FALSE);
|
|
break;
|
|
|
|
}
|
|
|
|
m_bMainDll=FALSE;
|
|
}
|
|
|
|
//**************************************************************************************
|
|
//Begin Mircea Dunka 31 Aug 1998 - DialogBar interface
|
|
void Waypoint_Interface::fn_vDefineDlgBarBtnIcon (tde_DlgBarCategory wCategory, tds_DlgBarBtn *_pDlgBarBtn)
|
|
{
|
|
if(wCategory == C_DlgBarCategoryEditor)
|
|
{
|
|
_pDlgBarBtn->hIcon = ::LoadIcon((HINSTANCE)(GetDLLIdentity()->hModule), MAKEINTRESOURCE(IDI_OWP_DLGBAR_ICON));
|
|
CString oCst;
|
|
oCst = "WayPoint";
|
|
if( (M_GetMainApp()) && (M_GetMainApp()->mp_oAppKeyboard) )
|
|
{
|
|
oCst += " (";
|
|
oCst += M_GetMainApp()->mp_oAppKeyboard->mfn_oConvertIniStringToKeyString((const CString*)&CString("Activate Waypoints & Ways Editor"));
|
|
oCst += ")";
|
|
}
|
|
strcpy(_pDlgBarBtn->szToolTip, (char*)(LPCTSTR)oCst);
|
|
_pDlgBarBtn->uID = (UINT)this;
|
|
}
|
|
}
|
|
//end Mircea Dunka 31 Aug 1998
|
|
|
|
|
|
//----------------------- SubMenu
|
|
BOOL Waypoint_Interface::fn_bDefineSubMenu(EDT_SubMenu *_p_oEDTSubMenu)
|
|
{
|
|
if (_p_oEDTSubMenu->GetSubMenuType() == C_SubMenuEditor)
|
|
{
|
|
CString csEntry = "WayPoint";
|
|
csEntry += "\t";
|
|
csEntry += M_GetMainApp()->mp_oAppKeyboard->mfn_oConvertIniStringToKeyString((const CString*)&CString("Activate Waypoints & Ways Editor"));
|
|
|
|
_p_oEDTSubMenu->AddAnEntry(this, (char*)(LPCTSTR)csEntry, c_Waypoint_Submenu_Activate, fn_bIsCurrentEditor());
|
|
return TRUE;
|
|
}
|
|
|
|
else if (_p_oEDTSubMenu->GetSubMenuType() == C_SubMenuPreference)
|
|
{
|
|
_p_oEDTSubMenu->AddAnEntry(this, "Save Dialogs Dimensions", c_Waypoint_Submenu_Preference, FALSE, TRUE);
|
|
return TRUE;
|
|
}
|
|
|
|
return FALSE;
|
|
}
|
|
|
|
|
|
void Waypoint_Interface::_OnSubMenuCommand(EDT_SubMenu *_p_oEDTSubMenu,UINT uiMsgID)
|
|
{
|
|
if (_p_oEDTSubMenu->GetSubMenuType()==C_SubMenuEditor)
|
|
{
|
|
switch ( uiMsgID )
|
|
{
|
|
case c_Waypoint_Submenu_Activate:
|
|
if (fn_bIsCurrentEditor())
|
|
GetMainWorld ( ) -> fn_bCloseEditor ( this );
|
|
else
|
|
GetMainWorld ( ) -> fn_bActivateEditor (this, NULL );
|
|
break;
|
|
}
|
|
}
|
|
else if (_p_oEDTSubMenu->GetSubMenuType()==C_SubMenuPreference)
|
|
{
|
|
|
|
if (uiMsgID==c_Waypoint_Submenu_Preference) fn_vSaveDialogsPreferences ();
|
|
}
|
|
else return;
|
|
}
|
|
|
|
|
|
//-------------------------------------------------------------------
|
|
// Accept Modif ?
|
|
//-------------------------------------------------------------------
|
|
BOOL Waypoint_Interface::fn_bAcceptModifDelete (CPA_List<CPA_SuperObject> *pListObjects, tdeStatus eStatus)
|
|
{
|
|
if (eStatus!=C_AsConcernedDLL) return CPA_ObjectDLLBase::fn_bAcceptModifDelete (pListObjects, eStatus);
|
|
|
|
if (m_bModifDeleteOk) return TRUE;
|
|
|
|
CPA_SuperObject* psoObject;
|
|
POSITION xPos;
|
|
BOOL bLink=FALSE;
|
|
BOOL bWay=FALSE;
|
|
BOOL bReferencedWaypoint=FALSE;
|
|
|
|
// if there is a way in the list, don't delete
|
|
for
|
|
(
|
|
psoObject=pListObjects->GetHeadElement(xPos);
|
|
psoObject;
|
|
psoObject=pListObjects->GetNextElement(xPos)
|
|
)
|
|
{
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
if (psoObject->GetObjectType()==C_ucLink) bLink=TRUE;
|
|
if (psoObject->GetObjectType()==C_ucWay) bWay=TRUE;
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
if (psoObject->GetObjectType()==HIE_C_ulEDT_Waypoint)
|
|
{
|
|
WayPoint* poWaypoint = (WayPoint*)(psoObject->GetObject());
|
|
// waypoint super object must have an object
|
|
ASSERT (poWaypoint);
|
|
if (poWaypoint->fn_bIsReferencedInAI()) bReferencedWaypoint=TRUE;
|
|
}
|
|
}
|
|
|
|
if ((bLink && !bWay) || bReferencedWaypoint) return FALSE;
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
|
|
BOOL Waypoint_Interface::fn_bAcceptModifInsert (CPA_SuperObject *pEdObj, CPA_SuperObject *pParent, tdeStatus eStatus)
|
|
{
|
|
if (m_bModifInsertOk) return TRUE;
|
|
|
|
if (eStatus!=C_AsConcernedDLL) return CPA_ObjectDLLBase::fn_bAcceptModifInsert (pEdObj, pParent, eStatus);
|
|
|
|
if (pEdObj->GetObjectType()==HIE_C_ulEDT_Waypoint) return TRUE;
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
else if (pEdObj->GetObjectType()==C_ucWay)
|
|
{
|
|
if (m_bRefreshWay) return TRUE;
|
|
if (!Way::fn_pGetDialog()->fn_pGetEditWay()) return FALSE; // there's no way to edit
|
|
return Way::fn_pGetDialog()->fn_pGetEditWay()->GetListWaypoint()->GetCount()<=0;
|
|
return NULL;
|
|
}
|
|
else if (pEdObj->GetObjectType()==C_ucLink) return TRUE;
|
|
else if (pEdObj->GetObjectType()==C_ucCursor) return TRUE;
|
|
else if (pEdObj->GetObjectType()==C_ucTangent) return TRUE;
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
else return FALSE;
|
|
}
|
|
|
|
|
|
tdeTypeAnswer Waypoint_Interface::fn_bAcceptSelect (CPA_SuperObject *pEdObj, ACP_tdxIndex xIndex, HIE_tdstPickInfo *pPicking, tdeStatus eStatus)
|
|
{
|
|
if (eStatus!=C_AsConcernedDLL) return CPA_ObjectDLLBase::fn_bAcceptSelect ( pEdObj, xIndex, pPicking, eStatus);
|
|
|
|
if (m_bStopSelect) return C_Refuse;
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
if (pEdObj->GetObjectType()==C_ucTangent)
|
|
{
|
|
m_bStopSelect=TRUE;
|
|
return C_Refuse;
|
|
}
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
return CPA_ObjectDLLBase::fn_bAcceptSelect ( pEdObj, xIndex, pPicking, eStatus);
|
|
}
|
|
|
|
BOOL Waypoint_Interface::fn_bAcceptToRunEngine (void)
|
|
{
|
|
if (!WayPoint::fn_bCheckWaypointCoherence())
|
|
{
|
|
MessageBox ( AfxGetMainWnd()->m_hWnd, "Waypoint editor doesn't allow to run engine.\n\nSome waypoints don't exist\n but are referenced in AI" , "Waypoint editor", MB_OK|MB_ICONSTOP );
|
|
return FALSE;
|
|
}
|
|
|
|
//mis en remarque temporairement par yann
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
if (!Way::fn_bCheckWayCoherence())
|
|
{
|
|
MessageBox ( AfxGetMainWnd()->m_hWnd, "Waypoint editor doesn't allow to run engine.\n\nSome undefined ways are referenced in AI" , "Waypoint editor", MB_OK|MB_ICONSTOP );
|
|
return FALSE;
|
|
}
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
return CPA_ObjectDLLBase::fn_bAcceptToRunEngine ();
|
|
}
|
|
|
|
BOOL Waypoint_Interface::fn_bAcceptToSave (void)
|
|
{
|
|
if (!WayPoint::fn_bCheckWaypointCoherence())
|
|
{
|
|
MessageBox ( AfxGetMainWnd()->m_hWnd, "Waypoint editor doesn't allow to save.\n\nSome waypoints don't exist\n but are referenced in AI" , "Waypoint editor", MB_OK|MB_ICONSTOP );
|
|
return FALSE;
|
|
}
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
//mis en remarque temporairement par yann
|
|
if (!Way::fn_bCheckWayCoherence())
|
|
{
|
|
MessageBox ( AfxGetMainWnd()->m_hWnd, "Waypoint editor doesn't allow to save.\n\nSome undefined ways are referenced in AI" , "Waypoint editor", MB_OK|MB_ICONSTOP );
|
|
return FALSE;
|
|
}
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
return CPA_ObjectDLLBase::fn_bAcceptToSave ();
|
|
}
|
|
|
|
|
|
//-------------------------------------------------------------------
|
|
// MOVES
|
|
//-------------------------------------------------------------------
|
|
|
|
// this function retrieve all the net that must be redraw
|
|
void Waypoint_Interface::fn_vOnBeginMove (CPA_List<CPA_SuperObject> *pListObjects, CPA_List<CPA_SuperObject> *pListConcerned, tdeStatus eStatus)
|
|
{
|
|
if (eStatus!=C_AsConcernedDLL) return;
|
|
|
|
CPA_List<CPA_SuperObject> oListConcerned;
|
|
oListConcerned.AddTail (pListConcerned);
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
// m_ListMovingWay.RemoveAll ();
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
m_ListMovingWP.RemoveAll ();
|
|
CPA_SuperObject* psoObject;
|
|
POSITION xPos;
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
// CPA_List<CPA_SuperObject> * p_oListOfWayPaths = GetInterface()->GetObjectListByType("Way");
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
// search the waypoints that are going to move
|
|
for
|
|
(
|
|
psoObject=oListConcerned.GetHeadElement(xPos);
|
|
psoObject;
|
|
psoObject=oListConcerned.GetNextElement(xPos)
|
|
)
|
|
{
|
|
if (psoObject->GetObjectType()==HIE_C_ulEDT_Waypoint)
|
|
{
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
POSITION xNetPos;
|
|
CPA_SuperObject* poSuperWay;
|
|
|
|
// search the net that contain these waypoints
|
|
for
|
|
(
|
|
poSuperWay=p_oListOfWayPaths->GetHeadElement(xNetPos);
|
|
poSuperWay;
|
|
poSuperWay=p_oListOfWayPaths->GetNextElement(xNetPos)
|
|
)
|
|
if ( ((Way*)(poSuperWay->GetObject()))->fn_bIsRedrawWay ((WayPoint*)(psoObject->GetObject())) )
|
|
{
|
|
// the net is already in the list ?
|
|
POSITION xNetListPos;
|
|
Way* poWay;
|
|
for
|
|
(
|
|
poWay=m_ListMovingWay.GetHeadElement(xNetListPos);
|
|
poWay && (poWay->GetSuperObject())!=poSuperWay;
|
|
poWay=m_ListMovingWay.GetNextElement(xNetListPos)
|
|
);
|
|
// the net is not register in the list
|
|
if (!poWay) m_ListMovingWay.AddTail ((Way*)poSuperWay->GetObject());
|
|
}
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
// Add the WP in the list of the WP that must be compute during the move
|
|
m_ListMovingWP.AddTail ((WayPoint*)psoObject->GetObject());
|
|
|
|
}
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
else if (psoObject->GetObjectType()==C_ucLink)
|
|
{
|
|
POSITION xNetPos;
|
|
CPA_SuperObject* poSuperWay;
|
|
CPA_List<WayPoint> oWaypointList;
|
|
|
|
// we try to move a link -> move the way
|
|
m_poSelectLink = (Link*)(psoObject->GetObject());
|
|
m_poSelectLink->fn_vSelectWay ();
|
|
|
|
for
|
|
(
|
|
poSuperWay=p_oListOfWayPaths->GetHeadElement(xNetPos);
|
|
poSuperWay;
|
|
poSuperWay=p_oListOfWayPaths->GetNextElement(xNetPos)
|
|
)
|
|
|
|
if (m_poSelectLink->fn_pGetWay()->fn_bConnect ( (Way*)(poSuperWay->GetObject()), &oWaypointList ) )
|
|
{
|
|
m_ListMovingWay.AddTail ( (Way*)(poSuperWay->GetObject()) );
|
|
m_ListMovingWP.AddTail ( &oWaypointList );
|
|
}
|
|
}
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
}
|
|
}
|
|
|
|
void Waypoint_Interface::fn_vOnMoving (CPA_List<CPA_SuperObject> *pListObjects, CPA_List<CPA_SuperObject> *pListConcerned, tdeStatus eStatus)
|
|
{
|
|
if (eStatus!=C_AsConcernedDLL) return;
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
// Way* poWay;
|
|
WayPoint* poWP;
|
|
POSITION /*xNetPosition, */xWPPosition;
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
// compute the moving WP
|
|
for
|
|
(
|
|
poWP=m_ListMovingWP.GetHeadElement (xWPPosition);
|
|
poWP;
|
|
poWP=m_ListMovingWP.GetNextElement (xWPPosition)
|
|
)
|
|
poWP->fn_vComputeMotorStructure ();
|
|
|
|
// Shaitan Correction {
|
|
if (m_pSelectedGraph && (m_eDisplayMode != E_dm_ShowNothing))
|
|
{
|
|
CPA_SuperObject *pSupObj;
|
|
POSITION pos;
|
|
|
|
for (pSupObj = pListConcerned->GetHeadElement(pos); pSupObj; pSupObj = pListObjects->GetNextElement(pos))
|
|
{
|
|
if (pSupObj->GetObjectType()==HIE_C_ulEDT_Waypoint)
|
|
m_pSelectedGraph->fn_vUpdateConnections((WayPoint*) pSupObj->GetObject(), TRUE);
|
|
}
|
|
}
|
|
//End Shaitan Correction }
|
|
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
// redraw the links
|
|
for
|
|
(
|
|
poWay=m_ListMovingWay.GetHeadElement (xNetPosition);
|
|
poWay;
|
|
poWay=m_ListMovingWay.GetNextElement (xNetPosition)
|
|
)
|
|
poWay->fn_vRefresh (FALSE,FALSE);
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
|
|
}
|
|
|
|
|
|
void Waypoint_Interface::fn_vOnModifMove (CPA_List<EDT_SavePos> *pListObjects, CPA_List<EDT_SaveGlobalPos> *pListConcerned, tdeTypeModif eType, tdeStatus eStatus)
|
|
{
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
POSITION xWPPos/*, xNetPos*/;
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
if (eStatus!=C_AsConcernedDLL) return;
|
|
|
|
CPA_SuperObject *p_oSuperObject;
|
|
EDT_SaveGlobalPos *p_oSaveGlobalPos;
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
// Way* poWay;
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
for
|
|
(
|
|
p_oSaveGlobalPos = pListConcerned->GetHeadElement(xWPPos);
|
|
xWPPos;
|
|
p_oSaveGlobalPos = pListConcerned->GetNextElement(xWPPos)
|
|
)
|
|
if (p_oSaveGlobalPos)
|
|
{
|
|
p_oSuperObject = p_oSaveGlobalPos->m_pObject;
|
|
|
|
if (p_oSuperObject->GetObjectType()==HIE_C_ulEDT_Waypoint)
|
|
{
|
|
// notify script
|
|
((WayPoint*)(p_oSuperObject->GetObject()))->fn_vNotifySave();
|
|
|
|
// compute the absolute matrix only if it's not already done by
|
|
// the hiearchie editor.
|
|
if (eType != C_EDTDo) fn_vComputeAbsoluteMatrix (p_oSuperObject);
|
|
|
|
// change the engine structure
|
|
((WayPoint*)(p_oSuperObject->GetObject()))->fn_vComputeMotorStructure ();
|
|
|
|
((WayPoint*)(p_oSuperObject->GetObject()))->fn_vDraw(TRUE,FALSE);
|
|
|
|
// Shaitan Correction {
|
|
if (m_pSelectedGraph && (m_eDisplayMode != E_dm_ShowNothing))
|
|
m_pSelectedGraph->fn_vUpdateConnections((WayPoint*) p_oSuperObject->GetObject(), TRUE);
|
|
//End Shaitan Correction }
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
for
|
|
(
|
|
poWay = Way::fn_poGetListOfWay()->GetHeadElement(xNetPos);
|
|
poWay;
|
|
poWay = Way::fn_poGetListOfWay()->GetNextElement(xNetPos)
|
|
)
|
|
if (poWay->fn_bIsRedrawWay ((WayPoint*)p_oSuperObject->GetObject()) ) poWay->fn_vRefresh (TRUE,FALSE);
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
}
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
else if (p_oSuperObject->GetObjectType()==C_ucWay)
|
|
{
|
|
// stop the selection
|
|
GetInterface()->fn_vCancelCurrentSelection ();
|
|
if (m_poSelectLink) GetInterface()->fn_vAddSelectedObject ( m_poSelectLink->GetSuperObject(), FALSE);
|
|
m_poSelectLink=NULL;
|
|
}
|
|
else if (p_oSuperObject->GetObjectType()==C_ucLink)
|
|
{
|
|
|
|
|
|
// POSITION xNetPos;
|
|
// CPA_SuperObject* poSuperWay;
|
|
// CPA_List<WayPoint> oWaypointList;
|
|
// CPA_List<CPA_SuperObject> * p_oListOfWayPaths = GetInterface()->GetObjectListByType("Way");
|
|
|
|
|
|
// we try to move a link -> move the way
|
|
Link* poLink = (Link*)(p_oSuperObject->GetObject());
|
|
|
|
// for
|
|
// (
|
|
// poSuperWay=p_oListOfWayPaths->GetHeadElement(xNetPos);
|
|
// poSuperWay;
|
|
// poSuperWay=p_oListOfWayPaths->GetNextElement(xNetPos)
|
|
// )
|
|
|
|
// if (poLink->fn_pGetWay()->fn_bConnect ( (Way*)(poSuperWay->GetObject()), &oWaypointList ) )
|
|
// {
|
|
// ((Way*)(poSuperWay->GetObject()))->fn_vRefresh (FALSE,FALSE);
|
|
|
|
// }
|
|
poLink->fn_vSetDraw (TRUE);
|
|
|
|
poLink->fn_pGetWay()->fn_vRefresh (FALSE,FALSE);
|
|
|
|
}
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
}
|
|
|
|
GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
|
|
// Begin Silviu Simen List by Sector and type
|
|
m_p_oDialogList->fn_vUpdateSelection(E_lrm_ReinitList);
|
|
// End Silviu Simen List by Sector and type
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
|
|
//------------------------------------------------- selection
|
|
BOOL Waypoint_Interface::fn_bAcceptAsParent (CPA_BaseObject *pChild, CPA_BaseObject *pParent)
|
|
{
|
|
if (pChild->GetDataType()==HIE_C_ulEDT_Waypoint) return TRUE;
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
else if (pChild->GetDataType()==C_ucWay) return TRUE;
|
|
else if (pChild->GetDataType()==C_ucLink) return TRUE;
|
|
else if (pChild->GetDataType()==C_ucCursor) return TRUE;
|
|
else if (pChild->GetDataType()==C_ucTangent) return TRUE;
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
else return FALSE;
|
|
}
|
|
|
|
BOOL Waypoint_Interface::fn_bAcceptModifRotate (CPA_List<CPA_SuperObject> *pListObjects, tdeStatus eStatus)
|
|
{
|
|
// Shaitan Correction {
|
|
CPA_SuperObject *pSupObj;
|
|
POSITION pos;
|
|
|
|
if (eStatus == C_AsConcernedDLL)
|
|
return FALSE;
|
|
|
|
if (eStatus == C_AsCurrentEditor)
|
|
{
|
|
for (pSupObj = pListObjects->GetHeadElement(pos); pSupObj; pSupObj = pListObjects->GetNextElement(pos))
|
|
{
|
|
if (pSupObj->GetObject() && (pSupObj->GetObject()->GetName() == "Connection"))
|
|
return FALSE;
|
|
}
|
|
}
|
|
|
|
return TRUE;
|
|
//End Shaitan Correction }
|
|
}
|
|
|
|
BOOL Waypoint_Interface::fn_bAcceptModifTranslate (CPA_List<CPA_SuperObject> *pListObjects, tdeStatus eStatus)
|
|
{
|
|
// Shaitan Correction {
|
|
CPA_SuperObject *pSupObj;
|
|
POSITION pos;
|
|
if (eStatus == C_AsCurrentEditor)
|
|
{
|
|
for (pSupObj = pListObjects->GetHeadElement(pos); pSupObj; pSupObj = pListObjects->GetNextElement(pos))
|
|
{
|
|
if (pSupObj->GetObject() && (pSupObj->GetObject()->GetName() == "Connection"))
|
|
return FALSE;
|
|
}
|
|
}
|
|
//End Shaitan Correction }
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
POSITION xPos;
|
|
CPA_SuperObject *p_oSuperObject;
|
|
for
|
|
(
|
|
p_oSuperObject = pListObjects->GetHeadElement(xPos);
|
|
p_oSuperObject;
|
|
p_oSuperObject = pListObjects->GetNextElement(xPos)
|
|
)
|
|
{
|
|
if (p_oSuperObject->GetObjectType()==C_ucTangent) return FALSE;
|
|
}
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
return TRUE;
|
|
}
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------
|
|
// OnModif
|
|
//-------------------------------------------------------------------
|
|
void Waypoint_Interface::fn_vOnModifDelete (CPA_List<EDT_SaveParents> *pListObjects, tdeTypeModif eType, tdeStatus eStatus)
|
|
{
|
|
// CPA2 Gabriela Dumitrascu 98-04-27
|
|
// Shaitan Correction {
|
|
if ((eStatus == C_AsChildOwner)&&(eType == C_EDTDo))
|
|
//End Shaitan Correction }
|
|
{
|
|
POSITION xDeletedPos;
|
|
CPA_SuperObject *p_oSuperObject;
|
|
EDT_SaveParents *p_stSaveParents;
|
|
for
|
|
(
|
|
p_stSaveParents = pListObjects->GetHeadElement(xDeletedPos),
|
|
p_oSuperObject = p_stSaveParents ? p_stSaveParents->m_pChild : NULL;
|
|
p_oSuperObject;
|
|
p_stSaveParents = pListObjects->GetNextElement(xDeletedPos),
|
|
p_oSuperObject = p_stSaveParents ? p_stSaveParents->m_pChild : NULL
|
|
)
|
|
{
|
|
if (p_oSuperObject->GetObject()->GetName() == "Connection")
|
|
// Shaitan Correction {
|
|
{
|
|
Connection *pConnection = (Connection *) p_oSuperObject->GetObject();
|
|
WayPoint *pSrcWP = pConnection->GetSrcWayPoint();
|
|
WayPoint *pDstWP = pConnection->GetDstWayPoint();
|
|
pConnection->GetGraph()->fn_vRemoveArcOfNode(pSrcWP, pDstWP, TRUE);
|
|
if ((m_bSymetricMode) && (pConnection->GetGraph()->GetGraphicConnection(pDstWP, pSrcWP) != NULL))
|
|
pConnection->GetGraph()->fn_vRemoveArcOfNode(pDstWP, pSrcWP, TRUE);
|
|
}
|
|
//Graph::fn_pGetDialog()->fn_vDeleteConnection((Connection*)p_oSuperObject->GetObject());
|
|
//End Shaitan Correction }
|
|
}
|
|
}
|
|
// End CPA2 Gabriela Dumitrascu 98-04-27
|
|
|
|
if (eStatus!=C_AsConcernedDLL) return;
|
|
if (m_bSkipOnModifDelete) return;
|
|
|
|
if (!m_bRefreshWay) fn_vRefreshHierarchyList ();
|
|
|
|
CPA_Interface *p_oEditor;
|
|
POSITION xDeletedPos, xNetPos;
|
|
CPA_SuperObject *p_oSuperObject;
|
|
EDT_SaveParents *p_stSaveParents;
|
|
|
|
// Script notication
|
|
if (!m_bModifDeleteOk)
|
|
{
|
|
POSITION xPos;
|
|
EDT_SaveParents* pstSaveParent;
|
|
for
|
|
(
|
|
pstSaveParent = pListObjects->GetHeadElement(xPos);
|
|
pstSaveParent;
|
|
pstSaveParent = pListObjects->GetNextElement(xPos)
|
|
)
|
|
if (pstSaveParent->m_pChild->GetObjectType()==HIE_C_ulEDT_Waypoint)
|
|
{
|
|
// Shaitan Correction {
|
|
WayPoint *pWayPoint = (WayPoint*)pstSaveParent->m_pChild->GetObject();
|
|
|
|
// unregister WP from link table (for engine)
|
|
if (eType==C_EDTUndo)
|
|
{
|
|
SCR_tdst_Link_Value *pValue = SCR_fnp_st_Link_SearchValue(WP_fnp_WayPoint_GetLinkTable(), (unsigned long) pWayPoint->GetEngineStruct());
|
|
if (!pValue)
|
|
{
|
|
SCR_fnp_st_Link_SetValue (WP_fnp_WayPoint_GetLinkTable(), (char*)(LPCSTR)pWayPoint->GetCompleteSectionName(), (unsigned long)pWayPoint->GetEngineStruct());
|
|
}
|
|
}
|
|
else
|
|
{
|
|
SCR_tdst_Link_Value *pValue = SCR_fnp_st_Link_SearchValue(WP_fnp_WayPoint_GetLinkTable(), (unsigned long) pWayPoint->GetEngineStruct());
|
|
if (pValue)
|
|
{
|
|
SCR_fn_v_Link_DeleteEntry(WP_fnp_WayPoint_GetLinkTable(), pValue);
|
|
}
|
|
}
|
|
|
|
// unvalidate waypoint
|
|
if (eType==C_EDTUndo) pWayPoint->fn_bValidate ();
|
|
else pWayPoint->fn_bUnValidate ();
|
|
|
|
// notification
|
|
if (eType==C_EDTUndo) pWayPoint->fn_vNotifyRestore ();
|
|
else pWayPoint->fn_vNotifyUnSave ();
|
|
|
|
// coherence manager
|
|
if (eType==C_EDTUndo) g_oCoherenceManager.m_fn_vRestoreObject (pWayPoint);
|
|
else g_oCoherenceManager.m_fn_vDeleteObject (pWayPoint);
|
|
|
|
// list of WPs
|
|
if (eType==C_EDTUndo) WayPoint::ms_oListOfWaypoint.AddTail(pWayPoint);
|
|
else
|
|
{
|
|
POSITION DeletePos = WayPoint::ms_oListOfWaypoint.Find(pWayPoint);
|
|
WayPoint::ms_oListOfWaypoint.RemoveAt (DeletePos);
|
|
}
|
|
//End Shaitan Correction }
|
|
}
|
|
|
|
}
|
|
|
|
// there's nothing to do in other cases because the stack of the ask manger work for us
|
|
if (eType == C_EDTDo)
|
|
{
|
|
// retrieve the editor instance
|
|
p_oEditor = this->GetInterface();
|
|
|
|
if (p_oEditor)
|
|
{
|
|
// get the list of WayPaths
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
// CPA_List<Way> * p_oListOfWay = Way::fn_poGetListOfWay ();
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
CPA_List<Graph> * p_oListOfGraph = Graph::fn_poGetListOfGraph ();
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
// if (p_oListOfWay)
|
|
if (p_oListOfGraph)
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
// scan the list of waypoints that are deleted
|
|
{
|
|
// if we insert a way for display -> no refresh
|
|
for
|
|
(
|
|
p_stSaveParents = pListObjects->GetHeadElement(xDeletedPos),
|
|
p_oSuperObject = p_stSaveParents ? p_stSaveParents->m_pChild : NULL;
|
|
p_oSuperObject;
|
|
p_stSaveParents = pListObjects->GetNextElement(xDeletedPos),
|
|
p_oSuperObject = p_stSaveParents ? p_stSaveParents->m_pChild : NULL
|
|
)
|
|
{
|
|
// for the waypoint editor: delete = empty
|
|
if (m_bRefreshWay) return;
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
if (p_oSuperObject->GetRealTypeName()=="Way" && !m_bRefreshWay)
|
|
{
|
|
Way* poWay = (Way*)p_oSuperObject->GetObject();
|
|
|
|
fn_bComputeRealWay (&poWay);
|
|
poWay->fn_vEmptyWay ();
|
|
poWay->GetSuperObject()->RemoveAll ();
|
|
poWay->fn_vNotifyAllEdtList ();
|
|
return;
|
|
}
|
|
|
|
// remove the deleted wp from way using it
|
|
else
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
if (p_oSuperObject->GetRealTypeName()=="Waypoint")
|
|
{
|
|
if (WayPoint::fn_pGetDialog()->fn_pGetEditWP()==p_oSuperObject->GetObject())
|
|
WayPoint::fn_pGetDialog()->fn_vEdit (NULL);
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
Way* poWay;
|
|
for
|
|
(
|
|
poWay = p_oListOfWay->GetHeadElement(xNetPos);
|
|
poWay;
|
|
poWay = p_oListOfWay->GetNextElement(xNetPos)
|
|
)
|
|
poWay->fn_vRemoveWayPoint ((WayPoint*) p_oSuperObject->GetObject());
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
//ANNECY Shaitan Correction {
|
|
Graph* poGraph;
|
|
for
|
|
(
|
|
poGraph = p_oListOfGraph->GetHeadElement(xNetPos);
|
|
poGraph;
|
|
poGraph = p_oListOfGraph->GetNextElement(xNetPos)
|
|
)
|
|
{
|
|
WayPoint* poWP = (WayPoint*) p_oSuperObject->GetObject();
|
|
int iNode = poGraph->fn_iGetNodeOfWayPoint(poWP->GetStruct());
|
|
if (iNode != -1)
|
|
{
|
|
// Shaitan Correction {
|
|
// poGraph->fn_bRemoveNode(iNode, TRUE);
|
|
poGraph->fn_bRemoveNode(poWP, TRUE);
|
|
//CPA2 Gabriela Dumitrascu 98-04-21
|
|
// Graph::fn_pGetDialog()->m_WPList.DeleteString(iNode);
|
|
// Graph::fn_pGetDialog()->fn_vRefreshWPList(Graph::fn_pGetDialog()->m_GraphNameList.GetCurSel());
|
|
//End CPA2 Gabriela Dumitrascu 98-04-21
|
|
}
|
|
}
|
|
// Graph::fn_pGetDialog()->fn_vDeleteWP();
|
|
//End Shaitan Correction }
|
|
//ENDANNECY Shaitan Correction }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
void Waypoint_Interface::fn_vOnModifInsert (CPA_SuperObject *pEdObj, CPA_SuperObject *pParent, tdstPosition *p_stPosition, tdeTypeModif eType, tdeStatus eStatus)
|
|
{
|
|
// if the DLL is not concerned, we don't stay here anylonger
|
|
if (eStatus!=C_AsConcernedDLL || m_bSkipOnModifInsert) return;
|
|
|
|
|
|
if (!m_bRefreshWay) fn_vRefreshHierarchyList ();
|
|
|
|
if (pEdObj->GetObjectType()==HIE_C_ulEDT_Waypoint)
|
|
{
|
|
|
|
// Shaitan Correction {
|
|
WayPoint *pWayPoint = (WayPoint*)pEdObj->GetObject();
|
|
|
|
// unregister WP from link table (for engine)
|
|
if (eType!=C_EDTUndo)
|
|
{
|
|
SCR_tdst_Link_Value *pValue = SCR_fnp_st_Link_SearchValue(WP_fnp_WayPoint_GetLinkTable(), (unsigned long) pWayPoint->GetEngineStruct());
|
|
if (!pValue)
|
|
{
|
|
SCR_fnp_st_Link_SetValue (WP_fnp_WayPoint_GetLinkTable(), (char*)(LPCSTR)pWayPoint->GetCompleteSectionName(), (unsigned long)pWayPoint->GetEngineStruct());
|
|
}
|
|
}
|
|
else
|
|
{
|
|
SCR_tdst_Link_Value *pValue = SCR_fnp_st_Link_SearchValue(WP_fnp_WayPoint_GetLinkTable(), (unsigned long) pWayPoint->GetEngineStruct());
|
|
if (pValue)
|
|
{
|
|
SCR_fn_v_Link_DeleteEntry(WP_fnp_WayPoint_GetLinkTable(), pValue);
|
|
}
|
|
}
|
|
|
|
// unvalidate waypoint
|
|
if (eType!=C_EDTUndo) pWayPoint->fn_bValidate ();
|
|
else pWayPoint->fn_bUnValidate ();
|
|
|
|
// notification
|
|
if (eType==C_EDTRedo) pWayPoint->fn_vNotifyRestore ();
|
|
else if (eType==C_EDTUndo) pWayPoint->fn_vNotifyUnSave ();
|
|
|
|
// coherence manager
|
|
if (eType==C_EDTRedo) g_oCoherenceManager.m_fn_vRestoreObject (pWayPoint);
|
|
else if (eType==C_EDTUndo) g_oCoherenceManager.m_fn_vDeleteObject (pWayPoint);
|
|
|
|
// list of WPs
|
|
if (eType!=C_EDTUndo)
|
|
{
|
|
POSITION InsertPos = WayPoint::ms_oListOfWaypoint.Find(pWayPoint);
|
|
if (!InsertPos)
|
|
WayPoint::ms_oListOfWaypoint.AddTail(pWayPoint);
|
|
}
|
|
else
|
|
{
|
|
POSITION DeletePos = WayPoint::ms_oListOfWaypoint.Find(pWayPoint);
|
|
if (DeletePos)
|
|
WayPoint::ms_oListOfWaypoint.RemoveAt (DeletePos);
|
|
}
|
|
//End Shaitan Correction }
|
|
((WayPoint*)(pEdObj->GetObject()))->fn_vSetFather ( pParent );
|
|
|
|
((WayPoint*)(pEdObj->GetObject()))->fn_vDraw(!g_bBeforeEditor,FALSE);
|
|
if (pParent != GetInterface()->GetSpecificInterface()->GetDynamicRoot())
|
|
((WayPoint*)(pEdObj->GetObject()))->fn_vSetDynamicFather ( pParent );
|
|
|
|
|
|
if (m_bComputeEngineWaypoint)
|
|
((WayPoint*)(pEdObj->GetObject()))->fn_vComputeMotorStructure ();
|
|
|
|
fn_vEdit ((WayPoint*)(pEdObj->GetObject()));
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
// if we drag the waypoint on a way, we insert the waypoint in the way
|
|
if ( ((WayPoint*)(pEdObj->GetObject()))->fn_bGetCoordinate() )
|
|
{
|
|
if (p_stPosition)
|
|
{
|
|
CPA_SuperObject* psoObject=fn_pExplorePicking (p_stPosition->xIndex, p_stPosition->a_stPickInfo, C_ucLink);
|
|
|
|
if (psoObject)
|
|
{
|
|
CPA_SuperObject* psoParent = (CPA_SuperObject*)((CPA_SuperObject*)psoObject->GetParent());
|
|
MTH3D_tdstVector v = (p_stPosition->a_stPickInfo)->stPickedObject.aDEF_stDataOfElement[0].stHit;
|
|
((Way*)(psoParent->GetObject()))->fn_vModeInsert (((Link*)(psoObject->GetObject())), &v );
|
|
((Way*)(psoParent->GetObject()))->fn_vInsertWayPoint((WayPoint*)(pEdObj->GetObject()));
|
|
((Way*)(psoParent->GetObject()))->fn_vModeNormal();
|
|
}
|
|
}
|
|
}
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
}
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
else if (pEdObj->GetObjectType()==C_ucWay)
|
|
{
|
|
if (m_bRefreshWay) return;
|
|
|
|
fn_vRefreshList ();
|
|
|
|
MTH3D_tdstVector v;
|
|
fn_vComputeAbsoluteMatrix (pEdObj);
|
|
m_pElasticWay = (Way*)(pEdObj->GetObject());
|
|
|
|
|
|
if (eType==C_EDTUndo)
|
|
{
|
|
m_pElasticWay->fn_vAddAtTheEnd ();
|
|
return;
|
|
}
|
|
|
|
|
|
GEO_tdxHandleToMatrix hAbsoluteMatrix = HIE_fn_hGetSuperObjectGlobalMatrix (pEdObj->GetStruct());
|
|
POS_fn_vGetTranslationVector
|
|
(
|
|
hAbsoluteMatrix,
|
|
&v
|
|
);
|
|
CPA_SuperObject* psoWP = fn_pExplorePicking (p_stPosition->xIndex, p_stPosition->a_stPickInfo, C_ucWaypoint);
|
|
|
|
if (psoWP)
|
|
{
|
|
if ( !m_pElasticWay->fn_vInsertWayPoint((WayPoint*)(psoWP->GetObject())) )
|
|
{
|
|
// delete object from hierarchy
|
|
if (pEdObj->GetParent()) GetInterface()->fn_bDeleteObjectInHierarchy ( pEdObj, FALSE, FALSE, FALSE, FALSE );
|
|
m_pElasticWay=NULL;
|
|
return;
|
|
}
|
|
}
|
|
else
|
|
m_pElasticWay->fn_vInsertNewWayPoint ( &v );
|
|
|
|
// set the edit way
|
|
fn_vEdit (m_pElasticWay);
|
|
|
|
// init the mouse translation
|
|
((DEV_ViewPort3D*) (GetInterface()->GetMultiDevice()->GetFocusDevice()->GetViewPort()))->InitMouseMove (&v, &(p_stPosition->stPos.stPos2D));
|
|
|
|
m_pElasticWay->fn_vModeAdd (&v);
|
|
|
|
m_bCreateMode=TRUE;
|
|
|
|
}
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
}
|
|
|
|
|
|
//---------------- Edition
|
|
void Waypoint_Interface::fn_vEdit (WayPoint* poWP)
|
|
{
|
|
if (poWP)
|
|
{
|
|
WayPoint::fn_pGetDialog()->fn_vEdit (poWP);
|
|
m_p_oDialogList->fn_vUpdateSelection (E_lrm_ChangeSelection);
|
|
}
|
|
}
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
void Waypoint_Interface::fn_vEdit ( Way* p_oWay, int iWpPos )
|
|
{
|
|
if (p_oWay->GetSuperObject()->fn_bIsUnderObject ( GetInterface()->GetSpecificInterface()->GetDynamicRoot() ) )
|
|
{
|
|
BOOL bUpDateList=TRUE;
|
|
if (m_poWayList)
|
|
if (p_oWay->fn_bWayInEdtList(m_poWayList)) bUpDateList=FALSE;
|
|
|
|
if ( bUpDateList || !m_poWayList || !m_poActor || !m_poModel || !m_poFamilly )
|
|
{
|
|
m_poWayList = p_oWay->fn_pGetEdtList();
|
|
m_poActor = fn_pGetActorUsingAList (m_poWayList);
|
|
m_poModel = m_poActor->GetOwner();
|
|
m_poFamilly = m_poModel->GetOwner();
|
|
fn_vEditListOfWay (m_poActor);
|
|
}
|
|
|
|
GetInterface()->fn_vCancelCurrentSelection (FALSE);
|
|
if (!m_bStopSelect) GetInterface()->fn_vAddSelectedObject (p_oWay->GetSuperObject());
|
|
}
|
|
Way::fn_pGetDialog()->fn_vEdit (p_oWay,iWpPos);
|
|
m_p_oDialogList->fn_vUpdateSelection (E_lrm_ChangeSelection);
|
|
}
|
|
|
|
void Waypoint_Interface::fn_vEdit ( Link* p_oLink )
|
|
{
|
|
p_oLink->fn_vEdit ();
|
|
if (p_oLink->fn_bIsRotationMode()) Link::fn_pGetRotationDialog()->fn_vEdit (p_oLink);
|
|
else Link::fn_pGetDialog()->fn_vEdit (p_oLink);
|
|
}
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
void Waypoint_Interface::fn_vRefreshDisplayControl (void)
|
|
{
|
|
((EditDia*) m_p_oSplitFrameWP->m_fn_p_oGetPane(1))->fn_vRefresh();
|
|
}
|
|
|
|
|
|
void Waypoint_Interface::fn_vRefreshScreen (void)
|
|
{
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
// Way::fn_vRefreshWay ();
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
WayPoint::fn_vRefreshWaypoint ();
|
|
//ROMTEAM Networks (Gabriela Dumitrascu 02/03/98)
|
|
Graph::fn_vRefreshGraph ();
|
|
//ENDROMTEAM Networks (Gabriela Dumitrascu)
|
|
GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
|
|
}
|
|
|
|
|
|
|
|
|
|
//----------------- Tools
|
|
// compute all the absolute matrix from World to given super-object
|
|
void Waypoint_Interface::fn_vComputeAbsoluteMatrix (CPA_SuperObject* psoWP)
|
|
{
|
|
CPA_List<CPA_SuperObject> ListObject;
|
|
POSITION xPos;
|
|
CPA_SuperObject* psObj;
|
|
POS_tdstCompletePosition stIdentityMatrix;
|
|
GEO_tdxHandleToMatrix hFatherMatrix;
|
|
|
|
POS_fn_vSetIdentityMatrix ( &stIdentityMatrix );
|
|
hFatherMatrix = &stIdentityMatrix;
|
|
ListObject.RemoveAll ();
|
|
|
|
// list of the tree from object to world
|
|
for ( psObj=psoWP; psObj; psObj=(CPA_SuperObject*)psObj->GetParent() )
|
|
ListObject.AddTail ( psObj );
|
|
|
|
// we go from world to object and compute all the absolute matrix
|
|
for ( psObj=ListObject.GetTailElement(xPos); psObj; psObj=ListObject.GetPrevElement(xPos) )
|
|
{
|
|
if (psObj->GetStruct())
|
|
{
|
|
GEO_tdxHandleToMatrix hAbsoluteMatrix = HIE_fn_hGetSuperObjectGlobalMatrix (psObj->GetStruct());
|
|
GEO_tdxHandleToMatrix hRelativeMatrix = HIE_fn_hGetSuperObjectMatrix (psObj->GetStruct());
|
|
|
|
POS_fn_vMulMatrixMatrix
|
|
(
|
|
hAbsoluteMatrix,
|
|
hFatherMatrix,
|
|
hRelativeMatrix
|
|
);
|
|
hFatherMatrix = HIE_fn_hGetSuperObjectGlobalMatrix (psObj->GetStruct());
|
|
}
|
|
}
|
|
|
|
// clean the list
|
|
ListObject.RemoveAll ();
|
|
}
|
|
|
|
void Waypoint_Interface::fn_vComputeNewRelativeMatrix(HIE_tdxHandleToSuperObject _hSprObj)
|
|
{
|
|
GEO_tdxHandleToMatrix hMatrix;
|
|
POS_tdstCompletePosition LocalMatrix;
|
|
hMatrix=&LocalMatrix;
|
|
POS_fn_vSetIdentityMatrix(hMatrix);
|
|
|
|
|
|
POS_fn_vInvertMatrix(hMatrix, HIE_M_xGetSuperObjectMember(HIE_fn_hGetSuperObjectFather(_hSprObj),hGlobalMatrix));
|
|
|
|
|
|
POS_fn_vMulMatrixMatrix(HIE_M_xGetSuperObjectMember(_hSprObj, hLocalMatrix), hMatrix, HIE_M_xGetSuperObjectMember(_hSprObj, hGlobalMatrix));
|
|
}
|
|
|
|
|
|
void Waypoint_Interface::fn_vComputeRelativeMatrix (CPA_SuperObject* poSuperObject, CPA_SuperObject* poParentSuperObject)
|
|
{
|
|
GEO_tdxHandleToMatrix hMatrix;
|
|
POS_tdstCompletePosition LocalMatrix;
|
|
|
|
HIE_tdxHandleToSuperObject hSuperObject = poSuperObject->GetStruct();
|
|
HIE_tdxHandleToSuperObject hParentSuperObject = poParentSuperObject->GetStruct();
|
|
|
|
hMatrix=&LocalMatrix;
|
|
POS_fn_vSetIdentityMatrix(hMatrix);
|
|
POS_fn_vInvertMatrix(hMatrix, HIE_M_xGetSuperObjectMember(hParentSuperObject,hGlobalMatrix));
|
|
POS_fn_vMulMatrixMatrix(HIE_M_xGetSuperObjectMember(hSuperObject, hLocalMatrix), hMatrix, HIE_M_xGetSuperObjectMember(hSuperObject, hGlobalMatrix));
|
|
}
|
|
|
|
|
|
|
|
void Waypoint_Interface::fn_vDrawAllWP (void)
|
|
{
|
|
// change mouse cursor to wait
|
|
fn_vSetCursor ( IDC_WAIT );
|
|
|
|
// redraw all the WP in the world
|
|
// first get the list
|
|
POSITION xPos;
|
|
CPA_SuperObject* pSuperWP;
|
|
CPA_List<CPA_SuperObject> *p_oListOfWP;
|
|
p_oListOfWP = GetInterface()->GetObjectListByType("Waypoint");
|
|
|
|
for
|
|
(
|
|
pSuperWP = p_oListOfWP->GetHeadElement(xPos);
|
|
pSuperWP;
|
|
pSuperWP = p_oListOfWP->GetNextElement(xPos)
|
|
)
|
|
((WayPoint*)(pSuperWP->GetObject()))->fn_vDraw(FALSE);
|
|
GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
|
|
|
|
// restore cursor
|
|
fn_vSetCursor ( IDC_POINTER_WP );
|
|
}
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
// Window preferences
|
|
//--------------------------------------------------------------------
|
|
void Waypoint_Interface::fn_vSaveDialogsPreferences (void)
|
|
{
|
|
CString csFileName;
|
|
CString csDimension;
|
|
BOOL bRes = TRUE;
|
|
|
|
csFileName = M_GetMainApp()->m_csEditorDataPath + "Objects\\" + C_szWaypointIniFile;
|
|
|
|
// left frame width
|
|
csDimension.Format("%ld", m_p_oSplitFrameWP->m_oCurPos.right - m_p_oSplitFrameWP->m_oCurPos.left);
|
|
bRes &= WritePrivateProfileString ("Preference", "Waypoint Left Frame Width", (char*)(LPCSTR)csDimension, (char*)(LPCSTR)csFileName);
|
|
|
|
csDimension.Format("%ld", m_p_oSplitFrameWP->GetPaneSize(0));
|
|
bRes &= WritePrivateProfileString ("Preference", "DialogList Dimension", (char*)(LPCSTR)csDimension, (char*)(LPCSTR)csFileName);
|
|
csDimension.Format("%ld", m_p_oSplitFrameWP->GetPaneSize(1));
|
|
bRes &= WritePrivateProfileString ("Preference", "Display Control Dimension", (char*)(LPCSTR)csDimension, (char*)(LPCSTR)csFileName);
|
|
csDimension.Format("%ld", m_p_oSplitFrameWP->GetPaneSize(2));
|
|
bRes &= WritePrivateProfileString ("Preference", "Waypoint Edit Dimension", (char*)(LPCSTR)csDimension, (char*)(LPCSTR)csFileName);
|
|
/*
|
|
csDimension.Format("%ld", m_p_oSplitFrameWP->GetPaneSize(3));
|
|
bRes &= WritePrivateProfileString ("Preference", "Link Dimension", (char*)(LPCSTR)csDimension, (char*)(LPCSTR)csFileName);
|
|
csDimension.Format("%ld", m_p_oSplitFrameWP->GetPaneSize(4));
|
|
bRes &= WritePrivateProfileString ("Preference", "Orientation Dimension", (char*)(LPCSTR)csDimension, (char*)(LPCSTR)csFileName);
|
|
csDimension.Format("%ld", m_p_oSplitFrameWP->GetPaneSize(5));
|
|
bRes &= WritePrivateProfileString ("Preference", "Way Dimension", (char*)(LPCSTR)csDimension, (char*)(LPCSTR)csFileName);
|
|
*/
|
|
//ROMTEAM Networks (Gabriela Dumitrascu 02/03/98)
|
|
csDimension.Format("%ld", m_p_oSplitFrameWP->GetPaneSize(3/*6*/));
|
|
bRes &= WritePrivateProfileString ("Preference", "Network Edit Dimension", (char*)(LPCSTR)csDimension, (char*)(LPCSTR)csFileName);
|
|
//ENDROMTEAM Networks (Gabriela Dumitrascu)
|
|
|
|
// message
|
|
if (!bRes)
|
|
M_GetMainWnd()->UpdateStatus("Waypoint Editor cannot save your preferences. Waypoint.ini may have a ReadOnly status ?", C_STATUSPANE_INFOS, C_STATUS_WARNING);
|
|
else
|
|
M_GetMainWnd()->UpdateStatus("Preferences saved", C_STATUSPANE_INFOS, C_STATUS_NORMAL);
|
|
}
|
|
|
|
|
|
void Waypoint_Interface::fn_vSwapLinkDialog ( BOOL bOrientationMode )
|
|
{
|
|
int iSize = m_p_oSplitFrameWP->GetPaneSize(3) + m_p_oSplitFrameWP->GetPaneSize(4);
|
|
|
|
if (bOrientationMode)
|
|
{
|
|
m_p_oSplitFrameWP->SetPaneSize (2,m_p_oSplitFrameWP->GetPaneSize(2)+11);
|
|
m_p_oSplitFrameWP->SetPaneSize (3,0);
|
|
m_p_oSplitFrameWP->SetPaneSize (4,iSize-11);
|
|
}
|
|
else
|
|
{
|
|
m_p_oSplitFrameWP->SetPaneSize (3,iSize);
|
|
m_p_oSplitFrameWP->SetPaneSize (4,0);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
// Graphics Models
|
|
//--------------------------------------------------------------------
|
|
//ROMTEAM WorldEditor (Viorel Preoteasa 20/01/98)
|
|
/*
|
|
CPA_SuperObject* Waypoint_Interface::fn_pGetNewSymbolicalGraphicObject (void)
|
|
{
|
|
CPA_SuperObject* poSuperObject = GetInterface()->GetNewSuperObject ( E_ss_NoSave );
|
|
|
|
poSuperObject->SetTypeSO (C_Protected);
|
|
Geometry3D* poSpotObject = new Geometry3D ( m_poGeomDll, 4, 1 );
|
|
|
|
MTH3D_tdstVector a4_stPoint [4];
|
|
|
|
MTH3D_M_vSetVectorElements ( a4_stPoint, -0.15258f, 0.f, -0.07629f);
|
|
MTH3D_M_vSetVectorElements ( a4_stPoint+1, 0.15258f, 0.f, -0.07629f);
|
|
MTH3D_M_vSetVectorElements ( a4_stPoint+2, 0.f, 0.f, 0.15258f);
|
|
MTH3D_M_vSetVectorElements ( a4_stPoint+3, 0.f, -0.22888f, 0.f);
|
|
|
|
poSpotObject->fn_vSetListOfPoints(4, a4_stPoint);
|
|
|
|
ACP_tdxHandleOfElement hElement = poSpotObject->fn_hCreateElementIndexedTriangle(4,0);
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 0, 0, 1, 3 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 1, 1, 2, 3 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 2, 0, 3, 2 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 3, 0, 2, 1 );
|
|
|
|
GEO_tdstColor stColorIT;
|
|
|
|
stColorIT.xR = 0.f;
|
|
stColorIT.xG = 0.f;
|
|
stColorIT.xB = 0.f;
|
|
stColorIT.xA = 1.;
|
|
|
|
GEO_vSetPointReceivedLightIntensityOfObject ( poSpotObject->GetStruct(), &stColorIT, 0);
|
|
GEO_vSetPointReceivedLightIntensityOfObject ( poSpotObject->GetStruct(), &stColorIT, 1);
|
|
GEO_vSetPointReceivedLightIntensityOfObject ( poSpotObject->GetStruct(), &stColorIT, 2);
|
|
GEO_vSetPointReceivedLightIntensityOfObject ( poSpotObject->GetStruct(), &stColorIT, 3);
|
|
|
|
fn_vInitGameMaterial ( poSpotObject, hElement, 0.12157f, 0.56078f, 0.56078f );
|
|
|
|
HIE_fn_vSetSuperObjectDrawMask(poSuperObject->GetStruct(), GLI_C_lAllIsEnable );
|
|
poSuperObject->SetObject (poSpotObject);
|
|
poSpotObject->fn_vEndCreation();
|
|
|
|
|
|
return poSuperObject;
|
|
}
|
|
*/
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Method : fn_pGetNewSymbolicalGraphicObject
|
|
// Date : 97-11
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Description :
|
|
// Author : Viorel Preoteasa - CPA2
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Modification :
|
|
// Date :
|
|
// By :
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
CPA_SuperObject* Waypoint_Interface::fn_pGetNewSymbolicalGraphicObject (void)
|
|
{
|
|
CPA_SuperObject* poSuperObject = GetInterface()->GetNewSuperObject ( E_ss_NoSave );
|
|
|
|
poSuperObject->SetTypeSO (C_Protected);
|
|
Symbolical3D* poSpotObject = new Symbolical3D (TRUE, m_poGeomDll);
|
|
|
|
GEO_tdstColor stColorIT;
|
|
|
|
stColorIT.xR = 0.f;
|
|
stColorIT.xG = 0.f;
|
|
stColorIT.xB = 0.f;
|
|
stColorIT.xA = 1.;
|
|
|
|
for(int i=0; i<4; i++)
|
|
GEO_vSetPointReceivedLightIntensityOfObject ( poSpotObject->GetStruct(), &stColorIT, i);
|
|
|
|
fn_vInitGameMaterial ( poSpotObject, poSpotObject->GetHElement(), 0.12157f, 0.56078f, 0.56078f );
|
|
|
|
HIE_fn_vSetSuperObjectDrawMask(poSuperObject->GetStruct(), GLI_C_lAllIsEnable );
|
|
poSuperObject->SetObject (poSpotObject);
|
|
|
|
return poSuperObject;
|
|
}
|
|
|
|
/*
|
|
CPA_SuperObject* Waypoint_Interface::fn_pGetNewSphericalGraphicObject (void)
|
|
{
|
|
//---- Sphere à base d'indexed triangles en attendant
|
|
CPA_SuperObject* poSuperObject = GetInterface()->GetNewSuperObject ( E_ss_NoSave);
|
|
|
|
poSuperObject->SetTypeSO (C_Protected);
|
|
Geometry3D* poSpotObject = new Geometry3D ( m_poGeomDll, 62, 1 );
|
|
MTH3D_tdstVector a62_stPoint [62];
|
|
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+0, 0.00000f, 0.00000f, 1.00000f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+1, 0.50000f, 0.00000f, 0.86603f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+2, 0.43301f, 0.25000f, 0.86603f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+3, 0.25000f, 0.43301f, 0.86603f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+4,-0.00000f, 0.50000f, 0.86603f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+5,-0.25000f, 0.43301f, 0.86603f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+6,-0.43301f, 0.25000f, 0.86603f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+7,-0.50000f,-0.00000f, 0.86603f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+8,-0.43301f,-0.25000f, 0.86603f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+9,-0.25000f,-0.43301f, 0.86603f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+10, 0.00000f,-0.50000f, 0.86603f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+11, 0.25000f,-0.43301f, 0.86603f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+12, 0.43301f,-0.25000f, 0.86603f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+13, 0.86603f, 0.00000f, 0.50000f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+14, 0.75000f, 0.43301f, 0.50000f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+15, 0.43301f, 0.75000f, 0.50000f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+16,-0.00000f, 0.86603f, 0.50000f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+17,-0.43301f, 0.75000f, 0.50000f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+18,-0.75000f, 0.43301f, 0.50000f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+19,-0.86603f,-0.00000f, 0.50000f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+20,-0.75000f,-0.43301f, 0.50000f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+21,-0.43301f,-0.75000f, 0.50000f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+22, 0.00000f,-0.86603f, 0.50000f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+23, 0.43301f,-0.75000f, 0.50000f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+24, 0.75000f,-0.43301f, 0.50000f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+25, 1.00000f, 0.00000f,-0.00000f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+26, 0.86603f, 0.50000f,-0.00000f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+27, 0.50000f, 0.86603f,-0.00000f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+28,-0.00000f, 1.00000f,-0.00000f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+29,-0.50000f, 0.86603f,-0.00000f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+30,-0.86603f, 0.50000f,-0.00000f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+31,-1.00000f,-0.00000f,-0.00000f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+32,-0.86603f,-0.50000f,-0.00000f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+33,-0.50000f,-0.86603f,-0.00000f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+34, 0.00000f,-1.00000f,-0.00000f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+35, 0.50000f,-0.86603f,-0.00000f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+36, 0.86603f,-0.50000f,-0.00000f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+37, 0.86603f, 0.00000f,-0.50000f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+38, 0.75000f, 0.43301f,-0.50000f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+39, 0.43301f, 0.75000f,-0.50000f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+40,-0.00000f, 0.86603f,-0.50000f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+41,-0.43301f, 0.75000f,-0.50000f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+42,-0.75000f, 0.43301f,-0.50000f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+43,-0.86603f,-0.00000f,-0.50000f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+44,-0.75000f,-0.43301f,-0.50000f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+45,-0.43301f,-0.75000f,-0.50000f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+46, 0.00000f,-0.86603f,-0.50000f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+47, 0.43301f,-0.75000f,-0.50000f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+48, 0.75000f,-0.43301f,-0.50000f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+49, 0.50000f, 0.00000f,-0.86603f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+50, 0.43301f, 0.25000f,-0.86603f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+51, 0.25000f, 0.43301f,-0.86603f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+52,-0.00000f, 0.50000f,-0.86603f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+53,-0.25000f, 0.43301f,-0.86603f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+54,-0.43301f, 0.25000f,-0.86603f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+55,-0.50000f,-0.00000f,-0.86603f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+56,-0.43301f,-0.25000f,-0.86603f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+57,-0.25000f,-0.43301f,-0.86603f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+58, 0.00000f,-0.50000f,-0.86603f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+59, 0.25000f,-0.43301f,-0.86603f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+60, 0.43301f,-0.25000f,-0.86603f );
|
|
MTH3D_M_vSetVectorElements ( a62_stPoint+61, 0.00000f, 0.00000f,-1.00000f );
|
|
|
|
|
|
poSpotObject->fn_vSetListOfPoints(62, a62_stPoint);
|
|
|
|
ACP_tdxHandleOfElement hElement = poSpotObject->fn_hCreateElementIndexedTriangle(120,0);
|
|
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 0,0,1,2 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 1,0,2,3 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 2,0,3,4 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 3,0,4,5 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 4,0,5,6 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 5,0,6,7 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 6,0,7,8 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 7,0,8,9 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 8,0,9,10 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 9,0,10,11 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 10,0,11,12 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 11,0,12,1 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 12,1,13,14 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 13,1,14,2 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 14,2,14,15 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 15,2,15,3 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 16,3,15,16 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 17,3,16,4 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 18,4,16,17 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 19,4,17,5 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 20,5,17,18 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 21,5,18,6 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 22,6,18,19 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 23,6,19,7 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 24,7,19,20 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 25,7,20,8 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 26,8,20,21 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 27,8,21,9 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 28,9,21,22 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 29,9,22,10 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 30,10,22,23 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 31,10,23,11 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 32,11,23,24 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 33,11,24,12 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 34,12,24,13 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 35,12,13,1 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 36,13,25,26 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 37,13,26,14 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 38,14,26,27 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 39,14,27,15 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 40,15,27,28 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 41,15,28,16 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 42,16,28,29 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 43,16,29,17 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 44,17,29,30 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 45,17,30,18 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 46,18,30,31 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 47,18,31,19 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 48,19,31,32 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 49,19,32,20 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 50,20,32,33 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 51,20,33,21 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 52,21,33,34 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 53,21,34,22 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 54,22,34,35 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 55,22,35,23 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 56,23,35,36 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 57,23,36,24 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 58,24,36,25 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 59,24,25,13 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 60,25,37,38 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 61,25,38,26 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 62,26,38,39 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 63,26,39,27 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 64,27,39,40 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 65,27,40,28 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 66,28,40,41 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 67,28,41,29 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 68,29,41,42 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 69,29,42,30 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 70,30,42,43 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 71,30,43,31 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 72,31,43,44 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 73,31,44,32 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 74,32,44,45 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 75,32,45,33 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 76,33,45,46 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 77,33,46,34 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 78,34,46,47 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 79,34,47,35 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 80,35,47,48 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 81,35,48,36 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 82,36,48,37 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 83,36,37,25 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 84,37,49,50 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 85,37,50,38 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 86,38,50,51 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 87,38,51,39 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 88,39,51,52 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 89,39,52,40 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 90,40,52,53 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 91,40,53,41 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 92,41,53,54 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 93,41,54,42 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 94,42,54,55 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 95,42,55,43 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 96,43,55,56 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 97,43,56,44 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 98,44,56,57 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 99,44,57,45 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 100,45,57,58 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 101,45,58,46 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 102,46,58,59 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 103,46,59,47 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 104,47,59,60 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 105,47,60,48 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 106,48,60,49 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 107,48,49,37 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 108,61,50,49 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 109,61,51,50 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 110,61,52,51 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 111,61,53,52 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 112,61,54,53 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 113,61,55,54 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 114,61,56,55 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 115,61,57,56 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 116,61,58,57 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 117,61,59,58 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 118,61,60,59 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 119,61,49,60 );
|
|
|
|
|
|
|
|
GEO_tdstColor stColorIT;
|
|
stColorIT.xR = 0.12157f;
|
|
stColorIT.xG = 0.56078f;
|
|
stColorIT.xB = 0.56078f;
|
|
stColorIT.xA = 1.;
|
|
|
|
for (int iCounter=0; iCounter<62; iCounter++)
|
|
GEO_vSetPointReceivedLightIntensityOfObject ( poSpotObject->GetStruct(), &stColorIT, iCounter);
|
|
|
|
fn_vInitGameMaterial ( poSpotObject, hElement, 0.12157f, 0.56078f, 0.56078f );
|
|
|
|
HIE_fn_vSetSuperObjectDrawMask(poSuperObject->GetStruct(), GLI_C_lAllIsEnable & (~GLI_C_lIsNotGrided) );
|
|
poSuperObject->SetObject (poSpotObject);
|
|
poSpotObject->fn_vEndCreation();
|
|
|
|
return poSuperObject;
|
|
}
|
|
*/
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Method : fn_pGetNewSphericalGraphicObject
|
|
// Date : 97-11
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Description :
|
|
// Author : Viorel Preoteasa - CPA2
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Modification :
|
|
// Date :
|
|
// By :
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
CPA_SuperObject* Waypoint_Interface::fn_pGetNewSphericalGraphicObject (void)
|
|
{
|
|
//---- Sphere à base d'indexed triangles en attendant
|
|
CPA_SuperObject* poSuperObject = GetInterface()->GetNewSuperObject ( E_ss_NoSave);
|
|
poSuperObject->SetTypeSO (C_Protected);
|
|
ITSphere3D *poSphereObject = new ITSphere3D(m_poGeomDll, 1, 10, 10);
|
|
|
|
GEO_tdstColor stColorIT;
|
|
stColorIT.xR = 0.12157f;
|
|
stColorIT.xG = 0.56078f;
|
|
stColorIT.xB = 0.56078f;
|
|
stColorIT.xA = 1.;
|
|
|
|
ACP_tdxHandleOfObject hObject = poSphereObject->GetStruct();
|
|
|
|
for (int iCounter=0; iCounter<(poSphereObject->GetStruct())->xNbPoints; iCounter++)
|
|
GEO_vSetPointReceivedLightIntensityOfObject ( poSphereObject->GetStruct(), &stColorIT, iCounter);
|
|
fn_vInitGameMaterial ( poSphereObject, poSphereObject->GetHElement(), 0.12157f, 0.56078f, 0.56078f );
|
|
|
|
HIE_fn_vSetSuperObjectDrawMask(poSuperObject->GetStruct(), GLI_C_lAllIsEnable & (~GLI_C_lIsNotGrided) );
|
|
poSuperObject->SetObject (poSphereObject);
|
|
|
|
return poSuperObject;
|
|
}
|
|
|
|
|
|
/*
|
|
CPA_SuperObject* Waypoint_Interface::fn_pGetNewLineGraphicObject (void)
|
|
{
|
|
CPA_SuperObject* poSuperObject = GetInterface()->GetNewSuperObject ( E_ss_NoSave );
|
|
poSuperObject->SetTypeSO (C_Protected);
|
|
Geometry3D* poSpotObject = new Geometry3D (m_poGeomDll, 8, 1 );
|
|
|
|
MTH3D_tdstVector a8_stPoint [8];
|
|
|
|
for ( int iCounter=0; iCounter<8; iCounter++)
|
|
MTH3D_M_vSetVectorElements ( a8_stPoint+iCounter, 0., 0., 0.);
|
|
|
|
poSpotObject->fn_vSetListOfPoints(8, a8_stPoint);
|
|
|
|
ACP_tdxHandleOfElement hElement = poSpotObject->fn_hCreateElementIndexedTriangle(12,0);
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 0, 0, 1, 3 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 1, 1, 2, 3 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 2, 4, 5, 1 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 3, 1, 0, 4 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 4, 1, 5, 6 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 5, 1, 6, 2 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 6, 3, 2, 6 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 7, 6, 7, 3 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 8, 0, 3, 7 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 9, 7, 4, 0 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 10, 4, 7, 5 );
|
|
poSpotObject->fn_eSetIndexedTriangle ( hElement, 11, 6, 5, 7 );
|
|
|
|
GEO_tdstColor stColorIT;
|
|
stColorIT.xR = 0.8f;
|
|
stColorIT.xG = 0.;
|
|
stColorIT.xB = 0.;
|
|
stColorIT.xA = 1.;
|
|
|
|
for ( iCounter=0; iCounter<8; iCounter++)
|
|
GEO_vSetPointReceivedLightIntensityOfObject ( poSpotObject->GetStruct(), &stColorIT, iCounter );
|
|
|
|
fn_vInitGameMaterial ( poSpotObject, hElement, 0.8f, 0.f, 0.f );
|
|
HIE_fn_vSetSuperObjectDrawMask(poSuperObject->GetStruct(), C_lGouraudElement);
|
|
poSuperObject->SetObject (poSpotObject);
|
|
poSpotObject->fn_vEndCreation();
|
|
|
|
return poSuperObject;
|
|
}
|
|
*/
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Method : fn_pGetNewLineGraphicObject
|
|
// Date : 97-11
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Description :
|
|
// Author : Viorel Preoteasa - CPA2
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Modification :
|
|
// Date :
|
|
// By :
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
CPA_SuperObject* Waypoint_Interface::fn_pGetNewLineGraphicObject(void)
|
|
{
|
|
CPA_SuperObject* poSuperObject = GetInterface()->GetNewSuperObject ( E_ss_NoSave );
|
|
poSuperObject->SetTypeSO (C_Protected);
|
|
Bar3D* poSpotObject = new Bar3D (TRUE, m_poGeomDll);
|
|
|
|
GEO_tdstColor stColorIT;
|
|
stColorIT.xR = 0.8f;
|
|
stColorIT.xG = 0.;
|
|
stColorIT.xB = 0.;
|
|
stColorIT.xA = 1.;
|
|
|
|
int iCounter;
|
|
for ( iCounter=0; iCounter<8; iCounter++)
|
|
GEO_vSetPointReceivedLightIntensityOfObject ( poSpotObject->GetStruct(), &stColorIT, iCounter );
|
|
|
|
fn_vInitGameMaterial ( poSpotObject, poSpotObject->GetHElement(), 0.8f, 0.f, 0.f );
|
|
HIE_fn_vSetSuperObjectDrawMask(poSuperObject->GetStruct(), C_lGouraudElement);
|
|
poSuperObject->SetObject (poSpotObject);
|
|
|
|
return poSuperObject;
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
CPA_SuperObject* Waypoint_Interface::fn_pGetNewTangentGraphicObject (GEO_tdstColor* pstColor)
|
|
{
|
|
CPA_SuperObject* poSuperObject = GetInterface()->GetNewSuperObject ( E_ss_NoSave );
|
|
|
|
poSuperObject->SetTypeSO(C_Protected);
|
|
Geometry3D* poTangentObject = new Geometry3D (m_poGeomDll, 13, 1 );
|
|
|
|
MTH3D_tdstVector a13_stPoint [13];
|
|
MTH3D_M_vSetVectorElements ( a13_stPoint, -0.05f, -0.05f, 0.0f);
|
|
MTH3D_M_vSetVectorElements ( a13_stPoint+1, 0.05f,-0.05f,0.0f);
|
|
MTH3D_M_vSetVectorElements ( a13_stPoint+2, 0.05f,0.05f,0.0f);
|
|
MTH3D_M_vSetVectorElements ( a13_stPoint+3, -0.05f,0.05f,0.0f);
|
|
MTH3D_M_vSetVectorElements ( a13_stPoint+4, -0.05f,-0.05f,0.4f);
|
|
MTH3D_M_vSetVectorElements ( a13_stPoint+5, 0.05f,-0.05f,0.4f);
|
|
MTH3D_M_vSetVectorElements ( a13_stPoint+6, 0.05f,0.05f,0.4f);
|
|
MTH3D_M_vSetVectorElements ( a13_stPoint+7, -0.05f,0.05f,0.4f);
|
|
MTH3D_M_vSetVectorElements ( a13_stPoint+8, -0.1f,-0.1f,0.4f);
|
|
MTH3D_M_vSetVectorElements ( a13_stPoint+9, 0.1f,-0.1f,0.4f);
|
|
MTH3D_M_vSetVectorElements ( a13_stPoint+10, 0.1f,0.1f,0.4f);
|
|
MTH3D_M_vSetVectorElements ( a13_stPoint+11, -0.1f,0.1f,0.4f);
|
|
MTH3D_M_vSetVectorElements ( a13_stPoint+12, 0.f,0.f,0.6f);
|
|
poTangentObject->fn_vSetListOfPoints(13, a13_stPoint);
|
|
|
|
ACP_tdxHandleOfElement hElement = poTangentObject->fn_hCreateElementIndexedTriangle(22,0);
|
|
poTangentObject->fn_eSetIndexedTriangle ( hElement, 0, 0, 1, 3);
|
|
poTangentObject->fn_eSetIndexedTriangle ( hElement, 1, 1, 2, 3 );
|
|
poTangentObject->fn_eSetIndexedTriangle ( hElement, 2, 4, 5, 1 );
|
|
poTangentObject->fn_eSetIndexedTriangle ( hElement, 3, 1, 0, 4 );
|
|
poTangentObject->fn_eSetIndexedTriangle ( hElement, 4, 1, 5, 6 );
|
|
poTangentObject->fn_eSetIndexedTriangle ( hElement, 5, 1, 6, 2 );
|
|
poTangentObject->fn_eSetIndexedTriangle ( hElement, 6, 3 ,2, 6 );
|
|
poTangentObject->fn_eSetIndexedTriangle ( hElement, 7, 6, 7, 3 );
|
|
poTangentObject->fn_eSetIndexedTriangle ( hElement, 8, 0, 3, 7 );
|
|
poTangentObject->fn_eSetIndexedTriangle ( hElement, 9, 7, 4, 0 );
|
|
poTangentObject->fn_eSetIndexedTriangle ( hElement, 10,8, 9, 4 );
|
|
poTangentObject->fn_eSetIndexedTriangle ( hElement, 11,9, 5, 4 );
|
|
poTangentObject->fn_eSetIndexedTriangle ( hElement, 12,9, 10,5 );
|
|
poTangentObject->fn_eSetIndexedTriangle ( hElement, 13,5, 10,6 );
|
|
poTangentObject->fn_eSetIndexedTriangle ( hElement, 14,6, 10,11 );
|
|
poTangentObject->fn_eSetIndexedTriangle ( hElement, 15,6, 11,7 );
|
|
poTangentObject->fn_eSetIndexedTriangle ( hElement, 16,11,8, 7 );
|
|
poTangentObject->fn_eSetIndexedTriangle ( hElement, 17,7, 8, 4 );
|
|
poTangentObject->fn_eSetIndexedTriangle ( hElement, 18,9, 12,10 );
|
|
poTangentObject->fn_eSetIndexedTriangle ( hElement, 19,10,12,11 );
|
|
poTangentObject->fn_eSetIndexedTriangle ( hElement, 20,11,12,8 );
|
|
poTangentObject->fn_eSetIndexedTriangle ( hElement, 21,8, 12,9 );
|
|
|
|
|
|
for ( int iCounter=0; iCounter<13; iCounter++)
|
|
GEO_vSetPointReceivedLightIntensityOfObject ( poTangentObject->GetStruct(), pstColor, iCounter );
|
|
|
|
fn_vInitGameMaterial ( poTangentObject, hElement, pstColor->xR, pstColor->xG, pstColor->xB );
|
|
|
|
HIE_fn_vSetSuperObjectDrawMask(poSuperObject->GetStruct(), C_lGouraudElement);
|
|
GEO_xComputeObjectNormals ( (ACP_tdxHandleOfObject)(poTangentObject->GetStruct()) );
|
|
|
|
poSuperObject->SetObject (poTangentObject);
|
|
poTangentObject->fn_vEndCreation();
|
|
|
|
return poSuperObject;
|
|
|
|
}
|
|
*/
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Method : fn_pGetNewTangentGraphicObject
|
|
// Date : 97-11
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Description :
|
|
// Author : Viorel Preoteasa - CPA2
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Modification :
|
|
// Date :
|
|
// By :
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
CPA_SuperObject* Waypoint_Interface::fn_pGetNewTangentGraphicObject (GEO_tdstColor* pstColor)
|
|
{
|
|
CPA_SuperObject* poSuperObject = GetInterface()->GetNewSuperObject ( E_ss_NoSave );
|
|
poSuperObject->SetTypeSO(C_Protected);
|
|
|
|
Arrow3D* poTangentObject = new Arrow3D(TRUE, m_poGeomDll);
|
|
for ( int iCounter=0; iCounter<13; iCounter++)
|
|
GEO_vSetPointReceivedLightIntensityOfObject ( poTangentObject->GetStruct(), pstColor, iCounter );
|
|
|
|
fn_vInitGameMaterial ( poTangentObject, poTangentObject->GetHElement(), pstColor->xR, pstColor->xG, pstColor->xB );
|
|
|
|
HIE_fn_vSetSuperObjectDrawMask(poSuperObject->GetStruct(), C_lGouraudElement);
|
|
GEO_xComputeObjectNormals ( (ACP_tdxHandleOfObject)(poTangentObject->GetStruct()) );
|
|
poSuperObject->SetObject (poTangentObject);
|
|
|
|
return poSuperObject;
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
CPA_SuperObject* Waypoint_Interface::fn_pGetNewPlaneGraphicObject (void)
|
|
{
|
|
CPA_SuperObject* poSuperObject = GetInterface()->GetNewSuperObject ( E_ss_NoSave );
|
|
|
|
|
|
poSuperObject->SetTypeSO (C_Protected);
|
|
Geometry3D* poPlaneObject = new Geometry3D (m_poGeomDll, 24, 3 );
|
|
|
|
MTH3D_tdstVector a8_stPoint [24];
|
|
|
|
for ( int iCounter=0; iCounter<24; iCounter++ )
|
|
MTH3D_M_vSetVectorElements ( a8_stPoint+iCounter, 0.0, 0.0, 0.0 );
|
|
|
|
poPlaneObject->fn_vSetListOfPoints(24, a8_stPoint);
|
|
|
|
ACP_tdxHandleOfElement hElement0 = poPlaneObject->fn_hCreateElementIndexedTriangle(4,0);
|
|
poPlaneObject->fn_eSetIndexedTriangle ( hElement0, 0, 0, 1, 3 );
|
|
poPlaneObject->fn_eSetIndexedTriangle ( hElement0, 1, 1, 2, 3 );
|
|
poPlaneObject->fn_eSetIndexedTriangle ( hElement0, 2, 4, 7, 5 );
|
|
poPlaneObject->fn_eSetIndexedTriangle ( hElement0, 3, 6, 5, 7 );
|
|
|
|
ACP_tdxHandleOfElement hElement1 = poPlaneObject->fn_hCreateElementIndexedTriangle(12,0);
|
|
poPlaneObject->fn_eSetIndexedTriangle ( hElement1, 0, 0, 4, 11 );
|
|
poPlaneObject->fn_eSetIndexedTriangle ( hElement1, 1, 4, 15, 11 );
|
|
poPlaneObject->fn_eSetIndexedTriangle ( hElement1, 2, 14, 5, 1 );
|
|
poPlaneObject->fn_eSetIndexedTriangle ( hElement1, 3, 10, 14, 1 );
|
|
poPlaneObject->fn_eSetIndexedTriangle ( hElement1, 4, 1, 5, 6 );
|
|
poPlaneObject->fn_eSetIndexedTriangle ( hElement1, 5, 1, 6, 2 );
|
|
poPlaneObject->fn_eSetIndexedTriangle ( hElement1, 6, 3, 20, 7 );
|
|
poPlaneObject->fn_eSetIndexedTriangle ( hElement1, 7, 3, 16, 20 );
|
|
poPlaneObject->fn_eSetIndexedTriangle ( hElement1, 8, 17, 6, 21 );
|
|
poPlaneObject->fn_eSetIndexedTriangle ( hElement1, 9, 17, 2, 6 );
|
|
poPlaneObject->fn_eSetIndexedTriangle ( hElement1, 10, 0, 3, 7 );
|
|
poPlaneObject->fn_eSetIndexedTriangle ( hElement1, 11, 7, 4, 0 );
|
|
|
|
ACP_tdxHandleOfElement hElement2 = poPlaneObject->fn_hCreateElementIndexedTriangle(20,0);
|
|
poPlaneObject->fn_eSetIndexedTriangle ( hElement2, 0, 8, 9, 11 );
|
|
poPlaneObject->fn_eSetIndexedTriangle ( hElement2, 1, 9, 10, 11 );
|
|
poPlaneObject->fn_eSetIndexedTriangle ( hElement2, 2, 12, 13, 9 );
|
|
poPlaneObject->fn_eSetIndexedTriangle ( hElement2, 3, 9, 8, 12 );
|
|
poPlaneObject->fn_eSetIndexedTriangle ( hElement2, 4, 9, 13, 14 );
|
|
poPlaneObject->fn_eSetIndexedTriangle ( hElement2, 5, 9, 14, 10 );
|
|
poPlaneObject->fn_eSetIndexedTriangle ( hElement2, 6, 13, 12, 15 );
|
|
poPlaneObject->fn_eSetIndexedTriangle ( hElement2, 7, 13, 15, 14 );
|
|
poPlaneObject->fn_eSetIndexedTriangle ( hElement2, 8, 8, 11, 15 );
|
|
poPlaneObject->fn_eSetIndexedTriangle ( hElement2, 9, 15, 12, 8 );
|
|
|
|
poPlaneObject->fn_eSetIndexedTriangle ( hElement2, 10, 16, 17, 19 );
|
|
poPlaneObject->fn_eSetIndexedTriangle ( hElement2, 11, 17, 18, 19 );
|
|
poPlaneObject->fn_eSetIndexedTriangle ( hElement2, 12, 20, 23, 21 );
|
|
poPlaneObject->fn_eSetIndexedTriangle ( hElement2, 13, 21, 23, 22 );
|
|
poPlaneObject->fn_eSetIndexedTriangle ( hElement2, 14, 17, 22, 18 );
|
|
poPlaneObject->fn_eSetIndexedTriangle ( hElement2, 15, 17, 21, 22 );
|
|
poPlaneObject->fn_eSetIndexedTriangle ( hElement2, 16, 16, 19, 23 );
|
|
poPlaneObject->fn_eSetIndexedTriangle ( hElement2, 17, 16, 23, 20 );
|
|
poPlaneObject->fn_eSetIndexedTriangle ( hElement2, 18, 19, 18, 23 );
|
|
poPlaneObject->fn_eSetIndexedTriangle ( hElement2, 19, 18, 22, 23 );
|
|
|
|
GEO_tdstColor stColorIT;
|
|
stColorIT.xR = 0.;
|
|
stColorIT.xG = 0.8f;
|
|
stColorIT.xB = 0.;
|
|
stColorIT.xA = 1.;
|
|
|
|
for ( iCounter=0; iCounter<24; iCounter++)
|
|
GEO_vSetPointReceivedLightIntensityOfObject ( poPlaneObject->GetStruct(), &stColorIT, iCounter );
|
|
|
|
fn_vInitGameMaterial ( poPlaneObject, hElement0, 0.f, 0.8f, 0.f );
|
|
fn_vInitGameMaterial ( poPlaneObject, hElement1, 0.f, 0.3f, 0.f );
|
|
fn_vInitGameMaterial ( poPlaneObject, hElement2, 0.f, 0.8f, 0.8f );
|
|
|
|
|
|
HIE_fn_vSetSuperObjectDrawMask(poSuperObject->GetStruct(), C_lGouraudElement & (~GLI_C_lIsNotGrided) );
|
|
|
|
poSuperObject->SetObject (poPlaneObject);
|
|
poPlaneObject->fn_vEndCreation();
|
|
|
|
return poSuperObject;
|
|
}
|
|
*/
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Method : fn_pGetNewPlaneGraphicObject
|
|
// Date : 97-11
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Description :
|
|
// Author : Viorel Preoteasa - CPA2
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Modification :
|
|
// Date :
|
|
// By :
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
CPA_SuperObject* Waypoint_Interface::fn_pGetNewPlaneGraphicObject (void)
|
|
{
|
|
CPA_SuperObject* poSuperObject = GetInterface()->GetNewSuperObject ( E_ss_NoSave );
|
|
|
|
|
|
poSuperObject->SetTypeSO (C_Protected);
|
|
Plane3D* poPlaneObject = new Plane3D (TRUE, m_poGeomDll);
|
|
|
|
GEO_tdstColor stColorIT;
|
|
stColorIT.xR = 0.;
|
|
stColorIT.xG = 0.8f;
|
|
stColorIT.xB = 0.;
|
|
stColorIT.xA = 1.;
|
|
|
|
for ( int iCounter=0; iCounter<24; iCounter++)
|
|
GEO_vSetPointReceivedLightIntensityOfObject ( poPlaneObject->GetStruct(), &stColorIT, iCounter );
|
|
|
|
fn_vInitGameMaterial ( poPlaneObject, poPlaneObject->GetHElement(0), 0.f, 0.8f, 0.f );
|
|
fn_vInitGameMaterial ( poPlaneObject, poPlaneObject->GetHElement(1), 0.f, 0.3f, 0.f );
|
|
fn_vInitGameMaterial ( poPlaneObject, poPlaneObject->GetHElement(2), 0.f, 0.8f, 0.8f );
|
|
|
|
|
|
HIE_fn_vSetSuperObjectDrawMask(poSuperObject->GetStruct(), C_lGouraudElement & (~GLI_C_lIsNotGrided) );
|
|
|
|
poSuperObject->SetObject (poPlaneObject);
|
|
|
|
return poSuperObject;
|
|
}
|
|
|
|
/*
|
|
CPA_SuperObject* Waypoint_Interface::fn_pGetNewCursorGraphicObject (void)
|
|
{
|
|
CPA_SuperObject* poSuperObject = GetInterface()->GetNewSuperObject ( E_ss_NoSave );
|
|
|
|
poSuperObject->SetTypeSO (C_Protected);
|
|
Geometry3D* poCursorObject = new Geometry3D (m_poGeomDll, 8, 1 );
|
|
|
|
MTH3D_tdstVector a8_stPoint [8];
|
|
|
|
for (int iCounter=0; iCounter<8; iCounter++)
|
|
MTH3D_M_vSetVectorElements ( a8_stPoint+iCounter, 0.0, 0.0, 0.0 );
|
|
|
|
poCursorObject->fn_vSetListOfPoints(8, a8_stPoint);
|
|
|
|
ACP_tdxHandleOfElement hElement = poCursorObject->fn_hCreateElementIndexedTriangle(12,0);
|
|
poCursorObject->fn_eSetIndexedTriangle ( hElement, 0, 0, 1, 3 );
|
|
poCursorObject->fn_eSetIndexedTriangle ( hElement, 1, 1, 2, 3 );
|
|
poCursorObject->fn_eSetIndexedTriangle ( hElement, 2, 4, 5, 1 );
|
|
poCursorObject->fn_eSetIndexedTriangle ( hElement, 3, 1, 0, 4 );
|
|
poCursorObject->fn_eSetIndexedTriangle ( hElement, 4, 1, 5, 6 );
|
|
poCursorObject->fn_eSetIndexedTriangle ( hElement, 5, 1, 6, 2 );
|
|
poCursorObject->fn_eSetIndexedTriangle ( hElement, 6, 3, 2, 6 );
|
|
poCursorObject->fn_eSetIndexedTriangle ( hElement, 7, 6, 7, 3 );
|
|
poCursorObject->fn_eSetIndexedTriangle ( hElement, 8, 0, 3, 7 );
|
|
poCursorObject->fn_eSetIndexedTriangle ( hElement, 9, 7, 4, 0 );
|
|
poCursorObject->fn_eSetIndexedTriangle ( hElement, 10, 4, 7, 5 );
|
|
poCursorObject->fn_eSetIndexedTriangle ( hElement, 11, 6, 5, 7 );
|
|
|
|
GEO_tdstColor stColorIT;
|
|
stColorIT.xR = 0.8f;
|
|
stColorIT.xG = 0.8f;
|
|
stColorIT.xB = 0.8f;
|
|
stColorIT.xA = 1.;
|
|
|
|
for ( iCounter=0; iCounter<8; iCounter++)
|
|
GEO_vSetPointReceivedLightIntensityOfObject ( poCursorObject->GetStruct(), &stColorIT, iCounter );
|
|
|
|
fn_vInitGameMaterial ( poCursorObject, hElement, 0.8f, 0.8f, 0.8f );
|
|
|
|
HIE_fn_vSetSuperObjectDrawMask(poSuperObject->GetStruct(), C_lGouraudElement);
|
|
|
|
poSuperObject->SetObject (poCursorObject);
|
|
poCursorObject->fn_vEndCreation();
|
|
|
|
|
|
return poSuperObject;
|
|
}
|
|
*/
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Method : fn_pGetNewPlaneGraphicObject
|
|
// Date : 97-11
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Description :
|
|
// Author : Viorel Preoteasa - CPA2
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Modification :
|
|
// Date :
|
|
// By :
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
CPA_SuperObject* Waypoint_Interface::fn_pGetNewCursorGraphicObject (void)
|
|
{
|
|
CPA_SuperObject* poSuperObject = GetInterface()->GetNewSuperObject ( E_ss_NoSave );
|
|
|
|
poSuperObject->SetTypeSO (C_Protected);
|
|
Bar3D* poCursorObject = new Bar3D (TRUE, m_poGeomDll);
|
|
|
|
GEO_tdstColor stColorIT;
|
|
stColorIT.xR = 0.8f;
|
|
stColorIT.xG = 0.8f;
|
|
stColorIT.xB = 0.8f;
|
|
stColorIT.xA = 1.;
|
|
|
|
int iCounter;
|
|
for ( iCounter=0; iCounter<8; iCounter++)
|
|
GEO_vSetPointReceivedLightIntensityOfObject ( poCursorObject->GetStruct(), &stColorIT, iCounter );
|
|
|
|
fn_vInitGameMaterial ( poCursorObject, poCursorObject->GetHElement(), 0.8f, 0.8f, 0.8f );
|
|
HIE_fn_vSetSuperObjectDrawMask(poSuperObject->GetStruct(), C_lGouraudElement);
|
|
poSuperObject->SetObject (poCursorObject);
|
|
|
|
return poSuperObject;
|
|
}
|
|
//ENDROMTEAM WorldEditor (Viorel Preoteasa)
|
|
|
|
// Shaitan Correction {
|
|
/*
|
|
// CPA2 Gabriela Dumitrascu 98-04-27
|
|
CPA_SuperObject* Waypoint_Interface::fn_pGetNewConnectionGraphicObject (int iGraph, int iNode, int iArc)
|
|
{
|
|
CPA_SuperObject* poSuperObject = GetInterface()->GetNewSuperObject ( E_ss_NoSave );
|
|
poSuperObject->SetTypeSO(C_Protected);
|
|
|
|
GEO_tdstColor stColor;
|
|
stColor.xR = 0.f;
|
|
stColor.xG = 0.f;
|
|
stColor.xB = 0.8f;
|
|
Arrow3D* poConnectionObject = new Connection(m_poGeomDll, iGraph, iNode, iArc);
|
|
for ( int iCounter=0; iCounter<13; iCounter++)
|
|
GEO_vSetPointReceivedLightIntensityOfObject (poConnectionObject->GetStruct(), &stColor, iCounter );
|
|
|
|
fn_vInitGameMaterial (poConnectionObject, poConnectionObject->GetHElement(), stColor.xR, stColor.xG, stColor.xB );
|
|
|
|
HIE_fn_vSetSuperObjectDrawMask(poSuperObject->GetStruct(), C_lGouraudElement);
|
|
GEO_xComputeObjectNormals ( (ACP_tdxHandleOfObject)(poConnectionObject->GetStruct()));
|
|
poSuperObject->SetObject (poConnectionObject);
|
|
|
|
return poSuperObject;
|
|
}
|
|
// End CPA2 Gabriela Dumitrascu 98-04-27
|
|
*/
|
|
|
|
CPA_SuperObject* Waypoint_Interface::fn_pCreateConnectionGraphicObject (Graph *pGraph, WayPoint *pSrcWP, WayPoint *pDstWP, long lCapacity, long lWeight)
|
|
{
|
|
CPA_SuperObject* poSuperObject = GetInterface()->GetNewSuperObject(E_ss_NoSave);
|
|
poSuperObject->SetTypeSO(C_Protected);
|
|
|
|
GEO_tdstColor stColor;
|
|
stColor.xR = 0.f;
|
|
stColor.xG = 0.f;
|
|
stColor.xB = 0.8f;
|
|
Arrow3D* poConnectionObject = new Connection(m_poGeomDll, pGraph, pSrcWP, pDstWP, lCapacity, lWeight);
|
|
for ( int iCounter=0; iCounter<13; iCounter++)
|
|
GEO_vSetPointReceivedLightIntensityOfObject (poConnectionObject->GetStruct(), &stColor, iCounter );
|
|
|
|
fn_vInitGameMaterial (poConnectionObject, poConnectionObject->GetHElement(), stColor.xR, stColor.xG, stColor.xB );
|
|
|
|
HIE_fn_vSetSuperObjectDrawMask(poSuperObject->GetStruct(), C_lGouraudElement);
|
|
GEO_xComputeObjectNormals ( (ACP_tdxHandleOfObject)(poConnectionObject->GetStruct()));
|
|
poSuperObject->SetObject (poConnectionObject);
|
|
|
|
return poSuperObject;
|
|
}
|
|
//End Shaitan Correction }
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
// Tools
|
|
//--------------------------------------------------------------------
|
|
CPA_BaseObject* Waypoint_Interface::fn_pSelectWayPointParam ( CPA_List<CPA_BaseObject> *pParams )
|
|
{
|
|
POSITION xPos;
|
|
CPA_BaseObject* p_oSuperObject=NULL;
|
|
for
|
|
(
|
|
p_oSuperObject = pParams->GetHeadElement ( xPos );
|
|
p_oSuperObject;
|
|
p_oSuperObject = pParams->GetNextElement ( xPos )
|
|
)
|
|
if (((CPA_SuperObject*)p_oSuperObject)->GetObjectType()==HIE_C_ulEDT_Waypoint) return p_oSuperObject;
|
|
|
|
// we don't find something interresting
|
|
return NULL;
|
|
}
|
|
|
|
|
|
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
BOOL Waypoint_Interface::fn_bWaypointInAWay ( WayPoint* poWP )
|
|
{
|
|
POSITION xNetPosition;
|
|
Way* poWay;
|
|
for (poWay=Way::fn_poGetListOfWay()->GetHeadElement(xNetPosition); poWay; poWay=Way::fn_poGetListOfWay()->GetNextElement(xNetPosition) )
|
|
if ( poWay->fn_iIsWayPointInNet (poWP)>=0 ) return TRUE;
|
|
return FALSE;
|
|
}
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
|
|
|
|
void Waypoint_Interface::fn_vPick ( ACP_tdxIndex* pxNbPicked, HIE_aDEF_stTabOfPickInfo& ra_stPickInfo, tdstMousePos *p_stPos)
|
|
{
|
|
*pxNbPicked = HIE_xIsSuperObjectPick
|
|
(
|
|
GLI_C_ModePickingFace,
|
|
GetInterface()->GetMultiDevice()->GetFocusDevice()->GetViewPort()->m_hDisplayDevice,
|
|
GetInterface()->GetMultiDevice()->GetFocusDevice()->GetViewPort()->m_hDisplayViewport,
|
|
&(p_stPos->stPos2D),
|
|
GetInterface()->GetMultiDevice3D()->GetEngineWorld(),
|
|
ra_stPickInfo
|
|
);
|
|
}
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
void Waypoint_Interface::fn_vAddWayPoint (void)
|
|
{
|
|
if (!m_poAddWP->fn_bGetCoordinate()) return;
|
|
if (Way::fn_pGetDialog()->fn_pGetEditWay()) Way::fn_pGetDialog()->fn_pGetEditWay()->fn_vAddWayPoint(m_poAddWP);
|
|
}
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
CPA_SuperObject* Waypoint_Interface::fn_pExplorePicking (ACP_tdxIndex xIndex, HIE_tdstPickInfo *p_stObject, long lTypeObject, ACP_tdxIndex* pxFindIndex )
|
|
{
|
|
for (ACP_tdxIndex i=0; i<xIndex; i++)
|
|
{
|
|
CPA_SuperObject* pChild = GetInterface()->GetEditorObject(p_stObject[i].hSprObject);
|
|
while (pChild)
|
|
{
|
|
if (pChild && pChild->GetObjectType()==lTypeObject)
|
|
{
|
|
if (pxFindIndex) *pxFindIndex = i;
|
|
return pChild;
|
|
}
|
|
pChild = (CPA_SuperObject*)pChild->GetParent();
|
|
}
|
|
|
|
}
|
|
return NULL;
|
|
}
|
|
|
|
CPA_SuperObject* Waypoint_Interface::fn_pFirstSuperObjectPicked (HIE_tdstPickInfo *p_stObject)
|
|
{
|
|
return GetInterface()->GetEditorObject(p_stObject[0].hSprObject);
|
|
}
|
|
|
|
CPA_SuperObject* Waypoint_Interface::fn_pFirstSuperObjectPickedInDynamicHierarchy (ACP_tdxIndex xIndex, HIE_tdstPickInfo *p_stObject)
|
|
{
|
|
for (ACP_tdxIndex i=0; i<xIndex; i++)
|
|
{
|
|
CPA_SuperObject* pChild = GetInterface()->GetEditorObject(p_stObject[i].hSprObject);
|
|
while (pChild)
|
|
{
|
|
if (pChild && !fn_bIsSuperObjectInStaticHierarchy (pChild)) return pChild;
|
|
pChild = (CPA_SuperObject*)pChild->GetParent();
|
|
}
|
|
|
|
}
|
|
return NULL;
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
// File Management
|
|
//--------------------------------------------------------------------
|
|
CString Waypoint_Interface::fn_csGetWaypointSaveFileName (void)
|
|
{
|
|
char szLevelName [256];
|
|
fn_zsGetActualLevelFilename (szLevelName, "wp");
|
|
CString csLevelName = szLevelName;
|
|
return csLevelName;
|
|
}
|
|
|
|
|
|
CString Waypoint_Interface::fn_csGetWaySaveFileName (void)
|
|
{
|
|
char szLevelName [256];
|
|
fn_zsGetActualLevelFilename (szLevelName, "way");
|
|
CString csLevelName = szLevelName;
|
|
return csLevelName;
|
|
}
|
|
|
|
BOOL Waypoint_Interface::fn_bExistWaypointSaveFile (void)
|
|
{
|
|
CString csPath = fn_csGetWaypointSaveFileName ();
|
|
FILE* pFile;
|
|
|
|
pFile = fopen (csPath.GetBuffer(128), "r" );
|
|
|
|
if ( pFile )
|
|
{
|
|
m_bExistWaypointSaveFile=TRUE;
|
|
fclose (pFile);
|
|
}
|
|
else m_bExistWaypointSaveFile=FALSE;
|
|
return m_bExistWaypointSaveFile;
|
|
}
|
|
|
|
|
|
BOOL Waypoint_Interface::fn_bExistWaySaveFile (void)
|
|
{
|
|
CString csPath = fn_csGetWaySaveFileName ();
|
|
FILE* pFile;
|
|
|
|
pFile = fopen (csPath.GetBuffer(128), "r" );
|
|
|
|
if ( pFile )
|
|
{
|
|
m_bExistWaySaveFile=TRUE;
|
|
fclose (pFile);
|
|
}
|
|
else m_bExistWaySaveFile=FALSE;
|
|
return m_bExistWaySaveFile;
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
// Tools
|
|
//--------------------------------------------------------------------
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
CPA_BaseObject* Waypoint_Interface::fn_pSelectWayParam ( CPA_List<CPA_BaseObject> *pParams )
|
|
{
|
|
POSITION xPos;
|
|
CPA_BaseObject* p_oSuperObject=NULL;
|
|
for
|
|
(
|
|
p_oSuperObject = pParams->GetHeadElement ( xPos );
|
|
p_oSuperObject;
|
|
p_oSuperObject = pParams->GetNextElement ( xPos )
|
|
)
|
|
if (((CPA_SuperObject*)p_oSuperObject)->GetObjectType()==C_ucWay) return p_oSuperObject;
|
|
|
|
// we don't find something interresting
|
|
return NULL;
|
|
}
|
|
|
|
CPA_BaseObject* Waypoint_Interface::fn_pSelectLinkParam ( CPA_List<CPA_BaseObject> *pParams )
|
|
{
|
|
POSITION xPos;
|
|
CPA_BaseObject* p_oSuperObject=NULL;
|
|
for
|
|
(
|
|
p_oSuperObject = pParams->GetHeadElement ( xPos );
|
|
p_oSuperObject;
|
|
p_oSuperObject = pParams->GetNextElement ( xPos )
|
|
)
|
|
if (((CPA_SuperObject*)p_oSuperObject)->GetObjectType()==C_ucLink) return p_oSuperObject;
|
|
|
|
// we don't find something interresting
|
|
return NULL;
|
|
}
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
void Waypoint_Interface::fn_vRefreshHierarchyList (void)
|
|
{
|
|
m_p_oDialogList->fn_vUpdateSelection (E_lrm_ReinitList);
|
|
}
|
|
|
|
void Waypoint_Interface::fn_vSetCursor ( UINT i )
|
|
{
|
|
HINSTANCE hOldInst = AfxGetResourceHandle();
|
|
AfxSetResourceHandle( m_p_stDLLIdentity->hModule );
|
|
|
|
// change cursor
|
|
SetCursor (AfxGetApp()->LoadCursor (i));
|
|
|
|
AfxSetResourceHandle( hOldInst );
|
|
}
|
|
|
|
void Waypoint_Interface::fn_vSetCursor ( LPCTSTR lpszResourceName )
|
|
{
|
|
HINSTANCE hOldInst = AfxGetResourceHandle();
|
|
AfxSetResourceHandle( m_p_stDLLIdentity->hModule );
|
|
|
|
// change cursor
|
|
SetCursor (AfxGetApp()-> LoadStandardCursor (lpszResourceName));
|
|
|
|
AfxSetResourceHandle( hOldInst );
|
|
}
|
|
|
|
|
|
//----------- Lists
|
|
// edition
|
|
long Waypoint_Interface::OnQueryAction (CPA_EditorBase * pCallingDll, WPARAM wParam, LPARAM lParam)
|
|
{
|
|
|
|
switch (wParam)
|
|
{
|
|
case C_uiQueryEditAnObjectList:
|
|
{
|
|
tdstEdtListMess * pEdtListMess = (tdstEdtListMess *) lParam;
|
|
CPA_SuperObject * pSuperActor = (CPA_SuperObject*) pEdtListMess -> pActor;
|
|
|
|
if (!pEdtListMess->pList) return 0;
|
|
|
|
|
|
m_poActor = pSuperActor->GetObject();
|
|
m_poModel = m_poActor->GetOwner();
|
|
m_poFamilly = m_poModel->GetOwner();
|
|
m_poWayList = pEdtListMess->pList;
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
// replace all the NULL ways with empty ways
|
|
fn_vFillListOfWay ();
|
|
|
|
CPA_List<CPA_BaseObject> oEditWay;
|
|
*/
|
|
GetMainWorld () -> fn_bActivateEditor ( this , NULL );
|
|
/*
|
|
fn_vGetListOfWaySuperObject ( &oEditWay );
|
|
|
|
fn_vEditWayList ( &oEditWay );
|
|
GetMainWorld () -> fn_bActivateEditor ( this , &oEditWay );
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
}
|
|
break;
|
|
|
|
case C_uiQueryAnObjectHasBeenChanged :
|
|
{
|
|
tdstEdtListMess * pEdtListMess = (tdstEdtListMess *) lParam;
|
|
CPA_Object * pActor = (CPA_Object *) pEdtListMess -> pActor;
|
|
EdtList* poWayList = pEdtListMess->pList;
|
|
if (!pEdtListMess->pList->fn_hGetMotorList()) return 0;
|
|
|
|
unsigned long ulIndex = pEdtListMess->ulIndexInList;
|
|
// Way* poWay = (Way*) (m_poWayList->GetAt (poWayList->FindIndex (ulIndex)));
|
|
|
|
// if (poWay) -> add a valid way
|
|
// else -> a way is removed -> set null in engine list of way
|
|
// WP_tdhWay hWay = poWay ? (WP_tdhWay) poWay->GetStruct() : NULL;
|
|
// WAYLST_tdhHandleOfFatherListOfWay hEngineListOfWay = (WAYLST_tdhHandleOfFatherListOfWay)( pEdtListMess->pList->fn_hGetMotorList() );
|
|
|
|
|
|
// WAYLST_tdhHandleOfListOfWayElement hListOfWayElement = WAYLST_fn_h_GetElementInListOfWayAt(hEngineListOfWay,(unsigned short)ulIndex);
|
|
// WAYLST_fn_v_SetWayFromListOfWayElement(hListOfWayElement,hWay);
|
|
}
|
|
break;
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
case C_uiQueryCreateWayObject :
|
|
{
|
|
tdstCreateWayMess* pstCreateWayMess = (tdstCreateWayMess*)lParam;
|
|
return (long)fn_pCreateWayFromEngine ( pstCreateWayMess->hEngineWay, pstCreateWayMess->pOwner, pstCreateWayMess->csName, pstCreateWayMess->csReferenceSectionName );
|
|
}
|
|
break;
|
|
|
|
case C_uiQueryInsertWayObject :
|
|
{
|
|
// notify all EdtList
|
|
tdstEdtListMess* pEdtListMess = (tdstEdtListMess *) lParam;
|
|
EdtList* pEdtList = pEdtListMess->pList;
|
|
fn_vNotifyAllEdtList ( pEdtList->fn_oGetNameList() );
|
|
}
|
|
break;
|
|
|
|
|
|
case C_uiQueryDeleteWayObject :
|
|
{
|
|
// notify all EdtList
|
|
tdstEdtListMess* pEdtListMess = (tdstEdtListMess *) lParam;
|
|
EdtList* pEdtList = pEdtListMess->pList;
|
|
fn_vNotifyAllEdtList ( pEdtList->fn_oGetNameList() );
|
|
}
|
|
break;
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
|
|
void Waypoint_Interface::fn_vNotifyAllEdtList ( CPA_tdoNameList* poNameList )
|
|
{
|
|
CPA_List<CPA_BaseObject> oList;
|
|
|
|
long lNbNameList = GetInterface()->GetMainWorld()->fn_lFindObjects (&oList, "", C_szEdtListTypeName, poNameList );
|
|
if (lNbNameList==0) return;
|
|
|
|
POSITION xPos;
|
|
CPA_BaseObject* poBaseObject;
|
|
|
|
for (poBaseObject=oList.GetHeadElement(xPos); xPos; poBaseObject=oList.GetNextElement(xPos) )
|
|
{
|
|
EdtList* poEdtList = (EdtList*) poBaseObject;
|
|
poEdtList->fn_vNotifySave ();
|
|
}
|
|
}
|
|
|
|
|
|
// set the list in the dialog and select it
|
|
void Waypoint_Interface::fn_vEditWayList ( CPA_List<CPA_BaseObject>* poList )
|
|
{
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
POSITION xPos;
|
|
CPA_BaseObject* poBaseObject;
|
|
|
|
if (!m_p_oDialogList->GetListFromName ( csListOfWay )) m_p_oDialogList->fn_vAddANewList ( csListOfWay, &m_oSortedListOfWay, NULL, &m_oIconWayList,E_lo_Edited, FALSE, C_lDrawState | C_lDrawName | C_lDrawInfo, FALSE );
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
if (!m_p_oDialogList->GetListFromName ( csListOfActorModel )) m_p_oDialogList->fn_vAddANewList ( csListOfActorModel, &m_oSortedListOfObjectList );
|
|
if (!m_p_oDialogList->GetListFromName ( csListOfActorInstance )) m_p_oDialogList->fn_vAddANewList ( csListOfActorInstance, &m_oSortedListOfNameList );
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
CPA_ListForDialog *pListDialogOfWay = m_p_oDialogList->GetListFromName ( csListOfWay );
|
|
|
|
pListDialogOfWay->SetOrder ( E_lo_Edited );
|
|
|
|
CPA_BaseObjectList* pListOfWay = pListDialogOfWay->GetSortedList ();
|
|
|
|
// clear the list
|
|
pListOfWay->DeleteAllElements();
|
|
|
|
for ( poBaseObject = poList->GetHeadElement (xPos); xPos; poBaseObject = poList->GetNextElement (xPos) )
|
|
pListOfWay->fn_bAddObject ( ((CPA_SuperObject*)poBaseObject)->GetObject() );
|
|
|
|
// select way list
|
|
m_bListAlreadyCreated=TRUE;
|
|
m_p_oDialogList->SetCurrentType ( csListOfWay );
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
// set the ways in the hierarchy if usefull
|
|
fn_vRefreshScreen ();
|
|
}
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
void Waypoint_Interface::fn_vFillListOfWay (void)
|
|
{
|
|
long lCounter=0;
|
|
CPA_SaveObject* poSaveObject;
|
|
|
|
Way* poNewWayObject=NULL;
|
|
POSITION xPos;
|
|
CPA_tdoNameList* poNameList = m_poWayList->fn_oGetNameList();
|
|
|
|
for ( poSaveObject = m_poWayList->GetHeadElement (xPos), lCounter=0; xPos; poSaveObject = m_poWayList->GetNextElement (xPos), lCounter++ )
|
|
{
|
|
if (!poSaveObject)
|
|
{
|
|
POSITION xNamePos = poNameList->FindIndex (lCounter);
|
|
tdoObjectName* poName = poNameList->GetAt (xNamePos);
|
|
poNewWayObject=NULL;
|
|
if (poName->m_eGetShareMode()==E_sm_Common || poName->m_eGetShareMode()==E_sm_Shared)
|
|
{
|
|
|
|
POSITION xEdtListPos;
|
|
CPA_BaseObject* poBaseObject;
|
|
CPA_List<CPA_BaseObject> oEdtListList;
|
|
|
|
GetInterface()->GetMainWorld()->fn_lFindObjects (&oEdtListList, "", C_szEdtListTypeName, poNameList );
|
|
|
|
for (poBaseObject=oEdtListList.GetHeadElement (xEdtListPos); poBaseObject; poBaseObject=oEdtListList.GetNextElement (xEdtListPos) )
|
|
{
|
|
EdtList* poEdtList = (EdtList*) poBaseObject;
|
|
|
|
POSITION xReachablePos = poEdtList->FindIndex (lCounter);
|
|
CPA_BaseObject* poBaseObject = poEdtList->GetAt (xReachablePos);
|
|
if (poBaseObject)
|
|
{
|
|
poNewWayObject=(Way*)poBaseObject;
|
|
}
|
|
}
|
|
}
|
|
|
|
if (!poNewWayObject)
|
|
{
|
|
CPA_SuperObject* poNewWaySuperObject = fn_pCreateEmptyWay ("", m_poFamilly);
|
|
poNewWayObject = (Way*) poNewWaySuperObject->GetObject();
|
|
}
|
|
|
|
if (poName->m_eGetShareMode()==E_sm_Common||poName->m_eGetShareMode()==E_sm_Shared)
|
|
{
|
|
POSITION xEdtListPos;
|
|
CPA_BaseObject* poBaseObject;
|
|
CPA_List<CPA_BaseObject> oEdtListList;
|
|
|
|
GetInterface()->GetMainWorld()->fn_lFindObjects (&oEdtListList, "", C_szEdtListTypeName, poNameList );
|
|
|
|
for (poBaseObject=oEdtListList.GetHeadElement (xEdtListPos); poBaseObject; poBaseObject=oEdtListList.GetNextElement (xEdtListPos) )
|
|
{
|
|
EdtList* poEdtList = (EdtList*)poBaseObject;
|
|
POSITION xWayPos = poEdtList->FindIndex (lCounter);
|
|
Way* poWay = (Way*) poEdtList->GetAt (xWayPos);
|
|
|
|
if (poName->m_eGetShareMode()==E_sm_Common || !poWay)
|
|
{
|
|
poEdtList->SetAt ( xWayPos, poNewWayObject );
|
|
|
|
// engine
|
|
WP_tdhWay hWay = poNewWayObject->GetStruct();
|
|
WAYLST_tdhHandleOfFatherListOfWay hEngineListOfWay = (WAYLST_tdhHandleOfFatherListOfWay)( poEdtList->fn_hGetMotorList() );
|
|
WAYLST_tdhHandleOfListOfWayElement hListOfWayElement = WAYLST_fn_h_GetElementInListOfWayAt(hEngineListOfWay,(unsigned short)lCounter);
|
|
WAYLST_fn_v_SetWayFromListOfWayElement(hListOfWayElement,hWay);
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
m_poWayList->SetAt ( xPos, poNewWayObject );
|
|
|
|
// engine
|
|
WP_tdhWay hWay = poNewWayObject->GetStruct();
|
|
WAYLST_tdhHandleOfFatherListOfWay hEngineListOfWay = (WAYLST_tdhHandleOfFatherListOfWay)( m_poWayList->fn_hGetMotorList() );
|
|
WAYLST_tdhHandleOfListOfWayElement hListOfWayElement = WAYLST_fn_h_GetElementInListOfWayAt(hEngineListOfWay,(unsigned short)lCounter);
|
|
WAYLST_fn_v_SetWayFromListOfWayElement(hListOfWayElement,hWay);
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
void Waypoint_Interface::fn_vGetListOfWaySuperObject ( CPA_List<CPA_BaseObject>* poSuperObjectList )
|
|
{
|
|
poSuperObjectList->RemoveAll();
|
|
CPA_BaseObject* poBaseObject;
|
|
POSITION xPos;
|
|
|
|
for ( poBaseObject = m_poWayList->GetHeadElement (xPos); poBaseObject; poBaseObject = m_poWayList->GetNextElement (xPos) )
|
|
poSuperObjectList->AddTail ( ((Way*)poBaseObject)->GetSuperObject() );
|
|
}
|
|
|
|
|
|
// return a pointer on a new empty net
|
|
CPA_SuperObject* Waypoint_Interface::fn_pCreateEmptyWay (char* pszName, CPA_BaseObject* poFamilly)
|
|
{
|
|
//--- creation of the way
|
|
CPA_SuperObject* psoWay = GetInterface()->GetNewSuperObject ( E_ss_NoSave );
|
|
|
|
|
|
Way* poWay = new Way ( this, poFamilly );
|
|
|
|
// init objet
|
|
poWay->SetSuperObject (psoWay);
|
|
poWay->fn_vSetDefaultLink (WP_ConnType_ucStaticLine);
|
|
psoWay->SetObject(poWay);
|
|
psoWay->SetTypeSO (C_Dynamic);
|
|
|
|
return psoWay;
|
|
}
|
|
|
|
|
|
// create a copy of the way
|
|
CPA_SuperObject* Waypoint_Interface::fn_pCopyWay ( Way* poWay )
|
|
{
|
|
//--- creation of the way
|
|
CPA_SuperObject* psoCopyWay = GetInterface()->GetNewSuperObject ( E_ss_NoSave );
|
|
Way* poCopyWay = new Way ( *poWay );
|
|
|
|
// init objet
|
|
poCopyWay->SetSuperObject (psoCopyWay);
|
|
poCopyWay->fn_vSetDefaultLink (WP_ConnType_ucStaticLine);
|
|
psoCopyWay->SetObject(poCopyWay);
|
|
psoCopyWay->SetTypeSO (C_Dynamic);
|
|
|
|
fn_vSetRefreshWay (TRUE);
|
|
GetInterface()->fn_bInsertObjectInHierarchy (psoCopyWay, GetInterface()->GetSpecificInterface()->GetDynamicRoot(),FALSE,FALSE,FALSE );
|
|
poCopyWay->fn_vLoadFromEngine ();
|
|
GetInterface()->fn_bDeleteObjectInHierarchy (psoCopyWay,FALSE,FALSE,FALSE,FALSE);
|
|
fn_vSetRefreshWay (FALSE);
|
|
|
|
return psoCopyWay;
|
|
}
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
void Waypoint_Interface::fn_vEditListOfWay ( CPA_BaseObject* poActorInstance )
|
|
{
|
|
m_poActor = poActorInstance;
|
|
m_poWayList = fn_poGetEdtListUseByActor (poActorInstance);
|
|
|
|
if (m_poWayList)
|
|
{
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
// if (!m_p_oDialogList->GetListFromName ( csListOfWay )) m_p_oDialogList->fn_vAddANewList ( csListOfWay, &m_oSortedListOfWay, NULL, &m_oIconWayList,E_lo_Edited, FALSE, C_lDrawState | C_lDrawName | C_lDrawInfo, FALSE );
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
if (!m_p_oDialogList->GetListFromName ( csListOfActorModel )) m_p_oDialogList->fn_vAddANewList ( csListOfActorModel, &m_oSortedListOfObjectList );
|
|
if (!m_p_oDialogList->GetListFromName ( csListOfActorInstance )) m_p_oDialogList->fn_vAddANewList ( csListOfActorInstance, &m_oSortedListOfNameList );
|
|
|
|
GetMainWorld () -> fn_bActivateEditor ( this , NULL );
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
CPA_List<CPA_BaseObject> oEditWay;
|
|
fn_vFillListOfWay ();
|
|
fn_vGetListOfWaySuperObject ( &oEditWay );
|
|
fn_vEditWayList ( &oEditWay );
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
}
|
|
else
|
|
{
|
|
if (!m_p_oDialogList->GetListFromName ( csListOfActorModel )) m_p_oDialogList->fn_vAddANewList ( csListOfActorModel, &m_oSortedListOfObjectList );
|
|
if (!m_p_oDialogList->GetListFromName ( csListOfActorInstance )) m_p_oDialogList->fn_vAddANewList ( csListOfActorInstance, &m_oSortedListOfObjectList );
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
m_p_oDialogList->fn_vDeleteAList ( csListOfWay );
|
|
m_poWay=NULL;
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
//--- edit instances
|
|
fn_vEditListOfActorInstance ( m_poModel, TRUE );
|
|
}
|
|
|
|
}
|
|
|
|
// search the list of model of a family
|
|
void Waypoint_Interface::fn_vEditListOfActorModel ( CPA_BaseObject* poFamilly, BOOL bChange )
|
|
{
|
|
POSITION xPos;
|
|
CPA_BaseObject* poBaseObject;
|
|
CPA_List<CPA_BaseObject> oList;
|
|
long nb = GetInterface()->GetMainWorld()->fn_lFindObjects (&oList, "", C_szActorModelTypeName, poFamilly);
|
|
|
|
if (nb)
|
|
{
|
|
CPA_ListForDialog *pListDialog = m_p_oDialogList->GetListFromName ( csListOfActorModel );
|
|
CPA_BaseObjectList* pList = pListDialog->GetSortedList ();
|
|
pList->DeleteAllElements();
|
|
|
|
for ( poBaseObject = oList.GetHeadElement (xPos); xPos; poBaseObject = oList.GetNextElement (xPos) )
|
|
pList->fn_bAddObject ( poBaseObject );
|
|
|
|
// select list of way
|
|
if (bChange)
|
|
{
|
|
m_bListAlreadyCreated=TRUE;
|
|
m_p_oDialogList->SetCurrentType ( csListOfActorModel );
|
|
}
|
|
}
|
|
oList.RemoveAll ();
|
|
}
|
|
|
|
// search the list of instance of a given model
|
|
void Waypoint_Interface::fn_vEditListOfActorInstance ( CPA_BaseObject* poActorModel, BOOL bChange )
|
|
{
|
|
POSITION xPos;
|
|
CPA_BaseObject* poBaseObject;
|
|
|
|
CPA_List<CPA_BaseObject> oList;
|
|
long nb = GetInterface()->GetMainWorld()->fn_lFindObjects (&oList, "", C_szActorInstanceTypeName, poActorModel);
|
|
|
|
if (nb)
|
|
{
|
|
CPA_ListForDialog *pListDialog = m_p_oDialogList->GetListFromName ( csListOfActorInstance );
|
|
CPA_BaseObjectList* pList = pListDialog->GetSortedList ();
|
|
pList->DeleteAllElements ();
|
|
|
|
for ( poBaseObject = oList.GetHeadElement (xPos); xPos; poBaseObject = oList.GetNextElement (xPos) )
|
|
pList->fn_bAddObject ( poBaseObject );
|
|
|
|
// select list of way
|
|
if (bChange)
|
|
{
|
|
m_bListAlreadyCreated=TRUE;
|
|
m_p_oDialogList->SetCurrentType ( csListOfActorInstance );
|
|
}
|
|
}
|
|
oList.RemoveAll ();
|
|
}
|
|
|
|
void Waypoint_Interface::fn_vEditListOfFamilly ( BOOL bChange )
|
|
{
|
|
Position xPos;
|
|
CPA_BaseObject* poBaseObject;
|
|
CPA_BaseObjectList* poList = GetInterface()->GetMainWorld()->fn_p_oGetOriginalObjectList (C_szFamilyTypeName);
|
|
|
|
if (poList->GetCount())
|
|
{
|
|
CPA_ListForDialog *pListDialog = m_p_oDialogList->GetListFromName ( csListOfFamilly );
|
|
CPA_BaseObjectList* pList = pListDialog->GetSortedList ();
|
|
pList->DeleteAllElements ();
|
|
|
|
|
|
for ( poBaseObject = poList->GetHeadElement (xPos); xPos; poBaseObject = poList->GetNextElement (xPos) )
|
|
pList->fn_bAddObject ( poBaseObject );
|
|
|
|
// select list of way
|
|
if (bChange)
|
|
{
|
|
m_bListAlreadyCreated=TRUE;
|
|
m_p_oDialogList->SetCurrentType ( csListOfFamilly );
|
|
}
|
|
}
|
|
}
|
|
|
|
// this function return the owner of a given list
|
|
CPA_BaseObject* Waypoint_Interface::fn_pGetOwnerOfList ( CString csTypeList )
|
|
{
|
|
CPA_ListForDialog *pListDialog = m_p_oDialogList->GetListFromName ( csTypeList );
|
|
|
|
// the list doesn't exist
|
|
ASSERT (pListDialog);
|
|
|
|
CPA_BaseObjectList* pList = pListDialog->GetSortedList ();
|
|
return pList->GetHead()->GetOwner()->GetOwner();
|
|
}
|
|
|
|
BOOL Waypoint_Interface::fn_bIsSuperObjectInStaticHierarchy (CPA_SuperObject* poSuperObject)
|
|
{
|
|
CPA_SuperObject* poParent=poSuperObject;
|
|
if (!poParent) return FALSE;
|
|
BOOL bStaticRoot = (poParent==GetInterface()->GetSpecificInterface()->GetStaticRoot());
|
|
BOOL bDynamicRoot = (poParent==GetInterface()->GetSpecificInterface()->GetDynamicRoot());
|
|
while (!bStaticRoot&&!bDynamicRoot)
|
|
{
|
|
poParent=(CPA_SuperObject*)(poParent->GetParent());
|
|
bStaticRoot = (poParent==GetInterface()->GetSpecificInterface()->GetStaticRoot());
|
|
bDynamicRoot = (poParent==GetInterface()->GetSpecificInterface()->GetDynamicRoot());
|
|
if (!poParent) return FALSE;
|
|
}
|
|
return bStaticRoot;
|
|
}
|
|
|
|
void Waypoint_Interface::fn_vCreateVirtualWaypoint (void)
|
|
{
|
|
WayPoint* poWP = new WayPoint ( this, TRUE, "VirtualWP", FALSE );
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
// Way::fn_vSetVirtualWP ( poWP );
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
}
|
|
|
|
void Waypoint_Interface::fn_vDeleteVirtualWaypoint (void)
|
|
{
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
// delete Way::fn_pGetVirtualWP ();
|
|
// Way::fn_vSetVirtualWP ( NULL );
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
}
|
|
|
|
BOOL Waypoint_Interface::fn_bIsSubSectionInSection ( CString csFullPath, CString csSearchPath )
|
|
{
|
|
CString csSearchString = "^" + csSearchPath + "^";
|
|
return csFullPath.Find ( csSearchString )>=0;
|
|
}
|
|
|
|
void Waypoint_Interface::fn_vInitGameMaterial ( Geometry3D* poGeomObject, ACP_tdxHandleOfElement hElement, float fR, float fG, float fB )
|
|
{
|
|
GMT_tdxHandleToGameMaterial hGameMaterial = GMT_fn_hCreateGameMaterial();
|
|
ACP_tdxHandleOfMaterial hMaterial;
|
|
GLI_xCreateMaterial ( &hMaterial ) ;
|
|
GMT_fn_vSetVisualMaterial (hGameMaterial, hMaterial);
|
|
GEO_tdstColor stColor;
|
|
stColor.xR = fR;
|
|
stColor.xG = fG;
|
|
stColor.xB = fB;
|
|
stColor.xA = 1.f;
|
|
GLI_xSetMaterialAmbientCoef ( hMaterial, &stColor);
|
|
GLI_xSetMaterialType ( hMaterial, C_lGouraudElement );
|
|
poGeomObject->fn_vSetEngineGameMaterial (hElement, 0, hGameMaterial );
|
|
}
|
|
|
|
EdtList* Waypoint_Interface::fn_poGetEdtListUseByActor (CPA_BaseObject* poActorInstance)
|
|
{
|
|
tdstEdtListMess stEdtListMess;
|
|
stEdtListMess.csListType = C_szWayName;
|
|
stEdtListMess.pActor = poActorInstance;
|
|
|
|
return (EdtList*) GetInterface()->GetMainWorld()->GetObjectDLLWithName(C_szDLLActorName)->OnQueryAction (this, C_uiActor_GetAnObjectList , (long)&stEdtListMess);
|
|
}
|
|
|
|
|
|
CPA_BaseObject* Waypoint_Interface::fn_pGetActorUsingAList (EdtList* poEdtList)
|
|
{
|
|
return (CPA_BaseObject*) GetInterface()->GetMainWorld()->GetObjectDLLWithName(C_szDLLActorName)->OnQueryAction (this, C_uiActor_GetFirstActorUsingThisList , (long)poEdtList);
|
|
}
|
|
|
|
//ANNECY Shaitan Nettoyage (12/05/98) {
|
|
/*
|
|
BOOL Waypoint_Interface::fn_bComputeRealWay (Way** ppoWay)
|
|
{
|
|
Way* poWay = *ppoWay;
|
|
Way* poRealWay = NULL;
|
|
if (!poWay->fn_bIsCommon())
|
|
{
|
|
if (poWay->fn_lUsedInEdtList()>1)
|
|
{
|
|
// we have to change the object
|
|
EdtList* poEdtList = fn_pGetSelectedEdtList ();
|
|
|
|
long lIndex=0;
|
|
CPA_SaveObject* poSaveObject;
|
|
POSITION xPos;
|
|
for ( poSaveObject=poEdtList->GetHeadElement(xPos); poSaveObject && poSaveObject!=poWay; poSaveObject=poEdtList->GetNextElement(xPos), lIndex++ );
|
|
|
|
// we must find m_pElasticWay in current edtlist
|
|
ASSERT (poSaveObject);
|
|
|
|
if (poWay->IsWayEmpty())
|
|
{
|
|
// The way is empty -> we create a new one
|
|
CPA_SuperObject* poEmptyWaySuperObject = fn_pCreateEmptyWay ("",m_poFamilly);
|
|
poRealWay = (Way*)poEmptyWaySuperObject->GetObject();
|
|
|
|
m_bRefreshWay=TRUE;
|
|
GetInterface()->fn_bInsertObjectInHierarchy (poEmptyWaySuperObject, GetInterface()->GetSpecificInterface()->GetDynamicRoot (), FALSE, FALSE, FALSE);
|
|
m_bRefreshWay=FALSE;
|
|
}
|
|
else
|
|
{
|
|
// We make a copy of the way
|
|
CPA_SuperObject* poCopyWaySuperObject = fn_pCopyWay ( poWay );
|
|
poRealWay = (Way*)poCopyWaySuperObject->GetObject();
|
|
|
|
// insert in hierarchy
|
|
m_bRefreshWay=TRUE;
|
|
GetInterface()->fn_bInsertObjectInHierarchy (poCopyWaySuperObject, GetInterface()->GetSpecificInterface()->GetDynamicRoot (), FALSE, FALSE, FALSE);
|
|
m_bRefreshWay=FALSE;
|
|
}
|
|
|
|
tdstEdtListMess stEdtListMess;
|
|
stEdtListMess.csListType = CString ("Way");
|
|
stEdtListMess.pActor = m_poActor;
|
|
stEdtListMess.ulIndexInList = lIndex;
|
|
stEdtListMess.pObject = poRealWay;
|
|
|
|
GetMainWorld()->GetObjectDLLWithName(C_szDLLActorName)->OnQueryAction (this, C_uiActor_SetAnObjectInObjectList,(long)&stEdtListMess);
|
|
|
|
CPA_List<CPA_BaseObject> oEditWay;
|
|
fn_vGetListOfWaySuperObject ( &oEditWay );
|
|
fn_vEditWayList ( &oEditWay );
|
|
|
|
*ppoWay = poRealWay;
|
|
return TRUE;
|
|
}
|
|
}
|
|
return FALSE;
|
|
}
|
|
*/
|
|
//ENDANNECY Shaitan Nettoyage }
|
|
|
|
|
|
void Waypoint_Interface::fn_vCleanHierarchy (void)
|
|
{
|
|
POSITION xPos;
|
|
CPA_SuperObject* poSuperObject;
|
|
CPA_List<CPA_SuperObject> * p_oWayList = GetInterface()->GetObjectListByType("Way");
|
|
CPA_List<CPA_SuperObject> * p_oWPList = GetInterface()->GetObjectListByType("Waypoint");
|
|
|
|
CPA_List<CPA_SuperObject> oSuperObjectList;
|
|
|
|
if (p_oWayList) oSuperObjectList.AddTail(p_oWayList);
|
|
if (p_oWPList) oSuperObjectList.AddTail(p_oWPList);
|
|
|
|
m_bSkipOnModifDelete=TRUE;
|
|
m_bModifDeleteOk=TRUE;
|
|
if (oSuperObjectList.GetCount())
|
|
for (poSuperObject=oSuperObjectList.GetHeadElement(xPos); poSuperObject; poSuperObject=oSuperObjectList.GetNextElement(xPos) )
|
|
GetInterface()->fn_bDeleteObjectInHierarchy (poSuperObject, FALSE, FALSE, FALSE, FALSE, FALSE);
|
|
m_bSkipOnModifDelete=FALSE;
|
|
m_bModifDeleteOk=FALSE;
|
|
GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
|
|
}
|
|
|
|
|
|
// Shaitan Correction {
|
|
void Waypoint_Interface::SetDisplayMode (tdeLinkDisplayMode eNewMode)
|
|
{
|
|
// update display mode
|
|
m_eDisplayMode = eNewMode;
|
|
|
|
// update drawing
|
|
fn_vUpdateConnections();
|
|
}
|
|
|
|
void Waypoint_Interface::fn_vSelectGraph (Graph *pGraph)
|
|
{
|
|
Graph *pOldGraph = m_pSelectedGraph;
|
|
|
|
if (m_pSelectedGraph == pGraph)
|
|
return;
|
|
|
|
// update selection
|
|
m_pSelectedGraph = pGraph;
|
|
m_pDisplayedWayPoint = NULL;
|
|
m_eSelectMode = E_sm_Normal;
|
|
|
|
// update dialog
|
|
Graph::fn_pGetDialog()->fn_vSelectGraph(pGraph);
|
|
|
|
// update drawing
|
|
if (pOldGraph)
|
|
pOldGraph->fn_vShowWaypoints(FALSE);
|
|
|
|
switch (m_eDisplayMode)
|
|
{
|
|
case E_dm_ShowAllLinks:
|
|
if (pOldGraph)
|
|
pOldGraph->fn_vDisplayAllLinks(FALSE, TRUE);
|
|
if (m_pSelectedGraph)
|
|
m_pSelectedGraph->fn_vDisplayAllLinks(TRUE, TRUE);
|
|
break;
|
|
|
|
case E_dm_ShowOutLinks:
|
|
case E_dm_ShowInLinks:
|
|
if (pOldGraph)
|
|
pOldGraph->fn_vDisplayAllLinks(FALSE, TRUE);
|
|
break;
|
|
|
|
default:
|
|
GetInterface()->fn_vUpdateAll(E_mc_JustDraw);
|
|
}
|
|
}
|
|
|
|
void Waypoint_Interface::fn_vSetDisplayedWaypoint (WayPoint *pWaypoint, BOOL bCenter)
|
|
{
|
|
// check if waypoint must be changed
|
|
if (m_pDisplayedWayPoint == pWaypoint)
|
|
return;
|
|
|
|
// select waypoint
|
|
GetInterface()->fn_bSelectObject ((pWaypoint) ? pWaypoint->GetSuperObject() : NULL, bCenter);
|
|
fn_vEdit(pWaypoint);
|
|
|
|
// check graph
|
|
if (!m_pSelectedGraph || (pWaypoint && !m_pSelectedGraph->fn_bHasNode(pWaypoint)))
|
|
return;
|
|
|
|
// update selection
|
|
m_pDisplayedWayPoint = pWaypoint;
|
|
|
|
// update dialog
|
|
Graph::fn_pGetDialog()->fn_vSelectNode(m_pSelectedGraph, pWaypoint);
|
|
|
|
// update drawing
|
|
switch (m_eDisplayMode)
|
|
{
|
|
case E_dm_ShowOutLinks:
|
|
if (m_pDisplayedWayPoint)
|
|
m_pSelectedGraph->fn_vDisplayOutLinks(m_pDisplayedWayPoint, TRUE);
|
|
else
|
|
m_pSelectedGraph->fn_vDisplayAllLinks(FALSE, TRUE);
|
|
break;
|
|
|
|
case E_dm_ShowInLinks:
|
|
if (m_pDisplayedWayPoint)
|
|
m_pSelectedGraph->fn_vDisplayInLinks(m_pDisplayedWayPoint, TRUE);
|
|
else
|
|
m_pSelectedGraph->fn_vDisplayAllLinks(FALSE, TRUE);
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
void Waypoint_Interface::fn_vUpdateConnections (void)
|
|
{
|
|
// update drawing
|
|
switch (m_eDisplayMode)
|
|
{
|
|
case E_dm_ShowAllLinks:
|
|
if (m_pSelectedGraph)
|
|
m_pSelectedGraph->fn_vDisplayAllLinks(TRUE, TRUE);
|
|
break;
|
|
|
|
case E_dm_ShowOutLinks:
|
|
if (m_pSelectedGraph && m_pDisplayedWayPoint)
|
|
m_pSelectedGraph->fn_vDisplayOutLinks(m_pDisplayedWayPoint, TRUE);
|
|
break;
|
|
|
|
case E_dm_ShowInLinks:
|
|
if (m_pSelectedGraph && m_pDisplayedWayPoint)
|
|
m_pSelectedGraph->fn_vDisplayInLinks(m_pDisplayedWayPoint, TRUE);
|
|
break;
|
|
|
|
case E_dm_ShowNothing:
|
|
if (m_pSelectedGraph)
|
|
m_pSelectedGraph->fn_vDisplayAllLinks(FALSE, TRUE);
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
void Waypoint_Interface::fn_vUpdateEditor (tdeModeChange eMode)
|
|
{
|
|
// update drawing
|
|
if (m_pSelectedGraph)
|
|
m_pSelectedGraph->fn_vShowWaypoints(TRUE);
|
|
}
|
|
|
|
/*===========================================================================
|
|
KeyDown
|
|
=========================================================================*/
|
|
BOOL Waypoint_Interface::_OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
|
|
{
|
|
switch (m_p_oKeyboard->mfn_uwKeyToAction(nChar))
|
|
{
|
|
// display
|
|
case KA_ID_SHOWALL:
|
|
SetDisplayMode(E_dm_ShowAllLinks);
|
|
return TRUE;
|
|
case KA_ID_SHOWOUT:
|
|
SetDisplayMode(E_dm_ShowOutLinks);
|
|
return TRUE;
|
|
case KA_ID_SHOWIN:
|
|
SetDisplayMode(E_dm_ShowInLinks);
|
|
return TRUE;
|
|
case KA_ID_SHOWNONE:
|
|
SetDisplayMode(E_dm_ShowNothing);
|
|
return TRUE;
|
|
|
|
// nodes
|
|
case KA_ID_ADDORREMOVEWP:
|
|
m_eSelectMode = E_sm_AddOrRemoveWP;
|
|
return TRUE;
|
|
|
|
// connections
|
|
case KA_ID_NEXTWP:
|
|
m_eSelectMode = E_sm_NextWP_Key;
|
|
return TRUE;
|
|
case KA_ID_PREVWP:
|
|
m_eSelectMode = E_sm_PrevWP_Key;
|
|
return TRUE;
|
|
case KA_ID_NEXTWPCONTINUE:
|
|
m_eSelectMode = E_sm_NextWP_Continue;
|
|
return TRUE;
|
|
case KA_ID_PREVWPCONTINUE:
|
|
m_eSelectMode = E_sm_PrevWP_Continue;
|
|
return TRUE;
|
|
|
|
// not an editor key
|
|
default :
|
|
break;
|
|
}
|
|
|
|
//key not processed
|
|
return FALSE;
|
|
}
|
|
|
|
|
|
/*===========================================================================
|
|
KeyUp
|
|
=========================================================================*/
|
|
BOOL Waypoint_Interface::_OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
|
|
{
|
|
switch (m_p_oKeyboard->mfn_uwKeyToAction(nChar))
|
|
{
|
|
// nodes
|
|
case KA_ID_ADDORREMOVEWP:
|
|
m_eSelectMode = E_sm_Normal;
|
|
return TRUE;
|
|
|
|
// connections
|
|
case KA_ID_NEXTWP:
|
|
case KA_ID_PREVWP:
|
|
case KA_ID_NEXTWPCONTINUE:
|
|
case KA_ID_PREVWPCONTINUE:
|
|
m_eSelectMode = E_sm_Normal;
|
|
return TRUE;
|
|
|
|
default :
|
|
break;
|
|
}
|
|
|
|
|
|
//key not processed
|
|
return FALSE;
|
|
}
|
|
|
|
/*===========================================================================
|
|
Visual
|
|
=========================================================================*/
|
|
CPA_SuperObject * Waypoint_Interface::GetVisualSuperObject (CPA_SuperObject *pInstance)
|
|
{
|
|
WayPoint *poWaypoint = (WayPoint *) pInstance->GetObject();
|
|
|
|
if (!poWaypoint->fn_bIsGeneralRealDraw())
|
|
return poWaypoint->GetSymbolicalGraphic();
|
|
else
|
|
return NULL;
|
|
}
|
|
//End Shaitan Correction }
|
|
|