From 442b18874c0d329f8b315bab29e0a59a812b49bc Mon Sep 17 00:00:00 2001 From: KerelOlivier Date: Sat, 16 Apr 2022 01:39:58 +0200 Subject: [PATCH] initial commit --- .clang-format | 212 +++++++++++++++++++++++++++++++ .gitignore | 116 +++++++++++++++++ CMakeLists.txt | 6 + README.md | 0 main.cpp | 6 + src/datastructures/Beachline.cpp | 5 + src/datastructures/Beachline.h | 10 ++ src/datastructures/DCEL.cpp | 5 + src/datastructures/DCEL.h | 10 ++ src/types/event.h | 8 ++ src/types/node.h | 8 ++ src/types/point.h | 8 ++ src/utils/circle.h | 8 ++ src/utils/intersection.h | 8 ++ 14 files changed, 410 insertions(+) create mode 100644 .clang-format create mode 100644 .gitignore create mode 100644 CMakeLists.txt create mode 100644 README.md create mode 100644 main.cpp create mode 100644 src/datastructures/Beachline.cpp create mode 100644 src/datastructures/Beachline.h create mode 100644 src/datastructures/DCEL.cpp create mode 100644 src/datastructures/DCEL.h create mode 100644 src/types/event.h create mode 100644 src/types/node.h create mode 100644 src/types/point.h create mode 100644 src/utils/circle.h create mode 100644 src/utils/intersection.h diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..2d0f248 --- /dev/null +++ b/.clang-format @@ -0,0 +1,212 @@ +--- +Language: Cpp +# BasedOnStyle: Google +AccessModifierOffset: -1 +AlignAfterOpenBracket: Align +AlignArrayOfStructures: None +AlignConsecutiveMacros: None +AlignConsecutiveAssignments: None +AlignConsecutiveBitFields: None +AlignConsecutiveDeclarations: None +AlignEscapedNewlines: Left +AlignOperands: Align +AlignTrailingComments: true +AllowAllArgumentsOnNextLine: true +AllowAllConstructorInitializersOnNextLine: true +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortEnumsOnASingleLine: true +AllowShortBlocksOnASingleLine: Never +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: All +AllowShortLambdasOnASingleLine: All +AllowShortIfStatementsOnASingleLine: WithoutElse +AllowShortLoopsOnASingleLine: true +AlwaysBreakAfterDefinitionReturnType: None +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: true +AlwaysBreakTemplateDeclarations: Yes +AttributeMacros: + - __capability +BinPackArguments: true +BinPackParameters: true +BraceWrapping: + AfterCaseLabel: false + AfterClass: false + AfterControlStatement: Never + AfterEnum: false + AfterFunction: false + AfterNamespace: false + AfterObjCDeclaration: false + AfterStruct: false + AfterUnion: false + AfterExternBlock: false + BeforeCatch: false + BeforeElse: false + BeforeLambdaBody: false + BeforeWhile: false + IndentBraces: false + SplitEmptyFunction: true + SplitEmptyRecord: true + SplitEmptyNamespace: true +BreakBeforeBinaryOperators: None +BreakBeforeConceptDeclarations: true +BreakBeforeBraces: Attach +BreakBeforeInheritanceComma: false +BreakInheritanceList: BeforeColon +BreakBeforeTernaryOperators: true +BreakConstructorInitializersBeforeComma: false +BreakConstructorInitializers: BeforeColon +BreakAfterJavaFieldAnnotations: false +BreakStringLiterals: true +ColumnLimit: 80 +CommentPragmas: '^ IWYU pragma:' +CompactNamespaces: false +ConstructorInitializerAllOnOneLineOrOnePerLine: true +ConstructorInitializerIndentWidth: 4 +ContinuationIndentWidth: 4 +Cpp11BracedListStyle: true +DeriveLineEnding: true +DerivePointerAlignment: true +DisableFormat: false +EmptyLineAfterAccessModifier: Never +EmptyLineBeforeAccessModifier: LogicalBlock +ExperimentalAutoDetectBinPacking: false +FixNamespaceComments: true +ForEachMacros: + - foreach + - Q_FOREACH + - BOOST_FOREACH +IfMacros: + - KJ_IF_MAYBE +IncludeBlocks: Regroup +IncludeCategories: + - Regex: '^' + Priority: 2 + SortPriority: 0 + CaseSensitive: false + - Regex: '^<.*\.h>' + Priority: 1 + SortPriority: 0 + CaseSensitive: false + - Regex: '^<.*' + Priority: 2 + SortPriority: 0 + CaseSensitive: false + - Regex: '.*' + Priority: 3 + SortPriority: 0 + CaseSensitive: false +IncludeIsMainRegex: '([-_](test|unittest))?$' +IncludeIsMainSourceRegex: '' +IndentAccessModifiers: false +IndentCaseLabels: true +IndentCaseBlocks: false +IndentGotoLabels: true +IndentPPDirectives: None +IndentExternBlock: AfterExternBlock +IndentRequires: false +IndentWidth: 2 +IndentWrappedFunctionNames: false +InsertTrailingCommas: None +JavaScriptQuotes: Leave +JavaScriptWrapImports: true +KeepEmptyLinesAtTheStartOfBlocks: false +LambdaBodyIndentation: Signature +MacroBlockBegin: '' +MacroBlockEnd: '' +MaxEmptyLinesToKeep: 1 +NamespaceIndentation: None +ObjCBinPackProtocolList: Never +ObjCBlockIndentWidth: 2 +ObjCBreakBeforeNestedBlockParam: true +ObjCSpaceAfterProperty: false +ObjCSpaceBeforeProtocolList: true +PenaltyBreakAssignment: 2 +PenaltyBreakBeforeFirstCallParameter: 1 +PenaltyBreakComment: 300 +PenaltyBreakFirstLessLess: 120 +PenaltyBreakString: 1000 +PenaltyBreakTemplateDeclaration: 10 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 200 +PenaltyIndentedWhitespace: 0 +PointerAlignment: Left +PPIndentWidth: -1 +RawStringFormats: + - Language: Cpp + Delimiters: + - cc + - CC + - cpp + - Cpp + - CPP + - 'c++' + - 'C++' + CanonicalDelimiter: '' + BasedOnStyle: google + - Language: TextProto + Delimiters: + - pb + - PB + - proto + - PROTO + EnclosingFunctions: + - EqualsProto + - EquivToProto + - PARSE_PARTIAL_TEXT_PROTO + - PARSE_TEST_PROTO + - PARSE_TEXT_PROTO + - ParseTextOrDie + - ParseTextProtoOrDie + - ParseTestProto + - ParsePartialTestProto + CanonicalDelimiter: pb + BasedOnStyle: google +ReferenceAlignment: Pointer +ReflowComments: true +ShortNamespaceLines: 1 +SortIncludes: CaseSensitive +SortJavaStaticImport: Before +SortUsingDeclarations: true +SpaceAfterCStyleCast: false +SpaceAfterLogicalNot: false +SpaceAfterTemplateKeyword: true +SpaceBeforeAssignmentOperators: true +SpaceBeforeCaseColon: false +SpaceBeforeCpp11BracedList: false +SpaceBeforeCtorInitializerColon: true +SpaceBeforeInheritanceColon: true +SpaceBeforeParens: ControlStatements +SpaceAroundPointerQualifiers: Default +SpaceBeforeRangeBasedForLoopColon: true +SpaceInEmptyBlock: false +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 2 +SpacesInAngles: Never +SpacesInConditionalStatement: false +SpacesInContainerLiterals: true +SpacesInCStyleCastParentheses: false +SpacesInLineCommentPrefix: + Minimum: 1 + Maximum: -1 +SpacesInParentheses: false +SpacesInSquareBrackets: false +SpaceBeforeSquareBrackets: false +BitFieldColonSpacing: Both +Standard: Auto +StatementAttributeLikeMacros: + - Q_EMIT +StatementMacros: + - Q_UNUSED + - QT_REQUIRE_VERSION +TabWidth: 8 +UseCRLF: false +UseTab: Never +WhitespaceSensitiveMacros: + - STRINGIZE + - PP_STRINGIZE + - BOOST_PP_STRINGIZE + - NS_SWIFT_NAME + - CF_SWIFT_NAME +... + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6fe4c52 --- /dev/null +++ b/.gitignore @@ -0,0 +1,116 @@ + +# Created by https://www.toptal.com/developers/gitignore/api/clion +# Edit at https://www.toptal.com/developers/gitignore?templates=clion + +### CLion ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +.idea +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# SonarLint plugin +.idea/sonarlint/ + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### CLion Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml +# .idea/misc.xml +# *.ipr + +# Sonarlint plugin +# https://plugins.jetbrains.com/plugin/7973-sonarlint +.idea/**/sonarlint/ + +# SonarQube Plugin +# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin +.idea/**/sonarIssues.xml + +# Markdown Navigator plugin +# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced +.idea/**/markdown-navigator.xml +.idea/**/markdown-navigator-enh.xml +.idea/**/markdown-navigator/ + +# Cache file creation bug +# See https://youtrack.jetbrains.com/issue/JBR-2257 +.idea/$CACHE_FILE$ + +# CodeStream plugin +# https://plugins.jetbrains.com/plugin/12206-codestream +.idea/codestream.xml + +# End of https://www.toptal.com/developers/gitignore/api/clion + diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..1b09192 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.22) +project(Voronoi_2) + +set(CMAKE_CXX_STANDARD 20) + +add_executable(Voronoi_2 main.cpp src/datastructures/Beachline.cpp src/datastructures/Beachline.h src/datastructures/DCEL.cpp src/datastructures/DCEL.h src/types/point.h src/types/event.h src/types/node.h src/utils/intersection.h src/utils/circle.h) diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..0ab7f9b --- /dev/null +++ b/main.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + std::cout << "Hello, World!" << std::endl; + return 0; +} diff --git a/src/datastructures/Beachline.cpp b/src/datastructures/Beachline.cpp new file mode 100644 index 0000000..c08bf70 --- /dev/null +++ b/src/datastructures/Beachline.cpp @@ -0,0 +1,5 @@ +// +// Created by olivier on 4/16/22. +// + +#include "Beachline.h" diff --git a/src/datastructures/Beachline.h b/src/datastructures/Beachline.h new file mode 100644 index 0000000..f7ecfd3 --- /dev/null +++ b/src/datastructures/Beachline.h @@ -0,0 +1,10 @@ +// +// Created by olivier on 4/16/22. +// + +#ifndef VORONOI_2_BEACHLINE_H +#define VORONOI_2_BEACHLINE_H + +class Beachline {}; + +#endif // VORONOI_2_BEACHLINE_H diff --git a/src/datastructures/DCEL.cpp b/src/datastructures/DCEL.cpp new file mode 100644 index 0000000..1507518 --- /dev/null +++ b/src/datastructures/DCEL.cpp @@ -0,0 +1,5 @@ +// +// Created by olivier on 4/16/22. +// + +#include "DCEL.h" diff --git a/src/datastructures/DCEL.h b/src/datastructures/DCEL.h new file mode 100644 index 0000000..8c03930 --- /dev/null +++ b/src/datastructures/DCEL.h @@ -0,0 +1,10 @@ +// +// Created by olivier on 4/16/22. +// + +#ifndef VORONOI_2_DCEL_H +#define VORONOI_2_DCEL_H + +class DCEL {}; + +#endif // VORONOI_2_DCEL_H diff --git a/src/types/event.h b/src/types/event.h new file mode 100644 index 0000000..0467ae0 --- /dev/null +++ b/src/types/event.h @@ -0,0 +1,8 @@ +// +// Created by olivier on 4/16/22. +// + +#ifndef VORONOI_2_EVENT_H +#define VORONOI_2_EVENT_H + +#endif // VORONOI_2_EVENT_H diff --git a/src/types/node.h b/src/types/node.h new file mode 100644 index 0000000..52e22ec --- /dev/null +++ b/src/types/node.h @@ -0,0 +1,8 @@ +// +// Created by olivier on 4/16/22. +// + +#ifndef VORONOI_2_NODE_H +#define VORONOI_2_NODE_H + +#endif // VORONOI_2_NODE_H diff --git a/src/types/point.h b/src/types/point.h new file mode 100644 index 0000000..f1b3b29 --- /dev/null +++ b/src/types/point.h @@ -0,0 +1,8 @@ +// +// Created by olivier on 4/16/22. +// + +#ifndef VORONOI_2_POINT_H +#define VORONOI_2_POINT_H + +#endif // VORONOI_2_POINT_H diff --git a/src/utils/circle.h b/src/utils/circle.h new file mode 100644 index 0000000..03574b0 --- /dev/null +++ b/src/utils/circle.h @@ -0,0 +1,8 @@ +// +// Created by olivier on 4/16/22. +// + +#ifndef VORONOI_2_CIRCLE_H +#define VORONOI_2_CIRCLE_H + +#endif // VORONOI_2_CIRCLE_H diff --git a/src/utils/intersection.h b/src/utils/intersection.h new file mode 100644 index 0000000..0b3ab5b --- /dev/null +++ b/src/utils/intersection.h @@ -0,0 +1,8 @@ +// +// Created by olivier on 4/16/22. +// + +#ifndef VORONOI_2_INTERSECTION_H +#define VORONOI_2_INTERSECTION_H + +#endif // VORONOI_2_INTERSECTION_H