+ P* GetParent()
+ {
+ static_assert(std::is_same::value || std::is_same
::value || std::is_same
::value || std::is_same
::value || std::is_same
::value || std::is_same
::value, "template argument for P is not a parent class of CPACSDeckElementBase");
+ if (!IsParent
()) {
+ throw CTiglError("bad parent");
+ }
+ return static_cast
(m_parent);
+ }
+
+ template
+ const P* GetParent() const
+ {
+ static_assert(std::is_same::value || std::is_same
::value || std::is_same
::value || std::is_same
::value || std::is_same
::value || std::is_same
::value, "template argument for P is not a parent class of CPACSDeckElementBase");
+ if (!IsParent
()) {
+ throw CTiglError("bad parent");
+ }
+ return static_cast
(m_parent);
+ }
+
+ 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 CPACSDeckElementGeometry& GetGeometry() const;
+ TIGL_EXPORT virtual CPACSDeckElementGeometry& GetGeometry();
+
+ TIGL_EXPORT virtual const boost::optional& GetMass() const;
+ TIGL_EXPORT virtual boost::optional& GetMass();
+
+ TIGL_EXPORT virtual CPACSDeckElementMass& GetMass(CreateIfNotExistsTag);
+ TIGL_EXPORT virtual void RemoveMass();
+
+ protected:
+ void* m_parent;
+ const std::type_info* m_parentType;
+
+ CTiglUIDManager* m_uidMgr;
+
+ std::string m_uID;
+
+ /// Description
+ boost::optional m_description;
+
+ CPACSDeckElementGeometry m_geometry;
+
+ boost::optional m_mass;
+
+ private:
+ CPACSDeckElementBase(const CPACSDeckElementBase&) = delete;
+ CPACSDeckElementBase& operator=(const CPACSDeckElementBase&) = delete;
+
+ CPACSDeckElementBase(CPACSDeckElementBase&&) = delete;
+ CPACSDeckElementBase& operator=(CPACSDeckElementBase&&) = delete;
+ };
+} // namespace generated
+
+// Aliases in tigl namespace
+using CCPACSDeckElementBase = generated::CPACSDeckElementBase;
+using CCPACSCeilingPanelElements = generated::CPACSCeilingPanelElements;
+using CCPACSClassDividerElements = generated::CPACSClassDividerElements;
+using CCPACSGenericFloorElements = generated::CPACSGenericFloorElements;
+using CCPACSLavatoryElements = generated::CPACSLavatoryElements;
+using CCPACSLuggageCompartmentElements = generated::CPACSLuggageCompartmentElements;
+using CCPACSSidewallPanelElements = generated::CPACSSidewallPanelElements;
+} // namespace tigl
diff --git a/src/generated/CPACSDeckElementGeometry.cpp b/src/generated/CPACSDeckElementGeometry.cpp
new file mode 100644
index 000000000..beb1223ab
--- /dev/null
+++ b/src/generated/CPACSDeckElementGeometry.cpp
@@ -0,0 +1,239 @@
+// 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 "CPACSDeckElementBase.h"
+#include "CPACSDeckElementGeometry.h"
+#include "CPACSGalleyElement.h"
+#include "CPACSSeatElement.h"
+#include "CTiglError.h"
+#include "CTiglLogging.h"
+#include "CTiglUIDManager.h"
+#include "CTiglUIDObject.h"
+#include "TixiHelper.h"
+
+namespace tigl
+{
+namespace generated
+{
+ CPACSDeckElementGeometry::CPACSDeckElementGeometry(CPACSDeckElementBase* parent, CTiglUIDManager* uidMgr)
+ : m_uidMgr(uidMgr)
+ {
+ //assert(parent != NULL);
+ m_parent = parent;
+ m_parentType = &typeid(CPACSDeckElementBase);
+ }
+
+ CPACSDeckElementGeometry::CPACSDeckElementGeometry(CPACSGalleyElement* parent, CTiglUIDManager* uidMgr)
+ : m_uidMgr(uidMgr)
+ {
+ //assert(parent != NULL);
+ m_parent = parent;
+ m_parentType = &typeid(CPACSGalleyElement);
+ }
+
+ CPACSDeckElementGeometry::CPACSDeckElementGeometry(CPACSSeatElement* parent, CTiglUIDManager* uidMgr)
+ : m_uidMgr(uidMgr)
+ {
+ //assert(parent != NULL);
+ m_parent = parent;
+ m_parentType = &typeid(CPACSSeatElement);
+ }
+
+ CPACSDeckElementGeometry::~CPACSDeckElementGeometry()
+ {
+ }
+
+ const CTiglUIDObject* CPACSDeckElementGeometry::GetNextUIDParent() const
+ {
+ if (m_parent) {
+ if (IsParent()) {
+ return GetParent();
+ }
+ if (IsParent()) {
+ return GetParent();
+ }
+ if (IsParent()) {
+ return GetParent();
+ }
+ }
+ return nullptr;
+ }
+
+ CTiglUIDObject* CPACSDeckElementGeometry::GetNextUIDParent()
+ {
+ if (m_parent) {
+ if (IsParent()) {
+ return GetParent();
+ }
+ if (IsParent()) {
+ return GetParent();
+ }
+ if (IsParent()) {
+ return GetParent();
+ }
+ }
+ return nullptr;
+ }
+
+ CTiglUIDManager& CPACSDeckElementGeometry::GetUIDManager()
+ {
+ if (!m_uidMgr) {
+ throw CTiglError("UIDManager is null");
+ }
+ return *m_uidMgr;
+ }
+
+ const CTiglUIDManager& CPACSDeckElementGeometry::GetUIDManager() const
+ {
+ if (!m_uidMgr) {
+ throw CTiglError("UIDManager is null");
+ }
+ return *m_uidMgr;
+ }
+
+ void CPACSDeckElementGeometry::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath)
+ {
+ // read element genericGeometryComponent
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/genericGeometryComponent")) {
+ m_genericGeometryComponent_choice1 = boost::in_place(this, m_uidMgr);
+ try {
+ m_genericGeometryComponent_choice1->ReadCPACS(tixiHandle, xpath + "/genericGeometryComponent");
+ } catch(const std::exception& e) {
+ LOG(ERROR) << "Failed to read genericGeometryComponent at xpath " << xpath << ": " << e.what();
+ m_genericGeometryComponent_choice1 = boost::none;
+ }
+ }
+
+ // read element boundingBox
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/boundingBox")) {
+ m_boundingBox_choice2 = boost::in_place(this, m_uidMgr);
+ try {
+ m_boundingBox_choice2->ReadCPACS(tixiHandle, xpath + "/boundingBox");
+ } catch(const std::exception& e) {
+ LOG(ERROR) << "Failed to read boundingBox at xpath " << xpath << ": " << e.what();
+ m_boundingBox_choice2 = boost::none;
+ }
+ }
+
+ if (!ValidateChoices()) {
+ LOG(ERROR) << "Invalid choice configuration at xpath " << xpath;
+ }
+ }
+
+ void CPACSDeckElementGeometry::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const
+ {
+ // write element genericGeometryComponent
+ if (m_genericGeometryComponent_choice1) {
+ tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/genericGeometryComponent");
+ m_genericGeometryComponent_choice1->WriteCPACS(tixiHandle, xpath + "/genericGeometryComponent");
+ }
+ else {
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/genericGeometryComponent")) {
+ tixi::TixiRemoveElement(tixiHandle, xpath + "/genericGeometryComponent");
+ }
+ }
+
+ // write element boundingBox
+ if (m_boundingBox_choice2) {
+ tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/boundingBox");
+ m_boundingBox_choice2->WriteCPACS(tixiHandle, xpath + "/boundingBox");
+ }
+ else {
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/boundingBox")) {
+ tixi::TixiRemoveElement(tixiHandle, xpath + "/boundingBox");
+ }
+ }
+
+ }
+
+ bool CPACSDeckElementGeometry::ValidateChoices() const
+ {
+ return
+ (
+ (
+ (
+ // mandatory elements of this choice must be there
+ m_genericGeometryComponent_choice1.is_initialized()
+ &&
+ // elements of other choices must not be there
+ !(
+ m_boundingBox_choice2.is_initialized()
+ )
+ )
+ +
+ (
+ // mandatory elements of this choice must be there
+ m_boundingBox_choice2.is_initialized()
+ &&
+ // elements of other choices must not be there
+ !(
+ m_genericGeometryComponent_choice1.is_initialized()
+ )
+ )
+ == 1
+ )
+ )
+ ;
+ }
+
+ const boost::optional& CPACSDeckElementGeometry::GetGenericGeometryComponent_choice1() const
+ {
+ return m_genericGeometryComponent_choice1;
+ }
+
+ boost::optional& CPACSDeckElementGeometry::GetGenericGeometryComponent_choice1()
+ {
+ return m_genericGeometryComponent_choice1;
+ }
+
+ const boost::optional& CPACSDeckElementGeometry::GetBoundingBox_choice2() const
+ {
+ return m_boundingBox_choice2;
+ }
+
+ boost::optional& CPACSDeckElementGeometry::GetBoundingBox_choice2()
+ {
+ return m_boundingBox_choice2;
+ }
+
+ CPACSGenericGeometryComponent& CPACSDeckElementGeometry::GetGenericGeometryComponent_choice1(CreateIfNotExistsTag)
+ {
+ if (!m_genericGeometryComponent_choice1)
+ m_genericGeometryComponent_choice1 = boost::in_place(this, m_uidMgr);
+ return *m_genericGeometryComponent_choice1;
+ }
+
+ void CPACSDeckElementGeometry::RemoveGenericGeometryComponent_choice1()
+ {
+ m_genericGeometryComponent_choice1 = boost::none;
+ }
+
+ CPACSBoundingBox& CPACSDeckElementGeometry::GetBoundingBox_choice2(CreateIfNotExistsTag)
+ {
+ if (!m_boundingBox_choice2)
+ m_boundingBox_choice2 = boost::in_place(this, m_uidMgr);
+ return *m_boundingBox_choice2;
+ }
+
+ void CPACSDeckElementGeometry::RemoveBoundingBox_choice2()
+ {
+ m_boundingBox_choice2 = boost::none;
+ }
+
+} // namespace generated
+} // namespace tigl
diff --git a/src/generated/CPACSDeckElementGeometry.h b/src/generated/CPACSDeckElementGeometry.h
new file mode 100644
index 000000000..f9fdf9256
--- /dev/null
+++ b/src/generated/CPACSDeckElementGeometry.h
@@ -0,0 +1,132 @@
+// 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 "CPACSBoundingBox.h"
+#include "CPACSGenericGeometryComponent.h"
+#include "CreateIfNotExists.h"
+#include "CTiglError.h"
+#include "tigl_internal.h"
+
+namespace tigl
+{
+class CTiglUIDManager;
+class CTiglUIDObject;
+
+namespace generated
+{
+ class CPACSDeckElementBase;
+ class CPACSGalleyElement;
+ class CPACSSeatElement;
+
+ // This class is used in:
+ // CPACSDeckElementBase
+ // CPACSGalleyElement
+ // CPACSSeatElement
+
+ /// @brief Geometry
+ ///
+ /// Description of the deck element geometry. This might be either a bounding box definition or a link to a generic geometry component.
+ ///
+ class CPACSDeckElementGeometry
+ {
+ public:
+ TIGL_EXPORT CPACSDeckElementGeometry(CPACSDeckElementBase* parent, CTiglUIDManager* uidMgr);
+ TIGL_EXPORT CPACSDeckElementGeometry(CPACSGalleyElement* parent, CTiglUIDManager* uidMgr);
+ TIGL_EXPORT CPACSDeckElementGeometry(CPACSSeatElement* parent, CTiglUIDManager* uidMgr);
+
+ TIGL_EXPORT virtual ~CPACSDeckElementGeometry();
+
+ template
+ bool IsParent() const
+ {
+ return m_parentType != NULL && *m_parentType == typeid(P);
+ }
+
+ template
+ P* GetParent()
+ {
+ static_assert(std::is_same::value || std::is_same
::value || std::is_same
::value, "template argument for P is not a parent class of CPACSDeckElementGeometry");
+ if (!IsParent
()) {
+ throw CTiglError("bad parent");
+ }
+ return static_cast
(m_parent);
+ }
+
+ template
+ const P* GetParent() const
+ {
+ static_assert(std::is_same::value || std::is_same
::value || std::is_same
::value, "template argument for P is not a parent class of CPACSDeckElementGeometry");
+ if (!IsParent
()) {
+ throw CTiglError("bad parent");
+ }
+ return static_cast
(m_parent);
+ }
+
+ 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 bool ValidateChoices() const;
+
+ TIGL_EXPORT virtual const boost::optional& GetGenericGeometryComponent_choice1() const;
+ TIGL_EXPORT virtual boost::optional& GetGenericGeometryComponent_choice1();
+
+ TIGL_EXPORT virtual const boost::optional& GetBoundingBox_choice2() const;
+ TIGL_EXPORT virtual boost::optional& GetBoundingBox_choice2();
+
+ TIGL_EXPORT virtual CPACSGenericGeometryComponent& GetGenericGeometryComponent_choice1(CreateIfNotExistsTag);
+ TIGL_EXPORT virtual void RemoveGenericGeometryComponent_choice1();
+
+ TIGL_EXPORT virtual CPACSBoundingBox& GetBoundingBox_choice2(CreateIfNotExistsTag);
+ TIGL_EXPORT virtual void RemoveBoundingBox_choice2();
+
+ protected:
+ void* m_parent;
+ const std::type_info* m_parentType;
+
+ CTiglUIDManager* m_uidMgr;
+
+ boost::optional m_genericGeometryComponent_choice1;
+ boost::optional m_boundingBox_choice2;
+
+ private:
+ CPACSDeckElementGeometry(const CPACSDeckElementGeometry&) = delete;
+ CPACSDeckElementGeometry& operator=(const CPACSDeckElementGeometry&) = delete;
+
+ CPACSDeckElementGeometry(CPACSDeckElementGeometry&&) = delete;
+ CPACSDeckElementGeometry& operator=(CPACSDeckElementGeometry&&) = delete;
+ };
+} // namespace generated
+
+// Aliases in tigl namespace
+using CCPACSDeckElementGeometry = generated::CPACSDeckElementGeometry;
+using CCPACSDeckElementBase = generated::CPACSDeckElementBase;
+using CCPACSGalleyElement = generated::CPACSGalleyElement;
+using CCPACSSeatElement = generated::CPACSSeatElement;
+} // namespace tigl
diff --git a/src/generated/CPACSDeckElementMass.cpp b/src/generated/CPACSDeckElementMass.cpp
new file mode 100644
index 000000000..332a91ebb
--- /dev/null
+++ b/src/generated/CPACSDeckElementMass.cpp
@@ -0,0 +1,280 @@
+// 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 "CPACSDeckElementBase.h"
+#include "CPACSDeckElementMass.h"
+#include "CPACSGalleyElement.h"
+#include "CPACSSeatElement.h"
+#include "CTiglError.h"
+#include "CTiglLogging.h"
+#include "CTiglUIDManager.h"
+#include "TixiHelper.h"
+
+namespace tigl
+{
+namespace generated
+{
+ CPACSDeckElementMass::CPACSDeckElementMass(CPACSCargoContainerElement* parent, CTiglUIDManager* uidMgr)
+ : m_uidMgr(uidMgr)
+ , m_mass(0)
+ {
+ //assert(parent != NULL);
+ m_parent = parent;
+ m_parentType = &typeid(CPACSCargoContainerElement);
+ }
+
+ CPACSDeckElementMass::CPACSDeckElementMass(CPACSDeckElementBase* parent, CTiglUIDManager* uidMgr)
+ : m_uidMgr(uidMgr)
+ , m_mass(0)
+ {
+ //assert(parent != NULL);
+ m_parent = parent;
+ m_parentType = &typeid(CPACSDeckElementBase);
+ }
+
+ CPACSDeckElementMass::CPACSDeckElementMass(CPACSGalleyElement* parent, CTiglUIDManager* uidMgr)
+ : m_uidMgr(uidMgr)
+ , m_mass(0)
+ {
+ //assert(parent != NULL);
+ m_parent = parent;
+ m_parentType = &typeid(CPACSGalleyElement);
+ }
+
+ CPACSDeckElementMass::CPACSDeckElementMass(CPACSSeatElement* parent, CTiglUIDManager* uidMgr)
+ : m_uidMgr(uidMgr)
+ , m_mass(0)
+ {
+ //assert(parent != NULL);
+ m_parent = parent;
+ m_parentType = &typeid(CPACSSeatElement);
+ }
+
+ CPACSDeckElementMass::~CPACSDeckElementMass()
+ {
+ if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID);
+ }
+
+ const CTiglUIDObject* CPACSDeckElementMass::GetNextUIDParent() const
+ {
+ if (m_parent) {
+ if (IsParent()) {
+ return GetParent();
+ }
+ if (IsParent()) {
+ return GetParent();
+ }
+ if (IsParent()) {
+ return GetParent();
+ }
+ if (IsParent()) {
+ return GetParent();
+ }
+ }
+ return nullptr;
+ }
+
+ CTiglUIDObject* CPACSDeckElementMass::GetNextUIDParent()
+ {
+ if (m_parent) {
+ if (IsParent()) {
+ return GetParent();
+ }
+ if (IsParent()) {
+ return GetParent();
+ }
+ if (IsParent()) {
+ return GetParent();
+ }
+ if (IsParent()) {
+ return GetParent();
+ }
+ }
+ return nullptr;
+ }
+
+ CTiglUIDManager& CPACSDeckElementMass::GetUIDManager()
+ {
+ if (!m_uidMgr) {
+ throw CTiglError("UIDManager is null");
+ }
+ return *m_uidMgr;
+ }
+
+ const CTiglUIDManager& CPACSDeckElementMass::GetUIDManager() const
+ {
+ if (!m_uidMgr) {
+ throw CTiglError("UIDManager is null");
+ }
+ return *m_uidMgr;
+ }
+
+ void CPACSDeckElementMass::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 mass
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/mass")) {
+ m_mass = tixi::TixiGetElement(tixiHandle, xpath + "/mass");
+ }
+ else {
+ LOG(ERROR) << "Required element mass is missing at xpath " << xpath;
+ }
+
+ // read element location
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/location")) {
+ m_location = boost::in_place(this, m_uidMgr);
+ try {
+ m_location->ReadCPACS(tixiHandle, xpath + "/location");
+ } catch(const std::exception& e) {
+ LOG(ERROR) << "Failed to read location at xpath " << xpath << ": " << e.what();
+ m_location = boost::none;
+ }
+ }
+
+ // read element massInertia
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/massInertia")) {
+ m_massInertia = boost::in_place(this);
+ try {
+ m_massInertia->ReadCPACS(tixiHandle, xpath + "/massInertia");
+ } catch(const std::exception& e) {
+ LOG(ERROR) << "Failed to read massInertia at xpath " << xpath << ": " << e.what();
+ m_massInertia = boost::none;
+ }
+ }
+
+ if (m_uidMgr && !m_uID.empty()) m_uidMgr->RegisterObject(m_uID, *this);
+ }
+
+ void CPACSDeckElementMass::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const
+ {
+ // write attribute uID
+ tixi::TixiSaveAttribute(tixiHandle, xpath, "uID", m_uID);
+
+ // write element mass
+ tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/mass");
+ tixi::TixiSaveElement(tixiHandle, xpath + "/mass", m_mass);
+
+ // write element location
+ if (m_location) {
+ tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/location");
+ m_location->WriteCPACS(tixiHandle, xpath + "/location");
+ }
+ else {
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/location")) {
+ tixi::TixiRemoveElement(tixiHandle, xpath + "/location");
+ }
+ }
+
+ // write element massInertia
+ if (m_massInertia) {
+ tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/massInertia");
+ m_massInertia->WriteCPACS(tixiHandle, xpath + "/massInertia");
+ }
+ else {
+ if (tixi::TixiCheckElement(tixiHandle, xpath + "/massInertia")) {
+ tixi::TixiRemoveElement(tixiHandle, xpath + "/massInertia");
+ }
+ }
+
+ }
+
+ const std::string& CPACSDeckElementMass::GetUID() const
+ {
+ return m_uID;
+ }
+
+ void CPACSDeckElementMass::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 double& CPACSDeckElementMass::GetMass() const
+ {
+ return m_mass;
+ }
+
+ void CPACSDeckElementMass::SetMass(const double& value)
+ {
+ m_mass = value;
+ }
+
+ const boost::optional& CPACSDeckElementMass::GetLocation() const
+ {
+ return m_location;
+ }
+
+ boost::optional& CPACSDeckElementMass::GetLocation()
+ {
+ return m_location;
+ }
+
+ const boost::optional& CPACSDeckElementMass::GetMassInertia() const
+ {
+ return m_massInertia;
+ }
+
+ boost::optional& CPACSDeckElementMass::GetMassInertia()
+ {
+ return m_massInertia;
+ }
+
+ CCPACSPoint& CPACSDeckElementMass::GetLocation(CreateIfNotExistsTag)
+ {
+ if (!m_location)
+ m_location = boost::in_place(this, m_uidMgr);
+ return *m_location;
+ }
+
+ void CPACSDeckElementMass::RemoveLocation()
+ {
+ m_location = boost::none;
+ }
+
+ CPACSMassInertia& CPACSDeckElementMass::GetMassInertia(CreateIfNotExistsTag)
+ {
+ if (!m_massInertia)
+ m_massInertia = boost::in_place(this);
+ return *m_massInertia;
+ }
+
+ void CPACSDeckElementMass::RemoveMassInertia()
+ {
+ m_massInertia = boost::none;
+ }
+
+} // namespace generated
+} // namespace tigl
diff --git a/src/generated/CPACSDeckElementMass.h b/src/generated/CPACSDeckElementMass.h
new file mode 100644
index 000000000..c8c5da903
--- /dev/null
+++ b/src/generated/CPACSDeckElementMass.h
@@ -0,0 +1,147 @@
+// 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