diff --git a/ChangeLog.md b/ChangeLog.md
index b8cc57aeea..5f727c57e6 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -8,6 +8,7 @@ Changes since last release
- TiGL is now able to approximate profile point lists. The user can define an index list refering to points that should still be interpolated [#1276](https://github.com/DLR-SC/tigl/issues/1276).
- Add `Color` class and `setObjectsColor`/`setObjectsColorRGB` functions to the TiGLCreator scripting console to set object colors without needing a native QColor object ([#1222](https://github.com/DLR-SC/tigl/issues/1222))
- CPACS Export: Choose more meaningful marker for mirrored objects uIDs [#1289](https://github.com/DLR-SC/tigl/issues/1289)
+ - Add fuselage decks
- Add leading edge devices (LED) to TiGL and TiGLcreator [#1101](https://github.com/DLR-SC/tigl/issues/1101)
- Always display the borders of the control surfaces on the wing
- Add funtionality to add user-defined spotlights to the TiGLCreator ([#1245](https://github.com/DLR-SC/tigl/issues/1245))
diff --git a/TIGLCreator/filefilter.txt b/TIGLCreator/filefilter.txt
new file mode 100644
index 0000000000..66534f4644
--- /dev/null
+++ b/TIGLCreator/filefilter.txt
@@ -0,0 +1,24 @@
+~ RULE_10_1_A_do_not_use_bufferoverflow_risky_function_for_unix
+~ RULE_10_1_B_do_not_use_bufferoverflow_risky_function_for_windows
+~ RULE_3_2_B_do_not_use_same_filename_more_than_once
+~ RULE_3_2_CD_do_not_use_special_characters_in_filename
+~ RULE_3_2_F_use_representitive_classname_for_cpp_filename
+~ RULE_3_2_H_do_not_use_uppercase_for_c_filename
+~ RULE_4_1_A_B_use_space_for_indentation
+~ RULE_4_1_B_indent_each_enum_item_in_enum_block
+~ RULE_4_1_B_locate_each_enum_item_in_seperate_line
+~ RULE_4_1_C_align_long_function_parameter_list
+~ RULE_4_1_E_align_conditions
+~ RULE_4_2_A_B_space_around_word
+~ RULE_4_5_A_brace_for_namespace_should_be_located_in_seperate_line
+~ RULE_4_5_A_braces_for_function_definition_should_be_located_in_seperate_line
+~ RULE_4_5_A_braces_for_type_definition_should_be_located_in_seperate_line
+~ RULE_4_5_A_braces_inside_of_function_should_be_located_in_end_of_line
+~ RULE_4_5_A_indent_blocks_inside_of_function
+~ RULE_4_5_B_use_braces_even_for_one_statement
+~ RULE_6_5_B_do_not_use_lowercase_for_macro_constants
+~ RULE_7_2_B_do_not_use_goto_statement
+~ RULE_8_1_A_provide_file_info_comment
+~ RULE_9_1_A_do_not_use_hardcorded_include_path
+~ RULE_9_2_D_use_reentrant_function
+~ RULE_A_3_avoid_too_deep_blocks
diff --git a/bindings/python_internal/configuration.i b/bindings/python_internal/configuration.i
index 4b28e9f0a7..2bb69cc765 100644
--- a/bindings/python_internal/configuration.i
+++ b/bindings/python_internal/configuration.i
@@ -157,7 +157,10 @@
#include "generated/CPACSNacaProfile.h"
#include "CTiglNACA4Calculator.h"
#include "CPACSNacaProfile.h"
-
+#include "CCPACSDeck.h"
+#include "generated/CPACSDecks.h"
+#include "generated/CPACSCabinGeometryContour.h"
+#include "CCPACSDeckComponentBase.h"
%}
%feature("autodoc", "3");
@@ -216,6 +219,8 @@
%boost_optional(tigl::CCPACSRotorProfiles)
%boost_optional(tigl::CCPACSCurveParamPointMap)
%boost_optional(tigl::CCPACSCurvePointListXYZ)
+%boost_optional(tigl::CTiglMassInertia)
+%boost_optional(tigl::CTiglPoint)
// ---------------- Other ------------------------------//
%boost_optional(tigl::CCPACSEtaIsoLine)
@@ -236,6 +241,11 @@
%include "CCPACSMaterialDefinition.h"
%include "generated/CPACSCap.h"
+%include "CTiglMassInertia.h"
+%include "CTiglPoint.h"
+
+%include "generated/CPACSDoubleVectorBase.h"
+
// -------------- Fuselage Walls, Compartments -------------//
%boost_optional(tigl::generated::CPACSCompartments)
%include "generated/CPACSCompartments.h"
@@ -412,6 +422,61 @@ namespace tigl
%include "CTiglAttachedRotorBlade.h"
%include "CPACSRotorHubHinge_type.h"
+
+// ---------------- Decks ------------------ //
+
+%boost_optional(tigl::CCPACSDecks)
+%boost_optional(tigl::CCPACSCabinGeometry)
+%boost_optional(tigl::CCPACSSeatModules)
+%boost_optional(tigl::CCPACSCabinAisles)
+%boost_optional(tigl::CCPACSCabinSpaces)
+%boost_optional(tigl::CCPACSSidewallPanels)
+%boost_optional(tigl::CCPACSLuggageCompartments)
+%boost_optional(tigl::CCPACSCeilingPanels)
+%boost_optional(tigl::CCPACSGalleys)
+%boost_optional(tigl::CCPACSGenericFloorModules)
+%boost_optional(tigl::CCPACSLavatories)
+%boost_optional(tigl::CCPACSClassDividers)
+%boost_optional(tigl::CCPACSCargoContainers)
+%boost_optional(tigl::CCPACSDeckDoors)
+
+%include "generated/CPACSDecks.h"
+
+%include "generated/CPACSCabinGeometryContour.h"
+%include "generated/CPACSCabinGeometryContours.h"
+%include "generated/CPACSCabinGeometry.h"
+%include "generated/CPACSDeck_deckType.h"
+
+%ignore tigl::generated::CPACSSeatModules::GetSeatModules;
+%ignore tigl::generated::CPACSCabinAisles::GetCabinAisles;
+%ignore tigl::generated::CPACSCabinSpaces::GetCabinSpaces;
+%ignore tigl::generated::CPACSSidewallPanels::GetSidewallPanels;
+%ignore tigl::generated::CPACSLuggageCompartments::GetLuggageCompartments;
+%ignore tigl::generated::CPACSCeilingPanels::GetCeilingPanels;
+%ignore tigl::generated::CPACSGalleys::GetGalleys;
+%ignore tigl::generated::CPACSGenericFloorModules::GetGenericFloorModules;
+%ignore tigl::generated::CPACSLavatories::GetLavatorys;
+%ignore tigl::generated::CPACSClassDividers::GetClassDividers;
+%ignore tigl::generated::CPACSCargoContainers::GetCargoContainers;
+%ignore tigl::generated::CPACSDeckDoors::GetDeckDoors;
+
+%include "generated/CPACSSeatModules.h"
+%include "generated/CPACSCabinAisles.h"
+%include "generated/CPACSCabinSpaces.h"
+%include "generated/CPACSSidewallPanels.h"
+%include "generated/CPACSLuggageCompartments.h"
+%include "generated/CPACSCeilingPanels.h"
+%include "generated/CPACSGalleys.h"
+%include "generated/CPACSGenericFloorModules.h"
+%include "generated/CPACSLavatories.h"
+%include "generated/CPACSClassDividers.h"
+%include "generated/CPACSCargoContainers.h"
+%include "generated/CPACSDeckDoors.h"
+%include "CCPACSDeckComponentBase.h"
+
+%include "generated/CPACSDeck.h"
+%include "CCPACSDeck.h"
+
// --------------- Fuselage tanks -----------------//
%boost_optional(tigl::generated::CPACSVessels)
%boost_optional(tigl::CCPACSVessels)
@@ -653,7 +718,6 @@ class CCPACSSystemElements;
%boost_optional(tigl::CCPACSSystemControlDevices)
%boost_optional_enum(tigl::ECPACSSourceTarget_externalElement)
-%include "CTiglMassInertia.h"
%include "generated/CPACSUIDSequence.h"
%include "generated/CPACSComponent.h"
%include "CCPACSComponent.h"
@@ -670,7 +734,6 @@ class CCPACSSystemElements;
%include "CCPACSSystemConnection.h"
%include "generated/CPACSSystemConnections.h"
-%include "CTiglPoint.h"
%include "generated/CPACSComponents.h"
%include "generated/CPACSGenericSystem.h"
%include "CCPACSGenericSystem.h"
@@ -721,7 +784,9 @@ class CCPACSSystemElements;
tigl::CCPACSDuctAssembly,
tigl::CCPACSFuelTank,
tigl::CCPACSVessel,
- tigl::CCPACSComponent
+ tigl::CCPACSComponent,
+ tigl::CCPACSDeck,
+ tigl::CCPACSDeckComponentBase
);
namespace tigl
diff --git a/cpacs_gen_input/CustomTypes.txt b/cpacs_gen_input/CustomTypes.txt
index 6f00bc0a85..ec3f428ed0 100644
--- a/cpacs_gen_input/CustomTypes.txt
+++ b/cpacs_gen_input/CustomTypes.txt
@@ -50,6 +50,10 @@ CPACSFuselageSections CCPACSFuselageSections
CPACSFuselageElement CCPACSFuselageSectionElement
CPACSFuselageElements CCPACSFuselageSectionElements
+CPACSDeck CCPACSDeck
+CPACSDeckComponentBase CCPACSDeckComponentBase
+CPACSDeckComponent2DBase CCPACSDeckComponent2DBase
+
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 c0de6c5c4e..b9a0043459 100644
--- a/cpacs_gen_input/cpacs_schema.xsd
+++ b/cpacs_gen_input/cpacs_schema.xsd
@@ -25424,12 +25424,12 @@ The fuel tank volume type should also be used for the wing fuel tank
-
+
@@ -34943,59 +34943,12 @@ The fuel tank volume type should also be used for the wing fuel tank
-
+
-
-
-
-
-
- Cargo container
-
-
- Cargo container type for placing an instance of a cargo container in the parent deck.
-
-
-
-
-
-
-
-
-
- Name
-
-
-
-
- Description
-
-
-
-
- UID of the cargo container element in the cpacs/vehicles/deckElements node
-
-
-
-
- Position in x
-
-
-
-
- Position in y
-
-
-
-
-
-
-
-
@@ -35012,7 +34965,7 @@ The fuel tank volume type should also be used for the wing fuel tank
-
+
Seat module
@@ -35038,7 +34991,7 @@ The fuel tank volume type should also be used for the wing fuel tank
-
+
Galley
@@ -35064,7 +35017,7 @@ The fuel tank volume type should also be used for the wing fuel tank
-
+
Generic floor module
@@ -35090,7 +35043,7 @@ The fuel tank volume type should also be used for the wing fuel tank
-
+
Lavatory
@@ -35116,7 +35069,7 @@ The fuel tank volume type should also be used for the wing fuel tank
-
+
Class divider
@@ -35264,142 +35217,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
-
-
-
-
-
-
-
-
-
@@ -35416,7 +35233,7 @@ The fuel tank volume type should also be used for the wing fuel tank
-
+
@@ -35438,7 +35255,7 @@ The fuel tank volume type should also be used for the wing fuel tank
-
+
Ceiling panel element for use in the decks
@@ -35464,7 +35281,7 @@ The fuel tank volume type should also be used for the wing fuel tank
-
+
Class divider element for use in the decks
@@ -35490,47 +35307,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
@@ -35554,22 +35371,14 @@ The fuel tank volume type should also be used for the wing fuel tank
-
-
-
-
- Description
-
-
-
-
-
+
+
+
Number of trolleys
-
-
+
@@ -35590,7 +35399,7 @@ The fuel tank volume type should also be used for the wing fuel tank
-
+
Galley element for use in the decks
@@ -35616,7 +35425,7 @@ The fuel tank volume type should also be used for the wing fuel tank
-
+
Lavatory element for use in the decks
@@ -35642,7 +35451,7 @@ The fuel tank volume type should also be used for the wing fuel tank
-
+
Luggage compartment element for use in the decks
@@ -35666,22 +35475,14 @@ The fuel tank volume type should also be used for the wing fuel tank
-
-
-
-
- Description
-
-
-
-
-
+
+
+
Number of seats
-
-
+
@@ -35702,7 +35503,7 @@ The fuel tank volume type should also be used for the wing fuel tank
-
+
Seat element for use in the decks
@@ -35728,7 +35529,7 @@ The fuel tank volume type should also be used for the wing fuel tank
-
+
Generic floor element for use in the decks
@@ -35754,7 +35555,7 @@ The fuel tank volume type should also be used for the wing fuel tank
-
+
Sidewall panel element for use in the decks
@@ -35764,29 +35565,6 @@ The fuel tank volume type should also be used for the wing fuel tank
-
-
-
-
-
- Generic geometry component
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -35823,102 +35601,6 @@ The fuel tank volume type should also be used for the wing fuel tank
-
-
-
-
-
- Deck component
-
-
-
-
-
-
-
-
-
- Name
-
-
-
-
- Description
-
-
-
-
- UID of the corresponding element in the cpacs/vehicles/deckElemets node
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 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 7431b9cdba..83246dc212 100644
--- a/src/api/tigl.h
+++ b/src/api/tigl.h
@@ -237,7 +237,9 @@ 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_DECK_COMPONENT = 31, /**< The Component is a component of a fuselage deck */
+ TIGL_COMPONENT_OTHER = 32
};
typedef enum TiglGeometricComponentType TiglGeometricComponentType;
diff --git a/src/configuration/CCPACSConfiguration.cpp b/src/configuration/CCPACSConfiguration.cpp
index 0dfc7b2dda..5fe6738877 100644
--- a/src/configuration/CCPACSConfiguration.cpp
+++ b/src/configuration/CCPACSConfiguration.cpp
@@ -82,6 +82,7 @@ namespace {
const std::string farFieldXPath = "/cpacs/toolspecific/cFD/farField";
const std::string enginesXPath = "/cpacs/vehicles/engines";
const std::string systemElementsXPath = "/cpacs/vehicles/systemElements";
+ const std::string deckElementsXPath = "/cpacs/vehicles/deckElements";
}
// Build up memory structure for whole CPACS file
@@ -111,6 +112,10 @@ void CCPACSConfiguration::ReadCPACS(const std::string& configurationUID)
systemElements = boost::in_place(nullptr, &uidManager);
systemElements->ReadCPACS(tixiDocumentHandle, systemElementsXPath);
}
+ if (tixi::TixiCheckElement(tixiDocumentHandle, deckElementsXPath)) {
+ deckElements = boost::in_place(nullptr, &uidManager);
+ deckElements->ReadCPACS(tixiDocumentHandle, deckElementsXPath);
+ }
// create new root component for CTiglUIDManager
const bool isRotorcraft = tixi::TixiCheckElement(tixiDocumentHandle, "/cpacs/vehicles/rotorcraft/model[@uID='" + std::string(configurationUID) + "']");
diff --git a/src/configuration/CCPACSConfiguration.h b/src/configuration/CCPACSConfiguration.h
index 4c8c2ee8de..ef53e521a9 100644
--- a/src/configuration/CCPACSConfiguration.h
+++ b/src/configuration/CCPACSConfiguration.h
@@ -44,6 +44,7 @@
#include "generated/CPACSProfiles.h"
#include "generated/CPACSEngines.h"
#include "generated/CPACSSystemElements.h"
+#include "generated/CPACSDeckElements.h"
namespace tigl
{
@@ -281,6 +282,7 @@ class CCPACSConfiguration
boost::optional profiles; /**< Wing airfoils, fuselage profiles, rotor airfoils, guide curve profiles */
boost::optional engines; /**< Engines under vehicle node */
boost::optional systemElements; /**< System elements under vehicle node */
+ boost::optional deckElements; /**< Deck elements under vehicle node */
TixiDocumentHandle tixiDocumentHandle; /**< Handle for internal TixiDocument */
CCPACSHeader header; /**< Configuration header element */
CCPACSFarField farField; /**< Far field configuration for CFD tools */
diff --git a/src/decks/CCPACSDeck.cpp b/src/decks/CCPACSDeck.cpp
new file mode 100644
index 0000000000..a2327c2552
--- /dev/null
+++ b/src/decks/CCPACSDeck.cpp
@@ -0,0 +1,147 @@
+/*
+* 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"
+#include "CCPACSDeckComponentBase.h"
+
+#include "tiglcommonfunctions.h"
+#include "CNamedShape.h"
+#include "CGroupShapes.h"
+
+namespace tigl
+{
+
+// Constructor
+CCPACSDeck::CCPACSDeck(CCPACSDecks* parent, CTiglUIDManager* uidMgr)
+ : generated::CPACSDeck(parent, uidMgr)
+ , CTiglRelativelyPositionedComponent(&m_parentUID, &m_transformation)
+{
+}
+
+// Destructor
+CCPACSDeck::~CCPACSDeck()
+{
+}
+
+void CCPACSDeck::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath)
+{
+ Reset();
+ generated::CPACSDeck::ReadCPACS(tixiHandle, xpath);
+
+ // Default parent: if no explicit parentUID is given, place the deck
+ // relative to the surrounding fuselage.
+ if ((!m_parentUID || m_parentUID->empty()) && m_parent && m_parent->GetParent()) {
+ generated::CPACSDeck::SetParentUID(boost::optional(m_parent->GetParent()->GetUID()));
+ }
+}
+
+std::string CCPACSDeck::GetDefaultedUID() const
+{
+ return GetUID();
+}
+
+// Returns the parent configuration
+CCPACSConfiguration const& CCPACSDeck::GetConfiguration() const
+{
+ return m_parent->GetParent()->GetConfiguration();
+}
+
+TiglGeometricComponentType CCPACSDeck::GetComponentType() const
+{
+ return TIGL_COMPONENT_DECK;
+}
+
+TiglGeometricComponentIntent CCPACSDeck::GetComponentIntent() const
+{
+ return TIGL_INTENT_PHYSICAL;
+}
+
+// build loft
+PNamedShape CCPACSDeck::BuildLoft() const
+{
+ ListPNamedShape shapes;
+
+ auto appendLofts = [&shapes](const auto& components) {
+ for (const auto& component : components) {
+ if (component) {
+ shapes.push_back(component->GetLoft());
+ }
+ }
+ };
+
+ if (GetSeatModules()) {
+ appendLofts(GetSeatModules()->GetSeatModules());
+ }
+
+ if (GetSidewallPanels()) {
+ appendLofts(GetSidewallPanels()->GetSidewallPanels());
+ }
+
+ if (GetLuggageCompartments()) {
+ appendLofts(GetLuggageCompartments()->GetLuggageCompartments());
+ }
+
+ if (GetCeilingPanels()) {
+ appendLofts(GetCeilingPanels()->GetCeilingPanels());
+ }
+
+ if (GetGalleys()) {
+ appendLofts(GetGalleys()->GetGalleys());
+ }
+
+ if (GetGenericFloorModules()) {
+ appendLofts(GetGenericFloorModules()->GetGenericFloorModules());
+ }
+
+ if (GetLavatories()) {
+ appendLofts(GetLavatories()->GetLavatorys());
+ }
+
+ if (GetClassDividers()) {
+ appendLofts(GetClassDividers()->GetClassDividers());
+ }
+
+ if (GetCargoContainers()) {
+ appendLofts(GetCargoContainers()->GetCargoContainers());
+ }
+
+ PNamedShape groupedShape = CGroupShapes(shapes);
+ groupedShape->SetName(GetUID().c_str());
+ groupedShape->SetShortName(GetShortShapeName().c_str());
+
+ return groupedShape;
+}
+
+// get short name for loft
+std::string CCPACSDeck::GetShortShapeName() const
+{
+ unsigned int i = 0;
+
+ for (const auto& d : GetParent()->GetDecks()) {
+ ++i;
+ if (GetUID() == d->GetUID()) {
+ return "D" + std::to_string(i);
+ }
+ }
+
+ return "D";
+}
+
+} // end namespace tigl
diff --git a/src/decks/CCPACSDeck.h b/src/decks/CCPACSDeck.h
new file mode 100644
index 0000000000..fd365d320d
--- /dev/null
+++ b/src/decks/CCPACSDeck.h
@@ -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.
+*/
+
+#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 void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) override;
+
+ TIGL_EXPORT std::string GetDefaultedUID() const override;
+
+ // Returns the parent configuration
+ TIGL_EXPORT CCPACSConfiguration const& GetConfiguration() const;
+
+ // Returns the Component Type TIGL_COMPONENT_GENERICSYSTEM.
+ TIGL_EXPORT TiglGeometricComponentType GetComponentType() const override;
+
+ /// @brief Returns the TiGL geometric component intent.
+ TIGL_EXPORT TiglGeometricComponentIntent GetComponentIntent() const override;
+
+protected:
+ // Build the shape of the system
+ PNamedShape BuildLoft() const override;
+
+private:
+ // get short name for loft
+ std::string GetShortShapeName() const;
+};
+
+} // end namespace tigl
diff --git a/src/decks/CCPACSDeckComponentBase.cpp b/src/decks/CCPACSDeckComponentBase.cpp
new file mode 100644
index 0000000000..407ddad815
--- /dev/null
+++ b/src/decks/CCPACSDeckComponentBase.cpp
@@ -0,0 +1,297 @@
+/*
+* 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 "generated/CPACSSeatElement.h"
+#include "generated/CPACSGalleyElement.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
+{
+namespace
+{
+
+ template
+ const CCPACSElementGeometry* ResolveGeometry(const CTiglUIDManager& uidMgr, const std::string& uid)
+ {
+ if (!uidMgr.IsType(uid)) {
+ return nullptr;
+ }
+ return &uidMgr.ResolveObject(uid).GetGeometry();
+ }
+
+ template
+ const boost::optional* ResolveMassDescription(const CTiglUIDManager& uidMgr,
+ const std::string& uid)
+ {
+ if (!uidMgr.IsType(uid)) {
+ return nullptr;
+ }
+ return &uidMgr.ResolveObject(uid).GetMass();
+ }
+
+ template struct SupportedDeckElementTypes {
+ static const CCPACSElementGeometry* GetGeometry(const CTiglUIDManager& uidMgr, const std::string& uid)
+ {
+ const CCPACSElementGeometry* geometry = nullptr;
+ ((geometry = geometry ? geometry : ResolveGeometry(uidMgr, uid)), ...);
+ return geometry;
+ }
+
+ static const boost::optional* GetMassDescription(const CTiglUIDManager& uidMgr,
+ const std::string& uid)
+ {
+ const boost::optional* mass = nullptr;
+ ((mass = mass ? mass : ResolveMassDescription(uidMgr, uid)), ...);
+ return mass;
+ }
+ };
+
+ using DeckElementTypes =
+ SupportedDeckElementTypes;
+
+ const CCPACSElementGeometry* GetGeometry(const CTiglUIDManager& uidMgr, const std::string& uid)
+ {
+ return DeckElementTypes::GetGeometry(uidMgr, uid);
+ }
+
+ const boost::optional* GetMassDescription(const CTiglUIDManager& uidMgr, const std::string& uid)
+ {
+ return DeckElementTypes::GetMassDescription(uidMgr, uid);
+ }
+
+} // namespace
+
+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(CCPACSClassDividers* parent, CTiglUIDManager* uidMgr)
+ : generated::CPACSDeckComponentBase(parent, uidMgr)
+ , CTiglRelativelyPositionedComponent(parent->GetParent(), &m_transformation)
+ , m_mass(*this, &CCPACSDeckComponentBase::BuildMass)
+ , m_parentDeck(parent->GetParent())
+{
+}
+
+CCPACSDeckComponentBase::CCPACSDeckComponentBase(CCPACSGalleys* parent, CTiglUIDManager* uidMgr)
+ : generated::CPACSDeckComponentBase(parent, uidMgr)
+ , CTiglRelativelyPositionedComponent(parent->GetParent(), &m_transformation)
+ , m_mass(*this, &CCPACSDeckComponentBase::BuildMass)
+ , m_parentDeck(parent->GetParent())
+{
+}
+
+CCPACSDeckComponentBase::CCPACSDeckComponentBase(CCPACSGenericFloorModules* parent, CTiglUIDManager* uidMgr)
+ : generated::CPACSDeckComponentBase(parent, uidMgr)
+ , CTiglRelativelyPositionedComponent(parent->GetParent(), &m_transformation)
+ , m_mass(*this, &CCPACSDeckComponentBase::BuildMass)
+ , m_parentDeck(parent->GetParent())
+{
+}
+
+CCPACSDeckComponentBase::CCPACSDeckComponentBase(CCPACSLavatories* 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(CCPACSSeatModules* 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())
+{
+}
+
+CCPACSDeckComponentBase::CCPACSDeckComponentBase(CCPACSCargoContainers* 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();
+}
+
+TiglGeometricComponentType CCPACSDeckComponentBase::GetComponentType() const
+{
+ return TIGL_COMPONENT_DECK_COMPONENT;
+}
+
+TiglGeometricComponentIntent CCPACSDeckComponentBase::GetComponentIntent() const
+{
+ return TIGL_INTENT_PHYSICAL;
+}
+
+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
+{
+ const char* representation = ::tiglGeometryRepresentationToString(
+ static_cast(GetComponentRepresentation()));
+
+ if (!representation) {
+ throw CTiglError("Invalid geometry representation for component with uID \"" +
+ GetObjectUID().get_value_or("unnamed") + "\".");
+ }
+
+ return representation;
+}
+
+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 = GetCenterOfGravityLocal();
+ if (!cogLocal) {
+ return boost::none;
+ }
+
+ return GetTransformationMatrix() * (*cogLocal);
+}
+
+boost::optional CCPACSDeckComponentBase::GetMassInertiaLocal() const
+{
+ return m_mass->inertiaLocal;
+}
+
+const CCPACSElementGeometry& CCPACSDeckComponentBase::GetElementGeometry() const
+{
+ const CCPACSElementGeometry* const geom = GetGeometry(*m_uidMgr, m_deckElementUID);
+
+ if (!geom) {
+ throw CTiglError("Unsupported deck element for uID \"" + m_deckElementUID + "\".");
+ }
+
+ return *geom;
+}
+
+PNamedShape CCPACSDeckComponentBase::BuildLocalLoft() const
+{
+ const CCPACSElementGeometry& geom = GetElementGeometry();
+ const std::string compName = GetObjectUID().get_value_or("unnamed");
+
+ CTiglElementGeometryBuilder builder(*this, GetConfiguration(), geom, compName, _cpacsDocPath);
+ return builder.BuildShape();
+}
+
+PNamedShape CCPACSDeckComponentBase::BuildLoft() const
+{
+ return GetTransformationMatrix().Transform(BuildLocalLoft());
+}
+
+void CCPACSDeckComponentBase::BuildMass(MassCache& cache) const
+{
+ const auto* massPtr = GetMassDescription(*m_uidMgr, m_deckElementUID);
+ if (!massPtr || !*massPtr) {
+ LOG(WARNING) << "No mass definition for uID \"" + m_deckElementUID + "\"!";
+ return;
+ }
+
+ const CCPACSElementMass& massDef = massPtr->get();
+
+ CTiglElementMassBuilder builder(massDef, m_deckElementUID, BuildLocalLoft()->Shape());
+
+ const auto result = builder.EvaluateMass();
+ cache.mass = result.mass;
+ cache.cogLocal = result.cogLocal;
+ cache.inertiaLocal = result.inertiaLocal;
+
+ if (cache.mass) {
+ *cache.mass *= GetTransformationMatrix().GetVolumeScaleFactor();
+ }
+}
+
+} // namespace tigl
diff --git a/src/decks/CCPACSDeckComponentBase.h b/src/decks/CCPACSDeckComponentBase.h
new file mode 100644
index 0000000000..9a2bb96afe
--- /dev/null
+++ b/src/decks/CCPACSDeckComponentBase.h
@@ -0,0 +1,187 @@
+/*
+* 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 Representing a CPACS element.
+ *
+ * Mass properties:
+ * - The referenced element may define either an explicit mass or a density.
+ * - The mass returned represents the mass of the transformed component instance.
+ * If the component is subject to scaling when instantiated at deck level, the returned mass is scaled
+ * by the corresponding volume scale factor.
+ * - 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:
+ * - The local center of gravity and local mass inertia are expressed in the component's
+ * local coordinate system.
+ */
+class CCPACSDeckComponentBase : public generated::CPACSDeckComponentBase, public CTiglRelativelyPositionedComponent
+{
+public:
+ /**
+ * @brief Constructs a CCPACSDeckComponent2DBase.
+ * @param parent Parent CPACS container owning this component.
+ * @param uidMgr UID manager for resolving referenced deck elements.
+ */
+ TIGL_EXPORT CCPACSDeckComponentBase(CCPACSCeilingPanels* parent, CTiglUIDManager* uidMgr);
+
+ TIGL_EXPORT CCPACSDeckComponentBase(CCPACSClassDividers* parent, CTiglUIDManager* uidMgr);
+
+ TIGL_EXPORT CCPACSDeckComponentBase(CCPACSGalleys* parent, CTiglUIDManager* uidMgr);
+
+ TIGL_EXPORT CCPACSDeckComponentBase(CCPACSGenericFloorModules* parent, CTiglUIDManager* uidMgr);
+
+ TIGL_EXPORT CCPACSDeckComponentBase(CCPACSLavatories* parent, CTiglUIDManager* uidMgr);
+
+ TIGL_EXPORT CCPACSDeckComponentBase(CCPACSLuggageCompartments* parent, CTiglUIDManager* uidMgr);
+
+ TIGL_EXPORT CCPACSDeckComponentBase(CCPACSSeatModules* parent, CTiglUIDManager* uidMgr);
+
+ TIGL_EXPORT CCPACSDeckComponentBase(CCPACSSidewallPanels* parent, CTiglUIDManager* uidMgr);
+
+ TIGL_EXPORT CCPACSDeckComponentBase(CCPACSCargoContainers* 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;
+
+ /// @brief Returns the TiGL geometric component intent.
+ TIGL_EXPORT TiglGeometricComponentIntent GetComponentIntent() const override;
+
+ /**
+ * @brief Returns the geometric representation type of the referenced deck 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 predefined deck element and represents the mass of the
+ * transformed component instance at deck level:
+ * - If an explicit mass is provided in CPACS, it is used as the reference mass.
+ * - Otherwise, if a density is provided, the reference mass is computed from the local
+ * component geometry volume.
+ * - The resulting reference mass is scaled by the transformation at deck level.
+ * - 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 untransformed local 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 hierarchy
+ * to the local CoG.
+ *
+ * @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;
+
+protected:
+ virtual PNamedShape BuildLoft() const override;
+
+private:
+ PNamedShape BuildLocalLoft() const;
+
+ 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 41b3602030..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::TixiCheckElementHasTextContent(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::TixiCheckElementHasTextContent(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::TixiCheckElementHasTextContent(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..e9a1b3e99a
--- /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::TixiCheckElementHasTextContent(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::TixiCheckElementHasTextContent(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..421e2c1df8
--- /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(std::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..14456315b6
--- /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
+#include "tigl_internal.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..dcb822cb84
--- /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::TixiCheckElementHasTextContent(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::TixiCheckElementHasTextContent(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..70d2b71e53
--- /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::TixiCheckElementHasTextContent(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..344c0d0ca7
--- /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(std::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..61eb8ecbd8
--- /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
+#include "tigl_internal.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..a00df02cca
--- /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::TixiCheckElementHasTextContent(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::TixiCheckElementHasTextContent(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::TixiCheckElementHasTextContent(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..68c71b2ec9
--- /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(std::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..d9be0ea7bc
--- /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
+#include "tigl_internal.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/CPACSCargoContainerElement.cpp b/src/generated/CPACSCargoContainerElement.cpp
deleted file mode 100644
index 696955997a..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::TixiCheckElementHasTextContent(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::TixiCheckElementHasTextContent(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::TixiCheckElementHasTextContent(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::TixiCheckElementHasTextContent(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::TixiCheckElementHasTextContent(tixiHandle, xpath + "/deltaYBase")) {
- m_deltaYBase = tixi::TixiGetElement(tixiHandle, xpath + "/deltaYBase");
- }
-
- // read element deltaZ
- if (tixi::TixiCheckElementHasTextContent(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::TixiCheckElementHasTextContent(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 4330c6d3c6..2abd71ff2e 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(std::make_unique(this, m_uidMgr));
+ m_cargoContainerElements.push_back(std::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 ca51f28636..80b85534f1 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..333daf7a94
--- /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
+#include "CCPACSDeck.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);
+ }
+
+ CCPACSDeckComponentBase& 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 CCPACSDeckComponentBase& 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];
+ }
+
+ CCPACSDeckComponentBase& 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 CCPACSDeckComponentBase& 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);
+ }
+
+
+ CCPACSDeckComponentBase& CPACSCargoContainers::AddCargoContainer()
+ {
+ m_cargoContainers.push_back(std::make_unique(this, m_uidMgr));
+ return *m_cargoContainers.back();
+ }
+
+ void CPACSCargoContainers::RemoveCargoContainer(CCPACSDeckComponentBase& 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..79c1599e71
--- /dev/null
+++ b/src/generated/CPACSCargoContainers.h
@@ -0,0 +1,95 @@
+// 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 "tigl_internal.h"
+
+namespace tigl
+{
+class CTiglUIDManager;
+class CTiglUIDObject;
+class CCPACSDeckComponentBase;
+class CCPACSDeck;
+
+namespace generated
+{
+ // 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 CCPACSDeckComponentBase& GetCargoContainer(size_t index) const;
+ TIGL_EXPORT virtual CCPACSDeckComponentBase& GetCargoContainer(size_t index);
+
+ TIGL_EXPORT virtual const CCPACSDeckComponentBase& GetCargoContainer(const std::string& UID) const;
+ TIGL_EXPORT virtual CCPACSDeckComponentBase& GetCargoContainer(const std::string& UID);
+
+ TIGL_EXPORT virtual CCPACSDeckComponentBase& AddCargoContainer();
+ TIGL_EXPORT virtual void RemoveCargoContainer(CCPACSDeckComponentBase& 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;
+} // namespace tigl
diff --git a/src/generated/CPACSCeilingPanelElements.cpp b/src/generated/CPACSCeilingPanelElements.cpp
index a462df1d4b..41f5451aa5 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(std::make_unique(this, m_uidMgr));
+ m_ceilingPanelElements.push_back(std::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 9121591d4b..33116ccb6c 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> m_ceilingPanelElements;
+ std::vector> m_ceilingPanelElements;
private:
CPACSCeilingPanelElements(const CPACSCeilingPanelElements&) = delete;
@@ -94,6 +94,6 @@ namespace generated
// Aliases in tigl namespace
using CCPACSCeilingPanelElements = generated::CPACSCeilingPanelElements;
-using CCPACSDeckElementBase = generated::CPACSDeckElementBase;
+using CCPACSVehicleElementBase = generated::CPACSVehicleElementBase;
using CCPACSDeckElements = generated::CPACSDeckElements;
} // namespace tigl
diff --git a/src/generated/CPACSCeilingPanels.cpp b/src/generated/CPACSCeilingPanels.cpp
new file mode 100644
index 0000000000..0128417203
--- /dev/null
+++ b/src/generated/CPACSCeilingPanels.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
+#include "CCPACSDeck.h"
+#include "CPACSCeilingPanels.h"
+#include "CTiglError.h"
+#include "CTiglLogging.h"
+#include "CTiglUIDManager.h"
+#include "CTiglUIDObject.h"
+#include "TixiHelper.h"
+
+namespace tigl
+{
+namespace generated
+{
+ CPACSCeilingPanels::CPACSCeilingPanels(CCPACSDeck* parent, CTiglUIDManager* uidMgr)
+ : m_uidMgr(uidMgr)
+ {
+ //assert(parent != NULL);
+ m_parent = parent;
+ }
+
+ CPACSCeilingPanels::~CPACSCeilingPanels()
+ {
+ }
+
+ const CCPACSDeck* CPACSCeilingPanels::GetParent() const
+ {
+ return m_parent;
+ }
+
+ CCPACSDeck* CPACSCeilingPanels::GetParent()
+ {
+ return m_parent;
+ }
+
+ const CTiglUIDObject* CPACSCeilingPanels::GetNextUIDParent() const
+ {
+ return m_parent;
+ }
+
+ CTiglUIDObject* CPACSCeilingPanels::GetNextUIDParent()
+ {
+ return m_parent;
+ }
+
+ CTiglUIDManager& CPACSCeilingPanels::GetUIDManager()
+ {
+ if (!m_uidMgr) {
+ throw CTiglError("UIDManager is null");
+ }
+ return *m_uidMgr;
+ }
+
+ const CTiglUIDManager& CPACSCeilingPanels::GetUIDManager() const
+ {
+ if (!m_uidMgr) {
+ throw CTiglError("UIDManager is null");
+ }
+ return *m_uidMgr;
+ }
+
+ void CPACSCeilingPanels::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath)
+ {
+ // read element ceilingPanel
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/ceilingPanel")) {
+ tixi::TixiReadElements(tixiHandle, xpath + "/ceilingPanel", m_ceilingPanels, 1, tixi::xsdUnbounded, this, m_uidMgr);
+ }
+
+ }
+
+ void CPACSCeilingPanels::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const
+ {
+ // write element ceilingPanel
+ tixi::TixiSaveElements(tixiHandle, xpath + "/ceilingPanel", m_ceilingPanels);
+
+ }
+
+ const std::vector>& CPACSCeilingPanels::GetCeilingPanels() const
+ {
+ return m_ceilingPanels;
+ }
+
+ std::vector>& CPACSCeilingPanels::GetCeilingPanels()
+ {
+ return m_ceilingPanels;
+ }
+
+ size_t CPACSCeilingPanels::GetCeilingPanelCount() const
+ {
+ return m_ceilingPanels.size();
+ }
+
+ size_t CPACSCeilingPanels::GetCeilingPanelIndex(const std::string& UID) const
+ {
+ for (size_t i=0; i < GetCeilingPanelCount(); i++) {
+ const std::string tmpUID(m_ceilingPanels[i]->GetUID());
+ if (tmpUID == UID) {
+ return i+1;
+ }
+ }
+ throw CTiglError("Invalid UID in CPACSCeilingPanels::GetCeilingPanelIndex", TIGL_UID_ERROR);
+ }
+
+ CCPACSDeckComponentBase& CPACSCeilingPanels::GetCeilingPanel(size_t index)
+ {
+ if (index < 1 || index > GetCeilingPanelCount()) {
+ throw CTiglError("Invalid index in std::vector>::GetCeilingPanel", TIGL_INDEX_ERROR);
+ }
+ index--;
+ return *m_ceilingPanels[index];
+ }
+
+ const CCPACSDeckComponentBase& CPACSCeilingPanels::GetCeilingPanel(size_t index) const
+ {
+ if (index < 1 || index > GetCeilingPanelCount()) {
+ throw CTiglError("Invalid index in std::vector>::GetCeilingPanel", TIGL_INDEX_ERROR);
+ }
+ index--;
+ return *m_ceilingPanels[index];
+ }
+
+ CCPACSDeckComponentBase& CPACSCeilingPanels::GetCeilingPanel(const std::string& UID)
+ {
+ for (auto& elem : m_ceilingPanels ) {
+ if (elem->GetUID() == UID)
+ return *elem;
+ }
+ throw CTiglError("Invalid UID in CPACSCeilingPanels::GetCeilingPanel. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR);
+ }
+
+ const CCPACSDeckComponentBase& CPACSCeilingPanels::GetCeilingPanel(const std::string& UID) const
+ {
+ for (auto& elem : m_ceilingPanels ) {
+ if (elem->GetUID() == UID)
+ return *elem;
+ }
+ throw CTiglError("Invalid UID in CPACSCeilingPanels::GetCeilingPanel. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR);
+ }
+
+
+ CCPACSDeckComponentBase& CPACSCeilingPanels::AddCeilingPanel()
+ {
+ m_ceilingPanels.push_back(std::make_unique(this, m_uidMgr));
+ return *m_ceilingPanels.back();
+ }
+
+ void CPACSCeilingPanels::RemoveCeilingPanel(CCPACSDeckComponentBase& ref)
+ {
+ for (std::size_t i = 0; i < m_ceilingPanels.size(); i++) {
+ if (m_ceilingPanels[i].get() == &ref) {
+ m_ceilingPanels.erase(m_ceilingPanels.begin() + i);
+ return;
+ }
+ }
+ throw CTiglError("Element not found");
+ }
+
+} // namespace generated
+} // namespace tigl
diff --git a/src/generated/CPACSCeilingPanels.h b/src/generated/CPACSCeilingPanels.h
new file mode 100644
index 0000000000..641d30ec62
--- /dev/null
+++ b/src/generated/CPACSCeilingPanels.h
@@ -0,0 +1,96 @@
+// 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 "tigl_internal.h"
+
+namespace tigl
+{
+class CTiglUIDManager;
+class CTiglUIDObject;
+class CCPACSDeckComponentBase;
+class CCPACSDeck;
+
+namespace generated
+{
+ // This class is used in:
+ // CPACSDeck
+
+ /// @brief Ceiling panels
+ ///
+ /// Ceiling panel instance collection type.
+ ///
+ class CPACSCeilingPanels
+ {
+ public:
+ TIGL_EXPORT CPACSCeilingPanels(CCPACSDeck* parent, CTiglUIDManager* uidMgr);
+
+ TIGL_EXPORT virtual ~CPACSCeilingPanels();
+
+ 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>& GetCeilingPanels() const;
+ TIGL_EXPORT virtual std::vector>& GetCeilingPanels();
+
+ TIGL_EXPORT virtual size_t GetCeilingPanelCount() const;
+ TIGL_EXPORT virtual size_t GetCeilingPanelIndex(const std::string& UID) const;
+
+ TIGL_EXPORT virtual const CCPACSDeckComponentBase& GetCeilingPanel(size_t index) const;
+ TIGL_EXPORT virtual CCPACSDeckComponentBase& GetCeilingPanel(size_t index);
+
+ TIGL_EXPORT virtual const CCPACSDeckComponentBase& GetCeilingPanel(const std::string& UID) const;
+ TIGL_EXPORT virtual CCPACSDeckComponentBase& GetCeilingPanel(const std::string& UID);
+
+ TIGL_EXPORT virtual CCPACSDeckComponentBase& AddCeilingPanel();
+ TIGL_EXPORT virtual void RemoveCeilingPanel(CCPACSDeckComponentBase& ref);
+
+ protected:
+ CCPACSDeck* m_parent;
+
+ CTiglUIDManager* m_uidMgr;
+
+ /// Ceiling panel
+ std::vector> m_ceilingPanels;
+
+ private:
+ CPACSCeilingPanels(const CPACSCeilingPanels&) = delete;
+ CPACSCeilingPanels& operator=(const CPACSCeilingPanels&) = delete;
+
+ CPACSCeilingPanels(CPACSCeilingPanels&&) = delete;
+ CPACSCeilingPanels& operator=(CPACSCeilingPanels&&) = delete;
+ };
+} // namespace generated
+
+// Aliases in tigl namespace
+using CCPACSCeilingPanels = generated::CPACSCeilingPanels;
+} // namespace tigl
diff --git a/src/generated/CPACSClassDividerElements.cpp b/src/generated/CPACSClassDividerElements.cpp
index f7d0e3c216..74b531f572 100644
--- a/src/generated/CPACSClassDividerElements.cpp
+++ b/src/generated/CPACSClassDividerElements.cpp
@@ -17,8 +17,8 @@
#include