Skip to content

Commit

Permalink
🔧 Merge.
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasGilg committed Jan 17, 2025
1 parent 6485bf8 commit c568c24
Show file tree
Hide file tree
Showing 35 changed files with 2,487 additions and 11 deletions.
4 changes: 2 additions & 2 deletions plugins/csl-ogc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ endif()

# build plugin -------------------------------------------------------------------------------------

file(GLOB SOURCE_FILES src/*.cpp src/*/*.cpp)
file(GLOB_RECURSE SOURCE_FILES *.cpp)

# Resource files and header files are only added in order to make them available in your IDE.
file(GLOB HEADER_FILES src/*.hpp src/*/*.hpp)
file(GLOB_RECURSE HEADER_FILES *.hpp)

add_library(csl-ogc SHARED
${SOURCE_FILES}
Expand Down
98 changes: 98 additions & 0 deletions plugins/csl-ogc/src/schemas/gml/Base.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
#ifndef CSL_OGC_GML_BASE
#define CSL_OGC_GML_BASE

#include "BasicTypes.hpp"
#include "DeprecatedTypes.hpp"

#include <optional>
#include <string>
#include <vector>

#include "../xlink/XLink.hpp"

#include "csl_ogc_export.hpp"

namespace ogc::schemas::gml {

struct StandardObjectProperties;
struct ReferenceType;

struct CSL_OGC_EXPORT AssociationAttributeGroup {
// attributes
xlink::SimpleAttrsGroup simpleAttributes;

std::optional<NilReasonType> nilReason;
std::optional<std::string> remoteSchema;
};

struct CSL_OGC_EXPORT AbstractGMLType {
// attributes
std::string id;

// child elements
StandardObjectProperties standardObjectProperties;

virtual ~AbstractGMLType() = default;
};

struct CSL_OGC_EXPORT StandardObjectProperties {
// child elements
std::vector<MetaDataPropertyType> metaDataProperty;
std::optional<StringOrRefType> description;
std::optional<ReferenceType> descriptionReference;
std::optional<CodeWithAuthorityType> identifier;
std::vector<CodeType> name;
};

struct CSL_OGC_EXPORT OwnershipAttributeGroup {
// attributes
bool owns = false;
};

struct AssociationRoleType {
// attributes
AssociationAttributeGroup associationAttributes;
OwnershipAttributeGroup ownershipAttributes;

// content
std::optional<std::any> content;
};

struct CSL_OGC_EXPORT ReferenceType {
// attributes
OwnershipAttributeGroup ownershipAttributes;
AssociationAttributeGroup associationAttributes;
};

struct CSL_OGC_EXPORT InlinePropertyType {
// attributes
OwnershipAttributeGroup ownershipAttributes;

// content
std::any content;
};

struct CSL_OGC_EXPORT AbstractMemberType {
// attributes
OwnershipAttributeGroup ownershipAttributes;

virtual ~AbstractMemberType() = default;
};

enum class AggregationType { SET, BAG, SEQUENCE, ARRAY, RECORD, TABLE };

struct CSL_OGC_EXPORT AggregationAttributeGroup {
// attributes
AggregationType aggregationType;
};

struct CSL_OGC_EXPORT AbstractMetadataPropertyType {
// attributes
OwnershipAttributeGroup ownershipAttributes;

virtual ~AbstractMetadataPropertyType() = default;
};

} // namespace ogc::schemas::gml

#endif // CSL_OGC_GML_BASE
122 changes: 122 additions & 0 deletions plugins/csl-ogc/src/schemas/gml/BasicTypes.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
// This file is part of CosmoScout VR //
////////////////////////////////////////////////////////////////////////////////////////////////////

// SPDX-FileCopyrightText: German Aerospace Center (DLR) <cosmoscout@dlr.de>
// SPDX-License-Identifier: MIT

#ifndef CSL_OGC_GML_BASIC_TYPES
#define CSL_OGC_GML_BASIC_TYPES

#include <cstdint>
#include <optional>
#include <string>
#include <variant>
#include <vector>

#include "csl_ogc_export.hpp"

namespace ogc::schemas::gml {

struct CodeType;
struct MeasureType;

enum class NilReasonEnumeration { Inapplicable, Missing, Template, Unknown, Withheld, Other };

using NilReasonType = std::variant<NilReasonEnumeration, std::string>;

enum class SignType { Minus, Plus };

using BooleanOrNilReason = std::variant<NilReasonType, bool>;
using DoubleOrNilReason = std::variant<NilReasonType, double>;
using IntegerOrNilReason = std::variant<NilReasonType, int64_t>;
using NameOrNilReason = std::variant<NilReasonType, std::string>;
using StringOrNilReason = std::variant<NilReasonType, std::string>;

struct CSL_OGC_EXPORT CodeType {
// attributes
std::optional<std::string> codeSpace;

// content
std::string content;

virtual ~CodeType() = default;
};

struct CSL_OGC_EXPORT CodeWithAuthorityType final : CodeType {
CodeWithAuthorityType(std::string value, std::string codeSpace) {
CodeType::codeSpace = std::move(codeSpace);
content = std::move(value);
}

std::string codeSpace() {
return CodeType::codeSpace.value();
}
};

struct CSL_OGC_EXPORT MeasureType {
// attributes
std::string uom;

// content
double content;
};

using UomIdentifier = std::string;

struct CSL_OGC_EXPORT CoordinatesType {
// attributes
std::string decimal = ".";
std::string cs = ",";
std::string ts = " ";

// content
std::string content;
};

using BooleanList = std::vector<bool>;
using DoubleList = std::vector<double>;
using IntegerList = std::vector<int64_t>;
using NameList = std::vector<std::string>;
using NCNameList = std::vector<std::string>;
using QNameList = std::vector<std::string>;
using BooleanOrNilReasonList = std::vector<BooleanOrNilReason>;
using NameOrNilReasonList = std::vector<NameOrNilReason>;
using DoubleOrNilReasonList = std::vector<DoubleOrNilReason>;
using IntegerOrNilReasonList = std::vector<IntegerOrNilReason>;

struct CSL_OGC_EXPORT CodeListType {
// attributes
std::optional<std::string> codeSpace;

// content
NameList content;
};

struct CSL_OGC_EXPORT CodeOrNilReasonListType {
// attributes
std::optional<std::string> codeSpace;

// content
NameOrNilReasonList content;
};

struct CSL_OGC_EXPORT MeasureListType {
// attributes
UomIdentifier uom;

// content
DoubleList content;
};

struct CSL_OGC_EXPORT MeasureOrNilReasonListType {
// attributes
UomIdentifier uom;

// content
DoubleOrNilReasonList content;
};

} // namespace ogc::schemas::gml

#endif // CSL_OGC_GML_BASIC_TYPES
Loading

0 comments on commit c568c24

Please sign in to comment.