From 9465ea37c83c9ae41520cf8ea55466019c6efc6c Mon Sep 17 00:00:00 2001
From: MarAlder <43143741+MarAlder@users.noreply.github.com>
Date: Wed, 18 Mar 2026 14:55:49 +0100
Subject: [PATCH 01/35] generated classes; add custom classes for decks and
components; add test dataset
---
bindings/python_internal/configuration.i | 10 +
cpacs_gen_input/CustomTypes.txt | 3 +
cpacs_gen_input/PruneList.txt | 1 -
cpacs_gen_input/cpacs_schema.xsd | 293 +-----
src/CCPACSPoint.cpp | 10 -
src/CCPACSPoint.h | 2 -
src/api/tigl.h | 3 +-
src/decks/CCPACSDeck.cpp | 60 ++
src/decks/CCPACSDeck.h | 58 ++
src/decks/CCPACSDeckComponentBase.cpp | 235 +++++
src/decks/CCPACSDeckComponentBase.h | 188 ++++
src/generated/CPACSBoundingBox.cpp | 206 ----
src/generated/CPACSBoundingBox.h | 107 ---
src/generated/CPACSCabinAisle.cpp | 249 +++++
src/generated/CPACSCabinAisle.h | 122 +++
src/generated/CPACSCabinAisles.cpp | 176 ++++
src/generated/CPACSCabinAisles.h | 97 ++
src/generated/CPACSCabinGeometry.cpp | 169 ++++
src/generated/CPACSCabinGeometry.h | 105 +++
src/generated/CPACSCabinGeometryContour.cpp | 121 +++
src/generated/CPACSCabinGeometryContour.h | 85 ++
src/generated/CPACSCabinGeometryContours.cpp | 135 +++
src/generated/CPACSCabinGeometryContours.h | 89 ++
src/generated/CPACSCabinSpace.cpp | 249 +++++
src/generated/CPACSCabinSpace.h | 122 +++
src/generated/CPACSCabinSpaces.cpp | 176 ++++
src/generated/CPACSCabinSpaces.h | 97 ++
src/generated/CPACSCargoContainer.cpp | 275 ++++++
src/generated/CPACSCargoContainer.h | 118 +++
src/generated/CPACSCargoContainerElement.cpp | 342 -------
src/generated/CPACSCargoContainerElement.h | 137 ---
src/generated/CPACSCargoContainerElements.cpp | 24 +-
src/generated/CPACSCargoContainerElements.h | 22 +-
src/generated/CPACSCargoContainers.cpp | 176 ++++
src/generated/CPACSCargoContainers.h | 97 ++
src/generated/CPACSCeilingPanelElements.cpp | 24 +-
src/generated/CPACSCeilingPanelElements.h | 22 +-
src/generated/CPACSCeilingPanels.cpp | 176 ++++
src/generated/CPACSCeilingPanels.h | 96 ++
src/generated/CPACSClassDividerElements.cpp | 24 +-
src/generated/CPACSClassDividerElements.h | 22 +-
src/generated/CPACSClassDividers.cpp | 176 ++++
src/generated/CPACSClassDividers.h | 98 ++
src/generated/CPACSDeck.cpp | 884 ++++++++++++++++++
src/generated/CPACSDeck.h | 260 ++++++
src/generated/CPACSDeckComponent2DBase.cpp | 79 +-
src/generated/CPACSDeckComponent2DBase.h | 49 +-
src/generated/CPACSDeckComponentBase.cpp | 338 +++++++
src/generated/CPACSDeckComponentBase.h | 158 ++++
src/generated/CPACSDeckDoor.cpp | 252 +++++
src/generated/CPACSDeckDoor.h | 123 +++
src/generated/CPACSDeckDoor_doorType.h | 64 ++
src/generated/CPACSDeckDoors.cpp | 176 ++++
src/generated/CPACSDeckDoors.h | 97 ++
src/generated/CPACSDeckElementBase.cpp | 297 ------
src/generated/CPACSDeckElementBase.h | 150 ---
src/generated/CPACSDeckElementGeometry.cpp | 239 -----
src/generated/CPACSDeckElementGeometry.h | 132 ---
src/generated/CPACSDeckElementMass.cpp | 280 ------
src/generated/CPACSDeckElementMass.h | 147 ---
src/generated/CPACSDeckStructuralMounts.cpp | 36 +-
src/generated/CPACSDeckStructuralMounts.h | 36 +-
src/generated/CPACSDeck_deckType.h | 64 ++
src/generated/CPACSDecks.cpp | 176 ++++
...enericGeometryComponent.h => CPACSDecks.h} | 57 +-
.../CPACSDoorAssemblyPosition_doorType.h | 6 +-
src/generated/CPACSDoorOpening.cpp | 213 +++++
src/generated/CPACSDoorOpening.h | 99 ++
src/generated/CPACSDoorOpeningLegacy.cpp | 189 ++++
src/generated/CPACSDoorOpeningLegacy.h | 108 +++
...ontour.h => CPACSDoorOpeningLegacy_side.h} | 26 +-
src/generated/CPACSDoubleVectorBase.cpp | 360 +++++++
src/generated/CPACSDoubleVectorBase.h | 164 ++++
src/generated/CPACSElementGeometry.cpp | 30 +
src/generated/CPACSElementGeometry.h | 12 +-
src/generated/CPACSElementMass.cpp | 30 +
src/generated/CPACSElementMass.h | 12 +-
src/generated/CPACSFuselage.cpp | 44 +
src/generated/CPACSFuselage.h | 9 +
src/generated/CPACSGalleyElement.cpp | 35 +-
src/generated/CPACSGalleyElement.h | 24 +-
src/generated/CPACSGalleys.cpp | 176 ++++
src/generated/CPACSGalleys.h | 98 ++
src/generated/CPACSGenericFloorElements.cpp | 24 +-
src/generated/CPACSGenericFloorElements.h | 22 +-
src/generated/CPACSGenericFloorModules.cpp | 176 ++++
src/generated/CPACSGenericFloorModules.h | 98 ++
.../CPACSGenericGeometryComponent.cpp | 139 ---
src/generated/CPACSLavatories.cpp | 176 ++++
src/generated/CPACSLavatories.h | 98 ++
src/generated/CPACSLavatoryElements.cpp | 24 +-
src/generated/CPACSLavatoryElements.h | 22 +-
src/generated/CPACSLinkToFile.cpp | 14 -
src/generated/CPACSLinkToFile.h | 8 +-
.../CPACSLuggageCompartmentElements.cpp | 24 +-
.../CPACSLuggageCompartmentElements.h | 22 +-
src/generated/CPACSLuggageCompartments.cpp | 176 ++++
src/generated/CPACSLuggageCompartments.h | 95 ++
src/generated/CPACSMassInertia.cpp | 34 +-
src/generated/CPACSMassInertia.h | 37 +-
src/generated/CPACSPoint.cpp | 30 -
src/generated/CPACSPoint.h | 12 +-
src/generated/CPACSSeatElement.cpp | 35 +-
src/generated/CPACSSeatElement.h | 24 +-
src/generated/CPACSSeatModules.cpp | 18 +-
src/generated/CPACSSeatModules.h | 13 +-
src/generated/CPACSSidewallPanelElements.cpp | 24 +-
src/generated/CPACSSidewallPanelElements.h | 22 +-
src/generated/CPACSSidewallPanels.cpp | 176 ++++
src/generated/CPACSSidewallPanels.h | 96 ++
src/generated/CPACSStructuralElements.cpp | 44 -
src/generated/CPACSStructuralElements.h | 17 -
src/generated/CPACSTransformation.cpp | 45 +-
src/generated/CPACSTransformation.h | 14 +-
src/generated/CPACSVehicleElementBase.cpp | 125 ++-
src/generated/CPACSVehicleElementBase.h | 61 +-
src/geometry/CCPACSTransformation.cpp | 25 +-
src/geometry/CCPACSTransformation.h | 5 +-
.../TestData/simpletest-decks.cpacs.xml | 157 ++++
119 files changed, 9897 insertions(+), 2961 deletions(-)
create mode 100644 src/decks/CCPACSDeck.cpp
create mode 100644 src/decks/CCPACSDeck.h
create mode 100644 src/decks/CCPACSDeckComponentBase.cpp
create mode 100644 src/decks/CCPACSDeckComponentBase.h
delete mode 100644 src/generated/CPACSBoundingBox.cpp
delete mode 100644 src/generated/CPACSBoundingBox.h
create mode 100644 src/generated/CPACSCabinAisle.cpp
create mode 100644 src/generated/CPACSCabinAisle.h
create mode 100644 src/generated/CPACSCabinAisles.cpp
create mode 100644 src/generated/CPACSCabinAisles.h
create mode 100644 src/generated/CPACSCabinGeometry.cpp
create mode 100644 src/generated/CPACSCabinGeometry.h
create mode 100644 src/generated/CPACSCabinGeometryContour.cpp
create mode 100644 src/generated/CPACSCabinGeometryContour.h
create mode 100644 src/generated/CPACSCabinGeometryContours.cpp
create mode 100644 src/generated/CPACSCabinGeometryContours.h
create mode 100644 src/generated/CPACSCabinSpace.cpp
create mode 100644 src/generated/CPACSCabinSpace.h
create mode 100644 src/generated/CPACSCabinSpaces.cpp
create mode 100644 src/generated/CPACSCabinSpaces.h
create mode 100644 src/generated/CPACSCargoContainer.cpp
create mode 100644 src/generated/CPACSCargoContainer.h
delete mode 100644 src/generated/CPACSCargoContainerElement.cpp
delete mode 100644 src/generated/CPACSCargoContainerElement.h
create mode 100644 src/generated/CPACSCargoContainers.cpp
create mode 100644 src/generated/CPACSCargoContainers.h
create mode 100644 src/generated/CPACSCeilingPanels.cpp
create mode 100644 src/generated/CPACSCeilingPanels.h
create mode 100644 src/generated/CPACSClassDividers.cpp
create mode 100644 src/generated/CPACSClassDividers.h
create mode 100644 src/generated/CPACSDeck.cpp
create mode 100644 src/generated/CPACSDeck.h
create mode 100644 src/generated/CPACSDeckComponentBase.cpp
create mode 100644 src/generated/CPACSDeckComponentBase.h
create mode 100644 src/generated/CPACSDeckDoor.cpp
create mode 100644 src/generated/CPACSDeckDoor.h
create mode 100644 src/generated/CPACSDeckDoor_doorType.h
create mode 100644 src/generated/CPACSDeckDoors.cpp
create mode 100644 src/generated/CPACSDeckDoors.h
delete mode 100644 src/generated/CPACSDeckElementBase.cpp
delete mode 100644 src/generated/CPACSDeckElementBase.h
delete mode 100644 src/generated/CPACSDeckElementGeometry.cpp
delete mode 100644 src/generated/CPACSDeckElementGeometry.h
delete mode 100644 src/generated/CPACSDeckElementMass.cpp
delete mode 100644 src/generated/CPACSDeckElementMass.h
create mode 100644 src/generated/CPACSDeck_deckType.h
create mode 100644 src/generated/CPACSDecks.cpp
rename src/generated/{CPACSGenericGeometryComponent.h => CPACSDecks.h} (52%)
create mode 100644 src/generated/CPACSDoorOpening.cpp
create mode 100644 src/generated/CPACSDoorOpening.h
create mode 100644 src/generated/CPACSDoorOpeningLegacy.cpp
create mode 100644 src/generated/CPACSDoorOpeningLegacy.h
rename src/generated/{CPACSCargoContainerElement_contour.h => CPACSDoorOpeningLegacy_side.h} (62%)
create mode 100644 src/generated/CPACSDoubleVectorBase.cpp
create mode 100644 src/generated/CPACSDoubleVectorBase.h
create mode 100644 src/generated/CPACSGalleys.cpp
create mode 100644 src/generated/CPACSGalleys.h
create mode 100644 src/generated/CPACSGenericFloorModules.cpp
create mode 100644 src/generated/CPACSGenericFloorModules.h
delete mode 100644 src/generated/CPACSGenericGeometryComponent.cpp
create mode 100644 src/generated/CPACSLavatories.cpp
create mode 100644 src/generated/CPACSLavatories.h
create mode 100644 src/generated/CPACSLuggageCompartments.cpp
create mode 100644 src/generated/CPACSLuggageCompartments.h
create mode 100644 src/generated/CPACSSidewallPanels.cpp
create mode 100644 src/generated/CPACSSidewallPanels.h
create mode 100644 tests/unittests/TestData/simpletest-decks.cpacs.xml
diff --git a/bindings/python_internal/configuration.i b/bindings/python_internal/configuration.i
index ab2a4fec95..01f180921e 100644
--- a/bindings/python_internal/configuration.i
+++ b/bindings/python_internal/configuration.i
@@ -153,6 +153,8 @@
#include "generated/CPACSSourceTarget.h"
#include "generated/CPACSSourceTarget_externalElement.h"
#include "generated/CPACSAtaChapterList.h"
+#include "CCPACSDeck.h"
+#include "generated/CPACSDecks.h"
%}
%feature("autodoc", "3");
@@ -406,6 +408,14 @@ namespace tigl
%include "CTiglAttachedRotorBlade.h"
%include "CPACSRotorHubHinge_type.h"
+
+// ---------------- Decks ------------------ //
+
+%boost_optional(tigl::CCPACSDecks)
+
+%include "generated/CPACSDecks.h"
+%include "CCPACSDeck.h"
+
// --------------- Fuselage tanks -----------------//
%boost_optional(tigl::generated::CPACSVessels)
%boost_optional(tigl::CCPACSVessels)
diff --git a/cpacs_gen_input/CustomTypes.txt b/cpacs_gen_input/CustomTypes.txt
index 0f11e3a21e..7697391f0c 100644
--- a/cpacs_gen_input/CustomTypes.txt
+++ b/cpacs_gen_input/CustomTypes.txt
@@ -51,6 +51,9 @@ CPACSFuselageSections CCPACSFuselageSections
CPACSFuselageElement CCPACSFuselageSectionElement
CPACSFuselageElements CCPACSFuselageSectionElements
+CPACSDeck CCPACSDeck
+CPACSDeckComponentBase CCPACSDeckComponentBase
+
CPACSComponentSegment CCPACSWingComponentSegment
CPACSComponentSegments CCPACSWingComponentSegments
CPACSWing CCPACSWing
diff --git a/cpacs_gen_input/PruneList.txt b/cpacs_gen_input/PruneList.txt
index aef71978c8..50e8a46949 100644
--- a/cpacs_gen_input/PruneList.txt
+++ b/cpacs_gen_input/PruneList.txt
@@ -44,7 +44,6 @@ CPACSControlLaws
CPACSReference
// in fuselage
-CPACSDecks
CPACSFuselageCutOuts
CPACSFuselageFuelTanks
CPACSCenterFuselageAreasAssembly
diff --git a/cpacs_gen_input/cpacs_schema.xsd b/cpacs_gen_input/cpacs_schema.xsd
index 132e70b9f7..db7545bd1d 100644
--- a/cpacs_gen_input/cpacs_schema.xsd
+++ b/cpacs_gen_input/cpacs_schema.xsd
@@ -25334,12 +25334,12 @@ The fuel tank volume type should also be used for the wing fuel tank
-
+
@@ -34853,7 +34853,7 @@ The fuel tank volume type should also be used for the wing fuel tank
-
+
@@ -35174,142 +35174,6 @@ The fuel tank volume type should also be used for the wing fuel tank
-
-
-
-
-
- Bounding Box
-
-
-
-
-
-
-
-
-
- Length in x
-
-
-
-
- Length in y
-
-
-
-
- Length in z
-
-
-
-
- Origin
-
-
-
-
-
-
-
-
-
-
-
-
- Geometry
-
-
- Description of the deck element geometry. This might be either a bounding box definition or a link to a generic geometry component.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Cargo container element for use in the decks
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Description
-
-
-
-
-
- Contour: single or double
-
-
-
-
-
-
-
-
-
-
-
-
- Delta x
-
-
-
-
-
- Delta y
-
-
-
-
-
- Delta y of the base
-
-
-
-
-
- Delta z
-
-
-
-
-
- Delta z kink
-
-
-
-
-
-
-
-
-
@@ -35326,7 +35190,7 @@ The fuel tank volume type should also be used for the wing fuel tank
-
+
@@ -35348,7 +35212,7 @@ The fuel tank volume type should also be used for the wing fuel tank
-
+
Ceiling panel element for use in the decks
@@ -35374,7 +35238,7 @@ The fuel tank volume type should also be used for the wing fuel tank
-
+
Class divider element for use in the decks
@@ -35400,47 +35264,47 @@ The fuel tank volume type should also be used for the wing fuel tank
-
+
Ceiling panel elements for use in the decks
-
+
Class divider elements for use in the decks
-
+
Galley elements for use in the decks
-
+
Generic floor elements for use in the decks
-
+
Lavatory elements for use in the decks
-
+
Luggage compartment elements for use in the decks
-
+
Seat elements for use in the decks
-
+
Sidewall panel elements for use in the decks
-
+
Cargo container elements for use in the decks
@@ -35464,22 +35328,14 @@ The fuel tank volume type should also be used for the wing fuel tank
-
-
-
-
- Description
-
-
-
-
-
+
+
+
Number of trolleys
-
-
+
@@ -35500,7 +35356,7 @@ The fuel tank volume type should also be used for the wing fuel tank
-
+
Galley element for use in the decks
@@ -35526,7 +35382,7 @@ The fuel tank volume type should also be used for the wing fuel tank
-
+
Lavatory element for use in the decks
@@ -35552,7 +35408,7 @@ The fuel tank volume type should also be used for the wing fuel tank
-
+
Luggage compartment element for use in the decks
@@ -35576,22 +35432,14 @@ The fuel tank volume type should also be used for the wing fuel tank
-
-
-
-
- Description
-
-
-
-
-
+
+
+
Number of seats
-
-
+
@@ -35612,7 +35460,7 @@ The fuel tank volume type should also be used for the wing fuel tank
-
+
Seat element for use in the decks
@@ -35638,7 +35486,7 @@ The fuel tank volume type should also be used for the wing fuel tank
-
+
Generic floor element for use in the decks
@@ -35664,7 +35512,7 @@ The fuel tank volume type should also be used for the wing fuel tank
-
+
Sidewall panel element for use in the decks
@@ -35674,29 +35522,6 @@ The fuel tank volume type should also be used for the wing fuel tank
-
-
-
-
-
- Generic geometry component
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -35769,66 +35594,6 @@ The fuel tank volume type should also be used for the wing fuel tank
-
-
-
-
-
- Deck element
-
-
-
-
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Mass
-
-
- Description of mass, center of gravity and inertia
-
-
-
-
-
-
-
-
-
-
- Mass value
-
-
-
-
- Center of gravity (x,y,z)
-
-
-
-
-
-
-
-
-
diff --git a/src/CCPACSPoint.cpp b/src/CCPACSPoint.cpp
index 93435ae41f..bef8cc3b6f 100644
--- a/src/CCPACSPoint.cpp
+++ b/src/CCPACSPoint.cpp
@@ -36,16 +36,6 @@ CCPACSPoint::CCPACSPoint(CCPACSPointList* parent, CTiglUIDManager* uidMgr)
{
}
-CCPACSPoint::CCPACSPoint(CCPACSBoundingBox* parent, CTiglUIDManager* uidMgr)
- : generated::CPACSPoint(parent, uidMgr)
-{
-}
-
-CCPACSPoint::CCPACSPoint(CCPACSDeckElementMass* parent, CTiglUIDManager* uidMgr)
- : generated::CPACSPoint(parent, uidMgr)
-{
-}
-
CCPACSPoint::CCPACSPoint(CCPACSTransformation* parent, CTiglUIDManager* uidMgr)
: generated::CPACSPoint(parent, uidMgr)
{
diff --git a/src/CCPACSPoint.h b/src/CCPACSPoint.h
index 48a350aea2..bcf31fee92 100644
--- a/src/CCPACSPoint.h
+++ b/src/CCPACSPoint.h
@@ -27,8 +27,6 @@ class CCPACSPoint : public generated::CPACSPoint
TIGL_EXPORT CCPACSPoint(CCPACSControlSurfaceStep* parent, CTiglUIDManager* uidMgr);
TIGL_EXPORT CCPACSPoint(CCPACSControlSurfaceHingePoint* parent, CTiglUIDManager* uidMgr);
TIGL_EXPORT CCPACSPoint(CCPACSPointList* parent, CTiglUIDManager* uidMgr);
- TIGL_EXPORT CCPACSPoint(CCPACSBoundingBox* parent, CTiglUIDManager* uidMgr);
- TIGL_EXPORT CCPACSPoint(CCPACSDeckElementMass* parent, CTiglUIDManager* uidMgr);
TIGL_EXPORT CCPACSPoint(CCPACSTransformation* parent, CTiglUIDManager* uidMgr);
TIGL_EXPORT CCPACSPoint(CCPACSTransformationSE3* parent, CTiglUIDManager* uidMgr);
TIGL_EXPORT CCPACSPoint(CCPACSElementMass* parent, CTiglUIDManager* uidMgr);
diff --git a/src/api/tigl.h b/src/api/tigl.h
index 3da140d8e8..125898d9b8 100644
--- a/src/api/tigl.h
+++ b/src/api/tigl.h
@@ -237,7 +237,8 @@ enum TiglGeometricComponentType
TIGL_COMPONENT_TANK = 27, /**< The Component is a fuel tank */
TIGL_COMPONENT_TANK_HULL = 28, /**< The Component is a vessel of a fuel tank */
TIGL_COMPONENT_SYSTEM_COMPONENT = 29, /**< The Component is a system component */
- TIGL_COMPONENT_OTHER = 30
+ TIGL_COMPONENT_DECK = 30, /**< The Component is a fuselage deck */
+ TIGL_COMPONENT_OTHER = 31
};
typedef enum TiglGeometricComponentType TiglGeometricComponentType;
diff --git a/src/decks/CCPACSDeck.cpp b/src/decks/CCPACSDeck.cpp
new file mode 100644
index 0000000000..e9f6204217
--- /dev/null
+++ b/src/decks/CCPACSDeck.cpp
@@ -0,0 +1,60 @@
+/*
+* Copyright (C) 2007-2026 German Aerospace Center (DLR/SC)
+*
+* Created: 2026-03-17 Marko Alder
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include "CCPACSDeck.h"
+#include "generated/CPACSDecks.h"
+#include "CCPACSFuselage.h"
+
+namespace tigl
+{
+
+// Constructor
+CCPACSDeck::CCPACSDeck(CCPACSDecks* parent, CTiglUIDManager* uidMgr)
+ : generated::CPACSDeck(parent, uidMgr)
+ , CTiglRelativelyPositionedComponent(
+ &m_parentUID,
+ &m_transformation) // ToDo: if m_parentUID is not given, the parent should be the parent fuselage
+{
+}
+
+// Destructor
+CCPACSDeck::~CCPACSDeck()
+{
+}
+
+std::string CCPACSDeck::GetDefaultedUID() const
+{
+ return GetUID();
+}
+
+// Returns the parent configuration
+CCPACSConfiguration& CCPACSDeck::GetConfiguration() const
+{
+ return m_parent->GetParent()->GetConfiguration();
+}
+
+// build loft
+PNamedShape CCPACSDeck::BuildLoft() const
+{
+ // ToDo: implement get shapes
+ PNamedShape groupedShape;
+
+ return groupedShape;
+}
+
+} // end namespace tigl
diff --git a/src/decks/CCPACSDeck.h b/src/decks/CCPACSDeck.h
new file mode 100644
index 0000000000..8b4ab2ee7b
--- /dev/null
+++ b/src/decks/CCPACSDeck.h
@@ -0,0 +1,58 @@
+/*
+* Copyright (C) 2007-2026 German Aerospace Center (DLR/SC)
+*
+* Created: 2026-03-17 Marko Alder
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#pragma once
+
+#include "generated/CPACSDeck.h"
+#include "CTiglRelativelyPositionedComponent.h"
+
+namespace tigl
+{
+
+class CCPACSConfiguration;
+
+class CCPACSDeck : public generated::CPACSDeck, public CTiglRelativelyPositionedComponent
+{
+public:
+ // Constructor
+ TIGL_EXPORT CCPACSDeck(CCPACSDecks* parent, CTiglUIDManager* uidMgr);
+
+ // Virtual destructor
+ TIGL_EXPORT virtual ~CCPACSDeck();
+
+ TIGL_EXPORT std::string GetDefaultedUID() const override;
+
+ // Returns the parent configuration
+ TIGL_EXPORT CCPACSConfiguration& GetConfiguration() const;
+
+ // Returns the Component Type TIGL_COMPONENT_GENERICSYSTEM.
+ TIGL_EXPORT TiglGeometricComponentType GetComponentType() const override
+ {
+ return TIGL_COMPONENT_DECK;
+ }
+ TIGL_EXPORT TiglGeometricComponentIntent GetComponentIntent() const override
+ {
+ return TIGL_INTENT_PHYSICAL;
+ }
+
+protected:
+ // Build the shape of the system
+ PNamedShape BuildLoft() const override;
+};
+
+} // end namespace tigl
diff --git a/src/decks/CCPACSDeckComponentBase.cpp b/src/decks/CCPACSDeckComponentBase.cpp
new file mode 100644
index 0000000000..d3d3af8a21
--- /dev/null
+++ b/src/decks/CCPACSDeckComponentBase.cpp
@@ -0,0 +1,235 @@
+/*
+* Copyright (C) 2007-2026 German Aerospace Center (DLR/SC)
+*
+* Created: 2026-03-17 Marko Alder
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include
+#include
+
+#include "CCPACSDeckComponentBase.h"
+#include "CCPACSDeck.h"
+#include "generated/CPACSVehicleElementBase.h"
+
+#include "CCPACSConfiguration.h"
+#include "CTiglUIDManager.h"
+#include "CTiglElementGeometryBuilder.h"
+#include "CTiglElementMassBuilder.h"
+#include "tiglcommonfunctions.h"
+#include "CPACSElementGeometry.h"
+#include "CPACSElementMass.h"
+
+
+
+#include "CNamedShape.h"
+
+namespace tigl
+{
+
+template
+static const CCPACSElementGeometry* ResolveGeometry(CTiglUIDManager& uidMgr, const std::string& uid)
+{
+ if (!uidMgr.IsType(uid)) {
+ return nullptr;
+ }
+ return &uidMgr.ResolveObject(uid).GetGeometry();
+}
+
+template
+static const CCPACSElementGeometry* GetGeomFromTypes(CTiglUIDManager& uidMgr, const std::string& uid)
+{
+ const CCPACSElementGeometry* g = nullptr;
+ ((g = g ? g : ResolveGeometry(uidMgr, uid)), ...);
+ return g;
+}
+
+static const CCPACSElementGeometry* GetGeometry(CTiglUIDManager& uidMgr, const std::string& uid)
+{
+ return GetGeomFromTypes(uidMgr, uid);
+}
+
+template
+static const boost::optional* ResolveMassDescription(CTiglUIDManager& uidMgr, const std::string& uid)
+{
+ if (!uidMgr.IsType(uid)) {
+ return nullptr;
+ }
+ return &uidMgr.ResolveObject(uid).GetMass();
+}
+
+template
+static const boost::optional* GetMassDescriptionFromTypes(CTiglUIDManager& uidMgr,
+ const std::string& uid)
+{
+ const boost::optional* m = nullptr;
+ ((m = m ? m : ResolveMassDescription(uidMgr, uid)), ...);
+ return m;
+}
+
+static const boost::optional* GetMassDescription(CTiglUIDManager& uidMgr, const std::string& uid)
+{
+ return GetMassDescriptionFromTypes(uidMgr, uid);
+}
+
+CCPACSDeckComponentBase::CCPACSDeckComponentBase(CCPACSCeilingPanels* parent, CTiglUIDManager* uidMgr)
+ : generated::CPACSDeckComponentBase(parent, uidMgr)
+ , CTiglRelativelyPositionedComponent(parent->GetParent(), &m_transformation)
+ , m_mass(*this, &CCPACSDeckComponentBase::BuildMass)
+ , m_parentDeck(parent->GetParent())
+{
+}
+
+CCPACSDeckComponentBase::CCPACSDeckComponentBase(CCPACSLuggageCompartments* parent, CTiglUIDManager* uidMgr)
+ : generated::CPACSDeckComponentBase(parent, uidMgr)
+ , CTiglRelativelyPositionedComponent(parent->GetParent(), &m_transformation)
+ , m_mass(*this, &CCPACSDeckComponentBase::BuildMass)
+ , m_parentDeck(parent->GetParent())
+{
+}
+
+CCPACSDeckComponentBase::CCPACSDeckComponentBase(CCPACSSidewallPanels* parent, CTiglUIDManager* uidMgr)
+ : generated::CPACSDeckComponentBase(parent, uidMgr)
+ , CTiglRelativelyPositionedComponent(parent->GetParent(), &m_transformation)
+ , m_mass(*this, &CCPACSDeckComponentBase::BuildMass)
+ , m_parentDeck(parent->GetParent())
+{
+}
+
+std::string CCPACSDeckComponentBase::GetDefaultedUID() const
+{
+ return generated::CPACSDeckComponentBase::GetUID();
+}
+
+CCPACSConfiguration const& CCPACSDeckComponentBase::GetConfiguration() const
+{
+ return m_parentDeck->GetConfiguration();
+}
+
+TiglGeometryRepresentation CCPACSDeckComponentBase::GetComponentRepresentation() const
+{
+ using CPACSGeomRep = generated::CPACSGeometryRepresentation;
+ const auto representation = GetElementGeometry().GetRepresentation().get_value_or(CPACSGeomRep::physical);
+
+ if (representation == CPACSGeomRep::physical) {
+ return TIGL_GEOMREP_PHYSICAL;
+ }
+ if (representation == CPACSGeomRep::envelope) {
+ return TIGL_GEOMREP_ENVELOPE;
+ }
+
+ throw CTiglError("Invalid geometry representation for component with uID \"" +
+ GetObjectUID().get_value_or("unnamed") + "\".");
+}
+
+std::string CCPACSDeckComponentBase::GetComponentRepresentationAsString() const
+{
+ switch (GetComponentRepresentation()) {
+ case TIGL_GEOMREP_PHYSICAL:
+ return "physical";
+ case TIGL_GEOMREP_ENVELOPE:
+ return "envelope";
+ }
+}
+
+void CCPACSDeckComponentBase::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& objectXPath)
+{
+ Reset();
+ generated::CPACSDeckComponentBase::ReadCPACS(tixiHandle, objectXPath);
+
+ char* cCPACSPath = NULL;
+ tixiGetDocumentPath(tixiHandle, &cCPACSPath);
+ _cpacsDocPath = cCPACSPath ? std::string(cCPACSPath) : std::string();
+}
+
+boost::optional CCPACSDeckComponentBase::GetMass() const
+{
+ return m_mass->mass;
+}
+
+boost::optional CCPACSDeckComponentBase::GetCenterOfGravityLocal() const
+{
+ return m_mass->cogLocal;
+}
+
+boost::optional CCPACSDeckComponentBase::GetCenterOfGravityGlobal() const
+{
+ const auto cogLocal = m_mass->cogLocal;
+ if (!IsPositioned()) {
+ LOG(WARNING) << "Global center of gravity of component \"" << GetObjectUID().get_value_or("unnamed")
+ << "\" is only available if is defined.";
+ return boost::none;
+ }
+ return GetTransformationMatrix() * (*cogLocal);
+}
+
+boost::optional CCPACSDeckComponentBase::GetMassInertiaLocal() const
+{
+ return m_mass->inertiaLocal;
+}
+
+bool CCPACSDeckComponentBase::IsPositioned() const
+{
+ return GetTransformation().is_initialized();
+}
+
+const CCPACSElementGeometry& CCPACSDeckComponentBase::GetElementGeometry() const
+{
+ const std::string deckElementUID = m_deckElementUID;
+ const CCPACSElementGeometry* const geom = GetGeometry(*m_uidMgr, deckElementUID);
+
+ if (!geom) {
+ throw CTiglError("Unsupported system element for uID \"" + deckElementUID + "\".");
+ }
+
+ return *geom;
+}
+
+PNamedShape CCPACSDeckComponentBase::BuildLoft() const
+{
+ const CCPACSElementGeometry& geom = GetElementGeometry();
+
+ // Use component UID as shape name
+ const std::string compName = this->GetObjectUID().get_value_or("unnamed");
+
+ // The builder works on the generic CTiglRelativelyPositionedComponent,
+ // therefore the CCPACSComponent-specific information (configuration, geometry, uID) needs to be extracted at this level
+ CTiglElementGeometryBuilder builder(*this, this->GetConfiguration(), geom, compName, _cpacsDocPath);
+ const PNamedShape shape = builder.BuildShape();
+
+ // Apply local transformation and return shape
+ return GetTransformationMatrix().Transform(shape);
+}
+
+void CCPACSDeckComponentBase::BuildMass(MassCache& cache) const
+{
+ const std::string uid = m_deckElementUID;
+
+ const auto* massPtr = GetMassDescription(*m_uidMgr, uid);
+ if (!massPtr || !*massPtr) {
+ LOG(WARNING) << "No mass definition for uid \"" + uid + "\"!";
+ return;
+ }
+
+ const CCPACSElementMass& massDef = massPtr->get();
+
+ CTiglElementMassBuilder builder(massDef, uid, GetLoft()->Shape());
+
+ const auto result = builder.EvaluateMass();
+ cache.mass = result.mass;
+ cache.cogLocal = result.cogLocal; //ToDo: is it really local?
+ cache.inertiaLocal = result.inertiaLocal;
+}
+
+} //namespace tigl
diff --git a/src/decks/CCPACSDeckComponentBase.h b/src/decks/CCPACSDeckComponentBase.h
new file mode 100644
index 0000000000..59c22b78b8
--- /dev/null
+++ b/src/decks/CCPACSDeckComponentBase.h
@@ -0,0 +1,188 @@
+/*
+* Copyright (C) 2007-2026 German Aerospace Center (DLR/SC)
+*
+* Created: 2026-03-17 Marko Alder
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#pragma once
+
+#include "generated/CPACSDeckComponentBase.h"
+#include "generated/CPACSMassInertia.h"
+#include "CTiglRelativelyPositionedComponent.h"
+#include "CTiglPoint.h"
+#include "CTiglMassInertia.h"
+
+namespace tigl
+{
+class CCPACSConfiguration;
+
+/**
+ * @brief Geometric component representing a CPACS within systems.
+ *
+ * A CCPACSComponent references a system element via @c systemElementUID and provides
+ * geometric and mass properties derived from that referenced element.
+ *
+ * Mass properties:
+ * - The mass can be given explicitly or computed from a density and the component volume.
+ * - The center of gravity (CoG) can be given explicitly via CPACS @c location.
+ * If not provided, it is derived from the geometric centroid of the component.
+ *
+ * Coordinate frames:
+ * - Local values (mass, CoG local) are expressed in the component's local coordinate system.
+ * - Global CoG is only available if the component is explicitly positioned via a
+ * CPACS @c element (see IsPositioned()).
+ */
+class CCPACSDeckComponentBase : public generated::CPACSDeckComponentBase, public CTiglRelativelyPositionedComponent
+{
+public:
+ /**
+ * @brief Constructs a CCPACSComponent.
+ * @param parent Parent CPACS container.
+ * @param uidMgr UID manager for resolving referenced system elements.
+ */
+ TIGL_EXPORT CCPACSDeckComponentBase(CCPACSCeilingPanels* parent, CTiglUIDManager* uidMgr);
+
+ TIGL_EXPORT CCPACSDeckComponentBase(CCPACSLuggageCompartments* parent, CTiglUIDManager* uidMgr);
+
+ TIGL_EXPORT CCPACSDeckComponentBase(CCPACSSidewallPanels* parent, CTiglUIDManager* uidMgr);
+
+ /**
+ * @brief Returns the component UID (defaulted if required).
+ */
+ TIGL_EXPORT std::string GetDefaultedUID() const override;
+
+ TIGL_EXPORT CCPACSConfiguration const& GetConfiguration() const;
+
+ /**
+ * @brief Reads the CPACS subtree of this component.
+ */
+ TIGL_EXPORT void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& objectXPath) override;
+
+ /// @brief Returns the TiGL geometric component type.
+ TIGL_EXPORT TiglGeometricComponentType GetComponentType() const override
+ {
+ return TIGL_COMPONENT_SYSTEM_COMPONENT;
+ }
+
+ /// @brief Returns the TiGL geometric component intent.
+ TIGL_EXPORT TiglGeometricComponentIntent GetComponentIntent() const override
+ {
+ return TIGL_INTENT_PHYSICAL;
+ }
+
+ /**
+ * @brief Returns the geometric representation type of the referenced system element.
+ *
+ * The representation is obtained from the referenced element geometry definition.
+ * It is returned as one of the TiGL constants
+ * @c TIGL_GEOMREP_PHYSICAL (1) or @c TIGL_GEOMREP_ENVELOPE (2).
+ * If no explicit representation is given in CPACS,
+ * @c TIGL_GEOMREP_PHYSICAL (1) is returned.
+ *
+ * @return Geometry representation type of the component.
+ */
+ TIGL_EXPORT TiglGeometryRepresentation GetComponentRepresentation() const;
+
+ /**
+ * @brief Returns the geometry representation of the referenced system element as string.
+ *
+ * Possible return values are:
+ * - @c "physical"
+ * - @c "envelope"
+ *
+ * If no explicit representation is given in CPACS, @c "physical" is returned.
+ *
+ * @return Geometry representation as human-readable string.
+ */
+ TIGL_EXPORT std::string GetComponentRepresentationAsString() const;
+
+ /**
+ * @brief Returns the component mass.
+ *
+ * The mass is obtained from the referenced system element:
+ * - If an explicit mass is provided in CPACS, it is returned.
+ * - Otherwise, if a density is provided, the mass is computed as density * volume.
+ * - If neither mass nor density is available, no mass value is returned.
+ *
+ * @return Component mass, or boost::none if the mass cannot be determined.
+ */
+ TIGL_EXPORT boost::optional GetMass() const;
+
+ /**
+ * @brief Returns the center of gravity in the component's local coordinate system.
+ *
+ * If a CPACS @c location is provided, that value is used.
+ * Otherwise, the geometric centroid of the component volume is computed.
+ *
+ * If the center of gravity cannot be determined (e.g., missing mass definition or
+ * zero-volume geometry), boost::none is returned.
+ *
+ * @return Local CoG (x, y, z), or boost::none if not available.
+ */
+ TIGL_EXPORT boost::optional GetCenterOfGravityLocal() const;
+
+ /**
+ * @brief Returns the center of gravity in the global coordinate system.
+ *
+ * The global CoG is obtained by applying the component transformation to the local CoG.
+ * This value is only available if the component is explicitly positioned
+ * (see IsPositioned()) and a local CoG exists.
+ *
+ * @return Global CoG, or boost::none if unavailable.
+ */
+ TIGL_EXPORT boost::optional GetCenterOfGravityGlobal() const;
+
+ /**
+ * @brief Returns the mass inertia tensor components in the local coordinate system.
+ *
+ * If a CPACS @c massInertia definition is present, its values are returned.
+ * Otherwise, boost::none is returned. Cross terms (Jxy, Jxz, Jyz) are optional
+ * as in the CPACS schema.
+ *
+ * @return Local mass inertia components, or boost::none if not defined.
+ */
+ TIGL_EXPORT boost::optional GetMassInertiaLocal() const;
+
+ /**
+ * @brief Returns whether this component is explicitly positioned in CPACS.
+ *
+ * This checks for the presence of the optional CPACS @c element
+ * under the component.
+ *
+ * @return true if an explicit transformation is present, false otherwise.
+ */
+ TIGL_EXPORT bool IsPositioned() const;
+
+protected:
+ virtual PNamedShape BuildLoft() const override;
+
+private:
+ std::string _cpacsDocPath;
+
+ struct MassCache {
+ boost::optional mass = boost::none;
+ boost::optional cogLocal = boost::none;
+ boost::optional inertiaLocal = boost::none;
+ };
+
+ const CCPACSElementGeometry& GetElementGeometry() const;
+
+ void BuildMass(MassCache& cache) const;
+ Cache m_mass;
+
+ const CCPACSDeck* m_parentDeck;
+};
+
+} // namespace tigl
diff --git a/src/generated/CPACSBoundingBox.cpp b/src/generated/CPACSBoundingBox.cpp
deleted file mode 100644
index 76152b8f62..0000000000
--- a/src/generated/CPACSBoundingBox.cpp
+++ /dev/null
@@ -1,206 +0,0 @@
-// Copyright (c) 2020 RISC Software GmbH
-//
-// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC).
-// Do not edit, all changes are lost when files are re-generated.
-//
-// Licensed under the Apache License, Version 2.0 (the "License")
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include
-#include "CPACSBoundingBox.h"
-#include "CPACSDeckElementGeometry.h"
-#include "CTiglError.h"
-#include "CTiglLogging.h"
-#include "CTiglUIDManager.h"
-#include "CTiglUIDObject.h"
-#include "TixiHelper.h"
-
-namespace tigl
-{
-namespace generated
-{
- CPACSBoundingBox::CPACSBoundingBox(CPACSDeckElementGeometry* parent, CTiglUIDManager* uidMgr)
- : m_uidMgr(uidMgr)
- , m_deltaX(0)
- , m_deltaY(0)
- , m_deltaZ(0)
- {
- //assert(parent != NULL);
- m_parent = parent;
- }
-
- CPACSBoundingBox::~CPACSBoundingBox()
- {
- }
-
- const CPACSDeckElementGeometry* CPACSBoundingBox::GetParent() const
- {
- return m_parent;
- }
-
- CPACSDeckElementGeometry* CPACSBoundingBox::GetParent()
- {
- return m_parent;
- }
-
- const CTiglUIDObject* CPACSBoundingBox::GetNextUIDParent() const
- {
- if (m_parent) {
- return m_parent->GetNextUIDParent();
- }
- return nullptr;
- }
-
- CTiglUIDObject* CPACSBoundingBox::GetNextUIDParent()
- {
- if (m_parent) {
- return m_parent->GetNextUIDParent();
- }
- return nullptr;
- }
-
- CTiglUIDManager& CPACSBoundingBox::GetUIDManager()
- {
- if (!m_uidMgr) {
- throw CTiglError("UIDManager is null");
- }
- return *m_uidMgr;
- }
-
- const CTiglUIDManager& CPACSBoundingBox::GetUIDManager() const
- {
- if (!m_uidMgr) {
- throw CTiglError("UIDManager is null");
- }
- return *m_uidMgr;
- }
-
- void CPACSBoundingBox::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath)
- {
- // read element deltaX
- if (tixi::TixiCheckElement(tixiHandle, xpath + "/deltaX")) {
- m_deltaX = tixi::TixiGetElement(tixiHandle, xpath + "/deltaX");
- }
- else {
- LOG(ERROR) << "Required element deltaX is missing at xpath " << xpath;
- }
-
- // read element deltaY
- if (tixi::TixiCheckElement(tixiHandle, xpath + "/deltaY")) {
- m_deltaY = tixi::TixiGetElement(tixiHandle, xpath + "/deltaY");
- }
- else {
- LOG(ERROR) << "Required element deltaY is missing at xpath " << xpath;
- }
-
- // read element deltaZ
- if (tixi::TixiCheckElement(tixiHandle, xpath + "/deltaZ")) {
- m_deltaZ = tixi::TixiGetElement(tixiHandle, xpath + "/deltaZ");
- }
- else {
- LOG(ERROR) << "Required element deltaZ is missing at xpath " << xpath;
- }
-
- // read element origin
- if (tixi::TixiCheckElement(tixiHandle, xpath + "/origin")) {
- m_origin = boost::in_place(this, m_uidMgr);
- try {
- m_origin->ReadCPACS(tixiHandle, xpath + "/origin");
- } catch(const std::exception& e) {
- LOG(ERROR) << "Failed to read origin at xpath " << xpath << ": " << e.what();
- m_origin = boost::none;
- }
- }
-
- }
-
- void CPACSBoundingBox::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const
- {
- // write element deltaX
- tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/deltaX");
- tixi::TixiSaveElement(tixiHandle, xpath + "/deltaX", m_deltaX);
-
- // write element deltaY
- tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/deltaY");
- tixi::TixiSaveElement(tixiHandle, xpath + "/deltaY", m_deltaY);
-
- // write element deltaZ
- tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/deltaZ");
- tixi::TixiSaveElement(tixiHandle, xpath + "/deltaZ", m_deltaZ);
-
- // write element origin
- if (m_origin) {
- tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/origin");
- m_origin->WriteCPACS(tixiHandle, xpath + "/origin");
- }
- else {
- if (tixi::TixiCheckElement(tixiHandle, xpath + "/origin")) {
- tixi::TixiRemoveElement(tixiHandle, xpath + "/origin");
- }
- }
-
- }
-
- const double& CPACSBoundingBox::GetDeltaX() const
- {
- return m_deltaX;
- }
-
- void CPACSBoundingBox::SetDeltaX(const double& value)
- {
- m_deltaX = value;
- }
-
- const double& CPACSBoundingBox::GetDeltaY() const
- {
- return m_deltaY;
- }
-
- void CPACSBoundingBox::SetDeltaY(const double& value)
- {
- m_deltaY = value;
- }
-
- const double& CPACSBoundingBox::GetDeltaZ() const
- {
- return m_deltaZ;
- }
-
- void CPACSBoundingBox::SetDeltaZ(const double& value)
- {
- m_deltaZ = value;
- }
-
- const boost::optional& CPACSBoundingBox::GetOrigin() const
- {
- return m_origin;
- }
-
- boost::optional& CPACSBoundingBox::GetOrigin()
- {
- return m_origin;
- }
-
- CCPACSPoint& CPACSBoundingBox::GetOrigin(CreateIfNotExistsTag)
- {
- if (!m_origin)
- m_origin = boost::in_place(this, m_uidMgr);
- return *m_origin;
- }
-
- void CPACSBoundingBox::RemoveOrigin()
- {
- m_origin = boost::none;
- }
-
-} // namespace generated
-} // namespace tigl
diff --git a/src/generated/CPACSBoundingBox.h b/src/generated/CPACSBoundingBox.h
deleted file mode 100644
index a3c08b868e..0000000000
--- a/src/generated/CPACSBoundingBox.h
+++ /dev/null
@@ -1,107 +0,0 @@
-// Copyright (c) 2020 RISC Software GmbH
-//
-// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC).
-// Do not edit, all changes are lost when files are re-generated.
-//
-// Licensed under the Apache License, Version 2.0 (the "License")
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#pragma once
-
-#include
-#include
-#include
-#include
-#include
-#include "CreateIfNotExists.h"
-#include "tigl_internal.h"
-
-namespace tigl
-{
-class CTiglUIDManager;
-class CTiglUIDObject;
-
-namespace generated
-{
- class CPACSDeckElementGeometry;
-
- // This class is used in:
- // CPACSDeckElementGeometry
-
- /// @brief Bounding Box
- ///
- ///
- class CPACSBoundingBox
- {
- public:
- TIGL_EXPORT CPACSBoundingBox(CPACSDeckElementGeometry* parent, CTiglUIDManager* uidMgr);
-
- TIGL_EXPORT virtual ~CPACSBoundingBox();
-
- TIGL_EXPORT CPACSDeckElementGeometry* GetParent();
-
- TIGL_EXPORT const CPACSDeckElementGeometry* GetParent() const;
-
- TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent();
- TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const;
-
- TIGL_EXPORT CTiglUIDManager& GetUIDManager();
- TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const;
-
- TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath);
- TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const;
-
- TIGL_EXPORT virtual const double& GetDeltaX() const;
- TIGL_EXPORT virtual void SetDeltaX(const double& value);
-
- TIGL_EXPORT virtual const double& GetDeltaY() const;
- TIGL_EXPORT virtual void SetDeltaY(const double& value);
-
- TIGL_EXPORT virtual const double& GetDeltaZ() const;
- TIGL_EXPORT virtual void SetDeltaZ(const double& value);
-
- TIGL_EXPORT virtual const boost::optional& GetOrigin() const;
- TIGL_EXPORT virtual boost::optional& GetOrigin();
-
- TIGL_EXPORT virtual CCPACSPoint& GetOrigin(CreateIfNotExistsTag);
- TIGL_EXPORT virtual void RemoveOrigin();
-
- protected:
- CPACSDeckElementGeometry* m_parent;
-
- CTiglUIDManager* m_uidMgr;
-
- /// Length in x
- double m_deltaX;
-
- /// Length in y
- double m_deltaY;
-
- /// Length in z
- double m_deltaZ;
-
- /// Origin
- boost::optional m_origin;
-
- private:
- CPACSBoundingBox(const CPACSBoundingBox&) = delete;
- CPACSBoundingBox& operator=(const CPACSBoundingBox&) = delete;
-
- CPACSBoundingBox(CPACSBoundingBox&&) = delete;
- CPACSBoundingBox& operator=(CPACSBoundingBox&&) = delete;
- };
-} // namespace generated
-
-// Aliases in tigl namespace
-using CCPACSBoundingBox = generated::CPACSBoundingBox;
-using CCPACSDeckElementGeometry = generated::CPACSDeckElementGeometry;
-} // namespace tigl
diff --git a/src/generated/CPACSCabinAisle.cpp b/src/generated/CPACSCabinAisle.cpp
new file mode 100644
index 0000000000..9e2bec36bc
--- /dev/null
+++ b/src/generated/CPACSCabinAisle.cpp
@@ -0,0 +1,249 @@
+// Copyright (c) 2020 RISC Software GmbH
+//
+// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC).
+// Do not edit, all changes are lost when files are re-generated.
+//
+// Licensed under the Apache License, Version 2.0 (the "License")
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include
+#include "CPACSCabinAisle.h"
+#include "CPACSCabinAisles.h"
+#include "CTiglError.h"
+#include "CTiglLogging.h"
+#include "CTiglUIDManager.h"
+#include "TixiHelper.h"
+
+namespace tigl
+{
+namespace generated
+{
+ CPACSCabinAisle::CPACSCabinAisle(CPACSCabinAisles* parent, CTiglUIDManager* uidMgr)
+ : m_uidMgr(uidMgr)
+ , m_x(this)
+ , m_y(this)
+ , m_widthY(this)
+ {
+ //assert(parent != NULL);
+ m_parent = parent;
+ }
+
+ CPACSCabinAisle::~CPACSCabinAisle()
+ {
+ if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID);
+ }
+
+ const CPACSCabinAisles* CPACSCabinAisle::GetParent() const
+ {
+ return m_parent;
+ }
+
+ CPACSCabinAisles* CPACSCabinAisle::GetParent()
+ {
+ return m_parent;
+ }
+
+ const CTiglUIDObject* CPACSCabinAisle::GetNextUIDParent() const
+ {
+ if (m_parent) {
+ return m_parent->GetNextUIDParent();
+ }
+ return nullptr;
+ }
+
+ CTiglUIDObject* CPACSCabinAisle::GetNextUIDParent()
+ {
+ if (m_parent) {
+ return m_parent->GetNextUIDParent();
+ }
+ return nullptr;
+ }
+
+ CTiglUIDManager& CPACSCabinAisle::GetUIDManager()
+ {
+ if (!m_uidMgr) {
+ throw CTiglError("UIDManager is null");
+ }
+ return *m_uidMgr;
+ }
+
+ const CTiglUIDManager& CPACSCabinAisle::GetUIDManager() const
+ {
+ if (!m_uidMgr) {
+ throw CTiglError("UIDManager is null");
+ }
+ return *m_uidMgr;
+ }
+
+ void CPACSCabinAisle::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath)
+ {
+ // read attribute uID
+ if (tixi::TixiCheckAttribute(tixiHandle, xpath, "uID")) {
+ m_uID = tixi::TixiGetAttribute(tixiHandle, xpath, "uID");
+ if (m_uID.empty()) {
+ LOG(WARNING) << "Required attribute uID is empty at xpath " << xpath;
+ }
+ }
+ else {
+ LOG(ERROR) << "Required attribute uID is missing at xpath " << xpath;
+ }
+
+ // read element name
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/name")) {
+ m_name = tixi::TixiGetElement(tixiHandle, xpath + "/name");
+ if (m_name.empty()) {
+ LOG(WARNING) << "Required element name is empty at xpath " << xpath;
+ }
+ }
+ else {
+ LOG(ERROR) << "Required element name is missing at xpath " << xpath;
+ }
+
+ // read element description
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) {
+ m_description = tixi::TixiGetElement(tixiHandle, xpath + "/description");
+ if (m_description->empty()) {
+ LOG(WARNING) << "Optional element description is present but empty at xpath " << xpath;
+ }
+ }
+
+ // read element x
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/x")) {
+ m_x.ReadCPACS(tixiHandle, xpath + "/x");
+ }
+ else {
+ LOG(ERROR) << "Required element x is missing at xpath " << xpath;
+ }
+
+ // read element y
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/y")) {
+ m_y.ReadCPACS(tixiHandle, xpath + "/y");
+ }
+ else {
+ LOG(ERROR) << "Required element y is missing at xpath " << xpath;
+ }
+
+ // read element widthY
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/widthY")) {
+ m_widthY.ReadCPACS(tixiHandle, xpath + "/widthY");
+ }
+ else {
+ LOG(ERROR) << "Required element widthY is missing at xpath " << xpath;
+ }
+
+ if (m_uidMgr && !m_uID.empty()) m_uidMgr->RegisterObject(m_uID, *this);
+ }
+
+ void CPACSCabinAisle::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const
+ {
+ // write attribute uID
+ tixi::TixiSaveAttribute(tixiHandle, xpath, "uID", m_uID);
+
+ // write element name
+ tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/name");
+ tixi::TixiSaveElement(tixiHandle, xpath + "/name", m_name);
+
+ // write element description
+ if (m_description) {
+ tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/description");
+ tixi::TixiSaveElement(tixiHandle, xpath + "/description", *m_description);
+ }
+ else {
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) {
+ tixi::TixiRemoveElement(tixiHandle, xpath + "/description");
+ }
+ }
+
+ // write element x
+ tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/x");
+ m_x.WriteCPACS(tixiHandle, xpath + "/x");
+
+ // write element y
+ tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/y");
+ m_y.WriteCPACS(tixiHandle, xpath + "/y");
+
+ // write element widthY
+ tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/widthY");
+ m_widthY.WriteCPACS(tixiHandle, xpath + "/widthY");
+
+ }
+
+ const std::string& CPACSCabinAisle::GetUID() const
+ {
+ return m_uID;
+ }
+
+ void CPACSCabinAisle::SetUID(const std::string& value)
+ {
+ if (m_uidMgr && value != m_uID) {
+ if (m_uID.empty()) {
+ m_uidMgr->RegisterObject(value, *this);
+ }
+ else {
+ m_uidMgr->UpdateObjectUID(m_uID, value);
+ }
+ }
+ m_uID = value;
+ }
+
+ const std::string& CPACSCabinAisle::GetName() const
+ {
+ return m_name;
+ }
+
+ void CPACSCabinAisle::SetName(const std::string& value)
+ {
+ m_name = value;
+ }
+
+ const boost::optional& CPACSCabinAisle::GetDescription() const
+ {
+ return m_description;
+ }
+
+ void CPACSCabinAisle::SetDescription(const boost::optional& value)
+ {
+ m_description = value;
+ }
+
+ const CPACSDoubleVectorBase& CPACSCabinAisle::GetX() const
+ {
+ return m_x;
+ }
+
+ CPACSDoubleVectorBase& CPACSCabinAisle::GetX()
+ {
+ return m_x;
+ }
+
+ const CPACSDoubleVectorBase& CPACSCabinAisle::GetY() const
+ {
+ return m_y;
+ }
+
+ CPACSDoubleVectorBase& CPACSCabinAisle::GetY()
+ {
+ return m_y;
+ }
+
+ const CPACSDoubleVectorBase& CPACSCabinAisle::GetWidthY() const
+ {
+ return m_widthY;
+ }
+
+ CPACSDoubleVectorBase& CPACSCabinAisle::GetWidthY()
+ {
+ return m_widthY;
+ }
+
+} // namespace generated
+} // namespace tigl
diff --git a/src/generated/CPACSCabinAisle.h b/src/generated/CPACSCabinAisle.h
new file mode 100644
index 0000000000..2c1ca76ade
--- /dev/null
+++ b/src/generated/CPACSCabinAisle.h
@@ -0,0 +1,122 @@
+// Copyright (c) 2020 RISC Software GmbH
+//
+// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC).
+// Do not edit, all changes are lost when files are re-generated.
+//
+// Licensed under the Apache License, Version 2.0 (the "License")
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#pragma once
+
+#include
+#include
+#include
+#include
+#include "CPACSDoubleVectorBase.h"
+#include "CTiglUIDObject.h"
+#include "tigl_internal.h"
+
+namespace tigl
+{
+class CTiglUIDManager;
+
+namespace generated
+{
+ class CPACSCabinAisles;
+
+ // This class is used in:
+ // CPACSCabinAisles
+
+ /// @brief Aisle
+ ///
+ /// Aisles has as many entries as there are aisles in the
+ /// cabin. In a normal single aisle there are two aisles: the cabin
+ /// aisle and the aisle leading to the cockpit.
+ ///
+ class CPACSCabinAisle : public CTiglReqUIDObject
+ {
+ public:
+ TIGL_EXPORT CPACSCabinAisle(CPACSCabinAisles* parent, CTiglUIDManager* uidMgr);
+
+ TIGL_EXPORT virtual ~CPACSCabinAisle();
+
+ TIGL_EXPORT CPACSCabinAisles* GetParent();
+
+ TIGL_EXPORT const CPACSCabinAisles* GetParent() const;
+
+ TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent();
+ TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const;
+
+ TIGL_EXPORT CTiglUIDManager& GetUIDManager();
+ TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const;
+
+ TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath);
+ TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const;
+
+ TIGL_EXPORT virtual const std::string& GetUID() const;
+ TIGL_EXPORT virtual void SetUID(const std::string& value);
+
+ TIGL_EXPORT virtual const std::string& GetName() const;
+ TIGL_EXPORT virtual void SetName(const std::string& value);
+
+ TIGL_EXPORT virtual const boost::optional& GetDescription() const;
+ TIGL_EXPORT virtual void SetDescription(const boost::optional& value);
+
+ TIGL_EXPORT virtual const CPACSDoubleVectorBase& GetX() const;
+ TIGL_EXPORT virtual CPACSDoubleVectorBase& GetX();
+
+ TIGL_EXPORT virtual const CPACSDoubleVectorBase& GetY() const;
+ TIGL_EXPORT virtual CPACSDoubleVectorBase& GetY();
+
+ TIGL_EXPORT virtual const CPACSDoubleVectorBase& GetWidthY() const;
+ TIGL_EXPORT virtual CPACSDoubleVectorBase& GetWidthY();
+
+ protected:
+ CPACSCabinAisles* m_parent;
+
+ CTiglUIDManager* m_uidMgr;
+
+ std::string m_uID;
+
+ /// Name
+ std::string m_name;
+
+ /// Description
+ boost::optional m_description;
+
+ /// Longitudinal coordinates. The
+ /// number of coordinates can be chosen as appropriate, the minimum
+ /// number is two. The coordinates are relative to the cabin origin.
+ CPACSDoubleVectorBase m_x;
+
+ /// Center points of the aisle. The
+ /// y-vector has to have same length as the x-vector. The aisle
+ /// stretches equally left and right of the provided y-coordinate.
+ CPACSDoubleVectorBase m_y;
+
+ /// Width of the aisle at floor level at each
+ /// y-coordinate
+ CPACSDoubleVectorBase m_widthY;
+
+ private:
+ CPACSCabinAisle(const CPACSCabinAisle&) = delete;
+ CPACSCabinAisle& operator=(const CPACSCabinAisle&) = delete;
+
+ CPACSCabinAisle(CPACSCabinAisle&&) = delete;
+ CPACSCabinAisle& operator=(CPACSCabinAisle&&) = delete;
+ };
+} // namespace generated
+
+// Aliases in tigl namespace
+using CCPACSCabinAisle = generated::CPACSCabinAisle;
+using CCPACSCabinAisles = generated::CPACSCabinAisles;
+} // namespace tigl
diff --git a/src/generated/CPACSCabinAisles.cpp b/src/generated/CPACSCabinAisles.cpp
new file mode 100644
index 0000000000..6b8b1c4aab
--- /dev/null
+++ b/src/generated/CPACSCabinAisles.cpp
@@ -0,0 +1,176 @@
+// Copyright (c) 2020 RISC Software GmbH
+//
+// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC).
+// Do not edit, all changes are lost when files are re-generated.
+//
+// Licensed under the Apache License, Version 2.0 (the "License")
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include
+#include "CCPACSDeck.h"
+#include "CPACSCabinAisle.h"
+#include "CPACSCabinAisles.h"
+#include "CTiglError.h"
+#include "CTiglLogging.h"
+#include "CTiglUIDManager.h"
+#include "CTiglUIDObject.h"
+#include "TixiHelper.h"
+
+namespace tigl
+{
+namespace generated
+{
+ CPACSCabinAisles::CPACSCabinAisles(CCPACSDeck* parent, CTiglUIDManager* uidMgr)
+ : m_uidMgr(uidMgr)
+ {
+ //assert(parent != NULL);
+ m_parent = parent;
+ }
+
+ CPACSCabinAisles::~CPACSCabinAisles()
+ {
+ }
+
+ const CCPACSDeck* CPACSCabinAisles::GetParent() const
+ {
+ return m_parent;
+ }
+
+ CCPACSDeck* CPACSCabinAisles::GetParent()
+ {
+ return m_parent;
+ }
+
+ const CTiglUIDObject* CPACSCabinAisles::GetNextUIDParent() const
+ {
+ return m_parent;
+ }
+
+ CTiglUIDObject* CPACSCabinAisles::GetNextUIDParent()
+ {
+ return m_parent;
+ }
+
+ CTiglUIDManager& CPACSCabinAisles::GetUIDManager()
+ {
+ if (!m_uidMgr) {
+ throw CTiglError("UIDManager is null");
+ }
+ return *m_uidMgr;
+ }
+
+ const CTiglUIDManager& CPACSCabinAisles::GetUIDManager() const
+ {
+ if (!m_uidMgr) {
+ throw CTiglError("UIDManager is null");
+ }
+ return *m_uidMgr;
+ }
+
+ void CPACSCabinAisles::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath)
+ {
+ // read element aisle
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/aisle")) {
+ tixi::TixiReadElements(tixiHandle, xpath + "/aisle", m_aisles, 1, tixi::xsdUnbounded, this, m_uidMgr);
+ }
+
+ }
+
+ void CPACSCabinAisles::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const
+ {
+ // write element aisle
+ tixi::TixiSaveElements(tixiHandle, xpath + "/aisle", m_aisles);
+
+ }
+
+ const std::vector>& CPACSCabinAisles::GetAisles() const
+ {
+ return m_aisles;
+ }
+
+ std::vector>& CPACSCabinAisles::GetAisles()
+ {
+ return m_aisles;
+ }
+
+ size_t CPACSCabinAisles::GetAisleCount() const
+ {
+ return m_aisles.size();
+ }
+
+ size_t CPACSCabinAisles::GetAisleIndex(const std::string& UID) const
+ {
+ for (size_t i=0; i < GetAisleCount(); i++) {
+ const std::string tmpUID(m_aisles[i]->GetUID());
+ if (tmpUID == UID) {
+ return i+1;
+ }
+ }
+ throw CTiglError("Invalid UID in CPACSCabinAisles::GetAisleIndex", TIGL_UID_ERROR);
+ }
+
+ CPACSCabinAisle& CPACSCabinAisles::GetAisle(size_t index)
+ {
+ if (index < 1 || index > GetAisleCount()) {
+ throw CTiglError("Invalid index in std::vector>::GetAisle", TIGL_INDEX_ERROR);
+ }
+ index--;
+ return *m_aisles[index];
+ }
+
+ const CPACSCabinAisle& CPACSCabinAisles::GetAisle(size_t index) const
+ {
+ if (index < 1 || index > GetAisleCount()) {
+ throw CTiglError("Invalid index in std::vector>::GetAisle", TIGL_INDEX_ERROR);
+ }
+ index--;
+ return *m_aisles[index];
+ }
+
+ CPACSCabinAisle& CPACSCabinAisles::GetAisle(const std::string& UID)
+ {
+ for (auto& elem : m_aisles ) {
+ if (elem->GetUID() == UID)
+ return *elem;
+ }
+ throw CTiglError("Invalid UID in CPACSCabinAisles::GetAisle. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR);
+ }
+
+ const CPACSCabinAisle& CPACSCabinAisles::GetAisle(const std::string& UID) const
+ {
+ for (auto& elem : m_aisles ) {
+ if (elem->GetUID() == UID)
+ return *elem;
+ }
+ throw CTiglError("Invalid UID in CPACSCabinAisles::GetAisle. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR);
+ }
+
+
+ CPACSCabinAisle& CPACSCabinAisles::AddAisle()
+ {
+ m_aisles.push_back(make_unique(this, m_uidMgr));
+ return *m_aisles.back();
+ }
+
+ void CPACSCabinAisles::RemoveAisle(CPACSCabinAisle& ref)
+ {
+ for (std::size_t i = 0; i < m_aisles.size(); i++) {
+ if (m_aisles[i].get() == &ref) {
+ m_aisles.erase(m_aisles.begin() + i);
+ return;
+ }
+ }
+ throw CTiglError("Element not found");
+ }
+
+} // namespace generated
+} // namespace tigl
diff --git a/src/generated/CPACSCabinAisles.h b/src/generated/CPACSCabinAisles.h
new file mode 100644
index 0000000000..54064ba123
--- /dev/null
+++ b/src/generated/CPACSCabinAisles.h
@@ -0,0 +1,97 @@
+// Copyright (c) 2020 RISC Software GmbH
+//
+// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC).
+// Do not edit, all changes are lost when files are re-generated.
+//
+// Licensed under the Apache License, Version 2.0 (the "License")
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#pragma once
+
+#include
+#include
+#include
+#include "tigl_internal.h"
+#include "UniquePtr.h"
+
+namespace tigl
+{
+class CTiglUIDManager;
+class CTiglUIDObject;
+class CCPACSDeck;
+
+namespace generated
+{
+ class CPACSCabinAisle;
+
+ // This class is used in:
+ // CPACSDeck
+
+ /// @brief Cabin aisles
+ ///
+ ///
+ ///
+ class CPACSCabinAisles
+ {
+ public:
+ TIGL_EXPORT CPACSCabinAisles(CCPACSDeck* parent, CTiglUIDManager* uidMgr);
+
+ TIGL_EXPORT virtual ~CPACSCabinAisles();
+
+ TIGL_EXPORT CCPACSDeck* GetParent();
+
+ TIGL_EXPORT const CCPACSDeck* GetParent() const;
+
+ TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent();
+ TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const;
+
+ TIGL_EXPORT CTiglUIDManager& GetUIDManager();
+ TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const;
+
+ TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath);
+ TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const;
+
+ TIGL_EXPORT virtual const std::vector>& GetAisles() const;
+ TIGL_EXPORT virtual std::vector>& GetAisles();
+
+ TIGL_EXPORT virtual size_t GetAisleCount() const;
+ TIGL_EXPORT virtual size_t GetAisleIndex(const std::string& UID) const;
+
+ TIGL_EXPORT virtual const CPACSCabinAisle& GetAisle(size_t index) const;
+ TIGL_EXPORT virtual CPACSCabinAisle& GetAisle(size_t index);
+
+ TIGL_EXPORT virtual const CPACSCabinAisle& GetAisle(const std::string& UID) const;
+ TIGL_EXPORT virtual CPACSCabinAisle& GetAisle(const std::string& UID);
+
+ TIGL_EXPORT virtual CPACSCabinAisle& AddAisle();
+ TIGL_EXPORT virtual void RemoveAisle(CPACSCabinAisle& ref);
+
+ protected:
+ CCPACSDeck* m_parent;
+
+ CTiglUIDManager* m_uidMgr;
+
+ std::vector> m_aisles;
+
+ private:
+ CPACSCabinAisles(const CPACSCabinAisles&) = delete;
+ CPACSCabinAisles& operator=(const CPACSCabinAisles&) = delete;
+
+ CPACSCabinAisles(CPACSCabinAisles&&) = delete;
+ CPACSCabinAisles& operator=(CPACSCabinAisles&&) = delete;
+ };
+} // namespace generated
+
+// Aliases in tigl namespace
+using CCPACSCabinAisles = generated::CPACSCabinAisles;
+using CCPACSCabinAisle = generated::CPACSCabinAisle;
+} // namespace tigl
diff --git a/src/generated/CPACSCabinGeometry.cpp b/src/generated/CPACSCabinGeometry.cpp
new file mode 100644
index 0000000000..d4443c6b55
--- /dev/null
+++ b/src/generated/CPACSCabinGeometry.cpp
@@ -0,0 +1,169 @@
+// Copyright (c) 2020 RISC Software GmbH
+//
+// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC).
+// Do not edit, all changes are lost when files are re-generated.
+//
+// Licensed under the Apache License, Version 2.0 (the "License")
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include
+#include "CCPACSDeck.h"
+#include "CPACSCabinGeometry.h"
+#include "CTiglError.h"
+#include "CTiglLogging.h"
+#include "CTiglUIDObject.h"
+#include "TixiHelper.h"
+
+namespace tigl
+{
+namespace generated
+{
+ CPACSCabinGeometry::CPACSCabinGeometry(CCPACSDeck* parent)
+ : m_contours(this)
+ , m_x(this)
+ {
+ //assert(parent != NULL);
+ m_parent = parent;
+ }
+
+ CPACSCabinGeometry::~CPACSCabinGeometry()
+ {
+ }
+
+ const CCPACSDeck* CPACSCabinGeometry::GetParent() const
+ {
+ return m_parent;
+ }
+
+ CCPACSDeck* CPACSCabinGeometry::GetParent()
+ {
+ return m_parent;
+ }
+
+ const CTiglUIDObject* CPACSCabinGeometry::GetNextUIDParent() const
+ {
+ return m_parent;
+ }
+
+ CTiglUIDObject* CPACSCabinGeometry::GetNextUIDParent()
+ {
+ return m_parent;
+ }
+
+ void CPACSCabinGeometry::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath)
+ {
+ // read element name
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/name")) {
+ m_name = tixi::TixiGetElement(tixiHandle, xpath + "/name");
+ if (m_name.empty()) {
+ LOG(WARNING) << "Required element name is empty at xpath " << xpath;
+ }
+ }
+ else {
+ LOG(ERROR) << "Required element name is missing at xpath " << xpath;
+ }
+
+ // read element description
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) {
+ m_description = tixi::TixiGetElement(tixiHandle, xpath + "/description");
+ if (m_description->empty()) {
+ LOG(WARNING) << "Optional element description is present but empty at xpath " << xpath;
+ }
+ }
+
+ // read element contours
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/contours")) {
+ m_contours.ReadCPACS(tixiHandle, xpath + "/contours");
+ }
+ else {
+ LOG(ERROR) << "Required element contours is missing at xpath " << xpath;
+ }
+
+ // read element x
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/x")) {
+ m_x.ReadCPACS(tixiHandle, xpath + "/x");
+ }
+ else {
+ LOG(ERROR) << "Required element x is missing at xpath " << xpath;
+ }
+
+ }
+
+ void CPACSCabinGeometry::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const
+ {
+ // write element name
+ tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/name");
+ tixi::TixiSaveElement(tixiHandle, xpath + "/name", m_name);
+
+ // write element description
+ if (m_description) {
+ tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/description");
+ tixi::TixiSaveElement(tixiHandle, xpath + "/description", *m_description);
+ }
+ else {
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) {
+ tixi::TixiRemoveElement(tixiHandle, xpath + "/description");
+ }
+ }
+
+ // write element contours
+ tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/contours");
+ m_contours.WriteCPACS(tixiHandle, xpath + "/contours");
+
+ // write element x
+ tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/x");
+ m_x.WriteCPACS(tixiHandle, xpath + "/x");
+
+ }
+
+ const std::string& CPACSCabinGeometry::GetName() const
+ {
+ return m_name;
+ }
+
+ void CPACSCabinGeometry::SetName(const std::string& value)
+ {
+ m_name = value;
+ }
+
+ const boost::optional& CPACSCabinGeometry::GetDescription() const
+ {
+ return m_description;
+ }
+
+ void CPACSCabinGeometry::SetDescription(const boost::optional& value)
+ {
+ m_description = value;
+ }
+
+ const CPACSCabinGeometryContours& CPACSCabinGeometry::GetContours() const
+ {
+ return m_contours;
+ }
+
+ CPACSCabinGeometryContours& CPACSCabinGeometry::GetContours()
+ {
+ return m_contours;
+ }
+
+ const CPACSDoubleVectorBase& CPACSCabinGeometry::GetX() const
+ {
+ return m_x;
+ }
+
+ CPACSDoubleVectorBase& CPACSCabinGeometry::GetX()
+ {
+ return m_x;
+ }
+
+} // namespace generated
+} // namespace tigl
diff --git a/src/generated/CPACSCabinGeometry.h b/src/generated/CPACSCabinGeometry.h
new file mode 100644
index 0000000000..54ff4b9189
--- /dev/null
+++ b/src/generated/CPACSCabinGeometry.h
@@ -0,0 +1,105 @@
+// Copyright (c) 2020 RISC Software GmbH
+//
+// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC).
+// Do not edit, all changes are lost when files are re-generated.
+//
+// Licensed under the Apache License, Version 2.0 (the "License")
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#pragma once
+
+#include
+#include
+#include
+#include
+#include "CPACSCabinGeometryContours.h"
+#include "CPACSDoubleVectorBase.h"
+#include "tigl_internal.h"
+
+namespace tigl
+{
+class CTiglUIDObject;
+class CCPACSDeck;
+
+namespace generated
+{
+ // This class is used in:
+ // CPACSDeck
+
+ /// @brief Geometry
+ ///
+ /// [ WARNING: This type is known to be susceptible to
+ /// inconsistencies and might therefore be removed in a future version of CPACS]
+ /// The geometry of the cabin roughly corresponds to the available design space in the cabin.
+ /// It is given in terms of constant height contour lines.
+ /// The lines all share a common x -vector.
+ /// The y vector provides the lateral
+ /// contour at Z-coordinate provided by the constant value z .
+ /// One or more contour lines can be given.
+ /// The cabin geometry is assumed to be symmetric.
+ /// @see deckContours
+ ///
+ class CPACSCabinGeometry
+ {
+ public:
+ TIGL_EXPORT CPACSCabinGeometry(CCPACSDeck* parent);
+
+ TIGL_EXPORT virtual ~CPACSCabinGeometry();
+
+ TIGL_EXPORT CCPACSDeck* GetParent();
+
+ TIGL_EXPORT const CCPACSDeck* GetParent() const;
+
+ TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent();
+ TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const;
+
+ TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath);
+ TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const;
+
+ TIGL_EXPORT virtual const std::string& GetName() const;
+ TIGL_EXPORT virtual void SetName(const std::string& value);
+
+ TIGL_EXPORT virtual const boost::optional& GetDescription() const;
+ TIGL_EXPORT virtual void SetDescription(const boost::optional& value);
+
+ TIGL_EXPORT virtual const CPACSCabinGeometryContours& GetContours() const;
+ TIGL_EXPORT virtual CPACSCabinGeometryContours& GetContours();
+
+ TIGL_EXPORT virtual const CPACSDoubleVectorBase& GetX() const;
+ TIGL_EXPORT virtual CPACSDoubleVectorBase& GetX();
+
+ protected:
+ CCPACSDeck* m_parent;
+
+ /// Name
+ std::string m_name;
+
+ /// Description
+ boost::optional m_description;
+
+ CPACSCabinGeometryContours m_contours;
+
+ /// Vector of x coordinates
+ CPACSDoubleVectorBase m_x;
+
+ private:
+ CPACSCabinGeometry(const CPACSCabinGeometry&) = delete;
+ CPACSCabinGeometry& operator=(const CPACSCabinGeometry&) = delete;
+
+ CPACSCabinGeometry(CPACSCabinGeometry&&) = delete;
+ CPACSCabinGeometry& operator=(CPACSCabinGeometry&&) = delete;
+ };
+} // namespace generated
+
+// Aliases in tigl namespace
+using CCPACSCabinGeometry = generated::CPACSCabinGeometry;
+} // namespace tigl
diff --git a/src/generated/CPACSCabinGeometryContour.cpp b/src/generated/CPACSCabinGeometryContour.cpp
new file mode 100644
index 0000000000..8a6b085060
--- /dev/null
+++ b/src/generated/CPACSCabinGeometryContour.cpp
@@ -0,0 +1,121 @@
+// Copyright (c) 2020 RISC Software GmbH
+//
+// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC).
+// Do not edit, all changes are lost when files are re-generated.
+//
+// Licensed under the Apache License, Version 2.0 (the "License")
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include
+#include "CPACSCabinGeometryContour.h"
+#include "CPACSCabinGeometryContours.h"
+#include "CTiglError.h"
+#include "CTiglLogging.h"
+#include "CTiglUIDObject.h"
+#include "TixiHelper.h"
+
+namespace tigl
+{
+namespace generated
+{
+ CPACSCabinGeometryContour::CPACSCabinGeometryContour(CPACSCabinGeometryContours* parent)
+ : m_y(this)
+ , m_z(0)
+ {
+ //assert(parent != NULL);
+ m_parent = parent;
+ }
+
+ CPACSCabinGeometryContour::~CPACSCabinGeometryContour()
+ {
+ }
+
+ const CPACSCabinGeometryContours* CPACSCabinGeometryContour::GetParent() const
+ {
+ return m_parent;
+ }
+
+ CPACSCabinGeometryContours* CPACSCabinGeometryContour::GetParent()
+ {
+ return m_parent;
+ }
+
+ const CTiglUIDObject* CPACSCabinGeometryContour::GetNextUIDParent() const
+ {
+ if (m_parent) {
+ return m_parent->GetNextUIDParent();
+ }
+ return nullptr;
+ }
+
+ CTiglUIDObject* CPACSCabinGeometryContour::GetNextUIDParent()
+ {
+ if (m_parent) {
+ return m_parent->GetNextUIDParent();
+ }
+ return nullptr;
+ }
+
+ void CPACSCabinGeometryContour::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath)
+ {
+ // read element y
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/y")) {
+ m_y.ReadCPACS(tixiHandle, xpath + "/y");
+ }
+ else {
+ LOG(ERROR) << "Required element y is missing at xpath " << xpath;
+ }
+
+ // read element z
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/z")) {
+ m_z = tixi::TixiGetElement(tixiHandle, xpath + "/z");
+ }
+ else {
+ LOG(ERROR) << "Required element z is missing at xpath " << xpath;
+ }
+
+ }
+
+ void CPACSCabinGeometryContour::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const
+ {
+ // write element y
+ tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/y");
+ m_y.WriteCPACS(tixiHandle, xpath + "/y");
+
+ // write element z
+ tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/z");
+ tixi::TixiSaveElement(tixiHandle, xpath + "/z", m_z);
+
+ }
+
+ const CPACSDoubleVectorBase& CPACSCabinGeometryContour::GetY() const
+ {
+ return m_y;
+ }
+
+ CPACSDoubleVectorBase& CPACSCabinGeometryContour::GetY()
+ {
+ return m_y;
+ }
+
+ const double& CPACSCabinGeometryContour::GetZ() const
+ {
+ return m_z;
+ }
+
+ void CPACSCabinGeometryContour::SetZ(const double& value)
+ {
+ m_z = value;
+ }
+
+} // namespace generated
+} // namespace tigl
diff --git a/src/generated/CPACSCabinGeometryContour.h b/src/generated/CPACSCabinGeometryContour.h
new file mode 100644
index 0000000000..6ea876d0cc
--- /dev/null
+++ b/src/generated/CPACSCabinGeometryContour.h
@@ -0,0 +1,85 @@
+// Copyright (c) 2020 RISC Software GmbH
+//
+// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC).
+// Do not edit, all changes are lost when files are re-generated.
+//
+// Licensed under the Apache License, Version 2.0 (the "License")
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#pragma once
+
+#include
+#include
+#include "CPACSDoubleVectorBase.h"
+#include "tigl_internal.h"
+
+namespace tigl
+{
+class CTiglUIDObject;
+
+namespace generated
+{
+ class CPACSCabinGeometryContours;
+
+ // This class is used in:
+ // CPACSCabinGeometryContours
+
+ /// @brief Cabin geometry contour
+ ///
+ /// Type to define a lateral position value "y" at a given height "z" (in the parent deck coordinate system)
+ /// for each entry "x" in the parent cabin geometry definition.
+ ///
+ class CPACSCabinGeometryContour
+ {
+ public:
+ TIGL_EXPORT CPACSCabinGeometryContour(CPACSCabinGeometryContours* parent);
+
+ TIGL_EXPORT virtual ~CPACSCabinGeometryContour();
+
+ TIGL_EXPORT CPACSCabinGeometryContours* GetParent();
+
+ TIGL_EXPORT const CPACSCabinGeometryContours* GetParent() const;
+
+ TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent();
+ TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const;
+
+ TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath);
+ TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const;
+
+ TIGL_EXPORT virtual const CPACSDoubleVectorBase& GetY() const;
+ TIGL_EXPORT virtual CPACSDoubleVectorBase& GetY();
+
+ TIGL_EXPORT virtual const double& GetZ() const;
+ TIGL_EXPORT virtual void SetZ(const double& value);
+
+ protected:
+ CPACSCabinGeometryContours* m_parent;
+
+ /// Vector with y-coordinates
+ CPACSDoubleVectorBase m_y;
+
+ /// Height z
+ double m_z;
+
+ private:
+ CPACSCabinGeometryContour(const CPACSCabinGeometryContour&) = delete;
+ CPACSCabinGeometryContour& operator=(const CPACSCabinGeometryContour&) = delete;
+
+ CPACSCabinGeometryContour(CPACSCabinGeometryContour&&) = delete;
+ CPACSCabinGeometryContour& operator=(CPACSCabinGeometryContour&&) = delete;
+ };
+} // namespace generated
+
+// Aliases in tigl namespace
+using CCPACSCabinGeometryContour = generated::CPACSCabinGeometryContour;
+using CCPACSCabinGeometryContours = generated::CPACSCabinGeometryContours;
+} // namespace tigl
diff --git a/src/generated/CPACSCabinGeometryContours.cpp b/src/generated/CPACSCabinGeometryContours.cpp
new file mode 100644
index 0000000000..bb376f4dc7
--- /dev/null
+++ b/src/generated/CPACSCabinGeometryContours.cpp
@@ -0,0 +1,135 @@
+// Copyright (c) 2020 RISC Software GmbH
+//
+// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC).
+// Do not edit, all changes are lost when files are re-generated.
+//
+// Licensed under the Apache License, Version 2.0 (the "License")
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include
+#include "CPACSCabinGeometry.h"
+#include "CPACSCabinGeometryContour.h"
+#include "CPACSCabinGeometryContours.h"
+#include "CTiglError.h"
+#include "CTiglLogging.h"
+#include "CTiglUIDObject.h"
+#include "TixiHelper.h"
+
+namespace tigl
+{
+namespace generated
+{
+ CPACSCabinGeometryContours::CPACSCabinGeometryContours(CPACSCabinGeometry* parent)
+ {
+ //assert(parent != NULL);
+ m_parent = parent;
+ }
+
+ CPACSCabinGeometryContours::~CPACSCabinGeometryContours()
+ {
+ }
+
+ const CPACSCabinGeometry* CPACSCabinGeometryContours::GetParent() const
+ {
+ return m_parent;
+ }
+
+ CPACSCabinGeometry* CPACSCabinGeometryContours::GetParent()
+ {
+ return m_parent;
+ }
+
+ const CTiglUIDObject* CPACSCabinGeometryContours::GetNextUIDParent() const
+ {
+ if (m_parent) {
+ return m_parent->GetNextUIDParent();
+ }
+ return nullptr;
+ }
+
+ CTiglUIDObject* CPACSCabinGeometryContours::GetNextUIDParent()
+ {
+ if (m_parent) {
+ return m_parent->GetNextUIDParent();
+ }
+ return nullptr;
+ }
+
+ void CPACSCabinGeometryContours::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath)
+ {
+ // read element contour
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/contour")) {
+ tixi::TixiReadElements(tixiHandle, xpath + "/contour", m_contours, 1, tixi::xsdUnbounded, this);
+ }
+
+ }
+
+ void CPACSCabinGeometryContours::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const
+ {
+ // write element contour
+ tixi::TixiSaveElements(tixiHandle, xpath + "/contour", m_contours);
+
+ }
+
+ const std::vector>& CPACSCabinGeometryContours::GetContours() const
+ {
+ return m_contours;
+ }
+
+ std::vector>& CPACSCabinGeometryContours::GetContours()
+ {
+ return m_contours;
+ }
+
+ size_t CPACSCabinGeometryContours::GetContourCount() const
+ {
+ return m_contours.size();
+ }
+
+ CPACSCabinGeometryContour& CPACSCabinGeometryContours::GetContour(size_t index)
+ {
+ if (index < 1 || index > GetContourCount()) {
+ throw CTiglError("Invalid index in std::vector>::GetContour", TIGL_INDEX_ERROR);
+ }
+ index--;
+ return *m_contours[index];
+ }
+
+ const CPACSCabinGeometryContour& CPACSCabinGeometryContours::GetContour(size_t index) const
+ {
+ if (index < 1 || index > GetContourCount()) {
+ throw CTiglError("Invalid index in std::vector>::GetContour", TIGL_INDEX_ERROR);
+ }
+ index--;
+ return *m_contours[index];
+ }
+
+
+ CPACSCabinGeometryContour& CPACSCabinGeometryContours::AddContour()
+ {
+ m_contours.push_back(make_unique(this));
+ return *m_contours.back();
+ }
+
+ void CPACSCabinGeometryContours::RemoveContour(CPACSCabinGeometryContour& ref)
+ {
+ for (std::size_t i = 0; i < m_contours.size(); i++) {
+ if (m_contours[i].get() == &ref) {
+ m_contours.erase(m_contours.begin() + i);
+ return;
+ }
+ }
+ throw CTiglError("Element not found");
+ }
+
+} // namespace generated
+} // namespace tigl
diff --git a/src/generated/CPACSCabinGeometryContours.h b/src/generated/CPACSCabinGeometryContours.h
new file mode 100644
index 0000000000..40281ab0cd
--- /dev/null
+++ b/src/generated/CPACSCabinGeometryContours.h
@@ -0,0 +1,89 @@
+// Copyright (c) 2020 RISC Software GmbH
+//
+// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC).
+// Do not edit, all changes are lost when files are re-generated.
+//
+// Licensed under the Apache License, Version 2.0 (the "License")
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#pragma once
+
+#include
+#include
+#include
+#include "tigl_internal.h"
+#include "UniquePtr.h"
+
+namespace tigl
+{
+class CTiglUIDObject;
+
+namespace generated
+{
+ class CPACSCabinGeometryContour;
+ class CPACSCabinGeometry;
+
+ // This class is used in:
+ // CPACSCabinGeometry
+
+ /// @brief Cabin geometry contours
+ ///
+ /// Cabin geometry contour line collection type. By providing more than one entry,
+ /// a 3D cabin space can be described.
+ ///
+ class CPACSCabinGeometryContours
+ {
+ public:
+ TIGL_EXPORT CPACSCabinGeometryContours(CPACSCabinGeometry* parent);
+
+ TIGL_EXPORT virtual ~CPACSCabinGeometryContours();
+
+ TIGL_EXPORT CPACSCabinGeometry* GetParent();
+
+ TIGL_EXPORT const CPACSCabinGeometry* GetParent() const;
+
+ TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent();
+ TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const;
+
+ TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath);
+ TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const;
+
+ TIGL_EXPORT virtual const std::vector>& GetContours() const;
+ TIGL_EXPORT virtual std::vector>& GetContours();
+
+ TIGL_EXPORT virtual size_t GetContourCount() const;
+
+ TIGL_EXPORT virtual const CPACSCabinGeometryContour& GetContour(size_t index) const;
+ TIGL_EXPORT virtual CPACSCabinGeometryContour& GetContour(size_t index);
+
+ TIGL_EXPORT virtual CPACSCabinGeometryContour& AddContour();
+ TIGL_EXPORT virtual void RemoveContour(CPACSCabinGeometryContour& ref);
+
+ protected:
+ CPACSCabinGeometry* m_parent;
+
+ std::vector> m_contours;
+
+ private:
+ CPACSCabinGeometryContours(const CPACSCabinGeometryContours&) = delete;
+ CPACSCabinGeometryContours& operator=(const CPACSCabinGeometryContours&) = delete;
+
+ CPACSCabinGeometryContours(CPACSCabinGeometryContours&&) = delete;
+ CPACSCabinGeometryContours& operator=(CPACSCabinGeometryContours&&) = delete;
+ };
+} // namespace generated
+
+// Aliases in tigl namespace
+using CCPACSCabinGeometryContours = generated::CPACSCabinGeometryContours;
+using CCPACSCabinGeometryContour = generated::CPACSCabinGeometryContour;
+using CCPACSCabinGeometry = generated::CPACSCabinGeometry;
+} // namespace tigl
diff --git a/src/generated/CPACSCabinSpace.cpp b/src/generated/CPACSCabinSpace.cpp
new file mode 100644
index 0000000000..6769022229
--- /dev/null
+++ b/src/generated/CPACSCabinSpace.cpp
@@ -0,0 +1,249 @@
+// Copyright (c) 2020 RISC Software GmbH
+//
+// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC).
+// Do not edit, all changes are lost when files are re-generated.
+//
+// Licensed under the Apache License, Version 2.0 (the "License")
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include
+#include "CPACSCabinSpace.h"
+#include "CPACSCabinSpaces.h"
+#include "CTiglError.h"
+#include "CTiglLogging.h"
+#include "CTiglUIDManager.h"
+#include "TixiHelper.h"
+
+namespace tigl
+{
+namespace generated
+{
+ CPACSCabinSpace::CPACSCabinSpace(CPACSCabinSpaces* parent, CTiglUIDManager* uidMgr)
+ : m_uidMgr(uidMgr)
+ , m_x(this)
+ , m_y(this)
+ , m_height(0)
+ {
+ //assert(parent != NULL);
+ m_parent = parent;
+ }
+
+ CPACSCabinSpace::~CPACSCabinSpace()
+ {
+ if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID);
+ }
+
+ const CPACSCabinSpaces* CPACSCabinSpace::GetParent() const
+ {
+ return m_parent;
+ }
+
+ CPACSCabinSpaces* CPACSCabinSpace::GetParent()
+ {
+ return m_parent;
+ }
+
+ const CTiglUIDObject* CPACSCabinSpace::GetNextUIDParent() const
+ {
+ if (m_parent) {
+ return m_parent->GetNextUIDParent();
+ }
+ return nullptr;
+ }
+
+ CTiglUIDObject* CPACSCabinSpace::GetNextUIDParent()
+ {
+ if (m_parent) {
+ return m_parent->GetNextUIDParent();
+ }
+ return nullptr;
+ }
+
+ CTiglUIDManager& CPACSCabinSpace::GetUIDManager()
+ {
+ if (!m_uidMgr) {
+ throw CTiglError("UIDManager is null");
+ }
+ return *m_uidMgr;
+ }
+
+ const CTiglUIDManager& CPACSCabinSpace::GetUIDManager() const
+ {
+ if (!m_uidMgr) {
+ throw CTiglError("UIDManager is null");
+ }
+ return *m_uidMgr;
+ }
+
+ void CPACSCabinSpace::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath)
+ {
+ // read attribute uID
+ if (tixi::TixiCheckAttribute(tixiHandle, xpath, "uID")) {
+ m_uID = tixi::TixiGetAttribute(tixiHandle, xpath, "uID");
+ if (m_uID.empty()) {
+ LOG(WARNING) << "Required attribute uID is empty at xpath " << xpath;
+ }
+ }
+ else {
+ LOG(ERROR) << "Required attribute uID is missing at xpath " << xpath;
+ }
+
+ // read element name
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/name")) {
+ m_name = tixi::TixiGetElement(tixiHandle, xpath + "/name");
+ if (m_name.empty()) {
+ LOG(WARNING) << "Required element name is empty at xpath " << xpath;
+ }
+ }
+ else {
+ LOG(ERROR) << "Required element name is missing at xpath " << xpath;
+ }
+
+ // read element description
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) {
+ m_description = tixi::TixiGetElement(tixiHandle, xpath + "/description");
+ if (m_description->empty()) {
+ LOG(WARNING) << "Optional element description is present but empty at xpath " << xpath;
+ }
+ }
+
+ // read element x
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/x")) {
+ m_x.ReadCPACS(tixiHandle, xpath + "/x");
+ }
+ else {
+ LOG(ERROR) << "Required element x is missing at xpath " << xpath;
+ }
+
+ // read element y
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/y")) {
+ m_y.ReadCPACS(tixiHandle, xpath + "/y");
+ }
+ else {
+ LOG(ERROR) << "Required element y is missing at xpath " << xpath;
+ }
+
+ // read element height
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/height")) {
+ m_height = tixi::TixiGetElement(tixiHandle, xpath + "/height");
+ }
+ else {
+ LOG(ERROR) << "Required element height is missing at xpath " << xpath;
+ }
+
+ if (m_uidMgr && !m_uID.empty()) m_uidMgr->RegisterObject(m_uID, *this);
+ }
+
+ void CPACSCabinSpace::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const
+ {
+ // write attribute uID
+ tixi::TixiSaveAttribute(tixiHandle, xpath, "uID", m_uID);
+
+ // write element name
+ tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/name");
+ tixi::TixiSaveElement(tixiHandle, xpath + "/name", m_name);
+
+ // write element description
+ if (m_description) {
+ tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/description");
+ tixi::TixiSaveElement(tixiHandle, xpath + "/description", *m_description);
+ }
+ else {
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) {
+ tixi::TixiRemoveElement(tixiHandle, xpath + "/description");
+ }
+ }
+
+ // write element x
+ tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/x");
+ m_x.WriteCPACS(tixiHandle, xpath + "/x");
+
+ // write element y
+ tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/y");
+ m_y.WriteCPACS(tixiHandle, xpath + "/y");
+
+ // write element height
+ tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/height");
+ tixi::TixiSaveElement(tixiHandle, xpath + "/height", m_height);
+
+ }
+
+ const std::string& CPACSCabinSpace::GetUID() const
+ {
+ return m_uID;
+ }
+
+ void CPACSCabinSpace::SetUID(const std::string& value)
+ {
+ if (m_uidMgr && value != m_uID) {
+ if (m_uID.empty()) {
+ m_uidMgr->RegisterObject(value, *this);
+ }
+ else {
+ m_uidMgr->UpdateObjectUID(m_uID, value);
+ }
+ }
+ m_uID = value;
+ }
+
+ const std::string& CPACSCabinSpace::GetName() const
+ {
+ return m_name;
+ }
+
+ void CPACSCabinSpace::SetName(const std::string& value)
+ {
+ m_name = value;
+ }
+
+ const boost::optional& CPACSCabinSpace::GetDescription() const
+ {
+ return m_description;
+ }
+
+ void CPACSCabinSpace::SetDescription(const boost::optional& value)
+ {
+ m_description = value;
+ }
+
+ const CPACSDoubleVectorBase& CPACSCabinSpace::GetX() const
+ {
+ return m_x;
+ }
+
+ CPACSDoubleVectorBase& CPACSCabinSpace::GetX()
+ {
+ return m_x;
+ }
+
+ const CPACSDoubleVectorBase& CPACSCabinSpace::GetY() const
+ {
+ return m_y;
+ }
+
+ CPACSDoubleVectorBase& CPACSCabinSpace::GetY()
+ {
+ return m_y;
+ }
+
+ const double& CPACSCabinSpace::GetHeight() const
+ {
+ return m_height;
+ }
+
+ void CPACSCabinSpace::SetHeight(const double& value)
+ {
+ m_height = value;
+ }
+
+} // namespace generated
+} // namespace tigl
diff --git a/src/generated/CPACSCabinSpace.h b/src/generated/CPACSCabinSpace.h
new file mode 100644
index 0000000000..1c0a011f01
--- /dev/null
+++ b/src/generated/CPACSCabinSpace.h
@@ -0,0 +1,122 @@
+// Copyright (c) 2020 RISC Software GmbH
+//
+// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC).
+// Do not edit, all changes are lost when files are re-generated.
+//
+// Licensed under the Apache License, Version 2.0 (the "License")
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#pragma once
+
+#include
+#include
+#include
+#include
+#include "CPACSDoubleVectorBase.h"
+#include "CTiglUIDObject.h"
+#include "tigl_internal.h"
+
+namespace tigl
+{
+class CTiglUIDManager;
+
+namespace generated
+{
+ class CPACSCabinSpaces;
+
+ // This class is used in:
+ // CPACSCabinSpaces
+
+ /// @brief Space
+ ///
+ /// spaces describe areas in the cabin that need to be
+ /// clear for use as emergency area. Depending on the type of area,
+ /// it can have a height limit. The spaces are required for
+ /// downstream cabin design, for example to describe an empty cabin.
+ ///
+ class CPACSCabinSpace : public CTiglReqUIDObject
+ {
+ public:
+ TIGL_EXPORT CPACSCabinSpace(CPACSCabinSpaces* parent, CTiglUIDManager* uidMgr);
+
+ TIGL_EXPORT virtual ~CPACSCabinSpace();
+
+ TIGL_EXPORT CPACSCabinSpaces* GetParent();
+
+ TIGL_EXPORT const CPACSCabinSpaces* GetParent() const;
+
+ TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent();
+ TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const;
+
+ TIGL_EXPORT CTiglUIDManager& GetUIDManager();
+ TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const;
+
+ TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath);
+ TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const;
+
+ TIGL_EXPORT virtual const std::string& GetUID() const;
+ TIGL_EXPORT virtual void SetUID(const std::string& value);
+
+ TIGL_EXPORT virtual const std::string& GetName() const;
+ TIGL_EXPORT virtual void SetName(const std::string& value);
+
+ TIGL_EXPORT virtual const boost::optional& GetDescription() const;
+ TIGL_EXPORT virtual void SetDescription(const boost::optional& value);
+
+ TIGL_EXPORT virtual const CPACSDoubleVectorBase& GetX() const;
+ TIGL_EXPORT virtual CPACSDoubleVectorBase& GetX();
+
+ TIGL_EXPORT virtual const CPACSDoubleVectorBase& GetY() const;
+ TIGL_EXPORT virtual CPACSDoubleVectorBase& GetY();
+
+ TIGL_EXPORT virtual const double& GetHeight() const;
+ TIGL_EXPORT virtual void SetHeight(const double& value);
+
+ protected:
+ CPACSCabinSpaces* m_parent;
+
+ CTiglUIDManager* m_uidMgr;
+
+ std::string m_uID;
+
+ /// Name
+ std::string m_name;
+
+ /// Description
+ boost::optional m_description;
+
+ /// Vector with x-coordinates. These describe an area, so they
+ /// are not monotonous ascending.
+ CPACSDoubleVectorBase m_x;
+
+ /// Vector with y-coordinates at given x-coordinates. Warning:
+ /// x-y do not represent a function as single x-positions can have
+ /// multiple y-coordinates. Hence, no interpolation is possible.
+ CPACSDoubleVectorBase m_y;
+
+ /// Height above the floor that is required to
+ /// be empty of any objects
+ double m_height;
+
+ private:
+ CPACSCabinSpace(const CPACSCabinSpace&) = delete;
+ CPACSCabinSpace& operator=(const CPACSCabinSpace&) = delete;
+
+ CPACSCabinSpace(CPACSCabinSpace&&) = delete;
+ CPACSCabinSpace& operator=(CPACSCabinSpace&&) = delete;
+ };
+} // namespace generated
+
+// Aliases in tigl namespace
+using CCPACSCabinSpace = generated::CPACSCabinSpace;
+using CCPACSCabinSpaces = generated::CPACSCabinSpaces;
+} // namespace tigl
diff --git a/src/generated/CPACSCabinSpaces.cpp b/src/generated/CPACSCabinSpaces.cpp
new file mode 100644
index 0000000000..69e76f8fad
--- /dev/null
+++ b/src/generated/CPACSCabinSpaces.cpp
@@ -0,0 +1,176 @@
+// Copyright (c) 2020 RISC Software GmbH
+//
+// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC).
+// Do not edit, all changes are lost when files are re-generated.
+//
+// Licensed under the Apache License, Version 2.0 (the "License")
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include
+#include "CCPACSDeck.h"
+#include "CPACSCabinSpace.h"
+#include "CPACSCabinSpaces.h"
+#include "CTiglError.h"
+#include "CTiglLogging.h"
+#include "CTiglUIDManager.h"
+#include "CTiglUIDObject.h"
+#include "TixiHelper.h"
+
+namespace tigl
+{
+namespace generated
+{
+ CPACSCabinSpaces::CPACSCabinSpaces(CCPACSDeck* parent, CTiglUIDManager* uidMgr)
+ : m_uidMgr(uidMgr)
+ {
+ //assert(parent != NULL);
+ m_parent = parent;
+ }
+
+ CPACSCabinSpaces::~CPACSCabinSpaces()
+ {
+ }
+
+ const CCPACSDeck* CPACSCabinSpaces::GetParent() const
+ {
+ return m_parent;
+ }
+
+ CCPACSDeck* CPACSCabinSpaces::GetParent()
+ {
+ return m_parent;
+ }
+
+ const CTiglUIDObject* CPACSCabinSpaces::GetNextUIDParent() const
+ {
+ return m_parent;
+ }
+
+ CTiglUIDObject* CPACSCabinSpaces::GetNextUIDParent()
+ {
+ return m_parent;
+ }
+
+ CTiglUIDManager& CPACSCabinSpaces::GetUIDManager()
+ {
+ if (!m_uidMgr) {
+ throw CTiglError("UIDManager is null");
+ }
+ return *m_uidMgr;
+ }
+
+ const CTiglUIDManager& CPACSCabinSpaces::GetUIDManager() const
+ {
+ if (!m_uidMgr) {
+ throw CTiglError("UIDManager is null");
+ }
+ return *m_uidMgr;
+ }
+
+ void CPACSCabinSpaces::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath)
+ {
+ // read element space
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/space")) {
+ tixi::TixiReadElements(tixiHandle, xpath + "/space", m_spaces, 1, tixi::xsdUnbounded, this, m_uidMgr);
+ }
+
+ }
+
+ void CPACSCabinSpaces::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const
+ {
+ // write element space
+ tixi::TixiSaveElements(tixiHandle, xpath + "/space", m_spaces);
+
+ }
+
+ const std::vector>& CPACSCabinSpaces::GetSpaces() const
+ {
+ return m_spaces;
+ }
+
+ std::vector>& CPACSCabinSpaces::GetSpaces()
+ {
+ return m_spaces;
+ }
+
+ size_t CPACSCabinSpaces::GetSpaceCount() const
+ {
+ return m_spaces.size();
+ }
+
+ size_t CPACSCabinSpaces::GetSpaceIndex(const std::string& UID) const
+ {
+ for (size_t i=0; i < GetSpaceCount(); i++) {
+ const std::string tmpUID(m_spaces[i]->GetUID());
+ if (tmpUID == UID) {
+ return i+1;
+ }
+ }
+ throw CTiglError("Invalid UID in CPACSCabinSpaces::GetSpaceIndex", TIGL_UID_ERROR);
+ }
+
+ CPACSCabinSpace& CPACSCabinSpaces::GetSpace(size_t index)
+ {
+ if (index < 1 || index > GetSpaceCount()) {
+ throw CTiglError("Invalid index in std::vector>::GetSpace", TIGL_INDEX_ERROR);
+ }
+ index--;
+ return *m_spaces[index];
+ }
+
+ const CPACSCabinSpace& CPACSCabinSpaces::GetSpace(size_t index) const
+ {
+ if (index < 1 || index > GetSpaceCount()) {
+ throw CTiglError("Invalid index in std::vector>::GetSpace", TIGL_INDEX_ERROR);
+ }
+ index--;
+ return *m_spaces[index];
+ }
+
+ CPACSCabinSpace& CPACSCabinSpaces::GetSpace(const std::string& UID)
+ {
+ for (auto& elem : m_spaces ) {
+ if (elem->GetUID() == UID)
+ return *elem;
+ }
+ throw CTiglError("Invalid UID in CPACSCabinSpaces::GetSpace. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR);
+ }
+
+ const CPACSCabinSpace& CPACSCabinSpaces::GetSpace(const std::string& UID) const
+ {
+ for (auto& elem : m_spaces ) {
+ if (elem->GetUID() == UID)
+ return *elem;
+ }
+ throw CTiglError("Invalid UID in CPACSCabinSpaces::GetSpace. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR);
+ }
+
+
+ CPACSCabinSpace& CPACSCabinSpaces::AddSpace()
+ {
+ m_spaces.push_back(make_unique(this, m_uidMgr));
+ return *m_spaces.back();
+ }
+
+ void CPACSCabinSpaces::RemoveSpace(CPACSCabinSpace& ref)
+ {
+ for (std::size_t i = 0; i < m_spaces.size(); i++) {
+ if (m_spaces[i].get() == &ref) {
+ m_spaces.erase(m_spaces.begin() + i);
+ return;
+ }
+ }
+ throw CTiglError("Element not found");
+ }
+
+} // namespace generated
+} // namespace tigl
diff --git a/src/generated/CPACSCabinSpaces.h b/src/generated/CPACSCabinSpaces.h
new file mode 100644
index 0000000000..0a58973dd8
--- /dev/null
+++ b/src/generated/CPACSCabinSpaces.h
@@ -0,0 +1,97 @@
+// Copyright (c) 2020 RISC Software GmbH
+//
+// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC).
+// Do not edit, all changes are lost when files are re-generated.
+//
+// Licensed under the Apache License, Version 2.0 (the "License")
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#pragma once
+
+#include
+#include
+#include
+#include "tigl_internal.h"
+#include "UniquePtr.h"
+
+namespace tigl
+{
+class CTiglUIDManager;
+class CTiglUIDObject;
+class CCPACSDeck;
+
+namespace generated
+{
+ class CPACSCabinSpace;
+
+ // This class is used in:
+ // CPACSDeck
+
+ /// @brief Cabin spaces
+ ///
+ ///
+ ///
+ class CPACSCabinSpaces
+ {
+ public:
+ TIGL_EXPORT CPACSCabinSpaces(CCPACSDeck* parent, CTiglUIDManager* uidMgr);
+
+ TIGL_EXPORT virtual ~CPACSCabinSpaces();
+
+ TIGL_EXPORT CCPACSDeck* GetParent();
+
+ TIGL_EXPORT const CCPACSDeck* GetParent() const;
+
+ TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent();
+ TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const;
+
+ TIGL_EXPORT CTiglUIDManager& GetUIDManager();
+ TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const;
+
+ TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath);
+ TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const;
+
+ TIGL_EXPORT virtual const std::vector>& GetSpaces() const;
+ TIGL_EXPORT virtual std::vector>& GetSpaces();
+
+ TIGL_EXPORT virtual size_t GetSpaceCount() const;
+ TIGL_EXPORT virtual size_t GetSpaceIndex(const std::string& UID) const;
+
+ TIGL_EXPORT virtual const CPACSCabinSpace& GetSpace(size_t index) const;
+ TIGL_EXPORT virtual CPACSCabinSpace& GetSpace(size_t index);
+
+ TIGL_EXPORT virtual const CPACSCabinSpace& GetSpace(const std::string& UID) const;
+ TIGL_EXPORT virtual CPACSCabinSpace& GetSpace(const std::string& UID);
+
+ TIGL_EXPORT virtual CPACSCabinSpace& AddSpace();
+ TIGL_EXPORT virtual void RemoveSpace(CPACSCabinSpace& ref);
+
+ protected:
+ CCPACSDeck* m_parent;
+
+ CTiglUIDManager* m_uidMgr;
+
+ std::vector> m_spaces;
+
+ private:
+ CPACSCabinSpaces(const CPACSCabinSpaces&) = delete;
+ CPACSCabinSpaces& operator=(const CPACSCabinSpaces&) = delete;
+
+ CPACSCabinSpaces(CPACSCabinSpaces&&) = delete;
+ CPACSCabinSpaces& operator=(CPACSCabinSpaces&&) = delete;
+ };
+} // namespace generated
+
+// Aliases in tigl namespace
+using CCPACSCabinSpaces = generated::CPACSCabinSpaces;
+using CCPACSCabinSpace = generated::CPACSCabinSpace;
+} // namespace tigl
diff --git a/src/generated/CPACSCargoContainer.cpp b/src/generated/CPACSCargoContainer.cpp
new file mode 100644
index 0000000000..79926ef4d3
--- /dev/null
+++ b/src/generated/CPACSCargoContainer.cpp
@@ -0,0 +1,275 @@
+// Copyright (c) 2020 RISC Software GmbH
+//
+// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC).
+// Do not edit, all changes are lost when files are re-generated.
+//
+// Licensed under the Apache License, Version 2.0 (the "License")
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include
+#include "CPACSCargoContainer.h"
+#include "CPACSCargoContainers.h"
+#include "CTiglError.h"
+#include "CTiglLogging.h"
+#include "CTiglUIDManager.h"
+#include "TixiHelper.h"
+
+namespace tigl
+{
+namespace generated
+{
+ CPACSCargoContainer::CPACSCargoContainer(CPACSCargoContainers* parent, CTiglUIDManager* uidMgr)
+ : m_uidMgr(uidMgr)
+ , m_x(0)
+ , m_y(0)
+ {
+ //assert(parent != NULL);
+ m_parent = parent;
+ }
+
+ CPACSCargoContainer::~CPACSCargoContainer()
+ {
+ if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID);
+ if (m_uidMgr) {
+ if (!m_cargoContainerElementUID.empty()) m_uidMgr->TryUnregisterReference(m_cargoContainerElementUID, *this);
+ }
+ }
+
+ const CPACSCargoContainers* CPACSCargoContainer::GetParent() const
+ {
+ return m_parent;
+ }
+
+ CPACSCargoContainers* CPACSCargoContainer::GetParent()
+ {
+ return m_parent;
+ }
+
+ const CTiglUIDObject* CPACSCargoContainer::GetNextUIDParent() const
+ {
+ if (m_parent) {
+ return m_parent->GetNextUIDParent();
+ }
+ return nullptr;
+ }
+
+ CTiglUIDObject* CPACSCargoContainer::GetNextUIDParent()
+ {
+ if (m_parent) {
+ return m_parent->GetNextUIDParent();
+ }
+ return nullptr;
+ }
+
+ CTiglUIDManager& CPACSCargoContainer::GetUIDManager()
+ {
+ if (!m_uidMgr) {
+ throw CTiglError("UIDManager is null");
+ }
+ return *m_uidMgr;
+ }
+
+ const CTiglUIDManager& CPACSCargoContainer::GetUIDManager() const
+ {
+ if (!m_uidMgr) {
+ throw CTiglError("UIDManager is null");
+ }
+ return *m_uidMgr;
+ }
+
+ void CPACSCargoContainer::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath)
+ {
+ // read attribute uID
+ if (tixi::TixiCheckAttribute(tixiHandle, xpath, "uID")) {
+ m_uID = tixi::TixiGetAttribute(tixiHandle, xpath, "uID");
+ if (m_uID.empty()) {
+ LOG(WARNING) << "Required attribute uID is empty at xpath " << xpath;
+ }
+ }
+ else {
+ LOG(ERROR) << "Required attribute uID is missing at xpath " << xpath;
+ }
+
+ // read element name
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/name")) {
+ m_name = tixi::TixiGetElement(tixiHandle, xpath + "/name");
+ if (m_name->empty()) {
+ LOG(WARNING) << "Optional element name is present but empty at xpath " << xpath;
+ }
+ }
+
+ // read element description
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) {
+ m_description = tixi::TixiGetElement(tixiHandle, xpath + "/description");
+ if (m_description->empty()) {
+ LOG(WARNING) << "Optional element description is present but empty at xpath " << xpath;
+ }
+ }
+
+ // read element cargoContainerElementUID
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/cargoContainerElementUID")) {
+ m_cargoContainerElementUID = tixi::TixiGetElement(tixiHandle, xpath + "/cargoContainerElementUID");
+ if (m_cargoContainerElementUID.empty()) {
+ LOG(WARNING) << "Required element cargoContainerElementUID is empty at xpath " << xpath;
+ }
+ if (m_uidMgr && !m_cargoContainerElementUID.empty()) m_uidMgr->RegisterReference(m_cargoContainerElementUID, *this);
+ }
+ else {
+ LOG(ERROR) << "Required element cargoContainerElementUID is missing at xpath " << xpath;
+ }
+
+ // read element x
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/x")) {
+ m_x = tixi::TixiGetElement(tixiHandle, xpath + "/x");
+ }
+ else {
+ LOG(ERROR) << "Required element x is missing at xpath " << xpath;
+ }
+
+ // read element y
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/y")) {
+ m_y = tixi::TixiGetElement(tixiHandle, xpath + "/y");
+ }
+ else {
+ LOG(ERROR) << "Required element y is missing at xpath " << xpath;
+ }
+
+ if (m_uidMgr && !m_uID.empty()) m_uidMgr->RegisterObject(m_uID, *this);
+ }
+
+ void CPACSCargoContainer::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const
+ {
+ // write attribute uID
+ tixi::TixiSaveAttribute(tixiHandle, xpath, "uID", m_uID);
+
+ // write element name
+ if (m_name) {
+ tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/name");
+ tixi::TixiSaveElement(tixiHandle, xpath + "/name", *m_name);
+ }
+ else {
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/name")) {
+ tixi::TixiRemoveElement(tixiHandle, xpath + "/name");
+ }
+ }
+
+ // write element description
+ if (m_description) {
+ tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/description");
+ tixi::TixiSaveElement(tixiHandle, xpath + "/description", *m_description);
+ }
+ else {
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) {
+ tixi::TixiRemoveElement(tixiHandle, xpath + "/description");
+ }
+ }
+
+ // write element cargoContainerElementUID
+ tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/cargoContainerElementUID");
+ tixi::TixiSaveElement(tixiHandle, xpath + "/cargoContainerElementUID", m_cargoContainerElementUID);
+
+ // write element x
+ tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/x");
+ tixi::TixiSaveElement(tixiHandle, xpath + "/x", m_x);
+
+ // write element y
+ tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/y");
+ tixi::TixiSaveElement(tixiHandle, xpath + "/y", m_y);
+
+ }
+
+ const std::string& CPACSCargoContainer::GetUID() const
+ {
+ return m_uID;
+ }
+
+ void CPACSCargoContainer::SetUID(const std::string& value)
+ {
+ if (m_uidMgr && value != m_uID) {
+ if (m_uID.empty()) {
+ m_uidMgr->RegisterObject(value, *this);
+ }
+ else {
+ m_uidMgr->UpdateObjectUID(m_uID, value);
+ }
+ }
+ m_uID = value;
+ }
+
+ const boost::optional& CPACSCargoContainer::GetName() const
+ {
+ return m_name;
+ }
+
+ void CPACSCargoContainer::SetName(const boost::optional& value)
+ {
+ m_name = value;
+ }
+
+ const boost::optional& CPACSCargoContainer::GetDescription() const
+ {
+ return m_description;
+ }
+
+ void CPACSCargoContainer::SetDescription(const boost::optional& value)
+ {
+ m_description = value;
+ }
+
+ const std::string& CPACSCargoContainer::GetCargoContainerElementUID() const
+ {
+ return m_cargoContainerElementUID;
+ }
+
+ void CPACSCargoContainer::SetCargoContainerElementUID(const std::string& value)
+ {
+ if (m_uidMgr) {
+ if (!m_cargoContainerElementUID.empty()) m_uidMgr->TryUnregisterReference(m_cargoContainerElementUID, *this);
+ if (!value.empty()) m_uidMgr->RegisterReference(value, *this);
+ }
+ m_cargoContainerElementUID = value;
+ }
+
+ const double& CPACSCargoContainer::GetX() const
+ {
+ return m_x;
+ }
+
+ void CPACSCargoContainer::SetX(const double& value)
+ {
+ m_x = value;
+ }
+
+ const double& CPACSCargoContainer::GetY() const
+ {
+ return m_y;
+ }
+
+ void CPACSCargoContainer::SetY(const double& value)
+ {
+ m_y = value;
+ }
+
+ const CTiglUIDObject* CPACSCargoContainer::GetNextUIDObject() const
+ {
+ return this;
+ }
+
+ void CPACSCargoContainer::NotifyUIDChange(const std::string& oldUid, const std::string& newUid)
+ {
+ if (m_cargoContainerElementUID == oldUid) {
+ m_cargoContainerElementUID = newUid;
+ }
+ }
+
+} // namespace generated
+} // namespace tigl
diff --git a/src/generated/CPACSCargoContainer.h b/src/generated/CPACSCargoContainer.h
new file mode 100644
index 0000000000..fabca05c66
--- /dev/null
+++ b/src/generated/CPACSCargoContainer.h
@@ -0,0 +1,118 @@
+// Copyright (c) 2020 RISC Software GmbH
+//
+// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC).
+// Do not edit, all changes are lost when files are re-generated.
+//
+// Licensed under the Apache License, Version 2.0 (the "License")
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#pragma once
+
+#include
+#include
+#include
+#include
+#include "CTiglUIDObject.h"
+#include "ITiglUIDRefObject.h"
+#include "tigl_internal.h"
+
+namespace tigl
+{
+class CTiglUIDManager;
+
+namespace generated
+{
+ class CPACSCargoContainers;
+
+ // This class is used in:
+ // CPACSCargoContainers
+
+ /// @brief Cargo container
+ ///
+ /// Cargo container type for placing an instance of a cargo container in the parent deck.
+ ///
+ class CPACSCargoContainer : public CTiglReqUIDObject, public ITiglUIDRefObject
+ {
+ public:
+ TIGL_EXPORT CPACSCargoContainer(CPACSCargoContainers* parent, CTiglUIDManager* uidMgr);
+
+ TIGL_EXPORT virtual ~CPACSCargoContainer();
+
+ TIGL_EXPORT CPACSCargoContainers* GetParent();
+
+ TIGL_EXPORT const CPACSCargoContainers* GetParent() const;
+
+ TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent();
+ TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const;
+
+ TIGL_EXPORT CTiglUIDManager& GetUIDManager();
+ TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const;
+
+ TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath);
+ TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const;
+
+ TIGL_EXPORT virtual const std::string& GetUID() const;
+ TIGL_EXPORT virtual void SetUID(const std::string& value);
+
+ TIGL_EXPORT virtual const boost::optional& GetName() const;
+ TIGL_EXPORT virtual void SetName(const boost::optional& value);
+
+ TIGL_EXPORT virtual const boost::optional& GetDescription() const;
+ TIGL_EXPORT virtual void SetDescription(const boost::optional& value);
+
+ TIGL_EXPORT virtual const std::string& GetCargoContainerElementUID() const;
+ TIGL_EXPORT virtual void SetCargoContainerElementUID(const std::string& value);
+
+ TIGL_EXPORT virtual const double& GetX() const;
+ TIGL_EXPORT virtual void SetX(const double& value);
+
+ TIGL_EXPORT virtual const double& GetY() const;
+ TIGL_EXPORT virtual void SetY(const double& value);
+
+ protected:
+ CPACSCargoContainers* m_parent;
+
+ CTiglUIDManager* m_uidMgr;
+
+ std::string m_uID;
+
+ /// Name
+ boost::optional m_name;
+
+ /// Description
+ boost::optional m_description;
+
+ /// UID of the cargo container element in the cpacs/vehicles/deckElements node
+ std::string m_cargoContainerElementUID;
+
+ /// Position in x
+ double m_x;
+
+ /// Position in y
+ double m_y;
+
+ private:
+ TIGL_EXPORT const CTiglUIDObject* GetNextUIDObject() const final;
+ TIGL_EXPORT void NotifyUIDChange(const std::string& oldUid, const std::string& newUid) final;
+
+ CPACSCargoContainer(const CPACSCargoContainer&) = delete;
+ CPACSCargoContainer& operator=(const CPACSCargoContainer&) = delete;
+
+ CPACSCargoContainer(CPACSCargoContainer&&) = delete;
+ CPACSCargoContainer& operator=(CPACSCargoContainer&&) = delete;
+ };
+} // namespace generated
+
+// Aliases in tigl namespace
+using CCPACSCargoContainer = generated::CPACSCargoContainer;
+using CCPACSCargoContainers = generated::CPACSCargoContainers;
+} // namespace tigl
diff --git a/src/generated/CPACSCargoContainerElement.cpp b/src/generated/CPACSCargoContainerElement.cpp
deleted file mode 100644
index 22005232ab..0000000000
--- a/src/generated/CPACSCargoContainerElement.cpp
+++ /dev/null
@@ -1,342 +0,0 @@
-// Copyright (c) 2020 RISC Software GmbH
-//
-// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC).
-// Do not edit, all changes are lost when files are re-generated.
-//
-// Licensed under the Apache License, Version 2.0 (the "License")
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include
-#include "CPACSCargoContainerElement.h"
-#include "CPACSCargoContainerElements.h"
-#include "CTiglError.h"
-#include "CTiglLogging.h"
-#include "CTiglUIDManager.h"
-#include "TixiHelper.h"
-
-namespace tigl
-{
-namespace generated
-{
- CPACSCargoContainerElement::CPACSCargoContainerElement(CPACSCargoContainerElements* parent, CTiglUIDManager* uidMgr)
- : m_uidMgr(uidMgr)
- , m_deltaX(0)
- , m_deltaY(0)
- , m_deltaZ(0)
- {
- //assert(parent != NULL);
- m_parent = parent;
- }
-
- CPACSCargoContainerElement::~CPACSCargoContainerElement()
- {
- if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID);
- }
-
- const CPACSCargoContainerElements* CPACSCargoContainerElement::GetParent() const
- {
- return m_parent;
- }
-
- CPACSCargoContainerElements* CPACSCargoContainerElement::GetParent()
- {
- return m_parent;
- }
-
- const CTiglUIDObject* CPACSCargoContainerElement::GetNextUIDParent() const
- {
- if (m_parent) {
- return m_parent->GetNextUIDParent();
- }
- return nullptr;
- }
-
- CTiglUIDObject* CPACSCargoContainerElement::GetNextUIDParent()
- {
- if (m_parent) {
- return m_parent->GetNextUIDParent();
- }
- return nullptr;
- }
-
- CTiglUIDManager& CPACSCargoContainerElement::GetUIDManager()
- {
- if (!m_uidMgr) {
- throw CTiglError("UIDManager is null");
- }
- return *m_uidMgr;
- }
-
- const CTiglUIDManager& CPACSCargoContainerElement::GetUIDManager() const
- {
- if (!m_uidMgr) {
- throw CTiglError("UIDManager is null");
- }
- return *m_uidMgr;
- }
-
- void CPACSCargoContainerElement::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath)
- {
- // read attribute uID
- if (tixi::TixiCheckAttribute(tixiHandle, xpath, "uID")) {
- m_uID = tixi::TixiGetAttribute(tixiHandle, xpath, "uID");
- if (m_uID.empty()) {
- LOG(WARNING) << "Required attribute uID is empty at xpath " << xpath;
- }
- }
- else {
- LOG(ERROR) << "Required attribute uID is missing at xpath " << xpath;
- }
-
- // read element description
- if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) {
- m_description = tixi::TixiGetElement(tixiHandle, xpath + "/description");
- if (m_description->empty()) {
- LOG(WARNING) << "Optional element description is present but empty at xpath " << xpath;
- }
- }
-
- // read element mass
- if (tixi::TixiCheckElement(tixiHandle, xpath + "/mass")) {
- m_mass = boost::in_place(this, m_uidMgr);
- try {
- m_mass->ReadCPACS(tixiHandle, xpath + "/mass");
- } catch(const std::exception& e) {
- LOG(ERROR) << "Failed to read mass at xpath " << xpath << ": " << e.what();
- m_mass = boost::none;
- }
- }
-
- // read element contour
- if (tixi::TixiCheckElement(tixiHandle, xpath + "/contour")) {
- m_contour = stringToCPACSCargoContainerElement_contour(tixi::TixiGetElement(tixiHandle, xpath + "/contour"));
- }
- else {
- LOG(ERROR) << "Required element contour is missing at xpath " << xpath;
- }
-
- // read element deltaX
- if (tixi::TixiCheckElement(tixiHandle, xpath + "/deltaX")) {
- m_deltaX = tixi::TixiGetElement(tixiHandle, xpath + "/deltaX");
- }
- else {
- LOG(ERROR) << "Required element deltaX is missing at xpath " << xpath;
- }
-
- // read element deltaY
- if (tixi::TixiCheckElement(tixiHandle, xpath + "/deltaY")) {
- m_deltaY = tixi::TixiGetElement(tixiHandle, xpath + "/deltaY");
- }
- else {
- LOG(ERROR) << "Required element deltaY is missing at xpath " << xpath;
- }
-
- // read element deltaYBase
- if (tixi::TixiCheckElement(tixiHandle, xpath + "/deltaYBase")) {
- m_deltaYBase = tixi::TixiGetElement(tixiHandle, xpath + "/deltaYBase");
- }
-
- // read element deltaZ
- if (tixi::TixiCheckElement(tixiHandle, xpath + "/deltaZ")) {
- m_deltaZ = tixi::TixiGetElement(tixiHandle, xpath + "/deltaZ");
- }
- else {
- LOG(ERROR) << "Required element deltaZ is missing at xpath " << xpath;
- }
-
- // read element deltaZKink
- if (tixi::TixiCheckElement(tixiHandle, xpath + "/deltaZKink")) {
- m_deltaZKink = tixi::TixiGetElement(tixiHandle, xpath + "/deltaZKink");
- }
-
- if (m_uidMgr && !m_uID.empty()) m_uidMgr->RegisterObject(m_uID, *this);
- }
-
- void CPACSCargoContainerElement::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const
- {
- // write attribute uID
- tixi::TixiSaveAttribute(tixiHandle, xpath, "uID", m_uID);
-
- // write element description
- if (m_description) {
- tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/description");
- tixi::TixiSaveElement(tixiHandle, xpath + "/description", *m_description);
- }
- else {
- if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) {
- tixi::TixiRemoveElement(tixiHandle, xpath + "/description");
- }
- }
-
- // write element mass
- if (m_mass) {
- tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/mass");
- m_mass->WriteCPACS(tixiHandle, xpath + "/mass");
- }
- else {
- if (tixi::TixiCheckElement(tixiHandle, xpath + "/mass")) {
- tixi::TixiRemoveElement(tixiHandle, xpath + "/mass");
- }
- }
-
- // write element contour
- tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/contour");
- tixi::TixiSaveElement(tixiHandle, xpath + "/contour", CPACSCargoContainerElement_contourToString(m_contour));
-
- // write element deltaX
- tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/deltaX");
- tixi::TixiSaveElement(tixiHandle, xpath + "/deltaX", m_deltaX);
-
- // write element deltaY
- tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/deltaY");
- tixi::TixiSaveElement(tixiHandle, xpath + "/deltaY", m_deltaY);
-
- // write element deltaYBase
- if (m_deltaYBase) {
- tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/deltaYBase");
- tixi::TixiSaveElement(tixiHandle, xpath + "/deltaYBase", *m_deltaYBase);
- }
- else {
- if (tixi::TixiCheckElement(tixiHandle, xpath + "/deltaYBase")) {
- tixi::TixiRemoveElement(tixiHandle, xpath + "/deltaYBase");
- }
- }
-
- // write element deltaZ
- tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/deltaZ");
- tixi::TixiSaveElement(tixiHandle, xpath + "/deltaZ", m_deltaZ);
-
- // write element deltaZKink
- if (m_deltaZKink) {
- tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/deltaZKink");
- tixi::TixiSaveElement(tixiHandle, xpath + "/deltaZKink", *m_deltaZKink);
- }
- else {
- if (tixi::TixiCheckElement(tixiHandle, xpath + "/deltaZKink")) {
- tixi::TixiRemoveElement(tixiHandle, xpath + "/deltaZKink");
- }
- }
-
- }
-
- const std::string& CPACSCargoContainerElement::GetUID() const
- {
- return m_uID;
- }
-
- void CPACSCargoContainerElement::SetUID(const std::string& value)
- {
- if (m_uidMgr && value != m_uID) {
- if (m_uID.empty()) {
- m_uidMgr->RegisterObject(value, *this);
- }
- else {
- m_uidMgr->UpdateObjectUID(m_uID, value);
- }
- }
- m_uID = value;
- }
-
- const boost::optional& CPACSCargoContainerElement::GetDescription() const
- {
- return m_description;
- }
-
- void CPACSCargoContainerElement::SetDescription(const boost::optional& value)
- {
- m_description = value;
- }
-
- const boost::optional& CPACSCargoContainerElement::GetMass() const
- {
- return m_mass;
- }
-
- boost::optional& CPACSCargoContainerElement::GetMass()
- {
- return m_mass;
- }
-
- const CPACSCargoContainerElement_contour& CPACSCargoContainerElement::GetContour() const
- {
- return m_contour;
- }
-
- void CPACSCargoContainerElement::SetContour(const CPACSCargoContainerElement_contour& value)
- {
- m_contour = value;
- }
-
- const double& CPACSCargoContainerElement::GetDeltaX() const
- {
- return m_deltaX;
- }
-
- void CPACSCargoContainerElement::SetDeltaX(const double& value)
- {
- m_deltaX = value;
- }
-
- const double& CPACSCargoContainerElement::GetDeltaY() const
- {
- return m_deltaY;
- }
-
- void CPACSCargoContainerElement::SetDeltaY(const double& value)
- {
- m_deltaY = value;
- }
-
- const boost::optional& CPACSCargoContainerElement::GetDeltaYBase() const
- {
- return m_deltaYBase;
- }
-
- void CPACSCargoContainerElement::SetDeltaYBase(const boost::optional& value)
- {
- m_deltaYBase = value;
- }
-
- const double& CPACSCargoContainerElement::GetDeltaZ() const
- {
- return m_deltaZ;
- }
-
- void CPACSCargoContainerElement::SetDeltaZ(const double& value)
- {
- m_deltaZ = value;
- }
-
- const boost::optional& CPACSCargoContainerElement::GetDeltaZKink() const
- {
- return m_deltaZKink;
- }
-
- void CPACSCargoContainerElement::SetDeltaZKink(const boost::optional& value)
- {
- m_deltaZKink = value;
- }
-
- CPACSDeckElementMass& CPACSCargoContainerElement::GetMass(CreateIfNotExistsTag)
- {
- if (!m_mass)
- m_mass = boost::in_place(this, m_uidMgr);
- return *m_mass;
- }
-
- void CPACSCargoContainerElement::RemoveMass()
- {
- m_mass = boost::none;
- }
-
-} // namespace generated
-} // namespace tigl
diff --git a/src/generated/CPACSCargoContainerElement.h b/src/generated/CPACSCargoContainerElement.h
deleted file mode 100644
index 221305f0ed..0000000000
--- a/src/generated/CPACSCargoContainerElement.h
+++ /dev/null
@@ -1,137 +0,0 @@
-// Copyright (c) 2020 RISC Software GmbH
-//
-// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC).
-// Do not edit, all changes are lost when files are re-generated.
-//
-// Licensed under the Apache License, Version 2.0 (the "License")
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#pragma once
-
-#include
-#include
-#include
-#include
-#include "CPACSCargoContainerElement_contour.h"
-#include "CPACSDeckElementMass.h"
-#include "CreateIfNotExists.h"
-#include "CTiglUIDObject.h"
-#include "tigl_internal.h"
-
-namespace tigl
-{
-class CTiglUIDManager;
-
-namespace generated
-{
- class CPACSCargoContainerElements;
-
- // This class is used in:
- // CPACSCargoContainerElements
-
- /// @brief Cargo container element for use in the decks
- ///
- /// @see cargoContainer
- ///
- class CPACSCargoContainerElement : public CTiglReqUIDObject
- {
- public:
- TIGL_EXPORT CPACSCargoContainerElement(CPACSCargoContainerElements* parent, CTiglUIDManager* uidMgr);
-
- TIGL_EXPORT virtual ~CPACSCargoContainerElement();
-
- TIGL_EXPORT CPACSCargoContainerElements* GetParent();
-
- TIGL_EXPORT const CPACSCargoContainerElements* GetParent() const;
-
- TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent();
- TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const;
-
- TIGL_EXPORT CTiglUIDManager& GetUIDManager();
- TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const;
-
- TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath);
- TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const;
-
- TIGL_EXPORT virtual const std::string& GetUID() const;
- TIGL_EXPORT virtual void SetUID(const std::string& value);
-
- TIGL_EXPORT virtual const boost::optional& GetDescription() const;
- TIGL_EXPORT virtual void SetDescription(const boost::optional& value);
-
- TIGL_EXPORT virtual const boost::optional& GetMass() const;
- TIGL_EXPORT virtual boost::optional& GetMass();
-
- TIGL_EXPORT virtual const CPACSCargoContainerElement_contour& GetContour() const;
- TIGL_EXPORT virtual void SetContour(const CPACSCargoContainerElement_contour& value);
-
- TIGL_EXPORT virtual const double& GetDeltaX() const;
- TIGL_EXPORT virtual void SetDeltaX(const double& value);
-
- TIGL_EXPORT virtual const double& GetDeltaY() const;
- TIGL_EXPORT virtual void SetDeltaY(const double& value);
-
- TIGL_EXPORT virtual const boost::optional& GetDeltaYBase() const;
- TIGL_EXPORT virtual void SetDeltaYBase(const boost::optional& value);
-
- TIGL_EXPORT virtual const double& GetDeltaZ() const;
- TIGL_EXPORT virtual void SetDeltaZ(const double& value);
-
- TIGL_EXPORT virtual const boost::optional& GetDeltaZKink() const;
- TIGL_EXPORT virtual void SetDeltaZKink(const boost::optional& value);
-
- TIGL_EXPORT virtual CPACSDeckElementMass& GetMass(CreateIfNotExistsTag);
- TIGL_EXPORT virtual void RemoveMass();
-
- protected:
- CPACSCargoContainerElements* m_parent;
-
- CTiglUIDManager* m_uidMgr;
-
- std::string m_uID;
-
- /// Description
- boost::optional m_description;
-
- boost::optional m_mass;
-
- /// Contour: single or double
- CPACSCargoContainerElement_contour m_contour;
-
- /// Delta x
- double m_deltaX;
-
- /// Delta y
- double m_deltaY;
-
- /// Delta y of the base
- boost::optional m_deltaYBase;
-
- /// Delta z
- double m_deltaZ;
-
- /// Delta z kink
- boost::optional m_deltaZKink;
-
- private:
- CPACSCargoContainerElement(const CPACSCargoContainerElement&) = delete;
- CPACSCargoContainerElement& operator=(const CPACSCargoContainerElement&) = delete;
-
- CPACSCargoContainerElement(CPACSCargoContainerElement&&) = delete;
- CPACSCargoContainerElement& operator=(CPACSCargoContainerElement&&) = delete;
- };
-} // namespace generated
-
-// Aliases in tigl namespace
-using CCPACSCargoContainerElement = generated::CPACSCargoContainerElement;
-using CCPACSCargoContainerElements = generated::CPACSCargoContainerElements;
-} // namespace tigl
diff --git a/src/generated/CPACSCargoContainerElements.cpp b/src/generated/CPACSCargoContainerElements.cpp
index 40aaf35188..b23c2de53f 100644
--- a/src/generated/CPACSCargoContainerElements.cpp
+++ b/src/generated/CPACSCargoContainerElements.cpp
@@ -16,9 +16,9 @@
// limitations under the License.
#include
-#include "CPACSCargoContainerElement.h"
#include "CPACSCargoContainerElements.h"
#include "CPACSDeckElements.h"
+#include "CPACSVehicleElementBase.h"
#include "CTiglError.h"
#include "CTiglLogging.h"
#include "CTiglUIDManager.h"
@@ -98,12 +98,12 @@ namespace generated
}
- const std::vector>& CPACSCargoContainerElements::GetCargoContainerElements() const
+ const std::vector>& CPACSCargoContainerElements::GetCargoContainerElements() const
{
return m_cargoContainerElements;
}
- std::vector>& CPACSCargoContainerElements::GetCargoContainerElements()
+ std::vector>& CPACSCargoContainerElements::GetCargoContainerElements()
{
return m_cargoContainerElements;
}
@@ -124,25 +124,25 @@ namespace generated
throw CTiglError("Invalid UID in CPACSCargoContainerElements::GetCargoContainerElementIndex", TIGL_UID_ERROR);
}
- CPACSCargoContainerElement& CPACSCargoContainerElements::GetCargoContainerElement(size_t index)
+ CPACSVehicleElementBase& CPACSCargoContainerElements::GetCargoContainerElement(size_t index)
{
if (index < 1 || index > GetCargoContainerElementCount()) {
- throw CTiglError("Invalid index in std::vector>::GetCargoContainerElement", TIGL_INDEX_ERROR);
+ throw CTiglError("Invalid index in std::vector>::GetCargoContainerElement", TIGL_INDEX_ERROR);
}
index--;
return *m_cargoContainerElements[index];
}
- const CPACSCargoContainerElement& CPACSCargoContainerElements::GetCargoContainerElement(size_t index) const
+ const CPACSVehicleElementBase& CPACSCargoContainerElements::GetCargoContainerElement(size_t index) const
{
if (index < 1 || index > GetCargoContainerElementCount()) {
- throw CTiglError("Invalid index in std::vector>::GetCargoContainerElement", TIGL_INDEX_ERROR);
+ throw CTiglError("Invalid index in std::vector>::GetCargoContainerElement", TIGL_INDEX_ERROR);
}
index--;
return *m_cargoContainerElements[index];
}
- CPACSCargoContainerElement& CPACSCargoContainerElements::GetCargoContainerElement(const std::string& UID)
+ CPACSVehicleElementBase& CPACSCargoContainerElements::GetCargoContainerElement(const std::string& UID)
{
for (auto& elem : m_cargoContainerElements ) {
if (elem->GetUID() == UID)
@@ -151,7 +151,7 @@ namespace generated
throw CTiglError("Invalid UID in CPACSCargoContainerElements::GetCargoContainerElement. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR);
}
- const CPACSCargoContainerElement& CPACSCargoContainerElements::GetCargoContainerElement(const std::string& UID) const
+ const CPACSVehicleElementBase& CPACSCargoContainerElements::GetCargoContainerElement(const std::string& UID) const
{
for (auto& elem : m_cargoContainerElements ) {
if (elem->GetUID() == UID)
@@ -161,13 +161,13 @@ namespace generated
}
- CPACSCargoContainerElement& CPACSCargoContainerElements::AddCargoContainerElement()
+ CPACSVehicleElementBase& CPACSCargoContainerElements::AddCargoContainerElement()
{
- m_cargoContainerElements.push_back(make_unique(this, m_uidMgr));
+ m_cargoContainerElements.push_back(make_unique(this, m_uidMgr));
return *m_cargoContainerElements.back();
}
- void CPACSCargoContainerElements::RemoveCargoContainerElement(CPACSCargoContainerElement& ref)
+ void CPACSCargoContainerElements::RemoveCargoContainerElement(CPACSVehicleElementBase& ref)
{
for (std::size_t i = 0; i < m_cargoContainerElements.size(); i++) {
if (m_cargoContainerElements[i].get() == &ref) {
diff --git a/src/generated/CPACSCargoContainerElements.h b/src/generated/CPACSCargoContainerElements.h
index 2ef9975edf..ecf7452c1c 100644
--- a/src/generated/CPACSCargoContainerElements.h
+++ b/src/generated/CPACSCargoContainerElements.h
@@ -30,7 +30,7 @@ class CTiglUIDObject;
namespace generated
{
- class CPACSCargoContainerElement;
+ class CPACSVehicleElementBase;
class CPACSDeckElements;
// This class is used in:
@@ -60,27 +60,27 @@ namespace generated
TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath);
TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const;
- TIGL_EXPORT virtual const std::vector>& GetCargoContainerElements() const;
- TIGL_EXPORT virtual std::vector>& GetCargoContainerElements();
+ TIGL_EXPORT virtual const std::vector>& GetCargoContainerElements() const;
+ TIGL_EXPORT virtual std::vector>& GetCargoContainerElements();
TIGL_EXPORT virtual size_t GetCargoContainerElementCount() const;
TIGL_EXPORT virtual size_t GetCargoContainerElementIndex(const std::string& UID) const;
- TIGL_EXPORT virtual const CPACSCargoContainerElement& GetCargoContainerElement(size_t index) const;
- TIGL_EXPORT virtual CPACSCargoContainerElement& GetCargoContainerElement(size_t index);
+ TIGL_EXPORT virtual const CPACSVehicleElementBase& GetCargoContainerElement(size_t index) const;
+ TIGL_EXPORT virtual CPACSVehicleElementBase& GetCargoContainerElement(size_t index);
- TIGL_EXPORT virtual const CPACSCargoContainerElement& GetCargoContainerElement(const std::string& UID) const;
- TIGL_EXPORT virtual CPACSCargoContainerElement& GetCargoContainerElement(const std::string& UID);
+ TIGL_EXPORT virtual const CPACSVehicleElementBase& GetCargoContainerElement(const std::string& UID) const;
+ TIGL_EXPORT virtual CPACSVehicleElementBase& GetCargoContainerElement(const std::string& UID);
- TIGL_EXPORT virtual CPACSCargoContainerElement& AddCargoContainerElement();
- TIGL_EXPORT virtual void RemoveCargoContainerElement(CPACSCargoContainerElement& ref);
+ TIGL_EXPORT virtual CPACSVehicleElementBase& AddCargoContainerElement();
+ TIGL_EXPORT virtual void RemoveCargoContainerElement(CPACSVehicleElementBase& ref);
protected:
CPACSDeckElements* m_parent;
CTiglUIDManager* m_uidMgr;
- std::vector> m_cargoContainerElements;
+ std::vector> m_cargoContainerElements;
private:
CPACSCargoContainerElements(const CPACSCargoContainerElements&) = delete;
@@ -93,6 +93,6 @@ namespace generated
// Aliases in tigl namespace
using CCPACSCargoContainerElements = generated::CPACSCargoContainerElements;
-using CCPACSCargoContainerElement = generated::CPACSCargoContainerElement;
+using CCPACSVehicleElementBase = generated::CPACSVehicleElementBase;
using CCPACSDeckElements = generated::CPACSDeckElements;
} // namespace tigl
diff --git a/src/generated/CPACSCargoContainers.cpp b/src/generated/CPACSCargoContainers.cpp
new file mode 100644
index 0000000000..158b210972
--- /dev/null
+++ b/src/generated/CPACSCargoContainers.cpp
@@ -0,0 +1,176 @@
+// Copyright (c) 2020 RISC Software GmbH
+//
+// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC).
+// Do not edit, all changes are lost when files are re-generated.
+//
+// Licensed under the Apache License, Version 2.0 (the "License")
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include
+#include "CCPACSDeck.h"
+#include "CPACSCargoContainer.h"
+#include "CPACSCargoContainers.h"
+#include "CTiglError.h"
+#include "CTiglLogging.h"
+#include "CTiglUIDManager.h"
+#include "CTiglUIDObject.h"
+#include "TixiHelper.h"
+
+namespace tigl
+{
+namespace generated
+{
+ CPACSCargoContainers::CPACSCargoContainers(CCPACSDeck* parent, CTiglUIDManager* uidMgr)
+ : m_uidMgr(uidMgr)
+ {
+ //assert(parent != NULL);
+ m_parent = parent;
+ }
+
+ CPACSCargoContainers::~CPACSCargoContainers()
+ {
+ }
+
+ const CCPACSDeck* CPACSCargoContainers::GetParent() const
+ {
+ return m_parent;
+ }
+
+ CCPACSDeck* CPACSCargoContainers::GetParent()
+ {
+ return m_parent;
+ }
+
+ const CTiglUIDObject* CPACSCargoContainers::GetNextUIDParent() const
+ {
+ return m_parent;
+ }
+
+ CTiglUIDObject* CPACSCargoContainers::GetNextUIDParent()
+ {
+ return m_parent;
+ }
+
+ CTiglUIDManager& CPACSCargoContainers::GetUIDManager()
+ {
+ if (!m_uidMgr) {
+ throw CTiglError("UIDManager is null");
+ }
+ return *m_uidMgr;
+ }
+
+ const CTiglUIDManager& CPACSCargoContainers::GetUIDManager() const
+ {
+ if (!m_uidMgr) {
+ throw CTiglError("UIDManager is null");
+ }
+ return *m_uidMgr;
+ }
+
+ void CPACSCargoContainers::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath)
+ {
+ // read element cargoContainer
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/cargoContainer")) {
+ tixi::TixiReadElements(tixiHandle, xpath + "/cargoContainer", m_cargoContainers, 1, tixi::xsdUnbounded, this, m_uidMgr);
+ }
+
+ }
+
+ void CPACSCargoContainers::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const
+ {
+ // write element cargoContainer
+ tixi::TixiSaveElements(tixiHandle, xpath + "/cargoContainer", m_cargoContainers);
+
+ }
+
+ const std::vector>& CPACSCargoContainers::GetCargoContainers() const
+ {
+ return m_cargoContainers;
+ }
+
+ std::vector>& CPACSCargoContainers::GetCargoContainers()
+ {
+ return m_cargoContainers;
+ }
+
+ size_t CPACSCargoContainers::GetCargoContainerCount() const
+ {
+ return m_cargoContainers.size();
+ }
+
+ size_t CPACSCargoContainers::GetCargoContainerIndex(const std::string& UID) const
+ {
+ for (size_t i=0; i < GetCargoContainerCount(); i++) {
+ const std::string tmpUID(m_cargoContainers[i]->GetUID());
+ if (tmpUID == UID) {
+ return i+1;
+ }
+ }
+ throw CTiglError("Invalid UID in CPACSCargoContainers::GetCargoContainerIndex", TIGL_UID_ERROR);
+ }
+
+ CPACSCargoContainer& CPACSCargoContainers::GetCargoContainer(size_t index)
+ {
+ if (index < 1 || index > GetCargoContainerCount()) {
+ throw CTiglError("Invalid index in std::vector>::GetCargoContainer", TIGL_INDEX_ERROR);
+ }
+ index--;
+ return *m_cargoContainers[index];
+ }
+
+ const CPACSCargoContainer& CPACSCargoContainers::GetCargoContainer(size_t index) const
+ {
+ if (index < 1 || index > GetCargoContainerCount()) {
+ throw CTiglError("Invalid index in std::vector>::GetCargoContainer", TIGL_INDEX_ERROR);
+ }
+ index--;
+ return *m_cargoContainers[index];
+ }
+
+ CPACSCargoContainer& CPACSCargoContainers::GetCargoContainer(const std::string& UID)
+ {
+ for (auto& elem : m_cargoContainers ) {
+ if (elem->GetUID() == UID)
+ return *elem;
+ }
+ throw CTiglError("Invalid UID in CPACSCargoContainers::GetCargoContainer. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR);
+ }
+
+ const CPACSCargoContainer& CPACSCargoContainers::GetCargoContainer(const std::string& UID) const
+ {
+ for (auto& elem : m_cargoContainers ) {
+ if (elem->GetUID() == UID)
+ return *elem;
+ }
+ throw CTiglError("Invalid UID in CPACSCargoContainers::GetCargoContainer. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR);
+ }
+
+
+ CPACSCargoContainer& CPACSCargoContainers::AddCargoContainer()
+ {
+ m_cargoContainers.push_back(make_unique(this, m_uidMgr));
+ return *m_cargoContainers.back();
+ }
+
+ void CPACSCargoContainers::RemoveCargoContainer(CPACSCargoContainer& ref)
+ {
+ for (std::size_t i = 0; i < m_cargoContainers.size(); i++) {
+ if (m_cargoContainers[i].get() == &ref) {
+ m_cargoContainers.erase(m_cargoContainers.begin() + i);
+ return;
+ }
+ }
+ throw CTiglError("Element not found");
+ }
+
+} // namespace generated
+} // namespace tigl
diff --git a/src/generated/CPACSCargoContainers.h b/src/generated/CPACSCargoContainers.h
new file mode 100644
index 0000000000..ce8ff007b9
--- /dev/null
+++ b/src/generated/CPACSCargoContainers.h
@@ -0,0 +1,97 @@
+// Copyright (c) 2020 RISC Software GmbH
+//
+// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC).
+// Do not edit, all changes are lost when files are re-generated.
+//
+// Licensed under the Apache License, Version 2.0 (the "License")
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#pragma once
+
+#include
+#include
+#include
+#include "tigl_internal.h"
+#include "UniquePtr.h"
+
+namespace tigl
+{
+class CTiglUIDManager;
+class CTiglUIDObject;
+class CCPACSDeck;
+
+namespace generated
+{
+ class CPACSCargoContainer;
+
+ // This class is used in:
+ // CPACSDeck
+
+ /// @brief Cargo containers
+ ///
+ /// Cargo container instance collection type.
+ ///
+ class CPACSCargoContainers
+ {
+ public:
+ TIGL_EXPORT CPACSCargoContainers(CCPACSDeck* parent, CTiglUIDManager* uidMgr);
+
+ TIGL_EXPORT virtual ~CPACSCargoContainers();
+
+ TIGL_EXPORT CCPACSDeck* GetParent();
+
+ TIGL_EXPORT const CCPACSDeck* GetParent() const;
+
+ TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent();
+ TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const;
+
+ TIGL_EXPORT CTiglUIDManager& GetUIDManager();
+ TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const;
+
+ TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath);
+ TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const;
+
+ TIGL_EXPORT virtual const std::vector>& GetCargoContainers() const;
+ TIGL_EXPORT virtual std::vector>& GetCargoContainers();
+
+ TIGL_EXPORT virtual size_t GetCargoContainerCount() const;
+ TIGL_EXPORT virtual size_t GetCargoContainerIndex(const std::string& UID) const;
+
+ TIGL_EXPORT virtual const CPACSCargoContainer& GetCargoContainer(size_t index) const;
+ TIGL_EXPORT virtual CPACSCargoContainer& GetCargoContainer(size_t index);
+
+ TIGL_EXPORT virtual const CPACSCargoContainer& GetCargoContainer(const std::string& UID) const;
+ TIGL_EXPORT virtual CPACSCargoContainer& GetCargoContainer(const std::string& UID);
+
+ TIGL_EXPORT virtual CPACSCargoContainer& AddCargoContainer();
+ TIGL_EXPORT virtual void RemoveCargoContainer(CPACSCargoContainer& ref);
+
+ protected:
+ CCPACSDeck* m_parent;
+
+ CTiglUIDManager* m_uidMgr;
+
+ std::vector> m_cargoContainers;
+
+ private:
+ CPACSCargoContainers(const CPACSCargoContainers&) = delete;
+ CPACSCargoContainers& operator=(const CPACSCargoContainers&) = delete;
+
+ CPACSCargoContainers(CPACSCargoContainers&&) = delete;
+ CPACSCargoContainers& operator=(CPACSCargoContainers&&) = delete;
+ };
+} // namespace generated
+
+// Aliases in tigl namespace
+using CCPACSCargoContainers = generated::CPACSCargoContainers;
+using CCPACSCargoContainer = generated::CPACSCargoContainer;
+} // namespace tigl
diff --git a/src/generated/CPACSCeilingPanelElements.cpp b/src/generated/CPACSCeilingPanelElements.cpp
index 8b51974f9d..4c1b90f9af 100644
--- a/src/generated/CPACSCeilingPanelElements.cpp
+++ b/src/generated/CPACSCeilingPanelElements.cpp
@@ -17,8 +17,8 @@
#include
#include "CPACSCeilingPanelElements.h"
-#include "CPACSDeckElementBase.h"
#include "CPACSDeckElements.h"
+#include "CPACSVehicleElementBase.h"
#include "CTiglError.h"
#include "CTiglLogging.h"
#include "CTiglUIDManager.h"
@@ -98,12 +98,12 @@ namespace generated
}
- const std::vector>& CPACSCeilingPanelElements::GetCeilingPanelElements() const
+ const std::vector>& CPACSCeilingPanelElements::GetCeilingPanelElements() const
{
return m_ceilingPanelElements;
}
- std::vector>& CPACSCeilingPanelElements::GetCeilingPanelElements()
+ std::vector>& CPACSCeilingPanelElements::GetCeilingPanelElements()
{
return m_ceilingPanelElements;
}
@@ -124,25 +124,25 @@ namespace generated
throw CTiglError("Invalid UID in CPACSCeilingPanelElements::GetCeilingPanelElementIndex", TIGL_UID_ERROR);
}
- CPACSDeckElementBase& CPACSCeilingPanelElements::GetCeilingPanelElement(size_t index)
+ CPACSVehicleElementBase& CPACSCeilingPanelElements::GetCeilingPanelElement(size_t index)
{
if (index < 1 || index > GetCeilingPanelElementCount()) {
- throw CTiglError("Invalid index in std::vector>::GetCeilingPanelElement", TIGL_INDEX_ERROR);
+ throw CTiglError("Invalid index in std::vector>::GetCeilingPanelElement", TIGL_INDEX_ERROR);
}
index--;
return *m_ceilingPanelElements[index];
}
- const CPACSDeckElementBase& CPACSCeilingPanelElements::GetCeilingPanelElement(size_t index) const
+ const CPACSVehicleElementBase& CPACSCeilingPanelElements::GetCeilingPanelElement(size_t index) const
{
if (index < 1 || index > GetCeilingPanelElementCount()) {
- throw CTiglError("Invalid index in std::vector>::GetCeilingPanelElement", TIGL_INDEX_ERROR);
+ throw CTiglError("Invalid index in std::vector>::GetCeilingPanelElement", TIGL_INDEX_ERROR);
}
index--;
return *m_ceilingPanelElements[index];
}
- CPACSDeckElementBase& CPACSCeilingPanelElements::GetCeilingPanelElement(const std::string& UID)
+ CPACSVehicleElementBase& CPACSCeilingPanelElements::GetCeilingPanelElement(const std::string& UID)
{
for (auto& elem : m_ceilingPanelElements ) {
if (elem->GetUID() == UID)
@@ -151,7 +151,7 @@ namespace generated
throw CTiglError("Invalid UID in CPACSCeilingPanelElements::GetCeilingPanelElement. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR);
}
- const CPACSDeckElementBase& CPACSCeilingPanelElements::GetCeilingPanelElement(const std::string& UID) const
+ const CPACSVehicleElementBase& CPACSCeilingPanelElements::GetCeilingPanelElement(const std::string& UID) const
{
for (auto& elem : m_ceilingPanelElements ) {
if (elem->GetUID() == UID)
@@ -161,13 +161,13 @@ namespace generated
}
- CPACSDeckElementBase& CPACSCeilingPanelElements::AddCeilingPanelElement()
+ CPACSVehicleElementBase& CPACSCeilingPanelElements::AddCeilingPanelElement()
{
- m_ceilingPanelElements.push_back(make_unique(this, m_uidMgr));
+ m_ceilingPanelElements.push_back(make_unique(this, m_uidMgr));
return *m_ceilingPanelElements.back();
}
- void CPACSCeilingPanelElements::RemoveCeilingPanelElement(CPACSDeckElementBase& ref)
+ void CPACSCeilingPanelElements::RemoveCeilingPanelElement(CPACSVehicleElementBase& ref)
{
for (std::size_t i = 0; i < m_ceilingPanelElements.size(); i++) {
if (m_ceilingPanelElements[i].get() == &ref) {
diff --git a/src/generated/CPACSCeilingPanelElements.h b/src/generated/CPACSCeilingPanelElements.h
index e99f029061..36cdf929c1 100644
--- a/src/generated/CPACSCeilingPanelElements.h
+++ b/src/generated/CPACSCeilingPanelElements.h
@@ -30,7 +30,7 @@ class CTiglUIDObject;
namespace generated
{
- class CPACSDeckElementBase;
+ class CPACSVehicleElementBase;
class CPACSDeckElements;
// This class is used in:
@@ -60,20 +60,20 @@ namespace generated
TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath);
TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const;
- TIGL_EXPORT virtual const std::vector>& GetCeilingPanelElements() const;
- TIGL_EXPORT virtual std::vector>& GetCeilingPanelElements();
+ TIGL_EXPORT virtual const std::vector>& GetCeilingPanelElements() const;
+ TIGL_EXPORT virtual std::vector>& GetCeilingPanelElements();
TIGL_EXPORT virtual size_t GetCeilingPanelElementCount() const;
TIGL_EXPORT virtual size_t GetCeilingPanelElementIndex(const std::string& UID) const;
- TIGL_EXPORT virtual const CPACSDeckElementBase& GetCeilingPanelElement(size_t index) const;
- TIGL_EXPORT virtual CPACSDeckElementBase& GetCeilingPanelElement(size_t index);
+ TIGL_EXPORT virtual const CPACSVehicleElementBase& GetCeilingPanelElement(size_t index) const;
+ TIGL_EXPORT virtual CPACSVehicleElementBase& GetCeilingPanelElement(size_t index);
- TIGL_EXPORT virtual const CPACSDeckElementBase& GetCeilingPanelElement(const std::string& UID) const;
- TIGL_EXPORT virtual CPACSDeckElementBase& GetCeilingPanelElement(const std::string& UID);
+ TIGL_EXPORT virtual const CPACSVehicleElementBase& GetCeilingPanelElement(const std::string& UID) const;
+ TIGL_EXPORT virtual CPACSVehicleElementBase& GetCeilingPanelElement(const std::string& UID);
- TIGL_EXPORT virtual CPACSDeckElementBase& AddCeilingPanelElement();
- TIGL_EXPORT virtual void RemoveCeilingPanelElement(CPACSDeckElementBase& ref);
+ TIGL_EXPORT virtual CPACSVehicleElementBase& AddCeilingPanelElement();
+ TIGL_EXPORT virtual void RemoveCeilingPanelElement(CPACSVehicleElementBase& ref);
protected:
CPACSDeckElements* m_parent;
@@ -81,7 +81,7 @@ namespace generated
CTiglUIDManager* m_uidMgr;
/// Ceiling panel element for use in the decks
- std::vector