diff options
| author | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
|---|---|---|
| committer | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
| commit | 33613a85afc4b1481367fbe92a17ee59c240250b (patch) | |
| tree | 670b842326116b376b505ec2263878912fca97e2 /Master/CGuCAD/projects/Prakt5Greedy | |
| download | Studium-33613a85afc4b1481367fbe92a17ee59c240250b.tar.gz Studium-33613a85afc4b1481367fbe92a17ee59c240250b.tar.bz2 | |
Diffstat (limited to 'Master/CGuCAD/projects/Prakt5Greedy')
13 files changed, 1250 insertions, 0 deletions
diff --git a/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy.sln b/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy.sln new file mode 100644 index 0000000..94deeae --- /dev/null +++ b/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy.sln @@ -0,0 +1,20 @@ +
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Prakt5Greedy", "Prakt5Greedy\Prakt5Greedy.vcproj", "{883CFD5C-AE4A-4A72-B026-FD067C0466C9}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {883CFD5C-AE4A-4A72-B026-FD067C0466C9}.Debug|Win32.ActiveCfg = Debug|Win32
+ {883CFD5C-AE4A-4A72-B026-FD067C0466C9}.Debug|Win32.Build.0 = Debug|Win32
+ {883CFD5C-AE4A-4A72-B026-FD067C0466C9}.Release|Win32.ActiveCfg = Release|Win32
+ {883CFD5C-AE4A-4A72-B026-FD067C0466C9}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy.suo b/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy.suo Binary files differnew file mode 100644 index 0000000..262c586 --- /dev/null +++ b/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy.suo diff --git a/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy/DocData.cpp b/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy/DocData.cpp new file mode 100644 index 0000000..aaeeaf7 --- /dev/null +++ b/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy/DocData.cpp @@ -0,0 +1,43 @@ +// (C) Copyright 2002-2007 by Autodesk, Inc.
+//
+// Permission to use, copy, modify, and distribute this software in
+// object code form for any purpose and without fee is hereby granted,
+// provided that the above copyright notice appears in all copies and
+// that both that copyright notice and the limited warranty and
+// restricted rights notice below appear in all supporting
+// documentation.
+//
+// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
+// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
+// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
+// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
+// UNINTERRUPTED OR ERROR FREE.
+//
+// Use, duplication, or disclosure by the U.S. Government is subject to
+// restrictions set forth in FAR 52.227-19 (Commercial Computer
+// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
+// (Rights in Technical Data and Computer Software), as applicable.
+//
+
+//-----------------------------------------------------------------------------
+//----- DocData.cpp : Implementation file
+//-----------------------------------------------------------------------------
+#include "StdAfx.h"
+
+//-----------------------------------------------------------------------------
+//----- The one and only document manager object. You can use the DocVars object to retrieve
+//----- document specific data throughout your application
+AcApDataManager<CDocData> DocVars ;
+
+//-----------------------------------------------------------------------------
+//----- Implementation of the document data class.
+CDocData::CDocData () {
+}
+
+//-----------------------------------------------------------------------------
+CDocData::CDocData (const CDocData &data) {
+}
+
+//-----------------------------------------------------------------------------
+CDocData::~CDocData () {
+}
diff --git a/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy/DocData.h b/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy/DocData.h new file mode 100644 index 0000000..456f3f7 --- /dev/null +++ b/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy/DocData.h @@ -0,0 +1,40 @@ +// (C) Copyright 2002-2007 by Autodesk, Inc.
+//
+// Permission to use, copy, modify, and distribute this software in
+// object code form for any purpose and without fee is hereby granted,
+// provided that the above copyright notice appears in all copies and
+// that both that copyright notice and the limited warranty and
+// restricted rights notice below appear in all supporting
+// documentation.
+//
+// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
+// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
+// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
+// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
+// UNINTERRUPTED OR ERROR FREE.
+//
+// Use, duplication, or disclosure by the U.S. Government is subject to
+// restrictions set forth in FAR 52.227-19 (Commercial Computer
+// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
+// (Rights in Technical Data and Computer Software), as applicable.
+//
+
+//-----------------------------------------------------------------------------
+//----- DocData.h : include file for document specific data. An instance of this
+//----- class is automatically created and managed by the AsdkDataManager class.
+//----- See the AsdkDmgr.h / DocData.cpp for more datails
+//-----------------------------------------------------------------------------
+#pragma once
+
+//-----------------------------------------------------------------------------
+//----- Here you can store the document / database related data.
+class CDocData {
+
+ //----- TODO: here you can add your variables
+
+public:
+ CDocData () ;
+ CDocData (const CDocData &data) ;
+ ~CDocData () ;
+
+} ;
diff --git a/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy/Prakt5Greedy.cpp b/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy/Prakt5Greedy.cpp new file mode 100644 index 0000000..5b072dd --- /dev/null +++ b/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy/Prakt5Greedy.cpp @@ -0,0 +1,41 @@ +// (C) Copyright 2002-2007 by Autodesk, Inc.
+//
+// Permission to use, copy, modify, and distribute this software in
+// object code form for any purpose and without fee is hereby granted,
+// provided that the above copyright notice appears in all copies and
+// that both that copyright notice and the limited warranty and
+// restricted rights notice below appear in all supporting
+// documentation.
+//
+// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
+// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
+// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
+// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
+// UNINTERRUPTED OR ERROR FREE.
+//
+// Use, duplication, or disclosure by the U.S. Government is subject to
+// restrictions set forth in FAR 52.227-19 (Commercial Computer
+// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
+// (Rights in Technical Data and Computer Software), as applicable.
+//
+
+//-----------------------------------------------------------------------------
+//- Prakt5Greedy.cpp : Initialization functions
+//-----------------------------------------------------------------------------
+#include "StdAfx.h"
+#include "resource.h"
+
+//-----------------------------------------------------------------------------
+//- DLL Entry Point
+extern "C"
+BOOL WINAPI DllMain (HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) {
+ //- Remove this if you use lpReserved
+ UNREFERENCED_PARAMETER(lpReserved) ;
+
+ if ( dwReason == DLL_PROCESS_ATTACH ) {
+ _hdllInstance =hInstance ;
+ } else if ( dwReason == DLL_PROCESS_DETACH ) {
+ }
+ return (TRUE) ;
+}
+
diff --git a/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy/Prakt5Greedy.rc b/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy/Prakt5Greedy.rc new file mode 100644 index 0000000..bdd77f1 --- /dev/null +++ b/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy/Prakt5Greedy.rc @@ -0,0 +1,101 @@ +//Microsoft Visual C++ generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "winres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "#include ""winres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+#ifndef _MAC
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,0,0,1
+ PRODUCTVERSION 1,0,0,1
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "CompanyName", "\0"
+ VALUE "FileDescription", "Prakt5Greedy ObjectARX application\0"
+ VALUE "FileVersion", "1, 0, 0, 1\0"
+ VALUE "InternalName", "Prakt5Greedy\0"
+ VALUE "LegalCopyright", "Copyright © 2002\0"
+ VALUE "OriginalFilename", "CGCAD_seiPrakt5Greedy.arx\0"
+ VALUE "ProductName", "Prakt5Greedy Application\0"
+ VALUE "ProductVersion", "1, 0, 0, 1\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x0409, 0x04B0
+ END
+END
+
+#endif // !_MAC
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_PROJNAME "Prakt5Greedy"
+END
+
+
+
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy/Prakt5Greedy.vcproj b/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy/Prakt5Greedy.vcproj new file mode 100644 index 0000000..b37b4d4 --- /dev/null +++ b/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy/Prakt5Greedy.vcproj @@ -0,0 +1,277 @@ +<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8,00"
+ Name="Prakt5Greedy"
+ ProjectGUID="{883CFD5C-AE4A-4A72-B026-FD067C0466C9}"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ UseOfMFC="0"
+ UseOfATL="0"
+ CharacterSet="1"
+ ManagedExtensions="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalUsingDirectories="C:\Programme\AutoCAD Civil 3D 2009"
+ PreprocessorDefinitions="WIN32;_WINDOWS;PRAKT5GREEDY_MODULE;_ACRXAPP"
+ StringPooling="false"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="2"
+ BufferSecurityCheck="true"
+ TreatWChar_tAsBuiltInType="true"
+ ForceConformanceInForLoopScope="true"
+ RuntimeTypeInfo="true"
+ UsePrecompiledHeader="2"
+ WarningLevel="1"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions=""
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(outdir)/CGCAD_seiPrakt5Greedy.arx"
+ LinkIncremental="2"
+ LinkDLL="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/Prakt5Greedy.pdb"
+ SubSystem="2"
+ ImportLibrary="$(OutDir)/Prakt5Greedy.lib"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ UseOfMFC="0"
+ UseOfATL="0"
+ CharacterSet="1"
+ ManagedExtensions="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalUsingDirectories="C:\Programme\AutoCAD Civil 3D 2009"
+ PreprocessorDefinitions="WIN32;_WINDOWS;PRAKT5GREEDY_MODULE;NDEBUG;_ACRXAPP"
+ StringPooling="true"
+ MinimalRebuild="false"
+ BasicRuntimeChecks="0"
+ RuntimeLibrary="2"
+ BufferSecurityCheck="true"
+ TreatWChar_tAsBuiltInType="true"
+ ForceConformanceInForLoopScope="true"
+ RuntimeTypeInfo="true"
+ UsePrecompiledHeader="2"
+ WarningLevel="1"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions=""
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(outdir)/CGCAD_seiPrakt5Greedy.arx"
+ LinkIncremental="2"
+ LinkDLL="true"
+ GenerateDebugInformation="false"
+ ProgramDatabaseFile=""
+ SubSystem="2"
+ ImportLibrary="$(OutDir)/Prakt5Greedy.lib"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;idl;odl"
+ >
+ <File
+ RelativePath=".\acrxEntryPoint.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\DocData.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\Prakt5Greedy.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\StdAfx.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Include Files"
+ Filter="h;hh;hxx"
+ >
+ <File
+ RelativePath=".\DocData.h"
+ >
+ </File>
+ <File
+ RelativePath=".\Resource.h"
+ >
+ </File>
+ <File
+ RelativePath=".\StdAfx.h"
+ >
+ </File>
+ <File
+ RelativePath=".\Utils.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;bmp;cur;jpg;gif"
+ >
+ <File
+ RelativePath=".\Prakt5Greedy.rc"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Miscellaneous Files"
+ Filter="reg;rgs;mak;clw;vsdir;vsz;css;inf;vcproj;csproj"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy/Prakt5Greedy.vcproj.SYNERVA.eisenhauer.user b/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy/Prakt5Greedy.vcproj.SYNERVA.eisenhauer.user new file mode 100644 index 0000000..e82dc15 --- /dev/null +++ b/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy/Prakt5Greedy.vcproj.SYNERVA.eisenhauer.user @@ -0,0 +1,65 @@ +<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioUserFile
+ ProjectType="Visual C++"
+ Version="8,00"
+ ShowAllFiles="false"
+ >
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ >
+ <DebugSettings
+ Command="C:\Programme\AutoCAD Civil 3D 2009\acad.exe"
+ WorkingDirectory=""
+ CommandArguments=""
+ Attach="false"
+ DebuggerType="3"
+ Remote="1"
+ RemoteMachine="NB-STUDI2"
+ RemoteCommand=""
+ HttpUrl=""
+ PDBPath=""
+ SQLDebugging=""
+ Environment=""
+ EnvironmentMerge="true"
+ DebuggerFlavor=""
+ MPIRunCommand=""
+ MPIRunArguments=""
+ MPIRunWorkingDirectory=""
+ ApplicationCommand=""
+ ApplicationArguments=""
+ ShimCommand=""
+ MPIAcceptMode=""
+ MPIAcceptFilter=""
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ >
+ <DebugSettings
+ Command="C:\Programme\AutoCAD Civil 3D 2009\acad.exe"
+ WorkingDirectory=""
+ CommandArguments=""
+ Attach="false"
+ DebuggerType="3"
+ Remote="1"
+ RemoteMachine="NB-STUDI2"
+ RemoteCommand=""
+ HttpUrl=""
+ PDBPath=""
+ SQLDebugging=""
+ Environment=""
+ EnvironmentMerge="true"
+ DebuggerFlavor=""
+ MPIRunCommand=""
+ MPIRunArguments=""
+ MPIRunWorkingDirectory=""
+ ApplicationCommand=""
+ ApplicationArguments=""
+ ShimCommand=""
+ MPIAcceptMode=""
+ MPIAcceptFilter=""
+ />
+ </Configuration>
+ </Configurations>
+</VisualStudioUserFile>
diff --git a/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy/Resource.h b/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy/Resource.h new file mode 100644 index 0000000..880e15c --- /dev/null +++ b/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy/Resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by Prakt5Greedy.rc
+//
+#define IDS_PROJNAME 100
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 102
+#define _APS_NEXT_COMMAND_VALUE 32768
+#define _APS_NEXT_CONTROL_VALUE 100
+#define _APS_NEXT_SYMED_VALUE 102
+#endif
+#endif
diff --git a/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy/StdAfx.cpp b/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy/StdAfx.cpp new file mode 100644 index 0000000..afd4d88 --- /dev/null +++ b/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy/StdAfx.cpp @@ -0,0 +1,27 @@ +// (C) Copyright 2002-2007 by Autodesk, Inc.
+//
+// Permission to use, copy, modify, and distribute this software in
+// object code form for any purpose and without fee is hereby granted,
+// provided that the above copyright notice appears in all copies and
+// that both that copyright notice and the limited warranty and
+// restricted rights notice below appear in all supporting
+// documentation.
+//
+// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
+// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
+// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
+// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
+// UNINTERRUPTED OR ERROR FREE.
+//
+// Use, duplication, or disclosure by the U.S. Government is subject to
+// restrictions set forth in FAR 52.227-19 (Commercial Computer
+// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
+// (Rights in Technical Data and Computer Software), as applicable.
+//
+
+//-----------------------------------------------------------------------------
+//------ StdAfx.cpp : source file that includes just the standard includes
+//------ StdAfx.pch will be the pre-compiled header
+//------ StdAfx.obj will contain the pre-compiled type information
+//-----------------------------------------------------------------------------
+#include "StdAfx.h"
diff --git a/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy/StdAfx.h b/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy/StdAfx.h new file mode 100644 index 0000000..55926f2 --- /dev/null +++ b/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy/StdAfx.h @@ -0,0 +1,58 @@ +// (C) Copyright 2002-2007 by Autodesk, Inc.
+//
+// Permission to use, copy, modify, and distribute this software in
+// object code form for any purpose and without fee is hereby granted,
+// provided that the above copyright notice appears in all copies and
+// that both that copyright notice and the limited warranty and
+// restricted rights notice below appear in all supporting
+// documentation.
+//
+// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
+// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
+// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
+// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
+// UNINTERRUPTED OR ERROR FREE.
+//
+// Use, duplication, or disclosure by the U.S. Government is subject to
+// restrictions set forth in FAR 52.227-19 (Commercial Computer
+// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
+// (Rights in Technical Data and Computer Software), as applicable.
+//
+
+//-----------------------------------------------------------------------------
+//- StdAfx.h : include file for standard system include files,
+//- or project specific include files that are used frequently,
+//- but are changed infrequently
+//-----------------------------------------------------------------------------
+#pragma once
+
+#pragma pack (push, 8)
+#pragma warning(disable: 4786 4996)
+//#pragma warning(disable: 4098)
+
+//-----------------------------------------------------------------------------
+#include <windows.h>
+
+//- ObjectARX and OMF headers needs this
+#include <map>
+
+//-----------------------------------------------------------------------------
+//- Include ObjectDBX/ObjectARX headers
+//- Uncomment one of the following lines to bring a given library in your project.
+//#define _BREP_SUPPORT_ //- Support for the BRep API
+//#define _HLR_SUPPORT_ //- Support for the Hidden Line Removal API
+//#define _AMODELER_SUPPORT_ //- Support for the AModeler API
+//#define _ASE_SUPPORT_ //- Support for the ASI/ASE API
+//#define _RENDER_SUPPORT_ //- Support for the AutoCAD Render API
+//#define _ARX_CUSTOM_DRAG_N_DROP_ //- Support for the ObjectARX Drag'n Drop API
+//#define _INC_LEAGACY_HEADERS_ //- Include legacy headers in this project
+#include "arxHeaders.h"
+
+//-----------------------------------------------------------------------------
+#include "DocData.h" //- Your document specific data class holder
+
+//- Declare it as an extern here so that it becomes available in all modules
+extern AcApDataManager<CDocData> DocVars ;
+
+#pragma pack (pop)
+
diff --git a/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy/Utils.h b/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy/Utils.h new file mode 100644 index 0000000..e79c2ae --- /dev/null +++ b/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy/Utils.h @@ -0,0 +1,153 @@ +#include <math.h>
+#include <limits>
+
+static const double pi = 3.141592653589793238462643383279502884197; // Archimedes constant pi
+
+static int sign (double n)
+{
+ if (n >= std::numeric_limits<double>::epsilon() ) return 1;
+ return -1;
+}
+enum edgetype {
+ CONTOUR, TRIANG
+};
+struct Node {
+ AcGeVector3d v;
+ double arrivingAngle;
+ double leavingAngle;
+ unsigned nodeIdx;
+
+ Node(AcGePoint3d& p, unsigned i) {
+ v.x = p.x;
+ v.y = p.y;
+ v.z = 1;
+ nodeIdx = i;
+ }
+ bool operator==(const Node& other) const {
+ return (v.isEqualTo(other.v)) && (nodeIdx == other.nodeIdx);
+ }
+};
+
+struct Edge {
+ Node* startNode;
+ Node* endNode;
+ AcGeVector3d normVertex;
+ double length;
+ edgetype type;
+
+ Edge(Node* s,Node* e,edgetype et) {
+ startNode = s;
+ endNode = e;
+ normVertex=startNode->v.crossProduct(endNode->v);
+ type = et;
+ if(type == TRIANG) {
+ double dx= endNode->v.x - startNode->v.x;
+ double dy= endNode->v.y - startNode->v.y;
+ length = std::sqrt((dx*dx)+(dy*dy));
+ } else {
+ length = -1.0;
+ }
+ }
+
+ bool intersects(Edge& edge) {
+ /*if(startNode->nodeIdx == edge.startNode->nodeIdx || startNode->nodeIdx == edge.endNode->nodeIdx
+ || endNode->nodeIdx == edge.startNode->nodeIdx || endNode->nodeIdx == edge.endNode->nodeIdx) {
+ return false;
+ }*/
+ if(startNode->v.isEqualTo(edge.startNode->v) || endNode->v.isEqualTo(edge.endNode->v)
+ || startNode->v.isEqualTo(edge.endNode->v) || endNode->v.isEqualTo(edge.startNode->v) ) {
+ return false;
+ }
+ AcGeVector3d intersectionPoint = normVertex.crossProduct(edge.normVertex);
+ intersectionPoint.x = intersectionPoint.x / intersectionPoint.z;
+ intersectionPoint.y = intersectionPoint.y / intersectionPoint.z;
+ intersectionPoint.z = 1;
+ if(intersectionPoint.isEqualTo(startNode->v) || intersectionPoint.isEqualTo(endNode->v)
+ || intersectionPoint.isEqualTo(edge.startNode->v) || intersectionPoint.isEqualTo(edge.endNode->v) ) {
+ return false;
+ }
+ //acutPrintf(_T("\nIntersectionpoint: (%f / %f / %f)"),intersectionPoint.x,intersectionPoint.y,intersectionPoint.z);
+ AcGeVector3d v1(intersectionPoint.x - startNode->v.x , intersectionPoint.y - startNode->v.y,0);
+ AcGeVector3d v2(endNode->v.x - intersectionPoint.x , endNode->v.y - intersectionPoint.y,0);
+ AcGeVector3d v3(intersectionPoint.x - edge.startNode->v.x , intersectionPoint.y - edge.startNode->v.y,0);
+ AcGeVector3d v4(edge.endNode->v.x - intersectionPoint.x , edge.endNode->v.y - intersectionPoint.y,0);
+ if(v1.isEqualTo(v2) || v3.isEqualTo(v4) ) {
+ return false;
+ }
+ if( (sign(v1.x) == sign(v2.x)) && (sign(v1.y) == sign(v2.y)) && (sign(v3.x) == sign(v4.x)) && (sign(v3.y) == sign(v4.y) ) ) {
+ return true;
+ } else {
+ acutPrintf(_T("\n------------------------"));
+ acutPrintf(_T("\nA: [%d;%d] ,B:[%d;%d]"),startNode->nodeIdx,endNode->nodeIdx,edge.startNode->nodeIdx,edge.endNode->nodeIdx);
+ acutPrintf(_T("\nV1: (%f / %f / %f)"),v1.x,v1.y,v1.z);
+ acutPrintf(_T("\nV2: (%f / %f / %f)"),v2.x,v2.y,v2.z);
+ acutPrintf(_T("\nV3: (%f / %f / %f)"),v3.x,v3.y,v3.z);
+ acutPrintf(_T("\nV4: (%f / %f / %f)"),v4.x,v4.y,v4.z);
+ return false;
+ }
+ }
+ double getAngleToXaxisDeg() {
+ double angle = (std::atan2(endNode->v.y - startNode->v.y,endNode->v.x - startNode->v.x)*180) / pi;
+ if(angle < 0) {
+ angle += 360.0;
+ }
+ return angle;
+ }
+ double getInvAngleToXaxisDeg() {
+ double angle = (std::atan2(startNode->v.y - endNode->v.y,startNode->v.x - endNode->v.x)*180) / pi;
+ if(angle < 0) {
+ angle += 360.0;
+ }
+ return angle;
+ }
+ bool operator== (const Edge& other) const {
+ return (startNode->nodeIdx==other.startNode->nodeIdx) && (endNode->nodeIdx==other.endNode->nodeIdx);
+ }
+ bool operator!= (const Edge& other) const {
+ return !(*this == other);
+ }
+ bool operator< (const Edge& a) {
+ return length < a.length;
+ }
+ bool isEdgeOutsidePolygon()
+ {
+ bool isOutside = true;
+ double edgeAngle = getAngleToXaxisDeg();
+ double edgeInvAngle = getInvAngleToXaxisDeg();
+ double edgeAnglePlus360 = edgeAngle+360.0;
+ double edgeInvAnglePlus360 = getInvAngleToXaxisDeg() +360.0;
+ /*isOutside = ((edgeAngle > startNode->arrivingAngle) && (edgeAngle < startNode->leavingAngle))
+ && ((getInvAngleToXaxisDeg() > endNode->arrivingAngle) && (getInvAngleToXaxisDeg() < endNode->leavingAngle)) ;
+ if(!isOutside) {
+ isOutside = (edgeAnglePlus360 > startNode->arrivingAngle) && (edgeAnglePlus360 < startNode->leavingAngle)
+ && ((edgeInvAnglePlus360 > endNode->arrivingAngle) && (edgeInvAnglePlus360 < endNode->leavingAngle)) ;
+ }*/
+ isOutside = (((edgeAngle >= startNode->arrivingAngle) && (edgeAngle <= startNode->leavingAngle))
+ || ((edgeAnglePlus360 >= startNode->arrivingAngle) && (edgeAnglePlus360 <= startNode->leavingAngle)))
+ && (((edgeInvAngle >= endNode->arrivingAngle) && (edgeInvAngle <= endNode->leavingAngle))
+ || ((edgeInvAnglePlus360 >= endNode->arrivingAngle) && (edgeInvAnglePlus360 <= endNode->leavingAngle)));
+ return isOutside;
+ }
+};
+
+bool edgeComp(Edge* a, Edge* b) {
+ return a->length < b->length;
+}
+
+bool triangEdgeComp(Edge* a, Edge* b) {
+ if( (a->type == CONTOUR) && (b->type == TRIANG) ) {
+ return true;
+ } else {
+ if(a->startNode->nodeIdx < b->startNode->nodeIdx) {
+ return true;
+ } else if(a->startNode->nodeIdx == b->startNode->nodeIdx) {
+ if(a->endNode->nodeIdx < b->endNode->nodeIdx) {
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ return false;
+ }
+ }
+}
\ No newline at end of file diff --git a/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy/acrxEntryPoint.cpp b/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy/acrxEntryPoint.cpp new file mode 100644 index 0000000..9983595 --- /dev/null +++ b/Master/CGuCAD/projects/Prakt5Greedy/Prakt5Greedy/acrxEntryPoint.cpp @@ -0,0 +1,409 @@ +// (C) Copyright 2002-2007 by Autodesk, Inc.
+//
+// Permission to use, copy, modify, and distribute this software in
+// object code form for any purpose and without fee is hereby granted,
+// provided that the above copyright notice appears in all copies and
+// that both that copyright notice and the limited warranty and
+// restricted rights notice below appear in all supporting
+// documentation.
+//
+// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
+// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
+// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
+// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
+// UNINTERRUPTED OR ERROR FREE.
+//
+// Use, duplication, or disclosure by the U.S. Government is subject to
+// restrictions set forth in FAR 52.227-19 (Commercial Computer
+// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
+// (Rights in Technical Data and Computer Software), as applicable.
+//
+
+//-----------------------------------------------------------------------------
+//----- acrxEntryPoint.cpp
+//-----------------------------------------------------------------------------
+#include "StdAfx.h"
+#include "resource.h"
+#include <vector>
+#include <list>
+#include "Utils.h"
+
+//-----------------------------------------------------------------------------
+#define szRDS _RXST("CGCAD_sei")
+
+// Global
+#define TRIANG_LAYER _T("TRIANG")
+
+//-----------------------------------------------------------------------------
+//----- ObjectARX EntryPoint
+class CPrakt5GreedyApp : public AcRxArxApp {
+
+public:
+ CPrakt5GreedyApp () : AcRxArxApp () {}
+
+ virtual AcRx::AppRetCode On_kInitAppMsg (void *pkt) {
+ // TODO: Load dependencies here
+
+ // You *must* call On_kInitAppMsg here
+ AcRx::AppRetCode retCode =AcRxArxApp::On_kInitAppMsg (pkt) ;
+
+ // TODO: Add your initialization code here
+
+ return (retCode) ;
+ }
+
+ virtual AcRx::AppRetCode On_kUnloadAppMsg (void *pkt) {
+ // TODO: Add your code here
+
+ // You *must* call On_kUnloadAppMsg here
+ AcRx::AppRetCode retCode =AcRxArxApp::On_kUnloadAppMsg (pkt) ;
+
+ // TODO: Unload dependencies here
+
+ return (retCode) ;
+ }
+
+ virtual void RegisterServerComponents () {
+ }
+
+
+ // - CGCAD_seiPrakt5Greedy._Greedy command (do not rename)
+ static void CGCAD_seiPrakt5Greedy_Greedy(void)
+ {
+ AcDbPolyline* pPolyline = NULL;
+
+ acdbTransactionManager->startTransaction();
+ int res = selectPolyline(pPolyline);
+ if(res != RTNORM) {
+ acutPrintf(_T("\nError selecting polyline"));
+ acdbTransactionManager->abortTransaction();
+ return;
+ } else {
+ acutPrintf(_T("\nPolyline has %d Vertices"),pPolyline->numVerts());
+ }
+ res = createTriangLayer();
+ if(res != RTNORM) {
+ acutPrintf(_T("\nError creating TRIANG layer"));
+ acdbTransactionManager->abortTransaction();
+ return;
+ }
+ res = Greedy(pPolyline);
+ if(res != RTNORM) {
+ acutPrintf(_T("\nError in Greedy"));
+ acdbTransactionManager->abortTransaction();
+ return;
+ }
+ acdbTransactionManager->endTransaction();
+ }
+ static int selectPolyline(AcDbPolyline *&pPolyline) {
+ ads_name objName;
+ AcDbEntity* pEnt = NULL;
+ AcDbObjectId objId = AcDbObjectId::kNull;
+ int res = RTNORM;
+ ads_point pickPoint;
+ res = acedEntSel(_T("\nPlease select polyline"),objName,pickPoint);
+
+ if (res != RTNORM) {
+ acutPrintf(_T("\nError selecting entity"));
+ return res;
+ }
+ if (Acad::eOk != acdbGetObjectId(objId,objName)) {
+ acutPrintf(_T("\nCould not fetch objid for face"));
+ res = -1;
+ return res;
+ }
+ if (acdbTransactionManager->getObject((AcDbObject*&)pEnt,objId,AcDb::kForRead) != Acad::eOk) {
+ acutPrintf(_T("\nCould not get Object"));
+ res = -1;
+ return res;
+ }
+ if ( pEnt->isKindOf(AcDbPolyline::desc()) ) {
+ acutPrintf(_T("\nObject is a Polyline"));
+ pPolyline = AcDbPolyline::cast(pEnt);
+ }
+ return res;
+ }
+ static int addObject(AcDbEntity*& pEnt) {
+ AcDbBlockTable* pBlockTable = NULL;
+ AcDbObjectId newObjId = AcDbObjectId::kNull;
+ AcDbBlockTableRecord* pBlockTableRecord = NULL;
+ Acad::ErrorStatus res = acdbTransactionManager->getObject((AcDbObject*&) pBlockTable,curDoc()->database()->blockTableId(),AcDb::kForRead);
+ if (res != Acad::eOk) {
+ acdbTransactionManager->abortTransaction();
+ acutPrintf(_T("\nError opening Block Table. Exiting"));
+ return -1;
+ }
+ if( Acad::eOk != pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord, AcDb::kForRead) ) {
+ acdbTransactionManager->abortTransaction();
+ pBlockTableRecord->close();
+ acutPrintf(_T("\nError opening Block Table Record. Exiting"));
+ return -1;
+ }
+ if (Acad::eOk != pBlockTableRecord->upgradeOpen() ) {
+ acdbTransactionManager->abortTransaction();
+ pBlockTableRecord->close();
+ acutPrintf(_T("\nError opening Block Table Record for write. Exiting"));
+ return -1;
+ }
+ if ( Acad::eOk != pBlockTableRecord->appendAcDbEntity(newObjId, pEnt)) {
+ acdbTransactionManager->abortTransaction();
+ pBlockTableRecord->close();
+ acutPrintf(_T("\nError adding entity to Block Table Record. Exiting"));
+ return -1;
+ }
+ if (Acad::eOk != pBlockTableRecord->downgradeOpen() ) {
+ acdbTransactionManager->abortTransaction();
+ pBlockTableRecord->close();
+ acutPrintf(_T("\nError downgrading Block Table Record for read. Exiting"));
+ return -1;
+ }
+
+ if ( Acad::eOk != acdbTransactionManager->addNewlyCreatedDBRObject(pEnt) ) {
+ acdbTransactionManager->abortTransaction();
+ pBlockTableRecord->close();
+ acutPrintf(_T("\nError adding new entity to TransactionManager. Exiting"));
+ return -1;
+ }
+ pBlockTableRecord->close();
+ return 0;
+ }
+ static int createTriangLayer() {
+ AcDbLayerTable *pLayerTable = NULL;
+
+ acdbTransactionManager->startTransaction();
+ Acad::ErrorStatus res = acdbTransactionManager->getObject((AcDbObject*&) pLayerTable,curDoc()->database()->layerTableId(),AcDb::kForRead);
+
+ AcDbLayerTableRecord *pTriangLayerTableRecord = NULL;
+
+ if (!pLayerTable->has(TRIANG_LAYER)) {
+ acutPrintf(_T("\nCreating TRIANG Layer"));
+ pLayerTable->upgradeOpen();
+ pTriangLayerTableRecord = new AcDbLayerTableRecord;
+ pTriangLayerTableRecord->setName(TRIANG_LAYER);
+ AcCmColor polyColor;
+ polyColor.setRGB(0,0,255);
+ pTriangLayerTableRecord->setColor(polyColor);
+ pTriangLayerTableRecord->setIsLocked(false);
+ pTriangLayerTableRecord->setIsFrozen(false);
+ pTriangLayerTableRecord->setIsOff(false);
+ pTriangLayerTableRecord->setIsHidden(false);
+ if ( Acad::eOk != pLayerTable->add(pTriangLayerTableRecord) ) {
+ acutPrintf(_T("\nError adding TRIANG Layer"));
+ acdbTransactionManager->abortTransaction();
+ return 2;
+ }
+ acdbTransactionManager->addNewlyCreatedDBRObject(pTriangLayerTableRecord);
+ } else {
+ acutPrintf(_T("\nTRIANG Layer already exists"));
+ }
+ acdbTransactionManager->endTransaction();
+ return RTNORM;
+ }
+ static bool isEdgeAngleInsidePolygon(Node* node) {
+ bool res = false;
+ return res;
+ }
+ static int Greedy(AcDbPolyline*& pPolyline) {
+ std::vector<Node*> nodes;
+ for(unsigned i=0;i<pPolyline->numVerts();i++) {
+ AcGePoint3d p;
+ pPolyline->getPointAt(i,p);
+ bool contains = false;
+ for(std::vector<Node*>::iterator it = nodes.begin();it!=nodes.end();it++) {
+ if((*it)->v == p.asVector()) {
+ contains = true;
+ break;
+ }
+ }
+ if(!contains) {
+ Node* node = new Node(p,i);
+ nodes.push_back(node);
+ }
+ }
+ unsigned N = nodes.size();
+ // NT: Number of inner edges needed, see lecture pdf 7.1.2, page 126
+ unsigned NT = N - 3;
+
+ acutPrintf(_T("\nNo. Edges: %d, no. triangle edges: %d"),N,NT);
+
+ std::list<Edge*> edgePool;
+ std::list<Edge*> triangEdges;
+ Node* pStartNode;
+ Node* pEndNode;
+ Edge* edge = NULL;
+
+ // generate all edges
+ for (size_t c=0;c<nodes.size()-1;c++) {
+ for(size_t j=c+1;j<nodes.size();j++) {
+ pStartNode=nodes[c];
+ pEndNode=nodes[j];
+ if( c==0 && j==nodes.size()-1) {
+ edge = new Edge(pEndNode,pStartNode,CONTOUR);
+ acutPrintf(_T("\nAdding Contour Edge [%d ; %d]"),edge->startNode->nodeIdx,edge->endNode->nodeIdx);
+ } else if(j-c==1) {
+ edge = new Edge(pStartNode,pEndNode,CONTOUR);
+ acutPrintf(_T("\nAdding Contour Edge [%d ; %d]"),edge->startNode->nodeIdx,edge->endNode->nodeIdx);
+ } else {
+ edge = new Edge(pStartNode,pEndNode,TRIANG);
+ acutPrintf(_T("\nAdding TRIANG Edge [%d ; %d]"),edge->startNode->nodeIdx,edge->endNode->nodeIdx);
+ }
+ if(std::abs(edge->length) > std::numeric_limits<double>::epsilon()) {
+ edgePool.push_back(edge);
+ }
+ }
+ }
+
+ // calc startAngle and endAngle for all Nodes
+ std::vector<Node*>::iterator nodeIter;
+ std::list<Edge*>::iterator edgeIter;
+ /*for(nodeIter = nodes.begin(); nodeIter != nodes.end(); nodeIter++) {
+ Node* node = *nodeIter;
+ for(edgeIter = edgePool.begin(); edgeIter!=edgePool.end(); edgeIter++) {
+ Edge* edge = *edgeIter;
+ if(edge->type == CONTOUR) {
+ if(node == edge->startNode ) {
+ node->leavingAngle = edge->getAngleToXaxisDeg();
+ } else if(node == edge->endNode) {
+ node->arrivingAngle = edge->getAngleToXaxisDeg();
+ }
+ }
+ }
+ }*/
+ AcGeVector3d xAxis(1.0,0.0,0.0);
+ for (size_t c=0;c<nodes.size()-1;c++) {
+ for(size_t j=c+1;j<nodes.size();j++) {
+ bool areNeighboorNodes = false;
+ if( (c==0 && j==nodes.size()-1) ) {
+ pStartNode=nodes[j];
+ pEndNode=nodes[c];
+ areNeighboorNodes = true;
+ } else if(j-c==1) {
+ pStartNode=nodes[c];
+ pEndNode=nodes[j];
+ areNeighboorNodes = true;
+ } else {
+ areNeighboorNodes = false;
+ }
+ if(areNeighboorNodes) {
+ pStartNode->leavingAngle = (std::atan2(pEndNode->v.y - pStartNode->v.y,pEndNode->v.x - pStartNode->v.x)*180.0) / pi;
+ if(pStartNode->leavingAngle < 0.0) {
+ pStartNode->leavingAngle += 360.0;
+ }
+ pEndNode->arrivingAngle = (std::atan2(pStartNode->v.y - pEndNode->v.y,pStartNode->v.x - pEndNode->v.x)*180.0) / pi;
+ if(pEndNode->arrivingAngle < 0.0) {
+ pEndNode->arrivingAngle += 360.0;
+ }
+ }
+ }
+ }
+
+ for(nodeIter = nodes.begin(); nodeIter != nodes.end(); nodeIter++) {
+ Node* node = *nodeIter;
+ if(node->arrivingAngle > node->leavingAngle) {
+ node->leavingAngle += 360.0;
+ }
+ }
+ for(nodeIter = nodes.begin(); nodeIter != nodes.end(); nodeIter++) {
+ Node* node = *nodeIter;
+ acutPrintf(_T("\nNode: %d start: %f, end %f"),node->nodeIdx,node->arrivingAngle,node->leavingAngle);
+ }
+ //unsigned n=0;
+ //for(edgeIter = edgePool.begin(); edgeIter!=edgePool.end(); edgeIter++) {
+ // acutPrintf(_T("\nNo: %d length: %f"),++n,(*edgeIter)->length );
+ //}
+ edgePool.sort(edgeComp);
+ //n=0;
+ //for(edgeIter = edgePool.begin(); edgeIter!=edgePool.end(); edgeIter++) {
+ // acutPrintf(_T("\nNo: %d length: %f"),++n,(*edgeIter)->length );
+ //}
+ acutPrintf(_T("\nEdge pool size: %d"),edgePool.size() );
+
+ // first all all contour edges
+ for (edgeIter = edgePool.begin();edgeIter!=edgePool.end();edgeIter++)
+ {
+ Edge* pEdge = *edgeIter;
+ if( pEdge->type == CONTOUR) {
+ triangEdges.push_back(pEdge);
+ }
+ }
+ unsigned numInnerEdges = 0;
+ for (edgeIter = edgePool.begin();edgeIter!=edgePool.end();edgeIter++)
+ {
+ if(numInnerEdges >= NT) {
+ break;
+ }
+ Edge* pEdge = *edgeIter;
+ if( pEdge->type != CONTOUR) {
+ // check angle
+ if( !pEdge->isEdgeOutsidePolygon() ) {
+ acutPrintf(_T("\n[%d;%d] Edge angle valid: startnode start %f, end %f, endnode start %f, end %f, edge angle %f, inv: %f"),pEdge->startNode->nodeIdx,pEdge->endNode->nodeIdx,pEdge->startNode->arrivingAngle,pEdge->startNode->leavingAngle,pEdge->endNode->arrivingAngle,pEdge->endNode->leavingAngle,(pEdge->getAngleToXaxisDeg()<=360)?pEdge->getAngleToXaxisDeg():pEdge->getAngleToXaxisDeg()+360,pEdge->getInvAngleToXaxisDeg());
+ bool intersectsAnEdge = false;
+ for(std::list<Edge*>::iterator triangIter = triangEdges.begin();triangIter!=triangEdges.end();triangIter++) {
+ Edge triangEdge = **triangIter;
+ if( triangEdge.intersects(*pEdge) ) {
+ acutPrintf(_T("\nFound intersecting edges: [%d,%d] | [%d,%d]"),pEdge->startNode->nodeIdx,pEdge->endNode->nodeIdx,triangEdge.startNode->nodeIdx,triangEdge.endNode->nodeIdx);
+ intersectsAnEdge = true;
+ break;
+ }
+ }
+ if(!intersectsAnEdge) {
+ triangEdges.push_back(pEdge);
+ numInnerEdges++;
+ }
+ } else {
+ acutPrintf(_T("\n[%d;%d] Edge angle invalid: startnode start %f, end %f, endnode start %f, end %f, edge angle %f, inv: %f"),pEdge->startNode->nodeIdx,pEdge->endNode->nodeIdx,pEdge->startNode->arrivingAngle,pEdge->startNode->leavingAngle,pEdge->endNode->arrivingAngle,pEdge->endNode->leavingAngle,(pEdge->getAngleToXaxisDeg()<=360)?pEdge->getAngleToXaxisDeg():pEdge->getAngleToXaxisDeg()+360,pEdge->getInvAngleToXaxisDeg());
+ }
+
+ }
+ }
+ triangEdges.sort(triangEdgeComp);
+ acutPrintf(_T("\nFound %d triangle edges"),triangEdges.size() );
+
+ for(std::list<Edge*>::iterator triangIter = triangEdges.begin();triangIter!=triangEdges.end();triangIter++) {
+ Edge* e1 = *triangIter;
+ Edge* e2;
+ Edge* e3;
+ AcGePoint3d* p1 = NULL;
+ AcGePoint3d* p2 = NULL;
+ AcGePoint3d* p3 = NULL;
+ AcDbFace* pFace = NULL;
+ bool foundAFace = false;
+ for(std::list<Edge*>::iterator e2it = triangIter;e2it!=triangEdges.end();e2it++) {
+ e2=*e2it;
+ //if( ( e1->idx2 == e2->idx1) || (e1->idx1 == e2->idx1) ) {
+ for(std::list<Edge*>::iterator e3it = e2it;e3it!=triangEdges.end();e3it++) {
+ foundAFace = false;
+ e3 = (*e3it);
+ if( (*e1 != *e2) && (*e2 != *e3) && (*e1 != *e3) ) {
+ if( (e1->startNode->nodeIdx == e3->endNode->nodeIdx) && (e2->endNode->nodeIdx == e3->startNode->nodeIdx) && (e1->endNode->nodeIdx == e2->startNode->nodeIdx) ) {
+ p1 = new AcGePoint3d(e1->startNode->v.x,e1->startNode->v.y,0);
+ p2 = new AcGePoint3d(e2->startNode->v.x,e2->startNode->v.y,0);
+ p3 = new AcGePoint3d(e3->startNode->v.x,e3->startNode->v.y,0);
+ foundAFace = true;
+ } else if( (e1->startNode->nodeIdx == e2->startNode->nodeIdx) && (e2->endNode->nodeIdx == e3->endNode->nodeIdx) && (e3->startNode->nodeIdx == e1->endNode->nodeIdx) ) {
+ p1 = new AcGePoint3d(e1->startNode->v.x,e1->startNode->v.y,0);
+ p2 = new AcGePoint3d(e3->startNode->v.x,e3->startNode->v.y,0);
+ p3 = new AcGePoint3d(e3->endNode->v.x,e3->endNode->v.y,0);
+ foundAFace = true;
+ }
+ if(foundAFace) {
+ pFace = new AcDbFace(*p1,*p2,*p3,*p1,Adesk::kFalse,Adesk::kFalse,Adesk::kFalse,Adesk::kFalse);
+ pFace->setLayer(TRIANG_LAYER);
+ addObject((AcDbEntity*&) pFace);
+ acutPrintf(_T("\nPainting a face %d;%d %d;%d %d;%d"),e1->startNode->nodeIdx,e1->endNode->nodeIdx,e2->startNode->nodeIdx,e2->endNode->nodeIdx,e3->startNode->nodeIdx,e3->endNode->nodeIdx);
+ foundAFace = false;
+ }
+ }
+ } // e3it
+ //} //if
+ } // e2it
+ } // triangIter
+
+ return RTNORM;
+ }
+} ;
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_ARX_ENTRYPOINT(CPrakt5GreedyApp)
+
+ACED_ARXCOMMAND_ENTRY_AUTO(CPrakt5GreedyApp, CGCAD_seiPrakt5Greedy, _Greedy, Greedy, ACRX_CMD_MODAL, NULL)
|
