Add rayman2 source files

This commit is contained in:
2024-09-18 02:33:44 +08:00
parent bcc093f8ed
commit fb036c54fd
14339 changed files with 2596224 additions and 0 deletions

View File

@@ -0,0 +1,342 @@
# Microsoft Developer Studio Project File - Name="OWP" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 5.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=OWP - Win32 Debug Glide with Editors
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "Owp.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "Owp.mak" CFG="OWP - Win32 Debug Glide with Editors"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "OWP - Win32 Debug with Editors" (based on\
"Win32 (x86) Dynamic-Link Library")
!MESSAGE "OWP - Win32 Debug Glide with Editors" (based on\
"Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP Scc_ProjName ""$/CPA/TempGrp/Owp", NHEAAAAA"
# PROP Scc_LocalPath "."
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "OWP - Win32 Debug with Editors"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug with Editors"
# PROP BASE Intermediate_Dir "Debug with Editors"
# PROP BASE Target_Dir ""
# PROP Use_MFC 2
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "x:\CPA\EXE\GAM\edt_data\objects"
# PROP Intermediate_Dir "Tmp\OWPP5Evd"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "X:\CPA\Public" /I "inc" /I "X:\CPA\Public\Ai\AiBase" /D "CPA_WANTS_IMPORT" /D "ACTIVE_EDITOR" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "CPA_VISUAL" /D "CPA_DEBUG" /D "_WINDLL" /D "_AFXDLL" /D "USE_ALTIMAPS" /FR /YX /FD /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
# ADD BASE RSC /l 0x40c /d "_DEBUG"
# ADD RSC /l 0x40c /d "_DEBUG" /d "_AFXDLL"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 X:\CPA\Exe\GAM\GAMP5Evd.lib X:\CPA\Exe\Gam\Edt_data\objects\OGDP5Evd.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"X:\CPA\EXE\GAM\EDT_Data\Objects\OWPP5Evd.dll" /pdbtype:sept
# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "OWP - Win32 Debug Glide with Editors"
# PROP BASE Use_MFC 2
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug Glide with Editors"
# PROP BASE Intermediate_Dir "Debug Glide with Editors"
# PROP BASE Target_Dir ""
# PROP Use_MFC 2
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "x:\CPA\EXE\Main\edt_data\objects"
# PROP Intermediate_Dir "Tmp\OWPDFEvd"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "X:\CPA\Public" /D "CPA_WANTS_IMPORT" /D "ACTIVE_EDITOR" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "CPA_VISUAL" /D "CPA_DEBUG" /D "_WINDLL" /D "_AFXDLL" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /Z7 /Od /I "X:\CPA\Public" /I "inc" /I "res" /I "X:\CPA\Public\ai\aibase" /I "t:\dxsdk\sdk\inc" /D "CPA_WANTS_IMPORT" /D "ACTIVE_EDITOR" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "CPA_VISUAL" /D "CPA_DEBUG" /D "_WINDLL" /D "_AFXDLL" /D "USE_ALTIMAPS" /Fr /YX /FD /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
# ADD BASE RSC /l 0x40c /d "_DEBUG" /d "_AFXDLL"
# ADD RSC /l 0x40c /i "inc" /d "_DEBUG" /d "_AFXDLL"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 X:\CPA\Exe\GAM\GAMP5Evd.lib /nologo /subsystem:windows /dll /pdb:"x:\CPA\EXE\GAMEDT_Data\Tools\OWPP5Evd.pdb" /debug /machine:I386 /out:"X:\CPA\EXE\GAM\EDT_Data\Tools\OWPP5Evd.dll" /pdbtype:sept
# SUBTRACT BASE LINK32 /pdb:none
# ADD LINK32 /nologo /subsystem:windows /dll /profile /debug /machine:I386 /nodefaultlib:"msvcrtd.lib" /out:"X:\CPA\EXE\Main\EDT_Data\objects\OWPDFEvd.dll"
!ENDIF
# Begin Target
# Name "OWP - Win32 Debug with Editors"
# Name "OWP - Win32 Debug Glide with Editors"
# Begin Group "header files"
# PROP Default_Filter "h;hpp"
# Begin Source File
SOURCE=.\inc\CurObj.hpp
# End Source File
# Begin Source File
SOURCE=.\inc\editdia.h
# End Source File
# Begin Source File
SOURCE=.\inc\Inter.hpp
# End Source File
# Begin Source File
SOURCE=.\inc\isowpdia.hpp
# End Source File
# Begin Source File
SOURCE=.\inc\ntwdia.hpp
# End Source File
# Begin Source File
SOURCE=.\inc\NtwMod.hpp
# End Source File
# Begin Source File
SOURCE=.\inc\NtwObj.hpp
# End Source File
# Begin Source File
SOURCE=..\..\Public\Owp.h
# End Source File
# Begin Source File
SOURCE=..\..\Public\owp\Query.h
# End Source File
# Begin Source File
SOURCE=.\inc\StdAfx.h
# End Source File
# Begin Source File
SOURCE=.\inc\WPDia.hpp
# End Source File
# Begin Source File
SOURCE=.\inc\WPMod.hpp
# End Source File
# Begin Source File
SOURCE=.\inc\WPObj.hpp
# End Source File
# End Group
# Begin Group "source files"
# PROP Default_Filter "c;cpp"
# Begin Source File
SOURCE=.\src\CurObj.cpp
# End Source File
# Begin Source File
SOURCE=.\src\DLLCom.cpp
# End Source File
# Begin Source File
SOURCE=.\src\editdia.cpp
# End Source File
# Begin Source File
SOURCE=.\src\Inter.cpp
# ADD CPP /I "X:\CPA\Public\Gam"
# End Source File
# Begin Source File
SOURCE=.\src\isowpdia.cpp
# End Source File
# Begin Source File
SOURCE=.\src\ntwdia.cpp
# End Source File
# Begin Source File
SOURCE=.\src\NtwMod.cpp
# End Source File
# Begin Source File
SOURCE=.\src\NtwObj.cpp
# End Source File
# Begin Source File
SOURCE=.\src\StdAfx.cpp
# End Source File
# Begin Source File
SOURCE=.\src\Waypoint.def
# End Source File
# Begin Source File
SOURCE=.\src\WPDia.cpp
# End Source File
# Begin Source File
SOURCE=.\src\WPMod.cpp
# End Source File
# Begin Source File
SOURCE=.\src\WPObj.cpp
!IF "$(CFG)" == "OWP - Win32 Debug with Editors"
# ADD CPP /I "x:\CPA\Public\Ai"
!ELSEIF "$(CFG)" == "OWP - Win32 Debug Glide with Editors"
!ENDIF
# End Source File
# End Group
# Begin Group "resource files"
# PROP Default_Filter ""
# Begin Source File
SOURCE=.\res\add_wp.cur
# End Source File
# Begin Source File
SOURCE=.\res\arrow.cur
# End Source File
# Begin Source File
SOURCE=.\res\bitmap1.bmp
# End Source File
# Begin Source File
SOURCE=.\res\bmp00001.bmp
# End Source File
# Begin Source File
SOURCE=.\res\cur00001.cur
# End Source File
# Begin Source File
SOURCE=.\res\cur00002.cur
# End Source File
# Begin Source File
SOURCE=.\res\ico00001.ico
# End Source File
# Begin Source File
SOURCE=.\res\ico00002.ico
# End Source File
# Begin Source File
SOURCE=.\res\icon1.ico
# End Source File
# Begin Source File
SOURCE=.\res\icon2.ico
# End Source File
# Begin Source File
SOURCE=.\res\owp_dlgb.ico
# End Source File
# Begin Source File
SOURCE=.\res\pointer_.cur
# End Source File
# Begin Source File
SOURCE=.\res\radius_m.cur
# End Source File
# Begin Source File
SOURCE=.\res\realwp.ico
# End Source File
# Begin Source File
SOURCE=.\res\resource.h
# End Source File
# Begin Source File
SOURCE=.\res\symbolic.ico
# End Source File
# Begin Source File
SOURCE=.\res\Way.ico
# End Source File
# Begin Source File
SOURCE=.\res\WPDia.clw
# End Source File
# Begin Source File
SOURCE=.\res\WPDia.rc
# End Source File
# End Group
# Begin Group "other files"
# PROP Default_Filter "*"
# Begin Source File
SOURCE=..\..\Exe\Main\EDT_DATA\objects\waypoint\DynWP.bmp
# End Source File
# Begin Source File
SOURCE=..\..\exe\main\edt_data\objects\waypoint\OWPKeys.ini
# End Source File
# Begin Source File
SOURCE=..\..\Exe\Main\EDT_DATA\objects\waypoint\StatWP.bmp
# End Source File
# Begin Source File
SOURCE=..\..\Exe\Main\EDT_DATA\objects\waypoint\Way.bmp
# End Source File
# Begin Source File
SOURCE=..\..\Exe\Main\EDT_DATA\objects\waypoint\waypoint.cnt
# End Source File
# Begin Source File
SOURCE=..\..\Exe\Main\EDT_DATA\objects\waypoint\WAYPOINT.HLP
# End Source File
# Begin Source File
SOURCE=..\..\exe\main\edt_data\objects\waypoint\Waypoint.ini
# End Source File
# End Group
# Begin Group "lib"
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\Exe\Main\MaiDFEvd.lib
# End Source File
# Begin Source File
SOURCE=..\..\Exe\Main\Edt_Data\objects\OGDDFEvd.lib
# End Source File
# End Group
# End Target
# End Project

View File

@@ -0,0 +1,562 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="OWP"
ProjectGUID="{666C94B9-282C-4C15-B9EA-0AB2D57DAA48}"
SccProjectName="&quot;$/CPA/TempGrp/Owp&quot;, NHEAAAAA"
SccAuxPath=""
SccLocalPath="."
SccProvider="MSSCCI:NXN alienbrain"
Keyword="MFCProj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug with Editors|Win32"
OutputDirectory="x:\CPA\EXE\GAM\edt_data\objects"
IntermediateDirectory=".\Tmp\OWPP5Evd"
ConfigurationType="2"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="X:\CPA\Public;inc;X:\CPA\Public\Ai\AiBase;res"
PreprocessorDefinitions="CPA_WANTS_IMPORT;ACTIVE_EDITOR;WIN32;_DEBUG;_WINDOWS;CPA_VISUAL;CPA_DEBUG;USE_ALTIMAPS"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Tmp\OWPP5Evd/OWP.pch"
AssemblerListingLocation=".\Tmp\OWPP5Evd/"
ObjectFile=".\Tmp\OWPP5Evd/"
ProgramDataBaseFileName=".\Tmp\OWPP5Evd/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="X:\CPA\libd\GAMP5Evd.lib X:\CPA\Exe\main\Edt_data\objects\OGDdfEvd.lib"
OutputFile="X:\CPA\EXE\GAM\EDT_Data\Objects\OWPP5Evd.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ModuleDefinitionFile=".\src\Waypoint.def"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="x:\CPA\EXE\GAM\edt_data\objects/OWPP5Evd.pdb"
SubSystem="2"
ImportLibrary="x:\CPA\EXE\GAM\edt_data\objects/OWPP5Evd.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName="x:\CPA\EXE\GAM\edt_data\objects/OWP.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1036"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Debug Glide with Editors|Win32"
OutputDirectory="x:\CPA\EXE\Main\edt_data\objects"
IntermediateDirectory=".\Tmp\OWPDFEvd"
ConfigurationType="2"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="X:\CPA\Public,inc,res,X:\CPA\Public\ai\aibase,t:\dxsdk\sdk\inc"
PreprocessorDefinitions="CPA_WANTS_IMPORT;ACTIVE_EDITOR;WIN32;_DEBUG;_WINDOWS;CPA_VISUAL;CPA_DEBUG;USE_ALTIMAPS"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Tmp\OWPDFEvd/OWP.pch"
AssemblerListingLocation=".\Tmp\OWPDFEvd/"
ObjectFile=".\Tmp\OWPDFEvd/"
ProgramDataBaseFileName=".\Tmp\OWPDFEvd/"
BrowseInformation="1"
BrowseInformationFile=".\Tmp\OWPDFEvd/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="1"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="maidfevd.lib ogddfevd.lib"
OutputFile="X:\CPA\EXE\Main\EDT_Data\objects\OWPDFEvd.dll"
LinkIncremental="2"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="X:\cpa\exe\main\edt_data\objects;X:\cpa\exe\main\edt_data;X:\cpa\exe\main;X:\cpa\libd"
IgnoreDefaultLibraryNames=""
ModuleDefinitionFile=".\src\Waypoint.def"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="x:\CPA\EXE\Main\edt_data\objects/OWPDFEvd.pdb"
SubSystem="2"
ImportLibrary="x:\CPA\EXE\Main\edt_data\objects/OWPDFEvd.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName="x:\CPA\EXE\Main\edt_data\objects/OWP.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1036"
AdditionalIncludeDirectories="inc"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="header files"
Filter="h;hpp">
<File
RelativePath="inc\CurObj.hpp">
</File>
<File
RelativePath="inc\editdia.h">
</File>
<File
RelativePath="inc\Inter.hpp">
</File>
<File
RelativePath="inc\isowpdia.hpp">
</File>
<File
RelativePath="inc\ntwdia.hpp">
</File>
<File
RelativePath="inc\NtwMod.hpp">
</File>
<File
RelativePath="inc\NtwObj.hpp">
</File>
<File
RelativePath="..\..\Public\Owp.h">
</File>
<File
RelativePath="..\..\Public\owp\Query.h">
</File>
<File
RelativePath="inc\StdAfx.h">
</File>
<File
RelativePath="inc\WPDia.hpp">
</File>
<File
RelativePath="inc\WPMod.hpp">
</File>
<File
RelativePath="inc\WPObj.hpp">
</File>
</Filter>
<Filter
Name="source files"
Filter="c;cpp">
<File
RelativePath="src\CurObj.cpp">
<FileConfiguration
Name="Debug with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="src\DLLCom.cpp">
<FileConfiguration
Name="Debug with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="src\editdia.cpp">
<FileConfiguration
Name="Debug with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="src\Inter.cpp">
<FileConfiguration
Name="Debug with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="X:\CPA\Public\Gam"
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="X:\CPA\Public\Gam"
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="src\isowpdia.cpp">
<FileConfiguration
Name="Debug with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="src\ntwdia.cpp">
<FileConfiguration
Name="Debug with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="src\NtwMod.cpp">
<FileConfiguration
Name="Debug with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="src\NtwObj.cpp">
<FileConfiguration
Name="Debug with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="src\StdAfx.cpp">
<FileConfiguration
Name="Debug with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="src\Waypoint.def">
</File>
<File
RelativePath="src\WPDia.cpp">
<FileConfiguration
Name="Debug with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="src\WPMod.cpp">
<FileConfiguration
Name="Debug with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="src\WPObj.cpp">
<FileConfiguration
Name="Debug with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="x:\CPA\Public\Ai"
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="resource files"
Filter="">
<File
RelativePath="res\add_wp.cur">
</File>
<File
RelativePath="res\arrow.cur">
</File>
<File
RelativePath="res\bitmap1.bmp">
</File>
<File
RelativePath="res\bmp00001.bmp">
</File>
<File
RelativePath="res\cur00001.cur">
</File>
<File
RelativePath="res\cur00002.cur">
</File>
<File
RelativePath="res\ico00001.ico">
</File>
<File
RelativePath="res\ico00002.ico">
</File>
<File
RelativePath="res\icon1.ico">
</File>
<File
RelativePath="res\icon2.ico">
</File>
<File
RelativePath="res\owp_dlgb.ico">
</File>
<File
RelativePath="res\pointer_.cur">
</File>
<File
RelativePath="res\radius_m.cur">
</File>
<File
RelativePath="res\realwp.ico">
</File>
<File
RelativePath="res\resource.h">
</File>
<File
RelativePath="res\symbolic.ico">
</File>
<File
RelativePath="res\Way.ico">
</File>
<File
RelativePath="res\WPDia.clw">
</File>
<File
RelativePath="res\WPDia.rc">
<FileConfiguration
Name="Debug with Editors|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="res"/>
</FileConfiguration>
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="res"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="other files"
Filter="*">
<File
RelativePath="..\..\Exe\Main\EDT_DATA\objects\waypoint\DynWP.bmp">
</File>
<File
RelativePath="..\..\exe\main\edt_data\objects\waypoint\OWPKeys.ini">
</File>
<File
RelativePath="..\..\Exe\Main\EDT_DATA\objects\waypoint\StatWP.bmp">
</File>
<File
RelativePath="..\..\Exe\Main\EDT_DATA\objects\waypoint\Way.bmp">
</File>
<File
RelativePath="..\..\Exe\Main\EDT_DATA\objects\waypoint\waypoint.cnt">
</File>
<File
RelativePath="..\..\Exe\Main\EDT_DATA\objects\waypoint\WAYPOINT.HLP">
</File>
<File
RelativePath="..\..\exe\main\edt_data\objects\waypoint\Waypoint.ini">
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

Binary file not shown.

View File

@@ -0,0 +1,245 @@
/*==========================================================
File: Bezier.h
Prupose: Handle a Bezier curve
Author: Yann Le Tensorer
Creation Date: 23 january 1997
Version: 1.0
Revision: YLT - 1.1 - 3 february 1997
===========================================================*/
#ifndef __BEZIER_H__
#define __BEZIER_H__
#ifdef _AI_LIB_
// #include "AIUseCPA.h"
#include "dynamic.h"
#else /* _AI_LIB_ */
#include "mth3d.h"
#include "acp_base.h"
#include "gld.h"
#include "dynamic.h"
#endif /* _AI_LIB_ */
/* Object creation modes */
#define C_ucModeNoObject 0 /* no geometric object created */
#define C_ucModeRealObject 1 /* a geometric object is created */
/* Main bezier structure */
typedef struct _BezierObject
{
unsigned char ucSamplingRate; /* sampling rate of curve */
MTH3D_tdstVector stStartPoint; /* first point of curve */
MTH3D_tdstVector stEndPoint; /* last point of curve */
MTH3D_tdstVector stStartVector; /* first tangent vector*/
MTH3D_tdstVector stEndVector; /* last tangent vector*/
ACP_tdxHandleOfObject hObject; /* handle of g<>om<6F>tric object*/
ACP_tdxHandleOfElement hElement; /* handle of "line" element*/
long color; /* color of the curve (24 bits)*/
GLD_tdstViewportAttributes *p_ViewPortAttributes; /* pointeur sur les attributs du viewport*/
unsigned char ucObjectMode; /* object mode C_ucModeNoObject or C_ucModeRealObject*/
MTH3D_tdstVector *d_stListOfPoints; /* List of bezier Points, in case mode=C_ucModeNoObject*/
ACP_tdstDynaParam *p_stDynaParams; /* Pointer to dynamic parameters of curve */
} tdstBezierObject;
#ifdef __cplusplus
extern "C" {
#endif
/*==========================================================
Function name: fn_vBezierObject_Calculate
Description: Calculates the points of the b<>zier curve according to the
parameters specified when creating the object.
Input: p_BezierObject: Pointer to a pre-created bezier object
Output: none
Author: Yann Le Tensorer
Date: 23 january 1997
Revision:
==========================================================*/
void fn_vBezierObject_Calculate(tdstBezierObject *p_BezierObject);
/*==========================================================
Function name: fn_vBezierObject_Create
Description: Create Bezier curve (in ram only) between two points
Input: p_BezierObject: pointer to a preallocated tdstBezierObject
ucSamplingRate: number of segment to define the curve)
stStartPoint: First vertex of the curve
stEndPoint: Last vertex of the curve
stStartVector: Tangent vector at the first point
stEndVector: Tangent vector at the last point
ucObjectMode: Creation mode (C_ucModeNoObject ou C_ucModeRealObject)
C_ucModeNoObject does not create a geometric object
whereas C_ucModeRealObject does.
Output: none
Author: Yann Le Tensorer
Date: 23 january 1997
Revision: YLT - 03 february 1997
==========================================================*/
void fn_vBezierObject_Create( tdstBezierObject *p_BezierObject,
unsigned char ucSamplingRate,
MTH3D_tdstVector* p_stStartPoint,
MTH3D_tdstVector* p_stEndPoint,
MTH3D_tdstVector* p_stStartVector,
MTH3D_tdstVector* p_stEndVector,
unsigned char ucObjectMode,
ACP_tdstDynaParam* p_stDynaParams);
/*==========================================================
Function name: fn_vBezierObject_SetColor
Description: Set the color of a bezier object.
Input: p_BezierObject: pointer to a pre-created tdstBezierObject
color: 24 bit color of object. (0->7=B; 8->15=G; 16->23=R ; 24->32=Unused)
Output: none
Author: Yann Le Tensorer
Date: 24 january 1997
Revision:
==========================================================*/
void fn_vBezierObject_SetColor(tdstBezierObject *p_BezierObject,long color);
/*==========================================================
Function name: fn_vBezierObject_SetViewPortAttributes
Description: Set the viewportattributes for drawing.
Input: p_BezierObject: pointer to a pre-created tdstBezierObject
p_ViewPortAttributes: pointer to pre-defined viewport attributes
Output: none
Author: Yann Le Tensorer
Date: 24 january 1997
Revision:
==========================================================*/
void fn_vBezierObject_SetViewPortAttributes(tdstBezierObject *p_BezierObject,GLD_tdstViewportAttributes *p_ViewPortAttributes);
/*==========================================================
Function name: fn_vBezierObject_Draw
Description: Draw Bezier object on screen
Input: p_BezierObject: pointer to a pre-created tdstBezierObject
Output: none
Author: Yann Le Tensorer
Date: 24 january 1997
Revision:
==========================================================*/
void fn_vBezierObject_Draw(tdstBezierObject *p_BezierObject);
/*==========================================================
Function name: fn_vBezierObject_Free
Description: Free memory allocated by the bezier objet
Input: p_BezierObject: pointer to a tdstBezierObject
Output: none
Author: Yann Le Tensorer
Date: 29 january 1997
Revision:
==========================================================*/
void fn_vBezierObject_Free(tdstBezierObject *p_BezierObject);
/*==========================================================
Function name: fn_vBezierObject_ChangeParams
Description: Changes the parameters of a bezier objet and recalculates the coordinates
of the points.
Input: p_BezierObject: Pointer to a pre-created bezier object
p_stStartPoint: Pointer to the start point
p_stEndPoint: Pointer to the end Point
p_stStartVector:Pointer to the start vector
p_stEndVector: Pointer to the end vector
Output: none
Author: Yann Le Tensorer
Date: 28 january 1997
Revision:
Notes: If an input parameter is 0, this parameter is simply not
affected. This enables to change easily only one parameter
==========================================================*/
void fn_vBezierObject_ChangeParams(tdstBezierObject *p_BezierObject,
MTH3D_tdstVector* p_stStartPoint,
MTH3D_tdstVector* p_stEndPoint,
MTH3D_tdstVector* p_stStartVector,
MTH3D_tdstVector* p_stEndVector);
/*==========================================================
Function name: fn_vBezierObject_GetParams
Description: Gets the parameters of a bezier objet
Input: p_BezierObject: Pointer to a pre-created bezier object
p_stStartPoint: Pointer to the start point
p_stEndPoint: Pointer to the end Point
p_stStartVector:Pointer to the start vector
p_stEndVector: Pointer to the end vector
Output: *p_stStartPoint:start point
*p_stEndPoint: end Point
*p_stStartVectorstart vector
*p_stEndVector: end vector
Author: Yann Le Tensorer
Date: 4 february 1997
Revision:
Notes: If an input parameter is 0, this parameter is simply not
affected.
==========================================================*/
void fn_vBezierObject_GetParams(tdstBezierObject *p_BezierObject,
MTH3D_tdstVector* p_stStartPoint,
MTH3D_tdstVector* p_stEndPoint,
MTH3D_tdstVector* p_stStartVector,
MTH3D_tdstVector* p_stEndVector);
/*==========================================================
Function name: fn_xBezierObject_GetSpeed
Description: returns the speed at a given sample (n<> of the point) of a bezier object
Input: p_stDynaParam: pointer to a pre-created tdstDynaParam structure
ucSampleNo: n<> of the point to get the speed from.
Output: return value is the speed.
Author: Yann Le Tensorer
Date: 03 february 1997
Revision:
==========================================================*/
MTH_tdxReal fn_xBezierObject_GetSpeed(tdstBezierObject *p_BezierObject,unsigned char ucSampleNo);
/*==========================================================
Function name: fn_xBezierObject_GetPoint
Description: returns the coordinates in the global rep<65>re of the point at a
given sample (n<> of the point) of a bezier object.
Input: p_stDynaParam: pointer to a pre-created tdstDynaParam structure
ucSampleNo: n<> of the point to get the coordinates from.
p_ReturnVector: pointer to a vector to be returned.
Output: *p_ReturnVector is a vector countaining the.coordinates of the point.
Author: Yann Le Tensorer
Date: 03 february 1997
Revision:
==========================================================*/
void fn_vBezierObject_GetPoint(tdstBezierObject *p_BezierObject,unsigned char ucSampleNo,MTH3D_tdstVector* p_ReturnVector);
/*===============================================================================
Function name: fn_bBezierObject_SetSamplingRate
Description: Modifies the sampling rate of a bezier object, and changes all
the depending parameters (including dynamic sampling rate)
Input: p_BezierObject: pointer to a preallocated tdstBezierObject
ucSamplingRate: New sampling rate
Output: return value is true if sampling rate could be modified,
false if not.
Author: Yann Le Tensorer
Date: 5 february 1997
Revision:
Note: The sampling rate can only be modified for objects that have been
created using C_ucModeNoObject at their creation.
================================================================================*/
ACP_tdxBool fn_bBezierObject_SetSamplingRate(tdstBezierObject *p_BezierObject,
unsigned char ucSamplingRate);
/*==========================================================
Function name: fn_ucBezierObject_GetSamplingRate
Description: Gets the sampling rate of a BezierObject objet
Input: p_BezierObject: Pointer to a pre-created Bezier object
Output: return value is the sampling rate of the circle arc object
Author: Yann Le Tensorer
Date: 5 february 1997
Revision:
==========================================================*/
unsigned char fn_ucBezierObject_GetSamplingRate(tdstBezierObject *p_BezierObject);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,276 @@
/*=========================================================================================
File: CirclWay.c
Prupose: Handle a CircleArc curve
Author: Yann Le Tensorer
Creation Date: 3 february 1997
Version: 1.1
Revision:
===========================================================================================
Revisions: Version Date Author
----------------------------------------------------------------
1.1 6 february 1997 Yann Le Tensorer
Added function "fn_vCircle_FindCenter"
=========================================================================================*/
#ifndef __CircleArc_H__
#define __CircleArc_H__
#ifdef _AI_LIB_
#include "AIUseCPA.h"
#include "dynamic.h"
#else /* _AI_LIB_ */
#include "mth3d.h"
#include "acp_base.h"
#include "gld.h"
#include "dynamic.h"
#endif /* _AI_LIB_ */
/* Object creation modes */
#define C_ucModeNoObject 0 /* no geometric object created */
#define C_ucModeRealObject 1 /* a geometric object is created */
/* Main CircleArc structure */
typedef struct _CircleArcObject
{
unsigned char ucSamplingRate; /* sampling rate of curve */
MTH3D_tdstVector stStartPoint; /* first point of curve */
MTH3D_tdstVector stEndPoint; /* last point of curve */
MTH3D_tdstVector stCenter; /* center of the circle */
MTH3D_tdstMatrix stLocalRepere; /* local rep<65>re of plan in which is the circle */
ACP_tdxHandleOfObject hObject; /* handle of g<>om<6F>tric object*/
ACP_tdxHandleOfElement hElement; /* handle of "line" element*/
long color; /* color of the curve (24 bits)*/
GLD_tdstViewportAttributes *p_ViewPortAttributes; /* pointeur sur les attributs du viewport*/
unsigned char ucObjectMode; /* object mode C_ucModeNoObject or C_ucModeRealObject*/
MTH3D_tdstVector *d_stListOfPoints; /* List of CircleArc Points, in case mode=C_ucModeNoObject*/
ACP_tdstDynaParam *p_stDynaParams; /* Pointer to dynamic parameters of curve */
MTH3D_tdstVector stLocalStartPoint; /* first point of curve in local repere*/
MTH3D_tdstVector stLocalEndPoint; /* last point of curve in local repere*/
MTH3D_tdstMatrix stInvLocalRepere; /* Inverse matrix of local rep<65>re of plan in which is the circle */
MTH_tdxReal xMainAngle;
MTH3D_tdstVector stTmpVector0; /* internal use */
MTH3D_tdstVector stTmpVector1; /* internal use */
} tdstCircleArcObject;
#ifdef __cplusplus
extern "C" {
#endif
/*==========================================================
Function name: fn_vCircleArcObject_Calculate
Description: Calculates the points of the b<>zier curve according to the
parameters specified when creating the object.
Input: p_CircleArcObject: Pointer to a pre-created CircleArc object
Output: none
Author: Yann Le Tensorer
Date: 23 january 1997
Revision:
==========================================================*/
void fn_vCircleArcObject_Calculate(tdstCircleArcObject *p_CircleArcObject);
/*==========================================================
Function name: fn_vCircleArcObject_Create
Description: Create CircleArc curve (in ram only) between two points
Input: p_CircleArcObject: pointer to a preallocated tdstCircleArcObject
ucSamplingRate: number of segment to define the curve)
stStartPoint: First vertex of the curve
stEndPoint: Last vertex of the curve
stCenter: center of the circle
ucObjectMode: Creation mode (C_ucModeNoObject ou C_ucModeRealObject)
C_ucModeNoObject does not create a geometric object
whereas C_ucModeRealObject does.
Output: none
Author: Yann Le Tensorer
Date: 23 january 1997
Revision: YLT - 03 february 1997
==========================================================*/
void fn_vCircleArcObject_Create(tdstCircleArcObject *p_CircleArcObject,
unsigned char ucSamplingRate,
MTH3D_tdstVector* p_stStartPoint,
MTH3D_tdstVector* p_stEndPoint,
MTH3D_tdstVector* p_stCenter,
unsigned char ucObjectMode,
ACP_tdstDynaParam* p_stDynaParams);
/*==========================================================
Function name: fn_vCircleArcObject_SetColor
Description: Set the color of a CircleArc object.
Input: p_CircleArcObject: pointer to a pre-created tdstCircleArcObject
color: 24 bit color of object. (0->7=B; 8->15=G; 16->23=R ; 24->32=Unused)
Output: none
Author: Yann Le Tensorer
Date: 24 january 1997
Revision:
==========================================================*/
void fn_vCircleArcObject_SetColor(tdstCircleArcObject *p_CircleArcObject,long color);
/*==========================================================
Function name: fn_vCircleArcObject_SetViewPortAttributes
Description: Set the viewportattributes for drawing.
Input: p_CircleArcObject: pointer to a pre-created tdstCircleArcObject
p_ViewPortAttributes: pointer to pre-defined viewport attributes
Output: none
Author: Yann Le Tensorer
Date: 24 january 1997
Revision:
==========================================================*/
void fn_vCircleArcObject_SetViewPortAttributes(tdstCircleArcObject *p_CircleArcObject,GLD_tdstViewportAttributes *p_ViewPortAttributes);
/*==========================================================
Function name: fn_vCircleArcObject_Draw
Description: Draw CircleArc object on screen
Input: p_CircleArcObject: pointer to a pre-created tdstCircleArcObject
Output: none
Author: Yann Le Tensorer
Date: 24 january 1997
Revision:
==========================================================*/
void fn_vCircleArcObject_Draw(tdstCircleArcObject *p_CircleArcObject);
/*==========================================================
Function name: fn_vCircleArcObject_Free
Description: Free memory allocated by the CircleArc objet
Input: p_CircleArcObject: pointer to a tdstCircleArcObject
Output: none
Author: Yann Le Tensorer
Date: 29 january 1997
Revision:
==========================================================*/
void fn_vCircleArcObject_Free(tdstCircleArcObject *p_CircleArcObject);
/*==========================================================
Function name: fn_vCircleArcObject_ChangeParams
Description: Changes the parameters of a CircleArc objet and recalculates the coordinates
of the points.
Input: p_CircleArcObject: Pointer to a pre-created CircleArc object
p_stStartPoint: Pointer to the start point
p_stEndPoint: Pointer to the end Point
p_stCenter: Pointer to the center of the circle
Output: none
Author: Yann Le Tensorer
Date: 6 february 1997
Revision:
Notes: If an input parameter is 0, this parameter is simply not
affected. This enables to change easily only one parameter
==========================================================*/
void fn_vCircleArcObject_ChangeParams(tdstCircleArcObject *p_CircleArcObject,
MTH3D_tdstVector *p_stStartPoint,
MTH3D_tdstVector *p_stEndPoint,
MTH3D_tdstVector *p_stCenter);
/*==========================================================
Function name: fn_xCircleArcObject_GetSpeed
Description: returns the speed at a given sample (n<> of the point) of a CircleArc object
Input: p_stDynaParam: pointer to a pre-created tdstDynaParam structure
ucSampleNo: n<> of the point to get the speed from.
Output: return value is the speed.
Author: Yann Le Tensorer
Date: 03 february 1997
Revision:
==========================================================*/
MTH_tdxReal fn_xCircleArcObject_GetSpeed(tdstCircleArcObject *p_CircleArcObject,unsigned char ucSampleNo);
/*==========================================================
Function name: fn_xCircleArcObject_GetPoint
Description: returns the coordinates in the global rep<65>re of the point at a
given sample (n<> of the point) of a CircleArc object.
Input: p_stDynaParam: pointer to a pre-created tdstDynaParam structure
ucSampleNo: n<> of the point to get the coordinates from.
p_ReturnVector: pointer to a vector to be returned.
Output: *p_ReturnVector is a vector countaining the.coordinates of the point.
Author: Yann Le Tensorer
Date: 03 february 1997
Revision:
==========================================================*/
void fn_vCircleArcObject_GetPoint(tdstCircleArcObject *p_CircleArcObject,unsigned char ucSampleNo,MTH3D_tdstVector* p_ReturnVector);
/*==========================================================
Function name: fn_vCircleArcObject_GlobalToLocal
Description: Changes coordinates of a point from global coordinates to local.
Input: p_CircleArcObject: pointer to the circle arc object
p_stDestVector: pointer to the destination vector
p_stSourceVector: pointer to the source vector
Output: *p_stDestVector is a vector countaining the.coordinates in the local
repere of the plan.
Author: Yann Le Tensorer
Date: 4 february 1997
Revision:
==========================================================*/
void fn_vCircleArcObject_GlobalToLocal( tdstCircleArcObject *p_CircleArcObject,
MTH3D_tdstVector *p_stDestVector,
MTH3D_tdstVector *p_stSourceVector);
/*==========================================================
Function name: fn_vCircleArcObject_LocalToGlobal
Description: Changes coordinates of a point from local coordinates to global
Input: p_CircleArcObject: pointer to the circle arc object
p_stDestVector: pointer to the destination vector
p_stSourceVector: pointer to the source vector
Output: *p_stDestVector is a vector countaining the.coordinates in the global
repere of the plan.
Author: Yann Le Tensorer
Date: 4 february 1997
Revision:
==========================================================*/
void fn_vCircleArcObject_LocalToGlobal( tdstCircleArcObject *p_CircleArcObject,
MTH3D_tdstVector *p_stDestVector,
MTH3D_tdstVector *p_stSourceVector);
/*==========================================================
Function name: fn_ucCircleArcObject_GetSamplingRate
Description: Gets the sampling rate of a CircleArcObject objet
Input: p_CircleArcObject: Pointer to a pre-created CircleArc object
Output: return value is the sampling rate of the circle arc object
Author: Yann Le Tensorer
Date: 5 february 1997
Revision:
==========================================================*/
unsigned char fn_ucCircleArcObject_GetSamplingRate(tdstCircleArcObject *p_CircleArcObject);
/*===============================================================================
Function name: fn_bCircleArcObject_SetSamplingRate
Description: Modifies the sampling rate of a CircleArc object, and changes all
the depending parameters (including dynamic sampling rate)
Input: p_CircleArcObject: pointer to a preallocated tdstCircleArcObject
ucSamplingRate: New sampling rate
Output: return value is true if sampling rate could be modified,
false if not.
Author: Yann Le Tensorer
Date: 5 february 1997
Revision:
Note: The sampling rate can only be modified for objects that have been
created using C_ucModeNoObject at their creation.
================================================================================*/
ACP_tdxBool fn_bCircleArcObject_SetSamplingRate(tdstCircleArcObject *p_CircleArcObject,
unsigned char ucSamplingRate);
/*==========================================================
Function name: fn_vCircle_FindCenter
Description: Finds the 3D coordinate of the center of the circle on which are 3 points.
Input: p_FirstPoint: pointer to the first point
p_SecondPoint: pointer to the second point
p_ThirdPoint: pointer to the third point
p_ReturnCenter: pointer to a point to be returned.
Output: *p_ReturnCenter is a vector countaining the.coordinates of the center.
Author: Yann Le Tensorer
Date: 6 february 1997
Revision:
==========================================================*/
void fn_vCircle_FindCenter( MTH3D_tdstVector *p_FirstPoint,
MTH3D_tdstVector *p_SecondPoint,
MTH3D_tdstVector *p_ThirdPoint,
MTH3D_tdstVector *p_ReturnCenter);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,94 @@
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : CurObj.hpp
//
// Definition of the cursor object
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// inherit from : CPA_Object
// CPA_EdMot<ACP_tdxHandleOfLink>
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 29 jan 1997 Author: J Th<54>noz
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
//
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
*/
#ifndef __CursorOBJECT_HPP__
#define __CursorOBJECT_HPP__
class Waypoint_Interface;
class LinkBez;
//----------- engine structure
typedef struct {} tdstCursor;
typedef tdstCursor* ACP_tdxHandleOfCursor;
//-----------
typedef enum
{
eCursorNoLimit,
eCursorCircularLimit
}
eCursorMouseMoveLimit;
class Cursor : public CPA_BaseObject
{
protected:
static long ms_lNbCursor; // cursor counter
static Waypoint_Interface* ms_poInterface; // interface
CPA_SuperObject* m_poSuperObject;
MTH3D_tdstVector m_stVertex; // local Vertex of the cursor in the m_poParent axis
GLI_tdxValue m_xDim; // dim of the cursor
CPA_SuperObject* m_poParent; // parent object = physical parent : just for axis to store vertex
BOOL m_bCursorMove; // cursor moves
eCursorMouseMoveLimit m_eMouseMoveLimit;
public:
// static
static void fn_vInitObject (Waypoint_Interface* poInterface);
static Waypoint_Interface* GetInterface (void);
Cursor ( CPA_ObjectDLLBase *p_oDLL, CPA_BaseObject *poOwner, eCursorMouseMoveLimit elimit = eCursorNoLimit );
void *GetEngineStruct (void) { return NULL; }
// data
long GetDataType (void);
void* GetData (void);
// super object
void SetSuperObject ( CPA_SuperObject* poSuperObject) { m_poSuperObject=poSuperObject; }
CPA_SuperObject* GetSuperObject (void) { return m_poSuperObject; }
//set
void fn_vSetAbsoluteVertex ( MTH3D_tdstVector* pAbsoluteVertex );
void fn_vSetLocalVertex ( MTH3D_tdstVector* pLocalVertex ) { m_stVertex = *pLocalVertex; }
//get
void fn_vGetAbsoluteVertex ( MTH3D_tdstVector* pAbsoluteVertex );
void fn_vGetLocalVertex ( MTH3D_tdstVector* pLocalVertex ) { *pLocalVertex = m_stVertex; }
// moves
void fn_vStartMove ( MTH3D_tdstVector* pstStartVertex );
void fn_vMove ( MTH3D_tdstVector* pstTranslation );
void fn_vEndMove (void);
// draw
void fn_vDraw (void);
// move
BOOL fn_bCursorMove (void);
protected :
BOOL fn_bCanMove ( MTH3D_tdstVector* pstVertex );
};
#endif //__OBJECT_HPP__

View File

@@ -0,0 +1,254 @@
/*==========================================================
File: Dynamic.h
Prupose: Dynamic parameters of a connection
Author: Yann Le Tensorer
Creation Date: 29 january 1997
Revision : Yann Le Tensorer
04 february 1997
Added function fn_vDynamicObject_GetParams
Version 1.01
===========================================================*/
#include "acp_base.h"
#include "mth_real.h"
#ifndef __DYNA_H__
#define __DYNA_H__
#define C_ucNone 0
#define C_ucConst 1
#define C_ucLinear 2
#define C_ucSinus 3
typedef struct _ACP_tdstDynaParam
{
unsigned char ucDynamicType;
unsigned char ucSamplingRate;
MTH_tdxReal xSpeed;
MTH_tdxReal xStartSpeed;
MTH_tdxReal xStartAngle;
MTH_tdxReal xEndAngle;
MTH_tdxReal xEndSpeed;
MTH_tdxReal xMaxSpeed;
MTH_tdxReal* d_stListOfSpeeds;
} ACP_tdstDynaParam;
#ifdef __cplusplus
extern "C" {
#endif
/*==========================================================
Function name: fn_vDynamicObject_Calculate
Description: Caculates the speeds at sampled points, according to dynamic parameters
Input: p_stDynaParam: pointer to a pre-created tdstDynaParam structure
Output: none
Author: Yann Le Tensorer
Date: 30 january 1997
Revision:
==========================================================*/
void fn_vDynamicObject_Calculate(ACP_tdstDynaParam* p_stDynaParam);
/*==========================================================
Function name: fn_vDynamicObject_Create
Description: Creates a dynamic parameters object
Input: p_stDynaParam: pointer to a preallocated tdstDynaParam structure
ucSamplingRate: sampling rate
ucDynamicType: dynamic type (C_NONE,C_CONST,C_LINEAR,C_SINUS)
xFirst,xSecond,xThird: See table below
Type: | C_NONE | C_CONST | C_LINEAR | C_SINUS
===========================================================
xFirst | - | speed | start speed | start angle
| | | |
xSecond | - | - | end speed | end angle
| | | |
xThird | - | - | - | max speed
Output: none
Author: Yann Le Tensorer
Date: 30 january 1997
Revision:
==========================================================*/
void fn_vDynamicObject_Create( ACP_tdstDynaParam* p_stDynaParam,
unsigned char ucSamplingRate,
unsigned char ucDynamicType,
MTH_tdxReal xFirst,
MTH_tdxReal xSecond,
MTH_tdxReal xThird);
/*==========================================================
Function name: fn_vDynaParams_Free
Description: removes the allocated ram for DynaParams
Input: p_stDynaParam: pointer to a pre-created tdstDynaParam structure
Output: none
Author: Yann Le Tensorer
Date: 30 january 1997
Revision:
==========================================================*/
void fn_vDynamicObject_Free(ACP_tdstDynaParam* p_stDynaParam);
/*==========================================================
Function name: fn_vDynamicObject_ChangeParams
Description: changes the dynamic parameters (except sampling rate)
Input: p_stDynaParam: pointer to a preallocated tdstDynaParam structure
ucDynamicType: dynamic type (C_ucNone,C_ucConst,C_ucLinear,C_ucSinus)
xFirst,xSecond,xThird: See table below
Type: | C_ucNone | C_ucConst | C_ucLinear | C_ucSinus
===========================================================
xFirst | - | speed | start speed | start angle
| | | |
xSecond | - | - | end speed | end angle
| | | |
xThird | - | - | - | max speed
Output: none
Author: Yann Le Tensorer
Date: 30 january 1997
Revision:
==========================================================*/
void fn_vDynamicObject_ChangeParams( ACP_tdstDynaParam* p_stDynaParam,
unsigned char ucDynamicType,
MTH_tdxReal xFirst,
MTH_tdxReal xSecond,
MTH_tdxReal xThird);
/*==========================================================
Function name: fn_vDynamicObject_GetParams
Description: Gets the dynamic parameters (including sampling rate)
Input: p_stDynaParam: pointer to a preallocated tdstDynaParam structure
p_ucDynamicType:pointer to get dynamic type (C_ucNone,C_ucConst,C_ucLinear,C_ucSinus)
p_SamplingRate: pointer to get sampling rate
p_xFirst,p_xSecond,p_xThird:pointers to parameters to get See table below
Type: | C_ucNone | C_ucConst | C_ucLinear | C_ucSinus
===========================================================
xFirst | - | speed | start speed | start angle
| | | |
xSecond | - | - | end speed | end angle
| | | |
xThird | - | - | - | max speed
Output: none
Author: Yann Le Tensorer
Date: 04 february 1997
Revision:
==========================================================*/
void fn_vDynamicObject_GetParams( ACP_tdstDynaParam* p_stDynaParam,
unsigned char* p_ucDynamicType,
unsigned char* p_ucSamplingRate,
MTH_tdxReal* p_xFirst,
MTH_tdxReal* p_xSecond,
MTH_tdxReal* p_xThird);
/*==========================================================
Function name: fn_xDynamicObject_GetSpeed
Description: returns the speed at a given sample (n<> of the point)
Input: p_stDynaParam: pointer to a pre-created tdstDynaParam structure
ucSampleNo: n<> of the point to get the speed from.
Output: return value is the speed.
Author: Yann Le Tensorer
Date: 31 january 1997
Revision:
==========================================================*/
MTH_tdxReal fn_xDynamicObject_GetSpeed(ACP_tdstDynaParam* p_stDynaParams,unsigned char ucSampleNo);
/*==========================================================
Function name: fn_vDynamicObject_ChangeSamplingRate
Description: Changes the sampling rate of a dynamic object
Input: p_stDynaParam: pointer to a preallocated tdstDynaParam structure
ucSamplingRate: sampling rate
Output: none
Author: Yann Le Tensorer
Date: 5 february 1997
Revision:
==========================================================*/
void fn_vDynamicObject_ChangeSamplingRate( ACP_tdstDynaParam* p_stDynaParam,
unsigned char ucSamplingRate);
/*==========================================================
Function name: fn_vDynamicObject_CreateNotSampled
Description: Creates a dynamic parameters object for not sampled type
Input: p_stDynaParam: pointer to a preallocated tdstDynaParam structure
ucDynamicType: dynamic type (C_NONE,C_CONST,C_LINEAR,C_SINUS)
xFirst,xSecond,xThird: See table below
Type: | C_NONE | C_CONST | C_LINEAR | C_SINUS
===========================================================
xFirst | - | speed | start speed | start angle
| | | |
xSecond| - | - | end speed | end angle
| | | |
xThird | - | - | - | max speed
Output: none
Author: Albert Pais
Date: February 04, 1997
Revision:
==========================================================*/
void fn_vDynamicObject_CreateNotSampled
(
ACP_tdstDynaParam* /*p_stDynaParam*/,
unsigned char /*ucDynamicType*/,
MTH_tdxReal /*xFirst*/,
MTH_tdxReal /*xSecond*/,
MTH_tdxReal /*xThird*/
);
/*==========================================================
Function name: fn_vDynamicObject_CalculateNotSampled
Description: Caculates specific coef when speed is not sampled
Input:
p_stDynaParam: pointer to a pre-created tdstDynaParam structure
the initial dist beetween the initial point and the final point
Output: none
Remark :
The xSpeed field of the structure is used to store some
parameters used at execution
Author: Albert Pais
Date: Frebruary 4,1997
Revision:
==========================================================*/
void fn_vDynamicObject_CalculateNotSampled
(
ACP_tdstDynaParam* /*_p_stDynaParam*/,
MTH_tdxReal /*_xInitialDist*/
);
/*==========================================================
Function name: fn_xDynamicObject_GetSpeedNotSampled
Description: returns the speed at a given position when it is not sampled
Input:
p_stDynaParam: pointer to a pre-created tdstDynaParam structure
_xDist : the dist beetween the position where speed is required and the point to reach
Output: return value is the speed.
Author: Albert Pais
Date: February 4,1997
Revision:
==========================================================*/
MTH_tdxReal fn_xDynamicObject_GetSpeedNotSampled
(
ACP_tdstDynaParam* /*_p_stDynaParams*/,
MTH_tdxReal /*_xDist*/
);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,349 @@
/*
------------------------------------------------------------------------------------------
HEADER FILE FOR :
Definition of (way) editor object : bezier curves.
------------------------------------------------------------------------------------------
File Name :
Ed_Bez.h
------------------------------------------------------------------------------------------
Creation :
* Date :
February 20, 1997
* Author :
Albert PAIS
------------------------------------------------------------------------------------------
Contents :
This file defines structures and functions for the bezier curve used by
the (way) editor
------------------------------------------------------------------------------------------
Remarks :
Code comes from old bezier.h made by Yann Le Tensorer (January-February 1997)
------------------------------------------------------------------------------------------
See Also :
Mth_Bezier.h/.c for mathematical bezier curve definition and implementation.
------------------------------------------------------------------------------------------
Modification :
* Date :
* Author :
* Modify :
------------------------------------------------------------------------------------------
*/
#if !defined(__EDIBEZ_TYPES__)
#define __EDIBEZ_TYPES__
#if !defined(ONLY_TYPES)
#define EDIBEZ_UNDEF
#define ONLY_TYPES
#endif /* !ONLY_TYPES */
/*
------------------------------------------------------------------------------------------
INCLUDE FILES :
------------------------------------------------------------------------------------------
*/
/*
----------------------------------------
File Name :
mth3d.h
----------------------------------------
Required for :
Definition of standard 3d mathematic
objects
----------------------------------------
*/
#include "mth.h"
/*
----------------------------------------
File Name :
acp_base.h
----------------------------------------
Required for :
Definition of standard CPA objects
----------------------------------------
*/
#include "acp_base.h"
/*
----------------------------------------
File Name :
gld.h
----------------------------------------
Required for :
Graphic Library for Display
----------------------------------------
*/
#include "gld.h"
#if defined(EDIBEZ_UNDEF)
#undef ONLY_TYPES
#undef EDIBEZ_UNDEF
#endif /* !EDIBEZ_UNDEF */
/*
------------------------------------------------------------------------------------------
TYPE AND STRUCTURE DEFINITION :
------------------------------------------------------------------------------------------
*/
void fn_vJustToLinkBez (void);
/*
----------------------------------------
Type definition :
The bezier object for (way) editor
----------------------------------------
* Structure Name :
EDWAY_tdstBezierObject_
* Type def :
EDWAY_tdstBezierObject
* Handles :
EDWAY_tdhBezierObject
----------------------------------------
Creation Date :
February 20,1997
Author :
Albert PAIS
----------------------------------------
Members :
* Type : MTH3D_tdhBezierCurve
Name : m_hBezierCurve
Meaning : A handle on the mathematical
bezier curve associated
* Type : ACP_tdxHandleOfObject
Name : m_hGeometricObject
Meaning : A handle on a geometric
object
* Type : ACP_tdxHandleOfElement
Name : m_hLineElement
Meaning : A handle on a line element
object
* Type : long
Name : m_lColor
Meaning : Color of the curve (24bit)
* Type : GLD_tdstViewportAttributes
Name : m_pstViewPortAttributes
Meaning : pointer on the view port
attributes
* Type : MTH3D_tdstVector
Name : m_dstListOfPoints
Meaning : Dynamic array on the
points of the bezier curve
in case mode=C_ucModeNoObject
* Type : ACP_tdstDynaParam
Name : m_pstDynaParams
Meaning : A pointer on the dynamic
params associated
* Type : unsigned char
Name : m_ucObjectMode
Meaning : the object mode :
C_ucModeNoObject or C_ucModeRealObject
---------------------------------------
*/
#ifdef _EDWAY_BEZ_FRIEND_
typedef struct EDWAY_tdstBezierObject_
{
MTH3D_tdhBezierCurve m_hBezierCurve;
ACP_tdxHandleOfObject m_hGeometricObject;
ACP_tdxHandleOfElement m_hLineElement;
long m_lColor;
GLD_tdstViewportAttributes *m_pstViewPortAttributes;
MTH3D_tdstVector **m_pdstListOfPoints;
ACP_tdstDynaParam *m_pstDynaParams;
unsigned char m_ucObjectMode;
} EDWAY_tdstBezierObject;
#endif /* _EDWAY_BEZ_FRIEND_ */
typedef struct EDWAY_tdstBezierObject_* EDWAY_tdhBezierObject;
#endif /* !__EDIBEZ_TYPES__ */
#if !defined(ONLY_TYPES)
#if !defined(__EDIBEZ_VARS__)
#define __EDIBEZ_VARS__
#undef EXTERN
#undef extern
#if !defined(GLOBALS)
#define EXTERN extern
#else /* !GLOBALS */
#define EXTERN
#endif /* !GLOBALS */
/*
------------------------------------------------------------------------------------------
VARIABLE DECLARATION :
<type> <variable name>
#if defined(GLOBALS)
= <initial values>
#endif
;
------------------------------------------------------------------------------------------
*/
/*
------------------------------------------------------------------------------------------
MACROS-CONSTANT DECLARATION:
------------------------------------------------------------------------------------------
*/
/* Invalid handle :*/
#define EDWAY_C_hInvalidBezierObject ((EDWAY_tdhBezierObject)NULL)
/* no geometric object created : */
#define EDWAY_C_ucModeNoObject 0
/* a geometric object is created */
#define EDWAY_C_ucModeRealObject 1
#undef extern
#endif /* !__EDIBEZ_VARS__ */
#if !defined (__EDIBEZ_PROTOS__)
#define __EDIBEZ_PROTOS__
/*
------------------------------------------------------------------------------------------
MACROS-FUNCTIONS DECLARATION:
------------------------------------------------------------------------------------------
*/
#ifdef _EDWAY_BEZ_FRIEND_
#define EDWAY_M_vBezierObjectGetPointerParam(_hBezObj,_pxPointer,_SlotName)\
(*(_pxPointer) = (_hBezObj)->m_st##_SlotName##)
#define EDWAY_M_xBezierObjectGetScalarParam(_hBezObj,_Prefix,_SlotName)\
((_hBezObj)->m_##_Prefix## ##_SlotName##)
#define EDWAY_M_vBezierObjectSetPointerParam(_hBezObj,_pxPointer,_SlotName)\
((_hBezObj)->m_st##_SlotName## = *(_pxPointer))
#define EDWAY_M_vBezierObjectSetScalarParam(_hBezObj,_xScalar,_Prefix,_SlotName)\
((_hBezObj)->m_##_Prefix## ##_SlotName## = (_xScalar))
#define EDWAY_M_uwBezierObjectSizeOf()\
((unsigned short)(sizeof(struct EDWAY_tdstBezierObject_)))
#else /* _EDWAY_BEZ_FRIEND_ */
#define EDWAY_M_vBezierObjectGetPointerParam(_hBezObj,_pxPointer,_SlotName)\
(EDWAY_fnv_BezierObject_Get##_SlotName##(_hBezObj,_pxPointer))
#define EDWAY_M_xBezierObjectGetScalarParam(_hBezObj,_Prefix,_SlotName)\
(EDWAY_fn##_Prefix##_BezierObject_Get##_SlotName##(_hBezObj))
#define EDWAY_M_vBezierObjectSetPointerParam(_hBezObj,_pxPointer,_SlotName)\
(EDWAY_fnv_BezierObject_Set##_SlotName##(_hBezObj,_pxPointer))
#define EDWAY_M_vBezierObjectSetScalarParam(_hBezObj,_xScalar,_Prefix,_SlotName)\
(EDWAY_fnv_BezierObject_Set##_SlotName##(_hBezObj,_xScalar))
#define EDWAY_M_uwBezierObjectSizeOf()\
EDWAY_fnuw_BezierObject_SizeOf()
#endif /* _EDWAY_BEZ_FRIEND_ */
#define EDWAY_M_hBezierObjectGetBezierCurve(_hBezObjCon)\
EDWAY_M_xBezierObjectGetScalarParam(_hBezObjCon,h,BezierCurve)
#define EDWAY_M_hBezierObjectGetGeometricObject(_hBezObjCon)\
EDWAY_M_xBezierObjectGetScalarParam(_hBezObjCon,h,GeometricObject)
#define EDWAY_M_hBezierObjectGetLineElement(_hBezObjCon)\
EDWAY_M_xBezierObjectGetScalarParam(_hBezObjCon,h,LineElement)
#define EDWAY_M_lBezierObjectGetColor(_hBezObjCon)\
EDWAY_M_xBezierObjectGetScalarParam(_hBezObjCon,l,Color)
#define EDWAY_M_pstBezierObjectGetViewPortAttributes(_hBezObjCon)\
EDWAY_M_xBezierObjectGetScalarParam(_hBezObjCon,pst,ViewPortAttributes)
#define EDWAY_M_dstBezierObjectGetListOfPoints(_hBezObjCon)\
EDWAY_M_xBezierObjectGetScalarParam(_hBezObjCon,dst,ListOfPoints)
#define EDWAY_M_pstBezierObjectGetDynaParams(_hBezObjCon)\
EDWAY_M_xBezierObjectGetScalarParam(_hBezObjCon,pst,DynaParams)
#define EDWAY_M_ucBezierObjectGetObjectMode(_hBezObjCon)\
EDWAY_M_xBezierObjectGetScalarParam(_hBezObjCon,uc,ObjectMode)
#define EDWAY_M_vBezierObjectSetBezierCurve(_hBezObjCon,_hBezCur)\
EDWAY_M_vBezierObjectSetScalarParam(_hBezObjCon,_hBezCur,h,BezierCurve)
#define EDWAY_M_vBezierObjectSetGeometricObject(_hBezObjCon,_hGeoObj)\
EDWAY_M_vBezierObjectSetScalarParam(_hBezObjCon,_hGeoObj,h,GeometricObject)
#define EDWAY_M_vBezierObjectSetLineElement(_hBezObjCon,_LinEle)\
EDWAY_M_vBezierObjectSetScalarParam(_hBezObjCon,_LinEle,h,LineElement)
#define EDWAY_M_vBezierObjectSetColor(_hBezObjCon,_lCol)\
EDWAY_M_vBezierObjectSetScalarParam(_hBezObjCon,_lCol,l,Color)
#define EDWAY_M_vBezierObjectSetViewPortAttributes(_hBezObjCon,_pstViePorAtt)\
EDWAY_M_vBezierObjectSetScalarParam(_hBezObjCon,_pstViePorAtt,pst,ViewPortAttributes)
#define EDWAY_M_vBezierObjectSetListOfPoints(_hBezObjCon,_dstLisOfPts)\
EDWAY_M_vBezierObjectSetScalarParam(_hBezObjCon,_dstLisOfPts,dst,ListOfPoints)
#define EDWAY_M_vBezierObjectSetDynaParams(_hBezObjCon,_pstDynPar)\
EDWAY_M_vBezierObjectSetScalarParam(_hBezObjCon,_pstDynPar,pst,DynaParams)
#define EDWAY_M_vBezierObjectSetObjectMode(_hBezObjCon,_ucObjMod)\
EDWAY_M_vBezierObjectSetScalarParam(_hBezObjCon,_ucObjMod,uc,ObjectMode)
/*
------------------------------------------------------------------------------------------
FUNCTIONS DECLARATION:
------------------------------------------------------------------------------------------
*/
EDWAY_tdhBezierObject EDWAY_fnh_BezierObject_CreateStructure(void);
void EDWAY_fnv_BezierObject_DestroyStructure(EDWAY_tdhBezierObject);
/* Creation :*/
void EDWAY_fnv_BezierObject_Create
(EDWAY_tdhBezierObject,unsigned char,MTH3D_tdstVector*,MTH3D_tdstVector*,MTH3D_tdstVector*,MTH3D_tdstVector*,unsigned char,ACP_tdstDynaParam*, MTH3D_tdstVector** pdstListOfPoints);
void EDWAY_fnv_BezierObject_CreateWithCurve
(
EDWAY_tdhBezierObject _hBezierObject,
MTH3D_tdhBezierCurve _hBezierCurve,
unsigned char _ucObjectMode,
ACP_tdstDynaParam* _pstDynaParams,
MTH3D_tdstVector** pdstListOfPoints
);
void EDWAY_fnv_BezierObject_Free(EDWAY_tdhBezierObject);
unsigned short EDWAY_fnuw_BezierObject_SizeOf(void);
/* computing points :*/
void EDWAY_fnv_BezierObject_Calculate
(EDWAY_tdhBezierObject);
/* Getting fields values :*/
MTH3D_tdhBezierCurve EDWAY_fnh_BezierObject_GetBezierCurve(EDWAY_tdhBezierObject);
ACP_tdxHandleOfObject EDWAY_fnh_BezierObject_GetGeometricObject(EDWAY_tdhBezierObject);
ACP_tdxHandleOfElement EDWAY_fnh_BezierObject_GetLineElement(EDWAY_tdhBezierObject);
long EDWAY_fnl_BezierObject_GetColor(EDWAY_tdhBezierObject);
GLD_tdstViewportAttributes* EDWAY_fnpst_BezierObject_GetViewPortAttributes(EDWAY_tdhBezierObject);
MTH3D_tdstVector* EDWAY_fndst_BezierObject_GetListOfPoints(EDWAY_tdhBezierObject);
ACP_tdstDynaParam* EDWAY_fnpst_BezierObject_GetDynaParams(EDWAY_tdhBezierObject);
unsigned char EDWAY_fnuc_BezierObject_GetObjectMode(EDWAY_tdhBezierObject);
/* changing (and only changing) fields value */
void EDWAY_fnv_BezierObject_SetBezierCurve(EDWAY_tdhBezierObject,MTH3D_tdhBezierCurve);
void EDWAY_fnv_BezierObject_SetGeometricObject(EDWAY_tdhBezierObject,ACP_tdxHandleOfObject);
void EDWAY_fnv_BezierObject_SetLineElement(EDWAY_tdhBezierObject,ACP_tdxHandleOfElement);
void EDWAY_fnv_BezierObject_SetColor(EDWAY_tdhBezierObject,long);
void EDWAY_fnv_BezierObject_SetViewPortAttributes(EDWAY_tdhBezierObject,GLD_tdstViewportAttributes*);
void EDWAY_fnv_BezierObject_SetListOfPoints(EDWAY_tdhBezierObject,MTH3D_tdstVector*);
void EDWAY_fnv_BezierObject_SetDynaParams(EDWAY_tdhBezierObject,ACP_tdstDynaParam *);
void EDWAY_fnv_BezierObject_SetObjectMode(EDWAY_tdhBezierObject,unsigned char);
/* Changing fields value and reflect back consequences : */
ACP_tdxBool EDWAY_fnb_BezierObject_ChangeSamplingRate(EDWAY_tdhBezierObject,unsigned char);
void EDWAY_fnv_BezierObject_ChangeParams
(EDWAY_tdhBezierObject ,MTH3D_tdstVector*,MTH3D_tdstVector*,MTH3D_tdstVector*,MTH3D_tdstVector*);
void EDWAY_fnv_BezierObject_GetParams
(EDWAY_tdhBezierObject ,MTH3D_tdstVector*,MTH3D_tdstVector*,MTH3D_tdstVector*,MTH3D_tdstVector*);
/* retrieving speed :*/
MTH_tdxReal fn_xBezierObject_GetSpeed
(EDWAY_tdhBezierObject,unsigned char);
/* retrieving point */
void EDWAY_fnv_BezierObject_GetPoint
(EDWAY_tdhBezierObject,unsigned char,MTH3D_tdstVector*);
/* drawing the bezier object */
void EDWAY_fnv_BezierObject_Draw(EDWAY_tdhBezierObject);
#endif /* !__EDIBEZ_PROTOS__ */
#endif /* !ONLY_TYPES */

View File

@@ -0,0 +1,420 @@
/*
------------------------------------------------------------------------------------------
HEADER FILE FOR :
Definition of (way) editor object : circle arc curves.
------------------------------------------------------------------------------------------
File Name :
Edi_CiAr.h
------------------------------------------------------------------------------------------
Creation :
* Date :
February 25, 1997
* Author :
Albert PAIS
------------------------------------------------------------------------------------------
Contents :
This file defines structures and functions for the circle arc curve used by
the (way) editor
------------------------------------------------------------------------------------------
Remarks :
Code comes from old circlway.h made by Yann Le Tensorer (January-February 1997)
------------------------------------------------------------------------------------------
See Also :
Mth_CiAr.h/.c for mathematical circle arc curve definition and implementation.
------------------------------------------------------------------------------------------
Modification :
* Date :
* Author :
* Modify :
------------------------------------------------------------------------------------------
*/
#if !defined(__EDICIAR_TYPES__)
#define __EDICIAR_TYPES__
#if !defined(ONLY_TYPES)
#define EDICIAR_UNDEF
#define ONLY_TYPES
#endif /* !ONLY_TYPES */
/*
------------------------------------------------------------------------------------------
INCLUDE FILES :
------------------------------------------------------------------------------------------
*/
/*
----------------------------------------
File Name :
mth3d.h
----------------------------------------
Required for :
Definition of standard 3d mathematic
objects
----------------------------------------
*/
#include "mth.h"
/*
----------------------------------------
File Name :
acp_base.h
----------------------------------------
Required for :
Definition of standard CPA objects
----------------------------------------
*/
#include "acp_base.h"
/*
----------------------------------------
File Name :
gld.h
----------------------------------------
Required for :
Graphic Library for Display
----------------------------------------
*/
#include "gld.h"
#if defined(EDICIAR_UNDEF)
#undef ONLY_TYPES
#undef EDICIAR_UNDEF
#endif /* !EDICIAR_UNDEF */
/*
------------------------------------------------------------------------------------------
TYPE AND STRUCTURE DEFINITION :
------------------------------------------------------------------------------------------
*/
void JustToLinkCiAr (void);
/*
----------------------------------------
Type definition :
The circle arc object for (way) editor
----------------------------------------
* Structure Name :
EDWAY_tdstCircleArcObject_
* Type def :
EDWAY_tdstCircleArcObject
* Handles :
EDWAY_tdhCircleArcObject
----------------------------------------
Creation Date :
February 25,1997
Author :
Albert PAIS
----------------------------------------
Members :
* Type : MTH3D_tdhCircleArcCurve
Name : m_hCircleArcCurve
Meaning : A handle on the mathematical
circle arc curve associated
* Type : ACP_tdxHandleOfObject
Name : m_hGeometricObject
Meaning : A handle on a geometric
object
* Type : ACP_tdxHandleOfElement
Name : m_hLineElement
Meaning : A handle on a line element
object
* Type : long
Name : m_lColor
Meaning : Color of the curve (24bit)
* Type : GLD_tdstViewportAttributes
Name : m_pstViewPortAttributes
Meaning : pointer on the view port
attributes
* Type : MTH3D_tdstVector
Name : m_dstListOfPoints
Meaning : Dynamic array on the
points of the circle arc curve
in case mode=C_ucModeNoObject
* Type : ACP_tdstDynaParam
Name : m_pstDynaParams
Meaning : A pointer on the dynamic
params associated
* Type : MTH3D_tdstMatrix
Name : m_stLocalRepere
Meaning : The local repere
* Type : MTH3D_tdstMatrix
Name : m_stInvLocalRepere
Meaning : The inverse matrix of the
local repere
* Type : MTH3D_tdstVector
Name : m_stLocalStartPoint
Meaning : The starting point
in the local repere
* Type : MTH3D_tdstVector
Name : m_stLocalEndPoint
Meaning : The ending point
in the local repere
* Type : MTH_tdxReal
Name : m_xMainAngle
Meaning : The angle between OA,OB,
O stands for the center
A stands for the starting point
B stands for the ending point
* Type : unsigned char
Name : m_ucObjectMode
Meaning : the object mode :
C_ucModeNoObject or C_ucModeRealObject
---------------------------------------
*/
#ifdef _EDWAY_CIRCLEARC_FRIEND_
typedef struct EDWAY_tdstCircleArcObject_
{
MTH3D_tdhCircleArcCurve m_hCircleArcCurve;
ACP_tdxHandleOfObject m_hGeometricObject;
ACP_tdxHandleOfElement m_hLineElement;
long m_lColor;
GLD_tdstViewportAttributes *m_pstViewPortAttributes;
// MTH3D_tdstVector *m_dstListOfPoints;
MTH3D_tdstVector** m_pdstListOfPoints;
ACP_tdstDynaParam *m_pstDynaParams;
MTH3D_tdstMatrix m_stLocalRepere;
MTH3D_tdstMatrix m_stInvLocalRepere;
MTH3D_tdstVector m_stLocalStartPoint;
MTH3D_tdstVector m_stLocalEndPoint;
MTH_tdxReal m_xMainAngle;
unsigned char m_ucObjectMode;
} EDWAY_tdstCircleArcObject;
#endif /* _EDWAY_CIRCLEARC_FRIEND_ */
typedef struct EDWAY_tdstCircleArcObject_* EDWAY_tdhCircleArcObject;
#endif /* !__EDICIAR_TYPES__ */
#if !defined(ONLY_TYPES)
#if !defined(__EDICIAR_VARS__)
#define __EDICIAR_VARS__
#undef EXTERN
#undef extern
#if !defined(GLOBALS)
#define EXTERN extern
#else /* !GLOBALS */
#define EXTERN
#endif /* !GLOBALS */
/*
------------------------------------------------------------------------------------------
VARIABLE DECLARATION :
<type> <variable name>
#if defined(GLOBALS)
= <initial values>
#endif
;
------------------------------------------------------------------------------------------
*/
/*
------------------------------------------------------------------------------------------
MACROS-CONSTANT DECLARATION:
------------------------------------------------------------------------------------------
*/
/* Invalid handle :*/
#define EDWAY_C_hInvalidCircleArcObject ((EDWAY_tdhCircleArcObject)0)
/* no geometric object created : */
#define EDWAY_C_ucModeNoObject ((unsigned char)0)
/* a geometric object is created */
#define EDWAY_C_ucModeRealObject ((unsigned char)1)
#undef extern
#endif /* !__EDICIAR_VARS__ */
#if !defined (__EDICIAR_PROTOS__)
#define __EDICIAR_PROTOS__
/*
------------------------------------------------------------------------------------------
MACROS-FUNCTIONS DECLARATION:
------------------------------------------------------------------------------------------
*/
#ifdef _EDWAY_CIRCLEARC_FRIEND_
#define EDWAY_M_vCircleArcObjectGetPointerParam(_hCirArcObj,_pxPointer,_SlotName)\
(*(_pxPointer) = (_hCirArcObj)->m_st##_SlotName##)
#define EDWAY_M_xCircleArcObjectGetScalarParam(_hCirArcObj,_Prefix,_SlotName)\
((_hCirArcObj)->m_##_Prefix## ##_SlotName##)
#define EDWAY_M_vCircleArcObjectSetPointerParam(_hCirArcObj,_pxPointer,_SlotName)\
((_hCirArcObj)->m_st##_SlotName## = *(_pxPointer))
#define EDWAY_M_vCircleArcObjectSetScalarParam(_hCirArcObj,_xScalar,_Prefix,_SlotName)\
((_hCirArcObj)->m_##_Prefix## ##_SlotName## = (_xScalar))
#define EDWAY_M_uwCircleArcObjectSizeOf()\
((unsigned short)(sizeof(struct EDWAY_tdstCircleArcObject_)))
/* Only defined for friend!!!!! */
/* not very clean, but efficient :*/
#define EDWAY_M_pstCircleArcObjectGetLocalRepere(_hCirArcObj)\
(&(EDWAY_M_xCircleArcObjectGetScalarParam(_hCirArcObj,st,LocalRepere)))
#define EDWAY_M_pstCircleArcObjectGetInvLocalRepere(_hCirArcObj)\
(&(EDWAY_M_xCircleArcObjectGetScalarParam(_hCirArcObj,st,InvLocalRepere)))
#define EDWAY_M_pstCircleArcObjectGetLocalStartPoint(_hCirArcObj)\
(&(EDWAY_M_xCircleArcObjectGetScalarParam(_hCirArcObj,st,LocalStartPoint)))
#define EDWAY_M_pstCircleArcObjectGetLocalEndPoint(_hCirArcObj)\
(&(EDWAY_M_xCircleArcObjectGetScalarParam(_hCirArcObj,st,LocalEndPoint)))
#else /* _EDWAY_CIRCLEARC_FRIEND_ */
#define EDWAY_M_vCircleArcObjectGetPointerParam(_hCirArcObj,_pxPointer,_SlotName)\
(EDWAY_fnv_CircleArcObject_Get##_SlotName##(_hCirArcObj,_pxPointer))
#define EDWAY_M_xCircleArcObjectGetScalarParam(_hCirArcObj,_Prefix,_SlotName)\
(EDWAY_fn##_Prefix##_CircleArcObject_Get##_SlotName##(_hCirArcObj))
#define EDWAY_M_vCircleArcObjectSetPointerParam(_hCirArcObj,_pxPointer,_SlotName)\
(EDWAY_fnv_CircleArcObject_Set##_SlotName##(_hCirArcObj,_pxPointer))
#define EDWAY_M_vCircleArcObjectSetScalarParam(_hCirArcObj,_xScalar,_Prefix,_SlotName)\
(EDWAY_fnv_CircleArcObject_Set##_SlotName##(_hCirArcObj,_xScalar))
#define EDWAY_M_uwCircleArcObjectSizeOf()\
EDWAY_fnuw_CircleArcObject_SizeOf()
#endif /* _EDWAY_CIRCLEARC_FRIEND_ */
#define EDWAY_M_hCircleArcObjectGetCircleArcCurve(_hCirArcCon)\
EDWAY_M_xCircleArcObjectGetScalarParam(_hCirArcCon,h,CircleArcCurve)
#define EDWAY_M_hCircleArcObjectGetGeometricObject(_hCirArcCon)\
EDWAY_M_xCircleArcObjectGetScalarParam(_hCirArcCon,h,GeometricObject)
#define EDWAY_M_hCircleArcObjectGetLineElement(_hCirArcCon)\
EDWAY_M_xCircleArcObjectGetScalarParam(_hCirArcCon,h,LineElement)
#define EDWAY_M_lCircleArcObjectGetColor(_hCirArcCon)\
EDWAY_M_xCircleArcObjectGetScalarParam(_hCirArcCon,l,Color)
#define EDWAY_M_pstCircleArcObjectGetViewPortAttributes(_hCirArcCon)\
EDWAY_M_xCircleArcObjectGetScalarParam(_hCirArcCon,pst,ViewPortAttributes)
#define EDWAY_M_dstCircleArcObjectGetListOfPoints(_hCirArcCon)\
EDWAY_M_xCircleArcObjectGetScalarParam(_hCirArcCon,dst,ListOfPoints)
#define EDWAY_M_pstCircleArcObjectGetDynaParams(_hCirArcCon)\
EDWAY_M_xCircleArcObjectGetScalarParam(_hCirArcCon,pst,DynaParams)
#define EDWAY_M_vCircleArcObjectGetLocalRepere(_hCirArcCon,_pstLocRep)\
EDWAY_M_vCircleArcObjectGetPointerParam(_hCirArcCon,_pstLocRep,LocalRepere)
#define EDWAY_M_vCircleArcObjectGetInvLocalRepere(_hCirArcCon,_pstInvLocRep)\
EDWAY_M_vCircleArcObjectGetPointerParam(_hCirArcCon,_pstInvLocRep,InvLocalRepere)
#define EDWAY_M_vCircleArcObjectGetLocalStartPoint(_hCirArcCon,_pstLocStaPoi)\
EDWAY_M_vCircleArcObjectGetPointerParam(_hCirArcCon,_pstLocStaPoi,LocalStartPoint)
#define EDWAY_M_vCircleArcObjectGetLocalEndPoint(_hCirArcCon,_pstLocEndPoi)\
EDWAY_M_vCircleArcObjectGetPointerParam(_hCirArcCon,_pstLocEndPoi,LocalEndPoint)
#define EDWAY_M_xCircleArcObjectGetMainAngle(_hCirArcCon)\
EDWAY_M_xCircleArcObjectGetScalarParam(_hCirArcCon,x,MainAngle)
#define EDWAY_M_ucCircleArcObjectGetObjectMode(_hCirArcCon)\
EDWAY_M_xCircleArcObjectGetScalarParam(_hCirArcCon,uc,ObjectMode)
#define EDWAY_M_vCircleArcObjectSetCircleArcCurve(_hCirArcCon,_hCirArcCur)\
EDWAY_M_vCircleArcObjectSetScalarParam(_hCirArcCon,_hCirArcCur,h,CircleArcCurve)
#define EDWAY_M_vCircleArcObjectSetGeometricObject(_hCirArcCon,_hGeoObj)\
EDWAY_M_vCircleArcObjectSetScalarParam(_hCirArcCon,_hGeoObj,h,GeometricObject)
#define EDWAY_M_vCircleArcObjectSetLineElement(_hCirArcCon,_LinEle)\
EDWAY_M_vCircleArcObjectSetScalarParam(_hCirArcCon,_LinEle,h,LineElement)
#define EDWAY_M_vCircleArcObjectSetColor(_hCirArcCon,_lCol)\
EDWAY_M_vCircleArcObjectSetScalarParam(_hCirArcCon,_lCol,l,Color)
#define EDWAY_M_vCircleArcObjectSetViewPortAttributes(_hCirArcCon,_pstViePorAtt)\
EDWAY_M_vCircleArcObjectSetScalarParam(_hCirArcCon,_pstViePorAtt,pst,ViewPortAttributes)
#define EDWAY_M_vCircleArcObjectSetListOfPoints(_hCirArcCon,_dstLisOfPts)\
EDWAY_M_vCircleArcObjectSetScalarParam(_hCirArcCon,_dstLisOfPts,dst,ListOfPoints)
#define EDWAY_M_vCircleArcObjectSetDynaParams(_hCirArcCon,_pstDynPar)\
EDWAY_M_vCircleArcObjectSetScalarParam(_hCirArcCon,_pstDynPar,pst,DynaParams)
#define EDWAY_M_vCircleArcObjectSetLocalRepere(_hCirArcCon,_pstLocRep)\
EDWAY_M_vCircleArcObjectSetPointerParam(_hCirArcCon,_pstLocRep,LocalRepere)
#define EDWAY_M_vCircleArcObjectSetInvLocalRepere(_hCirArcCon,_pstInvLocRep)\
EDWAY_M_vCircleArcObjectSetPointerParam(_hCirArcCon,_pstInvLocRep,InvLocalRepere)
#define EDWAY_M_vCircleArcObjectSetLocalStartPoint(_hCirArcCon,_pstLocStaPoi)\
EDWAY_M_vCircleArcObjectSetPointerParam(_hCirArcCon,_pstLocStaPoi,LocalStartPoint)
#define EDWAY_M_vCircleArcObjectSetLocalEndPoint(_hCirArcCon,_pstLocEndPoi)\
EDWAY_M_vCircleArcObjectSetPointerParam(_hCirArcCon,_pstLocEndPoi,LocalEndPoint)
#define EDWAY_M_vCircleArcObjectSetMainAngle(_hCirArcCon,_xNewMainAng)\
EDWAY_M_vCircleArcObjectSetScalarParam(_hCirArcCon,_xNewMainAng,x,MainAngle)
#define EDWAY_M_vCircleArcObjectSetObjectMode(_hCirArcCon,_ucObjMod)\
EDWAY_M_vCircleArcObjectSetScalarParam(_hCirArcCon,_ucObjMod,uc,ObjectMode)
/*
------------------------------------------------------------------------------------------
FUNCTIONS DECLARATION:
------------------------------------------------------------------------------------------
*/
/* creation and destruction of the structure */
EDWAY_tdhCircleArcObject EDWAY_fnh_CircleArcObject_CreateSturcture(void);
void EDWAY_fnv_CircleArcObject_DestroyStructure(EDWAY_tdhCircleArcObject);
/* Creation :*/
void EDWAY_fnv_CircleArcObject_Create
(EDWAY_tdhCircleArcObject,unsigned char,MTH3D_tdstVector*,MTH3D_tdstVector*,MTH3D_tdstVector*,unsigned char,ACP_tdstDynaParam*,MTH3D_tdstVector** pdstListOfPoints);
void EDWAY_fnv_CircleArcObject_CreateFromCurve
(
EDWAY_tdhCircleArcObject _hCircleArcObject,
MTH3D_tdhCircleArcCurve _hCircleArcCurve,
unsigned char _ucObjectMode,
ACP_tdstDynaParam* _pstDynaParams,
MTH3D_tdstVector** pdstListOfPoints
);
void EDWAY_fnv_CircleArcObject_Free(EDWAY_tdhCircleArcObject);
/* computing points :*/
void EDWAY_fnv_CircleArcObject_Calculate
(EDWAY_tdhCircleArcObject);
/* getting the size of the structure :*/
unsigned short EDWAY_fnuw_CircleArcObject_SizeOf(void);
/* Getting fields values :*/
MTH3D_tdhCircleArcCurve EDWAY_fnh_CircleArcObject_GetCircleArcCurve(EDWAY_tdhCircleArcObject);
ACP_tdxHandleOfObject EDWAY_fnh_CircleArcObject_GetGeometricObject(EDWAY_tdhCircleArcObject);
ACP_tdxHandleOfElement EDWAY_fnh_CircleArcObject_GetLineElement(EDWAY_tdhCircleArcObject);
long EDWAY_fnl_CircleArcObject_GetColor(EDWAY_tdhCircleArcObject);
GLD_tdstViewportAttributes* EDWAY_fnpst_CircleArcObject_GetViewPortAttributes(EDWAY_tdhCircleArcObject);
MTH3D_tdstVector* EDWAY_fndst_CircleArcObject_GetListOfPoints(EDWAY_tdhCircleArcObject);
ACP_tdstDynaParam* EDWAY_fnpst_CircleArcObject_GetDynaParams(EDWAY_tdhCircleArcObject);
void EDWAY_fnv_CircleArcObject_GetLocalRepere(EDWAY_tdhCircleArcObject,MTH3D_tdstMatrix*);
void EDWAY_fnv_CircleArcObject_GetInvLocalRepere(EDWAY_tdhCircleArcObject,MTH3D_tdstMatrix*);
void EDWAY_fnv_CircleArcObject_GetLocalStartPoint(EDWAY_tdhCircleArcObject,MTH3D_tdstVector*);
void EDWAY_fnv_CircleArcObject_GetLocalEndPoint(EDWAY_tdhCircleArcObject,MTH3D_tdstVector*);
MTH_tdxReal EDWAY_fnx_CircleArcObject_GetMainAngle(EDWAY_tdhCircleArcObject);
unsigned char EDWAY_fnuc_CircleArcObject_GetObjectMode(EDWAY_tdhCircleArcObject);
/* changing (and only changing) fields value */
void EDWAY_fnv_CircleArcObject_SetCircleArcCurve(EDWAY_tdhCircleArcObject,MTH3D_tdhCircleArcCurve);
void EDWAY_fnv_CircleArcObject_SetGeometricObject(EDWAY_tdhCircleArcObject,ACP_tdxHandleOfObject);
void EDWAY_fnv_CircleArcObject_SetLineElement(EDWAY_tdhCircleArcObject,ACP_tdxHandleOfElement);
void EDWAY_fnv_CircleArcObject_SetColor(EDWAY_tdhCircleArcObject,long);
void EDWAY_fnv_CircleArcObject_SetViewPortAttributes(EDWAY_tdhCircleArcObject,GLD_tdstViewportAttributes*);
void EDWAY_fnv_CircleArcObject_SetListOfPoints(EDWAY_tdhCircleArcObject,MTH3D_tdstVector*);
void EDWAY_fnv_CircleArcObject_SetDynaParams(EDWAY_tdhCircleArcObject,ACP_tdstDynaParam *);
void EDWAY_fnv_CircleArcObject_SetLocalRepere(EDWAY_tdhCircleArcObject,MTH3D_tdstMatrix*);
void EDWAY_fnv_CircleArcObject_SetInvLocalRepere(EDWAY_tdhCircleArcObject,MTH3D_tdstMatrix*);
void EDWAY_fnv_CircleArcObject_SetLocalStartPoint(EDWAY_tdhCircleArcObject,MTH3D_tdstVector*);
void EDWAY_fnv_CircleArcObject_SetLocalEndPoint(EDWAY_tdhCircleArcObject,MTH3D_tdstVector*);
void EDWAY_fnv_CircleArcObject_SetMainAngle(EDWAY_tdhCircleArcObject,MTH_tdxReal);
void EDWAY_fnv_CircleArcObject_SetObjectMode(EDWAY_tdhCircleArcObject,unsigned char);
/* Changing fields value and reflect back consequences : */
ACP_tdxBool EDWAY_fnb_CircleArcObject_ChangeSamplingRate(EDWAY_tdhCircleArcObject,unsigned char);
void EDWAY_fnv_CircleArcObject_ChangeParams
(EDWAY_tdhCircleArcObject,MTH3D_tdstVector*,MTH3D_tdstVector*,MTH3D_tdstVector*);
void EDWAY_fnv_CircleArcObject_GetParams
(EDWAY_tdhCircleArcObject,MTH3D_tdstVector*,MTH3D_tdstVector*,MTH3D_tdstVector*);
/* retrieving speed :*/
MTH_tdxReal fn_xCircleArcObject_GetSpeed
(EDWAY_tdhCircleArcObject,unsigned char);
/* retrieving point */
void EDWAY_fnv_CircleArcObject_GetPoint
(EDWAY_tdhCircleArcObject,unsigned char,MTH3D_tdstVector*);
/* drawing the circle arc object */
void EDWAY_fnv_CircleArcObject_Draw(EDWAY_tdhCircleArcObject);
void EDWAY_fnv_CircleArcObject_GlobalToLocal(EDWAY_tdhCircleArcObject,MTH3D_tdstVector*,MTH3D_tdstVector*);
void EDWAY_fnv_CircleArcObject_LocalToGlobal(EDWAY_tdhCircleArcObject,MTH3D_tdstVector*,MTH3D_tdstVector*);
#endif /* !__EDICIAR_PROTOS__ */
#endif /* !ONLY_TYPES */

View File

@@ -0,0 +1,676 @@
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : Inter.hpp
//
// Interface DLL class.
// This class is implement the DLL class.
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// inherit from CPA_ObjectDLLBase
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 21 jan 1997 Author: J Th<54>noz
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
//
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
*/
#ifndef __WPINTERF_HPP__
#define __WPINTERF_HPP__
class WayPoint;
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
class Way;
class Link2D;
class Link;
class DiaWP;
class DiaWay;
class DiaLink;
class Tangent;
*/
//ENDANNECY Shaitan Nettoyage }
//ROMTEAM Networks (Gabriela Dumitrascu 25/02/98)
class NtwDia;
//ENDROMTEAM Networks (Gabriela Dumitrascu)
class Cursor;
class Way_Interface;
class CPA_tdoNameList;
class Geometry3D;
class EdtList;
// Shaitan Correction {
class Graph;
// End Shaitan Correction }
//-----------------------------------------------------------
// Definition of the types objects
//-----------------------------------------------------------
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
#define C_ucWay 1968
#define C_ucLink 1997
#define C_ucTangent 1945
*/
//ENDANNECY Shaitan Nettoyage }
#define C_ucCursor 1918
//ROMTEAM Networks (Gabriela Dumitrascu 25/02/98)
#define C_ucGraph 1969
#define C_ucConnection 1970
//ENDROMTEAM Networks (Gabriela Dumitrascu)
// Shaitan Correction {
typedef enum tdeLinkDisplayMode_
{
E_dm_ShowAllLinks,
E_dm_ShowOutLinks,
E_dm_ShowInLinks,
E_dm_ShowNothing
}
tdeLinkDisplayMode;
typedef enum tdeWpSelectMode_
{
E_sm_AddOrRemoveWP,
E_sm_PrevWP_Popup,
E_sm_NextWP_Popup,
E_sm_NextWP_Key,
E_sm_PrevWP_Key,
E_sm_NextWP_Continue,
E_sm_PrevWP_Continue,
E_sm_Normal
}
tdeWpSelectMode;
// End Shaitan Correction }
//----------------------------------------------------------
// Object DLL interface class
//----------------------------------------------------------
class Waypoint_Interface : public CPA_ObjectDLLBase
{
private:
//---- Flags
BOOL m_bModifInsertOk; // Force the acception of the AcceptModifInsert message
BOOL m_bModifDeleteOk; // Force the acception of the AcceptModifDelete message
BOOL m_bRunEngine; // we are runnin the game
BOOL m_bStopDraw; // Stop the effect of fn_vAddObjectsToDraw
BOOL m_bCreateMode; // we are creating a way
BOOL m_bMainDll; // this DLL is the main one ( for popup menu )
BOOL m_bRefreshWay;
BOOL m_bListAlreadyCreated; // The list is already created by the DLL
BOOL m_bAddLink; // The next waypoint is inserted on a link
BOOL m_bExistWaypointSaveFile; // The waypoint save file exists when we change the map
BOOL m_bExistWaySaveFile; // The way save file exists when we change the map
BOOL m_bComputeEngineWaypoint; // No modif insert actions
BOOL m_bNextInstanceInWay; // The next instance is created in a way
BOOL m_bStopSelect; // selection is lock
BOOL m_bFirstBeforeEditor; // never enter Before Editor function
BOOL m_bFirstActivateEditor; // never enter OnActivateEditor function
BOOL m_bSkipOnModifDelete; // skip OnModifDelete
BOOL m_bSkipOnModifInsert; // skip OnModifInsert
BOOL m_bCommandWP;
BOOL m_bCommandLink;
BOOL m_bDialogOnScreen; // is the dialog way/WP display on the screen ?
BOOL m_bModifRadius; // Are we in modify radius mode ?
BOOL m_bOrientTangent; // mouse tangent orientation
//---- general
CPA_EditorBase* m_poGeomDll; // Geom Dll
CPA_DialogList* m_p_oDialogList ; // dialog list
CSplitFrame* m_p_oSplitFrameWP; // split frame
//----CPA_List
//ANNECY Shaitan Nettoyage (12/05/98) {
// CPA_List<Way> m_ListMovingWay; // List of the Way to redraw by the OnMouving function
//ENDANNECY Shaitan Nettoyage }
CPA_List<WayPoint> m_ListMovingWP; // List of the WP to recompute by the OnMouving function
CPA_List<CPA_SuperObject> m_oLoadListOfWay; // list of the loaded way
//---- CPA_BaseObjectList
CPA_BaseObjectList m_oSortedListOfWay;
CPA_BaseObjectList m_oSortedListOfObjectList;
CPA_BaseObjectList m_oSortedListOfNameList;
CPA_BaseObjectList m_oSortedListOfFamilly;
CPA_BaseObjectList m_oSortedListOfActorModel;
CPA_BaseObjectList m_oSortedListOfActorInstance;
//---- Icon list
CImageList m_oIconWayList; // list of icons for way list
//---- waypoint management
MTH3D_tdstVector m_stdCenterWP; // center in real coordinate of the WP that is beeing moved
MTH3D_tdstVector m_stdMouseVertex; // vertex of the mouse at the beginning of the draging action
WayPoint* m_o_ModifRadiusWP; // We modify the radius of this WP
//CPA2 Gabriela Dumitrascu 98-05-07
// Shaitan Correction {
// BOOL m_bGraphMove;
//End Shaitan Correction }
//End CPA2 Gabriela Dumitrascu 98-05-07
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
//---- way management
Way* m_pModifInsertWay; // ref to the edit way
WayPoint* m_poAddWP; // this is the WP we add to the way in the dialog
Way* m_pElasticWay; // this the way we create
CPA_SuperObject* m_p_oGraphicModelLine; // model of graphic line
//---- link management
Link2D* m_poRButtonLink; // R button on this link
Link* m_poSelectLink; // we try to move this link
Tangent* m_poTangentMove; // Tangent we edit
Link2D* m_poPlaneMove; // Plane we rotate
Cursor* m_poCursorMove; // Cursor we translate
//---- RButton capture
Tangent* m_poRButtonDownTangent; // we make a Rbutton Down on this tangent
BOOL m_bRButtonDownTangent; // m_poRButtonDownTangent is valid
Way* m_poRButtonDownWay; // we make a Rbutton Down on this way
BOOL m_bRButtonDownWay; // m_poRButtonDownWay is valid
*/
//ENDANNECY Shaitan Nettoyage }
//CPA2 Gabriela Dumitrascu 98-04-07
// Shaitan Correction {
// BOOL m_bRButtonDownWayPoint; // m_poRButtonDownWayPoint is valid
//End Shaitan Correction }
//End CPA2 Gabriela Dumitrascu 98-04-07
//---- List management
//ANNECY Shaitan Nettoyage (12/05/98) {
// CPA_BaseObject* m_poWay; // Current way
//ENDANNECY Shaitan Nettoyage }
CPA_BaseObject* m_poActor; // Current actor instance
CPA_BaseObject* m_poModel; // Current actor model
CPA_BaseObject* m_poFamilly; // Current familly
EdtList* m_poWayList; // Current Edtlist
// these datas are very protected and are just used to transmit datas between key down and key up
GLI_tdst2DVertex m_stMouseVertex2DCreate;
MTH3D_tdstVector m_stMouseVertex3DCreate;
BOOL m_bMouseVertexValid; // These 2 previous values are valid ?
// Shaitan Correction {
Graph * m_pSelectedGraph;
WayPoint * m_pDisplayedWayPoint;
tdeLinkDisplayMode m_eDisplayMode;
tdeWpSelectMode m_eSelectMode;
BOOL m_bSymetricMode;
CPA_KeyActionConfiguration * m_p_oKeyboard;
// End Shaitan Correction }
public:
Waypoint_Interface(void);
//----------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------
// Dll Base
//----------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------
// BOOL fn_bPreTranslateMessage(MSG * /*p_stMsg*/);
void fn_vJustAfterRegistered(void);
void fn_vConstruct(void);
// void fn_vRefreshDatas(void);
// void fn_vLevelChanges (void);
void fn_vLevelHasChanged (void);
// Editor Modifs
void fn_vOnModifDelete (CPA_List<EDT_SaveParents> *pListObjects, tdeTypeModif eType, tdeStatus eStatus);
// void fn_vOnModifParent (CPA_List<EDT_SaveParents> *pListObjects, tdeTypeModif eType, tdeStatus eStatus);
// void fn_vOnModifCopy (CPA_List<EDT_SaveParents> *pListObjects, tdeTypeModif eType, tdeStatus eStatus);
// void fn_vOnModifName (CPA_SuperObject *pEdObj, CString csInitalName, CString csFinalName, tdeTypeModif eType, tdeStatus eStatus);
// void fn_vOnSelect (CPA_SuperObject *pEdObj, tdeTypeModif eType, tdeStatus eStatus);
void fn_vOnModifInsert (CPA_SuperObject *pEdObj, CPA_SuperObject *pParent,
tdstPosition *p_stPosition, tdeTypeModif eType, tdeStatus eStatus);
// Moves
void fn_vOnModifMove (CPA_List<EDT_SavePos> *pListObjects, CPA_List<EDT_SaveGlobalPos> *pListConcerned, tdeTypeModif eType, tdeStatus eStatus);
void fn_vOnBeginMove (CPA_List<CPA_SuperObject> *pListObjects, CPA_List<CPA_SuperObject> *pListConcerned, tdeStatus eStatus);
void fn_vOnMoving (CPA_List<CPA_SuperObject> *pListObjects, CPA_List<CPA_SuperObject> *pListConcerned, tdeStatus eStatus);
// permission
BOOL fn_bAcceptModifDelete (CPA_List<CPA_SuperObject> *pListObjects, tdeStatus eStatus);
// BOOL fn_bAcceptModifParent (CPA_List<CPA_SuperObject> *pListObjects, tdeStatus eStatus);
BOOL fn_bAcceptModifCopy (CPA_List<CPA_SuperObject> *pListObjects, tdeStatus eStatus);
BOOL fn_bAcceptModifTranslate (CPA_List<CPA_SuperObject> *pListObjects, tdeStatus eStatus);
BOOL fn_bAcceptModifRotate (CPA_List<CPA_SuperObject> *pListObjects, tdeStatus eStatus);
BOOL fn_bAcceptModifInsert (CPA_SuperObject *pEdObj, CPA_SuperObject *pParent, tdeStatus eStatus);
// BOOL fn_bAcceptModifScale (CPA_SuperObject *pEdObj, tdeStatus eStatus);
// BOOL fn_bAcceptModifName (CPA_SuperObject *pEdObj, tdeStatus eStatus);
// BOOL fn_bAcceptMultiSelect (void);
// to precise selection
tdeTypeAnswer fn_bAcceptSelect (CPA_SuperObject *pEdObj, ACP_tdxIndex xIndex, HIE_tdstPickInfo *pPicking, tdeStatus eStatus);
// orient
// BOOL fn_bAcceptOrientInstance (CPA_SuperObject *pEdObj);
// BOOL fn_bOnClickOrientPosition (CPA_SuperObject *pEdObj, tdstPosition *pOrientPosition);
// BOOL fn_bOnOrientingObject (CPA_SuperObject *pEdObj, tdstPosition *pOrientPosition);
// BOOL fn_bOnEndOrientObject (CPA_SuperObject *pEdObj, tdstPosition *pOrientPosition);
/*===========================================================================
Dialog List
=========================================================================*/
// BOOL fn_bSetCustomTest (CPA_DialogList *pDialog);
// BOOL fn_bCustomTestFunction (CString csCurrentType, CString csTestName, CPA_BaseObject *pEdObj);
//----------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------
// Editor Base
//----------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------
// focus
// void fn_vHasLostFocus (void);
// BOOL fn_bHasGainedFocus (void);
// engine - editor
void fn_vBeforeEngine (void);
void fn_vBeforeEditor (void);
// engine
BOOL fn_bAcceptToRunEngine (void);
// BOOL fn_bAcceptToRunTimerEngine (void);
// end appli
// void fn_vJustBeforeClosing (void);
BOOL fn_bAcceptToExit (void);
// save
BOOL fn_bAcceptToSave (void);
// void fn_vBeforeSaveAll (void);
void fn_vAfterSaveAll (void);
// Shaitan Correction {
// keys
BOOL _OnKeyDown (UINT nChar, UINT nRepCnt, UINT nFlags);
BOOL _OnKeyUp (UINT nChar, UINT nRepCnt, UINT nFlags);
//End Shaitan Correction }
// mouse
BOOL _OnMouseMove (UINT nFlags, tdstMousePos *p_stPos, MTH3D_tdstVector *p_stVect);
BOOL _OnLButtonDblClk (UINT nFlags, tdstMousePos *p_stPos, ACP_tdxIndex xIndex, HIE_tdstPickInfo *p_stPickInfo);
// BOOL _OnRButtonDblClk (UINT nFlags, tdstMousePos *p_stPos, ACP_tdxIndex xIndex, HIE_tdstPickInfo *p_stPickInfo);
BOOL _OnLButtonDown (UINT nFlags, tdstMousePos *p_stPos, ACP_tdxIndex xIndex, HIE_tdstPickInfo *p_stPickInfo);
BOOL _OnRButtonDown (UINT nFlags, tdstMousePos *p_stPos, ACP_tdxIndex xIndex, HIE_tdstPickInfo *p_stPickInfo);
BOOL _OnLButtonUp (UINT nFlags, tdstMousePos *p_stPos);
// BOOL _OnRButtonUp (UINT nFlags, tdstMousePos *p_stPos);
// command
// BOOL _OnCommand (UINT IDCmdMsg);
// BOOL _OnUpdateCommandUI (UINT uiID, CCmdUI *pCmdUI);
// dragdrop
// BOOL _OnDragDropEnd (WPARAM wParam, LPARAM lParam);
// BOOL _OnDragDropMove (WPARAM wParam, LPARAM lParam);
// BOOL _OnDragDropLooseFocus (WPARAM wParam, LPARAM lParam);
// BOOL _OnDragDropGainFocus (WPARAM wParam, LPARAM lParam);
// add objects to draw
void fn_vAddObjectsToDraw (GLD_tdstViewportAttributes *p1, GLI_tdxHandleToLight p2, DEV_ViewPort* p3);
// void fn_vAddObjectsToDraw2 (GLD_tdstViewportAttributes *p1, GLI_tdxHandleToLight p2);
/*===========================================================================
Reinit
=========================================================================*/
// void fn_vOnChangeDevice (void);
// void fn_vOnChangeWorld (void);
// void fn_vOnChangeRoot (void);
/*===========================================================================
Models
=========================================================================*/
// BOOL fn_bCanDeleteThisModel (CString csListName, CString csModelType, CString csModelName);
// void fn_vOnAddModelToList (CPA_ObjectDLLBase *pOwnerDLL, CString csListName, CString csModelName, tdeTypeModif eType);
/*===========================================================================
for Dialog List
=========================================================================*/
CPA_BaseObject * GetDialogSelection (CPA_DialogList *pDialog, CString csTypeName, tdeListDrawMode eDrawMode);
void GetListsForDialog (CPA_DialogList *pDialog);
BOOL fn_bOnSelChangeHierarchyTree (CPA_DialogList *pDialog, CString csListName, CPA_BaseObject *pSelectedObject, CPA_BaseObject *pSelectedParent);
BOOL fn_bOnDblClkHierarchyTree (CPA_DialogList *pDialog, CString csListName, CPA_BaseObject *pSelectedObject, CPA_BaseObject *pSelectedParent);
BOOL fn_bOnSelChangeListObjects (CPA_DialogList *pDialog, CString csTypeName, CPA_BaseObject *pSelectedObject, BOOL bUnselect);
BOOL fn_bOnDblClkListObjects (CPA_DialogList *pDialog, CString csTypeName, CPA_BaseObject *pSelectedObject);
// BOOL fn_bCanDragItemInHierarchyTree (CPA_DialogList *pDialog, CString csTypeName, CPA_BaseObject *pObjectToDrag);
// BOOL fn_bCanDropItemInHierarchyTree (CPA_DialogList *pDialog, CString csTypeName, CPA_BaseObject *pObjectToDrop, CPA_BaseObject *pTarget);
// BOOL fn_bOnDragDropInHierarchyTree (CPA_DialogList *pDialog, CString csTypeName, CPA_BaseObject *pObject, CPA_BaseObject *pTarget);
BOOL fn_bOnSelChangeComboList (CPA_DialogList *pDialog, CString csTypeName);
BOOL fn_bOnButtonTest (CPA_DialogList *pDialog, CString csTypeName, tdeListDrawMode eDraw);
BOOL fn_bOnKeyDownInDialog (CPA_DialogList *pDialog, CString csTypeName, tdeListDrawMode eDraw,
CPA_BaseObject *pSelectedObject, UINT nChar, UINT nRepCnt, UINT nFlags);
// BOOL fn_bOnKeyUpInDialog (CPA_DialogList *pDialog, CString csTypeName, tdeListDrawMode eDraw,
// CPA_BaseObject *pSelectedObject, UINT nChar, UINT nRepCnt, UINT nFlags);
void fn_vInitDefaultParameters (CPA_DialogList *pDialog);
// void fn_vSetANewTest (CPA_DialogList *pDialog, CString csCurrentList);
BOOL fn_bTestFunction (CString csCurrentType, CString csTestName, CPA_BaseObject *pEdObj);
CString GetInfoForListItem (CPA_DialogList *pDialog, CString csListName, CPA_BaseObject *pObject);
// int GetIconForListItem (CPA_DialogList *pDialog, CString csListName, CPA_BaseObject *pObject);
int GetStateForListItem (CPA_DialogList *pDialog, CString csListName, CPA_BaseObject *pObject);
// CPA_BaseObject * GetTreeNodeFirstChild (CPA_DialogList *pDialog, CString csListName, CPA_BaseObject *pParent);
// CPA_BaseObject * GetTreeNodeNextChild (CPA_DialogList *pDialog, CString csListName, CPA_BaseObject *pParent, CPA_BaseObject *pCurrentChild);
// int GetIconForTreeItem (CPA_DialogList *pDialog, CString csListName, CPA_BaseObject *pObject);
// int GetStateForTreeItem (CPA_DialogList *pDialog, CString csListName, CPA_BaseObject *pObject);
/*===========================================================================
Current Editor
=========================================================================*/
tdePermission fn_eAcceptNewEditor (CPA_EditorBase *pNewEditor);
BOOL fn_bCanActivateEditor (CPA_List<CPA_BaseObject> *pParams);
void fn_vOnActivateEditor (CPA_List<CPA_BaseObject> *pParams, BOOL bBackActivated=FALSE);
// BOOL fn_bCanCloseEditor (void);
void fn_vOnCloseEditor (void);
// void fn_vBackActiveMe (void *pMyData);
// void fn_vEraseWalkDataStructure (void *pMyData);
/*===========================================================================
Dialog Bar - Mircea Dunka 31 Aug. 1998
=========================================================================*/
void fn_vDefineDlgBarBtnIcon (tde_DlgBarCategory wCategory, tds_DlgBarBtn *_pDlgBarBtn);
/*===========================================================================
SubMenus and PopupMenu
=========================================================================*/
BOOL fn_bDefineSubMenu (EDT_SubMenu *_p_oEDTSubMenu);
void _OnSubMenuCommand (EDT_SubMenu *_p_oEDTSubMenu,UINT uiMsgID);
BOOL fn_bDefinePopupMenu (EDT_PopUpMenu *pPopup, CPA_List<CPA_SuperObject> *pSelection, BOOL bAsCurrentEditor);
void _OnPopUpMenuCommand (UINT m_IDCmdMsg);
/*===========================================================================
Coherence
=========================================================================*/
// BOOL fn_bOnInvalidateLink (CPA_BaseObject *pOwner, CPA_BaseObject *pReferencedObject, BOOL bDestroyed);
// void fn_vOnRestoreLink (CPA_BaseObject *pOwner, CPA_BaseObject *pReferencedObject);
// void fn_vOnModifyChild (CPA_BaseObject *pOwner, CPA_BaseObject *pReferencedObject, unsigned long _ulData);
/*===========================================================================
Draw Flag
=========================================================================*/
// void fn_vOnModifDrawFlag (CPA_SuperObject *pSuperObject);
/*===========================================================================
General Purpose
=========================================================================*/
long OnQueryAction (CPA_EditorBase * /*p_oSender*/, WPARAM, LPARAM);
// long OnQueryInfos (CPA_EditorBase * /*p_oSender*/, WPARAM, LPARAM);
// long OnQueryOpen (CPA_EditorBase * /*p_oSender*/, WPARAM, LPARAM);
// long OnQueryClose (CPA_EditorBase * /*p_oSender*/, WPARAM, LPARAM);
/*===========================================================================
Reachable Objects
=========================================================================*/
// BOOL fn_bLoadBaseObject (CPA_BaseObject *p_oObject);
//----------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------
// Object DllBase
//----------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------
// hierarchy
// CPA_SuperObject * GetNewEditorInstance (HIE_tdxHandleToSuperObject pEngineInstance);
// void fn_vBuildNewEditorInstance (CPA_SuperObject *pEditorInstance, HIE_tdxHandleToSuperObject pEngineInstance);
// void fn_vUpdateEditorInstance (CPA_SuperObject *pEditorInstance, HIE_tdxHandleToSuperObject pEngineInstance);
// BOOL fn_bCanHandleThisType (long lEngineType);
// models & instances
void fn_vInitListByType (CPA_World *pWorld);
void fn_vInitListsOfModels (void);
// void fn_vSaveListModels (CString csListName, CPA_List<EDT_Model> *pListModels);
// CString fn_csLoadListModels (void);
// EDT_Model * GetNewModel (CString csListName);
// BOOL fn_bCanLoadNewModel (CString csListName);
// BOOL fn_bCanDeleteModel (CString csListName);
// BOOL fn_bCanSaveListModels (CString csListName);
// BOOL fn_bCanLoadListModels (void);
// void fn_vOnLoadNewModel (CString csListName, EDT_Model *pNewModel);
CPA_SuperObject * GetNewInstance (CString csTypeName, CString csModelName, CPA_SuperObject *pParent);
tdeTypeSO GetTypeInstance (CString csTypeName, CString csModelName);
//ANNECY Shaitan EmptySectors 25/02/98
tdeSaveStatus GetStatusInstance (CString csTypeName, CString csModelName);
//ENDANNECY Shaitan EmptySectors
CPA_SuperObject * GetParentForInsertion (CString csTypeName, CString csModelName, tdstPosition *p_stPosition);
// BOOL fn_bChooseInsertPosition (CPA_SuperObject *pNewInstance, CPA_SuperObject *pParent, tdstPosition *p_stPosition);
// objects
// CPA_BaseObject * GetNewObject (CString csObjectFile, CString csObjectName, FILE *p_fFile, CPA_MainWorld *p_oMainWorld);
CPA_BaseObject * Duplicate (CPA_BaseObject *pObject, CPA_SuperObject *pNewSuperObject);
CPA_SuperObject * GetCopyOfProtectedChild (CPA_SuperObject *pInitialChild, CPA_SuperObject *pNewOwner);
// permissions for EvtEditor
BOOL fn_bAcceptAsParent (CPA_BaseObject *pChild, CPA_BaseObject *pParent);
// BOOL fn_bAcceptAsChild (CPA_BaseObject *pParent, CPA_BaseObject *pChild);
// for bounding volumes
// void fn_vComputeBoundingVolume(CPA_BaseObject *pObject);
ACP_tdxHandleOfObject fn_hGetBoundingVolume(CPA_BaseObject *_pObj);
// when insertion is canceled
// void fn_vOnCancelInsertion (CPA_SuperObject *pInstance);
// Shaitan Correction {
// to scale editor objects
CPA_SuperObject * GetVisualSuperObject (CPA_SuperObject *pInstance);
//End Shaitan Correction }
void fn_vUpdateObjectList (CPA_BaseObject *p_oObject, tdeUpdate eType);
EDT_Model * fn_pstLoadNewDescriptor (void);
//--------------------------------------------------- Load
//ROMTEAM Networks (Gabriela Dumitrascu 25/02/98)
void fn_vLoadGraph (void);
//ENDROMTEAM Networks (Gabriela Dumitrascu)
void fn_vLoadWaypoint (void);
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
void fn_vLoadWay (void);
void fn_vInsertWaySon (void);
Way* fn_pCreateWayFromEngine ( WP_tdhWay hWay, CPA_BaseObject* poOwner, CString csName, CString csReferencedSectionName );
*/
//ENDANNECY Shaitan Nettoyage }
//--------------------------------------------------- copy of way
//ANNECY Shaitan Nettoyage (12/05/98) {
// CPA_SuperObject* fn_pCopyWay ( Way* poWay );
//ENDANNECY Shaitan Nettoyage }
void fn_vSetNextInstanceInWay (void) { m_bNextInstanceInWay=TRUE; }
void fn_vSetModifDeleteOk (BOOL bModifDeleteOk) { m_bModifDeleteOk=bModifDeleteOk; }
//-------------------------------------------------- Dialog management
void fn_vRefreshWaypointCoordinate (void);
void fn_vRefreshList (void);
void fn_vRefreshTestButton (void);
void fn_vSaveDialogsPreferences (void);
void fn_vSwapLinkDialog ( BOOL bOrientationMode );
//----------------------------------------------------------- Edition
void fn_vEdit (WayPoint* poWP);
//ANNECY Shaitan Nettoyage (12/05/98) {
// void fn_vEdit (Way* p_oWay, int iWpPos=0);
// void fn_vEdit (Link* p_oLink);
//ENDANNECY Shaitan Nettoyage }
// Is there a waypoint in any way ?
//ANNECY Shaitan Nettoyage (12/05/98) {
// BOOL fn_bWaypointInAWay ( WayPoint* poWP );
//ENDANNECY Shaitan Nettoyage }
//----------------------------------------------------------- Refresh Screen
void fn_vRefreshScreen (void);
void fn_vRefreshDisplayControl (void);
//--------------------------------------------------- other functions
void fn_vComputeAbsoluteMatrix (CPA_SuperObject* psoWP);
void fn_vComputeNewRelativeMatrix (HIE_tdxHandleToSuperObject _hSprObj);
void fn_vComputeRelativeMatrix (CPA_SuperObject* poSuperObject, CPA_SuperObject* poParentSuperObject);
//------------------------------------------------------------- Draw
void fn_vDrawAllWP (void);
void fn_vSetRefreshWay ( BOOL bRefreshWay ) { m_bRefreshWay = bRefreshWay; }
//--------------------------------------- Selected objects in lists
CPA_BaseObject* fn_pGetSelectedFamilly (void) { return m_poFamilly; }
CPA_BaseObject* fn_pGetSelectedModel (void) { return m_poModel; }
CPA_BaseObject* fn_pGetSelectedInstance (void) { return m_poActor; }
//ANNECY Shaitan Nettoyage (12/05/98) {
// CPA_BaseObject* fn_pGetSelectedWay (void) { return m_poWay; }
//ENDANNECY Shaitan Nettoyage }
EdtList* fn_pGetSelectedEdtList (void) { return m_poWayList; }
CPA_DialogList* fn_pGetDialogList (void) { return m_p_oDialogList; }
//--------------------------------------- Get new graphical instances
CPA_SuperObject* fn_pGetNewSymbolicalGraphicObject (void);
CPA_SuperObject* fn_pGetNewSphericalGraphicObject (void);
CPA_SuperObject* fn_pGetNewLineGraphicObject (void);
CPA_SuperObject* fn_pGetNewTangentGraphicObject (GEO_tdstColor* pstColor);
CPA_SuperObject* fn_pGetNewPlaneGraphicObject(void);
CPA_SuperObject* fn_pGetNewCursorGraphicObject (void);
// Shaitan Correction {
// CPA_SuperObject* fn_pGetNewConnectionGraphicObject (int iGraph, int iNode, int iArc);
CPA_SuperObject* fn_pCreateConnectionGraphicObject (Graph *pGraph, WayPoint *pSrcWP, WayPoint *pDstWP, long lCapacity, long lWeight);
//End Shaitan Correction }
inline void fn_vRefreshHierarchyList (void);
//---------------------------------------- File Management
//--- waypoint
CString Waypoint_Interface::fn_csGetWaypointSaveFileName (void);
BOOL fn_bIsExistWaypointFile (void) { return m_bExistWaypointSaveFile; }
void fn_vSetExistWaypointFile (BOOL bExistWaypointSaveFile) { m_bExistWaypointSaveFile=bExistWaypointSaveFile; }
BOOL fn_bExistWaypointSaveFile (void);
//--- way
CString Waypoint_Interface::fn_csGetWaySaveFileName (void);
BOOL fn_bIsExistWayFile (void) { return m_bExistWaySaveFile; }
void fn_vSetExistWayFile (BOOL bExistWaySaveFile) { m_bExistWaySaveFile=bExistWaySaveFile; }
BOOL fn_bExistWaySaveFile (void);
//--- important function that convert way in EdtList to Real way to edit
//ANNECY Shaitan Nettoyage (12/05/98) {
// BOOL fn_bComputeRealWay (Way** ppoWay);
//ENDANNECY Shaitan Nettoyage }
//--- return EdtList used by the actor
EdtList* fn_poGetEdtListUseByActor (CPA_BaseObject* poActorInstance);
CPA_BaseObject* fn_pGetActorUsingAList (EdtList* poEdtList);
protected :
void fn_vPick ( ACP_tdxIndex* pxNbPicked, HIE_aDEF_stTabOfPickInfo& ra_stPickInfo, tdstMousePos *p_stPos);
//ANNECY Shaitan Nettoyage (12/05/98) {
// void fn_vAddWayPoint (void);
//ENDANNECY Shaitan Nettoyage }
CPA_SuperObject* fn_pExplorePicking (ACP_tdxIndex xIndex, HIE_tdstPickInfo *p_stObject, long lTypeObject, ACP_tdxIndex* pxFindIndex=NULL );
CPA_SuperObject* fn_pFirstSuperObjectPicked (HIE_tdstPickInfo *p_stObject);
CPA_SuperObject* fn_pFirstSuperObjectPickedInDynamicHierarchy (ACP_tdxIndex xIndex, HIE_tdstPickInfo *p_stObject);
//----------- tools
// extract a reachable object from the list
CPA_BaseObject* fn_pSelectWayPointParam ( CPA_List<CPA_BaseObject> *pParams );
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
CPA_BaseObject* fn_pSelectWayParam ( CPA_List<CPA_BaseObject> *pParams );
CPA_BaseObject* fn_pSelectLinkParam ( CPA_List<CPA_BaseObject> *pParams );
*/
//ENDANNECY Shaitan Nettoyage }
// set the list of Way
void fn_vSetCursor ( UINT i );
void fn_vSetCursor ( LPCTSTR lpszResourceName );
//--------------------------------------------------- Lists management
void fn_vEditWayList ( CPA_List<CPA_BaseObject>* poList );
CPA_SuperObject* fn_pCreateEmptyWay (char* pszName, CPA_BaseObject* poFamilly);
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
void fn_vFillListOfWay (void);
void fn_vGetListOfWaySuperObject ( CPA_List<CPA_BaseObject>* poSuperObjectList );
*/
//ENDANNECY Shaitan Nettoyage }
void fn_vEditListOfWay ( CPA_BaseObject* poObjectList );
void fn_vEditListOfActorModel ( CPA_BaseObject* poFamilly, BOOL bChange=TRUE );
void fn_vEditListOfActorInstance ( CPA_BaseObject* poActorModel, BOOL bChange=TRUE );
void fn_vEditListOfFamilly ( BOOL bChange=TRUE );
CPA_BaseObject* fn_pGetOwnerOfList ( CString csTypeList );
BOOL fn_bIsSuperObjectInStaticHierarchy (CPA_SuperObject* poSuperObject);
void fn_vCreateVirtualWaypoint (void);
void fn_vDeleteVirtualWaypoint (void);
BOOL fn_bIsSubSectionInSection ( CString csFullPath, CString csSearchPath );
void fn_vInitGameMaterial ( Geometry3D* poGeomObject, ACP_tdxHandleOfElement hElement, float fR, float fG, float fB );
// modification of EdtList
void fn_vNotifyAllEdtList ( CPA_tdoNameList* poNameList );
void fn_vCleanHierarchy(void);
// Shaitan Correction {
public:
tdeLinkDisplayMode GetDisplayMode (void) { return m_eDisplayMode; }
void SetDisplayMode (tdeLinkDisplayMode eNewMode);
Graph * GetSelectedGraph (void) { return m_pSelectedGraph; }
WayPoint * GetDisplayedWaypoint (void) { return m_pDisplayedWayPoint; }
void fn_vSelectGraph (Graph *pGraph);
void fn_vSetDisplayedWaypoint (WayPoint *pWaypoint, BOOL bCenter = FALSE);
void fn_vUpdateConnections (void);
void fn_vUpdateEditor (tdeModeChange eMode);
void fn_vSetSymetricMode (BOOL bSymetric) { m_bSymetricMode = bSymetric; }
BOOL fn_bGetSymetricMode (void) { return m_bSymetricMode; }
};
// End Shaitan Correction }
extern tdstDLLIdentity g_stWayPointIdentity;
#endif // __WPINTERF_HPP__

View File

@@ -0,0 +1,64 @@
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : Link2D.hpp
//
// Definition of links defined in a 2D plane
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// inherit from : Link
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 30 jan 1997 Author: J Th<54>noz
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
//
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
*/
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
#ifndef __Link2D_HPP__
#define __Link2D_HPP__
class Link2D : public Link
{
protected :
MTH3D_tdstVector m_stPlaneVertex; // Only use to rotate the plane
MTH3D_tdstVector m_stNormalVertex; // Use to keep the same normal when move
CPA_SuperObject* m_poGraphic; // graphic object of the plane
GLI_tdxValue m_xe; // e of the plane
public:
Link2D ( CPA_ObjectDLLBase *p_oDLL, CPA_BaseObject *p_oOwner, WP_tdhLink hLink );
Link2D ( CPA_ObjectDLLBase *p_oDLL, CPA_BaseObject *p_oOwner );
void fn_vInitPlane (MTH3D_tdstVector* pstVertex) { m_stNormalVertex=*pstVertex; }
void fn_vDrawPlane (void);
void fn_vConstructPlane (void);
void fn_vDestroyPlane (void);
// moves
void fn_vStartMove ( MTH3D_tdstVector* pstStartVertex );
void fn_vMove ( MTH3D_tdstVector* pstTranslation );
void fn_vEndMove (void);
BOOL fn_bIsPlane (void) { return TRUE; }
void fn_vSetPlaneHorizontal (void);
void fn_vSetPlaneVertical (void);
void fn_vProjVertex ( MTH3D_tdstVector* pstVertex );
protected :
// compute the matrix of the plane ( VertexLink1, VertexLink2, pstVertex )
void fn_vComputePlaneAxis (MTH3D_tdstVector* pstVertex=NULL);
};
#endif //__Link2D_HPP__
*/
//ENDANNECY Shaitan Nettoyage }

View File

@@ -0,0 +1,92 @@
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : LinkArc.hpp
//
// Definition of the link editors objects
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// inherit from : Link2D
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 30 jan 1997 Author: J Th<54>noz
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
//
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
*/
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
#ifndef __LinkArc_HPP__
#define __LinkArc_HPP__
//ROMTEAM WorldEditor (Viorel Preoteasa 20/01/98)
#include "ogd.h"
//ENDROMTEAM WorldEditor (Viorel Preoteasa)
class LinkArc : public Link2D
{
protected:
static char ms_cType; // type of link
static char ms_szName [10]; // name of the link
BOOL m_bFirstEdition; // This object was not yet edited
BOOL m_bEditPlane; // Must we draw the edit plane
Cursor* m_poCursor; // cursor object
MTH3D_tdstVector m_stCenterVertex; // Local vertex of translation
//ROMTEAM WorldEditor (Viorel Preoteasa 20/01/98)
// EDWAY_tdhCircleArcObject m_hArcObject; // editor object
Arc3D m_hArcObject; // editor object
//ENDROMTEAM WorldEditor (Viorel Preoteasa)
BOOL m_bInitCenter; // m_stCenterVertex must be reinit
public:
static Link* fn_pConstruct ( CPA_ObjectDLLBase *p_oDLL, CPA_BaseObject *p_oOwner, WP_tdhLink hLink) { if (hLink) return new LinkArc ( p_oDLL, p_oOwner, hLink);
else return new LinkArc ( p_oDLL, p_oOwner ); }
static void fn_vRegisterObject (void); // this function is used to register this object
LinkArc ( CPA_ObjectDLLBase *p_oDLL, CPA_BaseObject *p_oOwner, WP_tdhLink hLink );
LinkArc ( CPA_ObjectDLLBase *p_oDLL, CPA_BaseObject *p_oOwner );
char fn_cGetType (void) { return ms_cType; }
char* fn_pGetName (void) { return ms_szName; }
CDialog* fn_pGetSpecificDialog (CWnd* pParentWnd);
void fn_vFreeSpecificDialog (CDialog* pDialog);
//ROMTEAM WorldEditor (Viorel Preoteasa 20/01/98)
// EDWAY_tdhCircleArcObject fn_hGetEditArcObject (void) { return m_hArcObject; }
Arc3D *fn_hGetEditArcObject (void) { return &m_hArcObject;}
//ENDROMTEAM WorldEditor (Viorel Preoteasa)
void fn_vConstructGraphic (void);
void fn_vRotationGraphic (BOOL bRotation);
void fn_vDrawNormal (void);
void fn_vDrawOutHierarchy (GLD_tdstViewportAttributes *pViewportAttributes);
void fn_vSetWaypoints ( WayPoint* poFirstWP, WayPoint* poSecondWP );
void fn_vGetSaveInfo ( char dszParam [20][20], long& lNbParam );
void fn_vInitGraphic (void);
void fn_vStopEdit (void);
void fn_vStartEdit (void);
// Update data
void fn_vUpdateCenter (void);
protected :
void fn_vSetEngineStructure (void);
void fn_vInitCenter (BOOL bInit);
void fn_vGetAbsoluteCenter (MTH3D_tdstVector* pstCenter);
void fn_vSetAbsoluteCenter (MTH3D_tdstVector* pstCenter);
void fn_vComputeCursorVertex ( MTH3D_tdstVector* pstCursorVertex );
void fn_vInitPlaneOrientation (void);
};
#endif
*/
//ENDANNECY Shaitan Nettoyage }

View File

@@ -0,0 +1,82 @@
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : LinkBez.hpp
//
// Edit the Bezier links
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// inherit from : Link
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 29 jan 1997 Author: J Th<54>noz
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
//
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
*/
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
#ifndef __LinkBez_HPP__
#define __LinkBez_HPP__
//ROMTEAM WorldEditor (Viorel Preoteasa 20/01/98)
#include "ogd.h"
//ENDROMTEAM WorldEditor (Viorel Preoteasa)
class LinkBez : public Link
{
protected:
static char ms_cType; // type of link
static char ms_szName [10]; // name of the link
//ROMTEAM WorldEditor (Viorel Preoteasa 20/01/98)
// EDWAY_tdhBezierObject m_hBezierObject; // editor object
Bezier3D m_hBezierObject; // editor object
//ENDROMTEAM WorldEditor (Viorel Preoteasa)
Tangent* m_pstStartTangent; // Tangent object first point
Tangent* m_pstFinishTangent; // Tangent object second point
BOOL m_bFirstEdition;
public:
static void fn_vRegisterObject (void); // this function is used to register this object
static Link* fn_pConstruct ( CPA_ObjectDLLBase *p_oDLL, CPA_BaseObject *p_oOwner, WP_tdhLink hLink) { if (hLink) return new LinkBez ( p_oDLL, p_oOwner, hLink);
else return new LinkBez ( p_oDLL, p_oOwner ); }
LinkBez ( CPA_ObjectDLLBase *p_oDLL, CPA_BaseObject *p_oOwner, WP_tdhLink hLink );
LinkBez ( CPA_ObjectDLLBase *p_oDLL, CPA_BaseObject *p_oOwner );
char fn_cGetType (void) { return ms_cType; }
char* fn_pGetName (void) { return ms_szName; }
//ROMTEAM WorldEditor (Viorel Preoteasa 20/01/98)
// EDWAY_tdhBezierObject fn_hGetEditBezierObject (void) { return m_hBezierObject; }
Bezier3D *fn_hGetEditBezierObject (void) { return &m_hBezierObject; }
//ENDROMTEAM WorldEditor (Viorel Preoteasa)
void fn_vChangeNeighbourTangent (Tangent* pTangent);
void fn_vSetTangent ( int iSide, MTH3D_tdstVector* pTangentVertex );
void fn_vConstructGraphic (void);
void fn_vInitGraphic (void);
void fn_vRotationGraphic (BOOL bRotation);
void fn_vDrawNormal (void);
void fn_vDrawOutHierarchy (GLD_tdstViewportAttributes *pViewportAttributes);
void fn_vGetSaveInfo ( char dszParam [20][20], long& lNbParam );
void fn_vInitEditorFromEngine (void);
CDialog* fn_pGetSpecificDialog (CWnd* pParentWnd);
void fn_vFreeSpecificDialog (CDialog* pDialog);
protected :
void fn_vSetEngineStructure (void);
};
#endif
*/
//ENDANNECY Shaitan Nettoyage }

View File

@@ -0,0 +1,62 @@
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : LinkLine.hpp
//
// Definition of the link editors objects
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// inherit from : Link
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 29 jan 1997 Author: J Th<54>noz
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
//
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
*/
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
#ifndef __LinkLine_HPP__
#define __LinkLine_HPP__
class LinkLine : public Link
{
protected:
static char ms_cType; // type of link
static char ms_szName [10]; // name of the link
GLI_tdxValue m_xLBeam; // grahpical dim of the link
public:
static void fn_vRegisterObject (void); // this function is used to register this object
static Link* fn_pConstruct ( CPA_ObjectDLLBase* p_oDLL, CPA_BaseObject *p_oOwner, WP_tdhLink hLink) { if (hLink) return new LinkLine ( p_oDLL, p_oOwner, hLink);
else return new LinkLine ( p_oDLL, p_oOwner ); }
LinkLine ( CPA_ObjectDLLBase *p_oDLL, CPA_BaseObject *p_oOwner, WP_tdhLink hLink );
LinkLine ( CPA_ObjectDLLBase *p_oDLL, CPA_BaseObject *p_oOwner );
char fn_cGetType (void) { return ms_cType; }
char* fn_pGetName (void) { return ms_szName; }
void fn_vConstructGraphic (void);
void fn_vRotationGraphic (BOOL bRotation);
void fn_vDrawNormal (void);
void fn_vGetSaveInfo ( char dszParam [20][20], long& lNbParam );
void fn_vSetWaypoints ( WayPoint* poFirstWP, WayPoint* poSecondWP );
protected :
// Line graphic
CPA_SuperObject* fn_vLineGraphic (MTH3D_tdstVector *pstVertex1, MTH3D_tdstVector *pstVertex2, char* szName, tdeLocalColor color = E_lc_NoColor );
void fn_vModifLineGraphic (CPA_SuperObject* psoLine, MTH3D_tdstVector *pstVertex1, MTH3D_tdstVector *pstVertex2 );
};
#endif
*/
//ENDANNECY Shaitan Nettoyage }

View File

@@ -0,0 +1,34 @@
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : LinkMod.cpp
//
// Modification class.
// This class is used to implement the Do/Undo actions.
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// inherit from CPA_Modif
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 21 jan 1997 Author: J Th<54>noz
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
//
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
*/
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
#ifndef __LinkMOD_HPP__
#define __LinkMOD_HPP__
#endif
*/
//ENDANNECY Shaitan Nettoyage }

View File

@@ -0,0 +1,216 @@
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : LinkObj.hpp
//
// Definition of the link editors objects
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// inherit from : CPA_Object
// CPA_EdMot<WP_tdhWayPoint>
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 21 jan 1997 Author: J Th<54>noz
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
//
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
*/
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
#ifndef __LinkOBJECT_HPP__
#define __LinkOBJECT_HPP__
#define C_ucLink 1997
//----------------------------------------------------------------------
// Definition of the name of the models
static char* pszLineModelName = "Line";
static char* pszArcModelName = "Arc";
static char* pszSplineModelName = "Spline";
//----------------------------------------------------------------------
class DiaLink;
class RotationDia;
class Link;
typedef struct tdst_LinkObject_
{
char szName [10];
char cType;
Link* (*fn_pConstruct) ( CPA_ObjectDLLBase* , CPA_BaseObject*, WP_tdhLink );
} tdst_LinkObject;
class WayPoint;
class Way;
class Waypoint_Interface;
class Tangent;
class Link : public CPA_BaseObject, public CPA_EdMot<WP_tdhLink>
{
protected :
static Waypoint_Interface* ms_poInterface; // Interface
static DiaLink* ms_poDiaLink; // Dialog
static RotationDia* ms_poRotationDia; // Rotation Dialog
static CPA_List<tdst_LinkObject> ms_oListLinkObject; // List of the present links
static long ms_lNbLink; // Number of created link
CPA_SuperObject* m_poSuperObject; // super object
Way* m_poParent; // Father of the link
WayPoint* m_poFirstWP; // First WP of the link
WayPoint* m_poSecondWP; // Second WP of the link
Tangent* m_poFirstOrientationTangent; // orientation at first WP location
Tangent* m_poSecondOrientationTangent; // orientation at second WP location
MTH_tdxReal m_xOrientationTangentLenght; // lenght of orientation tangent
BOOL m_bAddInHierarchy; // The link is insert in the hierarchy
BOOL m_bRemoveInHierarchy; // The link has been in the hierarchy, but was retired
BOOL m_bDraw; // The link is ok in the hierachy but must be draw
BOOL m_bCanDrawOutHierarchy;// can we run the fn_vDrawOutHierarchy function ?
BOOL m_bRotationMode; // Link is in rotation edition mode
BOOL m_bFirstEdition;
MTH_tdxReal m_xFirstTwistOrientation; // twist at first WP location
MTH_tdxReal m_xSecondTwistOrientation; // twist at second WP location
BOOL m_bXDirectOrientation; // Ox rotation in trigo way
BOOL m_bYDirectOrientation; // Oy rotation in trigo way
BOOL m_bZDirectOrientation; // twist in trigo way
long m_lNbLapXOrientation; // Number of complete laps in Ox rotation
long m_lNbLapYOrientation; // Number of complete laps in Oy rotation
long m_lNbLapZOrientation; // Number of complete laps in Oz rotation
public:
// static
static void fn_vInitObject (Waypoint_Interface* poInterface);
static SCRIPT_tdeReturnValue CallBackLoad (FILE *p_fFile, char *szAction, char *szParams[], SCRIPT_tdeAction cType);
static void fn_vSetDialog ( DiaLink* poDiaLink, RotationDia* poRotationDia );
static DiaLink* fn_pGetDialog ( void ) { return ms_poDiaLink; }
static RotationDia* fn_pGetRotationDialog (void) { return ms_poRotationDia; }
static Link* fn_pCreateLink ( Way* poWay, char cType, WayPoint* poFirstWP=NULL, WayPoint* poSecondWP=NULL, WP_tdhLink hLink=NULL ); // create a new link with it's associated super object
static Link* fn_pCreateLink ( Way* poWay, WP_tdhLink hLink, WayPoint* poFirstWP, WayPoint* poSecondWP );
static Link* CloneLink ( Way* poWay, Link* poLink, CString& szNewLinkName );
Link ( CPA_ObjectDLLBase *p_oDLL, CPA_BaseObject *p_oOwner, WP_tdhLink hLink );
Link ( CPA_ObjectDLLBase *p_oDLL, CPA_BaseObject *p_oOwner );
void *GetEngineStruct (void) { return GetStruct(); }
//--- data
long GetDataType (void);
void* GetData (void);
// super object
void SetSuperObject ( CPA_SuperObject* poSuperObject) { m_poSuperObject=poSuperObject; }
CPA_SuperObject* GetSuperObject (void) { return m_poSuperObject; }
void fn_vSplitLink ( Way* poWay, WayPoint* poWP, Link** pLinkBefore, Link** pLinkAfter );
Link* fn_pMergeLink ( Way* poWay, Link* pLink );
// save link
void fn_vSave ( SCR_tdst_File_Description *_p_stFile );
// set
void fn_vSetAddInHierarchy ( BOOL bAddInHierarchy ) { m_bAddInHierarchy=bAddInHierarchy; }
void fn_vSetRemoveInHierarchy ( BOOL bRemoveInHierarchy ) { m_bRemoveInHierarchy=bRemoveInHierarchy; }
void fn_vSetDraw ( BOOL bDraw ) { m_bDraw=bDraw; }
void fn_vSetDrawOutHierarchy (BOOL bDraw) { m_bCanDrawOutHierarchy = bDraw; }
void fn_vSetXDirectOrientation ( BOOL bXDirectOrientation );
void fn_vSetYDirectOrientation ( BOOL bYDirectOrientation );
void fn_vSetZDirectOrientation ( BOOL bZDirectOrientation );
void fn_vSetNbLapXOrientation ( long lNbLapXOrientation );
void fn_vSetNbLapYOrientation ( long lNbLapYOrientation );
void fn_vSetNbLapZOrientation ( long lNbLapZOrientation );
void fn_vSetFirstTwistOrientation ( MTH_tdxReal xFirstTwistOrientation );
void fn_vSetSecondTwistOrientation ( MTH_tdxReal xSecondTwistOrientation );
virtual void fn_vSetWaypoints ( WayPoint* poFirstWP, WayPoint* poSecondWP ) { if(poFirstWP) m_poFirstWP=poFirstWP; if (poSecondWP) m_poSecondWP=poSecondWP; }
// get
static CPA_List <tdst_LinkObject>* fn_pGetListObject (void) { return &ms_oListLinkObject; }
BOOL fn_bIsAddInHierarchy ( void ) { return m_bAddInHierarchy; }
BOOL fn_bIsRemoveInHierarchy ( void ) { return m_bRemoveInHierarchy; }
BOOL fn_bIsDraw ( void ) { return m_bDraw; }
BOOL fn_bCanDrawOutHierarchy (void) { return m_bCanDrawOutHierarchy; }
void fn_vGetWaypoints ( WayPoint** poFirstWP, WayPoint** poSecondWP ) { *poFirstWP=m_poFirstWP; *poSecondWP=m_poSecondWP; }
BOOL fn_bIsWaypoint ( WayPoint* poWp ) { return (m_poFirstWP==poWp) || (m_poSecondWP==poWp); }
Way* fn_pGetWay (void) { return m_poParent; }
BOOL fn_bIsRotationMode (void) { return m_bRotationMode; }
BOOL fn_bIsXDirectOrientation (void) { return m_bXDirectOrientation; }
BOOL fn_bIsYDirectOrientation (void) { return m_bYDirectOrientation; }
BOOL fn_bIsZDirectOrientation (void) { return m_bZDirectOrientation; }
long fn_lGetNbLapXOrientation (void) { return m_lNbLapXOrientation; }
long fn_lGetNbLapYOrientation (void) { return m_lNbLapYOrientation; }
long fn_lGetNbLapZOrientation (void) { return m_lNbLapZOrientation; }
MTH_tdxReal fn_xGetFirstTwistOrientation (void) { return m_xFirstTwistOrientation; }
MTH_tdxReal fn_xGetSecondTwistOrientation (void) { return m_xSecondTwistOrientation; }
//---- Object dependant functions
virtual char fn_cGetType ( void )=0;
virtual char* fn_pGetName ( void )=0;
// draw
virtual void fn_vConstructGraphic (void); // construct the graphic son's
virtual void fn_vInitGraphic (void); // init the graphic son after it has been put into the hierarchy
virtual void fn_vRotationGraphic (BOOL bRotation); // Set/Unset rotation mode
virtual void fn_vDrawNormal (void) {} // refresh the draw when in normal mode
virtual void fn_vDrawRotation (void) {} // refresh the draw when in rotation mode
virtual void fn_vInitEditorFromEngine (void) {} // init editor data when engine exist
virtual void fn_vGetSaveInfo ( char dszParam [20][20], long& lNbParam )=0; // ask for saving data
virtual void fn_vDrawOutHierarchy (GLD_tdstViewportAttributes *pViewportAttributes) {} // This function is call to draw out of the hierarchy
virtual void fn_vStartEdit (void) { }; // this link is selected
virtual void fn_vStopEdit (void) { }; // this link is no longer selected
virtual void fn_vChangeNeighbourTangent (Tangent* pTangent);
virtual void fn_vChangeAllTangent (Tangent* pTangent);
// A tangent son of this link change
void fn_vDraw (void); // refreh the draw according to the mode
// dialog
virtual CDialog* fn_pGetSpecificDialog (CWnd* pParentWnd) { return NULL; } // return a pointer on a specific dialog son of pParentWnd
virtual void fn_vFreeSpecificDialog (CDialog* pDialog) {}
virtual BOOL fn_bIsPlane (void) { return FALSE; }
Waypoint_Interface* GetInterface (void);
void fn_vWayNotifySave (void);
void fn_vEdit (void);
void fn_vSelectWay (void);
void fn_vSetAllOrientationTangent ( MTH3D_tdstVector* pTangentVertex );
void fn_vReinitOrientationTangent (Tangent* poTangent);
protected :
void fn_vRefreshEngineOrientation (void);
void fn_vComputeAxis (void); // Modify local axis
void fn_vSetType ( WP_tde_ucConnectionType cType );
void fn_vSetOrientationTangent ( int iSide, MTH3D_tdstVector* pTangentVertex );
void fn_vVertex2Rotation (MTH_tdxReal* pxXRot, MTH_tdxReal* pxYRot, MTH_tdxReal* pxZRot, MTH3D_tdstVector* pstVector, MTH_tdxReal* pxRot );
void fn_vRotation2Vertex ( MTH3D_tdstVector* pstVector, MTH_tdxReal* pxRot, MTH_tdxReal* pxXRot, MTH_tdxReal* pxYRot, MTH_tdxReal* pxZRot );
void fn_vComputeModulusRotation ( MTH_tdxReal* xStartRot, MTH_tdxReal* xEndRot, BOOL bDirectOrientation, long lNbLapOrientation );
void fn_vExtractModulusRotation ( BOOL* bDirectOrientation, long* lNbLapOrientation, MTH_tdxReal& xStartRot, MTH_tdxReal& xEndRot );
private:
void fn_vCorrectNulValue ( MTH3D_tdstVector* pstVector );
inline BOOL fn_bIsRealNul ( MTH_tdxReal& rReal );
};
#endif //__LinkOBJECT_HPP__
*/
//ENDANNECY Shaitan Nettoyage }

View File

@@ -0,0 +1,76 @@
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : ArcDia.hpp
//
// Dialog edition the arcs
//
///////////////////////////////////////////////////////////////////////////////////////////////////
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 6 feb 1997 Author: J Th<54>noz
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
//
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
*/
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
#ifndef __ArcDia_HPP__
#define __ArcDia_HPP__
/////////////////////////////////////////////////////////////////////////////
// BezierDia dialog
class LinkArc;
class Waypoint_Interface;
class ArcDia : public CDialog
{
protected:
LinkArc* m_pLinkArc;
// Construction
public:
ArcDia (LinkArc* pLinkBez, CWnd* pParent = NULL); // standard constructor
void fn_vTutRegister (void);
void fn_vTutUnregister (void);
// Dialog Data
//{{AFX_DATA(BezierDia)
enum { IDD = IDD_ARC_DIALOG };
int m_iSamplingRate;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(BezierDia)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
BOOL OnCommand(WPARAM wParam, LPARAM lParam);
// Generated message map functions
//{{AFX_MSG(ArcDia)
afx_msg void OnKillfocusArcEdit();
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#endif
*/
//ENDANNECY Shaitan Nettoyage }

View File

@@ -0,0 +1,76 @@
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : LinkDia.hpp
//
// Dialog edition the ways
//
///////////////////////////////////////////////////////////////////////////////////////////////////
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 21 jan 1997 Author: J Th<54>noz
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
//
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
*/
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
#ifndef __BezDia_HPP__
#define __BezDia_HPP__
/////////////////////////////////////////////////////////////////////////////
// BezierDia dialog
class LinkBez;
class BezierDia : public CDialog
{
protected:
LinkBez* m_pLinkBez;
// Construction
public:
BezierDia (LinkBez* pLinkBez, CWnd* pParent = NULL); // standard constructor
void fn_vTutRegister (void);
void fn_vTutUnregister (void);
// Dialog Data
//{{AFX_DATA(BezierDia)
enum { IDD = IDD_BEZIER_DIALOG };
int m_iSamplingRate;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(BezierDia)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
BOOL OnCommand(WPARAM wParam, LPARAM lParam);
// Generated message map functions
//{{AFX_MSG(BezierDia)
afx_msg void OnKillfocusBezierEdit();
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#endif
*/
//ENDANNECY Shaitan Nettoyage }

View File

@@ -0,0 +1,179 @@
//ROMTEAM Networks (Gabriela Dumitrascu 15/03/98)
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : NtwMod.hpp
//
// Modification classes
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// inherit from CPA_Modif
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 98-03-15 Author: CPA2 Gabriela Dumitrascu
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
///////////////////////////////////////////////////////////////////////////////////////////////////
*/
#ifndef __NTWMOD_HPP__
#define __NTWMOD_HPP__
#include "NtwObj.hpp"
#define GRAPH_INSERT_GRAPH 0
#define GRAPH_DELETE_GRAPH 1
#define GRAPH_INSERT_NODE 2
#define GRAPH_DELETE_NODE 3
#define GRAPH_INSERT_ARC 4
#define GRAPH_DELETE_ARC 5
#define GRAPH_RENAME_GRAPH 6
class ModifGraph : public CPA_Modif
{
protected:
Graph *m_poGraph;
WP_tdHandleOfGraph m_hOldGraph, m_hNewGraph;
public :
ModifGraph(Graph *poGraph, unsigned short type);
void ModifSave();
BOOL Do (void);
BOOL Undo (void);
};
// Shaitan Correction {
//===========================================================================
class DeleteGraph : public CPA_Modif
{
private:
// editor parameters
Graph *m_pGraph;
// flags
BOOL m_bDeleted;
BOOL m_bFirstTime;
public:
DeleteGraph (Graph *pGraph);
~DeleteGraph (void);
BOOL Do (void);
BOOL Undo (void);
};
//===========================================================================
class RenameGraph : public CPA_Modif
{
private:
// editor parameters
Graph *m_pGraph;
CString m_csOldName;
CString m_csNewName;
// flags
BOOL m_bFirstTime;
public:
RenameGraph (Graph *pGraph, CString csNewName);
~RenameGraph (void);
BOOL Do (void);
BOOL Undo (void);
};
//===========================================================================
class InsertNode : public CPA_Modif
{
private:
// editor parameters
Graph *m_pGraph;
WayPoint *m_pNode;
// flags
BOOL m_bInserted;
BOOL m_bFirstTime;
public:
InsertNode (Graph *pGraph, WayPoint *pNode, BOOL pBlock);
~InsertNode (void);
BOOL Do (void);
BOOL Undo (void);
};
//===========================================================================
class DeleteNode : public CPA_Modif
{
private:
// editor parameters
Graph *m_pGraph;
WayPoint *m_pNode;
// connections
CPA_List<CPA_SuperObject> m_lstConnections;
// flags
BOOL m_bDeleted;
BOOL m_bFirstTime;
public:
DeleteNode (Graph *pGraph, WayPoint *pNode, BOOL pBlock);
~DeleteNode (void);
BOOL Do (void);
BOOL Undo (void);
};
//===========================================================================
class InsertConnection : public CPA_Modif
{
private:
// editor parameters
Graph *m_pGraph;
WayPoint *m_pSrcWaypoint;
WayPoint *m_pDstWaypoint;
CPA_SuperObject *m_pArrow;
// engine parameters
WP_tdhGraphNode m_hSrcNode;
WP_tdhGraphNode m_hDstNode;
// flags
BOOL m_bInserted;
BOOL m_bUpdate;
BOOL m_bFirstTime;
public:
InsertConnection (Graph *pGraph, WayPoint *pSrcWaypoint, WayPoint *pDstWaypoint, BOOL bUpdate, BOOL pBlock);
~InsertConnection (void);
BOOL Do (void);
BOOL Undo (void);
};
//===========================================================================
class DeleteConnection : public CPA_Modif
{
private:
// editor parameters
Graph *m_pGraph;
WayPoint *m_pSrcWaypoint;
WayPoint *m_pDstWaypoint;
CPA_SuperObject *m_pArrow;
// engine parameters
WP_tdhGraphNode m_hSrcNode;
WP_tdhGraphNode m_hDstNode;
// flags
BOOL m_bDeleted;
BOOL m_bFirstTime;
public:
DeleteConnection (Graph *pGraph, WayPoint *pSrcWaypoint, WayPoint *pDstWaypoint, BOOL pBlock);
~DeleteConnection (void);
BOOL Do (void);
BOOL Undo (void);
};
//End Shaitan Correction }
#endif
//ENDROMTEAM Networks (Gabriela Dumitrascu)

View File

@@ -0,0 +1,199 @@
//ROMTEAM Networks (Gabriela Dumitrascu 25/02/98)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : NtwObj.hpp
//
// Definition of the graph editors objects
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// inherit from : CPA_Object
// CPA_EdMot<ACP_tdxHandleOfLink>
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 1998-03-02 Author: CPA2 Gabi Dumitrascu
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
///////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef __NTWOBJ_HPP__
#define __NTWOBJ_HPP__
#define _WP_D_WPARC_FREIND_
#include "Wparc.h"
#include "ogd.h"
class NtwDia;
class Waypoint_Interface;
class Graph : public CPA_SaveObject, public CPA_EdMot<WP_tdHandleOfGraph>
{
//protected:
public:
static NtwDia* ms_poNtwDia;
static Waypoint_Interface* ms_poInterface;
static BOOL ms_bNotifyHeader;
// Shaitan Correction {
CPA_List<CPA_SuperObject> ms_oListOfArrows; // list of all arrows of the graph
//End Shaitan Correction }
CPA_SuperObject* m_poSuperObject; // super object
BOOL m_bSave;
public:
static CPA_List<Graph> ms_oListOfGraph; //// list of all the graph
//--- static
static void fn_vInitObject (Waypoint_Interface* poInterface);
static Waypoint_Interface* GetInterface (void) { return ms_poInterface; }
static void fn_vCallbackSave ( SCR_tdst_File_Description *_p_stFile, char *_p_szSectionName, void *_p_vData,SCR_tde_Ntfy_Action _eAction );
static void fn_vCallbackEmptySectionWPGraph( SCR_tdst_File_Description *p_stFile, char *_p_szSectionName, void *_p_vData,SCR_tde_Ntfy_Action _eAction );
static void fn_vCallbackEmptySectionWPSommet( SCR_tdst_File_Description *p_stFile, char *_p_szSectionName, void *_p_vData,SCR_tde_Ntfy_Action _eAction );
static void fn_vSetDialog ( NtwDia* poNtwDia );
static void fn_vSetNotifyHeader (BOOL bNotifyHeader) { ms_bNotifyHeader = bNotifyHeader; }
static void fn_vRefreshGraph (void);
static Graph* fn_pGetGraph(WP_tdhWayPoint hWP);
static NtwDia* fn_pGetDialog ( void ) { return ms_poNtwDia; }
static CPA_List<Graph>* fn_poGetListOfGraph (void) { return &ms_oListOfGraph; }
static WayPoint* GetWaypoint(WP_tdhWayPoint hWP);
Graph( CPA_ObjectDLLBase *p_oDLL, CString csName = "1", BOOL bSave = TRUE );
Graph ( CPA_ObjectDLLBase *p_oDLL, WP_tdHandleOfGraph hEngineGraph, CString csName, CString csFileName, CString csSectionName );
Graph( Graph& rGraph );
~Graph();
Graph& operator= (Graph& rGraph);
//--- data
long GetDataType (void);
void* GetData (void) {return GetStruct();}
// Unicity
tdeMissingCriteria fn_eCheckUnicity (const CString csNewName);
//--- save
void fn_vNotifySave (void);
void fn_vNotifyUnSave (void);
void fn_vNotifyRestore (void);
void fn_vNotifyRename (void);
void fn_vUpdateReference (CPA_SaveObject *pReferencedObject);
//---set
void SetSuperObject ( CPA_SuperObject* poSuperObject) { m_poSuperObject=poSuperObject; }
void fn_vSetSave (BOOL bSave) { m_bSave=bSave; }
//----get
CPA_SuperObject* GetSuperObject (void) {return m_poSuperObject;}
WP_tdHandleOfGraph GetEngineStruct() {return (WP_tdHandleOfGraph)GetStruct();}
// Shaitan Correction {
void fn_vAddNode(WP_tdhWayPoint hWP, BOOL pBlock);
BOOL fn_bRemoveNode(int iNode, BOOL pBlock);
void fn_vAddNode(WayPoint *pWP, BOOL pBlock);
BOOL fn_bRemoveNode(WayPoint *pWP, BOOL pBlock);
//End Shaitan Correction }
BOOL fn_bHasNode(WP_tdhWayPoint hWP) {return fn_iGetNodeOfWayPoint(hWP) != -1;}
BOOL fn_bHasNode(WayPoint *pWP) {return fn_bHasNode((WP_tdhWayPoint)pWP->GetEngineStruct());}
int fn_iGetNumberOfNodes() {return WPG_fn_lNumberOfWaypointOfGraph(GetEngineStruct());}
WP_tdhGraphNode fn_hGetNode(int iNode);
WP_tdhWayPoint fn_hGetWayPointOfNode(int iNode);
int fn_iGetNodeOfWayPoint(WP_tdhWayPoint hWP);
int fn_iGetNumberOfArcs(WP_tdhGraphNode hNode);
WP_tdHandleOfArc fn_hGetArc(WP_tdhGraphNode hNode, int iArc);
int fn_iGetArcOfNode(WP_tdhGraphNode hNode, WP_tdhGraphNode hArcNode);
BOOL fn_bNodeHasArc(WP_tdhGraphNode hNode, WP_tdhGraphNode hArcNode) {return fn_iGetArcOfNode(hNode, hArcNode) != -1;}
// Shaitan Correction {
void fn_vAddArcToNode(WP_tdhGraphNode hNode, WP_tdhGraphNode hArcNode, BOOL pBlock);
void fn_vAddArcToNode(WayPoint *pSrcNode, WayPoint *pDstNode, BOOL bUpdate, BOOL pBlock);
void fn_vRemoveArcOfNode(WP_tdhGraphNode hNode, int iArc, BOOL pBlock);
void fn_vRemoveArcOfNode(WayPoint *pSrcNode, WayPoint *pDstNode, BOOL pBlock);
//End Shaitan Correction }
void fn_vSetDefaultArcWeight(WP_tdhGraphNode hNode, int iArc);
void fn_vSetDefaultAllArcsWeight();
// Shaitan NewParam {
long fn_lGetDefaultArcWeight(WayPoint* pSrcNode, WayPoint* pDstNode);
void fn_vSetAllArcsCapacity(long lCapacity);
//End Shaitan NewParam }
// Shaitan Correction {
void fn_vInitGraphicConnections (void);
void fn_vUpdateConnection (CPA_SuperObject *pConnection, BOOL bUpdate);
void fn_vDisplayConnection (CPA_SuperObject *pConnection, BOOL bUpdate);
void fn_vDisplayAllLinks (BOOL bDisplay, BOOL bUpdate);
void fn_vDisplayOutLinks (WayPoint* pSrcNode, BOOL bUpdate);
void fn_vDisplayInLinks (WayPoint* pDstNode, BOOL bUpdate);
void fn_vUpdateConnections (WayPoint *pMovedWP, BOOL bUpdate);
void fn_vAddGraphicConnection (CPA_SuperObject *pConnection);
void fn_vRemoveGraphicConnection (CPA_SuperObject *pConnection);
CPA_SuperObject * GetGraphicConnection (WayPoint* pSrcNode, WayPoint* pDstNode);
void GetConnectionsToWaypoint (WayPoint *pNode, int iType, CPA_List<CPA_SuperObject> *pListToFill);
void SetConnectionCapacity (WayPoint *pSrcNode, WayPoint *pDstNode, long lCapacity);
void SetConnectionWeight (WayPoint *pSrcNode, WayPoint *pDstNode, long lWeight);
long GetConnectionCapacity (WayPoint *pSrcNode, WayPoint *pDstNode);
long GetConnectionWeight (WayPoint *pSrcNode, WayPoint *pDstNode);
// Shaitan NewParam {
void SetNodeType (WayPoint *pSrcNode, long lType);
long GetNodeType (WayPoint *pSrcNode);
WayPoint * GetPrevNode (WayPoint *pSrcNode);
WayPoint * GetNextNode (WayPoint *pSrcNode);
WayPoint * GetPrevConnection (WayPoint *pSrcNode, WayPoint *pDstNode);
WayPoint * GetNextConnection (WayPoint *pSrcNode, WayPoint *pDstNode);
//End Shaitan NewParam }
void fn_vShowWaypoints (BOOL bShow);
//End Shaitan Correction }
};
class Connection : public Arrow3D
{
// Shaitan Correction {
/*
public:
int m_iGraph, m_iNode, m_iArc;
// construct
Connection(CPA_EditorBase *p_oEditor, int iGraph, int iNode, int iArc);
*/
private:
Graph *m_pGraph;
WayPoint *m_pSrcWP;
WayPoint *m_pDstWP;
long m_lCapacity;
long m_lWeight;
public:
Graph * GetGraph (void) { return m_pGraph; }
WayPoint * GetSrcWayPoint (void) { return m_pSrcWP; }
WayPoint * GetDstWayPoint (void) { return m_pDstWP; }
long GetCapacity (void) { return m_lCapacity; }
long GetWeight (void) { return m_lWeight; }
void SetCapacity (long lCapacity) { m_lCapacity = lCapacity; }
void SetWeight (long lWeight) { m_lWeight = lWeight; }
Connection(CPA_EditorBase *p_oEditor, Graph *pGraph, WayPoint *pSrcWP, WayPoint *pDstWP, long m_lCapacity, long m_lWeight);
//End Shaitan Correction }
};
#endif //__NTWOBJ_HPP__
//ENDROMTEAM Networks (Gabriela Dumitrascu)

View File

@@ -0,0 +1,18 @@
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#ifndef __STDAAFX_H__
#define __STDAAFX_H__
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows 95 Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
#endif //__STDAAFX_H__

View File

@@ -0,0 +1,153 @@
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : TanObj.hpp
//
// Definition of the tangent objects
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// inherit from : CPA_Object
// CPA_EdMot<ACP_tdxHandleOfLink>
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 29 jan 1997 Author: J Th<54>noz
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
//
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
*/
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
#ifndef __TanagentOBJECT_HPP__
#define __TanagentOBJECT_HPP__
class Waypoint_Interface;
class Link;
typedef enum _eTangentLenghtMode
{
eVariableLenghtTangent, // lenght of tangent is edited
eFixLenghtTangent // lenght of tangent is constant
}
eTangentLenghtMode;
typedef enum _eTangentOrientationMode
{
eVariableOrientationTangent, // lenght of tangent is edited
eFixOrientationTangent // lenght of tangent is constant
}
eTangentOrientationMode;
typedef enum _eTangentChangeNeighbourMode // change the neighbour tangent only
{
eNeverChangeNeighbour,
eAlwaysChangeNeighbour,
eShiftDownChangeNeighbour,
eControlDownChangeNeighbour,
eShiftUpChangeNeighbour,
eControlUpChangeNeighbour
}
eTangentNeighbourMode;
typedef enum _eTangentChangeAllMode // change all the tangents
{
eNeverChangeAll,
eAlwaysChangeAll,
eShiftDownChangeAll,
eControlDownChangeAll,
eShiftUpChangeAll,
eControlUpChangeAll
}
eTangentChangeAllMode;
class Tangent : public CPA_BaseObject
{
protected:
static Waypoint_Interface* ms_poInterface; // interface
static long ms_lNbTangent; // object counter
CPA_SuperObject* m_poSuperObject;
Link* m_poParent; // Father Link onject
MTH3D_tdstVector m_stFixVertex; // in the axis of the father object
MTH3D_tdstVector m_stTangentVector; // in the absolute axis
GLI_tdxValue m_xDim;
MTH3D_tdstVector m_stMoveVertex; // extrem vertex of the tangant
// -> is only used when tangent moves
GLI_tdxValue m_xMoveRatio; // dif between pick point and movevertex
GEO_tdstColor m_stColor; // color of the graphic tangent
eTangentLenghtMode m_eTangentLenghtMode; // lenght edition mode
eTangentOrientationMode m_eTangentOrientationMode; // orientation edition mode
eTangentNeighbourMode m_eTangentNeighbourMode; // change neighbour mode
eTangentChangeAllMode m_eTangentChangeAllMode; // change all mode
BOOL m_bOrientationAllow; // allow orientation of tangent
BOOL m_bNotifyWay; // notify the owner way
public:
// static
static void fn_vInitObject (Waypoint_Interface* poInterface);
static Waypoint_Interface* GetInterface (void);
Tangent
(
CPA_ObjectDLLBase *p_oDLL,
CPA_BaseObject *p_oOwner,
eTangentLenghtMode eLenghtMode=eVariableLenghtTangent,
eTangentOrientationMode eOrientationMode=eFixOrientationTangent,
eTangentNeighbourMode eNeighbourMode = eNeverChangeNeighbour,
eTangentChangeAllMode eChangeAllMode = eNeverChangeAll,
GEO_tdstColor* pstColor=NULL
);
void *GetEngineStruct (void) { return NULL; }
// data
long GetDataType (void);
void* GetData (void);
// set
void fn_vSetAbsoluteVertex ( MTH3D_tdstVector* pstFixAbsoluteVertex, MTH3D_tdstVector* pstTangentVe );
void fn_vSetTangent ( MTH3D_tdstVector* pstMoveAbsoluteVertex );
void fn_vSetTangentDirection ( MTH3D_tdstVector* pstAbsoluteDirectionVertex, BOOL bOppositeDirection=FALSE );
void fn_vSetColor ( GEO_tdstColor* pstColor );
void fn_vSetDim ( GLI_tdxValue xDim ) { m_xDim = xDim; }
// get
Link* fn_pGetParent (void) { return m_poParent; }
// super object
void SetSuperObject ( CPA_SuperObject* poSuperObject) { m_poSuperObject=poSuperObject; }
CPA_SuperObject* GetSuperObject (void) { return m_poSuperObject; }
// move
void fn_pGetAbsoluteTangent (MTH3D_tdstVector* pstTangent);
// draw
void fn_vConstructGraphic (void); // construct the graphic son's
void fn_vDraw (void); // refreh the draw according to the object
// moves
void fn_vStartMove ( MTH3D_tdstVector* pstStartVertex, BOOL bShift, BOOL bControl );
void fn_vMove ( MTH3D_tdstVector* pstTranslation, BOOL bShift, BOOL bControl );
void fn_vEndMove (void);
void fn_vChangeAllTangent (void); // change all the tangent of the way
protected :
void fn_vChangeNeighbourTangent (BOOL bShift, BOOL BControl);
void fn_vChangeAllTangent (BOOL bShift, BOOL BControl);
};
#endif //__TanagentOBJECT_HPP__
*/
//ENDANNECY Shaitan Nettoyage }

View File

@@ -0,0 +1,92 @@
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : WPDia.hpp
//
// Dialog edition the waypoints
//
///////////////////////////////////////////////////////////////////////////////////////////////////
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 21 jan 1997 Author: J Th<54>noz
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
//
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
*/
// DiaWP.hpp : header file
//
#ifndef DIAWP_HPP
#define DIAWP_HPP
/////////////////////////////////////////////////////////////////////////////
// DiaWP dialog
class DiaWP : public CFormView
{
protected:
WayPoint* m_poWP;
BOOL m_bEditRadius;
// Construction
public:
DiaWP(CWnd* pParent = NULL); // standard constructor
DECLARE_DYNCREATE ( DiaWP );
void fn_vInitDialog ( void ); // jack's function to init the dialog
void fn_vEdit (WayPoint* poWP);
WayPoint* fn_pGetEditWP (void) { return m_poWP; }
BOOL fn_bIsEditWP (WayPoint* poWP) { return m_poWP==poWP; }
void fn_vRefreshDialog (void);
void fn_vRefreshCoordinate(void);
void fn_vEditName (void);
// Dialog Data
//{{AFX_DATA(DiaWP)
enum { IDD = IDD_WAYPOINT_DIALOG };
CEdit m_EditWP;
float m_fRadius;
BOOL m_bStaticCoord;
BOOL m_bGlobalCheck;
CString m_csWaypointName;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(DiaWP)
public:
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
void OnDestroy();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
BOOL OnCommand(WPARAM wParam, LPARAM lParam);
// Generated message map functions
//{{AFX_MSG(DiaWP)
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnKillfocusWaypointEdit();
afx_msg void OnWaypointCoordCheck();
afx_msg void OnChangeWaypointEdit();
afx_msg void OnRealwpRadio();
afx_msg void OnSymbolicalwpRadio();
afx_msg void OnGlobaldrawCheck();
afx_msg void OnKillfocusWaypointNameEdit();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
void fn_vDrawWP (void);
};
#endif

View File

@@ -0,0 +1,54 @@
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : WPMod.hpp
//
// Modification classes
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// inherit from CPA_Modif
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 21 jan 1997 Author: J Th<54>noz
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
//
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
*/
#ifndef __WPMOD_HPP__
#define __WPMOD_HPP__
#define TYPE_RADIUS_WP 3
#define TYPE_COORDINATE_WP 4
class ModifWayPointRadius : public CPA_Modif
{
protected:
WayPoint* m_poWP;
GLI_tdxValue m_xOldRadius;
GLI_tdxValue m_xNewRadius;
BOOL m_bFirstTime;
public :
ModifWayPointRadius (WayPoint* poWP, GLI_tdxValue* pxR, BOOL pBlock=0);
BOOL Do (void);
BOOL Undo (void);
};
class ModifWayPointCoordinate : public CPA_Modif
{
protected:
WayPoint* m_poWP;
BOOL m_bFirstTime;
public :
ModifWayPointCoordinate (WayPoint* poWP, BOOL pBlock=0);
BOOL Do (void);
BOOL Undo (void);
protected :
inline void fn_vChangeSystemCoordinate (void);
};
#endif

View File

@@ -0,0 +1,168 @@
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : WPObj.hpp
//
// Definition of the waypoint editors objects
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// inherit from : CPA_Object
// CPA_EdMot<ACP_tdxHandleOfLink>
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 21 jan 1997 Author: J Th<54>noz
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
//
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
*/
#ifndef __WPOBJECT_HPP__
#define __WPOBJECT_HPP__
//----------------------------------------------------------------------
// Definition of the name of the models
static CString csStaticModelName = "Static";
static CString csDynamicModelName = "Dynamic";
static CString csWaypointModelName = "Waypoint";
//----------------------------------------------------------------------
class DiaWP;
//class Way;
class Waypoint_Interface;
class WayPoint : public CPA_SaveObject, public CPA_EdMot<WP_tdhWayPoint>
{
protected:
static DiaWP* ms_poDiaWP;
static BOOL ms_bRealDraw;
static BOOL ms_bGlobalDraw;
static BOOL ms_bNotifyHeader;
static Waypoint_Interface* ms_poInterface;
static BOOL ms_bOnScreen;
static BOOL ms_bDrawJustIsolateWaypoint;
//ROMTEAM Networks (Gabriela Dumitrascu 02/03/98)
// static CPA_List<WayPoint> ms_oListOfWaypoint; // list of all the ways
//ENDROMTEAM Networks (Gabriela Dumitrascu)
CPA_SuperObject* m_poSuperObject;
BOOL m_bAbsoluteCoordinate;
CPA_SuperObject* m_poFather;
BOOL m_bCurrentDraw;
BOOL m_bRealDraw;
BOOL m_bAlone; // this waypoint is created alone ( not in a way )
BOOL m_bSave; // this waypoint can be save
BOOL m_bOnScreen;
CPA_SuperObject* m_pSymbolicalGraphic;
CPA_SuperObject* m_pRealGraphic;
CPA_SuperObject * m_poDynamicFather;
public:
//ROMTEAM Networks (Gabriela Dumitrascu 02/03/98)
static CPA_List<WayPoint> ms_oListOfWaypoint; // list of all the ways
//ENDROMTEAM Networks (Gabriela Dumitrascu)
//--- static
static void fn_vInitObject (Waypoint_Interface* poInterface);
static void fn_vCallbackHeader ( SCR_tdst_File_Description *p_stFile, char *_p_szSectionName, void *_p_vData,SCR_tde_Ntfy_Action _eAction );
static void fn_vCallbackSave ( SCR_tdst_File_Description *_p_stFile, char *_p_szSectionName, void *_p_vData,SCR_tde_Ntfy_Action _eAction );
static void fn_vCallbackEmptySectionWaypointIsolate ( SCR_tdst_File_Description *p_stFile, char *_p_szSectionName, void *_p_vData,SCR_tde_Ntfy_Action _eAction );
static void fn_vCallbackEmptySectionWaypointInWay ( SCR_tdst_File_Description *p_stFile, char *_p_szSectionName, void *_p_vData,SCR_tde_Ntfy_Action _eAction );
static void fn_vSetDialog ( DiaWP* poDiaWP );
static DiaWP* fn_pGetDialog ( void ) { return ms_poDiaWP; }
static BOOL fn_bIsWaypointScreen (void) { return ms_bOnScreen; }
static void fn_vSetWaypointOnScreen (BOOL bOnScreen) { ms_bOnScreen=bOnScreen; }
static BOOL fn_bDrawJustIsolateWaypoint ( void ) { return ms_bDrawJustIsolateWaypoint; }
static void fn_vSetDrawJustIsolateWaypoint ( BOOL bDrawJustIsolateWaypoint ) { ms_bDrawJustIsolateWaypoint=bDrawJustIsolateWaypoint;}
static void fn_vSetNotifyHeader (BOOL bNotifyHeader) { ms_bNotifyHeader = bNotifyHeader; }
static void fn_vRefreshWaypoint (void);
static BOOL fn_bCheckWaypointCoherence (CPA_List<WayPoint> *poWaypointList=NULL);
WayPoint( CPA_ObjectDLLBase *p_oDLL, BOOL bAlone=TRUE, CString csName="Waypoint1", BOOL bSave=TRUE );
WayPoint ( CPA_ObjectDLLBase *p_oDLL, WP_tdhWayPoint hEngineWP, CString csName, CString csFileName, CString csSectionName );
WayPoint( WayPoint& rWayPoint );
~WayPoint();
WayPoint& operator= (WayPoint& rWP);
//--- data
long GetDataType (void);
void* GetData (void);
//--- save
void fn_vUpDateSectorSection (void);
void fn_vNotifySave (void);
void fn_vNotifyUnSave (void);
void fn_vNotifyRestore (void);
void fn_vNotifyRename (void);
void fn_vUpdateReference (CPA_SaveObject *pReferencedObject);
void *GetEngineStruct() { return GetStruct(); };
void fn_vSetRadius (GLI_tdxValue* pxR);
void fn_vSetCoordinate (BOOL bAbsolute);
void fn_vSetFather (CPA_SuperObject* poFather);
void fn_vChangeSystemCoordinate (void);
GLI_tdxValue fn_xGetRadius (void);
BOOL fn_bIsAlone (void) { return m_bAlone; }
void fn_vSetAlone ( BOOL bAlone ) { m_bAlone=bAlone; }
void fn_vSetSave ( BOOL bSave ) { m_bSave=bSave; }
void fn_vSetSymbolicalGraphic ( CPA_SuperObject* poSymbolicalGraphic ) { m_pSymbolicalGraphic=poSymbolicalGraphic; }
void fn_vSetRealGraphic ( CPA_SuperObject* poRealGraphic ) { m_pRealGraphic=poRealGraphic; }
// Shaitan Correction {
CPA_SuperObject * GetSymbolicalGraphic (void) { return m_pSymbolicalGraphic; }
CPA_SuperObject * GetRealGraphic (void) { return m_pRealGraphic; }
//End Shaitan Correction }
BOOL fn_bGetCoordinate (void) { return m_bAbsoluteCoordinate; }
CPA_SuperObject* fn_pGetFather (void);
void fn_vSetOnScreen ( BOOL bOnScreen ) { m_bOnScreen = bOnScreen; }
BOOL fn_bGetOnScreen (void) { return m_bOnScreen; }
void SetSuperObject ( CPA_SuperObject* poSuperObject) { m_poSuperObject=poSuperObject; }
CPA_SuperObject* GetSuperObject (void) { return m_poSuperObject; }
CPA_SuperObject* fn_pGetDynamicFather (void);
void fn_vSetDynamicFather (CPA_SuperObject* poDynamicFather);
static Waypoint_Interface* GetInterface (void) { return ms_poInterface; }
//------------------------------- compute motor object
void fn_vComputeMotorStructure (void);
//------------------------------- Drawing mode
// draw
void fn_vDraw (BOOL bScreen=TRUE, BOOL bDestroy=TRUE); // draw the wp
void fn_vDrawNewRadius (void); // modify the draw of the radius if necessary
// local drawing
BOOL fn_bIsRealDraw (void) { return m_bRealDraw; }
void fn_vSetRealDraw (BOOL bDrawMode) { m_bRealDraw=bDrawMode; }
// global variables of drawing
// mode of global drawing
static BOOL fn_bIsGlobalRealDraw (void) { return ms_bRealDraw; }
static void fn_vSetGlobalRealDraw (BOOL bGlobalDrawMode) { ms_bRealDraw=bGlobalDrawMode; }
// global draw activate
static BOOL fn_bIsGlobalDraw (void) { return ms_bGlobalDraw; }
static void fn_vSetGlobalDraw (BOOL bGlobalDraw) { ms_bGlobalDraw=bGlobalDraw; }
// general functions
// solve local/global directions
BOOL fn_bIsGeneralRealDraw (void) { return ms_bGlobalDraw ? ms_bRealDraw : m_bRealDraw; }
void fn_vSetGeneralRealDraw (BOOL bDrawMode) { if (ms_bGlobalDraw) fn_vSetGlobalRealDraw (bDrawMode); else fn_vSetRealDraw(bDrawMode); }
BOOL fn_bIsWaypointDrawable (void);
//-------------------------------- Coherence management
BOOL fn_bCheckCoherence (void);
BOOL fn_bIsReferencedInAI (void);
};
extern CPA_List<WayPoint> g_ListWayPoint;
#endif //__OBJECT_HPP__

View File

@@ -0,0 +1,105 @@
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : WayMod.hpp
//
// Modification classes
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// inherit from CPA_Modif
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 21 jan 1997 Author: J Th<54>noz
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
//
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
*/
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
#ifndef __WayMOD_HPP__
#define __WayMOD_HPP__
#define TYPE_INSERT_WP 1
#define TYPE_DELETE_WP 2
#define TYPE_REMOVE_WP 3
#define TYPE_ADD_NEW_WP 4
// insert a WP at any position in the way
class ModifWayInsert : public CPA_Modif
{
protected:
Way* m_pWay;
WayPoint* m_pInsertWP;
WP_tduc_WPIndex m_stBeforeWP;
BOOL m_DialogRefresh;
Link* m_pOldLink;
Link* m_pLinkBefore;
Link* m_pLinkAfter;
public :
ModifWayInsert (Way* pWay, WayPoint* m_pInsertWP, WP_tduc_WPIndex stBeforeWP, BOOL bDialog1stRefresh=TRUE,BOOL pBlock=0);
BOOL Do (void);
BOOL Undo (void);
};
// delete a way point in the net at a given position
class ModifWayDelete : public CPA_Modif
{
protected:
Way* m_pWay;
WayPoint* m_pDeleteWP;
WP_tduc_WPIndex m_stDeletePosWP;
Link* m_pLink;
Link* m_pOldLinkBefore;
Link* m_pOldLinkAfter;
BOOL m_DialogRefresh;
public :
ModifWayDelete (Way* pWay, WP_tduc_WPIndex lPosDeleteWP, BOOL pBlock=0);
BOOL Do (void);
BOOL Undo (void);
};
// delete all the waypoints in a way
class ModifWayRemove : public CPA_Modif
{
protected:
Way* m_pWay;
WayPoint* m_pRemoveWP;
long m_lNbRemoveWP;
WP_tduc_WPIndex* m_dstRemovePosWP;
Link** m_dpoRemoveLinkBefore;
Link** m_dpoRemoveLinkAfter;
public :
ModifWayRemove (Way* pWay, WayPoint* pDeleteWP, BOOL pBlock=0);
BOOL Do (void);
BOOL Undo (void);
};
// Add a new WP in a way
class ModifWayAddWP : public CPA_Modif
{
protected :
Way* m_poWay; // net where the WP wil be add
CPA_SuperObject* m_poSuperWP; // new super object WP
MTH3D_tdstVector* m_pAbsolutePosition; // location of the WP in absolute system
CPA_Interface* m_pEditor; // ref to the editor to be use
ModifWayInsert* m_pModifInsertWP; // insert modif object
WP_tduc_WPIndex m_stPosBeforeWP; // pos to insert
public :
ModifWayAddWP ( Way* poWay, MTH3D_tdstVector* pAbsolutePosition, WP_tduc_WPIndex lBeforeWP, CPA_Interface* pEditor, BOOL pBlock=FALSE);
BOOL Do (void);
BOOL Undo (void);
};
#endif
*/
//ENDANNECY Shaitan Nettoyage }

View File

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

View File

@@ -0,0 +1,91 @@
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : EditDia.hpp
//
// Dialog edition the waypoints
//
///////////////////////////////////////////////////////////////////////////////////////////////////
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 10 mar 1997 Author: J Th<54>noz
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
//
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
*/
#ifndef EDITWP_HPP
#define EDITWP_HPP
class Waypoint_Interface;
class EditDia : public CFormView
{
protected:
Waypoint_Interface* m_poInterface;
protected:
EditDia(void); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(EditDia);
// Form Data
public:
//{{AFX_DATA(EditDia)
enum { IDD = IDD_EDIT_DIALOG };
CTabCtrl m_oTab;
//}}AFX_DATA
// Operations
public:
void fn_vInit (void);
void fn_vSetInterface ( Waypoint_Interface* );
void fn_vRefresh (void);
protected:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(EditDia)
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext);
virtual void OnDestroy();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Generated message map functions
//{{AFX_MSG(EditDia)
afx_msg void OnEditWaypointOnRadio();
afx_msg void OnEditWaypointOffRadio();
afx_msg void OnEditWaypointAllRadio();
afx_msg void OnEditWaypointIsolateRadio();
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
afx_msg void OnSelchangeEditTab(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnEditWayOffRadio();
afx_msg void OnEditWayOnRadio();
afx_msg void OnEditWaySelectedRadio();
*/
//ENDANNECY Shaitan Nettoyage }
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
long fn_lGetId (long lWayDisplay);
void fn_vSetDisplay ( long lDisplayState );
void fn_vSetFlags ( int iIndex, long lDisplayState );
*/
//ENDANNECY Shaitan Nettoyage }
};
#endif
/////////////////////////////////////////////////////////////////////////////

View File

@@ -0,0 +1,56 @@
//ROMTEAM Networks (Gabriela Dumitrascu 25/02/98)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : IsoWpDia.hpp
//
// Definition of the waypoint
///////////////////////////////////////////////////////////////////////////////////////////////////
// inherit from : CDialog
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 1998-02-23 Author: CPA2 Gabriela Dumitrascu
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
///////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// IsoWPDia dialog
class IsoWPDia : public CDialog
{
public:
CPA_List<WayPoint> m_oListOfWP;
CPA_List<WayPoint> m_oListOfSelWP;
// Construction
public:
IsoWPDia(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(IsoWPDia)
enum { IDD = IDD_ISOLATE_WP };
CListBox m_IsoWpList;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(IsoWPDia)
public:
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(IsoWPDia)
virtual void OnOK();
virtual BOOL OnInitDialog();
afx_msg void OnDestroy();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//ENDROMTEAM Networks (Gabriela Dumitrascu)

View File

@@ -0,0 +1,101 @@
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : LinkDia.hpp
//
// Dialog edition the ways
//
///////////////////////////////////////////////////////////////////////////////////////////////////
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 21 jan 1997 Author: J Th<54>noz
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
//
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
*/
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
#ifndef __LinkDia_HPP__
#define __LinkDia_HPP__
/////////////////////////////////////////////////////////////////////////////
// DiaLink form view
class Link;
class DiaLink : public CFormView
{
protected:
DiaLink(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(DiaLink);
Link* m_poLink;
CDialog* m_pSpecificDialog;
//{{AFX_DATA(DiaLink)
enum { IDD = IDD_LINK_DIALOG };
CString m_szLinkName;
CString m_oSpeedMode;
float m_fSpeed1;
float m_fSpeed2;
float m_fSpeed3;
//}}AFX_DATA
// Attributes
public:
// Operations
public:
virtual void fn_vInitDialog (void);
virtual void fn_vEdit (Link* poLink);
BOOL fn_bIsEditLink (Link* poLink) { return m_poLink==poLink; }
CString& fn_rGetTypeLink (void) { return m_szLinkName; }
void fn_vChangeDialog (void);
void fn_vSetDynParam (void);
void fn_vDrawDynParamDialog (void);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(DiaLink)
public:
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
void OnDestroy();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~DiaLink();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
//{{AFX_MSG(DiaLink)
afx_msg void OnSelchangeLinkCombo();
afx_msg void OnSelchangeLinkSpeedCombo();
afx_msg void OnKillfocusLinkSpeed1Edit();
afx_msg void OnKillfocusLinkSpeed2Edit();
afx_msg void OnKillfocusLinkSpeed3Edit();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
#endif
*/
//ENDANNECY Shaitan Nettoyage }

View File

@@ -0,0 +1,260 @@
//ROMTEAM Networks (Gabriela Dumitrascu 25/02/98)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : ntwdia.hpp
//
// header file
///////////////////////////////////////////////////////////////////////////////////////////////////
// inherit from : CFormView
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 1998-02-25 Author: CPA2 Gabriela Dumitrascu
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
///////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef NTWDIA_HPP
#define NTWDIA_HPP
class NtwDia : public CFormView
{
public:
NtwDia(CWnd* pParent = NULL); // standard constructor
DECLARE_DYNCREATE(NtwDia)
void fn_vInitDialog ( void ); // function to init the dialog
// Form Data
public:
//{{AFX_DATA(NtwDia)
enum { IDD = IDD_GRAPH_DIALOG };
CListBox m_ConnectList;
CComboBox m_WPList;
CComboBox m_GraphNameList;
CString m_EditGraph;
CButton m_Symetric;
// Shaitan NewParam {
// long m_lWeight;
//End Shaitan NewParam }
CString m_EditWP;
//}}AFX_DATA
// Attributes
public:
// Shaitan Correction {
// enum {statusReady, statusNextWP, statusPreviousWP} m_status;
// WP_tdHandleOfArc m_hSelArc;
// CPA_List<CPA_SuperObject> ms_oListOfArrows; // list of all the arrow
// End Shaitan Correction }
// Operations
public:
void fn_vRefreshDialog();
// Shaitan Correction {
//void fn_vRefreshGraphList(int iGraph = 0, int iNode = 0, int iArc = 0);
//void fn_vRefreshWPList(int iGraph, int iNode = 0, int iArc = 0);
//void fn_vRefreshConnectList(int iGraph, int iNode, int iArc = 0);
// BOOL fn_bSetCrtWaypoint(WayPoint* poWayPoint);
// BOOL fn_bSetCrtConnection(class Connection* poConnection);
// BOOL fn_bAddOrDeleteWaypoint(WayPoint* poWayPoint);
// CPA_SuperObject* fn_pCreateConnection(int iGraph, int iNode, int iArc);
// void fn_vDestroyAllArrows();
// void fn_vShowOutLinks ();
// void fn_vShowInLinks ();
// void fn_vShowAllLinks ();
// void fn_vCancelDisplayLinks();
// void fn_vDefineNextWP();
// void fn_vDefinePreviousWP();
// void fn_vDeleteConnection(class Connection* pConnection);
// void fn_vMove ( MTH3D_tdstVector* pstTranslation = NULL);
// void fn_vShowAllWP();
// void fn_vDeleteWP();
// End Shaitan Correction }
// Shaitan Correction {
int GetIndexOfGraph (Graph *pGraph);
int GetIndexOfNode (WayPoint *pNode);
int GetIndexOfConnection (WayPoint *pDstNode);
void fn_vSelectGraph (Graph *pGraph);
void fn_vSelectNode (Graph *pGraph, WayPoint *pNode);
void fn_vSelectConnection (Graph *pGraph, WayPoint *pSrcWaypoint, WayPoint *pDstWaypoint);
void fn_vRefreshGraphList (Graph *pGraph);
void fn_vRefreshNodeList (Graph *pGraph, WayPoint *pNode);
void fn_vRefreshConnectList (Graph *pGraph, WayPoint *pSrcWaypoint, WayPoint *pDstWaypoint);
//End Shaitan Correction }
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(NtwDia)
public:
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(NtwDia)
afx_msg void OnDestroy();
afx_msg void OnSelchangeGraphName();
afx_msg void OnSelchangeNtwWp();
// Shaitan Correction {
afx_msg void OnDblClkNtwWp();
afx_msg void OnChangeGraphName();
//End Shaitan Correction }
afx_msg void OnSelchangeConnectList();
afx_msg void OnGraphInsert();
afx_msg void OnGraphDelete();
afx_msg void OnConnectDelete();
afx_msg void OnConnectInsert();
afx_msg void OnWpInsert();
afx_msg void OnWpDelete();
// Shaitan NewParam {
afx_msg void OnEditNode();
afx_msg void OnEditConnect();
// afx_msg void OnDefaultWeight();
afx_msg void OnDefaultAllWeights();
afx_msg void OnEditAllConnects();
// afx_msg void OnChangeWeight();
// afx_msg void OnCapacity();
//End Shaitan NewParam }
afx_msg void OnDefault();
// Shaitan Correction {
afx_msg void OnSize(UINT, int, int);
//End Shaitan Correction }
afx_msg void OnSymetric();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
// Shaitan Correction {
private:
int m_iSelectedGraph;
int m_iSelectedNode;
int m_iSelectedConnection;
BOOL m_bInitialised;
//End Shaitan Correction }
};
/////////////////////////////////////////////////////////////////////////////
// Shaitan Correction {
class NtwCreationDialog : public CDialog
{
private:
NtwDia *m_pParentDialog;
Graph *m_pEditedGraph;
// Construction
public:
NtwCreationDialog(CString csDefaultName, NtwDia *pParentDialog, Graph *pGraph, CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(EdActors_ActorNameChangeDialog)
enum { IDD = IDD_CREATION_DIALOG };
CString m_csNewName;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(EdActors_ActorNameChangeDialog)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(EdActors_ActorNameChangeDialog)
virtual void OnOK();
afx_msg void OnDestroy();
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//End Shaitan Correction }
// Shaitan NewParam {
class NtwParameterDialog : public CDialog
{
private:
NtwDia *m_pParentDialog;
Graph *m_pEditedGraph;
WayPoint *m_pSrcNode;
WayPoint *m_pDstNode;
BOOL m_bEditConnection;
BOOL m_bAll;
BOOL m_bSymetric;
// Construction
public:
NtwParameterDialog(NtwDia *pParentDialog, Graph *pGraph, WayPoint *pSrcNode, WayPoint *pDstNode = NULL, BOOL bAll = FALSE, CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(EdActors_ActorNameChangeDialog)
enum { IDD = IDD_GRAPH_PARAMETERS };
CEdit m_cEditWeight;
CStatic m_cStaticWeight;
CButton m_cDefaultWeight;
CStatic m_cStaticType;
CButton m_cNextOK;
CButton m_cPrevOK;
CButton m_cNextCancel;
CButton m_cPrevCancel;
CButton m_cNextWPOK;
CButton m_cPrevWPOK;
CButton m_cNextWPCancel;
CButton m_cPrevWPCancel;
CStatic m_cStaticNode;
CStatic m_cStaticLink;
CButton m_cSymetric;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(EdActors_ActorNameChangeDialog)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
void fn_vInitParameters (void);
void fn_vApplyModifications (void);
void fn_vUpdateButtons (void);
// Generated message map functions
//{{AFX_MSG(EdActors_ActorNameChangeDialog)
virtual void OnOK();
afx_msg void OnPrevOK();
afx_msg void OnNextOK();
afx_msg void OnPrevCancel();
afx_msg void OnNextCancel();
afx_msg void OnPrevWPOK();
afx_msg void OnNextWPOK();
afx_msg void OnPrevWPCancel();
afx_msg void OnNextWPCancel();
afx_msg void OnDefaultWeight();
afx_msg void OnDestroy();
afx_msg void OnSymetric();
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//End Shaitan NewParam }
#endif
//ENDROMTEAM Networks (Gabriela Dumitrascu)

View File

@@ -0,0 +1,106 @@
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
#if !defined(AFX_ROTDIA_HPP__E2A06241_1F76_11D1_95C8_0060973153D4__INCLUDED_)
#define AFX_ROTDIA_HPP__E2A06241_1F76_11D1_95C8_0060973153D4__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// rotdia.hpp : header file
//
/////////////////////////////////////////////////////////////////////////////
// RotationDia form view
#ifndef __AFXEXT_H__
#include <afxext.h>
#endif
class Link;
class RotationDia : public CFormView
{
protected:
Link* m_poLink;
BOOL m_bFocusTwist1;
BOOL m_bFocusTwist2;
BOOL m_bFocusTwistLap;
BOOL m_bFocusXLap;
BOOL m_bFocusYLap;
RotationDia(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(RotationDia)
// Form Data
public:
void fn_vInitDialog ( void ); // jack's function to init the dialog
void fn_vEdit (Link* poLink);
BOOL fn_bIsEditLink (Link* poLink) { return m_poLink==poLink; }
//{{AFX_DATA(RotationDia)
enum { IDD = IDD_ORIENTATION_DIALOG };
float m_fTwist1;
float m_fTwist2;
long m_lTwistLap;
long m_lxLap;
long m_lyLap;
//}}AFX_DATA
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(RotationDia)
public:
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~RotationDia();
void fn_vActivateWindow (BOOL bActivate);
// Generated message map functions
//{{AFX_MSG(RotationDia)
afx_msg void OnKillfocusOrientLapTwistEdit();
afx_msg void OnKillfocusOrientLapXEdit();
afx_msg void OnKillfocusOrientLapYEdit();
afx_msg void OnOrientTwistDirectRadio();
afx_msg void OnOrientTwistIndirectRadio();
afx_msg void OnOrientXDirectRadio();
afx_msg void OnOrientXIndirectRadio();
afx_msg void OnOrientYDirectRadio();
afx_msg void OnOrientYIndirectRadio();
afx_msg void OnKillfocusTwist1Edit();
afx_msg void OnKillfocusTwist2Edit();
afx_msg void OnSetfocusOrientLapTwistEdit();
afx_msg void OnSetfocusOrientLapXEdit();
afx_msg void OnSetfocusOrientLapYEdit();
afx_msg void OnSetfocusTwist1Edit();
afx_msg void OnSetfocusTwist2Edit();
afx_msg void OnDestroy();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_ROTDIA_HPP__E2A06241_1F76_11D1_95C8_0060973153D4__INCLUDED_)
*/
//ENDANNECY Shaitan Nettoyage }

View File

@@ -0,0 +1,2 @@
Waypoint V3.4.4

View File

@@ -0,0 +1,101 @@
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : WayDia.hpp
//
// Dialog edition the ways
//
///////////////////////////////////////////////////////////////////////////////////////////////////
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 21 jan 1997 Author: J Th<54>noz
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
//
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
*/
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
#ifndef __WayDia_HPP__
#define __WayDia_HPP__
/////////////////////////////////////////////////////////////////////////////
// DiaWay dialog
class DiaWay : public CFormView
{
protected :
Way* m_pWayObj;
int m_iSelect;
BOOL m_bInsert;
BOOL m_bDisableDelete;
// Construction
public:
DiaWay(CWnd* pParent = NULL); // standard constructor
DECLARE_DYNCREATE (DiaWay);
void fn_vInitDialog (void);
void fn_vRefreshDialog (int iSelect=0);
void fn_vRefreshLinkBox (void);
void fn_vRefreshNameList (void);
BOOL fn_vSelectWPInList (WayPoint* poWP);
BOOL fn_vSelectWPInList (int iIndiceWP);
void fn_vEdit (Way* poWay,int iSelect=0);
Way* fn_pGetEditWay (void) { return m_pWayObj; }
BOOL fn_bIsEdit (Way* poWay);
void fn_vMessageBoxDynamicWP ( WayPoint* p_oWP );
// Dialog Data
//{{AFX_DATA(DiaWay)
enum { IDD = IDD_WAY_DIALOG };
CEdit m_oEditWayPointButton;
CComboBox m_ListNameWP ;
CString m_EditWay;
CString m_csWayName;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(DiaWay)
public:
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
virtual void OnDestroy ();
//}}AFX_VIRTUAL
protected :
BOOL fn_bValidEntry (void);
void fn_vEditName (void);
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
//{{AFX_MSG(DiaWay)
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnDeleteWayButton();
afx_msg void OnAddWayButton();
afx_msg void OnSelchangeWayCombo();
afx_msg void OnEditupdateWayCombo();
afx_msg void OnClose();
afx_msg void OnKillfocusWayNameEdit();
afx_msg void OnDblclkWayCombo();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
BOOL fn_bSameNameSuit (void);
};
#endif
*/
//ENDANNECY Shaitan Nettoyage }

View File

@@ -0,0 +1,421 @@
/*
------------------------------------------------------------------------------------------
HEADER FILE FOR WP:
WayPoint.h
Creation Date : January,1997
Author : Jacques (Annecy)
------------------------------------------------------------------------------------------
Modifications :
January 16,1997 Alb Many modification in all file to conform it with 3DOS
------------------------------------------------------------------------------------------
This file defines structures and functions used to manage waypoint and way
in the engine
------------------------------------------------------------------------------------------
Remark :
if _WAY_FirstLinkIsFirstWaypoint_ is defined, it is assumed that there is as much links as
waypoints, first link describing how to go to the first waypoint, and so on
if it is not defined, it is assumed that there is one more waypoint than links. First link
describing how to go from the first WP to the second, and so on.
------------------------------------------------------------------------------------------
*/
/*
Invalidate one of the two following lines :
*/
//#define _WAY_FirstLinkIsFirstWaypoint_
#undef _WAY_FirstLinkIsFirstWaypoint_
#if !defined(__WAYPOINT_TYPES__)
#define __WAYPOINT_TYPES__
#if !defined(ONLY_TYPES)
#define WAYPOINT_UNDEF
#define ONLY_TYPES
#endif /* !ONLY_TYPES */
/*
------------------------------------------------------------------------------------------
INCLUDE FILES :
------------------------------------------------------------------------------------------
*/
/*
Avoiding :
error C2501: 'Do_not_use_extern_in_c_files' : missing decl-specifiers
*/
#ifdef extern
#undef extern
#endif
#include "ACP_Base.h"
#include "Hie.h"
#include "mth.h"
#include "Macros.h"
#include "dynamic.h"
#include "Bezier.h"
#include "Circlway.h"
#if defined(WAYPOINT_UNDEF)
#undef ONLY_TYPES
#undef WAYPOINT_UNDEF
#endif /* !WAYPOINT_UNDEF */
/*
------------------------------------------------------------------------------------------
TYPE DEFINITION :
If enumerate :
M_BeginDeclareEnumerate(<type>)
M_EndDeclareEnumerate(<type>, <basic type>)
------------------------------------------------------------------------------------------
*/
/*
Structure defining WayPoint in the Game Engine :
*/
typedef struct tdst_WayPoint_
{
/* vertex defining the position of the waypoint */
MTH3D_tdstVector m_stVertex;
/* radius of the WP :*/
MTH_tdxReal m_xRadius;
/* Handle on the superobject owner of the WP (if NULL, WP = static) */
HIE_tdxHandleToSuperObject m_hSuperObject;
/* following field is used to determine when the object should be free */
unsigned char m_ucUsedCount;
} tdst_WayPoint;
/* defining the handle type :*/
typedef tdst_WayPoint* ACP_tdxHandleOfWaypoint;
/* following type defines the type of the connection */
M_BeginDeclareEnumerate(ACP_tde_ucConnectionType_)
ACP_ConnType_ucStaticLine,
ACP_ConnType_ucDynamicLine,
ACP_ConnType_ucBezier,
ACP_ConnType_ucCircle,
ACP_ConnType_ucInvalid,
ACP_ConnType_ucNbrOfElement = ACP_ConnType_ucInvalid,
M_EndDeclareEnumerate(ACP_tde_ucConnectionType,unsigned char)
/* The following enum describes the dynamic type of a connection :*/
M_BeginDeclareEnumerate(ACP_tde_ucConnectionDynamicType_)
ACP_ConDynType_ucNone,
ACP_ConDynType_ucConstant,
ACP_ConDynType_ucLinear,
ACP_ConDynType_ucSinus,
ACP_ConDynType_ucInvalid,
ACP_ConDynType_ucNbrOfElement = ACP_ConDynType_ucInvalid
M_EndDeclareEnumerate(ACP_tde_ucConnectionDynamicType,unsigned char)
/* defining a sampling rate type :*/
typedef unsigned char tduc_SamplingRate;
/*
Structure defining a Link in the Game Engine :
*/
typedef struct tdst_Link_
{
/* Information depending on the type of the link :*/
union
{
void *m_pvBuffer;/* to access the buffer without caring about the type */
MTH3D_tdstVector *m_pstStaticVector;/* to access to the buffer for StaticLine type */
tdstBezierObject *m_pstBezierObject;/* to access to the buffer for BezierObect type */
//JT modify
tdstCircleArcObject *m_pstCircleArcObject;/* to access to the buffer for ArcObject type */
};
/* Information depending on the dynamic type of the link :*/
ACP_tdstDynaParam m_stConnDynTypeInfo;
/* Defines the type of the link(linear,sinesuoidale,spline...) :*/
ACP_tde_ucConnectionType m_eucConnectionType;
/* defines the dynamic type (none, linear,sinus...)*/
ACP_tde_ucConnectionDynamicType m_eucConnectionDynamicType;
/* Current sample index :*/
unsigned char m_ucCurrentSample;
/* following member is used to determine when to erase the link :*/
unsigned char m_ucUsedCount;
} tdst_Link;
/* defining the handle type :*/
typedef tdst_Link* ACP_tdxHandleOfLink;
/*
typedef for the index :
*/
typedef unsigned char tducWPIndex;
/*
This structure defines the type of the waypoint :
*/
typedef struct tdst_Way_
{
/* this field contains the speed the way is traveled through */
/* MTH_tdxReal m_tdxSpeed; No more used since it is in the link, no?*/
/* a dynamic array on handles on wp :*/
ACP_tdxHandleOfWaypoint *m_d_hWayPoint;
/* a dynamic array on handles on link :*/
ACP_tdxHandleOfLink *m_d_hLink;
/* The following member contains the size of the arrays */
tducWPIndex m_ucSizeWay;
/* contains an index on the array for the current wp :*/
tducWPIndex m_ucCurrentWPIndex;
/* following member is used to determine when to erase the way :*/
unsigned char m_ucUsedCount;
} tdst_Way;
/* defining the handle type :*/
typedef tdst_Way* ACP_tdxHandleOfWay;
// index : used in AI for Way in model
typedef unsigned char tduc_WayIndex;
#endif /* !__WAYPOINT_TYPES__ */
#if !defined(ONLY_TYPES)
#if !defined(__WAYPOINT_VARS__)
#define __WAYPOINT_VARS__
#undef EXTERN
#undef extern
#if !defined(WP_GLOBALS)
#define EXTERN extern
#else /* !GLOBALS */
#define EXTERN
#endif /* !GLOBALS */
/*
------------------------------------------------------------------------------------------
VARIABLE DECLARATION :
<type> <variable name>
#if defined(GLOBALS)
= <initial values>
#endif
;
------------------------------------------------------------------------------------------
*/
/*
------------------------------------------------------------------------------------------
MACROS-CONSTANT DECLARATION:
------------------------------------------------------------------------------------------
*/
/* define script section name :*/
#define C_SectionWayPointDescription "WayPoint"
#define C_SectionWayDescription "Way"
/* invalid handles :*/
#define ACP_C_InvalidWayPointHandle ((ACP_tdxHandleOfWaypoint)NULL)
#define ACP_C_InvalidWayHandle ((ACP_tdxHandleOfWay)NULL)
#define ACP_C_InvalidLinkHandle ((ACP_tdxHandleOfLink)NULL)
#undef extern
#endif /* !__WAYPOINT_VARS__ */
#if !defined (__WAYPOINT_PROTOS__)
#define __WAYPOINT_PROTOS__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/*
------------------------------------------------------------------------------------------
MACROS-FUNCTIONS DECLARATION:
------------------------------------------------------------------------------------------
*/
/* accessing to members of the structures :*/
#define M_xGetWPRadius(_hWP)\
(((ACP_tdxHandleOfWaypoint)(_hWP))->m_xRadius)
#define M_hGetSuperObject(hWP)\
(((ACP_tdxHandleOfWaypoint)(hWP))->m_hSuperObject)
#define M_stGetVertex(hWP)\
(((ACP_tdxHandleOfWaypoint)(hWP))->m_stVertex)
// ANNECY AV {
//#define M_ucGetWPUsedCount(hWP)\
(((ACP_tdxHandleOfWaypoint)(hWP))->m_ucUsedCount)
// END ANNECY AV }
#define M_eucGetLinkConnectionType(_hLink)\
(((ACP_tdxHandleOfLink)(_hLink))->m_eucConnectionType)
#define M_pvGetLinkConnTypeInfo(_hLink)\
(((ACP_tdxHandleOfLink)(_hLink))->m_pvBuffer)
#define M_stGetLinkConnTypeStaticVector(_hLink)\
(((ACP_tdxHandleOfLink)(_hLink))->m_pstStaticVector)
#define M_stGetLinkConnTypeBezierObject(_hLink)\
(((ACP_tdxHandleOfLink)(_hLink))->m_pstBezierObject)
#define M_eucGetLinkConnectionDynType(_hLink)\
(((ACP_tdxHandleOfLink)(_hLink))->m_eucConnectionDynamicType)
#define M_stGetLinkConnDynTypeInfo(_hLink)\
(((ACP_tdxHandleOfLink)(_hLink))->m_stConnDynTypeInfo)
#define M_ucGetLinkCurrentSample(_hLink)\
(((ACP_tdxHandleOfLink)(_hLink))->m_ucCurrentSample)
// ANNECY AV {
//#define M_ucGetLinkUsedCount(_hLink)\
(((ACP_tdxHandleOfLink)(_hLink))->m_ucUsedCount)
// END ANNECY AV }
#define M_dhGetWayWPHandleArray(_hWay)\
(((ACP_tdxHandleOfWay)(_hWay))->m_d_hWayPoint)
#define M_dhGetWayLinkHandleArray(_hWay)\
(((ACP_tdxHandleOfWay)(_hWay))->m_d_hLink)
#define M_ucGetWaySizeWay(_hWay)\
(((ACP_tdxHandleOfWay)(_hWay))->m_ucSizeWay)
#define M_ucGetWayCurrentWPIndex(_hWay)\
(((ACP_tdxHandleOfWay)(_hWay))->m_ucCurrentWPIndex)
// ANNECY AV {
//#define M_ucGetWayCurrentUsedCount(_hWay)\
(((ACP_tdxHandleOfWay)(_hWay))->m_ucUsedCount)
// END ANNECY AV }
#define M_hGetWPAtPositionWay(_hWay,_ucIndex)\
(M_dhGetWayWPHandleArray(_hWay)[(_ucIndex)])
#define M_hGetLinkAtPositionWay(_hWay,_ucIndex)\
(M_dhGetWayLinkHandleArray(_hWay)[(_ucIndex)])
#define M_hGetWayCurrentWP(_hWay)\
M_hGetWPAtPositionWay((_hWay),M_ucGetWayCurrentWPIndex(_hWay))
#define M_ucWayNbrOfWP(_hWay)\
M_ucGetWaySizeWay(_hWay)
#ifdef _WAY_FirstLinkIsFirstWaypoint_
#define M_hGetWayCurrentLink(_hWay)\
M_hGetLinkAtPositionWay((_hWay),M_ucGetWayCurrentWPIndex(_hWay))
#define M_ucWayNbrOfLink(_hWay)\
M_ucGetWaySizeWay(_hWay)
#else /*_WAY_FirstLinkIsFirstWaypoint_*/
#define M_hGetWayCurrentLink(_hWay)\
M_hGetLinkAtPositionWay((_hWay),(unsigned char)(M_ucGetWayCurrentWPIndex(_hWay)-1))
#define M_ucWayNbrOfLink(_hWay)\
((unsigned char)(M_ucGetWaySizeWay(_hWay)-1))
#endif /*_WAY_FirstLinkIsFirstWaypoint_*/
#define M_bWayIsLastWayPoint(_hWay,_ucPos)\
(M_ucGetWaySizeWay(_hWay) == ((_ucPos)+1))
#define M_bWayIsFirstWayPoint(_hWay)\
(M_ucGetWayCurrentWPIndex(_hWay)==0)
#define M_bIsValidDynTypeLink(_eucConnDynType)\
(((_eucConnDynType)>=ACP_ConDynType_ucNone)&&((_eucConnDynType)<ACP_ConDynType_ucInvalid))
/*
------------------------------------------------------------------------------------------
FUNCTIONS DECLARATION:
------------------------------------------------------------------------------------------
*/
//------------------------------------ Waypoints
ACP_tdxHandleOfWaypoint fn_hConstructWaypoint(void);
void fn_vDestroyWaypoint (ACP_tdxHandleOfWaypoint /*_hWP*/);
ACP_tdxHandleOfWaypoint fn_hDuplicateWaypoint (ACP_tdxHandleOfWaypoint /*_hWP*/);
void fn_vCopyWaypoint (ACP_tdxHandleOfWaypoint /*_hDestWP*/, ACP_tdxHandleOfWaypoint /*_hSrcWP*/);
void fn_vInvalidateWaypoint(ACP_tdxHandleOfWaypoint* /*_hWP*/);
ACP_tdxBool fn_bIsWaypointValid (ACP_tdxHandleOfWaypoint /*_hWP*/);
ACP_tdxHandleOfWaypoint fn_hAddRefWaypoint(ACP_tdxHandleOfWaypoint /*_hWP*/);
ACP_tdxHandleOfWaypoint fn_hReleaseWaypoint(ACP_tdxHandleOfWaypoint /*_hWP*/);
// set
void fn_vSetRadiusWaypoint (ACP_tdxHandleOfWaypoint /*_hWP*/, MTH_tdxReal /*_xRadius*/);
void fn_vSetVertexWaypoint (ACP_tdxHandleOfWaypoint /*_hWP*/, MTH3D_tdstVector* /*_stVertex*/);
void fn_vSetSuperObjetWaypoint (ACP_tdxHandleOfWaypoint /*_hWP*/, HIE_tdxHandleToSuperObject /*_hSuperObject*/);
// get
void fn_vGetRadiusWaypoint (ACP_tdxHandleOfWaypoint /*_hWP*/, MTH_tdxReal* /*_pstRadius*/);
void fn_vGetVertexWaypoint (ACP_tdxHandleOfWaypoint /*_hWP*/, MTH3D_tdstVector* /*_pstVertex*/);
HIE_tdxHandleToSuperObject fn_pGetSuperObjetWaypoint (ACP_tdxHandleOfWaypoint /*_hWP*/);
// load
SCRIPT_tdeReturnValue fn_eScriptCallBackLoadWaypoint(FILE * /*p_fFile*/, char * /*szAction*/, char ** /*szParams[]*/, SCRIPT_tdeAction /*cType*/);
ACP_tdxHandleOfWaypoint fn_hGetHWPLoaded(char * /*_szFileName*/, char* /*_p_szWPName*/);
// tools
void fn_vComputeLocationWaypoint ( ACP_tdxHandleOfWaypoint /*_hWP*/, MTH3D_tdstVector* /*_pstVertex*/);
//----------------------------------- Link
ACP_tdxHandleOfLink fn_hConstructLink (void);
void fn_vDestroyLink (ACP_tdxHandleOfLink /*_hLink*/);
//JT modify -> .c change
ACP_tdxHandleOfLink fn_hDuplicateLink (ACP_tdxHandleOfLink /*_hLink*/);
//JT modify -> new function
void fn_vCopyLink (ACP_tdxHandleOfLink /*_hDestLink*/, ACP_tdxHandleOfLink /*_hSrcLink*/);
void fn_vInvalidateLink (ACP_tdxHandleOfLink* /*_hLink*/);
ACP_tdxBool fn_bIsLinkValid (ACP_tdxHandleOfLink /*_hLink*/);
ACP_tdxHandleOfLink fn_hAddRefLink(ACP_tdxHandleOfLink /*_hWP*/);
ACP_tdxHandleOfLink fn_hReleaseLink(ACP_tdxHandleOfLink /*_hWP*/);
void fn_vAllocLink (ACP_tdxHandleOfLink /*_hLink*/,ACP_tde_ucConnectionType /*_eucConnType*/,ACP_tde_ucConnectionDynamicType /*_eucConnDynType*/);
void fn_vFreeLink (ACP_tdxHandleOfLink);
ACP_tde_ucConnectionType fn_eucGetConTypeLink(ACP_tdxHandleOfLink /*_hLink*/);
ACP_tde_ucConnectionDynamicType fn_eucGetConDynTypeLink(ACP_tdxHandleOfLink /*_hLink*/);
void *fn_pvGetLinkConTypeInfo(ACP_tdxHandleOfLink /*_hLink*/);
//JT modify -> create new
void fn_vSetLinkConTypeInfo(ACP_tdxHandleOfLink /*_hLink*/, void* /*_pLinkConTypeInfo*/);
ACP_tdstDynaParam *fn_pvGetLinkConDynTypeInfo(ACP_tdxHandleOfLink /*_hLink*/);
void fn_vSetConTypeLink(ACP_tdxHandleOfLink /*_hLink*/,ACP_tde_ucConnectionType /*_eucType*/);
void fn_vSetConDynTypeLink(ACP_tdxHandleOfLink /*_hLink*/,ACP_tde_ucConnectionDynamicType /*eucType*/);
void fn_vBuildLinkFromszParams(ACP_tdxHandleOfLink /*hLink*/, char ** /*szParams*/,ACP_tdxHandleOfWaypoint /*_hWayPointBefore*/, ACP_tdxHandleOfWaypoint /*_hWayPointAfter*/ );
//-------------------------------- Way
ACP_tdxHandleOfWay fn_hConstructWay (void);
void fn_vDestroyWay (ACP_tdxHandleOfWay /*_hWay*/);
ACP_tdxHandleOfWay fn_hDuplicateWay (ACP_tdxHandleOfWay /*_hWay*/);
void fn_vCopyWay (ACP_tdxHandleOfWay /*_hWayDst*/, ACP_tdxHandleOfWay /*_hWaySrc*/);
void fn_vInvalidateWay(ACP_tdxHandleOfWay* /*_hWay*/);
ACP_tdxBool fn_bIsWayValid (ACP_tdxHandleOfWay /*_hWay*/);
void fn_vInitWay (ACP_tdxHandleOfWay /*__hWay*/);
ACP_tdxHandleOfWay fn_hAddRefWay(ACP_tdxHandleOfWay /*_hWay*/);
ACP_tdxHandleOfWay fn_hReleaseWay(ACP_tdxHandleOfWay /*_hWay*/);
// manipulate
void fn_vAllocWay (ACP_tdxHandleOfWay /*_hWay*/, tducWPIndex/*_ucSizeWay*/);
void fn_vFreeWay (ACP_tdxHandleOfWay /*_hWay*/);
void fn_vReallocWay (ACP_tdxHandleOfWay /*_hWay*/, tducWPIndex/*_ucNewSizeWay*/);
//JT modify
void fn_vInsertWayPoint (ACP_tdxHandleOfWay /*_hWay*/, ACP_tdxHandleOfWaypoint /*_hWP*/, ACP_tdxHandleOfLink /*_hLinkBefore*/, ACP_tdxHandleOfLink /*_hLinkAfter*/, tducWPIndex /*_ucPosWP*/);
//JT modify
void fn_vDeleteWayPoint (ACP_tdxHandleOfWay /*hWay*/, tducWPIndex /*_ucPosWP*/, ACP_tdxHandleOfLink /*_hNewLink*/);
// set
void fn_vSetCurrentWPWay(ACP_tdxHandleOfWay,tducWPIndex);
// get
tducWPIndex fn_ucGetSizeWay (ACP_tdxHandleOfWay /*hWay*/);
ACP_tdxHandleOfWaypoint fn_hGetWayPoint (ACP_tdxHandleOfWay /*hWay*/, tducWPIndex /*_ucPos*/);
ACP_tdxHandleOfLink fn_hGetLink (ACP_tdxHandleOfWay /*hWay*/, tducWPIndex /*ucPos*/);
tducWPIndex fn_ucPositionWayPoint (ACP_tdxHandleOfWay /*hWay*/, ACP_tdxHandleOfWaypoint /*hWP*/);
ACP_tdxHandleOfWaypoint fn_hNextWayPoint(ACP_tdxHandleOfWay /*hWay*/);
ACP_tdxHandleOfWaypoint fn_hPrevWayPoint (ACP_tdxHandleOfWay /*hWay*/);
ACP_tdxHandleOfWaypoint fn_hCurrentWayPoint (ACP_tdxHandleOfWay /*hWay*/);
// load
SCRIPT_tdeReturnValue fn_eScriptCallBackLoadWay(FILE * /*p_fFile*/, char * /*szAction*/, char * /*szParams*/[], SCRIPT_tdeAction /*cType*/);
/* Tools :*/
/* function called when action FollowWay is initialised :*/
void fnv_InitWayBeforeFollowing(HIE_tdxHandleToSuperObject /*_p_SuperObjPerso*/,ACP_tdxHandleOfWay /*_hWay*/);
/* function called when the specific vertex has been reached */
unsigned char fn_ucCurrentVertexReachedWhileFollowingWay(HIE_tdxHandleToSuperObject /*_p_SuperObjPerso*/,ACP_tdxHandleOfWay /* _hWay */);
/* function called to get the speed : */
MTH_tdxReal fn_tdxGetSpeedWay(HIE_tdxHandleToSuperObject /*_p_SuperObjPerso*/,ACP_tdxHandleOfWay /*_hWay*/);
/* function called to get the vertex to reach */
void fn_vGetNextPointWay(HIE_tdxHandleToSuperObject /*_p_SuperobjPerso*/,ACP_tdxHandleOfWay /*_hWay*/,MTH3D_tdstVector* /*_stVertex*/,MTH_tdxReal* /*_p_stMinDist*/);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* !__WAYPOINT_PROTOS__ */
#endif /* !ONLY_TYPES */

View File

@@ -0,0 +1,26 @@
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : wp_edit.hpp
//
// Include to use wp_edi
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 9 apr 1997 Author: J Th<54>noz
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
//
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
*/
#ifndef wp_edit_def
#define wp_edit_def
#include "ai_handl.h"
#include "dnm.h"
#include "gam.h"
#endif

View File

@@ -0,0 +1,5 @@
SCC = This is a source code control file
[OWP.vcproj]
SCC_Aux_Path = "P4SCC#srvperforce-ma:1666##raymandata##Editor"
SCC_Project_Name = Perforce Project

View File

@@ -0,0 +1,245 @@
; CLW file contains information for the MFC ClassWizard
[General Info]
Version=1
LastClass=EditDia
LastTemplate=CFormView
NewFileInclude1=#include "stdafx.h"
NewFileInclude2=#include "wpdia.h"
LastPage=0
ClassCount=4
Class1=DiaWP
ResourceCount=11
Resource1=IDD_ARC_DIALOG
Resource2=IDD_WAYPOINT_DIALOG
Resource3=IDD_WAY_DIALOG
Resource4=IDD_EDIT_DIALOG
Resource5=IDD_LINK_DIALOG
Class2=EditDia
Class3=DiaWay
Resource6=IDD_BEZIER_DIALOG
Class4=RotationDia
Resource7=IDD_ORIENTATION_DIALOG
Resource8=IDD_ISOLATE_WP (English (U.S.))
Resource9=IDD_GRAPH_DIALOG
Resource10=IDD_CREATION_DIALOG
Resource11=IDD_GRAPH_PARAMETERS
[CLS:DiaWP]
Type=0
HeaderFile=\Cpa\TempGrp\Owp\inc\wpdia.hpp
ImplementationFile=\Cpa\TempGrp\Owp\src\wpdia.cpp
BaseClass=CFormView
LastObject=DiaWP
Filter=D
VirtualFilter=VWC
[DLG:IDD_WAYPOINT_DIALOG]
Type=1
Class=DiaWP
ControlCount=9
Control1=IDC_WAYPOINT_TEXT,static,1342308352
Control2=IDC_WAYPOINT_EDIT,edit,1350762624
Control3=IDC_WAYPOINT_COORD_CHECK,button,1342246915
Control4=IDC_SYMBOLICALWP_RADIO,button,1342312521
Control5=IDC_REALWP_RADIO,button,1342181449
Control6=IDC_GLOBALDRAW_CHECK,button,1342246915
Control7=IDC_WAYPOINT_ALONE_PICTURE,static,1073741838
Control8=IDC_WAYPOINT_WAY_PICTURE,static,1073741838
Control9=IDC_WAYPOINT_NAME_EDIT,edit,1350631552
[DLG:IDD_WAY_DIALOG]
Type=1
Class=DiaWay
ControlCount=4
Control1=IDC_WAY_ADD_BUTTON,button,1342242816
Control2=IDC_WAY_DELETE_BUTTON,button,1342242816
Control3=IDC_WAY_COMBO,combobox,1344339969
Control4=IDC_WAY_NAME_EDIT,edit,1350631552
[DLG:IDD_LINK_DIALOG]
Type=1
Class=?
ControlCount=10
Control1=IDC_LINK_COMBO,combobox,1344340227
Control2=IDC_DYNAMIC_DIALOG,button,1073741831
Control3=IDC_LINK_SPEED_COMBO,combobox,1344339971
Control4=IDC_LINK_SPEED1_EDIT,edit,1350631552
Control5=IDC_LINK_SPEED2_EDIT,edit,1350631552
Control6=IDC_LINK_SPEED3_EDIT,edit,1350631552
Control7=IDC_LINK_SPEED1_STATIC,static,1342308352
Control8=IDC_LINK_SPEED2_STATIC,static,1342308352
Control9=IDC_LINK_SPEED3_STATIC,static,1342308352
Control10=IDC_LINK_SPEED_GROUPBOX,button,1342177287
[DLG:IDD_BEZIER_DIALOG]
Type=1
Class=DiaWay
ControlCount=2
Control1=IDC_BEZIER_STATIC,static,1342308352
Control2=IDC_BEZIER_EDIT,edit,1350631552
[DLG:IDD_ARC_DIALOG]
Type=1
Class=EditDia
ControlCount=2
Control1=IDC_ARC_STATIC,static,1342308352
Control2=IDC_ARC_EDIT,edit,1350631552
[CLS:EditDia]
Type=0
HeaderFile=\Cpa\TempGrp\Owp\inc\editdia.h
ImplementationFile=\Cpa\TempGrp\Owp\src\editdia.cpp
BaseClass=CFormView
LastObject=EditDia
Filter=D
VirtualFilter=VWC
[DLG:IDD_EDIT_DIALOG]
Type=1
Class=EditDia
ControlCount=9
Control1=IDC_EDIT_WAYPOINT_STATIC,button,1342177287
Control2=IDC_EDIT_WAYPOINT_ON_RADIO,button,1342312457
Control3=IDC_EDIT_WAYPOINT_OFF_RADIO,button,1342181385
Control4=IDC_EDIT_WAYPOINT_ISOLATE_RADIO,button,1342308361
Control5=IDC_EDIT_WAYPOINT_ALL_RADIO,button,1342177289
Control6=IDC_EDIT_TAB,SysTabControl32,1342178304
Control7=IDC_EDIT_WAY_ON_RADIO,button,1342312457
Control8=IDC_EDIT_WAY_OFF_RADIO,button,1342181385
Control9=IDC_EDIT_WAY_SELECTED_RADIO,button,1342181385
[CLS:DiaWay]
Type=0
HeaderFile=\Cpa\TempGrp\Owp\inc\waydia.hpp
ImplementationFile=\Cpa\TempGrp\Owp\src\waydia.cpp
BaseClass=CFormView
LastObject=DiaWay
Filter=D
VirtualFilter=VWC
[DLG:IDD_ORIENTATION_DIALOG]
Type=1
Class=RotationDia
ControlCount=18
Control1=IDC_TWIST1_EDIT,edit,1350631552
Control2=IDC_TWIST2_EDIT,edit,1350631552
Control3=IDC_TWIST_STATIC,static,1342308353
Control4=IDC_ORIENT_X_STATIC,button,1342177287
Control5=IDC_ORIENT_X_DIRECT_RADIO,button,1342181385
Control6=IDC_ORIENT_X_INDIRECT_RADIO,button,1342181385
Control7=IDC_LAP_X_STATIC,static,1342308352
Control8=IDC_ORIENT_LAP_X_EDIT,edit,1350631552
Control9=IDC_ORIENT_Y_STATIC,button,1342177287
Control10=IDC_ORIENT_Y_DIRECT_RADIO,button,1342181385
Control11=IDC_ORIENT_Y_INDIRECT_RADIO,button,1342181385
Control12=IDC_LAP_Y_STATIC,static,1342308352
Control13=IDC_ORIENT_LAP_Y_EDIT,edit,1350631552
Control14=IDC_ORIENT_TWIST_STATIC,button,1342177287
Control15=IDC_ORIENT_TWIST_DIRECT_RADIO,button,1342181385
Control16=IDC_ORIENT_TWIST_INDIRECT_RADIO,button,1342181385
Control17=IDC_LAP_TWIST_STATIC,static,1342308352
Control18=IDC_ORIENT_LAP_TWIST_EDIT,edit,1350631552
[CLS:RotationDia]
Type=0
HeaderFile=..\inc\rotdia.hpp
ImplementationFile=..\src\rotdia.cpp
BaseClass=CFormView
Filter=D
LastObject=RotationDia
VirtualFilter=VWC
[DLG:IDD_GRAPH_DIALOG]
Type=1
ControlCount=19
Control1=IDC_STATIC_GRAPH,static,1342308352
Control2=IDC_GRAPH_NAME,combobox,1344339969
Control3=IDC_GRAPH_INSERT,button,1342242816
Control4=IDC_GRAPH_DELETE,button,1342242816
Control5=IDC_STATIC_NODE,static,1342308352
Control6=IDC_NTW_WP,combobox,1344339969
Control7=IDC_STATIC_LINK,static,1342308352
Control8=IDC_CONNECT_LIST,listbox,1352728833
Control9=IDC_CONNECT_INSERT,button,1342242816
Control10=IDC_CONNECT_DELETE,button,1342242816
Control11=IDC_WP_INSERT,button,1342242816
Control12=IDC_WP_DELETE,button,1342242816
Control13=IDC_CONNECT_EDITALL,button,1342242816
Control14=IDC_CONNECT_ALLDEFAULT,button,1342242816
Control15=IDC_DEFAULT,button,1073807361
Control16=IDC_GRAPH_RENAME,button,1342242816
Control17=IDC_WP_EDIT,button,1342242816
Control18=IDC_CONNECT_EDIT,button,1342242816
Control19=IDC_CONNECT_SYMETRIC,button,1342246915
[DLG:IDD_ISOLATE_WP (English (U.S.))]
Type=1
ControlCount=3
Control1=IDOK,button,1342242817
Control2=IDCANCEL,button,1342242816
Control3=IDC_LIST_WP,listbox,1352730881
[DLG:IDD_CREATION_DIALOG]
Type=1
ControlCount=4
Control1=IDOK,button,1342242817
Control2=IDCANCEL,button,1342242816
Control3=IDC_GRAPH_NAME,edit,1350631552
Control4=IDC_STATIC,static,1342308352
[DLG:IDD_GRAPH_PARAMETERS]
Type=1
ControlCount=49
Control1=IDOK,button,1342242817
Control2=IDCANCEL,button,1342242816
Control3=IDC_EDIT_WEIGHT,edit,1350639744
Control4=IDC_CAPACITY1,button,1342242819
Control5=IDC_STATIC_CAPACITY,button,1342178055
Control6=IDC_CAPACITY2,button,1342242819
Control7=IDC_CAPACITY3,button,1342242819
Control8=IDC_CAPACITY4,button,1342242819
Control9=IDC_CAPACITY5,button,1342242819
Control10=IDC_CAPACITY6,button,1342242819
Control11=IDC_CAPACITY7,button,1342242819
Control12=IDC_CAPACITY8,button,1342242819
Control13=IDC_CAPACITY9,button,1342242819
Control14=IDC_CAPACITY10,button,1342242819
Control15=IDC_CAPACITY11,button,1342242819
Control16=IDC_CAPACITY12,button,1342242819
Control17=IDC_CAPACITY13,button,1342242819
Control18=IDC_CAPACITY14,button,1342242819
Control19=IDC_CAPACITY15,button,1342242819
Control20=IDC_CAPACITY16,button,1342242819
Control21=IDC_CAPACITY17,button,1342242819
Control22=IDC_CAPACITY18,button,1342242819
Control23=IDC_CAPACITY19,button,1342242819
Control24=IDC_CAPACITY20,button,1342242819
Control25=IDC_CAPACITY21,button,1342242819
Control26=IDC_CAPACITY22,button,1342242819
Control27=IDC_CAPACITY23,button,1342242819
Control28=IDC_CAPACITY24,button,1342242819
Control29=IDC_CAPACITY25,button,1342242819
Control30=IDC_CAPACITY26,button,1342242819
Control31=IDC_CAPACITY27,button,1342242819
Control32=IDC_CAPACITY28,button,1342242819
Control33=IDC_CAPACITY29,button,1342242819
Control34=IDC_CAPACITY30,button,1342242819
Control35=IDC_CAPACITY31,button,1342242819
Control36=IDC_CAPACITY32,button,1342242819
Control37=IDC_DEFAULT_WEIGHT,button,1342242816
Control38=IDC_STATIC_WEIGHT,button,1342178055
Control39=IDC_EDIT_OKPREV,button,1342242816
Control40=IDC_EDIT_OKNEXT,button,1342242816
Control41=IDC_EDIT_CANCELPREV,button,1342242816
Control42=IDC_EDIT_CANCELNEXT,button,1342242816
Control43=IDC_EDIT_OKPREVNODE,button,1342242816
Control44=IDC_EDIT_OKNEXTNODE,button,1342242816
Control45=IDC_EDIT_CANCELPREVNODE,button,1342242816
Control46=IDC_EDIT_CANCELNEXTNODE,button,1342242816
Control47=IDC_STATIC_NODE,static,1342308353
Control48=IDC_STATIC_LINK,static,1342308353
Control49=IDC_EDIT_SYMETRIC,button,1342242816

View File

@@ -0,0 +1,492 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_ISOLATE_WP DIALOG DISCARDABLE 0, 0, 120, 169
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Isolate WayPoints"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,7,148,50,14
PUSHBUTTON "Cancel",IDCANCEL,63,148,50,14
LISTBOX IDC_LIST_WP,14,16,91,125,LBS_NOINTEGRALHEIGHT |
LBS_EXTENDEDSEL | WS_VSCROLL | WS_TABSTOP
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_ISOLATE_WP, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 113
TOPMARGIN, 7
BOTTOMMARGIN, 162
END
END
#endif // APSTUDIO_INVOKED
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// French (France) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
#ifdef _WIN32
LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_WAYPOINT_DIALOG DIALOG DISCARDABLE 200, 40, 116, 48
STYLE WS_CHILD
FONT 8, "MS Sans Serif"
BEGIN
LTEXT "R=",IDC_WAYPOINT_TEXT,39,19,10,8
EDITTEXT IDC_WAYPOINT_EDIT,51,17,58,12,ES_AUTOHSCROLL | WS_GROUP
CONTROL "&Static",IDC_WAYPOINT_COORD_CHECK,"Button",
BS_AUTOCHECKBOX | BS_PUSHLIKE | WS_TABSTOP,7,18,23,11
CONTROL "",IDC_SYMBOLICALWP_RADIO,"Button",BS_AUTORADIOBUTTON |
BS_ICON | BS_PUSHLIKE | WS_GROUP,39,33,33,11
CONTROL "Sp",IDC_REALWP_RADIO,"Button",BS_AUTORADIOBUTTON |
BS_ICON | BS_PUSHLIKE,76,33,33,11
CONTROL "Global",IDC_GLOBALDRAW_CHECK,"Button",BS_AUTOCHECKBOX |
BS_PUSHLIKE | WS_TABSTOP,7,33,23,11
CONTROL 151,IDC_WAYPOINT_ALONE_PICTURE,"Static",SS_BITMAP | NOT
WS_VISIBLE,7,2,11,10
CONTROL 152,IDC_WAYPOINT_WAY_PICTURE,"Static",SS_BITMAP | NOT
WS_VISIBLE,7,2,11,10
EDITTEXT IDC_WAYPOINT_NAME_EDIT,26,2,83,12,ES_AUTOHSCROLL
END
IDD_WAY_DIALOG DIALOGEX 30, 40, 116, 98
STYLE WS_CHILD
EXSTYLE WS_EX_APPWINDOW
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
PUSHBUTTON "Insert",IDC_WAY_ADD_BUTTON,7,81,50,14
PUSHBUTTON "Delete",IDC_WAY_DELETE_BUTTON,59,81,50,14
COMBOBOX IDC_WAY_COMBO,7,15,102,70,CBS_SIMPLE | WS_VSCROLL |
WS_TABSTOP
EDITTEXT IDC_WAY_NAME_EDIT,7,2,102,12,ES_AUTOHSCROLL
END
IDD_LINK_DIALOG DIALOG DISCARDABLE 0, 0, 116, 100
STYLE WS_CHILD
FONT 8, "MS Sans Serif"
BEGIN
COMBOBOX IDC_LINK_COMBO,7,3,102,58,CBS_DROPDOWNLIST | CBS_SORT |
WS_VSCROLL | WS_TABSTOP
GROUPBOX "",IDC_DYNAMIC_DIALOG,7,81,102,16,NOT WS_VISIBLE
COMBOBOX IDC_LINK_SPEED_COMBO,14,27,87,55,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
EDITTEXT IDC_LINK_SPEED1_EDIT,63,42,37,12,ES_AUTOHSCROLL
EDITTEXT IDC_LINK_SPEED2_EDIT,63,54,37,12,ES_AUTOHSCROLL
EDITTEXT IDC_LINK_SPEED3_EDIT,63,66,37,12,ES_AUTOHSCROLL
LTEXT "",IDC_LINK_SPEED1_STATIC,16,42,37,12
LTEXT "",IDC_LINK_SPEED2_STATIC,16,54,37,12
LTEXT "",IDC_LINK_SPEED3_STATIC,16,66,37,12
GROUPBOX "Speed",IDC_LINK_SPEED_GROUPBOX,7,16,102,65
END
IDD_BEZIER_DIALOG DIALOG DISCARDABLE 0, 0, 124, 18
STYLE WS_CHILD | WS_VISIBLE
FONT 8, "MS Sans Serif"
BEGIN
LTEXT "Sampling rate:",IDC_BEZIER_STATIC,10,3,54,8
EDITTEXT IDC_BEZIER_EDIT,68,2,47,13,ES_AUTOHSCROLL
END
IDD_ARC_DIALOG DIALOG DISCARDABLE 0, 0, 124, 18
STYLE WS_CHILD | WS_VISIBLE
FONT 8, "MS Sans Serif"
BEGIN
LTEXT "Sampling rate:",IDC_ARC_STATIC,10,3,54,8
EDITTEXT IDC_ARC_EDIT,68,2,47,13,ES_AUTOHSCROLL
END
IDD_EDIT_DIALOG DIALOGEX 0, 0, 116, 75
STYLE WS_CHILD
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
GROUPBOX "Waypoint",IDC_EDIT_WAYPOINT_STATIC,7,38,102,34
CONTROL "&On",IDC_EDIT_WAYPOINT_ON_RADIO,"Button",
BS_AUTORADIOBUTTON | BS_PUSHLIKE | WS_GROUP,17,51,18,12
CONTROL "&Off",IDC_EDIT_WAYPOINT_OFF_RADIO,"Button",
BS_AUTORADIOBUTTON | BS_PUSHLIKE,39,51,18,12
CONTROL "&Isolate",IDC_EDIT_WAYPOINT_ISOLATE_RADIO,"Button",
BS_AUTORADIOBUTTON | WS_GROUP,61,46,37,10
CONTROL "&All",IDC_EDIT_WAYPOINT_ALL_RADIO,"Button",
BS_AUTORADIOBUTTON,61,59,23,10
CONTROL "Tab1",IDC_EDIT_TAB,"SysTabControl32",TCS_FIXEDWIDTH,7,3,
102,34,WS_EX_STATICEDGE
CONTROL "On",IDC_EDIT_WAY_ON_RADIO,"Button",BS_AUTORADIOBUTTON |
BS_PUSHLIKE | WS_GROUP,16,20,23,13
CONTROL "Off",IDC_EDIT_WAY_OFF_RADIO,"Button",BS_AUTORADIOBUTTON |
BS_PUSHLIKE,42,20,23,13
CONTROL "?",IDC_EDIT_WAY_SELECTED_RADIO,"Button",
BS_AUTORADIOBUTTON | BS_PUSHLIKE,68,20,23,13
END
IDD_ORIENTATION_DIALOG DIALOG DISCARDABLE 0, 0, 116, 112
STYLE WS_CHILD
FONT 8, "MS Sans Serif"
BEGIN
EDITTEXT IDC_TWIST1_EDIT,7,7,34,12,ES_AUTOHSCROLL
EDITTEXT IDC_TWIST2_EDIT,65,7,41,12,ES_AUTOHSCROLL
CTEXT "Twist",IDC_TWIST_STATIC,41,7,23,9
GROUPBOX "x",IDC_ORIENT_X_STATIC,7,23,102,25
CONTROL "+",IDC_ORIENT_X_DIRECT_RADIO,"Button",
BS_AUTORADIOBUTTON | BS_PUSHLIKE,14,32,10,11
CONTROL "-",IDC_ORIENT_X_INDIRECT_RADIO,"Button",
BS_AUTORADIOBUTTON | BS_PUSHLIKE,27,32,10,11
LTEXT "Lap",IDC_LAP_X_STATIC,43,33,14,10
EDITTEXT IDC_ORIENT_LAP_X_EDIT,60,30,44,12,ES_AUTOHSCROLL
GROUPBOX "y",IDC_ORIENT_Y_STATIC,7,51,102,25
CONTROL "+",IDC_ORIENT_Y_DIRECT_RADIO,"Button",
BS_AUTORADIOBUTTON | BS_PUSHLIKE,14,61,10,11
CONTROL "-",IDC_ORIENT_Y_INDIRECT_RADIO,"Button",
BS_AUTORADIOBUTTON | BS_PUSHLIKE,27,61,10,11
LTEXT "Lap",IDC_LAP_Y_STATIC,43,62,13,10
EDITTEXT IDC_ORIENT_LAP_Y_EDIT,60,58,44,12,ES_AUTOHSCROLL
GROUPBOX "Twist",IDC_ORIENT_TWIST_STATIC,7,79,102,25
CONTROL "+",IDC_ORIENT_TWIST_DIRECT_RADIO,"Button",
BS_AUTORADIOBUTTON | BS_PUSHLIKE,14,89,10,11
CONTROL "-",IDC_ORIENT_TWIST_INDIRECT_RADIO,"Button",
BS_AUTORADIOBUTTON | BS_PUSHLIKE,27,89,10,11
LTEXT "Lap",IDC_LAP_TWIST_STATIC,43,90,16,10
EDITTEXT IDC_ORIENT_LAP_TWIST_EDIT,60,86,44,12,ES_AUTOHSCROLL
END
IDD_GRAPH_DIALOG DIALOG DISCARDABLE 0, 0, 117, 304
STYLE WS_CHILD
FONT 8, "MS Sans Serif"
BEGIN
LTEXT "Graph Name",IDC_STATIC_GRAPH,7,7,48,8
COMBOBOX IDC_GRAPH_NAME,7,15,102,44,CBS_SIMPLE | WS_VSCROLL |
WS_TABSTOP
PUSHBUTTON "Insert",IDC_GRAPH_INSERT,7,56,32,14
PUSHBUTTON "Delete",IDC_GRAPH_DELETE,41,56,33,14
LTEXT "Nodes",IDC_STATIC_NODE,7,82,22,8
COMBOBOX IDC_NTW_WP,7,96,102,41,CBS_SIMPLE | WS_VSCROLL |
WS_TABSTOP
LTEXT "Connections",IDC_STATIC_LINK,7,169,46,8
LISTBOX IDC_CONNECT_LIST,7,182,102,40,LBS_NOINTEGRALHEIGHT |
WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Insert",IDC_CONNECT_INSERT,7,225,34,14
PUSHBUTTON "Delete",IDC_CONNECT_DELETE,80,225,32,14
PUSHBUTTON "Insert",IDC_WP_INSERT,7,138,32,14
PUSHBUTTON "Delete",IDC_WP_DELETE,79,138,30,14
PUSHBUTTON "Edit for All Connections",IDC_CONNECT_EDITALL,7,249,110,
13
PUSHBUTTON "Set Default Weight for All",IDC_CONNECT_ALLDEFAULT,7,
265,109,12
DEFPUSHBUTTON "",IDC_DEFAULT,81,0,6,7,NOT WS_VISIBLE
PUSHBUTTON "Rename",IDC_GRAPH_RENAME,76,56,33,14
PUSHBUTTON "Edit",IDC_WP_EDIT,44,138,32,14
PUSHBUTTON "Edit",IDC_CONNECT_EDIT,45,225,32,14
CONTROL "Symetric Mode",IDC_CONNECT_SYMETRIC,"Button",
BS_AUTOCHECKBOX | BS_PUSHLIKE | WS_TABSTOP,26,284,63,14
END
IDD_CREATION_DIALOG DIALOG DISCARDABLE 0, 0, 135, 63
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION
CAPTION "Create New Graph"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,68,42,37,14
PUSHBUTTON "Cancel",IDCANCEL,25,42,37,14
EDITTEXT IDC_GRAPH_NAME,7,20,120,13,ES_AUTOHSCROLL
LTEXT "Choose a name for the graph :",IDC_STATIC,7,7,120,13
END
IDD_GRAPH_PARAMETERS DIALOG DISCARDABLE 0, 0, 196, 327
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION
CAPTION "Parameters of the conection"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,101,306,37,14
PUSHBUTTON "Cancel",IDCANCEL,57,306,37,14
EDITTEXT IDC_EDIT_WEIGHT,13,274,50,14,ES_AUTOHSCROLL | ES_NUMBER
CONTROL "Translater",IDC_CAPACITY1,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,15,62,50,8
GROUPBOX "Capacity",IDC_STATIC_CAPACITY,7,48,182,209,BS_CENTER
CONTROL "Marcher",IDC_CAPACITY2,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,15,73,50,8
CONTROL "Courir",IDC_CAPACITY3,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,15,86,50,8
CONTROL "Reculer",IDC_CAPACITY4,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,15,97,50,8
CONTROL "Sauter",IDC_CAPACITY5,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,15,110,50,8
CONTROL "Voler",IDC_CAPACITY6,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,15,121,50,8
CONTROL "Accrocher",IDC_CAPACITY7,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,15,134,50,8
CONTROL "Suspendre",IDC_CAPACITY8,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,15,145,50,8
CONTROL "Nager",IDC_CAPACITY9,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,15,158,50,8
CONTROL "Balancer",IDC_CAPACITY10,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,15,169,50,8
CONTROL "Bloquer",IDC_CAPACITY11,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,15,182,50,8
CONTROL "Teleporter",IDC_CAPACITY12,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,15,193,50,8
CONTROL "Glisser",IDC_CAPACITY13,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,15,206,50,8
CONTROL "Aspirer",IDC_CAPACITY14,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,15,217,50,8
CONTROL "Pause",IDC_CAPACITY15,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,15,230,61,8
CONTROL "Custom-Bit 15",IDC_CAPACITY16,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,15,241,57,8
CONTROL "Custom-Bit 16",IDC_CAPACITY17,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,114,62,62,8
CONTROL "Custom-Bit 17",IDC_CAPACITY18,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,114,73,62,8
CONTROL "Custom-Bit 18",IDC_CAPACITY19,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,114,86,62,8
CONTROL "Custom-Bit 19",IDC_CAPACITY20,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,114,97,62,8
CONTROL "Custom-Bit 20",IDC_CAPACITY21,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,114,110,62,8
CONTROL "Custom-Bit 21",IDC_CAPACITY22,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,114,121,62,8
CONTROL "Custom-Bit 22",IDC_CAPACITY23,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,114,134,62,8
CONTROL "Custom Bit 23",IDC_CAPACITY24,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,114,145,62,8
CONTROL "Custom-Bit 24",IDC_CAPACITY25,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,114,158,62,8
CONTROL "Custom-Bit 25",IDC_CAPACITY26,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,114,169,62,8
CONTROL "Custom-Bit 26",IDC_CAPACITY27,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,114,182,62,8
CONTROL "Custom-Bit 27",IDC_CAPACITY28,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,114,193,62,8
CONTROL "Custom-Bit 28",IDC_CAPACITY29,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,114,206,62,8
CONTROL "Custom-Bit 29",IDC_CAPACITY30,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,114,217,62,8
CONTROL "Custom-Bit 30",IDC_CAPACITY31,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,114,230,62,8
CONTROL "All Enabled",IDC_CAPACITY32,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,114,241,62,8
PUSHBUTTON "Default",IDC_DEFAULT_WEIGHT,77,274,34,14
GROUPBOX "Weight",IDC_STATIC_WEIGHT,7,263,112,32,BS_CENTER
PUSHBUTTON "<< OK",IDC_EDIT_OKPREV,7,7,25,14
PUSHBUTTON "OK >>",IDC_EDIT_OKNEXT,164,7,25,14
PUSHBUTTON "< (c)",IDC_EDIT_CANCELPREV,35,7,21,14
PUSHBUTTON "(c) >",IDC_EDIT_CANCELNEXT,140,7,20,14
PUSHBUTTON "<= OK",IDC_EDIT_OKPREVNODE,7,25,25,14
PUSHBUTTON "OK =>",IDC_EDIT_OKNEXTNODE,163,25,26,14
PUSHBUTTON "<- (c)",IDC_EDIT_CANCELPREVNODE,35,25,21,14
PUSHBUTTON "(c) ->",IDC_EDIT_CANCELNEXTNODE,139,25,21,14
CTEXT "Node :",IDC_STATIC_NODE,62,10,75,9
CTEXT "Connection :",IDC_STATIC_LINK,60,29,75,10
PUSHBUTTON "Symetric",IDC_EDIT_SYMETRIC,133,272,48,14
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_WAYPOINT_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 109
TOPMARGIN, 2
BOTTOMMARGIN, 44
END
IDD_WAY_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 109
TOPMARGIN, 2
BOTTOMMARGIN, 95
END
IDD_LINK_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 109
TOPMARGIN, 3
BOTTOMMARGIN, 97
END
IDD_BEZIER_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 117
TOPMARGIN, 7
BOTTOMMARGIN, 11
END
IDD_ARC_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 117
TOPMARGIN, 7
BOTTOMMARGIN, 11
END
IDD_EDIT_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 109
TOPMARGIN, 3
BOTTOMMARGIN, 72
END
IDD_ORIENTATION_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 109
TOPMARGIN, 7
BOTTOMMARGIN, 105
END
IDD_GRAPH_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 7
TOPMARGIN, 7
BOTTOMMARGIN, 298
END
IDD_CREATION_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 128
TOPMARGIN, 7
BOTTOMMARGIN, 56
END
IDD_GRAPH_PARAMETERS, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 189
TOPMARGIN, 7
BOTTOMMARGIN, 320
END
END
#endif // APSTUDIO_INVOKED
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_SYMBOLICWP ICON DISCARDABLE "symbolic.ico"
IDI_REALWP ICON DISCARDABLE "realwp.ico"
IDI_SPECIFIC_WAY ICON DISCARDABLE "icon2.ico"
IDI_COMMON_WAY ICON DISCARDABLE "ico00001.ico"
IDI_SHARED_WAY ICON DISCARDABLE "ico00002.ico"
IDI_OWP_DLGBAR_ICON ICON DISCARDABLE "owp_dlgb.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Cursor
//
IDC_POINTER_WP CURSOR DISCARDABLE "arrow.cur"
IDC_RADIUS_MOVE CURSOR DISCARDABLE "radius_m.cur"
IDC_ADD_WP CURSOR DISCARDABLE "add_wp.cur"
IDC_POINTER_WAY CURSOR DISCARDABLE "arrow.cur"
IDC_POINTER_TANGENT CURSOR DISCARDABLE "pointer_.cur"
IDC_POINTER_PLANE CURSOR DISCARDABLE "cur00001.cur"
IDC_POINTER_CURSOR CURSOR DISCARDABLE "cur00002.cur"
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//
IDB_WAYPOINT_ALONE_BITMAP BITMAP DISCARDABLE "bitmap1.bmp"
IDB_WAYPOINT_WAY_BITMAP BITMAP DISCARDABLE "bmp00001.bmp"
#endif // French (France) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,173 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by WPDia.rc
//
#define IDD_WAYPOINT_DIALOG 102
#define IDD_WAY_DIALOG 103
#define IDC_POINTER_WP 104
#define IDC_RADIUS_MOVE 105
#define IDC_POINTER_WAY 106
#define IDC_ADD_WP 107
#define IDC_POINTER_TANGENT 108
#define IDC_POINTER_PLANE 109
#define IDC_POINTER_CURSOR 110
#define IDI_SYMBOLICWP 119
#define IDI_REALWP 120
#define IDR_MAINFRAME 128
#define IDI_NETWAYPOINT 130
#define IDD_LINK_DIALOG 144
#define IDD_BEZIER_DIALOG 146
#define IDD_ARC_DIALOG 147
#define IDD_EDIT_DIALOG 148
#define IDB_WAYPOINT_ALONE_BITMAP 151
#define IDB_WAYPOINT_WAY_BITMAP 152
#define IDI_ICON1 153
#define IDI_SPECIFIC_WAY 158
#define IDI_COMMON_WAY 159
#define IDI_SHARED_WAY 160
#define IDD_ORIENTATION_DIALOG 161
#define IDD_GRAPH_DIALOG 162
#define IDD_CREATION_DIALOG 163
#define IDD_ISOLATE_WP 164
#define IDI_OWP_DLGBAR_ICON 164
#define IDD_GRAPH_PARAMETERS 165
#define IDC_WAYPOINT_TEXT 1000
#define IDC_WAYPOINT_EDIT 1001
#define IDC_WAY_ADD_BUTTON 1002
#define IDC_WAY_DELETE_BUTTON 1003
#define IDC_WAYPOINT_COORD_CHECK 1004
#define IDC_WAY_COMBO 1012
#define IDC_LINK_COMBO 1016
#define IDC_WAY_EDIT_SPEED 1017
#define IDC_WAY_LINK_STATIC 1019
#define IDC_SYMBOLICALWP_RADIO 1022
#define IDC_REALWP_RADIO 1023
#define IDC_GLOBALDRAW_CHECK 1024
#define IDC_DYNAMIC_DIALOG 1028
#define IDC_LINK_SPEED_COMBO 1033
#define IDC_LINK_SPEED1_EDIT 1034
#define IDC_LINK_SPEED2_EDIT 1035
#define IDC_LINK_SPEED3_EDIT 1036
#define IDC_LINK_SPEED1_STATIC 1037
#define IDC_LINK_SPEED2_STATIC 1038
#define IDC_LINK_SPEED3_STATIC 1039
#define IDC_LINK_SPEED_GROUPBOX 1040
#define IDC_BEZIER_STATIC 1041
#define IDC_BEZIER_EDIT 1042
#define IDC_ARC_EDIT 1043
#define IDC_ARC_STATIC 1044
#define IDC_EDIT_EDIT 1045
#define IDC_EDIT_SHOW 1047
#define IDC_WAYPOINT_ALONE_PICTURE 1049
#define IDC_WAYPOINT_WAY_PICTURE 1050
#define IDC_WAYPOINT_NAME_EDIT 1052
#define IDC_WAY_NAME_EDIT 1053
#define IDC_EDIT_WAYPOINT_STATIC 1054
#define IDC_EDIT_WAYPOINT_ON_RADIO 1056
#define IDC_EDIT_WAYPOINT_OFF_RADIO 1057
#define IDC_EDIT_WAYPOINT_ISOLATE_RADIO 1058
#define IDC_EDIT_WAYPOINT_ALL_RADIO 1059
#define IDC_EDIT_TAB 1061
#define IDC_EDIT_WAY_ON_RADIO 1062
#define IDC_EDIT_WAY_OFF_RADIO 1063
#define IDC_TWIST1_EDIT 1063
#define IDC_EDIT_WAY_SELECTED_RADIO 1064
#define IDC_TWIST2_EDIT 1064
#define IDC_TWIST_STATIC 1065
#define IDC_ORIENT_X_DIRECT_RADIO 1066
#define IDC_ORIENT_X_INDIRECT_RADIO 1067
#define IDC_LAP_X_STATIC 1068
#define IDC_ORIENT_LAP_X_EDIT 1069
#define IDC_ORIENT_X_STATIC 1070
#define IDC_ORIENT_Y_STATIC 1071
#define IDC_DEFAULT 1071
#define IDC_ORIENT_Y_DIRECT_RADIO 1072
#define IDC_STATIC_GRAPH 1072
#define IDC_ORIENT_Y_INDIRECT_RADIO 1073
#define IDC_STATIC_NODE 1073
#define IDC_LAP_Y_STATIC 1074
#define IDC_STATIC_LINK 1074
#define IDC_ORIENT_LAP_Y_EDIT 1075
#define IDC_STATIC_CAPACITY 1075
#define IDC_ORIENT_TWIST_STATIC 1076
#define IDC_STATIC_WEIGHT 1076
#define IDC_ORIENT_TWIST_DIRECT_RADIO 1077
#define IDC_ORIENT_TWIST_INDIRECT_RADIO 1078
#define IDC_NTW_TYPE 1078
#define IDC_LAP_TWIST_STATIC 1079
#define IDC_STATIC_TYPE 1079
#define IDC_ORIENT_LAP_TWIST_EDIT 1080
#define IDC_WP_EDIT 1080
#define IDC_GRAPH_NAME 1081
#define IDC_GRAPH_INSERT 1082
#define IDC_GRAPH_DELETE 1083
#define IDC_WP_INSERT 1084
#define IDC_NTW_WP 1085
#define IDC_CONNECT_LIST 1086
#define IDC_WEIGHT 1087
#define IDC_CONNECT_EDIT 1087
#define IDC_EDIT_WEIGHT 1087
#define IDC_CONNECT_DELETE 1088
#define IDC_WP_DELETE 1089
#define IDC_LIST_WP 1089
#define IDC_CONNECT_INSERT 1090
#define IDC_CAPACITY1 1091
#define IDC_CONNECT_EDITALL 1091
#define IDC_CAPACITY2 1092
#define IDC_CAPACITY3 1093
#define IDC_CAPACITY4 1094
#define IDC_CAPACITY5 1095
#define IDC_CAPACITY6 1096
#define IDC_CAPACITY7 1097
#define IDC_CAPACITY8 1098
#define IDC_CAPACITY9 1099
#define IDC_CAPACITY10 1100
#define IDC_CAPACITY11 1101
#define IDC_CAPACITY12 1102
#define IDC_CAPACITY13 1103
#define IDC_CAPACITY14 1104
#define IDC_CAPACITY15 1105
#define IDC_CAPACITY16 1106
#define IDC_CAPACITY17 1107
#define IDC_CAPACITY18 1108
#define IDC_CAPACITY19 1109
#define IDC_CAPACITY20 1110
#define IDC_CAPACITY21 1111
#define IDC_CAPACITY22 1112
#define IDC_CAPACITY23 1113
#define IDC_CAPACITY24 1114
#define IDC_CAPACITY25 1115
#define IDC_CAPACITY26 1116
#define IDC_CAPACITY27 1117
#define IDC_CAPACITY28 1118
#define IDC_CAPACITY29 1119
#define IDC_CAPACITY30 1120
#define IDC_CAPACITY31 1121
#define IDC_CAPACITY32 1122
#define IDC_DEFAULT_WEIGHT 1123
#define IDC_DEFAULT_ALL_WEIGHTS 1124
#define IDC_CONNECT_ALLDEFAULT 1124
#define IDC_EDIT_PREV 1124
#define IDC_EDIT_OKPREV 1124
#define IDC_GRAPH_RENAME 1125
#define IDC_EDIT_NEXT 1125
#define IDC_EDIT_OKNEXT 1125
#define IDC_EDIT_CANCELPREV 1126
#define IDC_EDIT_CANCELNEXT 1127
#define IDC_EDIT_OKPREVNODE 1128
#define IDC_EDIT_OKNEXTNODE 1129
#define IDC_EDIT_CANCELPREVNODE 1130
#define IDC_EDIT_CANCELNEXTNODE 1131
#define IDC_EDIT_SYMETRIC 1134
#define IDC_CONNECT_SYMETRIC 1136
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 165
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1137
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

View File

@@ -0,0 +1,527 @@
/*=========================================================================================
File: Bezier.c
Prupose: Handle a Bezier curve
Author: Yann Le Tensorer
Creation Date: 23 january 1997
Version: 1.0
===========================================================================================
Revisions: Version Date Author
----------------------------------------------------------------
1.1 3 february 1997 Yann Le Tensorer
1.2 5 february 1997 Yann Le Tensorer
Added the possibility of changing the sampling rate in real-time
=========================================================================================*/
/*==========================================================
Notes:
This module implements functions to create and draw bezier curves
here is an example how to use it:
{
tdstBezierObject BezierCurve;
long color;
MTH3D_tdstVector A,B,T1,T2;
ACP_tdstDynaParam stDynaParam;
unsigned char ucSamplingRate;
color=0xffffffff; // white
A.xX=0;
A.xY=0;
A.xZ=0;
B.xX=1;
B.xY=1;
B.xZ=0;
T1.xX=0;
T1.xY=0.25;
T1.xZ=0;
T2.xX=-0.25;
T2.xY=0;
T2.xZ=0;
ucSamplingRate=20; // Sampling rate
fn_vDynamicObject_Create(&stDynaParam,ucSamplingRate,C_ucSinus,0,MTH_C_Pi,255);
fn_vBezierObject_Create(&BezierCurve,ucSamplingRate,&A,&B,&T1,&T2,C_ucModeNoObject,&stDynaParam);
fn_vBezierObject_SetColor(&BezierCurve,color);
fn_vBezierObject_SetViewPortAttributes(...); // en fonction du viewport
fn_vBezierObject_Draw(&BezierCurve);
fn_vBezierObject_Free(&BezierCurve);
}
===========================================================*/
#ifdef _AI_LIB_
#include "AIUseCPA.h"
/*#include "acp_base.h"*/
/*#include "gli.h"*/
#include "geoobj.h"
#include "bezier.h"
#include "IAOption.h"
#include "IAMacros.h"
/* AI memory and error management */
#include "MemIA.h"
#include "ErrIA.h"
#else /*_AI_LIB_*/
#include "acp_base.h"
#include "gli.h"
#include "geoobj.h"
#include "bezier.h"
#endif /*_AI_LIB_*/
/*============================================================
Memory management macros, to be replaced with correct memory management
============================================================*/
#ifdef _AI_LIB_
#define M_malloc(pointer,cast,size) M_IAAlloc(pointer,cast,size)
#define M_free(pointer) M_IAFree(pointer)
#else /*_AI_LIB_*/
#define M_malloc(pointer,cast,size) (pointer=(cast)malloc(size))
#define M_free(pointer) (free(pointer))
#endif /*_AI_LIB_*/
/*==========================================================
Function name: fn_vBezierObject_Create
Description: Create Bezier curve (in ram only) between two points
Input: p_BezierObject: pointer to a preallocated tdstBezierObject
ucSamplingRate: number of segment to define the curve)
stStartPoint: First vertex of the curve
stEndPoint: Last vertex of the curve
stStartVector: Tangent vector at the first point
stEndVector: Tangent vector at the last point
ucObjectMode: Creation mode (C_ucModeNoObject ou C_ucModeRealObject)
C_ucModeNoObject does not create a geometric object
whereas C_ucModeRealObject does.
Output: none
Author: Yann Le Tensorer
Date: 23 january 1997
Revision: YLT - 03 february 1997
==========================================================*/
void fn_vBezierObject_Create( tdstBezierObject *p_BezierObject,
unsigned char ucSamplingRate,
MTH3D_tdstVector* p_stStartPoint,
MTH3D_tdstVector* p_stEndPoint,
MTH3D_tdstVector* p_stStartVector,
MTH3D_tdstVector* p_stEndVector,
unsigned char ucObjectMode,
ACP_tdstDynaParam* p_stDynaParams
)
{
GEO_tdstDoubledIndex xLineDoubleIndex;
long xCurVertex;
if (p_BezierObject==0) return; /* avoid crash */
/* copies input parameters into objects parameters */
p_BezierObject->ucObjectMode =ucObjectMode;
p_BezierObject->ucSamplingRate =ucSamplingRate;
p_BezierObject->stStartPoint =*p_stStartPoint;
p_BezierObject->stEndPoint =*p_stEndPoint;
p_BezierObject->stStartVector =*p_stStartVector;
p_BezierObject->stEndVector =*p_stEndVector;
p_BezierObject->p_stDynaParams =p_stDynaParams;
/* if mode is MODE_NO_OBJECT, allocates ram only for points list and dynamic parameters */
if (ucObjectMode==C_ucModeNoObject)
{
M_malloc ( p_BezierObject->d_stListOfPoints,
MTH3D_tdstVector*,
(ucSamplingRate+1)*sizeof(MTH3D_tdstVector)
);
}
else
/* else mode is MODE_REAL_OBJET, creates the geometric object*/
{
/* This list of points is not used */
p_BezierObject->d_stListOfPoints=0;
/* create object with 1 element (lines only), and ucSamplingRate+1 points) */
GEO_vCreateGeometricObject(&p_BezierObject->hObject,ucSamplingRate+1,1);
/* create line element*/
GEO_xCreateElementLines(p_BezierObject->hObject,&p_BezierObject->hElement,ucSamplingRate);
/* create lines indexes */
for (xCurVertex=0;xCurVertex<ucSamplingRate;xCurVertex++)
{
/* define start and end vertex of a line */
xLineDoubleIndex.a2_xIndex[0]=xCurVertex;
xLineDoubleIndex.a2_xIndex[1]=xCurVertex+1;
/* set line index */
GEO_xSetIndexOfElementLines(p_BezierObject->hObject,p_BezierObject->hElement,xCurVertex,&xLineDoubleIndex);
}
}
/* calculate points of bezier curve */
fn_vBezierObject_Calculate(p_BezierObject);
}
/*===============================================================================
Function name: fn_bBezierObject_SetSamplingRate
Description: Modifies the sampling rate of a bezier object, and changes all
the depending parameters (including dynamic sampling rate)
Input: p_BezierObject: pointer to a preallocated tdstBezierObject
ucSamplingRate: New sampling rate
Output: return value is true if sampling rate could be modified,
false if not.
Author: Yann Le Tensorer
Date: 5 february 1997
Revision:
Note: The sampling rate can only be modified for objects that have been
created using C_ucModeNoObject at their creation.
================================================================================*/
ACP_tdxBool fn_bBezierObject_SetSamplingRate(tdstBezierObject *p_BezierObject,
unsigned char ucSamplingRate)
{
if (p_BezierObject==0) return FALSE;
if (p_BezierObject->ucObjectMode==C_ucModeNoObject)
{
/* copies new sampling rate value into objects parameters */
p_BezierObject->ucSamplingRate =ucSamplingRate;
if (p_BezierObject->ucSamplingRate<2) p_BezierObject->ucSamplingRate=2;
/* free old list of points and allocates new one */
if (p_BezierObject->d_stListOfPoints!=0)
M_free(p_BezierObject->d_stListOfPoints);
M_malloc ( p_BezierObject->d_stListOfPoints,
MTH3D_tdstVector*,
(p_BezierObject->ucSamplingRate+1)*sizeof(MTH3D_tdstVector)
);
/* calculate points of bezier curve */
fn_vBezierObject_Calculate(p_BezierObject);
/* checks if dynamic parameters are attached to the object
if yes, changes them to match the new sampling rate */
fn_vDynamicObject_ChangeSamplingRate(p_BezierObject->p_stDynaParams,
p_BezierObject->ucSamplingRate);
return TRUE;
}
else
return FALSE;
}
/*==========================================================
Function name: fn_vBezierObject_Free
Description: Free memory allocated by the bezier objet
Input: p_BezierObject: pointer to a tdstBezierObject
Output: none
Author: Yann Le Tensorer
Date: 29 january 1997
Revision:
==========================================================*/
void fn_vBezierObject_Free(tdstBezierObject *p_BezierObject)
{
if (p_BezierObject!=0)
{
if (p_BezierObject->d_stListOfPoints!=0)
M_free(p_BezierObject->d_stListOfPoints);
/* if dynamic parameters are present, free memory too */
if (p_BezierObject->p_stDynaParams!=0)
fn_vDynamicObject_Free(p_BezierObject->p_stDynaParams);
}
}
/*==========================================================
Function name: fn_vBezierObject_Calculate
Description: Calculates the points of the b<>zier curve according to the
parameters specified when creating the object.
Input: p_BezierObject: Pointer to a pre-created bezier object
Output: none
Author: Yann Le Tensorer
Date: 23 january 1997
Revision:
==========================================================*/
void fn_vBezierObject_Calculate(tdstBezierObject *p_BezierObject)
{
double xt,endxt,t,c0,c1,c2,c3,c4,c5,c6;
MTH3D_tdstVector A,B,T1,T2;
MTH3D_tdstVector *p_stPointList;
if (p_BezierObject==0) return; /* avoid crash */
if (p_BezierObject->ucObjectMode==C_ucModeRealObject)
p_stPointList=((p_BezierObject->hObject) -> d_stListOfPoints);
else
p_stPointList=(p_BezierObject->d_stListOfPoints);
A = p_BezierObject->stStartPoint;
B = p_BezierObject->stEndPoint;
MTH3D_M_vAddVector(&T1,&p_BezierObject->stStartVector,&p_BezierObject->stStartPoint);
MTH3D_M_vAddVector(&T2,&p_BezierObject->stEndVector,&p_BezierObject->stEndPoint);
endxt= p_BezierObject->ucSamplingRate;
for (xt=0;xt<=endxt;xt++)
{
t=xt/endxt;
c0=1-t; /* 1-t */
c2=c0*c0; /* (1-t)^2 */
c1=3*t*c2; /* 3t*((1-t)^2) */
c3=t*t; /* t^2 */
c4=3*c3*c0; /* 3t^2*(1-t) */
c5=c0*c2; /* (1-t)^3 */
c6=c3*t; /* t^3 */
p_stPointList->xX=(c5*A.xX)+(c1*T1.xX)+(c4*T2.xX)+(c6*B.xX);
p_stPointList->xY=(c5*A.xY)+(c1*T1.xY)+(c4*T2.xY)+(c6*B.xY);
p_stPointList->xZ=(c5*A.xZ)+(c1*T1.xZ)+(c4*T2.xZ)+(c6*B.xZ);
p_stPointList++;
}
}
/*==========================================================
Function name: fn_vBezierObject_SetColor
Description: Set the color of a bezier object.
Input: p_BezierObject: pointer to a pre-created tdstBezierObject
color: 24 bit color of object. (0->7=B; 8->15=G; 16->23=R ; 24->32=Unused)
Output: none
Author: Yann Le Tensorer
Date: 24 january 1997
Revision:
==========================================================*/
void fn_vBezierObject_SetColor(tdstBezierObject *p_BezierObject,long color)
{
if (p_BezierObject==0) return; /* avoid crash */
p_BezierObject->color=color;
}
/*==========================================================
Function name: fn_vBezierObject_SetViewPortAttributes
Description: Set the viewportattributes for drawing.
Input: p_BezierObject: pointer to a pre-created tdstBezierObject
p_ViewPortAttributes: pointer to pre-defined viewport attributes
Output: none
Author: Yann Le Tensorer
Date: 24 january 1997
Revision:
==========================================================*/
void fn_vBezierObject_SetViewPortAttributes(tdstBezierObject *p_BezierObject,GLD_tdstViewportAttributes *p_ViewPortAttributes)
{
if (p_BezierObject==0) return; /* avoid crash */
p_BezierObject->p_ViewPortAttributes=p_ViewPortAttributes;
}
/*==========================================================
Function name: fn_vBezierObject_Draw
Description: Draw Bezier object on screen
Input: p_BezierObject: pointer to a pre-created tdstBezierObject
Output: none
Author: Yann Le Tensorer
Date: 24 january 1997
Revision:
==========================================================*/
void fn_vBezierObject_Draw(tdstBezierObject *p_BezierObject)
{
POS_tdstCompletePosition stMatrix;
GEO_tdstColor ColBidon;
MTH3D_tdstVector *p_stPointList;
MTH3D_tdstVector *p_stPointListEnd;
POS_fn_vSetIdentityMatrix(&stMatrix);
if (p_BezierObject==0) return; /* avoid crash */
/*unsigned long color; */
ColBidon.xR=(float)0.5;
ColBidon.xG=(float)0.5;
ColBidon.xB=(float)0.5;
ColBidon.xA=(float)0.5;
if (p_BezierObject->ucObjectMode==C_ucModeRealObject)
p_stPointList=((p_BezierObject->hObject) -> d_stListOfPoints);
else
p_stPointList=(p_BezierObject->d_stListOfPoints);
if (p_stPointList==0) return;
GLI_xGetCameraMatrix(((GLI_tdstSpecificAttributesFor3D*)((p_BezierObject->p_ViewPortAttributes)->p_vSpecificToXD))->p_stCam,&stMatrix);
GLI_xLoadMatrix(&stMatrix);
GLI_vSetFog(100,100,&ColBidon);
p_stPointListEnd=p_stPointList+p_BezierObject->ucSamplingRate;
for (;p_stPointList<p_stPointListEnd;p_stPointList++)
{
GLI_xDraw3DLine16(
(struct GLD_tdstViewportAttributes_*)(p_BezierObject->p_ViewPortAttributes),
p_stPointList,
p_stPointList+1,
p_BezierObject->color);
}
GLI_xPopMatrix();
}
/*==========================================================
Function name: fn_vBezierObject_ChangeParams
Description: Changes the parameters of a bezier objet and recalculates the coordinates
of the points.
Input: p_BezierObject: Pointer to a pre-created bezier object
p_stStartPoint: Pointer to the start point
p_stEndPoint: Pointer to the end Point
p_stStartVector:Pointer to the start vector
p_stEndVector: Pointer to the end vector
Output: none
Author: Yann Le Tensorer
Date: 28 january 1997
Revision:
Notes: If an input parameter is 0, this parameter is simply not
affected. This enables to change easily only one parameter
==========================================================*/
void fn_vBezierObject_ChangeParams(tdstBezierObject *p_BezierObject,
MTH3D_tdstVector* p_stStartPoint,
MTH3D_tdstVector* p_stEndPoint,
MTH3D_tdstVector* p_stStartVector,
MTH3D_tdstVector* p_stEndVector)
{
if (p_BezierObject==0) return; /* avoid crash */
/* copies input parameters into objects parameters */
if (p_stStartPoint!=0) p_BezierObject->stStartPoint =*p_stStartPoint;
if (p_stEndPoint!=0) p_BezierObject->stEndPoint =*p_stEndPoint;
if (p_stStartVector!=0) p_BezierObject->stStartVector =*p_stStartVector;
if (p_stEndVector!=0) p_BezierObject->stEndVector =*p_stEndVector;
fn_vBezierObject_Calculate(p_BezierObject);
}
/*==========================================================
Function name: fn_xBezierObject_GetSpeed
Description: returns the speed at a given sample (n<> of the point) of a bezier object
Input: p_stDynaParam: pointer to a pre-created tdstDynaParam structure
ucSampleNo: n<> of the point to get the speed from.
Output: return value is the speed.
Author: Yann Le Tensorer
Date: 03 february 1997
Revision:
==========================================================*/
MTH_tdxReal fn_xBezierObject_GetSpeed(tdstBezierObject *p_BezierObject,unsigned char ucSampleNo)
{
if (p_BezierObject==0) return 0;
return fn_xDynamicObject_GetSpeed(p_BezierObject->p_stDynaParams,ucSampleNo);
}
/*==========================================================
Function name: fn_vBezierObject_GetPoint
Description: returns the coordinates in the global rep<65>re of the point at a
given sample (n<> of the point) of a bezier object.
Input: p_stDynaParam: pointer to a pre-created tdstDynaParam structure
ucSampleNo: n<> of the point to get the coordinates from.
p_ReturnVector: pointer to a vector to be returned.
Output: *p_ReturnVector is a vector countaining the.coordinates of the point.
Author: Yann Le Tensorer
Date: 03 february 1997
Revision:
==========================================================*/
void fn_vBezierObject_GetPoint(tdstBezierObject *p_BezierObject,unsigned char ucSampleNo,MTH3D_tdstVector* p_ReturnVector)
{
MTH3D_tdstVector *p_stPointList;
if (p_BezierObject==0) return;
if (p_BezierObject->ucObjectMode==C_ucModeRealObject)
p_stPointList=((p_BezierObject->hObject) -> d_stListOfPoints);
else
p_stPointList=(p_BezierObject->d_stListOfPoints);
if (p_stPointList!=0)
*p_ReturnVector=p_stPointList[ucSampleNo];
}
/*==========================================================
Function name: fn_vBezierObject_GetParams
Description: Gets the parameters of a bezier objet
Input: p_BezierObject: Pointer to a pre-created bezier object
p_stStartPoint: Pointer to the start point
p_stEndPoint: Pointer to the end Point
p_stStartVector:Pointer to the start vector
p_stEndVector: Pointer to the end vector
Output: *p_stStartPoint:start point
*p_stEndPoint: end Point
*p_stStartVectorstart vector
*p_stEndVector: end vector
Author: Yann Le Tensorer
Date: 4 february 1997
Revision:
Notes: If an input pointer is null, this parameter is simply not
affected.
==========================================================*/
void fn_vBezierObject_GetParams(tdstBezierObject *p_BezierObject,
MTH3D_tdstVector* p_stStartPoint,
MTH3D_tdstVector* p_stEndPoint,
MTH3D_tdstVector* p_stStartVector,
MTH3D_tdstVector* p_stEndVector)
{
if (p_BezierObject==0) return; /* avoid crash */
if (p_stStartPoint!=0) *p_stStartPoint = p_BezierObject->stStartPoint;
if (p_stEndPoint!=0) *p_stEndPoint = p_BezierObject->stEndPoint;
if (p_stEndVector!=0) *p_stEndVector = p_BezierObject->stEndVector;
if (p_stStartVector!=0) *p_stStartVector= p_BezierObject->stStartVector;
}
/*==========================================================
Function name: fn_ucBezierObject_GetSamplingRate
Description: Gets the sampling rate of a BezierObject objet
Input: p_BezierObject: Pointer to a pre-created Bezier object
Output: return value is the sampling rate of the circle arc object
Author: Yann Le Tensorer
Date: 5 february 1997
Revision:
==========================================================*/
unsigned char fn_ucBezierObject_GetSamplingRate(tdstBezierObject *p_BezierObject)
{
if (p_BezierObject==0)
return 0;
else
return p_BezierObject->ucSamplingRate;
}

View File

@@ -0,0 +1,696 @@
/*=========================================================================================
File: CirclWay.c
Prupose: Handle a CircleArc curve
Author: Yann Le Tensorer
Creation Date: 3 february 1997
Version: 1.1
Revision:
===========================================================================================
Revisions: Version Date Author
----------------------------------------------------------------
1.1 6 february 1997 Yann Le Tensorer
Added function "fn_vCircle_FindCenter"
=========================================================================================*/
/*==========================================================
Notes:
This module implements functions to create and draw CircleArc curves
here is an example how to use it:
{
tdstCircleArcObject CircleArcCurve;
long color;
MTH3D_tdstVector A,B,O;
ACP_tdstDynaParam stDynaParam;
unsigned char ucSamplingRate;
color=0xffffffff; // white
O.xX=0;
O.xY=0;
O.xZ=0
A.xX=0;
A.xY=1;
A.xZ=0;
B.xX=-1;
B.xY=0;
B.xZ=0;
ucSamplingRate=20; // Sampling rate
fn_vDynamicObject_Create(&stDynaParam,ucSamplingRate,C_ucSinus,0,MTH_C_Pi,255);
fn_vCircleArcObject_Create(&CircleArcCurve,ucSamplingRate,&A,&B,&O,C_ucModeNoObject,&stDynaParam);
fn_vCircleArcObject_SetColor(&CircleArcCurve,color);
fn_vCircleArcObject_SetViewPortAttributes(...); // en fonction du viewport
fn_vCircleArcObject_Draw(&CircleArcCurve);
fn_vCircleArcObject_Free(&CircleArcCurve);
}
===========================================================*/
#ifdef _AI_LIB_
#include "AIUseCPA.h"
/*#include "acp_base.h"*/
/*#include "gli.h"*/
#include "geoobj.h"
#include "circlway.h"
#include "IAOption.h"
#include "IAMacros.h"
/* AI memory and error management */
#include "MemIA.h"
#include "ErrIA.h"
#else /*_AI_LIB_*/
#include "acp_base.h"
#include "gli.h"
#include "geoobj.h"
#include "circlway.h"
#endif /*_AI_LIB_*/
/*============================================================
Memory management macros, to be replaced with correct memory management
============================================================*/
#ifdef _AI_LIB_
#define M_malloc(pointer,cast,size) M_IAAlloc(pointer,cast,size)
#define M_free(pointer) M_IAFree(pointer)
#else /*_AI_LIB_*/
#define M_malloc(pointer,cast,size) (pointer=(cast)malloc(size))
#define M_free(pointer) (free(pointer))
#endif /*_AI_LIB_*/
/*==========================================================
Function name: fn_vCircleArcObject_Create
Description: Create CircleArc curve (in ram only) between two points
Input: p_CircleArcObject: pointer to a preallocated tdstCircleArcObject
ucSamplingRate: number of segment to define the curve)
p_stStartPoint: pointer to the first vertex of the curve (in global repere)
p_stEndPoint: pointer to the last vertex of the curve (in global repere)
p_stCenter: pointer to the center of the circle (in global repere)
ucObjectMode: Creation mode (C_ucModeNoObject ou C_ucModeRealObject)
C_ucModeNoObject does not create a geometric object
whereas C_ucModeRealObject does.
Output: none
Author: Yann Le Tensorer
Date: 4 february 1997
Revision:
==========================================================*/
void fn_vCircleArcObject_Create( tdstCircleArcObject *p_CircleArcObject,
unsigned char ucSamplingRate,
MTH3D_tdstVector* p_stStartPoint,
MTH3D_tdstVector* p_stEndPoint,
MTH3D_tdstVector* p_stCenter,
unsigned char ucObjectMode,
ACP_tdstDynaParam* p_stDynaParams
)
{
GEO_tdstDoubledIndex xLineDoubleIndex;
MTH3D_tdstVector TmpVector,TmpVector2,OA,OB,UnitOA,UnitOB;
MTH_tdxReal DotProduct;
long xCurVertex;
if (p_CircleArcObject==0) return; /* avoid crash */
/* copies input parameters into objects parameters */
p_CircleArcObject->ucObjectMode =ucObjectMode;
p_CircleArcObject->ucSamplingRate =ucSamplingRate;
p_CircleArcObject->stStartPoint =*p_stStartPoint;
p_CircleArcObject->stEndPoint =*p_stEndPoint;
p_CircleArcObject->stCenter =*p_stCenter;
p_CircleArcObject->p_stDynaParams =p_stDynaParams;
/* calculate OA and OB */
MTH3D_M_vSubVector(&OA,&p_CircleArcObject->stStartPoint,&p_CircleArcObject->stCenter);
MTH3D_M_vSubVector(&OB,&p_CircleArcObject->stEndPoint,&p_CircleArcObject->stCenter);
/*=====================================
calculates the local repere of the plan
=====================================*/
MTH3D_M_vNormalizeVector(&UnitOA,&OA);
MTH3D_M_vNormalizeVector(&UnitOB,&OB);
/* X axis = OA */
p_CircleArcObject->stLocalRepere.stCol_0=UnitOA;
/* Z axis = (OA^OB) */
MTH3D_M_vCrossProductVector(&TmpVector,&UnitOA,&UnitOB);
MTH3D_M_vNormalizeVector(&TmpVector,&TmpVector);
p_CircleArcObject->stLocalRepere.stCol_2=TmpVector;
/* Y axis = (OA^OB)^OA*/
MTH3D_M_vCrossProductVector(&TmpVector2,&TmpVector,&UnitOA);
MTH3D_M_vNormalizeVector(&TmpVector2,&TmpVector2);
p_CircleArcObject->stLocalRepere.stCol_1 = TmpVector2;
// MTH3D_M_vCrossProductVector(&p_CircleArcObject->stLocalRepere.stCol_1,&TmpVector,&UnitOA);
/*==================================================
Calculates inverse of local repere matrix
===================================================*/
MTH3D_M_vInverMatrix(&p_CircleArcObject->stInvLocalRepere,&p_CircleArcObject->stLocalRepere);
/*==================================================
calculates start and end coordinates in local repere
Xlocal(A)=inv(M)*(OA)
Xlocal(B)=inv(M)*(OB)
==================================================*/
fn_vCircleArcObject_GlobalToLocal( p_CircleArcObject,
&p_CircleArcObject->stLocalStartPoint,
&p_CircleArcObject->stStartPoint);
fn_vCircleArcObject_GlobalToLocal( p_CircleArcObject,
&p_CircleArcObject->stLocalEndPoint,
&p_CircleArcObject->stEndPoint);
/*==================================================
Calculates angle (OA,OB)
===================================================*/
DotProduct=MTH3D_M_xDotProductVector(&UnitOA,&UnitOB);
p_CircleArcObject->xMainAngle=MTH_M_xACos(DotProduct);
/* if mode is MODE_NO_OBJECT, allocates ram only for points list and dynamic parameters */
if (ucObjectMode==C_ucModeNoObject)
{
M_malloc ( p_CircleArcObject->d_stListOfPoints,
MTH3D_tdstVector*,
(ucSamplingRate+1)*sizeof(MTH3D_tdstVector)
);
}
else
/* else mode is MODE_REAL_OBJET, creates the geometric object*/
{
/* This list of points is not used */
p_CircleArcObject->d_stListOfPoints=0;
/* create object with 1 element (lines only), and ucSamplingRate+1 points) */
GEO_vCreateGeometricObject(&p_CircleArcObject->hObject,ucSamplingRate+1,1);
/* create line element*/
GEO_xCreateElementLines(p_CircleArcObject->hObject,&p_CircleArcObject->hElement,ucSamplingRate);
/* create lines indexes */
for (xCurVertex=0;xCurVertex<ucSamplingRate;xCurVertex++)
{
/* define start and end vertex of a line */
xLineDoubleIndex.a2_xIndex[0]=xCurVertex;
xLineDoubleIndex.a2_xIndex[1]=xCurVertex+1;
/* set line index */
GEO_xSetIndexOfElementLines(p_CircleArcObject->hObject,p_CircleArcObject->hElement,xCurVertex,&xLineDoubleIndex);
}
}
/* calculate points of CircleArc curve */
fn_vCircleArcObject_Calculate(p_CircleArcObject);
}
/*==========================================================
Function name: fn_vCircleArcObject_Free
Description: Free memory allocated by the CircleArc objet
Input: p_CircleArcObject: pointer to a tdstCircleArcObject
Output: none
Author: Yann Le Tensorer
Date: 29 january 1997
Revision:
==========================================================*/
void fn_vCircleArcObject_Free(tdstCircleArcObject *p_CircleArcObject)
{
if (p_CircleArcObject!=0)
{
if (p_CircleArcObject->d_stListOfPoints!=0)
M_free(p_CircleArcObject->d_stListOfPoints);
/* if dynamic parameters are present, free memory too */
if (p_CircleArcObject->p_stDynaParams!=0)
fn_vDynamicObject_Free(p_CircleArcObject->p_stDynaParams);
}
}
/*==========================================================
Function name: fn_vCircleArcObject_Calculate
Description: Calculates the points of the b<>zier curve according to the
parameters specified when creating the object.
Input: p_CircleArcObject: Pointer to a pre-created CircleArc object
Output: none
Author: Yann Le Tensorer
Date: 5 february 1997
Revision:
==========================================================*/
void fn_vCircleArcObject_Calculate(tdstCircleArcObject *p_CircleArcObject)
{
MTH_tdxReal xCurAngle,xDeltaAngle,xRayon;
MTH3D_tdstVector A,B,LocalCurPoint,OA;
MTH3D_tdstVector *p_stPointList;
int i;
if (p_CircleArcObject==0) return; /* avoid crash */
if (p_CircleArcObject->ucObjectMode==C_ucModeRealObject)
p_stPointList=((p_CircleArcObject->hObject) -> d_stListOfPoints);
else
p_stPointList=(p_CircleArcObject->d_stListOfPoints);
/* Calculates rayon of circle */
MTH3D_M_vSubVector(&OA,&p_CircleArcObject->stStartPoint,&p_CircleArcObject->stCenter);
xRayon=MTH3D_M_xNormVector(&OA);
A = p_CircleArcObject->stLocalStartPoint;
B = p_CircleArcObject->stLocalEndPoint;
xDeltaAngle=p_CircleArcObject->xMainAngle/p_CircleArcObject->ucSamplingRate;
for (i=0,xCurAngle=0;i<=p_CircleArcObject->ucSamplingRate;i++,xCurAngle+=xDeltaAngle)
{
LocalCurPoint.xX=MTH_M_xCos(xCurAngle)*xRayon;
LocalCurPoint.xY=MTH_M_xSin(xCurAngle)*xRayon;
LocalCurPoint.xZ=0;
fn_vCircleArcObject_LocalToGlobal(p_CircleArcObject,p_stPointList,&LocalCurPoint);
p_stPointList++;
}
}
/*==========================================================
Function name: fn_vCircleArcObject_SetColor
Description: Set the color of a CircleArc object.
Input: p_CircleArcObject: pointer to a pre-created tdstCircleArcObject
color: 24 bit color of object. (0->7=B; 8->15=G; 16->23=R ; 24->32=Unused)
Output: none
Author: Yann Le Tensorer
Date: 24 january 1997
Revision:
==========================================================*/
void fn_vCircleArcObject_SetColor(tdstCircleArcObject *p_CircleArcObject,long color)
{
if (p_CircleArcObject==0) return; /* avoid crash */
p_CircleArcObject->color=color;
}
/*==========================================================
Function name: fn_vCircleArcObject_SetViewPortAttributes
Description: Set the viewportattributes for drawing.
Input: p_CircleArcObject: pointer to a pre-created tdstCircleArcObject
p_ViewPortAttributes: pointer to pre-defined viewport attributes
Output: none
Author: Yann Le Tensorer
Date: 24 january 1997
Revision:
==========================================================*/
void fn_vCircleArcObject_SetViewPortAttributes(tdstCircleArcObject *p_CircleArcObject,GLD_tdstViewportAttributes *p_ViewPortAttributes)
{
if (p_CircleArcObject==0) return; /* avoid crash */
p_CircleArcObject->p_ViewPortAttributes=p_ViewPortAttributes;
}
/*==========================================================
Function name: fn_vCircleArcObject_Draw
Description: Draw CircleArc object on screen
Input: p_CircleArcObject: pointer to a pre-created tdstCircleArcObject
Output: none
Author: Yann Le Tensorer
Date: 24 january 1997
Revision:
==========================================================*/
void fn_vCircleArcObject_Draw(tdstCircleArcObject *p_CircleArcObject)
{
POS_tdstCompletePosition stMatrix;
GEO_tdstColor ColBidon;
MTH3D_tdstVector *p_stPointList;
MTH3D_tdstVector *p_stPointListEnd;
POS_fn_vSetIdentityMatrix(&stMatrix);
if (p_CircleArcObject==0) return; /* avoid crash */
/*unsigned long color; */
ColBidon.xR=(float)0.5;
ColBidon.xG=(float)0.5;
ColBidon.xB=(float)0.5;
ColBidon.xA=(float)0.5;
if (p_CircleArcObject->ucObjectMode==C_ucModeRealObject)
p_stPointList=((p_CircleArcObject->hObject) -> d_stListOfPoints);
else
p_stPointList=(p_CircleArcObject->d_stListOfPoints);
if (p_stPointList==0) return;
GLI_xGetCameraMatrix(((GLI_tdstSpecificAttributesFor3D*)((p_CircleArcObject->p_ViewPortAttributes)->p_vSpecificToXD))->p_stCam,&stMatrix);
GLI_xLoadMatrix(&stMatrix);
GLI_vSetFog(100,100,&ColBidon);
p_stPointListEnd=p_stPointList+p_CircleArcObject->ucSamplingRate;
for (;p_stPointList<p_stPointListEnd;p_stPointList++)
{
GLI_xDraw3DLine16(
(struct GLD_tdstViewportAttributes_*)(p_CircleArcObject->p_ViewPortAttributes),
p_stPointList,
p_stPointList+1,
p_CircleArcObject->color);
}
GLI_xPopMatrix();
}
/*==========================================================
Function name: fn_vCircleArcObject_ChangeParams
Description: Changes the parameters of a CircleArc objet and recalculates the coordinates
of the points.
Input: p_CircleArcObject: Pointer to a pre-created CircleArc object
p_stStartPoint: Pointer to the start point
p_stEndPoint: Pointer to the end Point
p_stCenter: Pointer to the center of the circle
Output: none
Author: Yann Le Tensorer
Date: 6 february 1997
Revision:
Notes: If an input parameter is 0, this parameter is simply not
affected. This enables to change easily only one parameter
==========================================================*/
void fn_vCircleArcObject_ChangeParams(tdstCircleArcObject *p_CircleArcObject,
MTH3D_tdstVector* p_stStartPoint,
MTH3D_tdstVector* p_stEndPoint,
MTH3D_tdstVector* p_stCenter)
{
MTH3D_tdstVector TmpVector,TmpVector2,OA,OB,UnitOA,UnitOB;
MTH_tdxReal DotProduct;
if (p_CircleArcObject==0) return; /* avoid crash */
/* copies input parameters into objects parameters */
if (p_stStartPoint!=0) p_CircleArcObject->stStartPoint =*p_stStartPoint;
if (p_stEndPoint!=0) p_CircleArcObject->stEndPoint =*p_stEndPoint;
if (p_stCenter!=0) p_CircleArcObject->stCenter =*p_stCenter;
/* calculate OA and OB */
MTH3D_M_vSubVector(&OA,&p_CircleArcObject->stStartPoint,&p_CircleArcObject->stCenter);
MTH3D_M_vSubVector(&OB,&p_CircleArcObject->stEndPoint,&p_CircleArcObject->stCenter);
/*=====================================
calculates the local repere of the plan
=====================================*/
MTH3D_M_vNormalizeVector(&UnitOA,&OA);
MTH3D_M_vNormalizeVector(&UnitOB,&OB);
/* X axis = OA */
p_CircleArcObject->stLocalRepere.stCol_0=UnitOA;
/* Z axis = (OA^OB) */
MTH3D_M_vCrossProductVector(&TmpVector,&UnitOA,&UnitOB);
MTH3D_M_vNormalizeVector(&TmpVector,&TmpVector);
p_CircleArcObject->stLocalRepere.stCol_2=TmpVector;
/* Y axis = (OA^OB)^OA*/
MTH3D_M_vCrossProductVector(&TmpVector2,&TmpVector,&UnitOA);
MTH3D_M_vNormalizeVector(&TmpVector2,&TmpVector2);
p_CircleArcObject->stLocalRepere.stCol_1 = TmpVector2;
// MTH3D_M_vCrossProductVector(&p_CircleArcObject->stLocalRepere.stCol_1,&TmpVector,&UnitOA);
/*==================================================
Calculates inverse of local repere matrix
===================================================*/
MTH3D_M_vInverMatrix(&p_CircleArcObject->stInvLocalRepere,&p_CircleArcObject->stLocalRepere);
/*==================================================
calculates start and end coordinates in local repere
Xlocal(A)=inv(M)*(OA)
Xlocal(B)=inv(M)*(OB)
==================================================*/
fn_vCircleArcObject_GlobalToLocal( p_CircleArcObject,
&p_CircleArcObject->stLocalStartPoint,
&p_CircleArcObject->stStartPoint);
fn_vCircleArcObject_GlobalToLocal( p_CircleArcObject,
&p_CircleArcObject->stLocalEndPoint,
&p_CircleArcObject->stEndPoint);
/*==================================================
Calculates angle (OA,OB)
===================================================*/
DotProduct=MTH3D_M_xDotProductVector(&UnitOA,&UnitOB);
p_CircleArcObject->xMainAngle=MTH_M_xACos(DotProduct);
fn_vCircleArcObject_Calculate(p_CircleArcObject);
}
/*==========================================================
Function name: fn_xCircleArcObject_GetSpeed
Description: returns the speed at a given sample (n<> of the point) of a CircleArc object
Input: p_stDynaParam: pointer to a pre-created tdstDynaParam structure
ucSampleNo: n<> of the point to get the speed from.
Output: return value is the speed.
Author: Yann Le Tensorer
Date: 03 february 1997
Revision:
==========================================================*/
MTH_tdxReal fn_xCircleArcObject_GetSpeed(tdstCircleArcObject *p_CircleArcObject,unsigned char ucSampleNo)
{
if (p_CircleArcObject==0) return 0;
return fn_xDynamicObject_GetSpeed(p_CircleArcObject->p_stDynaParams,ucSampleNo);
}
/*==========================================================
Function name: fn_vCircleArcObject_GetPoint
Description: returns the coordinates in the global rep<65>re of the point at a
given sample (n<> of the point) of a CircleArc object.
Input: p_stDynaParam: pointer to a pre-created tdstDynaParam structure
ucSampleNo: n<> of the point to get the coordinates from.
p_ReturnVector: pointer to a vector to be returned.
Output: *p_ReturnVector is a vector countaining the.coordinates of the point.
Author: Yann Le Tensorer
Date: 03 february 1997
Revision:
==========================================================*/
void fn_vCircleArcObject_GetPoint(tdstCircleArcObject *p_CircleArcObject,unsigned char ucSampleNo,MTH3D_tdstVector* p_ReturnVector)
{
MTH3D_tdstVector *p_stPointList;
if (p_CircleArcObject==0) return;
if (p_CircleArcObject->ucObjectMode==C_ucModeRealObject)
p_stPointList=((p_CircleArcObject->hObject) -> d_stListOfPoints);
else
p_stPointList=(p_CircleArcObject->d_stListOfPoints);
if (p_stPointList!=0)
*p_ReturnVector=p_stPointList[ucSampleNo];
}
/*==========================================================
Function name: fn_vCircleArcObject_GlobalToLocal
Description: Changes coordinates of a point from global coordinates to local.
Input: p_CircleArcObject: pointer to the circle arc object
p_stDestVector: pointer to the destination vector
p_stSourceVector: pointer to the source vector
Output: *p_stDestVector is a vector countaining the.coordinates in the local
repere of the plan.
Author: Yann Le Tensorer
Date: 4 february 1997
Revision:
==========================================================*/
void fn_vCircleArcObject_GlobalToLocal( tdstCircleArcObject *p_CircleArcObject,
MTH3D_tdstVector *p_stDestVector,
MTH3D_tdstVector *p_stSourceVector)
{
MTH3D_M_vSubVector( &p_CircleArcObject->stTmpVector0,
p_stSourceVector,
&p_CircleArcObject->stCenter);
MTH3D_M_vMulMatrixVector( p_stDestVector,
&p_CircleArcObject->stInvLocalRepere,
&p_CircleArcObject->stTmpVector0);
}
/*==========================================================
Function name: fn_vCircleArcObject_LocalToGlobal
Description: Changes coordinates of a point from local coordinates to global
Input: p_CircleArcObject: pointer to the circle arc object
p_stDestVector: pointer to the destination vector
p_stSourceVector: pointer to the source vector
Output: *p_stDestVector is a vector countaining the.coordinates in the global
repere of the plan.
Author: Yann Le Tensorer
Date: 4 february 1997
Revision:
==========================================================*/
void fn_vCircleArcObject_LocalToGlobal( tdstCircleArcObject *p_CircleArcObject,
MTH3D_tdstVector *p_stDestVector,
MTH3D_tdstVector *p_stSourceVector)
{
MTH3D_M_vMulMatrixVector( p_stDestVector,
&p_CircleArcObject->stLocalRepere,
p_stSourceVector);
MTH3D_M_vAddVector( p_stDestVector,
p_stDestVector,
&p_CircleArcObject->stCenter);
}
/*==========================================================
Function name: fn_ucCircleArcObject_GetSamplingRate
Description: Gets the sampling rate of a CircleArcObject objet
Input: p_CircleArcObject: Pointer to a pre-created CircleArc object
Output: return value is the sampling rate of the circle arc object
Author: Yann Le Tensorer
Date: 5 february 1997
Revision:
==========================================================*/
unsigned char fn_ucCircleArcObject_GetSamplingRate(tdstCircleArcObject *p_CircleArcObject)
{
if (p_CircleArcObject==0)
return 0;
else
return p_CircleArcObject->ucSamplingRate;
}
/*===============================================================================
Function name: fn_bCircleArcObject_SetSamplingRate
Description: Modifies the sampling rate of a CircleArc object, and changes all
the depending parameters (including dynamic sampling rate)
Input: p_CircleArcObject: pointer to a preallocated tdstCircleArcObject
ucSamplingRate: New sampling rate
Output: return value is true if sampling rate could be modified,
false if not.
Author: Yann Le Tensorer
Date: 5 february 1997
Revision:
Note: The sampling rate can only be modified for objects that have been
created using C_ucModeNoObject at their creation.
================================================================================*/
ACP_tdxBool fn_bCircleArcObject_SetSamplingRate(tdstCircleArcObject *p_CircleArcObject,
unsigned char ucSamplingRate)
{
if (p_CircleArcObject==0) return FALSE;
if (p_CircleArcObject->ucObjectMode==C_ucModeNoObject)
{
/* copies new sampling rate value into objects parameters */
p_CircleArcObject->ucSamplingRate =ucSamplingRate;
if (p_CircleArcObject->ucSamplingRate<2) p_CircleArcObject->ucSamplingRate=2;
/* free old list of points and allocates new one */
if (p_CircleArcObject->d_stListOfPoints!=0)
M_free(p_CircleArcObject->d_stListOfPoints);
M_malloc ( p_CircleArcObject->d_stListOfPoints,
MTH3D_tdstVector*,
(p_CircleArcObject->ucSamplingRate+1)*sizeof(MTH3D_tdstVector)
);
/* calculate points of CircleArc curve */
fn_vCircleArcObject_Calculate(p_CircleArcObject);
/* checks if dynamic parameters are attached to the object
if yes, changes them to match the new sampling rate */
fn_vDynamicObject_ChangeSamplingRate(p_CircleArcObject->p_stDynaParams,
p_CircleArcObject->ucSamplingRate);
return TRUE;
}
else
return FALSE;
}
/*==========================================================
Function name: fn_vCircle_FindCenter
Description: Finds the 3D coordinate of the center of the circle on which are 3 points.
Input: p_FirstPoint: pointer to the first point
p_SecondPoint: pointer to the second point
p_ThirdPoint: pointer to the third point
p_ReturnCenter: pointer to a point to be returned.
Output: *p_ReturnCenter is a vector countaining the.coordinates of the center.
Author: Yann Le Tensorer
Date: 6 february 1997
Revision:
NOTE: The 3 points must have a z coordinate equal to zero! (In fact, the points must be
given in a local repere of the plan in which is the circle, where the x and y
axis define the plan) The Center of the screen is given in the local repere
of this plan, so with a zero coordinate too.
==========================================================*/
void fn_vCircle_FindCenter( MTH3D_tdstVector *p_FirstPoint,
MTH3D_tdstVector *p_SecondPoint,
MTH3D_tdstVector *p_ThirdPoint,
MTH3D_tdstVector *p_ReturnCenter)
{
MTH_tdxReal xa,xb,xc,ya,yb,yc,xm,xn,ym,yn,a,b,c,d,alpha,beta;
/* see technical notes of ways and waypoints specifications (ref.003ST037)
for explanations...*/
xa=p_FirstPoint->xX;
ya=p_FirstPoint->xY;
xb=p_SecondPoint->xX;
yb=p_SecondPoint->xY;
xc=p_ThirdPoint->xX;
yc=p_ThirdPoint->xY;
xm=MTH_M_xMul(MTH_M_xAdd(xa,xc),MTH_C_Inv2);
ym=MTH_M_xMul(MTH_M_xAdd(ya,yc),MTH_C_Inv2);
xn=MTH_M_xMul(MTH_M_xAdd(xb,xc),MTH_C_Inv2);
yn=MTH_M_xMul(MTH_M_xAdd(yb,yc),MTH_C_Inv2);
a=MTH_M_xSub(xm,xa);
b=MTH_M_xSub(ym,ya);
c=MTH_M_xSub(xn,xb);
d=MTH_M_xSub(yn,yb);
alpha=MTH_M_xAdd(MTH_M_xMul(a,xm),MTH_M_xMul(b,ym));
beta= MTH_M_xAdd(MTH_M_xMul(c,xn),MTH_M_xMul(d,yn));
p_ReturnCenter->xX=MTH_M_xDiv(
MTH_M_xSub(MTH_M_xMul(beta,b),MTH_M_xMul(alpha,d)),
MTH_M_xSub(MTH_M_xMul(b,c),MTH_M_xMul(a,d))
);
p_ReturnCenter->xY=MTH_M_xDiv(
MTH_M_xSub(MTH_M_xMul(alpha,c),MTH_M_xMul(beta,a)),
MTH_M_xSub(MTH_M_xMul(b,c),MTH_M_xMul(a,d))
);
p_ReturnCenter->xZ=MTH_C_ZERO;
}

View File

@@ -0,0 +1,232 @@
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : CurObj.cpp
//
// Definition of the cursor object
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// inherit from : CPA_Object
// CPA_EdMot<ACP_tdxHandleOfLink>
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 5 feb 1997 Author: J Th<54>noz
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
//
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
*/
#include "stdafx.h"
#include "acp_base.h"
#include "incitf.h"
#include "incgam.h"
#include "incai.h"
#include "WPObj.hpp"
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
#include "WayObj.hpp"
#include "LinkObj.hpp"
*/
//ENDANNECY Shaitan Nettoyage }
#include "CurObj.hpp"
#include "Inter.hpp"
//-------- static init
long Cursor::ms_lNbCursor=0;
Waypoint_Interface* Cursor::ms_poInterface;
//------ static
void Cursor::fn_vInitObject (Waypoint_Interface* poInterface)
{
ms_poInterface = poInterface;
}
Cursor::Cursor( CPA_ObjectDLLBase *p_oDLL, CPA_BaseObject *p_oOwner, eCursorMouseMoveLimit elimit ):
CPA_BaseObject ( p_oDLL, "Cursor" )
{
CPA_SuperObject* poSuperCursor = ms_poInterface->GetInterface()->GetNewSuperObject ( E_ss_NoSave, C_NoType );
m_poSuperObject = poSuperCursor;
poSuperCursor->SetTypeSO (C_Protected);
poSuperCursor->SetObject(this);
SetSuperObject (poSuperCursor);
// name
CString csName;
csName.Format ("Cursor%d", ms_lNbCursor);
ms_lNbCursor++;
fn_eRename (csName);
// init
MTH3D_M_vNullVector(&m_stVertex);
m_xDim=0.05f;
m_poParent = (CPA_SuperObject*)p_oOwner;
m_eMouseMoveLimit = elimit;
m_bCursorMove = FALSE;
// graphic object
CPA_SuperObject* poGraphic = GetInterface()->fn_pGetNewCursorGraphicObject();
poGraphic->SetSuperObjectOwner (GetSuperObject());
GetSuperObject()->AddTail (poGraphic);
GEO_xComputeObjectNormals ( (ACP_tdxHandleOfObject)HIE_fn_hGetSuperObjectObject(poGraphic->GetStruct()));
poGraphic->SetEditProtected (TRUE);
}
long Cursor::GetDataType (void)
{
return C_ucCursor;
}
void* Cursor::GetData (void)
{
return NULL;
}
Waypoint_Interface* Cursor::GetInterface (void)
{
return ms_poInterface;
}
void Cursor::fn_vDraw (void)
{
MTH3D_tdstVector stAbsoluteVertex;
tdeLocalColor tdColor = GetSuperObject()->GetLocalColor ();
CPA_SuperObject* psoObject = (CPA_SuperObject*)GetSuperObject()->GetHead();
fn_vGetAbsoluteVertex ( &stAbsoluteVertex );
ACP_tdxHandleOfObject hMot = (ACP_tdxHandleOfObject) HIE_fn_hGetSuperObjectObject(psoObject->GetStruct());
MTH3D_tdstVector a8_stPoint [13];
MTH3D_M_vSetVectorElements (a8_stPoint, m_xDim,m_xDim,-m_xDim);
MTH3D_M_vSetVectorElements (a8_stPoint+1, m_xDim,-m_xDim,-m_xDim);
MTH3D_M_vSetVectorElements (a8_stPoint+2, -m_xDim,-m_xDim,-m_xDim);
MTH3D_M_vSetVectorElements (a8_stPoint+3, -m_xDim,m_xDim,-m_xDim);
MTH3D_M_vSetVectorElements (a8_stPoint+4, m_xDim,m_xDim,m_xDim);
MTH3D_M_vSetVectorElements (a8_stPoint+5, m_xDim,-m_xDim,m_xDim);
MTH3D_M_vSetVectorElements (a8_stPoint+6, -m_xDim,-m_xDim,m_xDim);
MTH3D_M_vSetVectorElements (a8_stPoint+7, -m_xDim,m_xDim,m_xDim);
GEO_vSetListOfPointsOfObject
(
hMot,
a8_stPoint,
8,
0
);
GEO_xComputeObjectNormals ( hMot );
// change the local matrix
GEO_tdxHandleToMatrix hAbsoluteObjectMatrix = HIE_fn_hGetSuperObjectGlobalMatrix (psoObject->GetStruct());
GEO_tdxHandleToMatrix hAbsoluteFatherMatrix = HIE_fn_hGetSuperObjectGlobalMatrix (m_poParent->GetStruct());
POS_fn_vSetIdentityMatrix( hAbsoluteObjectMatrix );
MTH3D_tdstVector stOx, stOy, stOz;
POS_fn_vGetRotationMatrix( hAbsoluteFatherMatrix ,
&stOx, &stOy, &stOz );
POS_fn_vSetRotationMatrix( hAbsoluteObjectMatrix ,
&stOx, &stOy, &stOz );
POS_fn_vSetTranslationVector( hAbsoluteObjectMatrix, &stAbsoluteVertex );
GetInterface()->fn_vComputeNewRelativeMatrix (psoObject->GetStruct());
}
void Cursor::fn_vSetAbsoluteVertex ( MTH3D_tdstVector* pAbsoluteVertex )
{
POS_tdstCompletePosition stInvMatrix;
POS_fn_vSetIdentityMatrix(&stInvMatrix);
GEO_tdxHandleToMatrix hAbsoluteLineMatrix = HIE_fn_hGetSuperObjectGlobalMatrix (m_poParent->GetStruct());
POS_fn_vInvertMatrix( &stInvMatrix , hAbsoluteLineMatrix );
POS_fn_vMulMatrixVertex( &m_stVertex, &stInvMatrix, pAbsoluteVertex) ;
m_stVertex.xZ=0.;
}
void Cursor::fn_vGetAbsoluteVertex ( MTH3D_tdstVector* pAbsoluteVertex )
{
GEO_tdxHandleToMatrix hAbsoluteLineMatrix = HIE_fn_hGetSuperObjectGlobalMatrix (m_poParent->GetStruct());
POS_fn_vMulMatrixVertex( pAbsoluteVertex, hAbsoluteLineMatrix, &m_stVertex) ;
}
void Cursor::fn_vStartMove ( MTH3D_tdstVector* pstStartVertex )
{
fn_vSetAbsoluteVertex (pstStartVertex);
fn_vDraw ();
GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
}
void Cursor::fn_vMove ( MTH3D_tdstVector* pstTranslation )
{
MTH3D_tdstVector stVertex, stInitialVertex;
fn_vGetAbsoluteVertex ( &stVertex );
stInitialVertex = stVertex;
MTH3D_M_vAddVector(&stVertex, &stVertex, pstTranslation);
if (fn_bCanMove(&stVertex))
{
fn_vSetAbsoluteVertex ( &stVertex );
fn_vGetAbsoluteVertex ( pstTranslation );
MTH3D_M_vSubVector(pstTranslation, pstTranslation, &stInitialVertex );
fn_vDraw ();
GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
}
else MTH3D_M_vSetVectorElements (pstTranslation, 0., 0., 0.);
}
void Cursor::fn_vEndMove (void)
{
m_bCursorMove = TRUE;
}
BOOL Cursor::fn_bCanMove ( MTH3D_tdstVector* pstVertex )
{
switch (m_eMouseMoveLimit)
{
case eCursorCircularLimit:
{
MTH3D_tdstVector stLocalA, stLocalC;
MTH3D_tdstVector stAB, stBC, stAC;
MTH_tdxReal lAB, lBC, lAC;
MTH3D_M_vSetVectorElements (&stLocalA, 0., 0., 0.);
MTH3D_M_vSetVectorElements (&stLocalC, 1., 0., 0.);
GEO_tdxHandleToMatrix hAbsoluteMatrix = HIE_fn_hGetSuperObjectGlobalMatrix (m_poParent->GetStruct());
MTH3D_tdstVector stFirstVertex, stSecondVertex;
POS_fn_vMulMatrixVertex( &stFirstVertex, hAbsoluteMatrix, &stLocalA );
POS_fn_vMulMatrixVertex( &stSecondVertex, hAbsoluteMatrix, &stLocalC );
stAB=*pstVertex;
MTH3D_M_vSubVector(&stAB,&stAB,&stFirstVertex);
stBC=stSecondVertex;
MTH3D_M_vSubVector(&stBC,&stBC,pstVertex);
stAC=stSecondVertex;
MTH3D_M_vSubVector(&stAC,&stAC,&stFirstVertex);
lAB = MTH3D_M_xNormVector(&stAB);
lBC = MTH3D_M_xNormVector(&stBC);
lAC = MTH3D_M_xNormVector(&stAC);
lAB *= lAB;
lBC *= lBC;
lAC *= lAC;
return (lAB+lBC<=lAC);
}
default : return TRUE;
}
}
BOOL Cursor::fn_bCursorMove (void)
{
BOOL bReturnCursorMove = m_bCursorMove;
m_bCursorMove = FALSE;
return bReturnCursorMove;
}

View File

@@ -0,0 +1,129 @@
//
// Common functions for Object DLL capabilities
// C. Beaudet
//
#include "stdafx.h"
#include "acp_base.h"
#include "afxdllx.h"
#include "incitf.h"
#include "incgam.h"
#include "incai.h"
#include "WPObj.hpp"
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
#include "WayObj.hpp"
#include "LinkObj.hpp"
*/
//ENDANNECY Shaitan Nettoyage }
#include "Inter.hpp"
//------------------------------------------------------------------------
// Global vars
static char *gs_p_szCPAVersion = C_szCPAVersion;
static AFX_EXTENSION_MODULE NEAR extensionDLL = { NULL, NULL };
#ifdef DLL_ONLY_ONE_INSTANCE
static WaypointObjetcInterface *gs_p_oWaypointInterface = NULL;
#endif
static CList<CPA_DLLBase*,CPA_DLLBase*> g_oListOfInstances; //private internal
//------------------------------------------------------------------------
// functions that are present in all DLL :
//------------------------------------------------------------------------
//========================================================================
// Get current CPA version
//========================================================================
extern "C" char __declspec(dllexport) *fn_p_szGetCPAVersion(void)
{
return gs_p_szCPAVersion;
}
//========================================================================
// Get type of this DLL
//========================================================================
extern "C" tdstDLLIdentity __declspec(dllexport) *fn_p_stGetDLLIdentity(void)
{
g_stWayPointIdentity . eType = OBJECT_DLL;
g_stWayPointIdentity . csName = "WayPoint";
g_stWayPointIdentity . hModule = NULL;
g_stWayPointIdentity . p_oListOfInstances = &g_oListOfInstances;
return &g_stWayPointIdentity;
}
//========================================================================
// DLL int function
//========================================================================
extern "C" void __declspec(dllexport) fn_vInitDll(void)
{
new CDynLinkLibrary(extensionDLL);
}
//========================================================================
// DLL entry point
//========================================================================
extern "C" int __stdcall DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
if (!AfxInitExtensionModule(extensionDLL, hInstance))
return 0;
}
return 1;
}
//========================================================================
// Get the DLL
//========================================================================
extern "C" CPA_DLLBase __declspec(dllexport) *fn_p_oGetDLL(long lKey)
{
#ifdef DLL_ONLY_ONE_INSTANCE
switch(lKey)
{
case 0: // the game world
if (gs_p_oWayPointInterface == NULL)
{
gs_p_oWaypointInterface = new Waypoint_Interface();
ASSERT(gs_p_oWaypointInterface != NULL);
}
return gs_p_oWaypointInterface;
break;
default:
return NULL;
}
#else //DLL_ONLY_ONE_INSTANCE
switch(lKey)
{
case 0: // the game world
return new Waypoint_Interface();
break;
default:
return NULL;
}
#endif //DLL_ONLY_ONE_INSTANCE
}
//------------------------------------------------------------------------
// functions that are present in this type of DLL only :
//------------------------------------------------------------------------
#undef DLL_ONLY_ONE_INSTANCE

View File

@@ -0,0 +1,593 @@
/*================================================================
File: Dynamic.h
Prupose: Dynamic parameters of a connection
Author: Yann Le Tensorer
Creation Date: 29 january 1997
------------------------------------------------------------------
Revisions: 1.01 Yann Le Tensorer
4 february 1997
Added function fn_vDynamicObject_GetParams
=================================================================*/
#ifdef _AI_LIB_
#include "AIUseCPA.h"
#include "dynamic.h"
#include "IAOption.h"
#include "IAMacros.h"
/* AI memory and error management */
#include "MemIA.h"
#include "ErrIA.h"
#else /*_AI_LIB_*/
#include "acp_base.h"
#include "dynamic.h"
#include "malloc.h"
#endif /*_AI_LIB_*/
/*============================================================
Memory management macros, to be replaced with correct memory management
============================================================*/
#ifdef _AI_LIB_
#define M_malloc(pointer,cast,size) M_IAAlloc(pointer,cast,size)
#define M_free(pointer) M_IAFree(pointer)
#else /*_AI_LIB_*/
#define M_malloc(pointer,cast,size) (pointer=(cast)malloc(size))
#define M_free(pointer) (free(pointer))
#endif /*_AI_LIB_*/
/*==========================================================
Function name: fn_vDynamicObject_Calculate
Description: Caculates the speeds at sampled points, according to dynamic parameters
Input: p_stDynaParam: pointer to a pre-created tdstDynaParam structure
Output: none
Author: Yann Le Tensorer
Date: 30 january 1997
Revision:
==========================================================*/
void fn_vDynamicObject_Calculate(ACP_tdstDynaParam* p_stDynaParam)
{
MTH_tdxReal *SpeedList;
MTH_tdxReal *SpeedListEnd;
MTH_tdxReal CurSpeed;
MTH_tdxReal inc;
MTH_tdxReal MaxSpeed;
MTH_tdxReal CurAngle;
if (p_stDynaParam==0) return; /* avoid unexepected crash */
switch (p_stDynaParam->ucDynamicType)
{
case C_ucNone:
case C_ucConst:
break;
case C_ucLinear:
inc=(p_stDynaParam->xEndSpeed-p_stDynaParam->xStartSpeed)/p_stDynaParam->ucSamplingRate;
SpeedList = p_stDynaParam->d_stListOfSpeeds; /* start adress */
if (SpeedList==0) break; /* avoid unexpected crash */
SpeedListEnd= p_stDynaParam->d_stListOfSpeeds+p_stDynaParam->ucSamplingRate; /* end adress */
CurSpeed = p_stDynaParam->xStartSpeed;
for (;SpeedList<=SpeedListEnd;SpeedList++)
{
*SpeedList=CurSpeed;
CurSpeed+=inc;
}
break;
case C_ucSinus:
MaxSpeed=(p_stDynaParam->xMaxSpeed)/2;
inc=(p_stDynaParam->xEndAngle-p_stDynaParam->xStartAngle)/p_stDynaParam->ucSamplingRate;
SpeedList = p_stDynaParam->d_stListOfSpeeds; /* start adress */
if (SpeedList==0) break; /* avoid unexpected crash */
SpeedListEnd= p_stDynaParam->d_stListOfSpeeds+p_stDynaParam->ucSamplingRate; /* end adress */
CurAngle = p_stDynaParam->xStartAngle;
for (;SpeedList<=SpeedListEnd;SpeedList++)
{
*SpeedList=(MTH_M_xSin(CurAngle)+1)*MaxSpeed;
CurAngle+=inc;
}
break;
}
}
/*==========================================================
Function name: fn_vDynamicObject_Create
Description: Creates a dynamic parameters object
Input: p_stDynaParam: pointer to a preallocated tdstDynaParam structure
ucSamplingRate: sampling rate
ucDynamicType: dynamic type (C_NONE,C_CONST,C_LINEAR,C_SINUS)
xFirst,xSecond,xThird: See table below
Type: | C_NONE | C_CONST | C_LINEAR | C_SINUS
===========================================================
xFirst | - | speed | start speed | start angle
| | | |
xSecond | - | - | end speed | end angle
| | | |
xThird | - | - | - | max speed
Output: none
Author: Yann Le Tensorer
Date: 30 january 1997
Revision: 5 february 1997 : corrected minor bugs
==========================================================*/
void fn_vDynamicObject_Create( ACP_tdstDynaParam* p_stDynaParam,
unsigned char ucSamplingRate,
unsigned char ucDynamicType,
MTH_tdxReal xFirst,
MTH_tdxReal xSecond,
MTH_tdxReal xThird)
{
if (p_stDynaParam==0) return;
p_stDynaParam->ucSamplingRate=ucSamplingRate;
if (p_stDynaParam->ucSamplingRate<2) p_stDynaParam->ucSamplingRate=2;
p_stDynaParam->ucDynamicType=ucDynamicType;
switch (ucDynamicType)
{
case C_ucNone:
p_stDynaParam->xSpeed=0;
p_stDynaParam->xEndSpeed=0;
p_stDynaParam->xMaxSpeed=0;
p_stDynaParam->d_stListOfSpeeds=0;
break;
case C_ucConst:
p_stDynaParam->xSpeed=xFirst;
p_stDynaParam->xEndSpeed=0;
p_stDynaParam->xMaxSpeed=0;
p_stDynaParam->d_stListOfSpeeds=0;
break;
case C_ucLinear:
p_stDynaParam->xStartSpeed=xFirst;
p_stDynaParam->xEndSpeed=xSecond;
p_stDynaParam->xMaxSpeed=0;
M_malloc(p_stDynaParam->d_stListOfSpeeds,MTH_tdxReal*,sizeof(MTH_tdxReal)*(p_stDynaParam->ucSamplingRate+1));
break;
case C_ucSinus:
p_stDynaParam->xStartAngle=xFirst;
p_stDynaParam->xEndAngle=xSecond;
p_stDynaParam->xMaxSpeed=xThird;
M_malloc(p_stDynaParam->d_stListOfSpeeds,MTH_tdxReal*,sizeof(MTH_tdxReal)*(p_stDynaParam->ucSamplingRate+1));
break;
}
fn_vDynamicObject_Calculate(p_stDynaParam);
}
/*==========================================================
Function name: fn_vDynamicObject_ChangeSamplingRate
Description: Changes the sampling rate of a dynamic object
Input: p_stDynaParam: pointer to a preallocated tdstDynaParam structure
ucSamplingRate: sampling rate
Output: none
Author: Yann Le Tensorer
Date: 5 february 1997
Revision:
==========================================================*/
void fn_vDynamicObject_ChangeSamplingRate( ACP_tdstDynaParam* p_stDynaParams,
unsigned char ucSamplingRate)
{
if (p_stDynaParams==0) return;
p_stDynaParams->ucSamplingRate=ucSamplingRate;
if (p_stDynaParams->ucSamplingRate<2) p_stDynaParams->ucSamplingRate=2;
switch (p_stDynaParams->ucDynamicType)
{
case C_ucNone:
p_stDynaParams->d_stListOfSpeeds=0;
break;
case C_ucConst:
p_stDynaParams->d_stListOfSpeeds=0;
break;
case C_ucLinear:
if (p_stDynaParams->d_stListOfSpeeds!=0)
M_free(p_stDynaParams->d_stListOfSpeeds);
M_malloc(p_stDynaParams->d_stListOfSpeeds,MTH_tdxReal*,sizeof(MTH_tdxReal)*(p_stDynaParams->ucSamplingRate+1));
break;
case C_ucSinus:
if (p_stDynaParams->d_stListOfSpeeds!=0)
M_free(p_stDynaParams->d_stListOfSpeeds);
M_malloc(p_stDynaParams->d_stListOfSpeeds,MTH_tdxReal*,sizeof(MTH_tdxReal)*(p_stDynaParams->ucSamplingRate+1));
break;
}
fn_vDynamicObject_Calculate(p_stDynaParams);
}
/*==========================================================
Function name: fn_vDynaParams_Free
Description: removes the allocated ram for DynaParams
Input: p_stDynaParam: pointer to a pre-created tdstDynaParam structure
Output: none
Author: Yann Le Tensorer
Date: 30 january 1997
Revision:
==========================================================*/
void fn_vDynamicObject_Free(ACP_tdstDynaParam* p_stDynaParams)
{
if (p_stDynaParams!=0)
if (p_stDynaParams->d_stListOfSpeeds!=0)
M_free(p_stDynaParams->d_stListOfSpeeds);
}
/*==========================================================
Function name: fn_vDynamicObject_ChangeParams
Description: changes the dynamic parameters (except sampling rate)
Input: p_stDynaParam: pointer to a preallocated tdstDynaParam structure
ucDynamicType: dynamic type (C_ucNone,C_ucConst,C_ucLinear,C_ucSinus)
xFirst,xSecond,xThird: See table below
Type: | C_ucNone | C_ucConst | C_ucLinear | C_ucSinus
===========================================================
xFirst | - | speed | start speed | start angle
| | | |
xSecond | - | - | end speed | end angle
| | | |
xThird | - | - | - | max speed
Output: none
Author: Yann Le Tensorer
Date: 30 january 1997
Revision:
==========================================================*/
void fn_vDynamicObject_ChangeParams( ACP_tdstDynaParam* p_stDynaParam,
unsigned char ucDynamicType,
MTH_tdxReal xFirst,
MTH_tdxReal xSecond,
MTH_tdxReal xThird)
{
p_stDynaParam->ucDynamicType=ucDynamicType;
switch (ucDynamicType)
{
case C_ucNone:
p_stDynaParam->xSpeed=0;
p_stDynaParam->xEndSpeed=0;
p_stDynaParam->xMaxSpeed=0;
if (p_stDynaParam->d_stListOfSpeeds!=0)
{
M_free(p_stDynaParam->d_stListOfSpeeds);
p_stDynaParam->d_stListOfSpeeds=0;
}
break;
case C_ucConst:
p_stDynaParam->xSpeed=xFirst;
p_stDynaParam->xEndSpeed=0;
p_stDynaParam->xMaxSpeed=0;
if (p_stDynaParam->d_stListOfSpeeds!=0)
{
M_free(p_stDynaParam->d_stListOfSpeeds);
p_stDynaParam->d_stListOfSpeeds=0;
}
break;
case C_ucLinear:
p_stDynaParam->xStartSpeed=xFirst;
p_stDynaParam->xEndSpeed=xSecond;
p_stDynaParam->xMaxSpeed=0;
if (p_stDynaParam->d_stListOfSpeeds==0)
M_malloc(p_stDynaParam->d_stListOfSpeeds,MTH_tdxReal*,sizeof(MTH_tdxReal)*(p_stDynaParam->ucSamplingRate+1));
break;
case C_ucSinus:
p_stDynaParam->xStartAngle=xFirst;
p_stDynaParam->xEndAngle=xSecond;
p_stDynaParam->xMaxSpeed=xThird;
if (p_stDynaParam->d_stListOfSpeeds==0)
M_malloc(p_stDynaParam->d_stListOfSpeeds,MTH_tdxReal*,sizeof(MTH_tdxReal)*(p_stDynaParam->ucSamplingRate+1));
break;
}
fn_vDynamicObject_Calculate(p_stDynaParam);
}
/*==========================================================
Function name: fn_vDynamicObject_GetParams
Description: Gets the dynamic parameters (including sampling rate)
Input: p_stDynaParam: pointer to a preallocated tdstDynaParam structure
p_ucDynamicType:pointer to get dynamic type (C_ucNone,C_ucConst,C_ucLinear,C_ucSinus)
p_SamplingRate: pointer to get sampling rate
p_xFirst,p_xSecond,p_xThird:pointers to parameters to get See table below
Type: | C_ucNone | C_ucConst | C_ucLinear | C_ucSinus
===========================================================
xFirst | - | speed | start speed | start angle
| | | |
xSecond | - | - | end speed | end angle
| | | |
xThird | - | - | - | max speed
Output: none
Author: Yann Le Tensorer
Date: 04 february 1997
Revision:
Note: Programmer may call the function with null pointers.
Only non-null pointers will be affected...
==========================================================*/
void fn_vDynamicObject_GetParams( ACP_tdstDynaParam* p_stDynaParam,
unsigned char* p_ucDynamicType,
unsigned char* p_ucSamplingRate,
MTH_tdxReal* p_xFirst,
MTH_tdxReal* p_xSecond,
MTH_tdxReal* p_xThird)
{
if (p_stDynaParam==0) return;
if (p_ucDynamicType!=0) *p_ucDynamicType=p_stDynaParam->ucDynamicType;
if (p_ucSamplingRate!=0) *p_ucSamplingRate=p_stDynaParam->ucSamplingRate;
switch (p_stDynaParam->ucDynamicType)
{
case C_ucNone:
if (p_xFirst!=0) *p_xFirst =0;
if (p_xSecond!=0) *p_xSecond =0;
if (p_xThird!=0) *p_xThird =0;
break;
case C_ucConst:
if (p_xFirst!=0) *p_xFirst =p_stDynaParam->xSpeed;
if (p_xSecond!=0) *p_xSecond =0;
if (p_xThird!=0) *p_xThird =0;
break;
case C_ucLinear:
if (p_xFirst!=0) *p_xFirst =p_stDynaParam->xStartSpeed;
if (p_xSecond!=0) *p_xSecond =p_stDynaParam->xEndSpeed;
if (p_xThird!=0) *p_xThird =0;
break;
case C_ucSinus:
if (p_xFirst!=0) *p_xFirst =p_stDynaParam->xStartAngle;
if (p_xSecond!=0) *p_xSecond =p_stDynaParam->xEndAngle;
if (p_xThird!=0) *p_xThird =p_stDynaParam->xMaxSpeed;
break;
default:
break;
}
}
/*=========================================================
Function name: fn_xDynamicObject_GetSpeed
Description: returns the speed at a given sample (n<> of the point)
Input: p_stDynaParam: pointer to a pre-created tdstDynaParam structure
iSampleNo: n<> of the point to get the speed from.
Output: return value is the speed.
Author: Yann Le Tensorer
Date: 31 january 1997
==========================================================*/
MTH_tdxReal fn_xDynamicObject_GetSpeed(ACP_tdstDynaParam* p_stDynaParams,unsigned char ucSampleNo)
{
MTH_tdxReal xReturn;
if (p_stDynaParams==0) return 0;
switch (p_stDynaParams->ucDynamicType)
{
case C_ucNone:
xReturn=0;
break;
case C_ucConst:
xReturn=p_stDynaParams->xSpeed;
break;
case C_ucLinear:
case C_ucSinus:
if (ucSampleNo<=p_stDynaParams->ucSamplingRate && p_stDynaParams->d_stListOfSpeeds!=0)
xReturn=p_stDynaParams->d_stListOfSpeeds[ucSampleNo];
else
xReturn=0;
break;
default: xReturn=0;
}
return xReturn;
}
/*==========================================================
Function name: fn_vDynamicObject_CreateNotSampled
Description: Creates a dynamic parameters object for not sampled type
Input: p_stDynaParam: pointer to a preallocated tdstDynaParam structure
ucDynamicType: dynamic type (C_NONE,C_CONST,C_LINEAR,C_SINUS)
xFirst,xSecond,xThird: See table below
Type: | C_NONE | C_CONST | C_LINEAR | C_SINUS
===========================================================
xFirst | - | speed | start speed | start angle
| | | |
xSecond| - | - | end speed | end angle
| | | |
xThird | - | - | - | max speed
Output: none
Author: Albert Pais
Date: February 04, 1997
Revision:
==========================================================*/
void fn_vDynamicObject_CreateNotSampled
(
ACP_tdstDynaParam* p_stDynaParam,
unsigned char ucDynamicType,
MTH_tdxReal xFirst,
MTH_tdxReal xSecond,
MTH_tdxReal xThird
)
{
p_stDynaParam->ucDynamicType=ucDynamicType;
switch (ucDynamicType)
{
case C_ucNone:
p_stDynaParam->xSpeed=0;
p_stDynaParam->xEndSpeed=0;
p_stDynaParam->xMaxSpeed=0;
p_stDynaParam->d_stListOfSpeeds=0;
break;
case C_ucConst:
p_stDynaParam->xSpeed=xFirst;
p_stDynaParam->xEndSpeed=0;
p_stDynaParam->xMaxSpeed=0;
p_stDynaParam->d_stListOfSpeeds=0;
break;
case C_ucLinear:
p_stDynaParam->xStartSpeed=xFirst;
p_stDynaParam->xEndSpeed=xSecond;
p_stDynaParam->xMaxSpeed=0;
break;
case C_ucSinus:
p_stDynaParam->xStartAngle=xFirst;
p_stDynaParam->xEndAngle=xSecond;
p_stDynaParam->xMaxSpeed=xThird;
break;
}
}
/*==========================================================
Function name: fn_xDynamicObject_GetSpeedNotSampled
Description: returns the speed at a given position when it is not sampled
Input:
p_stDynaParam: pointer to a pre-created tdstDynaParam structure
_xDist : the dist beetween the position where speed is required and the point to reach
Output: return value is the speed.
Author: Albert Pais
Date: February 4,1997
Revision:
==========================================================*/
MTH_tdxReal fn_xDynamicObject_GetSpeedNotSampled
(
ACP_tdstDynaParam* _p_stDynaParams,
MTH_tdxReal _xDist
)
{
MTH_tdxReal xReturn;
switch (_p_stDynaParams->ucDynamicType)
{
case C_ucNone:
xReturn=0;
break;
case C_ucConst:
xReturn=_p_stDynaParams->xSpeed;
break;
case C_ucLinear:
/* Speed = InitialSpeed + CurrentDist x (FinalSpeed-InitialSpeed) / InitialDist */
/* tip : (FinalSpeed-InitialSpeed) / InitialDist is stored inside xSpeed field */
xReturn = MTH_M_xAdd
(
_p_stDynaParams->xStartSpeed,
MTH_M_xMul(_xDist,_p_stDynaParams->xSpeed )
);
break;
case C_ucSinus:
/* Speed = MaxSpeed x
(1+sin( (FinalAngle - InitialAngle)/InitialDist * CurrentDist + InitialAngle )) */
/* tip : (FinalAngle - InitialAngle)/InitialDist is stored inside xSpeed field */
xReturn = MTH_M_xMul
(
(_p_stDynaParams->xMaxSpeed),
MTH_M_xAdd
(
MTH_C_ONE,
MTH_M_xSin
(
MTH_M_xAdd
(
MTH_M_xMul
(
_p_stDynaParams->xSpeed,
_xDist
),
_p_stDynaParams->xStartAngle
)
)
)
);
break;
default: xReturn=0;
}
return xReturn;
}
/*==========================================================
Function name: fn_vDynamicObject_CalculateNotSampled
Description: Caculates specific coef when speed is not sampled
Input:
p_stDynaParam: pointer to a pre-created tdstDynaParam structure
the initial dist beetween the initial point and the final point
Output: none
Remark :
The xSpeed field of the structure is used to store some
parameters used at execution
Author: Albert Pais
Date: Frebruary 4,1997
Revision:
==========================================================*/
void fn_vDynamicObject_CalculateNotSampled
(
ACP_tdstDynaParam* _p_stDynaParam,
MTH_tdxReal _xInitialDist
)
{
switch (_p_stDynaParam->ucDynamicType)
{
case C_ucNone:
case C_ucConst:
/* nothing to compute */
break;
case C_ucLinear:
if(_xInitialDist)
{/* xSpeed is used to store a specific coef :*/
_p_stDynaParam->xSpeed =
MTH_M_xDiv
(
MTH_M_xSub
(
(_p_stDynaParam->xEndSpeed),
(_p_stDynaParam->xStartSpeed)
),
_xInitialDist
);
}
else
{
_p_stDynaParam->xSpeed = MTH_C_ZERO;
}
break;
case C_ucSinus:
if(_xInitialDist)
{/* xSpeed is used to store a specific coef :*/
_p_stDynaParam->xSpeed =
MTH_M_xDiv
(
MTH_M_xSub
(
(_p_stDynaParam->xEndAngle),
(_p_stDynaParam->xStartAngle)
),
_xInitialDist
);
}
else
{
_p_stDynaParam->xSpeed = MTH_C_ZERO;
}
break;
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,257 @@
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : Link2D.cpp
//
// Definition of links defined in a 2D plane
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// inherit from : Link
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 30 jan 1997 Author: J Th<54>noz
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
//
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
*/
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
#include "stdafx.h"
#include "acp_base.h"
#include "incitf.h"
#include "incgam.h"
#include "incai.h"
#include "WPObj.hpp"
#include "WayObj.hpp"
#include "LinkObj.hpp"
#include "Inter.hpp"
#include "Link2D.hpp"
Link2D::Link2D ( CPA_ObjectDLLBase *p_oDLL, CPA_BaseObject *p_oOwner, WP_tdhLink hLink )
: Link ( p_oDLL, p_oOwner, hLink )
{
m_xe = 0.025f;
}
Link2D::Link2D ( CPA_ObjectDLLBase *p_oDLL, CPA_BaseObject *p_oOwner )
: Link ( p_oDLL, p_oOwner )
{
m_xe = 0.025f;
}
void Link2D::fn_vConstructPlane (void)
{
m_poGraphic = GetInterface()->fn_pGetNewPlaneGraphicObject();
m_poGraphic->SetSuperObjectOwner (GetSuperObject());
GetInterface()->GetInterface()->fn_bInsertObjectInHierarchy (m_poGraphic,GetSuperObject(),FALSE,FALSE,FALSE);
GEO_xComputeObjectNormals ( (ACP_tdxHandleOfObject)HIE_fn_hGetSuperObjectObject(m_poGraphic->GetStruct()));
m_poGraphic->SetEditProtected (TRUE);
}
void Link2D::fn_vDestroyPlane (void)
{
GetInterface()->fn_vSetModifDeleteOk (TRUE);
GetInterface()->GetInterface()->fn_bDeleteObjectInHierarchy (m_poGraphic,FALSE,FALSE,TRUE,FALSE);
GetInterface()->fn_vSetModifDeleteOk (FALSE);
m_poGraphic = NULL;
}
void Link2D::fn_vDrawPlane (void)
{
MTH3D_tdstVector stFirstVertex, stSecondVertex;
GLI_tdxValue d5, md5;
tdeLocalColor tdColor = GetSuperObject()->GetLocalColor ();
WP_fnv_WayPoint_ComputeLocation ( (WP_tdhWayPoint)(m_poFirstWP->GetEngineStruct()), &stFirstVertex );
WP_fnv_WayPoint_ComputeLocation ( (WP_tdhWayPoint)(m_poSecondWP->GetEngineStruct()), &stSecondVertex );
MTH3D_tdstVector n, u, v;
ACP_tdxHandleOfObject hMot = (ACP_tdxHandleOfObject) HIE_fn_hGetSuperObjectObject(m_poGraphic->GetStruct());
n = stSecondVertex;
MTH3D_M_vSubVector(&n,&n,&stFirstVertex);
GLI_tdxValue lenght = MTH3D_M_xNormVector( &n );
d5 = (GLI_tdxValue)(lenght*0.5);
md5 = -d5;
MTH3D_tdstVector a8_stPoint [24];
MTH3D_M_vSetVectorElements (a8_stPoint, 0,-0.5,m_xe);
MTH3D_M_vSetVectorElements (a8_stPoint+1, 1.,-0.5,m_xe);
MTH3D_M_vSetVectorElements (a8_stPoint+2, 1.,0.5,m_xe);
MTH3D_M_vSetVectorElements (a8_stPoint+3, 0,0.5,m_xe);
MTH3D_M_vSetVectorElements (a8_stPoint+4, 0,-0.5,-m_xe);
MTH3D_M_vSetVectorElements (a8_stPoint+5, 1.,-0.5,-m_xe);
MTH3D_M_vSetVectorElements (a8_stPoint+6, 1.,0.5,-m_xe);
MTH3D_M_vSetVectorElements (a8_stPoint+7, 0,0.5,-m_xe);
MTH3D_M_vSetVectorElements (a8_stPoint+8, 0.4f, -0.6f, m_xe);
MTH3D_M_vSetVectorElements (a8_stPoint+9, 0.6f, -0.6f, m_xe);
MTH3D_M_vSetVectorElements (a8_stPoint+10, 0.6f, -0.5f, m_xe);
MTH3D_M_vSetVectorElements (a8_stPoint+11, 0.4f, -0.5f, m_xe);
MTH3D_M_vSetVectorElements (a8_stPoint+12, 0.4f, -0.6f, -m_xe);
MTH3D_M_vSetVectorElements (a8_stPoint+13, 0.6f, -0.6f, -m_xe);
MTH3D_M_vSetVectorElements (a8_stPoint+14, 0.6f, -0.5f, -m_xe);
MTH3D_M_vSetVectorElements (a8_stPoint+15, 0.4f, -0.5f, -m_xe);
MTH3D_M_vSetVectorElements (a8_stPoint+16, 0.4f, 0.5f, m_xe);
MTH3D_M_vSetVectorElements (a8_stPoint+17, 0.6f, 0.5f, m_xe);
MTH3D_M_vSetVectorElements (a8_stPoint+18, 0.6f, 0.6f, m_xe);
MTH3D_M_vSetVectorElements (a8_stPoint+19, 0.4f, 0.6f, m_xe);
MTH3D_M_vSetVectorElements (a8_stPoint+20, 0.4f, 0.5f, -m_xe);
MTH3D_M_vSetVectorElements (a8_stPoint+21, 0.6f, 0.5f, -m_xe);
MTH3D_M_vSetVectorElements (a8_stPoint+22, 0.6f, 0.6f, -m_xe);
MTH3D_M_vSetVectorElements (a8_stPoint+23, 0.4f, 0.6f, -m_xe);
GEO_vSetListOfPointsOfObject
(
hMot,
a8_stPoint,
24,
0
);
GEO_xComputeObjectNormals ( hMot );
MTH3D_M_vNormalizeVector(&n,&n);
if (n.xX||n.xY) { MTH3D_M_vSetVectorElements ((&u),(-n.xY),(n.xX),0.); }
else { MTH3D_M_vSetVectorElements((&u),0.,(-n.xZ),n.xY); }
MTH3D_M_vNormalizeVector(&u,&u);
MTH3D_M_vCrossProductVector((&v),(&n),(&u));
fn_vComputePlaneAxis ();
}
// moves
void Link2D::fn_vStartMove ( MTH3D_tdstVector* pstStartVertex )
{
m_stPlaneVertex = *pstStartVertex;
fn_vDrawPlane ();
GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
}
void Link2D::fn_vMove ( MTH3D_tdstVector* pstTranslation )
{
MTH3D_tdstVector stInitialValue = m_stPlaneVertex;
MTH3D_M_vAddVector(&m_stPlaneVertex,&m_stPlaneVertex,pstTranslation);
fn_vComputePlaneAxis (&m_stPlaneVertex);
fn_vProjVertex ( &m_stPlaneVertex );
fn_vDrawPlane ();
GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
*pstTranslation = m_stPlaneVertex;
MTH3D_M_vSubVector(pstTranslation, pstTranslation, &stInitialValue);
}
void Link2D::fn_vEndMove (void)
{
fn_vWayNotifySave ();
}
void Link2D::fn_vComputePlaneAxis (MTH3D_tdstVector* pstVertex)
{
MTH3D_tdstVector stFirstVertex, stSecondVertex;
MTH3D_tdstVector Ox, Oy, Oz;
MTH3D_tdstVector v;
MTH3D_tdstVector stVectorU, stVectorV, stVectorN;
WP_fnv_WayPoint_ComputeLocation ( (WP_tdhWayPoint)(m_poFirstWP->GetEngineStruct()), &stFirstVertex );
WP_fnv_WayPoint_ComputeLocation ( (WP_tdhWayPoint)(m_poSecondWP->GetEngineStruct()), &stSecondVertex );
Ox = stSecondVertex;
MTH3D_M_vSubVector(&Ox,&Ox,&stFirstVertex);
GLI_tdxValue lenght = MTH3D_M_xNormVector( &Ox );
if (pstVertex)
{
v = *pstVertex;
MTH3D_M_vSubVector(&v,&v,&stFirstVertex);
MTH3D_M_vCrossProductVector((&Oz),(&Ox),(&v));
// we keep the normal on the same side !!
if (MTH3D_M_xDotProductVector(&Oz,&m_stNormalVertex)<=0) MTH3D_M_vMulScalarVector (&Oz,-1,&Oz);
}
else Oz = m_stNormalVertex;
MTH3D_M_vCrossProductVector((&Oy),(&Oz),(&Ox));
MTH3D_M_vCrossProductVector((&Oz),(&Ox),(&Oy));
MTH3D_M_vNormalizeVector(&Oy,&Oy);
MTH3D_M_vNormalizeVector(&Oz,&Oz);
MTH3D_M_vNormalizeVector(&Ox,&Ox);
GEO_tdxHandleToMatrix hAbsolutePlaneMatrix = HIE_fn_hGetSuperObjectGlobalMatrix (m_poGraphic->GetStruct());
POS_fn_vSetIdentityMatrix( hAbsolutePlaneMatrix );
POS_fn_vSetTranslationVector( hAbsolutePlaneMatrix, &stFirstVertex );
POS_fn_vSetRotationMatrix( hAbsolutePlaneMatrix , &Ox, &Oy, &Oz );
POS_fn_vGetScaleMatrix( hAbsolutePlaneMatrix, &stVectorU, &stVectorV, &stVectorN );
MTH3D_M_vMulScalarVector( &stVectorU, lenght, &stVectorU);
MTH3D_M_vMulScalarVector( &stVectorV, lenght, &stVectorV);
POS_fn_vSetScaleMatrix( hAbsolutePlaneMatrix, &stVectorU, &stVectorV, &stVectorN );
POS_fn_vNormalizeMatrix( hAbsolutePlaneMatrix ) ;
GetInterface()->fn_vComputeNewRelativeMatrix (m_poGraphic->GetStruct());
m_stNormalVertex = Oz;
}
void Link2D::fn_vSetPlaneHorizontal (void)
{
MTH3D_M_vSetVectorElements (&m_stNormalVertex, 0., 0., 1.);
fn_vComputePlaneAxis ();
fn_vDrawPlane ();
GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
}
void Link2D::fn_vSetPlaneVertical (void)
{
MTH3D_tdstVector Ox, Oy;
MTH3D_tdstVector stFirstVertex, stSecondVertex;
MTH3D_M_vSetVectorElements (&Oy, 0., 0., 1.);
WP_fnv_WayPoint_ComputeLocation ( (WP_tdhWayPoint)(m_poFirstWP->GetEngineStruct()), &stFirstVertex );
WP_fnv_WayPoint_ComputeLocation ( (WP_tdhWayPoint)(m_poSecondWP->GetEngineStruct()), &stSecondVertex );
Ox = stSecondVertex;
MTH3D_M_vSubVector(&Ox,&Ox,&stFirstVertex);
MTH3D_M_vCrossProductVector ( &m_stNormalVertex, &Ox, &Oy );
fn_vComputePlaneAxis ();
fn_vDrawPlane ();
GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
}
void Link2D::fn_vProjVertex ( MTH3D_tdstVector* pstVertex )
{
POS_tdstCompletePosition stInvMatrix;
MTH3D_tdstVector stLocalVertex;
MTH_tdxReal sty;
POS_fn_vSetIdentityMatrix(&stInvMatrix);
GEO_tdxHandleToMatrix hAbsoluteMatrix = HIE_fn_hGetSuperObjectGlobalMatrix (m_poGraphic->GetStruct());
POS_fn_vInvertMatrix( &stInvMatrix , hAbsoluteMatrix );
POS_fn_vMulMatrixVertex( &stLocalVertex, &stInvMatrix, pstVertex);
MTH3D_M_vSetXofVector(&stLocalVertex,0.5);
sty = MTH3D_M_xGetYofVector(&stLocalVertex);
if (sty>0.) MTH3D_M_vSetYofVector(&stLocalVertex,0.55f)
else MTH3D_M_vSetYofVector(&stLocalVertex,-0.55f);
MTH3D_M_vSetZofVector(&stLocalVertex,0.);
POS_fn_vMulMatrixVertex( pstVertex ,hAbsoluteMatrix, &stLocalVertex);
}
*/
//ENDANNECY Shaitan Nettoyage }

View File

@@ -0,0 +1,414 @@
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : LinkArc.cpp
//
// Definition of the circle arc
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// inherit from : Link2D
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 30 jan 1997 Author: J Th<54>noz
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
//
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
*/
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
#include "stdafx.h"
#include "acp_base.h"
#include "resource.h"
#include "incitf.h"
#include "incgam.h"
#define _ENG_CIRCLE_FRIEND_
#include "incai.h"
#undef _ENG_CIRCLE_FRIEND_
#include "WpObj.hpp"
#include "WayObj.hpp"
#include "LinkObj.hpp"
#include "CurObj.hpp"
#include "Link2D.hpp"
#include "LinkArc.hpp"
#include "LkArcDia.h"
#include "Inter.hpp"
//ROMTEAM WorldEditor (Viorel Preoteasa 20/01/98)
//ENDROMTEAM WorldEditor (Viorel Preoteasa)
char LinkArc::ms_cType = WP_ConnType_ucCircle;
char LinkArc::ms_szName [10] = "Arc";
int iJustToLinkCiArBidouille;
void JustToLinkCiAr (void) { iJustToLinkCiArBidouille=1; }
void LinkArc::fn_vRegisterObject (void)
{
tdst_LinkObject* pstLinkObject = new tdst_LinkObject;
strcpy ( pstLinkObject->szName, ms_szName );
pstLinkObject->cType = ms_cType;
pstLinkObject->fn_pConstruct = fn_pConstruct;
ms_oListLinkObject.AddTail (pstLinkObject);
JustToLinkCiAr ();
}
LinkArc::LinkArc ( CPA_ObjectDLLBase *p_oDLL, CPA_BaseObject *p_oOwner, WP_tdhLink hLink )
: Link2D ( p_oDLL, p_oOwner, hLink )
{
m_bInitCenter = FALSE;
MTH3D_tdstVector stNulVector = { 0, 0, 0 };
hLink = (WP_tdhLink)GetEngineStruct();
//-------------------------------------
//ROMTEAM WorldEditor (Viorel Preoteasa 20/01/98)
m_hArcObject.CreateFromCurve
(
WP_fnv_Link_GetConnectionTypeCircleArcCurve (hLink),
EDWAY_C_ucModeNoObject,
NULL,
&WP_fnh_Link_GetEngineCircleArcObject(hLink)->m_dstListOfPoints
);
//ENDROMTEAM WorldEditor (Viorel Preoteasa)
//-------------------------------------
m_bEditPlane = FALSE;
m_poCursor=NULL;
m_stCenterVertex=stNulVector;
m_bFirstEdition=TRUE;
}
LinkArc::LinkArc ( CPA_ObjectDLLBase *p_oDLL, CPA_BaseObject *p_oOwner )
: Link2D ( p_oDLL, p_oOwner )
{
m_bInitCenter = TRUE;
MTH3D_tdstVector stNulVector = { 0, 0, 0 };
WP_tdhLink hLink = (WP_tdhLink)GetEngineStruct();
// allocate circle structure
WP_fnv_Link_Allocate
(
hLink,
WP_ConnType_ucCircle,
WP_fneuc_Link_GetConnectionDynamicType (hLink)
);
//------------------------------------------------
//ROMTEAM WorldEditor (Viorel Preoteasa 20/01/98)
m_hArcObject.CreateFromCurve
(
WP_fnv_Link_GetConnectionTypeCircleArcCurve (hLink),
EDWAY_C_ucModeNoObject,
NULL,
&WP_fnh_Link_GetEngineCircleArcObject(hLink)->m_dstListOfPoints
);
// init sampling rate values
WP_fnv_Link_SetCurrentSample (hLink, 15);
// EDWAY_fnb_CircleArcObject_ChangeSamplingRate ( m_hArcObject, 15 );
m_hArcObject.ChangeSamplingRate (15 );
//ENDROMTEAM WorldEditor (Viorel Preoteasa)
//------------------------------------------------
m_bEditPlane = FALSE;
m_poCursor=NULL;
m_stCenterVertex=stNulVector;
m_bFirstEdition=TRUE;
}
CDialog* LinkArc::fn_pGetSpecificDialog (CWnd* pParentWnd)
{
ArcDia* pDialog = new ArcDia (this);
pDialog->Create ( IDD_ARC_DIALOG, pParentWnd );
pDialog->fn_vTutRegister ();
return (CDialog*) pDialog;
}
void LinkArc::fn_vFreeSpecificDialog (CDialog* pDialog)
{
((ArcDia*)pDialog)->fn_vTutUnregister ();
}
void LinkArc::fn_vConstructGraphic (void)
{
}
void LinkArc::fn_vRotationGraphic (BOOL bRotation)
{
Link::fn_vRotationGraphic (bRotation);
if (bRotation)
{
if (m_bEditPlane)
fn_vStopEdit ();
}
else
{
}
}
void LinkArc::fn_vDrawNormal (void)
{
fn_vComputeAxis ();
if (m_bEditPlane) {
fn_vDrawPlane ();
m_poCursor->fn_vDraw ();
fn_vSetEngineStructure ();
}
}
void LinkArc::fn_vDrawOutHierarchy (GLD_tdstViewportAttributes *pViewportAttributes)
{
if (m_bEditPlane)
{
fn_vUpdateCenter ();
}
fn_vSetEngineStructure ();
//----------------------------------------------
//ROMTEAM WorldEditor (Viorel Preoteasa 20/01/98)
m_hArcObject.SetColor(0xFFFFFFFF);
m_hArcObject.SetViewPortAttributes (pViewportAttributes);
m_hArcObject.Draw();
//ENDROMTEAM WorldEditor (Viorel Preoteasa)
//----------------------------------------------
}
void LinkArc::fn_vSetWaypoints ( WayPoint* poFirstWP, WayPoint* poSecondWP )
{
Link::fn_vSetWaypoints ( poFirstWP, poSecondWP );
}
void LinkArc::fn_vInitGraphic (void)
{
Link::fn_vInitGraphic ();
fn_vInitCenter (m_bInitCenter);
m_bInitCenter=FALSE;
}
void LinkArc::fn_vStartEdit (void)
{
if (m_bRotationMode) return;
fn_vSetDrawOutHierarchy (FALSE);
//---- plane
fn_vConstructPlane();
if (m_bFirstEdition)
{
fn_vInitPlaneOrientation ();
m_bFirstEdition=FALSE;
}
fn_vComputeAxis ();
m_bEditPlane = TRUE;
fn_vDrawPlane ();
//----- cursor
// create
m_poCursor= new Cursor ( GetInterface(), m_poGraphic, eCursorCircularLimit );
// insert in hierarchy
m_poCursor->GetSuperObject()->SetSuperObjectOwner (m_poGraphic);
GetInterface()->GetInterface()->fn_bInsertObjectInHierarchy ( m_poCursor->GetSuperObject(), m_poGraphic, FALSE, FALSE, FALSE );
m_poCursor->GetSuperObject()->SetEditProtected (TRUE);
// compute absolute matrix
GetInterface()->fn_vComputeAbsoluteMatrix (m_poCursor->GetSuperObject());
// compute the third point with the center
MTH3D_tdstVector stCursorVertex;
fn_vComputeCursorVertex ( &stCursorVertex );
m_poCursor->fn_vSetAbsoluteVertex (&stCursorVertex);
m_poCursor->fn_vDraw ();
fn_vSetDrawOutHierarchy (TRUE);
GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
}
void LinkArc::fn_vStopEdit (void)
{
m_bEditPlane = FALSE;
fn_vDestroyPlane();
GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
}
void LinkArc::fn_vSetEngineStructure (void)
{
MTH3D_tdstVector stStartPoint;
MTH3D_tdstVector stEndPoint;
MTH3D_tdstVector stCenterPoint;
WP_fnv_WayPoint_ComputeLocation ( (WP_tdhWayPoint)(m_poFirstWP->GetEngineStruct()), &stStartPoint );
WP_fnv_WayPoint_ComputeLocation ( (WP_tdhWayPoint)(m_poSecondWP->GetEngineStruct()), &stEndPoint );
fn_vGetAbsoluteCenter (&stCenterPoint);
//ROMTEAM WorldEditor (Viorel Preoteasa 20/01/98)
// EDWAY_fnv_CircleArcObject_ChangeParams (m_hArcObject,&stStartPoint, &stEndPoint, &stCenterPoint);
m_hArcObject.ChangeParams (&stStartPoint, &stEndPoint, &stCenterPoint);
//ENDROMTEAM WorldEditor (Viorel Preoteasa)
if ( m_poCursor )
if ( m_poCursor->fn_bCursorMove() ) fn_vWayNotifySave ();
}
void LinkArc::fn_vUpdateCenter (void)
{
MTH3D_tdstVector stStartPoint, stEndPoint;
MTH3D_tdstVector stLocalFirstVertex, stLocalSecondVertex, stLocalThirdVertex;
MTH3D_tdstVector stAbsoluteCenter;
MTH3D_tdstVector stCenter;
WP_fnv_WayPoint_ComputeLocation ( (WP_tdhWayPoint)(m_poFirstWP->GetEngineStruct()), &stStartPoint );
WP_fnv_WayPoint_ComputeLocation ( (WP_tdhWayPoint)(m_poSecondWP->GetEngineStruct()), &stEndPoint );
// local vertex
CPA_SuperObject* psoPlane = (CPA_SuperObject*)GetSuperObject()->GetHead();
GetInterface()->fn_vComputeAbsoluteMatrix (psoPlane);
GEO_tdxHandleToMatrix hAbsolutePlaneMatrix = HIE_fn_hGetSuperObjectGlobalMatrix (psoPlane->GetStruct());
POS_tdstCompletePosition InvMatrix;
POS_fn_vSetIdentityMatrix(&InvMatrix);
POS_fn_vInvertMatrix( &InvMatrix , hAbsolutePlaneMatrix );
POS_fn_vMulMatrixVertex( &stLocalFirstVertex, &InvMatrix, &stStartPoint ) ;
POS_fn_vMulMatrixVertex( &stLocalSecondVertex, &InvMatrix, &stEndPoint ) ;
m_poCursor->fn_vGetAbsoluteVertex ( &stAbsoluteCenter );
POS_fn_vMulMatrixVertex( &stLocalThirdVertex, &InvMatrix, &stAbsoluteCenter ) ;
MTH3D_fnv_CircleArcCurve_FindCenter
(
&stLocalFirstVertex,
&stLocalSecondVertex,
&stLocalThirdVertex,
&stCenter
);
POS_fn_vMulMatrixVertex( &stAbsoluteCenter, hAbsolutePlaneMatrix, &stCenter );
fn_vSetAbsoluteCenter ( &stAbsoluteCenter );
}
void LinkArc::fn_vInitCenter (BOOL bInit)
{
if (bInit)
{
MTH3D_tdstVector stFirstVertex, stSecondVertex;
MTH3D_tdstVector u, v, w;
MTH3D_tdstVector stAbsoluteCenter;
WP_fnv_WayPoint_ComputeLocation ( (WP_tdhWayPoint)(m_poFirstWP->GetEngineStruct()), &stFirstVertex );
WP_fnv_WayPoint_ComputeLocation ( (WP_tdhWayPoint)(m_poSecondWP->GetEngineStruct()), &stSecondVertex );
u = stSecondVertex;
MTH3D_M_vSubVector(&u,&u,&stFirstVertex);
MTH3D_M_vMulScalarVector(&u,0.5f,&u);
MTH3D_M_vSetVectorElements ( &w, 0.f, 0.f, 1.f );
MTH3D_M_vCrossProductVector ( &v, &w, &u );
MTH3D_M_vNormalizeVector(&v,&v);
MTH3D_M_vMulScalarVector(&v,1e-3f,&v);
stAbsoluteCenter = stFirstVertex;
MTH3D_M_vAddVector(&stAbsoluteCenter,&stAbsoluteCenter,&u);
MTH3D_M_vAddVector(&stAbsoluteCenter,&stAbsoluteCenter,&v);
fn_vSetAbsoluteCenter (&stAbsoluteCenter);
}
else
{
MTH3D_tdstVector stFirstPoint, stSecondPoint, stCenterPoint;
//ROMTEAM WorldEditor (Viorel Preoteasa 20/01/98)
// EDWAY_fnv_CircleArcObject_GetParams (m_hArcObject, &stFirstPoint, &stSecondPoint, &stCenterPoint);
m_hArcObject.GetParams (&stFirstPoint, &stSecondPoint, &stCenterPoint);
//ENDROMTEAM WorldEditor (Viorel Preoteasa)
fn_vSetAbsoluteCenter (&stCenterPoint);
}
}
void LinkArc::fn_vGetAbsoluteCenter (MTH3D_tdstVector* pstCenter)
{
GetInterface()->fn_vComputeAbsoluteMatrix (GetSuperObject());
GEO_tdxHandleToMatrix hAbsoluteMatrix = HIE_fn_hGetSuperObjectGlobalMatrix (GetSuperObject()->GetStruct());
POS_fn_vMulMatrixVertex( pstCenter, hAbsoluteMatrix, &m_stCenterVertex );
}
void LinkArc::fn_vSetAbsoluteCenter (MTH3D_tdstVector* pstCenter)
{
GetInterface()->fn_vComputeAbsoluteMatrix (GetSuperObject());
GEO_tdxHandleToMatrix hAbsoluteMatrix = HIE_fn_hGetSuperObjectGlobalMatrix (GetSuperObject()->GetStruct());
POS_tdstCompletePosition InvMatrix;
POS_fn_vSetIdentityMatrix(&InvMatrix);
POS_fn_vInvertMatrix( &InvMatrix , hAbsoluteMatrix );
POS_fn_vMulMatrixVertex( &m_stCenterVertex, &InvMatrix, pstCenter );
}
void LinkArc::fn_vComputeCursorVertex ( MTH3D_tdstVector* pstCursorVertex )
{
MTH3D_tdstVector stFirstVertex, stSecondVertex;
MTH3D_tdstVector stCenterVertex;
MTH3D_tdstVector stMildVertex;
MTH3D_tdstVector stVector;
MTH3D_tdstVector stRadiusVector;
WP_fnv_WayPoint_ComputeLocation ( (WP_tdhWayPoint)(m_poFirstWP->GetEngineStruct()), &stFirstVertex );
WP_fnv_WayPoint_ComputeLocation ( (WP_tdhWayPoint)(m_poSecondWP->GetEngineStruct()), &stSecondVertex );
fn_vGetAbsoluteCenter ( &stCenterVertex );
stMildVertex = stFirstVertex;
MTH3D_M_vAddVector(&stMildVertex,&stMildVertex,&stSecondVertex);
MTH3D_M_vMulScalarVector(&stMildVertex,0.5f,&stMildVertex);
stVector = stMildVertex;
MTH3D_M_vSubVector(&stVector,&stVector,&stCenterVertex);
MTH3D_M_vNormalizeVector(&stVector,&stVector);
stRadiusVector = stFirstVertex;
MTH3D_M_vSubVector(&stRadiusVector,&stRadiusVector,&stCenterVertex);
MTH_tdxReal stRadius = GLI_M_Norme(&stRadiusVector);
MTH3D_M_vMulScalarVector(&stVector,stRadius,&stVector);
*pstCursorVertex = stCenterVertex;
MTH3D_M_vAddVector(pstCursorVertex,pstCursorVertex,&stVector);
}
void LinkArc::fn_vGetSaveInfo ( char dszParam [20][20], long& lNbParam )
{
unsigned char ucSamplingRate;
MTH3D_tdstVector stFirstPoint, stSecondPoint, stCenterPoint;
ucSamplingRate = WP_fnuc_Link_GetCurrentSample (GetStruct());
//ROMTEAM WorldEditor (Viorel Preoteasa 20/01/98)
// EDWAY_fnv_CircleArcObject_GetParams (m_hArcObject, &stFirstPoint, &stSecondPoint, &stCenterPoint);
m_hArcObject.GetParams (&stFirstPoint, &stSecondPoint, &stCenterPoint);
//ENDROMTEAM WorldEditor (Viorel Preoteasa)
strcpy ( dszParam [0], "Circle" );
lNbParam = 2;
sprintf ( dszParam[lNbParam++], "%d", ucSamplingRate);
sprintf ( dszParam[lNbParam++], "%f", MTH3D_M_xGetXofVector(&stCenterPoint) );
sprintf ( dszParam[lNbParam++], "%f", MTH3D_M_xGetYofVector(&stCenterPoint) );
sprintf ( dszParam[lNbParam++], "%f", MTH3D_M_xGetZofVector(&stCenterPoint) );
}
void LinkArc::fn_vInitPlaneOrientation (void)
{
MTH3D_tdstVector stFirstPoint, stSecondPoint, stCenterPoint;
//ROMTEAM WorldEditor (Viorel Preoteasa 20/01/98)
// EDWAY_fnv_CircleArcObject_GetParams (m_hArcObject, &stFirstPoint, &stSecondPoint, &stCenterPoint);
m_hArcObject.GetParams (&stFirstPoint, &stSecondPoint, &stCenterPoint);
//ENDROMTEAM WorldEditor (Viorel Preoteasa)
fn_vComputePlaneAxis ( &stCenterPoint );
}
*/
//ENDANNECY Shaitan Nettoyage }

View File

@@ -0,0 +1,356 @@
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : LinkBez.cpp
//
// Edit Bezier Link
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// inherit from : Link
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 29 jan 1997 Author: J Th<54>noz
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
//
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
*/
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
#include "stdafx.h"
#include "acp_base.h"
#include "resource.h"
#include "incitf.h"
#include "incgam.h"
#define _ENG_BEZ_FRIEND_
#include "incai.h"
#undef _ENG_BEZ_FRIEND_
#include "WpObj.hpp"
#include "WayObj.hpp"
#include "LinkObj.hpp"
#include "CurObj.hpp"
#include "Link2D.hpp"
#include "TanObj.hpp"
#include "LinkBez.hpp"
#include "LkBezDia.h"
#include "Inter.hpp"
//ROMTEAM WorldEditor (Viorel Preoteasa 20/01/98)
//ENDROMTEAM WorldEditor (Viorel Preoteasa)
char LinkBez::ms_cType = WP_ConnType_ucBezier;
char LinkBez::ms_szName [10] = "Bezier";
int iJustToLinkBezBidouille;
void fn_vJustToLinkBez (void) { iJustToLinkBezBidouille=1; }
void LinkBez::fn_vRegisterObject (void)
{
tdst_LinkObject* pstLinkObject = new tdst_LinkObject;
strcpy ( pstLinkObject->szName, ms_szName );
pstLinkObject->cType = ms_cType;
pstLinkObject->fn_pConstruct = fn_pConstruct;
ms_oListLinkObject.AddTail (pstLinkObject);
fn_vJustToLinkBez ();
}
LinkBez::LinkBez ( CPA_ObjectDLLBase *p_oDLL, CPA_BaseObject *p_oOwner, WP_tdhLink hLink )
: Link ( p_oDLL, p_oOwner, hLink )
{
MTH3D_tdstVector stNulVector = { 0, 0, 0 };
hLink = (WP_tdhLink)GetEngineStruct();
ACP_tdstDynaParam stDynaParam;
WP_fnv_Link_GetDynamicParameter (hLink,&stDynaParam);
//-----------------------------------------------
//ROMTEAM WorldEditor (Viorel Preoteasa 20/01/98)
m_hBezierObject.CreateWithCurve
(
WP_fnv_Link_GetConnectionTypeBezierCurve (hLink),
EDWAY_C_ucModeNoObject,
NULL,
&WP_M_hLinkGetEngineBezierObject(hLink)->m_dstListOfPoints
);
WP_fnv_Link_SetCurrentSample (hLink, 15);
m_hBezierObject.ChangeSamplingRate(15);
//ENDROMTEAM WorldEditor (Viorel Preoteasa)
//-----------------------------------------------
m_pstStartTangent = new Tangent ( p_oDLL, this, eVariableLenghtTangent, eFixOrientationTangent, eControlUpChangeNeighbour );
m_pstFinishTangent = new Tangent ( p_oDLL, this, eVariableLenghtTangent, eFixOrientationTangent, eControlUpChangeNeighbour );
m_bFirstEdition = TRUE;
}
LinkBez::LinkBez ( CPA_ObjectDLLBase *p_oDLL, CPA_BaseObject *p_oOwner )
: Link ( p_oDLL, p_oOwner )
{
MTH3D_tdstVector stNulVector = { 0, 0, 0 };
WP_tdhLink hLink = (WP_tdhLink)GetEngineStruct();
// allocate bezier structure
WP_fnv_Link_Allocate
(
hLink,
WP_ConnType_ucBezier,
WP_fneuc_Link_GetConnectionDynamicType (hLink)
);
ACP_tdstDynaParam stDynaParam;
WP_fnv_Link_GetDynamicParameter (hLink,&stDynaParam);
//-------------------------------------------
//ROMTEAM WorldEditor (Viorel Preoteasa 20/01/98)
m_hBezierObject.CreateWithCurve
(
WP_fnv_Link_GetConnectionTypeBezierCurve (hLink),
EDWAY_C_ucModeNoObject,
NULL,
&WP_M_hLinkGetEngineBezierObject(hLink)->m_dstListOfPoints
);
// init sampling rate values
WP_fnv_Link_SetCurrentSample (hLink, 15);
m_hBezierObject.ChangeSamplingRate(15);
//ENDROMTEAM WorldEditor (Viorel Preoteasa)
//-------------------------------------------
// c'est comme <20>a -> pour allouer m_dstListOfPoints j'ai pas trouv<75> autre chose
// WP_fnv_Link_ChangeConnectionTypeBezier( hLink, EDWAY_fnh_BezierObject_GetBezierCurve(m_hBezierObject) );
// TEST
// ENG_fnv_BezierObject_BuildListOfPoints( WP_M_hLinkGetEngineBezierObject(hLink) );
// ((ENG_tdstBezierObject) WP_M_hLinkGetEngineBezierObject(hLink))->m_dstListOfPoints = NULL;
// ENG_fnv_BezierObject_SetListOfPoints ( WP_M_hLinkGetEngineBezierObject(hLink), NULL );
// EDWAY_fnv_BezierObject_Calculate (m_hBezierObject);
m_pstStartTangent = new Tangent ( p_oDLL, this, eVariableLenghtTangent, eFixOrientationTangent, eControlUpChangeNeighbour );
m_pstFinishTangent = new Tangent ( p_oDLL, this, eVariableLenghtTangent, eFixOrientationTangent, eControlUpChangeNeighbour );
m_bFirstEdition = TRUE;
}
void LinkBez::fn_vConstructGraphic (void)
{
Link::fn_vConstructGraphic();
m_pstStartTangent->GetSuperObject()->SetSuperObjectOwner (GetSuperObject());
m_pstFinishTangent->GetSuperObject()->SetSuperObjectOwner (GetSuperObject());
}
void LinkBez::fn_vRotationGraphic (BOOL bRotation)
{
Link::fn_vRotationGraphic (bRotation);
if (bRotation)
{
GetInterface()->GetInterface()->fn_bDeleteObjectInHierarchy (m_pstStartTangent->GetSuperObject(), FALSE, FALSE, FALSE, FALSE );
GetInterface()->GetInterface()->fn_bDeleteObjectInHierarchy (m_pstFinishTangent->GetSuperObject(), FALSE, FALSE, FALSE, FALSE );
}
else
{
GetInterface()->GetInterface()->fn_bInsertObjectInHierarchy (m_pstStartTangent->GetSuperObject(), GetSuperObject(),FALSE,FALSE,FALSE);
GetInterface()->GetInterface()->fn_bInsertObjectInHierarchy (m_pstFinishTangent->GetSuperObject(), GetSuperObject(),FALSE,FALSE,FALSE);
}
}
void LinkBez::fn_vInitGraphic (void)
{
Link::fn_vInitGraphic ();
if (!m_bFirstEdition) return;
m_bFirstEdition = FALSE;
// set the vertex of the Tangent object
MTH3D_tdstVector stFirstFixVertex, stSecondFixVertex;
MTH3D_tdstVector stFirstMoveVertex, stSecondMoveVertex;
MTH3D_tdstVector u;
MTH3D_tdstVector stStartPoint, stEndPoint;
MTH3D_tdstVector stStartVector, stEndVector;
WP_fnv_WayPoint_ComputeLocation ( (WP_tdhWayPoint)(m_poFirstWP->GetEngineStruct()), &stFirstFixVertex );
WP_fnv_WayPoint_ComputeLocation ( (WP_tdhWayPoint)(m_poSecondWP->GetEngineStruct()), &stSecondFixVertex );
stFirstMoveVertex = stFirstFixVertex;
stSecondMoveVertex = stSecondFixVertex;
//ROMTEAM WorldEditor (Viorel Preoteasa 20/01/98)
// EDWAY_fnv_BezierObject_GetParams (m_hBezierObject,&stStartPoint, &stEndPoint, &stStartVector, &stEndVector);
m_hBezierObject.GetParams (&stStartPoint, &stEndPoint, &stStartVector, &stEndVector);
//ENDROMTEAM WorldEditor (Viorel Preoteasa)
if ( (MTH3D_M_xNormVector(&stStartVector)>1e-10) && (MTH3D_M_xNormVector(&stEndVector)>1e-10) )
{
// init with load values
MTH3D_M_vAddVector(&stFirstMoveVertex,&stFirstMoveVertex,&stStartVector);
MTH3D_M_vAddVector(&stSecondMoveVertex,&stSecondMoveVertex,&stEndVector);
}
else
{
// set new init values
u = stSecondFixVertex;
MTH3D_M_vSubVector(&u, &u, &stFirstFixVertex );
MTH3D_M_vMulScalarVector(&u,0.15f,&u);
MTH_tdxReal xLenght = MTH3D_M_xNormVector (&u);
if (xLenght<0.1f) MTH3D_M_vMulScalarVector ( &u, 0.1f/xLenght, &u);
MTH3D_M_vAddVector(&stFirstMoveVertex,&stFirstMoveVertex,&u);
MTH3D_M_vMulScalarVector(&u,-1,&u);
MTH3D_M_vAddVector(&stSecondMoveVertex,&stSecondMoveVertex,&u);
}
GetSuperObject()->AddTail ( m_pstStartTangent->GetSuperObject() );
GetSuperObject()->AddTail ( m_pstFinishTangent->GetSuperObject() );
GetInterface()->GetInterface()->fn_vCancelCurrentSelection (FALSE);
m_pstStartTangent->fn_vSetAbsoluteVertex ( &stFirstFixVertex, &stFirstMoveVertex );
m_pstFinishTangent->fn_vSetAbsoluteVertex ( &stSecondFixVertex, &stSecondMoveVertex );
}
void LinkBez::fn_vDrawNormal (void)
{
fn_vComputeAxis ();
m_pstStartTangent->fn_vDraw ();
m_pstFinishTangent->fn_vDraw ();
fn_vSetEngineStructure ();
}
void LinkBez::fn_vDrawOutHierarchy (GLD_tdstViewportAttributes *pViewportAttributes)
{
fn_vSetEngineStructure ();
//ROMTEAM WorldEditor (Viorel Preoteasa 20/01/98)
m_hBezierObject.SetViewPortAttributes( pViewportAttributes );
m_hBezierObject.SetColor (0xFFFFFFFF );
m_hBezierObject.Draw();
//ENDROMTEAM WorldEditor (Viorel Preoteasa)
}
CDialog* LinkBez::fn_pGetSpecificDialog (CWnd* pParentWnd)
{
BezierDia* pDialog = new BezierDia (this);
pDialog->Create ( IDD_BEZIER_DIALOG, pParentWnd );
pDialog->fn_vTutRegister ();
return (CDialog*) pDialog;
}
void LinkBez::fn_vFreeSpecificDialog (CDialog* pDialog)
{
((BezierDia*)pDialog)->fn_vTutUnregister ();
}
void LinkBez::fn_vSetEngineStructure (void)
{
MTH3D_tdstVector stStartPoint;
MTH3D_tdstVector stEndPoint;
MTH3D_tdstVector stStartVector;
MTH3D_tdstVector stEndVector;
m_pstStartTangent->fn_pGetAbsoluteTangent (&stStartVector);
m_pstFinishTangent->fn_pGetAbsoluteTangent (&stEndVector);
WP_fnv_WayPoint_ComputeLocation ( (WP_tdhWayPoint)(m_poFirstWP->GetEngineStruct()), &stStartPoint );
WP_fnv_WayPoint_ComputeLocation ( (WP_tdhWayPoint)(m_poSecondWP->GetEngineStruct()), &stEndPoint );
//ROMTEAM WorldEditor (Viorel Preoteasa 20/01/98)
m_hBezierObject.ChangeParams(&stStartPoint, &stEndPoint, &stStartVector, &stEndVector);
//ENDROMTEAM WorldEditor (Viorel Preoteasa)
}
void LinkBez::fn_vChangeNeighbourTangent (Tangent* pTangent)
{
Link::fn_vChangeNeighbourTangent (pTangent);
Link* pChangeLink;
if (m_pstStartTangent==pTangent)
{
pChangeLink = m_poParent->fn_pPrevLink (this);
if (pChangeLink)
if (pChangeLink->fn_cGetType()==WP_ConnType_ucBezier)
{
MTH3D_tdstVector stTangent;
pTangent->fn_pGetAbsoluteTangent(&stTangent);
((LinkBez*)pChangeLink)->fn_vSetTangent ( 2, &stTangent );
pChangeLink->fn_vDraw ();
}
}
else
{
pChangeLink = m_poParent->fn_pNextLink (this);
if (pChangeLink)
if (pChangeLink->fn_cGetType()==WP_ConnType_ucBezier)
{
MTH3D_tdstVector stTangent;
pTangent->fn_pGetAbsoluteTangent(&stTangent);
((LinkBez*)pChangeLink)->fn_vSetTangent ( 1, &stTangent );
pChangeLink->fn_vDraw ();
}
}
}
void LinkBez::fn_vSetTangent ( int iSide, MTH3D_tdstVector* pTangentVertex )
{
switch (iSide)
{
case 1 : m_pstStartTangent->fn_vSetTangentDirection (pTangentVertex,TRUE); break;
case 2 : m_pstFinishTangent->fn_vSetTangentDirection (pTangentVertex,TRUE); break;
}
}
void LinkBez::fn_vGetSaveInfo ( char dszParam [20][20], long& lNbParam )
{
unsigned char ucSamplingRate;
MTH3D_tdstVector stFirstPoint, stSecondPoint, stFirstVector, stSecondVector;
ucSamplingRate = WP_fnuc_Link_GetCurrentSample (GetStruct());
//ROMTEAM WorldEditor (Viorel Preoteasa 20/01/98)
// EDWAY_fnv_BezierObject_GetParams ( m_hBezierObject, &stFirstPoint, &stSecondPoint, &stFirstVector, &stSecondVector );
m_hBezierObject.GetParams (&stFirstPoint, &stSecondPoint, &stFirstVector, &stSecondVector );
//ENDROMTEAM WorldEditor (Viorel Preoteasa)
strcpy ( dszParam [0], "Bezier" );
lNbParam = 2;
sprintf ( dszParam[lNbParam++], "%d", ucSamplingRate);
sprintf ( dszParam[lNbParam++], "%f", MTH3D_M_xGetXofVector(&stFirstVector) );
sprintf ( dszParam[lNbParam++], "%f", MTH3D_M_xGetYofVector(&stFirstVector) );
sprintf ( dszParam[lNbParam++], "%f", MTH3D_M_xGetZofVector(&stFirstVector) );
sprintf ( dszParam[lNbParam++], "%f", MTH3D_M_xGetXofVector(&stSecondVector) );
sprintf ( dszParam[lNbParam++], "%f", MTH3D_M_xGetYofVector(&stSecondVector) );
sprintf ( dszParam[lNbParam++], "%f", MTH3D_M_xGetZofVector(&stSecondVector) );
}
void LinkBez::fn_vInitEditorFromEngine (void)
{
}
*/
//ENDANNECY Shaitan Nettoyage }

View File

@@ -0,0 +1,157 @@
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : LinkLine.cpp
//
// Definition of the link editors objects
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// inherit from : Link
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 29 jan 1997 Author: J Th<54>noz
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
//
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
*/
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
#include "stdafx.h"
#include "acp_base.h"
#include "incitf.h"
#include "incgam.h"
#include "incai.h"
#include "WPObj.hpp"
#include "WayObj.hpp"
#include "LinkObj.hpp"
#include "LinkLine.hpp"
#include "Eng_StLi.h"
#include "Inter.hpp"
char LinkLine::ms_cType = WP_ConnType_ucStaticLine;
char LinkLine::ms_szName [10] = "Line";
void LinkLine::fn_vRegisterObject (void)
{
tdst_LinkObject* pstLinkObject = new tdst_LinkObject;
strcpy ( pstLinkObject->szName, ms_szName );
pstLinkObject->cType = ms_cType;
pstLinkObject->fn_pConstruct = fn_pConstruct;
ms_oListLinkObject.AddTail (pstLinkObject);
}
LinkLine::LinkLine ( CPA_ObjectDLLBase *p_oDLL, CPA_BaseObject *p_oOwner, WP_tdhLink hLink )
: Link ( p_oDLL, p_oOwner, hLink )
{
m_xLBeam = 0.034f;
fn_vSetType ( WP_ConnType_ucStaticLine );
}
LinkLine::LinkLine ( CPA_ObjectDLLBase *p_oDLL, CPA_BaseObject *p_oOwner )
: Link ( p_oDLL, p_oOwner )
{
m_xLBeam = 0.034f;
fn_vSetType ( WP_ConnType_ucStaticLine );
}
void LinkLine::fn_vConstructGraphic (void)
{
CPA_SuperObject* poGraphic = GetInterface()->fn_pGetNewLineGraphicObject();
poGraphic->SetSuperObjectOwner (GetSuperObject());
GetSuperObject()->AddTail (poGraphic);
GEO_xComputeObjectNormals ( (ACP_tdxHandleOfObject)HIE_fn_hGetSuperObjectObject(poGraphic->GetStruct()));
poGraphic->SetEditProtected (TRUE);
}
void LinkLine::fn_vRotationGraphic (BOOL bRotation)
{
Link::fn_vRotationGraphic (bRotation);
}
void LinkLine::fn_vDrawNormal (void)
{
MTH3D_tdstVector stFirstVertex, stSecondVertex;
tdeLocalColor tdColor = GetSuperObject()->GetLocalColor ();
WP_fnv_WayPoint_ComputeLocation ( (WP_tdhWayPoint)(m_poFirstWP->GetEngineStruct()), &stFirstVertex );
WP_fnv_WayPoint_ComputeLocation ( (WP_tdhWayPoint)(m_poSecondWP->GetEngineStruct()), &stSecondVertex );
CPA_SuperObject* psoLine = (CPA_SuperObject*)GetSuperObject()->GetHead();
GLI_tdxValue d=(GLI_tdxValue)(m_xLBeam*0.5);
GLI_tdxValue md=(GLI_tdxValue)(-m_xLBeam*0.5);
GLI_tdxValue d2=(GLI_tdxValue)(m_xLBeam*2.);
GLI_tdxValue md2=(GLI_tdxValue)(-m_xLBeam*2.);
GLI_tdxValue zero=(GLI_tdxValue)0.;
MTH3D_tdstVector n, u, v;
MTH3D_tdstVector Ox = { 1., 0., 0. };
// Version finale
ACP_tdxHandleOfObject hMot = (ACP_tdxHandleOfObject) HIE_fn_hGetSuperObjectObject(psoLine->GetStruct());
n = stSecondVertex;
MTH3D_M_vSubVector(&n,&n,&stFirstVertex);
GLI_tdxValue lenght = MTH3D_M_xNormVector( &n );
MTH3D_tdstVector a8_stPoint [8];
MTH3D_M_vSetVectorElements (a8_stPoint, md2,md2,zero);
MTH3D_M_vSetVectorElements (a8_stPoint+1, d2,md2,zero);
MTH3D_M_vSetVectorElements (a8_stPoint+2, d2,d2,zero);
MTH3D_M_vSetVectorElements (a8_stPoint+3, md2,d2,zero);
MTH3D_M_vSetVectorElements (a8_stPoint+4, md,md,lenght);
MTH3D_M_vSetVectorElements (a8_stPoint+5, d,md,lenght);
MTH3D_M_vSetVectorElements (a8_stPoint+6, d,d,lenght);
MTH3D_M_vSetVectorElements (a8_stPoint+7, md,d,lenght);
GEO_vSetListOfPointsOfObject
(
hMot,
a8_stPoint,
8,
0
);
GEO_xComputeObjectNormals ( hMot );
MTH3D_M_vNormalizeVector(&n,&n);
// here : to rotate the beam around its principal axis
// by defaults find section align with plan z=0
if (n.xX||n.xY) { MTH3D_M_vSetVectorElements ((&u),(-n.xY),(n.xX),0.); }
else { MTH3D_M_vSetVectorElements((&u),0.,(-n.xZ),n.xY); }
MTH3D_M_vNormalizeVector(&u,&u);
MTH3D_M_vCrossProductVector((&v),(&n),(&u));
// change the local matrix
GEO_tdxHandleToMatrix hAbsoluteLineMatrix = HIE_fn_hGetSuperObjectGlobalMatrix (psoLine->GetStruct());
POS_fn_vSetIdentityMatrix( hAbsoluteLineMatrix );
POS_fn_vSetTranslationVector( hAbsoluteLineMatrix, &stFirstVertex );
POS_fn_vSetRotationMatrix( hAbsoluteLineMatrix , &u, &v, &n );
GetInterface()->fn_vComputeNewRelativeMatrix (psoLine->GetStruct());
}
void LinkLine::fn_vGetSaveInfo ( char dszParam [20][20], long& lNbParam )
{
strcpy ( dszParam [0], "StaticLine" );
lNbParam = 2;
}
void LinkLine::fn_vSetWaypoints ( WayPoint* poFirstWP, WayPoint* poSecondWP )
{
Link::fn_vSetWaypoints ( poFirstWP, poSecondWP );
if (poFirstWP && poSecondWP)
WP_fnv_Link_ChangeConnectionTypeStaticLineObject ((WP_tdhLink)GetData(), (WP_tdhWayPoint)poFirstWP->GetData(), (WP_tdhWayPoint)poSecondWP->GetData() );
}
*/
//ENDANNECY Shaitan Nettoyage }

View File

@@ -0,0 +1,30 @@
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : LinkMod.cpp
//
// Modification class.
// This class is used to implement the Do/Undo actions.
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// inherit from CPA_Modif
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 21 jan 1997 Author: J Th<54>noz
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
//
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
*/
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
//#include "LinkMod.hpp"
//#include "Inter.hpp"
*/
//ENDANNECY Shaitan Nettoyage }

View File

@@ -0,0 +1,875 @@
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : LinkObj.cpp
//
// Definition of the link editors objects
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// inherit from : CPA_Object
// CPA_EdMot<ACP_tdxHandleOfLink>
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 21 jan 1997 Author: J Th<54>noz
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
//
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
*/
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
#include "stdafx.h"
#include "acp_base.h"
#include "resource.h"
#include "incitf.h"
#include "incgam.h"
#include "incai.h"
#include "LinkMod.hpp"
#include "LinkDia.hpp"
#include "RotDia.hpp"
#include "incgli.h"
#include "WPObj.hpp"
#include "WayObj.hpp"
#include "LinkObj.hpp"
#include "Link2D.hpp"
#include "Inter.hpp"
#include "TanObj.hpp"
#include "LinkLine.hpp"
#include "LinkBez.hpp"
#include "LinkArc.hpp"
#include "LinkObj.hpp"
DeclareTemplateStatic(WP_tdhLink);
//---- static
Waypoint_Interface* Link::ms_poInterface; // Interface
DiaLink* Link::ms_poDiaLink; // Dialog
RotationDia* Link::ms_poRotationDia; // Rotation Dialog
CPA_List<tdst_LinkObject> Link::ms_oListLinkObject; // List of the present links
long Link::ms_lNbLink=0;
void Link::fn_vInitObject (Waypoint_Interface* poInterface)
{
CPA_EdMot<WP_tdhLink>::Init (WP_fnh_Link_Create, WP_fnv_Link_Copy, WP_fnv_Link_Destroy);
LinkLine::fn_vRegisterObject();
LinkBez::fn_vRegisterObject();
LinkArc::fn_vRegisterObject();
ms_poInterface = poInterface;
}
void Link::fn_vSetDialog ( DiaLink* poDiaLink, RotationDia* poRotationDia )
{
ms_poDiaLink=poDiaLink;
ms_poDiaLink->fn_vInitDialog ();
ms_poRotationDia=poRotationDia;
ms_poRotationDia->fn_vInitDialog ();
}
Link* Link::fn_pCreateLink ( Way* poWay, char cType, WayPoint* poFirstWP, WayPoint* poSecondWP, WP_tdhLink hLink )
{
CPA_SuperObject* poSuperLink = ms_poInterface->GetInterface()->GetNewSuperObject ( E_ss_NoSave, C_NoType );
poSuperLink->SetTypeSO (C_Protected);
Link* poLink;
POSITION xPos;
tdst_LinkObject* pst_LinkObject;
if (hLink)
cType = (char) WP_fneuc_Link_GetConnectionType (hLink);
// important loop that call the right constructor
for ( pst_LinkObject=ms_oListLinkObject.GetHeadElement (xPos); pst_LinkObject; pst_LinkObject=ms_oListLinkObject.GetNextElement (xPos) )
if (pst_LinkObject->cType==cType)
poLink = pst_LinkObject->fn_pConstruct ( poWay->GetInterface(), poWay, hLink );
poLink->fn_vSetDraw (TRUE);
poSuperLink->SetObject(poLink);
poLink->SetSuperObject(poSuperLink);
//---- set dynamics parameters
if (!hLink)
{
ACP_tdstDynaParam stDynParam;
WP_fnv_Link_GetDynamicParameter ( (WP_tdhLink)(poLink->GetEngineStruct()), &stDynParam );
fn_vDynamicObject_ChangeParams( &stDynParam, C_ucNone, 0., 0., 0.);
WP_fnv_Link_SetDynamicParameter ( (WP_tdhLink)(poLink->GetEngineStruct()), &stDynParam );
}
//---- create the graphic object
poLink->fn_vConstructGraphic ();
poLink->fn_vSetWaypoints ( poFirstWP, poSecondWP );
return poLink;
}
Link* Link::fn_pCreateLink ( Way* poWay, WP_tdhLink hLink, WayPoint* poFirstWP, WayPoint* poSecondWP )
{
Link* poLink;
char cType;
cType = (char) WP_fneuc_Link_GetConnectionType (hLink);
poLink = fn_pCreateLink ( poWay, cType, poFirstWP, poSecondWP, hLink );
poLink->fn_vSetDrawOutHierarchy (TRUE);
poLink->fn_vInitEditorFromEngine ();
return poLink;
}
Link* Link::CloneLink ( Way* poWay, Link* poLink, CString& szNewLinkName )
{
char cNewType = WP_ConnType_ucInvalid;
POSITION xPos;
tdst_LinkObject* pst_LinkObject;
WayPoint *poFirstWP, *poSecondWP;
// search the type of the new link
for ( pst_LinkObject=ms_oListLinkObject.GetHeadElement (xPos); pst_LinkObject; pst_LinkObject=ms_oListLinkObject.GetNextElement (xPos) )
if (!strcmp (pst_LinkObject->szName, szNewLinkName)) cNewType = pst_LinkObject->cType;
if (cNewType == WP_ConnType_ucInvalid) return NULL;
// Set waypoints
poLink->fn_vGetWaypoints ( &poFirstWP, &poSecondWP );
// Set dynamic parameters
ACP_tdstDynaParam stDynParam; // dynamic param
WP_tde_ucConnectionDynamicType eConnectionType; // type
WP_fnv_Link_GetDynamicParameter ( (WP_tdhLink)(poLink->GetEngineStruct()), &stDynParam );
eConnectionType = WP_fneuc_Link_GetConnectionDynamicType ( (WP_tdhLink)(poLink->GetEngineStruct()) );
Link* poNewLink = fn_pCreateLink ( poWay, cNewType, poFirstWP, poSecondWP );
WP_fnv_Link_SetDynamicParameter ( (WP_tdhLink)(poNewLink->GetEngineStruct()), &stDynParam );
WP_fnv_Link_SetConnectionDynamicType ( (WP_tdhLink)(poNewLink->GetEngineStruct()), eConnectionType );
return poNewLink;
}
Link::Link( CPA_ObjectDLLBase *p_oDLL, CPA_BaseObject *p_oOwner, WP_tdhLink hLink ):
CPA_BaseObject ( p_oDLL, "Link" ),
CPA_EdMot<WP_tdhLink>(hLink)
{
m_poParent = (Way*)p_oOwner;
m_bAddInHierarchy=FALSE;
m_bRemoveInHierarchy=FALSE;
m_bDraw=FALSE;
m_bCanDrawOutHierarchy=FALSE;
m_bRotationMode=FALSE;
m_bFirstEdition=TRUE;
m_xOrientationTangentLenght=0.5f;
m_bXDirectOrientation=TRUE;
m_bYDirectOrientation=TRUE;
m_bZDirectOrientation=TRUE;
m_lNbLapXOrientation=0L;
m_lNbLapYOrientation=0L;
m_lNbLapZOrientation=0L;
m_xFirstTwistOrientation=0.;
m_xSecondTwistOrientation=0.;
// name
CString csName;
csName.Format ("Link%d", ms_lNbLink);
ms_lNbLink++;
fn_eRename (csName);
//--- init dyn params
WP_fnv_Link_SetConnectionDynamicType ( GetStruct(), WP_ConDynType_ucNone );
//--- orientation tangent
GEO_tdstColor stColor;
stColor.xR = 0.f;
stColor.xG = 0.f;
stColor.xB = 0.8f;
m_poFirstOrientationTangent = new Tangent ( p_oDLL, this, eFixLenghtTangent, eVariableOrientationTangent, eControlDownChangeNeighbour, eShiftDownChangeAll, &stColor );
stColor.xR = 0.8f;
stColor.xG = 0.8f;
stColor.xB = 0.f;
m_poSecondOrientationTangent = new Tangent ( p_oDLL, this, eFixLenghtTangent, eVariableOrientationTangent,eControlDownChangeNeighbour, eShiftDownChangeAll, &stColor );
}
Link::Link( CPA_ObjectDLLBase *p_oDLL, CPA_BaseObject *p_oOwner ):
CPA_BaseObject ( p_oDLL, "Link" ),
CPA_EdMot<WP_tdhLink>()
{
WP_fnv_Link_SetConnectionType ( (WP_tdhLink)GetStruct(), WP_ConnType_ucInvalid);
m_poParent = (Way*)p_oOwner;
m_bAddInHierarchy=FALSE;
m_bRemoveInHierarchy=FALSE;
m_bDraw=FALSE;
m_bCanDrawOutHierarchy=FALSE;
m_bRotationMode=FALSE;
m_bFirstEdition=TRUE;
m_xOrientationTangentLenght=0.5f;
m_bXDirectOrientation=TRUE;
m_bYDirectOrientation=TRUE;
m_bZDirectOrientation=TRUE;
m_lNbLapXOrientation=0L;
m_lNbLapYOrientation=0L;
m_lNbLapZOrientation=0L;
m_xFirstTwistOrientation=0.;
m_xSecondTwistOrientation=0.;
// name
CString csName;
csName.Format ("Link%d", ms_lNbLink);
ms_lNbLink++;
fn_eRename (csName);
//--- init dyn params
WP_fnv_Link_SetConnectionDynamicType ( GetStruct(), WP_ConDynType_ucNone );
fn_vWayNotifySave ();
//--- orientation tangent
GEO_tdstColor stColor;
stColor.xR = 0.f;
stColor.xG = 0.f;
stColor.xB = 0.8f;
m_poFirstOrientationTangent = new Tangent ( p_oDLL, this, eFixLenghtTangent, eVariableOrientationTangent, eControlDownChangeNeighbour, eShiftDownChangeAll, &stColor );
stColor.xR = 0.8f;
stColor.xG = 0.8f;
stColor.xB = 0.f;
m_poSecondOrientationTangent = new Tangent ( p_oDLL, this, eFixLenghtTangent, eVariableOrientationTangent,eControlDownChangeNeighbour, eShiftDownChangeAll, &stColor );
}
//-------------------------------------------------------------------
// Data
//-------------------------------------------------------------------
long Link::GetDataType (void)
{
return C_ucLink;
}
void* Link::GetData (void)
{
return GetStruct();
}
SCRIPT_tdeReturnValue Link::CallBackLoad (FILE *p_fFile, char *szAction, char *szParams[], SCRIPT_tdeAction cType)
{
return R_SCRIPT_NormalReturn;
}
void Link::fn_vSplitLink ( Way* poWay, WayPoint* poWP, Link** pLinkBefore, Link** pLinkAfter )
{
// create and set the extrems WP
*pLinkBefore = (Link*)(poWay->fn_pCreateLink(WP_ConnType_ucStaticLine)->GetObject());
*pLinkAfter = (Link*)(poWay->fn_pCreateLink(WP_ConnType_ucStaticLine)->GetObject());
(*pLinkBefore)->fn_vSetWaypoints ( m_poFirstWP, poWP );
(*pLinkAfter)->fn_vSetWaypoints ( poWP, m_poSecondWP );
}
Link* Link::fn_pMergeLink ( Way* poWay, Link* pLink )
{
if (!pLink) return NULL;
Link* pMergeLink = (Link*)(poWay->fn_pCreateLink(WP_ConnType_ucStaticLine)->GetObject());
// set the extrems WP
WayPoint *oFirstWP, *oSecondWP, *oBufferWP;
fn_vGetWaypoints ( &oFirstWP, &oBufferWP );
pLink->fn_vGetWaypoints ( &oBufferWP, &oSecondWP );
pMergeLink->fn_vSetWaypoints ( oFirstWP, oSecondWP );
return pMergeLink;
}
//-------- Set
void Link::fn_vSetType ( WP_tde_ucConnectionType cType )
{
WP_fnv_Link_SetConnectionType ( ((WP_tdhLink)GetEngineStruct()), cType );
}
//-------- Get
char Link::fn_cGetType ( void )
{
return WP_fneuc_Link_GetConnectionType ( ((WP_tdhLink)GetEngineStruct()) );
}
void Link::fn_vSave ( SCR_tdst_File_Description *_p_stFile )
{
ACP_tdstDynaParam stDynParam;
unsigned char ucDynamicType;
float fSpeed1, fSpeed2, fSpeed3;
long lNbParam=0;
char* dszParam [20];
char a20_20_szParam [20][20];
fn_vGetSaveInfo ( a20_20_szParam, lNbParam );
// dynamic conection type
switch ( WP_fneuc_Link_GetConnectionDynamicType (GetStruct()) )
{
case WP_ConDynType_ucNone : strcpy ( a20_20_szParam[1], "None"); break;
case WP_ConDynType_ucConstant : strcpy ( a20_20_szParam[1], "Constant"); break;
case WP_ConDynType_ucLinear : strcpy ( a20_20_szParam[1], "Linear"); break;
case WP_ConDynType_ucSinus : strcpy ( a20_20_szParam[1], "Sinus"); break;
default : dszParam[1][0]=0; break;
}
// dynamic param
WP_tdhLink hLink = (WP_tdhLink)GetEngineStruct();
WP_fnv_Link_GetDynamicParameter(hLink,&stDynParam);
fn_vDynamicObject_GetParams( &stDynParam, &ucDynamicType, &fSpeed1, &fSpeed2, &fSpeed3);
switch ( ucDynamicType )
{
case C_ucConst :
sprintf ( a20_20_szParam[lNbParam++], "%g", fSpeed1 );
break;
case C_ucLinear :
sprintf ( a20_20_szParam[lNbParam++], "%g", fSpeed1 );
sprintf ( a20_20_szParam[lNbParam++], "%g", fSpeed2 );
break;
case C_ucSinus :
sprintf ( a20_20_szParam[lNbParam++], "%g", fSpeed1 );
sprintf ( a20_20_szParam[lNbParam++], "%g", fSpeed2 );
sprintf ( a20_20_szParam[lNbParam++], "%g", fSpeed3 );
break;
}
// save rotation parameters
MTH3D_tdstVector stFirstOrientationVector, stSecondOrientationVector;
fn_vDynamicObject_GetRotation( &stDynParam, &stFirstOrientationVector, &stSecondOrientationVector );
sprintf ( a20_20_szParam[lNbParam++], "%g", MTH3D_M_xGetXofVector(&stFirstOrientationVector) );
sprintf ( a20_20_szParam[lNbParam++], "%g", MTH3D_M_xGetYofVector(&stFirstOrientationVector) );
sprintf ( a20_20_szParam[lNbParam++], "%g", MTH3D_M_xGetZofVector(&stFirstOrientationVector) );
sprintf ( a20_20_szParam[lNbParam++], "%g", MTH3D_M_xGetXofVector(&stSecondOrientationVector) );
sprintf ( a20_20_szParam[lNbParam++], "%g", MTH3D_M_xGetYofVector(&stSecondOrientationVector) );
sprintf ( a20_20_szParam[lNbParam++], "%g", MTH3D_M_xGetZofVector(&stSecondOrientationVector) );
// write entry
for ( long lCounter = 0; lCounter<20; lCounter++ ) dszParam[lCounter]=a20_20_szParam[lCounter];
SCR_M_SvL0_SaveEntry( _p_stFile, "Link", SCR_CC_C_Cfg_NoChar );
SCR_fn_v_SvL0_SaveParameters_AP( _p_stFile, SCR_EF_SvL0_Normal, lNbParam, dszParam);
}
Waypoint_Interface* Link::GetInterface (void)
{
return ms_poInterface;
}
void Link::fn_vWayNotifySave (void)
{
m_poParent->fn_vNotifySave ();
}
void Link::fn_vEdit (void)
{
int iPos = m_poParent->fn_iIsWayPointInNet (m_poFirstWP,m_poSecondWP);
GetInterface()->fn_vEdit ( m_poParent, iPos>0 ? iPos : 0 );
}
void Link::fn_vSelectWay (void)
{
GetInterface()->GetInterface()->fn_vAddSelectedObject ( m_poParent->GetSuperObject(), FALSE);
m_poParent->fn_vSelectAllWP ();
}
void Link::fn_vConstructGraphic (void)
{
m_poFirstOrientationTangent->GetSuperObject()->SetSuperObjectOwner (GetSuperObject());
m_poSecondOrientationTangent->GetSuperObject()->SetSuperObjectOwner (GetSuperObject());
}
void Link::fn_vInitGraphic (void)
{
if (!m_bFirstEdition) return;
m_bFirstEdition = FALSE;
fn_vComputeAxis ();
MTH3D_tdstVector stFirstFixVertex, stSecondFixVertex;
MTH3D_tdstVector stFirstMoveVertex, stSecondMoveVertex;
WP_fnv_WayPoint_ComputeLocation ( (WP_tdhWayPoint)(m_poFirstWP->GetEngineStruct()), &stFirstFixVertex );
WP_fnv_WayPoint_ComputeLocation ( (WP_tdhWayPoint)(m_poSecondWP->GetEngineStruct()), &stSecondFixVertex );
// init orientation parameters
MTH3D_tdstVector u;
ACP_tdstDynaParam stDynaParam;
MTH3D_tdstVector stFirstEngineOrientationVector, stSecondEngineOrientationVector;
MTH3D_tdstVector stFirstEditorOrientationVector, stSecondEditorOrientationVector;
MTH_tdxReal stFirstXRot, stFirstYRot, stFirstZRot;
MTH_tdxReal stSecondXRot, stSecondYRot, stSecondZRot;
stFirstXRot = MTH_C_ZERO;
stFirstYRot = MTH_C_ZERO;
stFirstZRot = MTH_C_ZERO;
stSecondXRot = MTH_C_ZERO;
stSecondYRot = MTH_C_ZERO;
stSecondZRot = MTH_C_ZERO;
WP_tdhLink hLink = (WP_tdhLink)GetEngineStruct();
WP_fnv_Link_GetDynamicParameter (hLink,&stDynaParam);
fn_vDynamicObject_GetRotation( &stDynaParam, &stFirstEngineOrientationVector, &stSecondEngineOrientationVector );
u =stSecondFixVertex;
MTH3D_M_vSubVector( &u, &u, &stFirstFixVertex );
MTH3D_M_vNormalizeVector(&u,&u);
MTH3D_M_vMulScalarVector(&u,m_xOrientationTangentLenght,&u);
stFirstMoveVertex = stFirstFixVertex;
stSecondMoveVertex = stSecondFixVertex;
if (MTH3D_M_xNormVector(&stFirstEngineOrientationVector)>=1e-10)
{
MTH3D_M_vGetVectorElements ( &stFirstXRot, &stFirstYRot, &stFirstZRot, &stFirstEngineOrientationVector );
fn_vRotation2Vertex ( &stFirstEditorOrientationVector, &m_xFirstTwistOrientation, &stFirstXRot, &stFirstYRot, &stFirstZRot );
MTH3D_M_vNormalizeVector(&stFirstEditorOrientationVector,&stFirstEditorOrientationVector);
MTH3D_M_vMulScalarVector(&stFirstEditorOrientationVector,m_xOrientationTangentLenght,&stFirstEditorOrientationVector);
}
else stFirstEditorOrientationVector = u;
MTH3D_M_vAddVector(&stFirstMoveVertex,&stFirstMoveVertex,&stFirstEditorOrientationVector);
if (MTH3D_M_xNormVector(&stSecondEngineOrientationVector)>=1e-10)
{
MTH3D_M_vGetVectorElements ( &stSecondXRot, &stSecondYRot, &stSecondZRot, &stSecondEngineOrientationVector );
fn_vRotation2Vertex ( &stSecondEditorOrientationVector, &m_xSecondTwistOrientation, &stSecondXRot, &stSecondYRot, &stSecondZRot );
MTH3D_M_vNormalizeVector(&stSecondEditorOrientationVector,&stSecondEditorOrientationVector);
MTH3D_M_vMulScalarVector(&stSecondEditorOrientationVector,m_xOrientationTangentLenght,&stSecondEditorOrientationVector);
}
else stSecondEditorOrientationVector = u;
MTH3D_M_vAddVector(&stSecondMoveVertex,&stSecondMoveVertex,&stSecondEditorOrientationVector);
fn_vExtractModulusRotation ( &m_bXDirectOrientation, &m_lNbLapXOrientation, stFirstXRot, stSecondXRot );
fn_vExtractModulusRotation ( &m_bYDirectOrientation, &m_lNbLapYOrientation, stFirstYRot, stSecondYRot );
fn_vExtractModulusRotation ( &m_bZDirectOrientation, &m_lNbLapZOrientation, stFirstZRot, stSecondZRot );
// matrix compute
Link::fn_vRotationGraphic (TRUE);
m_poFirstOrientationTangent->fn_vSetAbsoluteVertex ( &stFirstFixVertex, &stFirstMoveVertex );
m_poSecondOrientationTangent->fn_vSetAbsoluteVertex ( &stSecondFixVertex, &stSecondMoveVertex );
Link::fn_vRotationGraphic (FALSE);
}
void Link::fn_vRotationGraphic (BOOL bRotation)
{
if (m_bRotationMode==bRotation) return;
m_bRotationMode=bRotation;
if (bRotation)
{
// hierarchy
GetInterface()->GetInterface()->fn_bInsertObjectInHierarchy (m_poFirstOrientationTangent->GetSuperObject(), GetSuperObject(),FALSE,FALSE,FALSE);
GetInterface()->GetInterface()->fn_bInsertObjectInHierarchy (m_poSecondOrientationTangent->GetSuperObject(), GetSuperObject(),FALSE,FALSE,FALSE);
// dialog
if (ms_poDiaLink->fn_bIsEditLink(this)) ms_poDiaLink->fn_vEdit (NULL);
}
else
{
// hierarchy
GetInterface()->GetInterface()->fn_bDeleteObjectInHierarchy (m_poFirstOrientationTangent->GetSuperObject(), FALSE, FALSE, FALSE, FALSE );
GetInterface()->GetInterface()->fn_bDeleteObjectInHierarchy (m_poSecondOrientationTangent->GetSuperObject(), FALSE, FALSE, FALSE, FALSE );
// dialog
if (ms_poRotationDia->fn_bIsEditLink(this)) ms_poRotationDia->fn_vEdit (NULL);
}
}
void Link::fn_vDraw (void)
{
if (m_bRotationMode)
{
fn_vComputeAxis();
m_poFirstOrientationTangent->fn_vDraw ();
m_poSecondOrientationTangent->fn_vDraw ();
fn_vDrawRotation ();
fn_vRefreshEngineOrientation();
}
else
{
fn_vComputeAxis();
fn_vDrawNormal ();
}
}
void Link::fn_vComputeAxis (void)
{
MTH3D_tdstVector stFirstVertex, stSecondVertex;
MTH3D_tdstVector stVectorU, stVectorV, stVectorN;
MTH3D_tdstVector n, u, v;
WP_fnv_WayPoint_ComputeLocation ( (WP_tdhWayPoint)(m_poFirstWP->GetEngineStruct()), &stFirstVertex );
WP_fnv_WayPoint_ComputeLocation ( (WP_tdhWayPoint)(m_poSecondWP->GetEngineStruct()), &stSecondVertex );
n = stSecondVertex;
MTH3D_M_vSubVector(&n,&n,&stFirstVertex);
GLI_tdxValue lenght = MTH3D_M_xNormVector( &n );
MTH3D_M_vNormalizeVector(&n,&n);
if (n.xX||n.xY) { MTH3D_M_vSetVectorElements ((&u),(-n.xY),(n.xX),0.); }
else { MTH3D_M_vSetVectorElements((&u),0.,(-n.xZ),n.xY); }
MTH3D_M_vNormalizeVector(&u,&u);
MTH3D_M_vCrossProductVector((&v),(&n),(&u));
MTH3D_M_vNormalizeVector(&v,&v);
// change the local matrix
GetInterface()->fn_vComputeAbsoluteMatrix (GetSuperObject());
GEO_tdxHandleToMatrix hAbsoluteLineMatrix = HIE_fn_hGetSuperObjectGlobalMatrix (GetSuperObject()->GetStruct());
POS_fn_vSetIdentityMatrix( hAbsoluteLineMatrix );
POS_fn_vSetTranslationVector( hAbsoluteLineMatrix, &stFirstVertex );
POS_fn_vSetRotationMatrix( hAbsoluteLineMatrix , &n, &u, &v );
POS_fn_vGetScaleMatrix( hAbsoluteLineMatrix, &stVectorN, &stVectorU, &stVectorV );
MTH3D_M_vMulScalarVector( &stVectorN, lenght, &stVectorN);
POS_fn_vSetScaleMatrix( hAbsoluteLineMatrix, &stVectorN, &stVectorU, &stVectorV );
POS_fn_vNormalizeMatrix( hAbsoluteLineMatrix ) ;
GetInterface()->fn_vComputeNewRelativeMatrix (GetSuperObject()->GetStruct());
}
void Link::fn_vSetXDirectOrientation ( BOOL bXDirectOrientation )
{
m_bXDirectOrientation = bXDirectOrientation;
fn_vRefreshEngineOrientation ();
}
void Link::fn_vSetYDirectOrientation ( BOOL bYDirectOrientation )
{
m_bYDirectOrientation = bYDirectOrientation;
fn_vRefreshEngineOrientation ();
}
void Link::fn_vSetZDirectOrientation ( BOOL bZDirectOrientation )
{
m_bZDirectOrientation = bZDirectOrientation;
fn_vRefreshEngineOrientation ();
}
void Link::fn_vSetNbLapXOrientation ( long lNbLapXOrientation )
{
m_lNbLapXOrientation = lNbLapXOrientation;
fn_vRefreshEngineOrientation ();
}
void Link::fn_vSetNbLapYOrientation ( long lNbLapYOrientation )
{
m_lNbLapYOrientation = lNbLapYOrientation;
fn_vRefreshEngineOrientation ();
}
void Link::fn_vSetNbLapZOrientation ( long lNbLapZOrientation )
{
m_lNbLapZOrientation = lNbLapZOrientation;
fn_vRefreshEngineOrientation ();
}
void Link::fn_vSetFirstTwistOrientation ( MTH_tdxReal xFirstTwistOrientation )
{
m_xFirstTwistOrientation = xFirstTwistOrientation;
fn_vRefreshEngineOrientation ();
}
void Link::fn_vSetSecondTwistOrientation ( MTH_tdxReal xSecondTwistOrientation )
{
m_xSecondTwistOrientation = xSecondTwistOrientation;
fn_vRefreshEngineOrientation ();
}
void Link::fn_vRefreshEngineOrientation (void)
{
ACP_tdstDynaParam stDynaParam;
MTH3D_tdstVector stFirstEngineOrientationVector, stSecondEngineOrientationVector;
MTH3D_tdstVector stFirstAbsoluteOrientationVector, stSecondAbsoluteOrientationVector;
WP_tdhLink hLink = (WP_tdhLink)GetEngineStruct();
m_poFirstOrientationTangent->fn_pGetAbsoluteTangent (&stFirstAbsoluteOrientationVector);
m_poSecondOrientationTangent->fn_pGetAbsoluteTangent (&stSecondAbsoluteOrientationVector);
MTH_tdxReal xXStartRot, xYStartRot, xZStartRot;
MTH_tdxReal xXEndRot, xYEndRot, xZEndRot;
fn_vVertex2Rotation ( &xXStartRot, &xYStartRot, &xZStartRot, &stFirstAbsoluteOrientationVector, &m_xFirstTwistOrientation );
fn_vVertex2Rotation ( &xXEndRot, &xYEndRot, &xZEndRot, &stSecondAbsoluteOrientationVector, &m_xSecondTwistOrientation );
fn_vComputeModulusRotation ( &xXStartRot, &xXEndRot, m_bXDirectOrientation, m_lNbLapXOrientation );
fn_vComputeModulusRotation ( &xYStartRot, &xYEndRot, m_bYDirectOrientation, m_lNbLapYOrientation );
fn_vComputeModulusRotation ( &xZStartRot, &xZEndRot, m_bZDirectOrientation, m_lNbLapZOrientation );
MTH3D_M_vSetVectorElements ( &stFirstEngineOrientationVector, xXStartRot, xYStartRot, xZStartRot );
MTH3D_M_vSetVectorElements ( &stSecondEngineOrientationVector, xXEndRot, xYEndRot, xZEndRot );
WP_fnv_Link_GetDynamicParameter (hLink,&stDynaParam);
fn_vDynamicObject_SetRotation( &stDynaParam, &stFirstEngineOrientationVector, &stSecondEngineOrientationVector );
WP_fnv_Link_SetDynamicParameter (hLink,&stDynaParam);
fn_vWayNotifySave();
}
void Link::fn_vChangeNeighbourTangent (Tangent* pTangent)
{
Link* pChangeLink;
if (m_poFirstOrientationTangent==pTangent)
{
pChangeLink = m_poParent->fn_pPrevLink (this);
if (pChangeLink)
{
MTH3D_tdstVector stTangent;
pTangent->fn_pGetAbsoluteTangent(&stTangent);
pChangeLink->fn_vSetOrientationTangent ( 2, &stTangent );
pChangeLink->fn_vDraw ();
}
}
else
{
pChangeLink = m_poParent->fn_pNextLink (this);
if (pChangeLink)
{
MTH3D_tdstVector stTangent;
pTangent->fn_pGetAbsoluteTangent(&stTangent);
pChangeLink->fn_vSetOrientationTangent ( 1, &stTangent );
pChangeLink->fn_vDraw ();
}
}
}
void Link::fn_vReinitOrientationTangent (Tangent* poTangent)
{
MTH3D_tdstVector stFirstFixVertex, stSecondFixVertex;
WP_fnv_WayPoint_ComputeLocation ( (WP_tdhWayPoint)(m_poFirstWP->GetEngineStruct()), &stFirstFixVertex );
WP_fnv_WayPoint_ComputeLocation ( (WP_tdhWayPoint)(m_poSecondWP->GetEngineStruct()), &stSecondFixVertex );
MTH3D_tdstVector u;
u =stSecondFixVertex;
MTH3D_M_vSubVector( &u, &u, &stFirstFixVertex );
MTH3D_M_vNormalizeVector(&u,&u);
MTH3D_M_vMulScalarVector(&u,m_xOrientationTangentLenght,&u);
poTangent->fn_vSetTangentDirection (&u);
GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
}
void Link::fn_vChangeAllTangent (Tangent* pTangent)
{
// on pourrait blinder en s'assurant que la tangente re<72>ue est bien une tangente d'orientation
MTH3D_tdstVector stTangent;
pTangent->fn_pGetAbsoluteTangent(&stTangent);
m_poParent->fn_vChangeAllOrientationTangent (&stTangent);
}
void Link::fn_vSetOrientationTangent ( int iSide, MTH3D_tdstVector* pTangentVertex )
{
switch (iSide)
{
case 1 : m_poFirstOrientationTangent->fn_vSetTangentDirection (pTangentVertex); break;
case 2 : m_poSecondOrientationTangent->fn_vSetTangentDirection (pTangentVertex); break;
}
}
void Link::fn_vSetAllOrientationTangent (MTH3D_tdstVector* pTangentVertex)
{
m_poFirstOrientationTangent->fn_vSetTangentDirection (pTangentVertex);
m_poSecondOrientationTangent->fn_vSetTangentDirection (pTangentVertex);
fn_vRefreshEngineOrientation ();
}
void Link::fn_vVertex2Rotation (MTH_tdxReal* pxXRot, MTH_tdxReal* pxYRot, MTH_tdxReal* pxZRot, MTH3D_tdstVector* pstVector, MTH_tdxReal* pxRot )
{
MTH3D_tdstVector stU, stV, stW;
MTH3D_tdstVector stu, stw;
MTH_tdxReal xSin, xCos;
MTH3D_tdstMatrix stMatrix;
MTH3D_tdstVector stOx, stOz;
MTH3D_M_vSetVectorElements( &stOx, 1.f, 0.f, 0.f);
MTH3D_M_vSetVectorElements( &stOz, 0.f, 0.f, 1.f);
stV = *pstVector;
MTH3D_M_vNormalizeVector (&stV, &stV);
if ( fn_bIsRealNul(MTH3D_M_xGetXofVector(&stV)) && fn_bIsRealNul(MTH3D_M_xGetYofVector(&stV)) )
{
MTH3D_M_vCrossProductVector ( &stu, &stOx, &stV );
}
else
{
MTH3D_M_vCrossProductVector ( &stu, &stV, &stOz );
}
MTH3D_M_vNormalizeVector (&stu, &stu);
MTH3D_M_vCrossProductVector (&stw, &stu, &stV);
MTH_tdxReal sinRot = MTH_M_xSin ( *pxRot );
MTH_tdxReal cosRot = MTH_M_xCos ( *pxRot );
MTH3D_M_vMulScalarVector ( &stw, cosRot, &stw );
MTH3D_M_vMulScalarVector ( &stu, sinRot, &stu );
MTH3D_M_vAddVector ( &stW, &stw, &stu);
MTH3D_M_vCrossProductVector (&stU, &stV, &stW);
fn_vCorrectNulValue ( &stU );
fn_vCorrectNulValue ( &stV );
fn_vCorrectNulValue ( &stW );
// Ox rotation
*pxXRot = atan2 ( MTH3D_M_xGetZofVector(&stV), MTH3D_M_xGetYofVector(&stV) );
xSin = sin (*pxXRot);
xCos = cos (*pxXRot);
MTH3D_M_vSetMatrixLineXElements( &stMatrix, 1.f, 0.f, 0.f );
MTH3D_M_vSetMatrixLineYElements( &stMatrix, 0.f, xCos, xSin );
MTH3D_M_vSetMatrixLineZElements( &stMatrix, 0.f, -xSin, xCos )
MTH3D_M_vMulMatrixVector( &stU, &stMatrix, &stU);
MTH3D_M_vMulMatrixVector( &stV, &stMatrix, &stV);
MTH3D_M_vMulMatrixVector( &stW, &stMatrix, &stW);
// Oz rotation
*pxZRot = atan2 ( -MTH3D_M_xGetXofVector(&stV), MTH3D_M_xGetYofVector(&stV) );
xSin = MTH_M_xSin (*pxZRot);
xCos = MTH_M_xCos (*pxZRot);
MTH3D_M_vSetMatrixLineXElements( &stMatrix, xCos, xSin, 0.f );
MTH3D_M_vSetMatrixLineYElements( &stMatrix, -xSin, xCos, 0.f );
MTH3D_M_vSetMatrixLineZElements( &stMatrix, 0.f, 0.f, 1.f )
MTH3D_M_vMulMatrixVector( &stU, &stMatrix, &stU);
MTH3D_M_vMulMatrixVector( &stV, &stMatrix, &stV);
MTH3D_M_vMulMatrixVector( &stW, &stMatrix, &stW);
fn_vCorrectNulValue ( &stU );
fn_vCorrectNulValue ( &stV );
fn_vCorrectNulValue ( &stW );
// Oy rotation
if ( !fn_bIsRealNul(MTH3D_M_xGetZofVector(&stU)) || !fn_bIsRealNul(MTH3D_M_xGetXofVector(&stU)) )
*pxYRot = atan2 ( -MTH3D_M_xGetZofVector(&stU), MTH3D_M_xGetXofVector(&stU) );
else
*pxYRot = atan2 ( MTH3D_M_xGetXofVector(&stW), MTH3D_M_xGetZofVector(&stW) );
xSin = MTH_M_xSin (*pxYRot);
xCos = MTH_M_xCos (*pxYRot);
MTH3D_M_vSetMatrixLineXElements( &stMatrix, xCos, 0.f, -xSin );
MTH3D_M_vSetMatrixLineYElements( &stMatrix, 0.f, 1.f, 0.f );
MTH3D_M_vSetMatrixLineZElements( &stMatrix, xSin, 0.f, xCos )
MTH3D_M_vMulMatrixVector( &stU, &stMatrix, &stU);
MTH3D_M_vMulMatrixVector( &stV, &stMatrix, &stV);
MTH3D_M_vMulMatrixVector( &stW, &stMatrix, &stW);
}
void Link::fn_vRotation2Vertex ( MTH3D_tdstVector* pstVector, MTH_tdxReal* pxRot, MTH_tdxReal* pxXRot, MTH_tdxReal* pxYRot, MTH_tdxReal* pxZRot )
{
MTH3D_tdstVector stU, stV, stW;
MTH_tdxReal xSin, xCos;
MTH3D_M_vSetVectorElements( &stU, 1.f, 0.f, 0.f);
MTH3D_M_vSetVectorElements( &stV, 0.f, 1.f, 0.f);
MTH3D_M_vSetVectorElements( &stW, 0.f, 0.f, 1.f);
// Ox rotation
xSin = MTH_M_xSin (*pxXRot);
xCos = MTH_M_xCos (*pxXRot);
MTH3D_M_vMulScalarVector ( &stV, xCos, &stV );
MTH3D_M_vMulScalarVector ( &stW, xSin, &stW );
MTH3D_M_vAddVector ( &stV, &stV, &stW);
MTH3D_M_vCrossProductVector (&stW, &stU, &stV);
// Oz rotation
xSin = MTH_M_xSin (*pxZRot);
xCos = MTH_M_xCos (*pxZRot);
MTH3D_M_vMulScalarVector ( &stU, xCos, &stU );
MTH3D_M_vMulScalarVector ( &stV, xSin, &stV );
MTH3D_M_vAddVector ( &stU, &stU, &stV);
MTH3D_M_vCrossProductVector (&stV, &stW, &stU);
// Oy rotation
xSin = MTH_M_xSin (*pxYRot);
xCos = MTH_M_xCos (*pxYRot);
MTH3D_M_vMulScalarVector ( &stW, xCos, &stW );
MTH3D_M_vMulScalarVector ( &stU, xSin, &stU );
MTH3D_M_vAddVector ( &stW, &stW, &stU);
MTH3D_M_vCrossProductVector (&stU, &stV, &stW);
*pstVector = stV;
MTH3D_M_vMulScalarVector(pstVector,m_xOrientationTangentLenght,pstVector);
MTH3D_tdstMatrix stMatrix;
MTH3D_tdstVector stOz;
MTH3D_M_vSetColumnInMatrix ( &stMatrix, &stU, 0 );
MTH3D_M_vSetColumnInMatrix ( &stMatrix, &stV, 1 );
MTH3D_M_vSetColumnInMatrix ( &stMatrix, &stW, 2 );
MTH3D_M_vInverMatrix (&stMatrix, &stMatrix);
MTH3D_M_vGetColumnInMatrix ( &stOz, &stMatrix, 2 );
*pxRot = - atan2 ( MTH3D_M_xGetXofVector(&stOz), MTH3D_M_xGetZofVector(&stOz) );
}
void Link::fn_vCorrectNulValue ( MTH3D_tdstVector* pstVector )
{
if ( fn_bIsRealNul (MTH3D_M_xGetXofVector (pstVector)) ) MTH3D_M_vSetXofVector (pstVector,0.);
if ( fn_bIsRealNul (MTH3D_M_xGetYofVector (pstVector)) ) MTH3D_M_vSetYofVector (pstVector,0.);
if ( fn_bIsRealNul (MTH3D_M_xGetZofVector (pstVector)) ) MTH3D_M_vSetZofVector (pstVector,0.);
}
BOOL Link::fn_bIsRealNul ( MTH_tdxReal& rReal )
{
return ( fabs(rReal) < 1.e-5);
}
void Link::fn_vComputeModulusRotation ( MTH_tdxReal* xStartRot, MTH_tdxReal* xEndRot, BOOL bDirectOrientation, long lNbLapOrientation )
{
// direct orientation
if (bDirectOrientation && (*xStartRot-1e-5)>(*xEndRot)) (*xEndRot)+=MTH_C_2Pi;
else if (!bDirectOrientation && (*xStartRot)<(*xEndRot-1e-3)) (*xStartRot)+=MTH_C_2Pi;
// number of laps
long lSignedLap = bDirectOrientation ? lNbLapOrientation : -lNbLapOrientation;
(*xEndRot) += lSignedLap * MTH_C_2Pi;
}
void Link::fn_vExtractModulusRotation ( BOOL* bDirectOrientation, long* lNbLapOrientation, MTH_tdxReal& xStartRot, MTH_tdxReal& xEndRot )
{
*bDirectOrientation = (xEndRot>=xStartRot);
if (*bDirectOrientation)
{
*lNbLapOrientation = (long)((xEndRot-xStartRot+1e-3)/MTH_C_2Pi);
xEndRot -= (*lNbLapOrientation) * MTH_C_2Pi;
if (xEndRot+1e-3>=MTH_C_Pi) xEndRot -= MTH_C_2Pi;
}
else
{
*lNbLapOrientation = (long)((xStartRot-xEndRot+1e-3)/MTH_C_2Pi);
xEndRot += (*lNbLapOrientation) * MTH_C_2Pi;
if (xStartRot-1e-3<-MTH_C_Pi) xStartRot += MTH_C_2Pi;
}
}
*/
//ENDANNECY Shaitan Nettoyage }

View File

@@ -0,0 +1,128 @@
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : LkArcDia.cpp
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// inherit from : Link
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 30 jan 1997 Author: J Th<54>noz
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
//
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
*/
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
#include "stdafx.h"
#include "acp_base.h"
#include "resource.h"
#include "incitf.h"
#include "incgam.h"
#include "incai.h"
#include "LkArcDia.h"
#include "WpObj.hpp"
#include "WayObj.hpp"
#include "LinkObj.hpp"
#include "CurObj.hpp"
#include "Link2D.hpp"
#include "LinkArc.hpp"
//ROMTEAM WorldEditor (Viorel Preoteasa 20/01/98)
//ENDROMTEAM WorldEditor (Viorel Preoteasa)
#include "Inter.hpp"
#include "x:/cpa/main/inc/_EditId.h"
#include "tut.h"
/////////////////////////////////////////////////////////////////////////////
// BezierDia dialog
ArcDia::ArcDia (LinkArc* pLinkArc, CWnd* pParent)
: CDialog(ArcDia::IDD, pParent)
{
//{{AFX_DATA_INIT(BezierDia)
m_iSamplingRate = 0;
//}}AFX_DATA_INIT
m_pLinkArc = pLinkArc;
}
void ArcDia::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(BezierDia)
DDX_Text(pDX, IDC_ARC_EDIT, m_iSamplingRate);
DDV_MinMaxInt(pDX, m_iSamplingRate, 0, 500000);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(ArcDia, CDialog)
//{{AFX_MSG_MAP(ArcDia)
ON_EN_KILLFOCUS(IDC_ARC_EDIT, OnKillfocusArcEdit)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// BezierDia message handlers
void ArcDia::OnKillfocusArcEdit()
{
UpdateData (TRUE);
// change inthe dynamic param
WP_fnv_Link_SetCurrentSample ( (WP_tdhLink)(m_pLinkArc->GetEngineStruct()),m_iSamplingRate );
//ROMTEAM WorldEditor (Viorel Preoteasa 20/01/98)
// change in the arc structure
// EDWAY_fnb_CircleArcObject_ChangeSamplingRate ( m_pLinkArc->fn_hGetEditArcObject (), m_iSamplingRate );
(m_pLinkArc->fn_hGetEditArcObject())->ChangeSamplingRate (m_iSamplingRate );
//ENDROMTEAM WorldEditor (Viorel Preoteasa)
m_pLinkArc->GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
}
BOOL ArcDia::OnInitDialog()
{
CDialog::OnInitDialog();
m_iSamplingRate = WP_fnuc_Link_GetCurrentSample ((WP_tdhLink)(m_pLinkArc->GetEngineStruct()));
UpdateData (FALSE);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
BOOL ArcDia::OnCommand(WPARAM wParam, LPARAM lParam)
{
// TODO: Add your specialized code here and/or call the base class
if (wParam==1)
{
OnKillfocusArcEdit();
return TRUE;
}
return CDialog::OnCommand(wParam, lParam);
}
void ArcDia::fn_vTutRegister (void)
{
TUT_M_vGetTutDll ();
TUT_M_vRegisterControl (m_hWnd , "OWP_ArcDialog" , TUT_e_Window);
TUT_M_vRegisterControlID (IDC_ARC_EDIT,"OWP_ArcSamplingRateEdit",TUT_e_TextEdit);
}
void ArcDia::fn_vTutUnregister (void)
{
TUT_M_vGetTutDll ();
TUT_M_vUnregisterControl (m_hWnd);
TUT_M_vUnregisterControlID (IDC_ARC_EDIT);
}
*/
//ENDANNECY Shaitan Nettoyage }

View File

@@ -0,0 +1,130 @@
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : LkBezDia.cpp
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// inherit from : Link
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 30 jan 1997 Author: J Th<54>noz
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
//
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
*/
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
#include "stdafx.h"
#include "acp_base.h"
#include "resource.h"
#include "incitf.h"
#include "incgam.h"
#include "incai.h"
#include "LkBezDia.h"
#include "WpObj.hpp"
#include "WayObj.hpp"
#include "LinkObj.hpp"
#include "TanObj.hpp"
#include "CurObj.hpp"
#include "Link2D.hpp"
#include "LinkBez.hpp"
//ROMTEAM WorldEditor (Viorel Preoteasa 20/01/98)
//ENDROMTEAM WorldEditor (Viorel Preoteasa)
#include "Inter.hpp"
#include "x:/cpa/main/inc/_EditId.h"
#include "tut.h"
/////////////////////////////////////////////////////////////////////////////
// BezierDia dialog
BezierDia::BezierDia (LinkBez* pLinkBez, CWnd* pParent)
: CDialog(BezierDia::IDD, pParent)
{
//{{AFX_DATA_INIT(BezierDia)
m_iSamplingRate = 0;
//}}AFX_DATA_INIT
m_pLinkBez = pLinkBez;
}
void BezierDia::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(BezierDia)
DDX_Text(pDX, IDC_BEZIER_EDIT, m_iSamplingRate);
DDV_MinMaxInt(pDX, m_iSamplingRate, 0, 500000);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(BezierDia, CDialog)
//{{AFX_MSG_MAP(BezierDia)
ON_EN_KILLFOCUS(IDC_BEZIER_EDIT, OnKillfocusBezierEdit)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// BezierDia message handlers
void BezierDia::OnKillfocusBezierEdit()
{
UpdateData (TRUE);
// change in the dynamic param
WP_fnv_Link_SetCurrentSample ( (WP_tdhLink)(m_pLinkBez->GetEngineStruct()),m_iSamplingRate );
//ROMTEAM WorldEditor (Viorel Preoteasa 20/01/98)
// change in the bezier structure
// EDWAY_fnb_BezierObject_ChangeSamplingRate(m_pLinkBez->fn_hGetEditBezierObject(),m_iSamplingRate);
(m_pLinkBez->fn_hGetEditBezierObject())->ChangeSamplingRate(m_iSamplingRate);
//ENDROMTEAM WorldEditor (Viorel Preoteasa)
m_pLinkBez->GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
}
BOOL BezierDia::OnInitDialog()
{
CDialog::OnInitDialog();
m_iSamplingRate = WP_fnuc_Link_GetCurrentSample ((WP_tdhLink)(m_pLinkBez->GetEngineStruct()));
UpdateData (FALSE);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
BOOL BezierDia::OnCommand(WPARAM wParam, LPARAM lParam)
{
// TODO: Add your specialized code here and/or call the base class
if (wParam==1)
{
OnKillfocusBezierEdit();
return TRUE;
}
return CDialog::OnCommand(wParam, lParam);
}
void BezierDia::fn_vTutRegister (void)
{
TUT_M_vGetTutDll ();
TUT_M_vRegisterControl (m_hWnd , "OWP_ArcDialog" , TUT_e_Window);
TUT_M_vRegisterControlID (IDC_BEZIER_EDIT,"OWP_BezierSamplingRateEdit",TUT_e_TextEdit);
}
void BezierDia::fn_vTutUnregister (void)
{
TUT_M_vGetTutDll ();
TUT_M_vUnregisterControl (m_hWnd);
TUT_M_vUnregisterControlID (IDC_BEZIER_EDIT);
}
*/
//ENDANNECY Shaitan Nettoyage }

View File

@@ -0,0 +1,552 @@
//ROMTEAM Networks (Gabriela Dumitrascu 15/03/98)
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : NtwMod.hpp
//
// Modification classes
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// inherit from CPA_Modif
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 98-03-15 Author: CPA2 Gabriela Dumitrascu
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
///////////////////////////////////////////////////////////////////////////////////////////////////
*/
#include "stdafx.h"
#include "acp_base.h"
#include "resource.h"
#include "incdpt.h"
#include "incitf.h"
#include "incgam.h"
#include "incai.h"
#include "WPObj.hpp"
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
#include "WayObj.hpp"
#include "LinkObj.hpp"
*/
//ENDANNECY Shaitan Nettoyage }
#include "Inter.hpp"
#include "NtwMod.hpp"
#include "NtwDia.hpp"
#include "x:\cpa\main\inc\_editid.h"
ModifGraph::ModifGraph(Graph *poGraph, unsigned short type) : CPA_Modif (type,"",FALSE)
{
m_poGraph = poGraph;
m_hOldGraph = WPG_fn_hCreate("", "");
WPG_fn_vCopy(m_hOldGraph, m_poGraph->GetEngineStruct());
m_hNewGraph = NULL;
switch (type)
{
case GRAPH_INSERT_GRAPH:
SetName("Insert graph");
break;
case GRAPH_DELETE_GRAPH:
SetName("Delete graph");
break;
case GRAPH_INSERT_NODE:
SetName("Insert node");
break;
case GRAPH_DELETE_NODE:
SetName("Delete node");
break;
case GRAPH_INSERT_ARC:
SetName("Insert arc");
break;
case GRAPH_DELETE_ARC:
SetName("Delete arc");
break;
}
}
void ModifGraph::ModifSave()
{
m_hNewGraph = WPG_fn_hCreate("", "");
WPG_fn_vCopy(m_hNewGraph, m_poGraph->GetEngineStruct());
}
BOOL ModifGraph::Do (void)
{
WPG_fn_vCopy(m_poGraph->GetEngineStruct(), m_hNewGraph);
m_poGraph->fn_vNotifySave();
m_poGraph->fn_pGetDialog()->fn_vRefreshDialog();
return TRUE;
}
BOOL ModifGraph::Undo (void)
{
WPG_fn_vCopy(m_poGraph->GetEngineStruct(), m_hOldGraph);
m_poGraph->fn_vNotifySave();
m_poGraph->fn_pGetDialog()->fn_vRefreshDialog();
return TRUE;
}
//ENDROMTEAM Networks (Gabriela Dumitrascu)
// Shaitan Correction {
/*===========================================================================
Delete Graph
===========================================================================*/
DeleteGraph::DeleteGraph (Graph *pGraph)
: CPA_Modif (GRAPH_DELETE_GRAPH, "Delete Graph", FALSE)
{
// register parameters
m_pGraph = pGraph;
// init flag
m_bDeleted = FALSE;
m_bFirstTime = TRUE;
}
DeleteGraph::~DeleteGraph (void)
{
}
BOOL DeleteGraph::Do (void)
{
// update editor
POSITION DeletePos = Graph::ms_oListOfGraph.Find(m_pGraph);
Graph::ms_oListOfGraph.RemoveAt(DeletePos);
// update engine
SCR_tdst_Link_Value *pValue = SCR_fnp_st_Link_SearchValue(WPG_fnp_Graph_GetLinkTable(), (unsigned long) m_pGraph->GetEngineStruct());
if (pValue)
{
SCR_fn_v_Link_DeleteEntry(WPG_fnp_Graph_GetLinkTable(), pValue);
}
// update flag
m_pGraph->fn_vNotifyUnSave();
m_bDeleted = TRUE;
// update interface
Graph::fn_pGetDialog()->fn_vRefreshGraphList(NULL);
Graph::GetInterface()->fn_vSelectGraph(NULL);
m_bFirstTime = FALSE;
return TRUE;
}
BOOL DeleteGraph::Undo (void)
{
// update editor
Graph::ms_oListOfGraph.AddTail(m_pGraph);
// update engine
SCR_tdst_Link_Value *pValue = SCR_fnp_st_Link_SearchValue(WPG_fnp_Graph_GetLinkTable(), (unsigned long) m_pGraph->GetEngineStruct());
if (!pValue)
{
WPG_fn_vAddGlobalGraph(m_pGraph->GetEngineStruct());
}
// update flag
m_pGraph->fn_vNotifyRestore();
m_bDeleted = FALSE;
// update interface
Graph::fn_pGetDialog()->fn_vRefreshGraphList(NULL);
Graph::GetInterface()->fn_vSelectGraph(m_pGraph);
return TRUE;
}
/*===========================================================================
Delete Graph
===========================================================================*/
RenameGraph::RenameGraph (Graph *pGraph, CString csNewName)
: CPA_Modif (GRAPH_RENAME_GRAPH, "Rename Graph", FALSE)
{
// register parameters
m_pGraph = pGraph;
m_csOldName = pGraph->GetName();
m_csNewName = csNewName,
// init flag
m_bFirstTime = TRUE;
}
RenameGraph::~RenameGraph (void)
{
}
BOOL RenameGraph::Do (void)
{
// update editor
m_pGraph->fn_eRename(m_csNewName);
m_csNewName = m_pGraph->GetName();
// update engine structure
WPG_fn_vSetNameOfGraph(m_pGraph->GetEngineStruct(), m_pGraph->GetName());
// update link table
SCR_tdst_Link_Value *pValue = SCR_fnp_st_Link_SearchValue(WPG_fnp_Graph_GetLinkTable(), (unsigned long) m_pGraph->GetEngineStruct());
if (pValue)
{
SCR_fn_v_Link_DeleteEntry(WPG_fnp_Graph_GetLinkTable(), pValue);
WPG_fn_vAddGlobalGraph(m_pGraph->GetEngineStruct());
}
// update interface
if (!m_bFirstTime)
{
Graph::fn_pGetDialog()->fn_vRefreshGraphList(m_pGraph);
Graph::GetInterface()->fn_vSelectGraph(m_pGraph);
}
m_bFirstTime = FALSE;
return TRUE;
}
BOOL RenameGraph::Undo (void)
{
// update editor
BOOL bIsLoadingWorld = Graph::GetInterface()->GetInterface()->fn_bIsLoadingWorld();
Graph::GetInterface()->GetInterface()->SetLoadingWorld(TRUE);
m_pGraph->fn_eRename(m_csOldName);
Graph::GetInterface()->GetInterface()->SetLoadingWorld(bIsLoadingWorld);
// update engine structure
WPG_fn_vSetNameOfGraph(m_pGraph->GetEngineStruct(), m_pGraph->GetName());
// update link table
SCR_tdst_Link_Value *pValue = SCR_fnp_st_Link_SearchValue(WPG_fnp_Graph_GetLinkTable(), (unsigned long) m_pGraph->GetEngineStruct());
if (pValue)
{
SCR_fn_v_Link_DeleteEntry(WPG_fnp_Graph_GetLinkTable(), pValue);
WPG_fn_vAddGlobalGraph(m_pGraph->GetEngineStruct());
}
// update interface
Graph::fn_pGetDialog()->fn_vRefreshGraphList(m_pGraph);
Graph::GetInterface()->fn_vSelectGraph(m_pGraph);
return TRUE;
}
/*===========================================================================
Insert Node
===========================================================================*/
InsertNode::InsertNode (Graph *pGraph, WayPoint *pNode, BOOL pBlock)
: CPA_Modif (GRAPH_INSERT_NODE, "Insert Node", pBlock)
{
// register parameters
m_pGraph = pGraph;
m_pNode = pNode;
// init flag
m_bInserted = FALSE;
m_bFirstTime = TRUE;
}
InsertNode::~InsertNode (void)
{
}
BOOL InsertNode::Do (void)
{
// update engine
WPG_fn_lAddWayPointIfNotExists(m_pGraph->GetEngineStruct(), m_pNode->GetStruct(), 0L); //BART
// update flag
m_pGraph->fn_vNotifySave();
m_bInserted = TRUE;
// update interface
if (!m_bFirstTime)
Graph::GetInterface()->fn_vSelectGraph(m_pGraph);
Graph::GetInterface()->fn_vSetDisplayedWaypoint(m_pNode);
Graph::GetInterface()->fn_vUpdateConnections();
Graph::fn_pGetDialog()->fn_vRefreshNodeList(m_pGraph, m_pNode);
m_bFirstTime = FALSE;
return TRUE;
}
BOOL InsertNode::Undo (void)
{
// update engine
WPG_fn_lRemoveWayPoint(m_pGraph->GetEngineStruct(), m_pNode->GetStruct());
// update flag
m_pGraph->fn_vNotifySave();
m_bInserted = FALSE;
// update interface
Graph::GetInterface()->fn_vSelectGraph(m_pGraph);
Graph::GetInterface()->fn_vSetDisplayedWaypoint(NULL);
Graph::GetInterface()->fn_vUpdateConnections();
Graph::fn_pGetDialog()->fn_vRefreshNodeList(m_pGraph, NULL);
return TRUE;
}
/*===========================================================================
Delete Node
===========================================================================*/
DeleteNode::DeleteNode (Graph *pGraph, WayPoint *pNode, BOOL pBlock)
: CPA_Modif (GRAPH_DELETE_NODE, "Delete Node", pBlock)
{
// register parameters
m_pGraph = pGraph;
m_pNode = pNode;
// register connections
m_pGraph->GetConnectionsToWaypoint(pNode, 0, &m_lstConnections);
// init flag
m_bDeleted = FALSE;
m_bFirstTime = TRUE;
}
DeleteNode::~DeleteNode (void)
{
if (m_bDeleted)
{
while (m_lstConnections.GetCount() > 0)
delete(m_lstConnections.RemoveTail());
}
}
BOOL DeleteNode::Do (void)
{
CPA_SuperObject *pConnection;
WP_tdhGraphNode hNode, hNextNode;
WP_tdhWayPoint hWayPoint;
POSITION pos;
int iNode;
// update engine
hWayPoint = m_pNode->GetStruct();
LST2_M_DynamicForEachMovingElementOf(&m_pGraph->GetEngineStruct()->m_hListOfNode, hNode, hNextNode, iNode)
{
WPG_fn_lRemoveArcFromWayPoint(m_pGraph->GetEngineStruct(), hNode->m_hWayPoint, hWayPoint);
}
WPG_fn_lRemoveWayPoint(m_pGraph->GetEngineStruct(), hWayPoint);
// update editor connections
for (pConnection = m_lstConnections.GetHeadElement(pos); pConnection;
pConnection = m_lstConnections.GetNextElement(pos))
m_pGraph->fn_vRemoveGraphicConnection(pConnection);
// update flag
m_pGraph->fn_vNotifySave();
m_bDeleted = TRUE;
// update interface
m_pNode->GetRealGraphic()->SetLocalColor(E_lc_NoColor);
m_pNode->GetSymbolicalGraphic()->SetLocalColor(E_lc_NoColor);
if (!m_bFirstTime)
Graph::GetInterface()->fn_vSelectGraph(m_pGraph);
Graph::GetInterface()->fn_vSetDisplayedWaypoint(NULL);
Graph::GetInterface()->fn_vUpdateConnections();
Graph::fn_pGetDialog()->fn_vRefreshNodeList(m_pGraph, NULL);
m_bFirstTime = FALSE;
return TRUE;
}
BOOL DeleteNode::Undo (void)
{
CPA_SuperObject *pConnection;
WP_tdhGraphNode hSrcNode, hDstNode;
Connection *pLinkObject;
POSITION pos;
int iSrcNode, iDstNode;
// update engine
WPG_fn_lAddWayPointIfNotExists(m_pGraph->GetEngineStruct(), m_pNode->GetStruct(), 0L); //BART
for (pConnection = m_lstConnections.GetHeadElement(pos); pConnection;
pConnection = m_lstConnections.GetNextElement(pos))
{
pLinkObject = (Connection *) pConnection->GetObject();
iSrcNode = m_pGraph->fn_iGetNodeOfWayPoint(pLinkObject->GetSrcWayPoint()->GetStruct());
hSrcNode = m_pGraph->fn_hGetNode(iSrcNode);
iDstNode = m_pGraph->fn_iGetNodeOfWayPoint(pLinkObject->GetDstWayPoint()->GetStruct());
hDstNode = m_pGraph->fn_hGetNode(iDstNode);
WPG_fn_vAddArc(hSrcNode, hDstNode, pLinkObject->GetWeight(), pLinkObject->GetCapacity());
}
// update editor
for (pConnection = m_lstConnections.GetHeadElement(pos); pConnection;
pConnection = m_lstConnections.GetNextElement(pos))
m_pGraph->fn_vAddGraphicConnection(pConnection);
// update flag
m_pGraph->fn_vNotifySave();
m_bDeleted = FALSE;
// update interface
Graph::GetInterface()->fn_vSelectGraph(m_pGraph);
Graph::GetInterface()->fn_vSetDisplayedWaypoint(m_pNode);
Graph::GetInterface()->fn_vUpdateConnections();
Graph::fn_pGetDialog()->fn_vRefreshNodeList(m_pGraph, m_pNode);
return TRUE;
}
/*===========================================================================
Insert Connection
===========================================================================*/
InsertConnection::InsertConnection (Graph *pGraph, WayPoint *pSrcWaypoint, WayPoint *pDstWaypoint, BOOL bUpdate, BOOL pBlock)
: CPA_Modif (GRAPH_INSERT_ARC, "Insert Connection", pBlock)
{
int iSrcNode, iDstNode;
// register parameters
m_pGraph = pGraph;
m_pSrcWaypoint = pSrcWaypoint;
m_pDstWaypoint = pDstWaypoint;
m_pArrow = NULL;
// register engine parameters
iSrcNode = m_pGraph->fn_iGetNodeOfWayPoint(m_pSrcWaypoint->GetStruct());
m_hSrcNode = m_pGraph->fn_hGetNode(iSrcNode);
iDstNode = m_pGraph->fn_iGetNodeOfWayPoint(m_pDstWaypoint->GetStruct());
m_hDstNode = m_pGraph->fn_hGetNode(iDstNode);
// init flag
m_bUpdate = bUpdate;
m_bInserted = FALSE;
m_bFirstTime = TRUE;
}
InsertConnection::~InsertConnection (void)
{
// if necessary, delete graphic connection
if (!m_bInserted)
delete m_pArrow;
}
BOOL InsertConnection::Do (void)
{
// update engine data
WPG_fn_vAddArc(m_hSrcNode, m_hDstNode, 0, 0);
// update graphic connection
if (!m_pArrow)
m_pArrow = m_pGraph->GetInterface()->fn_pCreateConnectionGraphicObject(m_pGraph, m_pSrcWaypoint, m_pDstWaypoint, 0, 0);
m_pGraph->fn_vAddGraphicConnection(m_pArrow);
// update flag
m_pGraph->fn_vNotifySave();
m_bInserted = TRUE;
// update interface
if (!m_bFirstTime)
{
Graph::GetInterface()->fn_vSelectGraph(m_pGraph);
Graph::GetInterface()->fn_vSetDisplayedWaypoint(m_pSrcWaypoint);
Graph::fn_pGetDialog()->fn_vRefreshConnectList(m_pGraph, m_pSrcWaypoint, m_pDstWaypoint);
}
else if (m_bUpdate)
Graph::fn_pGetDialog()->fn_vRefreshConnectList(m_pGraph, m_pSrcWaypoint, m_pDstWaypoint);
Graph::GetInterface()->fn_vUpdateConnections();
m_bFirstTime = FALSE;
return TRUE;
}
BOOL InsertConnection::Undo (void)
{
// update graphic connection
m_pGraph->fn_vRemoveGraphicConnection(m_pArrow);
// update engine data
WPG_fn_vRemoveArc(m_hSrcNode, m_hDstNode);
// update flag
m_pGraph->fn_vNotifySave();
m_bInserted = FALSE;
// update dialog
Graph::GetInterface()->fn_vSelectGraph(m_pGraph);
Graph::GetInterface()->fn_vSetDisplayedWaypoint(m_pSrcWaypoint);
Graph::GetInterface()->fn_vUpdateConnections();
Graph::fn_pGetDialog()->fn_vRefreshConnectList(m_pGraph, m_pSrcWaypoint, NULL);
return TRUE;
}
/*===========================================================================
Delete Connection
===========================================================================*/
DeleteConnection::DeleteConnection (Graph *pGraph, WayPoint *pSrcWaypoint, WayPoint *pDstWaypoint, BOOL pBlock)
: CPA_Modif (GRAPH_DELETE_ARC, "Delete Connection", pBlock)
{
int iSrcNode, iDstNode;
// register parameters
m_pGraph = pGraph;
m_pSrcWaypoint = pSrcWaypoint;
m_pDstWaypoint = pDstWaypoint;
m_pArrow = m_pGraph->GetGraphicConnection(m_pSrcWaypoint, m_pDstWaypoint);
// register engine parameters
iSrcNode = m_pGraph->fn_iGetNodeOfWayPoint(m_pSrcWaypoint->GetStruct());
m_hSrcNode = m_pGraph->fn_hGetNode(iSrcNode);
iDstNode = m_pGraph->fn_iGetNodeOfWayPoint(m_pDstWaypoint->GetStruct());
m_hDstNode = m_pGraph->fn_hGetNode(iDstNode);
// init flag
m_bDeleted = FALSE;
m_bFirstTime = TRUE;
}
DeleteConnection::~DeleteConnection (void)
{
// if necessary, delete graphic connection
if (m_bDeleted)
delete m_pArrow;
}
BOOL DeleteConnection::Do (void)
{
// update graphic connection
m_pGraph->fn_vRemoveGraphicConnection(m_pArrow);
// update engine data
WPG_fn_vRemoveArc(m_hSrcNode, m_hDstNode);
// update flag
m_pGraph->fn_vNotifySave();
m_bDeleted = TRUE;
// update dialog
if (!m_bFirstTime)
{
Graph::GetInterface()->fn_vSelectGraph(m_pGraph);
Graph::GetInterface()->fn_vSetDisplayedWaypoint(m_pSrcWaypoint);
}
Graph::GetInterface()->fn_vUpdateConnections();
Graph::fn_pGetDialog()->fn_vRefreshConnectList(m_pGraph, m_pSrcWaypoint, NULL);
m_bFirstTime = FALSE;
return TRUE;
}
BOOL DeleteConnection::Undo (void)
{
Connection *pLinkObject = (Connection *) m_pArrow->GetObject();
// update engine data
WPG_fn_vAddArc(m_hSrcNode, m_hDstNode, pLinkObject->GetWeight(), pLinkObject->GetCapacity());
// update graphic connection
m_pGraph->fn_vAddGraphicConnection(m_pArrow);
// update flag
m_pGraph->fn_vNotifySave();
m_bDeleted = FALSE;
// update dialog
Graph::GetInterface()->fn_vSelectGraph(m_pGraph);
Graph::GetInterface()->fn_vSetDisplayedWaypoint(m_pSrcWaypoint);
Graph::GetInterface()->fn_vUpdateConnections();
Graph::fn_pGetDialog()->fn_vRefreshConnectList(m_pGraph, m_pSrcWaypoint, m_pDstWaypoint);
return TRUE;
}
//End Shaitan Correction }

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,6 @@
// stdafx.cpp : source file that includes just the standard includes
// ACPProject.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"

View File

@@ -0,0 +1,371 @@
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : TanObj.cpp
//
// Definition of the tangent objects
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// inherit from : CPA_Object
// CPA_EdMot<ACP_tdxHandleOfLink>
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 29 jan 1997 Author: J Th<54>noz
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
//
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
*/
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
#include "stdafx.h"
#include "acp_base.h"
#include "incitf.h"
#include "incgam.h"
#include "incai.h"
#include "WpObj.hpp"
#include "WayObj.hpp"
#include "LinkObj.hpp"
#include "TanObj.hpp"
#include "Inter.hpp"
#include "LinkBez.hpp"
long Tangent::ms_lNbTangent=0;
Waypoint_Interface* Tangent::ms_poInterface;
//------ static
void Tangent::fn_vInitObject (Waypoint_Interface* poInterface)
{
ms_poInterface = poInterface;
}
Tangent::Tangent( CPA_ObjectDLLBase *p_oDLL, CPA_BaseObject *p_oOwner, eTangentLenghtMode eLenghtMode, eTangentOrientationMode eOrientationMode, eTangentNeighbourMode eNeighbourMode, eTangentChangeAllMode eChangeAllMode, GEO_tdstColor* pstColor ):
CPA_BaseObject ( p_oDLL, "Tangent" )
{
CPA_SuperObject* poSuperTangent = ms_poInterface->GetInterface()->GetNewSuperObject ( E_ss_NoSave, C_NoType );
poSuperTangent->SetObject(this);
SetSuperObject (poSuperTangent);
poSuperTangent->SetTypeSO (C_Protected);
// name
CString csName;
csName.Format ("Tangent%d", ms_lNbTangent);
ms_lNbTangent++;
fn_eRename (csName);
// init
MTH3D_M_vNullVector(&m_stFixVertex);
MTH3D_M_vNullVector(&m_stTangentVector);
m_xDim = 0.05f;
m_bOrientationAllow=FALSE;
m_bNotifyWay=FALSE;
// color
if (pstColor) m_stColor = *pstColor;
else
{
m_stColor.xR = 0.f;
m_stColor.xG = 0.8f;
m_stColor.xB = 0.f;
}
m_eTangentLenghtMode = eLenghtMode;
m_eTangentOrientationMode = eOrientationMode;
m_eTangentNeighbourMode = eNeighbourMode;
m_eTangentChangeAllMode = eChangeAllMode;
// graphic object
CPA_SuperObject* poGraphic = GetInterface()->fn_pGetNewTangentGraphicObject (&m_stColor);
poGraphic->SetSuperObjectOwner (GetSuperObject());
GetSuperObject()->AddTail (poGraphic);
GEO_xComputeObjectNormals ( (ACP_tdxHandleOfObject)HIE_fn_hGetSuperObjectObject(poGraphic->GetStruct()));
poGraphic->SetEditProtected (TRUE);
m_poParent = (Link*)p_oOwner;
}
long Tangent::GetDataType (void)
{
return C_ucTangent;
}
void* Tangent::GetData (void)
{
return NULL;
}
void Tangent::fn_vSetAbsoluteVertex ( MTH3D_tdstVector* pstFixAbsoluteVertex, MTH3D_tdstVector* pstMoveAbsoluteVertex )
{
POS_tdstCompletePosition InvMatrix;
POS_fn_vSetIdentityMatrix(&InvMatrix);
GetInterface()->fn_vComputeAbsoluteMatrix (GetSuperObject());
GEO_tdxHandleToMatrix hAbsoluteLineMatrix = HIE_fn_hGetSuperObjectGlobalMatrix (GetSuperObject()->GetStruct());
POS_fn_vInvertMatrix( &InvMatrix, hAbsoluteLineMatrix );
POS_fn_vMulMatrixVertex( &m_stFixVertex, &InvMatrix, pstFixAbsoluteVertex ) ;
m_stTangentVector = *pstMoveAbsoluteVertex;
m_stMoveVertex = *pstMoveAbsoluteVertex;
MTH3D_M_vSubVector( &m_stTangentVector, &m_stTangentVector, pstFixAbsoluteVertex );
m_bOrientationAllow=TRUE;
fn_vDraw ();
m_bOrientationAllow=FALSE;
}
void Tangent::fn_vSetTangent ( MTH3D_tdstVector* pstMoveAbsoluteVertex )
{
MTH3D_tdstVector st_FixVertex;
GetInterface()->fn_vComputeAbsoluteMatrix (GetSuperObject());
GEO_tdxHandleToMatrix hAbsoluteLineMatrix = HIE_fn_hGetSuperObjectGlobalMatrix (GetSuperObject()->GetStruct());
POS_fn_vMulMatrixVertex( &st_FixVertex, hAbsoluteLineMatrix, &m_stFixVertex ) ;
switch (m_eTangentLenghtMode)
{
case eVariableLenghtTangent:
m_stTangentVector = *pstMoveAbsoluteVertex;
MTH3D_M_vSubVector(&m_stTangentVector, &m_stTangentVector, &st_FixVertex );
break;
case eFixLenghtTangent:
{
GLI_tdxValue xLenght, xModifLenght, xRatio;
xLenght = MTH3D_M_xNormVector( &m_stTangentVector );
m_stTangentVector = *pstMoveAbsoluteVertex;
MTH3D_M_vSubVector( &m_stTangentVector, &m_stTangentVector, &st_FixVertex );
xModifLenght = MTH3D_M_xNormVector( &m_stTangentVector );
xRatio = xModifLenght>0 ? xLenght/xModifLenght : 1.f;
MTH3D_M_vMulScalarVector(&m_stTangentVector,xRatio, &m_stTangentVector);
} break;
}
m_bOrientationAllow=TRUE;
m_poParent->fn_vDraw ();
m_bOrientationAllow=FALSE;
}
void Tangent::fn_vSetTangentDirection ( MTH3D_tdstVector* pstAbsoluteDirectionVertex, BOOL bOppositeDirection )
{
MTH_tdxReal xLenght = MTH3D_M_xNormVector( &m_stTangentVector );
m_stTangentVector = *pstAbsoluteDirectionVertex;
MTH3D_M_vNormalizeVector(&m_stTangentVector,&m_stTangentVector);
if(bOppositeDirection) MTH3D_M_vMulScalarVector( &m_stTangentVector, -xLenght, &m_stTangentVector )
else MTH3D_M_vMulScalarVector( &m_stTangentVector, xLenght, &m_stTangentVector );
m_bOrientationAllow=TRUE;
fn_vDraw ();
m_bOrientationAllow=FALSE;
}
void Tangent::fn_pGetAbsoluteTangent (MTH3D_tdstVector* pstTangent)
{
*pstTangent = m_stTangentVector;
}
void Tangent::fn_vConstructGraphic (void)
{
CPA_SuperObject* poGraphic = GetInterface()->fn_pGetNewTangentGraphicObject(&m_stColor);
poGraphic->SetSuperObjectOwner (GetSuperObject());
GetSuperObject()->AddTail (poGraphic);
GEO_xComputeObjectNormals ( (ACP_tdxHandleOfObject)HIE_fn_hGetSuperObjectObject(poGraphic->GetStruct()));
poGraphic->SetEditProtected (TRUE);
}
void Tangent::fn_vDraw (void)
{
if (m_eTangentOrientationMode==eVariableOrientationTangent && !m_bOrientationAllow)
{
MTH3D_tdstVector stU, stV;
GEO_tdxHandleToMatrix hAbsoluteMatrix = HIE_fn_hGetSuperObjectGlobalMatrix (GetSuperObject()->GetStruct());
GLI_tdxValue xlenght = MTH3D_M_xNormVector( &m_stTangentVector );
POS_fn_vGetRotationMatrix( hAbsoluteMatrix , &stU, &stV, &m_stTangentVector );
MTH3D_M_vMulScalarVector ( &m_stTangentVector, xlenght, &m_stTangentVector );
return;
}
MTH3D_tdstVector stAbsoluteFixVertex, stAbsoluteMoveVertex;
GEO_tdxHandleToMatrix hAbsoluteMatrix = HIE_fn_hGetSuperObjectGlobalMatrix (GetSuperObject()->GetStruct());
GetInterface()->fn_vComputeAbsoluteMatrix (GetSuperObject());
POS_fn_vNormalizeMatrix( hAbsoluteMatrix ) ;
POS_fn_vMulMatrixVertex( &stAbsoluteFixVertex, hAbsoluteMatrix, &m_stFixVertex ) ;
stAbsoluteMoveVertex = stAbsoluteFixVertex;
MTH3D_M_vAddVector(&stAbsoluteMoveVertex, &stAbsoluteMoveVertex, &m_stTangentVector );
tdeLocalColor tdColor = GetSuperObject()->GetLocalColor ();
CPA_SuperObject* psoObject = (CPA_SuperObject*)GetSuperObject()->GetHead();
GLI_tdxValue d=m_xDim;
GLI_tdxValue md=-m_xDim;
GLI_tdxValue d2=(GLI_tdxValue)(m_xDim*2.);
GLI_tdxValue md2=(GLI_tdxValue)(-m_xDim*2.);
GLI_tdxValue zero=0.;
MTH3D_tdstVector n, u, v;
MTH3D_tdstVector Ox = { 1., 0., 0. };
// Version finale
ACP_tdxHandleOfObject hMot = (ACP_tdxHandleOfObject) HIE_fn_hGetSuperObjectObject(psoObject->GetStruct());
n = stAbsoluteMoveVertex;
MTH3D_M_vSubVector(&n,&n,&stAbsoluteFixVertex);
GLI_tdxValue lenght = MTH3D_M_xNormVector( &n );
GLI_tdxValue lenght8 = (GLI_tdxValue)(lenght*0.8);
MTH3D_tdstVector a8_stPoint [13];
MTH3D_M_vSetVectorElements (a8_stPoint, md,md,zero);
MTH3D_M_vSetVectorElements (a8_stPoint+1, d,md,zero);
MTH3D_M_vSetVectorElements (a8_stPoint+2, d,d,zero);
MTH3D_M_vSetVectorElements (a8_stPoint+3, md,d,zero);
MTH3D_M_vSetVectorElements (a8_stPoint+4, md,md,lenght8);
MTH3D_M_vSetVectorElements (a8_stPoint+5, d,md,lenght8);
MTH3D_M_vSetVectorElements (a8_stPoint+6, d,d,lenght8);
MTH3D_M_vSetVectorElements (a8_stPoint+7, md,d,lenght8);
MTH3D_M_vSetVectorElements (a8_stPoint+8, md2,md2,lenght8);
MTH3D_M_vSetVectorElements (a8_stPoint+9, d2,md2,lenght8);
MTH3D_M_vSetVectorElements (a8_stPoint+10, d2,d2,lenght8);
MTH3D_M_vSetVectorElements (a8_stPoint+11, md2,d2,lenght8);
MTH3D_M_vSetVectorElements (a8_stPoint+12, 0,0,lenght);
GEO_vSetListOfPointsOfObject
(
hMot,
a8_stPoint,
13,
0
);
MTH3D_M_vNormalizeVector(&n,&n);
// here : to rotate the beam around its principal axis
// by defaults find section align with plan z=0
if (n.xX||n.xY) { MTH3D_M_vSetVectorElements ((&u),(-n.xY),(n.xX),0.); }
else { MTH3D_M_vSetVectorElements((&u),0.,(n.xZ),(-n.xY)); }
MTH3D_M_vNormalizeVector(&u,&u);
MTH3D_M_vCrossProductVector((&v),(&n),(&u));
// change the local matrix
GEO_tdxHandleToMatrix hAbsoluteLineMatrix = HIE_fn_hGetSuperObjectGlobalMatrix (psoObject->GetStruct());
POS_fn_vSetIdentityMatrix( hAbsoluteLineMatrix );
POS_fn_vSetTranslationVector( hAbsoluteLineMatrix, &stAbsoluteFixVertex );
POS_fn_vSetRotationMatrix( hAbsoluteLineMatrix , &u, &v, &n );
GetInterface()->fn_vComputeNewRelativeMatrix (psoObject->GetStruct());
}
Waypoint_Interface* Tangent::GetInterface (void)
{
return ms_poInterface;
}
void Tangent::fn_vStartMove ( MTH3D_tdstVector* pstStartVertex, BOOL bShift, BOOL bControl )
{
MTH3D_tdstVector stExtremVector, stPickVector;
MTH3D_tdstVector st_FixVertex;
GetInterface()->fn_vComputeAbsoluteMatrix (GetSuperObject());
GEO_tdxHandleToMatrix hAbsoluteLineMatrix = HIE_fn_hGetSuperObjectGlobalMatrix (GetSuperObject()->GetStruct());
POS_fn_vMulMatrixVertex( &st_FixVertex, hAbsoluteLineMatrix, &m_stFixVertex ) ;
stExtremVector = m_stMoveVertex;
stPickVector = *pstStartVertex;
MTH3D_M_vSubVector( &stExtremVector, &stExtremVector, &st_FixVertex);
MTH3D_M_vSubVector( &stPickVector, &stPickVector, &st_FixVertex);
m_xMoveRatio = MTH3D_M_xNormVector(&stExtremVector)/MTH3D_M_xNormVector(&stPickVector);
fn_vChangeNeighbourTangent (bShift, bControl);
fn_vChangeAllTangent (bShift, bControl);
GetInterface()->fn_vEdit (m_poParent);
GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
}
void Tangent::fn_vMove ( MTH3D_tdstVector* pstTranslation, BOOL bShift, BOOL bControl )
{
MTH3D_tdstVector stTranslation = * pstTranslation;
MTH3D_M_vMulScalarVector(&stTranslation,m_xMoveRatio, &stTranslation);
MTH3D_M_vAddVector(&m_stMoveVertex, &m_stMoveVertex, &stTranslation);
fn_vSetTangent ( &m_stMoveVertex );
fn_vChangeNeighbourTangent (bShift, bControl);
fn_vChangeAllTangent (bShift, bControl);
GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
m_bNotifyWay=TRUE;
}
void Tangent::fn_vEndMove (void)
{
if (m_bNotifyWay)
{
m_poParent->fn_vWayNotifySave();
m_bNotifyWay=FALSE;
}
}
void Tangent::fn_vChangeNeighbourTangent (BOOL bShift, BOOL bControl)
{
switch (m_eTangentNeighbourMode)
{
case eAlwaysChangeNeighbour :
m_poParent->fn_vChangeNeighbourTangent (this);
break;
case eShiftDownChangeNeighbour :
if (bShift) m_poParent->fn_vChangeNeighbourTangent (this);
break;
case eControlDownChangeNeighbour :
if (bControl) m_poParent->fn_vChangeNeighbourTangent (this);
break;
case eShiftUpChangeNeighbour :
if (!bShift) m_poParent->fn_vChangeNeighbourTangent (this);
break;
case eControlUpChangeNeighbour :
if (!bControl) m_poParent->fn_vChangeNeighbourTangent (this);
break;
}
}
void Tangent::fn_vChangeAllTangent (void)
{
m_poParent->fn_vChangeAllTangent (this);
}
void Tangent::fn_vChangeAllTangent (BOOL bShift, BOOL bControl)
{
switch (m_eTangentChangeAllMode)
{
case eAlwaysChangeAll :
m_poParent->fn_vChangeAllTangent (this);
break;
case eShiftDownChangeAll :
if (bShift) m_poParent->fn_vChangeAllTangent (this);
break;
case eControlDownChangeAll :
if (bControl) m_poParent->fn_vChangeAllTangent (this);
break;
case eShiftUpChangeAll :
if (!bShift) m_poParent->fn_vChangeAllTangent (this);
break;
case eControlUpChangeAll :
if (!bControl) m_poParent->fn_vChangeAllTangent (this);
break;
}
}
*/
//ENDANNECY Shaitan Nettoyage }

View File

@@ -0,0 +1,366 @@
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : WPDia.cpp
//
// Dialog edition the waypoints
//
///////////////////////////////////////////////////////////////////////////////////////////////////
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 21 jan 1997 Author: J Th<54>noz
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
//
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
*/
#include "stdafx.h"
#include "acp_base.h"
#include "resource.h"
#include "incitf.h"
#include "incgam.h"
#include "incai.h"
#include "WPObj.hpp"
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
#include "WayObj.hpp"
#include "LinkObj.hpp"
#include "WayDia.hpp"
*/
//ENDANNECY Shaitan Nettoyage }
#include "WPDia.hpp"
#include "Inter.hpp"
#include "ogd.h"
#include "x:/cpa/main/inc/_EditId.h"
#include "tut.h"
IMPLEMENT_DYNCREATE ( DiaWP, CFormView );
/////////////////////////////////////////////////////////////////////////////
// DiaWP dialog
DiaWP::DiaWP(CWnd* pParent /*=NULL*/)
: CFormView(DiaWP::IDD)
{
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); //IDI_SYMBOLICWP
m_bEditRadius=FALSE;
m_poWP = NULL;
}
void DiaWP::fn_vInitDialog ( void )
{
// init the radio buttons icons
((CButton*)GetDlgItem (IDC_SYMBOLICALWP_RADIO))->SetIcon( AfxGetApp()->LoadIcon(IDI_SYMBOLICWP) );
((CButton*)GetDlgItem (IDC_REALWP_RADIO))->SetIcon( AfxGetApp()->LoadIcon(IDI_REALWP) );
// desactivate all the controls
GetDlgItem (IDC_GLOBALDRAW_CHECK)->EnableWindow (FALSE);
GetDlgItem (IDC_SYMBOLICALWP_RADIO)->EnableWindow (FALSE);
GetDlgItem (IDC_REALWP_RADIO)->EnableWindow (FALSE);
GetDlgItem (IDC_WAYPOINT_COORD_CHECK)->EnableWindow (FALSE);
GetDlgItem (IDC_WAYPOINT_EDIT)->EnableWindow (FALSE);
GetDlgItem (IDC_WAYPOINT_NAME_EDIT)->EnableWindow (FALSE);
}
// to edit a new waypoint
void DiaWP::fn_vEdit (WayPoint* poWP)
{
// Aspect of the dialog
if (!m_poWP && poWP)
{
// wake up
GetDlgItem (IDC_GLOBALDRAW_CHECK)->EnableWindow (TRUE);
GetDlgItem (IDC_SYMBOLICALWP_RADIO)->EnableWindow (TRUE);
GetDlgItem (IDC_REALWP_RADIO)->EnableWindow (TRUE);
GetDlgItem (IDC_WAYPOINT_COORD_CHECK)->EnableWindow (TRUE);
GetDlgItem (IDC_WAYPOINT_EDIT)->EnableWindow (TRUE);
GetDlgItem (IDC_WAYPOINT_TEXT)->EnableWindow (TRUE);
GetDlgItem (IDC_WAYPOINT_NAME_EDIT)->EnableWindow (TRUE);
}
else if (m_poWP && !poWP)
{
GetDlgItem (IDC_GLOBALDRAW_CHECK)->EnableWindow (FALSE);
GetDlgItem (IDC_SYMBOLICALWP_RADIO)->EnableWindow (FALSE);
GetDlgItem (IDC_REALWP_RADIO)->EnableWindow (FALSE);
GetDlgItem (IDC_WAYPOINT_COORD_CHECK)->EnableWindow (FALSE);
GetDlgItem (IDC_WAYPOINT_EDIT)->EnableWindow (FALSE);
GetDlgItem (IDC_WAYPOINT_TEXT)->EnableWindow (FALSE);
GetDlgItem (IDC_WAYPOINT_NAME_EDIT)->EnableWindow (FALSE);
}
m_poWP = poWP;
fn_vRefreshCoordinate();
if (poWP)
{
GetParent()->SetWindowText ( poWP->GetName() );
// set the style buttons
CheckRadioButton( IDC_SYMBOLICALWP_RADIO, IDC_REALWP_RADIO, poWP->fn_bIsRealDraw() ? IDC_REALWP_RADIO : IDC_SYMBOLICALWP_RADIO );
if (m_poWP->fn_bIsAlone())
{
GetDlgItem (IDC_WAYPOINT_ALONE_PICTURE)->ShowWindow( SW_SHOW );
GetDlgItem (IDC_WAYPOINT_WAY_PICTURE)->ShowWindow( SW_HIDE );
}
else
{
GetDlgItem (IDC_WAYPOINT_WAY_PICTURE)->ShowWindow( SW_SHOW );
GetDlgItem (IDC_WAYPOINT_ALONE_PICTURE)->ShowWindow( SW_HIDE );
}
GetDlgItem (IDC_WAYPOINT_COORD_CHECK)->EnableWindow (m_poWP->fn_pGetDynamicFather() ? TRUE : FALSE);
fn_vEditName ();
fn_vRefreshDialog ();
}
else
{
m_fRadius = 0.;
m_bStaticCoord = FALSE;
GetParent()->SetWindowText ( "no waypoint to edit" );
UpdateData (FALSE);
m_csWaypointName="";
UpdateData (FALSE);
}
GetParent()->GetParent()->RedrawWindow (NULL, NULL, RDW_INVALIDATE|RDW_FRAME);
}
void DiaWP::DoDataExchange(CDataExchange* pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(DiaWP)
DDX_Control(pDX, IDC_WAYPOINT_EDIT, m_EditWP);
DDX_Text(pDX, IDC_WAYPOINT_EDIT, m_fRadius);
DDV_MinMaxDouble(pDX, m_fRadius, 0., 99.99);
DDX_Check(pDX, IDC_WAYPOINT_COORD_CHECK, m_bStaticCoord);
DDX_Check(pDX, IDC_GLOBALDRAW_CHECK, m_bGlobalCheck);
DDX_Text(pDX, IDC_WAYPOINT_NAME_EDIT, m_csWaypointName);
DDV_MaxChars(pDX, m_csWaypointName, 50);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(DiaWP, CFormView)
//{{AFX_MSG_MAP(DiaWP)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_EN_KILLFOCUS(IDC_WAYPOINT_EDIT, OnKillfocusWaypointEdit)
ON_BN_CLICKED(IDC_WAYPOINT_COORD_CHECK, OnWaypointCoordCheck)
ON_EN_CHANGE(IDC_WAYPOINT_EDIT, OnChangeWaypointEdit)
ON_BN_CLICKED(IDC_REALWP_RADIO, OnRealwpRadio)
ON_BN_CLICKED(IDC_SYMBOLICALWP_RADIO, OnSymbolicalwpRadio)
ON_BN_CLICKED(IDC_GLOBALDRAW_CHECK, OnGlobaldrawCheck)
ON_WM_DESTROY()
ON_EN_KILLFOCUS(IDC_WAYPOINT_NAME_EDIT, OnKillfocusWaypointNameEdit)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// DiaWP message handlers
/////////////////////////////////////////////////////////////////////////////
// DiaNetWP message handlers
void DiaWP::fn_vRefreshDialog (void)
{
m_fRadius = (float)(m_poWP->fn_xGetRadius());
m_bStaticCoord = m_poWP->fn_bGetCoordinate();
// change the radio buttons push
CheckRadioButton( IDC_SYMBOLICALWP_RADIO, IDC_REALWP_RADIO, m_poWP->fn_bIsGeneralRealDraw() ? IDC_REALWP_RADIO : IDC_SYMBOLICALWP_RADIO );
UpdateData (FALSE);
}
void DiaWP::fn_vRefreshCoordinate(void)
{
if (!m_poWP) return; // there's no waypoint to edit
//ANNECY Shaitan Nettoyage (12/05/98) {
// if (m_poWP->GetInterface()->fn_bWaypointInAWay(m_poWP)) GetDlgItem (IDC_WAYPOINT_COORD_CHECK)->EnableWindow (FALSE);
//ENDANNECY Shaitan Nettoyage }
else GetDlgItem (IDC_WAYPOINT_COORD_CHECK)->EnableWindow (TRUE);
}
void DiaWP::OnSysCommand(UINT nID, LPARAM lParam)
{
CFormView::OnSysCommand(nID, lParam);
}
// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.
void DiaWP::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CFormView::OnPaint();
}
}
// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR DiaWP::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
void DiaWP::OnKillfocusWaypointEdit()
{
if (!m_bEditRadius) return;
UpdateData (TRUE);
GLI_tdxValue xRadius = (GLI_tdxValue)m_fRadius;
if (xRadius == 0.0f)
xRadius = 0.001f;
m_poWP->fn_vSetRadius (&xRadius);
m_poWP->fn_vDrawNewRadius ();
m_bEditRadius=FALSE;
}
BOOL DiaWP::OnCommand(WPARAM wParam, LPARAM lParam)
{
// TODO: Add your specialized code here and/or call the base class
if (wParam==1)
{
OnKillfocusWaypointEdit();
OnKillfocusWaypointNameEdit();
}
return CFormView::OnCommand(wParam, lParam);
}
void DiaWP::OnWaypointCoordCheck()
{
m_poWP->fn_vChangeSystemCoordinate ();
}
void DiaWP::OnChangeWaypointEdit()
{
m_bEditRadius=TRUE;
}
// we want a real draw
void DiaWP::OnRealwpRadio()
{
m_poWP->fn_vSetGeneralRealDraw (TRUE);
fn_vDrawWP ();
}
void DiaWP::OnSymbolicalwpRadio()
{
m_poWP->fn_vSetGeneralRealDraw (FALSE);
fn_vDrawWP ();
}
void DiaWP::OnGlobaldrawCheck()
{
// set the memeber varaible
UpdateData (TRUE);
// change the status of the WP object
m_poWP->fn_vSetGlobalDraw (m_bGlobalCheck);
// change the radio buttons push
CheckRadioButton( IDC_SYMBOLICALWP_RADIO, IDC_REALWP_RADIO, m_poWP->fn_bIsGeneralRealDraw() ? IDC_REALWP_RADIO : IDC_SYMBOLICALWP_RADIO );
((Waypoint_Interface*)(m_poWP->GetInterface()))->fn_vDrawAllWP();
}
// draw all the WP that must be redraw
void DiaWP::fn_vDrawWP (void)
{
if (m_bGlobalCheck) ((Waypoint_Interface*)(m_poWP->GetInterface()))->fn_vDrawAllWP();
else m_poWP->fn_vDraw (); // draw the WP in his new mode
}
// Neme edition
void DiaWP::fn_vEditName (void)
{
m_csWaypointName = m_poWP->GetName();
}
void DiaWP::OnKillfocusWaypointNameEdit()
{
CString pOldName = m_csWaypointName;
UpdateData (TRUE);
if (pOldName == m_csWaypointName) return;
if (m_poWP->fn_eRename (m_csWaypointName)!=E_mc_None)
{
MessageBox ( m_csWaypointName+CString( " is already used."),"Attention",MB_ICONEXCLAMATION );
m_csWaypointName=pOldName;
UpdateData (FALSE);
}
else
{
m_poWP->GetInterface()->fn_vRefreshHierarchyList ();
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
Way::fn_pGetDialog()->fn_vRefreshNameList ();
// notify all the ways using this waypoint
POSITION xPos;
Way* poWay;
for ( poWay=Way::fn_poGetListOfWay()->GetHeadElement(xPos); poWay; poWay=Way::fn_poGetListOfWay()->GetNextElement(xPos) )
if ( poWay->fn_iIsWayPointInNet ((WayPoint*)m_poWP)>=0 ) poWay->fn_vNotifySave ();
*/
//ENDANNECY Shaitan Nettoyage }
}
}
BOOL DiaWP::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
BOOL bCreate = CFormView::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
TUT_M_vGetTutDll ();
TUT_M_vRegisterControl (m_hWnd , "OWP_WaypointDialog" , TUT_e_Window);
TUT_M_vRegisterControlID (IDC_GLOBALDRAW_CHECK,"OWP_GlobalDraw",TUT_e_Button);
TUT_M_vRegisterControlID (IDC_SYMBOLICALWP_RADIO,"OWP_SymbolicalDraw",TUT_e_Button);
TUT_M_vRegisterControlID (IDC_REALWP_RADIO,"OWP_RealDraw",TUT_e_Button);
TUT_M_vRegisterControlID (IDC_WAYPOINT_COORD_CHECK,"OWP_Absolute",TUT_e_Button);
TUT_M_vRegisterControlID (IDC_WAYPOINT_EDIT,"OWP_WaypointRadiusEdit",TUT_e_TextEdit);
TUT_M_vRegisterControlID (IDC_WAYPOINT_NAME_EDIT,"OWP_WaypointNameEdit",TUT_e_TextEdit);
return bCreate;
}
void DiaWP::OnDestroy()
{
TUT_M_vGetTutDll ();
TUT_M_vUnregisterControl (m_hWnd);
TUT_M_vUnregisterControlID (IDC_GLOBALDRAW_CHECK);
TUT_M_vUnregisterControlID (IDC_SYMBOLICALWP_RADIO);
TUT_M_vUnregisterControlID (IDC_REALWP_RADIO);
TUT_M_vUnregisterControlID (IDC_WAYPOINT_COORD_CHECK);
TUT_M_vUnregisterControlID (IDC_WAYPOINT_EDIT);
TUT_M_vUnregisterControlID (IDC_WAYPOINT_NAME_EDIT);
}

View File

@@ -0,0 +1,131 @@
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : WPMod.cpp
//
// Modification classes
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// inherit from CPA_Modif
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 21 jan 1997 Author: J Th<54>noz
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
//
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
*/
#include "stdafx.h"
#include "acp_base.h"
#include "resource.h"
#include "incitf.h"
#include "incgam.h"
#include "incai.h"
#include "WpObj.hpp"
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
#include "WayObj.hpp"
#include "LinkObj.hpp"
*/
//ENDANNECY Shaitan Nettoyage }
#include "WPMod.hpp"
#include "WPDia.hpp"
#include "inter.hpp"
ModifWayPointRadius::ModifWayPointRadius (WayPoint* poWP, GLI_tdxValue* pxR, BOOL pBlock) : CPA_Modif (TYPE_RADIUS_WP,"Change radius WayPoint",pBlock)
{
m_poWP = poWP;
m_xOldRadius = 0.;
m_xNewRadius = *pxR;
m_bFirstTime=TRUE;
}
BOOL ModifWayPointRadius::Do (void)
{
m_xOldRadius = WP_fnx_WayPoint_GetRadius (m_poWP->GetStruct() );
WP_fnv_WayPoint_SetRadius (m_poWP->GetStruct(), m_xNewRadius);
if (m_bFirstTime) m_bFirstTime=FALSE;
WayPoint::fn_pGetDialog()->fn_vRefreshDialog();
m_poWP->fn_vNotifySave ();
return TRUE;
}
BOOL ModifWayPointRadius::Undo (void)
{
WP_fnv_WayPoint_SetRadius (m_poWP->GetStruct(), m_xOldRadius);
WayPoint::fn_pGetDialog()->fn_vRefreshDialog();
m_poWP->fn_vNotifySave ();
return TRUE;
}
ModifWayPointCoordinate::ModifWayPointCoordinate (WayPoint* poWP, BOOL pBlock) : CPA_Modif (TYPE_COORDINATE_WP,"Change coordinate WayPoint",pBlock)
{
m_poWP = poWP;
m_bFirstTime=TRUE;
if (!m_poWP->fn_bGetCoordinate()) m_poWP->fn_vSetFather ( (CPA_SuperObject*)(m_poWP->GetSuperObject()->GetParent()) );
}
BOOL ModifWayPointCoordinate::Do (void)
{
fn_vChangeSystemCoordinate ();
if (m_bFirstTime) m_bFirstTime=FALSE;
else WayPoint::fn_pGetDialog()->fn_vRefreshDialog();
m_poWP->fn_vNotifySave ();
return TRUE;
}
BOOL ModifWayPointCoordinate::Undo (void)
{
fn_vChangeSystemCoordinate ();
WayPoint::fn_pGetDialog()->fn_vRefreshDialog();
m_poWP->fn_vNotifySave ();
return TRUE;
}
void ModifWayPointCoordinate::fn_vChangeSystemCoordinate (void)
{
BOOL bAbsoluteCoordinate = !m_poWP->fn_bGetCoordinate();
m_poWP->fn_vSetCoordinate (bAbsoluteCoordinate);
// traitement coordonn<6E>es moteurs
if (bAbsoluteCoordinate)
{
m_poWP->GetInterface()->GetInterface()->fn_bDeleteObjectInHierarchy (m_poWP->GetSuperObject(), FALSE, FALSE, FALSE, FALSE);
m_poWP->GetSuperObject()->SetTypeSO (C_Dynamic);
POS_tdstCompletePosition *pParentMatrix = HIE_fn_hGetSuperObjectGlobalMatrix(m_poWP->fn_pGetFather()->GetStruct());
POS_tdstCompletePosition *pInstanceMatrix = HIE_fn_hGetSuperObjectMatrix(m_poWP->GetSuperObject()->GetStruct());
POS_fn_vMulMatrixMatrix(pInstanceMatrix, pParentMatrix, pInstanceMatrix);
m_poWP->GetInterface()->GetInterface()->fn_bInsertObjectInHierarchy ( m_poWP->GetSuperObject(), m_poWP->GetInterface()->GetInterface()->GetSpecificInterface()->GetDynamicRoot(), FALSE, FALSE, FALSE );
HIE_fn_vSetSuperObjectDrawMask(m_poWP->GetSuperObject()->GetStruct(), GLI_C_lAllIsEnable );
HIE_fn_vSetSuperObjectDrawMask(m_poWP->GetSuperObject()->GetHead()->GetStruct(), GLI_C_lAllIsEnable );
m_poWP->GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
}
else
{
m_poWP->GetInterface()->GetInterface()->fn_bDeleteObjectInHierarchy (m_poWP->GetSuperObject(), FALSE, FALSE, FALSE, FALSE);
m_poWP->GetSuperObject()->SetTypeSO (C_Protected);
POS_tdstCompletePosition *pParentMatrix = HIE_fn_hGetSuperObjectGlobalMatrix(m_poWP->fn_pGetDynamicFather()->GetStruct());
POS_tdstCompletePosition stInvertMatrix;
POS_fn_vInvertMatrix(&stInvertMatrix, pParentMatrix);
POS_tdstCompletePosition *pInstanceMatrix = HIE_fn_hGetSuperObjectMatrix(m_poWP->GetSuperObject()->GetStruct());
POS_fn_vMulMatrixMatrix(pInstanceMatrix, &stInvertMatrix, pInstanceMatrix);
m_poWP->GetInterface()->GetInterface()->fn_bInsertObjectInHierarchy ( m_poWP->GetSuperObject(), m_poWP->fn_pGetDynamicFather(), FALSE, FALSE, FALSE );
WP_fnv_WayPoint_SetSuperObject (m_poWP->GetStruct(), m_poWP->fn_pGetFather()->GetStruct() );
m_poWP->GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
}
}

View File

@@ -0,0 +1,815 @@
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : WPObj.cpp
//
// Definition of the waypoint editors objects
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// inherit from : CPA_Object
// CPA_EdMot<ACP_tdxHandleOfLink>
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 21 jan 1997 Author: J Th<54>noz
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
//
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
*/
#include "stdafx.h"
#include "acp_base.h"
#include "resource.h"
#include "incdpt.h"
#include "incitf.h"
#include "incgam.h"
#include "incai.h"
#include "WPObj.hpp"
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
#include "WayObj.hpp"
#include "LinkObj.hpp"
*/
//ENDANNECY Shaitan Nettoyage }
#include "Inter.hpp"
#include "WPMod.hpp"
#include "WPDia.hpp"
#include "x:\cpa\main\inc\_editid.h"
//--------------------------------------- Script definition
static char* pszWaypointAction = "Waypoint";
//----------------------------------------------- static variables
BOOL WayPoint::ms_bRealDraw = TRUE;
BOOL WayPoint::ms_bGlobalDraw = FALSE;
BOOL WayPoint::ms_bOnScreen=TRUE;
DiaWP* WayPoint::ms_poDiaWP;
BOOL WayPoint::ms_bNotifyHeader;
BOOL WayPoint::ms_bDrawJustIsolateWaypoint;
CPA_List<WayPoint> WayPoint::ms_oListOfWaypoint;
Waypoint_Interface* WayPoint::ms_poInterface;
DeclareTemplateStatic(WP_tdhWayPoint);
void WayPoint::fn_vSetDialog ( DiaWP* poDiaWP )
{
ms_poDiaWP=poDiaWP;
ms_poDiaWP->fn_vInitDialog ();
}
void del(WP_tdhWayPoint h)
{
if (M_GetMainApp()->m_bLeavingApplication == TRUE)
return;
WP_fnv_WayPoint_Destroy(h);
}
void WayPoint::fn_vInitObject (Waypoint_Interface* poInterface)
{
// init Edmot
CPA_EdMot<WP_tdhWayPoint>::Init (WP_fnh_WayPoint_Create, WP_fnv_WayPoint_Copy, del);
ms_bNotifyHeader=FALSE;
ms_poInterface = poInterface;
ms_bOnScreen = TRUE;
ms_bDrawJustIsolateWaypoint = TRUE;
}
void WayPoint::fn_vRefreshWaypoint (void)
{
POSITION xPos;
WayPoint* poWaypoint;
CPA_SuperObject* poSuperObject;
CPA_List<CPA_SuperObject>* pListOfWaypointInHierarchy;
CPA_List<WayPoint> oListOfWaypointToRetreive;
CPA_BaseObjectList oListOfAllWaypoint;
// serach invisible ways in hierarchy
pListOfWaypointInHierarchy = GetInterface()->GetInterface()->GetObjectListByType("Waypoint");
if (pListOfWaypointInHierarchy->GetCount())
{
for ( poSuperObject=pListOfWaypointInHierarchy->GetHeadElement (xPos); xPos; poSuperObject=pListOfWaypointInHierarchy->GetNextElement (xPos) )
{
if (poSuperObject)
{
poWaypoint = (WayPoint*)(poSuperObject->GetObject());
if (!poWaypoint->fn_bIsWaypointDrawable()) oListOfWaypointToRetreive.AddTail (poWaypoint);
}
}
}
// and retreive them now
GetInterface()->fn_vSetRefreshWay (TRUE);
for ( poWaypoint=oListOfWaypointToRetreive.GetHeadElement (xPos); xPos; poWaypoint=oListOfWaypointToRetreive.GetNextElement (xPos) )
{
GetInterface()->fn_vSetModifDeleteOk (TRUE);
GetInterface()->GetInterface()->fn_bDeleteObjectInHierarchy (poWaypoint->GetSuperObject(),FALSE,FALSE,FALSE,FALSE);
GetInterface()->fn_vSetModifDeleteOk (FALSE);
}
// Add the way that are not in hierarchy and should be
if (ms_oListOfWaypoint.GetCount())
{
for (poWaypoint=ms_oListOfWaypoint.GetHeadElement(xPos); poWaypoint; poWaypoint=ms_oListOfWaypoint.GetNextElement(xPos) )
// the waypoint is virtual ?
if (poWaypoint->GetSuperObject())
{
// the waypoint is not in the hierarchy
if (!poWaypoint->GetSuperObject()->GetParent())
{
if (poWaypoint->fn_bIsWaypointDrawable ())
if (poWaypoint->fn_pGetFather())
// local waypoint
GetInterface()->GetInterface()->fn_bInsertObjectInHierarchy (poWaypoint->GetSuperObject(), poWaypoint->fn_pGetFather(),FALSE,FALSE,FALSE );
else
// absolute waypoint
GetInterface()->GetInterface()->fn_bInsertObjectInHierarchy (poWaypoint->GetSuperObject(), GetInterface()->GetInterface()->GetSpecificInterface()->GetDynamicRoot(),FALSE,FALSE,FALSE );
}
}
}
GetInterface()->fn_vSetRefreshWay (FALSE);
GetInterface()->GetInterface()->fn_vCancelCurrentSelection (FALSE);
}
BOOL WayPoint::fn_bCheckWaypointCoherence (CPA_List<WayPoint> *poWaypointList)
{
POSITION xPos;
WayPoint* poWaypoint;
BOOL bCheckWaypointCoherence = TRUE;
for ( poWaypoint=ms_oListOfWaypoint.GetHeadElement(xPos); xPos; poWaypoint=ms_oListOfWaypoint.GetNextElement(xPos) )
{
if (!poWaypoint->fn_bCheckCoherence())
{
if (poWaypointList) poWaypointList->AddTail (poWaypoint);
bCheckWaypointCoherence = FALSE;
}
}
return bCheckWaypointCoherence;
}
WayPoint::WayPoint (CPA_ObjectDLLBase *p_oDLL, BOOL bAlone, CString csName, BOOL bSave):
CPA_SaveObject ( p_oDLL, C_szWayPointTypeName, E_ss_Responsible )
{
m_bAbsoluteCoordinate=FALSE;
MTH_tdxReal stInitialValueRadius = 1.f;
WP_fnv_WayPoint_SetRadius ((WP_tdhWayPoint)GetEngineStruct(), stInitialValueRadius);
m_bCurrentDraw=FALSE;
m_bRealDraw=FALSE;
m_bSave=bSave;
m_bAlone = bAlone;
m_bOnScreen = FALSE;
m_poSuperObject = NULL;
// Shaitan Correction {
m_pSymbolicalGraphic = GetInterface()->fn_pGetNewSymbolicalGraphicObject();
m_pSymbolicalGraphic->SetEditProtected (TRUE);
m_pRealGraphic = GetInterface()->fn_pGetNewSphericalGraphicObject();
m_pRealGraphic->SetEditProtected (TRUE);
//End Shaitan Correction }
m_poDynamicFather = NULL;
ms_oListOfWaypoint.AddTail (this);
char szLevelFileName [256];
char szSectionName [SCR_CV_ui_Cfg_MaxLenName];
fn_zsGetActualLevelFilename (szLevelFileName,"wp");
long lSizePath = strlen ( fn_szGetLevelsDataPath() );
CString csLevelName = szLevelFileName+lSizePath+1;
csLevelName += "^";
csLevelName += m_bAlone ? C_SubSectionIsolateWayPointDescription : C_SubSectionInWayWayPointDescription;
// section object
SetSectionData ( this ) ;
SetCallBackSave ( fn_vCallbackSave ) ;
SetDataPath ( fn_szGetLevelsDataPath() ) ;
SCR_fn_v_RdL0_ComputeSectionName ( szSectionName, (char *)(LPCSTR)csLevelName, pszWaypointAction, " ");
SetReferencedSectionName (szSectionName);
// name
if ( fn_eRename (csName) != E_mc_None)
SetDefaultValidName ( ) ;
fn_vUpdateSectionName ( ) ;
SetExistingSection (FALSE) ;
// update link table
SCR_fnp_st_Link_SetValue (WP_fnp_WayPoint_GetLinkTable(),
(char*)(LPCSTR)GetCompleteSectionName(),
(unsigned long)GetEngineStruct());
fn_vNotifySave ();
}
WayPoint::WayPoint ( CPA_ObjectDLLBase *p_oDLL, WP_tdhWayPoint hEngineWP, CString csName, CString csFileName, CString csSectionName ):
CPA_SaveObject ( p_oDLL, C_szWayPointTypeName, E_ss_Responsible ),
CPA_EdMot<WP_tdhWayPoint>(hEngineWP)
{
char szSectionName [SCR_CV_ui_Cfg_MaxLenName];
m_bAbsoluteCoordinate=WP_fnb_WayPoint_IsStatic (hEngineWP);
m_bCurrentDraw=FALSE;
m_bRealDraw=FALSE;
m_bSave=TRUE;
m_bOnScreen = FALSE;
m_poSuperObject = NULL;
// Shaitan Correction {
m_pSymbolicalGraphic = GetInterface()->fn_pGetNewSymbolicalGraphicObject();
m_pSymbolicalGraphic->SetEditProtected (TRUE);
m_pRealGraphic = GetInterface()->fn_pGetNewSphericalGraphicObject();
m_pRealGraphic->SetEditProtected (TRUE);
//End Shaitan Correction }
m_poDynamicFather = NULL;
ms_oListOfWaypoint.AddTail (this);
// section object
SetSectionData ( this ) ;
SetCallBackSave ( fn_vCallbackSave ) ;
SetDataPath ( fn_szGetLevelsDataPath() ) ;
SCR_fn_v_RdL0_ComputeSectionName ( szSectionName, (char *)(LPCSTR)csFileName, (char *)(LPCSTR)csSectionName, " ");
SetReferencedSectionName (szSectionName);
// name
if ( fn_eRename (csName) != E_mc_None)
SetDefaultValidName ( ) ;
fn_vUpdateSectionName ( ) ;
SetExistingSection (TRUE) ;
}
WayPoint::WayPoint( WayPoint& rWayPoint):
CPA_SaveObject ( ms_poInterface, C_szWayPointTypeName, E_ss_Responsible ),
CPA_EdMot<WP_tdhWayPoint>()
{
m_bAbsoluteCoordinate=rWayPoint.m_bAbsoluteCoordinate;
m_poFather=rWayPoint.m_poFather;
m_bCurrentDraw=rWayPoint.m_bCurrentDraw;
m_bRealDraw=rWayPoint.m_bRealDraw;
m_bSave=rWayPoint.m_bSave;
m_bOnScreen = FALSE;
m_poSuperObject = NULL;
// Shaitan Correction {
m_pSymbolicalGraphic = GetInterface()->fn_pGetNewSymbolicalGraphicObject();
m_pSymbolicalGraphic->SetEditProtected (TRUE);
m_pRealGraphic = GetInterface()->fn_pGetNewSphericalGraphicObject();
m_pRealGraphic->SetEditProtected (TRUE);
//End Shaitan Correction }
ms_oListOfWaypoint.AddTail (this);
WP_fnv_WayPoint_Copy (GetStruct(), rWayPoint.GetStruct());
// section object
SetSectionData ( this ) ;
SetCallBackSave ( fn_vCallbackSave ) ;
SetDataPath ( fn_szGetLevelsDataPath() ) ;
SetReferencedSectionName ( rWayPoint.GetReferencedSectionName() );
// name
if ( fn_eRename (rWayPoint.GetName() ) != E_mc_None)
SetDefaultValidName ( ) ;
fn_vUpdateSectionName ( ) ;
}
WayPoint::~WayPoint(void)
{
POSITION DeletePos = ms_oListOfWaypoint.Find( this );
ms_oListOfWaypoint.RemoveAt (DeletePos);
}
WayPoint& WayPoint::operator= (WayPoint& rWayPoint)
{
m_bAbsoluteCoordinate=rWayPoint.m_bAbsoluteCoordinate;
m_poFather=rWayPoint.m_poFather;
m_bCurrentDraw=rWayPoint.m_bCurrentDraw;
m_bRealDraw=rWayPoint.m_bRealDraw;
m_bSave=rWayPoint.m_bSave;
WP_fnv_WayPoint_Copy (GetStruct(), rWayPoint.GetStruct());
return *this;
}
//-------------------------------------------------------------------
// Data
//-------------------------------------------------------------------
long WayPoint::GetDataType (void)
{
return HIE_C_ulEDT_Waypoint;
}
void* WayPoint::GetData (void)
{
return GetStruct();
}
//-------------------------------------------------------------------
// SAVE
//-------------------------------------------------------------------
void WayPoint::fn_vNotifySave (void)
{
if (!m_bSave) return;
if (!GetInterface()->fn_bExistWaypointSaveFile() && !ms_bNotifyHeader)
{
char szSectionName [SCR_CV_ui_Cfg_MaxLenName];
// header
SCR_fn_v_SvL1_RegisterNotify ( GetInterface()->fn_csGetWaypointSaveFileName().GetBuffer(256), WayPoint::fn_vCallbackHeader, NULL, SCR_EA_Ntfy_AddSection );
// Isolate section
SCR_fn_v_RdL0_ComputeSectionName
(
szSectionName,
GetInterface()->fn_csGetWaypointSaveFileName().GetBuffer(256),
C_SubSectionIsolateWayPointDescription,
" "
);
SCR_fn_v_SvL1_RegisterNotify ( szSectionName, WayPoint::fn_vCallbackEmptySectionWaypointIsolate, NULL, SCR_EA_Ntfy_AddSection );
// Inway section
SCR_fn_v_RdL0_ComputeSectionName
(
szSectionName,
GetInterface()->fn_csGetWaypointSaveFileName().GetBuffer(256),
C_SubSectionInWayWayPointDescription,
" "
);
SCR_fn_v_SvL1_RegisterNotify ( szSectionName, WayPoint::fn_vCallbackEmptySectionWaypointInWay, NULL, SCR_EA_Ntfy_AddSection );
ms_bNotifyHeader=TRUE;
}
fn_vNotifySection( SCR_EA_Ntfy_AddOrRebuildSection );
}
void WayPoint::fn_vNotifyUnSave (void)
{
if (m_bSave) CPA_SaveObject::fn_vNotifyUnSave ();
}
void WayPoint::fn_vNotifyRestore (void)
{
if (m_bSave) CPA_SaveObject::fn_vNotifyRestore ();
}
void WayPoint::fn_vNotifyRename (void)
{
if (m_bSave) CPA_SaveObject::fn_vNotifyRename ();
}
void WayPoint::fn_vUpdateReference (CPA_SaveObject *pReferencedObject)
{
if (m_bSave) fn_vUpdateReference (pReferencedObject);
}
void WayPoint::fn_vCallbackHeader ( SCR_tdst_File_Description *p_stFile, char *_p_szSectionName, void *_p_vData,SCR_tde_Ntfy_Action _eAction )
{
if (_eAction==SCR_EA_Ntfy_AddSection)
{
char szBuffer [256];
char szTime [256];
char szDate [256];
SCR_M_SvL0_SaveScriptFileHeader(p_stFile);
SCR_M_SvL0_SaveComment(p_stFile, "Generated by waypoint editor");
_strtime(szTime);
_strdate(szDate);
sprintf(szBuffer, "Created date : %s %s", szDate, szTime);
SCR_M_SvL0_SaveComment(p_stFile, szBuffer);
SCR_M_SvL0_SaveBlankLine(p_stFile);
}
}
// create empty section for isolate waypoint
void WayPoint::fn_vCallbackEmptySectionWaypointIsolate ( SCR_tdst_File_Description *p_stFile, char *p_szSectionName, void *_p_vData,SCR_tde_Ntfy_Action _eAction )
{
if (_eAction==SCR_EA_Ntfy_AddSection)
{
char szSectionName [SCR_CV_ui_Cfg_MaxLenName];
strcpy ( szSectionName, C_SubSectionIsolateWayPointDescription );
strcat ( szSectionName, ":" );
SCR_fn_v_SvL1_ToEndSection (p_stFile);
SCR_M_SvL0_SaveBlankLine (p_stFile);
SCR_M_SvL0_SaveBeginSection ( p_stFile, szSectionName, SCR_CC_C_Cfg_EOL );
SCR_M_SvL0_SaveEndSection ( p_stFile, SCR_CC_C_Cfg_EOL );
}
}
// create empty section for waypoint "in way"
void WayPoint::fn_vCallbackEmptySectionWaypointInWay ( SCR_tdst_File_Description *p_stFile, char *p_szSectionName, void *_p_vData,SCR_tde_Ntfy_Action _eAction )
{
if (_eAction==SCR_EA_Ntfy_AddSection)
{
char szSectionName [SCR_CV_ui_Cfg_MaxLenName];
strcpy ( szSectionName, C_SubSectionInWayWayPointDescription );
strcat ( szSectionName, ":" );
SCR_fn_v_SvL1_ToEndSection (p_stFile);
SCR_M_SvL0_SaveBlankLine (p_stFile);
SCR_M_SvL0_SaveBeginSection ( p_stFile, szSectionName, SCR_CC_C_Cfg_EOL );
SCR_M_SvL0_SaveEndSection ( p_stFile, SCR_CC_C_Cfg_EOL );
}
}
void WayPoint::fn_vCallbackSave ( SCR_tdst_File_Description *_p_stFile, char *_p_szSectionName, void *_p_vData,SCR_tde_Ntfy_Action _eAction )
{
WayPoint* poWayPoint = (WayPoint*)_p_vData;
switch (_eAction)
{
case SCR_EA_Ntfy_AddSection :
case SCR_EA_Ntfy_ModifySection :
case SCR_EA_Ntfy_RebuildSection :
{
// declaration
char szSectionName [SCR_CV_ui_Cfg_MaxLenName];
char szObjectName [SCR_CV_ui_Cfg_MaxLenName];
double a3_dVertex [3];
MTH3D_tdstVector stVertex;
double xRadius;
//init
strcpy ( szObjectName, poWayPoint->GetName() );
WP_fnv_WayPoint_GetVertex ( poWayPoint->GetStruct(), &stVertex );
xRadius = WP_fnx_WayPoint_GetRadius ( poWayPoint->GetStruct() );
MTH3D_M_vGetVectorElements ( &(a3_dVertex[0]), &(a3_dVertex[1]), &(a3_dVertex[2]), &stVertex );
SCR_fn_v_RdL0_ComputeSectionName
(
szSectionName,
NULL,
pszWaypointAction,
szObjectName
);
SCR_g_ui_SvL0_IndentationLevel=1;
SCR_M_SvL0_SaveBeginSection ( _p_stFile, szSectionName, SCR_CC_C_Cfg_EOL );
SCR_M_SvL0_SaveEntry( _p_stFile, "Vertex", SCR_CC_C_Cfg_NoChar );
SCR_fn_v_SvL0_SaveParameters_MP( _p_stFile, SCR_EF_SvL0_ArrayDouble, 2, 3, a3_dVertex );
SCR_M_SvL0_SaveEntry( _p_stFile, "Radius", SCR_CC_C_Cfg_NoChar );
SCR_fn_v_SvL0_SaveParameters_MP( _p_stFile, SCR_EF_SvL0_ArrayDouble, 2, 1, &xRadius );
if (WP_fnb_WayPoint_IsDynamic(poWayPoint->GetStruct()))
{
HIE_tdxHandleToSuperObject hSuperObject = WP_fnh_WayPoint_GetSuperObject (poWayPoint->GetStruct());
CPA_BaseObject* poBaseObject = poWayPoint->GetInterface()->GetMainWorld()->fn_p_oFindObjectWithEngine (hSuperObject);
strcpy ( szSectionName, ((CPA_SaveObject*)((CPA_SuperObject*)poBaseObject)->GetObject())->GetReferencedSectionName() );
SCR_M_SvL0_SaveEntry( _p_stFile, "Father", SCR_CC_C_Cfg_NoChar );
SCR_fn_v_SvL0_SaveParameters_MP ( _p_stFile, SCR_EF_SvL0_Normal, 1, szSectionName );
}
SCR_M_SvL0_SaveEndSection (_p_stFile, SCR_CC_C_Cfg_EOL);
SCR_g_ui_SvL0_IndentationLevel=0;
poWayPoint->fn_vSectionSaved ();
} break;
case SCR_EA_Ntfy_DeleteSection :
poWayPoint->fn_vSectionDeleted ();
break;
}
}
void WayPoint::fn_vSetRadius (GLI_tdxValue* pxR)
{
GetInterface()->GetInterface()->GetMultiDevice()->GetEditManager()->AskFor(new ModifWayPointRadius (this, pxR));
}
void WayPoint::fn_vChangeSystemCoordinate (void)
{
GetInterface()->GetInterface()->GetMultiDevice()->GetEditManager()->AskFor(new ModifWayPointCoordinate (this));
}
void WayPoint::fn_vSetCoordinate (BOOL bAbsolute)
{
m_bAbsoluteCoordinate = bAbsolute;
}
GLI_tdxValue WayPoint::fn_xGetRadius (void)
{
GLI_tdxValue stRadius;
stRadius = WP_fnx_WayPoint_GetRadius (GetStruct() );
return stRadius;
}
CPA_SuperObject* WayPoint::fn_pGetFather (void)
{
return m_poFather;
}
void WayPoint::fn_vSetFather (CPA_SuperObject* poFather)
{
m_poFather=poFather;
}
CPA_SuperObject* WayPoint::fn_pGetDynamicFather (void)
{
return m_poDynamicFather;
}
void WayPoint::fn_vSetDynamicFather (CPA_SuperObject* poDynamicFather)
{
m_poDynamicFather=poDynamicFather;
}
void WayPoint::fn_vComputeMotorStructure (void)
{
if (m_bAbsoluteCoordinate)
{
MTH3D_tdstVector stVertex;
// compute absolute matrix
GetInterface()->fn_vComputeAbsoluteMatrix (GetSuperObject());
GEO_tdxHandleToMatrix hAbsoluteMatrix = HIE_fn_hGetSuperObjectGlobalMatrix ( GetSuperObject()->GetStruct() );
POS_fn_vGetTranslationVector( hAbsoluteMatrix, &stVertex ) ;
WP_fnv_WayPoint_SetVertex (GetStruct(), &stVertex);
WP_fnv_WayPoint_SetSuperObject (GetStruct(), NULL);
}
else
{
MTH3D_tdstVector stVertex;
WP_fnv_WayPoint_SetSuperObject ( GetStruct(), fn_pGetFather()->GetStruct() );
GEO_tdxHandleToMatrix hRelativeMatrix;
hRelativeMatrix = HIE_fn_hGetSuperObjectMatrix (GetSuperObject()->GetStruct());
POS_fn_vGetTranslationVector( hRelativeMatrix, &stVertex ) ;
WP_fnv_WayPoint_SetVertex (GetStruct(), &stVertex);
}
}
// this function attach the appropriate graphic object to the WayPoint Object
// bSreen echo on the screen the new draw -> default TRUE
// bDestroy delete in the hiearchy the old graphic object -> default TRUE
void WayPoint::fn_vDraw (BOOL bScreen, BOOL bDestroy)
{
// Shaitan Correction {
CPA_SuperObject * pDelSuperObject;
CPA_SuperObject * pNewGraphicObject;
//End Shaitan Correction }
BOOL bMustChange = (fn_bIsGeneralRealDraw()!=m_bCurrentDraw);
// Shaitan Correction {
// we must change the draw
if (m_bCurrentDraw)
pDelSuperObject = m_pRealGraphic;
else
pDelSuperObject = m_pSymbolicalGraphic;
//End Shaitan Correction }
if (bMustChange)
{
m_bCurrentDraw = fn_bIsGeneralRealDraw();
// Shaitan Correction {
// we must change the draw
// POSITION xPos;
// CPA_SuperObjectBase* pDelSuperObject;
// pDelSuperObject = GetSuperObject()->GetHeadElement (xPos);
//End Shaitan Correction }
// Ruse de sioux
if (bDestroy)
{
GetInterface()->fn_vSetModifDeleteOk (TRUE);
GetInterface()->GetInterface()->fn_bDeleteObjectInHierarchy (pDelSuperObject,FALSE,FALSE,FALSE,FALSE);
GetInterface()->fn_vSetModifDeleteOk (FALSE);
}
else GetSuperObject()->RemoveAll();
}
// Shaitan Correction {
// we must change the draw
if (m_bCurrentDraw)
pNewGraphicObject = m_pRealGraphic;
else
pNewGraphicObject = m_pSymbolicalGraphic;
// pNewGraphicObject = m_bCurrentDraw ? ((Waypoint_Interface*)GetInterface())->fn_pGetNewSphericalGraphicObject() : ((Waypoint_Interface*)GetInterface())->fn_pGetNewSymbolicalGraphicObject ();
//End Shaitan Correction }
if (bMustChange)
{
GetInterface()->GetInterface()->fn_bInsertObjectInHierarchy (pNewGraphicObject, GetSuperObject(),FALSE,FALSE,FALSE);
pNewGraphicObject->SetEditProtected (TRUE);
pNewGraphicObject->SetSuperObjectOwner (GetSuperObject());
}
// register the relative location;
GEO_tdxHandleToMatrix hRelativeMatrix = HIE_fn_hGetSuperObjectMatrix (pDelSuperObject->GetStruct());
// no scale
POS_fn_vResetScaleMatrix( hRelativeMatrix );
if (m_bCurrentDraw)
{
// compute the radius by changing the scale matrix
MTH3D_tdstVector stI, stJ, stK;
GLI_tdxValue xR;
xR = WP_fnx_WayPoint_GetRadius (GetStruct());
POS_fn_vGetScaleMatrix
(
hRelativeMatrix,
&stI,
&stJ,
&stK
);
MTH3D_M_vMulScalarVector(&stI, xR, &stI );
MTH3D_M_vMulScalarVector(&stJ, xR, &stJ );
MTH3D_M_vMulScalarVector(&stK, xR, &stK );
POS_fn_vSetScaleMatrix
(
hRelativeMatrix,
&stI ,
&stJ ,
&stK
);
// normalize
// POS_fn_vNormalizeMatrix( hRelativeMatrix );
}
// correct the scale with the father's one
CPA_SuperObject *pFather = fn_pGetFather();
POS_tdstCompletePosition stScaleMatrix, stInvertMatrix;
POS_fn_vSetIdentityMatrix(&stScaleMatrix);
POS_fn_vSetIdentityMatrix(&stInvertMatrix);
MTH3D_tdstVector stI, stJ, stK;
POS_fn_vGetScaleMatrix
(
HIE_fn_hGetSuperObjectGlobalMatrix(pFather->GetStruct()),
&stI,
&stJ,
&stK
);
POS_fn_vSetScaleMatrix
(
&stScaleMatrix,
&stI ,
&stJ ,
&stK
);
POS_fn_vInvertMatrix(&stInvertMatrix, &stScaleMatrix);
POS_fn_vMulMatrixMatrix(hRelativeMatrix, &stInvertMatrix, hRelativeMatrix);
// init the location
HIE_fn_vSetSuperObjectMatrix(pNewGraphicObject->GetStruct(), hRelativeMatrix);
// Redraw the world
if (bScreen) GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw); // provisoire JT
}
void WayPoint::fn_vDrawNewRadius (void)
{
if (!fn_bIsGeneralRealDraw()) return;
// compute the radius by changing the scale matrix
GEO_tdxHandleToMatrix hRelativeMatrix = HIE_fn_hGetSuperObjectMatrix (m_pRealGraphic->GetStruct());
MTH3D_tdstVector stI, stJ, stK;
GLI_tdxValue xR;
xR = WP_fnx_WayPoint_GetRadius (GetStruct());
POS_fn_vResetScaleMatrix( hRelativeMatrix ) ;
POS_fn_vGetScaleMatrix
(
hRelativeMatrix,
&stI,
&stJ,
&stK
);
MTH3D_M_vMulScalarVector(&stI, xR, &stI );
MTH3D_M_vMulScalarVector(&stJ, xR, &stJ );
MTH3D_M_vMulScalarVector(&stK, xR, &stK );
POS_fn_vSetScaleMatrix
(
hRelativeMatrix,
&stI,
&stJ,
&stK
);
// correct the scale with the father's one
CPA_SuperObject *pFather = fn_pGetFather();
POS_tdstCompletePosition stScaleMatrix, stInvertMatrix;
POS_fn_vSetIdentityMatrix(&stScaleMatrix);
POS_fn_vSetIdentityMatrix(&stInvertMatrix);
POS_fn_vGetScaleMatrix
(
HIE_fn_hGetSuperObjectGlobalMatrix(pFather->GetStruct()),
&stI,
&stJ,
&stK
);
POS_fn_vSetScaleMatrix
(
&stScaleMatrix,
&stI ,
&stJ ,
&stK
);
POS_fn_vInvertMatrix(&stInvertMatrix, &stScaleMatrix);
POS_fn_vMulMatrixMatrix(hRelativeMatrix, &stInvertMatrix, hRelativeMatrix);
// normalize
// POS_fn_vNormalizeMatrix( hRelativeMatrix );
GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
}
BOOL WayPoint::fn_bIsWaypointDrawable (void)
{
return ( (ms_bOnScreen && ( m_bAlone ? TRUE : !fn_bDrawJustIsolateWaypoint() )) || m_bOnScreen ) && fn_bIsValid();
}
BOOL WayPoint::fn_bCheckCoherence (void)
{
CList<CPA_BaseObject*,CPA_BaseObject*> oInvalidFatherList;
int iIncoherenceNb = g_oCoherenceManager.m_fn_iGetInvalidFatherList ( this, &oInvalidFatherList );
if (!iIncoherenceNb) return TRUE;
POSITION xPos;
CPA_BaseObject* poBaseObject;
for ( xPos=oInvalidFatherList.GetHeadPosition(); xPos; oInvalidFatherList.GetNext(xPos) )
{
poBaseObject = oInvalidFatherList.GetAt (xPos);
if (poBaseObject->GetType()==C_szIABehaviourTypeName) return FALSE;
}
return TRUE;
}
BOOL WayPoint::fn_bIsReferencedInAI (void)
{
CList<CPA_BaseObject*,CPA_BaseObject*> oInvalidFatherList;
int iIncoherenceNb = g_oCoherenceManager.m_fn_iGetFatherList ( this, &oInvalidFatherList );
if (!iIncoherenceNb) return FALSE;
POSITION xPos;
CPA_BaseObject* poBaseObject;
for ( xPos=oInvalidFatherList.GetHeadPosition(); xPos; oInvalidFatherList.GetNext(xPos) )
{
poBaseObject = oInvalidFatherList.GetAt (xPos);
if (poBaseObject->GetType()==C_szIABehaviourTypeName) return TRUE;
}
return FALSE;
}

View File

@@ -0,0 +1,604 @@
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : WayMod.cpp
//
// Modification classes
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// inherit from CPA_Modif
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 21 jan 1997 Author: J Th<54>noz
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
//
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
*/
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
#include "stdafx.h"
#include "acp_base.h"
#include "resource.h"
#include "incitf.h"
#include "incgam.h"
#include "incai.h"
#include "WpObj.hpp"
#include "WayObj.hpp"
#include "LinkObj.hpp"
#include "WayMod.hpp"
#include "Inter.hpp"
#include "WayDia.hpp"
ModifWayInsert::ModifWayInsert (Way* pWay, WayPoint* pInsertWP, WP_tduc_WPIndex stBeforeWP, BOOL bDialog1stRefresh, BOOL pBlock) : CPA_Modif (TYPE_INSERT_WP,"",pBlock)
{
m_pWay = pWay;
m_pWay->GetInterface()->fn_bComputeRealWay (&m_pWay);
m_pInsertWP = pInsertWP;
m_stBeforeWP = stBeforeWP;
m_DialogRefresh=bDialog1stRefresh;
SetName(CString("Insert ")+CString(m_pInsertWP->GetName())+CString (" into ")+CString (m_pWay->GetName()));
}
BOOL ModifWayInsert::Do (void)
{
POSITION lPosWP, lPosLink;
WayPoint* poWP;
Link* poLink;
int iSelect=0;
// insert object in the editor list
if (m_stBeforeWP<m_pWay->GetListWaypoint()->GetCount())
{
//----------- link
if (m_stBeforeWP)
{
m_pOldLink = m_pWay->fn_pGetLink (m_stBeforeWP-1);
m_pOldLink->fn_vSplitLink ( m_pWay, m_pInsertWP, &m_pLinkBefore, &m_pLinkAfter );
m_pOldLink->fn_vSetRemoveInHierarchy (TRUE);
m_pLinkBefore->fn_vSetAddInHierarchy (TRUE);
m_pLinkAfter->fn_vSetAddInHierarchy (TRUE);
for (poLink=m_pWay->GetListLink()->GetHeadElement(lPosLink), iSelect=1; poLink && iSelect!=m_stBeforeWP; poLink=m_pWay->GetListLink()->GetNextElement(lPosLink), iSelect++);
if (poLink)
{
m_pWay->GetListLink()->SetAt( lPosLink, m_pLinkAfter );
m_pWay->GetListLink()->InsertBefore( lPosLink, m_pLinkBefore );
}
}
else
{
m_pOldLink=NULL;
m_pLinkBefore=NULL;
m_pLinkAfter=(Link*)(m_pWay->fn_pCreateLink (m_pWay->fn_cGetDefaultLink())->GetObject());
m_pLinkAfter->fn_vSetWaypoints ( m_pInsertWP, m_pWay->GetListWaypoint()->GetHead () );
m_pWay->GetListLink()->AddHead ( m_pLinkAfter );
}
//------------- waypoint
for (poWP=m_pWay->GetListWaypoint()->GetHeadElement(lPosWP), iSelect=0; poWP && iSelect!=m_stBeforeWP; poWP=m_pWay->GetListWaypoint()->GetNextElement(lPosWP), iSelect++);
if (poWP) m_pWay->GetListWaypoint()->InsertBefore(lPosWP,m_pInsertWP);
}
else
{
//---------- link
m_pOldLink=NULL;
m_pLinkAfter=NULL;
m_pLinkBefore=NULL;
if (m_pWay->GetListWaypoint()->GetCount())
{
m_pLinkBefore = (Link*) (m_pWay->fn_pCreateLink(m_pWay->fn_cGetDefaultLink())->GetObject());
m_pLinkBefore->fn_vSetWaypoints (m_pWay->GetListWaypoint()->GetTail (), m_pInsertWP);
m_pLinkBefore->fn_vSetAddInHierarchy (TRUE);
m_pWay->GetListLink()->AddTail(m_pLinkBefore);
}
//---------- waypoint
m_pWay->GetListWaypoint()->AddTail(m_pInsertWP);
iSelect=m_pWay->GetListWaypoint()->GetCount();
}
// insert the WP and the links in the engine structure
WP_fnv_Way_InsertWayPoint ((WP_tdhWay)(m_pWay->GetStruct()), (WP_tdhWayPoint)(m_pInsertWP->GetStruct()),m_pLinkBefore ? (WP_tdhLink)(m_pLinkBefore->GetStruct()) : NULL, m_pLinkAfter ? (WP_tdhLink)(m_pLinkAfter->GetStruct()) : NULL , m_stBeforeWP);
// refresh the dialog if it's open
if (!m_DialogRefresh) m_DialogRefresh=TRUE;
else
if (m_pWay->fn_bIsDialog()) m_pWay->fn_pGetDialog()->fn_vRefreshDialog(iSelect);
// refreh the waypoint dialog
m_pWay->GetInterface()->fn_vRefreshWaypointCoordinate ();
// refresh the graphic
m_pInsertWP->fn_vDraw(FALSE,TRUE);
m_pWay->fn_vRefresh();
m_pWay->GetInterface()->fn_vRefreshHierarchyList ();
m_pWay->fn_vNotifySave ();
return TRUE;
}
BOOL ModifWayInsert::Undo (void)
{
POSITION lPosWP, lPosLink;
WayPoint* poWP;
Link* poLink;
int iSelect=0;
// delete object in the engine structure
WP_fnv_Way_DeleteWayPoint ((WP_tdhWay)(m_pWay->GetStruct()), m_stBeforeWP, m_pOldLink ? (WP_tdhLink)m_pOldLink->GetStruct() : NULL );
// delete object in the editor list
for (poWP=m_pWay->GetListWaypoint()->GetHeadElement(lPosWP), iSelect=0; poWP && iSelect!=m_stBeforeWP; poWP=m_pWay->GetListWaypoint()->GetNextElement(lPosWP), iSelect++);
if (poWP) m_pWay->GetListWaypoint()->RemoveAt(lPosWP);
// restore editors links
if (m_stBeforeWP)
{
for (poLink=m_pWay->GetListLink()->GetHeadElement(lPosLink), iSelect=1; poLink && iSelect!=m_stBeforeWP; poLink=m_pWay->GetListLink()->GetNextElement(lPosLink), iSelect++);
if (m_pOldLink)
{
m_pWay->GetListLink()->SetAt( lPosLink, m_pOldLink );
m_pOldLink->fn_vSetAddInHierarchy (TRUE);
m_pWay->GetListLink()->GetNextElement(lPosLink);
}
m_pLinkBefore->fn_vSetRemoveInHierarchy (TRUE);
if (m_pLinkAfter) m_pLinkAfter->fn_vSetRemoveInHierarchy (TRUE);
if (lPosLink) m_pWay->GetListLink()->RemoveAt(lPosLink);
}
else
{
if (m_pWay->GetListLink()->GetCount()) m_pWay->GetListLink()->RemoveHead ();
}
if (m_pWay->fn_bIsDialog()) m_pWay->fn_pGetDialog()->fn_vRefreshDialog(iSelect);
m_pWay->GetInterface()->fn_vRefreshWaypointCoordinate();
m_pWay->fn_vRefresh();
m_pWay->GetInterface()->fn_vRefreshHierarchyList ();
m_pWay->fn_vNotifySave ();
return TRUE;
}
ModifWayDelete::ModifWayDelete (Way* pWay, WP_tduc_WPIndex stPosDeleteWP, BOOL pBlock) : CPA_Modif (TYPE_DELETE_WP,"",pBlock)
{
m_pWay = pWay;
m_pWay->GetInterface()->fn_bComputeRealWay (&m_pWay);
m_stDeletePosWP = stPosDeleteWP;
m_pDeleteWP=0;
m_pLink=NULL;
m_DialogRefresh=!pBlock;
SetName(CString("Delete ")+CString(m_pWay->fn_pGetWayPoint ((m_stDeletePosWP==WP_fnuc_Way_GetSizeWay ((WP_tdhWay)(pWay->GetEngineStruct()))) ? m_stDeletePosWP-1 : m_stDeletePosWP)->GetName()) + CString (" in ") + CString (m_pWay->GetName()) );
}
BOOL ModifWayDelete::Do (void)
{
POSITION lPosWP, lPosLink;
POSITION lPosModifyLink;
WayPoint* poWP;
Link* poLink;
int iSelect=0;
// delete object in the editor list
for (poWP=m_pWay->GetListWaypoint()->GetHeadElement(lPosWP), iSelect=0; poWP && iSelect!=m_stDeletePosWP; poWP=m_pWay->GetListWaypoint()->GetNextElement(lPosWP),iSelect++);
if (poWP) {
m_pWay->GetListWaypoint()->RemoveAt(lPosWP); // Ok we have it
m_pDeleteWP=poWP;
}
// modify links in the editor list
if (m_stDeletePosWP)
{
for (poLink=m_pWay->GetListLink()->GetHeadElement(lPosLink), iSelect=1; poLink && iSelect!=m_stDeletePosWP; poLink=m_pWay->GetListLink()->GetNextElement(lPosLink),iSelect++);
lPosModifyLink = lPosLink;
m_pOldLinkBefore=poLink;
m_pOldLinkAfter=m_pWay->GetListLink()->GetNextElement(lPosLink);
if (m_pOldLinkBefore && m_pOldLinkAfter)
{
m_pLink = m_pOldLinkBefore->fn_pMergeLink (m_pWay, m_pOldLinkAfter);
m_pLink->fn_vSetAddInHierarchy (TRUE);
if (m_pOldLinkBefore) m_pOldLinkBefore->fn_vSetRemoveInHierarchy (TRUE);
if (m_pOldLinkAfter) m_pOldLinkAfter->fn_vSetRemoveInHierarchy (TRUE);
m_pWay->GetListLink()->SetAt( lPosModifyLink, m_pLink );
if (m_stDeletePosWP) m_pWay->GetListLink()->RemoveAt(lPosLink);
}
else
{
m_pLink=NULL;
if (m_pOldLinkBefore) m_pOldLinkBefore->fn_vSetRemoveInHierarchy (TRUE);
m_pWay->GetListLink()->RemoveTail ();
}
}
else
{
m_pOldLinkBefore=NULL;
m_pOldLinkAfter=m_pWay->GetListLink()->GetHeadElement(lPosLink);
m_pLink = NULL;
if (m_pWay->GetListLink()->GetCount())
{
m_pWay->GetListLink()->GetHead()->fn_vSetRemoveInHierarchy (TRUE);
m_pWay->GetListLink()->RemoveHead();
}
}
// delete object in the motor structure
if (m_pWay->IsWayEmpty()) WP_fnv_Way_Free ((WP_tdhWay)(m_pWay->GetStruct()));
else WP_fnv_Way_DeleteWayPoint ((WP_tdhWay)(m_pWay->GetStruct()), m_stDeletePosWP, m_pLink ? (WP_tdhLink)m_pLink->GetEngineStruct() : NULL );
// refresh the dialog if it's open
if (m_pWay->fn_bIsDialog()) m_pWay->fn_pGetDialog()->fn_vRefreshDialog(max (iSelect-1,0));
// refreh the waypoint dialog
m_pWay->GetInterface()->fn_vRefreshWaypointCoordinate();
m_pWay->fn_vRefresh();
if (m_DialogRefresh) m_pWay->GetInterface()->fn_vRefreshHierarchyList ();
if (m_pWay->IsWayEmpty())
{
m_pWay->fn_vNotifyUnSave ();
m_pWay->fn_vSetRecreate (TRUE);
if (m_pWay->GetSuperObject()->GetParent())
{
Way::GetInterface()->fn_vSetModifDeleteOk (TRUE);
Way::GetInterface()->GetInterface()->fn_bDeleteObjectInHierarchy (m_pWay->GetSuperObject(), FALSE, FALSE, FALSE, FALSE );
Way::GetInterface()->fn_vSetModifDeleteOk (FALSE);
}
}
else m_pWay->fn_vNotifySave ();
return TRUE;
}
BOOL ModifWayDelete::Undo (void)
{
POSITION lPosWP, lPosLink;
WayPoint* poWP;
Link* poLink;
long lIndex;
if (m_pWay->IsWayEmpty())
{
Way::GetInterface()->fn_vSetRefreshWay (TRUE);
if (!m_pWay->GetSuperObject()->GetParent()) Way::GetInterface()->GetInterface()->fn_bInsertObjectInHierarchy (m_pWay->GetSuperObject(), Way::GetInterface()->GetInterface()->GetSpecificInterface()->GetDynamicRoot(), FALSE, FALSE, FALSE );
Way::GetInterface()->fn_vSetRefreshWay (FALSE);
}
// search the position in the editor list to reinsert and do it
for (poWP=m_pWay->GetListWaypoint()->GetHeadElement(lPosWP), lIndex=0; poWP && lIndex!=m_stDeletePosWP; poWP=m_pWay->GetListWaypoint()->GetNextElement(lPosWP),lIndex++);
if (poWP) m_pWay->GetListWaypoint()->InsertBefore(lPosWP,m_pDeleteWP);
else m_pWay->GetListWaypoint()->AddTail(m_pDeleteWP);
if (m_pWay->fn_bIsDialog()) m_pWay->fn_pGetDialog()->fn_vRefreshDialog(lIndex);
// set the links editor
if (m_stDeletePosWP)
{
if (m_pLink)
{
for (poLink=m_pWay->GetListLink()->GetHeadElement(lPosLink), lIndex=1; poLink && lIndex!=m_stDeletePosWP; poLink=m_pWay->GetListLink()->GetNextElement(lPosLink),lIndex++);
m_pLink->fn_vSetRemoveInHierarchy (TRUE);
if (m_pOldLinkBefore)
{
m_pOldLinkBefore->fn_vSetAddInHierarchy (TRUE);
m_pWay->GetListLink()->SetAt( lPosLink, m_pOldLinkBefore );
}
if (m_pOldLinkAfter)
{
m_pOldLinkAfter->fn_vSetAddInHierarchy (TRUE);
m_pWay->GetListLink()->InsertAfter( lPosLink, m_pOldLinkAfter );
}
}
else
{
m_pOldLinkBefore->fn_vSetAddInHierarchy (TRUE);
m_pWay->GetListLink()->AddTail (m_pOldLinkBefore);
m_pOldLinkBefore->fn_vSetAddInHierarchy (TRUE);
}
}
else
{
if (m_pOldLinkAfter)
{
m_pOldLinkAfter->fn_vSetAddInHierarchy (TRUE);
m_pWay->GetListLink()->AddHead (m_pOldLinkAfter);
}
}
// reinsert the object in the motor structure
WP_fnv_Way_InsertWayPoint ((WP_tdhWay)(m_pWay->GetStruct()), (WP_tdhWayPoint)(m_pDeleteWP->GetStruct()), m_pOldLinkBefore ? (WP_tdhLink)(m_pOldLinkBefore->GetEngineStruct()) : NULL, m_pOldLinkAfter ? (WP_tdhLink)(m_pOldLinkAfter->GetEngineStruct()) : NULL, m_stDeletePosWP);
m_pWay->fn_vRefresh();
// refresh the dialog if it's open
if (m_pWay->fn_bIsDialog()) m_pWay->fn_pGetDialog()->fn_vRefreshDialog ();
// refreh the waypoint dialog
m_pWay->GetInterface()->fn_vRefreshWaypointCoordinate();
if (m_DialogRefresh) m_pWay->GetInterface()->fn_vRefreshHierarchyList ();
m_pWay->fn_vNotifySave ();
return TRUE;
}
ModifWayRemove::ModifWayRemove (Way* pWay, WayPoint* pRemoveWP, BOOL pBlock) : CPA_Modif (TYPE_REMOVE_WP,"Remove WP",pBlock)
{
m_pWay = pWay;
m_pWay->GetInterface()->fn_bComputeRealWay (&m_pWay);
m_pRemoveWP = pRemoveWP;
m_lNbRemoveWP = 0;
m_dstRemovePosWP = NULL;
m_dpoRemoveLinkBefore = NULL;
m_dpoRemoveLinkAfter = NULL;
}
BOOL ModifWayRemove::Do (void)
{
POSITION lPos;
WayPoint* poWP;
// we count the number of waypoint to remove
m_lNbRemoveWP=0;
for
(
poWP=m_pWay->GetListWaypoint()->GetHeadElement(lPos);
poWP;
poWP=m_pWay->GetListWaypoint()->GetNextElement(lPos)
)
if (poWP==m_pRemoveWP) m_lNbRemoveWP++;
// we allocate the array of position
m_dstRemovePosWP = new WP_tduc_WPIndex [m_lNbRemoveWP];
m_dpoRemoveLinkBefore = new Link* [m_lNbRemoveWP];
m_dpoRemoveLinkAfter = new Link* [m_lNbRemoveWP];
long lIndexRemoveWP = 0; // indice in the array
for (lIndexRemoveWP=0; lIndexRemoveWP<m_lNbRemoveWP; lIndexRemoveWP++)
{
POSITION lPosLinkBefore=0, lPosLinkAfter=0, lPosLink=0;
// delete object in the engine structure
m_dstRemovePosWP[lIndexRemoveWP] = WP_fnuc_Way_PositionWayPoint ((WP_tdhWay)(m_pWay->GetStruct()), (WP_tdhWayPoint)(m_pRemoveWP->GetStruct()));
m_dpoRemoveLinkBefore[lIndexRemoveWP] = m_pWay->fn_pGetLink (m_dstRemovePosWP[lIndexRemoveWP]-1);
m_dpoRemoveLinkAfter[lIndexRemoveWP] = m_pWay->fn_pGetLink (m_dstRemovePosWP[lIndexRemoveWP]);
Link* poLink = NULL;
if (m_dpoRemoveLinkBefore[lIndexRemoveWP] && m_dpoRemoveLinkAfter[lIndexRemoveWP])
{
poLink = m_dpoRemoveLinkBefore[lIndexRemoveWP]->fn_pMergeLink (m_pWay, m_dpoRemoveLinkAfter[lIndexRemoveWP] );
poLink->fn_vSetAddInHierarchy (TRUE);
}
// delete object in the editor list
for (poWP=m_pWay->GetListWaypoint()->GetHeadElement(lPos); poWP && poWP!=m_pRemoveWP; poWP=m_pWay->GetListWaypoint()->GetNextElement(lPos) );
if (poWP==m_pRemoveWP) m_pWay->GetListWaypoint()->RemoveAt(lPos);
// replace link in the editor list
if (m_dstRemovePosWP[lIndexRemoveWP]) lPosLinkBefore=m_pWay->GetListLink()->FindIndex (m_dstRemovePosWP[lIndexRemoveWP]-1);
lPosLinkAfter = m_pWay->GetListLink()->FindIndex (m_dstRemovePosWP[lIndexRemoveWP]);
if (lPosLinkBefore) m_pWay->GetListLink()->RemoveAt (lPosLinkBefore);
if (lPosLinkAfter) m_pWay->GetListLink()->RemoveAt (lPosLinkAfter);
if (m_dstRemovePosWP[lIndexRemoveWP]>=2) lPosLink = m_pWay->GetListLink()->FindIndex (m_dstRemovePosWP[lIndexRemoveWP]-2);
if (lPosLinkBefore && lPosLinkAfter)
{
if (lPosLink) m_pWay->GetListLink()->InsertAfter ( lPosLink, poLink );
else m_pWay->GetListLink()->AddHead (poLink);
}
WP_fnv_Way_DeleteWayPoint ((WP_tdhWay)(m_pWay->GetStruct()), m_dstRemovePosWP[lIndexRemoveWP],poLink ? (WP_tdhLink)(poLink->GetEngineStruct()) : NULL );
// Links
if (m_dpoRemoveLinkBefore[lIndexRemoveWP]) m_dpoRemoveLinkBefore[lIndexRemoveWP]->fn_vSetRemoveInHierarchy (TRUE);
if (m_dpoRemoveLinkAfter[lIndexRemoveWP]) m_dpoRemoveLinkAfter[lIndexRemoveWP]->fn_vSetRemoveInHierarchy (TRUE);
}
// refreh the waypoint dialog
m_pWay->GetInterface()->fn_vRefreshWaypointCoordinate();
// refresh the dialog if it's open
if (m_pWay->fn_bIsDialog()) m_pWay->fn_pGetDialog()->fn_vRefreshDialog();
m_pWay->fn_vRefresh();
m_pWay->GetInterface()->fn_vRefreshHierarchyList ();
if (m_pWay->IsWayEmpty())
{
m_pWay->fn_vNotifyUnSave ();
m_pWay->fn_vSetRecreate (TRUE);
if (m_pWay->GetSuperObject()->GetParent())
{
Way::GetInterface()->fn_vSetModifDeleteOk (TRUE);
Way::GetInterface()->GetInterface()->fn_bDeleteObjectInHierarchy (m_pWay->GetSuperObject(), FALSE, FALSE, FALSE, FALSE );
Way::GetInterface()->fn_vSetModifDeleteOk (FALSE);
}
}
else m_pWay->fn_vNotifySave ();
return TRUE;
}
BOOL ModifWayRemove::Undo (void)
{
POSITION lPos;
WayPoint* poWP;
long lWP;
long lIndexRemoveWP = 0;
if (m_pWay->IsWayEmpty())
{
Way::GetInterface()->fn_vSetRefreshWay (TRUE);
if (!m_pWay->GetSuperObject()->GetParent()) Way::GetInterface()->GetInterface()->fn_bInsertObjectInHierarchy (m_pWay->GetSuperObject(), Way::GetInterface()->GetInterface()->GetSpecificInterface()->GetDynamicRoot(), FALSE, FALSE, FALSE );
Way::GetInterface()->fn_vSetRefreshWay (FALSE);
}
// reinsert the object in the motor structure
for (lIndexRemoveWP=m_lNbRemoveWP-1; lIndexRemoveWP>=0; lIndexRemoveWP--)
{
WP_fnv_Way_InsertWayPoint ((WP_tdhWay)(m_pWay->GetStruct()), (WP_tdhWayPoint)(m_pRemoveWP->GetStruct()), m_dpoRemoveLinkBefore[lIndexRemoveWP] ? (WP_tdhLink)(m_dpoRemoveLinkBefore[lIndexRemoveWP]->GetEngineStruct()) : NULL, m_dpoRemoveLinkAfter[lIndexRemoveWP] ? (WP_tdhLink)(m_dpoRemoveLinkAfter[lIndexRemoveWP]->GetEngineStruct()) : NULL, m_dstRemovePosWP[lIndexRemoveWP]);
// search the position in the editor list to reinsert and do it
for (poWP=m_pWay->GetListWaypoint()->GetHeadElement(lPos), lWP=0; poWP && lWP!=m_dstRemovePosWP[lIndexRemoveWP]; poWP=m_pWay->GetListWaypoint()->GetNextElement(lPos),lWP++);
if (poWP) m_pWay->GetListWaypoint()->InsertBefore(lPos,m_pRemoveWP);
else m_pWay->GetListWaypoint()->AddTail(m_pRemoveWP);
// list links
if (m_dstRemovePosWP[lIndexRemoveWP]<2)
{
if (m_dpoRemoveLinkAfter[lIndexRemoveWP] && m_dpoRemoveLinkBefore[lIndexRemoveWP])
{
m_pWay->GetListLink()->GetHead()->fn_vSetRemoveInHierarchy (TRUE);
m_pWay->GetListLink()->RemoveHead ();
}
if (m_dpoRemoveLinkAfter[lIndexRemoveWP]) m_pWay->GetListLink()->AddHead (m_dpoRemoveLinkAfter[lIndexRemoveWP]);
if (m_dpoRemoveLinkBefore[lIndexRemoveWP]) m_pWay->GetListLink()->AddHead (m_dpoRemoveLinkBefore[lIndexRemoveWP]);
}
else
{
POSITION lPosLastLink = m_pWay->GetListLink()->FindIndex (m_dstRemovePosWP[lIndexRemoveWP]-1);
if (lPosLastLink)
{
m_pWay->GetListLink()->GetAt ( lPosLastLink )->fn_vSetRemoveInHierarchy (TRUE);
m_pWay->GetListLink()->RemoveAt ( lPosLastLink );
}
POSITION lPosInsertLink = m_pWay->GetListLink()->FindIndex ( m_dstRemovePosWP[lIndexRemoveWP]-2 );
if (m_dpoRemoveLinkBefore[lIndexRemoveWP]) m_pWay->GetListLink()->InsertAfter (lPosInsertLink, m_dpoRemoveLinkBefore[lIndexRemoveWP]);
m_pWay->GetListLink()->GetNextElement (lPosInsertLink);
if (m_dpoRemoveLinkAfter[lIndexRemoveWP]) m_pWay->GetListLink()->InsertAfter (lPosInsertLink, m_dpoRemoveLinkAfter[lIndexRemoveWP]);
}
// Links
if (m_dpoRemoveLinkBefore[lIndexRemoveWP]) m_dpoRemoveLinkBefore[lIndexRemoveWP]->fn_vSetAddInHierarchy (TRUE);
if (m_dpoRemoveLinkAfter[lIndexRemoveWP]) m_dpoRemoveLinkAfter[lIndexRemoveWP]->fn_vSetAddInHierarchy (TRUE);
}
delete[] m_dstRemovePosWP;
delete[] m_dpoRemoveLinkBefore;
delete[] m_dpoRemoveLinkAfter;
m_dstRemovePosWP=NULL;
m_dpoRemoveLinkBefore=NULL;
m_dpoRemoveLinkAfter=NULL;
if (m_pWay->fn_bIsDialog()) m_pWay->fn_pGetDialog()->fn_vRefreshDialog(lWP);
// refreh the waypoint dialog
m_pWay->GetInterface()->fn_vRefreshWaypointCoordinate();
m_pWay->fn_vRefresh();
m_pWay->GetInterface()->fn_vRefreshHierarchyList ();
m_pWay->fn_vNotifySave ();
return TRUE;
}
// Add a new WP in the net
ModifWayAddWP::ModifWayAddWP ( Way* poWay, MTH3D_tdstVector* pAbsolutePosition, WP_tduc_WPIndex stBeforeWP, CPA_Interface* pEditor, BOOL pBlock ) : CPA_Modif (TYPE_ADD_NEW_WP,"Add new WP", pBlock )
{
m_poWay = poWay;
m_poWay->GetInterface()->fn_bComputeRealWay (&m_poWay);
m_pAbsolutePosition = pAbsolutePosition;
m_pEditor = pEditor;
m_poWay->GetInterface()->fn_vSetNextInstanceInWay ();
m_poSuperWP = m_pEditor->GetNewInstance ("Waypoint", "Waypoint");
HIE_fn_vSetSuperObjectDrawMask(m_poSuperWP->GetStruct(), C_lTexturedElement);
m_pModifInsertWP=NULL;
m_stPosBeforeWP = stBeforeWP;
// compute position of the WayPoint
POS_tdstCompletePosition InvWorldMatrix;
POS_fn_vSetIdentityMatrix(&InvWorldMatrix);
HIE_tdxHandleToSuperObject hSuperWorldEngine = ((DEV_MultiDevice3D *)(m_pEditor->GetMultiDevice()))->GetEngineWorld();
CPA_SuperObject* poSuperWorldEditor = ((DEV_MultiDevice3D *)(m_pEditor->GetMultiDevice()))->GetWorld()->GetRoot();
// set absolute position
GEO_tdxHandleToMatrix hAbsoluteWorldMatrix = HIE_fn_hGetSuperObjectGlobalMatrix (hSuperWorldEngine);
GEO_tdxHandleToMatrix hAbsoluteWPMatrix = HIE_fn_hGetSuperObjectGlobalMatrix (m_poSuperWP->GetStruct());
GEO_tdxHandleToMatrix hRelativeWPMatrix = HIE_fn_hGetSuperObjectMatrix (m_poSuperWP->GetStruct());
POS_fn_vSetIdentityMatrix( hAbsoluteWPMatrix ) ;
POS_fn_vSetTranslationVector
(
hAbsoluteWPMatrix,
m_pAbsolutePosition
);
// compute relative position
POS_fn_vInvertIsoMatrix( &InvWorldMatrix, hAbsoluteWorldMatrix );
POS_fn_vMulMatrixMatrix
(
hRelativeWPMatrix,
&InvWorldMatrix,
hAbsoluteWPMatrix
);
// Set the name
SetName(CString("Add new ")+CString(m_poSuperWP->GetObject()->GetName())+CString(" to ")+CString(m_poWay->GetName()));
}
BOOL ModifWayAddWP::Do (void)
{
CPA_SuperObject* poSuperWorldEditor = ((DEV_MultiDevice3D *)(m_pEditor->GetMultiDevice()))->GetWorld()->GetRoot();
m_poWay->GetInterface()->GetInterface()->fn_bInsertObjectInHierarchy ( m_poSuperWP, m_poWay->GetInterface()->GetInterface()->GetSpecificInterface()->GetDynamicRoot(),FALSE,FALSE, FALSE );
// set the status of the waypoint
((WayPoint*)(m_poSuperWP->GetObject()))->fn_vSetAlone (FALSE);
// Set the engine structure
((WayPoint*)(m_poSuperWP->GetObject()))->fn_vComputeMotorStructure ();
m_pModifInsertWP = new ModifWayInsert (m_poWay, (WayPoint*)(m_poSuperWP->GetObject()), m_stPosBeforeWP );
m_pModifInsertWP->Do ();
m_poWay->fn_vNotifySave ();
return TRUE;
}
BOOL ModifWayAddWP::Undo (void)
{
CPA_SuperObject* poSuperWorldEditor = ((DEV_MultiDevice3D *)(m_pEditor->GetMultiDevice()))->GetWorld()->GetRoot();
// delete the add waypoint from the hiearchie
m_pModifInsertWP->Undo ();
Way::GetInterface()->fn_vSetModifDeleteOk (TRUE);
m_poWay->GetInterface()->GetInterface()->fn_bDeleteObjectInHierarchy ( m_poSuperWP,FALSE,FALSE, FALSE, FALSE );
Way::GetInterface()->fn_vSetModifDeleteOk (FALSE);
delete m_pModifInsertWP;
m_pModifInsertWP=NULL;
// test jt
if (m_poWay->IsWayEmpty())
{
m_poWay->fn_vNotifyUnSave ();
m_poWay->fn_vSetRecreate (TRUE);
if (m_poWay->GetSuperObject()->GetParent())
{
Way::GetInterface()->fn_vSetModifDeleteOk (TRUE);
Way::GetInterface()->GetInterface()->fn_bDeleteObjectInHierarchy (m_poWay->GetSuperObject(), FALSE, FALSE, FALSE, FALSE );
Way::GetInterface()->fn_vSetModifDeleteOk (FALSE);
}
}
else m_poWay->fn_vNotifySave ();
m_pEditor->fn_vUpdateAll (E_mc_JustDraw);
// m_poWay->fn_vNotifySave ();
return TRUE;
}
*/
//ENDANNECY Shaitan Nettoyage }

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,8 @@
LIBRARY
EXPORTS
fn_p_szGetCPAVersion
fn_p_stGetDLLIdentity
fn_p_oGetDLL
fn_vInitDll
SECTIONS
.data READ WRITE

View File

@@ -0,0 +1,337 @@
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : EditDia.cpp
//
// General dialog edition
// - to change the super object name
// - to indicate what is visible
//
///////////////////////////////////////////////////////////////////////////////////////////////////
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 10 mar 1997 Author: J Th<54>noz
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
//
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
*/
#include "stdafx.h"
#include "acp_base.h"
#include "resource.h"
#include "incitf.h"
#include "incgam.h"
#include "incai.h"
#include "EditDia.h"
#include "WPObj.hpp"
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
#include "WayObj.hpp"
#include "LinkObj.hpp"
#include "WayDia.hpp"
*/
//ENDANNECY Shaitan Nettoyage }
#include "Inter.hpp"
#include "x:\cpa\main\inc\_editid.h"
#include "oac.h"
#include "gam.h"
#include "x:/cpa/main/inc/_EditId.h"
#include "tut.h"
/////////////////////////////////////////////////////////////////////////////
// EditDia
IMPLEMENT_DYNCREATE(EditDia, CFormView)
EditDia::EditDia(void)
: CFormView(EditDia::IDD)
{
//{{AFX_DATA_INIT(EditDia)
//}}AFX_DATA_INIT
}
void EditDia::fn_vSetInterface (Waypoint_Interface* poInterface)
{
m_poInterface = poInterface;
}
void EditDia::DoDataExchange(CDataExchange* pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(EditDia)
DDX_Control(pDX, IDC_EDIT_TAB, m_oTab);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(EditDia, CFormView)
//{{AFX_MSG_MAP(EditDia)
ON_BN_CLICKED(IDC_EDIT_WAYPOINT_ON_RADIO, OnEditWaypointOnRadio)
ON_BN_CLICKED(IDC_EDIT_WAYPOINT_OFF_RADIO, OnEditWaypointOffRadio)
ON_BN_CLICKED(IDC_EDIT_WAYPOINT_ALL_RADIO, OnEditWaypointAllRadio)
ON_BN_CLICKED(IDC_EDIT_WAYPOINT_ISOLATE_RADIO, OnEditWaypointIsolateRadio)
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
ON_NOTIFY(TCN_SELCHANGE, IDC_EDIT_TAB, OnSelchangeEditTab)
ON_BN_CLICKED(IDC_EDIT_WAY_OFF_RADIO, OnEditWayOffRadio)
ON_BN_CLICKED(IDC_EDIT_WAY_ON_RADIO, OnEditWayOnRadio)
ON_BN_CLICKED(IDC_EDIT_WAY_SELECTED_RADIO, OnEditWaySelectedRadio)
*/
//ENDANNECY Shaitan Nettoyage }
ON_WM_DESTROY()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
void EditDia::fn_vInit (void)
{
UpdateData (FALSE);
CTabCtrl* poTab = (CTabCtrl*)GetDlgItem (IDC_EDIT_TAB);
TC_ITEM stTabCtrlItemAll;
stTabCtrlItemAll.mask = TCIF_TEXT;
stTabCtrlItemAll.pszText = "All";
poTab->InsertItem( 0, &stTabCtrlItemAll );
poTab->SetItemSize( CSize (30,18) );
GetDlgItem (IDC_EDIT_WAY_ON_RADIO)->Invalidate ();
GetDlgItem (IDC_EDIT_WAY_OFF_RADIO)->Invalidate ();
GetDlgItem (IDC_EDIT_WAY_SELECTED_RADIO)->Invalidate ();
CheckRadioButton( IDC_EDIT_WAYPOINT_ISOLATE_RADIO, IDC_EDIT_WAYPOINT_ALL_RADIO, WayPoint::fn_bDrawJustIsolateWaypoint() ? IDC_EDIT_WAYPOINT_ISOLATE_RADIO : IDC_EDIT_WAYPOINT_ALL_RADIO );
CheckRadioButton( IDC_EDIT_WAYPOINT_ON_RADIO, IDC_EDIT_WAYPOINT_OFF_RADIO, WayPoint::fn_bIsWaypointScreen() ? IDC_EDIT_WAYPOINT_ON_RADIO : IDC_EDIT_WAYPOINT_OFF_RADIO );
}
void EditDia::OnEditWaypointOnRadio()
{
// Enable buttons
GetDlgItem (IDC_EDIT_WAYPOINT_ISOLATE_RADIO)->EnableWindow(TRUE);
GetDlgItem (IDC_EDIT_WAYPOINT_ALL_RADIO)->EnableWindow(TRUE);
WayPoint::fn_vSetWaypointOnScreen (TRUE);
m_poInterface->fn_vRefreshScreen ();
}
void EditDia::OnEditWaypointOffRadio()
{
// Disable buttons
GetDlgItem (IDC_EDIT_WAYPOINT_ISOLATE_RADIO)->EnableWindow(FALSE);
GetDlgItem (IDC_EDIT_WAYPOINT_ALL_RADIO)->EnableWindow(FALSE);
WayPoint::fn_vSetWaypointOnScreen (FALSE);
m_poInterface->fn_vRefreshScreen ();
}
void EditDia::OnEditWaypointAllRadio()
{
WayPoint::fn_vSetDrawJustIsolateWaypoint (FALSE);
m_poInterface->fn_vRefreshScreen ();
}
void EditDia::OnEditWaypointIsolateRadio()
{
WayPoint::fn_vSetDrawJustIsolateWaypoint (TRUE);
m_poInterface->fn_vRefreshScreen ();
}
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
void EditDia::OnSelchangeEditTab(NMHDR* pNMHDR, LRESULT* pResult)
{
if (pNMHDR->idFrom==IDC_EDIT_TAB)
{
int iIndex = m_oTab.GetCurSel();
switch (iIndex)
{
case 0: // All
CheckRadioButton( IDC_EDIT_WAY_ON_RADIO, IDC_EDIT_WAY_SELECTED_RADIO, fn_lGetId (Way::fn_eGetDisplayAllWay()) );
GetDlgItem (IDC_EDIT_WAY_SELECTED_RADIO)->ShowWindow (SW_SHOW);
break;
case 1: // Actor
CheckRadioButton( IDC_EDIT_WAY_ON_RADIO, IDC_EDIT_WAY_SELECTED_RADIO, fn_lGetId ((tdeWayDisplay)m_poInterface->fn_pGetSelectedEdtList()->fn_lGetDrawObjects() ) );
GetDlgItem (IDC_EDIT_WAY_SELECTED_RADIO)->ShowWindow (SW_SHOW);
break;
case 2: // Way
CheckRadioButton( IDC_EDIT_WAY_ON_RADIO, IDC_EDIT_WAY_SELECTED_RADIO, fn_lGetId (((Way*)m_poInterface->fn_pGetSelectedWay())->fn_eGetDisplayWay() ) );
GetDlgItem (IDC_EDIT_WAY_SELECTED_RADIO)->ShowWindow (SW_HIDE);
break;
}
}
*pResult = 0;
}
long EditDia::fn_lGetId (long lWayDisplay)
{
tdeWayDisplay eWayDisplay = (tdeWayDisplay)lWayDisplay;
switch (eWayDisplay)
{
case eWayDisplayOn : return IDC_EDIT_WAY_ON_RADIO;
case eWayDisplayOff : return IDC_EDIT_WAY_OFF_RADIO;
case eWayDisplaySelected : return IDC_EDIT_WAY_SELECTED_RADIO;
default :return 0;
}
}
void EditDia::OnEditWayOffRadio()
{
fn_vSetDisplay (eWayDisplayOff);
}
void EditDia::OnEditWayOnRadio()
{
fn_vSetDisplay (eWayDisplayOn);
}
void EditDia::OnEditWaySelectedRadio()
{
fn_vSetDisplay (eWayDisplaySelected);
}
void EditDia::fn_vSetDisplay ( long lDisplayState )
{
tdeWayDisplay eDisplayState = (tdeWayDisplay)lDisplayState;
int iIndex = m_oTab.GetCurSel();
// set flags to object
fn_vSetFlags ( iIndex, lDisplayState );
// set all previous tab to selected
if (eDisplayState!=eWayDisplayOff)
{
for ( int iCounter=0; iCounter<iIndex; iCounter++)
fn_vSetFlags ( iCounter, (long)eWayDisplaySelected );
}
// Draw screen
m_poInterface->fn_vRefreshScreen ();
}
void EditDia::fn_vSetFlags ( int iIndex, long lDisplayState )
{
tdeWayDisplay eDisplayState = (tdeWayDisplay)lDisplayState;
switch (iIndex)
{
case 0: // all
Way::fn_vSetDisplayAllWay (eDisplayState);
break;
case 1: // instance actor
m_poInterface->fn_poGetEdtListUseByActor (m_poInterface->fn_pGetSelectedInstance ())->fn_vSetDrawObjects ((long)eDisplayState);
break;
case 2 : // way
((Way*)m_poInterface->fn_pGetSelectedWay())->fn_vSetDisplayWay(eDisplayState);
break;
}
}
*/
//ENDANNECY Shaitan Nettoyage }
void EditDia::fn_vRefresh (void)
{
// add
if (m_poInterface->fn_pGetSelectedEdtList() && m_oTab.GetItemCount()==1)
{
TC_ITEM stTabCtrlItemActor;
stTabCtrlItemActor.mask = TCIF_TEXT;
stTabCtrlItemActor.pszText = "Actor";
m_oTab.InsertItem( 1, &stTabCtrlItemActor );
}
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
if (m_poInterface->fn_pGetSelectedWay() && m_oTab.GetItemCount()==2)
{
TC_ITEM stTabCtrlItemWay;
stTabCtrlItemWay.mask = TCIF_TEXT;
stTabCtrlItemWay.pszText = "Way";
m_oTab.InsertItem( 2, &stTabCtrlItemWay );
}
// retrieve
if (!m_poInterface->fn_pGetSelectedWay() && m_oTab.GetItemCount()==3)
{
m_oTab.SetCurSel (1);
m_oTab.DeleteItem (2);
}
*/
//ENDANNECY Shaitan Nettoyage }
if (!m_poInterface->fn_pGetSelectedEdtList() && m_oTab.GetItemCount()==2)
{
m_oTab.SetCurSel (0);
m_oTab.DeleteItem (1);
}
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
// refresh
int iIndex = m_oTab.GetCurSel();
switch (iIndex)
{
case 0: // All
CheckRadioButton( IDC_EDIT_WAY_ON_RADIO, IDC_EDIT_WAY_SELECTED_RADIO, fn_lGetId (Way::fn_eGetDisplayAllWay()) );
break;
case 1: // Actor
CheckRadioButton( IDC_EDIT_WAY_ON_RADIO, IDC_EDIT_WAY_SELECTED_RADIO, fn_lGetId ((tdeWayDisplay)m_poInterface->fn_pGetSelectedEdtList()->fn_lGetDrawObjects() ) );
GetDlgItem (IDC_EDIT_WAY_SELECTED_RADIO)->ShowWindow (SW_SHOW);
break;
case 2: // Way
CheckRadioButton( IDC_EDIT_WAY_ON_RADIO, IDC_EDIT_WAY_OFF_RADIO, fn_lGetId (((Way*)m_poInterface->fn_pGetSelectedWay())->fn_eGetDisplayWay() ) );
GetDlgItem (IDC_EDIT_WAY_SELECTED_RADIO)->ShowWindow (SW_HIDE);
break;
}
*/
//ENDANNECY Shaitan Nettoyage }
Invalidate ();
}
BOOL EditDia::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
BOOL bCreate = CFormView::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
TUT_M_vGetTutDll ();
TUT_M_vRegisterControl (m_hWnd , "OWP_DisplayControlDialog" , TUT_e_Window);
TUT_M_vRegisterControlID (IDC_EDIT_WAYPOINT_ON_RADIO,"OWP_DisplayWaypointOn",TUT_e_Button);
TUT_M_vRegisterControlID (IDC_EDIT_WAYPOINT_OFF_RADIO,"OWP_DisplayWaypointOff",TUT_e_Button);
TUT_M_vRegisterControlID (IDC_EDIT_WAYPOINT_ALL_RADIO,"OWP_DisplayWaypointAll",TUT_e_Button);
TUT_M_vRegisterControlID (IDC_EDIT_WAYPOINT_ISOLATE_RADIO,"OWP_DisplayIsolateWaypoint",TUT_e_Button);
TUT_M_vRegisterControlID (IDC_EDIT_TAB,"OWP_DisplayControlTab",TUT_e_Window); // <- Onglet
TUT_M_vRegisterControlID (IDC_EDIT_WAY_OFF_RADIO,"OWP_DisplayWayOff",TUT_e_Button);
TUT_M_vRegisterControlID (IDC_EDIT_WAY_ON_RADIO,"OWP_DisplayWayOn",TUT_e_Button);
TUT_M_vRegisterControlID (IDC_EDIT_WAY_SELECTED_RADIO,"OWP_DisplayWaySelected",TUT_e_Button);
return bCreate;
}
void EditDia::OnDestroy()
{
CFormView::OnDestroy();
TUT_M_vGetTutDll ();
TUT_M_vUnregisterControl (m_hWnd);
TUT_M_vUnregisterControlID (IDC_EDIT_WAYPOINT_ON_RADIO);
TUT_M_vUnregisterControlID (IDC_EDIT_WAYPOINT_OFF_RADIO);
TUT_M_vUnregisterControlID (IDC_EDIT_WAYPOINT_ALL_RADIO);
TUT_M_vUnregisterControlID (IDC_EDIT_WAYPOINT_ISOLATE_RADIO);
TUT_M_vUnregisterControlID (IDC_EDIT_TAB);
TUT_M_vUnregisterControlID (IDC_EDIT_WAY_OFF_RADIO);
TUT_M_vUnregisterControlID (IDC_EDIT_WAY_ON_RADIO);
TUT_M_vUnregisterControlID (IDC_EDIT_WAY_SELECTED_RADIO);
}

View File

@@ -0,0 +1,119 @@
//ROMTEAM Networks (Gabriela Dumitrascu 25/02/98)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : IsoWpDia.cpp
//
// Definition of the waypoint ,implementation file
///////////////////////////////////////////////////////////////////////////////////////////////////
// inherit from : CDialog
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 1998-02-23 Author: CPA2 Gabriela Dumitrascu
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
///////////////////////////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "acp_base.h"
#include "resource.h"
#include "incitf.h"
#include "incai.h"
#include "WPObj.hpp"
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
#include "WayObj.hpp"
#include "LinkObj.hpp"
#include "WayDia.hpp"
*/
//ENDANNECY Shaitan Nettoyage }
#include "WPDia.hpp"
#include "Inter.hpp"
#include "x:\cpa\main\inc\_EditId.h"
#include "isowpdia.hpp"
#include "tut.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// IsoWPDia dialog
IsoWPDia::IsoWPDia(CWnd* pParent /*=NULL*/)
: CDialog(IsoWPDia::IDD, pParent)
{
//{{AFX_DATA_INIT(IsoWPDia)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void IsoWPDia::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(IsoWPDia)
DDX_Control(pDX, IDC_LIST_WP, m_IsoWpList);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(IsoWPDia, CDialog)
//{{AFX_MSG_MAP(IsoWPDia)
ON_WM_DESTROY()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// IsoWPDia message handlers
void IsoWPDia::OnOK()
{
int i = 0;
POSITION lPos;
m_oListOfSelWP.RemoveAll();
for (WayPoint* poWP = m_oListOfWP.GetHeadElement(lPos); poWP; poWP = m_oListOfWP.GetNextElement(lPos), i++)
{
if (m_IsoWpList.GetSel(i))
m_oListOfSelWP.AddTail(poWP);
}
CDialog::OnOK();
}
BOOL IsoWPDia::OnInitDialog()
{
CDialog::OnInitDialog();
WayPoint* poWP;
POSITION lPos;
for (poWP = m_oListOfWP.GetHeadElement(lPos); poWP; poWP = m_oListOfWP.GetNextElement(lPos))
m_IsoWpList.AddString(poWP->GetName());
return TRUE;
}
BOOL IsoWPDia::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
TUT_M_vGetTutDll ();
TUT_M_vRegisterControlID (IDC_LIST_WP, "IsoWp_List",TUT_e_ListBox);
TUT_M_vRegisterControlID (IDOK, "WP_Ok", TUT_e_Button);
TUT_M_vRegisterControlID (IDCANCEL, "WP_Cancel",TUT_e_Button);
return CDialog::Create(IDD, pParentWnd);
}
void IsoWPDia::OnDestroy()
{
TUT_M_vGetTutDll ();
TUT_M_vUnregisterControlID (IDC_LIST_WP);
TUT_M_vUnregisterControlID (IDOK );
TUT_M_vUnregisterControlID (IDCANCEL );
CDialog::OnDestroy();
}
//ENDROMTEAM Networks (Gabriela Dumitrascu)

View File

@@ -0,0 +1,372 @@
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : LinkDia.cpp
//
// Dialog edition the ways
//
///////////////////////////////////////////////////////////////////////////////////////////////////
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 21 jan 1997 Author: J Th<54>noz
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
//
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
*/
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
#include "stdafx.h"
#include "acp_base.h"
#include "resource.h"
#include "incitf.h"
#include "incgam.h"
#include "incai.h"
#include "incGli.h"
#include "WpObj.hpp"
#include "WayObj.hpp"
#include "LinkObj.hpp"
#include "LinkDia.hpp"
#include "LkBezDia.h"
#include "x:/cpa/main/inc/_EditId.h"
#include "tut.h"
/////////////////////////////////////////////////////////////////////////////
// DiaLink
IMPLEMENT_DYNCREATE(DiaLink, CFormView)
DiaLink::DiaLink()
: CFormView(DiaLink::IDD)
{
//{{AFX_DATA_INIT(DiaLink)
m_szLinkName = _T("");
m_oSpeedMode = _T("");
m_fSpeed1 = 0.0f;
m_fSpeed2 = 0.0f;
m_fSpeed3 = 0.0f;
//}}AFX_DATA_INIT
m_poLink = NULL;
m_pSpecificDialog = NULL;
}
DiaLink::~DiaLink()
{
}
void DiaLink::DoDataExchange(CDataExchange* pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(DiaLink)
DDX_CBString(pDX, IDC_LINK_COMBO, m_szLinkName);
DDV_MaxChars(pDX, m_szLinkName, 15);
DDX_CBString(pDX, IDC_LINK_SPEED_COMBO, m_oSpeedMode);
DDV_MaxChars(pDX, m_oSpeedMode, 15);
DDX_Text(pDX, IDC_LINK_SPEED1_EDIT, m_fSpeed1);
DDV_MinMaxFloat(pDX, m_fSpeed1, 0.f, 9999.99f);
DDX_Text(pDX, IDC_LINK_SPEED2_EDIT, m_fSpeed2);
DDV_MinMaxFloat(pDX, m_fSpeed2, 0.f, 9999.99f);
DDX_Text(pDX, IDC_LINK_SPEED3_EDIT, m_fSpeed3);
DDV_MinMaxFloat(pDX, m_fSpeed3, 0.f, 9999.99f);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(DiaLink, CFormView)
//{{AFX_MSG_MAP(DiaLink)
ON_CBN_SELCHANGE(IDC_LINK_COMBO, OnSelchangeLinkCombo)
ON_CBN_SELCHANGE(IDC_LINK_SPEED_COMBO, OnSelchangeLinkSpeedCombo)
ON_EN_KILLFOCUS(IDC_LINK_SPEED1_EDIT, OnKillfocusLinkSpeed1Edit)
ON_EN_KILLFOCUS(IDC_LINK_SPEED2_EDIT, OnKillfocusLinkSpeed2Edit)
ON_EN_KILLFOCUS(IDC_LINK_SPEED3_EDIT, OnKillfocusLinkSpeed3Edit)
ON_WM_DESTROY()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
void DiaLink::fn_vInitDialog (void)
{
POSITION xPos;
tdst_LinkObject* pstDefLink;
CComboBox* pComboLink = (CComboBox*) GetDlgItem (IDC_LINK_COMBO);
CComboBox* pComboSpeed = (CComboBox*) GetDlgItem (IDC_LINK_SPEED_COMBO);
for ( pstDefLink=Link::fn_pGetListObject()->GetHeadElement(xPos); pstDefLink; pstDefLink=Link::fn_pGetListObject()->GetNextElement(xPos) )
pComboLink->AddString (pstDefLink->szName);
pComboLink->EnableWindow (FALSE);
pComboSpeed->AddString ("none");
pComboSpeed->AddString ("constant");
pComboSpeed->AddString ("linear");
pComboSpeed->AddString ("sinus");
GetDlgItem (IDC_LINK_SPEED_GROUPBOX)->EnableWindow (FALSE);
GetDlgItem (IDC_LINK_SPEED_COMBO)->EnableWindow (FALSE);
GetDlgItem (IDC_LINK_SPEED1_STATIC)->EnableWindow (FALSE);
GetDlgItem (IDC_LINK_SPEED2_STATIC)->EnableWindow (FALSE);
GetDlgItem (IDC_LINK_SPEED3_STATIC)->EnableWindow (FALSE);
GetDlgItem (IDC_LINK_SPEED1_EDIT)->EnableWindow (FALSE);
GetDlgItem (IDC_LINK_SPEED2_EDIT)->EnableWindow (FALSE);
GetDlgItem (IDC_LINK_SPEED3_EDIT)->EnableWindow (FALSE);
}
void DiaLink::fn_vEdit (Link* poLink)
{
if (m_poLink==poLink) return;
// Aspect of the dialog
if (!m_poLink && poLink)
{
GetDlgItem (IDC_LINK_COMBO)->EnableWindow (TRUE);
GetDlgItem (IDC_LINK_SPEED_GROUPBOX)->EnableWindow (TRUE);
GetDlgItem (IDC_LINK_SPEED_COMBO)->EnableWindow (TRUE);
}
else if (m_poLink && !poLink)
{
GetDlgItem (IDC_LINK_COMBO)->EnableWindow (FALSE);
GetDlgItem (IDC_LINK_SPEED_GROUPBOX)->EnableWindow (FALSE);
GetDlgItem (IDC_LINK_SPEED_COMBO)->EnableWindow (FALSE);
}
if (m_poLink) m_poLink->fn_vStopEdit ();
m_poLink=poLink;
if (m_poLink) m_poLink->fn_vStartEdit ();
if (m_poLink)
{
ACP_tdstDynaParam stDynParam;
WP_fnv_Link_GetDynamicParameter ( (WP_tdhLink)(m_poLink->GetEngineStruct()), &stDynParam );
unsigned char ucDynamicType;
float dSpeed1, dSpeed2, dSpeed3;
GetParent()->SetWindowText ( "" );
m_szLinkName = m_poLink->fn_pGetName ();
fn_vDynamicObject_GetParams( &stDynParam, &ucDynamicType, &dSpeed1, &dSpeed2, &dSpeed3);
m_fSpeed1 = dSpeed1;
m_fSpeed2 = dSpeed2;
m_fSpeed3 = dSpeed3;
switch (ucDynamicType)
{
case C_ucNone : m_oSpeedMode = CString ("none"); break;
case C_ucConst : m_oSpeedMode = CString ("constant"); break;
case C_ucLinear : m_oSpeedMode = CString ("linear"); break;
case C_ucSinus : m_oSpeedMode = CString ("sinus"); break;
default: ucDynamicType=C_ucNone;
m_oSpeedMode = CString ("none");
break;
}
UpdateData (FALSE);
fn_vDrawDynParamDialog ();
fn_vChangeDialog ();
}
else
{
GetParent()->SetWindowText ( "no link to edit" );
m_szLinkName = "";
m_oSpeedMode = CString ("");
GetDlgItem (IDC_LINK_SPEED1_STATIC)->SetWindowText( "" );
GetDlgItem (IDC_LINK_SPEED2_STATIC)->SetWindowText( "" );
GetDlgItem (IDC_LINK_SPEED3_STATIC)->SetWindowText( "" );
GetDlgItem (IDC_LINK_SPEED1_STATIC)->EnableWindow (FALSE);
GetDlgItem (IDC_LINK_SPEED2_STATIC)->EnableWindow (FALSE);
GetDlgItem (IDC_LINK_SPEED3_STATIC)->EnableWindow (FALSE);
GetDlgItem (IDC_LINK_SPEED1_EDIT)->EnableWindow (FALSE);
GetDlgItem (IDC_LINK_SPEED2_EDIT)->EnableWindow (FALSE);
GetDlgItem (IDC_LINK_SPEED3_EDIT)->EnableWindow (FALSE);
UpdateData (FALSE);
}
GetParent()->GetParent()->RedrawWindow (NULL, NULL, RDW_INVALIDATE|RDW_FRAME);
}
/////////////////////////////////////////////////////////////////////////////
// DiaLink diagnostics
#ifdef _DEBUG
void DiaLink::AssertValid() const
{
CFormView::AssertValid();
}
void DiaLink::Dump(CDumpContext& dc) const
{
CFormView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// DiaLink message handlers
void DiaLink::OnSelchangeLinkCombo(void)
{
UpdateData (TRUE);
Way* poParentWay = (Way*) (((CPA_SuperObject*)(m_poLink->GetSuperObject())->GetParent())->GetObject());
Link* pNewLink = Link::CloneLink ( poParentWay, m_poLink, m_szLinkName );
poParentWay->fn_bChangeLink ( m_poLink, pNewLink );
m_poLink = pNewLink;
fn_vChangeDialog ();
}
void DiaLink::fn_vChangeDialog (void)
{
RECT stRect;
GetDlgItem (IDC_DYNAMIC_DIALOG)->GetWindowRect( &stRect );
ScreenToClient( &stRect ) ;
if (m_pSpecificDialog)
{
m_poLink->fn_vFreeSpecificDialog (m_pSpecificDialog);
delete m_pSpecificDialog;
}
m_pSpecificDialog = m_poLink->fn_pGetSpecificDialog (this);
if (m_pSpecificDialog) m_pSpecificDialog->MoveWindow( &stRect, TRUE );
}
//--------------------------- Dynamic Param Edition
void DiaLink::fn_vSetDynParam (void)
{
ACP_tdstDynaParam stDynParam;
WP_fnv_Link_GetDynamicParameter ( (WP_tdhLink)(m_poLink->GetEngineStruct()), &stDynParam );
WP_tde_ucConnectionDynamicType eConnectionType;
unsigned char ucDynamicType;
UpdateData (TRUE);
if ( m_oSpeedMode=="none" ) { ucDynamicType=C_ucNone; eConnectionType=WP_ConDynType_ucNone; }
else if ( m_oSpeedMode=="constant" ) { ucDynamicType=C_ucConst; eConnectionType=WP_ConDynType_ucConstant; }
else if ( m_oSpeedMode=="linear" ) { ucDynamicType=C_ucLinear; eConnectionType=WP_ConDynType_ucLinear; }
else if ( m_oSpeedMode=="sinus" ) { ucDynamicType=C_ucSinus; eConnectionType=WP_ConDynType_ucSinus; }
fn_vDynamicObject_ChangeParams( &stDynParam, ucDynamicType, m_fSpeed1, m_fSpeed2, m_fSpeed3);
WP_fnv_Link_SetDynamicParameter ( (WP_tdhLink)(m_poLink->GetEngineStruct()), &stDynParam );
WP_fnv_Link_SetConnectionDynamicType ( (WP_tdhLink)(m_poLink->GetEngineStruct()), eConnectionType );
m_poLink->fn_vWayNotifySave ();
}
void DiaLink::fn_vDrawDynParamDialog (void)
{
UpdateData (TRUE);
if ( m_oSpeedMode=="none" )
{
GetDlgItem (IDC_LINK_SPEED1_STATIC)->SetWindowText( "" );
GetDlgItem (IDC_LINK_SPEED2_STATIC)->SetWindowText( "" );
GetDlgItem (IDC_LINK_SPEED3_STATIC)->SetWindowText( "" );
GetDlgItem (IDC_LINK_SPEED1_STATIC)->EnableWindow (FALSE);
GetDlgItem (IDC_LINK_SPEED2_STATIC)->EnableWindow (FALSE);
GetDlgItem (IDC_LINK_SPEED3_STATIC)->EnableWindow (FALSE);
GetDlgItem (IDC_LINK_SPEED1_EDIT)->EnableWindow (FALSE);
GetDlgItem (IDC_LINK_SPEED2_EDIT)->EnableWindow (FALSE);
GetDlgItem (IDC_LINK_SPEED3_EDIT)->EnableWindow (FALSE);
}
else if ( m_oSpeedMode=="constant" )
{
GetDlgItem (IDC_LINK_SPEED1_STATIC)->SetWindowText( "speed" );
GetDlgItem (IDC_LINK_SPEED2_STATIC)->SetWindowText( "" );
GetDlgItem (IDC_LINK_SPEED3_STATIC)->SetWindowText( "" );
GetDlgItem (IDC_LINK_SPEED1_STATIC)->EnableWindow (TRUE);
GetDlgItem (IDC_LINK_SPEED2_STATIC)->EnableWindow (FALSE);
GetDlgItem (IDC_LINK_SPEED3_STATIC)->EnableWindow (FALSE);
GetDlgItem (IDC_LINK_SPEED1_EDIT)->EnableWindow (TRUE);
GetDlgItem (IDC_LINK_SPEED2_EDIT)->EnableWindow (FALSE);
GetDlgItem (IDC_LINK_SPEED3_EDIT)->EnableWindow (FALSE);
}
else if ( m_oSpeedMode=="linear" )
{
GetDlgItem (IDC_LINK_SPEED1_STATIC)->SetWindowText( "start speed" );
GetDlgItem (IDC_LINK_SPEED2_STATIC)->SetWindowText( "end speed" );
GetDlgItem (IDC_LINK_SPEED3_STATIC)->SetWindowText( "" );
GetDlgItem (IDC_LINK_SPEED1_STATIC)->EnableWindow (TRUE);
GetDlgItem (IDC_LINK_SPEED2_STATIC)->EnableWindow (TRUE);
GetDlgItem (IDC_LINK_SPEED3_STATIC)->EnableWindow (FALSE);
GetDlgItem (IDC_LINK_SPEED1_EDIT)->EnableWindow (TRUE);
GetDlgItem (IDC_LINK_SPEED2_EDIT)->EnableWindow (TRUE);
GetDlgItem (IDC_LINK_SPEED3_EDIT)->EnableWindow (FALSE);
}
else if ( m_oSpeedMode=="sinus" )
{
GetDlgItem (IDC_LINK_SPEED1_STATIC)->SetWindowText( "start angle" );
GetDlgItem (IDC_LINK_SPEED2_STATIC)->SetWindowText( "end angle" );
GetDlgItem (IDC_LINK_SPEED3_STATIC)->SetWindowText( "max speed" );
GetDlgItem (IDC_LINK_SPEED1_STATIC)->EnableWindow (TRUE);
GetDlgItem (IDC_LINK_SPEED2_STATIC)->EnableWindow (TRUE);
GetDlgItem (IDC_LINK_SPEED3_STATIC)->EnableWindow (TRUE);
GetDlgItem (IDC_LINK_SPEED1_EDIT)->EnableWindow (TRUE);
GetDlgItem (IDC_LINK_SPEED2_EDIT)->EnableWindow (TRUE);
GetDlgItem (IDC_LINK_SPEED3_EDIT)->EnableWindow (TRUE);
}
}
void DiaLink::OnSelchangeLinkSpeedCombo()
{
fn_vDrawDynParamDialog ();
fn_vSetDynParam ();
}
void DiaLink::OnKillfocusLinkSpeed1Edit()
{
fn_vSetDynParam ();
}
void DiaLink::OnKillfocusLinkSpeed2Edit()
{
fn_vSetDynParam ();
}
void DiaLink::OnKillfocusLinkSpeed3Edit()
{
fn_vSetDynParam ();
}
BOOL DiaLink::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
BOOL bCreate = CFormView::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
TUT_M_vGetTutDll ();
TUT_M_vRegisterControl (m_hWnd , "OWP_LinkDialog" , TUT_e_Window);
TUT_M_vRegisterControlID (IDC_LINK_COMBO,"OWP_LinkTypeCombo",TUT_e_ComboBox);
TUT_M_vRegisterControlID (IDC_LINK_SPEED_COMBO,"OWP_LinkSpeedCombo",TUT_e_ComboBox);
TUT_M_vRegisterControlID (IDC_LINK_SPEED1_EDIT,"OWP_LinkSpeed1Edit",TUT_e_TextEdit);
TUT_M_vRegisterControlID (IDC_LINK_SPEED2_EDIT,"OWP_LinkSpeed2Edit",TUT_e_TextEdit);
TUT_M_vRegisterControlID (IDC_LINK_SPEED3_EDIT,"OWP_LinkSpeed3Edit",TUT_e_TextEdit);
return bCreate;
}
void DiaLink::OnDestroy()
{
TUT_M_vGetTutDll ();
TUT_M_vUnregisterControl (m_hWnd);
TUT_M_vUnregisterControlID (IDC_LINK_COMBO);
TUT_M_vUnregisterControlID (IDC_LINK_SPEED_COMBO);
TUT_M_vUnregisterControlID (IDC_LINK_SPEED1_EDIT);
TUT_M_vUnregisterControlID (IDC_LINK_SPEED2_EDIT);
TUT_M_vUnregisterControlID (IDC_LINK_SPEED3_EDIT);
}
*/
//ENDANNECY Shaitan Nettoyage }

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,342 @@
// rotdia.cpp : implementation file
//
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
#include "stdafx.h"
#include "acp_base.h"
#include "resource.h"
#include "rotdia.hpp"
#include "incitf.h"
#include "incgam.h"
#include "incai.h"
#include "WPObj.hpp"
#include "WayObj.hpp"
#include "LinkObj.hpp"
#include "WPDia.hpp"
#include "WayDia.hpp"
#include "Inter.hpp"
#include "x:\cpa\main\inc\_editid.h"
#include "tut.h"
/////////////////////////////////////////////////////////////////////////////
// RotationDia
IMPLEMENT_DYNCREATE(RotationDia, CFormView)
RotationDia::RotationDia()
: CFormView(RotationDia::IDD)
{
//{{AFX_DATA_INIT(RotationDia)
m_fTwist1 = 0.0f;
m_fTwist2 = 0.0f;
m_lTwistLap = 0;
m_lxLap = 0;
m_lyLap = 0;
//}}AFX_DATA_INIT
m_poLink = NULL;
m_bFocusTwist1 = FALSE;
m_bFocusTwist2 = FALSE;
m_bFocusTwistLap = FALSE;
m_bFocusXLap = FALSE;
m_bFocusYLap = FALSE;
}
RotationDia::~RotationDia()
{
}
void RotationDia::DoDataExchange(CDataExchange* pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(RotationDia)
DDX_Text(pDX, IDC_TWIST1_EDIT, m_fTwist1);
DDV_MinMaxFloat(pDX, m_fTwist1, 0.f, 360.f);
DDX_Text(pDX, IDC_TWIST2_EDIT, m_fTwist2);
DDV_MinMaxFloat(pDX, m_fTwist2, 0.f, 360.f);
DDX_Text(pDX, IDC_ORIENT_LAP_TWIST_EDIT, m_lTwistLap);
DDX_Text(pDX, IDC_ORIENT_LAP_X_EDIT, m_lxLap);
DDX_Text(pDX, IDC_ORIENT_LAP_Y_EDIT, m_lyLap);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(RotationDia, CFormView)
//{{AFX_MSG_MAP(RotationDia)
ON_EN_KILLFOCUS(IDC_ORIENT_LAP_TWIST_EDIT, OnKillfocusOrientLapTwistEdit)
ON_EN_KILLFOCUS(IDC_ORIENT_LAP_X_EDIT, OnKillfocusOrientLapXEdit)
ON_EN_KILLFOCUS(IDC_ORIENT_LAP_Y_EDIT, OnKillfocusOrientLapYEdit)
ON_BN_CLICKED(IDC_ORIENT_TWIST_DIRECT_RADIO, OnOrientTwistDirectRadio)
ON_BN_CLICKED(IDC_ORIENT_TWIST_INDIRECT_RADIO, OnOrientTwistIndirectRadio)
ON_BN_CLICKED(IDC_ORIENT_X_DIRECT_RADIO, OnOrientXDirectRadio)
ON_BN_CLICKED(IDC_ORIENT_X_INDIRECT_RADIO, OnOrientXIndirectRadio)
ON_BN_CLICKED(IDC_ORIENT_Y_DIRECT_RADIO, OnOrientYDirectRadio)
ON_BN_CLICKED(IDC_ORIENT_Y_INDIRECT_RADIO, OnOrientYIndirectRadio)
ON_EN_KILLFOCUS(IDC_TWIST1_EDIT, OnKillfocusTwist1Edit)
ON_EN_KILLFOCUS(IDC_TWIST2_EDIT, OnKillfocusTwist2Edit)
ON_EN_SETFOCUS(IDC_ORIENT_LAP_TWIST_EDIT, OnSetfocusOrientLapTwistEdit)
ON_EN_SETFOCUS(IDC_ORIENT_LAP_X_EDIT, OnSetfocusOrientLapXEdit)
ON_EN_SETFOCUS(IDC_ORIENT_LAP_Y_EDIT, OnSetfocusOrientLapYEdit)
ON_EN_SETFOCUS(IDC_TWIST1_EDIT, OnSetfocusTwist1Edit)
ON_EN_SETFOCUS(IDC_TWIST2_EDIT, OnSetfocusTwist2Edit)
ON_WM_DESTROY()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// RotationDia message handlers
void RotationDia::fn_vInitDialog ( void )
{
fn_vActivateWindow (FALSE);
GetParent()->SetWindowText ( "no orientation to edit" );
}
void RotationDia::fn_vEdit (Link* poLink)
{
BOOL bRedraw=FALSE;
if (!m_poLink && poLink)
{
fn_vActivateWindow (TRUE);
GetParent()->SetWindowText ( "Orientation" );
bRedraw=TRUE;
}
else if (m_poLink && !poLink)
{
fn_vActivateWindow (FALSE);
GetParent()->SetWindowText ( "no orientation to edit" );
bRedraw=TRUE;
}
m_poLink = poLink;
if (m_poLink)
{
CheckRadioButton( IDC_ORIENT_X_DIRECT_RADIO, IDC_ORIENT_X_INDIRECT_RADIO, m_poLink->fn_bIsXDirectOrientation() ? IDC_ORIENT_X_DIRECT_RADIO : IDC_ORIENT_X_INDIRECT_RADIO );
CheckRadioButton( IDC_ORIENT_Y_DIRECT_RADIO, IDC_ORIENT_Y_INDIRECT_RADIO, m_poLink->fn_bIsYDirectOrientation() ? IDC_ORIENT_Y_DIRECT_RADIO : IDC_ORIENT_Y_INDIRECT_RADIO );
CheckRadioButton( IDC_ORIENT_TWIST_DIRECT_RADIO, IDC_ORIENT_TWIST_INDIRECT_RADIO, m_poLink->fn_bIsZDirectOrientation() ? IDC_ORIENT_TWIST_DIRECT_RADIO : IDC_ORIENT_TWIST_INDIRECT_RADIO );
m_lxLap = m_poLink->fn_lGetNbLapXOrientation();
m_lyLap = m_poLink->fn_lGetNbLapYOrientation();
m_lTwistLap = m_poLink->fn_lGetNbLapZOrientation();
m_fTwist1 = m_poLink->fn_xGetFirstTwistOrientation () * 180. / MTH_C_Pi;
m_fTwist2 = m_poLink->fn_xGetSecondTwistOrientation () * 180. / MTH_C_Pi;
m_fTwist1 = ((long) (m_fTwist1*10.f+0.5f))/10.f;
m_fTwist2 = ((long) (m_fTwist2*10.f+0.5f))/10.f;
}
UpdateData (FALSE);
if (bRedraw) GetParent()->GetParent()->RedrawWindow (NULL, NULL, RDW_INVALIDATE|RDW_FRAME);
}
//--------------------------- On Command -> to capture end of edition in edit dialogs
BOOL RotationDia::OnCommand(WPARAM wParam, LPARAM lParam)
{
if (wParam==1)
{
if (m_bFocusTwist1)
{
OnKillfocusTwist1Edit();
m_bFocusTwist1=TRUE;
}
if (m_bFocusTwist2)
{
OnKillfocusTwist2Edit();
m_bFocusTwist2=TRUE;
}
if (m_bFocusTwistLap)
{
OnKillfocusOrientLapTwistEdit();
m_bFocusTwistLap=TRUE;
}
if (m_bFocusXLap)
{
OnKillfocusOrientLapXEdit();
m_bFocusXLap=TRUE;
}
if (m_bFocusYLap)
{
OnKillfocusOrientLapYEdit();
m_bFocusYLap=TRUE;
}
return TRUE;
}
return CFormView::OnCommand(wParam, lParam);
}
//--------------------------- Lap edition
void RotationDia::OnKillfocusOrientLapTwistEdit()
{
UpdateData (TRUE);
m_poLink->fn_vSetNbLapZOrientation ( m_lTwistLap );
m_bFocusTwistLap=FALSE;
}
void RotationDia::OnKillfocusOrientLapXEdit()
{
UpdateData (TRUE);
m_poLink->fn_vSetNbLapXOrientation ( m_lxLap );
m_bFocusXLap=FALSE;
}
void RotationDia::OnKillfocusOrientLapYEdit()
{
UpdateData (TRUE);
m_poLink->fn_vSetNbLapYOrientation ( m_lyLap );
m_bFocusYLap=FALSE;
}
//--------------------------- Direct/Indirect Orientation
void RotationDia::OnOrientTwistDirectRadio()
{
UpdateData (TRUE);
m_poLink->fn_vSetZDirectOrientation (TRUE);
}
void RotationDia::OnOrientTwistIndirectRadio()
{
UpdateData (TRUE);
m_poLink->fn_vSetZDirectOrientation (FALSE);
}
void RotationDia::OnOrientXDirectRadio()
{
UpdateData (TRUE);
m_poLink->fn_vSetXDirectOrientation (TRUE);
}
void RotationDia::OnOrientXIndirectRadio()
{
UpdateData (TRUE);
m_poLink->fn_vSetXDirectOrientation (FALSE);
}
void RotationDia::OnOrientYDirectRadio()
{
UpdateData (TRUE);
m_poLink->fn_vSetYDirectOrientation (TRUE);
}
void RotationDia::OnOrientYIndirectRadio()
{
UpdateData (TRUE);
m_poLink->fn_vSetYDirectOrientation (FALSE);
}
//---------------------------- Twist edition
void RotationDia::OnKillfocusTwist1Edit()
{
UpdateData (TRUE);
m_poLink->fn_vSetFirstTwistOrientation (m_fTwist1*MTH_C_Pi/180.f);
m_bFocusTwist1=FALSE;
}
void RotationDia::OnKillfocusTwist2Edit()
{
UpdateData (TRUE);
m_poLink->fn_vSetSecondTwistOrientation (m_fTwist2*MTH_C_Pi/180.f);
m_bFocusTwist2=FALSE;
}
//---------------- Edit dialog have focus
void RotationDia::OnSetfocusOrientLapTwistEdit()
{
m_bFocusTwistLap=TRUE;
}
void RotationDia::OnSetfocusOrientLapXEdit()
{
m_bFocusXLap=TRUE;
}
void RotationDia::OnSetfocusOrientLapYEdit()
{
m_bFocusYLap=TRUE;
}
void RotationDia::OnSetfocusTwist1Edit()
{
m_bFocusTwist1=TRUE;
}
void RotationDia::OnSetfocusTwist2Edit()
{
m_bFocusTwist2=TRUE;
}
void RotationDia::fn_vActivateWindow (BOOL bActivate)
{
GetDlgItem (IDC_ORIENT_LAP_TWIST_EDIT)->EnableWindow (bActivate);
GetDlgItem (IDC_ORIENT_LAP_X_EDIT)->EnableWindow (bActivate);
GetDlgItem (IDC_ORIENT_LAP_Y_EDIT)->EnableWindow (bActivate);
GetDlgItem (IDC_ORIENT_TWIST_DIRECT_RADIO)->EnableWindow (bActivate);
GetDlgItem (IDC_ORIENT_TWIST_INDIRECT_RADIO)->EnableWindow (bActivate);
GetDlgItem (IDC_ORIENT_X_DIRECT_RADIO)->EnableWindow (bActivate);
GetDlgItem (IDC_ORIENT_X_INDIRECT_RADIO)->EnableWindow (bActivate);
GetDlgItem (IDC_ORIENT_Y_DIRECT_RADIO)->EnableWindow (bActivate);
GetDlgItem (IDC_ORIENT_Y_INDIRECT_RADIO)->EnableWindow (bActivate);
GetDlgItem (IDC_TWIST1_EDIT)->EnableWindow (bActivate);
GetDlgItem (IDC_TWIST2_EDIT)->EnableWindow (bActivate);
GetDlgItem (IDC_LAP_X_STATIC)->EnableWindow (bActivate);
GetDlgItem (IDC_LAP_Y_STATIC)->EnableWindow (bActivate);
GetDlgItem (IDC_LAP_TWIST_STATIC)->EnableWindow (bActivate);
GetDlgItem (IDC_ORIENT_TWIST_STATIC)->EnableWindow (bActivate);
GetDlgItem (IDC_ORIENT_X_STATIC)->EnableWindow (bActivate);
GetDlgItem (IDC_ORIENT_Y_STATIC)->EnableWindow (bActivate);
GetDlgItem (IDC_TWIST_STATIC)->EnableWindow (bActivate);
}
BOOL RotationDia::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
BOOL bCreate = CFormView::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
TUT_M_vGetTutDll ();
TUT_M_vRegisterControl (m_hWnd , "OWP_RotationDialog" , TUT_e_Window);
TUT_M_vRegisterControlID (IDC_ORIENT_LAP_TWIST_EDIT,"OWP_RotationTwistEdit",TUT_e_TextEdit);
TUT_M_vRegisterControlID (IDC_ORIENT_LAP_X_EDIT,"OWP_RotationXLapEdit",TUT_e_TextEdit);
TUT_M_vRegisterControlID (IDC_ORIENT_LAP_Y_EDIT,"OWP_RotationYLapEdit",TUT_e_TextEdit);
TUT_M_vRegisterControlID (IDC_ORIENT_TWIST_DIRECT_RADIO,"OWP_RotationTwistDirect",TUT_e_Button);
TUT_M_vRegisterControlID (IDC_ORIENT_TWIST_INDIRECT_RADIO,"OWP_RotationTwistIndirect",TUT_e_Button);
TUT_M_vRegisterControlID (IDC_ORIENT_X_DIRECT_RADIO,"OWP_RotationXDirect",TUT_e_Button);
TUT_M_vRegisterControlID (IDC_ORIENT_X_INDIRECT_RADIO,"OWP_RotationXIndirect",TUT_e_Button);
TUT_M_vRegisterControlID (IDC_ORIENT_Y_DIRECT_RADIO,"OWP_RotationYDirect",TUT_e_Button);
TUT_M_vRegisterControlID (IDC_ORIENT_Y_INDIRECT_RADIO,"OWP_RotationYIndirect",TUT_e_Button);
TUT_M_vRegisterControlID (IDC_TWIST1_EDIT,"OWP_RotationTwist1Edit",TUT_e_TextEdit);
TUT_M_vRegisterControlID (IDC_TWIST2_EDIT,"OWP_RotationTwist2Edit",TUT_e_TextEdit);
return bCreate;
}
void RotationDia::OnDestroy()
{
CFormView::OnDestroy();
TUT_M_vGetTutDll ();
TUT_M_vUnregisterControl (m_hWnd);
TUT_M_vUnregisterControlID (IDC_ORIENT_LAP_TWIST_EDIT);
TUT_M_vUnregisterControlID (IDC_ORIENT_LAP_X_EDIT);
TUT_M_vUnregisterControlID (IDC_ORIENT_LAP_Y_EDIT);
TUT_M_vUnregisterControlID (IDC_ORIENT_TWIST_DIRECT_RADIO);
TUT_M_vUnregisterControlID (IDC_ORIENT_TWIST_INDIRECT_RADIO);
TUT_M_vUnregisterControlID (IDC_ORIENT_X_DIRECT_RADIO);
TUT_M_vUnregisterControlID (IDC_ORIENT_X_INDIRECT_RADIO);
TUT_M_vUnregisterControlID (IDC_ORIENT_Y_INDIRECT_RADIO);
TUT_M_vUnregisterControlID (IDC_ORIENT_Y_INDIRECT_RADIO);
TUT_M_vUnregisterControlID (IDC_TWIST1_EDIT);
TUT_M_vUnregisterControlID (IDC_TWIST1_EDIT);
}
*/
//ENDANNECY Shaitan Nettoyage }

View File

@@ -0,0 +1,503 @@
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : WayDia.cpp
//
// Dialog edition the ways
//
///////////////////////////////////////////////////////////////////////////////////////////////////
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 21 jan 1997 Author: J Th<54>noz
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date: Author:
//
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
*/
//ANNECY Shaitan Nettoyage (12/05/98) {
/*
#include "stdafx.h"
#include "acp_base.h"
#include "resource.h"
#include "incitf.h"
#include "incgam.h"
#include "incai.h"
#include "WpObj.hpp"
#include "WayObj.hpp"
#include "LinkObj.hpp"
#include "Inter.hpp"
#include "WayDia.hpp"
#include "WpDia.hpp"
#include "LinkDia.hpp"
#include "RotDia.hpp"
#include "oac.h"
#include "x:\cpa\main\inc\_editid.h"
#include "tut.h"
/////////////////////////////////////////////////////////////////////////////
// DiaWay dialog
IMPLEMENT_DYNCREATE ( DiaWay, CFormView);
DiaWay::DiaWay(CWnd* pParent)
: CFormView(DiaWay::IDD)
{
//{{AFX_DATA_INIT(DiaWay)
m_EditWay = _T("");
m_csWayName = _T("");
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDI_NETWAYPOINT);
m_bInsert=FALSE;
m_bDisableDelete=TRUE;
m_pWayObj=NULL;
}
void DiaWay::fn_vInitDialog (void)
{
GetDlgItem (IDC_WAY_COMBO)->EnableWindow (FALSE);
GetDlgItem (IDC_WAY_DELETE_BUTTON)->EnableWindow (FALSE);
GetDlgItem (IDC_WAY_ADD_BUTTON)->EnableWindow (FALSE);
GetDlgItem (IDC_WAY_NAME_EDIT)->EnableWindow (FALSE);
}
void DiaWay::DoDataExchange(CDataExchange* pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(DiaWay)
DDX_Control(pDX, IDC_WAY_COMBO, m_ListNameWP);
DDX_CBString(pDX, IDC_WAY_COMBO, m_EditWay);
DDV_MaxChars(pDX, m_EditWay, 30);
DDX_Text(pDX, IDC_WAY_NAME_EDIT, m_csWayName);
DDV_MaxChars(pDX, m_csWayName, 30);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(DiaWay, CFormView)
//{{AFX_MSG_MAP(DiaWay)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDC_WAY_DELETE_BUTTON, OnDeleteWayButton)
ON_BN_CLICKED(IDC_WAY_ADD_BUTTON, OnAddWayButton)
ON_CBN_SELCHANGE(IDC_WAY_COMBO, OnSelchangeWayCombo)
ON_CBN_EDITUPDATE(IDC_WAY_COMBO, OnEditupdateWayCombo)
ON_WM_CLOSE()
ON_WM_DESTROY()
ON_CBN_DBLCLK(IDC_WAY_COMBO, OnDblclkWayCombo)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
// to edit a new way
void DiaWay::fn_vEdit (Way* poWay, int iSelect)
{
// Aspect of the dialog
if (!m_pWayObj && poWay)
{
GetDlgItem (IDC_WAY_COMBO)->EnableWindow (TRUE);
GetDlgItem (IDC_WAY_DELETE_BUTTON)->EnableWindow (TRUE);
GetDlgItem (IDC_WAY_ADD_BUTTON)->EnableWindow (TRUE);
GetDlgItem (IDC_WAY_NAME_EDIT)->EnableWindow (TRUE);
}
else if (m_pWayObj && !poWay)
{
GetDlgItem (IDC_WAY_COMBO)->EnableWindow (FALSE);
GetDlgItem (IDC_WAY_DELETE_BUTTON)->EnableWindow (FALSE);
GetDlgItem (IDC_WAY_ADD_BUTTON)->EnableWindow (FALSE);
GetDlgItem (IDC_WAY_NAME_EDIT)->EnableWindow (FALSE);
m_csWayName="";
UpdateData (FALSE);
}
m_pWayObj=poWay;
if (m_pWayObj)
{
CString csWindowTitle;
csWindowTitle = m_pWayObj->fn_csGetNameInNameList ();
GetParent()->SetWindowText ( csWindowTitle );
fn_vRefreshDialog (iSelect);
fn_vEditName ();
}
else
{
GetParent()->SetWindowText ( "no way to edit" );
m_ListNameWP.ResetContent();
m_bInsert=FALSE;
m_bDisableDelete=TRUE;
m_csWayName="";
}
GetParent()->GetParent()->RedrawWindow (NULL, NULL, RDW_INVALIDATE|RDW_FRAME);
}
BOOL DiaWay::fn_bIsEdit (Way* poWay)
{
return m_pWayObj==poWay;
}
void DiaWay::fn_vRefreshDialog (int iSelect)
{
long lCount;
char (*dpszNameWay) [30];
long lNbWayPointInNet = m_pWayObj->fn_lGetWPName (&dpszNameWay);
UpdateData (FALSE); // just to call DoDataExange the first time
m_ListNameWP.ResetContent();
for (lCount=0; lCount<lNbWayPointInNet; lCount++) m_ListNameWP.AddString (dpszNameWay[lCount]);
m_ListNameWP.AddString ("");
m_iSelect=iSelect;
delete[] dpszNameWay;
m_bDisableDelete=m_ListNameWP.GetCount()<=1;
GetDlgItem (IDC_WAY_DELETE_BUTTON)->EnableWindow (!m_bDisableDelete);
fn_vRefreshLinkBox ();
m_csWayName = m_pWayObj->GetName ();
UpdateData (FALSE);
m_ListNameWP.SetCurSel (m_iSelect);
}
void DiaWay::fn_vRefreshNameList (void)
{
if (!m_pWayObj) return;
long lCount;
char (*dpszNameWay) [30];
long lNbWayPointInNet = m_pWayObj->fn_lGetWPName (&dpszNameWay);
m_ListNameWP.ResetContent();
for (lCount=0; lCount<lNbWayPointInNet; lCount++) m_ListNameWP.AddString (dpszNameWay[lCount]);
m_ListNameWP.AddString ("");
UpdateData (FALSE);
m_ListNameWP.SetCurSel (m_iSelect);
}
void DiaWay::OnSysCommand(UINT nID, LPARAM lParam)
{
CFormView::OnSysCommand(nID, lParam);
}
// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.
void DiaWay::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CFormView::OnPaint();
}
}
// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR DiaWay::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
void DiaWay::OnDeleteWayButton()
{
char szBuffer [30];
m_ListNameWP.GetLBText (m_iSelect, szBuffer);
// delete in the editor object
if (m_iSelect<m_pWayObj->GetListWaypoint()->GetCount()) m_pWayObj->fn_vSupWP (m_iSelect);
m_bInsert=FALSE;
m_pWayObj->fn_vDialogDeleteWp ();
// disable the delete button because there is nothing to delete
if (!m_bDisableDelete && m_ListNameWP.GetCount()<=1)
{
GetDlgItem (IDC_WAY_DELETE_BUTTON)->EnableWindow (FALSE);
m_bDisableDelete=TRUE;
}
}
void DiaWay::OnAddWayButton()
{
if (m_bInsert || m_iSelect==m_ListNameWP.GetCount()-1)
{
m_ListNameWP.SetFocus();
return;
}
m_bInsert=TRUE;
m_ListNameWP.InsertString (m_iSelect,"");
m_ListNameWP.SetEditSel (0,-1);
m_ListNameWP.SetCurSel (m_iSelect);
m_ListNameWP.SetFocus();
}
void DiaWay::OnSelchangeWayCombo()
{
if (m_bInsert)
{
if (!fn_bValidEntry())
{
m_ListNameWP.SetCurSel(m_iSelect);
return;
}
m_bInsert=FALSE;
}
m_iSelect = m_ListNameWP.GetCurSel();
if (m_iSelect==m_pWayObj->GetListWaypoint()->GetCount())
{
GetDlgItem (IDC_WAY_DELETE_BUTTON)->EnableWindow (FALSE);
m_bDisableDelete=TRUE;
}
else
{
GetDlgItem (IDC_WAY_DELETE_BUTTON)->EnableWindow (TRUE);
m_bDisableDelete=FALSE;
}
WayPoint::fn_pGetDialog()->fn_vEdit ( m_pWayObj->fn_pGetWayPoint (m_iSelect) );
m_pWayObj->GetInterface()->GetInterface()->fn_vCancelCurrentSelection (FALSE);
if (m_pWayObj->fn_pGetWayPoint (m_iSelect)) m_pWayObj->GetInterface()->GetInterface()->fn_vAddSelectedObject (m_pWayObj->fn_pGetWayPoint (m_iSelect)->GetSuperObject() );
else m_pWayObj->GetInterface()->GetInterface()->fn_vCancelCurrentSelection ();
Link::fn_pGetDialog()->fn_vEdit (m_pWayObj->fn_pGetLink (m_iSelect));
}
void DiaWay::OnEditupdateWayCombo()
{
m_bInsert=TRUE;
UpdateData (TRUE);
m_ListNameWP.DeleteString (m_iSelect);
m_ListNameWP.InsertString (m_iSelect,m_EditWay);
m_ListNameWP.SetCurSel (m_iSelect);
m_ListNameWP.SetEditSel(-1,0);
}
BOOL DiaWay::fn_bValidEntry (void)
{
WayPoint* pInsertWP=NULL;
UpdateData (TRUE);
if (m_iSelect==m_ListNameWP.GetCount()-1) m_ListNameWP.AddString ("");
if (*m_EditWay)
{
if (!fn_bSameNameSuit())
{
// this WP exist ?
pInsertWP = (WayPoint*)(m_pWayObj->GetInterface()->GetMainWorld()->fn_p_oFindObject (m_EditWay.GetBuffer(30), "Waypoint" ));
if (pInsertWP)
{
// this WP is static ?
if (pInsertWP->fn_bGetCoordinate())
{
m_pWayObj->fn_vInsBeforeWP (pInsertWP, m_iSelect );
if (m_bDisableDelete && m_ListNameWP.GetCount()>1)
{
GetDlgItem (IDC_WAY_DELETE_BUTTON)->EnableWindow (TRUE);
m_bDisableDelete=FALSE;
}
return TRUE;
}
else MessageBox ( "The waypoint "+m_EditWay+ " is not static.", "Error", MB_ICONEXCLAMATION);
}
else MessageBox ( "The waypoint "+m_EditWay+ " is not defined.", "Error", MB_ICONEXCLAMATION);
}
else MessageBox ("The waypoint "+m_EditWay+ " is doubled in the net.", "Error", MB_ICONEXCLAMATION);
m_ListNameWP.SetCurSel (m_iSelect);
m_ListNameWP.SetEditSel(-1,0);
return FALSE;
}
if (m_iSelect!=m_ListNameWP.GetCount()-1) {
MessageBox ("You must give a waypoint name", "Error", MB_ICONEXCLAMATION);
return FALSE;
}
return TRUE;
}
void DiaWay::fn_vMessageBoxDynamicWP ( WayPoint* poWP )
{
MessageBox ( "The waypoint "+CString(poWP->GetSuperObject()->GetName())+ " is not static.", "Error", MB_ICONEXCLAMATION);
}
BOOL DiaWay::fn_bSameNameSuit (void)
{
char szCurrentText [30];
char szPreviousText [30];
long lCounter;
sprintf (szPreviousText,"Impossible_name_WGDTSY");
for (lCounter=0; lCounter<m_ListNameWP.GetCount(); lCounter++)
{
m_ListNameWP.GetLBText( lCounter, szCurrentText );
if (!strcmp(szCurrentText,szPreviousText)) return TRUE;
strcpy (szPreviousText,szCurrentText);
}
return FALSE;
}
void DiaWay::OnClose()
{
if (m_bInsert)
if (!fn_bValidEntry())
{
m_ListNameWP.SetFocus();
return;
}
CFormView::OnClose();
}
BOOL DiaWay::OnCommand(WPARAM wParam, LPARAM lParam)
{
// TODO: Add your specialized code here and/or call the base class
if (wParam==394228)
{
if ( GetAsyncKeyState(VK_DELETE) )
{
OnDeleteWayButton();
return TRUE;
}
}
if (wParam==1)
{
OnKillfocusWayNameEdit ();
if (m_bInsert)
{
if (fn_bValidEntry())
{
if (m_iSelect==m_ListNameWP.GetCount()-2) m_iSelect++;
m_ListNameWP.SetCurSel (m_iSelect);
m_ListNameWP.SetFocus();
m_bInsert=FALSE;
m_pWayObj->fn_vDialogAddWp ();
}
else
{
m_ListNameWP.SetCurSel (m_iSelect);
m_ListNameWP.SetFocus();
}
return TRUE;
}
}
return CFormView::OnCommand(wParam, lParam);
}
BOOL DiaWay::fn_vSelectWPInList (WayPoint* poWP)
{
m_iSelect = m_ListNameWP.FindStringExact( 0, poWP->GetSuperObject()->GetName() );
if (m_iSelect==LB_ERR) return FALSE;
m_ListNameWP.SetCurSel (m_iSelect);
fn_vRefreshLinkBox ();
return TRUE;
}
BOOL DiaWay::fn_vSelectWPInList (int iIndiceWP)
{
m_iSelect = iIndiceWP;
m_ListNameWP.SetCurSel (m_iSelect);
fn_vRefreshLinkBox ();
return TRUE;
}
void DiaWay::fn_vRefreshLinkBox (void)
{
Link* poLink = m_pWayObj->fn_pGetLink(m_iSelect);
if (poLink && poLink->fn_bIsRotationMode()) Link::fn_pGetRotationDialog()->fn_vEdit (poLink);
else Link::fn_pGetDialog()->fn_vEdit (poLink);
}
void DiaWay::fn_vEditName (void)
{
m_csWayName = m_pWayObj->GetName ();
}
void DiaWay::OnKillfocusWayNameEdit()
{
CString pOldName = m_csWayName;
UpdateData (TRUE);
if (pOldName == m_csWayName) return;
if (m_pWayObj->fn_eRename(m_csWayName)!=E_mc_None)
{
CString csMessage = m_csWayName+CString( " is already used.");
M_GetMainWnd()->UpdateStatus ( csMessage.GetBuffer(80), C_STATUSPANE_INFOS, C_STATUS_ERROR );
m_csWayName=pOldName;
UpdateData (FALSE);
}
else
{
m_pWayObj->GetInterface()->fn_vRefreshHierarchyList ();
m_pWayObj->fn_vNotifyAllEdtList ();
}
}
void DiaWay::OnDblclkWayCombo()
{
WayPoint* poWp = m_pWayObj->fn_pGetWayPoint (m_iSelect);
m_pWayObj->GetInterface()->GetInterface()->fn_bSelectObject (poWp->GetSuperObject(), TRUE );
}
BOOL DiaWay::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
BOOL bCreate = CFormView::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
TUT_M_vGetTutDll ();
TUT_M_vRegisterControl (m_hWnd , "OWP_WayDialog" , TUT_e_Window);
TUT_M_vRegisterControlID (IDC_WAY_COMBO,"OWP_WayCombo",TUT_e_ComboBox);
TUT_M_vRegisterControlID (IDC_WAY_DELETE_BUTTON,"OWP_WayDelete",TUT_e_Button);
TUT_M_vRegisterControlID (IDC_WAY_ADD_BUTTON,"OWP_WayAdd",TUT_e_Button);
TUT_M_vRegisterControlID (IDC_WAY_NAME_EDIT,"OWP_WayNameEdit",TUT_e_TextEdit);
return bCreate;
}
void DiaWay::OnDestroy()
{
TUT_M_vGetTutDll ();
TUT_M_vUnregisterControl (m_hWnd);
TUT_M_vUnregisterControlID (IDC_WAY_COMBO);
TUT_M_vUnregisterControlID (IDC_WAY_DELETE_BUTTON);
TUT_M_vUnregisterControlID (IDC_WAY_ADD_BUTTON);
TUT_M_vUnregisterControlID (IDC_WAY_NAME_EDIT);
}
*/
//ENDANNECY Shaitan Nettoyage }

File diff suppressed because it is too large Load Diff