diff --git a/bindings/python_internal/configuration.i b/bindings/python_internal/configuration.i index a436d12a0..d7049d34a 100644 --- a/bindings/python_internal/configuration.i +++ b/bindings/python_internal/configuration.i @@ -90,7 +90,6 @@ #include "generated/CPACSWallPositionUIDs.h" #include "generated/CPACSWallPosition.h" #include "generated/CPACSWallPositions.h" -#include "generated/CPACSWallSegment_phi.h" #include "generated/CPACSWallSegment.h" #include "generated/CPACSWallSegments.h" #include "generated/CPACSUIDSequence.h" @@ -130,7 +129,6 @@ %boost_optional(tigl::CCPACSWingRibsDefinitions) %boost_optional(tigl::CCPACSWingSpars) %boost_optional(tigl::generated::CPACSGuideCurve_continuity) -%boost_optional(tigl::CCPACSRectangleProfile_cornerRadius) %boost_optional(tigl::CCPACSRectangleProfile) %boost_optional(tigl::CCPACSStandardProfile) %boost_optional(tigl::CCPACSWingProfileCST) @@ -187,7 +185,6 @@ %include "generated/CPACSWallPositionUIDs.h" %include "generated/CPACSWallPosition.h" %include "generated/CPACSWallPositions.h" -%include "generated/CPACSWallSegment_phi.h" %include "generated/CPACSWallSegment.h" %include "generated/CPACSWallSegments.h" %boost_optional(tigl::generated::CPACSWalls) @@ -405,7 +402,6 @@ class CCPACSWingRibsPositioning; %include "generated/CPACSCst2D.h" %include "ITiglWingProfileAlgo.h" %include "generated/CPACSPosExcl0DoubleBase.h" -%include "generated/CPACSRectangleProfile_cornerRadius.h" %include "generated/CPACSRectangleProfile.h" %include "generated/CPACSStandardProfile.h" //TODO: Need to replace with implementation CCPACSStandardProfile.h, once it exists. %include "CCPACSWingProfileCST.h" diff --git a/cpacs_gen_input/cpacs_schema.xsd b/cpacs_gen_input/cpacs_schema.xsd index 7718e76a4..c60f06237 100644 --- a/cpacs_gen_input/cpacs_schema.xsd +++ b/cpacs_gen_input/cpacs_schema.xsd @@ -6,7 +6,7 @@ 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 -f + 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, diff --git a/cpacs_gen_input/cpacs_schema.xsd.orig b/cpacs_gen_input/cpacs_schema.xsd.orig index e45ec99d5..1b52e072e 100644 --- a/cpacs_gen_input/cpacs_schema.xsd.orig +++ b/cpacs_gen_input/cpacs_schema.xsd.orig @@ -47,7 +47,7 @@ marko.alder@dlr.de Date - 2020-06-03 + 2020-11-27 diff --git a/src/CCPACSStringVector.cpp b/src/CCPACSStringVector.cpp index 237fdc07a..b8bc147ff 100644 --- a/src/CCPACSStringVector.cpp +++ b/src/CCPACSStringVector.cpp @@ -72,12 +72,12 @@ CCPACSStringVector::CCPACSStringVector(CCPACSTrackJointPosition* parent) void CCPACSStringVector::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) { generated::CPACSStringVectorBase::ReadCPACS(tixiHandle, xpath); - m_vec = stringToDoubleVec(m_simpleContent); + m_vec = stringToDoubleVec(m_value); } void CCPACSStringVector::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const { - const_cast(m_simpleContent) = + const_cast(m_value) = vecToString(std::begin(m_vec), std::end(m_vec), sep); // TODO: this is a terrible hack, but WriteCPACS() has to be const generated::CPACSStringVectorBase::WriteCPACS(tixiHandle, xpath); } diff --git a/src/cpacs_other/CCPACSExternalObject.cpp b/src/cpacs_other/CCPACSExternalObject.cpp index 8ab97a700..d02fa31e8 100644 --- a/src/cpacs_other/CCPACSExternalObject.cpp +++ b/src/cpacs_other/CCPACSExternalObject.cpp @@ -77,7 +77,7 @@ void CCPACSExternalObject::ReadCPACS(const TixiDocumentHandle& tixiHandle, const char* cCPACSPath = NULL; tixiGetDocumentPath(tixiHandle, &cCPACSPath); - _filePath = getPathRelativeToApp(cCPACSPath ? cCPACSPath : "", m_linkToFile.GetSimpleContent()); + _filePath = getPathRelativeToApp(cCPACSPath ? cCPACSPath : "", m_linkToFile.GetValue()); // test if file can be read if (!IsFileReadable(_filePath)) { diff --git a/src/generated/CPACSCompartment.cpp b/src/generated/CPACSCompartment.cpp index c2e5834a2..851ef6009 100644 --- a/src/generated/CPACSCompartment.cpp +++ b/src/generated/CPACSCompartment.cpp @@ -118,13 +118,7 @@ namespace generated // read element designVolume if (tixi::TixiCheckElement(tixiHandle, xpath + "/designVolume")) { - m_designVolume = boost::in_place(this); - try { - m_designVolume->ReadCPACS(tixiHandle, xpath + "/designVolume"); - } catch(const std::exception& e) { - LOG(ERROR) << "Failed to read designVolume at xpath " << xpath << ": " << e.what(); - m_designVolume = boost::none; - } + m_designVolume = tixi::TixiGetElement(tixiHandle, xpath + "/designVolume"); } if (m_uidMgr && m_uID) m_uidMgr->RegisterObject(*m_uID, *this); @@ -171,7 +165,7 @@ namespace generated // write element designVolume if (m_designVolume) { tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/designVolume"); - m_designVolume->WriteCPACS(tixiHandle, xpath + "/designVolume"); + tixi::TixiSaveElement(tixiHandle, xpath + "/designVolume", *m_designVolume); } else { if (tixi::TixiCheckElement(tixiHandle, xpath + "/designVolume")) { @@ -232,26 +226,14 @@ namespace generated m_description = value; } - const boost::optional& CPACSCompartment::GetDesignVolume() const - { - return m_designVolume; - } - - boost::optional& CPACSCompartment::GetDesignVolume() + const boost::optional& CPACSCompartment::GetDesignVolume() const { return m_designVolume; } - CPACSCompartment_designVolume& CPACSCompartment::GetDesignVolume(CreateIfNotExistsTag) - { - if (!m_designVolume) - m_designVolume = boost::in_place(this); - return *m_designVolume; - } - - void CPACSCompartment::RemoveDesignVolume() + void CPACSCompartment::SetDesignVolume(const boost::optional& value) { - m_designVolume = boost::none; + m_designVolume = value; } } // namespace generated diff --git a/src/generated/CPACSCompartment.h b/src/generated/CPACSCompartment.h index 6a7fac8f5..5ff8ebb51 100644 --- a/src/generated/CPACSCompartment.h +++ b/src/generated/CPACSCompartment.h @@ -22,8 +22,6 @@ #include #include #include "CPACSCompartmentGeometry.h" -#include "CPACSCompartment_designVolume.h" -#include "CreateIfNotExists.h" #include "CTiglUIDObject.h" #include "tigl_internal.h" @@ -70,30 +68,27 @@ namespace generated TIGL_EXPORT virtual const boost::optional& GetDescription() const; TIGL_EXPORT virtual void SetDescription(const boost::optional& value); - TIGL_EXPORT virtual const boost::optional& GetDesignVolume() const; - TIGL_EXPORT virtual boost::optional& GetDesignVolume(); - - TIGL_EXPORT virtual CPACSCompartment_designVolume& GetDesignVolume(CreateIfNotExistsTag); - TIGL_EXPORT virtual void RemoveDesignVolume(); + TIGL_EXPORT virtual const boost::optional& GetDesignVolume() const; + TIGL_EXPORT virtual void SetDesignVolume(const boost::optional& value); protected: CPACSCompartments* m_parent; CTiglUIDManager* m_uidMgr; - boost::optional m_uID; + boost::optional m_uID; /// Compartment geometry uIDs list. - CPACSCompartmentGeometry m_geometry; + CPACSCompartmentGeometry m_geometry; /// Name of the compartment. - boost::optional m_name; + boost::optional m_name; /// Description of the compartment. - boost::optional m_description; + boost::optional m_description; /// Ideal design volume of the compartment. - boost::optional m_designVolume; + boost::optional m_designVolume; private: CPACSCompartment(const CPACSCompartment&) = delete; diff --git a/src/generated/CPACSCompartment_designVolume.cpp b/src/generated/CPACSCompartment_designVolume.cpp deleted file mode 100644 index 26ee5cf96..000000000 --- a/src/generated/CPACSCompartment_designVolume.cpp +++ /dev/null @@ -1,103 +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 "CPACSCompartment.h" -#include "CPACSCompartment_designVolume.h" -#include "CTiglError.h" -#include "CTiglLogging.h" -#include "CTiglUIDObject.h" -#include "TixiHelper.h" - -namespace tigl -{ -namespace generated -{ - CPACSCompartment_designVolume::CPACSCompartment_designVolume(CPACSCompartment* parent) - : m_simpleContent(0) - { - //assert(parent != NULL); - m_parent = parent; - } - - CPACSCompartment_designVolume::~CPACSCompartment_designVolume() - { - } - - const CPACSCompartment* CPACSCompartment_designVolume::GetParent() const - { - return m_parent; - } - - CPACSCompartment* CPACSCompartment_designVolume::GetParent() - { - return m_parent; - } - - const CTiglUIDObject* CPACSCompartment_designVolume::GetNextUIDParent() const - { - if (m_parent) { - if (m_parent->GetUID()) - return m_parent; - else - return m_parent->GetNextUIDParent(); - } - return nullptr; - } - - CTiglUIDObject* CPACSCompartment_designVolume::GetNextUIDParent() - { - if (m_parent) { - if (m_parent->GetUID()) - return m_parent; - else - return m_parent->GetNextUIDParent(); - } - return nullptr; - } - - void CPACSCompartment_designVolume::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) - { - // read simpleContent - if (tixi::TixiCheckElement(tixiHandle, xpath)) { - m_simpleContent = tixi::TixiGetElement(tixiHandle, xpath); - } - else { - LOG(ERROR) << "Required simpleContent is missing at xpath " << xpath; - } - - } - - void CPACSCompartment_designVolume::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const - { - // write simpleContent - tixi::TixiSaveElement(tixiHandle, xpath, m_simpleContent); - - } - - const double& CPACSCompartment_designVolume::GetSimpleContent() const - { - return m_simpleContent; - } - - void CPACSCompartment_designVolume::SetSimpleContent(const double& value) - { - m_simpleContent = value; - } - -} // namespace generated -} // namespace tigl diff --git a/src/generated/CPACSCompartment_designVolume.h b/src/generated/CPACSCompartment_designVolume.h deleted file mode 100644 index 757dc4ff2..000000000 --- a/src/generated/CPACSCompartment_designVolume.h +++ /dev/null @@ -1,72 +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 "tigl_internal.h" - -namespace tigl -{ -class CTiglUIDObject; - -namespace generated -{ - class CPACSCompartment; - - // This class is used in: - // CPACSCompartment - - class CPACSCompartment_designVolume - { - public: - TIGL_EXPORT CPACSCompartment_designVolume(CPACSCompartment* parent); - - TIGL_EXPORT virtual ~CPACSCompartment_designVolume(); - - TIGL_EXPORT CPACSCompartment* GetParent(); - - TIGL_EXPORT const CPACSCompartment* 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 double& GetSimpleContent() const; - TIGL_EXPORT virtual void SetSimpleContent(const double& value); - - protected: - CPACSCompartment* m_parent; - - double m_simpleContent; - - private: - CPACSCompartment_designVolume(const CPACSCompartment_designVolume&) = delete; - CPACSCompartment_designVolume& operator=(const CPACSCompartment_designVolume&) = delete; - - CPACSCompartment_designVolume(CPACSCompartment_designVolume&&) = delete; - CPACSCompartment_designVolume& operator=(CPACSCompartment_designVolume&&) = delete; - }; -} // namespace generated - -// Aliases in tigl namespace -using CCPACSCompartment_designVolume = generated::CPACSCompartment_designVolume; -using CCPACSCompartment = generated::CPACSCompartment; -} // namespace tigl diff --git a/src/generated/CPACSDoubleConstraintBase.cpp b/src/generated/CPACSDoubleConstraintBase.cpp index 0016337d9..8bc09597c 100644 --- a/src/generated/CPACSDoubleConstraintBase.cpp +++ b/src/generated/CPACSDoubleConstraintBase.cpp @@ -28,7 +28,7 @@ namespace tigl namespace generated { CPACSDoubleConstraintBase::CPACSDoubleConstraintBase(CPACSPointPerformanceConstraints* parent) - : m_simpleContent(0) + : m_value(0) { //assert(parent != NULL); m_parent = parent; @@ -76,7 +76,7 @@ namespace generated // read simpleContent if (tixi::TixiCheckElement(tixiHandle, xpath)) { - m_simpleContent = tixi::TixiGetElement(tixiHandle, xpath); + m_value = tixi::TixiGetElement(tixiHandle, xpath); } else { LOG(ERROR) << "Required simpleContent is missing at xpath " << xpath; @@ -90,7 +90,7 @@ namespace generated tixi::TixiSaveAttribute(tixiHandle, xpath, "relationalOperator", CPACSRelationalOperatorToString(m_relationalOperator)); // write simpleContent - tixi::TixiSaveElement(tixiHandle, xpath, m_simpleContent); + tixi::TixiSaveElement(tixiHandle, xpath, m_value); } @@ -104,14 +104,14 @@ namespace generated m_relationalOperator = value; } - const double& CPACSDoubleConstraintBase::GetSimpleContent() const + const double& CPACSDoubleConstraintBase::GetValue() const { - return m_simpleContent; + return m_value; } - void CPACSDoubleConstraintBase::SetSimpleContent(const double& value) + void CPACSDoubleConstraintBase::SetValue(const double& value) { - m_simpleContent = value; + m_value = value; } } // namespace generated diff --git a/src/generated/CPACSDoubleConstraintBase.h b/src/generated/CPACSDoubleConstraintBase.h index 63842ffdd..a8cb631a3 100644 --- a/src/generated/CPACSDoubleConstraintBase.h +++ b/src/generated/CPACSDoubleConstraintBase.h @@ -58,14 +58,14 @@ namespace generated TIGL_EXPORT virtual const CPACSRelationalOperator& GetRelationalOperator() const; TIGL_EXPORT virtual void SetRelationalOperator(const CPACSRelationalOperator& value); - TIGL_EXPORT virtual const double& GetSimpleContent() const; - TIGL_EXPORT virtual void SetSimpleContent(const double& value); + TIGL_EXPORT virtual const double& GetValue() const; + TIGL_EXPORT virtual void SetValue(const double& value); protected: CPACSPointPerformanceConstraints* m_parent; CPACSRelationalOperator m_relationalOperator; - double m_simpleContent; + double m_value; private: CPACSDoubleConstraintBase(const CPACSDoubleConstraintBase&) = delete; diff --git a/src/generated/CPACSLinkToFile.cpp b/src/generated/CPACSLinkToFile.cpp index 29b79a513..3fa30141b 100644 --- a/src/generated/CPACSLinkToFile.cpp +++ b/src/generated/CPACSLinkToFile.cpp @@ -66,8 +66,8 @@ namespace generated // read simpleContent if (tixi::TixiCheckElement(tixiHandle, xpath)) { - m_simpleContent = tixi::TixiGetElement(tixiHandle, xpath); - if (m_simpleContent.empty()) { + m_value = tixi::TixiGetElement(tixiHandle, xpath); + if (m_value.empty()) { LOG(WARNING) << "Required element is empty at xpath " << xpath; } } @@ -90,7 +90,7 @@ namespace generated } // write simpleContent - tixi::TixiSaveElement(tixiHandle, xpath, m_simpleContent); + tixi::TixiSaveElement(tixiHandle, xpath, m_value); } @@ -104,14 +104,14 @@ namespace generated m_format = value; } - const std::string& CPACSLinkToFile::GetSimpleContent() const + const std::string& CPACSLinkToFile::GetValue() const { - return m_simpleContent; + return m_value; } - void CPACSLinkToFile::SetSimpleContent(const std::string& value) + void CPACSLinkToFile::SetValue(const std::string& value) { - m_simpleContent = value; + m_value = value; } } // namespace generated diff --git a/src/generated/CPACSLinkToFile.h b/src/generated/CPACSLinkToFile.h index 611d710ac..6f580837d 100644 --- a/src/generated/CPACSLinkToFile.h +++ b/src/generated/CPACSLinkToFile.h @@ -62,14 +62,14 @@ namespace generated TIGL_EXPORT virtual const boost::optional& GetFormat() const; TIGL_EXPORT virtual void SetFormat(const boost::optional& value); - TIGL_EXPORT virtual const std::string& GetSimpleContent() const; - TIGL_EXPORT virtual void SetSimpleContent(const std::string& value); + TIGL_EXPORT virtual const std::string& GetValue() const; + TIGL_EXPORT virtual void SetValue(const std::string& value); protected: CCPACSExternalObject* m_parent; boost::optional m_format; - std::string m_simpleContent; + std::string m_value; private: CPACSLinkToFile(const CPACSLinkToFile&) = delete; diff --git a/src/generated/CPACSPosExcl0DoubleBase.cpp b/src/generated/CPACSPosExcl0DoubleBase.cpp index 5f2d7fd81..5b0412a7c 100644 --- a/src/generated/CPACSPosExcl0DoubleBase.cpp +++ b/src/generated/CPACSPosExcl0DoubleBase.cpp @@ -29,7 +29,7 @@ namespace tigl namespace generated { CPACSPosExcl0DoubleBase::CPACSPosExcl0DoubleBase(CPACSRectangleProfile* parent) - : m_simpleContent(0) + : m_value(0) { //assert(parent != NULL); m_parent = parent; @@ -37,7 +37,7 @@ namespace generated } CPACSPosExcl0DoubleBase::CPACSPosExcl0DoubleBase(CPACSSuperEllipseProfile* parent) - : m_simpleContent(0) + : m_value(0) { //assert(parent != NULL); m_parent = parent; @@ -76,9 +76,68 @@ namespace generated void CPACSPosExcl0DoubleBase::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) { + // read attribute externalDataNodePath + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "externalDataNodePath")) { + m_externalDataNodePath = tixi::TixiGetAttribute(tixiHandle, xpath, "externalDataNodePath"); + if (m_externalDataNodePath->empty()) { + LOG(WARNING) << "Optional attribute externalDataNodePath is present but empty at xpath " << xpath; + } + } + + // read attribute externalFileName + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "externalFileName")) { + m_externalFileName = tixi::TixiGetAttribute(tixiHandle, xpath, "externalFileName"); + if (m_externalFileName->empty()) { + LOG(WARNING) << "Optional attribute externalFileName is present but empty at xpath " << xpath; + } + } + + // read attribute externalDataDirectory + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "externalDataDirectory")) { + m_externalDataDirectory = tixi::TixiGetAttribute(tixiHandle, xpath, "externalDataDirectory"); + if (m_externalDataDirectory->empty()) { + LOG(WARNING) << "Optional attribute externalDataDirectory is present but empty at xpath " << xpath; + } + } + + // read attribute mu + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "mu")) { + m_mu = tixi::TixiGetAttribute(tixiHandle, xpath, "mu"); + } + + // read attribute delta + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "delta")) { + m_delta = tixi::TixiGetAttribute(tixiHandle, xpath, "delta"); + } + + // read attribute a + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "a")) { + m_a = tixi::TixiGetAttribute(tixiHandle, xpath, "a"); + } + + // read attribute b + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "b")) { + m_b = tixi::TixiGetAttribute(tixiHandle, xpath, "b"); + } + + // read attribute c + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "c")) { + m_c = tixi::TixiGetAttribute(tixiHandle, xpath, "c"); + } + + // read attribute v + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "v")) { + m_v = tixi::TixiGetAttribute(tixiHandle, xpath, "v"); + } + + // read attribute w + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "w")) { + m_w = tixi::TixiGetAttribute(tixiHandle, xpath, "w"); + } + // read simpleContent if (tixi::TixiCheckElement(tixiHandle, xpath)) { - m_simpleContent = tixi::TixiGetElement(tixiHandle, xpath); + m_value = tixi::TixiGetElement(tixiHandle, xpath); } else { LOG(ERROR) << "Required simpleContent is missing at xpath " << xpath; @@ -88,19 +147,219 @@ namespace generated void CPACSPosExcl0DoubleBase::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const { + // write attribute externalDataNodePath + if (m_externalDataNodePath) { + tixi::TixiSaveAttribute(tixiHandle, xpath, "externalDataNodePath", *m_externalDataNodePath); + } + else { + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "externalDataNodePath")) { + tixi::TixiRemoveAttribute(tixiHandle, xpath, "externalDataNodePath"); + } + } + + // write attribute externalFileName + if (m_externalFileName) { + tixi::TixiSaveAttribute(tixiHandle, xpath, "externalFileName", *m_externalFileName); + } + else { + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "externalFileName")) { + tixi::TixiRemoveAttribute(tixiHandle, xpath, "externalFileName"); + } + } + + // write attribute externalDataDirectory + if (m_externalDataDirectory) { + tixi::TixiSaveAttribute(tixiHandle, xpath, "externalDataDirectory", *m_externalDataDirectory); + } + else { + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "externalDataDirectory")) { + tixi::TixiRemoveAttribute(tixiHandle, xpath, "externalDataDirectory"); + } + } + + // write attribute mu + if (m_mu) { + tixi::TixiSaveAttribute(tixiHandle, xpath, "mu", *m_mu); + } + else { + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "mu")) { + tixi::TixiRemoveAttribute(tixiHandle, xpath, "mu"); + } + } + + // write attribute delta + if (m_delta) { + tixi::TixiSaveAttribute(tixiHandle, xpath, "delta", *m_delta); + } + else { + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "delta")) { + tixi::TixiRemoveAttribute(tixiHandle, xpath, "delta"); + } + } + + // write attribute a + if (m_a) { + tixi::TixiSaveAttribute(tixiHandle, xpath, "a", *m_a); + } + else { + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "a")) { + tixi::TixiRemoveAttribute(tixiHandle, xpath, "a"); + } + } + + // write attribute b + if (m_b) { + tixi::TixiSaveAttribute(tixiHandle, xpath, "b", *m_b); + } + else { + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "b")) { + tixi::TixiRemoveAttribute(tixiHandle, xpath, "b"); + } + } + + // write attribute c + if (m_c) { + tixi::TixiSaveAttribute(tixiHandle, xpath, "c", *m_c); + } + else { + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "c")) { + tixi::TixiRemoveAttribute(tixiHandle, xpath, "c"); + } + } + + // write attribute v + if (m_v) { + tixi::TixiSaveAttribute(tixiHandle, xpath, "v", *m_v); + } + else { + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "v")) { + tixi::TixiRemoveAttribute(tixiHandle, xpath, "v"); + } + } + + // write attribute w + if (m_w) { + tixi::TixiSaveAttribute(tixiHandle, xpath, "w", *m_w); + } + else { + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "w")) { + tixi::TixiRemoveAttribute(tixiHandle, xpath, "w"); + } + } + // write simpleContent - tixi::TixiSaveElement(tixiHandle, xpath, m_simpleContent); + tixi::TixiSaveElement(tixiHandle, xpath, m_value); + + } + + const boost::optional& CPACSPosExcl0DoubleBase::GetExternalDataNodePath() const + { + return m_externalDataNodePath; + } + + void CPACSPosExcl0DoubleBase::SetExternalDataNodePath(const boost::optional& value) + { + m_externalDataNodePath = value; + } + + const boost::optional& CPACSPosExcl0DoubleBase::GetExternalFileName() const + { + return m_externalFileName; + } + + void CPACSPosExcl0DoubleBase::SetExternalFileName(const boost::optional& value) + { + m_externalFileName = value; + } + + const boost::optional& CPACSPosExcl0DoubleBase::GetExternalDataDirectory() const + { + return m_externalDataDirectory; + } + + void CPACSPosExcl0DoubleBase::SetExternalDataDirectory(const boost::optional& value) + { + m_externalDataDirectory = value; + } + + const boost::optional& CPACSPosExcl0DoubleBase::GetMu() const + { + return m_mu; + } + + void CPACSPosExcl0DoubleBase::SetMu(const boost::optional& value) + { + m_mu = value; + } + + const boost::optional& CPACSPosExcl0DoubleBase::GetDelta() const + { + return m_delta; + } + + void CPACSPosExcl0DoubleBase::SetDelta(const boost::optional& value) + { + m_delta = value; + } + + const boost::optional& CPACSPosExcl0DoubleBase::GetA() const + { + return m_a; + } + + void CPACSPosExcl0DoubleBase::SetA(const boost::optional& value) + { + m_a = value; + } + + const boost::optional& CPACSPosExcl0DoubleBase::GetB() const + { + return m_b; + } + + void CPACSPosExcl0DoubleBase::SetB(const boost::optional& value) + { + m_b = value; + } + const boost::optional& CPACSPosExcl0DoubleBase::GetC() const + { + return m_c; + } + + void CPACSPosExcl0DoubleBase::SetC(const boost::optional& value) + { + m_c = value; + } + + const boost::optional& CPACSPosExcl0DoubleBase::GetV() const + { + return m_v; + } + + void CPACSPosExcl0DoubleBase::SetV(const boost::optional& value) + { + m_v = value; + } + + const boost::optional& CPACSPosExcl0DoubleBase::GetW() const + { + return m_w; + } + + void CPACSPosExcl0DoubleBase::SetW(const boost::optional& value) + { + m_w = value; } - const double& CPACSPosExcl0DoubleBase::GetSimpleContent() const + const double& CPACSPosExcl0DoubleBase::GetValue() const { - return m_simpleContent; + return m_value; } - void CPACSPosExcl0DoubleBase::SetSimpleContent(const double& value) + void CPACSPosExcl0DoubleBase::SetValue(const double& value) { - m_simpleContent = value; + m_value = value; } } // namespace generated diff --git a/src/generated/CPACSPosExcl0DoubleBase.h b/src/generated/CPACSPosExcl0DoubleBase.h index 1f388d2c5..7056dad6e 100644 --- a/src/generated/CPACSPosExcl0DoubleBase.h +++ b/src/generated/CPACSPosExcl0DoubleBase.h @@ -17,6 +17,8 @@ #pragma once +#include +#include #include #include #include @@ -36,8 +38,19 @@ namespace generated // CPACSRectangleProfile // CPACSSuperEllipseProfile - /// @brief Positive double values larger than 0 + /// @brief doubleBaseType /// + /// Base type for double nodes (including external data + /// attributes) + /// The double base type can include optional uncertainty + /// information. The description of uncertainties is placed in + /// addtional attributes. First, it is described by an attribute + /// that describes the type of uncertainty function called + /// functionName. The functionName attribute includes the tag name + /// of the distribution function which is listened in the table + /// shown below. Each uncertainty function is further describes by a + /// set of parameters that are described in the table below. + /// @see uncertaintyFunctions /// class CPACSPosExcl0DoubleBase { @@ -79,14 +92,54 @@ 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 double& GetSimpleContent() const; - TIGL_EXPORT virtual void SetSimpleContent(const double& value); + TIGL_EXPORT virtual const boost::optional& GetExternalDataNodePath() const; + TIGL_EXPORT virtual void SetExternalDataNodePath(const boost::optional& value); + + TIGL_EXPORT virtual const boost::optional& GetExternalFileName() const; + TIGL_EXPORT virtual void SetExternalFileName(const boost::optional& value); + + TIGL_EXPORT virtual const boost::optional& GetExternalDataDirectory() const; + TIGL_EXPORT virtual void SetExternalDataDirectory(const boost::optional& value); + + TIGL_EXPORT virtual const boost::optional& GetMu() const; + TIGL_EXPORT virtual void SetMu(const boost::optional& value); + + TIGL_EXPORT virtual const boost::optional& GetDelta() const; + TIGL_EXPORT virtual void SetDelta(const boost::optional& value); + + TIGL_EXPORT virtual const boost::optional& GetA() const; + TIGL_EXPORT virtual void SetA(const boost::optional& value); + + TIGL_EXPORT virtual const boost::optional& GetB() const; + TIGL_EXPORT virtual void SetB(const boost::optional& value); + + TIGL_EXPORT virtual const boost::optional& GetC() const; + TIGL_EXPORT virtual void SetC(const boost::optional& value); + + TIGL_EXPORT virtual const boost::optional& GetV() const; + TIGL_EXPORT virtual void SetV(const boost::optional& value); + + TIGL_EXPORT virtual const boost::optional& GetW() const; + TIGL_EXPORT virtual void SetW(const boost::optional& value); + + TIGL_EXPORT virtual const double& GetValue() const; + TIGL_EXPORT virtual void SetValue(const double& value); protected: void* m_parent; const std::type_info* m_parentType; - double m_simpleContent; + boost::optional m_externalDataNodePath; + boost::optional m_externalFileName; + boost::optional m_externalDataDirectory; + boost::optional m_mu; + boost::optional m_delta; + boost::optional m_a; + boost::optional m_b; + boost::optional m_c; + boost::optional m_v; + boost::optional m_w; + double m_value; private: CPACSPosExcl0DoubleBase(const CPACSPosExcl0DoubleBase&) = delete; diff --git a/src/generated/CPACSRectangleProfile.cpp b/src/generated/CPACSRectangleProfile.cpp index 1374ae26d..09bb099b6 100644 --- a/src/generated/CPACSRectangleProfile.cpp +++ b/src/generated/CPACSRectangleProfile.cpp @@ -68,13 +68,7 @@ namespace generated { // read element cornerRadius if (tixi::TixiCheckElement(tixiHandle, xpath + "/cornerRadius")) { - m_cornerRadius = boost::in_place(this); - try { - m_cornerRadius->ReadCPACS(tixiHandle, xpath + "/cornerRadius"); - } catch(const std::exception& e) { - LOG(ERROR) << "Failed to read cornerRadius at xpath " << xpath << ": " << e.what(); - m_cornerRadius = boost::none; - } + m_cornerRadius = tixi::TixiGetElement(tixiHandle, xpath + "/cornerRadius"); } // read element heightToWidthRatio @@ -92,7 +86,7 @@ namespace generated // write element cornerRadius if (m_cornerRadius) { tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/cornerRadius"); - m_cornerRadius->WriteCPACS(tixiHandle, xpath + "/cornerRadius"); + tixi::TixiSaveElement(tixiHandle, xpath + "/cornerRadius", *m_cornerRadius); } else { if (tixi::TixiCheckElement(tixiHandle, xpath + "/cornerRadius")) { @@ -106,14 +100,14 @@ namespace generated } - const boost::optional& CPACSRectangleProfile::GetCornerRadius() const + const boost::optional& CPACSRectangleProfile::GetCornerRadius() const { return m_cornerRadius; } - boost::optional& CPACSRectangleProfile::GetCornerRadius() + void CPACSRectangleProfile::SetCornerRadius(const boost::optional& value) { - return m_cornerRadius; + m_cornerRadius = value; } const CPACSPosExcl0DoubleBase& CPACSRectangleProfile::GetHeightToWidthRatio() const @@ -126,17 +120,5 @@ namespace generated return m_heightToWidthRatio; } - CPACSRectangleProfile_cornerRadius& CPACSRectangleProfile::GetCornerRadius(CreateIfNotExistsTag) - { - if (!m_cornerRadius) - m_cornerRadius = boost::in_place(this); - return *m_cornerRadius; - } - - void CPACSRectangleProfile::RemoveCornerRadius() - { - m_cornerRadius = boost::none; - } - } // namespace generated } // namespace tigl diff --git a/src/generated/CPACSRectangleProfile.h b/src/generated/CPACSRectangleProfile.h index c87bd1130..6d700972e 100644 --- a/src/generated/CPACSRectangleProfile.h +++ b/src/generated/CPACSRectangleProfile.h @@ -22,8 +22,6 @@ #include #include #include "CPACSPosExcl0DoubleBase.h" -#include "CPACSRectangleProfile_cornerRadius.h" -#include "CreateIfNotExists.h" #include "tigl_internal.h" namespace tigl @@ -63,20 +61,17 @@ 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 boost::optional& GetCornerRadius() const; - TIGL_EXPORT virtual boost::optional& GetCornerRadius(); + TIGL_EXPORT virtual const boost::optional& GetCornerRadius() const; + TIGL_EXPORT virtual void SetCornerRadius(const boost::optional& value); TIGL_EXPORT virtual const CPACSPosExcl0DoubleBase& GetHeightToWidthRatio() const; TIGL_EXPORT virtual CPACSPosExcl0DoubleBase& GetHeightToWidthRatio(); - TIGL_EXPORT virtual CPACSRectangleProfile_cornerRadius& GetCornerRadius(CreateIfNotExistsTag); - TIGL_EXPORT virtual void RemoveCornerRadius(); - protected: CPACSStandardProfile* m_parent; - boost::optional m_cornerRadius; - CPACSPosExcl0DoubleBase m_heightToWidthRatio; + boost::optional m_cornerRadius; + CPACSPosExcl0DoubleBase m_heightToWidthRatio; private: CPACSRectangleProfile(const CPACSRectangleProfile&) = delete; diff --git a/src/generated/CPACSRectangleProfile_cornerRadius.cpp b/src/generated/CPACSRectangleProfile_cornerRadius.cpp deleted file mode 100644 index 18db90451..000000000 --- a/src/generated/CPACSRectangleProfile_cornerRadius.cpp +++ /dev/null @@ -1,97 +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 "CPACSRectangleProfile.h" -#include "CPACSRectangleProfile_cornerRadius.h" -#include "CTiglError.h" -#include "CTiglLogging.h" -#include "CTiglUIDObject.h" -#include "TixiHelper.h" - -namespace tigl -{ -namespace generated -{ - CPACSRectangleProfile_cornerRadius::CPACSRectangleProfile_cornerRadius(CPACSRectangleProfile* parent) - : m_simpleContent(0) - { - //assert(parent != NULL); - m_parent = parent; - } - - CPACSRectangleProfile_cornerRadius::~CPACSRectangleProfile_cornerRadius() - { - } - - const CPACSRectangleProfile* CPACSRectangleProfile_cornerRadius::GetParent() const - { - return m_parent; - } - - CPACSRectangleProfile* CPACSRectangleProfile_cornerRadius::GetParent() - { - return m_parent; - } - - const CTiglUIDObject* CPACSRectangleProfile_cornerRadius::GetNextUIDParent() const - { - if (m_parent) { - return m_parent->GetNextUIDParent(); - } - return nullptr; - } - - CTiglUIDObject* CPACSRectangleProfile_cornerRadius::GetNextUIDParent() - { - if (m_parent) { - return m_parent->GetNextUIDParent(); - } - return nullptr; - } - - void CPACSRectangleProfile_cornerRadius::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) - { - // read simpleContent - if (tixi::TixiCheckElement(tixiHandle, xpath)) { - m_simpleContent = tixi::TixiGetElement(tixiHandle, xpath); - } - else { - LOG(ERROR) << "Required simpleContent is missing at xpath " << xpath; - } - - } - - void CPACSRectangleProfile_cornerRadius::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const - { - // write simpleContent - tixi::TixiSaveElement(tixiHandle, xpath, m_simpleContent); - - } - - const double& CPACSRectangleProfile_cornerRadius::GetSimpleContent() const - { - return m_simpleContent; - } - - void CPACSRectangleProfile_cornerRadius::SetSimpleContent(const double& value) - { - m_simpleContent = value; - } - -} // namespace generated -} // namespace tigl diff --git a/src/generated/CPACSRectangleProfile_cornerRadius.h b/src/generated/CPACSRectangleProfile_cornerRadius.h deleted file mode 100644 index add3507d2..000000000 --- a/src/generated/CPACSRectangleProfile_cornerRadius.h +++ /dev/null @@ -1,75 +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 "tigl_internal.h" - -namespace tigl -{ -class CTiglUIDObject; - -namespace generated -{ - class CPACSRectangleProfile; - - // This class is used in: - // CPACSRectangleProfile - - /// @brief Corner radius - /// - /// - class CPACSRectangleProfile_cornerRadius - { - public: - TIGL_EXPORT CPACSRectangleProfile_cornerRadius(CPACSRectangleProfile* parent); - - TIGL_EXPORT virtual ~CPACSRectangleProfile_cornerRadius(); - - TIGL_EXPORT CPACSRectangleProfile* GetParent(); - - TIGL_EXPORT const CPACSRectangleProfile* 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 double& GetSimpleContent() const; - TIGL_EXPORT virtual void SetSimpleContent(const double& value); - - protected: - CPACSRectangleProfile* m_parent; - - double m_simpleContent; - - private: - CPACSRectangleProfile_cornerRadius(const CPACSRectangleProfile_cornerRadius&) = delete; - CPACSRectangleProfile_cornerRadius& operator=(const CPACSRectangleProfile_cornerRadius&) = delete; - - CPACSRectangleProfile_cornerRadius(CPACSRectangleProfile_cornerRadius&&) = delete; - CPACSRectangleProfile_cornerRadius& operator=(CPACSRectangleProfile_cornerRadius&&) = delete; - }; -} // namespace generated - -// Aliases in tigl namespace -using CCPACSRectangleProfile_cornerRadius = generated::CPACSRectangleProfile_cornerRadius; -using CCPACSRectangleProfile = generated::CPACSRectangleProfile; -} // namespace tigl diff --git a/src/generated/CPACSStringVectorBase.cpp b/src/generated/CPACSStringVectorBase.cpp index cb92a8b76..0f3ea68b1 100644 --- a/src/generated/CPACSStringVectorBase.cpp +++ b/src/generated/CPACSStringVectorBase.cpp @@ -210,8 +210,8 @@ namespace generated // read simpleContent if (tixi::TixiCheckElement(tixiHandle, xpath)) { - m_simpleContent = tixi::TixiGetElement(tixiHandle, xpath); - if (m_simpleContent.empty()) { + m_value = tixi::TixiGetElement(tixiHandle, xpath); + if (m_value.empty()) { LOG(WARNING) << "Required element is empty at xpath " << xpath; } } @@ -304,7 +304,7 @@ namespace generated } // write simpleContent - tixi::TixiSaveElement(tixiHandle, xpath, m_simpleContent); + tixi::TixiSaveElement(tixiHandle, xpath, m_value); } @@ -388,14 +388,14 @@ namespace generated m_w = value; } - const std::string& CPACSStringVectorBase::GetSimpleContent() const + const std::string& CPACSStringVectorBase::GetValue() const { - return m_simpleContent; + return m_value; } - void CPACSStringVectorBase::SetSimpleContent(const std::string& value) + void CPACSStringVectorBase::SetValue(const std::string& value) { - m_simpleContent = value; + m_value = value; } } // namespace generated diff --git a/src/generated/CPACSStringVectorBase.h b/src/generated/CPACSStringVectorBase.h index 13db901cd..e854924ce 100644 --- a/src/generated/CPACSStringVectorBase.h +++ b/src/generated/CPACSStringVectorBase.h @@ -138,8 +138,8 @@ namespace generated TIGL_EXPORT virtual const boost::optional& GetW() const; TIGL_EXPORT virtual void SetW(const boost::optional& value); - TIGL_EXPORT virtual const std::string& GetSimpleContent() const; - TIGL_EXPORT virtual void SetSimpleContent(const std::string& value); + TIGL_EXPORT virtual const std::string& GetValue() const; + TIGL_EXPORT virtual void SetValue(const std::string& value); protected: void* m_parent; @@ -153,7 +153,7 @@ namespace generated boost::optional m_c; boost::optional m_v; boost::optional m_w; - std::string m_simpleContent; + std::string m_value; private: CPACSStringVectorBase(const CPACSStringVectorBase&) = delete; diff --git a/src/generated/CPACSSuperEllipseProfile.cpp b/src/generated/CPACSSuperEllipseProfile.cpp index 5bc595907..81edcae3e 100644 --- a/src/generated/CPACSSuperEllipseProfile.cpp +++ b/src/generated/CPACSSuperEllipseProfile.cpp @@ -32,7 +32,7 @@ namespace generated , m_nUpper(this) , m_mLower(this) , m_nLower(this) - , m_lowerHeightFraction(this) + , m_lowerHeightFraction(0) { //assert(parent != NULL); m_parent = parent; @@ -104,7 +104,7 @@ namespace generated // read element lowerHeightFraction if (tixi::TixiCheckElement(tixiHandle, xpath + "/lowerHeightFraction")) { - m_lowerHeightFraction.ReadCPACS(tixiHandle, xpath + "/lowerHeightFraction"); + m_lowerHeightFraction = tixi::TixiGetElement(tixiHandle, xpath + "/lowerHeightFraction"); } else { LOG(ERROR) << "Required element lowerHeightFraction is missing at xpath " << xpath; @@ -132,7 +132,7 @@ namespace generated // write element lowerHeightFraction tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/lowerHeightFraction"); - m_lowerHeightFraction.WriteCPACS(tixiHandle, xpath + "/lowerHeightFraction"); + tixi::TixiSaveElement(tixiHandle, xpath + "/lowerHeightFraction", m_lowerHeightFraction); } @@ -176,14 +176,14 @@ namespace generated return m_nLower; } - const CPACSSuperEllipseProfile_lowerHeightFraction& CPACSSuperEllipseProfile::GetLowerHeightFraction() const + const double& CPACSSuperEllipseProfile::GetLowerHeightFraction() const { return m_lowerHeightFraction; } - CPACSSuperEllipseProfile_lowerHeightFraction& CPACSSuperEllipseProfile::GetLowerHeightFraction() + void CPACSSuperEllipseProfile::SetLowerHeightFraction(const double& value) { - return m_lowerHeightFraction; + m_lowerHeightFraction = value; } } // namespace generated diff --git a/src/generated/CPACSSuperEllipseProfile.h b/src/generated/CPACSSuperEllipseProfile.h index 57139d570..7da98baf4 100644 --- a/src/generated/CPACSSuperEllipseProfile.h +++ b/src/generated/CPACSSuperEllipseProfile.h @@ -20,7 +20,6 @@ #include #include #include "CPACSPosExcl0DoubleBase.h" -#include "CPACSSuperEllipseProfile_lowerHeightFraction.h" #include "tigl_internal.h" namespace tigl @@ -81,25 +80,25 @@ namespace generated TIGL_EXPORT virtual const CPACSPosExcl0DoubleBase& GetNLower() const; TIGL_EXPORT virtual CPACSPosExcl0DoubleBase& GetNLower(); - TIGL_EXPORT virtual const CPACSSuperEllipseProfile_lowerHeightFraction& GetLowerHeightFraction() const; - TIGL_EXPORT virtual CPACSSuperEllipseProfile_lowerHeightFraction& GetLowerHeightFraction(); + TIGL_EXPORT virtual const double& GetLowerHeightFraction() const; + TIGL_EXPORT virtual void SetLowerHeightFraction(const double& value); protected: CPACSStandardProfile* m_parent; /// Exponent m for upper semi-ellipse - CPACSPosExcl0DoubleBase m_mUpper; + CPACSPosExcl0DoubleBase m_mUpper; /// Exponent n for upper semi-ellipse - CPACSPosExcl0DoubleBase m_nUpper; + CPACSPosExcl0DoubleBase m_nUpper; /// Exponent m for lower semi-ellipse - CPACSPosExcl0DoubleBase m_mLower; + CPACSPosExcl0DoubleBase m_mLower; /// Exponent n for lower semi-ellipse - CPACSPosExcl0DoubleBase m_nLower; + CPACSPosExcl0DoubleBase m_nLower; - CPACSSuperEllipseProfile_lowerHeightFraction m_lowerHeightFraction; + double m_lowerHeightFraction; private: CPACSSuperEllipseProfile(const CPACSSuperEllipseProfile&) = delete; diff --git a/src/generated/CPACSSuperEllipseProfile_lowerHeightFraction.cpp b/src/generated/CPACSSuperEllipseProfile_lowerHeightFraction.cpp deleted file mode 100644 index 80dc7492d..000000000 --- a/src/generated/CPACSSuperEllipseProfile_lowerHeightFraction.cpp +++ /dev/null @@ -1,97 +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 "CPACSSuperEllipseProfile.h" -#include "CPACSSuperEllipseProfile_lowerHeightFraction.h" -#include "CTiglError.h" -#include "CTiglLogging.h" -#include "CTiglUIDObject.h" -#include "TixiHelper.h" - -namespace tigl -{ -namespace generated -{ - CPACSSuperEllipseProfile_lowerHeightFraction::CPACSSuperEllipseProfile_lowerHeightFraction(CPACSSuperEllipseProfile* parent) - : m_simpleContent(0) - { - //assert(parent != NULL); - m_parent = parent; - } - - CPACSSuperEllipseProfile_lowerHeightFraction::~CPACSSuperEllipseProfile_lowerHeightFraction() - { - } - - const CPACSSuperEllipseProfile* CPACSSuperEllipseProfile_lowerHeightFraction::GetParent() const - { - return m_parent; - } - - CPACSSuperEllipseProfile* CPACSSuperEllipseProfile_lowerHeightFraction::GetParent() - { - return m_parent; - } - - const CTiglUIDObject* CPACSSuperEllipseProfile_lowerHeightFraction::GetNextUIDParent() const - { - if (m_parent) { - return m_parent->GetNextUIDParent(); - } - return nullptr; - } - - CTiglUIDObject* CPACSSuperEllipseProfile_lowerHeightFraction::GetNextUIDParent() - { - if (m_parent) { - return m_parent->GetNextUIDParent(); - } - return nullptr; - } - - void CPACSSuperEllipseProfile_lowerHeightFraction::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) - { - // read simpleContent - if (tixi::TixiCheckElement(tixiHandle, xpath)) { - m_simpleContent = tixi::TixiGetElement(tixiHandle, xpath); - } - else { - LOG(ERROR) << "Required simpleContent is missing at xpath " << xpath; - } - - } - - void CPACSSuperEllipseProfile_lowerHeightFraction::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const - { - // write simpleContent - tixi::TixiSaveElement(tixiHandle, xpath, m_simpleContent); - - } - - const double& CPACSSuperEllipseProfile_lowerHeightFraction::GetSimpleContent() const - { - return m_simpleContent; - } - - void CPACSSuperEllipseProfile_lowerHeightFraction::SetSimpleContent(const double& value) - { - m_simpleContent = value; - } - -} // namespace generated -} // namespace tigl diff --git a/src/generated/CPACSSuperEllipseProfile_lowerHeightFraction.h b/src/generated/CPACSSuperEllipseProfile_lowerHeightFraction.h deleted file mode 100644 index 519e62b45..000000000 --- a/src/generated/CPACSSuperEllipseProfile_lowerHeightFraction.h +++ /dev/null @@ -1,72 +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 "tigl_internal.h" - -namespace tigl -{ -class CTiglUIDObject; - -namespace generated -{ - class CPACSSuperEllipseProfile; - - // This class is used in: - // CPACSSuperEllipseProfile - - class CPACSSuperEllipseProfile_lowerHeightFraction - { - public: - TIGL_EXPORT CPACSSuperEllipseProfile_lowerHeightFraction(CPACSSuperEllipseProfile* parent); - - TIGL_EXPORT virtual ~CPACSSuperEllipseProfile_lowerHeightFraction(); - - TIGL_EXPORT CPACSSuperEllipseProfile* GetParent(); - - TIGL_EXPORT const CPACSSuperEllipseProfile* 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 double& GetSimpleContent() const; - TIGL_EXPORT virtual void SetSimpleContent(const double& value); - - protected: - CPACSSuperEllipseProfile* m_parent; - - double m_simpleContent; - - private: - CPACSSuperEllipseProfile_lowerHeightFraction(const CPACSSuperEllipseProfile_lowerHeightFraction&) = delete; - CPACSSuperEllipseProfile_lowerHeightFraction& operator=(const CPACSSuperEllipseProfile_lowerHeightFraction&) = delete; - - CPACSSuperEllipseProfile_lowerHeightFraction(CPACSSuperEllipseProfile_lowerHeightFraction&&) = delete; - CPACSSuperEllipseProfile_lowerHeightFraction& operator=(CPACSSuperEllipseProfile_lowerHeightFraction&&) = delete; - }; -} // namespace generated - -// Aliases in tigl namespace -using CCPACSSuperEllipseProfile_lowerHeightFraction = generated::CPACSSuperEllipseProfile_lowerHeightFraction; -using CCPACSSuperEllipseProfile = generated::CPACSSuperEllipseProfile; -} // namespace tigl diff --git a/src/generated/CPACSWallSegment.cpp b/src/generated/CPACSWallSegment.cpp index 92fc12665..b9f775f3c 100644 --- a/src/generated/CPACSWallSegment.cpp +++ b/src/generated/CPACSWallSegment.cpp @@ -29,7 +29,7 @@ namespace generated { CPACSWallSegment::CPACSWallSegment(CPACSWallSegments* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) - , m_phi(reinterpret_cast(this)) + , m_phi(0.0) , m_wallPositionUIDs(reinterpret_cast(this), m_uidMgr) { //assert(parent != NULL); @@ -98,7 +98,7 @@ namespace generated // read element phi if (tixi::TixiCheckElement(tixiHandle, xpath + "/phi")) { - m_phi.ReadCPACS(tixiHandle, xpath + "/phi"); + m_phi = tixi::TixiGetElement(tixiHandle, xpath + "/phi"); } else { LOG(ERROR) << "Required element phi is missing at xpath " << xpath; @@ -164,7 +164,7 @@ namespace generated // write element phi tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/phi"); - m_phi.WriteCPACS(tixiHandle, xpath + "/phi"); + tixi::TixiSaveElement(tixiHandle, xpath + "/phi", m_phi); // write element doubleSidedExtrusion if (m_doubleSidedExtrusion) { @@ -248,14 +248,14 @@ namespace generated m_uID = value; } - const CPACSWallSegment_phi& CPACSWallSegment::GetPhi() const + const double& CPACSWallSegment::GetPhi() const { return m_phi; } - CPACSWallSegment_phi& CPACSWallSegment::GetPhi() + void CPACSWallSegment::SetPhi(const double& value) { - return m_phi; + m_phi = value; } const boost::optional& CPACSWallSegment::GetDoubleSidedExtrusion() const diff --git a/src/generated/CPACSWallSegment.h b/src/generated/CPACSWallSegment.h index d84c47f3b..219c1e160 100644 --- a/src/generated/CPACSWallSegment.h +++ b/src/generated/CPACSWallSegment.h @@ -23,7 +23,6 @@ #include #include "CPACSBoundingElementUIDs.h" #include "CPACSWallPositionUIDs.h" -#include "CPACSWallSegment_phi.h" #include "CreateIfNotExists.h" #include "CTiglUIDObject.h" #include "ITiglUIDRefObject.h" @@ -63,8 +62,8 @@ namespace generated TIGL_EXPORT virtual const boost::optional& GetUID() const; TIGL_EXPORT virtual void SetUID(const boost::optional& value); - TIGL_EXPORT virtual const CPACSWallSegment_phi& GetPhi() const; - TIGL_EXPORT virtual CPACSWallSegment_phi& GetPhi(); + TIGL_EXPORT virtual const double& GetPhi() const; + TIGL_EXPORT virtual void SetPhi(const double& value); TIGL_EXPORT virtual const boost::optional& GetDoubleSidedExtrusion() const; TIGL_EXPORT virtual void SetDoubleSidedExtrusion(const boost::optional& value); @@ -98,7 +97,7 @@ namespace generated /// around fuselage x-axis of extrusion direction. A /// value of 0deg means fuselage z-axis as extrusion /// direction. Default: 0.0deg. - CPACSWallSegment_phi m_phi; + double m_phi; /// By default, the wall is only extruded in positive direction. If doubleSidedExtrusion is true, the wall is additionaly extruded in negative direction as well. Default: false. boost::optional m_doubleSidedExtrusion; diff --git a/src/generated/CPACSWallSegment_phi.cpp b/src/generated/CPACSWallSegment_phi.cpp deleted file mode 100644 index f55895ac2..000000000 --- a/src/generated/CPACSWallSegment_phi.cpp +++ /dev/null @@ -1,103 +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 "CCPACSFuselageWallSegment.h" -#include "CPACSWallSegment_phi.h" -#include "CTiglError.h" -#include "CTiglLogging.h" -#include "CTiglUIDObject.h" -#include "TixiHelper.h" - -namespace tigl -{ -namespace generated -{ - CPACSWallSegment_phi::CPACSWallSegment_phi(CCPACSFuselageWallSegment* parent) - : m_simpleContent(0) - { - //assert(parent != NULL); - m_parent = parent; - } - - CPACSWallSegment_phi::~CPACSWallSegment_phi() - { - } - - const CCPACSFuselageWallSegment* CPACSWallSegment_phi::GetParent() const - { - return m_parent; - } - - CCPACSFuselageWallSegment* CPACSWallSegment_phi::GetParent() - { - return m_parent; - } - - const CTiglUIDObject* CPACSWallSegment_phi::GetNextUIDParent() const - { - if (m_parent) { - if (m_parent->GetUID()) - return m_parent; - else - return m_parent->GetNextUIDParent(); - } - return nullptr; - } - - CTiglUIDObject* CPACSWallSegment_phi::GetNextUIDParent() - { - if (m_parent) { - if (m_parent->GetUID()) - return m_parent; - else - return m_parent->GetNextUIDParent(); - } - return nullptr; - } - - void CPACSWallSegment_phi::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) - { - // read simpleContent - if (tixi::TixiCheckElement(tixiHandle, xpath)) { - m_simpleContent = tixi::TixiGetElement(tixiHandle, xpath); - } - else { - LOG(ERROR) << "Required simpleContent is missing at xpath " << xpath; - } - - } - - void CPACSWallSegment_phi::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const - { - // write simpleContent - tixi::TixiSaveElement(tixiHandle, xpath, m_simpleContent); - - } - - const double& CPACSWallSegment_phi::GetSimpleContent() const - { - return m_simpleContent; - } - - void CPACSWallSegment_phi::SetSimpleContent(const double& value) - { - m_simpleContent = value; - } - -} // namespace generated -} // namespace tigl diff --git a/src/generated/CPACSWallSegment_phi.h b/src/generated/CPACSWallSegment_phi.h deleted file mode 100644 index b51f00aa1..000000000 --- a/src/generated/CPACSWallSegment_phi.h +++ /dev/null @@ -1,70 +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 "tigl_internal.h" - -namespace tigl -{ -class CTiglUIDObject; -class CCPACSFuselageWallSegment; - -namespace generated -{ - // This class is used in: - // CPACSWallSegment - - class CPACSWallSegment_phi - { - public: - TIGL_EXPORT CPACSWallSegment_phi(CCPACSFuselageWallSegment* parent); - - TIGL_EXPORT virtual ~CPACSWallSegment_phi(); - - TIGL_EXPORT CCPACSFuselageWallSegment* GetParent(); - - TIGL_EXPORT const CCPACSFuselageWallSegment* 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 double& GetSimpleContent() const; - TIGL_EXPORT virtual void SetSimpleContent(const double& value); - - protected: - CCPACSFuselageWallSegment* m_parent; - - double m_simpleContent; - - private: - CPACSWallSegment_phi(const CPACSWallSegment_phi&) = delete; - CPACSWallSegment_phi& operator=(const CPACSWallSegment_phi&) = delete; - - CPACSWallSegment_phi(CPACSWallSegment_phi&&) = delete; - CPACSWallSegment_phi& operator=(CPACSWallSegment_phi&&) = delete; - }; -} // namespace generated - -// Aliases in tigl namespace -using CCPACSWallSegment_phi = generated::CPACSWallSegment_phi; -} // namespace tigl diff --git a/src/generated/TixiHelper.h b/src/generated/TixiHelper.h index 8299698df..49c156738 100644 --- a/src/generated/TixiHelper.h +++ b/src/generated/TixiHelper.h @@ -19,7 +19,9 @@ #include -#define BOOST_DATE_TIME_NO_LIB +#ifndef BOOST_DATE_TIME_NO_LIB + #define BOOST_DATE_TIME_NO_LIB +#endif #include #include diff --git a/src/structural_elements/CCPACSFuselageWallSegment.cpp b/src/structural_elements/CCPACSFuselageWallSegment.cpp index e09826ebf..35a99fdf3 100644 --- a/src/structural_elements/CCPACSFuselageWallSegment.cpp +++ b/src/structural_elements/CCPACSFuselageWallSegment.cpp @@ -94,7 +94,7 @@ TopoDS_Compound CCPACSFuselageWallSegment::GetCutPlanes() const void CCPACSFuselageWallSegment::SetPhi(const double& value) { - CPACSWallSegment::GetPhi().SetSimpleContent(value); + CPACSWallSegment::SetPhi(value); Invalidate(); } @@ -188,7 +188,7 @@ PNamedShape CCPACSFuselageWallSegment::BuildLoft() const } // extrusion vector - double phiRad = Radians(GetPhi().GetSimpleContent()); + double phiRad = Radians(GetPhi()); gp_Vec ext_vec(0., -sin(phiRad), cos(phiRad)); ext_vec = GetFuselage().GetTransformationMatrix().Transform(ext_vec); diff --git a/thirdparty/cpacs_gen b/thirdparty/cpacs_gen index a1cadb81e..6f4fc1bf2 160000 --- a/thirdparty/cpacs_gen +++ b/thirdparty/cpacs_gen @@ -1 +1 @@ -Subproject commit a1cadb81e9f67f9a0677b10c63d31fac036bccda +Subproject commit 6f4fc1bf23a2f39b7d82600d2b7ea0336c0fb7b9