diff --git a/.gitmodules b/.gitmodules index 3d3f179841..35d9d7499e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,5 +1,5 @@ [submodule "thirdparty/cpacs_gen"] path = thirdparty/cpacs_gen - url = https://github.com/RISCSoftware/cpacs_tigl_gen.git + url = https://github.com/DLR-SC/cpacs_tigl_gen.git branch = master ignore = dirty diff --git a/ChangeLog.md b/ChangeLog.md index 5234a25bdf..d098f4328e 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -3,7 +3,15 @@ Changelog Changes since last release ------------- - +10/07/2025 +- General changes + - Updated TiGL to new Version of [cpacs_tigl_Gen](https://github.com/DLR-SC/cpacs_tigl_gen) which is a fork from [RISCSoftware/cpacs_tigl_gen](https://github.com/RISCSoftware/cpacs_tigl_gen) + +- Fixes + - [#59](https://github.com/RISCSoftware/cpacs_tigl_gen/issues/59) + Getters by index and uID are generated now for all Elements in CPACS with Attribute: maxOccur = "unbounded". This gives users quick + access to elements and eliminates the need for TIGL developers to customize classes for this purpose. + 08/02/2025 - General changes: diff --git a/TIGLViewer/src/TIGLViewerDocument.cpp b/TIGLViewer/src/TIGLViewerDocument.cpp index e2f278a586..14ac54f981 100644 --- a/TIGLViewer/src/TIGLViewerDocument.cpp +++ b/TIGLViewer/src/TIGLViewerDocument.cpp @@ -88,6 +88,7 @@ #include "CCPACSEnginePylon.h" #include "generated/CPACSTrailingEdgeDevices.h" #include "CCPACSTrailingEdgeDevice.h" +#include "CCPACSFuselage.h" #define max(a,b) ((a) > (b) ? (a) : (b)) @@ -600,7 +601,7 @@ QString TIGLViewerDocument::dlgGetFuselageSelection() tigl::CCPACSConfiguration& config = GetConfiguration(); int fuselageCount = config.GetFuselageCount(); for (int i = 1; i <= fuselageCount; i++) { - tigl::CCPACSFuselage& fuselage = config.GetFuselage(i); + auto& fuselage = config.GetFuselage(i); std::string name = fuselage.GetUID(); if (name.empty()) { name = "Unknown fuselage"; @@ -626,7 +627,7 @@ QString TIGLViewerDocument::dlgGetFuselageSegmentSelection() tigl::CCPACSConfiguration& config = GetConfiguration(); int fuselageCount = config.GetFuselageCount(); for (int i = 1; i <= fuselageCount; i++) { - tigl::CCPACSFuselage& fuselage = config.GetFuselage(i); + auto& fuselage = config.GetFuselage(i); for (int j = 1; j <= fuselage.GetSegmentCount(); ++j) { tigl::CCPACSFuselageSegment& segment = fuselage.GetSegment(j); std::string name = segment.GetUID(); @@ -874,7 +875,7 @@ void TIGLViewerDocument::drawFuselageGuideCurves() } START_COMMAND() - const tigl::CCPACSFuselage& fuselage = GetConfiguration().GetFuselage(fuselageUid.toStdString()); + const auto& fuselage = GetConfiguration().GetFuselage(fuselageUid.toStdString()); const TopoDS_Compound& guideCurves = fuselage.GetSegments().GetGuideCurveWires(); TopoDS_Iterator anIter(guideCurves); @@ -1027,7 +1028,7 @@ void TIGLViewerDocument::drawFuselage() } START_COMMAND() - tigl::CCPACSFuselage& fuselage = GetConfiguration().GetFuselage(fuselageUid.toStdString()); + auto& fuselage = GetConfiguration().GetFuselage(fuselageUid.toStdString()); app->getScene()->deleteAllObjects(); @@ -1059,7 +1060,7 @@ void TIGLViewerDocument::drawFuselageTriangulation() } START_COMMAND() - tigl::CCPACSFuselage& fuselage = GetConfiguration().GetFuselage(fuselageUid.toStdString()); + auto& fuselage = GetConfiguration().GetFuselage(fuselageUid.toStdString()); //clear screen app->getScene()->deleteAllObjects(); @@ -1093,7 +1094,7 @@ void TIGLViewerDocument::drawFuselageSamplePoints() } START_COMMAND() - tigl::CCPACSFuselage& fuselage = GetConfiguration().GetFuselage(fuselageUid.toStdString()); + auto& fuselage = GetConfiguration().GetFuselage(fuselageUid.toStdString()); for (int segmentIndex = 1; segmentIndex <= fuselage.GetSegmentCount(); segmentIndex++) { @@ -1132,7 +1133,7 @@ void TIGLViewerDocument::drawFuselageSamplePointsAngle() double x, y, z; app->getScene()->deleteAllObjects(); - tigl::CCPACSFuselage& fuselage = GetConfiguration().GetFuselage(fuselageIndex); + auto& fuselage = GetConfiguration().GetFuselage(fuselageIndex); // Draw the fuselage for (int i = 1; i <= fuselage.GetSegmentCount(); i++) { @@ -1199,7 +1200,7 @@ void TIGLViewerDocument::drawAllFuselagesAndWingsSurfacePoints() // Draw all fuselages for (int fuselageIndex = 1; fuselageIndex <= GetConfiguration().GetFuselageCount(); fuselageIndex++) { - tigl::CCPACSFuselage& fuselage = GetConfiguration().GetFuselage(fuselageIndex); + auto& fuselage = GetConfiguration().GetFuselage(fuselageIndex); app->getScene()->displayShape(fuselage.GetLoft(), true, getDefaultShapeColor()); @@ -1749,7 +1750,7 @@ void TIGLViewerDocument::exportFuselageCurvesBRep() } START_COMMAND() - tigl::CCPACSFuselage& fuselage = GetConfiguration().GetFuselage(fuselageUid.toStdString()); + auto& fuselage = GetConfiguration().GetFuselage(fuselageUid.toStdString()); QString baseName = QDir(std::string(dirname.toStdString() + "/" + fuselage.GetUID()).c_str()).absolutePath(); TopoDS_Compound profiles; @@ -1788,7 +1789,7 @@ void TIGLViewerDocument::drawFusedFuselage() START_COMMAND() app->getScene()->deleteAllObjects(); - tigl::CCPACSFuselage& fuselage = GetConfiguration().GetFuselage(fuselageUid.toStdString()); + auto& fuselage = GetConfiguration().GetFuselage(fuselageUid.toStdString()); app->getScene()->displayShape(fuselage.GetLoft(), true, getDefaultShapeColor()); } diff --git a/bindings/python_internal/CMakeLists.txt b/bindings/python_internal/CMakeLists.txt index fd837fd3d2..65f9ea17dd 100644 --- a/bindings/python_internal/CMakeLists.txt +++ b/bindings/python_internal/CMakeLists.txt @@ -17,8 +17,8 @@ if (TIGL_BINDINGS_PYTHON_INTERNAL) endif() include(tiglmacros) - - # Ensure the correct Python version is picked up by specifying the Python_EXECUTABLE + + # Ensure the correct Python version is picked up by specifying the Python_EXECUTABLE if (DEFINED ENV{CONDA_PREFIX}) if (WIN32) set(Python3_EXECUTABLE "$ENV{CONDA_PREFIX}/python.exe") diff --git a/bindings/python_internal/configuration.i b/bindings/python_internal/configuration.i index 9b1f083865..2d03fa281e 100644 --- a/bindings/python_internal/configuration.i +++ b/bindings/python_internal/configuration.i @@ -34,8 +34,12 @@ #include "CCPACSConfiguration.h" #include "CCPACSConfigurationManager.h" #include "CTiglFusePlane.h" +#include "CCPACSFuselage.h" +#include "generated/CPACSFuselageProfiles.h" +#include "CCPACSFuselageProfiles.h" #include "CCPACSWingProfile.h" #include "generated/CPACSStandardProfile.h" //TODO: Replace with CCPACSStandardProfile, once it exists. +#include "generated/CPACSFuselageSections.h" #include "CCPACSFuselageSection.h" #include "CCPACSExternalObject.h" #include "CTiglShapeCache.h" @@ -81,7 +85,7 @@ #include "generated/CPACSTrailingEdgeDevice.h" #include "CTiglControlSurfaceTransformation.h" #include "CCPACSTrailingEdgeDevice.h" -#include "CCPACSEnginePylons.h" +#include "generated/CPACSTrailingEdgeDevices.h" #include "CCPACSEnginePylon.h" #include "CCPACSEnginePosition.h" #include "generated/CPACSLateralCap_placement.h" @@ -100,18 +104,29 @@ #include "CCPACSDucts.h" #include "CCPACSDuctAssembly.h" #include "CCPACSDuct.h" +#include "CCPACSNacelleSections.h" +#include "CCPACSRotationCurve.h" +#include "CCPACSNacelleCenterCowl.h" +#include "generated/CPACSNacelleCowl.h" +#include "CCPACSNacelleCowl.h" +#include "generated/CPACSEngine.h" +#include "generated/CPACSEngineNacelle.h" +#include "generated/CPACSNacelleGuideCurves.h" +#include "CCPACSNacelleGuideCurves.h" +#include "CCPACSPositionings.h" +#include "generated/CPACSProfiles.h" #include "generated/CPACSFuelTanks.h" #include "generated/CPACSFuelTank.h" #include "generated/CPACSFuelTankVolume.h" -#include "CCPACSFuelTanks.h" #include "CCPACSFuelTank.h" #include "generated/CPACSVessels.h" -#include "CCPACSVessels.h" #include "generated/CPACSVessel.h" #include "CCPACSVessel.h" #include "generated/CPACSVesselStructure.h" #include "CCPACSVesselStructure.h" +#include "CCPACSFuelTank.h" #include "CCPACSFrame.h" + %} %feature("autodoc", "3"); @@ -159,10 +174,10 @@ %boost_optional(tigl::CCPACSWingCells) %boost_optional(tigl::generated::CPACSAlignmentCrossBeam) %boost_optional(tigl::generated::CPACSDoorAssemblyPosition_doorType) -%boost_optional(tigl::CCPACSWingSections) +%boost_optional(tigl::generated::CPACSWingSections) %boost_optional(tigl::CCPACSWingSegments) %boost_optional(tigl::CCPACSPositionings) -%boost_optional(tigl::CCPACSEnginePylons) +%boost_optional(tigl::generated::CPACSEnginePylons) %boost_optional(tigl::CCPACSWingProfiles) %boost_optional(tigl::CCPACSFuselageProfiles) %boost_optional(tigl::CCPACSRotorProfiles) @@ -213,7 +228,7 @@ %include "CCPACSWallSegment.h" // ----------------- Engines ---------------------------// -%boost_optional(tigl::CCPACSEngines) +%boost_optional(tigl::generated::CPACSEngines) %boost_optional(tigl::generated::CPACSEngineNacelle) %boost_optional(tigl::CCPACSNacelleCowl) %boost_optional(tigl::CCPACSNacelleCenterCowl) @@ -238,7 +253,6 @@ namespace tigl { %include "CCPACSNacelleCowl.h" %include "generated/CPACSEngine.h" %include "generated/CPACSEngines.h" -%include "CCPACSEngines.h" // ---------------- Control surfaces ------------------ // %boost_optional(tigl::generated::CPACSControlSurfaceTrackType_trackSubType) @@ -256,7 +270,7 @@ namespace tigl { %boost_optional(tigl::generated::CPACSLeadingEdgeHollow) %boost_optional(tigl::generated::CPACSCutOutControlPoints) %boost_optional(tigl::generated::CPACSControlSurfaceSkinCutOutBorder) -%boost_optional(tigl::CCPACSTrailingEdgeDevices) +%boost_optional(tigl::generated::CPACSTrailingEdgeDevices) %boost_optional(tigl::CCPACSControlSurfaces) %boost_optional(tigl::CPACSControlSurfaceWingCutOut) %boost_optional(tigl::generated::CPACSControlSurfaceTracks) @@ -303,7 +317,6 @@ namespace tigl %ignore ComponentSegment(CCPACSTrailingEdgeDevice&); %include "CCPACSTrailingEdgeDevice.h" %include "generated/CPACSTrailingEdgeDevices.h" -%include "CCPACSTrailingEdgeDevices.h" %include "generated/CPACSControlSurfaces.h" %include "CCPACSControlSurfaces.h" @@ -338,7 +351,7 @@ namespace tigl %include "generated/CPACSSkin.h" %include "generated/CPACSFuselageStructure.h" %include "CCPACSFuselageStructure.h" - +%include "generated/CPACSFuselageSections.h" %include "generated/CPACSWingSkin.h" %include "CPACSRotor_type.h" @@ -348,6 +361,8 @@ namespace tigl %include "CPACSRotorHubHinge_type.h" // --------------- Fuselage tanks -----------------// +%boost_optional(tigl::generated::CPACSVessels) +%boost_optional(tigl::CCPACSVessels) %boost_optional(tigl::generated::CPACSFuelTanks) %boost_optional(tigl::CCPACSFuelTanks) %boost_optional(tigl::generated::CPACSFuelTankVolume) @@ -355,7 +370,6 @@ namespace tigl namespace tigl { class CCPACSFuselageSegments; -class CCPACSVessels; } %include "generated/CPACSIsotensoidDome.h" @@ -364,18 +378,16 @@ class CCPACSVessels; %include "generated/CPACSDomeType.h" %include "generated/CPACSVesselStructure.h" %include "CCPACSVesselStructure.h" -%include "generated/CPACSFuelTanks.h" -%include "generated/CPACSFuelTankVolume.h" -%include "generated/CPACSFuelTank.h" %include "CTiglFuselageConnection.h" %include "CCPACSFuselageSegment.h" %include "CCPACSFuselageSegments.h" -%include "CCPACSFuelTanks.h" -%include "CCPACSFuelTank.h" +%include "generated/CPACSFuelTankVolume.h" %include "generated/CPACSVessels.h" -%include "CCPACSVessels.h" %include "generated/CPACSVessel.h" %include "CCPACSVessel.h" +%include "generated/CPACSFuelTanks.h" +%include "generated/CPACSFuelTank.h" +%include "CCPACSFuelTank.h" // -------------------- Wing Structure -------------------// @@ -482,9 +494,6 @@ class CCPACSWingRibsPositioning; %include "generated/CPACSFuselageSection.h" %include "CCPACSFuselageSection.h" %include "generated/CPACSWingSections.h" -%include "CCPACSWingSections.h" -%include "generated/CPACSFuselageSections.h" -%include "CCPACSFuselageSections.h" %include "generated/CPACSWingElements.h" %include "CCPACSWingSectionElements.h" %include "generated/CPACSFuselageElements.h" @@ -525,11 +534,9 @@ class CCPACSWingRibsPositioning; %include "generated/CPACSRotors.h" %include "CCPACSRotors.h" %include "generated/CPACSFuselageProfiles.h" -%include "CCPACSFuselageProfiles.h" %include "generated/CPACSFuselage.h" %include "CCPACSFuselage.h" %include "generated/CPACSFuselages.h" -%include "CCPACSFuselages.h" %include "TiglFarFieldType.h" %include "generated/CPACSCellPositioningSpanwise.h" %include "generated/CPACSCellPositioningChordwise.h" @@ -553,7 +560,6 @@ class CCPACSWingRibsPositioning; %include "generated/CPACSEnginePylon.h" %include "CCPACSEnginePylon.h" %include "generated/CPACSEnginePylons.h" -%include "CCPACSEnginePylons.h" // ---------------- Ducts ------------------ // diff --git a/cpacs_gen_input/CustomTypes.txt b/cpacs_gen_input/CustomTypes.txt index 01eb5a96d0..655420378c 100644 --- a/cpacs_gen_input/CustomTypes.txt +++ b/cpacs_gen_input/CustomTypes.txt @@ -10,13 +10,11 @@ CPACSRotorHub_type TiglRotorHubType // classes CPACSAircraftModel CCPACSAircraftModel CPACSRotorcraftModel CCPACSRotorcraftModel -CPACSProfiles CCPACSProfiles CPACSMaterialDefinition CCPACSMaterialDefinition CPACSFarField CCPACSFarField CPACSGuideCurve CCPACSGuideCurve CPACSGuideCurves CCPACSGuideCurves CPACSGuideCurveProfileGeometry CCPACSGuideCurveProfile -CPACSGuideCurveProfiles CCPACSGuideCurveProfiles CPACSPositioning CCPACSPositioning CPACSPositionings CCPACSPositionings CPACSPoint CCPACSPoint @@ -39,12 +37,10 @@ CPACSGenericSystems CCPACSGenericSystems CPACSGenericSystem CCPACSGenericSystem CPACSFuselage CCPACSFuselage -CPACSFuselages CCPACSFuselages CPACSFuselageProfiles CCPACSFuselageProfiles CPACSFuselageSegment CCPACSFuselageSegment CPACSFuselageSegments CCPACSFuselageSegments CPACSFuselageSection CCPACSFuselageSection -CPACSFuselageSections CCPACSFuselageSections CPACSFuselageElement CCPACSFuselageSectionElement CPACSFuselageElements CCPACSFuselageSectionElements @@ -64,7 +60,6 @@ CPACSWingRibsPositioning CCPACSWingRibsPositioning CPACSWingElement CCPACSWingSectionElement CPACSWingElements CCPACSWingSectionElements CPACSWingSection CCPACSWingSection -CPACSWingSections CCPACSWingSections CPACSWingComponentSegmentStructure CCPACSWingCSStructure CPACSWingShell CCPACSWingShell CPACSWingSegment CCPACSWingSegment @@ -92,14 +87,11 @@ CPACSRotorHubHinges CCPACSRotorHinges // fuselage structure CPACSDoorAssemblyPosition CCPACSDoorAssemblyPosition -CPACSDoors CCPACSDoors CPACSPressureBulkhead CCPACSPressureBulkhead CPACSPressureBulkheadAssembly CCPACSPressureBulkheadAssembly CPACSPressureBulkheadAssemblyPosition CCPACSPressureBulkheadAssemblyPosition -CPACSPressureBulkheads CCPACSPressureBulkheads CPACSProfileBasedStructuralElement CCPACSProfileBasedStructuralElement CPACSSheetList CCPACSSheetList -CPACSStructuralProfiles CCPACSStructuralProfiles CPACSCrossBeamAssemblyPosition CCPACSCrossBeamAssemblyPosition CPACSCargoCrossBeamsAssembly CCPACSCargoCrossBeamsAssembly CPACSCrossBeamStrutAssemblyPosition CCPACSCrossBeamStrutAssemblyPosition @@ -123,19 +115,16 @@ CPACSWalls CCPACSWalls // control surfaces CPACSControlSurfaces CCPACSControlSurfaces CPACSControlSurfaceBorderTrailingEdge CCPACSControlSurfaceBorderTrailingEdge -CPACSTrailingEdgeDevices CCPACSTrailingEdgeDevices CPACSTrailingEdgeDevice CCPACSTrailingEdgeDevice CPACSControlSurfaceOuterShapeTrailingEdge CCPACSControlSurfaceOuterShapeTrailingEdge CPACSControlSurfaceWingCutOut CCPACSControlSurfaceWingCutOut // Pylons CPACSEnginePylon CCPACSEnginePylon -CPACSEnginePylons CCPACSEnginePylons // Engines CPACSEnginePositions CCPACSEnginePositions CPACSEnginePosition CCPACSEnginePosition -CPACSEngines CCPACSEngines CPACSNacelleCowl CCPACSNacelleCowl CPACSNacelleSections CCPACSNacelleSections CPACSNacelleSection CCPACSNacelleSection @@ -152,7 +141,5 @@ CPACSDucts CCPACSDucts // Tanks CPACSVessel CCPACSVessel -CPACSVessels CCPACSVessels CPACSFuelTank CCPACSFuelTank -CPACSFuelTanks CCPACSFuelTanks -CPACSVesselStructure CCPACSVesselStructure \ No newline at end of file +CPACSVesselStructure CCPACSVesselStructure diff --git a/src/CCPACSPositionings.cpp b/src/CCPACSPositionings.cpp index abce954422..f28396aecf 100644 --- a/src/CCPACSPositionings.cpp +++ b/src/CCPACSPositionings.cpp @@ -73,22 +73,6 @@ CTiglTransformation CCPACSPositionings::GetPositioningTransformation(const std:: return CTiglTransformation(); } -int CCPACSPositionings::GetPositioningCount() const -{ - return CPACSPositionings::m_positionings.size(); -} - -CCPACSPositioning& CCPACSPositionings::GetPositioning(int index) -{ - { - index --; - if (index < 0 || index >= GetPositioningCount()) { - throw CTiglError("Invalid index in CCPACSPositionings::GetPositioning", TIGL_INDEX_ERROR); - } - return *m_positionings[index]; - } -} - namespace { void UpdateNextPositioning(CCPACSPositioning* currPos, int depth) diff --git a/src/CCPACSPositionings.h b/src/CCPACSPositionings.h index a7d804e78c..9fa8a5bf96 100644 --- a/src/CCPACSPositionings.h +++ b/src/CCPACSPositionings.h @@ -60,19 +60,6 @@ class CCPACSPositionings : public generated::CPACSPositionings */ TIGL_EXPORT CTiglTransformation GetPositioningTransformation(const std::string& sectionIndex); - /** - * @brief GetPositioningCount returns the total count of positionings in a configuration per element (e.g. wing) - * @return int Return total count of positionings - */ - TIGL_EXPORT int GetPositioningCount() const; - - /** - * @brief GetPositioning - * @param index Note that index starts at 1 - * @return Returns CCPACSPositioning& by index - */ - TIGL_EXPORT CCPACSPositioning& GetPositioning(int index); - // Cleanup routine TIGL_EXPORT void Cleanup(); diff --git a/src/api/tigl.cpp b/src/api/tigl.cpp index 1e84e7b544..590638bae8 100644 --- a/src/api/tigl.cpp +++ b/src/api/tigl.cpp @@ -35,6 +35,7 @@ #include "CCPACSConfiguration.h" #include "CCPACSConfigurationManager.h" #include "CTiglUIDManager.h" +#include "CCPACSFuselage.h" #include "CCPACSWing.h" #include "CCPACSWingSection.h" #include "CCPACSWingSegment.h" diff --git a/src/configuration/CCPACSConfiguration.cpp b/src/configuration/CCPACSConfiguration.cpp index d643d9e2cb..7280012470 100644 --- a/src/configuration/CCPACSConfiguration.cpp +++ b/src/configuration/CCPACSConfiguration.cpp @@ -192,7 +192,7 @@ bool CCPACSConfiguration::IsRotorcraft() const } // Returns the class which holds all wing profiles -boost::optional CCPACSConfiguration::GetWingProfiles() +boost::optional CCPACSConfiguration::GetWingProfiles() const { if (profiles && profiles->GetWingAirfoils()) return *profiles->GetWingAirfoils(); @@ -200,7 +200,7 @@ boost::optional CCPACSConfiguration::GetWingProfiles() return boost::none; } -boost::optional CCPACSConfiguration::GetWingProfiles() const +boost::optional CCPACSConfiguration::GetWingProfiles() { if (profiles && profiles->GetWingAirfoils()) return *profiles->GetWingAirfoils(); @@ -227,7 +227,7 @@ boost::optional CCPACSConfiguration::GetFuselageProfile } // Returns the wing profile for a given uid. -CCPACSWingProfile& CCPACSConfiguration::GetWingProfile(std::string uid) const +const CCPACSWingProfile& CCPACSConfiguration::GetWingProfile(std::string uid) const { if (profiles->GetWingAirfoils() && profiles->GetWingAirfoils()->HasProfile(uid)) { return profiles->GetWingAirfoils()->GetProfile(uid); @@ -240,8 +240,13 @@ CCPACSWingProfile& CCPACSConfiguration::GetWingProfile(std::string uid) const } } +CCPACSWingProfile& CCPACSConfiguration::GetWingProfile(std::string uid) +{ + return const_cast(std::as_const(*this).GetWingProfile(uid)); +} + // Returns the aircraft systems object. -boost::optional CCPACSConfiguration::GetACSystems() +boost::optional CCPACSConfiguration::GetACSystems() const { if (aircraftModel && aircraftModel->GetSystems()) { return *aircraftModel->GetSystems(); @@ -254,7 +259,7 @@ boost::optional CCPACSConfiguration::GetACSystems() } } -boost::optional CCPACSConfiguration::GetACSystems() const +boost::optional CCPACSConfiguration::GetACSystems() { if (aircraftModel && aircraftModel->GetSystems()) { return *aircraftModel->GetSystems(); @@ -268,7 +273,7 @@ boost::optional CCPACSConfiguration::GetACSystems() cons } // Returns the total count of wings (including rotor blades) in a configuration -int CCPACSConfiguration::GetWingCount() const +size_t CCPACSConfiguration::GetWingCount() const { if (aircraftModel && aircraftModel->GetWings()) { return aircraftModel->GetWings()->GetWingCount(); @@ -284,7 +289,7 @@ int CCPACSConfiguration::GetWingCount() const } // Returns the count of rotor blade wings in a configuration -int CCPACSConfiguration::GetRotorBladeCount() const +size_t CCPACSConfiguration::GetRotorBladeCount() const { if (rotorcraftModel && rotorcraftModel->GetRotorBlades()) { return rotorcraftModel->GetRotorBlades()->GetRotorBladeCount(); @@ -295,13 +300,13 @@ int CCPACSConfiguration::GetRotorBladeCount() const } // Returns the wing (or rotor blade) for a given index. -CCPACSWing& CCPACSConfiguration::GetWing(int index) const +const CCPACSWing& CCPACSConfiguration::GetWing(size_t index) const { if (aircraftModel) { return aircraftModel->GetWings()->GetWing(index); } else if (rotorcraftModel) { - const int wingCount = rotorcraftModel->GetWings() ? rotorcraftModel->GetWings()->GetWingCount() : 0; + const size_t wingCount = rotorcraftModel->GetWings() ? rotorcraftModel->GetWings()->GetWingCount() : 0; if (index <= wingCount) { return rotorcraftModel->GetWings()->GetWing(index); } @@ -314,8 +319,14 @@ CCPACSWing& CCPACSConfiguration::GetWing(int index) const throw CTiglError("No configuration loaded"); } } + +CCPACSWing& CCPACSConfiguration::GetWing(size_t index) +{ + return const_cast (std::as_const(*this).GetWing(index)); +} + // Returns the wing (or rotor blade) for a given UID. -CCPACSWing& CCPACSConfiguration::GetWing(const std::string& UID) const +const CCPACSWing& CCPACSConfiguration::GetWing(const std::string& UID) const { if (aircraftModel) { return aircraftModel->GetWings()->GetWing(UID); @@ -333,8 +344,13 @@ CCPACSWing& CCPACSConfiguration::GetWing(const std::string& UID) const } } +CCPACSWing& CCPACSConfiguration::GetWing(const std::string& UID) +{ + return const_cast(std::as_const(*this).GetWing(UID)); +} + // Returns the wing (or rotor blade) index for a given UID. -int CCPACSConfiguration::GetWingIndex(const std::string& UID) const +size_t CCPACSConfiguration::GetWingIndex(const std::string& UID) const { if (aircraftModel) { return aircraftModel->GetWings()->GetWingIndex(UID); @@ -355,7 +371,7 @@ int CCPACSConfiguration::GetWingIndex(const std::string& UID) const } // Returns the total count of generic systems in a configuration -int CCPACSConfiguration::GetGenericSystemCount() +size_t CCPACSConfiguration::GetGenericSystemCount() { boost::optional acSystems = GetACSystems(); if (acSystems && acSystems->GetGenericSystems()) { @@ -367,7 +383,18 @@ int CCPACSConfiguration::GetGenericSystemCount() } // Returns the generic system for a given index. -CCPACSGenericSystem& CCPACSConfiguration::GetGenericSystem(int index) +const CCPACSGenericSystem& CCPACSConfiguration::GetGenericSystem(size_t index) const +{ + boost::optional acSystems = GetACSystems(); + if (acSystems && acSystems->GetGenericSystems()) { + return acSystems->GetGenericSystems()->GetGenericSystem(index); + } + else { + throw CTiglError("No generic system loaded"); + } +} + +CCPACSGenericSystem& CCPACSConfiguration::GetGenericSystem(size_t index) { boost::optional acSystems = GetACSystems(); if (acSystems && acSystems->GetGenericSystems()) { @@ -379,6 +406,17 @@ CCPACSGenericSystem& CCPACSConfiguration::GetGenericSystem(int index) } // Returns the generic system for a given UID. +const CCPACSGenericSystem& CCPACSConfiguration::GetGenericSystem(const std::string& UID) const +{ + boost::optional acSystems = GetACSystems(); + if (acSystems && acSystems->GetGenericSystems()) { + return acSystems->GetGenericSystems()->GetGenericSystem(UID); + } + else { + throw CTiglError("No generic system loaded"); + } +} + CCPACSGenericSystem& CCPACSConfiguration::GetGenericSystem(const std::string& UID) { boost::optional acSystems = GetACSystems(); @@ -391,7 +429,7 @@ CCPACSGenericSystem& CCPACSConfiguration::GetGenericSystem(const std::string& UI } // Returns the total count of rotors in a configuration -int CCPACSConfiguration::GetRotorCount() const +size_t CCPACSConfiguration::GetRotorCount() const { if (rotorcraftModel && rotorcraftModel->GetRotors()) { return rotorcraftModel->GetRotors()->GetRotorCount(); @@ -402,7 +440,7 @@ int CCPACSConfiguration::GetRotorCount() const } // Returns the rotor for a given index. -CCPACSRotor& CCPACSConfiguration::GetRotor(int index) const +const CCPACSRotor& CCPACSConfiguration::GetRotor(size_t index) const { if (rotorcraftModel) { return rotorcraftModel->GetRotors()->GetRotor(index); @@ -412,28 +450,38 @@ CCPACSRotor& CCPACSConfiguration::GetRotor(int index) const } } -// Returns the rotor for a given UID. -CCPACSRotor& CCPACSConfiguration::GetRotor(const std::string& UID) const +CCPACSRotor& CCPACSConfiguration::GetRotor(size_t index) +{ + return const_cast(std::as_const(*this).GetRotor(index)); +} + + +// Returns the rotor index for a given UID. +size_t CCPACSConfiguration::GetRotorIndex(const std::string& UID) const { if (rotorcraftModel) { - return rotorcraftModel->GetRotors()->GetRotor(UID); + return rotorcraftModel->GetRotors()->GetRotorIndex(UID); } else { throw CTiglError("no rotorcraft loaded"); } } - -// Returns the rotor index for a given UID. -int CCPACSConfiguration::GetRotorIndex(const std::string& UID) const +// Returns the rotor for a given UID. +const CCPACSRotor& CCPACSConfiguration::GetRotor(const std::string& UID) const { if (rotorcraftModel) { - return rotorcraftModel->GetRotors()->GetRotorIndex(UID); + return rotorcraftModel->GetRotors()->GetRotor(UID); } else { throw CTiglError("no rotorcraft loaded"); } } +CCPACSRotor& CCPACSConfiguration::GetRotor(const std::string& UID) +{ + return const_cast(std::as_const(*this).GetRotor(UID)); +} + TopoDS_Shape CCPACSConfiguration::GetParentLoft(const std::string& UID) { CTiglRelativelyPositionedComponent* parent = uidManager.GetParentGeometricComponent(UID); @@ -454,7 +502,7 @@ bool CCPACSConfiguration::HasFuselageProfile(std::string uid) const } // Returns the total count of fuselage profiles in this configuration -int CCPACSConfiguration::GetFuselageProfileCount() const +size_t CCPACSConfiguration::GetFuselageProfileCount() const { if (profiles && profiles->GetFuselageProfiles()) { return profiles->GetFuselageProfiles()->GetProfileCount(); @@ -465,19 +513,29 @@ int CCPACSConfiguration::GetFuselageProfileCount() const } // Returns the fuselage profile for a given index. -CCPACSFuselageProfile& CCPACSConfiguration::GetFuselageProfile(int index) const +const CCPACSFuselageProfile& CCPACSConfiguration::GetFuselageProfile(size_t index) const +{ + return profiles->GetFuselageProfiles()->GetProfile(index); +} + +CCPACSFuselageProfile& CCPACSConfiguration::GetFuselageProfile(size_t index) { return profiles->GetFuselageProfiles()->GetProfile(index); } // Returns the fuselage profile for a given uid. -CCPACSFuselageProfile& CCPACSConfiguration::GetFuselageProfile(std::string uid) const +const CCPACSFuselageProfile& CCPACSConfiguration::GetFuselageProfile(std::string uid) const +{ + return profiles->GetFuselageProfiles()->GetProfile(uid); +} + +CCPACSFuselageProfile& CCPACSConfiguration::GetFuselageProfile(std::string uid) { return profiles->GetFuselageProfiles()->GetProfile(uid); } // Returns the total count of fuselages in a configuration -int CCPACSConfiguration::GetFuselageCount() const +size_t CCPACSConfiguration::GetFuselageCount() const { if (aircraftModel) { if (aircraftModel->GetFuselages()) { @@ -501,7 +559,7 @@ int CCPACSConfiguration::GetFuselageCount() const } // Returns the fuselage for a given index. -CCPACSFuselage& CCPACSConfiguration::GetFuselage(int index) const +const CCPACSFuselage& CCPACSConfiguration::GetFuselage(size_t index) const { if (aircraftModel) { return aircraftModel->GetFuselages()->GetFuselage(index); @@ -514,18 +572,9 @@ CCPACSFuselage& CCPACSConfiguration::GetFuselage(int index) const } } - -CCPACSFuselages& CCPACSConfiguration::GetFuselages() +CCPACSFuselage& CCPACSConfiguration::GetFuselage(size_t index) { - if (aircraftModel) { - return *aircraftModel->GetFuselages(); - } - else if (rotorcraftModel) { - return *rotorcraftModel->GetFuselages(); - } - else { - throw CTiglError("No configuration loaded"); - } + return const_cast(std::as_const(*this).GetFuselage(index)); } const CCPACSFuselages& CCPACSConfiguration::GetFuselages() const @@ -541,6 +590,11 @@ const CCPACSFuselages& CCPACSConfiguration::GetFuselages() const } } +CCPACSFuselages& CCPACSConfiguration::GetFuselages() +{ + return const_cast(std::as_const(*this).GetFuselages()); +} + bool CCPACSConfiguration::HasDucts() const { if (aircraftModel) { @@ -551,7 +605,7 @@ bool CCPACSConfiguration::HasDucts() const } } -boost::optional& CCPACSConfiguration::GetDucts() +const boost::optional& CCPACSConfiguration::GetDucts() const { if (aircraftModel) { return aircraftModel->GetDucts(); @@ -561,7 +615,7 @@ boost::optional& CCPACSConfiguration::GetDucts() } } -const boost::optional& CCPACSConfiguration::GetDucts() const +boost::optional& CCPACSConfiguration::GetDucts() { if (aircraftModel) { return aircraftModel->GetDucts(); @@ -571,7 +625,7 @@ const boost::optional& CCPACSConfiguration::GetDucts() const } } -int CCPACSConfiguration::GetFuelTanksCount() const +size_t CCPACSConfiguration::GetFuelTankCount() const { if (!aircraftModel) { return 0; @@ -582,55 +636,48 @@ int CCPACSConfiguration::GetFuelTanksCount() const return 0; } - return fuelTanks->GetFuelTanksCount(); + return fuelTanks->GetFuelTankCount(); } -CCPACSFuelTank const& CCPACSConfiguration::GetFuelTank(int index) const +const CCPACSFuelTank& CCPACSConfiguration::GetFuelTank(size_t index) const { if (!aircraftModel) { throw CTiglError("No configuration loaded"); } - auto const& fuelTanks = aircraftModel->GetFuelTanks(); - if (!fuelTanks) { + if (!(aircraftModel->GetFuelTanks())) { throw CTiglError("No fuel tanks found"); } + return aircraftModel->GetFuelTanks()->GetFuelTank(index); +} - return fuelTanks->GetFuelTank(index); +CCPACSFuelTank& CCPACSConfiguration::GetFuelTank(size_t index) +{ + return const_cast(std::as_const(*this).GetFuelTank(index)); } -CCPACSFuelTank const& CCPACSConfiguration::GetFuelTank(const std::string& UID) const +const CCPACSFuelTank& CCPACSConfiguration::GetFuelTank(const std::string& UID) const { if (!aircraftModel) { throw CTiglError("No configuration loaded"); } - auto const& fuelTanks = aircraftModel->GetFuelTanks(); - if (!fuelTanks) { + if (!(aircraftModel->GetFuelTanks())) { throw CTiglError("No fuel tanks found"); } - return fuelTanks->GetFuelTank(UID); + return aircraftModel->GetFuelTanks()->GetFuelTank(UID); } -int CCPACSConfiguration::GetFuelTankIndex(const std::string& UID) const +CCPACSFuelTank& CCPACSConfiguration::GetFuelTank(const std::string& UID) { - return GetFuelTanks().GetFuelTankIndex(UID); + return const_cast(std::as_const(*this).GetFuelTank(UID)); } -CCPACSFuelTanks& CCPACSConfiguration::GetFuelTanks() +size_t CCPACSConfiguration::GetFuelTankIndex(const std::string& UID) const { - if (!aircraftModel) { - throw CTiglError("No configuration loaded"); - } - - auto const& fuelTanks = aircraftModel->GetFuelTanks(); - if (!fuelTanks) { - throw CTiglError("No fuel tanks found"); - } - - return *aircraftModel->GetFuelTanks(); + return GetFuelTanks().GetFuelTankIndex(UID); } const CCPACSFuelTanks& CCPACSConfiguration::GetFuelTanks() const @@ -647,6 +694,11 @@ const CCPACSFuelTanks& CCPACSConfiguration::GetFuelTanks() const return *aircraftModel->GetFuelTanks(); } +CCPACSFuelTanks& CCPACSConfiguration::GetFuelTanks() +{ + return const_cast(std::as_const(*this).GetFuelTanks()); +} + boost::optional& CCPACSConfiguration::GetEnginePylons() { if (aircraftModel) { @@ -667,17 +719,17 @@ const boost::optional& CCPACSConfiguration::GetEnginePylons( } } -boost::optional& CCPACSConfiguration::GetEngines() +const boost::optional& CCPACSConfiguration::GetEngines() const { return engines; } -const boost::optional& CCPACSConfiguration::GetEngines() const +boost::optional& CCPACSConfiguration::GetEngines() { return engines; } -boost::optional& CCPACSConfiguration::GetEnginePositions() +const boost::optional& CCPACSConfiguration::GetEnginePositions() const { if (aircraftModel) { return aircraftModel->GetEngines(); @@ -687,7 +739,7 @@ boost::optional& CCPACSConfiguration::GetEnginePositions( } } -const boost::optional& CCPACSConfiguration::GetEnginePositions() const +boost::optional& CCPACSConfiguration::GetEnginePositions() { if (aircraftModel) { return aircraftModel->GetEngines(); @@ -698,7 +750,7 @@ const boost::optional& CCPACSConfiguration::GetEnginePosi } // Returns the engine for a given uid. -CCPACSEngine& CCPACSConfiguration::GetEngine(const std::string& uid) const +const CCPACSEngine& CCPACSConfiguration::GetEngine(const std::string& uid) const { try { if (GetEngines()) { @@ -711,6 +763,11 @@ CCPACSEngine& CCPACSConfiguration::GetEngine(const std::string& uid) const } } +CCPACSEngine& CCPACSConfiguration::GetEngine(const std::string& uid) +{ + return const_cast(std::as_const(*this).GetEngine(uid)); +} + CCPACSFarField& CCPACSConfiguration::GetFarField() { @@ -718,12 +775,12 @@ CCPACSFarField& CCPACSConfiguration::GetFarField() } // Returns the fuselage index for a given UID. -int CCPACSConfiguration::GetFuselageIndex(const std::string& UID) const +size_t CCPACSConfiguration::GetFuselageIndex(const std::string& UID) const { return GetFuselages().GetFuselageIndex(UID); } -int CCPACSConfiguration::GetExternalObjectCount() const +size_t CCPACSConfiguration::GetExternalObjectCount() const { if (aircraftModel && aircraftModel->GetGenericGeometryComponents()) { return aircraftModel->GetGenericGeometryComponents()->GetObjectCount(); @@ -733,13 +790,13 @@ int CCPACSConfiguration::GetExternalObjectCount() const } } -CCPACSExternalObject&CCPACSConfiguration::GetExternalObject(int index) const +CCPACSExternalObject&CCPACSConfiguration::GetExternalObject(size_t index) const { return aircraftModel->GetGenericGeometryComponents()->GetObject(index); } // Returns the fuselage for a given UID. -CCPACSFuselage& CCPACSConfiguration::GetFuselage(const std::string& UID) const +const CCPACSFuselage& CCPACSConfiguration::GetFuselage(const std::string& UID)const { if (aircraftModel) { return aircraftModel->GetFuselages()->GetFuselage(UID); @@ -752,24 +809,29 @@ CCPACSFuselage& CCPACSConfiguration::GetFuselage(const std::string& UID) const } } +CCPACSFuselage& CCPACSConfiguration::GetFuselage(const std::string& UID) +{ + return const_cast(std::as_const(*this).GetFuselage(UID)); +} + // Returns the guide curve profile for a given UID. -CCPACSGuideCurveProfile& CCPACSConfiguration::GetGuideCurveProfile(std::string UID) +const CCPACSGuideCurveProfile& CCPACSConfiguration::GetGuideCurveProfile(std::string UID) const { return profiles->GetGuideCurves()->GetGuideCurveProfile(UID); } -const CCPACSGuideCurveProfile& CCPACSConfiguration::GetGuideCurveProfile(std::string UID) const +CCPACSGuideCurveProfile& CCPACSConfiguration::GetGuideCurveProfile(std::string UID) { return profiles->GetGuideCurves()->GetGuideCurveProfile(UID); } // Returns the uid manager -CTiglUIDManager& CCPACSConfiguration::GetUIDManager() +const CTiglUIDManager& CCPACSConfiguration::GetUIDManager() const { return uidManager; } -const CTiglUIDManager& CCPACSConfiguration::GetUIDManager() const +CTiglUIDManager& CCPACSConfiguration::GetUIDManager() { return uidManager; } @@ -781,7 +843,7 @@ double CCPACSConfiguration::GetAirplaneLength() return max.x - min.x; } -// Returns the uid manager +// Returns the model uid const std::string& CCPACSConfiguration::GetUID() const { if (aircraftModel) { @@ -836,7 +898,7 @@ CCPACSHeader* CCPACSConfiguration::GetHeader() return &header; } -CCPACSWings& CCPACSConfiguration::GetWings() +const CCPACSWings& CCPACSConfiguration::GetWings() const { if (aircraftModel) { return *aircraftModel->GetWings(); @@ -849,19 +911,12 @@ CCPACSWings& CCPACSConfiguration::GetWings() } } -const CCPACSWings& CCPACSConfiguration::GetWings() const +CCPACSWings& CCPACSConfiguration::GetWings() { - if (aircraftModel) { - return *aircraftModel->GetWings(); - } - else if (rotorcraftModel) { - return *rotorcraftModel->GetWings(); - } - else { - throw CTiglError("No configuration loaded"); - } + return const_cast(std::as_const(*this).GetWings()); } + void ConfigurationGetBoundingBox(const CCPACSConfiguration &config, CTiglPoint &min, CTiglPoint &max) { std::vector shapesToDraw; diff --git a/src/configuration/CCPACSConfiguration.h b/src/configuration/CCPACSConfiguration.h index c5dd637adc..be6ea0105a 100644 --- a/src/configuration/CCPACSConfiguration.h +++ b/src/configuration/CCPACSConfiguration.h @@ -32,23 +32,22 @@ #include "generated/CPACSHeader.h" #include "CCPACSWings.h" #include "CCPACSRotors.h" -#include "CCPACSFuselages.h" +#include "generated/CPACSFuselages.h" #include "CCPACSACSystems.h" #include "CCPACSFarField.h" -#include "CCPACSGuideCurveProfiles.h" +#include "generated/CPACSGuideCurveProfiles.h" #include "TopoDS_Compound.hxx" #include "BRep_Builder.hxx" #include "CTiglShapeCache.h" #include "CTiglMemoryPool.h" #include "CSharedPtr.h" -#include "CCPACSProfiles.h" -#include "CCPACSEngines.h" +#include "generated/CPACSProfiles.h" +#include "generated/CPACSEngines.h" namespace tigl { -class CCPACSEnginePylons; class CTiglFusePlane; typedef CSharedPtr PTiglFusePlane; @@ -82,8 +81,8 @@ class CCPACSConfiguration TIGL_EXPORT bool HasWingProfile(std::string uid) const; // Returns the class which holds all wing profiles - TIGL_EXPORT boost::optional GetWingProfiles(); TIGL_EXPORT boost::optional GetWingProfiles() const; + TIGL_EXPORT boost::optional GetWingProfiles(); // Returns the class which holds all rotor profiles TIGL_EXPORT boost::optional GetRotorProfiles(); @@ -92,123 +91,137 @@ class CCPACSConfiguration TIGL_EXPORT boost::optional GetFuselageProfiles(); // Returns the wing or rotor profile for a given uid. - TIGL_EXPORT CCPACSWingProfile& GetWingProfile(std::string uid) const; + TIGL_EXPORT const CCPACSWingProfile& GetWingProfile(std::string uid) const; + TIGL_EXPORT CCPACSWingProfile& GetWingProfile(std::string uid); // Returns the total count of wings (including rotor blades) in a configuration - TIGL_EXPORT int GetWingCount() const; + TIGL_EXPORT size_t GetWingCount() const; // Returns the count of rotor blade wings in a configuration - TIGL_EXPORT int GetRotorBladeCount() const; + TIGL_EXPORT size_t GetRotorBladeCount() const; // Returns the wing (or rotor blade) for a given index. - TIGL_EXPORT CCPACSWing& GetWing(int index) const; + TIGL_EXPORT const CCPACSWing& GetWing(size_t index) const ; + TIGL_EXPORT CCPACSWing& GetWing(size_t index); // Returns the wing (or rotor blade) for a given UID. - TIGL_EXPORT CCPACSWing& GetWing(const std::string& UID) const; + TIGL_EXPORT const CCPACSWing& GetWing(const std::string& UID) const; + TIGL_EXPORT CCPACSWing& GetWing(const std::string& UID); // Returns the wing (or rotor blade) index for a given UID. - TIGL_EXPORT int GetWingIndex(const std::string& UID) const; + TIGL_EXPORT size_t GetWingIndex(const std::string& UID) const; // Returns the total count of generic systems in a configuration - TIGL_EXPORT int GetGenericSystemCount(); + TIGL_EXPORT size_t GetGenericSystemCount(); // Returns the generic system for a given index. - TIGL_EXPORT CCPACSGenericSystem& GetGenericSystem(int index); + TIGL_EXPORT const CCPACSGenericSystem& GetGenericSystem(size_t index) const; + TIGL_EXPORT CCPACSGenericSystem& GetGenericSystem(size_t index); // Returns the generic system for a given UID. + TIGL_EXPORT const CCPACSGenericSystem& GetGenericSystem(const std::string& UID) const; TIGL_EXPORT CCPACSGenericSystem& GetGenericSystem(const std::string& UID); // Returns the total count of rotors in a configuration - TIGL_EXPORT int GetRotorCount() const; + TIGL_EXPORT size_t GetRotorCount() const; // Returns the rotor for a given index. - TIGL_EXPORT CCPACSRotor& GetRotor(int index) const; + TIGL_EXPORT const CCPACSRotor& GetRotor(size_t index) const; + TIGL_EXPORT CCPACSRotor& GetRotor(size_t index); // Returns the rotor for a given UID. - TIGL_EXPORT CCPACSRotor& GetRotor(const std::string& UID) const; + TIGL_EXPORT const CCPACSRotor& GetRotor(const std::string& UID) const; + TIGL_EXPORT CCPACSRotor& GetRotor(const std::string& UID); // Returns the rotor index for a given UID. - TIGL_EXPORT int GetRotorIndex(const std::string& UID) const; + TIGL_EXPORT size_t GetRotorIndex(const std::string& UID) const; TIGL_EXPORT TopoDS_Shape GetParentLoft(const std::string& UID); TIGL_EXPORT bool HasFuselageProfile(std::string uid) const; // Returns the total count of fuselage profiles in this configuration - TIGL_EXPORT int GetFuselageProfileCount() const; + TIGL_EXPORT size_t GetFuselageProfileCount() const; // Returns the fuselage profile for a given index. - TIGL_EXPORT CCPACSFuselageProfile& GetFuselageProfile(int index) const; + TIGL_EXPORT const CCPACSFuselageProfile& GetFuselageProfile(size_t index) const; + TIGL_EXPORT CCPACSFuselageProfile& GetFuselageProfile(size_t index); // Returns the fuselage profile for a given uid. - TIGL_EXPORT CCPACSFuselageProfile& GetFuselageProfile(std::string uid) const; + TIGL_EXPORT const CCPACSFuselageProfile& GetFuselageProfile(std::string uid) const; + TIGL_EXPORT CCPACSFuselageProfile& GetFuselageProfile(std::string uid); // Returns the total count of fuselages in a configuration - TIGL_EXPORT int GetFuselageCount() const; + TIGL_EXPORT size_t GetFuselageCount() const; // Returns the fuselage for a given index. - TIGL_EXPORT CCPACSFuselage& GetFuselage(int index) const; + TIGL_EXPORT const CCPACSFuselage& GetFuselage(size_t index) const; + TIGL_EXPORT CCPACSFuselage& GetFuselage(size_t index); // Returns the fuselage for a given UID. - TIGL_EXPORT CCPACSFuselage& GetFuselage(const std::string& UID) const; + TIGL_EXPORT const CCPACSFuselage& GetFuselage(const std::string& UID) const; + TIGL_EXPORT CCPACSFuselage& GetFuselage(const std::string& UID); // Returns the fuselage index for a given UID. - TIGL_EXPORT int GetFuselageIndex(const std::string& UID) const; + TIGL_EXPORT size_t GetFuselageIndex(const std::string& UID) const; // Returns list of fuselages - TIGL_EXPORT CCPACSFuselages& GetFuselages(); TIGL_EXPORT const CCPACSFuselages& GetFuselages() const; + TIGL_EXPORT CCPACSFuselages& GetFuselages(); // Returns ducts TIGL_EXPORT bool HasDucts() const; - TIGL_EXPORT boost::optional& GetDucts(); TIGL_EXPORT const boost::optional& GetDucts() const; + TIGL_EXPORT boost::optional& GetDucts(); // Returns the total count of fuel tanks in a configuration - TIGL_EXPORT int GetFuelTanksCount() const; + TIGL_EXPORT size_t GetFuelTankCount() const; // Returns the fuel tank for a given index. - TIGL_EXPORT CCPACSFuelTank const& GetFuelTank(int index) const; + TIGL_EXPORT const CCPACSFuelTank& GetFuelTank(size_t index) const; + TIGL_EXPORT CCPACSFuelTank& GetFuelTank(size_t index); // Returns the fuel tank for a given UID. - TIGL_EXPORT CCPACSFuelTank const& GetFuelTank(const std::string& UID) const; + TIGL_EXPORT const CCPACSFuelTank& GetFuelTank(const std::string& UID) const; + TIGL_EXPORT CCPACSFuelTank& GetFuelTank(const std::string& UID); // Returns the fuel tank index for a given UID. - TIGL_EXPORT int GetFuelTankIndex(const std::string& UID) const; + TIGL_EXPORT size_t GetFuelTankIndex(const std::string& UID) const; // Returns list of fuel tanks - TIGL_EXPORT CCPACSFuelTanks& GetFuelTanks(); TIGL_EXPORT const CCPACSFuelTanks& GetFuelTanks() const; + TIGL_EXPORT CCPACSFuelTanks& GetFuelTanks(); // Returns list of engine pylons - TIGL_EXPORT boost::optional& GetEnginePylons(); TIGL_EXPORT const boost::optional& GetEnginePylons() const; + TIGL_EXPORT boost::optional& GetEnginePylons(); // Returns list of engines - TIGL_EXPORT boost::optional& GetEngines(); TIGL_EXPORT const boost::optional& GetEngines() const; + TIGL_EXPORT boost::optional& GetEngines(); // Returns list of engine positions - TIGL_EXPORT boost::optional& GetEnginePositions(); TIGL_EXPORT const boost::optional& GetEnginePositions() const; + TIGL_EXPORT boost::optional& GetEnginePositions(); - TIGL_EXPORT CCPACSEngine& GetEngine(const std::string& UID) const; + TIGL_EXPORT const CCPACSEngine& GetEngine(const std::string& UID) const; + TIGL_EXPORT CCPACSEngine& GetEngine(const std::string& UID); // Returns the farfield TIGL_EXPORT CCPACSFarField& GetFarField(); // Returns the number of external objects (i.e. linked CAD files like STEP, IGES) - TIGL_EXPORT int GetExternalObjectCount() const; + TIGL_EXPORT size_t GetExternalObjectCount() const; - TIGL_EXPORT CCPACSExternalObject& GetExternalObject(int index) const; + TIGL_EXPORT CCPACSExternalObject& GetExternalObject(size_t index) const; // Returns the guide curve profile for a given UID. - TIGL_EXPORT CCPACSGuideCurveProfile& GetGuideCurveProfile(std::string UID); TIGL_EXPORT const CCPACSGuideCurveProfile& GetGuideCurveProfile(std::string UID) const; + TIGL_EXPORT CCPACSGuideCurveProfile& GetGuideCurveProfile(std::string UID); // Returns the uid manager - TIGL_EXPORT CTiglUIDManager& GetUIDManager(); TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); // Returns the algorithm for fusing the aircraft TIGL_EXPORT PTiglFusePlane AircraftFusingAlgo(); @@ -233,11 +246,11 @@ class CCPACSConfiguration TIGL_EXPORT CCPACSHeader* GetHeader(); /** Getter for member wings */ - TIGL_EXPORT CCPACSWings& GetWings(); TIGL_EXPORT const CCPACSWings& GetWings() const; + TIGL_EXPORT CCPACSWings& GetWings(); - TIGL_EXPORT boost::optional GetACSystems(); TIGL_EXPORT boost::optional GetACSystems() const; + TIGL_EXPORT boost::optional GetACSystems(); private: // Copy constructor diff --git a/src/control_devices/CCPACSTrailingEdgeDevice.h b/src/control_devices/CCPACSTrailingEdgeDevice.h index 8e4cc6a968..3242e58039 100644 --- a/src/control_devices/CCPACSTrailingEdgeDevice.h +++ b/src/control_devices/CCPACSTrailingEdgeDevice.h @@ -18,6 +18,7 @@ */ #include "generated/CPACSTrailingEdgeDevice.h" +#include "generated/CPACSTrailingEdgeDevices.h" #include "CTiglAbstractGeometricComponent.h" #include "Cache.h" diff --git a/src/control_devices/CCPACSTrailingEdgeDevices.cpp b/src/control_devices/CCPACSTrailingEdgeDevices.cpp deleted file mode 100644 index 2556ffd314..0000000000 --- a/src/control_devices/CCPACSTrailingEdgeDevices.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/* -* Copyright (C) 2007-2021 German Aerospace Center (DLR/SC) -* -* Created: 2021-02-05 Jan Kleinert -* -* 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. -*/ -/** -* @file -* @brief Implementation of CPACS trailing edge devices -*/ - -#include "CTiglError.h" -#include "CCPACSTrailingEdgeDevice.h" -#include "CCPACSTrailingEdgeDevices.h" - -namespace tigl { - -CCPACSTrailingEdgeDevices::CCPACSTrailingEdgeDevices(CCPACSControlSurfaces* parent, CTiglUIDManager* uidMgr) - : generated::CPACSTrailingEdgeDevices(parent, uidMgr) {} - -// Returns the total count of trailing edge devices in a configuration -int CCPACSTrailingEdgeDevices::GetTrailingEdgeDeviceCount() const -{ - return static_cast(m_trailingEdgeDevices.size()); -} - -// Returns the trailing edge device for a given index. -CCPACSTrailingEdgeDevice& CCPACSTrailingEdgeDevices::GetTrailingEdgeDevice(int index) const -{ - index --; - if (index < 0 || index >= GetTrailingEdgeDeviceCount()) { - throw CTiglError("Invalid index in CCPACSTrailingEdgeDevices::GetTrailingEdgeDevice", TIGL_INDEX_ERROR); - } - return *m_trailingEdgeDevices[index]; -} - -// Returns the trailing edge device for a given UID. -CCPACSTrailingEdgeDevice& CCPACSTrailingEdgeDevices::GetTrailingEdgeDevice(const std::string& UID) const -{ - return *m_trailingEdgeDevices[GetTrailingEdgeDeviceIndex(UID)-1]; -} - -// Returns the trailing edge device index for a given UID. -int CCPACSTrailingEdgeDevices::GetTrailingEdgeDeviceIndex(const std::string& UID) const -{ - for (int i=0; i < GetTrailingEdgeDeviceCount(); i++) { - const std::string tmpUID(m_trailingEdgeDevices[i]->GetUID()); - if (tmpUID == UID) { - return i+1; - } - } - - // UID not there - throw CTiglError("Invalid UID in CCPACSTrailingEdgeDevices::GetTrailingEdgeDeviceIndex", TIGL_UID_ERROR); -} - -} // namespace tigl diff --git a/src/control_devices/CCPACSTrailingEdgeDevices.h b/src/control_devices/CCPACSTrailingEdgeDevices.h deleted file mode 100644 index 10337d55aa..0000000000 --- a/src/control_devices/CCPACSTrailingEdgeDevices.h +++ /dev/null @@ -1,50 +0,0 @@ -/* -* Copyright (C) 2007-2021 German Aerospace Center (DLR/SC) -* -* Created: 2021-02-05 Jan Kleinert -* -* 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. -*/ -/** -* @file -* @brief Implementation of CPACS trailing edge devices -*/ - -#ifndef CCPACSTRAILINGEDGEDEVICES_H -#define CCPACSTRAILINGEDGEDEVICES_H - -#include "generated/CPACSTrailingEdgeDevices.h" - -namespace tigl { - -class CCPACSTrailingEdgeDevices : public generated::CPACSTrailingEdgeDevices -{ -public: - TIGL_EXPORT CCPACSTrailingEdgeDevices(CCPACSControlSurfaces* parent, CTiglUIDManager* uidMgr); - - // Returns the total count of trailing edge devices in a configuration - TIGL_EXPORT int GetTrailingEdgeDeviceCount() const; - - // Returns the trailing edge device for a given index. - TIGL_EXPORT CCPACSTrailingEdgeDevice& GetTrailingEdgeDevice(int index) const; - - // Returns the trailing edge device for a given UID. - TIGL_EXPORT CCPACSTrailingEdgeDevice& GetTrailingEdgeDevice(const std::string& UID) const; - - // Returns the trailing edge device index for a given UID. - TIGL_EXPORT int GetTrailingEdgeDeviceIndex(const std::string& UID) const; -}; - -} // namespace tigl - -#endif diff --git a/src/cpacs_other/CCPACSProfiles.cpp b/src/cpacs_other/CCPACSProfiles.cpp deleted file mode 100644 index bc6eaea367..0000000000 --- a/src/cpacs_other/CCPACSProfiles.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* -* 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 "CCPACSProfiles.h" - -namespace tigl -{ -CCPACSProfiles::CCPACSProfiles(CCPACSVehicles* parent, CTiglUIDManager* uidMgr) - : generated::CPACSProfiles(parent, uidMgr) {} - -} // end namespace tigl diff --git a/src/cpacs_other/CCPACSProfiles.h b/src/cpacs_other/CCPACSProfiles.h deleted file mode 100644 index af4d2ca7d7..0000000000 --- a/src/cpacs_other/CCPACSProfiles.h +++ /dev/null @@ -1,31 +0,0 @@ -/* -* 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. -*/ - -#ifndef CCPACSPROFILES_H -#define CCPACSPROFILES_H - -#include "generated/CPACSProfiles.h" - -namespace tigl -{ -class CCPACSProfiles : public generated::CPACSProfiles -{ -public: - TIGL_EXPORT CCPACSProfiles(CCPACSVehicles* parent, CTiglUIDManager* uidMgr); - -}; - -} // end namespace tigl - -#endif // CCPACSPROFILES_H diff --git a/src/cpacs_other/CCPACSStructuralProfiles.cpp b/src/cpacs_other/CCPACSStructuralProfiles.cpp deleted file mode 100644 index cdc8b4de83..0000000000 --- a/src/cpacs_other/CCPACSStructuralProfiles.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/* -* Copyright (c) 2018 RISC Software GmbH -* -* 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 "CCPACSStructuralProfiles.h" - -namespace tigl -{ - -CCPACSStructuralProfiles::CCPACSStructuralProfiles(CCPACSProfiles* parent, CTiglUIDManager* uidMgr) - : generated::CPACSStructuralProfiles(parent, uidMgr) -{ -} - -} // namespace tigl diff --git a/src/cpacs_other/CCPACSStructuralProfiles.h b/src/cpacs_other/CCPACSStructuralProfiles.h deleted file mode 100644 index 3c195f2deb..0000000000 --- a/src/cpacs_other/CCPACSStructuralProfiles.h +++ /dev/null @@ -1,30 +0,0 @@ -/* -* Copyright (c) 2018 RISC Software GmbH -* -* 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/CPACSStructuralProfiles.h" - -namespace tigl -{ - -class CCPACSStructuralProfiles : public generated::CPACSStructuralProfiles -{ -public: - TIGL_EXPORT CCPACSStructuralProfiles(CCPACSProfiles* parent, CTiglUIDManager* uidMgr); -}; - -} // namespace tigl diff --git a/src/engine_nacelle/CCPACSEngines.cpp b/src/engine_nacelle/CCPACSEngines.cpp deleted file mode 100644 index 59203fba45..0000000000 --- a/src/engine_nacelle/CCPACSEngines.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/* -* Copyright (C) 2019 German Aerospace Center (DLR/SC) -* -* Created: 2019-01-04 Jan Kleinert -* 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 "CCPACSEngines.h" -#include "CTiglUIDManager.h" -#include "cassert" - -namespace tigl { - -CCPACSEngines::CCPACSEngines(CCPACSVehicles* parent, CTiglUIDManager* uidMgr) - : generated::CPACSEngines(parent, uidMgr) -{} - -TIGL_EXPORT size_t CCPACSEngines::GetEngineCount() const -{ - return GetEngines().size(); -} - -TIGL_EXPORT CCPACSEngine& CCPACSEngines::GetEngine(size_t index) const -{ - index--; - if (index >= GetEngineCount()) { - throw CTiglError("Invalid index in CCPACSEngines::GetEngine", TIGL_INDEX_ERROR); - } - return *m_engines[index]; -} - -TIGL_EXPORT CCPACSEngine& CCPACSEngines::GetEngine(std::string const uid) const -{ - for (std::size_t i = 0; i < m_engines.size(); ++i) { - if (m_engines[i]->GetUID() == uid) { - return *m_engines[i]; - } - } - throw CTiglError("CCPACSEngines::GetEngine: Engine \"" + uid + "\" not found in CPACS file!", TIGL_UID_ERROR); -} - -} //namespace tigl diff --git a/src/engine_nacelle/CCPACSEngines.h b/src/engine_nacelle/CCPACSEngines.h deleted file mode 100644 index 6e1be94088..0000000000 --- a/src/engine_nacelle/CCPACSEngines.h +++ /dev/null @@ -1,37 +0,0 @@ -/* -* Copyright (C) 2018 German Aerospace Center (DLR/SC) -* -* Created: 2019-01-04 Jan Kleinert -* 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/CPACSEngines.h" -#include "generated/CPACSEngine.h" -#include "tigl_internal.h" - -namespace tigl -{ - -class CCPACSEngines : public generated::CPACSEngines -{ -public: - TIGL_EXPORT CCPACSEngines(CCPACSVehicles* parent, CTiglUIDManager* uidMgr); - - TIGL_EXPORT size_t GetEngineCount() const; - TIGL_EXPORT CCPACSEngine& GetEngine(size_t index) const; - TIGL_EXPORT CCPACSEngine& GetEngine(std::string const uid) const; -}; - -} //namespace tigl diff --git a/src/engine_pylon/CCPACSEnginePylons.cpp b/src/engine_pylon/CCPACSEnginePylons.cpp deleted file mode 100644 index f8e18bcc9b..0000000000 --- a/src/engine_pylon/CCPACSEnginePylons.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* -* Copyright (C) 2018 German Aerospace Center (DLR/SC) -* -* Created: 2018-10-31 Martin Siggel -* 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 "CCPACSEnginePylons.h" - -#include "CTiglError.h" -#include "CCPACSEnginePylon.h" - -namespace tigl -{ - -CCPACSEnginePylons::CCPACSEnginePylons(CCPACSAircraftModel* parent, CTiglUIDManager* uidMgr) - : generated::CPACSEnginePylons(parent, uidMgr) -{ -} - -// Gets a pylon by index. -CCPACSEnginePylon& CCPACSEnginePylons::GetEnginePylon(int index) -{ - index--; - if (index < 0 || index >= GetPylonCount()) { - throw CTiglError("Invalid index value in CCPACSEnginePylons::GetEnginePylon", TIGL_INDEX_ERROR); - } - return *m_enginePylons[index]; -} - -const CCPACSEnginePylon& CCPACSEnginePylons::GetEnginePylon(int index) const -{ - index--; - if (index < 0 || index >= GetPylonCount()) { - throw CTiglError("Invalid index value in CCPACSEnginePylons::GetEnginePylon", TIGL_INDEX_ERROR); - } - return *m_enginePylons[index]; -} - -// Gets a pylon by uid. -CCPACSEnginePylon& CCPACSEnginePylons::GetEnginePylon(const std::string& segmentUID) -{ - for (std::size_t i = 0; i < m_enginePylons.size(); i++) { - if (m_enginePylons[i]->GetUID() == segmentUID) { - return *m_enginePylons[i]; - } - } - throw CTiglError("Invalid uid in CCPACSEnginePylons::GetEnginePylon", TIGL_UID_ERROR); -} - -const CCPACSEnginePylon& CCPACSEnginePylons::GetEnginePylon(const std::string& segmentUID) const -{ - for (std::size_t i = 0; i < m_enginePylons.size(); i++) { - if (m_enginePylons[i]->GetUID() == segmentUID) { - return *m_enginePylons[i]; - } - } - throw CTiglError("Invalid uid in CCPACSEnginePylons::GetEnginePylon", TIGL_UID_ERROR); -} - -// Gets total pylon count -int CCPACSEnginePylons::GetPylonCount() const -{ - return static_cast(m_enginePylons.size()); -} - -} // namespace tigl diff --git a/src/engine_pylon/CCPACSEnginePylons.h b/src/engine_pylon/CCPACSEnginePylons.h deleted file mode 100644 index b761afa776..0000000000 --- a/src/engine_pylon/CCPACSEnginePylons.h +++ /dev/null @@ -1,45 +0,0 @@ -/* -* Copyright (C) 2018 German Aerospace Center (DLR/SC) -* -* Created: 2018-10-31 Martin Siggel -* 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. -*/ - -#ifndef CCPACSENGINEPYLONS_H -#define CCPACSENGINEPYLONS_H - -#include "generated/CPACSEnginePylons.h" -#include "tigl_internal.h" - -namespace tigl -{ - -class CCPACSEnginePylons : public generated::CPACSEnginePylons -{ -public: - // Constructor - TIGL_EXPORT CCPACSEnginePylons(CCPACSAircraftModel* parent, CTiglUIDManager* uidMgr); - - // Gets a pylon by index or UID. - TIGL_EXPORT CCPACSEnginePylon& GetEnginePylon(const int index); - TIGL_EXPORT const CCPACSEnginePylon& GetEnginePylon(const int index) const; - TIGL_EXPORT CCPACSEnginePylon& GetEnginePylon(const std::string& segmentUID); - TIGL_EXPORT const CCPACSEnginePylon& GetEnginePylon(const std::string& segmentUID) const; - - // Gets total pylon count - TIGL_EXPORT int GetPylonCount() const; -}; - -} // end namespace tigl - -#endif // CCPACSENGINEPYLONS_H diff --git a/src/exports/CTiglCADExporter.cpp b/src/exports/CTiglCADExporter.cpp index 5403def14a..e7c547d264 100644 --- a/src/exports/CTiglCADExporter.cpp +++ b/src/exports/CTiglCADExporter.cpp @@ -26,6 +26,7 @@ #include "CCPACSEnginePylon.h" #include "CCPACSEnginePositions.h" #include "CCPACSEnginePosition.h" +#include "CCPACSFuselage.h" #include #include @@ -85,7 +86,7 @@ bool CTiglCADExporter::AddConfiguration(CCPACSConfiguration& config, const Shape if (config.GetEnginePylons()) { CCPACSEnginePylons& pylons = config.GetEnginePylons().value(); - for (int p = 1; p <= pylons.GetPylonCount(); ++p) { + for (int p = 1; p <= pylons.GetEnginePylonCount(); ++p) { CCPACSEnginePylon& pylon = pylons.GetEnginePylon(p); if (!pylon.HasLoft()) { diff --git a/src/fuelTanks/CCPACSFuelTanks.cpp b/src/fuelTanks/CCPACSFuelTanks.cpp deleted file mode 100644 index 398c133fcf..0000000000 --- a/src/fuelTanks/CCPACSFuelTanks.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* -* Copyright (C) 2007-2025 German Aerospace Center (DLR/SC) -* -* Created: 2025-05-09 Marko Alder -* -* Created: 2022-04-06 Anton Reiswich -* 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. -*/ -/** -* @file -* @brief Implementation of CPACS fuelTanks handling routines. -*/ - -#include "CCPACSFuelTanks.h" -#include "CCPACSFuelTank.h" -#include "CTiglError.h" - -namespace tigl -{ - -CCPACSFuelTanks::CCPACSFuelTanks(CCPACSAircraftModel* parent, CTiglUIDManager* uidMgr) - : generated::CPACSFuelTanks(parent, uidMgr) -{ -} - -int CCPACSFuelTanks::GetFuelTanksCount() const -{ - return static_cast(m_fuelTanks.size()); -} - -CCPACSFuelTank const& CCPACSFuelTanks::GetFuelTank(std::string const& uID) const -{ - return const_cast(*this).GetFuelTank(uID); -} - -CCPACSFuelTank& CCPACSFuelTanks::GetFuelTank(std::string const& uID) -{ - auto it = std::find_if(m_fuelTanks.begin(), m_fuelTanks.end(), - [&](std::unique_ptr const& t) { return t->GetUID() == uID; }); - - if (it != std::end(m_fuelTanks)) { - return **it; - } - throw CTiglError("Could not find fuelTank with uid " + uID, TIGL_UID_ERROR); -} - -CCPACSFuelTank const& CCPACSFuelTanks::GetFuelTank(int index) const -{ - return const_cast(*this).GetFuelTank(index); -} - -CCPACSFuelTank& CCPACSFuelTanks::GetFuelTank(int index) -{ - index--; - if (index < 0 || index >= GetFuelTanksCount()) { - throw CTiglError("Invalid index in CCPACSFuelTanks::GetFuelTank", TIGL_INDEX_ERROR); - } - return *m_fuelTanks[index]; -} - -int CCPACSFuelTanks::GetFuelTankIndex(const std::string& uID) const -{ - for (int i = 0; i < GetFuelTanksCount(); i++) { - const std::string tmpUID(m_fuelTanks[i]->GetUID()); - if (tmpUID == uID) { - return i + 1; - } - } - throw CTiglError("Could not find fuelTank with uid " + uID, TIGL_UID_ERROR); -} - -} //namespace tigl diff --git a/src/fuelTanks/CCPACSFuelTanks.h b/src/fuelTanks/CCPACSFuelTanks.h deleted file mode 100644 index e450e55fbf..0000000000 --- a/src/fuelTanks/CCPACSFuelTanks.h +++ /dev/null @@ -1,51 +0,0 @@ -/* -* Copyright (C) 2007-2025 German Aerospace Center (DLR/SC) -* -* Created: 2025-05-09 Marko Alder -* -* Created: 2022-04-06 Anton Reiswich -* 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. -*/ -/** -* @file -* @brief Implementation of CPACS fuelTanks handling routines. -*/ - -#pragma once - -#include "generated/CPACSFuelTanks.h" - -namespace tigl -{ - -class CCPACSFuelTanks : public generated::CPACSFuelTanks -{ -public: - TIGL_EXPORT CCPACSFuelTanks(CCPACSAircraftModel* parent, CTiglUIDManager* uidMgr); - - // Get a specific fuel tank for a given uID - TIGL_EXPORT CCPACSFuelTank const& GetFuelTank(std::string const& uID) const; - TIGL_EXPORT CCPACSFuelTank& GetFuelTank(std::string const& uID); - - // Get a specific fuel tank for a given index. - TIGL_EXPORT CCPACSFuelTank const& GetFuelTank(int index) const; - TIGL_EXPORT CCPACSFuelTank& GetFuelTank(int index); - - // Returns the fuel tank index for a given uID. - TIGL_EXPORT int GetFuelTankIndex(std::string const& uID) const; - - // Returns the total count of fuel tank in a configuration - TIGL_EXPORT int GetFuelTanksCount() const; -}; - -} //namespace tigl diff --git a/src/fuelTanks/CCPACSVessel.cpp b/src/fuelTanks/CCPACSVessel.cpp index 4ba65fd021..5c8fbfe897 100644 --- a/src/fuelTanks/CCPACSVessel.cpp +++ b/src/fuelTanks/CCPACSVessel.cpp @@ -21,14 +21,14 @@ */ #include "CCPACSVessel.h" -#include "CCPACSVessels.h" +#include "generated/CPACSVessels.h" #include "CCPACSFuselageSegment.h" #include "CTiglMakeLoft.h" #include "CNamedShape.h" #include "CTiglTopoAlgorithms.h" #include "tiglcommonfunctions.h" #include "CCPACSFuelTank.h" -#include "CCPACSFuelTanks.h" +#include "generated/CPACSFuelTanks.h" #include "generated/CPACSDomeType.h" #include "generated/CPACSEllipsoidDome.h" #include "generated/CPACSTorisphericalDome.h" @@ -82,7 +82,7 @@ TiglGeometricComponentIntent CCPACSVessel::GetComponentIntent() const return TIGL_INTENT_PHYSICAL; } -int CCPACSVessel::GetSectionCount() const +size_t CCPACSVessel::GetSectionCount() const { if (m_sections_choice1) { return m_sections_choice1.get_ptr()->GetSectionCount(); @@ -92,22 +92,26 @@ int CCPACSVessel::GetSectionCount() const } } -CCPACSFuselageSection const& CCPACSVessel::GetSection(int index) const +const CCPACSFuselageSection& CCPACSVessel::GetSection (size_t index) const { return const_cast(*this).GetSection(index); } -CCPACSFuselageSection& CCPACSVessel::GetSection(int index) +CCPACSFuselageSection& CCPACSVessel::GetSection (size_t index) { if (m_sections_choice1) { - return m_sections_choice1.get().GetSection(index); + try { + return m_sections_choice1.get().GetSection(index); + } catch(CTiglError e){ + throw CTiglError("Invalid index in CCPACSVessel::GetSection", TIGL_INDEX_ERROR); + } } else { throw CTiglError(_vesselTypeException); } } -CCPACSFuselageSection const& CCPACSVessel::GetSection(const std::string& sectionUID) const +const CCPACSFuselageSection& CCPACSVessel::GetSection(const std::string& sectionUID) const { return const_cast(*this).GetSection(sectionUID); } @@ -142,7 +146,7 @@ TopoDS_Shape CCPACSVessel::GetSectionFace(const std::string sectionUID) const return TopoDS_Shape(); } -int CCPACSVessel::GetSegmentCount() const +size_t CCPACSVessel::GetSegmentCount() const { if (m_segments_choice1) { return m_segments_choice1.get_ptr()->GetSegmentCount(); @@ -152,24 +156,23 @@ int CCPACSVessel::GetSegmentCount() const } } -CCPACSFuselageSegment& CCPACSVessel::GetSegment(const int index) +CCPACSFuselageSegment& CCPACSVessel::GetSegment(const size_t index) { if (m_segments_choice1) { - return m_segments_choice1.get().GetSegment(index); + try { + return m_segments_choice1.get().GetSegment(index); + } catch (CTiglError e){ + throw CTiglError("Invalid index in CCPACSVessel::GetSegment", TIGL_INDEX_ERROR); + } } else { throw CTiglError(_vesselTypeException); } } -const CCPACSFuselageSegment& CCPACSVessel::GetSegment(const int index) const +const CCPACSFuselageSegment& CCPACSVessel::GetSegment(const size_t index) const { - if (m_segments_choice1) { - return m_segments_choice1.get().GetSegment(index); - } - else { - throw CTiglError(_vesselTypeException); - } + return const_cast(*this).GetSegment(index); } CCPACSFuselageSegment& CCPACSVessel::GetSegment(std::string uid) diff --git a/src/fuelTanks/CCPACSVessel.h b/src/fuelTanks/CCPACSVessel.h index db09b9eaa4..1f3cfaa63f 100644 --- a/src/fuelTanks/CCPACSVessel.h +++ b/src/fuelTanks/CCPACSVessel.h @@ -49,11 +49,11 @@ class CCPACSVessel : public generated::CPACSVessel, public CTiglRelativelyPositi TIGL_EXPORT TiglGeometricComponentIntent GetComponentIntent() const override; // Get number of sections - TIGL_EXPORT int GetSectionCount() const; + TIGL_EXPORT size_t GetSectionCount() const; // Get a specific section - TIGL_EXPORT CCPACSFuselageSection const& GetSection(int index) const; - TIGL_EXPORT CCPACSFuselageSection& GetSection(int index); + TIGL_EXPORT CCPACSFuselageSection const& GetSection(size_t index) const; + TIGL_EXPORT CCPACSFuselageSection& GetSection(size_t index); TIGL_EXPORT CCPACSFuselageSection const& GetSection(const std::string& sectionUID) const; TIGL_EXPORT CCPACSFuselageSection& GetSection(const std::string& sectionUID); @@ -61,10 +61,10 @@ class CCPACSVessel : public generated::CPACSVessel, public CTiglRelativelyPositi TIGL_EXPORT TopoDS_Shape GetSectionFace(const std::string sectionUID) const; // Get number of segments - TIGL_EXPORT int GetSegmentCount() const; + TIGL_EXPORT size_t GetSegmentCount() const; // Get a specific segment via its index - TIGL_EXPORT CCPACSFuselageSegment& GetSegment(const int index); - TIGL_EXPORT const CCPACSFuselageSegment& GetSegment(const int index) const; + TIGL_EXPORT CCPACSFuselageSegment& GetSegment(const size_t index); + TIGL_EXPORT const CCPACSFuselageSegment& GetSegment(const size_t index) const; // Get a specific segment via its uID TIGL_EXPORT CCPACSFuselageSegment& GetSegment(std::string uid); diff --git a/src/fuelTanks/CCPACSVessels.cpp b/src/fuelTanks/CCPACSVessels.cpp deleted file mode 100644 index 01a2a36242..0000000000 --- a/src/fuelTanks/CCPACSVessels.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* -* Copyright (C) 2007-2025 German Aerospace Center (DLR/SC) -* -* Created: 2025-05-09 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. -*/ -/** -* @file -* @brief Implementation of CPACS vessels handling routines. -*/ - -#include "CCPACSVessels.h" -#include "CCPACSVessel.h" -#include "CTiglError.h" - -namespace tigl -{ - -CCPACSVessels::CCPACSVessels(CCPACSFuelTank* parent, CTiglUIDManager* uidMgr) - : generated::CPACSVessels(parent, uidMgr) -{ -} - -int CCPACSVessels::GetVesselsCount() const -{ - return static_cast(m_vessels.size()); -} - -CCPACSVessel const& CCPACSVessels::GetVessel(std::string const& uID) const -{ - return const_cast(*this).GetVessel(uID); -} - -CCPACSVessel& CCPACSVessels::GetVessel(std::string const& uID) -{ - auto it = std::find_if(m_vessels.begin(), m_vessels.end(), - [&](std::unique_ptr const& v) { return v->GetUID() == uID; }); - - if (it != std::end(m_vessels)) { - return **it; - } - throw CTiglError("Could not find vessel with uid " + uID, TIGL_UID_ERROR); -} - -CCPACSVessel const& CCPACSVessels::GetVessel(int index) const -{ - return const_cast(*this).GetVessel(index); -} - -CCPACSVessel& CCPACSVessels::GetVessel(int index) -{ - index--; - if (index < 0 || index >= GetVesselsCount()) { - throw CTiglError("Invalid index in CCPACSVessels::GetVessel", TIGL_INDEX_ERROR); - } - return *m_vessels[index]; -} - -int CCPACSVessels::GetVesselIndex(const std::string& uID) const -{ - for (int i = 0; i < GetVesselsCount(); i++) { - const std::string tmpUID(m_vessels[i]->GetUID()); - if (tmpUID == uID) { - return i + 1; - } - } - throw CTiglError("Could not find vessel with uid " + uID, TIGL_UID_ERROR); -} - -} //namespace tigl diff --git a/src/fuelTanks/CCPACSVessels.h b/src/fuelTanks/CCPACSVessels.h deleted file mode 100644 index 895315c6b9..0000000000 --- a/src/fuelTanks/CCPACSVessels.h +++ /dev/null @@ -1,54 +0,0 @@ -/* -* Copyright (C) 2007-2025 German Aerospace Center (DLR/SC) -* -* Created: 2025-05-09 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. -*/ -/** -* @file -* @brief Implementation of CPACS vessels handling routines. -*/ - -#pragma once - -#include "generated/CPACSVessels.h" -#include -#include - -namespace tigl -{ - -class CCPACSVessels : public generated::CPACSVessels -{ -public: - TIGL_EXPORT CCPACSVessels(CCPACSFuelTank* parent, CTiglUIDManager* uidMgr); - - // Get a specific vessel for a given uID - TIGL_EXPORT CCPACSVessel const& GetVessel(std::string const& uID) const; - TIGL_EXPORT CCPACSVessel& GetVessel(std::string const& uID); - - // Get a specific vessel for a given index. - TIGL_EXPORT CCPACSVessel const& GetVessel(int index) const; - TIGL_EXPORT CCPACSVessel& GetVessel(int index); - - // Returns the vessel index for a given uID. - TIGL_EXPORT int GetVesselIndex(const std::string& uID) const; - - // Returns the total count of fuselages in a configuration - TIGL_EXPORT int GetVesselsCount() const; - -private: -}; - -} //namespace tigl diff --git a/src/fuselage/CCPACSFrame.cpp b/src/fuselage/CCPACSFrame.cpp index 257ead797b..96aebf576d 100644 --- a/src/fuselage/CCPACSFrame.cpp +++ b/src/fuselage/CCPACSFrame.cpp @@ -43,6 +43,7 @@ #include "CCPACSCrossBeamAssemblyPosition.h" #include "CCPACSCrossBeamStrutAssemblyPosition.h" #include "CCPACSFuselageStringer.h" +#include "CCPACSFramesAssembly.h" namespace tigl { diff --git a/src/fuselage/CCPACSFuselage.cpp b/src/fuselage/CCPACSFuselage.cpp index 343270be0d..f564201733 100644 --- a/src/fuselage/CCPACSFuselage.cpp +++ b/src/fuselage/CCPACSFuselage.cpp @@ -174,7 +174,7 @@ TopoDS_Shape CCPACSFuselage::GetSectionFace(const std::string section_uid) const } // Returns the section for a given index -CCPACSFuselageSection& CCPACSFuselage::GetSection(int index) const +CCPACSFuselageSection& CCPACSFuselage::GetSection(int index) { return m_sections.GetSection(index); } diff --git a/src/fuselage/CCPACSFuselage.h b/src/fuselage/CCPACSFuselage.h index d9680c909c..2314607773 100644 --- a/src/fuselage/CCPACSFuselage.h +++ b/src/fuselage/CCPACSFuselage.h @@ -28,7 +28,7 @@ #include "tigl_config.h" #include "CTiglTransformation.h" -#include "CCPACSFuselageSections.h" +#include "generated/CPACSFuselageSections.h" #include "CCPACSFuselageSegments.h" #include "CCPACSPositionings.h" #include "CTiglRelativelyPositionedComponent.h" @@ -72,7 +72,7 @@ class CCPACSFuselage : public generated::CPACSFuselage, public CTiglRelativelyPo TIGL_EXPORT int GetSectionCount() const; // Returns the section for a given index - TIGL_EXPORT CCPACSFuselageSection& GetSection(int index) const; + TIGL_EXPORT CCPACSFuselageSection& GetSection(int index); // Returns the face that has a given fuselage section as its boundary TIGL_EXPORT TopoDS_Shape GetSectionFace(const std::string section_uid) const; diff --git a/src/fuselage/CCPACSFuselageProfiles.cpp b/src/fuselage/CCPACSFuselageProfiles.cpp index eaeccaddb5..57044f3285 100644 --- a/src/fuselage/CCPACSFuselageProfiles.cpp +++ b/src/fuselage/CCPACSFuselageProfiles.cpp @@ -91,7 +91,14 @@ int CCPACSFuselageProfiles::GetProfileCount() const } // Returns the fuselage profile for a given uid. -CCPACSFuselageProfile& CCPACSFuselageProfiles::GetProfile(std::string uid) const +const CCPACSFuselageProfile& CCPACSFuselageProfiles::GetProfile(std::string uid) const +{ + for (auto& p : m_fuselageProfiles) + if (p->GetUID() == uid) + return static_cast(*p); + throw CTiglError("Fuselage profile \"" + uid + "\" not found in CPACS file!", TIGL_UID_ERROR); +} +CCPACSFuselageProfile& CCPACSFuselageProfiles::GetProfile(std::string uid) { for (auto& p : m_fuselageProfiles) if (p->GetUID() == uid) @@ -99,13 +106,14 @@ CCPACSFuselageProfile& CCPACSFuselageProfiles::GetProfile(std::string uid) const throw CTiglError("Fuselage profile \"" + uid + "\" not found in CPACS file!", TIGL_UID_ERROR); } -// Returns the fuselage profile for a given index - TODO: depricated function! -CCPACSFuselageProfile& CCPACSFuselageProfiles::GetProfile(int index) const +// Returns the fuselage profile for a given index +const CCPACSFuselageProfile& CCPACSFuselageProfiles::GetProfile(size_t index) const +{ + return static_cast(*m_fuselageProfiles[index]); +} + +CCPACSFuselageProfile& CCPACSFuselageProfiles::GetProfile(size_t index) { - index--; - if (index < 0 || index >= m_fuselageProfiles.size()) { - throw CTiglError("Invalid index in CCPACSFuselageProfiles::GetProfile", TIGL_INDEX_ERROR); - } return static_cast(*m_fuselageProfiles[index]); } diff --git a/src/fuselage/CCPACSFuselageProfiles.h b/src/fuselage/CCPACSFuselageProfiles.h index 619b94eedb..8c60b097ad 100644 --- a/src/fuselage/CCPACSFuselageProfiles.h +++ b/src/fuselage/CCPACSFuselageProfiles.h @@ -47,16 +47,18 @@ class CCPACSFuselageProfiles : public generated::CPACSFuselageProfiles TIGL_EXPORT void AddProfile(CCPACSFuselageProfile* profile); // Removes a CPACS wing profile from the list - TIGL_EXPORT void DeleteProfile( std::string uid ); + TIGL_EXPORT void DeleteProfile(std::string uid ); // Returns the total count of fuselage profiles in this configuration TIGL_EXPORT int GetProfileCount() const; // Returns the fuselage profile for a given index. - TIGL_EXPORT CCPACSFuselageProfile& GetProfile(int index) const; + TIGL_EXPORT const CCPACSFuselageProfile& GetProfile(size_t index) const; + TIGL_EXPORT CCPACSFuselageProfile& GetProfile(size_t index); // Returns the fuselage profile for a given uid. - TIGL_EXPORT CCPACSFuselageProfile& GetProfile(std::string uid) const; + TIGL_EXPORT const CCPACSFuselageProfile& GetProfile(std::string uid) const; + TIGL_EXPORT CCPACSFuselageProfile& GetProfile(std::string uid); // Invalidates internal state TIGL_EXPORT void Invalidate(const boost::optional& source = boost::none) const; diff --git a/src/fuselage/CCPACSFuselageSectionElement.cpp b/src/fuselage/CCPACSFuselageSectionElement.cpp index 11059e62eb..9dd45241a8 100644 --- a/src/fuselage/CCPACSFuselageSectionElement.cpp +++ b/src/fuselage/CCPACSFuselageSectionElement.cpp @@ -22,7 +22,7 @@ #include "CCPACSFuselageSectionElement.h" #include "CCPACSFuselageSectionElements.h" -#include "CCPACSFuselageSections.h" +#include "generated/CPACSFuselageSections.h" #include "CCPACSFuselageSection.h" #include "CCPACSFuselage.h" diff --git a/src/fuselage/CCPACSFuselageSections.cpp b/src/fuselage/CCPACSFuselageSections.cpp deleted file mode 100644 index 9756290bbe..0000000000 --- a/src/fuselage/CCPACSFuselageSections.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* -* Copyright (C) 2007-2013 German Aerospace Center (DLR/SC) -* -* Created: 2010-08-13 Markus Litz -* 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. -*/ -/** -* @file -* @brief Implementation of CPACS fuselage sections handling routines. -*/ - -#include "CCPACSFuselageSections.h" -#include "CCPACSFuselageSection.h" - -#include "CTiglError.h" - -namespace tigl -{ -CCPACSFuselageSections::CCPACSFuselageSections(CCPACSFuselage* parent, CTiglUIDManager* uidMgr) - : generated::CPACSFuselageSections(parent, uidMgr) {} - -CCPACSFuselageSections::CCPACSFuselageSections(CCPACSDuct* parent, CTiglUIDManager* uidMgr) - : generated::CPACSFuselageSections(parent, uidMgr) {} - -CCPACSFuselageSections::CCPACSFuselageSections(CCPACSVessel* parent, CTiglUIDManager* uidMgr) - : generated::CPACSFuselageSections(parent, uidMgr) {} - -int CCPACSFuselageSections::GetSectionCount() const -{ - return static_cast(m_sections.size()); -} - -CCPACSFuselageSection& CCPACSFuselageSections::GetSection(int index) const -{ - index--; - if (index < 0 || index >= GetSectionCount()) { - throw CTiglError("Invalid index in CCPACSFuselageSections::GetSection", TIGL_INDEX_ERROR); - } - return *m_sections[index]; -} - -// Gets a section by uid. -CCPACSFuselageSection& CCPACSFuselageSections::GetSection(const std::string& sectionUID) -{ - for (std::size_t i = 0; i < m_sections.size(); i++) { - if (m_sections[i]->GetUID() == sectionUID) { - return *m_sections[i]; - } - } - throw CTiglError("Invalid uid in CCPACSWingSections::GetSection", TIGL_UID_ERROR); -} - - -} // end namespace tigl diff --git a/src/fuselage/CCPACSFuselageSections.h b/src/fuselage/CCPACSFuselageSections.h deleted file mode 100644 index b629fba7c2..0000000000 --- a/src/fuselage/CCPACSFuselageSections.h +++ /dev/null @@ -1,55 +0,0 @@ -/* -* Copyright (C) 2007-2013 German Aerospace Center (DLR/SC) -* -* Created: 2010-08-13 Markus Litz -* 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. -*/ -/** -* @file -* @brief Implementation of CPACS fuselage sections handling routines. -*/ - -#ifndef CCPACSFUSELAGESECTIONS_H -#define CCPACSFUSELAGESECTIONS_H - -#include "generated/CPACSFuselageSections.h" -#include "tigl_internal.h" -#include "tixi.h" -#include -#include - -namespace tigl -{ - -class CCPACSFuselageSection; - -class CCPACSFuselageSections : public generated::CPACSFuselageSections -{ -public: - TIGL_EXPORT CCPACSFuselageSections(CCPACSFuselage* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CCPACSFuselageSections(CCPACSDuct* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CCPACSFuselageSections(CCPACSVessel* parent, CTiglUIDManager* uidMgr); - - // Get section count - TIGL_EXPORT int GetSectionCount() const; - - // Returns the section for a given index - TIGL_EXPORT CCPACSFuselageSection& GetSection(int index) const; - - // Returns the section for a given uid - TIGL_EXPORT CCPACSFuselageSection& GetSection(const std::string& sectionUID); -}; - -} // end namespace tigl - -#endif // CCPACSFUSELAGESECTIONS_H diff --git a/src/fuselage/CCPACSFuselageSegment.cpp b/src/fuselage/CCPACSFuselageSegment.cpp index b988442953..8e5ec26110 100644 --- a/src/fuselage/CCPACSFuselageSegment.cpp +++ b/src/fuselage/CCPACSFuselageSegment.cpp @@ -22,17 +22,18 @@ #include #include "CCPACSFuselageSegment.h" +#include "generated/CPACSFuselageSegments.h" #include "CTiglFuselageSegmentGuidecurveBuilder.h" #include "CCPACSFuselage.h" #include "CCPACSDuct.h" #include "CCPACSVessel.h" -#include "CCPACSVessels.h" +#include "generated/CPACSVessels.h" #include "CCPACSFuselageProfile.h" #include "CCPACSConfiguration.h" #include "CTiglUIDManager.h" #include "generated/CPACSGuideCurve.h" -#include "CCPACSGuideCurveProfiles.h" +#include "generated/CPACSGuideCurveProfiles.h" #include "CCPACSGuideCurveAlgo.h" #include "CCPACSFuselageProfileGetPointAlgo.h" #include "CTiglLogging.h" diff --git a/src/fuselage/CCPACSFuselageSegments.cpp b/src/fuselage/CCPACSFuselageSegments.cpp index 2bea74b252..f5d478a95f 100644 --- a/src/fuselage/CCPACSFuselageSegments.cpp +++ b/src/fuselage/CCPACSFuselageSegments.cpp @@ -92,39 +92,6 @@ void CCPACSFuselageSegments::Invalidate(const boost::optional& sour guideCurves.clear(); } -// Gets a segment by index. -CCPACSFuselageSegment & CCPACSFuselageSegments::GetSegment(int index) -{ - return const_cast(static_cast(*this).GetSegment(index)); -} - -const CCPACSFuselageSegment & CCPACSFuselageSegments::GetSegment(int index) const -{ - index--; - if (index < 0 || index >= GetSegmentCount()) { - throw CTiglError("Invalid index value in CCPACSFuselageSegments::GetSegment", TIGL_INDEX_ERROR); - } - return *m_segments[index]; -} - -// Gets a segment by uid. -CCPACSFuselageSegment & CCPACSFuselageSegments::GetSegment(const std::string& segmentUID) -{ - for (std::size_t i = 0; i < m_segments.size(); i++) { - if (m_segments[i]->GetUID() == segmentUID) { - return *m_segments[i]; - } - } - throw CTiglError("Invalid uid in CCPACSFuselageSegments::GetSegment", TIGL_UID_ERROR); -} - -// Gets total segment count -int CCPACSFuselageSegments::GetSegmentCount() const -{ - return static_cast(m_segments.size()); -} - - CTiglRelativelyPositionedComponent const* CCPACSFuselageSegments::GetParentComponent() const { if (IsParent()) { diff --git a/src/fuselage/CCPACSFuselageSegments.h b/src/fuselage/CCPACSFuselageSegments.h index ff461ae57b..f45b39d88e 100644 --- a/src/fuselage/CCPACSFuselageSegments.h +++ b/src/fuselage/CCPACSFuselageSegments.h @@ -46,16 +46,6 @@ class CCPACSFuselageSegments : public generated::CPACSFuselageSegments // Invalidates internal state TIGL_EXPORT void Invalidate(const boost::optional& source = boost::none) const; - // Gets a segment by index. - TIGL_EXPORT CCPACSFuselageSegment& GetSegment(int index); - TIGL_EXPORT const CCPACSFuselageSegment& GetSegment(int index) const; - - // Gets a segment by uid - TIGL_EXPORT CCPACSFuselageSegment & GetSegment(const std::string& segmentUID); - - // Gets total segment count - TIGL_EXPORT int GetSegmentCount() const; - // Gets the parent component TIGL_EXPORT CTiglRelativelyPositionedComponent const* GetParentComponent() const; diff --git a/src/fuselage/CCPACSFuselages.cpp b/src/fuselage/CCPACSFuselages.cpp deleted file mode 100644 index 84f4004ce8..0000000000 --- a/src/fuselage/CCPACSFuselages.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* -* Copyright (C) 2007-2013 German Aerospace Center (DLR/SC) -* -* Created: 2010-08-13 Markus Litz -* 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. -*/ -/** -* @file -* @brief Implementation of CPACS fuselages handling routines. -*/ - -#include "CCPACSFuselages.h" -#include "CCPACSFuselage.h" -#include "CCPACSAircraftModel.h" -#include "CCPACSFuselageProfiles.h" -#include "CCPACSConfiguration.h" -#include "CTiglError.h" - -namespace tigl -{ -CCPACSFuselages::CCPACSFuselages(CCPACSAircraftModel* parent, CTiglUIDManager* uidMgr) - : generated::CPACSFuselages(parent, uidMgr) {} - -CCPACSFuselages::CCPACSFuselages(CCPACSRotorcraftModel* parent, CTiglUIDManager* uidMgr) - : generated::CPACSFuselages(parent, uidMgr) {} - -// Read CPACS fuselages element -void CCPACSFuselages::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) -{ - generated::CPACSFuselages::ReadCPACS(tixiHandle, xpath); -} - -// Write CPACS fuselage elements -void CCPACSFuselages::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const -{ - generated::CPACSFuselages::WriteCPACS(tixiHandle, xpath); -} - -// Returns the total count of fuselages in a configuration -int CCPACSFuselages::GetFuselageCount() const -{ - return static_cast(m_fuselages.size()); -} - -// Returns the fuselage for a given index. -CCPACSFuselage& CCPACSFuselages::GetFuselage(int index) const -{ - index--; - if (index < 0 || index >= GetFuselageCount()) { - throw CTiglError("Invalid index in CCPACSFuselages::GetFuselage", TIGL_INDEX_ERROR); - } - return *m_fuselages[index]; -} - -// Returns the fuselage for a given UID. -CCPACSFuselage& CCPACSFuselages::GetFuselage(const std::string& UID) const -{ - return *m_fuselages[GetFuselageIndex(UID) - 1]; -} - -// Returns the fuselage index for a given UID. -int CCPACSFuselages::GetFuselageIndex(const std::string& UID) const -{ - for (int i=0; i < GetFuselageCount(); i++) { - const std::string tmpUID(m_fuselages[i]->GetUID()); - if (tmpUID == UID) { - return i+1; - } - } - - // UID not there - throw CTiglError("Invalid UID in CCPACSFuselages::GetFuselageIndex", TIGL_UID_ERROR); -} - -} // end namespace tigl diff --git a/src/fuselage/CCPACSFuselages.h b/src/fuselage/CCPACSFuselages.h deleted file mode 100644 index 0fb053ab73..0000000000 --- a/src/fuselage/CCPACSFuselages.h +++ /dev/null @@ -1,63 +0,0 @@ -/* -* Copyright (C) 2007-2013 German Aerospace Center (DLR/SC) -* -* Created: 2010-08-13 Markus Litz -* 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. -*/ -/** -* @file -* @brief Implementation of CPACS fuselages handling routines. -*/ - -#ifndef CCPACSFUSELAGES_H -#define CCPACSFUSELAGES_H - -#include "generated/CPACSFuselages.h" -#include "tigl_internal.h" - -#include "CCPACSFuselage.h" -#include "CCPACSFuselageProfile.h" -#include "CCPACSFuselageProfiles.h" - - -namespace tigl -{ -class CCPACSFuselages : public generated::CPACSFuselages -{ -public: - //TIGL_EXPORT CCPACSFuselages(); - TIGL_EXPORT CCPACSFuselages(CCPACSAircraftModel* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CCPACSFuselages(CCPACSRotorcraftModel* parent, CTiglUIDManager* uidMgr); - - // Read CPACS fuselage elements - TIGL_EXPORT void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); - - // Write CPACS fuselage elements - TIGL_EXPORT void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; - - // Returns the total count of fuselages in a configuration - TIGL_EXPORT int GetFuselageCount() const; - - // Returns the fuselage for a given index. - TIGL_EXPORT CCPACSFuselage& GetFuselage(int index) const; - - // Returns the fuselage for a given UID. - TIGL_EXPORT CCPACSFuselage& GetFuselage(const std::string& UID) const; - - // Returns the fuselage index for a given UID. - TIGL_EXPORT int GetFuselageIndex(const std::string& UID) const; -}; - -} // end namespace tigl - -#endif // CCPACSFUSELAGES_H diff --git a/src/fuselage/CTiglFuselageConnection.cpp b/src/fuselage/CTiglFuselageConnection.cpp index 9caceba786..e1c4a4e480 100644 --- a/src/fuselage/CTiglFuselageConnection.cpp +++ b/src/fuselage/CTiglFuselageConnection.cpp @@ -1,191 +1,191 @@ -/* -* Copyright (C) 2007-2013 German Aerospace Center (DLR/SC) -* -* Created: 2010-08-13 Markus Litz -* Changed: $Id: CCPACSFuselageConnection.cpp 2641 2017-03-30 21:08:46Z bgruber $ -* -* Version: $Revision: 2641 $ -* -* 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. -*/ -/** -* @file -* @brief Implementation of CPACS fuselage connection handling routines. -*/ - -#include "CTiglFuselageConnection.h" -#include "CTiglError.h" -#include "CCPACSFuselage.h" -#include "CCPACSDuct.h" -#include "CCPACSVessel.h" -#include "CCPACSVessels.h" -#include "CCPACSFuelTank.h" -#include "CCPACSFuselageSections.h" -#include "CCPACSFuselageSection.h" -#include "CCPACSFuselageSegment.h" -#include "CCPACSConfiguration.h" -#include - -namespace tigl -{ - -CTiglFuselageConnection::CTiglFuselageConnection() : elementUID(NULL), segment(NULL) {} - -// Constructor -CTiglFuselageConnection::CTiglFuselageConnection(const std::string& elementUID, CCPACSFuselageSegment* aSegment) - : elementUID(&elementUID), segment(aSegment) -{ - // find the corresponding section to this segment - int i = 0; - for (auto& section: GetParentComponentSections().GetSections()) { - ++i; - for (int j = 1; j <= section->GetSectionElementCount(); j++) { - if (section->GetSectionElement(j).GetUID() == elementUID) { - sectionUID = section->GetUID(); - sectionIndex = i; - elementIndex = j; - } - } - } -} - -// Returns the section index of this connection -const std::string& CTiglFuselageConnection::GetSectionUID() const -{ - return sectionUID; -} - -// Returns the section element index of this connection -const std::string& CTiglFuselageConnection::GetSectionElementUID() const -{ - return *elementUID; -} - - -// Returns the section index of this connection -int CTiglFuselageConnection::GetSectionIndex() const -{ - return sectionIndex; -} - -// Returns the section element index of this connection -int CTiglFuselageConnection::GetSectionElementIndex() const -{ - return elementIndex; -} - - -// Returns the fuselage profile referenced by this connection -CCPACSFuselageProfile& CTiglFuselageConnection::GetProfile() -{ - std::string profileUID; - - bool found = false; - for (auto& section: GetParentComponentSections().GetSections()) { - for (int j=1; j <= section->GetSectionElementCount(); j++) { - if (section->GetSectionElement(j).GetUID() == *elementUID ) { - CCPACSFuselageSectionElement& element = section->GetSectionElement(j); - profileUID = element.GetProfileUID(); - found = true; - break; - } - } - if ( found ) { - break; - } - } - CCPACSConfiguration const& config = segment->GetParent()->GetConfiguration(); - - return (config.GetFuselageProfile(profileUID)); -} - -const CCPACSFuselageProfile& CTiglFuselageConnection::GetProfile() const { - return const_cast(*this).GetProfile(); -} - -// Returns the positioning transformation for the referenced section -boost::optional CTiglFuselageConnection::GetPositioningTransformation() const -{ - boost::optional ret; - if (GetParentComponentPositionings()) { - ret = GetParentComponentPositionings()->GetPositioningTransformation(sectionUID); - } - return ret; -} - -// Returns the section matrix referenced by this connection -CTiglTransformation CTiglFuselageConnection::GetSectionTransformation() const -{ - CTiglTransformation transformation; - - for (auto& section: GetParentComponentSections().GetSections()) { - for (int j = 1; j <= section->GetSectionElementCount(); j++) { - if (section->GetSectionElement(j).GetUID() == *elementUID) { - transformation = section->GetSectionTransformation(); - } - } - } - return transformation; -} - -// Returns the section element matrix referenced by this connection -CTiglTransformation CTiglFuselageConnection::GetSectionElementTransformation() const -{ - CTiglTransformation transformation; - - for (auto& section: GetParentComponentSections().GetSections()) { - for (int j = 1; j <= section->GetSectionElementCount(); j++) { - if (section->GetSectionElement(j).GetUID() == *elementUID) { - CCPACSFuselageSectionElement& element = section->GetSectionElement(j); - transformation = element.GetSectionElementTransformation(); - } - } - } - return transformation; -} - -bool CTiglFuselageConnection::ParentComponentHasPositionings() const -{ - return (segment->GetParent()->IsParent() || segment->GetParent()->IsParent()); -} - -CCPACSFuselageSections const& CTiglFuselageConnection::GetParentComponentSections() const -{ - if (segment->GetParent()->IsParent()) { - return segment->GetParent()->GetParent()->GetSections(); - } - else if (segment->GetParent()->IsParent()) { - return segment->GetParent()->GetParent()->GetSections(); - } - else if (segment->GetParent()->IsParent()) { - return segment->GetParent()->GetParent()->GetSections_choice1().get(); - } - else { - throw CTiglError("CTiglFuselageConnection: Unknown parent for segment."); - } -} - -boost::optional& CTiglFuselageConnection::GetParentComponentPositionings() const -{ - if (segment->GetParent()->IsParent()) { - return segment->GetParent()->GetParent()->GetPositionings(); - } - else if (segment->GetParent()->IsParent()) { - return segment->GetParent()->GetParent()->GetPositionings(); - } - else { - throw CTiglError("CTiglFuselageConnection: Unknown parent for segment."); - } -} - -} // end namespace tigl +/* +* Copyright (C) 2007-2013 German Aerospace Center (DLR/SC) +* +* Created: 2010-08-13 Markus Litz +* Changed: $Id: CCPACSFuselageConnection.cpp 2641 2017-03-30 21:08:46Z bgruber $ +* +* Version: $Revision: 2641 $ +* +* 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. +*/ +/** +* @file +* @brief Implementation of CPACS fuselage connection handling routines. +*/ + +#include "CTiglFuselageConnection.h" +#include "CTiglError.h" +#include "CCPACSFuselage.h" +#include "CCPACSDuct.h" +#include "CCPACSVessel.h" +#include "generated/CPACSVessels.h" +#include "CCPACSFuelTank.h" +#include "generated/CPACSFuselageSections.h" +#include "CCPACSFuselageSection.h" +#include "CCPACSFuselageSegment.h" +#include "CCPACSConfiguration.h" +#include + +namespace tigl +{ + +CTiglFuselageConnection::CTiglFuselageConnection() : elementUID(NULL), segment(NULL) {} + +// Constructor +CTiglFuselageConnection::CTiglFuselageConnection(const std::string& elementUID, CCPACSFuselageSegment* aSegment) + : elementUID(&elementUID), segment(aSegment) +{ + // find the corresponding section to this segment + int i = 0; + for (auto& section: GetParentComponentSections().GetSections()) { + ++i; + for (int j = 1; j <= section->GetSectionElementCount(); j++) { + if (section->GetSectionElement(j).GetUID() == elementUID) { + sectionUID = section->GetUID(); + sectionIndex = i; + elementIndex = j; + } + } + } +} + +// Returns the section index of this connection +const std::string& CTiglFuselageConnection::GetSectionUID() const +{ + return sectionUID; +} + +// Returns the section element index of this connection +const std::string& CTiglFuselageConnection::GetSectionElementUID() const +{ + return *elementUID; +} + + +// Returns the section index of this connection +int CTiglFuselageConnection::GetSectionIndex() const +{ + return sectionIndex; +} + +// Returns the section element index of this connection +int CTiglFuselageConnection::GetSectionElementIndex() const +{ + return elementIndex; +} + + +// Returns the fuselage profile referenced by this connection +const CCPACSFuselageProfile& CTiglFuselageConnection::GetProfile() const +{ + std::string profileUID; + + bool found = false; + for (auto& section: GetParentComponentSections().GetSections()) { + for (int j=1; j <= section->GetSectionElementCount(); j++) { + if (section->GetSectionElement(j).GetUID() == *elementUID ) { + CCPACSFuselageSectionElement& element = section->GetSectionElement(j); + profileUID = element.GetProfileUID(); + found = true; + break; + } + } + if ( found ) { + break; + } + } + CCPACSConfiguration const& config = segment->GetParent()->GetConfiguration(); + + return (config.GetFuselageProfile(profileUID)); +} + +CCPACSFuselageProfile& CTiglFuselageConnection::GetProfile() { + return const_cast(std::as_const(*this).GetProfile()); +} + +// Returns the positioning transformation for the referenced section +boost::optional CTiglFuselageConnection::GetPositioningTransformation() const +{ + boost::optional ret; + if (GetParentComponentPositionings()) { + ret = GetParentComponentPositionings()->GetPositioningTransformation(sectionUID); + } + return ret; +} + +// Returns the section matrix referenced by this connection +CTiglTransformation CTiglFuselageConnection::GetSectionTransformation() const +{ + CTiglTransformation transformation; + + for (auto& section: GetParentComponentSections().GetSections()) { + for (int j = 1; j <= section->GetSectionElementCount(); j++) { + if (section->GetSectionElement(j).GetUID() == *elementUID) { + transformation = section->GetSectionTransformation(); + } + } + } + return transformation; +} + +// Returns the section element matrix referenced by this connection +CTiglTransformation CTiglFuselageConnection::GetSectionElementTransformation() const +{ + CTiglTransformation transformation; + + for (auto& section: GetParentComponentSections().GetSections()) { + for (int j = 1; j <= section->GetSectionElementCount(); j++) { + if (section->GetSectionElement(j).GetUID() == *elementUID) { + CCPACSFuselageSectionElement& element = section->GetSectionElement(j); + transformation = element.GetSectionElementTransformation(); + } + } + } + return transformation; +} + +bool CTiglFuselageConnection::ParentComponentHasPositionings() const +{ + return (segment->GetParent()->IsParent() || segment->GetParent()->IsParent()); +} + +CCPACSFuselageSections const& CTiglFuselageConnection::GetParentComponentSections() const +{ + if (segment->GetParent()->IsParent()) { + return segment->GetParent()->GetParent()->GetSections(); + } + else if (segment->GetParent()->IsParent()) { + return segment->GetParent()->GetParent()->GetSections(); + } + else if (segment->GetParent()->IsParent()) { + return segment->GetParent()->GetParent()->GetSections_choice1().get(); + } + else { + throw CTiglError("CTiglFuselageConnection: Unknown parent for segment."); + } +} + +boost::optional& CTiglFuselageConnection::GetParentComponentPositionings() const +{ + if (segment->GetParent()->IsParent()) { + return segment->GetParent()->GetParent()->GetPositionings(); + } + else if (segment->GetParent()->IsParent()) { + return segment->GetParent()->GetParent()->GetPositionings(); + } + else { + throw CTiglError("CTiglFuselageConnection: Unknown parent for segment."); + } +} + +} // end namespace tigl diff --git a/src/fuselage/CTiglFuselageConnection.h b/src/fuselage/CTiglFuselageConnection.h index 2bee9464ed..9afcfeb2cc 100644 --- a/src/fuselage/CTiglFuselageConnection.h +++ b/src/fuselage/CTiglFuselageConnection.h @@ -27,13 +27,14 @@ #include "CTiglTransformation.h" #include #include +#include "generated/CPACSFuselageSections.h" namespace tigl { + class CCPACSFuselageSegment; class CCPACSFuselageProfile; -class CCPACSFuselageSections; class CCPACSPositionings; // TODO: this class is very similar to CCPACSWingConnection, merge into one class @@ -57,8 +58,8 @@ class CTiglFuselageConnection TIGL_EXPORT int GetSectionElementIndex() const; // Returns the fuselage profile referenced by this connection - TIGL_EXPORT CCPACSFuselageProfile& GetProfile(); TIGL_EXPORT const CCPACSFuselageProfile& GetProfile() const; + TIGL_EXPORT CCPACSFuselageProfile& GetProfile(); // Returns the positioning transformation (segment transformation) for the referenced section TIGL_EXPORT boost::optional GetPositioningTransformation() const; diff --git a/src/generated/CPACSAircraft.cpp b/src/generated/CPACSAircraft.cpp index 6695ffa74b..4ce0e72cf6 100644 --- a/src/generated/CPACSAircraft.cpp +++ b/src/generated/CPACSAircraft.cpp @@ -108,6 +108,59 @@ namespace generated return m_models; } + size_t CPACSAircraft::GetModelCount() const + { + return m_models.size(); + } + + size_t CPACSAircraft::GetModelIndex(const std::string& UID) const + { + for (size_t i=0; i < GetModelCount(); i++) { + const std::string tmpUID(m_models[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSAircraft::GetModelIndex", TIGL_UID_ERROR); + } + + CCPACSAircraftModel& CPACSAircraft::GetModel(size_t index) + { + if (index < 1 || index > GetModelCount()) { + throw CTiglError("Invalid index in std::vector>::GetModel", TIGL_INDEX_ERROR); + } + index--; + return *m_models[index]; + } + + const CCPACSAircraftModel& CPACSAircraft::GetModel(size_t index) const + { + if (index < 1 || index > GetModelCount()) { + throw CTiglError("Invalid index in std::vector>::GetModel", TIGL_INDEX_ERROR); + } + index--; + return *m_models[index]; + } + + CCPACSAircraftModel& CPACSAircraft::GetModel(const std::string& UID) + { + for (auto& elem : m_models ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSAircraft::GetModel. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSAircraftModel& CPACSAircraft::GetModel(const std::string& UID) const + { + for (auto& elem : m_models ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSAircraft::GetModel. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSAircraftModel& CPACSAircraft::AddModel() { m_models.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSAircraft.h b/src/generated/CPACSAircraft.h index 94674ff3df..6fb9ce2716 100644 --- a/src/generated/CPACSAircraft.h +++ b/src/generated/CPACSAircraft.h @@ -64,6 +64,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetModels() const; TIGL_EXPORT virtual std::vector>& GetModels(); + TIGL_EXPORT virtual size_t GetModelCount() const; + TIGL_EXPORT virtual size_t GetModelIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSAircraftModel& GetModel(size_t index) const; + TIGL_EXPORT virtual CCPACSAircraftModel& GetModel(size_t index); + + TIGL_EXPORT virtual const CCPACSAircraftModel& GetModel(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSAircraftModel& GetModel(const std::string& UID); + TIGL_EXPORT virtual CCPACSAircraftModel& AddModel(); TIGL_EXPORT virtual void RemoveModel(CCPACSAircraftModel& ref); diff --git a/src/generated/CPACSAircraftControlElements.cpp b/src/generated/CPACSAircraftControlElements.cpp index cd31c1f6b7..6a8d07fe0a 100644 --- a/src/generated/CPACSAircraftControlElements.cpp +++ b/src/generated/CPACSAircraftControlElements.cpp @@ -102,6 +102,30 @@ namespace generated return m_controlElements; } + size_t CPACSAircraftControlElements::GetControlElementCount() const + { + return m_controlElements.size(); + } + + CPACSAircraftControlElement& CPACSAircraftControlElements::GetControlElement(size_t index) + { + if (index < 1 || index > GetControlElementCount()) { + throw CTiglError("Invalid index in std::vector>::GetControlElement", TIGL_INDEX_ERROR); + } + index--; + return *m_controlElements[index]; + } + + const CPACSAircraftControlElement& CPACSAircraftControlElements::GetControlElement(size_t index) const + { + if (index < 1 || index > GetControlElementCount()) { + throw CTiglError("Invalid index in std::vector>::GetControlElement", TIGL_INDEX_ERROR); + } + index--; + return *m_controlElements[index]; + } + + CPACSAircraftControlElement& CPACSAircraftControlElements::AddControlElement() { m_controlElements.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSAircraftControlElements.h b/src/generated/CPACSAircraftControlElements.h index 0f0bcef66b..525fdedf88 100644 --- a/src/generated/CPACSAircraftControlElements.h +++ b/src/generated/CPACSAircraftControlElements.h @@ -64,6 +64,11 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetControlElements() const; TIGL_EXPORT virtual std::vector>& GetControlElements(); + TIGL_EXPORT virtual size_t GetControlElementCount() const; + + TIGL_EXPORT virtual const CPACSAircraftControlElement& GetControlElement(size_t index) const; + TIGL_EXPORT virtual CPACSAircraftControlElement& GetControlElement(size_t index); + TIGL_EXPORT virtual CPACSAircraftControlElement& AddControlElement(); TIGL_EXPORT virtual void RemoveControlElement(CPACSAircraftControlElement& ref); diff --git a/src/generated/CPACSAircraftModel.cpp b/src/generated/CPACSAircraftModel.cpp index 8fa565e849..7e80003100 100644 --- a/src/generated/CPACSAircraftModel.cpp +++ b/src/generated/CPACSAircraftModel.cpp @@ -406,12 +406,12 @@ namespace generated return m_ducts; } - const boost::optional& CPACSAircraftModel::GetFuselages() const + const boost::optional& CPACSAircraftModel::GetFuselages() const { return m_fuselages; } - boost::optional& CPACSAircraftModel::GetFuselages() + boost::optional& CPACSAircraftModel::GetFuselages() { return m_fuselages; } @@ -436,12 +436,12 @@ namespace generated return m_engines; } - const boost::optional& CPACSAircraftModel::GetEnginePylons() const + const boost::optional& CPACSAircraftModel::GetEnginePylons() const { return m_enginePylons; } - boost::optional& CPACSAircraftModel::GetEnginePylons() + boost::optional& CPACSAircraftModel::GetEnginePylons() { return m_enginePylons; } @@ -456,12 +456,12 @@ namespace generated return m_landingGears; } - const boost::optional& CPACSAircraftModel::GetFuelTanks() const + const boost::optional& CPACSAircraftModel::GetFuelTanks() const { return m_fuelTanks; } - boost::optional& CPACSAircraftModel::GetFuelTanks() + boost::optional& CPACSAircraftModel::GetFuelTanks() { return m_fuelTanks; } @@ -508,7 +508,7 @@ namespace generated m_ducts = boost::none; } - CCPACSFuselages& CPACSAircraftModel::GetFuselages(CreateIfNotExistsTag) + CPACSFuselages& CPACSAircraftModel::GetFuselages(CreateIfNotExistsTag) { if (!m_fuselages) m_fuselages = boost::in_place(reinterpret_cast(this), m_uidMgr); @@ -544,7 +544,7 @@ namespace generated m_engines = boost::none; } - CCPACSEnginePylons& CPACSAircraftModel::GetEnginePylons(CreateIfNotExistsTag) + CPACSEnginePylons& CPACSAircraftModel::GetEnginePylons(CreateIfNotExistsTag) { if (!m_enginePylons) m_enginePylons = boost::in_place(reinterpret_cast(this), m_uidMgr); @@ -568,7 +568,7 @@ namespace generated m_landingGears = boost::none; } - CCPACSFuelTanks& CPACSAircraftModel::GetFuelTanks(CreateIfNotExistsTag) + CPACSFuelTanks& CPACSAircraftModel::GetFuelTanks(CreateIfNotExistsTag) { if (!m_fuelTanks) m_fuelTanks = boost::in_place(reinterpret_cast(this), m_uidMgr); diff --git a/src/generated/CPACSAircraftModel.h b/src/generated/CPACSAircraftModel.h index f0e1395755..0c740d92f4 100644 --- a/src/generated/CPACSAircraftModel.h +++ b/src/generated/CPACSAircraftModel.h @@ -22,13 +22,13 @@ #include #include #include -#include #include -#include -#include #include #include #include +#include "CPACSEnginePylons.h" +#include "CPACSFuelTanks.h" +#include "CPACSFuselages.h" #include "CPACSLandingGears.h" #include "CPACSVehicleConfigurations.h" #include "CreateIfNotExists.h" @@ -88,8 +88,8 @@ namespace generated TIGL_EXPORT virtual const boost::optional& GetDucts() const; TIGL_EXPORT virtual boost::optional& GetDucts(); - TIGL_EXPORT virtual const boost::optional& GetFuselages() const; - TIGL_EXPORT virtual boost::optional& GetFuselages(); + TIGL_EXPORT virtual const boost::optional& GetFuselages() const; + TIGL_EXPORT virtual boost::optional& GetFuselages(); TIGL_EXPORT virtual const boost::optional& GetWings() const; TIGL_EXPORT virtual boost::optional& GetWings(); @@ -97,14 +97,14 @@ namespace generated TIGL_EXPORT virtual const boost::optional& GetEngines() const; TIGL_EXPORT virtual boost::optional& GetEngines(); - TIGL_EXPORT virtual const boost::optional& GetEnginePylons() const; - TIGL_EXPORT virtual boost::optional& GetEnginePylons(); + TIGL_EXPORT virtual const boost::optional& GetEnginePylons() const; + TIGL_EXPORT virtual boost::optional& GetEnginePylons(); TIGL_EXPORT virtual const boost::optional& GetLandingGears() const; TIGL_EXPORT virtual boost::optional& GetLandingGears(); - TIGL_EXPORT virtual const boost::optional& GetFuelTanks() const; - TIGL_EXPORT virtual boost::optional& GetFuelTanks(); + TIGL_EXPORT virtual const boost::optional& GetFuelTanks() const; + TIGL_EXPORT virtual boost::optional& GetFuelTanks(); TIGL_EXPORT virtual const boost::optional& GetSystems() const; TIGL_EXPORT virtual boost::optional& GetSystems(); @@ -118,7 +118,7 @@ namespace generated TIGL_EXPORT virtual CCPACSDucts& GetDucts(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveDucts(); - TIGL_EXPORT virtual CCPACSFuselages& GetFuselages(CreateIfNotExistsTag); + TIGL_EXPORT virtual CPACSFuselages& GetFuselages(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveFuselages(); TIGL_EXPORT virtual CCPACSWings& GetWings(CreateIfNotExistsTag); @@ -127,13 +127,13 @@ namespace generated TIGL_EXPORT virtual CCPACSEnginePositions& GetEngines(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveEngines(); - TIGL_EXPORT virtual CCPACSEnginePylons& GetEnginePylons(CreateIfNotExistsTag); + TIGL_EXPORT virtual CPACSEnginePylons& GetEnginePylons(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveEnginePylons(); TIGL_EXPORT virtual CPACSLandingGears& GetLandingGears(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveLandingGears(); - TIGL_EXPORT virtual CCPACSFuelTanks& GetFuelTanks(CreateIfNotExistsTag); + TIGL_EXPORT virtual CPACSFuelTanks& GetFuelTanks(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveFuelTanks(); TIGL_EXPORT virtual CCPACSACSystems& GetSystems(CreateIfNotExistsTag); @@ -160,17 +160,17 @@ namespace generated boost::optional m_ducts; - boost::optional m_fuselages; + boost::optional m_fuselages; boost::optional m_wings; boost::optional m_engines; - boost::optional m_enginePylons; + boost::optional m_enginePylons; boost::optional m_landingGears; - boost::optional m_fuelTanks; + boost::optional m_fuelTanks; boost::optional m_systems; diff --git a/src/generated/CPACSAxleAssemblies.cpp b/src/generated/CPACSAxleAssemblies.cpp index 8bc08dea03..20f41754b7 100644 --- a/src/generated/CPACSAxleAssemblies.cpp +++ b/src/generated/CPACSAxleAssemblies.cpp @@ -102,6 +102,30 @@ namespace generated return m_axleAssemblys; } + size_t CPACSAxleAssemblies::GetAxleAssemblyCount() const + { + return m_axleAssemblys.size(); + } + + CPACSAxleAssembly& CPACSAxleAssemblies::GetAxleAssembly(size_t index) + { + if (index < 1 || index > GetAxleAssemblyCount()) { + throw CTiglError("Invalid index in std::vector>::GetAxleAssembly", TIGL_INDEX_ERROR); + } + index--; + return *m_axleAssemblys[index]; + } + + const CPACSAxleAssembly& CPACSAxleAssemblies::GetAxleAssembly(size_t index) const + { + if (index < 1 || index > GetAxleAssemblyCount()) { + throw CTiglError("Invalid index in std::vector>::GetAxleAssembly", TIGL_INDEX_ERROR); + } + index--; + return *m_axleAssemblys[index]; + } + + CPACSAxleAssembly& CPACSAxleAssemblies::AddAxleAssembly() { m_axleAssemblys.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSAxleAssemblies.h b/src/generated/CPACSAxleAssemblies.h index 71d47e2532..f68d31b08c 100644 --- a/src/generated/CPACSAxleAssemblies.h +++ b/src/generated/CPACSAxleAssemblies.h @@ -64,6 +64,11 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetAxleAssemblys() const; TIGL_EXPORT virtual std::vector>& GetAxleAssemblys(); + TIGL_EXPORT virtual size_t GetAxleAssemblyCount() const; + + TIGL_EXPORT virtual const CPACSAxleAssembly& GetAxleAssembly(size_t index) const; + TIGL_EXPORT virtual CPACSAxleAssembly& GetAxleAssembly(size_t index); + TIGL_EXPORT virtual CPACSAxleAssembly& AddAxleAssembly(); TIGL_EXPORT virtual void RemoveAxleAssembly(CPACSAxleAssembly& ref); diff --git a/src/generated/CPACSCargoContainerElements.cpp b/src/generated/CPACSCargoContainerElements.cpp index 390284e297..40aaf35188 100644 --- a/src/generated/CPACSCargoContainerElements.cpp +++ b/src/generated/CPACSCargoContainerElements.cpp @@ -108,6 +108,59 @@ namespace generated return m_cargoContainerElements; } + size_t CPACSCargoContainerElements::GetCargoContainerElementCount() const + { + return m_cargoContainerElements.size(); + } + + size_t CPACSCargoContainerElements::GetCargoContainerElementIndex(const std::string& UID) const + { + for (size_t i=0; i < GetCargoContainerElementCount(); i++) { + const std::string tmpUID(m_cargoContainerElements[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSCargoContainerElements::GetCargoContainerElementIndex", TIGL_UID_ERROR); + } + + CPACSCargoContainerElement& CPACSCargoContainerElements::GetCargoContainerElement(size_t index) + { + if (index < 1 || index > GetCargoContainerElementCount()) { + throw CTiglError("Invalid index in std::vector>::GetCargoContainerElement", TIGL_INDEX_ERROR); + } + index--; + return *m_cargoContainerElements[index]; + } + + const CPACSCargoContainerElement& CPACSCargoContainerElements::GetCargoContainerElement(size_t index) const + { + if (index < 1 || index > GetCargoContainerElementCount()) { + throw CTiglError("Invalid index in std::vector>::GetCargoContainerElement", TIGL_INDEX_ERROR); + } + index--; + return *m_cargoContainerElements[index]; + } + + CPACSCargoContainerElement& CPACSCargoContainerElements::GetCargoContainerElement(const std::string& UID) + { + for (auto& elem : m_cargoContainerElements ) { + if (elem->GetUID() == UID) + return *elem; + } + 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 + { + for (auto& elem : m_cargoContainerElements ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSCargoContainerElements::GetCargoContainerElement. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CPACSCargoContainerElement& CPACSCargoContainerElements::AddCargoContainerElement() { m_cargoContainerElements.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSCargoContainerElements.h b/src/generated/CPACSCargoContainerElements.h index 974a5c3e10..2ef9975edf 100644 --- a/src/generated/CPACSCargoContainerElements.h +++ b/src/generated/CPACSCargoContainerElements.h @@ -63,6 +63,15 @@ namespace generated 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 CPACSCargoContainerElement& GetCargoContainerElement(const std::string& UID) const; + TIGL_EXPORT virtual CPACSCargoContainerElement& GetCargoContainerElement(const std::string& UID); + TIGL_EXPORT virtual CPACSCargoContainerElement& AddCargoContainerElement(); TIGL_EXPORT virtual void RemoveCargoContainerElement(CPACSCargoContainerElement& ref); diff --git a/src/generated/CPACSCargoCrossBeamStrutsAssembly.cpp b/src/generated/CPACSCargoCrossBeamStrutsAssembly.cpp index 26aa458c02..6f36744140 100644 --- a/src/generated/CPACSCargoCrossBeamStrutsAssembly.cpp +++ b/src/generated/CPACSCargoCrossBeamStrutsAssembly.cpp @@ -108,6 +108,59 @@ namespace generated return m_cargoCrossBeamStruts; } + size_t CPACSCargoCrossBeamStrutsAssembly::GetCargoCrossBeamStrutCount() const + { + return m_cargoCrossBeamStruts.size(); + } + + size_t CPACSCargoCrossBeamStrutsAssembly::GetCargoCrossBeamStrutIndex(const std::string& UID) const + { + for (size_t i=0; i < GetCargoCrossBeamStrutCount(); i++) { + const std::string tmpUID(m_cargoCrossBeamStruts[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSCargoCrossBeamStrutsAssembly::GetCargoCrossBeamStrutIndex", TIGL_UID_ERROR); + } + + CCPACSCrossBeamStrutAssemblyPosition& CPACSCargoCrossBeamStrutsAssembly::GetCargoCrossBeamStrut(size_t index) + { + if (index < 1 || index > GetCargoCrossBeamStrutCount()) { + throw CTiglError("Invalid index in std::vector>::GetCargoCrossBeamStrut", TIGL_INDEX_ERROR); + } + index--; + return *m_cargoCrossBeamStruts[index]; + } + + const CCPACSCrossBeamStrutAssemblyPosition& CPACSCargoCrossBeamStrutsAssembly::GetCargoCrossBeamStrut(size_t index) const + { + if (index < 1 || index > GetCargoCrossBeamStrutCount()) { + throw CTiglError("Invalid index in std::vector>::GetCargoCrossBeamStrut", TIGL_INDEX_ERROR); + } + index--; + return *m_cargoCrossBeamStruts[index]; + } + + CCPACSCrossBeamStrutAssemblyPosition& CPACSCargoCrossBeamStrutsAssembly::GetCargoCrossBeamStrut(const std::string& UID) + { + for (auto& elem : m_cargoCrossBeamStruts ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSCargoCrossBeamStrutsAssembly::GetCargoCrossBeamStrut. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSCrossBeamStrutAssemblyPosition& CPACSCargoCrossBeamStrutsAssembly::GetCargoCrossBeamStrut(const std::string& UID) const + { + for (auto& elem : m_cargoCrossBeamStruts ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSCargoCrossBeamStrutsAssembly::GetCargoCrossBeamStrut. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSCrossBeamStrutAssemblyPosition& CPACSCargoCrossBeamStrutsAssembly::AddCargoCrossBeamStrut() { m_cargoCrossBeamStruts.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); diff --git a/src/generated/CPACSCargoCrossBeamStrutsAssembly.h b/src/generated/CPACSCargoCrossBeamStrutsAssembly.h index 0672500c06..8b949245cb 100644 --- a/src/generated/CPACSCargoCrossBeamStrutsAssembly.h +++ b/src/generated/CPACSCargoCrossBeamStrutsAssembly.h @@ -63,6 +63,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetCargoCrossBeamStruts() const; TIGL_EXPORT virtual std::vector>& GetCargoCrossBeamStruts(); + TIGL_EXPORT virtual size_t GetCargoCrossBeamStrutCount() const; + TIGL_EXPORT virtual size_t GetCargoCrossBeamStrutIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSCrossBeamStrutAssemblyPosition& GetCargoCrossBeamStrut(size_t index) const; + TIGL_EXPORT virtual CCPACSCrossBeamStrutAssemblyPosition& GetCargoCrossBeamStrut(size_t index); + + TIGL_EXPORT virtual const CCPACSCrossBeamStrutAssemblyPosition& GetCargoCrossBeamStrut(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSCrossBeamStrutAssemblyPosition& GetCargoCrossBeamStrut(const std::string& UID); + TIGL_EXPORT virtual CCPACSCrossBeamStrutAssemblyPosition& AddCargoCrossBeamStrut(); TIGL_EXPORT virtual void RemoveCargoCrossBeamStrut(CCPACSCrossBeamStrutAssemblyPosition& ref); diff --git a/src/generated/CPACSCargoCrossBeamsAssembly.cpp b/src/generated/CPACSCargoCrossBeamsAssembly.cpp index 1f6ccbb967..f13142b9c7 100644 --- a/src/generated/CPACSCargoCrossBeamsAssembly.cpp +++ b/src/generated/CPACSCargoCrossBeamsAssembly.cpp @@ -108,6 +108,59 @@ namespace generated return m_cargoCrossBeams; } + size_t CPACSCargoCrossBeamsAssembly::GetCargoCrossBeamCount() const + { + return m_cargoCrossBeams.size(); + } + + size_t CPACSCargoCrossBeamsAssembly::GetCargoCrossBeamIndex(const std::string& UID) const + { + for (size_t i=0; i < GetCargoCrossBeamCount(); i++) { + const std::string tmpUID(m_cargoCrossBeams[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSCargoCrossBeamsAssembly::GetCargoCrossBeamIndex", TIGL_UID_ERROR); + } + + CCPACSCrossBeamAssemblyPosition& CPACSCargoCrossBeamsAssembly::GetCargoCrossBeam(size_t index) + { + if (index < 1 || index > GetCargoCrossBeamCount()) { + throw CTiglError("Invalid index in std::vector>::GetCargoCrossBeam", TIGL_INDEX_ERROR); + } + index--; + return *m_cargoCrossBeams[index]; + } + + const CCPACSCrossBeamAssemblyPosition& CPACSCargoCrossBeamsAssembly::GetCargoCrossBeam(size_t index) const + { + if (index < 1 || index > GetCargoCrossBeamCount()) { + throw CTiglError("Invalid index in std::vector>::GetCargoCrossBeam", TIGL_INDEX_ERROR); + } + index--; + return *m_cargoCrossBeams[index]; + } + + CCPACSCrossBeamAssemblyPosition& CPACSCargoCrossBeamsAssembly::GetCargoCrossBeam(const std::string& UID) + { + for (auto& elem : m_cargoCrossBeams ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSCargoCrossBeamsAssembly::GetCargoCrossBeam. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSCrossBeamAssemblyPosition& CPACSCargoCrossBeamsAssembly::GetCargoCrossBeam(const std::string& UID) const + { + for (auto& elem : m_cargoCrossBeams ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSCargoCrossBeamsAssembly::GetCargoCrossBeam. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSCrossBeamAssemblyPosition& CPACSCargoCrossBeamsAssembly::AddCargoCrossBeam() { m_cargoCrossBeams.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); diff --git a/src/generated/CPACSCargoCrossBeamsAssembly.h b/src/generated/CPACSCargoCrossBeamsAssembly.h index 8d0a95837e..edfd3d9931 100644 --- a/src/generated/CPACSCargoCrossBeamsAssembly.h +++ b/src/generated/CPACSCargoCrossBeamsAssembly.h @@ -63,6 +63,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetCargoCrossBeams() const; TIGL_EXPORT virtual std::vector>& GetCargoCrossBeams(); + TIGL_EXPORT virtual size_t GetCargoCrossBeamCount() const; + TIGL_EXPORT virtual size_t GetCargoCrossBeamIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSCrossBeamAssemblyPosition& GetCargoCrossBeam(size_t index) const; + TIGL_EXPORT virtual CCPACSCrossBeamAssemblyPosition& GetCargoCrossBeam(size_t index); + + TIGL_EXPORT virtual const CCPACSCrossBeamAssemblyPosition& GetCargoCrossBeam(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSCrossBeamAssemblyPosition& GetCargoCrossBeam(const std::string& UID); + TIGL_EXPORT virtual CCPACSCrossBeamAssemblyPosition& AddCargoCrossBeam(); TIGL_EXPORT virtual void RemoveCargoCrossBeam(CCPACSCrossBeamAssemblyPosition& ref); diff --git a/src/generated/CPACSCargoDoorsAssembly.cpp b/src/generated/CPACSCargoDoorsAssembly.cpp index 9f2560871d..5455b344ce 100644 --- a/src/generated/CPACSCargoDoorsAssembly.cpp +++ b/src/generated/CPACSCargoDoorsAssembly.cpp @@ -108,6 +108,59 @@ namespace generated return m_cargoDoors; } + size_t CPACSCargoDoorsAssembly::GetCargoDoorCount() const + { + return m_cargoDoors.size(); + } + + size_t CPACSCargoDoorsAssembly::GetCargoDoorIndex(const std::string& UID) const + { + for (size_t i=0; i < GetCargoDoorCount(); i++) { + const std::string tmpUID(m_cargoDoors[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSCargoDoorsAssembly::GetCargoDoorIndex", TIGL_UID_ERROR); + } + + CCPACSDoorAssemblyPosition& CPACSCargoDoorsAssembly::GetCargoDoor(size_t index) + { + if (index < 1 || index > GetCargoDoorCount()) { + throw CTiglError("Invalid index in std::vector>::GetCargoDoor", TIGL_INDEX_ERROR); + } + index--; + return *m_cargoDoors[index]; + } + + const CCPACSDoorAssemblyPosition& CPACSCargoDoorsAssembly::GetCargoDoor(size_t index) const + { + if (index < 1 || index > GetCargoDoorCount()) { + throw CTiglError("Invalid index in std::vector>::GetCargoDoor", TIGL_INDEX_ERROR); + } + index--; + return *m_cargoDoors[index]; + } + + CCPACSDoorAssemblyPosition& CPACSCargoDoorsAssembly::GetCargoDoor(const std::string& UID) + { + for (auto& elem : m_cargoDoors ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSCargoDoorsAssembly::GetCargoDoor. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSDoorAssemblyPosition& CPACSCargoDoorsAssembly::GetCargoDoor(const std::string& UID) const + { + for (auto& elem : m_cargoDoors ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSCargoDoorsAssembly::GetCargoDoor. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSDoorAssemblyPosition& CPACSCargoDoorsAssembly::AddCargoDoor() { m_cargoDoors.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSCargoDoorsAssembly.h b/src/generated/CPACSCargoDoorsAssembly.h index 2f896dd3dc..a86beab170 100644 --- a/src/generated/CPACSCargoDoorsAssembly.h +++ b/src/generated/CPACSCargoDoorsAssembly.h @@ -63,6 +63,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetCargoDoors() const; TIGL_EXPORT virtual std::vector>& GetCargoDoors(); + TIGL_EXPORT virtual size_t GetCargoDoorCount() const; + TIGL_EXPORT virtual size_t GetCargoDoorIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSDoorAssemblyPosition& GetCargoDoor(size_t index) const; + TIGL_EXPORT virtual CCPACSDoorAssemblyPosition& GetCargoDoor(size_t index); + + TIGL_EXPORT virtual const CCPACSDoorAssemblyPosition& GetCargoDoor(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSDoorAssemblyPosition& GetCargoDoor(const std::string& UID); + TIGL_EXPORT virtual CCPACSDoorAssemblyPosition& AddCargoDoor(); TIGL_EXPORT virtual void RemoveCargoDoor(CCPACSDoorAssemblyPosition& ref); diff --git a/src/generated/CPACSCeilingPanelElements.cpp b/src/generated/CPACSCeilingPanelElements.cpp index 0fc9ff91f5..8b51974f9d 100644 --- a/src/generated/CPACSCeilingPanelElements.cpp +++ b/src/generated/CPACSCeilingPanelElements.cpp @@ -108,6 +108,59 @@ namespace generated return m_ceilingPanelElements; } + size_t CPACSCeilingPanelElements::GetCeilingPanelElementCount() const + { + return m_ceilingPanelElements.size(); + } + + size_t CPACSCeilingPanelElements::GetCeilingPanelElementIndex(const std::string& UID) const + { + for (size_t i=0; i < GetCeilingPanelElementCount(); i++) { + const std::string tmpUID(m_ceilingPanelElements[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSCeilingPanelElements::GetCeilingPanelElementIndex", TIGL_UID_ERROR); + } + + CPACSDeckElementBase& CPACSCeilingPanelElements::GetCeilingPanelElement(size_t index) + { + if (index < 1 || index > GetCeilingPanelElementCount()) { + throw CTiglError("Invalid index in std::vector>::GetCeilingPanelElement", TIGL_INDEX_ERROR); + } + index--; + return *m_ceilingPanelElements[index]; + } + + const CPACSDeckElementBase& CPACSCeilingPanelElements::GetCeilingPanelElement(size_t index) const + { + if (index < 1 || index > GetCeilingPanelElementCount()) { + throw CTiglError("Invalid index in std::vector>::GetCeilingPanelElement", TIGL_INDEX_ERROR); + } + index--; + return *m_ceilingPanelElements[index]; + } + + CPACSDeckElementBase& CPACSCeilingPanelElements::GetCeilingPanelElement(const std::string& UID) + { + for (auto& elem : m_ceilingPanelElements ) { + if (elem->GetUID() == UID) + return *elem; + } + 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 + { + for (auto& elem : m_ceilingPanelElements ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSCeilingPanelElements::GetCeilingPanelElement. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CPACSDeckElementBase& CPACSCeilingPanelElements::AddCeilingPanelElement() { m_ceilingPanelElements.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSCeilingPanelElements.h b/src/generated/CPACSCeilingPanelElements.h index 7cdab85a9a..e99f029061 100644 --- a/src/generated/CPACSCeilingPanelElements.h +++ b/src/generated/CPACSCeilingPanelElements.h @@ -63,6 +63,15 @@ namespace generated 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 CPACSDeckElementBase& GetCeilingPanelElement(const std::string& UID) const; + TIGL_EXPORT virtual CPACSDeckElementBase& GetCeilingPanelElement(const std::string& UID); + TIGL_EXPORT virtual CPACSDeckElementBase& AddCeilingPanelElement(); TIGL_EXPORT virtual void RemoveCeilingPanelElement(CPACSDeckElementBase& ref); diff --git a/src/generated/CPACSClassDividerElements.cpp b/src/generated/CPACSClassDividerElements.cpp index 7d51307ae4..4a49f0abe9 100644 --- a/src/generated/CPACSClassDividerElements.cpp +++ b/src/generated/CPACSClassDividerElements.cpp @@ -108,6 +108,59 @@ namespace generated return m_classDividerElements; } + size_t CPACSClassDividerElements::GetClassDividerElementCount() const + { + return m_classDividerElements.size(); + } + + size_t CPACSClassDividerElements::GetClassDividerElementIndex(const std::string& UID) const + { + for (size_t i=0; i < GetClassDividerElementCount(); i++) { + const std::string tmpUID(m_classDividerElements[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSClassDividerElements::GetClassDividerElementIndex", TIGL_UID_ERROR); + } + + CPACSDeckElementBase& CPACSClassDividerElements::GetClassDividerElement(size_t index) + { + if (index < 1 || index > GetClassDividerElementCount()) { + throw CTiglError("Invalid index in std::vector>::GetClassDividerElement", TIGL_INDEX_ERROR); + } + index--; + return *m_classDividerElements[index]; + } + + const CPACSDeckElementBase& CPACSClassDividerElements::GetClassDividerElement(size_t index) const + { + if (index < 1 || index > GetClassDividerElementCount()) { + throw CTiglError("Invalid index in std::vector>::GetClassDividerElement", TIGL_INDEX_ERROR); + } + index--; + return *m_classDividerElements[index]; + } + + CPACSDeckElementBase& CPACSClassDividerElements::GetClassDividerElement(const std::string& UID) + { + for (auto& elem : m_classDividerElements ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSClassDividerElements::GetClassDividerElement. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CPACSDeckElementBase& CPACSClassDividerElements::GetClassDividerElement(const std::string& UID) const + { + for (auto& elem : m_classDividerElements ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSClassDividerElements::GetClassDividerElement. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CPACSDeckElementBase& CPACSClassDividerElements::AddClassDividerElement() { m_classDividerElements.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSClassDividerElements.h b/src/generated/CPACSClassDividerElements.h index 26486c2411..ab8a220f05 100644 --- a/src/generated/CPACSClassDividerElements.h +++ b/src/generated/CPACSClassDividerElements.h @@ -63,6 +63,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetClassDividerElements() const; TIGL_EXPORT virtual std::vector>& GetClassDividerElements(); + TIGL_EXPORT virtual size_t GetClassDividerElementCount() const; + TIGL_EXPORT virtual size_t GetClassDividerElementIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CPACSDeckElementBase& GetClassDividerElement(size_t index) const; + TIGL_EXPORT virtual CPACSDeckElementBase& GetClassDividerElement(size_t index); + + TIGL_EXPORT virtual const CPACSDeckElementBase& GetClassDividerElement(const std::string& UID) const; + TIGL_EXPORT virtual CPACSDeckElementBase& GetClassDividerElement(const std::string& UID); + TIGL_EXPORT virtual CPACSDeckElementBase& AddClassDividerElement(); TIGL_EXPORT virtual void RemoveClassDividerElement(CPACSDeckElementBase& ref); diff --git a/src/generated/CPACSCompartments.cpp b/src/generated/CPACSCompartments.cpp index bc4bf44156..9c5743243f 100644 --- a/src/generated/CPACSCompartments.cpp +++ b/src/generated/CPACSCompartments.cpp @@ -102,6 +102,59 @@ namespace generated return m_compartments; } + size_t CPACSCompartments::GetCompartmentCount() const + { + return m_compartments.size(); + } + + size_t CPACSCompartments::GetCompartmentIndex(const std::string& UID) const + { + for (size_t i=0; i < GetCompartmentCount(); i++) { + const boost::optional tmpUID(*m_compartments[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSCompartments::GetCompartmentIndex", TIGL_UID_ERROR); + } + + CPACSCompartment& CPACSCompartments::GetCompartment(size_t index) + { + if (index < 1 || index > GetCompartmentCount()) { + throw CTiglError("Invalid index in std::vector>::GetCompartment", TIGL_INDEX_ERROR); + } + index--; + return *m_compartments[index]; + } + + const CPACSCompartment& CPACSCompartments::GetCompartment(size_t index) const + { + if (index < 1 || index > GetCompartmentCount()) { + throw CTiglError("Invalid index in std::vector>::GetCompartment", TIGL_INDEX_ERROR); + } + index--; + return *m_compartments[index]; + } + + CPACSCompartment& CPACSCompartments::GetCompartment(const std::string& UID) + { + for (auto& elem : m_compartments ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSCompartments::GetCompartment. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CPACSCompartment& CPACSCompartments::GetCompartment(const std::string& UID) const + { + for (auto& elem : m_compartments ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSCompartments::GetCompartment. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CPACSCompartment& CPACSCompartments::AddCompartment() { m_compartments.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSCompartments.h b/src/generated/CPACSCompartments.h index d20c33b61a..3adf8ca6c0 100644 --- a/src/generated/CPACSCompartments.h +++ b/src/generated/CPACSCompartments.h @@ -59,6 +59,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetCompartments() const; TIGL_EXPORT virtual std::vector>& GetCompartments(); + TIGL_EXPORT virtual size_t GetCompartmentCount() const; + TIGL_EXPORT virtual size_t GetCompartmentIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CPACSCompartment& GetCompartment(size_t index) const; + TIGL_EXPORT virtual CPACSCompartment& GetCompartment(size_t index); + + TIGL_EXPORT virtual const CPACSCompartment& GetCompartment(const std::string& UID) const; + TIGL_EXPORT virtual CPACSCompartment& GetCompartment(const std::string& UID); + TIGL_EXPORT virtual CPACSCompartment& AddCompartment(); TIGL_EXPORT virtual void RemoveCompartment(CPACSCompartment& ref); diff --git a/src/generated/CPACSComponentSegments.cpp b/src/generated/CPACSComponentSegments.cpp index 13dd3386c4..31702d501f 100644 --- a/src/generated/CPACSComponentSegments.cpp +++ b/src/generated/CPACSComponentSegments.cpp @@ -102,6 +102,59 @@ namespace generated return m_componentSegments; } + size_t CPACSComponentSegments::GetComponentSegmentCount() const + { + return m_componentSegments.size(); + } + + size_t CPACSComponentSegments::GetComponentSegmentIndex(const std::string& UID) const + { + for (size_t i=0; i < GetComponentSegmentCount(); i++) { + const std::string tmpUID(m_componentSegments[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSComponentSegments::GetComponentSegmentIndex", TIGL_UID_ERROR); + } + + CCPACSWingComponentSegment& CPACSComponentSegments::GetComponentSegment(size_t index) + { + if (index < 1 || index > GetComponentSegmentCount()) { + throw CTiglError("Invalid index in std::vector>::GetComponentSegment", TIGL_INDEX_ERROR); + } + index--; + return *m_componentSegments[index]; + } + + const CCPACSWingComponentSegment& CPACSComponentSegments::GetComponentSegment(size_t index) const + { + if (index < 1 || index > GetComponentSegmentCount()) { + throw CTiglError("Invalid index in std::vector>::GetComponentSegment", TIGL_INDEX_ERROR); + } + index--; + return *m_componentSegments[index]; + } + + CCPACSWingComponentSegment& CPACSComponentSegments::GetComponentSegment(const std::string& UID) + { + for (auto& elem : m_componentSegments ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSComponentSegments::GetComponentSegment. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSWingComponentSegment& CPACSComponentSegments::GetComponentSegment(const std::string& UID) const + { + for (auto& elem : m_componentSegments ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSComponentSegments::GetComponentSegment. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSWingComponentSegment& CPACSComponentSegments::AddComponentSegment() { m_componentSegments.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); diff --git a/src/generated/CPACSComponentSegments.h b/src/generated/CPACSComponentSegments.h index ecbdf8070c..3ba1943542 100644 --- a/src/generated/CPACSComponentSegments.h +++ b/src/generated/CPACSComponentSegments.h @@ -63,6 +63,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetComponentSegments() const; TIGL_EXPORT virtual std::vector>& GetComponentSegments(); + TIGL_EXPORT virtual size_t GetComponentSegmentCount() const; + TIGL_EXPORT virtual size_t GetComponentSegmentIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSWingComponentSegment& GetComponentSegment(size_t index) const; + TIGL_EXPORT virtual CCPACSWingComponentSegment& GetComponentSegment(size_t index); + + TIGL_EXPORT virtual const CCPACSWingComponentSegment& GetComponentSegment(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSWingComponentSegment& GetComponentSegment(const std::string& UID); + TIGL_EXPORT virtual CCPACSWingComponentSegment& AddComponentSegment(); TIGL_EXPORT virtual void RemoveComponentSegment(CCPACSWingComponentSegment& ref); diff --git a/src/generated/CPACSComposite.cpp b/src/generated/CPACSComposite.cpp index b06dfe7dcd..1f840b3ecf 100644 --- a/src/generated/CPACSComposite.cpp +++ b/src/generated/CPACSComposite.cpp @@ -223,6 +223,30 @@ namespace generated return m_compositeLayers; } + size_t CPACSComposite::GetCompositeLayerCount() const + { + return m_compositeLayers.size(); + } + + CPACSCompositeLayer& CPACSComposite::GetCompositeLayer(size_t index) + { + if (index < 1 || index > GetCompositeLayerCount()) { + throw CTiglError("Invalid index in std::vector>::GetCompositeLayer", TIGL_INDEX_ERROR); + } + index--; + return *m_compositeLayers[index]; + } + + const CPACSCompositeLayer& CPACSComposite::GetCompositeLayer(size_t index) const + { + if (index < 1 || index > GetCompositeLayerCount()) { + throw CTiglError("Invalid index in std::vector>::GetCompositeLayer", TIGL_INDEX_ERROR); + } + index--; + return *m_compositeLayers[index]; + } + + CPACSCompositeLayer& CPACSComposite::AddCompositeLayer() { m_compositeLayers.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSComposite.h b/src/generated/CPACSComposite.h index 72046130c5..5e28756aef 100644 --- a/src/generated/CPACSComposite.h +++ b/src/generated/CPACSComposite.h @@ -77,6 +77,11 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetCompositeLayers() const; TIGL_EXPORT virtual std::vector>& GetCompositeLayers(); + TIGL_EXPORT virtual size_t GetCompositeLayerCount() const; + + TIGL_EXPORT virtual const CPACSCompositeLayer& GetCompositeLayer(size_t index) const; + TIGL_EXPORT virtual CPACSCompositeLayer& GetCompositeLayer(size_t index); + TIGL_EXPORT virtual CPACSCompositeLayer& AddCompositeLayer(); TIGL_EXPORT virtual void RemoveCompositeLayer(CPACSCompositeLayer& ref); diff --git a/src/generated/CPACSComposites.cpp b/src/generated/CPACSComposites.cpp index 1aa2eeba05..46eba2e7a3 100644 --- a/src/generated/CPACSComposites.cpp +++ b/src/generated/CPACSComposites.cpp @@ -108,6 +108,59 @@ namespace generated return m_composites; } + size_t CPACSComposites::GetCompositeCount() const + { + return m_composites.size(); + } + + size_t CPACSComposites::GetCompositeIndex(const std::string& UID) const + { + for (size_t i=0; i < GetCompositeCount(); i++) { + const std::string tmpUID(m_composites[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSComposites::GetCompositeIndex", TIGL_UID_ERROR); + } + + CPACSComposite& CPACSComposites::GetComposite(size_t index) + { + if (index < 1 || index > GetCompositeCount()) { + throw CTiglError("Invalid index in std::vector>::GetComposite", TIGL_INDEX_ERROR); + } + index--; + return *m_composites[index]; + } + + const CPACSComposite& CPACSComposites::GetComposite(size_t index) const + { + if (index < 1 || index > GetCompositeCount()) { + throw CTiglError("Invalid index in std::vector>::GetComposite", TIGL_INDEX_ERROR); + } + index--; + return *m_composites[index]; + } + + CPACSComposite& CPACSComposites::GetComposite(const std::string& UID) + { + for (auto& elem : m_composites ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSComposites::GetComposite. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CPACSComposite& CPACSComposites::GetComposite(const std::string& UID) const + { + for (auto& elem : m_composites ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSComposites::GetComposite. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CPACSComposite& CPACSComposites::AddComposite() { m_composites.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSComposites.h b/src/generated/CPACSComposites.h index b94113fbb2..cf0e577463 100644 --- a/src/generated/CPACSComposites.h +++ b/src/generated/CPACSComposites.h @@ -63,6 +63,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetComposites() const; TIGL_EXPORT virtual std::vector>& GetComposites(); + TIGL_EXPORT virtual size_t GetCompositeCount() const; + TIGL_EXPORT virtual size_t GetCompositeIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CPACSComposite& GetComposite(size_t index) const; + TIGL_EXPORT virtual CPACSComposite& GetComposite(size_t index); + + TIGL_EXPORT virtual const CPACSComposite& GetComposite(const std::string& UID) const; + TIGL_EXPORT virtual CPACSComposite& GetComposite(const std::string& UID); + TIGL_EXPORT virtual CPACSComposite& AddComposite(); TIGL_EXPORT virtual void RemoveComposite(CPACSComposite& ref); diff --git a/src/generated/CPACSControlSurfaceContours.cpp b/src/generated/CPACSControlSurfaceContours.cpp index de7d7955df..980371298a 100644 --- a/src/generated/CPACSControlSurfaceContours.cpp +++ b/src/generated/CPACSControlSurfaceContours.cpp @@ -108,6 +108,30 @@ namespace generated return m_intermediateAirfoils; } + size_t CPACSControlSurfaceContours::GetIntermediateAirfoilCount() const + { + return m_intermediateAirfoils.size(); + } + + CPACSControlSurfaceAirfoil& CPACSControlSurfaceContours::GetIntermediateAirfoil(size_t index) + { + if (index < 1 || index > GetIntermediateAirfoilCount()) { + throw CTiglError("Invalid index in std::vector>::GetIntermediateAirfoil", TIGL_INDEX_ERROR); + } + index--; + return *m_intermediateAirfoils[index]; + } + + const CPACSControlSurfaceAirfoil& CPACSControlSurfaceContours::GetIntermediateAirfoil(size_t index) const + { + if (index < 1 || index > GetIntermediateAirfoilCount()) { + throw CTiglError("Invalid index in std::vector>::GetIntermediateAirfoil", TIGL_INDEX_ERROR); + } + index--; + return *m_intermediateAirfoils[index]; + } + + CPACSControlSurfaceAirfoil& CPACSControlSurfaceContours::AddIntermediateAirfoil() { m_intermediateAirfoils.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSControlSurfaceContours.h b/src/generated/CPACSControlSurfaceContours.h index 6b4343d314..b95f0d462d 100644 --- a/src/generated/CPACSControlSurfaceContours.h +++ b/src/generated/CPACSControlSurfaceContours.h @@ -64,6 +64,11 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetIntermediateAirfoils() const; TIGL_EXPORT virtual std::vector>& GetIntermediateAirfoils(); + TIGL_EXPORT virtual size_t GetIntermediateAirfoilCount() const; + + TIGL_EXPORT virtual const CPACSControlSurfaceAirfoil& GetIntermediateAirfoil(size_t index) const; + TIGL_EXPORT virtual CPACSControlSurfaceAirfoil& GetIntermediateAirfoil(size_t index); + TIGL_EXPORT virtual CPACSControlSurfaceAirfoil& AddIntermediateAirfoil(); TIGL_EXPORT virtual void RemoveIntermediateAirfoil(CPACSControlSurfaceAirfoil& ref); diff --git a/src/generated/CPACSControlSurfaceSteps.cpp b/src/generated/CPACSControlSurfaceSteps.cpp index 61e70160ca..c8f1ee2475 100644 --- a/src/generated/CPACSControlSurfaceSteps.cpp +++ b/src/generated/CPACSControlSurfaceSteps.cpp @@ -108,6 +108,30 @@ namespace generated return m_steps; } + size_t CPACSControlSurfaceSteps::GetStepCount() const + { + return m_steps.size(); + } + + CPACSControlSurfaceStep& CPACSControlSurfaceSteps::GetStep(size_t index) + { + if (index < 1 || index > GetStepCount()) { + throw CTiglError("Invalid index in std::vector>::GetStep", TIGL_INDEX_ERROR); + } + index--; + return *m_steps[index]; + } + + const CPACSControlSurfaceStep& CPACSControlSurfaceSteps::GetStep(size_t index) const + { + if (index < 1 || index > GetStepCount()) { + throw CTiglError("Invalid index in std::vector>::GetStep", TIGL_INDEX_ERROR); + } + index--; + return *m_steps[index]; + } + + CPACSControlSurfaceStep& CPACSControlSurfaceSteps::AddStep() { m_steps.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSControlSurfaceSteps.h b/src/generated/CPACSControlSurfaceSteps.h index fc16e2f2ae..7b0330e698 100644 --- a/src/generated/CPACSControlSurfaceSteps.h +++ b/src/generated/CPACSControlSurfaceSteps.h @@ -64,6 +64,11 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetSteps() const; TIGL_EXPORT virtual std::vector>& GetSteps(); + TIGL_EXPORT virtual size_t GetStepCount() const; + + TIGL_EXPORT virtual const CPACSControlSurfaceStep& GetStep(size_t index) const; + TIGL_EXPORT virtual CPACSControlSurfaceStep& GetStep(size_t index); + TIGL_EXPORT virtual CPACSControlSurfaceStep& AddStep(); TIGL_EXPORT virtual void RemoveStep(CPACSControlSurfaceStep& ref); diff --git a/src/generated/CPACSControlSurfaceTracks.cpp b/src/generated/CPACSControlSurfaceTracks.cpp index 0ca3320a9e..19ed356cf5 100644 --- a/src/generated/CPACSControlSurfaceTracks.cpp +++ b/src/generated/CPACSControlSurfaceTracks.cpp @@ -102,6 +102,59 @@ namespace generated return m_tracks; } + size_t CPACSControlSurfaceTracks::GetTrackCount() const + { + return m_tracks.size(); + } + + size_t CPACSControlSurfaceTracks::GetTrackIndex(const std::string& UID) const + { + for (size_t i=0; i < GetTrackCount(); i++) { + const std::string tmpUID(m_tracks[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSControlSurfaceTracks::GetTrackIndex", TIGL_UID_ERROR); + } + + CPACSControlSurfaceTrackType& CPACSControlSurfaceTracks::GetTrack(size_t index) + { + if (index < 1 || index > GetTrackCount()) { + throw CTiglError("Invalid index in std::vector>::GetTrack", TIGL_INDEX_ERROR); + } + index--; + return *m_tracks[index]; + } + + const CPACSControlSurfaceTrackType& CPACSControlSurfaceTracks::GetTrack(size_t index) const + { + if (index < 1 || index > GetTrackCount()) { + throw CTiglError("Invalid index in std::vector>::GetTrack", TIGL_INDEX_ERROR); + } + index--; + return *m_tracks[index]; + } + + CPACSControlSurfaceTrackType& CPACSControlSurfaceTracks::GetTrack(const std::string& UID) + { + for (auto& elem : m_tracks ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSControlSurfaceTracks::GetTrack. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CPACSControlSurfaceTrackType& CPACSControlSurfaceTracks::GetTrack(const std::string& UID) const + { + for (auto& elem : m_tracks ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSControlSurfaceTracks::GetTrack. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CPACSControlSurfaceTrackType& CPACSControlSurfaceTracks::AddTrack() { m_tracks.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSControlSurfaceTracks.h b/src/generated/CPACSControlSurfaceTracks.h index 043ebcdb2d..ee7a508b61 100644 --- a/src/generated/CPACSControlSurfaceTracks.h +++ b/src/generated/CPACSControlSurfaceTracks.h @@ -64,6 +64,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetTracks() const; TIGL_EXPORT virtual std::vector>& GetTracks(); + TIGL_EXPORT virtual size_t GetTrackCount() const; + TIGL_EXPORT virtual size_t GetTrackIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CPACSControlSurfaceTrackType& GetTrack(size_t index) const; + TIGL_EXPORT virtual CPACSControlSurfaceTrackType& GetTrack(size_t index); + + TIGL_EXPORT virtual const CPACSControlSurfaceTrackType& GetTrack(const std::string& UID) const; + TIGL_EXPORT virtual CPACSControlSurfaceTrackType& GetTrack(const std::string& UID); + TIGL_EXPORT virtual CPACSControlSurfaceTrackType& AddTrack(); TIGL_EXPORT virtual void RemoveTrack(CPACSControlSurfaceTrackType& ref); diff --git a/src/generated/CPACSControlSurfaces.cpp b/src/generated/CPACSControlSurfaces.cpp index c3ce054277..7fca1f4787 100644 --- a/src/generated/CPACSControlSurfaces.cpp +++ b/src/generated/CPACSControlSurfaces.cpp @@ -105,17 +105,17 @@ namespace generated } - const boost::optional& CPACSControlSurfaces::GetTrailingEdgeDevices() const + const boost::optional& CPACSControlSurfaces::GetTrailingEdgeDevices() const { return m_trailingEdgeDevices; } - boost::optional& CPACSControlSurfaces::GetTrailingEdgeDevices() + boost::optional& CPACSControlSurfaces::GetTrailingEdgeDevices() { return m_trailingEdgeDevices; } - CCPACSTrailingEdgeDevices& CPACSControlSurfaces::GetTrailingEdgeDevices(CreateIfNotExistsTag) + CPACSTrailingEdgeDevices& CPACSControlSurfaces::GetTrailingEdgeDevices(CreateIfNotExistsTag) { if (!m_trailingEdgeDevices) m_trailingEdgeDevices = boost::in_place(reinterpret_cast(this), m_uidMgr); diff --git a/src/generated/CPACSControlSurfaces.h b/src/generated/CPACSControlSurfaces.h index 5e90409413..9cf886fd00 100644 --- a/src/generated/CPACSControlSurfaces.h +++ b/src/generated/CPACSControlSurfaces.h @@ -19,9 +19,9 @@ #include #include -#include #include #include +#include "CPACSTrailingEdgeDevices.h" #include "CreateIfNotExists.h" #include "tigl_internal.h" @@ -62,10 +62,10 @@ 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& GetTrailingEdgeDevices() const; - TIGL_EXPORT virtual boost::optional& GetTrailingEdgeDevices(); + TIGL_EXPORT virtual const boost::optional& GetTrailingEdgeDevices() const; + TIGL_EXPORT virtual boost::optional& GetTrailingEdgeDevices(); - TIGL_EXPORT virtual CCPACSTrailingEdgeDevices& GetTrailingEdgeDevices(CreateIfNotExistsTag); + TIGL_EXPORT virtual CPACSTrailingEdgeDevices& GetTrailingEdgeDevices(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveTrailingEdgeDevices(); protected: @@ -73,7 +73,7 @@ namespace generated CTiglUIDManager* m_uidMgr; - boost::optional m_trailingEdgeDevices; + boost::optional m_trailingEdgeDevices; private: CPACSControlSurfaces(const CPACSControlSurfaces&) = delete; diff --git a/src/generated/CPACSCurveProfiles.cpp b/src/generated/CPACSCurveProfiles.cpp index 0b4b1c3596..6f6ed7f165 100644 --- a/src/generated/CPACSCurveProfiles.cpp +++ b/src/generated/CPACSCurveProfiles.cpp @@ -17,8 +17,8 @@ #include #include -#include "CCPACSProfiles.h" #include "CPACSCurveProfiles.h" +#include "CPACSProfiles.h" #include "CTiglError.h" #include "CTiglLogging.h" #include "CTiglUIDManager.h" @@ -29,7 +29,7 @@ namespace tigl { namespace generated { - CPACSCurveProfiles::CPACSCurveProfiles(CCPACSProfiles* parent, CTiglUIDManager* uidMgr) + CPACSCurveProfiles::CPACSCurveProfiles(CPACSProfiles* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { //assert(parent != NULL); @@ -40,12 +40,12 @@ namespace generated { } - const CCPACSProfiles* CPACSCurveProfiles::GetParent() const + const CPACSProfiles* CPACSCurveProfiles::GetParent() const { return m_parent; } - CCPACSProfiles* CPACSCurveProfiles::GetParent() + CPACSProfiles* CPACSCurveProfiles::GetParent() { return m_parent; } @@ -108,6 +108,59 @@ namespace generated return m_curveProfiles; } + size_t CPACSCurveProfiles::GetCurveProfileCount() const + { + return m_curveProfiles.size(); + } + + size_t CPACSCurveProfiles::GetCurveProfileIndex(const std::string& UID) const + { + for (size_t i=0; i < GetCurveProfileCount(); i++) { + const std::string tmpUID(m_curveProfiles[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSCurveProfiles::GetCurveProfileIndex", TIGL_UID_ERROR); + } + + CCPACSNacelleProfile& CPACSCurveProfiles::GetCurveProfile(size_t index) + { + if (index < 1 || index > GetCurveProfileCount()) { + throw CTiglError("Invalid index in std::vector>::GetCurveProfile", TIGL_INDEX_ERROR); + } + index--; + return *m_curveProfiles[index]; + } + + const CCPACSNacelleProfile& CPACSCurveProfiles::GetCurveProfile(size_t index) const + { + if (index < 1 || index > GetCurveProfileCount()) { + throw CTiglError("Invalid index in std::vector>::GetCurveProfile", TIGL_INDEX_ERROR); + } + index--; + return *m_curveProfiles[index]; + } + + CCPACSNacelleProfile& CPACSCurveProfiles::GetCurveProfile(const std::string& UID) + { + for (auto& elem : m_curveProfiles ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSCurveProfiles::GetCurveProfile. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSNacelleProfile& CPACSCurveProfiles::GetCurveProfile(const std::string& UID) const + { + for (auto& elem : m_curveProfiles ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSCurveProfiles::GetCurveProfile. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSNacelleProfile& CPACSCurveProfiles::AddCurveProfile() { m_curveProfiles.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSCurveProfiles.h b/src/generated/CPACSCurveProfiles.h index cc9d9293f6..8308a6248d 100644 --- a/src/generated/CPACSCurveProfiles.h +++ b/src/generated/CPACSCurveProfiles.h @@ -28,23 +28,24 @@ namespace tigl class CTiglUIDManager; class CTiglUIDObject; class CCPACSNacelleProfile; -class CCPACSProfiles; namespace generated { + class CPACSProfiles; + // This class is used in: // CPACSProfiles class CPACSCurveProfiles { public: - TIGL_EXPORT CPACSCurveProfiles(CCPACSProfiles* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSCurveProfiles(CPACSProfiles* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSCurveProfiles(); - TIGL_EXPORT CCPACSProfiles* GetParent(); + TIGL_EXPORT CPACSProfiles* GetParent(); - TIGL_EXPORT const CCPACSProfiles* GetParent() const; + TIGL_EXPORT const CPACSProfiles* GetParent() const; TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -58,11 +59,20 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetCurveProfiles() const; TIGL_EXPORT virtual std::vector>& GetCurveProfiles(); + TIGL_EXPORT virtual size_t GetCurveProfileCount() const; + TIGL_EXPORT virtual size_t GetCurveProfileIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSNacelleProfile& GetCurveProfile(size_t index) const; + TIGL_EXPORT virtual CCPACSNacelleProfile& GetCurveProfile(size_t index); + + TIGL_EXPORT virtual const CCPACSNacelleProfile& GetCurveProfile(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSNacelleProfile& GetCurveProfile(const std::string& UID); + TIGL_EXPORT virtual CCPACSNacelleProfile& AddCurveProfile(); TIGL_EXPORT virtual void RemoveCurveProfile(CCPACSNacelleProfile& ref); protected: - CCPACSProfiles* m_parent; + CPACSProfiles* m_parent; CTiglUIDManager* m_uidMgr; @@ -79,4 +89,5 @@ namespace generated // Aliases in tigl namespace using CCPACSCurveProfiles = generated::CPACSCurveProfiles; +using CCPACSProfiles = generated::CPACSProfiles; } // namespace tigl diff --git a/src/generated/CPACSCutOutProfiles.cpp b/src/generated/CPACSCutOutProfiles.cpp index f04a24840f..531429af1d 100644 --- a/src/generated/CPACSCutOutProfiles.cpp +++ b/src/generated/CPACSCutOutProfiles.cpp @@ -156,6 +156,30 @@ namespace generated return m_cutOutProfiles; } + size_t CPACSCutOutProfiles::GetCutOutProfileCount() const + { + return m_cutOutProfiles.size(); + } + + CPACSCutOutProfile& CPACSCutOutProfiles::GetCutOutProfile(size_t index) + { + if (index < 1 || index > GetCutOutProfileCount()) { + throw CTiglError("Invalid index in std::vector>::GetCutOutProfile", TIGL_INDEX_ERROR); + } + index--; + return *m_cutOutProfiles[index]; + } + + const CPACSCutOutProfile& CPACSCutOutProfiles::GetCutOutProfile(size_t index) const + { + if (index < 1 || index > GetCutOutProfileCount()) { + throw CTiglError("Invalid index in std::vector>::GetCutOutProfile", TIGL_INDEX_ERROR); + } + index--; + return *m_cutOutProfiles[index]; + } + + CPACSCutOutProfile& CPACSCutOutProfiles::AddCutOutProfile() { m_cutOutProfiles.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSCutOutProfiles.h b/src/generated/CPACSCutOutProfiles.h index a8ddc5de81..a947607979 100644 --- a/src/generated/CPACSCutOutProfiles.h +++ b/src/generated/CPACSCutOutProfiles.h @@ -70,6 +70,11 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetCutOutProfiles() const; TIGL_EXPORT virtual std::vector>& GetCutOutProfiles(); + TIGL_EXPORT virtual size_t GetCutOutProfileCount() const; + + TIGL_EXPORT virtual const CPACSCutOutProfile& GetCutOutProfile(size_t index) const; + TIGL_EXPORT virtual CPACSCutOutProfile& GetCutOutProfile(size_t index); + TIGL_EXPORT virtual CPACSCutOutProfile& AddCutOutProfile(); TIGL_EXPORT virtual void RemoveCutOutProfile(CPACSCutOutProfile& ref); diff --git a/src/generated/CPACSDeckStructuralMounts.cpp b/src/generated/CPACSDeckStructuralMounts.cpp index 82735659b2..01d801cd63 100644 --- a/src/generated/CPACSDeckStructuralMounts.cpp +++ b/src/generated/CPACSDeckStructuralMounts.cpp @@ -102,6 +102,59 @@ namespace generated return m_structuralMounts; } + size_t CPACSDeckStructuralMounts::GetStructuralMountCount() const + { + return m_structuralMounts.size(); + } + + size_t CPACSDeckStructuralMounts::GetStructuralMountIndex(const std::string& UID) const + { + for (size_t i=0; i < GetStructuralMountCount(); i++) { + const std::string tmpUID(m_structuralMounts[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSDeckStructuralMounts::GetStructuralMountIndex", TIGL_UID_ERROR); + } + + CPACSDeckStructuralMount& CPACSDeckStructuralMounts::GetStructuralMount(size_t index) + { + if (index < 1 || index > GetStructuralMountCount()) { + throw CTiglError("Invalid index in std::vector>::GetStructuralMount", TIGL_INDEX_ERROR); + } + index--; + return *m_structuralMounts[index]; + } + + const CPACSDeckStructuralMount& CPACSDeckStructuralMounts::GetStructuralMount(size_t index) const + { + if (index < 1 || index > GetStructuralMountCount()) { + throw CTiglError("Invalid index in std::vector>::GetStructuralMount", TIGL_INDEX_ERROR); + } + index--; + return *m_structuralMounts[index]; + } + + CPACSDeckStructuralMount& CPACSDeckStructuralMounts::GetStructuralMount(const std::string& UID) + { + for (auto& elem : m_structuralMounts ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSDeckStructuralMounts::GetStructuralMount. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CPACSDeckStructuralMount& CPACSDeckStructuralMounts::GetStructuralMount(const std::string& UID) const + { + for (auto& elem : m_structuralMounts ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSDeckStructuralMounts::GetStructuralMount. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CPACSDeckStructuralMount& CPACSDeckStructuralMounts::AddStructuralMount() { m_structuralMounts.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSDeckStructuralMounts.h b/src/generated/CPACSDeckStructuralMounts.h index 6a3692d452..4eb5b9d012 100644 --- a/src/generated/CPACSDeckStructuralMounts.h +++ b/src/generated/CPACSDeckStructuralMounts.h @@ -63,6 +63,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetStructuralMounts() const; TIGL_EXPORT virtual std::vector>& GetStructuralMounts(); + TIGL_EXPORT virtual size_t GetStructuralMountCount() const; + TIGL_EXPORT virtual size_t GetStructuralMountIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CPACSDeckStructuralMount& GetStructuralMount(size_t index) const; + TIGL_EXPORT virtual CPACSDeckStructuralMount& GetStructuralMount(size_t index); + + TIGL_EXPORT virtual const CPACSDeckStructuralMount& GetStructuralMount(const std::string& UID) const; + TIGL_EXPORT virtual CPACSDeckStructuralMount& GetStructuralMount(const std::string& UID); + TIGL_EXPORT virtual CPACSDeckStructuralMount& AddStructuralMount(); TIGL_EXPORT virtual void RemoveStructuralMount(CPACSDeckStructuralMount& ref); diff --git a/src/generated/CPACSDoorCutOut.cpp b/src/generated/CPACSDoorCutOut.cpp index 56d6e3be72..b4586d5d5c 100644 --- a/src/generated/CPACSDoorCutOut.cpp +++ b/src/generated/CPACSDoorCutOut.cpp @@ -16,8 +16,8 @@ // limitations under the License. #include -#include "CCPACSDoors.h" #include "CPACSDoorCutOut.h" +#include "CPACSDoors.h" #include "CTiglError.h" #include "CTiglLogging.h" #include "CTiglUIDManager.h" @@ -27,7 +27,7 @@ namespace tigl { namespace generated { - CPACSDoorCutOut::CPACSDoorCutOut(CCPACSDoors* parent, CTiglUIDManager* uidMgr) + CPACSDoorCutOut::CPACSDoorCutOut(CPACSDoors* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { //assert(parent != NULL); @@ -42,12 +42,12 @@ namespace generated } } - const CCPACSDoors* CPACSDoorCutOut::GetParent() const + const CPACSDoors* CPACSDoorCutOut::GetParent() const { return m_parent; } - CCPACSDoors* CPACSDoorCutOut::GetParent() + CPACSDoors* CPACSDoorCutOut::GetParent() { return m_parent; } diff --git a/src/generated/CPACSDoorCutOut.h b/src/generated/CPACSDoorCutOut.h index 3d5f9248df..bf382c216d 100644 --- a/src/generated/CPACSDoorCutOut.h +++ b/src/generated/CPACSDoorCutOut.h @@ -28,10 +28,11 @@ namespace tigl { class CTiglUIDManager; -class CCPACSDoors; namespace generated { + class CPACSDoors; + // This class is used in: // CPACSDoors @@ -42,13 +43,13 @@ namespace generated class CPACSDoorCutOut : public CTiglReqUIDObject, public ITiglUIDRefObject { public: - TIGL_EXPORT CPACSDoorCutOut(CCPACSDoors* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSDoorCutOut(CPACSDoors* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSDoorCutOut(); - TIGL_EXPORT CCPACSDoors* GetParent(); + TIGL_EXPORT CPACSDoors* GetParent(); - TIGL_EXPORT const CCPACSDoors* GetParent() const; + TIGL_EXPORT const CPACSDoors* GetParent() const; TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -75,7 +76,7 @@ namespace generated TIGL_EXPORT virtual void SetDssDesignUID(const boost::optional& value); protected: - CCPACSDoors* m_parent; + CPACSDoors* m_parent; CTiglUIDManager* m_uidMgr; @@ -110,4 +111,5 @@ namespace generated // Aliases in tigl namespace using CCPACSDoorCutOut = generated::CPACSDoorCutOut; +using CCPACSDoors = generated::CPACSDoors; } // namespace tigl diff --git a/src/generated/CPACSDoorSurroundStructuresAssembly.cpp b/src/generated/CPACSDoorSurroundStructuresAssembly.cpp index 627d75fe39..d176b2ad3a 100644 --- a/src/generated/CPACSDoorSurroundStructuresAssembly.cpp +++ b/src/generated/CPACSDoorSurroundStructuresAssembly.cpp @@ -108,6 +108,59 @@ namespace generated return m_doorSurroundStructures; } + size_t CPACSDoorSurroundStructuresAssembly::GetDoorSurroundStructureCount() const + { + return m_doorSurroundStructures.size(); + } + + size_t CPACSDoorSurroundStructuresAssembly::GetDoorSurroundStructureIndex(const std::string& UID) const + { + for (size_t i=0; i < GetDoorSurroundStructureCount(); i++) { + const std::string tmpUID(m_doorSurroundStructures[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSDoorSurroundStructuresAssembly::GetDoorSurroundStructureIndex", TIGL_UID_ERROR); + } + + CPACSDoorSurroundStructurePosition& CPACSDoorSurroundStructuresAssembly::GetDoorSurroundStructure(size_t index) + { + if (index < 1 || index > GetDoorSurroundStructureCount()) { + throw CTiglError("Invalid index in std::vector>::GetDoorSurroundStructure", TIGL_INDEX_ERROR); + } + index--; + return *m_doorSurroundStructures[index]; + } + + const CPACSDoorSurroundStructurePosition& CPACSDoorSurroundStructuresAssembly::GetDoorSurroundStructure(size_t index) const + { + if (index < 1 || index > GetDoorSurroundStructureCount()) { + throw CTiglError("Invalid index in std::vector>::GetDoorSurroundStructure", TIGL_INDEX_ERROR); + } + index--; + return *m_doorSurroundStructures[index]; + } + + CPACSDoorSurroundStructurePosition& CPACSDoorSurroundStructuresAssembly::GetDoorSurroundStructure(const std::string& UID) + { + for (auto& elem : m_doorSurroundStructures ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSDoorSurroundStructuresAssembly::GetDoorSurroundStructure. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CPACSDoorSurroundStructurePosition& CPACSDoorSurroundStructuresAssembly::GetDoorSurroundStructure(const std::string& UID) const + { + for (auto& elem : m_doorSurroundStructures ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSDoorSurroundStructuresAssembly::GetDoorSurroundStructure. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CPACSDoorSurroundStructurePosition& CPACSDoorSurroundStructuresAssembly::AddDoorSurroundStructure() { m_doorSurroundStructures.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSDoorSurroundStructuresAssembly.h b/src/generated/CPACSDoorSurroundStructuresAssembly.h index 5a62978382..6475891712 100644 --- a/src/generated/CPACSDoorSurroundStructuresAssembly.h +++ b/src/generated/CPACSDoorSurroundStructuresAssembly.h @@ -64,6 +64,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetDoorSurroundStructures() const; TIGL_EXPORT virtual std::vector>& GetDoorSurroundStructures(); + TIGL_EXPORT virtual size_t GetDoorSurroundStructureCount() const; + TIGL_EXPORT virtual size_t GetDoorSurroundStructureIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CPACSDoorSurroundStructurePosition& GetDoorSurroundStructure(size_t index) const; + TIGL_EXPORT virtual CPACSDoorSurroundStructurePosition& GetDoorSurroundStructure(size_t index); + + TIGL_EXPORT virtual const CPACSDoorSurroundStructurePosition& GetDoorSurroundStructure(const std::string& UID) const; + TIGL_EXPORT virtual CPACSDoorSurroundStructurePosition& GetDoorSurroundStructure(const std::string& UID); + TIGL_EXPORT virtual CPACSDoorSurroundStructurePosition& AddDoorSurroundStructure(); TIGL_EXPORT virtual void RemoveDoorSurroundStructure(CPACSDoorSurroundStructurePosition& ref); diff --git a/src/generated/CPACSDoors.cpp b/src/generated/CPACSDoors.cpp index 68a8f8e1ab..bde775b68b 100644 --- a/src/generated/CPACSDoors.cpp +++ b/src/generated/CPACSDoors.cpp @@ -86,7 +86,7 @@ namespace generated { // read element door if (tixi::TixiCheckElement(tixiHandle, xpath + "/door")) { - tixi::TixiReadElements(tixiHandle, xpath + "/door", m_doors, 1, tixi::xsdUnbounded, reinterpret_cast(this), m_uidMgr); + tixi::TixiReadElements(tixiHandle, xpath + "/door", m_doors, 1, tixi::xsdUnbounded, this, m_uidMgr); } } @@ -108,9 +108,62 @@ namespace generated return m_doors; } + size_t CPACSDoors::GetDoorCount() const + { + return m_doors.size(); + } + + size_t CPACSDoors::GetDoorIndex(const std::string& UID) const + { + for (size_t i=0; i < GetDoorCount(); i++) { + const std::string tmpUID(m_doors[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSDoors::GetDoorIndex", TIGL_UID_ERROR); + } + + CPACSDoorCutOut& CPACSDoors::GetDoor(size_t index) + { + if (index < 1 || index > GetDoorCount()) { + throw CTiglError("Invalid index in std::vector>::GetDoor", TIGL_INDEX_ERROR); + } + index--; + return *m_doors[index]; + } + + const CPACSDoorCutOut& CPACSDoors::GetDoor(size_t index) const + { + if (index < 1 || index > GetDoorCount()) { + throw CTiglError("Invalid index in std::vector>::GetDoor", TIGL_INDEX_ERROR); + } + index--; + return *m_doors[index]; + } + + CPACSDoorCutOut& CPACSDoors::GetDoor(const std::string& UID) + { + for (auto& elem : m_doors ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSDoors::GetDoor. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CPACSDoorCutOut& CPACSDoors::GetDoor(const std::string& UID) const + { + for (auto& elem : m_doors ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSDoors::GetDoor. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CPACSDoorCutOut& CPACSDoors::AddDoor() { - m_doors.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); + m_doors.push_back(make_unique(this, m_uidMgr)); return *m_doors.back(); } diff --git a/src/generated/CPACSDoors.h b/src/generated/CPACSDoors.h index 0c37a0dbc1..6ce75829e6 100644 --- a/src/generated/CPACSDoors.h +++ b/src/generated/CPACSDoors.h @@ -63,6 +63,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetDoors() const; TIGL_EXPORT virtual std::vector>& GetDoors(); + TIGL_EXPORT virtual size_t GetDoorCount() const; + TIGL_EXPORT virtual size_t GetDoorIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CPACSDoorCutOut& GetDoor(size_t index) const; + TIGL_EXPORT virtual CPACSDoorCutOut& GetDoor(size_t index); + + TIGL_EXPORT virtual const CPACSDoorCutOut& GetDoor(const std::string& UID) const; + TIGL_EXPORT virtual CPACSDoorCutOut& GetDoor(const std::string& UID); + TIGL_EXPORT virtual CPACSDoorCutOut& AddDoor(); TIGL_EXPORT virtual void RemoveDoor(CPACSDoorCutOut& ref); @@ -82,9 +91,8 @@ namespace generated }; } // namespace generated -// CPACSDoors is customized, use type CCPACSDoors directly - // Aliases in tigl namespace +using CCPACSDoors = generated::CPACSDoors; using CCPACSDoorCutOut = generated::CPACSDoorCutOut; using CCPACSStructuralElements = generated::CPACSStructuralElements; } // namespace tigl diff --git a/src/generated/CPACSDuct.cpp b/src/generated/CPACSDuct.cpp index cdaeaa414a..ee578c2ea6 100644 --- a/src/generated/CPACSDuct.cpp +++ b/src/generated/CPACSDuct.cpp @@ -303,12 +303,12 @@ namespace generated return m_transformation; } - const CCPACSFuselageSections& CPACSDuct::GetSections() const + const CPACSFuselageSections& CPACSDuct::GetSections() const { return m_sections; } - CCPACSFuselageSections& CPACSDuct::GetSections() + CPACSFuselageSections& CPACSDuct::GetSections() { return m_sections; } diff --git a/src/generated/CPACSDuct.h b/src/generated/CPACSDuct.h index 71cec98cad..6d8a0f7797 100644 --- a/src/generated/CPACSDuct.h +++ b/src/generated/CPACSDuct.h @@ -20,13 +20,13 @@ #include #include #include -#include #include #include #include #include #include #include +#include "CPACSFuselageSections.h" #include "CreateIfNotExists.h" #include "CTiglUIDObject.h" #include "tigl_internal.h" @@ -79,8 +79,8 @@ namespace generated TIGL_EXPORT virtual const boost::optional& GetTransformation() const; TIGL_EXPORT virtual boost::optional& GetTransformation(); - TIGL_EXPORT virtual const CCPACSFuselageSections& GetSections() const; - TIGL_EXPORT virtual CCPACSFuselageSections& GetSections(); + TIGL_EXPORT virtual const CPACSFuselageSections& GetSections() const; + TIGL_EXPORT virtual CPACSFuselageSections& GetSections(); TIGL_EXPORT virtual const boost::optional& GetPositionings() const; TIGL_EXPORT virtual boost::optional& GetPositionings(); @@ -117,7 +117,7 @@ namespace generated boost::optional m_transformation; - CCPACSFuselageSections m_sections; + CPACSFuselageSections m_sections; boost::optional m_positionings; diff --git a/src/generated/CPACSDucts.cpp b/src/generated/CPACSDucts.cpp index 396ba1519a..9cfdf05ade 100644 --- a/src/generated/CPACSDucts.cpp +++ b/src/generated/CPACSDucts.cpp @@ -113,6 +113,59 @@ namespace generated return m_ducts; } + size_t CPACSDucts::GetDuctCount() const + { + return m_ducts.size(); + } + + size_t CPACSDucts::GetDuctIndex(const std::string& UID) const + { + for (size_t i=0; i < GetDuctCount(); i++) { + const std::string tmpUID(m_ducts[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSDucts::GetDuctIndex", TIGL_UID_ERROR); + } + + CCPACSDuct& CPACSDucts::GetDuct(size_t index) + { + if (index < 1 || index > GetDuctCount()) { + throw CTiglError("Invalid index in std::vector>::GetDuct", TIGL_INDEX_ERROR); + } + index--; + return *m_ducts[index]; + } + + const CCPACSDuct& CPACSDucts::GetDuct(size_t index) const + { + if (index < 1 || index > GetDuctCount()) { + throw CTiglError("Invalid index in std::vector>::GetDuct", TIGL_INDEX_ERROR); + } + index--; + return *m_ducts[index]; + } + + CCPACSDuct& CPACSDucts::GetDuct(const std::string& UID) + { + for (auto& elem : m_ducts ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSDucts::GetDuct. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSDuct& CPACSDucts::GetDuct(const std::string& UID) const + { + for (auto& elem : m_ducts ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSDucts::GetDuct. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const std::vector>& CPACSDucts::GetDuctAssemblys() const { return m_ductAssemblys; @@ -123,6 +176,59 @@ namespace generated return m_ductAssemblys; } + size_t CPACSDucts::GetDuctAssemblyCount() const + { + return m_ductAssemblys.size(); + } + + size_t CPACSDucts::GetDuctAssemblyIndex(const std::string& UID) const + { + for (size_t i=0; i < GetDuctAssemblyCount(); i++) { + const std::string tmpUID(m_ductAssemblys[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSDucts::GetDuctAssemblyIndex", TIGL_UID_ERROR); + } + + CCPACSDuctAssembly& CPACSDucts::GetDuctAssembly(size_t index) + { + if (index < 1 || index > GetDuctAssemblyCount()) { + throw CTiglError("Invalid index in std::vector>::GetDuctAssembly", TIGL_INDEX_ERROR); + } + index--; + return *m_ductAssemblys[index]; + } + + const CCPACSDuctAssembly& CPACSDucts::GetDuctAssembly(size_t index) const + { + if (index < 1 || index > GetDuctAssemblyCount()) { + throw CTiglError("Invalid index in std::vector>::GetDuctAssembly", TIGL_INDEX_ERROR); + } + index--; + return *m_ductAssemblys[index]; + } + + CCPACSDuctAssembly& CPACSDucts::GetDuctAssembly(const std::string& UID) + { + for (auto& elem : m_ductAssemblys ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSDucts::GetDuctAssembly. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSDuctAssembly& CPACSDucts::GetDuctAssembly(const std::string& UID) const + { + for (auto& elem : m_ductAssemblys ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSDucts::GetDuctAssembly. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSDuct& CPACSDucts::AddDuct() { m_ducts.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); diff --git a/src/generated/CPACSDucts.h b/src/generated/CPACSDucts.h index 00eee03852..6c02eef8e8 100644 --- a/src/generated/CPACSDucts.h +++ b/src/generated/CPACSDucts.h @@ -62,9 +62,27 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetDucts() const; TIGL_EXPORT virtual std::vector>& GetDucts(); + TIGL_EXPORT virtual size_t GetDuctCount() const; + TIGL_EXPORT virtual size_t GetDuctIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSDuct& GetDuct(size_t index) const; + TIGL_EXPORT virtual CCPACSDuct& GetDuct(size_t index); + + TIGL_EXPORT virtual const CCPACSDuct& GetDuct(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSDuct& GetDuct(const std::string& UID); + TIGL_EXPORT virtual const std::vector>& GetDuctAssemblys() const; TIGL_EXPORT virtual std::vector>& GetDuctAssemblys(); + TIGL_EXPORT virtual size_t GetDuctAssemblyCount() const; + TIGL_EXPORT virtual size_t GetDuctAssemblyIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSDuctAssembly& GetDuctAssembly(size_t index) const; + TIGL_EXPORT virtual CCPACSDuctAssembly& GetDuctAssembly(size_t index); + + TIGL_EXPORT virtual const CCPACSDuctAssembly& GetDuctAssembly(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSDuctAssembly& GetDuctAssembly(const std::string& UID); + TIGL_EXPORT virtual CCPACSDuct& AddDuct(); TIGL_EXPORT virtual void RemoveDuct(CCPACSDuct& ref); diff --git a/src/generated/CPACSEngine.cpp b/src/generated/CPACSEngine.cpp index f82d6f04ac..39fe4eb2de 100644 --- a/src/generated/CPACSEngine.cpp +++ b/src/generated/CPACSEngine.cpp @@ -16,8 +16,8 @@ // limitations under the License. #include -#include "CCPACSEngines.h" #include "CPACSEngine.h" +#include "CPACSEngines.h" #include "CTiglError.h" #include "CTiglLogging.h" #include "CTiglUIDManager.h" @@ -27,7 +27,7 @@ namespace tigl { namespace generated { - CPACSEngine::CPACSEngine(CCPACSEngines* parent, CTiglUIDManager* uidMgr) + CPACSEngine::CPACSEngine(CPACSEngines* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { //assert(parent != NULL); @@ -39,12 +39,12 @@ namespace generated if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID); } - const CCPACSEngines* CPACSEngine::GetParent() const + const CPACSEngines* CPACSEngine::GetParent() const { return m_parent; } - CCPACSEngines* CPACSEngine::GetParent() + CPACSEngines* CPACSEngine::GetParent() { return m_parent; } diff --git a/src/generated/CPACSEngine.h b/src/generated/CPACSEngine.h index b92b7824d2..35c06b52d8 100644 --- a/src/generated/CPACSEngine.h +++ b/src/generated/CPACSEngine.h @@ -29,10 +29,11 @@ namespace tigl { class CTiglUIDManager; -class CCPACSEngines; namespace generated { + class CPACSEngines; + // This class is used in: // CPACSEngines @@ -43,13 +44,13 @@ namespace generated class CPACSEngine : public CTiglReqUIDObject { public: - TIGL_EXPORT CPACSEngine(CCPACSEngines* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSEngine(CPACSEngines* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSEngine(); - TIGL_EXPORT CCPACSEngines* GetParent(); + TIGL_EXPORT CPACSEngines* GetParent(); - TIGL_EXPORT const CCPACSEngines* GetParent() const; + TIGL_EXPORT const CPACSEngines* GetParent() const; TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -79,7 +80,7 @@ namespace generated TIGL_EXPORT virtual void RemoveNacelle(); protected: - CCPACSEngines* m_parent; + CPACSEngines* m_parent; CTiglUIDManager* m_uidMgr; @@ -107,4 +108,5 @@ namespace generated // Aliases in tigl namespace using CCPACSEngine = generated::CPACSEngine; +using CCPACSEngines = generated::CPACSEngines; } // namespace tigl diff --git a/src/generated/CPACSEnginePositions.cpp b/src/generated/CPACSEnginePositions.cpp index 00a1d8242e..584e4c57b8 100644 --- a/src/generated/CPACSEnginePositions.cpp +++ b/src/generated/CPACSEnginePositions.cpp @@ -118,6 +118,59 @@ namespace generated return m_engines; } + size_t CPACSEnginePositions::GetEngineCount() const + { + return m_engines.size(); + } + + size_t CPACSEnginePositions::GetEngineIndex(const std::string& UID) const + { + for (size_t i=0; i < GetEngineCount(); i++) { + const std::string tmpUID(m_engines[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSEnginePositions::GetEngineIndex", TIGL_UID_ERROR); + } + + CCPACSEnginePosition& CPACSEnginePositions::GetEngine(size_t index) + { + if (index < 1 || index > GetEngineCount()) { + throw CTiglError("Invalid index in std::vector>::GetEngine", TIGL_INDEX_ERROR); + } + index--; + return *m_engines[index]; + } + + const CCPACSEnginePosition& CPACSEnginePositions::GetEngine(size_t index) const + { + if (index < 1 || index > GetEngineCount()) { + throw CTiglError("Invalid index in std::vector>::GetEngine", TIGL_INDEX_ERROR); + } + index--; + return *m_engines[index]; + } + + CCPACSEnginePosition& CPACSEnginePositions::GetEngine(const std::string& UID) + { + for (auto& elem : m_engines ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSEnginePositions::GetEngine. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSEnginePosition& CPACSEnginePositions::GetEngine(const std::string& UID) const + { + for (auto& elem : m_engines ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSEnginePositions::GetEngine. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSEnginePosition& CPACSEnginePositions::AddEngine() { m_engines.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); diff --git a/src/generated/CPACSEnginePositions.h b/src/generated/CPACSEnginePositions.h index f499e50787..aa1895c86d 100644 --- a/src/generated/CPACSEnginePositions.h +++ b/src/generated/CPACSEnginePositions.h @@ -90,6 +90,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetEngines() const; TIGL_EXPORT virtual std::vector>& GetEngines(); + TIGL_EXPORT virtual size_t GetEngineCount() const; + TIGL_EXPORT virtual size_t GetEngineIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSEnginePosition& GetEngine(size_t index) const; + TIGL_EXPORT virtual CCPACSEnginePosition& GetEngine(size_t index); + + TIGL_EXPORT virtual const CCPACSEnginePosition& GetEngine(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSEnginePosition& GetEngine(const std::string& UID); + TIGL_EXPORT virtual CCPACSEnginePosition& AddEngine(); TIGL_EXPORT virtual void RemoveEngine(CCPACSEnginePosition& ref); diff --git a/src/generated/CPACSEnginePylon.cpp b/src/generated/CPACSEnginePylon.cpp index 4aa714f7b8..f962c05da5 100644 --- a/src/generated/CPACSEnginePylon.cpp +++ b/src/generated/CPACSEnginePylon.cpp @@ -16,8 +16,8 @@ // limitations under the License. #include -#include "CCPACSEnginePylons.h" #include "CPACSEnginePylon.h" +#include "CPACSEnginePylons.h" #include "CTiglError.h" #include "CTiglLogging.h" #include "CTiglUIDManager.h" @@ -27,7 +27,7 @@ namespace tigl { namespace generated { - CPACSEnginePylon::CPACSEnginePylon(CCPACSEnginePylons* parent, CTiglUIDManager* uidMgr) + CPACSEnginePylon::CPACSEnginePylon(CPACSEnginePylons* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) , m_transformation(reinterpret_cast(this), m_uidMgr) { @@ -43,12 +43,12 @@ namespace generated } } - const CCPACSEnginePylons* CPACSEnginePylon::GetParent() const + const CPACSEnginePylons* CPACSEnginePylon::GetParent() const { return m_parent; } - CCPACSEnginePylons* CPACSEnginePylon::GetParent() + CPACSEnginePylons* CPACSEnginePylon::GetParent() { return m_parent; } @@ -327,12 +327,12 @@ namespace generated return m_transformation; } - const boost::optional& CPACSEnginePylon::GetSections() const + const boost::optional& CPACSEnginePylon::GetSections() const { return m_sections; } - boost::optional& CPACSEnginePylon::GetSections() + boost::optional& CPACSEnginePylon::GetSections() { return m_sections; } @@ -357,7 +357,7 @@ namespace generated return m_positionings; } - CCPACSWingSections& CPACSEnginePylon::GetSections(CreateIfNotExistsTag) + CPACSWingSections& CPACSEnginePylon::GetSections(CreateIfNotExistsTag) { if (!m_sections) m_sections = boost::in_place(reinterpret_cast(this), m_uidMgr); diff --git a/src/generated/CPACSEnginePylon.h b/src/generated/CPACSEnginePylon.h index 9b8188f109..09b5c52dbc 100644 --- a/src/generated/CPACSEnginePylon.h +++ b/src/generated/CPACSEnginePylon.h @@ -21,11 +21,11 @@ #include #include #include -#include #include #include #include #include +#include "CPACSWingSections.h" #include "CreateIfNotExists.h" #include "CTiglUIDObject.h" #include "ITiglUIDRefObject.h" @@ -34,10 +34,11 @@ namespace tigl { class CTiglUIDManager; -class CCPACSEnginePylons; namespace generated { + class CPACSEnginePylons; + // This class is used in: // CPACSEnginePylons @@ -48,13 +49,13 @@ namespace generated class CPACSEnginePylon : public CTiglReqUIDObject, public ITiglUIDRefObject { public: - TIGL_EXPORT CPACSEnginePylon(CCPACSEnginePylons* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSEnginePylon(CPACSEnginePylons* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSEnginePylon(); - TIGL_EXPORT CCPACSEnginePylons* GetParent(); + TIGL_EXPORT CPACSEnginePylons* GetParent(); - TIGL_EXPORT const CCPACSEnginePylons* GetParent() const; + TIGL_EXPORT const CPACSEnginePylons* GetParent() const; TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -83,8 +84,8 @@ namespace generated TIGL_EXPORT virtual const CCPACSTransformation& GetTransformation() const; TIGL_EXPORT virtual CCPACSTransformation& GetTransformation(); - TIGL_EXPORT virtual const boost::optional& GetSections() const; - TIGL_EXPORT virtual boost::optional& GetSections(); + TIGL_EXPORT virtual const boost::optional& GetSections() const; + TIGL_EXPORT virtual boost::optional& GetSections(); TIGL_EXPORT virtual const boost::optional& GetSegments() const; TIGL_EXPORT virtual boost::optional& GetSegments(); @@ -92,7 +93,7 @@ namespace generated TIGL_EXPORT virtual const boost::optional& GetPositionings() const; TIGL_EXPORT virtual boost::optional& GetPositionings(); - TIGL_EXPORT virtual CCPACSWingSections& GetSections(CreateIfNotExistsTag); + TIGL_EXPORT virtual CPACSWingSections& GetSections(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveSections(); TIGL_EXPORT virtual CCPACSWingSegments& GetSegments(CreateIfNotExistsTag); @@ -102,7 +103,7 @@ namespace generated TIGL_EXPORT virtual void RemovePositionings(); protected: - CCPACSEnginePylons* m_parent; + CPACSEnginePylons* m_parent; CTiglUIDManager* m_uidMgr; @@ -122,7 +123,7 @@ namespace generated CCPACSTransformation m_transformation; - boost::optional m_sections; + boost::optional m_sections; boost::optional m_segments; @@ -141,4 +142,7 @@ namespace generated } // namespace generated // CPACSEnginePylon is customized, use type CCPACSEnginePylon directly + +// Aliases in tigl namespace +using CCPACSEnginePylons = generated::CPACSEnginePylons; } // namespace tigl diff --git a/src/generated/CPACSEnginePylons.cpp b/src/generated/CPACSEnginePylons.cpp index 34d76c4fc0..35ae46643c 100644 --- a/src/generated/CPACSEnginePylons.cpp +++ b/src/generated/CPACSEnginePylons.cpp @@ -80,7 +80,7 @@ namespace generated { // read element enginePylon if (tixi::TixiCheckElement(tixiHandle, xpath + "/enginePylon")) { - tixi::TixiReadElements(tixiHandle, xpath + "/enginePylon", m_enginePylons, 1, tixi::xsdUnbounded, reinterpret_cast(this), m_uidMgr); + tixi::TixiReadElements(tixiHandle, xpath + "/enginePylon", m_enginePylons, 1, tixi::xsdUnbounded, this, m_uidMgr); } } @@ -102,9 +102,62 @@ namespace generated return m_enginePylons; } + size_t CPACSEnginePylons::GetEnginePylonCount() const + { + return m_enginePylons.size(); + } + + size_t CPACSEnginePylons::GetEnginePylonIndex(const std::string& UID) const + { + for (size_t i=0; i < GetEnginePylonCount(); i++) { + const std::string tmpUID(m_enginePylons[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSEnginePylons::GetEnginePylonIndex", TIGL_UID_ERROR); + } + + CCPACSEnginePylon& CPACSEnginePylons::GetEnginePylon(size_t index) + { + if (index < 1 || index > GetEnginePylonCount()) { + throw CTiglError("Invalid index in std::vector>::GetEnginePylon", TIGL_INDEX_ERROR); + } + index--; + return *m_enginePylons[index]; + } + + const CCPACSEnginePylon& CPACSEnginePylons::GetEnginePylon(size_t index) const + { + if (index < 1 || index > GetEnginePylonCount()) { + throw CTiglError("Invalid index in std::vector>::GetEnginePylon", TIGL_INDEX_ERROR); + } + index--; + return *m_enginePylons[index]; + } + + CCPACSEnginePylon& CPACSEnginePylons::GetEnginePylon(const std::string& UID) + { + for (auto& elem : m_enginePylons ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSEnginePylons::GetEnginePylon. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSEnginePylon& CPACSEnginePylons::GetEnginePylon(const std::string& UID) const + { + for (auto& elem : m_enginePylons ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSEnginePylons::GetEnginePylon. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSEnginePylon& CPACSEnginePylons::AddEnginePylon() { - m_enginePylons.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); + m_enginePylons.push_back(make_unique(this, m_uidMgr)); return *m_enginePylons.back(); } diff --git a/src/generated/CPACSEnginePylons.h b/src/generated/CPACSEnginePylons.h index 9689001087..3a2d7dc989 100644 --- a/src/generated/CPACSEnginePylons.h +++ b/src/generated/CPACSEnginePylons.h @@ -62,6 +62,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetEnginePylons() const; TIGL_EXPORT virtual std::vector>& GetEnginePylons(); + TIGL_EXPORT virtual size_t GetEnginePylonCount() const; + TIGL_EXPORT virtual size_t GetEnginePylonIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSEnginePylon& GetEnginePylon(size_t index) const; + TIGL_EXPORT virtual CCPACSEnginePylon& GetEnginePylon(size_t index); + + TIGL_EXPORT virtual const CCPACSEnginePylon& GetEnginePylon(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSEnginePylon& GetEnginePylon(const std::string& UID); + TIGL_EXPORT virtual CCPACSEnginePylon& AddEnginePylon(); TIGL_EXPORT virtual void RemoveEnginePylon(CCPACSEnginePylon& ref); @@ -81,5 +90,6 @@ namespace generated }; } // namespace generated -// CPACSEnginePylons is customized, use type CCPACSEnginePylons directly +// Aliases in tigl namespace +using CCPACSEnginePylons = generated::CPACSEnginePylons; } // namespace tigl diff --git a/src/generated/CPACSEngines.cpp b/src/generated/CPACSEngines.cpp index 7ee4ea3882..632b2b16a3 100644 --- a/src/generated/CPACSEngines.cpp +++ b/src/generated/CPACSEngines.cpp @@ -86,7 +86,7 @@ namespace generated { // read element engine if (tixi::TixiCheckElement(tixiHandle, xpath + "/engine")) { - tixi::TixiReadElements(tixiHandle, xpath + "/engine", m_engines, 1, tixi::xsdUnbounded, reinterpret_cast(this), m_uidMgr); + tixi::TixiReadElements(tixiHandle, xpath + "/engine", m_engines, 1, tixi::xsdUnbounded, this, m_uidMgr); } } @@ -108,9 +108,62 @@ namespace generated return m_engines; } + size_t CPACSEngines::GetEngineCount() const + { + return m_engines.size(); + } + + size_t CPACSEngines::GetEngineIndex(const std::string& UID) const + { + for (size_t i=0; i < GetEngineCount(); i++) { + const std::string tmpUID(m_engines[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSEngines::GetEngineIndex", TIGL_UID_ERROR); + } + + CPACSEngine& CPACSEngines::GetEngine(size_t index) + { + if (index < 1 || index > GetEngineCount()) { + throw CTiglError("Invalid index in std::vector>::GetEngine", TIGL_INDEX_ERROR); + } + index--; + return *m_engines[index]; + } + + const CPACSEngine& CPACSEngines::GetEngine(size_t index) const + { + if (index < 1 || index > GetEngineCount()) { + throw CTiglError("Invalid index in std::vector>::GetEngine", TIGL_INDEX_ERROR); + } + index--; + return *m_engines[index]; + } + + CPACSEngine& CPACSEngines::GetEngine(const std::string& UID) + { + for (auto& elem : m_engines ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSEngines::GetEngine. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CPACSEngine& CPACSEngines::GetEngine(const std::string& UID) const + { + for (auto& elem : m_engines ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSEngines::GetEngine. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CPACSEngine& CPACSEngines::AddEngine() { - m_engines.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); + m_engines.push_back(make_unique(this, m_uidMgr)); return *m_engines.back(); } diff --git a/src/generated/CPACSEngines.h b/src/generated/CPACSEngines.h index 09e13cd058..a709d97e99 100644 --- a/src/generated/CPACSEngines.h +++ b/src/generated/CPACSEngines.h @@ -63,6 +63,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetEngines() const; TIGL_EXPORT virtual std::vector>& GetEngines(); + TIGL_EXPORT virtual size_t GetEngineCount() const; + TIGL_EXPORT virtual size_t GetEngineIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CPACSEngine& GetEngine(size_t index) const; + TIGL_EXPORT virtual CPACSEngine& GetEngine(size_t index); + + TIGL_EXPORT virtual const CPACSEngine& GetEngine(const std::string& UID) const; + TIGL_EXPORT virtual CPACSEngine& GetEngine(const std::string& UID); + TIGL_EXPORT virtual CPACSEngine& AddEngine(); TIGL_EXPORT virtual void RemoveEngine(CPACSEngine& ref); @@ -82,9 +91,8 @@ namespace generated }; } // namespace generated -// CPACSEngines is customized, use type CCPACSEngines directly - // Aliases in tigl namespace +using CCPACSEngines = generated::CPACSEngines; using CCPACSEngine = generated::CPACSEngine; using CCPACSVehicles = generated::CPACSVehicles; } // namespace tigl diff --git a/src/generated/CPACSFlightPoints.cpp b/src/generated/CPACSFlightPoints.cpp index 855c5e85aa..21cbe4d294 100644 --- a/src/generated/CPACSFlightPoints.cpp +++ b/src/generated/CPACSFlightPoints.cpp @@ -108,6 +108,59 @@ namespace generated return m_flightPoints; } + size_t CPACSFlightPoints::GetFlightPointCount() const + { + return m_flightPoints.size(); + } + + size_t CPACSFlightPoints::GetFlightPointIndex(const std::string& UID) const + { + for (size_t i=0; i < GetFlightPointCount(); i++) { + const std::string tmpUID(m_flightPoints[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSFlightPoints::GetFlightPointIndex", TIGL_UID_ERROR); + } + + CPACSGlobalFlightPoint& CPACSFlightPoints::GetFlightPoint(size_t index) + { + if (index < 1 || index > GetFlightPointCount()) { + throw CTiglError("Invalid index in std::vector>::GetFlightPoint", TIGL_INDEX_ERROR); + } + index--; + return *m_flightPoints[index]; + } + + const CPACSGlobalFlightPoint& CPACSFlightPoints::GetFlightPoint(size_t index) const + { + if (index < 1 || index > GetFlightPointCount()) { + throw CTiglError("Invalid index in std::vector>::GetFlightPoint", TIGL_INDEX_ERROR); + } + index--; + return *m_flightPoints[index]; + } + + CPACSGlobalFlightPoint& CPACSFlightPoints::GetFlightPoint(const std::string& UID) + { + for (auto& elem : m_flightPoints ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSFlightPoints::GetFlightPoint. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CPACSGlobalFlightPoint& CPACSFlightPoints::GetFlightPoint(const std::string& UID) const + { + for (auto& elem : m_flightPoints ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSFlightPoints::GetFlightPoint. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CPACSGlobalFlightPoint& CPACSFlightPoints::AddFlightPoint() { m_flightPoints.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSFlightPoints.h b/src/generated/CPACSFlightPoints.h index fa3b9c4907..f951a6f75e 100644 --- a/src/generated/CPACSFlightPoints.h +++ b/src/generated/CPACSFlightPoints.h @@ -63,6 +63,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetFlightPoints() const; TIGL_EXPORT virtual std::vector>& GetFlightPoints(); + TIGL_EXPORT virtual size_t GetFlightPointCount() const; + TIGL_EXPORT virtual size_t GetFlightPointIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CPACSGlobalFlightPoint& GetFlightPoint(size_t index) const; + TIGL_EXPORT virtual CPACSGlobalFlightPoint& GetFlightPoint(size_t index); + + TIGL_EXPORT virtual const CPACSGlobalFlightPoint& GetFlightPoint(const std::string& UID) const; + TIGL_EXPORT virtual CPACSGlobalFlightPoint& GetFlightPoint(const std::string& UID); + TIGL_EXPORT virtual CPACSGlobalFlightPoint& AddFlightPoint(); TIGL_EXPORT virtual void RemoveFlightPoint(CPACSGlobalFlightPoint& ref); diff --git a/src/generated/CPACSFrame.cpp b/src/generated/CPACSFrame.cpp index bce38bbaf3..76ae665160 100644 --- a/src/generated/CPACSFrame.cpp +++ b/src/generated/CPACSFrame.cpp @@ -141,6 +141,59 @@ namespace generated return m_framePositions; } + size_t CPACSFrame::GetFramePositionCount() const + { + return m_framePositions.size(); + } + + size_t CPACSFrame::GetFramePositionIndex(const std::string& UID) const + { + for (size_t i=0; i < GetFramePositionCount(); i++) { + const std::string tmpUID(m_framePositions[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSFrame::GetFramePositionIndex", TIGL_UID_ERROR); + } + + CCPACSFuselageStringerFramePosition& CPACSFrame::GetFramePosition(size_t index) + { + if (index < 1 || index > GetFramePositionCount()) { + throw CTiglError("Invalid index in std::vector>::GetFramePosition", TIGL_INDEX_ERROR); + } + index--; + return *m_framePositions[index]; + } + + const CCPACSFuselageStringerFramePosition& CPACSFrame::GetFramePosition(size_t index) const + { + if (index < 1 || index > GetFramePositionCount()) { + throw CTiglError("Invalid index in std::vector>::GetFramePosition", TIGL_INDEX_ERROR); + } + index--; + return *m_framePositions[index]; + } + + CCPACSFuselageStringerFramePosition& CPACSFrame::GetFramePosition(const std::string& UID) + { + for (auto& elem : m_framePositions ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSFrame::GetFramePosition. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSFuselageStringerFramePosition& CPACSFrame::GetFramePosition(const std::string& UID) const + { + for (auto& elem : m_framePositions ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSFrame::GetFramePosition. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSFuselageStringerFramePosition& CPACSFrame::AddFramePosition() { m_framePositions.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); diff --git a/src/generated/CPACSFrame.h b/src/generated/CPACSFrame.h index a9530f8f2a..05438c8738 100644 --- a/src/generated/CPACSFrame.h +++ b/src/generated/CPACSFrame.h @@ -65,6 +65,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetFramePositions() const; TIGL_EXPORT virtual std::vector>& GetFramePositions(); + TIGL_EXPORT virtual size_t GetFramePositionCount() const; + TIGL_EXPORT virtual size_t GetFramePositionIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSFuselageStringerFramePosition& GetFramePosition(size_t index) const; + TIGL_EXPORT virtual CCPACSFuselageStringerFramePosition& GetFramePosition(size_t index); + + TIGL_EXPORT virtual const CCPACSFuselageStringerFramePosition& GetFramePosition(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSFuselageStringerFramePosition& GetFramePosition(const std::string& UID); + TIGL_EXPORT virtual CCPACSFuselageStringerFramePosition& AddFramePosition(); TIGL_EXPORT virtual void RemoveFramePosition(CCPACSFuselageStringerFramePosition& ref); diff --git a/src/generated/CPACSFramesAssembly.cpp b/src/generated/CPACSFramesAssembly.cpp index 2a642d0f5d..7b409a8e35 100644 --- a/src/generated/CPACSFramesAssembly.cpp +++ b/src/generated/CPACSFramesAssembly.cpp @@ -133,6 +133,59 @@ namespace generated return m_frames; } + size_t CPACSFramesAssembly::GetFrameCount() const + { + return m_frames.size(); + } + + size_t CPACSFramesAssembly::GetFrameIndex(const std::string& UID) const + { + for (size_t i=0; i < GetFrameCount(); i++) { + const std::string tmpUID(m_frames[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSFramesAssembly::GetFrameIndex", TIGL_UID_ERROR); + } + + CCPACSFrame& CPACSFramesAssembly::GetFrame(size_t index) + { + if (index < 1 || index > GetFrameCount()) { + throw CTiglError("Invalid index in std::vector>::GetFrame", TIGL_INDEX_ERROR); + } + index--; + return *m_frames[index]; + } + + const CCPACSFrame& CPACSFramesAssembly::GetFrame(size_t index) const + { + if (index < 1 || index > GetFrameCount()) { + throw CTiglError("Invalid index in std::vector>::GetFrame", TIGL_INDEX_ERROR); + } + index--; + return *m_frames[index]; + } + + CCPACSFrame& CPACSFramesAssembly::GetFrame(const std::string& UID) + { + for (auto& elem : m_frames ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSFramesAssembly::GetFrame. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSFrame& CPACSFramesAssembly::GetFrame(const std::string& UID) const + { + for (auto& elem : m_frames ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSFramesAssembly::GetFrame. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSFrame& CPACSFramesAssembly::AddFrame() { m_frames.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); diff --git a/src/generated/CPACSFramesAssembly.h b/src/generated/CPACSFramesAssembly.h index 2849ea2669..eca8ee6503 100644 --- a/src/generated/CPACSFramesAssembly.h +++ b/src/generated/CPACSFramesAssembly.h @@ -92,6 +92,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetFrames() const; TIGL_EXPORT virtual std::vector>& GetFrames(); + TIGL_EXPORT virtual size_t GetFrameCount() const; + TIGL_EXPORT virtual size_t GetFrameIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSFrame& GetFrame(size_t index) const; + TIGL_EXPORT virtual CCPACSFrame& GetFrame(size_t index); + + TIGL_EXPORT virtual const CCPACSFrame& GetFrame(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSFrame& GetFrame(const std::string& UID); + TIGL_EXPORT virtual CCPACSFrame& AddFrame(); TIGL_EXPORT virtual void RemoveFrame(CCPACSFrame& ref); diff --git a/src/generated/CPACSFuelTank.cpp b/src/generated/CPACSFuelTank.cpp index 9285bb4510..612afbb2b3 100644 --- a/src/generated/CPACSFuelTank.cpp +++ b/src/generated/CPACSFuelTank.cpp @@ -16,8 +16,8 @@ // limitations under the License. #include -#include "CCPACSFuelTanks.h" #include "CPACSFuelTank.h" +#include "CPACSFuelTanks.h" #include "CTiglError.h" #include "CTiglLogging.h" #include "CTiglUIDManager.h" @@ -27,7 +27,7 @@ namespace tigl { namespace generated { - CPACSFuelTank::CPACSFuelTank(CCPACSFuelTanks* parent, CTiglUIDManager* uidMgr) + CPACSFuelTank::CPACSFuelTank(CPACSFuelTanks* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) , m_transformation(reinterpret_cast(this), m_uidMgr) , m_vessels(reinterpret_cast(this), m_uidMgr) @@ -44,12 +44,12 @@ namespace generated } } - const CCPACSFuelTanks* CPACSFuelTank::GetParent() const + const CPACSFuelTanks* CPACSFuelTank::GetParent() const { return m_parent; } - CCPACSFuelTanks* CPACSFuelTank::GetParent() + CPACSFuelTanks* CPACSFuelTank::GetParent() { return m_parent; } @@ -276,12 +276,12 @@ namespace generated return m_transformation; } - const CCPACSVessels& CPACSFuelTank::GetVessels() const + const CPACSVessels& CPACSFuelTank::GetVessels() const { return m_vessels; } - CCPACSVessels& CPACSFuelTank::GetVessels() + CPACSVessels& CPACSFuelTank::GetVessels() { return m_vessels; } diff --git a/src/generated/CPACSFuelTank.h b/src/generated/CPACSFuelTank.h index a49fd649eb..edb2362a8c 100644 --- a/src/generated/CPACSFuelTank.h +++ b/src/generated/CPACSFuelTank.h @@ -20,10 +20,10 @@ #include #include #include -#include #include #include #include +#include "CPACSVessels.h" #include "CTiglUIDObject.h" #include "ITiglUIDRefObject.h" #include "tigl_internal.h" @@ -31,10 +31,11 @@ namespace tigl { class CTiglUIDManager; -class CCPACSFuelTanks; namespace generated { + class CPACSFuelTanks; + // This class is used in: // CPACSFuelTanks @@ -44,13 +45,13 @@ namespace generated class CPACSFuelTank : public CTiglReqUIDObject, public ITiglUIDRefObject { public: - TIGL_EXPORT CPACSFuelTank(CCPACSFuelTanks* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSFuelTank(CPACSFuelTanks* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSFuelTank(); - TIGL_EXPORT CCPACSFuelTanks* GetParent(); + TIGL_EXPORT CPACSFuelTanks* GetParent(); - TIGL_EXPORT const CCPACSFuelTanks* GetParent() const; + TIGL_EXPORT const CPACSFuelTanks* GetParent() const; TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -79,11 +80,11 @@ namespace generated TIGL_EXPORT virtual const CCPACSTransformation& GetTransformation() const; TIGL_EXPORT virtual CCPACSTransformation& GetTransformation(); - TIGL_EXPORT virtual const CCPACSVessels& GetVessels() const; - TIGL_EXPORT virtual CCPACSVessels& GetVessels(); + TIGL_EXPORT virtual const CPACSVessels& GetVessels() const; + TIGL_EXPORT virtual CPACSVessels& GetVessels(); protected: - CCPACSFuelTanks* m_parent; + CPACSFuelTanks* m_parent; CTiglUIDManager* m_uidMgr; @@ -102,7 +103,7 @@ namespace generated CCPACSTransformation m_transformation; - CCPACSVessels m_vessels; + CPACSVessels m_vessels; private: TIGL_EXPORT const CTiglUIDObject* GetNextUIDObject() const final; @@ -117,4 +118,7 @@ namespace generated } // namespace generated // CPACSFuelTank is customized, use type CCPACSFuelTank directly + +// Aliases in tigl namespace +using CCPACSFuelTanks = generated::CPACSFuelTanks; } // namespace tigl diff --git a/src/generated/CPACSFuelTanks.cpp b/src/generated/CPACSFuelTanks.cpp index 32000d55a3..247d1d25bd 100644 --- a/src/generated/CPACSFuelTanks.cpp +++ b/src/generated/CPACSFuelTanks.cpp @@ -80,7 +80,7 @@ namespace generated { // read element fuelTank if (tixi::TixiCheckElement(tixiHandle, xpath + "/fuelTank")) { - tixi::TixiReadElements(tixiHandle, xpath + "/fuelTank", m_fuelTanks, 1, tixi::xsdUnbounded, reinterpret_cast(this), m_uidMgr); + tixi::TixiReadElements(tixiHandle, xpath + "/fuelTank", m_fuelTanks, 1, tixi::xsdUnbounded, this, m_uidMgr); } } @@ -102,9 +102,62 @@ namespace generated return m_fuelTanks; } + size_t CPACSFuelTanks::GetFuelTankCount() const + { + return m_fuelTanks.size(); + } + + size_t CPACSFuelTanks::GetFuelTankIndex(const std::string& UID) const + { + for (size_t i=0; i < GetFuelTankCount(); i++) { + const std::string tmpUID(m_fuelTanks[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSFuelTanks::GetFuelTankIndex", TIGL_UID_ERROR); + } + + CCPACSFuelTank& CPACSFuelTanks::GetFuelTank(size_t index) + { + if (index < 1 || index > GetFuelTankCount()) { + throw CTiglError("Invalid index in std::vector>::GetFuelTank", TIGL_INDEX_ERROR); + } + index--; + return *m_fuelTanks[index]; + } + + const CCPACSFuelTank& CPACSFuelTanks::GetFuelTank(size_t index) const + { + if (index < 1 || index > GetFuelTankCount()) { + throw CTiglError("Invalid index in std::vector>::GetFuelTank", TIGL_INDEX_ERROR); + } + index--; + return *m_fuelTanks[index]; + } + + CCPACSFuelTank& CPACSFuelTanks::GetFuelTank(const std::string& UID) + { + for (auto& elem : m_fuelTanks ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSFuelTanks::GetFuelTank. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSFuelTank& CPACSFuelTanks::GetFuelTank(const std::string& UID) const + { + for (auto& elem : m_fuelTanks ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSFuelTanks::GetFuelTank. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSFuelTank& CPACSFuelTanks::AddFuelTank() { - m_fuelTanks.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); + m_fuelTanks.push_back(make_unique(this, m_uidMgr)); return *m_fuelTanks.back(); } diff --git a/src/generated/CPACSFuelTanks.h b/src/generated/CPACSFuelTanks.h index 27161a2d34..58adcb34e6 100644 --- a/src/generated/CPACSFuelTanks.h +++ b/src/generated/CPACSFuelTanks.h @@ -62,6 +62,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetFuelTanks() const; TIGL_EXPORT virtual std::vector>& GetFuelTanks(); + TIGL_EXPORT virtual size_t GetFuelTankCount() const; + TIGL_EXPORT virtual size_t GetFuelTankIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSFuelTank& GetFuelTank(size_t index) const; + TIGL_EXPORT virtual CCPACSFuelTank& GetFuelTank(size_t index); + + TIGL_EXPORT virtual const CCPACSFuelTank& GetFuelTank(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSFuelTank& GetFuelTank(const std::string& UID); + TIGL_EXPORT virtual CCPACSFuelTank& AddFuelTank(); TIGL_EXPORT virtual void RemoveFuelTank(CCPACSFuelTank& ref); @@ -81,5 +90,6 @@ namespace generated }; } // namespace generated -// CPACSFuelTanks is customized, use type CCPACSFuelTanks directly +// Aliases in tigl namespace +using CCPACSFuelTanks = generated::CPACSFuelTanks; } // namespace tigl diff --git a/src/generated/CPACSFuselage.cpp b/src/generated/CPACSFuselage.cpp index 0c4564c5d6..d610b6590d 100644 --- a/src/generated/CPACSFuselage.cpp +++ b/src/generated/CPACSFuselage.cpp @@ -16,8 +16,8 @@ // limitations under the License. #include -#include "CCPACSFuselages.h" #include "CPACSFuselage.h" +#include "CPACSFuselages.h" #include "CTiglError.h" #include "CTiglLogging.h" #include "CTiglUIDManager.h" @@ -27,7 +27,7 @@ namespace tigl { namespace generated { - CPACSFuselage::CPACSFuselage(CCPACSFuselages* parent, CTiglUIDManager* uidMgr) + CPACSFuselage::CPACSFuselage(CPACSFuselages* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) , m_transformation(reinterpret_cast(this), m_uidMgr) , m_sections(reinterpret_cast(this), m_uidMgr) @@ -45,12 +45,12 @@ namespace generated } } - const CCPACSFuselages* CPACSFuselage::GetParent() const + const CPACSFuselages* CPACSFuselage::GetParent() const { return m_parent; } - CCPACSFuselages* CPACSFuselage::GetParent() + CPACSFuselages* CPACSFuselage::GetParent() { return m_parent; } @@ -353,12 +353,12 @@ namespace generated return m_transformation; } - const CCPACSFuselageSections& CPACSFuselage::GetSections() const + const CPACSFuselageSections& CPACSFuselage::GetSections() const { return m_sections; } - CCPACSFuselageSections& CPACSFuselage::GetSections() + CPACSFuselageSections& CPACSFuselage::GetSections() { return m_sections; } diff --git a/src/generated/CPACSFuselage.h b/src/generated/CPACSFuselage.h index 5c2511248f..6d8ad4d21a 100644 --- a/src/generated/CPACSFuselage.h +++ b/src/generated/CPACSFuselage.h @@ -19,7 +19,6 @@ #include #include -#include #include #include #include @@ -28,6 +27,7 @@ #include #include #include "CPACSCompartments.h" +#include "CPACSFuselageSections.h" #include "CreateIfNotExists.h" #include "CTiglUIDObject.h" #include "ITiglUIDRefObject.h" @@ -36,10 +36,11 @@ namespace tigl { class CTiglUIDManager; -class CCPACSFuselages; namespace generated { + class CPACSFuselages; + // This class is used in: // CPACSFuselages @@ -52,13 +53,13 @@ namespace generated class CPACSFuselage : public CTiglReqUIDObject, public ITiglUIDRefObject { public: - TIGL_EXPORT CPACSFuselage(CCPACSFuselages* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSFuselage(CPACSFuselages* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSFuselage(); - TIGL_EXPORT CCPACSFuselages* GetParent(); + TIGL_EXPORT CPACSFuselages* GetParent(); - TIGL_EXPORT const CCPACSFuselages* GetParent() const; + TIGL_EXPORT const CPACSFuselages* GetParent() const; TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -87,8 +88,8 @@ namespace generated TIGL_EXPORT virtual const CCPACSTransformation& GetTransformation() const; TIGL_EXPORT virtual CCPACSTransformation& GetTransformation(); - TIGL_EXPORT virtual const CCPACSFuselageSections& GetSections() const; - TIGL_EXPORT virtual CCPACSFuselageSections& GetSections(); + TIGL_EXPORT virtual const CPACSFuselageSections& GetSections() const; + TIGL_EXPORT virtual CPACSFuselageSections& GetSections(); TIGL_EXPORT virtual const boost::optional& GetPositionings() const; TIGL_EXPORT virtual boost::optional& GetPositionings(); @@ -112,7 +113,7 @@ namespace generated TIGL_EXPORT virtual void RemoveCompartments(); protected: - CCPACSFuselages* m_parent; + CPACSFuselages* m_parent; CTiglUIDManager* m_uidMgr; @@ -132,7 +133,7 @@ namespace generated CCPACSTransformation m_transformation; - CCPACSFuselageSections m_sections; + CPACSFuselageSections m_sections; boost::optional m_positionings; @@ -155,4 +156,7 @@ namespace generated } // namespace generated // CPACSFuselage is customized, use type CCPACSFuselage directly + +// Aliases in tigl namespace +using CCPACSFuselages = generated::CPACSFuselages; } // namespace tigl diff --git a/src/generated/CPACSFuselageElements.cpp b/src/generated/CPACSFuselageElements.cpp index 3d97267f6b..a7ca35b3c5 100644 --- a/src/generated/CPACSFuselageElements.cpp +++ b/src/generated/CPACSFuselageElements.cpp @@ -102,6 +102,59 @@ namespace generated return m_elements; } + size_t CPACSFuselageElements::GetElementCount() const + { + return m_elements.size(); + } + + size_t CPACSFuselageElements::GetElementIndex(const std::string& UID) const + { + for (size_t i=0; i < GetElementCount(); i++) { + const std::string tmpUID(m_elements[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSFuselageElements::GetElementIndex", TIGL_UID_ERROR); + } + + CCPACSFuselageSectionElement& CPACSFuselageElements::GetElement(size_t index) + { + if (index < 1 || index > GetElementCount()) { + throw CTiglError("Invalid index in std::vector>::GetElement", TIGL_INDEX_ERROR); + } + index--; + return *m_elements[index]; + } + + const CCPACSFuselageSectionElement& CPACSFuselageElements::GetElement(size_t index) const + { + if (index < 1 || index > GetElementCount()) { + throw CTiglError("Invalid index in std::vector>::GetElement", TIGL_INDEX_ERROR); + } + index--; + return *m_elements[index]; + } + + CCPACSFuselageSectionElement& CPACSFuselageElements::GetElement(const std::string& UID) + { + for (auto& elem : m_elements ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSFuselageElements::GetElement. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSFuselageSectionElement& CPACSFuselageElements::GetElement(const std::string& UID) const + { + for (auto& elem : m_elements ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSFuselageElements::GetElement. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSFuselageSectionElement& CPACSFuselageElements::AddElement() { m_elements.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); diff --git a/src/generated/CPACSFuselageElements.h b/src/generated/CPACSFuselageElements.h index f22c7467c2..7d209d539a 100644 --- a/src/generated/CPACSFuselageElements.h +++ b/src/generated/CPACSFuselageElements.h @@ -63,6 +63,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetElements() const; TIGL_EXPORT virtual std::vector>& GetElements(); + TIGL_EXPORT virtual size_t GetElementCount() const; + TIGL_EXPORT virtual size_t GetElementIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSFuselageSectionElement& GetElement(size_t index) const; + TIGL_EXPORT virtual CCPACSFuselageSectionElement& GetElement(size_t index); + + TIGL_EXPORT virtual const CCPACSFuselageSectionElement& GetElement(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSFuselageSectionElement& GetElement(const std::string& UID); + TIGL_EXPORT virtual CCPACSFuselageSectionElement& AddElement(); TIGL_EXPORT virtual void RemoveElement(CCPACSFuselageSectionElement& ref); diff --git a/src/generated/CPACSFuselageProfiles.cpp b/src/generated/CPACSFuselageProfiles.cpp index d99f6ce4f5..0977320a9b 100644 --- a/src/generated/CPACSFuselageProfiles.cpp +++ b/src/generated/CPACSFuselageProfiles.cpp @@ -16,9 +16,9 @@ // limitations under the License. #include -#include "CCPACSProfiles.h" #include "CPACSFuselageProfiles.h" #include "CPACSProfileGeometry.h" +#include "CPACSProfiles.h" #include "CTiglError.h" #include "CTiglLogging.h" #include "CTiglUIDManager.h" @@ -29,7 +29,7 @@ namespace tigl { namespace generated { - CPACSFuselageProfiles::CPACSFuselageProfiles(CCPACSProfiles* parent, CTiglUIDManager* uidMgr) + CPACSFuselageProfiles::CPACSFuselageProfiles(CPACSProfiles* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { //assert(parent != NULL); @@ -40,12 +40,12 @@ namespace generated { } - const CCPACSProfiles* CPACSFuselageProfiles::GetParent() const + const CPACSProfiles* CPACSFuselageProfiles::GetParent() const { return m_parent; } - CCPACSProfiles* CPACSFuselageProfiles::GetParent() + CPACSProfiles* CPACSFuselageProfiles::GetParent() { return m_parent; } @@ -108,6 +108,59 @@ namespace generated return m_fuselageProfiles; } + size_t CPACSFuselageProfiles::GetFuselageProfileCount() const + { + return m_fuselageProfiles.size(); + } + + size_t CPACSFuselageProfiles::GetFuselageProfileIndex(const std::string& UID) const + { + for (size_t i=0; i < GetFuselageProfileCount(); i++) { + const std::string tmpUID(m_fuselageProfiles[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSFuselageProfiles::GetFuselageProfileIndex", TIGL_UID_ERROR); + } + + CPACSProfileGeometry& CPACSFuselageProfiles::GetFuselageProfile(size_t index) + { + if (index < 1 || index > GetFuselageProfileCount()) { + throw CTiglError("Invalid index in std::vector>::GetFuselageProfile", TIGL_INDEX_ERROR); + } + index--; + return *m_fuselageProfiles[index]; + } + + const CPACSProfileGeometry& CPACSFuselageProfiles::GetFuselageProfile(size_t index) const + { + if (index < 1 || index > GetFuselageProfileCount()) { + throw CTiglError("Invalid index in std::vector>::GetFuselageProfile", TIGL_INDEX_ERROR); + } + index--; + return *m_fuselageProfiles[index]; + } + + CPACSProfileGeometry& CPACSFuselageProfiles::GetFuselageProfile(const std::string& UID) + { + for (auto& elem : m_fuselageProfiles ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSFuselageProfiles::GetFuselageProfile. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CPACSProfileGeometry& CPACSFuselageProfiles::GetFuselageProfile(const std::string& UID) const + { + for (auto& elem : m_fuselageProfiles ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSFuselageProfiles::GetFuselageProfile. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CPACSProfileGeometry& CPACSFuselageProfiles::AddFuselageProfile() { m_fuselageProfiles.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); diff --git a/src/generated/CPACSFuselageProfiles.h b/src/generated/CPACSFuselageProfiles.h index de752ea09e..20a5ea348a 100644 --- a/src/generated/CPACSFuselageProfiles.h +++ b/src/generated/CPACSFuselageProfiles.h @@ -27,11 +27,11 @@ namespace tigl { class CTiglUIDManager; class CTiglUIDObject; -class CCPACSProfiles; namespace generated { class CPACSProfileGeometry; + class CPACSProfiles; // This class is used in: // CPACSProfiles @@ -44,13 +44,13 @@ namespace generated class CPACSFuselageProfiles { public: - TIGL_EXPORT CPACSFuselageProfiles(CCPACSProfiles* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSFuselageProfiles(CPACSProfiles* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSFuselageProfiles(); - TIGL_EXPORT CCPACSProfiles* GetParent(); + TIGL_EXPORT CPACSProfiles* GetParent(); - TIGL_EXPORT const CCPACSProfiles* GetParent() const; + TIGL_EXPORT const CPACSProfiles* GetParent() const; TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -64,11 +64,20 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetFuselageProfiles() const; TIGL_EXPORT virtual std::vector>& GetFuselageProfiles(); + TIGL_EXPORT virtual size_t GetFuselageProfileCount() const; + TIGL_EXPORT virtual size_t GetFuselageProfileIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CPACSProfileGeometry& GetFuselageProfile(size_t index) const; + TIGL_EXPORT virtual CPACSProfileGeometry& GetFuselageProfile(size_t index); + + TIGL_EXPORT virtual const CPACSProfileGeometry& GetFuselageProfile(const std::string& UID) const; + TIGL_EXPORT virtual CPACSProfileGeometry& GetFuselageProfile(const std::string& UID); + TIGL_EXPORT virtual CPACSProfileGeometry& AddFuselageProfile(); TIGL_EXPORT virtual void RemoveFuselageProfile(CPACSProfileGeometry& ref); protected: - CCPACSProfiles* m_parent; + CPACSProfiles* m_parent; CTiglUIDManager* m_uidMgr; @@ -87,4 +96,5 @@ namespace generated // Aliases in tigl namespace using CCPACSProfileGeometry = generated::CPACSProfileGeometry; +using CCPACSProfiles = generated::CPACSProfiles; } // namespace tigl diff --git a/src/generated/CPACSFuselageSection.cpp b/src/generated/CPACSFuselageSection.cpp index 12d5d8dcc5..bf1971488f 100644 --- a/src/generated/CPACSFuselageSection.cpp +++ b/src/generated/CPACSFuselageSection.cpp @@ -16,8 +16,8 @@ // limitations under the License. #include -#include "CCPACSFuselageSections.h" #include "CPACSFuselageSection.h" +#include "CPACSFuselageSections.h" #include "CTiglError.h" #include "CTiglLogging.h" #include "CTiglUIDManager.h" @@ -27,7 +27,7 @@ namespace tigl { namespace generated { - CPACSFuselageSection::CPACSFuselageSection(CCPACSFuselageSections* parent, CTiglUIDManager* uidMgr) + CPACSFuselageSection::CPACSFuselageSection(CPACSFuselageSections* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) , m_transformation(reinterpret_cast(this), m_uidMgr) , m_elements(reinterpret_cast(this), m_uidMgr) @@ -41,12 +41,12 @@ namespace generated if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID); } - const CCPACSFuselageSections* CPACSFuselageSection::GetParent() const + const CPACSFuselageSections* CPACSFuselageSection::GetParent() const { return m_parent; } - CCPACSFuselageSections* CPACSFuselageSection::GetParent() + CPACSFuselageSections* CPACSFuselageSection::GetParent() { return m_parent; } diff --git a/src/generated/CPACSFuselageSection.h b/src/generated/CPACSFuselageSection.h index b905663175..fcd2adfe08 100644 --- a/src/generated/CPACSFuselageSection.h +++ b/src/generated/CPACSFuselageSection.h @@ -29,10 +29,11 @@ namespace tigl { class CTiglUIDManager; -class CCPACSFuselageSections; namespace generated { + class CPACSFuselageSections; + // This class is used in: // CPACSFuselageSections @@ -44,13 +45,13 @@ namespace generated class CPACSFuselageSection : public CTiglReqUIDObject { public: - TIGL_EXPORT CPACSFuselageSection(CCPACSFuselageSections* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSFuselageSection(CPACSFuselageSections* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSFuselageSection(); - TIGL_EXPORT CCPACSFuselageSections* GetParent(); + TIGL_EXPORT CPACSFuselageSections* GetParent(); - TIGL_EXPORT const CCPACSFuselageSections* GetParent() const; + TIGL_EXPORT const CPACSFuselageSections* GetParent() const; TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -77,7 +78,7 @@ namespace generated TIGL_EXPORT virtual CCPACSFuselageSectionElements& GetElements(); protected: - CCPACSFuselageSections* m_parent; + CPACSFuselageSections* m_parent; CTiglUIDManager* m_uidMgr; @@ -103,4 +104,7 @@ namespace generated } // namespace generated // CPACSFuselageSection is customized, use type CCPACSFuselageSection directly + +// Aliases in tigl namespace +using CCPACSFuselageSections = generated::CPACSFuselageSections; } // namespace tigl diff --git a/src/generated/CPACSFuselageSections.cpp b/src/generated/CPACSFuselageSections.cpp index d01cd2b324..8c4abcaad3 100644 --- a/src/generated/CPACSFuselageSections.cpp +++ b/src/generated/CPACSFuselageSections.cpp @@ -111,7 +111,7 @@ namespace generated { // read element section if (tixi::TixiCheckElement(tixiHandle, xpath + "/section")) { - tixi::TixiReadElements(tixiHandle, xpath + "/section", m_sections, 2, tixi::xsdUnbounded, reinterpret_cast(this), m_uidMgr); + tixi::TixiReadElements(tixiHandle, xpath + "/section", m_sections, 2, tixi::xsdUnbounded, this, m_uidMgr); } } @@ -133,9 +133,62 @@ namespace generated return m_sections; } + size_t CPACSFuselageSections::GetSectionCount() const + { + return m_sections.size(); + } + + size_t CPACSFuselageSections::GetSectionIndex(const std::string& UID) const + { + for (size_t i=0; i < GetSectionCount(); i++) { + const std::string tmpUID(m_sections[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSFuselageSections::GetSectionIndex", TIGL_UID_ERROR); + } + + CCPACSFuselageSection& CPACSFuselageSections::GetSection(size_t index) + { + if (index < 1 || index > GetSectionCount()) { + throw CTiglError("Invalid index in std::vector>::GetSection", TIGL_INDEX_ERROR); + } + index--; + return *m_sections[index]; + } + + const CCPACSFuselageSection& CPACSFuselageSections::GetSection(size_t index) const + { + if (index < 1 || index > GetSectionCount()) { + throw CTiglError("Invalid index in std::vector>::GetSection", TIGL_INDEX_ERROR); + } + index--; + return *m_sections[index]; + } + + CCPACSFuselageSection& CPACSFuselageSections::GetSection(const std::string& UID) + { + for (auto& elem : m_sections ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSFuselageSections::GetSection. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSFuselageSection& CPACSFuselageSections::GetSection(const std::string& UID) const + { + for (auto& elem : m_sections ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSFuselageSections::GetSection. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSFuselageSection& CPACSFuselageSections::AddSection() { - m_sections.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); + m_sections.push_back(make_unique(this, m_uidMgr)); return *m_sections.back(); } diff --git a/src/generated/CPACSFuselageSections.h b/src/generated/CPACSFuselageSections.h index 72c5987fff..cae2418510 100644 --- a/src/generated/CPACSFuselageSections.h +++ b/src/generated/CPACSFuselageSections.h @@ -92,6 +92,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetSections() const; TIGL_EXPORT virtual std::vector>& GetSections(); + TIGL_EXPORT virtual size_t GetSectionCount() const; + TIGL_EXPORT virtual size_t GetSectionIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSFuselageSection& GetSection(size_t index) const; + TIGL_EXPORT virtual CCPACSFuselageSection& GetSection(size_t index); + + TIGL_EXPORT virtual const CCPACSFuselageSection& GetSection(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSFuselageSection& GetSection(const std::string& UID); + TIGL_EXPORT virtual CCPACSFuselageSection& AddSection(); TIGL_EXPORT virtual void RemoveSection(CCPACSFuselageSection& ref); @@ -112,5 +121,6 @@ namespace generated }; } // namespace generated -// CPACSFuselageSections is customized, use type CCPACSFuselageSections directly +// Aliases in tigl namespace +using CCPACSFuselageSections = generated::CPACSFuselageSections; } // namespace tigl diff --git a/src/generated/CPACSFuselageSegments.cpp b/src/generated/CPACSFuselageSegments.cpp index 07c5faeaa2..7b0808123c 100644 --- a/src/generated/CPACSFuselageSegments.cpp +++ b/src/generated/CPACSFuselageSegments.cpp @@ -133,6 +133,59 @@ namespace generated return m_segments; } + size_t CPACSFuselageSegments::GetSegmentCount() const + { + return m_segments.size(); + } + + size_t CPACSFuselageSegments::GetSegmentIndex(const std::string& UID) const + { + for (size_t i=0; i < GetSegmentCount(); i++) { + const std::string tmpUID(m_segments[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSFuselageSegments::GetSegmentIndex", TIGL_UID_ERROR); + } + + CCPACSFuselageSegment& CPACSFuselageSegments::GetSegment(size_t index) + { + if (index < 1 || index > GetSegmentCount()) { + throw CTiglError("Invalid index in std::vector>::GetSegment", TIGL_INDEX_ERROR); + } + index--; + return *m_segments[index]; + } + + const CCPACSFuselageSegment& CPACSFuselageSegments::GetSegment(size_t index) const + { + if (index < 1 || index > GetSegmentCount()) { + throw CTiglError("Invalid index in std::vector>::GetSegment", TIGL_INDEX_ERROR); + } + index--; + return *m_segments[index]; + } + + CCPACSFuselageSegment& CPACSFuselageSegments::GetSegment(const std::string& UID) + { + for (auto& elem : m_segments ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSFuselageSegments::GetSegment. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSFuselageSegment& CPACSFuselageSegments::GetSegment(const std::string& UID) const + { + for (auto& elem : m_segments ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSFuselageSegments::GetSegment. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSFuselageSegment& CPACSFuselageSegments::AddSegment() { m_segments.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); diff --git a/src/generated/CPACSFuselageSegments.h b/src/generated/CPACSFuselageSegments.h index 74a8a54dda..a3298bb657 100644 --- a/src/generated/CPACSFuselageSegments.h +++ b/src/generated/CPACSFuselageSegments.h @@ -93,6 +93,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetSegments() const; TIGL_EXPORT virtual std::vector>& GetSegments(); + TIGL_EXPORT virtual size_t GetSegmentCount() const; + TIGL_EXPORT virtual size_t GetSegmentIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSFuselageSegment& GetSegment(size_t index) const; + TIGL_EXPORT virtual CCPACSFuselageSegment& GetSegment(size_t index); + + TIGL_EXPORT virtual const CCPACSFuselageSegment& GetSegment(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSFuselageSegment& GetSegment(const std::string& UID); + TIGL_EXPORT virtual CCPACSFuselageSegment& AddSegment(); TIGL_EXPORT virtual void RemoveSegment(CCPACSFuselageSegment& ref); diff --git a/src/generated/CPACSFuselages.cpp b/src/generated/CPACSFuselages.cpp index d98996b046..a60ff2b0a9 100644 --- a/src/generated/CPACSFuselages.cpp +++ b/src/generated/CPACSFuselages.cpp @@ -96,7 +96,7 @@ namespace generated { // read element fuselage if (tixi::TixiCheckElement(tixiHandle, xpath + "/fuselage")) { - tixi::TixiReadElements(tixiHandle, xpath + "/fuselage", m_fuselages, 1, tixi::xsdUnbounded, reinterpret_cast(this), m_uidMgr); + tixi::TixiReadElements(tixiHandle, xpath + "/fuselage", m_fuselages, 1, tixi::xsdUnbounded, this, m_uidMgr); } } @@ -118,9 +118,62 @@ namespace generated return m_fuselages; } + size_t CPACSFuselages::GetFuselageCount() const + { + return m_fuselages.size(); + } + + size_t CPACSFuselages::GetFuselageIndex(const std::string& UID) const + { + for (size_t i=0; i < GetFuselageCount(); i++) { + const std::string tmpUID(m_fuselages[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSFuselages::GetFuselageIndex", TIGL_UID_ERROR); + } + + CCPACSFuselage& CPACSFuselages::GetFuselage(size_t index) + { + if (index < 1 || index > GetFuselageCount()) { + throw CTiglError("Invalid index in std::vector>::GetFuselage", TIGL_INDEX_ERROR); + } + index--; + return *m_fuselages[index]; + } + + const CCPACSFuselage& CPACSFuselages::GetFuselage(size_t index) const + { + if (index < 1 || index > GetFuselageCount()) { + throw CTiglError("Invalid index in std::vector>::GetFuselage", TIGL_INDEX_ERROR); + } + index--; + return *m_fuselages[index]; + } + + CCPACSFuselage& CPACSFuselages::GetFuselage(const std::string& UID) + { + for (auto& elem : m_fuselages ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSFuselages::GetFuselage. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSFuselage& CPACSFuselages::GetFuselage(const std::string& UID) const + { + for (auto& elem : m_fuselages ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSFuselages::GetFuselage. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSFuselage& CPACSFuselages::AddFuselage() { - m_fuselages.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); + m_fuselages.push_back(make_unique(this, m_uidMgr)); return *m_fuselages.back(); } diff --git a/src/generated/CPACSFuselages.h b/src/generated/CPACSFuselages.h index 659719febd..4c5fa6bfb7 100644 --- a/src/generated/CPACSFuselages.h +++ b/src/generated/CPACSFuselages.h @@ -90,6 +90,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetFuselages() const; TIGL_EXPORT virtual std::vector>& GetFuselages(); + TIGL_EXPORT virtual size_t GetFuselageCount() const; + TIGL_EXPORT virtual size_t GetFuselageIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSFuselage& GetFuselage(size_t index) const; + TIGL_EXPORT virtual CCPACSFuselage& GetFuselage(size_t index); + + TIGL_EXPORT virtual const CCPACSFuselage& GetFuselage(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSFuselage& GetFuselage(const std::string& UID); + TIGL_EXPORT virtual CCPACSFuselage& AddFuselage(); TIGL_EXPORT virtual void RemoveFuselage(CCPACSFuselage& ref); @@ -110,5 +119,6 @@ namespace generated }; } // namespace generated -// CPACSFuselages is customized, use type CCPACSFuselages directly +// Aliases in tigl namespace +using CCPACSFuselages = generated::CPACSFuselages; } // namespace tigl diff --git a/src/generated/CPACSGalleyElements.cpp b/src/generated/CPACSGalleyElements.cpp index 3f5621037a..a90e9dabd9 100644 --- a/src/generated/CPACSGalleyElements.cpp +++ b/src/generated/CPACSGalleyElements.cpp @@ -108,6 +108,59 @@ namespace generated return m_galleyElements; } + size_t CPACSGalleyElements::GetGalleyElementCount() const + { + return m_galleyElements.size(); + } + + size_t CPACSGalleyElements::GetGalleyElementIndex(const std::string& UID) const + { + for (size_t i=0; i < GetGalleyElementCount(); i++) { + const std::string tmpUID(m_galleyElements[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSGalleyElements::GetGalleyElementIndex", TIGL_UID_ERROR); + } + + CPACSGalleyElement& CPACSGalleyElements::GetGalleyElement(size_t index) + { + if (index < 1 || index > GetGalleyElementCount()) { + throw CTiglError("Invalid index in std::vector>::GetGalleyElement", TIGL_INDEX_ERROR); + } + index--; + return *m_galleyElements[index]; + } + + const CPACSGalleyElement& CPACSGalleyElements::GetGalleyElement(size_t index) const + { + if (index < 1 || index > GetGalleyElementCount()) { + throw CTiglError("Invalid index in std::vector>::GetGalleyElement", TIGL_INDEX_ERROR); + } + index--; + return *m_galleyElements[index]; + } + + CPACSGalleyElement& CPACSGalleyElements::GetGalleyElement(const std::string& UID) + { + for (auto& elem : m_galleyElements ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSGalleyElements::GetGalleyElement. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CPACSGalleyElement& CPACSGalleyElements::GetGalleyElement(const std::string& UID) const + { + for (auto& elem : m_galleyElements ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSGalleyElements::GetGalleyElement. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CPACSGalleyElement& CPACSGalleyElements::AddGalleyElement() { m_galleyElements.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSGalleyElements.h b/src/generated/CPACSGalleyElements.h index bbae080711..39fc8e67aa 100644 --- a/src/generated/CPACSGalleyElements.h +++ b/src/generated/CPACSGalleyElements.h @@ -63,6 +63,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetGalleyElements() const; TIGL_EXPORT virtual std::vector>& GetGalleyElements(); + TIGL_EXPORT virtual size_t GetGalleyElementCount() const; + TIGL_EXPORT virtual size_t GetGalleyElementIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CPACSGalleyElement& GetGalleyElement(size_t index) const; + TIGL_EXPORT virtual CPACSGalleyElement& GetGalleyElement(size_t index); + + TIGL_EXPORT virtual const CPACSGalleyElement& GetGalleyElement(const std::string& UID) const; + TIGL_EXPORT virtual CPACSGalleyElement& GetGalleyElement(const std::string& UID); + TIGL_EXPORT virtual CPACSGalleyElement& AddGalleyElement(); TIGL_EXPORT virtual void RemoveGalleyElement(CPACSGalleyElement& ref); diff --git a/src/generated/CPACSGenericFloorElements.cpp b/src/generated/CPACSGenericFloorElements.cpp index 614fec5646..8f508f1f9d 100644 --- a/src/generated/CPACSGenericFloorElements.cpp +++ b/src/generated/CPACSGenericFloorElements.cpp @@ -108,6 +108,59 @@ namespace generated return m_genericFloorElements; } + size_t CPACSGenericFloorElements::GetGenericFloorElementCount() const + { + return m_genericFloorElements.size(); + } + + size_t CPACSGenericFloorElements::GetGenericFloorElementIndex(const std::string& UID) const + { + for (size_t i=0; i < GetGenericFloorElementCount(); i++) { + const std::string tmpUID(m_genericFloorElements[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSGenericFloorElements::GetGenericFloorElementIndex", TIGL_UID_ERROR); + } + + CPACSDeckElementBase& CPACSGenericFloorElements::GetGenericFloorElement(size_t index) + { + if (index < 1 || index > GetGenericFloorElementCount()) { + throw CTiglError("Invalid index in std::vector>::GetGenericFloorElement", TIGL_INDEX_ERROR); + } + index--; + return *m_genericFloorElements[index]; + } + + const CPACSDeckElementBase& CPACSGenericFloorElements::GetGenericFloorElement(size_t index) const + { + if (index < 1 || index > GetGenericFloorElementCount()) { + throw CTiglError("Invalid index in std::vector>::GetGenericFloorElement", TIGL_INDEX_ERROR); + } + index--; + return *m_genericFloorElements[index]; + } + + CPACSDeckElementBase& CPACSGenericFloorElements::GetGenericFloorElement(const std::string& UID) + { + for (auto& elem : m_genericFloorElements ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSGenericFloorElements::GetGenericFloorElement. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CPACSDeckElementBase& CPACSGenericFloorElements::GetGenericFloorElement(const std::string& UID) const + { + for (auto& elem : m_genericFloorElements ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSGenericFloorElements::GetGenericFloorElement. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CPACSDeckElementBase& CPACSGenericFloorElements::AddGenericFloorElement() { m_genericFloorElements.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSGenericFloorElements.h b/src/generated/CPACSGenericFloorElements.h index 192e3d820e..abe52090b3 100644 --- a/src/generated/CPACSGenericFloorElements.h +++ b/src/generated/CPACSGenericFloorElements.h @@ -63,6 +63,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetGenericFloorElements() const; TIGL_EXPORT virtual std::vector>& GetGenericFloorElements(); + TIGL_EXPORT virtual size_t GetGenericFloorElementCount() const; + TIGL_EXPORT virtual size_t GetGenericFloorElementIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CPACSDeckElementBase& GetGenericFloorElement(size_t index) const; + TIGL_EXPORT virtual CPACSDeckElementBase& GetGenericFloorElement(size_t index); + + TIGL_EXPORT virtual const CPACSDeckElementBase& GetGenericFloorElement(const std::string& UID) const; + TIGL_EXPORT virtual CPACSDeckElementBase& GetGenericFloorElement(const std::string& UID); + TIGL_EXPORT virtual CPACSDeckElementBase& AddGenericFloorElement(); TIGL_EXPORT virtual void RemoveGenericFloorElement(CPACSDeckElementBase& ref); diff --git a/src/generated/CPACSGenericGeometryComponents.cpp b/src/generated/CPACSGenericGeometryComponents.cpp index a145d1fd81..9fcf33f40e 100644 --- a/src/generated/CPACSGenericGeometryComponents.cpp +++ b/src/generated/CPACSGenericGeometryComponents.cpp @@ -102,6 +102,59 @@ namespace generated return m_genericGeometryComponents; } + size_t CPACSGenericGeometryComponents::GetGenericGeometryComponentCount() const + { + return m_genericGeometryComponents.size(); + } + + size_t CPACSGenericGeometryComponents::GetGenericGeometryComponentIndex(const std::string& UID) const + { + for (size_t i=0; i < GetGenericGeometryComponentCount(); i++) { + const std::string tmpUID(m_genericGeometryComponents[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSGenericGeometryComponents::GetGenericGeometryComponentIndex", TIGL_UID_ERROR); + } + + CCPACSExternalObject& CPACSGenericGeometryComponents::GetGenericGeometryComponent(size_t index) + { + if (index < 1 || index > GetGenericGeometryComponentCount()) { + throw CTiglError("Invalid index in std::vector>::GetGenericGeometryComponent", TIGL_INDEX_ERROR); + } + index--; + return *m_genericGeometryComponents[index]; + } + + const CCPACSExternalObject& CPACSGenericGeometryComponents::GetGenericGeometryComponent(size_t index) const + { + if (index < 1 || index > GetGenericGeometryComponentCount()) { + throw CTiglError("Invalid index in std::vector>::GetGenericGeometryComponent", TIGL_INDEX_ERROR); + } + index--; + return *m_genericGeometryComponents[index]; + } + + CCPACSExternalObject& CPACSGenericGeometryComponents::GetGenericGeometryComponent(const std::string& UID) + { + for (auto& elem : m_genericGeometryComponents ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSGenericGeometryComponents::GetGenericGeometryComponent. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSExternalObject& CPACSGenericGeometryComponents::GetGenericGeometryComponent(const std::string& UID) const + { + for (auto& elem : m_genericGeometryComponents ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSGenericGeometryComponents::GetGenericGeometryComponent. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSExternalObject& CPACSGenericGeometryComponents::AddGenericGeometryComponent() { m_genericGeometryComponents.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); diff --git a/src/generated/CPACSGenericGeometryComponents.h b/src/generated/CPACSGenericGeometryComponents.h index 38009c839e..61cb4ebee6 100644 --- a/src/generated/CPACSGenericGeometryComponents.h +++ b/src/generated/CPACSGenericGeometryComponents.h @@ -62,6 +62,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetGenericGeometryComponents() const; TIGL_EXPORT virtual std::vector>& GetGenericGeometryComponents(); + TIGL_EXPORT virtual size_t GetGenericGeometryComponentCount() const; + TIGL_EXPORT virtual size_t GetGenericGeometryComponentIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSExternalObject& GetGenericGeometryComponent(size_t index) const; + TIGL_EXPORT virtual CCPACSExternalObject& GetGenericGeometryComponent(size_t index); + + TIGL_EXPORT virtual const CCPACSExternalObject& GetGenericGeometryComponent(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSExternalObject& GetGenericGeometryComponent(const std::string& UID); + TIGL_EXPORT virtual CCPACSExternalObject& AddGenericGeometryComponent(); TIGL_EXPORT virtual void RemoveGenericGeometryComponent(CCPACSExternalObject& ref); diff --git a/src/generated/CPACSGenericSystems.cpp b/src/generated/CPACSGenericSystems.cpp index 166811fc7f..f4d8f69d6e 100644 --- a/src/generated/CPACSGenericSystems.cpp +++ b/src/generated/CPACSGenericSystems.cpp @@ -108,6 +108,59 @@ namespace generated return m_genericSystems; } + size_t CPACSGenericSystems::GetGenericSystemCount() const + { + return m_genericSystems.size(); + } + + size_t CPACSGenericSystems::GetGenericSystemIndex(const std::string& UID) const + { + for (size_t i=0; i < GetGenericSystemCount(); i++) { + const std::string tmpUID(m_genericSystems[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSGenericSystems::GetGenericSystemIndex", TIGL_UID_ERROR); + } + + CCPACSGenericSystem& CPACSGenericSystems::GetGenericSystem(size_t index) + { + if (index < 1 || index > GetGenericSystemCount()) { + throw CTiglError("Invalid index in std::vector>::GetGenericSystem", TIGL_INDEX_ERROR); + } + index--; + return *m_genericSystems[index]; + } + + const CCPACSGenericSystem& CPACSGenericSystems::GetGenericSystem(size_t index) const + { + if (index < 1 || index > GetGenericSystemCount()) { + throw CTiglError("Invalid index in std::vector>::GetGenericSystem", TIGL_INDEX_ERROR); + } + index--; + return *m_genericSystems[index]; + } + + CCPACSGenericSystem& CPACSGenericSystems::GetGenericSystem(const std::string& UID) + { + for (auto& elem : m_genericSystems ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSGenericSystems::GetGenericSystem. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSGenericSystem& CPACSGenericSystems::GetGenericSystem(const std::string& UID) const + { + for (auto& elem : m_genericSystems ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSGenericSystems::GetGenericSystem. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSGenericSystem& CPACSGenericSystems::AddGenericSystem() { m_genericSystems.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); diff --git a/src/generated/CPACSGenericSystems.h b/src/generated/CPACSGenericSystems.h index 2085e63743..a943f8e45d 100644 --- a/src/generated/CPACSGenericSystems.h +++ b/src/generated/CPACSGenericSystems.h @@ -63,6 +63,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetGenericSystems() const; TIGL_EXPORT virtual std::vector>& GetGenericSystems(); + TIGL_EXPORT virtual size_t GetGenericSystemCount() const; + TIGL_EXPORT virtual size_t GetGenericSystemIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSGenericSystem& GetGenericSystem(size_t index) const; + TIGL_EXPORT virtual CCPACSGenericSystem& GetGenericSystem(size_t index); + + TIGL_EXPORT virtual const CCPACSGenericSystem& GetGenericSystem(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSGenericSystem& GetGenericSystem(const std::string& UID); + TIGL_EXPORT virtual CCPACSGenericSystem& AddGenericSystem(); TIGL_EXPORT virtual void RemoveGenericSystem(CCPACSGenericSystem& ref); diff --git a/src/generated/CPACSGuideCurveProfileGeometry.cpp b/src/generated/CPACSGuideCurveProfileGeometry.cpp index bd9d292acf..3fea2ac9f2 100644 --- a/src/generated/CPACSGuideCurveProfileGeometry.cpp +++ b/src/generated/CPACSGuideCurveProfileGeometry.cpp @@ -16,8 +16,8 @@ // limitations under the License. #include -#include "CCPACSGuideCurveProfiles.h" #include "CPACSGuideCurveProfileGeometry.h" +#include "CPACSGuideCurveProfiles.h" #include "CTiglError.h" #include "CTiglLogging.h" #include "CTiglUIDManager.h" @@ -27,7 +27,7 @@ namespace tigl { namespace generated { - CPACSGuideCurveProfileGeometry::CPACSGuideCurveProfileGeometry(CCPACSGuideCurveProfiles* parent, CTiglUIDManager* uidMgr) + CPACSGuideCurveProfileGeometry::CPACSGuideCurveProfileGeometry(CPACSGuideCurveProfiles* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) , m_pointList(reinterpret_cast(this)) { @@ -40,12 +40,12 @@ namespace generated if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID); } - const CCPACSGuideCurveProfiles* CPACSGuideCurveProfileGeometry::GetParent() const + const CPACSGuideCurveProfiles* CPACSGuideCurveProfileGeometry::GetParent() const { return m_parent; } - CCPACSGuideCurveProfiles* CPACSGuideCurveProfileGeometry::GetParent() + CPACSGuideCurveProfiles* CPACSGuideCurveProfileGeometry::GetParent() { return m_parent; } diff --git a/src/generated/CPACSGuideCurveProfileGeometry.h b/src/generated/CPACSGuideCurveProfileGeometry.h index 25a3a983b1..3d053e16c9 100644 --- a/src/generated/CPACSGuideCurveProfileGeometry.h +++ b/src/generated/CPACSGuideCurveProfileGeometry.h @@ -29,10 +29,11 @@ namespace tigl { class CTiglUIDManager; -class CCPACSGuideCurveProfiles; namespace generated { + class CPACSGuideCurveProfiles; + // This class is used in: // CPACSGuideCurveProfiles @@ -61,13 +62,13 @@ namespace generated class CPACSGuideCurveProfileGeometry : public CTiglReqUIDObject { public: - TIGL_EXPORT CPACSGuideCurveProfileGeometry(CCPACSGuideCurveProfiles* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSGuideCurveProfileGeometry(CPACSGuideCurveProfiles* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSGuideCurveProfileGeometry(); - TIGL_EXPORT CCPACSGuideCurveProfiles* GetParent(); + TIGL_EXPORT CPACSGuideCurveProfiles* GetParent(); - TIGL_EXPORT const CCPACSGuideCurveProfiles* GetParent() const; + TIGL_EXPORT const CPACSGuideCurveProfiles* GetParent() const; TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -94,7 +95,7 @@ namespace generated TIGL_EXPORT virtual CCPACSPointListRelXYZVector& GetPointList(); protected: - CCPACSGuideCurveProfiles* m_parent; + CPACSGuideCurveProfiles* m_parent; CTiglUIDManager* m_uidMgr; @@ -120,4 +121,7 @@ namespace generated } // namespace generated // CPACSGuideCurveProfileGeometry is customized, use type CCPACSGuideCurveProfile directly + +// Aliases in tigl namespace +using CCPACSGuideCurveProfiles = generated::CPACSGuideCurveProfiles; } // namespace tigl diff --git a/src/generated/CPACSGuideCurveProfiles.cpp b/src/generated/CPACSGuideCurveProfiles.cpp index a1e50632ed..4dd8b84aa1 100644 --- a/src/generated/CPACSGuideCurveProfiles.cpp +++ b/src/generated/CPACSGuideCurveProfiles.cpp @@ -17,8 +17,8 @@ #include #include -#include "CCPACSProfiles.h" #include "CPACSGuideCurveProfiles.h" +#include "CPACSProfiles.h" #include "CTiglError.h" #include "CTiglLogging.h" #include "CTiglUIDManager.h" @@ -29,7 +29,7 @@ namespace tigl { namespace generated { - CPACSGuideCurveProfiles::CPACSGuideCurveProfiles(CCPACSProfiles* parent, CTiglUIDManager* uidMgr) + CPACSGuideCurveProfiles::CPACSGuideCurveProfiles(CPACSProfiles* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { //assert(parent != NULL); @@ -40,12 +40,12 @@ namespace generated { } - const CCPACSProfiles* CPACSGuideCurveProfiles::GetParent() const + const CPACSProfiles* CPACSGuideCurveProfiles::GetParent() const { return m_parent; } - CCPACSProfiles* CPACSGuideCurveProfiles::GetParent() + CPACSProfiles* CPACSGuideCurveProfiles::GetParent() { return m_parent; } @@ -86,7 +86,7 @@ namespace generated { // read element guideCurveProfile if (tixi::TixiCheckElement(tixiHandle, xpath + "/guideCurveProfile")) { - tixi::TixiReadElements(tixiHandle, xpath + "/guideCurveProfile", m_guideCurveProfiles, 1, tixi::xsdUnbounded, reinterpret_cast(this), m_uidMgr); + tixi::TixiReadElements(tixiHandle, xpath + "/guideCurveProfile", m_guideCurveProfiles, 1, tixi::xsdUnbounded, this, m_uidMgr); } } @@ -108,9 +108,62 @@ namespace generated return m_guideCurveProfiles; } + size_t CPACSGuideCurveProfiles::GetGuideCurveProfileCount() const + { + return m_guideCurveProfiles.size(); + } + + size_t CPACSGuideCurveProfiles::GetGuideCurveProfileIndex(const std::string& UID) const + { + for (size_t i=0; i < GetGuideCurveProfileCount(); i++) { + const std::string tmpUID(m_guideCurveProfiles[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSGuideCurveProfiles::GetGuideCurveProfileIndex", TIGL_UID_ERROR); + } + + CCPACSGuideCurveProfile& CPACSGuideCurveProfiles::GetGuideCurveProfile(size_t index) + { + if (index < 1 || index > GetGuideCurveProfileCount()) { + throw CTiglError("Invalid index in std::vector>::GetGuideCurveProfile", TIGL_INDEX_ERROR); + } + index--; + return *m_guideCurveProfiles[index]; + } + + const CCPACSGuideCurveProfile& CPACSGuideCurveProfiles::GetGuideCurveProfile(size_t index) const + { + if (index < 1 || index > GetGuideCurveProfileCount()) { + throw CTiglError("Invalid index in std::vector>::GetGuideCurveProfile", TIGL_INDEX_ERROR); + } + index--; + return *m_guideCurveProfiles[index]; + } + + CCPACSGuideCurveProfile& CPACSGuideCurveProfiles::GetGuideCurveProfile(const std::string& UID) + { + for (auto& elem : m_guideCurveProfiles ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSGuideCurveProfiles::GetGuideCurveProfile. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSGuideCurveProfile& CPACSGuideCurveProfiles::GetGuideCurveProfile(const std::string& UID) const + { + for (auto& elem : m_guideCurveProfiles ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSGuideCurveProfiles::GetGuideCurveProfile. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSGuideCurveProfile& CPACSGuideCurveProfiles::AddGuideCurveProfile() { - m_guideCurveProfiles.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); + m_guideCurveProfiles.push_back(make_unique(this, m_uidMgr)); return *m_guideCurveProfiles.back(); } diff --git a/src/generated/CPACSGuideCurveProfiles.h b/src/generated/CPACSGuideCurveProfiles.h index 08356d9daf..376c461504 100644 --- a/src/generated/CPACSGuideCurveProfiles.h +++ b/src/generated/CPACSGuideCurveProfiles.h @@ -28,10 +28,11 @@ namespace tigl class CTiglUIDManager; class CTiglUIDObject; class CCPACSGuideCurveProfile; -class CCPACSProfiles; namespace generated { + class CPACSProfiles; + // This class is used in: // CPACSProfiles @@ -44,13 +45,13 @@ namespace generated class CPACSGuideCurveProfiles { public: - TIGL_EXPORT CPACSGuideCurveProfiles(CCPACSProfiles* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSGuideCurveProfiles(CPACSProfiles* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSGuideCurveProfiles(); - TIGL_EXPORT CCPACSProfiles* GetParent(); + TIGL_EXPORT CPACSProfiles* GetParent(); - TIGL_EXPORT const CCPACSProfiles* GetParent() const; + TIGL_EXPORT const CPACSProfiles* GetParent() const; TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -64,11 +65,20 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetGuideCurveProfiles() const; TIGL_EXPORT virtual std::vector>& GetGuideCurveProfiles(); + TIGL_EXPORT virtual size_t GetGuideCurveProfileCount() const; + TIGL_EXPORT virtual size_t GetGuideCurveProfileIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSGuideCurveProfile& GetGuideCurveProfile(size_t index) const; + TIGL_EXPORT virtual CCPACSGuideCurveProfile& GetGuideCurveProfile(size_t index); + + TIGL_EXPORT virtual const CCPACSGuideCurveProfile& GetGuideCurveProfile(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSGuideCurveProfile& GetGuideCurveProfile(const std::string& UID); + TIGL_EXPORT virtual CCPACSGuideCurveProfile& AddGuideCurveProfile(); TIGL_EXPORT virtual void RemoveGuideCurveProfile(CCPACSGuideCurveProfile& ref); protected: - CCPACSProfiles* m_parent; + CPACSProfiles* m_parent; CTiglUIDManager* m_uidMgr; @@ -83,5 +93,7 @@ namespace generated }; } // namespace generated -// CPACSGuideCurveProfiles is customized, use type CCPACSGuideCurveProfiles directly +// Aliases in tigl namespace +using CCPACSGuideCurveProfiles = generated::CPACSGuideCurveProfiles; +using CCPACSProfiles = generated::CPACSProfiles; } // namespace tigl diff --git a/src/generated/CPACSGuideCurves.cpp b/src/generated/CPACSGuideCurves.cpp index ba6cba72a2..248da76072 100644 --- a/src/generated/CPACSGuideCurves.cpp +++ b/src/generated/CPACSGuideCurves.cpp @@ -118,6 +118,59 @@ namespace generated return m_guideCurves; } + size_t CPACSGuideCurves::GetGuideCurveCount() const + { + return m_guideCurves.size(); + } + + size_t CPACSGuideCurves::GetGuideCurveIndex(const std::string& UID) const + { + for (size_t i=0; i < GetGuideCurveCount(); i++) { + const std::string tmpUID(m_guideCurves[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSGuideCurves::GetGuideCurveIndex", TIGL_UID_ERROR); + } + + CCPACSGuideCurve& CPACSGuideCurves::GetGuideCurve(size_t index) + { + if (index < 1 || index > GetGuideCurveCount()) { + throw CTiglError("Invalid index in std::vector>::GetGuideCurve", TIGL_INDEX_ERROR); + } + index--; + return *m_guideCurves[index]; + } + + const CCPACSGuideCurve& CPACSGuideCurves::GetGuideCurve(size_t index) const + { + if (index < 1 || index > GetGuideCurveCount()) { + throw CTiglError("Invalid index in std::vector>::GetGuideCurve", TIGL_INDEX_ERROR); + } + index--; + return *m_guideCurves[index]; + } + + CCPACSGuideCurve& CPACSGuideCurves::GetGuideCurve(const std::string& UID) + { + for (auto& elem : m_guideCurves ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSGuideCurves::GetGuideCurve. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSGuideCurve& CPACSGuideCurves::GetGuideCurve(const std::string& UID) const + { + for (auto& elem : m_guideCurves ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSGuideCurves::GetGuideCurve. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSGuideCurve& CPACSGuideCurves::AddGuideCurve() { m_guideCurves.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); diff --git a/src/generated/CPACSGuideCurves.h b/src/generated/CPACSGuideCurves.h index e4703f45c5..f7e6420b3d 100644 --- a/src/generated/CPACSGuideCurves.h +++ b/src/generated/CPACSGuideCurves.h @@ -91,6 +91,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetGuideCurves() const; TIGL_EXPORT virtual std::vector>& GetGuideCurves(); + TIGL_EXPORT virtual size_t GetGuideCurveCount() const; + TIGL_EXPORT virtual size_t GetGuideCurveIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSGuideCurve& GetGuideCurve(size_t index) const; + TIGL_EXPORT virtual CCPACSGuideCurve& GetGuideCurve(size_t index); + + TIGL_EXPORT virtual const CCPACSGuideCurve& GetGuideCurve(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSGuideCurve& GetGuideCurve(const std::string& UID); + TIGL_EXPORT virtual CCPACSGuideCurve& AddGuideCurve(); TIGL_EXPORT virtual void RemoveGuideCurve(CCPACSGuideCurve& ref); diff --git a/src/generated/CPACSInternalPressures.cpp b/src/generated/CPACSInternalPressures.cpp index 429070c868..41f9e5c30e 100644 --- a/src/generated/CPACSInternalPressures.cpp +++ b/src/generated/CPACSInternalPressures.cpp @@ -102,6 +102,30 @@ namespace generated return m_internalPressures; } + size_t CPACSInternalPressures::GetInternalPressureCount() const + { + return m_internalPressures.size(); + } + + CPACSInternalPressure& CPACSInternalPressures::GetInternalPressure(size_t index) + { + if (index < 1 || index > GetInternalPressureCount()) { + throw CTiglError("Invalid index in std::vector>::GetInternalPressure", TIGL_INDEX_ERROR); + } + index--; + return *m_internalPressures[index]; + } + + const CPACSInternalPressure& CPACSInternalPressures::GetInternalPressure(size_t index) const + { + if (index < 1 || index > GetInternalPressureCount()) { + throw CTiglError("Invalid index in std::vector>::GetInternalPressure", TIGL_INDEX_ERROR); + } + index--; + return *m_internalPressures[index]; + } + + CPACSInternalPressure& CPACSInternalPressures::AddInternalPressure() { m_internalPressures.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSInternalPressures.h b/src/generated/CPACSInternalPressures.h index 7cfc240f06..05f6948327 100644 --- a/src/generated/CPACSInternalPressures.h +++ b/src/generated/CPACSInternalPressures.h @@ -62,6 +62,11 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetInternalPressures() const; TIGL_EXPORT virtual std::vector>& GetInternalPressures(); + TIGL_EXPORT virtual size_t GetInternalPressureCount() const; + + TIGL_EXPORT virtual const CPACSInternalPressure& GetInternalPressure(size_t index) const; + TIGL_EXPORT virtual CPACSInternalPressure& GetInternalPressure(size_t index); + TIGL_EXPORT virtual CPACSInternalPressure& AddInternalPressure(); TIGL_EXPORT virtual void RemoveInternalPressure(CPACSInternalPressure& ref); diff --git a/src/generated/CPACSLandingGearExtensionFunction.cpp b/src/generated/CPACSLandingGearExtensionFunction.cpp index 89f01adcdf..24d8fd83fa 100644 --- a/src/generated/CPACSLandingGearExtensionFunction.cpp +++ b/src/generated/CPACSLandingGearExtensionFunction.cpp @@ -141,6 +141,30 @@ namespace generated return m_steps; } + size_t CPACSLandingGearExtensionFunction::GetStepCount() const + { + return m_steps.size(); + } + + CPACSLandingGearExtensionFunctionStep& CPACSLandingGearExtensionFunction::GetStep(size_t index) + { + if (index < 1 || index > GetStepCount()) { + throw CTiglError("Invalid index in std::vector>::GetStep", TIGL_INDEX_ERROR); + } + index--; + return *m_steps[index]; + } + + const CPACSLandingGearExtensionFunctionStep& CPACSLandingGearExtensionFunction::GetStep(size_t index) const + { + if (index < 1 || index > GetStepCount()) { + throw CTiglError("Invalid index in std::vector>::GetStep", TIGL_INDEX_ERROR); + } + index--; + return *m_steps[index]; + } + + CPACSLandingGearExtensionFunctionStep& CPACSLandingGearExtensionFunction::AddStep() { m_steps.push_back(make_unique(this)); diff --git a/src/generated/CPACSLandingGearExtensionFunction.h b/src/generated/CPACSLandingGearExtensionFunction.h index 69904ddc0a..56962a1ddc 100644 --- a/src/generated/CPACSLandingGearExtensionFunction.h +++ b/src/generated/CPACSLandingGearExtensionFunction.h @@ -66,6 +66,11 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetSteps() const; TIGL_EXPORT virtual std::vector>& GetSteps(); + TIGL_EXPORT virtual size_t GetStepCount() const; + + TIGL_EXPORT virtual const CPACSLandingGearExtensionFunctionStep& GetStep(size_t index) const; + TIGL_EXPORT virtual CPACSLandingGearExtensionFunctionStep& GetStep(size_t index); + TIGL_EXPORT virtual CPACSLandingGearExtensionFunctionStep& AddStep(); TIGL_EXPORT virtual void RemoveStep(CPACSLandingGearExtensionFunctionStep& ref); diff --git a/src/generated/CPACSLandingGearSteeringFunction.cpp b/src/generated/CPACSLandingGearSteeringFunction.cpp index 8dc12148bf..cf501fc4e5 100644 --- a/src/generated/CPACSLandingGearSteeringFunction.cpp +++ b/src/generated/CPACSLandingGearSteeringFunction.cpp @@ -141,6 +141,30 @@ namespace generated return m_steps; } + size_t CPACSLandingGearSteeringFunction::GetStepCount() const + { + return m_steps.size(); + } + + CPACSLandingGearSteeringFunctionStep& CPACSLandingGearSteeringFunction::GetStep(size_t index) + { + if (index < 1 || index > GetStepCount()) { + throw CTiglError("Invalid index in std::vector>::GetStep", TIGL_INDEX_ERROR); + } + index--; + return *m_steps[index]; + } + + const CPACSLandingGearSteeringFunctionStep& CPACSLandingGearSteeringFunction::GetStep(size_t index) const + { + if (index < 1 || index > GetStepCount()) { + throw CTiglError("Invalid index in std::vector>::GetStep", TIGL_INDEX_ERROR); + } + index--; + return *m_steps[index]; + } + + CPACSLandingGearSteeringFunctionStep& CPACSLandingGearSteeringFunction::AddStep() { m_steps.push_back(make_unique(this)); diff --git a/src/generated/CPACSLandingGearSteeringFunction.h b/src/generated/CPACSLandingGearSteeringFunction.h index c0c3e02a91..e1fcb5234e 100644 --- a/src/generated/CPACSLandingGearSteeringFunction.h +++ b/src/generated/CPACSLandingGearSteeringFunction.h @@ -66,6 +66,11 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetSteps() const; TIGL_EXPORT virtual std::vector>& GetSteps(); + TIGL_EXPORT virtual size_t GetStepCount() const; + + TIGL_EXPORT virtual const CPACSLandingGearSteeringFunctionStep& GetStep(size_t index) const; + TIGL_EXPORT virtual CPACSLandingGearSteeringFunctionStep& GetStep(size_t index); + TIGL_EXPORT virtual CPACSLandingGearSteeringFunctionStep& AddStep(); TIGL_EXPORT virtual void RemoveStep(CPACSLandingGearSteeringFunctionStep& ref); diff --git a/src/generated/CPACSLandingGears.cpp b/src/generated/CPACSLandingGears.cpp index e8d42ff1ac..21b82794a1 100644 --- a/src/generated/CPACSLandingGears.cpp +++ b/src/generated/CPACSLandingGears.cpp @@ -102,6 +102,59 @@ namespace generated return m_landingGears; } + size_t CPACSLandingGears::GetLandingGearCount() const + { + return m_landingGears.size(); + } + + size_t CPACSLandingGears::GetLandingGearIndex(const std::string& UID) const + { + for (size_t i=0; i < GetLandingGearCount(); i++) { + const std::string tmpUID(m_landingGears[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSLandingGears::GetLandingGearIndex", TIGL_UID_ERROR); + } + + CPACSLandingGearBase& CPACSLandingGears::GetLandingGear(size_t index) + { + if (index < 1 || index > GetLandingGearCount()) { + throw CTiglError("Invalid index in std::vector>::GetLandingGear", TIGL_INDEX_ERROR); + } + index--; + return *m_landingGears[index]; + } + + const CPACSLandingGearBase& CPACSLandingGears::GetLandingGear(size_t index) const + { + if (index < 1 || index > GetLandingGearCount()) { + throw CTiglError("Invalid index in std::vector>::GetLandingGear", TIGL_INDEX_ERROR); + } + index--; + return *m_landingGears[index]; + } + + CPACSLandingGearBase& CPACSLandingGears::GetLandingGear(const std::string& UID) + { + for (auto& elem : m_landingGears ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSLandingGears::GetLandingGear. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CPACSLandingGearBase& CPACSLandingGears::GetLandingGear(const std::string& UID) const + { + for (auto& elem : m_landingGears ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSLandingGears::GetLandingGear. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CPACSLandingGearBase& CPACSLandingGears::AddLandingGear() { m_landingGears.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSLandingGears.h b/src/generated/CPACSLandingGears.h index 046ffb42ac..972ce01e5c 100644 --- a/src/generated/CPACSLandingGears.h +++ b/src/generated/CPACSLandingGears.h @@ -63,6 +63,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetLandingGears() const; TIGL_EXPORT virtual std::vector>& GetLandingGears(); + TIGL_EXPORT virtual size_t GetLandingGearCount() const; + TIGL_EXPORT virtual size_t GetLandingGearIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CPACSLandingGearBase& GetLandingGear(size_t index) const; + TIGL_EXPORT virtual CPACSLandingGearBase& GetLandingGear(size_t index); + + TIGL_EXPORT virtual const CPACSLandingGearBase& GetLandingGear(const std::string& UID) const; + TIGL_EXPORT virtual CPACSLandingGearBase& GetLandingGear(const std::string& UID); + TIGL_EXPORT virtual CPACSLandingGearBase& AddLandingGear(); TIGL_EXPORT virtual void RemoveLandingGear(CPACSLandingGearBase& ref); diff --git a/src/generated/CPACSLavatoryElements.cpp b/src/generated/CPACSLavatoryElements.cpp index c49c19660c..2b7caf5d11 100644 --- a/src/generated/CPACSLavatoryElements.cpp +++ b/src/generated/CPACSLavatoryElements.cpp @@ -108,6 +108,59 @@ namespace generated return m_lavatoryElements; } + size_t CPACSLavatoryElements::GetLavatoryElementCount() const + { + return m_lavatoryElements.size(); + } + + size_t CPACSLavatoryElements::GetLavatoryElementIndex(const std::string& UID) const + { + for (size_t i=0; i < GetLavatoryElementCount(); i++) { + const std::string tmpUID(m_lavatoryElements[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSLavatoryElements::GetLavatoryElementIndex", TIGL_UID_ERROR); + } + + CPACSDeckElementBase& CPACSLavatoryElements::GetLavatoryElement(size_t index) + { + if (index < 1 || index > GetLavatoryElementCount()) { + throw CTiglError("Invalid index in std::vector>::GetLavatoryElement", TIGL_INDEX_ERROR); + } + index--; + return *m_lavatoryElements[index]; + } + + const CPACSDeckElementBase& CPACSLavatoryElements::GetLavatoryElement(size_t index) const + { + if (index < 1 || index > GetLavatoryElementCount()) { + throw CTiglError("Invalid index in std::vector>::GetLavatoryElement", TIGL_INDEX_ERROR); + } + index--; + return *m_lavatoryElements[index]; + } + + CPACSDeckElementBase& CPACSLavatoryElements::GetLavatoryElement(const std::string& UID) + { + for (auto& elem : m_lavatoryElements ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSLavatoryElements::GetLavatoryElement. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CPACSDeckElementBase& CPACSLavatoryElements::GetLavatoryElement(const std::string& UID) const + { + for (auto& elem : m_lavatoryElements ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSLavatoryElements::GetLavatoryElement. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CPACSDeckElementBase& CPACSLavatoryElements::AddLavatoryElement() { m_lavatoryElements.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSLavatoryElements.h b/src/generated/CPACSLavatoryElements.h index 0aab0c3a9f..7efd9024e5 100644 --- a/src/generated/CPACSLavatoryElements.h +++ b/src/generated/CPACSLavatoryElements.h @@ -63,6 +63,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetLavatoryElements() const; TIGL_EXPORT virtual std::vector>& GetLavatoryElements(); + TIGL_EXPORT virtual size_t GetLavatoryElementCount() const; + TIGL_EXPORT virtual size_t GetLavatoryElementIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CPACSDeckElementBase& GetLavatoryElement(size_t index) const; + TIGL_EXPORT virtual CPACSDeckElementBase& GetLavatoryElement(size_t index); + + TIGL_EXPORT virtual const CPACSDeckElementBase& GetLavatoryElement(const std::string& UID) const; + TIGL_EXPORT virtual CPACSDeckElementBase& GetLavatoryElement(const std::string& UID); + TIGL_EXPORT virtual CPACSDeckElementBase& AddLavatoryElement(); TIGL_EXPORT virtual void RemoveLavatoryElement(CPACSDeckElementBase& ref); diff --git a/src/generated/CPACSLongFloorBeam.cpp b/src/generated/CPACSLongFloorBeam.cpp index 9c7969225b..5cf22d4db3 100644 --- a/src/generated/CPACSLongFloorBeam.cpp +++ b/src/generated/CPACSLongFloorBeam.cpp @@ -141,6 +141,59 @@ namespace generated return m_longFloorBeamPositions; } + size_t CPACSLongFloorBeam::GetLongFloorBeamPositionCount() const + { + return m_longFloorBeamPositions.size(); + } + + size_t CPACSLongFloorBeam::GetLongFloorBeamPositionIndex(const std::string& UID) const + { + for (size_t i=0; i < GetLongFloorBeamPositionCount(); i++) { + const std::string tmpUID(m_longFloorBeamPositions[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSLongFloorBeam::GetLongFloorBeamPositionIndex", TIGL_UID_ERROR); + } + + CCPACSLongFloorBeamPosition& CPACSLongFloorBeam::GetLongFloorBeamPosition(size_t index) + { + if (index < 1 || index > GetLongFloorBeamPositionCount()) { + throw CTiglError("Invalid index in std::vector>::GetLongFloorBeamPosition", TIGL_INDEX_ERROR); + } + index--; + return *m_longFloorBeamPositions[index]; + } + + const CCPACSLongFloorBeamPosition& CPACSLongFloorBeam::GetLongFloorBeamPosition(size_t index) const + { + if (index < 1 || index > GetLongFloorBeamPositionCount()) { + throw CTiglError("Invalid index in std::vector>::GetLongFloorBeamPosition", TIGL_INDEX_ERROR); + } + index--; + return *m_longFloorBeamPositions[index]; + } + + CCPACSLongFloorBeamPosition& CPACSLongFloorBeam::GetLongFloorBeamPosition(const std::string& UID) + { + for (auto& elem : m_longFloorBeamPositions ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSLongFloorBeam::GetLongFloorBeamPosition. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSLongFloorBeamPosition& CPACSLongFloorBeam::GetLongFloorBeamPosition(const std::string& UID) const + { + for (auto& elem : m_longFloorBeamPositions ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSLongFloorBeam::GetLongFloorBeamPosition. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSLongFloorBeamPosition& CPACSLongFloorBeam::AddLongFloorBeamPosition() { m_longFloorBeamPositions.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); diff --git a/src/generated/CPACSLongFloorBeam.h b/src/generated/CPACSLongFloorBeam.h index 5d3782bd88..36261a80f4 100644 --- a/src/generated/CPACSLongFloorBeam.h +++ b/src/generated/CPACSLongFloorBeam.h @@ -66,6 +66,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetLongFloorBeamPositions() const; TIGL_EXPORT virtual std::vector>& GetLongFloorBeamPositions(); + TIGL_EXPORT virtual size_t GetLongFloorBeamPositionCount() const; + TIGL_EXPORT virtual size_t GetLongFloorBeamPositionIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSLongFloorBeamPosition& GetLongFloorBeamPosition(size_t index) const; + TIGL_EXPORT virtual CCPACSLongFloorBeamPosition& GetLongFloorBeamPosition(size_t index); + + TIGL_EXPORT virtual const CCPACSLongFloorBeamPosition& GetLongFloorBeamPosition(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSLongFloorBeamPosition& GetLongFloorBeamPosition(const std::string& UID); + TIGL_EXPORT virtual CCPACSLongFloorBeamPosition& AddLongFloorBeamPosition(); TIGL_EXPORT virtual void RemoveLongFloorBeamPosition(CCPACSLongFloorBeamPosition& ref); diff --git a/src/generated/CPACSLongFloorBeamsAssembly.cpp b/src/generated/CPACSLongFloorBeamsAssembly.cpp index 45a799f6ce..4acabeeaa1 100644 --- a/src/generated/CPACSLongFloorBeamsAssembly.cpp +++ b/src/generated/CPACSLongFloorBeamsAssembly.cpp @@ -108,6 +108,59 @@ namespace generated return m_longFloorBeams; } + size_t CPACSLongFloorBeamsAssembly::GetLongFloorBeamCount() const + { + return m_longFloorBeams.size(); + } + + size_t CPACSLongFloorBeamsAssembly::GetLongFloorBeamIndex(const std::string& UID) const + { + for (size_t i=0; i < GetLongFloorBeamCount(); i++) { + const std::string tmpUID(m_longFloorBeams[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSLongFloorBeamsAssembly::GetLongFloorBeamIndex", TIGL_UID_ERROR); + } + + CCPACSLongFloorBeam& CPACSLongFloorBeamsAssembly::GetLongFloorBeam(size_t index) + { + if (index < 1 || index > GetLongFloorBeamCount()) { + throw CTiglError("Invalid index in std::vector>::GetLongFloorBeam", TIGL_INDEX_ERROR); + } + index--; + return *m_longFloorBeams[index]; + } + + const CCPACSLongFloorBeam& CPACSLongFloorBeamsAssembly::GetLongFloorBeam(size_t index) const + { + if (index < 1 || index > GetLongFloorBeamCount()) { + throw CTiglError("Invalid index in std::vector>::GetLongFloorBeam", TIGL_INDEX_ERROR); + } + index--; + return *m_longFloorBeams[index]; + } + + CCPACSLongFloorBeam& CPACSLongFloorBeamsAssembly::GetLongFloorBeam(const std::string& UID) + { + for (auto& elem : m_longFloorBeams ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSLongFloorBeamsAssembly::GetLongFloorBeam. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSLongFloorBeam& CPACSLongFloorBeamsAssembly::GetLongFloorBeam(const std::string& UID) const + { + for (auto& elem : m_longFloorBeams ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSLongFloorBeamsAssembly::GetLongFloorBeam. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSLongFloorBeam& CPACSLongFloorBeamsAssembly::AddLongFloorBeam() { m_longFloorBeams.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); diff --git a/src/generated/CPACSLongFloorBeamsAssembly.h b/src/generated/CPACSLongFloorBeamsAssembly.h index fb68fdda5a..7dda026af3 100644 --- a/src/generated/CPACSLongFloorBeamsAssembly.h +++ b/src/generated/CPACSLongFloorBeamsAssembly.h @@ -63,6 +63,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetLongFloorBeams() const; TIGL_EXPORT virtual std::vector>& GetLongFloorBeams(); + TIGL_EXPORT virtual size_t GetLongFloorBeamCount() const; + TIGL_EXPORT virtual size_t GetLongFloorBeamIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSLongFloorBeam& GetLongFloorBeam(size_t index) const; + TIGL_EXPORT virtual CCPACSLongFloorBeam& GetLongFloorBeam(size_t index); + + TIGL_EXPORT virtual const CCPACSLongFloorBeam& GetLongFloorBeam(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSLongFloorBeam& GetLongFloorBeam(const std::string& UID); + TIGL_EXPORT virtual CCPACSLongFloorBeam& AddLongFloorBeam(); TIGL_EXPORT virtual void RemoveLongFloorBeam(CCPACSLongFloorBeam& ref); diff --git a/src/generated/CPACSLuggageCompartmentElements.cpp b/src/generated/CPACSLuggageCompartmentElements.cpp index 82acf973c0..3d79ed316f 100644 --- a/src/generated/CPACSLuggageCompartmentElements.cpp +++ b/src/generated/CPACSLuggageCompartmentElements.cpp @@ -108,6 +108,59 @@ namespace generated return m_luggageCompartmentElements; } + size_t CPACSLuggageCompartmentElements::GetLuggageCompartmentElementCount() const + { + return m_luggageCompartmentElements.size(); + } + + size_t CPACSLuggageCompartmentElements::GetLuggageCompartmentElementIndex(const std::string& UID) const + { + for (size_t i=0; i < GetLuggageCompartmentElementCount(); i++) { + const std::string tmpUID(m_luggageCompartmentElements[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSLuggageCompartmentElements::GetLuggageCompartmentElementIndex", TIGL_UID_ERROR); + } + + CPACSDeckElementBase& CPACSLuggageCompartmentElements::GetLuggageCompartmentElement(size_t index) + { + if (index < 1 || index > GetLuggageCompartmentElementCount()) { + throw CTiglError("Invalid index in std::vector>::GetLuggageCompartmentElement", TIGL_INDEX_ERROR); + } + index--; + return *m_luggageCompartmentElements[index]; + } + + const CPACSDeckElementBase& CPACSLuggageCompartmentElements::GetLuggageCompartmentElement(size_t index) const + { + if (index < 1 || index > GetLuggageCompartmentElementCount()) { + throw CTiglError("Invalid index in std::vector>::GetLuggageCompartmentElement", TIGL_INDEX_ERROR); + } + index--; + return *m_luggageCompartmentElements[index]; + } + + CPACSDeckElementBase& CPACSLuggageCompartmentElements::GetLuggageCompartmentElement(const std::string& UID) + { + for (auto& elem : m_luggageCompartmentElements ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSLuggageCompartmentElements::GetLuggageCompartmentElement. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CPACSDeckElementBase& CPACSLuggageCompartmentElements::GetLuggageCompartmentElement(const std::string& UID) const + { + for (auto& elem : m_luggageCompartmentElements ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSLuggageCompartmentElements::GetLuggageCompartmentElement. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CPACSDeckElementBase& CPACSLuggageCompartmentElements::AddLuggageCompartmentElement() { m_luggageCompartmentElements.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSLuggageCompartmentElements.h b/src/generated/CPACSLuggageCompartmentElements.h index cac516e6b0..1c66cd5965 100644 --- a/src/generated/CPACSLuggageCompartmentElements.h +++ b/src/generated/CPACSLuggageCompartmentElements.h @@ -63,6 +63,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetLuggageCompartmentElements() const; TIGL_EXPORT virtual std::vector>& GetLuggageCompartmentElements(); + TIGL_EXPORT virtual size_t GetLuggageCompartmentElementCount() const; + TIGL_EXPORT virtual size_t GetLuggageCompartmentElementIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CPACSDeckElementBase& GetLuggageCompartmentElement(size_t index) const; + TIGL_EXPORT virtual CPACSDeckElementBase& GetLuggageCompartmentElement(size_t index); + + TIGL_EXPORT virtual const CPACSDeckElementBase& GetLuggageCompartmentElement(const std::string& UID) const; + TIGL_EXPORT virtual CPACSDeckElementBase& GetLuggageCompartmentElement(const std::string& UID); + TIGL_EXPORT virtual CPACSDeckElementBase& AddLuggageCompartmentElement(); TIGL_EXPORT virtual void RemoveLuggageCompartmentElement(CPACSDeckElementBase& ref); diff --git a/src/generated/CPACSNacelleGuideCurves.cpp b/src/generated/CPACSNacelleGuideCurves.cpp index af416c691c..31269e93ec 100644 --- a/src/generated/CPACSNacelleGuideCurves.cpp +++ b/src/generated/CPACSNacelleGuideCurves.cpp @@ -102,6 +102,30 @@ namespace generated return m_nacelleGuideCurves; } + size_t CPACSNacelleGuideCurves::GetNacelleGuideCurveCount() const + { + return m_nacelleGuideCurves.size(); + } + + CPACSNacelleGuideCurve& CPACSNacelleGuideCurves::GetNacelleGuideCurve(size_t index) + { + if (index < 1 || index > GetNacelleGuideCurveCount()) { + throw CTiglError("Invalid index in std::vector>::GetNacelleGuideCurve", TIGL_INDEX_ERROR); + } + index--; + return *m_nacelleGuideCurves[index]; + } + + const CPACSNacelleGuideCurve& CPACSNacelleGuideCurves::GetNacelleGuideCurve(size_t index) const + { + if (index < 1 || index > GetNacelleGuideCurveCount()) { + throw CTiglError("Invalid index in std::vector>::GetNacelleGuideCurve", TIGL_INDEX_ERROR); + } + index--; + return *m_nacelleGuideCurves[index]; + } + + CPACSNacelleGuideCurve& CPACSNacelleGuideCurves::AddNacelleGuideCurve() { m_nacelleGuideCurves.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); diff --git a/src/generated/CPACSNacelleGuideCurves.h b/src/generated/CPACSNacelleGuideCurves.h index a147bf7036..c2e6103381 100644 --- a/src/generated/CPACSNacelleGuideCurves.h +++ b/src/generated/CPACSNacelleGuideCurves.h @@ -62,6 +62,11 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetNacelleGuideCurves() const; TIGL_EXPORT virtual std::vector>& GetNacelleGuideCurves(); + TIGL_EXPORT virtual size_t GetNacelleGuideCurveCount() const; + + TIGL_EXPORT virtual const CPACSNacelleGuideCurve& GetNacelleGuideCurve(size_t index) const; + TIGL_EXPORT virtual CPACSNacelleGuideCurve& GetNacelleGuideCurve(size_t index); + TIGL_EXPORT virtual CPACSNacelleGuideCurve& AddNacelleGuideCurve(); TIGL_EXPORT virtual void RemoveNacelleGuideCurve(CPACSNacelleGuideCurve& ref); diff --git a/src/generated/CPACSNacelleProfiles.cpp b/src/generated/CPACSNacelleProfiles.cpp index 70ab7a7cab..defbfdc104 100644 --- a/src/generated/CPACSNacelleProfiles.cpp +++ b/src/generated/CPACSNacelleProfiles.cpp @@ -17,8 +17,8 @@ #include #include -#include "CCPACSProfiles.h" #include "CPACSNacelleProfiles.h" +#include "CPACSProfiles.h" #include "CTiglError.h" #include "CTiglLogging.h" #include "CTiglUIDManager.h" @@ -29,7 +29,7 @@ namespace tigl { namespace generated { - CPACSNacelleProfiles::CPACSNacelleProfiles(CCPACSProfiles* parent, CTiglUIDManager* uidMgr) + CPACSNacelleProfiles::CPACSNacelleProfiles(CPACSProfiles* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { //assert(parent != NULL); @@ -40,12 +40,12 @@ namespace generated { } - const CCPACSProfiles* CPACSNacelleProfiles::GetParent() const + const CPACSProfiles* CPACSNacelleProfiles::GetParent() const { return m_parent; } - CCPACSProfiles* CPACSNacelleProfiles::GetParent() + CPACSProfiles* CPACSNacelleProfiles::GetParent() { return m_parent; } @@ -108,6 +108,59 @@ namespace generated return m_nacelleProfiles; } + size_t CPACSNacelleProfiles::GetNacelleProfileCount() const + { + return m_nacelleProfiles.size(); + } + + size_t CPACSNacelleProfiles::GetNacelleProfileIndex(const std::string& UID) const + { + for (size_t i=0; i < GetNacelleProfileCount(); i++) { + const std::string tmpUID(m_nacelleProfiles[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSNacelleProfiles::GetNacelleProfileIndex", TIGL_UID_ERROR); + } + + CCPACSNacelleProfile& CPACSNacelleProfiles::GetNacelleProfile(size_t index) + { + if (index < 1 || index > GetNacelleProfileCount()) { + throw CTiglError("Invalid index in std::vector>::GetNacelleProfile", TIGL_INDEX_ERROR); + } + index--; + return *m_nacelleProfiles[index]; + } + + const CCPACSNacelleProfile& CPACSNacelleProfiles::GetNacelleProfile(size_t index) const + { + if (index < 1 || index > GetNacelleProfileCount()) { + throw CTiglError("Invalid index in std::vector>::GetNacelleProfile", TIGL_INDEX_ERROR); + } + index--; + return *m_nacelleProfiles[index]; + } + + CCPACSNacelleProfile& CPACSNacelleProfiles::GetNacelleProfile(const std::string& UID) + { + for (auto& elem : m_nacelleProfiles ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSNacelleProfiles::GetNacelleProfile. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSNacelleProfile& CPACSNacelleProfiles::GetNacelleProfile(const std::string& UID) const + { + for (auto& elem : m_nacelleProfiles ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSNacelleProfiles::GetNacelleProfile. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSNacelleProfile& CPACSNacelleProfiles::AddNacelleProfile() { m_nacelleProfiles.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSNacelleProfiles.h b/src/generated/CPACSNacelleProfiles.h index adae4cebf9..23826b14d7 100644 --- a/src/generated/CPACSNacelleProfiles.h +++ b/src/generated/CPACSNacelleProfiles.h @@ -28,10 +28,11 @@ namespace tigl class CTiglUIDManager; class CTiglUIDObject; class CCPACSNacelleProfile; -class CCPACSProfiles; namespace generated { + class CPACSProfiles; + // This class is used in: // CPACSProfiles @@ -43,13 +44,13 @@ namespace generated class CPACSNacelleProfiles { public: - TIGL_EXPORT CPACSNacelleProfiles(CCPACSProfiles* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSNacelleProfiles(CPACSProfiles* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSNacelleProfiles(); - TIGL_EXPORT CCPACSProfiles* GetParent(); + TIGL_EXPORT CPACSProfiles* GetParent(); - TIGL_EXPORT const CCPACSProfiles* GetParent() const; + TIGL_EXPORT const CPACSProfiles* GetParent() const; TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -63,11 +64,20 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetNacelleProfiles() const; TIGL_EXPORT virtual std::vector>& GetNacelleProfiles(); + TIGL_EXPORT virtual size_t GetNacelleProfileCount() const; + TIGL_EXPORT virtual size_t GetNacelleProfileIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSNacelleProfile& GetNacelleProfile(size_t index) const; + TIGL_EXPORT virtual CCPACSNacelleProfile& GetNacelleProfile(size_t index); + + TIGL_EXPORT virtual const CCPACSNacelleProfile& GetNacelleProfile(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSNacelleProfile& GetNacelleProfile(const std::string& UID); + TIGL_EXPORT virtual CCPACSNacelleProfile& AddNacelleProfile(); TIGL_EXPORT virtual void RemoveNacelleProfile(CCPACSNacelleProfile& ref); protected: - CCPACSProfiles* m_parent; + CPACSProfiles* m_parent; CTiglUIDManager* m_uidMgr; @@ -84,4 +94,5 @@ namespace generated // Aliases in tigl namespace using CCPACSNacelleProfiles = generated::CPACSNacelleProfiles; +using CCPACSProfiles = generated::CPACSProfiles; } // namespace tigl diff --git a/src/generated/CPACSNacelleSections.cpp b/src/generated/CPACSNacelleSections.cpp index 562e0b69ec..f3b84850cf 100644 --- a/src/generated/CPACSNacelleSections.cpp +++ b/src/generated/CPACSNacelleSections.cpp @@ -102,6 +102,59 @@ namespace generated return m_sections; } + size_t CPACSNacelleSections::GetSectionCount() const + { + return m_sections.size(); + } + + size_t CPACSNacelleSections::GetSectionIndex(const std::string& UID) const + { + for (size_t i=0; i < GetSectionCount(); i++) { + const std::string tmpUID(m_sections[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSNacelleSections::GetSectionIndex", TIGL_UID_ERROR); + } + + CCPACSNacelleSection& CPACSNacelleSections::GetSection(size_t index) + { + if (index < 1 || index > GetSectionCount()) { + throw CTiglError("Invalid index in std::vector>::GetSection", TIGL_INDEX_ERROR); + } + index--; + return *m_sections[index]; + } + + const CCPACSNacelleSection& CPACSNacelleSections::GetSection(size_t index) const + { + if (index < 1 || index > GetSectionCount()) { + throw CTiglError("Invalid index in std::vector>::GetSection", TIGL_INDEX_ERROR); + } + index--; + return *m_sections[index]; + } + + CCPACSNacelleSection& CPACSNacelleSections::GetSection(const std::string& UID) + { + for (auto& elem : m_sections ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSNacelleSections::GetSection. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSNacelleSection& CPACSNacelleSections::GetSection(const std::string& UID) const + { + for (auto& elem : m_sections ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSNacelleSections::GetSection. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSNacelleSection& CPACSNacelleSections::AddSection() { m_sections.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); diff --git a/src/generated/CPACSNacelleSections.h b/src/generated/CPACSNacelleSections.h index 7e0a63d5cc..05114ec496 100644 --- a/src/generated/CPACSNacelleSections.h +++ b/src/generated/CPACSNacelleSections.h @@ -62,6 +62,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetSections() const; TIGL_EXPORT virtual std::vector>& GetSections(); + TIGL_EXPORT virtual size_t GetSectionCount() const; + TIGL_EXPORT virtual size_t GetSectionIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSNacelleSection& GetSection(size_t index) const; + TIGL_EXPORT virtual CCPACSNacelleSection& GetSection(size_t index); + + TIGL_EXPORT virtual const CCPACSNacelleSection& GetSection(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSNacelleSection& GetSection(const std::string& UID); + TIGL_EXPORT virtual CCPACSNacelleSection& AddSection(); TIGL_EXPORT virtual void RemoveSection(CCPACSNacelleSection& ref); diff --git a/src/generated/CPACSPintleStruts.cpp b/src/generated/CPACSPintleStruts.cpp index a5b775b554..b3d9f102d5 100644 --- a/src/generated/CPACSPintleStruts.cpp +++ b/src/generated/CPACSPintleStruts.cpp @@ -108,6 +108,59 @@ namespace generated return m_pintleStruts; } + size_t CPACSPintleStruts::GetPintleStrutCount() const + { + return m_pintleStruts.size(); + } + + size_t CPACSPintleStruts::GetPintleStrutIndex(const std::string& UID) const + { + for (size_t i=0; i < GetPintleStrutCount(); i++) { + const std::string tmpUID(m_pintleStruts[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSPintleStruts::GetPintleStrutIndex", TIGL_UID_ERROR); + } + + CPACSStrutAssembly& CPACSPintleStruts::GetPintleStrut(size_t index) + { + if (index < 1 || index > GetPintleStrutCount()) { + throw CTiglError("Invalid index in std::vector>::GetPintleStrut", TIGL_INDEX_ERROR); + } + index--; + return *m_pintleStruts[index]; + } + + const CPACSStrutAssembly& CPACSPintleStruts::GetPintleStrut(size_t index) const + { + if (index < 1 || index > GetPintleStrutCount()) { + throw CTiglError("Invalid index in std::vector>::GetPintleStrut", TIGL_INDEX_ERROR); + } + index--; + return *m_pintleStruts[index]; + } + + CPACSStrutAssembly& CPACSPintleStruts::GetPintleStrut(const std::string& UID) + { + for (auto& elem : m_pintleStruts ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSPintleStruts::GetPintleStrut. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CPACSStrutAssembly& CPACSPintleStruts::GetPintleStrut(const std::string& UID) const + { + for (auto& elem : m_pintleStruts ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSPintleStruts::GetPintleStrut. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CPACSStrutAssembly& CPACSPintleStruts::AddPintleStrut() { m_pintleStruts.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSPintleStruts.h b/src/generated/CPACSPintleStruts.h index f05b33ac29..52e8001a45 100644 --- a/src/generated/CPACSPintleStruts.h +++ b/src/generated/CPACSPintleStruts.h @@ -59,6 +59,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetPintleStruts() const; TIGL_EXPORT virtual std::vector>& GetPintleStruts(); + TIGL_EXPORT virtual size_t GetPintleStrutCount() const; + TIGL_EXPORT virtual size_t GetPintleStrutIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CPACSStrutAssembly& GetPintleStrut(size_t index) const; + TIGL_EXPORT virtual CPACSStrutAssembly& GetPintleStrut(size_t index); + + TIGL_EXPORT virtual const CPACSStrutAssembly& GetPintleStrut(const std::string& UID) const; + TIGL_EXPORT virtual CPACSStrutAssembly& GetPintleStrut(const std::string& UID); + TIGL_EXPORT virtual CPACSStrutAssembly& AddPintleStrut(); TIGL_EXPORT virtual void RemovePintleStrut(CPACSStrutAssembly& ref); diff --git a/src/generated/CPACSPointList.cpp b/src/generated/CPACSPointList.cpp index ee62593a82..434991bfaa 100644 --- a/src/generated/CPACSPointList.cpp +++ b/src/generated/CPACSPointList.cpp @@ -102,6 +102,59 @@ namespace generated return m_points; } + size_t CPACSPointList::GetPointCount() const + { + return m_points.size(); + } + + size_t CPACSPointList::GetPointIndex(const std::string& UID) const + { + for (size_t i=0; i < GetPointCount(); i++) { + const boost::optional tmpUID(*m_points[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSPointList::GetPointIndex", TIGL_UID_ERROR); + } + + CCPACSPoint& CPACSPointList::GetPoint(size_t index) + { + if (index < 1 || index > GetPointCount()) { + throw CTiglError("Invalid index in std::vector>::GetPoint", TIGL_INDEX_ERROR); + } + index--; + return *m_points[index]; + } + + const CCPACSPoint& CPACSPointList::GetPoint(size_t index) const + { + if (index < 1 || index > GetPointCount()) { + throw CTiglError("Invalid index in std::vector>::GetPoint", TIGL_INDEX_ERROR); + } + index--; + return *m_points[index]; + } + + CCPACSPoint& CPACSPointList::GetPoint(const std::string& UID) + { + for (auto& elem : m_points ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSPointList::GetPoint. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSPoint& CPACSPointList::GetPoint(const std::string& UID) const + { + for (auto& elem : m_points ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSPointList::GetPoint. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSPoint& CPACSPointList::AddPoint() { m_points.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSPointList.h b/src/generated/CPACSPointList.h index b4d47ca98d..2c30a67e75 100644 --- a/src/generated/CPACSPointList.h +++ b/src/generated/CPACSPointList.h @@ -63,6 +63,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetPoints() const; TIGL_EXPORT virtual std::vector>& GetPoints(); + TIGL_EXPORT virtual size_t GetPointCount() const; + TIGL_EXPORT virtual size_t GetPointIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSPoint& GetPoint(size_t index) const; + TIGL_EXPORT virtual CCPACSPoint& GetPoint(size_t index); + + TIGL_EXPORT virtual const CCPACSPoint& GetPoint(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSPoint& GetPoint(const std::string& UID); + TIGL_EXPORT virtual CCPACSPoint& AddPoint(); TIGL_EXPORT virtual void RemovePoint(CCPACSPoint& ref); diff --git a/src/generated/CPACSPointListXY.cpp b/src/generated/CPACSPointListXY.cpp index 45516c78d4..fbc6d5c35a 100644 --- a/src/generated/CPACSPointListXY.cpp +++ b/src/generated/CPACSPointListXY.cpp @@ -102,6 +102,59 @@ namespace generated return m_points; } + size_t CPACSPointListXY::GetPointCount() const + { + return m_points.size(); + } + + size_t CPACSPointListXY::GetPointIndex(const std::string& UID) const + { + for (size_t i=0; i < GetPointCount(); i++) { + const boost::optional tmpUID(*m_points[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSPointListXY::GetPointIndex", TIGL_UID_ERROR); + } + + CCPACSPointXY& CPACSPointListXY::GetPoint(size_t index) + { + if (index < 1 || index > GetPointCount()) { + throw CTiglError("Invalid index in std::vector>::GetPoint", TIGL_INDEX_ERROR); + } + index--; + return *m_points[index]; + } + + const CCPACSPointXY& CPACSPointListXY::GetPoint(size_t index) const + { + if (index < 1 || index > GetPointCount()) { + throw CTiglError("Invalid index in std::vector>::GetPoint", TIGL_INDEX_ERROR); + } + index--; + return *m_points[index]; + } + + CCPACSPointXY& CPACSPointListXY::GetPoint(const std::string& UID) + { + for (auto& elem : m_points ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSPointListXY::GetPoint. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSPointXY& CPACSPointListXY::GetPoint(const std::string& UID) const + { + for (auto& elem : m_points ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSPointListXY::GetPoint. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSPointXY& CPACSPointListXY::AddPoint() { m_points.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); diff --git a/src/generated/CPACSPointListXY.h b/src/generated/CPACSPointListXY.h index 691c8b71fb..d3744a6496 100644 --- a/src/generated/CPACSPointListXY.h +++ b/src/generated/CPACSPointListXY.h @@ -63,6 +63,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetPoints() const; TIGL_EXPORT virtual std::vector>& GetPoints(); + TIGL_EXPORT virtual size_t GetPointCount() const; + TIGL_EXPORT virtual size_t GetPointIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSPointXY& GetPoint(size_t index) const; + TIGL_EXPORT virtual CCPACSPointXY& GetPoint(size_t index); + + TIGL_EXPORT virtual const CCPACSPointXY& GetPoint(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSPointXY& GetPoint(const std::string& UID); + TIGL_EXPORT virtual CCPACSPointXY& AddPoint(); TIGL_EXPORT virtual void RemovePoint(CCPACSPointXY& ref); diff --git a/src/generated/CPACSPointPerformanceDefinitions.cpp b/src/generated/CPACSPointPerformanceDefinitions.cpp index d6b52923a0..6dd1c0c218 100644 --- a/src/generated/CPACSPointPerformanceDefinitions.cpp +++ b/src/generated/CPACSPointPerformanceDefinitions.cpp @@ -108,6 +108,59 @@ namespace generated return m_pointPerformanceDefinitions; } + size_t CPACSPointPerformanceDefinitions::GetPointPerformanceDefinitionCount() const + { + return m_pointPerformanceDefinitions.size(); + } + + size_t CPACSPointPerformanceDefinitions::GetPointPerformanceDefinitionIndex(const std::string& UID) const + { + for (size_t i=0; i < GetPointPerformanceDefinitionCount(); i++) { + const std::string tmpUID(m_pointPerformanceDefinitions[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSPointPerformanceDefinitions::GetPointPerformanceDefinitionIndex", TIGL_UID_ERROR); + } + + CPACSPointPerformanceDefinition& CPACSPointPerformanceDefinitions::GetPointPerformanceDefinition(size_t index) + { + if (index < 1 || index > GetPointPerformanceDefinitionCount()) { + throw CTiglError("Invalid index in std::vector>::GetPointPerformanceDefinition", TIGL_INDEX_ERROR); + } + index--; + return *m_pointPerformanceDefinitions[index]; + } + + const CPACSPointPerformanceDefinition& CPACSPointPerformanceDefinitions::GetPointPerformanceDefinition(size_t index) const + { + if (index < 1 || index > GetPointPerformanceDefinitionCount()) { + throw CTiglError("Invalid index in std::vector>::GetPointPerformanceDefinition", TIGL_INDEX_ERROR); + } + index--; + return *m_pointPerformanceDefinitions[index]; + } + + CPACSPointPerformanceDefinition& CPACSPointPerformanceDefinitions::GetPointPerformanceDefinition(const std::string& UID) + { + for (auto& elem : m_pointPerformanceDefinitions ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSPointPerformanceDefinitions::GetPointPerformanceDefinition. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CPACSPointPerformanceDefinition& CPACSPointPerformanceDefinitions::GetPointPerformanceDefinition(const std::string& UID) const + { + for (auto& elem : m_pointPerformanceDefinitions ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSPointPerformanceDefinitions::GetPointPerformanceDefinition. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CPACSPointPerformanceDefinition& CPACSPointPerformanceDefinitions::AddPointPerformanceDefinition() { m_pointPerformanceDefinitions.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSPointPerformanceDefinitions.h b/src/generated/CPACSPointPerformanceDefinitions.h index 882fd52aa4..94bbe78097 100644 --- a/src/generated/CPACSPointPerformanceDefinitions.h +++ b/src/generated/CPACSPointPerformanceDefinitions.h @@ -63,6 +63,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetPointPerformanceDefinitions() const; TIGL_EXPORT virtual std::vector>& GetPointPerformanceDefinitions(); + TIGL_EXPORT virtual size_t GetPointPerformanceDefinitionCount() const; + TIGL_EXPORT virtual size_t GetPointPerformanceDefinitionIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CPACSPointPerformanceDefinition& GetPointPerformanceDefinition(size_t index) const; + TIGL_EXPORT virtual CPACSPointPerformanceDefinition& GetPointPerformanceDefinition(size_t index); + + TIGL_EXPORT virtual const CPACSPointPerformanceDefinition& GetPointPerformanceDefinition(const std::string& UID) const; + TIGL_EXPORT virtual CPACSPointPerformanceDefinition& GetPointPerformanceDefinition(const std::string& UID); + TIGL_EXPORT virtual CPACSPointPerformanceDefinition& AddPointPerformanceDefinition(); TIGL_EXPORT virtual void RemovePointPerformanceDefinition(CPACSPointPerformanceDefinition& ref); diff --git a/src/generated/CPACSPositionings.cpp b/src/generated/CPACSPositionings.cpp index 699582cad3..ef3f3f338b 100644 --- a/src/generated/CPACSPositionings.cpp +++ b/src/generated/CPACSPositionings.cpp @@ -148,6 +148,59 @@ namespace generated return m_positionings; } + size_t CPACSPositionings::GetPositioningCount() const + { + return m_positionings.size(); + } + + size_t CPACSPositionings::GetPositioningIndex(const std::string& UID) const + { + for (size_t i=0; i < GetPositioningCount(); i++) { + const std::string tmpUID(m_positionings[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSPositionings::GetPositioningIndex", TIGL_UID_ERROR); + } + + CCPACSPositioning& CPACSPositionings::GetPositioning(size_t index) + { + if (index < 1 || index > GetPositioningCount()) { + throw CTiglError("Invalid index in std::vector>::GetPositioning", TIGL_INDEX_ERROR); + } + index--; + return *m_positionings[index]; + } + + const CCPACSPositioning& CPACSPositionings::GetPositioning(size_t index) const + { + if (index < 1 || index > GetPositioningCount()) { + throw CTiglError("Invalid index in std::vector>::GetPositioning", TIGL_INDEX_ERROR); + } + index--; + return *m_positionings[index]; + } + + CCPACSPositioning& CPACSPositionings::GetPositioning(const std::string& UID) + { + for (auto& elem : m_positionings ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSPositionings::GetPositioning. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSPositioning& CPACSPositionings::GetPositioning(const std::string& UID) const + { + for (auto& elem : m_positionings ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSPositionings::GetPositioning. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSPositioning& CPACSPositionings::AddPositioning() { m_positionings.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); diff --git a/src/generated/CPACSPositionings.h b/src/generated/CPACSPositionings.h index 0d9a5329c0..f7c73bd55d 100644 --- a/src/generated/CPACSPositionings.h +++ b/src/generated/CPACSPositionings.h @@ -96,6 +96,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetPositionings() const; TIGL_EXPORT virtual std::vector>& GetPositionings(); + TIGL_EXPORT virtual size_t GetPositioningCount() const; + TIGL_EXPORT virtual size_t GetPositioningIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSPositioning& GetPositioning(size_t index) const; + TIGL_EXPORT virtual CCPACSPositioning& GetPositioning(size_t index); + + TIGL_EXPORT virtual const CCPACSPositioning& GetPositioning(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSPositioning& GetPositioning(const std::string& UID); + TIGL_EXPORT virtual CCPACSPositioning& AddPositioning(); TIGL_EXPORT virtual void RemovePositioning(CCPACSPositioning& ref); diff --git a/src/generated/CPACSPressureBulkhead.cpp b/src/generated/CPACSPressureBulkhead.cpp index 8952ed9f01..0307bcaeb1 100644 --- a/src/generated/CPACSPressureBulkhead.cpp +++ b/src/generated/CPACSPressureBulkhead.cpp @@ -16,8 +16,8 @@ // limitations under the License. #include -#include "CCPACSPressureBulkheads.h" #include "CPACSPressureBulkhead.h" +#include "CPACSPressureBulkheads.h" #include "CTiglError.h" #include "CTiglLogging.h" #include "CTiglUIDManager.h" @@ -27,7 +27,7 @@ namespace tigl { namespace generated { - CPACSPressureBulkhead::CPACSPressureBulkhead(CCPACSPressureBulkheads* parent, CTiglUIDManager* uidMgr) + CPACSPressureBulkhead::CPACSPressureBulkhead(CPACSPressureBulkheads* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { //assert(parent != NULL); @@ -45,12 +45,12 @@ namespace generated } } - const CCPACSPressureBulkheads* CPACSPressureBulkhead::GetParent() const + const CPACSPressureBulkheads* CPACSPressureBulkhead::GetParent() const { return m_parent; } - CCPACSPressureBulkheads* CPACSPressureBulkhead::GetParent() + CPACSPressureBulkheads* CPACSPressureBulkhead::GetParent() { return m_parent; } diff --git a/src/generated/CPACSPressureBulkhead.h b/src/generated/CPACSPressureBulkhead.h index 4be652395f..a1d9b9452f 100644 --- a/src/generated/CPACSPressureBulkhead.h +++ b/src/generated/CPACSPressureBulkhead.h @@ -28,10 +28,11 @@ namespace tigl { class CTiglUIDManager; -class CCPACSPressureBulkheads; namespace generated { + class CPACSPressureBulkheads; + // This class is used in: // CPACSPressureBulkheads @@ -43,13 +44,13 @@ namespace generated class CPACSPressureBulkhead : public CTiglReqUIDObject, public ITiglUIDRefObject { public: - TIGL_EXPORT CPACSPressureBulkhead(CCPACSPressureBulkheads* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSPressureBulkhead(CPACSPressureBulkheads* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSPressureBulkhead(); - TIGL_EXPORT CCPACSPressureBulkheads* GetParent(); + TIGL_EXPORT CPACSPressureBulkheads* GetParent(); - TIGL_EXPORT const CCPACSPressureBulkheads* GetParent() const; + TIGL_EXPORT const CPACSPressureBulkheads* GetParent() const; TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -99,7 +100,7 @@ namespace generated TIGL_EXPORT virtual void SetStructuralElementRadialUID_choice2(const boost::optional& value); protected: - CCPACSPressureBulkheads* m_parent; + CPACSPressureBulkheads* m_parent; CTiglUIDManager* m_uidMgr; @@ -162,4 +163,7 @@ namespace generated } // namespace generated // CPACSPressureBulkhead is customized, use type CCPACSPressureBulkhead directly + +// Aliases in tigl namespace +using CCPACSPressureBulkheads = generated::CPACSPressureBulkheads; } // namespace tigl diff --git a/src/generated/CPACSPressureBulkheadAssembly.cpp b/src/generated/CPACSPressureBulkheadAssembly.cpp index e738fc516f..10876f8d44 100644 --- a/src/generated/CPACSPressureBulkheadAssembly.cpp +++ b/src/generated/CPACSPressureBulkheadAssembly.cpp @@ -108,6 +108,59 @@ namespace generated return m_pressureBulkheads; } + size_t CPACSPressureBulkheadAssembly::GetPressureBulkheadCount() const + { + return m_pressureBulkheads.size(); + } + + size_t CPACSPressureBulkheadAssembly::GetPressureBulkheadIndex(const std::string& UID) const + { + for (size_t i=0; i < GetPressureBulkheadCount(); i++) { + const std::string tmpUID(m_pressureBulkheads[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSPressureBulkheadAssembly::GetPressureBulkheadIndex", TIGL_UID_ERROR); + } + + CCPACSPressureBulkheadAssemblyPosition& CPACSPressureBulkheadAssembly::GetPressureBulkhead(size_t index) + { + if (index < 1 || index > GetPressureBulkheadCount()) { + throw CTiglError("Invalid index in std::vector>::GetPressureBulkhead", TIGL_INDEX_ERROR); + } + index--; + return *m_pressureBulkheads[index]; + } + + const CCPACSPressureBulkheadAssemblyPosition& CPACSPressureBulkheadAssembly::GetPressureBulkhead(size_t index) const + { + if (index < 1 || index > GetPressureBulkheadCount()) { + throw CTiglError("Invalid index in std::vector>::GetPressureBulkhead", TIGL_INDEX_ERROR); + } + index--; + return *m_pressureBulkheads[index]; + } + + CCPACSPressureBulkheadAssemblyPosition& CPACSPressureBulkheadAssembly::GetPressureBulkhead(const std::string& UID) + { + for (auto& elem : m_pressureBulkheads ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSPressureBulkheadAssembly::GetPressureBulkhead. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSPressureBulkheadAssemblyPosition& CPACSPressureBulkheadAssembly::GetPressureBulkhead(const std::string& UID) const + { + for (auto& elem : m_pressureBulkheads ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSPressureBulkheadAssembly::GetPressureBulkhead. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSPressureBulkheadAssemblyPosition& CPACSPressureBulkheadAssembly::AddPressureBulkhead() { m_pressureBulkheads.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); diff --git a/src/generated/CPACSPressureBulkheadAssembly.h b/src/generated/CPACSPressureBulkheadAssembly.h index e1c2cccb28..31023ca59b 100644 --- a/src/generated/CPACSPressureBulkheadAssembly.h +++ b/src/generated/CPACSPressureBulkheadAssembly.h @@ -63,6 +63,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetPressureBulkheads() const; TIGL_EXPORT virtual std::vector>& GetPressureBulkheads(); + TIGL_EXPORT virtual size_t GetPressureBulkheadCount() const; + TIGL_EXPORT virtual size_t GetPressureBulkheadIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSPressureBulkheadAssemblyPosition& GetPressureBulkhead(size_t index) const; + TIGL_EXPORT virtual CCPACSPressureBulkheadAssemblyPosition& GetPressureBulkhead(size_t index); + + TIGL_EXPORT virtual const CCPACSPressureBulkheadAssemblyPosition& GetPressureBulkhead(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSPressureBulkheadAssemblyPosition& GetPressureBulkhead(const std::string& UID); + TIGL_EXPORT virtual CCPACSPressureBulkheadAssemblyPosition& AddPressureBulkhead(); TIGL_EXPORT virtual void RemovePressureBulkhead(CCPACSPressureBulkheadAssemblyPosition& ref); diff --git a/src/generated/CPACSPressureBulkheads.cpp b/src/generated/CPACSPressureBulkheads.cpp index d6149a87bd..669c575a1c 100644 --- a/src/generated/CPACSPressureBulkheads.cpp +++ b/src/generated/CPACSPressureBulkheads.cpp @@ -86,7 +86,7 @@ namespace generated { // read element pressureBulkhead if (tixi::TixiCheckElement(tixiHandle, xpath + "/pressureBulkhead")) { - tixi::TixiReadElements(tixiHandle, xpath + "/pressureBulkhead", m_pressureBulkheads, 1, tixi::xsdUnbounded, reinterpret_cast(this), m_uidMgr); + tixi::TixiReadElements(tixiHandle, xpath + "/pressureBulkhead", m_pressureBulkheads, 1, tixi::xsdUnbounded, this, m_uidMgr); } } @@ -108,9 +108,62 @@ namespace generated return m_pressureBulkheads; } + size_t CPACSPressureBulkheads::GetPressureBulkheadCount() const + { + return m_pressureBulkheads.size(); + } + + size_t CPACSPressureBulkheads::GetPressureBulkheadIndex(const std::string& UID) const + { + for (size_t i=0; i < GetPressureBulkheadCount(); i++) { + const std::string tmpUID(m_pressureBulkheads[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSPressureBulkheads::GetPressureBulkheadIndex", TIGL_UID_ERROR); + } + + CCPACSPressureBulkhead& CPACSPressureBulkheads::GetPressureBulkhead(size_t index) + { + if (index < 1 || index > GetPressureBulkheadCount()) { + throw CTiglError("Invalid index in std::vector>::GetPressureBulkhead", TIGL_INDEX_ERROR); + } + index--; + return *m_pressureBulkheads[index]; + } + + const CCPACSPressureBulkhead& CPACSPressureBulkheads::GetPressureBulkhead(size_t index) const + { + if (index < 1 || index > GetPressureBulkheadCount()) { + throw CTiglError("Invalid index in std::vector>::GetPressureBulkhead", TIGL_INDEX_ERROR); + } + index--; + return *m_pressureBulkheads[index]; + } + + CCPACSPressureBulkhead& CPACSPressureBulkheads::GetPressureBulkhead(const std::string& UID) + { + for (auto& elem : m_pressureBulkheads ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSPressureBulkheads::GetPressureBulkhead. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSPressureBulkhead& CPACSPressureBulkheads::GetPressureBulkhead(const std::string& UID) const + { + for (auto& elem : m_pressureBulkheads ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSPressureBulkheads::GetPressureBulkhead. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSPressureBulkhead& CPACSPressureBulkheads::AddPressureBulkhead() { - m_pressureBulkheads.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); + m_pressureBulkheads.push_back(make_unique(this, m_uidMgr)); return *m_pressureBulkheads.back(); } diff --git a/src/generated/CPACSPressureBulkheads.h b/src/generated/CPACSPressureBulkheads.h index 64ac23d956..3424ee5d6b 100644 --- a/src/generated/CPACSPressureBulkheads.h +++ b/src/generated/CPACSPressureBulkheads.h @@ -63,6 +63,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetPressureBulkheads() const; TIGL_EXPORT virtual std::vector>& GetPressureBulkheads(); + TIGL_EXPORT virtual size_t GetPressureBulkheadCount() const; + TIGL_EXPORT virtual size_t GetPressureBulkheadIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSPressureBulkhead& GetPressureBulkhead(size_t index) const; + TIGL_EXPORT virtual CCPACSPressureBulkhead& GetPressureBulkhead(size_t index); + + TIGL_EXPORT virtual const CCPACSPressureBulkhead& GetPressureBulkhead(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSPressureBulkhead& GetPressureBulkhead(const std::string& UID); + TIGL_EXPORT virtual CCPACSPressureBulkhead& AddPressureBulkhead(); TIGL_EXPORT virtual void RemovePressureBulkhead(CCPACSPressureBulkhead& ref); @@ -82,8 +91,7 @@ namespace generated }; } // namespace generated -// CPACSPressureBulkheads is customized, use type CCPACSPressureBulkheads directly - // Aliases in tigl namespace +using CCPACSPressureBulkheads = generated::CPACSPressureBulkheads; using CCPACSStructuralElements = generated::CPACSStructuralElements; } // namespace tigl diff --git a/src/generated/CPACSProfileBasedStructuralElement.cpp b/src/generated/CPACSProfileBasedStructuralElement.cpp index 9595fed9bd..ffd7faf53b 100644 --- a/src/generated/CPACSProfileBasedStructuralElement.cpp +++ b/src/generated/CPACSProfileBasedStructuralElement.cpp @@ -396,6 +396,30 @@ namespace generated return m_sheetProperties_choice2; } + size_t CPACSProfileBasedStructuralElement::GetSheetPropertiesCount() const + { + return m_sheetProperties_choice2.size(); + } + + CPACSMaterialDefinitionForProfileBased& CPACSProfileBasedStructuralElement::GetSheetProperties(size_t index) + { + if (index < 1 || index > GetSheetPropertiesCount()) { + throw CTiglError("Invalid index in std::vector>::GetSheetProperties", TIGL_INDEX_ERROR); + } + index--; + return *m_sheetProperties_choice2[index]; + } + + const CPACSMaterialDefinitionForProfileBased& CPACSProfileBasedStructuralElement::GetSheetProperties(size_t index) const + { + if (index < 1 || index > GetSheetPropertiesCount()) { + throw CTiglError("Invalid index in std::vector>::GetSheetProperties", TIGL_INDEX_ERROR); + } + index--; + return *m_sheetProperties_choice2[index]; + } + + const boost::optional& CPACSProfileBasedStructuralElement::GetStandardProfileType_choice2_1() const { return m_standardProfileType_choice2_1; @@ -430,6 +454,30 @@ namespace generated return m_pointProperties_choice2_2; } + size_t CPACSProfileBasedStructuralElement::GetPointPropertiesCount() const + { + return m_pointProperties_choice2_2.size(); + } + + CPACSMaterialDefinitionForProfileBasedPoint& CPACSProfileBasedStructuralElement::GetPointProperties(size_t index) + { + if (index < 1 || index > GetPointPropertiesCount()) { + throw CTiglError("Invalid index in std::vector>::GetPointProperties", TIGL_INDEX_ERROR); + } + index--; + return *m_pointProperties_choice2_2[index]; + } + + const CPACSMaterialDefinitionForProfileBasedPoint& CPACSProfileBasedStructuralElement::GetPointProperties(size_t index) const + { + if (index < 1 || index > GetPointPropertiesCount()) { + throw CTiglError("Invalid index in std::vector>::GetPointProperties", TIGL_INDEX_ERROR); + } + index--; + return *m_pointProperties_choice2_2[index]; + } + + const boost::optional& CPACSProfileBasedStructuralElement::GetReferencePointUID_choice2_2() const { return m_referencePointUID_choice2_2; diff --git a/src/generated/CPACSProfileBasedStructuralElement.h b/src/generated/CPACSProfileBasedStructuralElement.h index b531adbb65..99b525f3cb 100644 --- a/src/generated/CPACSProfileBasedStructuralElement.h +++ b/src/generated/CPACSProfileBasedStructuralElement.h @@ -105,6 +105,11 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetSheetProperties_choice2() const; TIGL_EXPORT virtual std::vector>& GetSheetProperties_choice2(); + TIGL_EXPORT virtual size_t GetSheetPropertiesCount() const; + + TIGL_EXPORT virtual const CPACSMaterialDefinitionForProfileBased& GetSheetProperties(size_t index) const; + TIGL_EXPORT virtual CPACSMaterialDefinitionForProfileBased& GetSheetProperties(size_t index); + TIGL_EXPORT virtual const boost::optional& GetStandardProfileType_choice2_1() const; TIGL_EXPORT virtual void SetStandardProfileType_choice2_1(const boost::optional& value); @@ -114,6 +119,11 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetPointProperties_choice2_2() const; TIGL_EXPORT virtual std::vector>& GetPointProperties_choice2_2(); + TIGL_EXPORT virtual size_t GetPointPropertiesCount() const; + + TIGL_EXPORT virtual const CPACSMaterialDefinitionForProfileBasedPoint& GetPointProperties(size_t index) const; + TIGL_EXPORT virtual CPACSMaterialDefinitionForProfileBasedPoint& GetPointProperties(size_t index); + TIGL_EXPORT virtual const boost::optional& GetReferencePointUID_choice2_2() const; TIGL_EXPORT virtual void SetReferencePointUID_choice2_2(const boost::optional& value); diff --git a/src/generated/CPACSProfileBasedStructuralElements.cpp b/src/generated/CPACSProfileBasedStructuralElements.cpp index 729f1eacea..aa2096001a 100644 --- a/src/generated/CPACSProfileBasedStructuralElements.cpp +++ b/src/generated/CPACSProfileBasedStructuralElements.cpp @@ -108,6 +108,59 @@ namespace generated return m_profileBasedStructuralElements; } + size_t CPACSProfileBasedStructuralElements::GetProfileBasedStructuralElementCount() const + { + return m_profileBasedStructuralElements.size(); + } + + size_t CPACSProfileBasedStructuralElements::GetProfileBasedStructuralElementIndex(const std::string& UID) const + { + for (size_t i=0; i < GetProfileBasedStructuralElementCount(); i++) { + const std::string tmpUID(m_profileBasedStructuralElements[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSProfileBasedStructuralElements::GetProfileBasedStructuralElementIndex", TIGL_UID_ERROR); + } + + CCPACSProfileBasedStructuralElement& CPACSProfileBasedStructuralElements::GetProfileBasedStructuralElement(size_t index) + { + if (index < 1 || index > GetProfileBasedStructuralElementCount()) { + throw CTiglError("Invalid index in std::vector>::GetProfileBasedStructuralElement", TIGL_INDEX_ERROR); + } + index--; + return *m_profileBasedStructuralElements[index]; + } + + const CCPACSProfileBasedStructuralElement& CPACSProfileBasedStructuralElements::GetProfileBasedStructuralElement(size_t index) const + { + if (index < 1 || index > GetProfileBasedStructuralElementCount()) { + throw CTiglError("Invalid index in std::vector>::GetProfileBasedStructuralElement", TIGL_INDEX_ERROR); + } + index--; + return *m_profileBasedStructuralElements[index]; + } + + CCPACSProfileBasedStructuralElement& CPACSProfileBasedStructuralElements::GetProfileBasedStructuralElement(const std::string& UID) + { + for (auto& elem : m_profileBasedStructuralElements ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSProfileBasedStructuralElements::GetProfileBasedStructuralElement. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSProfileBasedStructuralElement& CPACSProfileBasedStructuralElements::GetProfileBasedStructuralElement(const std::string& UID) const + { + for (auto& elem : m_profileBasedStructuralElements ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSProfileBasedStructuralElements::GetProfileBasedStructuralElement. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSProfileBasedStructuralElement& CPACSProfileBasedStructuralElements::AddProfileBasedStructuralElement() { m_profileBasedStructuralElements.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSProfileBasedStructuralElements.h b/src/generated/CPACSProfileBasedStructuralElements.h index 592f90b0aa..ae53458511 100644 --- a/src/generated/CPACSProfileBasedStructuralElements.h +++ b/src/generated/CPACSProfileBasedStructuralElements.h @@ -64,6 +64,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetProfileBasedStructuralElements() const; TIGL_EXPORT virtual std::vector>& GetProfileBasedStructuralElements(); + TIGL_EXPORT virtual size_t GetProfileBasedStructuralElementCount() const; + TIGL_EXPORT virtual size_t GetProfileBasedStructuralElementIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSProfileBasedStructuralElement& GetProfileBasedStructuralElement(size_t index) const; + TIGL_EXPORT virtual CCPACSProfileBasedStructuralElement& GetProfileBasedStructuralElement(size_t index); + + TIGL_EXPORT virtual const CCPACSProfileBasedStructuralElement& GetProfileBasedStructuralElement(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSProfileBasedStructuralElement& GetProfileBasedStructuralElement(const std::string& UID); + TIGL_EXPORT virtual CCPACSProfileBasedStructuralElement& AddProfileBasedStructuralElement(); TIGL_EXPORT virtual void RemoveProfileBasedStructuralElement(CCPACSProfileBasedStructuralElement& ref); diff --git a/src/generated/CPACSProfiles.cpp b/src/generated/CPACSProfiles.cpp index 1f1d875fdd..3415e2a5f3 100644 --- a/src/generated/CPACSProfiles.cpp +++ b/src/generated/CPACSProfiles.cpp @@ -85,7 +85,7 @@ namespace generated { // read element fuselageProfiles if (tixi::TixiCheckElement(tixiHandle, xpath + "/fuselageProfiles")) { - m_fuselageProfiles = boost::in_place(reinterpret_cast(this), m_uidMgr); + m_fuselageProfiles = boost::in_place(this, m_uidMgr); try { m_fuselageProfiles->ReadCPACS(tixiHandle, xpath + "/fuselageProfiles"); } catch(const std::exception& e) { @@ -96,7 +96,7 @@ namespace generated // read element wingAirfoils if (tixi::TixiCheckElement(tixiHandle, xpath + "/wingAirfoils")) { - m_wingAirfoils = boost::in_place(reinterpret_cast(this), m_uidMgr); + m_wingAirfoils = boost::in_place(this, m_uidMgr); try { m_wingAirfoils->ReadCPACS(tixiHandle, xpath + "/wingAirfoils"); } catch(const std::exception& e) { @@ -107,7 +107,7 @@ namespace generated // read element guideCurves if (tixi::TixiCheckElement(tixiHandle, xpath + "/guideCurves")) { - m_guideCurves = boost::in_place(reinterpret_cast(this), m_uidMgr); + m_guideCurves = boost::in_place(this, m_uidMgr); try { m_guideCurves->ReadCPACS(tixiHandle, xpath + "/guideCurves"); } catch(const std::exception& e) { @@ -118,7 +118,7 @@ namespace generated // read element rotorAirfoils if (tixi::TixiCheckElement(tixiHandle, xpath + "/rotorAirfoils")) { - m_rotorAirfoils = boost::in_place(reinterpret_cast(this), m_uidMgr); + m_rotorAirfoils = boost::in_place(this, m_uidMgr); try { m_rotorAirfoils->ReadCPACS(tixiHandle, xpath + "/rotorAirfoils"); } catch(const std::exception& e) { @@ -129,7 +129,7 @@ namespace generated // read element structuralProfiles if (tixi::TixiCheckElement(tixiHandle, xpath + "/structuralProfiles")) { - m_structuralProfiles = boost::in_place(reinterpret_cast(this), m_uidMgr); + m_structuralProfiles = boost::in_place(this, m_uidMgr); try { m_structuralProfiles->ReadCPACS(tixiHandle, xpath + "/structuralProfiles"); } catch(const std::exception& e) { @@ -140,7 +140,7 @@ namespace generated // read element nacelleProfiles if (tixi::TixiCheckElement(tixiHandle, xpath + "/nacelleProfiles")) { - m_nacelleProfiles = boost::in_place(reinterpret_cast(this), m_uidMgr); + m_nacelleProfiles = boost::in_place(this, m_uidMgr); try { m_nacelleProfiles->ReadCPACS(tixiHandle, xpath + "/nacelleProfiles"); } catch(const std::exception& e) { @@ -151,7 +151,7 @@ namespace generated // read element curveProfiles if (tixi::TixiCheckElement(tixiHandle, xpath + "/curveProfiles")) { - m_curveProfiles = boost::in_place(reinterpret_cast(this), m_uidMgr); + m_curveProfiles = boost::in_place(this, m_uidMgr); try { m_curveProfiles->ReadCPACS(tixiHandle, xpath + "/curveProfiles"); } catch(const std::exception& e) { @@ -263,12 +263,12 @@ namespace generated return m_wingAirfoils; } - const boost::optional& CPACSProfiles::GetGuideCurves() const + const boost::optional& CPACSProfiles::GetGuideCurves() const { return m_guideCurves; } - boost::optional& CPACSProfiles::GetGuideCurves() + boost::optional& CPACSProfiles::GetGuideCurves() { return m_guideCurves; } @@ -283,12 +283,12 @@ namespace generated return m_rotorAirfoils; } - const boost::optional& CPACSProfiles::GetStructuralProfiles() const + const boost::optional& CPACSProfiles::GetStructuralProfiles() const { return m_structuralProfiles; } - boost::optional& CPACSProfiles::GetStructuralProfiles() + boost::optional& CPACSProfiles::GetStructuralProfiles() { return m_structuralProfiles; } @@ -316,7 +316,7 @@ namespace generated CCPACSFuselageProfiles& CPACSProfiles::GetFuselageProfiles(CreateIfNotExistsTag) { if (!m_fuselageProfiles) - m_fuselageProfiles = boost::in_place(reinterpret_cast(this), m_uidMgr); + m_fuselageProfiles = boost::in_place(this, m_uidMgr); return *m_fuselageProfiles; } @@ -328,7 +328,7 @@ namespace generated CCPACSWingProfiles& CPACSProfiles::GetWingAirfoils(CreateIfNotExistsTag) { if (!m_wingAirfoils) - m_wingAirfoils = boost::in_place(reinterpret_cast(this), m_uidMgr); + m_wingAirfoils = boost::in_place(this, m_uidMgr); return *m_wingAirfoils; } @@ -337,10 +337,10 @@ namespace generated m_wingAirfoils = boost::none; } - CCPACSGuideCurveProfiles& CPACSProfiles::GetGuideCurves(CreateIfNotExistsTag) + CPACSGuideCurveProfiles& CPACSProfiles::GetGuideCurves(CreateIfNotExistsTag) { if (!m_guideCurves) - m_guideCurves = boost::in_place(reinterpret_cast(this), m_uidMgr); + m_guideCurves = boost::in_place(this, m_uidMgr); return *m_guideCurves; } @@ -352,7 +352,7 @@ namespace generated CCPACSRotorProfiles& CPACSProfiles::GetRotorAirfoils(CreateIfNotExistsTag) { if (!m_rotorAirfoils) - m_rotorAirfoils = boost::in_place(reinterpret_cast(this), m_uidMgr); + m_rotorAirfoils = boost::in_place(this, m_uidMgr); return *m_rotorAirfoils; } @@ -361,10 +361,10 @@ namespace generated m_rotorAirfoils = boost::none; } - CCPACSStructuralProfiles& CPACSProfiles::GetStructuralProfiles(CreateIfNotExistsTag) + CPACSStructuralProfiles& CPACSProfiles::GetStructuralProfiles(CreateIfNotExistsTag) { if (!m_structuralProfiles) - m_structuralProfiles = boost::in_place(reinterpret_cast(this), m_uidMgr); + m_structuralProfiles = boost::in_place(this, m_uidMgr); return *m_structuralProfiles; } @@ -376,7 +376,7 @@ namespace generated CPACSNacelleProfiles& CPACSProfiles::GetNacelleProfiles(CreateIfNotExistsTag) { if (!m_nacelleProfiles) - m_nacelleProfiles = boost::in_place(reinterpret_cast(this), m_uidMgr); + m_nacelleProfiles = boost::in_place(this, m_uidMgr); return *m_nacelleProfiles; } @@ -388,7 +388,7 @@ namespace generated CPACSCurveProfiles& CPACSProfiles::GetCurveProfiles(CreateIfNotExistsTag) { if (!m_curveProfiles) - m_curveProfiles = boost::in_place(reinterpret_cast(this), m_uidMgr); + m_curveProfiles = boost::in_place(this, m_uidMgr); return *m_curveProfiles; } diff --git a/src/generated/CPACSProfiles.h b/src/generated/CPACSProfiles.h index 5f97d51c2b..2f4f9704da 100644 --- a/src/generated/CPACSProfiles.h +++ b/src/generated/CPACSProfiles.h @@ -20,14 +20,14 @@ #include #include #include -#include #include -#include #include #include #include #include "CPACSCurveProfiles.h" +#include "CPACSGuideCurveProfiles.h" #include "CPACSNacelleProfiles.h" +#include "CPACSStructuralProfiles.h" #include "CreateIfNotExists.h" #include "tigl_internal.h" @@ -73,14 +73,14 @@ namespace generated TIGL_EXPORT virtual const boost::optional& GetWingAirfoils() const; TIGL_EXPORT virtual boost::optional& GetWingAirfoils(); - TIGL_EXPORT virtual const boost::optional& GetGuideCurves() const; - TIGL_EXPORT virtual boost::optional& GetGuideCurves(); + TIGL_EXPORT virtual const boost::optional& GetGuideCurves() const; + TIGL_EXPORT virtual boost::optional& GetGuideCurves(); TIGL_EXPORT virtual const boost::optional& GetRotorAirfoils() const; TIGL_EXPORT virtual boost::optional& GetRotorAirfoils(); - TIGL_EXPORT virtual const boost::optional& GetStructuralProfiles() const; - TIGL_EXPORT virtual boost::optional& GetStructuralProfiles(); + TIGL_EXPORT virtual const boost::optional& GetStructuralProfiles() const; + TIGL_EXPORT virtual boost::optional& GetStructuralProfiles(); TIGL_EXPORT virtual const boost::optional& GetNacelleProfiles() const; TIGL_EXPORT virtual boost::optional& GetNacelleProfiles(); @@ -94,13 +94,13 @@ namespace generated TIGL_EXPORT virtual CCPACSWingProfiles& GetWingAirfoils(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveWingAirfoils(); - TIGL_EXPORT virtual CCPACSGuideCurveProfiles& GetGuideCurves(CreateIfNotExistsTag); + TIGL_EXPORT virtual CPACSGuideCurveProfiles& GetGuideCurves(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveGuideCurves(); TIGL_EXPORT virtual CCPACSRotorProfiles& GetRotorAirfoils(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveRotorAirfoils(); - TIGL_EXPORT virtual CCPACSStructuralProfiles& GetStructuralProfiles(CreateIfNotExistsTag); + TIGL_EXPORT virtual CPACSStructuralProfiles& GetStructuralProfiles(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveStructuralProfiles(); TIGL_EXPORT virtual CPACSNacelleProfiles& GetNacelleProfiles(CreateIfNotExistsTag); @@ -114,13 +114,13 @@ namespace generated CTiglUIDManager* m_uidMgr; - boost::optional m_fuselageProfiles; - boost::optional m_wingAirfoils; - boost::optional m_guideCurves; - boost::optional m_rotorAirfoils; - boost::optional m_structuralProfiles; - boost::optional m_nacelleProfiles; - boost::optional m_curveProfiles; + boost::optional m_fuselageProfiles; + boost::optional m_wingAirfoils; + boost::optional m_guideCurves; + boost::optional m_rotorAirfoils; + boost::optional m_structuralProfiles; + boost::optional m_nacelleProfiles; + boost::optional m_curveProfiles; private: CPACSProfiles(const CPACSProfiles&) = delete; @@ -131,8 +131,7 @@ namespace generated }; } // namespace generated -// CPACSProfiles is customized, use type CCPACSProfiles directly - // Aliases in tigl namespace +using CCPACSProfiles = generated::CPACSProfiles; using CCPACSVehicles = generated::CPACSVehicles; } // namespace tigl diff --git a/src/generated/CPACSRivets.cpp b/src/generated/CPACSRivets.cpp index 5065dc86cb..a69011fc7d 100644 --- a/src/generated/CPACSRivets.cpp +++ b/src/generated/CPACSRivets.cpp @@ -108,6 +108,59 @@ namespace generated return m_rivets; } + size_t CPACSRivets::GetRivetCount() const + { + return m_rivets.size(); + } + + size_t CPACSRivets::GetRivetIndex(const std::string& UID) const + { + for (size_t i=0; i < GetRivetCount(); i++) { + const std::string tmpUID(m_rivets[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSRivets::GetRivetIndex", TIGL_UID_ERROR); + } + + CPACSRivet& CPACSRivets::GetRivet(size_t index) + { + if (index < 1 || index > GetRivetCount()) { + throw CTiglError("Invalid index in std::vector>::GetRivet", TIGL_INDEX_ERROR); + } + index--; + return *m_rivets[index]; + } + + const CPACSRivet& CPACSRivets::GetRivet(size_t index) const + { + if (index < 1 || index > GetRivetCount()) { + throw CTiglError("Invalid index in std::vector>::GetRivet", TIGL_INDEX_ERROR); + } + index--; + return *m_rivets[index]; + } + + CPACSRivet& CPACSRivets::GetRivet(const std::string& UID) + { + for (auto& elem : m_rivets ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSRivets::GetRivet. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CPACSRivet& CPACSRivets::GetRivet(const std::string& UID) const + { + for (auto& elem : m_rivets ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSRivets::GetRivet. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CPACSRivet& CPACSRivets::AddRivet() { m_rivets.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSRivets.h b/src/generated/CPACSRivets.h index 61c2c1cf54..bc0bc3a357 100644 --- a/src/generated/CPACSRivets.h +++ b/src/generated/CPACSRivets.h @@ -63,6 +63,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetRivets() const; TIGL_EXPORT virtual std::vector>& GetRivets(); + TIGL_EXPORT virtual size_t GetRivetCount() const; + TIGL_EXPORT virtual size_t GetRivetIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CPACSRivet& GetRivet(size_t index) const; + TIGL_EXPORT virtual CPACSRivet& GetRivet(size_t index); + + TIGL_EXPORT virtual const CPACSRivet& GetRivet(const std::string& UID) const; + TIGL_EXPORT virtual CPACSRivet& GetRivet(const std::string& UID); + TIGL_EXPORT virtual CPACSRivet& AddRivet(); TIGL_EXPORT virtual void RemoveRivet(CPACSRivet& ref); diff --git a/src/generated/CPACSRotorAirfoils.cpp b/src/generated/CPACSRotorAirfoils.cpp index 47fd60d97b..0d6fc5dcc5 100644 --- a/src/generated/CPACSRotorAirfoils.cpp +++ b/src/generated/CPACSRotorAirfoils.cpp @@ -16,8 +16,8 @@ // limitations under the License. #include -#include "CCPACSProfiles.h" #include "CPACSProfileGeometry.h" +#include "CPACSProfiles.h" #include "CPACSRotorAirfoils.h" #include "CTiglError.h" #include "CTiglLogging.h" @@ -29,7 +29,7 @@ namespace tigl { namespace generated { - CPACSRotorAirfoils::CPACSRotorAirfoils(CCPACSProfiles* parent, CTiglUIDManager* uidMgr) + CPACSRotorAirfoils::CPACSRotorAirfoils(CPACSProfiles* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { //assert(parent != NULL); @@ -40,12 +40,12 @@ namespace generated { } - const CCPACSProfiles* CPACSRotorAirfoils::GetParent() const + const CPACSProfiles* CPACSRotorAirfoils::GetParent() const { return m_parent; } - CCPACSProfiles* CPACSRotorAirfoils::GetParent() + CPACSProfiles* CPACSRotorAirfoils::GetParent() { return m_parent; } @@ -108,6 +108,59 @@ namespace generated return m_rotorAirfoils; } + size_t CPACSRotorAirfoils::GetRotorAirfoilCount() const + { + return m_rotorAirfoils.size(); + } + + size_t CPACSRotorAirfoils::GetRotorAirfoilIndex(const std::string& UID) const + { + for (size_t i=0; i < GetRotorAirfoilCount(); i++) { + const std::string tmpUID(m_rotorAirfoils[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSRotorAirfoils::GetRotorAirfoilIndex", TIGL_UID_ERROR); + } + + CPACSProfileGeometry& CPACSRotorAirfoils::GetRotorAirfoil(size_t index) + { + if (index < 1 || index > GetRotorAirfoilCount()) { + throw CTiglError("Invalid index in std::vector>::GetRotorAirfoil", TIGL_INDEX_ERROR); + } + index--; + return *m_rotorAirfoils[index]; + } + + const CPACSProfileGeometry& CPACSRotorAirfoils::GetRotorAirfoil(size_t index) const + { + if (index < 1 || index > GetRotorAirfoilCount()) { + throw CTiglError("Invalid index in std::vector>::GetRotorAirfoil", TIGL_INDEX_ERROR); + } + index--; + return *m_rotorAirfoils[index]; + } + + CPACSProfileGeometry& CPACSRotorAirfoils::GetRotorAirfoil(const std::string& UID) + { + for (auto& elem : m_rotorAirfoils ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSRotorAirfoils::GetRotorAirfoil. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CPACSProfileGeometry& CPACSRotorAirfoils::GetRotorAirfoil(const std::string& UID) const + { + for (auto& elem : m_rotorAirfoils ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSRotorAirfoils::GetRotorAirfoil. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CPACSProfileGeometry& CPACSRotorAirfoils::AddRotorAirfoil() { m_rotorAirfoils.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); diff --git a/src/generated/CPACSRotorAirfoils.h b/src/generated/CPACSRotorAirfoils.h index 1810cb0fbe..1229badca9 100644 --- a/src/generated/CPACSRotorAirfoils.h +++ b/src/generated/CPACSRotorAirfoils.h @@ -27,11 +27,11 @@ namespace tigl { class CTiglUIDManager; class CTiglUIDObject; -class CCPACSProfiles; namespace generated { class CPACSProfileGeometry; + class CPACSProfiles; // This class is used in: // CPACSProfiles @@ -44,13 +44,13 @@ namespace generated class CPACSRotorAirfoils { public: - TIGL_EXPORT CPACSRotorAirfoils(CCPACSProfiles* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSRotorAirfoils(CPACSProfiles* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSRotorAirfoils(); - TIGL_EXPORT CCPACSProfiles* GetParent(); + TIGL_EXPORT CPACSProfiles* GetParent(); - TIGL_EXPORT const CCPACSProfiles* GetParent() const; + TIGL_EXPORT const CPACSProfiles* GetParent() const; TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -64,11 +64,20 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetRotorAirfoils() const; TIGL_EXPORT virtual std::vector>& GetRotorAirfoils(); + TIGL_EXPORT virtual size_t GetRotorAirfoilCount() const; + TIGL_EXPORT virtual size_t GetRotorAirfoilIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CPACSProfileGeometry& GetRotorAirfoil(size_t index) const; + TIGL_EXPORT virtual CPACSProfileGeometry& GetRotorAirfoil(size_t index); + + TIGL_EXPORT virtual const CPACSProfileGeometry& GetRotorAirfoil(const std::string& UID) const; + TIGL_EXPORT virtual CPACSProfileGeometry& GetRotorAirfoil(const std::string& UID); + TIGL_EXPORT virtual CPACSProfileGeometry& AddRotorAirfoil(); TIGL_EXPORT virtual void RemoveRotorAirfoil(CPACSProfileGeometry& ref); protected: - CCPACSProfiles* m_parent; + CPACSProfiles* m_parent; CTiglUIDManager* m_uidMgr; @@ -87,4 +96,5 @@ namespace generated // Aliases in tigl namespace using CCPACSProfileGeometry = generated::CPACSProfileGeometry; +using CCPACSProfiles = generated::CPACSProfiles; } // namespace tigl diff --git a/src/generated/CPACSRotorBladeAttachments.cpp b/src/generated/CPACSRotorBladeAttachments.cpp index 51d7dd0b63..aa4138b403 100644 --- a/src/generated/CPACSRotorBladeAttachments.cpp +++ b/src/generated/CPACSRotorBladeAttachments.cpp @@ -102,6 +102,59 @@ namespace generated return m_rotorBladeAttachments; } + size_t CPACSRotorBladeAttachments::GetRotorBladeAttachmentCount() const + { + return m_rotorBladeAttachments.size(); + } + + size_t CPACSRotorBladeAttachments::GetRotorBladeAttachmentIndex(const std::string& UID) const + { + for (size_t i=0; i < GetRotorBladeAttachmentCount(); i++) { + const std::string tmpUID(m_rotorBladeAttachments[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSRotorBladeAttachments::GetRotorBladeAttachmentIndex", TIGL_UID_ERROR); + } + + CCPACSRotorBladeAttachment& CPACSRotorBladeAttachments::GetRotorBladeAttachment(size_t index) + { + if (index < 1 || index > GetRotorBladeAttachmentCount()) { + throw CTiglError("Invalid index in std::vector>::GetRotorBladeAttachment", TIGL_INDEX_ERROR); + } + index--; + return *m_rotorBladeAttachments[index]; + } + + const CCPACSRotorBladeAttachment& CPACSRotorBladeAttachments::GetRotorBladeAttachment(size_t index) const + { + if (index < 1 || index > GetRotorBladeAttachmentCount()) { + throw CTiglError("Invalid index in std::vector>::GetRotorBladeAttachment", TIGL_INDEX_ERROR); + } + index--; + return *m_rotorBladeAttachments[index]; + } + + CCPACSRotorBladeAttachment& CPACSRotorBladeAttachments::GetRotorBladeAttachment(const std::string& UID) + { + for (auto& elem : m_rotorBladeAttachments ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSRotorBladeAttachments::GetRotorBladeAttachment. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSRotorBladeAttachment& CPACSRotorBladeAttachments::GetRotorBladeAttachment(const std::string& UID) const + { + for (auto& elem : m_rotorBladeAttachments ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSRotorBladeAttachments::GetRotorBladeAttachment. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSRotorBladeAttachment& CPACSRotorBladeAttachments::AddRotorBladeAttachment() { m_rotorBladeAttachments.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); diff --git a/src/generated/CPACSRotorBladeAttachments.h b/src/generated/CPACSRotorBladeAttachments.h index 98b4203f69..b7dce4aacb 100644 --- a/src/generated/CPACSRotorBladeAttachments.h +++ b/src/generated/CPACSRotorBladeAttachments.h @@ -63,6 +63,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetRotorBladeAttachments() const; TIGL_EXPORT virtual std::vector>& GetRotorBladeAttachments(); + TIGL_EXPORT virtual size_t GetRotorBladeAttachmentCount() const; + TIGL_EXPORT virtual size_t GetRotorBladeAttachmentIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSRotorBladeAttachment& GetRotorBladeAttachment(size_t index) const; + TIGL_EXPORT virtual CCPACSRotorBladeAttachment& GetRotorBladeAttachment(size_t index); + + TIGL_EXPORT virtual const CCPACSRotorBladeAttachment& GetRotorBladeAttachment(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSRotorBladeAttachment& GetRotorBladeAttachment(const std::string& UID); + TIGL_EXPORT virtual CCPACSRotorBladeAttachment& AddRotorBladeAttachment(); TIGL_EXPORT virtual void RemoveRotorBladeAttachment(CCPACSRotorBladeAttachment& ref); diff --git a/src/generated/CPACSRotorBlades.cpp b/src/generated/CPACSRotorBlades.cpp index 092277098a..0fc22f9f32 100644 --- a/src/generated/CPACSRotorBlades.cpp +++ b/src/generated/CPACSRotorBlades.cpp @@ -102,6 +102,59 @@ namespace generated return m_rotorBlades; } + size_t CPACSRotorBlades::GetRotorBladeCount() const + { + return m_rotorBlades.size(); + } + + size_t CPACSRotorBlades::GetRotorBladeIndex(const std::string& UID) const + { + for (size_t i=0; i < GetRotorBladeCount(); i++) { + const std::string tmpUID(m_rotorBlades[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSRotorBlades::GetRotorBladeIndex", TIGL_UID_ERROR); + } + + CCPACSWing& CPACSRotorBlades::GetRotorBlade(size_t index) + { + if (index < 1 || index > GetRotorBladeCount()) { + throw CTiglError("Invalid index in std::vector>::GetRotorBlade", TIGL_INDEX_ERROR); + } + index--; + return *m_rotorBlades[index]; + } + + const CCPACSWing& CPACSRotorBlades::GetRotorBlade(size_t index) const + { + if (index < 1 || index > GetRotorBladeCount()) { + throw CTiglError("Invalid index in std::vector>::GetRotorBlade", TIGL_INDEX_ERROR); + } + index--; + return *m_rotorBlades[index]; + } + + CCPACSWing& CPACSRotorBlades::GetRotorBlade(const std::string& UID) + { + for (auto& elem : m_rotorBlades ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSRotorBlades::GetRotorBlade. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSWing& CPACSRotorBlades::GetRotorBlade(const std::string& UID) const + { + for (auto& elem : m_rotorBlades ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSRotorBlades::GetRotorBlade. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSWing& CPACSRotorBlades::AddRotorBlade() { m_rotorBlades.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); diff --git a/src/generated/CPACSRotorBlades.h b/src/generated/CPACSRotorBlades.h index 63fb369eef..559201df14 100644 --- a/src/generated/CPACSRotorBlades.h +++ b/src/generated/CPACSRotorBlades.h @@ -78,6 +78,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetRotorBlades() const; TIGL_EXPORT virtual std::vector>& GetRotorBlades(); + TIGL_EXPORT virtual size_t GetRotorBladeCount() const; + TIGL_EXPORT virtual size_t GetRotorBladeIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSWing& GetRotorBlade(size_t index) const; + TIGL_EXPORT virtual CCPACSWing& GetRotorBlade(size_t index); + + TIGL_EXPORT virtual const CCPACSWing& GetRotorBlade(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSWing& GetRotorBlade(const std::string& UID); + TIGL_EXPORT virtual CCPACSWing& AddRotorBlade(); TIGL_EXPORT virtual void RemoveRotorBlade(CCPACSWing& ref); diff --git a/src/generated/CPACSRotorHubHinges.cpp b/src/generated/CPACSRotorHubHinges.cpp index a3816a7bb9..d35516d937 100644 --- a/src/generated/CPACSRotorHubHinges.cpp +++ b/src/generated/CPACSRotorHubHinges.cpp @@ -102,6 +102,59 @@ namespace generated return m_hinges; } + size_t CPACSRotorHubHinges::GetHingeCount() const + { + return m_hinges.size(); + } + + size_t CPACSRotorHubHinges::GetHingeIndex(const std::string& UID) const + { + for (size_t i=0; i < GetHingeCount(); i++) { + const std::string tmpUID(m_hinges[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSRotorHubHinges::GetHingeIndex", TIGL_UID_ERROR); + } + + CCPACSRotorHinge& CPACSRotorHubHinges::GetHinge(size_t index) + { + if (index < 1 || index > GetHingeCount()) { + throw CTiglError("Invalid index in std::vector>::GetHinge", TIGL_INDEX_ERROR); + } + index--; + return *m_hinges[index]; + } + + const CCPACSRotorHinge& CPACSRotorHubHinges::GetHinge(size_t index) const + { + if (index < 1 || index > GetHingeCount()) { + throw CTiglError("Invalid index in std::vector>::GetHinge", TIGL_INDEX_ERROR); + } + index--; + return *m_hinges[index]; + } + + CCPACSRotorHinge& CPACSRotorHubHinges::GetHinge(const std::string& UID) + { + for (auto& elem : m_hinges ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSRotorHubHinges::GetHinge. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSRotorHinge& CPACSRotorHubHinges::GetHinge(const std::string& UID) const + { + for (auto& elem : m_hinges ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSRotorHubHinges::GetHinge. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSRotorHinge& CPACSRotorHubHinges::AddHinge() { m_hinges.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); diff --git a/src/generated/CPACSRotorHubHinges.h b/src/generated/CPACSRotorHubHinges.h index 07a0be9220..3a1e47dcce 100644 --- a/src/generated/CPACSRotorHubHinges.h +++ b/src/generated/CPACSRotorHubHinges.h @@ -63,6 +63,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetHinges() const; TIGL_EXPORT virtual std::vector>& GetHinges(); + TIGL_EXPORT virtual size_t GetHingeCount() const; + TIGL_EXPORT virtual size_t GetHingeIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSRotorHinge& GetHinge(size_t index) const; + TIGL_EXPORT virtual CCPACSRotorHinge& GetHinge(size_t index); + + TIGL_EXPORT virtual const CCPACSRotorHinge& GetHinge(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSRotorHinge& GetHinge(const std::string& UID); + TIGL_EXPORT virtual CCPACSRotorHinge& AddHinge(); TIGL_EXPORT virtual void RemoveHinge(CCPACSRotorHinge& ref); diff --git a/src/generated/CPACSRotorcraft.cpp b/src/generated/CPACSRotorcraft.cpp index 94e68354af..f6728053e4 100644 --- a/src/generated/CPACSRotorcraft.cpp +++ b/src/generated/CPACSRotorcraft.cpp @@ -108,6 +108,59 @@ namespace generated return m_models; } + size_t CPACSRotorcraft::GetModelCount() const + { + return m_models.size(); + } + + size_t CPACSRotorcraft::GetModelIndex(const std::string& UID) const + { + for (size_t i=0; i < GetModelCount(); i++) { + const std::string tmpUID(m_models[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSRotorcraft::GetModelIndex", TIGL_UID_ERROR); + } + + CCPACSRotorcraftModel& CPACSRotorcraft::GetModel(size_t index) + { + if (index < 1 || index > GetModelCount()) { + throw CTiglError("Invalid index in std::vector>::GetModel", TIGL_INDEX_ERROR); + } + index--; + return *m_models[index]; + } + + const CCPACSRotorcraftModel& CPACSRotorcraft::GetModel(size_t index) const + { + if (index < 1 || index > GetModelCount()) { + throw CTiglError("Invalid index in std::vector>::GetModel", TIGL_INDEX_ERROR); + } + index--; + return *m_models[index]; + } + + CCPACSRotorcraftModel& CPACSRotorcraft::GetModel(const std::string& UID) + { + for (auto& elem : m_models ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSRotorcraft::GetModel. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSRotorcraftModel& CPACSRotorcraft::GetModel(const std::string& UID) const + { + for (auto& elem : m_models ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSRotorcraft::GetModel. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSRotorcraftModel& CPACSRotorcraft::AddModel() { m_models.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSRotorcraft.h b/src/generated/CPACSRotorcraft.h index a82c9f74ee..b9d17a8414 100644 --- a/src/generated/CPACSRotorcraft.h +++ b/src/generated/CPACSRotorcraft.h @@ -70,6 +70,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetModels() const; TIGL_EXPORT virtual std::vector>& GetModels(); + TIGL_EXPORT virtual size_t GetModelCount() const; + TIGL_EXPORT virtual size_t GetModelIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSRotorcraftModel& GetModel(size_t index) const; + TIGL_EXPORT virtual CCPACSRotorcraftModel& GetModel(size_t index); + + TIGL_EXPORT virtual const CCPACSRotorcraftModel& GetModel(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSRotorcraftModel& GetModel(const std::string& UID); + TIGL_EXPORT virtual CCPACSRotorcraftModel& AddModel(); TIGL_EXPORT virtual void RemoveModel(CCPACSRotorcraftModel& ref); diff --git a/src/generated/CPACSRotorcraftModel.cpp b/src/generated/CPACSRotorcraftModel.cpp index 3bcfe3e197..48c7a13c29 100644 --- a/src/generated/CPACSRotorcraftModel.cpp +++ b/src/generated/CPACSRotorcraftModel.cpp @@ -308,12 +308,12 @@ namespace generated m_description = value; } - const boost::optional& CPACSRotorcraftModel::GetFuselages() const + const boost::optional& CPACSRotorcraftModel::GetFuselages() const { return m_fuselages; } - boost::optional& CPACSRotorcraftModel::GetFuselages() + boost::optional& CPACSRotorcraftModel::GetFuselages() { return m_fuselages; } @@ -368,7 +368,7 @@ namespace generated return m_systems; } - CCPACSFuselages& CPACSRotorcraftModel::GetFuselages(CreateIfNotExistsTag) + CPACSFuselages& CPACSRotorcraftModel::GetFuselages(CreateIfNotExistsTag) { if (!m_fuselages) m_fuselages = boost::in_place(reinterpret_cast(this), m_uidMgr); diff --git a/src/generated/CPACSRotorcraftModel.h b/src/generated/CPACSRotorcraftModel.h index dd3e4e4fb6..20b8204a74 100644 --- a/src/generated/CPACSRotorcraftModel.h +++ b/src/generated/CPACSRotorcraftModel.h @@ -21,12 +21,12 @@ #include #include #include -#include #include #include #include #include #include +#include "CPACSFuselages.h" #include "CreateIfNotExists.h" #include "CTiglUIDObject.h" #include "tigl_internal.h" @@ -81,8 +81,8 @@ 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& GetFuselages() const; - TIGL_EXPORT virtual boost::optional& GetFuselages(); + TIGL_EXPORT virtual const boost::optional& GetFuselages() const; + TIGL_EXPORT virtual boost::optional& GetFuselages(); TIGL_EXPORT virtual const boost::optional& GetWings() const; TIGL_EXPORT virtual boost::optional& GetWings(); @@ -99,7 +99,7 @@ namespace generated TIGL_EXPORT virtual const boost::optional& GetSystems() const; TIGL_EXPORT virtual boost::optional& GetSystems(); - TIGL_EXPORT virtual CCPACSFuselages& GetFuselages(CreateIfNotExistsTag); + TIGL_EXPORT virtual CPACSFuselages& GetFuselages(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveFuselages(); TIGL_EXPORT virtual CCPACSWings& GetWings(CreateIfNotExistsTag); @@ -130,7 +130,7 @@ namespace generated /// Description of rotorcraft model boost::optional m_description; - boost::optional m_fuselages; + boost::optional m_fuselages; boost::optional m_wings; diff --git a/src/generated/CPACSRotors.cpp b/src/generated/CPACSRotors.cpp index 8af75a6984..dd0c6ef81d 100644 --- a/src/generated/CPACSRotors.cpp +++ b/src/generated/CPACSRotors.cpp @@ -102,6 +102,59 @@ namespace generated return m_rotors; } + size_t CPACSRotors::GetRotorCount() const + { + return m_rotors.size(); + } + + size_t CPACSRotors::GetRotorIndex(const std::string& UID) const + { + for (size_t i=0; i < GetRotorCount(); i++) { + const std::string tmpUID(m_rotors[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSRotors::GetRotorIndex", TIGL_UID_ERROR); + } + + CCPACSRotor& CPACSRotors::GetRotor(size_t index) + { + if (index < 1 || index > GetRotorCount()) { + throw CTiglError("Invalid index in std::vector>::GetRotor", TIGL_INDEX_ERROR); + } + index--; + return *m_rotors[index]; + } + + const CCPACSRotor& CPACSRotors::GetRotor(size_t index) const + { + if (index < 1 || index > GetRotorCount()) { + throw CTiglError("Invalid index in std::vector>::GetRotor", TIGL_INDEX_ERROR); + } + index--; + return *m_rotors[index]; + } + + CCPACSRotor& CPACSRotors::GetRotor(const std::string& UID) + { + for (auto& elem : m_rotors ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSRotors::GetRotor. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSRotor& CPACSRotors::GetRotor(const std::string& UID) const + { + for (auto& elem : m_rotors ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSRotors::GetRotor. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSRotor& CPACSRotors::AddRotor() { m_rotors.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); diff --git a/src/generated/CPACSRotors.h b/src/generated/CPACSRotors.h index b5472d1f9b..ea288ca64a 100644 --- a/src/generated/CPACSRotors.h +++ b/src/generated/CPACSRotors.h @@ -63,6 +63,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetRotors() const; TIGL_EXPORT virtual std::vector>& GetRotors(); + TIGL_EXPORT virtual size_t GetRotorCount() const; + TIGL_EXPORT virtual size_t GetRotorIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSRotor& GetRotor(size_t index) const; + TIGL_EXPORT virtual CCPACSRotor& GetRotor(size_t index); + + TIGL_EXPORT virtual const CCPACSRotor& GetRotor(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSRotor& GetRotor(const std::string& UID); + TIGL_EXPORT virtual CCPACSRotor& AddRotor(); TIGL_EXPORT virtual void RemoveRotor(CCPACSRotor& ref); diff --git a/src/generated/CPACSSeatElements.cpp b/src/generated/CPACSSeatElements.cpp index a81e092336..8a4e49b112 100644 --- a/src/generated/CPACSSeatElements.cpp +++ b/src/generated/CPACSSeatElements.cpp @@ -108,6 +108,59 @@ namespace generated return m_seatElements; } + size_t CPACSSeatElements::GetSeatElementCount() const + { + return m_seatElements.size(); + } + + size_t CPACSSeatElements::GetSeatElementIndex(const std::string& UID) const + { + for (size_t i=0; i < GetSeatElementCount(); i++) { + const std::string tmpUID(m_seatElements[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSSeatElements::GetSeatElementIndex", TIGL_UID_ERROR); + } + + CPACSSeatElement& CPACSSeatElements::GetSeatElement(size_t index) + { + if (index < 1 || index > GetSeatElementCount()) { + throw CTiglError("Invalid index in std::vector>::GetSeatElement", TIGL_INDEX_ERROR); + } + index--; + return *m_seatElements[index]; + } + + const CPACSSeatElement& CPACSSeatElements::GetSeatElement(size_t index) const + { + if (index < 1 || index > GetSeatElementCount()) { + throw CTiglError("Invalid index in std::vector>::GetSeatElement", TIGL_INDEX_ERROR); + } + index--; + return *m_seatElements[index]; + } + + CPACSSeatElement& CPACSSeatElements::GetSeatElement(const std::string& UID) + { + for (auto& elem : m_seatElements ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSSeatElements::GetSeatElement. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CPACSSeatElement& CPACSSeatElements::GetSeatElement(const std::string& UID) const + { + for (auto& elem : m_seatElements ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSSeatElements::GetSeatElement. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CPACSSeatElement& CPACSSeatElements::AddSeatElement() { m_seatElements.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSSeatElements.h b/src/generated/CPACSSeatElements.h index a5bd4ccec3..323b65b4af 100644 --- a/src/generated/CPACSSeatElements.h +++ b/src/generated/CPACSSeatElements.h @@ -63,6 +63,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetSeatElements() const; TIGL_EXPORT virtual std::vector>& GetSeatElements(); + TIGL_EXPORT virtual size_t GetSeatElementCount() const; + TIGL_EXPORT virtual size_t GetSeatElementIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CPACSSeatElement& GetSeatElement(size_t index) const; + TIGL_EXPORT virtual CPACSSeatElement& GetSeatElement(size_t index); + + TIGL_EXPORT virtual const CPACSSeatElement& GetSeatElement(const std::string& UID) const; + TIGL_EXPORT virtual CPACSSeatElement& GetSeatElement(const std::string& UID); + TIGL_EXPORT virtual CPACSSeatElement& AddSeatElement(); TIGL_EXPORT virtual void RemoveSeatElement(CPACSSeatElement& ref); diff --git a/src/generated/CPACSSeatModules.cpp b/src/generated/CPACSSeatModules.cpp index 750e3132f8..de7ad9e1a2 100644 --- a/src/generated/CPACSSeatModules.cpp +++ b/src/generated/CPACSSeatModules.cpp @@ -108,6 +108,59 @@ namespace generated return m_seatModules; } + size_t CPACSSeatModules::GetSeatModuleCount() const + { + return m_seatModules.size(); + } + + size_t CPACSSeatModules::GetSeatModuleIndex(const std::string& UID) const + { + for (size_t i=0; i < GetSeatModuleCount(); i++) { + const std::string tmpUID(m_seatModules[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSSeatModules::GetSeatModuleIndex", TIGL_UID_ERROR); + } + + CPACSDeckComponent2DBase& CPACSSeatModules::GetSeatModule(size_t index) + { + if (index < 1 || index > GetSeatModuleCount()) { + throw CTiglError("Invalid index in std::vector>::GetSeatModule", TIGL_INDEX_ERROR); + } + index--; + return *m_seatModules[index]; + } + + const CPACSDeckComponent2DBase& CPACSSeatModules::GetSeatModule(size_t index) const + { + if (index < 1 || index > GetSeatModuleCount()) { + throw CTiglError("Invalid index in std::vector>::GetSeatModule", TIGL_INDEX_ERROR); + } + index--; + return *m_seatModules[index]; + } + + CPACSDeckComponent2DBase& CPACSSeatModules::GetSeatModule(const std::string& UID) + { + for (auto& elem : m_seatModules ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSSeatModules::GetSeatModule. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CPACSDeckComponent2DBase& CPACSSeatModules::GetSeatModule(const std::string& UID) const + { + for (auto& elem : m_seatModules ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSSeatModules::GetSeatModule. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CPACSDeckComponent2DBase& CPACSSeatModules::AddSeatModule() { m_seatModules.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSSeatModules.h b/src/generated/CPACSSeatModules.h index 7112416463..788b6ec7dd 100644 --- a/src/generated/CPACSSeatModules.h +++ b/src/generated/CPACSSeatModules.h @@ -63,6 +63,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetSeatModules() const; TIGL_EXPORT virtual std::vector>& GetSeatModules(); + TIGL_EXPORT virtual size_t GetSeatModuleCount() const; + TIGL_EXPORT virtual size_t GetSeatModuleIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CPACSDeckComponent2DBase& GetSeatModule(size_t index) const; + TIGL_EXPORT virtual CPACSDeckComponent2DBase& GetSeatModule(size_t index); + + TIGL_EXPORT virtual const CPACSDeckComponent2DBase& GetSeatModule(const std::string& UID) const; + TIGL_EXPORT virtual CPACSDeckComponent2DBase& GetSeatModule(const std::string& UID); + TIGL_EXPORT virtual CPACSDeckComponent2DBase& AddSeatModule(); TIGL_EXPORT virtual void RemoveSeatModule(CPACSDeckComponent2DBase& ref); diff --git a/src/generated/CPACSSheetBasedStructuralElements.cpp b/src/generated/CPACSSheetBasedStructuralElements.cpp index 0f1c82984e..23514e9e8b 100644 --- a/src/generated/CPACSSheetBasedStructuralElements.cpp +++ b/src/generated/CPACSSheetBasedStructuralElements.cpp @@ -108,6 +108,59 @@ namespace generated return m_sheetBasedStructuralElements; } + size_t CPACSSheetBasedStructuralElements::GetSheetBasedStructuralElementCount() const + { + return m_sheetBasedStructuralElements.size(); + } + + size_t CPACSSheetBasedStructuralElements::GetSheetBasedStructuralElementIndex(const std::string& UID) const + { + for (size_t i=0; i < GetSheetBasedStructuralElementCount(); i++) { + const std::string tmpUID(m_sheetBasedStructuralElements[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSSheetBasedStructuralElements::GetSheetBasedStructuralElementIndex", TIGL_UID_ERROR); + } + + CPACSSheetBasedStructuralElement& CPACSSheetBasedStructuralElements::GetSheetBasedStructuralElement(size_t index) + { + if (index < 1 || index > GetSheetBasedStructuralElementCount()) { + throw CTiglError("Invalid index in std::vector>::GetSheetBasedStructuralElement", TIGL_INDEX_ERROR); + } + index--; + return *m_sheetBasedStructuralElements[index]; + } + + const CPACSSheetBasedStructuralElement& CPACSSheetBasedStructuralElements::GetSheetBasedStructuralElement(size_t index) const + { + if (index < 1 || index > GetSheetBasedStructuralElementCount()) { + throw CTiglError("Invalid index in std::vector>::GetSheetBasedStructuralElement", TIGL_INDEX_ERROR); + } + index--; + return *m_sheetBasedStructuralElements[index]; + } + + CPACSSheetBasedStructuralElement& CPACSSheetBasedStructuralElements::GetSheetBasedStructuralElement(const std::string& UID) + { + for (auto& elem : m_sheetBasedStructuralElements ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSSheetBasedStructuralElements::GetSheetBasedStructuralElement. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CPACSSheetBasedStructuralElement& CPACSSheetBasedStructuralElements::GetSheetBasedStructuralElement(const std::string& UID) const + { + for (auto& elem : m_sheetBasedStructuralElements ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSSheetBasedStructuralElements::GetSheetBasedStructuralElement. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CPACSSheetBasedStructuralElement& CPACSSheetBasedStructuralElements::AddSheetBasedStructuralElement() { m_sheetBasedStructuralElements.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSSheetBasedStructuralElements.h b/src/generated/CPACSSheetBasedStructuralElements.h index c21bd991fc..e36672e21e 100644 --- a/src/generated/CPACSSheetBasedStructuralElements.h +++ b/src/generated/CPACSSheetBasedStructuralElements.h @@ -64,6 +64,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetSheetBasedStructuralElements() const; TIGL_EXPORT virtual std::vector>& GetSheetBasedStructuralElements(); + TIGL_EXPORT virtual size_t GetSheetBasedStructuralElementCount() const; + TIGL_EXPORT virtual size_t GetSheetBasedStructuralElementIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CPACSSheetBasedStructuralElement& GetSheetBasedStructuralElement(size_t index) const; + TIGL_EXPORT virtual CPACSSheetBasedStructuralElement& GetSheetBasedStructuralElement(size_t index); + + TIGL_EXPORT virtual const CPACSSheetBasedStructuralElement& GetSheetBasedStructuralElement(const std::string& UID) const; + TIGL_EXPORT virtual CPACSSheetBasedStructuralElement& GetSheetBasedStructuralElement(const std::string& UID); + TIGL_EXPORT virtual CPACSSheetBasedStructuralElement& AddSheetBasedStructuralElement(); TIGL_EXPORT virtual void RemoveSheetBasedStructuralElement(CPACSSheetBasedStructuralElement& ref); diff --git a/src/generated/CPACSSheetList.cpp b/src/generated/CPACSSheetList.cpp index c03d66a6ed..5ca938df3c 100644 --- a/src/generated/CPACSSheetList.cpp +++ b/src/generated/CPACSSheetList.cpp @@ -102,6 +102,59 @@ namespace generated return m_sheets; } + size_t CPACSSheetList::GetSheetCount() const + { + return m_sheets.size(); + } + + size_t CPACSSheetList::GetSheetIndex(const std::string& UID) const + { + for (size_t i=0; i < GetSheetCount(); i++) { + const std::string tmpUID(m_sheets[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSSheetList::GetSheetIndex", TIGL_UID_ERROR); + } + + CPACSSheet& CPACSSheetList::GetSheet(size_t index) + { + if (index < 1 || index > GetSheetCount()) { + throw CTiglError("Invalid index in std::vector>::GetSheet", TIGL_INDEX_ERROR); + } + index--; + return *m_sheets[index]; + } + + const CPACSSheet& CPACSSheetList::GetSheet(size_t index) const + { + if (index < 1 || index > GetSheetCount()) { + throw CTiglError("Invalid index in std::vector>::GetSheet", TIGL_INDEX_ERROR); + } + index--; + return *m_sheets[index]; + } + + CPACSSheet& CPACSSheetList::GetSheet(const std::string& UID) + { + for (auto& elem : m_sheets ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSSheetList::GetSheet. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CPACSSheet& CPACSSheetList::GetSheet(const std::string& UID) const + { + for (auto& elem : m_sheets ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSSheetList::GetSheet. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CPACSSheet& CPACSSheetList::AddSheet() { m_sheets.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); diff --git a/src/generated/CPACSSheetList.h b/src/generated/CPACSSheetList.h index a8c2209046..51b38d9175 100644 --- a/src/generated/CPACSSheetList.h +++ b/src/generated/CPACSSheetList.h @@ -65,6 +65,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetSheets() const; TIGL_EXPORT virtual std::vector>& GetSheets(); + TIGL_EXPORT virtual size_t GetSheetCount() const; + TIGL_EXPORT virtual size_t GetSheetIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CPACSSheet& GetSheet(size_t index) const; + TIGL_EXPORT virtual CPACSSheet& GetSheet(size_t index); + + TIGL_EXPORT virtual const CPACSSheet& GetSheet(const std::string& UID) const; + TIGL_EXPORT virtual CPACSSheet& GetSheet(const std::string& UID); + TIGL_EXPORT virtual CPACSSheet& AddSheet(); TIGL_EXPORT virtual void RemoveSheet(CPACSSheet& ref); diff --git a/src/generated/CPACSSheetList3D.cpp b/src/generated/CPACSSheetList3D.cpp index 9196d37501..5059f83474 100644 --- a/src/generated/CPACSSheetList3D.cpp +++ b/src/generated/CPACSSheetList3D.cpp @@ -102,6 +102,59 @@ namespace generated return m_sheet3Ds; } + size_t CPACSSheetList3D::GetSheet3DCount() const + { + return m_sheet3Ds.size(); + } + + size_t CPACSSheetList3D::GetSheet3DIndex(const std::string& UID) const + { + for (size_t i=0; i < GetSheet3DCount(); i++) { + const std::string tmpUID(m_sheet3Ds[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSSheetList3D::GetSheet3DIndex", TIGL_UID_ERROR); + } + + CPACSSheet3D& CPACSSheetList3D::GetSheet3D(size_t index) + { + if (index < 1 || index > GetSheet3DCount()) { + throw CTiglError("Invalid index in std::vector>::GetSheet3D", TIGL_INDEX_ERROR); + } + index--; + return *m_sheet3Ds[index]; + } + + const CPACSSheet3D& CPACSSheetList3D::GetSheet3D(size_t index) const + { + if (index < 1 || index > GetSheet3DCount()) { + throw CTiglError("Invalid index in std::vector>::GetSheet3D", TIGL_INDEX_ERROR); + } + index--; + return *m_sheet3Ds[index]; + } + + CPACSSheet3D& CPACSSheetList3D::GetSheet3D(const std::string& UID) + { + for (auto& elem : m_sheet3Ds ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSSheetList3D::GetSheet3D. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CPACSSheet3D& CPACSSheetList3D::GetSheet3D(const std::string& UID) const + { + for (auto& elem : m_sheet3Ds ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSSheetList3D::GetSheet3D. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CPACSSheet3D& CPACSSheetList3D::AddSheet3D() { m_sheet3Ds.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSSheetList3D.h b/src/generated/CPACSSheetList3D.h index 22c135f3ef..bdcecec706 100644 --- a/src/generated/CPACSSheetList3D.h +++ b/src/generated/CPACSSheetList3D.h @@ -63,6 +63,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetSheet3Ds() const; TIGL_EXPORT virtual std::vector>& GetSheet3Ds(); + TIGL_EXPORT virtual size_t GetSheet3DCount() const; + TIGL_EXPORT virtual size_t GetSheet3DIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CPACSSheet3D& GetSheet3D(size_t index) const; + TIGL_EXPORT virtual CPACSSheet3D& GetSheet3D(size_t index); + + TIGL_EXPORT virtual const CPACSSheet3D& GetSheet3D(const std::string& UID) const; + TIGL_EXPORT virtual CPACSSheet3D& GetSheet3D(const std::string& UID); + TIGL_EXPORT virtual CPACSSheet3D& AddSheet3D(); TIGL_EXPORT virtual void RemoveSheet3D(CPACSSheet3D& ref); diff --git a/src/generated/CPACSSideStruts.cpp b/src/generated/CPACSSideStruts.cpp index 75e7093d00..f0e6380107 100644 --- a/src/generated/CPACSSideStruts.cpp +++ b/src/generated/CPACSSideStruts.cpp @@ -108,6 +108,59 @@ namespace generated return m_sideStruts; } + size_t CPACSSideStruts::GetSideStrutCount() const + { + return m_sideStruts.size(); + } + + size_t CPACSSideStruts::GetSideStrutIndex(const std::string& UID) const + { + for (size_t i=0; i < GetSideStrutCount(); i++) { + const std::string tmpUID(m_sideStruts[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSSideStruts::GetSideStrutIndex", TIGL_UID_ERROR); + } + + CPACSStrutAssembly& CPACSSideStruts::GetSideStrut(size_t index) + { + if (index < 1 || index > GetSideStrutCount()) { + throw CTiglError("Invalid index in std::vector>::GetSideStrut", TIGL_INDEX_ERROR); + } + index--; + return *m_sideStruts[index]; + } + + const CPACSStrutAssembly& CPACSSideStruts::GetSideStrut(size_t index) const + { + if (index < 1 || index > GetSideStrutCount()) { + throw CTiglError("Invalid index in std::vector>::GetSideStrut", TIGL_INDEX_ERROR); + } + index--; + return *m_sideStruts[index]; + } + + CPACSStrutAssembly& CPACSSideStruts::GetSideStrut(const std::string& UID) + { + for (auto& elem : m_sideStruts ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSSideStruts::GetSideStrut. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CPACSStrutAssembly& CPACSSideStruts::GetSideStrut(const std::string& UID) const + { + for (auto& elem : m_sideStruts ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSSideStruts::GetSideStrut. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CPACSStrutAssembly& CPACSSideStruts::AddSideStrut() { m_sideStruts.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSSideStruts.h b/src/generated/CPACSSideStruts.h index c24dbb14ba..0201a77476 100644 --- a/src/generated/CPACSSideStruts.h +++ b/src/generated/CPACSSideStruts.h @@ -59,6 +59,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetSideStruts() const; TIGL_EXPORT virtual std::vector>& GetSideStruts(); + TIGL_EXPORT virtual size_t GetSideStrutCount() const; + TIGL_EXPORT virtual size_t GetSideStrutIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CPACSStrutAssembly& GetSideStrut(size_t index) const; + TIGL_EXPORT virtual CPACSStrutAssembly& GetSideStrut(size_t index); + + TIGL_EXPORT virtual const CPACSStrutAssembly& GetSideStrut(const std::string& UID) const; + TIGL_EXPORT virtual CPACSStrutAssembly& GetSideStrut(const std::string& UID); + TIGL_EXPORT virtual CPACSStrutAssembly& AddSideStrut(); TIGL_EXPORT virtual void RemoveSideStrut(CPACSStrutAssembly& ref); diff --git a/src/generated/CPACSSidewallPanelElements.cpp b/src/generated/CPACSSidewallPanelElements.cpp index 4b44ca25d4..4de5a64803 100644 --- a/src/generated/CPACSSidewallPanelElements.cpp +++ b/src/generated/CPACSSidewallPanelElements.cpp @@ -108,6 +108,59 @@ namespace generated return m_sidewallPanelElements; } + size_t CPACSSidewallPanelElements::GetSidewallPanelElementCount() const + { + return m_sidewallPanelElements.size(); + } + + size_t CPACSSidewallPanelElements::GetSidewallPanelElementIndex(const std::string& UID) const + { + for (size_t i=0; i < GetSidewallPanelElementCount(); i++) { + const std::string tmpUID(m_sidewallPanelElements[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSSidewallPanelElements::GetSidewallPanelElementIndex", TIGL_UID_ERROR); + } + + CPACSDeckElementBase& CPACSSidewallPanelElements::GetSidewallPanelElement(size_t index) + { + if (index < 1 || index > GetSidewallPanelElementCount()) { + throw CTiglError("Invalid index in std::vector>::GetSidewallPanelElement", TIGL_INDEX_ERROR); + } + index--; + return *m_sidewallPanelElements[index]; + } + + const CPACSDeckElementBase& CPACSSidewallPanelElements::GetSidewallPanelElement(size_t index) const + { + if (index < 1 || index > GetSidewallPanelElementCount()) { + throw CTiglError("Invalid index in std::vector>::GetSidewallPanelElement", TIGL_INDEX_ERROR); + } + index--; + return *m_sidewallPanelElements[index]; + } + + CPACSDeckElementBase& CPACSSidewallPanelElements::GetSidewallPanelElement(const std::string& UID) + { + for (auto& elem : m_sidewallPanelElements ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSSidewallPanelElements::GetSidewallPanelElement. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CPACSDeckElementBase& CPACSSidewallPanelElements::GetSidewallPanelElement(const std::string& UID) const + { + for (auto& elem : m_sidewallPanelElements ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSSidewallPanelElements::GetSidewallPanelElement. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CPACSDeckElementBase& CPACSSidewallPanelElements::AddSidewallPanelElement() { m_sidewallPanelElements.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSSidewallPanelElements.h b/src/generated/CPACSSidewallPanelElements.h index cdc82bd047..ff3150bd8c 100644 --- a/src/generated/CPACSSidewallPanelElements.h +++ b/src/generated/CPACSSidewallPanelElements.h @@ -63,6 +63,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetSidewallPanelElements() const; TIGL_EXPORT virtual std::vector>& GetSidewallPanelElements(); + TIGL_EXPORT virtual size_t GetSidewallPanelElementCount() const; + TIGL_EXPORT virtual size_t GetSidewallPanelElementIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CPACSDeckElementBase& GetSidewallPanelElement(size_t index) const; + TIGL_EXPORT virtual CPACSDeckElementBase& GetSidewallPanelElement(size_t index); + + TIGL_EXPORT virtual const CPACSDeckElementBase& GetSidewallPanelElement(const std::string& UID) const; + TIGL_EXPORT virtual CPACSDeckElementBase& GetSidewallPanelElement(const std::string& UID); + TIGL_EXPORT virtual CPACSDeckElementBase& AddSidewallPanelElement(); TIGL_EXPORT virtual void RemoveSidewallPanelElement(CPACSDeckElementBase& ref); diff --git a/src/generated/CPACSSkinSegments.cpp b/src/generated/CPACSSkinSegments.cpp index 30d8b4fec1..41133f3861 100644 --- a/src/generated/CPACSSkinSegments.cpp +++ b/src/generated/CPACSSkinSegments.cpp @@ -108,6 +108,59 @@ namespace generated return m_skinSegments; } + size_t CPACSSkinSegments::GetSkinSegmentCount() const + { + return m_skinSegments.size(); + } + + size_t CPACSSkinSegments::GetSkinSegmentIndex(const std::string& UID) const + { + for (size_t i=0; i < GetSkinSegmentCount(); i++) { + const std::string tmpUID(m_skinSegments[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSSkinSegments::GetSkinSegmentIndex", TIGL_UID_ERROR); + } + + CCPACSSkinSegment& CPACSSkinSegments::GetSkinSegment(size_t index) + { + if (index < 1 || index > GetSkinSegmentCount()) { + throw CTiglError("Invalid index in std::vector>::GetSkinSegment", TIGL_INDEX_ERROR); + } + index--; + return *m_skinSegments[index]; + } + + const CCPACSSkinSegment& CPACSSkinSegments::GetSkinSegment(size_t index) const + { + if (index < 1 || index > GetSkinSegmentCount()) { + throw CTiglError("Invalid index in std::vector>::GetSkinSegment", TIGL_INDEX_ERROR); + } + index--; + return *m_skinSegments[index]; + } + + CCPACSSkinSegment& CPACSSkinSegments::GetSkinSegment(const std::string& UID) + { + for (auto& elem : m_skinSegments ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSSkinSegments::GetSkinSegment. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSSkinSegment& CPACSSkinSegments::GetSkinSegment(const std::string& UID) const + { + for (auto& elem : m_skinSegments ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSSkinSegments::GetSkinSegment. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSSkinSegment& CPACSSkinSegments::AddSkinSegment() { m_skinSegments.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSSkinSegments.h b/src/generated/CPACSSkinSegments.h index e393ba0df1..aae3f1339d 100644 --- a/src/generated/CPACSSkinSegments.h +++ b/src/generated/CPACSSkinSegments.h @@ -63,6 +63,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetSkinSegments() const; TIGL_EXPORT virtual std::vector>& GetSkinSegments(); + TIGL_EXPORT virtual size_t GetSkinSegmentCount() const; + TIGL_EXPORT virtual size_t GetSkinSegmentIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSSkinSegment& GetSkinSegment(size_t index) const; + TIGL_EXPORT virtual CCPACSSkinSegment& GetSkinSegment(size_t index); + + TIGL_EXPORT virtual const CCPACSSkinSegment& GetSkinSegment(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSSkinSegment& GetSkinSegment(const std::string& UID); + TIGL_EXPORT virtual CCPACSSkinSegment& AddSkinSegment(); TIGL_EXPORT virtual void RemoveSkinSegment(CCPACSSkinSegment& ref); diff --git a/src/generated/CPACSSparCells.cpp b/src/generated/CPACSSparCells.cpp index e2feafedf1..f1e31ce4c6 100644 --- a/src/generated/CPACSSparCells.cpp +++ b/src/generated/CPACSSparCells.cpp @@ -108,6 +108,59 @@ namespace generated return m_sparCells; } + size_t CPACSSparCells::GetSparCellCount() const + { + return m_sparCells.size(); + } + + size_t CPACSSparCells::GetSparCellIndex(const std::string& UID) const + { + for (size_t i=0; i < GetSparCellCount(); i++) { + const std::string tmpUID(m_sparCells[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSSparCells::GetSparCellIndex", TIGL_UID_ERROR); + } + + CPACSSparCell& CPACSSparCells::GetSparCell(size_t index) + { + if (index < 1 || index > GetSparCellCount()) { + throw CTiglError("Invalid index in std::vector>::GetSparCell", TIGL_INDEX_ERROR); + } + index--; + return *m_sparCells[index]; + } + + const CPACSSparCell& CPACSSparCells::GetSparCell(size_t index) const + { + if (index < 1 || index > GetSparCellCount()) { + throw CTiglError("Invalid index in std::vector>::GetSparCell", TIGL_INDEX_ERROR); + } + index--; + return *m_sparCells[index]; + } + + CPACSSparCell& CPACSSparCells::GetSparCell(const std::string& UID) + { + for (auto& elem : m_sparCells ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSSparCells::GetSparCell. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CPACSSparCell& CPACSSparCells::GetSparCell(const std::string& UID) const + { + for (auto& elem : m_sparCells ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSSparCells::GetSparCell. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CPACSSparCell& CPACSSparCells::AddSparCell() { m_sparCells.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSSparCells.h b/src/generated/CPACSSparCells.h index 00999722a6..2ebe58ba3d 100644 --- a/src/generated/CPACSSparCells.h +++ b/src/generated/CPACSSparCells.h @@ -65,6 +65,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetSparCells() const; TIGL_EXPORT virtual std::vector>& GetSparCells(); + TIGL_EXPORT virtual size_t GetSparCellCount() const; + TIGL_EXPORT virtual size_t GetSparCellIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CPACSSparCell& GetSparCell(size_t index) const; + TIGL_EXPORT virtual CPACSSparCell& GetSparCell(size_t index); + + TIGL_EXPORT virtual const CPACSSparCell& GetSparCell(const std::string& UID) const; + TIGL_EXPORT virtual CPACSSparCell& GetSparCell(const std::string& UID); + TIGL_EXPORT virtual CPACSSparCell& AddSparCell(); TIGL_EXPORT virtual void RemoveSparCell(CPACSSparCell& ref); diff --git a/src/generated/CPACSSparPositions.cpp b/src/generated/CPACSSparPositions.cpp index e40c8a0725..48d0f6e63c 100644 --- a/src/generated/CPACSSparPositions.cpp +++ b/src/generated/CPACSSparPositions.cpp @@ -108,6 +108,59 @@ namespace generated return m_sparPositions; } + size_t CPACSSparPositions::GetSparPositionCount() const + { + return m_sparPositions.size(); + } + + size_t CPACSSparPositions::GetSparPositionIndex(const std::string& UID) const + { + for (size_t i=0; i < GetSparPositionCount(); i++) { + const std::string tmpUID(m_sparPositions[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSSparPositions::GetSparPositionIndex", TIGL_UID_ERROR); + } + + CCPACSWingSparPosition& CPACSSparPositions::GetSparPosition(size_t index) + { + if (index < 1 || index > GetSparPositionCount()) { + throw CTiglError("Invalid index in std::vector>::GetSparPosition", TIGL_INDEX_ERROR); + } + index--; + return *m_sparPositions[index]; + } + + const CCPACSWingSparPosition& CPACSSparPositions::GetSparPosition(size_t index) const + { + if (index < 1 || index > GetSparPositionCount()) { + throw CTiglError("Invalid index in std::vector>::GetSparPosition", TIGL_INDEX_ERROR); + } + index--; + return *m_sparPositions[index]; + } + + CCPACSWingSparPosition& CPACSSparPositions::GetSparPosition(const std::string& UID) + { + for (auto& elem : m_sparPositions ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSSparPositions::GetSparPosition. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSWingSparPosition& CPACSSparPositions::GetSparPosition(const std::string& UID) const + { + for (auto& elem : m_sparPositions ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSSparPositions::GetSparPosition. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSWingSparPosition& CPACSSparPositions::AddSparPosition() { m_sparPositions.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); diff --git a/src/generated/CPACSSparPositions.h b/src/generated/CPACSSparPositions.h index 95ceb32b81..93305ac39b 100644 --- a/src/generated/CPACSSparPositions.h +++ b/src/generated/CPACSSparPositions.h @@ -68,6 +68,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetSparPositions() const; TIGL_EXPORT virtual std::vector>& GetSparPositions(); + TIGL_EXPORT virtual size_t GetSparPositionCount() const; + TIGL_EXPORT virtual size_t GetSparPositionIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSWingSparPosition& GetSparPosition(size_t index) const; + TIGL_EXPORT virtual CCPACSWingSparPosition& GetSparPosition(size_t index); + + TIGL_EXPORT virtual const CCPACSWingSparPosition& GetSparPosition(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSWingSparPosition& GetSparPosition(const std::string& UID); + TIGL_EXPORT virtual CCPACSWingSparPosition& AddSparPosition(); TIGL_EXPORT virtual void RemoveSparPosition(CCPACSWingSparPosition& ref); diff --git a/src/generated/CPACSSparSegments.cpp b/src/generated/CPACSSparSegments.cpp index 84839c9b8b..8820ce8d6b 100644 --- a/src/generated/CPACSSparSegments.cpp +++ b/src/generated/CPACSSparSegments.cpp @@ -108,6 +108,59 @@ namespace generated return m_sparSegments; } + size_t CPACSSparSegments::GetSparSegmentCount() const + { + return m_sparSegments.size(); + } + + size_t CPACSSparSegments::GetSparSegmentIndex(const std::string& UID) const + { + for (size_t i=0; i < GetSparSegmentCount(); i++) { + const std::string tmpUID(m_sparSegments[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSSparSegments::GetSparSegmentIndex", TIGL_UID_ERROR); + } + + CCPACSWingSparSegment& CPACSSparSegments::GetSparSegment(size_t index) + { + if (index < 1 || index > GetSparSegmentCount()) { + throw CTiglError("Invalid index in std::vector>::GetSparSegment", TIGL_INDEX_ERROR); + } + index--; + return *m_sparSegments[index]; + } + + const CCPACSWingSparSegment& CPACSSparSegments::GetSparSegment(size_t index) const + { + if (index < 1 || index > GetSparSegmentCount()) { + throw CTiglError("Invalid index in std::vector>::GetSparSegment", TIGL_INDEX_ERROR); + } + index--; + return *m_sparSegments[index]; + } + + CCPACSWingSparSegment& CPACSSparSegments::GetSparSegment(const std::string& UID) + { + for (auto& elem : m_sparSegments ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSSparSegments::GetSparSegment. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSWingSparSegment& CPACSSparSegments::GetSparSegment(const std::string& UID) const + { + for (auto& elem : m_sparSegments ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSSparSegments::GetSparSegment. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSWingSparSegment& CPACSSparSegments::AddSparSegment() { m_sparSegments.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); diff --git a/src/generated/CPACSSparSegments.h b/src/generated/CPACSSparSegments.h index 77b6536891..fd0907073b 100644 --- a/src/generated/CPACSSparSegments.h +++ b/src/generated/CPACSSparSegments.h @@ -63,6 +63,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetSparSegments() const; TIGL_EXPORT virtual std::vector>& GetSparSegments(); + TIGL_EXPORT virtual size_t GetSparSegmentCount() const; + TIGL_EXPORT virtual size_t GetSparSegmentIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSWingSparSegment& GetSparSegment(size_t index) const; + TIGL_EXPORT virtual CCPACSWingSparSegment& GetSparSegment(size_t index); + + TIGL_EXPORT virtual const CCPACSWingSparSegment& GetSparSegment(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSWingSparSegment& GetSparSegment(const std::string& UID); + TIGL_EXPORT virtual CCPACSWingSparSegment& AddSparSegment(); TIGL_EXPORT virtual void RemoveSparSegment(CCPACSWingSparSegment& ref); diff --git a/src/generated/CPACSStringer.cpp b/src/generated/CPACSStringer.cpp index 92a20f033b..5686b0ec7f 100644 --- a/src/generated/CPACSStringer.cpp +++ b/src/generated/CPACSStringer.cpp @@ -141,6 +141,59 @@ namespace generated return m_stringerPositions; } + size_t CPACSStringer::GetStringerPositionCount() const + { + return m_stringerPositions.size(); + } + + size_t CPACSStringer::GetStringerPositionIndex(const std::string& UID) const + { + for (size_t i=0; i < GetStringerPositionCount(); i++) { + const std::string tmpUID(m_stringerPositions[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSStringer::GetStringerPositionIndex", TIGL_UID_ERROR); + } + + CCPACSFuselageStringerFramePosition& CPACSStringer::GetStringerPosition(size_t index) + { + if (index < 1 || index > GetStringerPositionCount()) { + throw CTiglError("Invalid index in std::vector>::GetStringerPosition", TIGL_INDEX_ERROR); + } + index--; + return *m_stringerPositions[index]; + } + + const CCPACSFuselageStringerFramePosition& CPACSStringer::GetStringerPosition(size_t index) const + { + if (index < 1 || index > GetStringerPositionCount()) { + throw CTiglError("Invalid index in std::vector>::GetStringerPosition", TIGL_INDEX_ERROR); + } + index--; + return *m_stringerPositions[index]; + } + + CCPACSFuselageStringerFramePosition& CPACSStringer::GetStringerPosition(const std::string& UID) + { + for (auto& elem : m_stringerPositions ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSStringer::GetStringerPosition. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSFuselageStringerFramePosition& CPACSStringer::GetStringerPosition(const std::string& UID) const + { + for (auto& elem : m_stringerPositions ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSStringer::GetStringerPosition. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSFuselageStringerFramePosition& CPACSStringer::AddStringerPosition() { m_stringerPositions.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); diff --git a/src/generated/CPACSStringer.h b/src/generated/CPACSStringer.h index 39afe62586..934c28f0e1 100644 --- a/src/generated/CPACSStringer.h +++ b/src/generated/CPACSStringer.h @@ -66,6 +66,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetStringerPositions() const; TIGL_EXPORT virtual std::vector>& GetStringerPositions(); + TIGL_EXPORT virtual size_t GetStringerPositionCount() const; + TIGL_EXPORT virtual size_t GetStringerPositionIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSFuselageStringerFramePosition& GetStringerPosition(size_t index) const; + TIGL_EXPORT virtual CCPACSFuselageStringerFramePosition& GetStringerPosition(size_t index); + + TIGL_EXPORT virtual const CCPACSFuselageStringerFramePosition& GetStringerPosition(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSFuselageStringerFramePosition& GetStringerPosition(const std::string& UID); + TIGL_EXPORT virtual CCPACSFuselageStringerFramePosition& AddStringerPosition(); TIGL_EXPORT virtual void RemoveStringerPosition(CCPACSFuselageStringerFramePosition& ref); diff --git a/src/generated/CPACSStringersAssembly.cpp b/src/generated/CPACSStringersAssembly.cpp index 1d05738161..64c428911d 100644 --- a/src/generated/CPACSStringersAssembly.cpp +++ b/src/generated/CPACSStringersAssembly.cpp @@ -133,6 +133,59 @@ namespace generated return m_stringers; } + size_t CPACSStringersAssembly::GetStringerCount() const + { + return m_stringers.size(); + } + + size_t CPACSStringersAssembly::GetStringerIndex(const std::string& UID) const + { + for (size_t i=0; i < GetStringerCount(); i++) { + const std::string tmpUID(m_stringers[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSStringersAssembly::GetStringerIndex", TIGL_UID_ERROR); + } + + CCPACSFuselageStringer& CPACSStringersAssembly::GetStringer(size_t index) + { + if (index < 1 || index > GetStringerCount()) { + throw CTiglError("Invalid index in std::vector>::GetStringer", TIGL_INDEX_ERROR); + } + index--; + return *m_stringers[index]; + } + + const CCPACSFuselageStringer& CPACSStringersAssembly::GetStringer(size_t index) const + { + if (index < 1 || index > GetStringerCount()) { + throw CTiglError("Invalid index in std::vector>::GetStringer", TIGL_INDEX_ERROR); + } + index--; + return *m_stringers[index]; + } + + CCPACSFuselageStringer& CPACSStringersAssembly::GetStringer(const std::string& UID) + { + for (auto& elem : m_stringers ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSStringersAssembly::GetStringer. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSFuselageStringer& CPACSStringersAssembly::GetStringer(const std::string& UID) const + { + for (auto& elem : m_stringers ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSStringersAssembly::GetStringer. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSFuselageStringer& CPACSStringersAssembly::AddStringer() { m_stringers.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); diff --git a/src/generated/CPACSStringersAssembly.h b/src/generated/CPACSStringersAssembly.h index 5b7526bfec..4334edfd43 100644 --- a/src/generated/CPACSStringersAssembly.h +++ b/src/generated/CPACSStringersAssembly.h @@ -93,6 +93,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetStringers() const; TIGL_EXPORT virtual std::vector>& GetStringers(); + TIGL_EXPORT virtual size_t GetStringerCount() const; + TIGL_EXPORT virtual size_t GetStringerIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSFuselageStringer& GetStringer(size_t index) const; + TIGL_EXPORT virtual CCPACSFuselageStringer& GetStringer(size_t index); + + TIGL_EXPORT virtual const CCPACSFuselageStringer& GetStringer(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSFuselageStringer& GetStringer(const std::string& UID); + TIGL_EXPORT virtual CCPACSFuselageStringer& AddStringer(); TIGL_EXPORT virtual void RemoveStringer(CCPACSFuselageStringer& ref); diff --git a/src/generated/CPACSStructuralElements.cpp b/src/generated/CPACSStructuralElements.cpp index bf471fbd4b..ac0d06de56 100644 --- a/src/generated/CPACSStructuralElements.cpp +++ b/src/generated/CPACSStructuralElements.cpp @@ -317,12 +317,12 @@ namespace generated return m_structuralWallElements; } - const boost::optional& CPACSStructuralElements::GetPressureBulkheads() const + const boost::optional& CPACSStructuralElements::GetPressureBulkheads() const { return m_pressureBulkheads; } - boost::optional& CPACSStructuralElements::GetPressureBulkheads() + boost::optional& CPACSStructuralElements::GetPressureBulkheads() { return m_pressureBulkheads; } @@ -337,12 +337,12 @@ namespace generated return m_windows; } - const boost::optional& CPACSStructuralElements::GetDoors() const + const boost::optional& CPACSStructuralElements::GetDoors() const { return m_doors; } - boost::optional& CPACSStructuralElements::GetDoors() + boost::optional& CPACSStructuralElements::GetDoors() { return m_doors; } @@ -413,7 +413,7 @@ namespace generated m_structuralWallElements = boost::none; } - CCPACSPressureBulkheads& CPACSStructuralElements::GetPressureBulkheads(CreateIfNotExistsTag) + CPACSPressureBulkheads& CPACSStructuralElements::GetPressureBulkheads(CreateIfNotExistsTag) { if (!m_pressureBulkheads) m_pressureBulkheads = boost::in_place(this, m_uidMgr); @@ -437,7 +437,7 @@ namespace generated m_windows = boost::none; } - CCPACSDoors& CPACSStructuralElements::GetDoors(CreateIfNotExistsTag) + CPACSDoors& CPACSStructuralElements::GetDoors(CreateIfNotExistsTag) { if (!m_doors) m_doors = boost::in_place(this, m_uidMgr); diff --git a/src/generated/CPACSStructuralElements.h b/src/generated/CPACSStructuralElements.h index bd897476ce..f9dfea00b3 100644 --- a/src/generated/CPACSStructuralElements.h +++ b/src/generated/CPACSStructuralElements.h @@ -19,11 +19,11 @@ #include #include -#include -#include #include #include +#include "CPACSDoors.h" #include "CPACSDoorSurroundStructuresAssembly.h" +#include "CPACSPressureBulkheads.h" #include "CPACSProfileBasedStructuralElements.h" #include "CPACSRivets.h" #include "CPACSSeatModules.h" @@ -79,14 +79,14 @@ namespace generated TIGL_EXPORT virtual const boost::optional& GetStructuralWallElements() const; TIGL_EXPORT virtual boost::optional& GetStructuralWallElements(); - TIGL_EXPORT virtual const boost::optional& GetPressureBulkheads() const; - TIGL_EXPORT virtual boost::optional& GetPressureBulkheads(); + TIGL_EXPORT virtual const boost::optional& GetPressureBulkheads() const; + TIGL_EXPORT virtual boost::optional& GetPressureBulkheads(); TIGL_EXPORT virtual const boost::optional& GetWindows() const; TIGL_EXPORT virtual boost::optional& GetWindows(); - TIGL_EXPORT virtual const boost::optional& GetDoors() const; - TIGL_EXPORT virtual boost::optional& GetDoors(); + TIGL_EXPORT virtual const boost::optional& GetDoors() const; + TIGL_EXPORT virtual boost::optional& GetDoors(); TIGL_EXPORT virtual const boost::optional& GetDoorSurroundStructures() const; TIGL_EXPORT virtual boost::optional& GetDoorSurroundStructures(); @@ -106,13 +106,13 @@ namespace generated TIGL_EXPORT virtual CPACSStructuralWallElements& GetStructuralWallElements(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveStructuralWallElements(); - TIGL_EXPORT virtual CCPACSPressureBulkheads& GetPressureBulkheads(CreateIfNotExistsTag); + TIGL_EXPORT virtual CPACSPressureBulkheads& GetPressureBulkheads(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemovePressureBulkheads(); TIGL_EXPORT virtual CPACSWindows& GetWindows(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveWindows(); - TIGL_EXPORT virtual CCPACSDoors& GetDoors(CreateIfNotExistsTag); + TIGL_EXPORT virtual CPACSDoors& GetDoors(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveDoors(); TIGL_EXPORT virtual CPACSDoorSurroundStructuresAssembly& GetDoorSurroundStructures(CreateIfNotExistsTag); @@ -135,11 +135,11 @@ namespace generated boost::optional m_structuralWallElements; - boost::optional m_pressureBulkheads; + boost::optional m_pressureBulkheads; boost::optional m_windows; - boost::optional m_doors; + boost::optional m_doors; boost::optional m_doorSurroundStructures; diff --git a/src/generated/CPACSStructuralProfile.cpp b/src/generated/CPACSStructuralProfile.cpp index adefaddb28..ad46d34c44 100644 --- a/src/generated/CPACSStructuralProfile.cpp +++ b/src/generated/CPACSStructuralProfile.cpp @@ -16,8 +16,8 @@ // limitations under the License. #include -#include "CCPACSStructuralProfiles.h" #include "CPACSStructuralProfile.h" +#include "CPACSStructuralProfiles.h" #include "CTiglError.h" #include "CTiglLogging.h" #include "CTiglUIDManager.h" @@ -27,7 +27,7 @@ namespace tigl { namespace generated { - CPACSStructuralProfile::CPACSStructuralProfile(CCPACSStructuralProfiles* parent, CTiglUIDManager* uidMgr) + CPACSStructuralProfile::CPACSStructuralProfile(CPACSStructuralProfiles* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) , m_pointList(this, m_uidMgr) , m_sheetList(this, m_uidMgr) @@ -41,12 +41,12 @@ namespace generated if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID); } - const CCPACSStructuralProfiles* CPACSStructuralProfile::GetParent() const + const CPACSStructuralProfiles* CPACSStructuralProfile::GetParent() const { return m_parent; } - CCPACSStructuralProfiles* CPACSStructuralProfile::GetParent() + CPACSStructuralProfiles* CPACSStructuralProfile::GetParent() { return m_parent; } diff --git a/src/generated/CPACSStructuralProfile.h b/src/generated/CPACSStructuralProfile.h index 3903749076..46c7c301d6 100644 --- a/src/generated/CPACSStructuralProfile.h +++ b/src/generated/CPACSStructuralProfile.h @@ -29,10 +29,11 @@ namespace tigl { class CTiglUIDManager; -class CCPACSStructuralProfiles; namespace generated { + class CPACSStructuralProfiles; + // This class is used in: // CPACSStructuralProfiles @@ -55,13 +56,13 @@ namespace generated class CPACSStructuralProfile : public CTiglReqUIDObject { public: - TIGL_EXPORT CPACSStructuralProfile(CCPACSStructuralProfiles* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSStructuralProfile(CPACSStructuralProfiles* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSStructuralProfile(); - TIGL_EXPORT CCPACSStructuralProfiles* GetParent(); + TIGL_EXPORT CPACSStructuralProfiles* GetParent(); - TIGL_EXPORT const CCPACSStructuralProfiles* GetParent() const; + TIGL_EXPORT const CPACSStructuralProfiles* GetParent() const; TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -88,7 +89,7 @@ namespace generated TIGL_EXPORT virtual CCPACSSheetList& GetSheetList(); protected: - CCPACSStructuralProfiles* m_parent; + CPACSStructuralProfiles* m_parent; CTiglUIDManager* m_uidMgr; @@ -117,4 +118,5 @@ namespace generated // Aliases in tigl namespace using CCPACSStructuralProfile = generated::CPACSStructuralProfile; +using CCPACSStructuralProfiles = generated::CPACSStructuralProfiles; } // namespace tigl diff --git a/src/generated/CPACSStructuralProfile3D.cpp b/src/generated/CPACSStructuralProfile3D.cpp index 6bbe920091..de1cb431ca 100644 --- a/src/generated/CPACSStructuralProfile3D.cpp +++ b/src/generated/CPACSStructuralProfile3D.cpp @@ -16,8 +16,8 @@ // limitations under the License. #include -#include "CCPACSStructuralProfiles.h" #include "CPACSStructuralProfile3D.h" +#include "CPACSStructuralProfiles.h" #include "CTiglError.h" #include "CTiglLogging.h" #include "CTiglUIDManager.h" @@ -27,7 +27,7 @@ namespace tigl { namespace generated { - CPACSStructuralProfile3D::CPACSStructuralProfile3D(CCPACSStructuralProfiles* parent, CTiglUIDManager* uidMgr) + CPACSStructuralProfile3D::CPACSStructuralProfile3D(CPACSStructuralProfiles* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) , m_pointList(this, m_uidMgr) , m_sheetList3D(this, m_uidMgr) @@ -41,12 +41,12 @@ namespace generated if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID); } - const CCPACSStructuralProfiles* CPACSStructuralProfile3D::GetParent() const + const CPACSStructuralProfiles* CPACSStructuralProfile3D::GetParent() const { return m_parent; } - CCPACSStructuralProfiles* CPACSStructuralProfile3D::GetParent() + CPACSStructuralProfiles* CPACSStructuralProfile3D::GetParent() { return m_parent; } diff --git a/src/generated/CPACSStructuralProfile3D.h b/src/generated/CPACSStructuralProfile3D.h index 2754b3c3f0..9564e0162b 100644 --- a/src/generated/CPACSStructuralProfile3D.h +++ b/src/generated/CPACSStructuralProfile3D.h @@ -29,10 +29,11 @@ namespace tigl { class CTiglUIDManager; -class CCPACSStructuralProfiles; namespace generated { + class CPACSStructuralProfiles; + // This class is used in: // CPACSStructuralProfiles @@ -43,13 +44,13 @@ namespace generated class CPACSStructuralProfile3D : public CTiglReqUIDObject { public: - TIGL_EXPORT CPACSStructuralProfile3D(CCPACSStructuralProfiles* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSStructuralProfile3D(CPACSStructuralProfiles* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSStructuralProfile3D(); - TIGL_EXPORT CCPACSStructuralProfiles* GetParent(); + TIGL_EXPORT CPACSStructuralProfiles* GetParent(); - TIGL_EXPORT const CCPACSStructuralProfiles* GetParent() const; + TIGL_EXPORT const CPACSStructuralProfiles* GetParent() const; TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -76,7 +77,7 @@ namespace generated TIGL_EXPORT virtual CPACSSheetList3D& GetSheetList3D(); protected: - CCPACSStructuralProfiles* m_parent; + CPACSStructuralProfiles* m_parent; CTiglUIDManager* m_uidMgr; @@ -97,4 +98,5 @@ namespace generated // Aliases in tigl namespace using CCPACSStructuralProfile3D = generated::CPACSStructuralProfile3D; +using CCPACSStructuralProfiles = generated::CPACSStructuralProfiles; } // namespace tigl diff --git a/src/generated/CPACSStructuralProfiles.cpp b/src/generated/CPACSStructuralProfiles.cpp index 55e0ec534b..94693289f5 100644 --- a/src/generated/CPACSStructuralProfiles.cpp +++ b/src/generated/CPACSStructuralProfiles.cpp @@ -16,7 +16,7 @@ // limitations under the License. #include -#include "CCPACSProfiles.h" +#include "CPACSProfiles.h" #include "CPACSStructuralProfile.h" #include "CPACSStructuralProfile3D.h" #include "CPACSStructuralProfiles.h" @@ -30,7 +30,7 @@ namespace tigl { namespace generated { - CPACSStructuralProfiles::CPACSStructuralProfiles(CCPACSProfiles* parent, CTiglUIDManager* uidMgr) + CPACSStructuralProfiles::CPACSStructuralProfiles(CPACSProfiles* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { //assert(parent != NULL); @@ -41,12 +41,12 @@ namespace generated { } - const CCPACSProfiles* CPACSStructuralProfiles::GetParent() const + const CPACSProfiles* CPACSStructuralProfiles::GetParent() const { return m_parent; } - CCPACSProfiles* CPACSStructuralProfiles::GetParent() + CPACSProfiles* CPACSStructuralProfiles::GetParent() { return m_parent; } @@ -87,12 +87,12 @@ namespace generated { // read element structuralProfile2D if (tixi::TixiCheckElement(tixiHandle, xpath + "/structuralProfile2D")) { - tixi::TixiReadElements(tixiHandle, xpath + "/structuralProfile2D", m_structuralProfile2Ds, 0, tixi::xsdUnbounded, reinterpret_cast(this), m_uidMgr); + tixi::TixiReadElements(tixiHandle, xpath + "/structuralProfile2D", m_structuralProfile2Ds, 0, tixi::xsdUnbounded, this, m_uidMgr); } // read element structuralProfile3D if (tixi::TixiCheckElement(tixiHandle, xpath + "/structuralProfile3D")) { - tixi::TixiReadElements(tixiHandle, xpath + "/structuralProfile3D", m_structuralProfile3Ds, 0, tixi::xsdUnbounded, reinterpret_cast(this), m_uidMgr); + tixi::TixiReadElements(tixiHandle, xpath + "/structuralProfile3D", m_structuralProfile3Ds, 0, tixi::xsdUnbounded, this, m_uidMgr); } } @@ -119,6 +119,59 @@ namespace generated return m_structuralProfile2Ds; } + size_t CPACSStructuralProfiles::GetStructuralProfile2DCount() const + { + return m_structuralProfile2Ds.size(); + } + + size_t CPACSStructuralProfiles::GetStructuralProfile2DIndex(const std::string& UID) const + { + for (size_t i=0; i < GetStructuralProfile2DCount(); i++) { + const std::string tmpUID(m_structuralProfile2Ds[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSStructuralProfiles::GetStructuralProfile2DIndex", TIGL_UID_ERROR); + } + + CPACSStructuralProfile& CPACSStructuralProfiles::GetStructuralProfile2D(size_t index) + { + if (index < 1 || index > GetStructuralProfile2DCount()) { + throw CTiglError("Invalid index in std::vector>::GetStructuralProfile2D", TIGL_INDEX_ERROR); + } + index--; + return *m_structuralProfile2Ds[index]; + } + + const CPACSStructuralProfile& CPACSStructuralProfiles::GetStructuralProfile2D(size_t index) const + { + if (index < 1 || index > GetStructuralProfile2DCount()) { + throw CTiglError("Invalid index in std::vector>::GetStructuralProfile2D", TIGL_INDEX_ERROR); + } + index--; + return *m_structuralProfile2Ds[index]; + } + + CPACSStructuralProfile& CPACSStructuralProfiles::GetStructuralProfile2D(const std::string& UID) + { + for (auto& elem : m_structuralProfile2Ds ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSStructuralProfiles::GetStructuralProfile2D. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CPACSStructuralProfile& CPACSStructuralProfiles::GetStructuralProfile2D(const std::string& UID) const + { + for (auto& elem : m_structuralProfile2Ds ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSStructuralProfiles::GetStructuralProfile2D. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const std::vector>& CPACSStructuralProfiles::GetStructuralProfile3Ds() const { return m_structuralProfile3Ds; @@ -129,9 +182,62 @@ namespace generated return m_structuralProfile3Ds; } + size_t CPACSStructuralProfiles::GetStructuralProfile3DCount() const + { + return m_structuralProfile3Ds.size(); + } + + size_t CPACSStructuralProfiles::GetStructuralProfile3DIndex(const std::string& UID) const + { + for (size_t i=0; i < GetStructuralProfile3DCount(); i++) { + const std::string tmpUID(m_structuralProfile3Ds[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSStructuralProfiles::GetStructuralProfile3DIndex", TIGL_UID_ERROR); + } + + CPACSStructuralProfile3D& CPACSStructuralProfiles::GetStructuralProfile3D(size_t index) + { + if (index < 1 || index > GetStructuralProfile3DCount()) { + throw CTiglError("Invalid index in std::vector>::GetStructuralProfile3D", TIGL_INDEX_ERROR); + } + index--; + return *m_structuralProfile3Ds[index]; + } + + const CPACSStructuralProfile3D& CPACSStructuralProfiles::GetStructuralProfile3D(size_t index) const + { + if (index < 1 || index > GetStructuralProfile3DCount()) { + throw CTiglError("Invalid index in std::vector>::GetStructuralProfile3D", TIGL_INDEX_ERROR); + } + index--; + return *m_structuralProfile3Ds[index]; + } + + CPACSStructuralProfile3D& CPACSStructuralProfiles::GetStructuralProfile3D(const std::string& UID) + { + for (auto& elem : m_structuralProfile3Ds ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSStructuralProfiles::GetStructuralProfile3D. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CPACSStructuralProfile3D& CPACSStructuralProfiles::GetStructuralProfile3D(const std::string& UID) const + { + for (auto& elem : m_structuralProfile3Ds ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSStructuralProfiles::GetStructuralProfile3D. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CPACSStructuralProfile& CPACSStructuralProfiles::AddStructuralProfile2D() { - m_structuralProfile2Ds.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); + m_structuralProfile2Ds.push_back(make_unique(this, m_uidMgr)); return *m_structuralProfile2Ds.back(); } @@ -148,7 +254,7 @@ namespace generated CPACSStructuralProfile3D& CPACSStructuralProfiles::AddStructuralProfile3D() { - m_structuralProfile3Ds.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); + m_structuralProfile3Ds.push_back(make_unique(this, m_uidMgr)); return *m_structuralProfile3Ds.back(); } diff --git a/src/generated/CPACSStructuralProfiles.h b/src/generated/CPACSStructuralProfiles.h index fb46b22b2c..88126bde2e 100644 --- a/src/generated/CPACSStructuralProfiles.h +++ b/src/generated/CPACSStructuralProfiles.h @@ -27,12 +27,12 @@ namespace tigl { class CTiglUIDManager; class CTiglUIDObject; -class CCPACSProfiles; namespace generated { class CPACSStructuralProfile; class CPACSStructuralProfile3D; + class CPACSProfiles; // This class is used in: // CPACSProfiles @@ -45,13 +45,13 @@ namespace generated class CPACSStructuralProfiles { public: - TIGL_EXPORT CPACSStructuralProfiles(CCPACSProfiles* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSStructuralProfiles(CPACSProfiles* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSStructuralProfiles(); - TIGL_EXPORT CCPACSProfiles* GetParent(); + TIGL_EXPORT CPACSProfiles* GetParent(); - TIGL_EXPORT const CCPACSProfiles* GetParent() const; + TIGL_EXPORT const CPACSProfiles* GetParent() const; TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -65,9 +65,27 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetStructuralProfile2Ds() const; TIGL_EXPORT virtual std::vector>& GetStructuralProfile2Ds(); + TIGL_EXPORT virtual size_t GetStructuralProfile2DCount() const; + TIGL_EXPORT virtual size_t GetStructuralProfile2DIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CPACSStructuralProfile& GetStructuralProfile2D(size_t index) const; + TIGL_EXPORT virtual CPACSStructuralProfile& GetStructuralProfile2D(size_t index); + + TIGL_EXPORT virtual const CPACSStructuralProfile& GetStructuralProfile2D(const std::string& UID) const; + TIGL_EXPORT virtual CPACSStructuralProfile& GetStructuralProfile2D(const std::string& UID); + TIGL_EXPORT virtual const std::vector>& GetStructuralProfile3Ds() const; TIGL_EXPORT virtual std::vector>& GetStructuralProfile3Ds(); + TIGL_EXPORT virtual size_t GetStructuralProfile3DCount() const; + TIGL_EXPORT virtual size_t GetStructuralProfile3DIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CPACSStructuralProfile3D& GetStructuralProfile3D(size_t index) const; + TIGL_EXPORT virtual CPACSStructuralProfile3D& GetStructuralProfile3D(size_t index); + + TIGL_EXPORT virtual const CPACSStructuralProfile3D& GetStructuralProfile3D(const std::string& UID) const; + TIGL_EXPORT virtual CPACSStructuralProfile3D& GetStructuralProfile3D(const std::string& UID); + TIGL_EXPORT virtual CPACSStructuralProfile& AddStructuralProfile2D(); TIGL_EXPORT virtual void RemoveStructuralProfile2D(CPACSStructuralProfile& ref); @@ -75,7 +93,7 @@ namespace generated TIGL_EXPORT virtual void RemoveStructuralProfile3D(CPACSStructuralProfile3D& ref); protected: - CCPACSProfiles* m_parent; + CPACSProfiles* m_parent; CTiglUIDManager* m_uidMgr; @@ -91,9 +109,9 @@ namespace generated }; } // namespace generated -// CPACSStructuralProfiles is customized, use type CCPACSStructuralProfiles directly - // Aliases in tigl namespace +using CCPACSStructuralProfiles = generated::CPACSStructuralProfiles; using CCPACSStructuralProfile = generated::CPACSStructuralProfile; using CCPACSStructuralProfile3D = generated::CPACSStructuralProfile3D; +using CCPACSProfiles = generated::CPACSProfiles; } // namespace tigl diff --git a/src/generated/CPACSStructuralWallElements.cpp b/src/generated/CPACSStructuralWallElements.cpp index a537f329ca..70c3d708f8 100644 --- a/src/generated/CPACSStructuralWallElements.cpp +++ b/src/generated/CPACSStructuralWallElements.cpp @@ -108,6 +108,59 @@ namespace generated return m_structuralWallElements; } + size_t CPACSStructuralWallElements::GetStructuralWallElementCount() const + { + return m_structuralWallElements.size(); + } + + size_t CPACSStructuralWallElements::GetStructuralWallElementIndex(const std::string& UID) const + { + for (size_t i=0; i < GetStructuralWallElementCount(); i++) { + const boost::optional tmpUID(*m_structuralWallElements[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSStructuralWallElements::GetStructuralWallElementIndex", TIGL_UID_ERROR); + } + + CPACSStructuralWallElement& CPACSStructuralWallElements::GetStructuralWallElement(size_t index) + { + if (index < 1 || index > GetStructuralWallElementCount()) { + throw CTiglError("Invalid index in std::vector>::GetStructuralWallElement", TIGL_INDEX_ERROR); + } + index--; + return *m_structuralWallElements[index]; + } + + const CPACSStructuralWallElement& CPACSStructuralWallElements::GetStructuralWallElement(size_t index) const + { + if (index < 1 || index > GetStructuralWallElementCount()) { + throw CTiglError("Invalid index in std::vector>::GetStructuralWallElement", TIGL_INDEX_ERROR); + } + index--; + return *m_structuralWallElements[index]; + } + + CPACSStructuralWallElement& CPACSStructuralWallElements::GetStructuralWallElement(const std::string& UID) + { + for (auto& elem : m_structuralWallElements ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSStructuralWallElements::GetStructuralWallElement. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CPACSStructuralWallElement& CPACSStructuralWallElements::GetStructuralWallElement(const std::string& UID) const + { + for (auto& elem : m_structuralWallElements ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSStructuralWallElements::GetStructuralWallElement. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CPACSStructuralWallElement& CPACSStructuralWallElements::AddStructuralWallElement() { m_structuralWallElements.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSStructuralWallElements.h b/src/generated/CPACSStructuralWallElements.h index 4a4dd04078..3e96fd69d2 100644 --- a/src/generated/CPACSStructuralWallElements.h +++ b/src/generated/CPACSStructuralWallElements.h @@ -59,6 +59,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetStructuralWallElements() const; TIGL_EXPORT virtual std::vector>& GetStructuralWallElements(); + TIGL_EXPORT virtual size_t GetStructuralWallElementCount() const; + TIGL_EXPORT virtual size_t GetStructuralWallElementIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CPACSStructuralWallElement& GetStructuralWallElement(size_t index) const; + TIGL_EXPORT virtual CPACSStructuralWallElement& GetStructuralWallElement(size_t index); + + TIGL_EXPORT virtual const CPACSStructuralWallElement& GetStructuralWallElement(const std::string& UID) const; + TIGL_EXPORT virtual CPACSStructuralWallElement& GetStructuralWallElement(const std::string& UID); + TIGL_EXPORT virtual CPACSStructuralWallElement& AddStructuralWallElement(); TIGL_EXPORT virtual void RemoveStructuralWallElement(CPACSStructuralWallElement& ref); diff --git a/src/generated/CPACSTrackJointPositions.cpp b/src/generated/CPACSTrackJointPositions.cpp index 1e336d1293..03e26fe2d2 100644 --- a/src/generated/CPACSTrackJointPositions.cpp +++ b/src/generated/CPACSTrackJointPositions.cpp @@ -90,6 +90,30 @@ namespace generated return m_jointPositions; } + size_t CPACSTrackJointPositions::GetJointPositionCount() const + { + return m_jointPositions.size(); + } + + CPACSTrackJointPosition& CPACSTrackJointPositions::GetJointPosition(size_t index) + { + if (index < 1 || index > GetJointPositionCount()) { + throw CTiglError("Invalid index in std::vector>::GetJointPosition", TIGL_INDEX_ERROR); + } + index--; + return *m_jointPositions[index]; + } + + const CPACSTrackJointPosition& CPACSTrackJointPositions::GetJointPosition(size_t index) const + { + if (index < 1 || index > GetJointPositionCount()) { + throw CTiglError("Invalid index in std::vector>::GetJointPosition", TIGL_INDEX_ERROR); + } + index--; + return *m_jointPositions[index]; + } + + CPACSTrackJointPosition& CPACSTrackJointPositions::AddJointPosition() { m_jointPositions.push_back(make_unique(this)); diff --git a/src/generated/CPACSTrackJointPositions.h b/src/generated/CPACSTrackJointPositions.h index 54038756d9..5449e0a396 100644 --- a/src/generated/CPACSTrackJointPositions.h +++ b/src/generated/CPACSTrackJointPositions.h @@ -59,6 +59,11 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetJointPositions() const; TIGL_EXPORT virtual std::vector>& GetJointPositions(); + TIGL_EXPORT virtual size_t GetJointPositionCount() const; + + TIGL_EXPORT virtual const CPACSTrackJointPosition& GetJointPosition(size_t index) const; + TIGL_EXPORT virtual CPACSTrackJointPosition& GetJointPosition(size_t index); + TIGL_EXPORT virtual CPACSTrackJointPosition& AddJointPosition(); TIGL_EXPORT virtual void RemoveJointPosition(CPACSTrackJointPosition& ref); diff --git a/src/generated/CPACSTrackStruts.cpp b/src/generated/CPACSTrackStruts.cpp index d36f938ee6..c3ad4bd96c 100644 --- a/src/generated/CPACSTrackStruts.cpp +++ b/src/generated/CPACSTrackStruts.cpp @@ -108,6 +108,30 @@ namespace generated return m_struts; } + size_t CPACSTrackStruts::GetStrutCount() const + { + return m_struts.size(); + } + + CPACSTrackStrut& CPACSTrackStruts::GetStrut(size_t index) + { + if (index < 1 || index > GetStrutCount()) { + throw CTiglError("Invalid index in std::vector>::GetStrut", TIGL_INDEX_ERROR); + } + index--; + return *m_struts[index]; + } + + const CPACSTrackStrut& CPACSTrackStruts::GetStrut(size_t index) const + { + if (index < 1 || index > GetStrutCount()) { + throw CTiglError("Invalid index in std::vector>::GetStrut", TIGL_INDEX_ERROR); + } + index--; + return *m_struts[index]; + } + + CPACSTrackStrut& CPACSTrackStruts::AddStrut() { m_struts.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSTrackStruts.h b/src/generated/CPACSTrackStruts.h index e7bd0e7d21..7fcdbd6c61 100644 --- a/src/generated/CPACSTrackStruts.h +++ b/src/generated/CPACSTrackStruts.h @@ -63,6 +63,11 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetStruts() const; TIGL_EXPORT virtual std::vector>& GetStruts(); + TIGL_EXPORT virtual size_t GetStrutCount() const; + + TIGL_EXPORT virtual const CPACSTrackStrut& GetStrut(size_t index) const; + TIGL_EXPORT virtual CPACSTrackStrut& GetStrut(size_t index); + TIGL_EXPORT virtual CPACSTrackStrut& AddStrut(); TIGL_EXPORT virtual void RemoveStrut(CPACSTrackStrut& ref); diff --git a/src/generated/CPACSTrailingEdgeDevice.cpp b/src/generated/CPACSTrailingEdgeDevice.cpp index 061b3282f6..d81ab835f4 100644 --- a/src/generated/CPACSTrailingEdgeDevice.cpp +++ b/src/generated/CPACSTrailingEdgeDevice.cpp @@ -16,8 +16,8 @@ // limitations under the License. #include -#include "CCPACSTrailingEdgeDevices.h" #include "CPACSTrailingEdgeDevice.h" +#include "CPACSTrailingEdgeDevices.h" #include "CTiglError.h" #include "CTiglLogging.h" #include "CTiglUIDManager.h" @@ -27,7 +27,7 @@ namespace tigl { namespace generated { - CPACSTrailingEdgeDevice::CPACSTrailingEdgeDevice(CCPACSTrailingEdgeDevices* parent, CTiglUIDManager* uidMgr) + CPACSTrailingEdgeDevice::CPACSTrailingEdgeDevice(CPACSTrailingEdgeDevices* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) , m_outerShape(reinterpret_cast(this), m_uidMgr) , m_path(reinterpret_cast(this), m_uidMgr) @@ -44,12 +44,12 @@ namespace generated } } - const CCPACSTrailingEdgeDevices* CPACSTrailingEdgeDevice::GetParent() const + const CPACSTrailingEdgeDevices* CPACSTrailingEdgeDevice::GetParent() const { return m_parent; } - CCPACSTrailingEdgeDevices* CPACSTrailingEdgeDevice::GetParent() + CPACSTrailingEdgeDevices* CPACSTrailingEdgeDevice::GetParent() { return m_parent; } diff --git a/src/generated/CPACSTrailingEdgeDevice.h b/src/generated/CPACSTrailingEdgeDevice.h index e2b9512d36..1b5499c313 100644 --- a/src/generated/CPACSTrailingEdgeDevice.h +++ b/src/generated/CPACSTrailingEdgeDevice.h @@ -34,10 +34,11 @@ namespace tigl { class CTiglUIDManager; -class CCPACSTrailingEdgeDevices; namespace generated { + class CPACSTrailingEdgeDevices; + // This class is used in: // CPACSTrailingEdgeDevices @@ -63,13 +64,13 @@ namespace generated class CPACSTrailingEdgeDevice : public CTiglReqUIDObject, public ITiglUIDRefObject { public: - TIGL_EXPORT CPACSTrailingEdgeDevice(CCPACSTrailingEdgeDevices* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSTrailingEdgeDevice(CPACSTrailingEdgeDevices* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSTrailingEdgeDevice(); - TIGL_EXPORT CCPACSTrailingEdgeDevices* GetParent(); + TIGL_EXPORT CPACSTrailingEdgeDevices* GetParent(); - TIGL_EXPORT const CCPACSTrailingEdgeDevices* GetParent() const; + TIGL_EXPORT const CPACSTrailingEdgeDevices* GetParent() const; TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -117,7 +118,7 @@ namespace generated TIGL_EXPORT virtual void RemoveTracks(); protected: - CCPACSTrailingEdgeDevices* m_parent; + CPACSTrailingEdgeDevices* m_parent; CTiglUIDManager* m_uidMgr; @@ -159,4 +160,7 @@ namespace generated } // namespace generated // CPACSTrailingEdgeDevice is customized, use type CCPACSTrailingEdgeDevice directly + +// Aliases in tigl namespace +using CCPACSTrailingEdgeDevices = generated::CPACSTrailingEdgeDevices; } // namespace tigl diff --git a/src/generated/CPACSTrailingEdgeDevices.cpp b/src/generated/CPACSTrailingEdgeDevices.cpp index cb7d72e515..5023f3065a 100644 --- a/src/generated/CPACSTrailingEdgeDevices.cpp +++ b/src/generated/CPACSTrailingEdgeDevices.cpp @@ -86,7 +86,7 @@ namespace generated { // read element trailingEdgeDevice if (tixi::TixiCheckElement(tixiHandle, xpath + "/trailingEdgeDevice")) { - tixi::TixiReadElements(tixiHandle, xpath + "/trailingEdgeDevice", m_trailingEdgeDevices, 1, tixi::xsdUnbounded, reinterpret_cast(this), m_uidMgr); + tixi::TixiReadElements(tixiHandle, xpath + "/trailingEdgeDevice", m_trailingEdgeDevices, 1, tixi::xsdUnbounded, this, m_uidMgr); } } @@ -108,9 +108,62 @@ namespace generated return m_trailingEdgeDevices; } + size_t CPACSTrailingEdgeDevices::GetTrailingEdgeDeviceCount() const + { + return m_trailingEdgeDevices.size(); + } + + size_t CPACSTrailingEdgeDevices::GetTrailingEdgeDeviceIndex(const std::string& UID) const + { + for (size_t i=0; i < GetTrailingEdgeDeviceCount(); i++) { + const std::string tmpUID(m_trailingEdgeDevices[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSTrailingEdgeDevices::GetTrailingEdgeDeviceIndex", TIGL_UID_ERROR); + } + + CCPACSTrailingEdgeDevice& CPACSTrailingEdgeDevices::GetTrailingEdgeDevice(size_t index) + { + if (index < 1 || index > GetTrailingEdgeDeviceCount()) { + throw CTiglError("Invalid index in std::vector>::GetTrailingEdgeDevice", TIGL_INDEX_ERROR); + } + index--; + return *m_trailingEdgeDevices[index]; + } + + const CCPACSTrailingEdgeDevice& CPACSTrailingEdgeDevices::GetTrailingEdgeDevice(size_t index) const + { + if (index < 1 || index > GetTrailingEdgeDeviceCount()) { + throw CTiglError("Invalid index in std::vector>::GetTrailingEdgeDevice", TIGL_INDEX_ERROR); + } + index--; + return *m_trailingEdgeDevices[index]; + } + + CCPACSTrailingEdgeDevice& CPACSTrailingEdgeDevices::GetTrailingEdgeDevice(const std::string& UID) + { + for (auto& elem : m_trailingEdgeDevices ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSTrailingEdgeDevices::GetTrailingEdgeDevice. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSTrailingEdgeDevice& CPACSTrailingEdgeDevices::GetTrailingEdgeDevice(const std::string& UID) const + { + for (auto& elem : m_trailingEdgeDevices ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSTrailingEdgeDevices::GetTrailingEdgeDevice. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSTrailingEdgeDevice& CPACSTrailingEdgeDevices::AddTrailingEdgeDevice() { - m_trailingEdgeDevices.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); + m_trailingEdgeDevices.push_back(make_unique(this, m_uidMgr)); return *m_trailingEdgeDevices.back(); } diff --git a/src/generated/CPACSTrailingEdgeDevices.h b/src/generated/CPACSTrailingEdgeDevices.h index 0664b18ff7..026676fc11 100644 --- a/src/generated/CPACSTrailingEdgeDevices.h +++ b/src/generated/CPACSTrailingEdgeDevices.h @@ -62,6 +62,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetTrailingEdgeDevices() const; TIGL_EXPORT virtual std::vector>& GetTrailingEdgeDevices(); + TIGL_EXPORT virtual size_t GetTrailingEdgeDeviceCount() const; + TIGL_EXPORT virtual size_t GetTrailingEdgeDeviceIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSTrailingEdgeDevice& GetTrailingEdgeDevice(size_t index) const; + TIGL_EXPORT virtual CCPACSTrailingEdgeDevice& GetTrailingEdgeDevice(size_t index); + + TIGL_EXPORT virtual const CCPACSTrailingEdgeDevice& GetTrailingEdgeDevice(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSTrailingEdgeDevice& GetTrailingEdgeDevice(const std::string& UID); + TIGL_EXPORT virtual CCPACSTrailingEdgeDevice& AddTrailingEdgeDevice(); TIGL_EXPORT virtual void RemoveTrailingEdgeDevice(CCPACSTrailingEdgeDevice& ref); @@ -81,5 +90,6 @@ namespace generated }; } // namespace generated -// CPACSTrailingEdgeDevices is customized, use type CCPACSTrailingEdgeDevices directly +// Aliases in tigl namespace +using CCPACSTrailingEdgeDevices = generated::CPACSTrailingEdgeDevices; } // namespace tigl diff --git a/src/generated/CPACSVehicleConfigurations.cpp b/src/generated/CPACSVehicleConfigurations.cpp index 9cebc6f0da..33289a0d95 100644 --- a/src/generated/CPACSVehicleConfigurations.cpp +++ b/src/generated/CPACSVehicleConfigurations.cpp @@ -102,6 +102,59 @@ namespace generated return m_configurations; } + size_t CPACSVehicleConfigurations::GetConfigurationCount() const + { + return m_configurations.size(); + } + + size_t CPACSVehicleConfigurations::GetConfigurationIndex(const std::string& UID) const + { + for (size_t i=0; i < GetConfigurationCount(); i++) { + const std::string tmpUID(m_configurations[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSVehicleConfigurations::GetConfigurationIndex", TIGL_UID_ERROR); + } + + CPACSVehicleConfiguration& CPACSVehicleConfigurations::GetConfiguration(size_t index) + { + if (index < 1 || index > GetConfigurationCount()) { + throw CTiglError("Invalid index in std::vector>::GetConfiguration", TIGL_INDEX_ERROR); + } + index--; + return *m_configurations[index]; + } + + const CPACSVehicleConfiguration& CPACSVehicleConfigurations::GetConfiguration(size_t index) const + { + if (index < 1 || index > GetConfigurationCount()) { + throw CTiglError("Invalid index in std::vector>::GetConfiguration", TIGL_INDEX_ERROR); + } + index--; + return *m_configurations[index]; + } + + CPACSVehicleConfiguration& CPACSVehicleConfigurations::GetConfiguration(const std::string& UID) + { + for (auto& elem : m_configurations ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSVehicleConfigurations::GetConfiguration. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CPACSVehicleConfiguration& CPACSVehicleConfigurations::GetConfiguration(const std::string& UID) const + { + for (auto& elem : m_configurations ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSVehicleConfigurations::GetConfiguration. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CPACSVehicleConfiguration& CPACSVehicleConfigurations::AddConfiguration() { m_configurations.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSVehicleConfigurations.h b/src/generated/CPACSVehicleConfigurations.h index 8622d08b2f..b3137b40ad 100644 --- a/src/generated/CPACSVehicleConfigurations.h +++ b/src/generated/CPACSVehicleConfigurations.h @@ -63,6 +63,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetConfigurations() const; TIGL_EXPORT virtual std::vector>& GetConfigurations(); + TIGL_EXPORT virtual size_t GetConfigurationCount() const; + TIGL_EXPORT virtual size_t GetConfigurationIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CPACSVehicleConfiguration& GetConfiguration(size_t index) const; + TIGL_EXPORT virtual CPACSVehicleConfiguration& GetConfiguration(size_t index); + + TIGL_EXPORT virtual const CPACSVehicleConfiguration& GetConfiguration(const std::string& UID) const; + TIGL_EXPORT virtual CPACSVehicleConfiguration& GetConfiguration(const std::string& UID); + TIGL_EXPORT virtual CPACSVehicleConfiguration& AddConfiguration(); TIGL_EXPORT virtual void RemoveConfiguration(CPACSVehicleConfiguration& ref); diff --git a/src/generated/CPACSVehicles.cpp b/src/generated/CPACSVehicles.cpp index 2508b5787b..1e47cbd997 100644 --- a/src/generated/CPACSVehicles.cpp +++ b/src/generated/CPACSVehicles.cpp @@ -327,22 +327,22 @@ namespace generated return m_flightPoints; } - const boost::optional& CPACSVehicles::GetEngines() const + const boost::optional& CPACSVehicles::GetEngines() const { return m_engines; } - boost::optional& CPACSVehicles::GetEngines() + boost::optional& CPACSVehicles::GetEngines() { return m_engines; } - const boost::optional& CPACSVehicles::GetProfiles() const + const boost::optional& CPACSVehicles::GetProfiles() const { return m_profiles; } - boost::optional& CPACSVehicles::GetProfiles() + boost::optional& CPACSVehicles::GetProfiles() { return m_profiles; } @@ -425,7 +425,7 @@ namespace generated m_flightPoints = boost::none; } - CCPACSEngines& CPACSVehicles::GetEngines(CreateIfNotExistsTag) + CPACSEngines& CPACSVehicles::GetEngines(CreateIfNotExistsTag) { if (!m_engines) m_engines = boost::in_place(this, m_uidMgr); @@ -437,7 +437,7 @@ namespace generated m_engines = boost::none; } - CCPACSProfiles& CPACSVehicles::GetProfiles(CreateIfNotExistsTag) + CPACSProfiles& CPACSVehicles::GetProfiles(CreateIfNotExistsTag) { if (!m_profiles) m_profiles = boost::in_place(this, m_uidMgr); diff --git a/src/generated/CPACSVehicles.h b/src/generated/CPACSVehicles.h index 0d83d839c4..df6867caf1 100644 --- a/src/generated/CPACSVehicles.h +++ b/src/generated/CPACSVehicles.h @@ -19,15 +19,15 @@ #include #include -#include -#include #include #include #include "CPACSAircraft.h" #include "CPACSDeckElements.h" +#include "CPACSEngines.h" #include "CPACSFlightPoints.h" #include "CPACSGlobalPerformanceCases.h" #include "CPACSMaterials.h" +#include "CPACSProfiles.h" #include "CPACSRotorcraft.h" #include "CPACSStructuralElements.h" #include "CreateIfNotExists.h" @@ -85,11 +85,11 @@ namespace generated TIGL_EXPORT virtual const boost::optional& GetFlightPoints() const; TIGL_EXPORT virtual boost::optional& GetFlightPoints(); - TIGL_EXPORT virtual const boost::optional& GetEngines() const; - TIGL_EXPORT virtual boost::optional& GetEngines(); + TIGL_EXPORT virtual const boost::optional& GetEngines() const; + TIGL_EXPORT virtual boost::optional& GetEngines(); - TIGL_EXPORT virtual const boost::optional& GetProfiles() const; - TIGL_EXPORT virtual boost::optional& GetProfiles(); + TIGL_EXPORT virtual const boost::optional& GetProfiles() const; + TIGL_EXPORT virtual boost::optional& GetProfiles(); TIGL_EXPORT virtual const boost::optional& GetStructuralElements() const; TIGL_EXPORT virtual boost::optional& GetStructuralElements(); @@ -112,10 +112,10 @@ namespace generated TIGL_EXPORT virtual CPACSFlightPoints& GetFlightPoints(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveFlightPoints(); - TIGL_EXPORT virtual CCPACSEngines& GetEngines(CreateIfNotExistsTag); + TIGL_EXPORT virtual CPACSEngines& GetEngines(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveEngines(); - TIGL_EXPORT virtual CCPACSProfiles& GetProfiles(CreateIfNotExistsTag); + TIGL_EXPORT virtual CPACSProfiles& GetProfiles(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveProfiles(); TIGL_EXPORT virtual CPACSStructuralElements& GetStructuralElements(CreateIfNotExistsTag); @@ -136,8 +136,8 @@ namespace generated boost::optional m_rotorcraft; boost::optional m_performanceCases; boost::optional m_flightPoints; - boost::optional m_engines; - boost::optional m_profiles; + boost::optional m_engines; + boost::optional m_profiles; boost::optional m_structuralElements; boost::optional m_deckElements; boost::optional m_materials; diff --git a/src/generated/CPACSVersionInfos.cpp b/src/generated/CPACSVersionInfos.cpp index 5158462fac..621a4f1c17 100644 --- a/src/generated/CPACSVersionInfos.cpp +++ b/src/generated/CPACSVersionInfos.cpp @@ -90,6 +90,30 @@ namespace generated return m_versionInfos; } + size_t CPACSVersionInfos::GetVersionInfoCount() const + { + return m_versionInfos.size(); + } + + CPACSVersionInfo& CPACSVersionInfos::GetVersionInfo(size_t index) + { + if (index < 1 || index > GetVersionInfoCount()) { + throw CTiglError("Invalid index in std::vector>::GetVersionInfo", TIGL_INDEX_ERROR); + } + index--; + return *m_versionInfos[index]; + } + + const CPACSVersionInfo& CPACSVersionInfos::GetVersionInfo(size_t index) const + { + if (index < 1 || index > GetVersionInfoCount()) { + throw CTiglError("Invalid index in std::vector>::GetVersionInfo", TIGL_INDEX_ERROR); + } + index--; + return *m_versionInfos[index]; + } + + CPACSVersionInfo& CPACSVersionInfos::AddVersionInfo() { m_versionInfos.push_back(make_unique(this)); diff --git a/src/generated/CPACSVersionInfos.h b/src/generated/CPACSVersionInfos.h index cfc5915dae..3cedca0dec 100644 --- a/src/generated/CPACSVersionInfos.h +++ b/src/generated/CPACSVersionInfos.h @@ -58,6 +58,11 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetVersionInfos() const; TIGL_EXPORT virtual std::vector>& GetVersionInfos(); + TIGL_EXPORT virtual size_t GetVersionInfoCount() const; + + TIGL_EXPORT virtual const CPACSVersionInfo& GetVersionInfo(size_t index) const; + TIGL_EXPORT virtual CPACSVersionInfo& GetVersionInfo(size_t index); + TIGL_EXPORT virtual CPACSVersionInfo& AddVersionInfo(); TIGL_EXPORT virtual void RemoveVersionInfo(CPACSVersionInfo& ref); diff --git a/src/generated/CPACSVessel.cpp b/src/generated/CPACSVessel.cpp index eeceb39b2a..70edb95d74 100644 --- a/src/generated/CPACSVessel.cpp +++ b/src/generated/CPACSVessel.cpp @@ -16,8 +16,8 @@ // limitations under the License. #include -#include "CCPACSVessels.h" #include "CPACSVessel.h" +#include "CPACSVessels.h" #include "CTiglError.h" #include "CTiglLogging.h" #include "CTiglUIDManager.h" @@ -27,7 +27,7 @@ namespace tigl { namespace generated { - CPACSVessel::CPACSVessel(CCPACSVessels* parent, CTiglUIDManager* uidMgr) + CPACSVessel::CPACSVessel(CPACSVessels* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) , m_transformation(reinterpret_cast(this), m_uidMgr) { @@ -40,12 +40,12 @@ namespace generated if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID); } - const CCPACSVessels* CPACSVessel::GetParent() const + const CPACSVessels* CPACSVessel::GetParent() const { return m_parent; } - CCPACSVessels* CPACSVessel::GetParent() + CPACSVessels* CPACSVessel::GetParent() { return m_parent; } @@ -404,12 +404,12 @@ namespace generated return m_transformation; } - const boost::optional& CPACSVessel::GetSections_choice1() const + const boost::optional& CPACSVessel::GetSections_choice1() const { return m_sections_choice1; } - boost::optional& CPACSVessel::GetSections_choice1() + boost::optional& CPACSVessel::GetSections_choice1() { return m_sections_choice1; } @@ -484,7 +484,7 @@ namespace generated m_burstPressure = value; } - CCPACSFuselageSections& CPACSVessel::GetSections_choice1(CreateIfNotExistsTag) + CPACSFuselageSections& CPACSVessel::GetSections_choice1(CreateIfNotExistsTag) { if (!m_sections_choice1) m_sections_choice1 = boost::in_place(reinterpret_cast(this), m_uidMgr); diff --git a/src/generated/CPACSVessel.h b/src/generated/CPACSVessel.h index 3d340772b1..1470a3e556 100644 --- a/src/generated/CPACSVessel.h +++ b/src/generated/CPACSVessel.h @@ -19,7 +19,6 @@ #include #include -#include #include #include #include @@ -27,6 +26,7 @@ #include #include "CPACSDomeType.h" #include "CPACSFuelTankVolume.h" +#include "CPACSFuselageSections.h" #include "CreateIfNotExists.h" #include "CTiglUIDObject.h" #include "tigl_internal.h" @@ -34,10 +34,11 @@ namespace tigl { class CTiglUIDManager; -class CCPACSVessels; namespace generated { + class CPACSVessels; + // This class is used in: // CPACSVessels @@ -47,13 +48,13 @@ namespace generated class CPACSVessel : public CTiglReqUIDObject { public: - TIGL_EXPORT CPACSVessel(CCPACSVessels* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSVessel(CPACSVessels* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSVessel(); - TIGL_EXPORT CCPACSVessels* GetParent(); + TIGL_EXPORT CPACSVessels* GetParent(); - TIGL_EXPORT const CCPACSVessels* GetParent() const; + TIGL_EXPORT const CPACSVessels* GetParent() const; TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -78,8 +79,8 @@ namespace generated TIGL_EXPORT virtual const CCPACSTransformation& GetTransformation() const; TIGL_EXPORT virtual CCPACSTransformation& GetTransformation(); - TIGL_EXPORT virtual const boost::optional& GetSections_choice1() const; - TIGL_EXPORT virtual boost::optional& GetSections_choice1(); + TIGL_EXPORT virtual const boost::optional& GetSections_choice1() const; + TIGL_EXPORT virtual boost::optional& GetSections_choice1(); TIGL_EXPORT virtual const boost::optional& GetSegments_choice1() const; TIGL_EXPORT virtual boost::optional& GetSegments_choice1(); @@ -102,7 +103,7 @@ namespace generated TIGL_EXPORT virtual const boost::optional& GetBurstPressure() const; TIGL_EXPORT virtual void SetBurstPressure(const boost::optional& value); - TIGL_EXPORT virtual CCPACSFuselageSections& GetSections_choice1(CreateIfNotExistsTag); + TIGL_EXPORT virtual CPACSFuselageSections& GetSections_choice1(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveSections_choice1(); TIGL_EXPORT virtual CCPACSFuselageSegments& GetSegments_choice1(CreateIfNotExistsTag); @@ -118,7 +119,7 @@ namespace generated TIGL_EXPORT virtual void RemoveVolume(); protected: - CCPACSVessels* m_parent; + CPACSVessels* m_parent; CTiglUIDManager* m_uidMgr; @@ -132,7 +133,7 @@ namespace generated CCPACSTransformation m_transformation; - boost::optional m_sections_choice1; + boost::optional m_sections_choice1; boost::optional m_segments_choice1; @@ -162,4 +163,7 @@ namespace generated } // namespace generated // CPACSVessel is customized, use type CCPACSVessel directly + +// Aliases in tigl namespace +using CCPACSVessels = generated::CPACSVessels; } // namespace tigl diff --git a/src/generated/CPACSVesselSkinLayers.cpp b/src/generated/CPACSVesselSkinLayers.cpp index d78d8784ec..422c4c0671 100644 --- a/src/generated/CPACSVesselSkinLayers.cpp +++ b/src/generated/CPACSVesselSkinLayers.cpp @@ -108,6 +108,30 @@ namespace generated return m_skinLayers; } + size_t CPACSVesselSkinLayers::GetSkinLayerCount() const + { + return m_skinLayers.size(); + } + + CCPACSSkin& CPACSVesselSkinLayers::GetSkinLayer(size_t index) + { + if (index < 1 || index > GetSkinLayerCount()) { + throw CTiglError("Invalid index in std::vector>::GetSkinLayer", TIGL_INDEX_ERROR); + } + index--; + return *m_skinLayers[index]; + } + + const CCPACSSkin& CPACSVesselSkinLayers::GetSkinLayer(size_t index) const + { + if (index < 1 || index > GetSkinLayerCount()) { + throw CTiglError("Invalid index in std::vector>::GetSkinLayer", TIGL_INDEX_ERROR); + } + index--; + return *m_skinLayers[index]; + } + + CCPACSSkin& CPACSVesselSkinLayers::AddSkinLayer() { m_skinLayers.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSVesselSkinLayers.h b/src/generated/CPACSVesselSkinLayers.h index a714eefb29..8f537084ff 100644 --- a/src/generated/CPACSVesselSkinLayers.h +++ b/src/generated/CPACSVesselSkinLayers.h @@ -62,6 +62,11 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetSkinLayers() const; TIGL_EXPORT virtual std::vector>& GetSkinLayers(); + TIGL_EXPORT virtual size_t GetSkinLayerCount() const; + + TIGL_EXPORT virtual const CCPACSSkin& GetSkinLayer(size_t index) const; + TIGL_EXPORT virtual CCPACSSkin& GetSkinLayer(size_t index); + TIGL_EXPORT virtual CCPACSSkin& AddSkinLayer(); TIGL_EXPORT virtual void RemoveSkinLayer(CCPACSSkin& ref); diff --git a/src/generated/CPACSVessels.cpp b/src/generated/CPACSVessels.cpp index 79eaccf36e..8afba8c56e 100644 --- a/src/generated/CPACSVessels.cpp +++ b/src/generated/CPACSVessels.cpp @@ -80,7 +80,7 @@ namespace generated { // read element vessel if (tixi::TixiCheckElement(tixiHandle, xpath + "/vessel")) { - tixi::TixiReadElements(tixiHandle, xpath + "/vessel", m_vessels, 1, tixi::xsdUnbounded, reinterpret_cast(this), m_uidMgr); + tixi::TixiReadElements(tixiHandle, xpath + "/vessel", m_vessels, 1, tixi::xsdUnbounded, this, m_uidMgr); } } @@ -102,9 +102,62 @@ namespace generated return m_vessels; } + size_t CPACSVessels::GetVesselCount() const + { + return m_vessels.size(); + } + + size_t CPACSVessels::GetVesselIndex(const std::string& UID) const + { + for (size_t i=0; i < GetVesselCount(); i++) { + const std::string tmpUID(m_vessels[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSVessels::GetVesselIndex", TIGL_UID_ERROR); + } + + CCPACSVessel& CPACSVessels::GetVessel(size_t index) + { + if (index < 1 || index > GetVesselCount()) { + throw CTiglError("Invalid index in std::vector>::GetVessel", TIGL_INDEX_ERROR); + } + index--; + return *m_vessels[index]; + } + + const CCPACSVessel& CPACSVessels::GetVessel(size_t index) const + { + if (index < 1 || index > GetVesselCount()) { + throw CTiglError("Invalid index in std::vector>::GetVessel", TIGL_INDEX_ERROR); + } + index--; + return *m_vessels[index]; + } + + CCPACSVessel& CPACSVessels::GetVessel(const std::string& UID) + { + for (auto& elem : m_vessels ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSVessels::GetVessel. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSVessel& CPACSVessels::GetVessel(const std::string& UID) const + { + for (auto& elem : m_vessels ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSVessels::GetVessel. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSVessel& CPACSVessels::AddVessel() { - m_vessels.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); + m_vessels.push_back(make_unique(this, m_uidMgr)); return *m_vessels.back(); } diff --git a/src/generated/CPACSVessels.h b/src/generated/CPACSVessels.h index 2c36573925..f5b503d444 100644 --- a/src/generated/CPACSVessels.h +++ b/src/generated/CPACSVessels.h @@ -61,6 +61,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetVessels() const; TIGL_EXPORT virtual std::vector>& GetVessels(); + TIGL_EXPORT virtual size_t GetVesselCount() const; + TIGL_EXPORT virtual size_t GetVesselIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSVessel& GetVessel(size_t index) const; + TIGL_EXPORT virtual CCPACSVessel& GetVessel(size_t index); + + TIGL_EXPORT virtual const CCPACSVessel& GetVessel(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSVessel& GetVessel(const std::string& UID); + TIGL_EXPORT virtual CCPACSVessel& AddVessel(); TIGL_EXPORT virtual void RemoveVessel(CCPACSVessel& ref); @@ -80,5 +89,6 @@ namespace generated }; } // namespace generated -// CPACSVessels is customized, use type CCPACSVessels directly +// Aliases in tigl namespace +using CCPACSVessels = generated::CPACSVessels; } // namespace tigl diff --git a/src/generated/CPACSWallPositions.cpp b/src/generated/CPACSWallPositions.cpp index 84e12ec2fb..2b82013162 100644 --- a/src/generated/CPACSWallPositions.cpp +++ b/src/generated/CPACSWallPositions.cpp @@ -108,6 +108,59 @@ namespace generated return m_wallPositions; } + size_t CPACSWallPositions::GetWallPositionCount() const + { + return m_wallPositions.size(); + } + + size_t CPACSWallPositions::GetWallPositionIndex(const std::string& UID) const + { + for (size_t i=0; i < GetWallPositionCount(); i++) { + const boost::optional tmpUID(*m_wallPositions[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSWallPositions::GetWallPositionIndex", TIGL_UID_ERROR); + } + + CCPACSWallPosition& CPACSWallPositions::GetWallPosition(size_t index) + { + if (index < 1 || index > GetWallPositionCount()) { + throw CTiglError("Invalid index in std::vector>::GetWallPosition", TIGL_INDEX_ERROR); + } + index--; + return *m_wallPositions[index]; + } + + const CCPACSWallPosition& CPACSWallPositions::GetWallPosition(size_t index) const + { + if (index < 1 || index > GetWallPositionCount()) { + throw CTiglError("Invalid index in std::vector>::GetWallPosition", TIGL_INDEX_ERROR); + } + index--; + return *m_wallPositions[index]; + } + + CCPACSWallPosition& CPACSWallPositions::GetWallPosition(const std::string& UID) + { + for (auto& elem : m_wallPositions ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSWallPositions::GetWallPosition. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSWallPosition& CPACSWallPositions::GetWallPosition(const std::string& UID) const + { + for (auto& elem : m_wallPositions ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSWallPositions::GetWallPosition. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSWallPosition& CPACSWallPositions::AddWallPosition() { m_wallPositions.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSWallPositions.h b/src/generated/CPACSWallPositions.h index f408cdd19b..b01f27d63b 100644 --- a/src/generated/CPACSWallPositions.h +++ b/src/generated/CPACSWallPositions.h @@ -58,6 +58,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetWallPositions() const; TIGL_EXPORT virtual std::vector>& GetWallPositions(); + TIGL_EXPORT virtual size_t GetWallPositionCount() const; + TIGL_EXPORT virtual size_t GetWallPositionIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSWallPosition& GetWallPosition(size_t index) const; + TIGL_EXPORT virtual CCPACSWallPosition& GetWallPosition(size_t index); + + TIGL_EXPORT virtual const CCPACSWallPosition& GetWallPosition(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSWallPosition& GetWallPosition(const std::string& UID); + TIGL_EXPORT virtual CCPACSWallPosition& AddWallPosition(); TIGL_EXPORT virtual void RemoveWallPosition(CCPACSWallPosition& ref); diff --git a/src/generated/CPACSWallSegments.cpp b/src/generated/CPACSWallSegments.cpp index 9f53321881..422347dccf 100644 --- a/src/generated/CPACSWallSegments.cpp +++ b/src/generated/CPACSWallSegments.cpp @@ -108,6 +108,59 @@ namespace generated return m_wallSegments; } + size_t CPACSWallSegments::GetWallSegmentCount() const + { + return m_wallSegments.size(); + } + + size_t CPACSWallSegments::GetWallSegmentIndex(const std::string& UID) const + { + for (size_t i=0; i < GetWallSegmentCount(); i++) { + const boost::optional tmpUID(*m_wallSegments[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSWallSegments::GetWallSegmentIndex", TIGL_UID_ERROR); + } + + CCPACSWallSegment& CPACSWallSegments::GetWallSegment(size_t index) + { + if (index < 1 || index > GetWallSegmentCount()) { + throw CTiglError("Invalid index in std::vector>::GetWallSegment", TIGL_INDEX_ERROR); + } + index--; + return *m_wallSegments[index]; + } + + const CCPACSWallSegment& CPACSWallSegments::GetWallSegment(size_t index) const + { + if (index < 1 || index > GetWallSegmentCount()) { + throw CTiglError("Invalid index in std::vector>::GetWallSegment", TIGL_INDEX_ERROR); + } + index--; + return *m_wallSegments[index]; + } + + CCPACSWallSegment& CPACSWallSegments::GetWallSegment(const std::string& UID) + { + for (auto& elem : m_wallSegments ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSWallSegments::GetWallSegment. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSWallSegment& CPACSWallSegments::GetWallSegment(const std::string& UID) const + { + for (auto& elem : m_wallSegments ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSWallSegments::GetWallSegment. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSWallSegment& CPACSWallSegments::AddWallSegment() { m_wallSegments.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSWallSegments.h b/src/generated/CPACSWallSegments.h index a983868bd2..dc542550c5 100644 --- a/src/generated/CPACSWallSegments.h +++ b/src/generated/CPACSWallSegments.h @@ -58,6 +58,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetWallSegments() const; TIGL_EXPORT virtual std::vector>& GetWallSegments(); + TIGL_EXPORT virtual size_t GetWallSegmentCount() const; + TIGL_EXPORT virtual size_t GetWallSegmentIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSWallSegment& GetWallSegment(size_t index) const; + TIGL_EXPORT virtual CCPACSWallSegment& GetWallSegment(size_t index); + + TIGL_EXPORT virtual const CCPACSWallSegment& GetWallSegment(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSWallSegment& GetWallSegment(const std::string& UID); + TIGL_EXPORT virtual CCPACSWallSegment& AddWallSegment(); TIGL_EXPORT virtual void RemoveWallSegment(CCPACSWallSegment& ref); diff --git a/src/generated/CPACSWindows.cpp b/src/generated/CPACSWindows.cpp index dd58970e55..93934836aa 100644 --- a/src/generated/CPACSWindows.cpp +++ b/src/generated/CPACSWindows.cpp @@ -141,6 +141,59 @@ namespace generated return m_windows; } + size_t CPACSWindows::GetWindowCount() const + { + return m_windows.size(); + } + + size_t CPACSWindows::GetWindowIndex(const std::string& UID) const + { + for (size_t i=0; i < GetWindowCount(); i++) { + const std::string tmpUID(m_windows[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSWindows::GetWindowIndex", TIGL_UID_ERROR); + } + + CPACSCutOut& CPACSWindows::GetWindow(size_t index) + { + if (index < 1 || index > GetWindowCount()) { + throw CTiglError("Invalid index in std::vector>::GetWindow", TIGL_INDEX_ERROR); + } + index--; + return *m_windows[index]; + } + + const CPACSCutOut& CPACSWindows::GetWindow(size_t index) const + { + if (index < 1 || index > GetWindowCount()) { + throw CTiglError("Invalid index in std::vector>::GetWindow", TIGL_INDEX_ERROR); + } + index--; + return *m_windows[index]; + } + + CPACSCutOut& CPACSWindows::GetWindow(const std::string& UID) + { + for (auto& elem : m_windows ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSWindows::GetWindow. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CPACSCutOut& CPACSWindows::GetWindow(const std::string& UID) const + { + for (auto& elem : m_windows ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSWindows::GetWindow. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CPACSCutOut& CPACSWindows::AddWindow() { m_windows.push_back(make_unique(this, m_uidMgr)); diff --git a/src/generated/CPACSWindows.h b/src/generated/CPACSWindows.h index 551228f406..9f5bd3c28b 100644 --- a/src/generated/CPACSWindows.h +++ b/src/generated/CPACSWindows.h @@ -66,6 +66,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetWindows() const; TIGL_EXPORT virtual std::vector>& GetWindows(); + TIGL_EXPORT virtual size_t GetWindowCount() const; + TIGL_EXPORT virtual size_t GetWindowIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CPACSCutOut& GetWindow(size_t index) const; + TIGL_EXPORT virtual CPACSCutOut& GetWindow(size_t index); + + TIGL_EXPORT virtual const CPACSCutOut& GetWindow(const std::string& UID) const; + TIGL_EXPORT virtual CPACSCutOut& GetWindow(const std::string& UID); + TIGL_EXPORT virtual CPACSCutOut& AddWindow(); TIGL_EXPORT virtual void RemoveWindow(CPACSCutOut& ref); diff --git a/src/generated/CPACSWing.cpp b/src/generated/CPACSWing.cpp index da01c35a47..988f21e075 100644 --- a/src/generated/CPACSWing.cpp +++ b/src/generated/CPACSWing.cpp @@ -344,12 +344,12 @@ namespace generated return m_transformation; } - const CCPACSWingSections& CPACSWing::GetSections() const + const CPACSWingSections& CPACSWing::GetSections() const { return m_sections; } - CCPACSWingSections& CPACSWing::GetSections() + CPACSWingSections& CPACSWing::GetSections() { return m_sections; } diff --git a/src/generated/CPACSWing.h b/src/generated/CPACSWing.h index 11e06daac3..3f9bf8c638 100644 --- a/src/generated/CPACSWing.h +++ b/src/generated/CPACSWing.h @@ -22,12 +22,12 @@ #include #include #include -#include #include #include #include #include #include +#include "CPACSWingSections.h" #include "CreateIfNotExists.h" #include "CTiglError.h" #include "CTiglUIDObject.h" @@ -139,8 +139,8 @@ namespace generated TIGL_EXPORT virtual const CCPACSTransformation& GetTransformation() const; TIGL_EXPORT virtual CCPACSTransformation& GetTransformation(); - TIGL_EXPORT virtual const CCPACSWingSections& GetSections() const; - TIGL_EXPORT virtual CCPACSWingSections& GetSections(); + TIGL_EXPORT virtual const CPACSWingSections& GetSections() const; + TIGL_EXPORT virtual CPACSWingSections& GetSections(); TIGL_EXPORT virtual const boost::optional& GetPositionings() const; TIGL_EXPORT virtual boost::optional& GetPositionings(); @@ -181,7 +181,7 @@ namespace generated CCPACSTransformation m_transformation; - CCPACSWingSections m_sections; + CPACSWingSections m_sections; boost::optional m_positionings; diff --git a/src/generated/CPACSWingAirfoils.cpp b/src/generated/CPACSWingAirfoils.cpp index 43572833e5..641a76885e 100644 --- a/src/generated/CPACSWingAirfoils.cpp +++ b/src/generated/CPACSWingAirfoils.cpp @@ -16,8 +16,8 @@ // limitations under the License. #include -#include "CCPACSProfiles.h" #include "CPACSProfileGeometry.h" +#include "CPACSProfiles.h" #include "CPACSWingAirfoils.h" #include "CTiglError.h" #include "CTiglLogging.h" @@ -29,7 +29,7 @@ namespace tigl { namespace generated { - CPACSWingAirfoils::CPACSWingAirfoils(CCPACSProfiles* parent, CTiglUIDManager* uidMgr) + CPACSWingAirfoils::CPACSWingAirfoils(CPACSProfiles* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { //assert(parent != NULL); @@ -40,12 +40,12 @@ namespace generated { } - const CCPACSProfiles* CPACSWingAirfoils::GetParent() const + const CPACSProfiles* CPACSWingAirfoils::GetParent() const { return m_parent; } - CCPACSProfiles* CPACSWingAirfoils::GetParent() + CPACSProfiles* CPACSWingAirfoils::GetParent() { return m_parent; } @@ -108,6 +108,59 @@ namespace generated return m_wingAirfoils; } + size_t CPACSWingAirfoils::GetWingAirfoilCount() const + { + return m_wingAirfoils.size(); + } + + size_t CPACSWingAirfoils::GetWingAirfoilIndex(const std::string& UID) const + { + for (size_t i=0; i < GetWingAirfoilCount(); i++) { + const std::string tmpUID(m_wingAirfoils[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSWingAirfoils::GetWingAirfoilIndex", TIGL_UID_ERROR); + } + + CPACSProfileGeometry& CPACSWingAirfoils::GetWingAirfoil(size_t index) + { + if (index < 1 || index > GetWingAirfoilCount()) { + throw CTiglError("Invalid index in std::vector>::GetWingAirfoil", TIGL_INDEX_ERROR); + } + index--; + return *m_wingAirfoils[index]; + } + + const CPACSProfileGeometry& CPACSWingAirfoils::GetWingAirfoil(size_t index) const + { + if (index < 1 || index > GetWingAirfoilCount()) { + throw CTiglError("Invalid index in std::vector>::GetWingAirfoil", TIGL_INDEX_ERROR); + } + index--; + return *m_wingAirfoils[index]; + } + + CPACSProfileGeometry& CPACSWingAirfoils::GetWingAirfoil(const std::string& UID) + { + for (auto& elem : m_wingAirfoils ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSWingAirfoils::GetWingAirfoil. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CPACSProfileGeometry& CPACSWingAirfoils::GetWingAirfoil(const std::string& UID) const + { + for (auto& elem : m_wingAirfoils ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSWingAirfoils::GetWingAirfoil. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CPACSProfileGeometry& CPACSWingAirfoils::AddWingAirfoil() { m_wingAirfoils.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); diff --git a/src/generated/CPACSWingAirfoils.h b/src/generated/CPACSWingAirfoils.h index 4f27d72022..fdc475fc2b 100644 --- a/src/generated/CPACSWingAirfoils.h +++ b/src/generated/CPACSWingAirfoils.h @@ -27,11 +27,11 @@ namespace tigl { class CTiglUIDManager; class CTiglUIDObject; -class CCPACSProfiles; namespace generated { class CPACSProfileGeometry; + class CPACSProfiles; // This class is used in: // CPACSProfiles @@ -44,13 +44,13 @@ namespace generated class CPACSWingAirfoils { public: - TIGL_EXPORT CPACSWingAirfoils(CCPACSProfiles* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSWingAirfoils(CPACSProfiles* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSWingAirfoils(); - TIGL_EXPORT CCPACSProfiles* GetParent(); + TIGL_EXPORT CPACSProfiles* GetParent(); - TIGL_EXPORT const CCPACSProfiles* GetParent() const; + TIGL_EXPORT const CPACSProfiles* GetParent() const; TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -64,11 +64,20 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetWingAirfoils() const; TIGL_EXPORT virtual std::vector>& GetWingAirfoils(); + TIGL_EXPORT virtual size_t GetWingAirfoilCount() const; + TIGL_EXPORT virtual size_t GetWingAirfoilIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CPACSProfileGeometry& GetWingAirfoil(size_t index) const; + TIGL_EXPORT virtual CPACSProfileGeometry& GetWingAirfoil(size_t index); + + TIGL_EXPORT virtual const CPACSProfileGeometry& GetWingAirfoil(const std::string& UID) const; + TIGL_EXPORT virtual CPACSProfileGeometry& GetWingAirfoil(const std::string& UID); + TIGL_EXPORT virtual CPACSProfileGeometry& AddWingAirfoil(); TIGL_EXPORT virtual void RemoveWingAirfoil(CPACSProfileGeometry& ref); protected: - CCPACSProfiles* m_parent; + CPACSProfiles* m_parent; CTiglUIDManager* m_uidMgr; @@ -87,4 +96,5 @@ namespace generated // Aliases in tigl namespace using CCPACSProfileGeometry = generated::CPACSProfileGeometry; +using CCPACSProfiles = generated::CPACSProfiles; } // namespace tigl diff --git a/src/generated/CPACSWingCells.cpp b/src/generated/CPACSWingCells.cpp index 22afd71f4a..bc70cd10a6 100644 --- a/src/generated/CPACSWingCells.cpp +++ b/src/generated/CPACSWingCells.cpp @@ -102,6 +102,59 @@ namespace generated return m_cells; } + size_t CPACSWingCells::GetCellCount() const + { + return m_cells.size(); + } + + size_t CPACSWingCells::GetCellIndex(const std::string& UID) const + { + for (size_t i=0; i < GetCellCount(); i++) { + const std::string tmpUID(m_cells[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSWingCells::GetCellIndex", TIGL_UID_ERROR); + } + + CCPACSWingCell& CPACSWingCells::GetCell(size_t index) + { + if (index < 1 || index > GetCellCount()) { + throw CTiglError("Invalid index in std::vector>::GetCell", TIGL_INDEX_ERROR); + } + index--; + return *m_cells[index]; + } + + const CCPACSWingCell& CPACSWingCells::GetCell(size_t index) const + { + if (index < 1 || index > GetCellCount()) { + throw CTiglError("Invalid index in std::vector>::GetCell", TIGL_INDEX_ERROR); + } + index--; + return *m_cells[index]; + } + + CCPACSWingCell& CPACSWingCells::GetCell(const std::string& UID) + { + for (auto& elem : m_cells ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSWingCells::GetCell. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSWingCell& CPACSWingCells::GetCell(const std::string& UID) const + { + for (auto& elem : m_cells ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSWingCells::GetCell. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSWingCell& CPACSWingCells::AddCell() { m_cells.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); diff --git a/src/generated/CPACSWingCells.h b/src/generated/CPACSWingCells.h index e49d2d4b91..e3d4483f45 100644 --- a/src/generated/CPACSWingCells.h +++ b/src/generated/CPACSWingCells.h @@ -62,6 +62,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetCells() const; TIGL_EXPORT virtual std::vector>& GetCells(); + TIGL_EXPORT virtual size_t GetCellCount() const; + TIGL_EXPORT virtual size_t GetCellIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSWingCell& GetCell(size_t index) const; + TIGL_EXPORT virtual CCPACSWingCell& GetCell(size_t index); + + TIGL_EXPORT virtual const CCPACSWingCell& GetCell(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSWingCell& GetCell(const std::string& UID); + TIGL_EXPORT virtual CCPACSWingCell& AddCell(); TIGL_EXPORT virtual void RemoveCell(CCPACSWingCell& ref); diff --git a/src/generated/CPACSWingElements.cpp b/src/generated/CPACSWingElements.cpp index d7c4582133..09a858276a 100644 --- a/src/generated/CPACSWingElements.cpp +++ b/src/generated/CPACSWingElements.cpp @@ -102,6 +102,59 @@ namespace generated return m_elements; } + size_t CPACSWingElements::GetElementCount() const + { + return m_elements.size(); + } + + size_t CPACSWingElements::GetElementIndex(const std::string& UID) const + { + for (size_t i=0; i < GetElementCount(); i++) { + const std::string tmpUID(m_elements[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSWingElements::GetElementIndex", TIGL_UID_ERROR); + } + + CCPACSWingSectionElement& CPACSWingElements::GetElement(size_t index) + { + if (index < 1 || index > GetElementCount()) { + throw CTiglError("Invalid index in std::vector>::GetElement", TIGL_INDEX_ERROR); + } + index--; + return *m_elements[index]; + } + + const CCPACSWingSectionElement& CPACSWingElements::GetElement(size_t index) const + { + if (index < 1 || index > GetElementCount()) { + throw CTiglError("Invalid index in std::vector>::GetElement", TIGL_INDEX_ERROR); + } + index--; + return *m_elements[index]; + } + + CCPACSWingSectionElement& CPACSWingElements::GetElement(const std::string& UID) + { + for (auto& elem : m_elements ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSWingElements::GetElement. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSWingSectionElement& CPACSWingElements::GetElement(const std::string& UID) const + { + for (auto& elem : m_elements ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSWingElements::GetElement. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSWingSectionElement& CPACSWingElements::AddElement() { m_elements.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); diff --git a/src/generated/CPACSWingElements.h b/src/generated/CPACSWingElements.h index fe3ceefeab..5727bd021d 100644 --- a/src/generated/CPACSWingElements.h +++ b/src/generated/CPACSWingElements.h @@ -63,6 +63,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetElements() const; TIGL_EXPORT virtual std::vector>& GetElements(); + TIGL_EXPORT virtual size_t GetElementCount() const; + TIGL_EXPORT virtual size_t GetElementIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSWingSectionElement& GetElement(size_t index) const; + TIGL_EXPORT virtual CCPACSWingSectionElement& GetElement(size_t index); + + TIGL_EXPORT virtual const CCPACSWingSectionElement& GetElement(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSWingSectionElement& GetElement(const std::string& UID); + TIGL_EXPORT virtual CCPACSWingSectionElement& AddElement(); TIGL_EXPORT virtual void RemoveElement(CCPACSWingSectionElement& ref); diff --git a/src/generated/CPACSWingRibsDefinitions.cpp b/src/generated/CPACSWingRibsDefinitions.cpp index 1da278615e..fbe2b5069b 100644 --- a/src/generated/CPACSWingRibsDefinitions.cpp +++ b/src/generated/CPACSWingRibsDefinitions.cpp @@ -108,6 +108,59 @@ namespace generated return m_ribsDefinitions; } + size_t CPACSWingRibsDefinitions::GetRibsDefinitionCount() const + { + return m_ribsDefinitions.size(); + } + + size_t CPACSWingRibsDefinitions::GetRibsDefinitionIndex(const std::string& UID) const + { + for (size_t i=0; i < GetRibsDefinitionCount(); i++) { + const std::string tmpUID(m_ribsDefinitions[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSWingRibsDefinitions::GetRibsDefinitionIndex", TIGL_UID_ERROR); + } + + CCPACSWingRibsDefinition& CPACSWingRibsDefinitions::GetRibsDefinition(size_t index) + { + if (index < 1 || index > GetRibsDefinitionCount()) { + throw CTiglError("Invalid index in std::vector>::GetRibsDefinition", TIGL_INDEX_ERROR); + } + index--; + return *m_ribsDefinitions[index]; + } + + const CCPACSWingRibsDefinition& CPACSWingRibsDefinitions::GetRibsDefinition(size_t index) const + { + if (index < 1 || index > GetRibsDefinitionCount()) { + throw CTiglError("Invalid index in std::vector>::GetRibsDefinition", TIGL_INDEX_ERROR); + } + index--; + return *m_ribsDefinitions[index]; + } + + CCPACSWingRibsDefinition& CPACSWingRibsDefinitions::GetRibsDefinition(const std::string& UID) + { + for (auto& elem : m_ribsDefinitions ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSWingRibsDefinitions::GetRibsDefinition. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSWingRibsDefinition& CPACSWingRibsDefinitions::GetRibsDefinition(const std::string& UID) const + { + for (auto& elem : m_ribsDefinitions ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSWingRibsDefinitions::GetRibsDefinition. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSWingRibsDefinition& CPACSWingRibsDefinitions::AddRibsDefinition() { m_ribsDefinitions.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); diff --git a/src/generated/CPACSWingRibsDefinitions.h b/src/generated/CPACSWingRibsDefinitions.h index c6b32c8089..4b1360e2dd 100644 --- a/src/generated/CPACSWingRibsDefinitions.h +++ b/src/generated/CPACSWingRibsDefinitions.h @@ -63,6 +63,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetRibsDefinitions() const; TIGL_EXPORT virtual std::vector>& GetRibsDefinitions(); + TIGL_EXPORT virtual size_t GetRibsDefinitionCount() const; + TIGL_EXPORT virtual size_t GetRibsDefinitionIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSWingRibsDefinition& GetRibsDefinition(size_t index) const; + TIGL_EXPORT virtual CCPACSWingRibsDefinition& GetRibsDefinition(size_t index); + + TIGL_EXPORT virtual const CCPACSWingRibsDefinition& GetRibsDefinition(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSWingRibsDefinition& GetRibsDefinition(const std::string& UID); + TIGL_EXPORT virtual CCPACSWingRibsDefinition& AddRibsDefinition(); TIGL_EXPORT virtual void RemoveRibsDefinition(CCPACSWingRibsDefinition& ref); diff --git a/src/generated/CPACSWingSection.cpp b/src/generated/CPACSWingSection.cpp index 0a22d1a7b2..a4d0c9b9f9 100644 --- a/src/generated/CPACSWingSection.cpp +++ b/src/generated/CPACSWingSection.cpp @@ -16,8 +16,8 @@ // limitations under the License. #include -#include "CCPACSWingSections.h" #include "CPACSWingSection.h" +#include "CPACSWingSections.h" #include "CTiglError.h" #include "CTiglLogging.h" #include "CTiglUIDManager.h" @@ -27,7 +27,7 @@ namespace tigl { namespace generated { - CPACSWingSection::CPACSWingSection(CCPACSWingSections* parent, CTiglUIDManager* uidMgr) + CPACSWingSection::CPACSWingSection(CPACSWingSections* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) , m_transformation(reinterpret_cast(this), m_uidMgr) , m_elements(reinterpret_cast(this), m_uidMgr) @@ -41,12 +41,12 @@ namespace generated if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID); } - const CCPACSWingSections* CPACSWingSection::GetParent() const + const CPACSWingSections* CPACSWingSection::GetParent() const { return m_parent; } - CCPACSWingSections* CPACSWingSection::GetParent() + CPACSWingSections* CPACSWingSection::GetParent() { return m_parent; } diff --git a/src/generated/CPACSWingSection.h b/src/generated/CPACSWingSection.h index 0b3df2ea81..a214ef5bdc 100644 --- a/src/generated/CPACSWingSection.h +++ b/src/generated/CPACSWingSection.h @@ -29,10 +29,11 @@ namespace tigl { class CTiglUIDManager; -class CCPACSWingSections; namespace generated { + class CPACSWingSections; + // This class is used in: // CPACSWingSections @@ -59,13 +60,13 @@ namespace generated class CPACSWingSection : public CTiglReqUIDObject { public: - TIGL_EXPORT CPACSWingSection(CCPACSWingSections* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSWingSection(CPACSWingSections* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSWingSection(); - TIGL_EXPORT CCPACSWingSections* GetParent(); + TIGL_EXPORT CPACSWingSections* GetParent(); - TIGL_EXPORT const CCPACSWingSections* GetParent() const; + TIGL_EXPORT const CPACSWingSections* GetParent() const; TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -92,7 +93,7 @@ namespace generated TIGL_EXPORT virtual CCPACSWingSectionElements& GetElements(); protected: - CCPACSWingSections* m_parent; + CPACSWingSections* m_parent; CTiglUIDManager* m_uidMgr; @@ -118,4 +119,7 @@ namespace generated } // namespace generated // CPACSWingSection is customized, use type CCPACSWingSection directly + +// Aliases in tigl namespace +using CCPACSWingSections = generated::CPACSWingSections; } // namespace tigl diff --git a/src/generated/CPACSWingSections.cpp b/src/generated/CPACSWingSections.cpp index 1190f14377..ce1fb702b4 100644 --- a/src/generated/CPACSWingSections.cpp +++ b/src/generated/CPACSWingSections.cpp @@ -96,7 +96,7 @@ namespace generated { // read element section if (tixi::TixiCheckElement(tixiHandle, xpath + "/section")) { - tixi::TixiReadElements(tixiHandle, xpath + "/section", m_sections, 2, tixi::xsdUnbounded, reinterpret_cast(this), m_uidMgr); + tixi::TixiReadElements(tixiHandle, xpath + "/section", m_sections, 2, tixi::xsdUnbounded, this, m_uidMgr); } } @@ -118,9 +118,62 @@ namespace generated return m_sections; } + size_t CPACSWingSections::GetSectionCount() const + { + return m_sections.size(); + } + + size_t CPACSWingSections::GetSectionIndex(const std::string& UID) const + { + for (size_t i=0; i < GetSectionCount(); i++) { + const std::string tmpUID(m_sections[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSWingSections::GetSectionIndex", TIGL_UID_ERROR); + } + + CCPACSWingSection& CPACSWingSections::GetSection(size_t index) + { + if (index < 1 || index > GetSectionCount()) { + throw CTiglError("Invalid index in std::vector>::GetSection", TIGL_INDEX_ERROR); + } + index--; + return *m_sections[index]; + } + + const CCPACSWingSection& CPACSWingSections::GetSection(size_t index) const + { + if (index < 1 || index > GetSectionCount()) { + throw CTiglError("Invalid index in std::vector>::GetSection", TIGL_INDEX_ERROR); + } + index--; + return *m_sections[index]; + } + + CCPACSWingSection& CPACSWingSections::GetSection(const std::string& UID) + { + for (auto& elem : m_sections ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSWingSections::GetSection. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSWingSection& CPACSWingSections::GetSection(const std::string& UID) const + { + for (auto& elem : m_sections ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSWingSections::GetSection. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSWingSection& CPACSWingSections::AddSection() { - m_sections.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); + m_sections.push_back(make_unique(this, m_uidMgr)); return *m_sections.back(); } diff --git a/src/generated/CPACSWingSections.h b/src/generated/CPACSWingSections.h index 38550b328e..cbb05a4b32 100644 --- a/src/generated/CPACSWingSections.h +++ b/src/generated/CPACSWingSections.h @@ -90,6 +90,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetSections() const; TIGL_EXPORT virtual std::vector>& GetSections(); + TIGL_EXPORT virtual size_t GetSectionCount() const; + TIGL_EXPORT virtual size_t GetSectionIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSWingSection& GetSection(size_t index) const; + TIGL_EXPORT virtual CCPACSWingSection& GetSection(size_t index); + + TIGL_EXPORT virtual const CCPACSWingSection& GetSection(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSWingSection& GetSection(const std::string& UID); + TIGL_EXPORT virtual CCPACSWingSection& AddSection(); TIGL_EXPORT virtual void RemoveSection(CCPACSWingSection& ref); @@ -110,5 +119,6 @@ namespace generated }; } // namespace generated -// CPACSWingSections is customized, use type CCPACSWingSections directly +// Aliases in tigl namespace +using CCPACSWingSections = generated::CPACSWingSections; } // namespace tigl diff --git a/src/generated/CPACSWingSegments.cpp b/src/generated/CPACSWingSegments.cpp index 4d24ddd549..120bdd93cd 100644 --- a/src/generated/CPACSWingSegments.cpp +++ b/src/generated/CPACSWingSegments.cpp @@ -118,6 +118,59 @@ namespace generated return m_segments; } + size_t CPACSWingSegments::GetSegmentCount() const + { + return m_segments.size(); + } + + size_t CPACSWingSegments::GetSegmentIndex(const std::string& UID) const + { + for (size_t i=0; i < GetSegmentCount(); i++) { + const std::string tmpUID(m_segments[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSWingSegments::GetSegmentIndex", TIGL_UID_ERROR); + } + + CCPACSWingSegment& CPACSWingSegments::GetSegment(size_t index) + { + if (index < 1 || index > GetSegmentCount()) { + throw CTiglError("Invalid index in std::vector>::GetSegment", TIGL_INDEX_ERROR); + } + index--; + return *m_segments[index]; + } + + const CCPACSWingSegment& CPACSWingSegments::GetSegment(size_t index) const + { + if (index < 1 || index > GetSegmentCount()) { + throw CTiglError("Invalid index in std::vector>::GetSegment", TIGL_INDEX_ERROR); + } + index--; + return *m_segments[index]; + } + + CCPACSWingSegment& CPACSWingSegments::GetSegment(const std::string& UID) + { + for (auto& elem : m_segments ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSWingSegments::GetSegment. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSWingSegment& CPACSWingSegments::GetSegment(const std::string& UID) const + { + for (auto& elem : m_segments ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSWingSegments::GetSegment. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSWingSegment& CPACSWingSegments::AddSegment() { m_segments.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); diff --git a/src/generated/CPACSWingSegments.h b/src/generated/CPACSWingSegments.h index 50c5c5ad74..5989b47bdd 100644 --- a/src/generated/CPACSWingSegments.h +++ b/src/generated/CPACSWingSegments.h @@ -90,6 +90,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetSegments() const; TIGL_EXPORT virtual std::vector>& GetSegments(); + TIGL_EXPORT virtual size_t GetSegmentCount() const; + TIGL_EXPORT virtual size_t GetSegmentIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSWingSegment& GetSegment(size_t index) const; + TIGL_EXPORT virtual CCPACSWingSegment& GetSegment(size_t index); + + TIGL_EXPORT virtual const CCPACSWingSegment& GetSegment(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSWingSegment& GetSegment(const std::string& UID); + TIGL_EXPORT virtual CCPACSWingSegment& AddSegment(); TIGL_EXPORT virtual void RemoveSegment(CCPACSWingSegment& ref); diff --git a/src/generated/CPACSWings.cpp b/src/generated/CPACSWings.cpp index d4e44badc3..9ab6c1ad92 100644 --- a/src/generated/CPACSWings.cpp +++ b/src/generated/CPACSWings.cpp @@ -118,6 +118,59 @@ namespace generated return m_wings; } + size_t CPACSWings::GetWingCount() const + { + return m_wings.size(); + } + + size_t CPACSWings::GetWingIndex(const std::string& UID) const + { + for (size_t i=0; i < GetWingCount(); i++) { + const std::string tmpUID(m_wings[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CPACSWings::GetWingIndex", TIGL_UID_ERROR); + } + + CCPACSWing& CPACSWings::GetWing(size_t index) + { + if (index < 1 || index > GetWingCount()) { + throw CTiglError("Invalid index in std::vector>::GetWing", TIGL_INDEX_ERROR); + } + index--; + return *m_wings[index]; + } + + const CCPACSWing& CPACSWings::GetWing(size_t index) const + { + if (index < 1 || index > GetWingCount()) { + throw CTiglError("Invalid index in std::vector>::GetWing", TIGL_INDEX_ERROR); + } + index--; + return *m_wings[index]; + } + + CCPACSWing& CPACSWings::GetWing(const std::string& UID) + { + for (auto& elem : m_wings ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSWings::GetWing. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + const CCPACSWing& CPACSWings::GetWing(const std::string& UID) const + { + for (auto& elem : m_wings ) { + if (elem->GetUID() == UID) + return *elem; + } + throw CTiglError("Invalid UID in CPACSWings::GetWing. \""+ UID + "\" not found in CPACS file!" , TIGL_UID_ERROR); + } + + CCPACSWing& CPACSWings::AddWing() { m_wings.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); diff --git a/src/generated/CPACSWings.h b/src/generated/CPACSWings.h index e30d7917cf..3909b14afc 100644 --- a/src/generated/CPACSWings.h +++ b/src/generated/CPACSWings.h @@ -90,6 +90,15 @@ namespace generated TIGL_EXPORT virtual const std::vector>& GetWings() const; TIGL_EXPORT virtual std::vector>& GetWings(); + TIGL_EXPORT virtual size_t GetWingCount() const; + TIGL_EXPORT virtual size_t GetWingIndex(const std::string& UID) const; + + TIGL_EXPORT virtual const CCPACSWing& GetWing(size_t index) const; + TIGL_EXPORT virtual CCPACSWing& GetWing(size_t index); + + TIGL_EXPORT virtual const CCPACSWing& GetWing(const std::string& UID) const; + TIGL_EXPORT virtual CCPACSWing& GetWing(const std::string& UID); + TIGL_EXPORT virtual CCPACSWing& AddWing(); TIGL_EXPORT virtual void RemoveWing(CCPACSWing& ref); diff --git a/src/geometry/CCPACSGenericSystems.cpp b/src/geometry/CCPACSGenericSystems.cpp index 9f8452ef57..e317c8dd1f 100644 --- a/src/geometry/CCPACSGenericSystems.cpp +++ b/src/geometry/CCPACSGenericSystems.cpp @@ -41,36 +41,6 @@ CCPACSGenericSystems::~CCPACSGenericSystems() { } -// Returns the total count of generic systems in a configuration -int CCPACSGenericSystems::GetGenericSystemCount() const -{ - return static_cast(m_genericSystems.size()); -} - -// Returns the generic system for a given index. -CCPACSGenericSystem& CCPACSGenericSystems::GetGenericSystem(int index) const -{ - index --; - if (index < 0 || index >= GetGenericSystemCount()) { - throw CTiglError("Invalid index in CCPACSGenericSystems::GetGenericSystem", TIGL_INDEX_ERROR); - } - return *m_genericSystems[index]; -} - -// Returns the generic system for a given UID. -CCPACSGenericSystem& CCPACSGenericSystems::GetGenericSystem(const std::string& UID) const -{ - for (int i=0; i < GetGenericSystemCount(); i++) { - const std::string tmpUID(m_genericSystems[i]->GetUID()); - if (tmpUID == UID) { - return *m_genericSystems[i]; - } - } - - // UID not there - throw CTiglError("Invalid UID in CCPACSGenericSystems::GetGenericSystem", TIGL_INDEX_ERROR); -} - CCPACSConfiguration& CCPACSGenericSystems::GetConfiguration() const { return m_parent->GetConfiguration(); diff --git a/src/geometry/CCPACSGenericSystems.h b/src/geometry/CCPACSGenericSystems.h index 661811f231..4c49e6a842 100644 --- a/src/geometry/CCPACSGenericSystems.h +++ b/src/geometry/CCPACSGenericSystems.h @@ -40,15 +40,6 @@ class CCPACSGenericSystems : public generated::CPACSGenericSystems // Virtual Destructor TIGL_EXPORT virtual ~CCPACSGenericSystems(); - // Returns the total count of wings in a configuration - TIGL_EXPORT int GetGenericSystemCount() const; - - // Returns the wing for a given index. - TIGL_EXPORT CCPACSGenericSystem& GetGenericSystem(int index) const; - - // Returns the wing for a given UID. - TIGL_EXPORT CCPACSGenericSystem& GetGenericSystem(const std::string& UID) const; - // Returns the parent configuration TIGL_EXPORT CCPACSConfiguration& GetConfiguration() const; }; diff --git a/src/geometry/CTiglIntersectionCalculation.h b/src/geometry/CTiglIntersectionCalculation.h index 737750ef3f..c8c2206bfa 100644 --- a/src/geometry/CTiglIntersectionCalculation.h +++ b/src/geometry/CTiglIntersectionCalculation.h @@ -26,7 +26,7 @@ #include "tigl_internal.h" #include "CCPACSWings.h" #include "CCPACSWingProfile.h" -#include "CCPACSFuselages.h" +#include "CPACSFuselages.h" #include "CCPACSFuselageProfile.h" #include "GeomAPI_IntSS.hxx" diff --git a/src/guide_curves/CCPACSGuideCurveProfiles.cpp b/src/guide_curves/CCPACSGuideCurveProfiles.cpp deleted file mode 100644 index a3a9277ea6..0000000000 --- a/src/guide_curves/CCPACSGuideCurveProfiles.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/* -* Copyright (C) 2007-2014 German Aerospace Center (DLR/SC) -* -* Created: 2014-02-10 Tobias Stollenwerk -* -* 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. -*/ -/** -* @file -* @brief Implementation of CPACS guide curve profiles handling routines -*/ - -#include "CCPACSGuideCurveProfiles.h" -#include "CTiglError.h" -#include "CTiglLogging.h" -#include "CCPACSGuideCurveProfile.h" - -namespace tigl -{ -CCPACSGuideCurveProfiles::CCPACSGuideCurveProfiles(CCPACSProfiles* parent, CTiglUIDManager* uidMgr) - : generated::CPACSGuideCurveProfiles(parent, uidMgr) {} - -// Returns the total count of guide curves in this configuration -int CCPACSGuideCurveProfiles::GetGuideCurveProfileCount() const -{ - return static_cast(m_guideCurveProfiles.size()); -} - -// Returns the guide curve for a given uid. -CCPACSGuideCurveProfile& CCPACSGuideCurveProfiles::GetGuideCurveProfile(const std::string& uid) const -{ - for (auto& p : m_guideCurveProfiles) - if (p->GetUID() == uid) - return *p; - - LOG(ERROR) << "Guide curve \"" + uid + "\" not found in CPACS file!" << std::endl; - throw CTiglError("Guide curve \"" + uid + "\" not found in CPACS file!", TIGL_UID_ERROR); -} - -} // end namespace tigl - - diff --git a/src/guide_curves/CCPACSGuideCurveProfiles.h b/src/guide_curves/CCPACSGuideCurveProfiles.h deleted file mode 100644 index 190aac0e14..0000000000 --- a/src/guide_curves/CCPACSGuideCurveProfiles.h +++ /dev/null @@ -1,46 +0,0 @@ -/* -* Copyright (C) 2007-2013 German Aerospace Center (DLR/SC) -* -* Created: 2014-02-10 Tobias Stollenwerk -* -* 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. -*/ -/** -* @file -* @brief Implementation of CPACS guide curve profiles handling routines -*/ - -#ifndef CCPACSGUIDECURVEPROFILES_H -#define CCPACSGUIDECURVEPROFILES_H - -#include "generated/CPACSGuideCurveProfiles.h" - -namespace tigl -{ -class CCPACSGuideCurveProfiles : public generated::CPACSGuideCurveProfiles -{ -public: - TIGL_EXPORT CCPACSGuideCurveProfiles(CCPACSProfiles* parent, CTiglUIDManager* uidMgr); - - // Returns the total count of guide curves in this configuration - TIGL_EXPORT int GetGuideCurveProfileCount() const; - - // Returns the guide curve for a given uid. - TIGL_EXPORT CCPACSGuideCurveProfile& GetGuideCurveProfile(const std::string& uid) const; -}; - -} // end namespace tigl - -#endif // CCPACSGUIDECURVEPROFILES_H - - diff --git a/src/guide_curves/CCPACSGuideCurves.cpp b/src/guide_curves/CCPACSGuideCurves.cpp index d8abf61a78..0571c2fd63 100644 --- a/src/guide_curves/CCPACSGuideCurves.cpp +++ b/src/guide_curves/CCPACSGuideCurves.cpp @@ -44,45 +44,6 @@ void CCPACSGuideCurves::ReadCPACS(const TixiDocumentHandle& tixiHandle, const st }); } -// Returns the total count of guide curves in this configuration -int CCPACSGuideCurves::GetGuideCurveCount() const -{ - return static_cast(m_guideCurves.size()); -} - -// Returns the guide curve for a given index -const CCPACSGuideCurve& CCPACSGuideCurves::GetGuideCurve(int index) const -{ - index--; - if (index < 0 || index >= GetGuideCurveCount()) { - throw CTiglError("Invalid index in CCPACSGuideCurves::GetGuideCurve", TIGL_INDEX_ERROR); - } - return *m_guideCurves[index]; -} - -// Returns the guide curve for a given index -CCPACSGuideCurve& CCPACSGuideCurves::GetGuideCurve(int index) -{ - return const_cast(static_cast(this)->GetGuideCurve(index)); -} - -// Returns the guide curve for a given uid. -const CCPACSGuideCurve& CCPACSGuideCurves::GetGuideCurve(std::string uid) const -{ - for (std::size_t i = 0; i < m_guideCurves.size(); i++) { - if (m_guideCurves[i]->GetUID() == uid) { - return *m_guideCurves[i]; - } - } - throw CTiglError("CCPACSGuideCurve::GetGuideCurve: Guide curve \"" + uid + "\" not found in CPACS file!", TIGL_UID_ERROR); -} - -// Returns the guide curve for a given uid. -CCPACSGuideCurve& CCPACSGuideCurves::GetGuideCurve(std::string uid) -{ - return const_cast(static_cast(this)->GetGuideCurve(uid)); -} - // Returns the guide curve for a given uid. bool CCPACSGuideCurves::GuideCurveExists(std::string uid) const { diff --git a/src/guide_curves/CCPACSGuideCurves.h b/src/guide_curves/CCPACSGuideCurves.h index 2332726bad..08de373315 100644 --- a/src/guide_curves/CCPACSGuideCurves.h +++ b/src/guide_curves/CCPACSGuideCurves.h @@ -35,21 +35,6 @@ class CCPACSGuideCurves : public generated::CPACSGuideCurves TIGL_EXPORT void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) override; - // Returns the total count of guide curves in this configuration - TIGL_EXPORT int GetGuideCurveCount() const; - - // Returns the guide curve for a given index - TIGL_EXPORT const CCPACSGuideCurve& GetGuideCurve(int index) const; - - // Returns the guide curve for a given index - TIGL_EXPORT CCPACSGuideCurve& GetGuideCurve(int index); - - // Returns the guide curve for a given uid - TIGL_EXPORT const CCPACSGuideCurve& GetGuideCurve(std::string uid) const; - - // Returns the guide curve for a given uid - TIGL_EXPORT CCPACSGuideCurve& GetGuideCurve(std::string uid); - // Check if guide curve with a given UID exists TIGL_EXPORT bool GuideCurveExists(std::string uid) const; diff --git a/src/rotor/CCPACSRotor.cpp b/src/rotor/CCPACSRotor.cpp index c216909e22..219aba1211 100644 --- a/src/rotor/CCPACSRotor.cpp +++ b/src/rotor/CCPACSRotor.cpp @@ -103,31 +103,48 @@ TiglRotorType CCPACSRotor::GetDefaultedType() const } // Returns the rotor blade attachment count -int CCPACSRotor::GetRotorBladeAttachmentCount() const +size_t CCPACSRotor::GetRotorBladeAttachmentCount() const { return m_rotorHub.GetRotorBladeAttachmentCount(); } // Returns the rotor blade attachment for a given index -CCPACSRotorBladeAttachment& CCPACSRotor::GetRotorBladeAttachment(int index) const +const CCPACSRotorBladeAttachment& CCPACSRotor::GetRotorBladeAttachment(size_t index) const +{ + return m_rotorHub.GetRotorBladeAttachment(index); +} + +// Returns the rotor blade attachment for a given index +CCPACSRotorBladeAttachment& CCPACSRotor::GetRotorBladeAttachment(size_t index) { return m_rotorHub.GetRotorBladeAttachment(index); } // Returns the rotor blade count -int CCPACSRotor::GetRotorBladeCount() const +size_t CCPACSRotor::GetRotorBladeCount() const { return m_rotorHub.GetRotorBladeCount(); } // Returns the rotor blade for a given index -CTiglAttachedRotorBlade& CCPACSRotor::GetRotorBlade(int index) const +const CTiglAttachedRotorBlade& CCPACSRotor::GetRotorBlade(size_t index) const +{ + return m_rotorHub.GetRotorBlade(index); +} + +// Returns the rotor blade for a given index +CTiglAttachedRotorBlade& CCPACSRotor::GetRotorBlade(size_t index) { return m_rotorHub.GetRotorBlade(index); } // Returns the parent configuration -CCPACSConfiguration& CCPACSRotor::GetConfiguration() const +const CCPACSConfiguration& CCPACSRotor::GetConfiguration() const +{ + return m_parent->GetConfiguration(); +} + +CCPACSConfiguration& CCPACSRotor::GetConfiguration() { return m_parent->GetConfiguration(); } @@ -155,7 +172,7 @@ PNamedShape CCPACSRotor::BuildLoft() const BRep_Builder aBuilder; aBuilder.MakeCompound(rotorGeometry); for (int iAttach=1; iAttach <= m_rotorHub.GetRotorBladeAttachmentCount(); ++iAttach) { - CCPACSRotorBladeAttachment& attach = m_rotorHub.GetRotorBladeAttachment(iAttach); + CCPACSRotorBladeAttachment const& attach = m_rotorHub.GetRotorBladeAttachment(iAttach); for (int iBlade=1; iBlade <= attach.GetNumberOfBlades(); ++iBlade) { // Add the transformed rotor blade to the rotor assembly TopoDS_Shape bladeShape = attach.GetAttachedRotorBlade(iBlade).GetLoft()->Shape(); diff --git a/src/rotor/CCPACSRotor.h b/src/rotor/CCPACSRotor.h index fe7c3c39db..02f0c78cf3 100644 --- a/src/rotor/CCPACSRotor.h +++ b/src/rotor/CCPACSRotor.h @@ -72,19 +72,22 @@ class CCPACSRotor : public generated::CPACSRotor, public CTiglRelativelyPosition TIGL_EXPORT TiglRotorType GetDefaultedType() const; // Returns the rotor blade attachment count - TIGL_EXPORT int GetRotorBladeAttachmentCount() const; + TIGL_EXPORT size_t GetRotorBladeAttachmentCount() const; // Returns the rotor blade attachment for a given index - TIGL_EXPORT CCPACSRotorBladeAttachment& GetRotorBladeAttachment(int index) const; + TIGL_EXPORT const CCPACSRotorBladeAttachment& GetRotorBladeAttachment(size_t index) const; + TIGL_EXPORT CCPACSRotorBladeAttachment& GetRotorBladeAttachment(size_t index); // Returns the rotor blade count - TIGL_EXPORT int GetRotorBladeCount() const; + TIGL_EXPORT size_t GetRotorBladeCount() const; // Returns the rotor blade for a given index - TIGL_EXPORT CTiglAttachedRotorBlade& GetRotorBlade(int index) const; + TIGL_EXPORT const CTiglAttachedRotorBlade& GetRotorBlade(size_t index) const; + TIGL_EXPORT CTiglAttachedRotorBlade& GetRotorBlade(size_t index); // Returns the parent configuration - TIGL_EXPORT CCPACSConfiguration& GetConfiguration() const; + TIGL_EXPORT const CCPACSConfiguration& GetConfiguration() const; + TIGL_EXPORT CCPACSConfiguration& GetConfiguration(); // Returns the rotor disk geometry TIGL_EXPORT PNamedShape GetRotorDisk(); diff --git a/src/rotor/CCPACSRotorBladeAttachment.cpp b/src/rotor/CCPACSRotorBladeAttachment.cpp index a25d1247fe..b4ca9b2104 100644 --- a/src/rotor/CCPACSRotorBladeAttachment.cpp +++ b/src/rotor/CCPACSRotorBladeAttachment.cpp @@ -98,7 +98,7 @@ CTiglTransformation CCPACSRotorBladeAttachment::GetRotorBladeTransformationMatri } // Returns the number of attached rotor blades -int CCPACSRotorBladeAttachment::GetNumberOfBlades() const +size_t CCPACSRotorBladeAttachment::GetNumberOfBlades() const { if (m_numberOfBlades_choice2) return *m_numberOfBlades_choice2; @@ -107,7 +107,7 @@ int CCPACSRotorBladeAttachment::GetNumberOfBlades() const } // Returns the azimuth angle of the attached rotor blade with the given index -double CCPACSRotorBladeAttachment::GetAzimuthAngle(int index) const +double CCPACSRotorBladeAttachment::GetAzimuthAngle(size_t index) const { index --; if (index < 0 || index >= GetNumberOfBlades()) { @@ -120,13 +120,13 @@ double CCPACSRotorBladeAttachment::GetAzimuthAngle(int index) const } // Returns the index of the referenced wing definition -int CCPACSRotorBladeAttachment::GetWingIndex() const +size_t CCPACSRotorBladeAttachment::GetWingIndex() const { return GetConfiguration().GetWingIndex(m_rotorBladeUID); } // Get hinge count -int CCPACSRotorBladeAttachment::GetHingeCount() const +size_t CCPACSRotorBladeAttachment::GetHingeCount() const { if (m_hinges) return m_hinges->GetRotorHingeCount(); @@ -135,13 +135,17 @@ int CCPACSRotorBladeAttachment::GetHingeCount() const } // Returns the hinge for a given index -CCPACSRotorHinge& CCPACSRotorBladeAttachment::GetHinge(const int index) const +const CCPACSRotorHinge& CCPACSRotorBladeAttachment::GetHinge(size_t index) const +{ + return m_hinges->GetRotorHinge(index); +} +CCPACSRotorHinge& CCPACSRotorBladeAttachment::GetHinge(size_t index) { return m_hinges->GetRotorHinge(index); } // Returns the rotor blade for a given index -CTiglAttachedRotorBlade& CCPACSRotorBladeAttachment::GetAttachedRotorBlade(int index) +const CTiglAttachedRotorBlade& CCPACSRotorBladeAttachment::GetAttachedRotorBlade(size_t index) const { lazyCreateAttachedRotorBlades(); index--; @@ -152,20 +156,19 @@ CTiglAttachedRotorBlade& CCPACSRotorBladeAttachment::GetAttachedRotorBlade(int i } // Returns the rotor blade for a given index -const CTiglAttachedRotorBlade& CCPACSRotorBladeAttachment::GetAttachedRotorBlade(int index) const { - return const_cast(this)->GetAttachedRotorBlade(index); +CTiglAttachedRotorBlade& CCPACSRotorBladeAttachment::GetAttachedRotorBlade(size_t index) { + return const_cast(std::as_const(*this).GetAttachedRotorBlade(index)); } // Returns the parent rotor -CCPACSRotor& CCPACSRotorBladeAttachment::GetRotor() const +const CCPACSRotor& CCPACSRotorBladeAttachment::GetRotor() const { return *m_parent->GetParent()->GetParent(); } -// Returns the parent configuration -CCPACSConfiguration& CCPACSRotorBladeAttachment::GetConfiguration() const +CCPACSRotor& CCPACSRotorBladeAttachment::GetRotor() { - return m_parent->GetConfiguration(); + return *m_parent->GetParent()->GetParent(); } void CCPACSRotorBladeAttachment::lazyCreateAttachedRotorBlades() const @@ -187,4 +190,15 @@ void CCPACSRotorBladeAttachment::lazyCreateAttachedRotorBlades() const assert(attachedRotorBlades.size() == bladeCount); } +// Returns the parent configuration +const CCPACSConfiguration& CCPACSRotorBladeAttachment::GetConfiguration() const +{ + return m_parent->GetConfiguration(); +} + +CCPACSConfiguration& CCPACSRotorBladeAttachment::GetConfiguration() +{ + return m_parent->GetConfiguration(); +} + } // end namespace tigl diff --git a/src/rotor/CCPACSRotorBladeAttachment.h b/src/rotor/CCPACSRotorBladeAttachment.h index c311513b5d..29d52709cf 100644 --- a/src/rotor/CCPACSRotorBladeAttachment.h +++ b/src/rotor/CCPACSRotorBladeAttachment.h @@ -69,29 +69,32 @@ class CCPACSRotorBladeAttachment : private generated::CPACSRotorBladeAttachment, TIGL_EXPORT CTiglTransformation GetRotorBladeTransformationMatrix(double thetaDeg=0., double bladeDeltaThetaDeg=0., bool doHingeTransformation=true, bool doRotationDirTransformation=true, bool doRotorTransformation=false); // Returns the number of attached rotor blades - TIGL_EXPORT int GetNumberOfBlades() const; + TIGL_EXPORT size_t GetNumberOfBlades() const; // Returns the azimuth angle of the attached rotor blade with the given index - TIGL_EXPORT double GetAzimuthAngle(int index) const; + TIGL_EXPORT double GetAzimuthAngle(size_t index) const; // Returns the index of the referenced wing definition - TIGL_EXPORT int GetWingIndex() const; + TIGL_EXPORT size_t GetWingIndex() const; // Get hinge count - TIGL_EXPORT int GetHingeCount() const; + TIGL_EXPORT size_t GetHingeCount() const; // Returns the hinge for a given index - TIGL_EXPORT CCPACSRotorHinge& GetHinge(int index) const; + TIGL_EXPORT const CCPACSRotorHinge& GetHinge(size_t index) const; + TIGL_EXPORT CCPACSRotorHinge& GetHinge(size_t index); // Returns the rotor blade for a given index - TIGL_EXPORT CTiglAttachedRotorBlade& GetAttachedRotorBlade(int index); - TIGL_EXPORT const CTiglAttachedRotorBlade& GetAttachedRotorBlade(int index) const; + TIGL_EXPORT const CTiglAttachedRotorBlade& GetAttachedRotorBlade(size_t index) const; + TIGL_EXPORT CTiglAttachedRotorBlade& GetAttachedRotorBlade(size_t index); // Returns the parent rotor - TIGL_EXPORT CCPACSRotor& GetRotor() const; + TIGL_EXPORT const CCPACSRotor& GetRotor() const; + TIGL_EXPORT CCPACSRotor& GetRotor(); // Returns the parent configuration - TIGL_EXPORT CCPACSConfiguration& GetConfiguration() const; + TIGL_EXPORT const CCPACSConfiguration& GetConfiguration() const; + TIGL_EXPORT CCPACSConfiguration& GetConfiguration(); private: // Invalidates internal state diff --git a/src/rotor/CCPACSRotorBladeAttachments.cpp b/src/rotor/CCPACSRotorBladeAttachments.cpp index 5e4b5fba2a..5be97667cd 100644 --- a/src/rotor/CCPACSRotorBladeAttachments.cpp +++ b/src/rotor/CCPACSRotorBladeAttachments.cpp @@ -43,30 +43,24 @@ void CCPACSRotorBladeAttachments::Invalidate(const boost::optional& } } -// Returns the total count of rotor blade attachments in a rotor hub -int CCPACSRotorBladeAttachments::GetRotorBladeAttachmentCount() const +// Returns the parent rotor +const CCPACSRotor& CCPACSRotorBladeAttachments::GetRotor() const { - return static_cast(m_rotorBladeAttachments.size()); + return *m_parent->GetParent(); } -// Returns the rotor blade attachment for a given index. -CCPACSRotorBladeAttachment& CCPACSRotorBladeAttachments::GetRotorBladeAttachment(int index) const +CCPACSRotor& CCPACSRotorBladeAttachments::GetRotor() { - index--; - if (index < 0 || index >= GetRotorBladeAttachmentCount()) { - throw CTiglError("Invalid index in CCPACSRotorBladeAttachments::GetRotorBladeAttachment", TIGL_INDEX_ERROR); - } - return *m_rotorBladeAttachments[index]; + return *m_parent->GetParent(); } -// Returns the parent rotor -CCPACSRotor& CCPACSRotorBladeAttachments::GetRotor() const +// Returns the parent configuration +const CCPACSConfiguration& CCPACSRotorBladeAttachments::GetConfiguration() const { - return *m_parent->GetParent(); + return m_parent->GetConfiguration(); } -// Returns the parent configuration -CCPACSConfiguration& CCPACSRotorBladeAttachments::GetConfiguration() const +CCPACSConfiguration& CCPACSRotorBladeAttachments::GetConfiguration() { return m_parent->GetConfiguration(); } diff --git a/src/rotor/CCPACSRotorBladeAttachments.h b/src/rotor/CCPACSRotorBladeAttachments.h index 2ae5e14261..e946f62593 100644 --- a/src/rotor/CCPACSRotorBladeAttachments.h +++ b/src/rotor/CCPACSRotorBladeAttachments.h @@ -46,17 +46,13 @@ class CCPACSRotorBladeAttachments : public generated::CPACSRotorBladeAttachments // Invalidates internal state TIGL_EXPORT void Invalidate(const boost::optional& source = boost::none) const; - // Returns the total count of rotor blade attachments in a rotor hub - TIGL_EXPORT int GetRotorBladeAttachmentCount() const; - - // Returns the rotor blade attachment for a given index. - TIGL_EXPORT CCPACSRotorBladeAttachment& GetRotorBladeAttachment(int index) const; - // Returns the parent rotor - TIGL_EXPORT CCPACSRotor& GetRotor() const; + TIGL_EXPORT const CCPACSRotor& GetRotor() const; + TIGL_EXPORT CCPACSRotor& GetRotor(); // Returns the parent configuration - TIGL_EXPORT CCPACSConfiguration& GetConfiguration() const; + TIGL_EXPORT const CCPACSConfiguration& GetConfiguration() const; + TIGL_EXPORT CCPACSConfiguration& GetConfiguration(); }; } // end namespace tigl diff --git a/src/rotor/CCPACSRotorBlades.cpp b/src/rotor/CCPACSRotorBlades.cpp index c54e6ad8dc..bafdc27f6d 100644 --- a/src/rotor/CCPACSRotorBlades.cpp +++ b/src/rotor/CCPACSRotorBlades.cpp @@ -42,49 +42,13 @@ void CCPACSRotorBlades::Invalidate(const boost::optional& source) c } } -// Adds a rotor blade to the rotor blade container -void CCPACSRotorBlades::AddRotorBlade(CCPACSWing* rotorBlade) -{ - m_rotorBlades.push_back(std::unique_ptr(rotorBlade)); -} - -// Returns the total count of rotor blades of a rotor blade attachment -int CCPACSRotorBlades::GetRotorBladeCount() const -{ - return (static_cast(m_rotorBlades.size())); -} - -// Returns the rotor blade for a given index -CCPACSWing& CCPACSRotorBlades::GetRotorBlade(int index) const -{ - index --; - if (index < 0 || index >= GetRotorBladeCount()) { - throw CTiglError("Invalid index in CCPACSRotorBlades::GetRotorBlade", TIGL_INDEX_ERROR); - } - return *m_rotorBlades[index]; -} - -CCPACSWing& CCPACSRotorBlades::GetRotorBlade(const std::string& uid) const -{ - return *m_rotorBlades[GetRotorBladeIndex(uid) - 1]; -} - -// Returns the wing index for a given UID. -int CCPACSRotorBlades::GetRotorBladeIndex(const std::string& UID) const +// Returns the parent configuration +const CCPACSConfiguration& CCPACSRotorBlades::GetConfiguration() const { - for (int i = 0; i < GetRotorBladeCount(); i++) { - const std::string tmpUID(m_rotorBlades[i]->GetUID()); - if (tmpUID == UID) { - return i + 1; - } - } - - // UID not there - throw CTiglError("Invalid UID in CCPACSRotorBlades::GetRotorBladeIndex", TIGL_UID_ERROR); + return m_parent->GetConfiguration(); } -// Returns the parent configuration -CCPACSConfiguration& CCPACSRotorBlades::GetConfiguration() const +CCPACSConfiguration& CCPACSRotorBlades::GetConfiguration() { return m_parent->GetConfiguration(); } diff --git a/src/rotor/CCPACSRotorBlades.h b/src/rotor/CCPACSRotorBlades.h index 8433e91d73..17b2334806 100644 --- a/src/rotor/CCPACSRotorBlades.h +++ b/src/rotor/CCPACSRotorBlades.h @@ -46,23 +46,9 @@ class CCPACSRotorBlades : public generated::CPACSRotorBlades // Invalidates internal state TIGL_EXPORT void Invalidate(const boost::optional& source = boost::none) const; - // Adds a rotor blade to the rotor blade container - TIGL_EXPORT void AddRotorBlade(CCPACSWing* rotorBlade); - using generated::CPACSRotorBlades::AddRotorBlade; - - // Returns the total count of rotor blades of a rotor blade attachment - TIGL_EXPORT int GetRotorBladeCount() const; - - // Returns the rotor blade for a given index. - TIGL_EXPORT CCPACSWing& GetRotorBlade(int index) const; - - // Returns the rotor blade for a given index. - TIGL_EXPORT CCPACSWing& GetRotorBlade(const std::string& uid) const; - - TIGL_EXPORT int GetRotorBladeIndex(const std::string& uid) const; - // Returns the parent configuration - TIGL_EXPORT CCPACSConfiguration& GetConfiguration() const; + TIGL_EXPORT const CCPACSConfiguration& GetConfiguration() const; + TIGL_EXPORT CCPACSConfiguration& GetConfiguration(); }; } // end namespace tigl diff --git a/src/rotor/CCPACSRotorHinge.cpp b/src/rotor/CCPACSRotorHinge.cpp index b978e22942..34f9eea285 100644 --- a/src/rotor/CCPACSRotorHinge.cpp +++ b/src/rotor/CCPACSRotorHinge.cpp @@ -74,22 +74,37 @@ double CCPACSRotorHinge::GetHingeAngle(double thetaDeg, double a0, std::vectorGetConfiguration(); + return m_parent->GetRotor(); } -// Returns the parent rotor -CCPACSRotor& CCPACSRotorHinge::GetRotor() const +CCPACSRotor& CCPACSRotorHinge::GetRotor() { return m_parent->GetRotor(); } // Returns the parent rotor blade attachment -CCPACSRotorBladeAttachment& CCPACSRotorHinge::GetRotorBladeAttachment() const +const CCPACSRotorBladeAttachment& CCPACSRotorHinge::GetRotorBladeAttachment() const +{ + return *m_parent->GetParent(); +} + +CCPACSRotorBladeAttachment& CCPACSRotorHinge::GetRotorBladeAttachment() { return *m_parent->GetParent(); } +// Returns the parent configuration +const CCPACSConfiguration& CCPACSRotorHinge::GetConfiguration() const +{ + return m_parent->GetConfiguration(); +} + +CCPACSConfiguration& CCPACSRotorHinge::GetConfiguration() +{ + return m_parent->GetConfiguration(); +} + } // end namespace tigl diff --git a/src/rotor/CCPACSRotorHinge.h b/src/rotor/CCPACSRotorHinge.h index cb4af80ad1..11febfda48 100644 --- a/src/rotor/CCPACSRotorHinge.h +++ b/src/rotor/CCPACSRotorHinge.h @@ -69,14 +69,18 @@ class CCPACSRotorHinge : public generated::CPACSRotorHubHinge // Returns the rotor hinge angle TIGL_EXPORT double GetHingeAngle(double thetaDeg=0., double a0=0., std::vector aSin=std::vector(), std::vector aCos=std::vector()) const; - // Returns the parent configuration - TIGL_EXPORT CCPACSConfiguration& GetConfiguration() const; - // Returns the parent rotor - TIGL_EXPORT CCPACSRotor& GetRotor() const; + TIGL_EXPORT const CCPACSRotor& GetRotor() const; + TIGL_EXPORT CCPACSRotor& GetRotor(); // Returns the parent rotor blade attachment - TIGL_EXPORT CCPACSRotorBladeAttachment& GetRotorBladeAttachment() const; + TIGL_EXPORT const CCPACSRotorBladeAttachment& GetRotorBladeAttachment() const; + TIGL_EXPORT CCPACSRotorBladeAttachment& GetRotorBladeAttachment(); + + // Returns the parent configuration + TIGL_EXPORT const CCPACSConfiguration& GetConfiguration() const; + TIGL_EXPORT CCPACSConfiguration& GetConfiguration(); + }; } // end namespace tigl diff --git a/src/rotor/CCPACSRotorHinges.cpp b/src/rotor/CCPACSRotorHinges.cpp index ae372f7360..c7a3957a19 100644 --- a/src/rotor/CCPACSRotorHinges.cpp +++ b/src/rotor/CCPACSRotorHinges.cpp @@ -35,13 +35,13 @@ CCPACSRotorHinges::CCPACSRotorHinges(CCPACSRotorBladeAttachment* parent, CTiglUI : generated::CPACSRotorHubHinges(parent, uidMgr) {} // Returns the total count of rotor hinges in a rotor blade attachment -int CCPACSRotorHinges::GetRotorHingeCount() const +size_t CCPACSRotorHinges::GetRotorHingeCount() const { return static_cast(m_hinges.size()); } // Returns the rotor hinge for a given index. -CCPACSRotorHinge& CCPACSRotorHinges::GetRotorHinge(int index) const +const CCPACSRotorHinge& CCPACSRotorHinges::GetRotorHinge(size_t index) const { index--; if (index < 0 || index >= GetRotorHingeCount()) { @@ -50,22 +50,42 @@ CCPACSRotorHinge& CCPACSRotorHinges::GetRotorHinge(int index) const return *m_hinges[index]; } -// Returns the parent configuration -CCPACSConfiguration& CCPACSRotorHinges::GetConfiguration() const +CCPACSRotorHinge& CCPACSRotorHinges::GetRotorHinge(size_t index) { - return m_parent->GetConfiguration(); + return const_cast(std::as_const(*this).GetRotorHinge(index)); } // Returns the parent rotor -CCPACSRotor& CCPACSRotorHinges::GetRotor() const +const CCPACSRotor& CCPACSRotorHinges::GetRotor() const +{ + return m_parent->GetRotor(); +} + +CCPACSRotor& CCPACSRotorHinges::GetRotor() { return m_parent->GetRotor(); } // Returns the parent rotor blade attachment -CCPACSRotorBladeAttachment& CCPACSRotorHinges::GetRotorBladeAttachment() const +const CCPACSRotorBladeAttachment& CCPACSRotorHinges::GetRotorBladeAttachment() const +{ + return *m_parent; +} + +CCPACSRotorBladeAttachment& CCPACSRotorHinges::GetRotorBladeAttachment() { return *m_parent; } +// Returns the parent configuration +const CCPACSConfiguration& CCPACSRotorHinges::GetConfiguration() const +{ + return m_parent->GetConfiguration(); +} + +CCPACSConfiguration& CCPACSRotorHinges::GetConfiguration() +{ + return m_parent->GetConfiguration(); +} + } // end namespace tigl diff --git a/src/rotor/CCPACSRotorHinges.h b/src/rotor/CCPACSRotorHinges.h index 5ae3bdc0b5..2ac9520c32 100644 --- a/src/rotor/CCPACSRotorHinges.h +++ b/src/rotor/CCPACSRotorHinges.h @@ -42,19 +42,23 @@ class CCPACSRotorHinges : public generated::CPACSRotorHubHinges TIGL_EXPORT CCPACSRotorHinges(CCPACSRotorBladeAttachment* parent, CTiglUIDManager* uidMgr); // Returns the total count of rotor hinges in a rotor blade attachment - TIGL_EXPORT int GetRotorHingeCount() const; + TIGL_EXPORT size_t GetRotorHingeCount() const; // Returns the rotor hinge for a given index. - TIGL_EXPORT CCPACSRotorHinge& GetRotorHinge(int index) const; - - // Returns the parent configuration - TIGL_EXPORT CCPACSConfiguration& GetConfiguration() const; + TIGL_EXPORT const CCPACSRotorHinge& GetRotorHinge(size_t index) const; + TIGL_EXPORT CCPACSRotorHinge& GetRotorHinge(size_t index); // Returns the parent rotor - TIGL_EXPORT CCPACSRotor& GetRotor() const; + TIGL_EXPORT const CCPACSRotor& GetRotor() const; + TIGL_EXPORT CCPACSRotor& GetRotor(); // Returns the parent rotor blade attachment - TIGL_EXPORT CCPACSRotorBladeAttachment& GetRotorBladeAttachment() const; + TIGL_EXPORT const CCPACSRotorBladeAttachment& GetRotorBladeAttachment() const; + TIGL_EXPORT CCPACSRotorBladeAttachment& GetRotorBladeAttachment(); + + // Returns the parent configuration + TIGL_EXPORT const CCPACSConfiguration& GetConfiguration() const; + TIGL_EXPORT CCPACSConfiguration& GetConfiguration(); }; } // end namespace tigl diff --git a/src/rotor/CCPACSRotorHub.cpp b/src/rotor/CCPACSRotorHub.cpp index 87fac69fd8..836bfd6ccd 100644 --- a/src/rotor/CCPACSRotorHub.cpp +++ b/src/rotor/CCPACSRotorHub.cpp @@ -44,19 +44,24 @@ TiglRotorHubType CCPACSRotorHub::GetDefaultedType() const } // Returns the rotor blade attachment count -int CCPACSRotorHub::GetRotorBladeAttachmentCount() const +size_t CCPACSRotorHub::GetRotorBladeAttachmentCount() const { return m_rotorBladeAttachments.GetRotorBladeAttachmentCount(); } // Returns the rotor blade attachment for a given index -CCPACSRotorBladeAttachment& CCPACSRotorHub::GetRotorBladeAttachment(int index) const +const CCPACSRotorBladeAttachment& CCPACSRotorHub::GetRotorBladeAttachment(size_t index) const +{ + return m_rotorBladeAttachments.GetRotorBladeAttachment(index); +} + +CCPACSRotorBladeAttachment& CCPACSRotorHub::GetRotorBladeAttachment(size_t index) { return m_rotorBladeAttachments.GetRotorBladeAttachment(index); } // Returns the rotor blade count -int CCPACSRotorHub::GetRotorBladeCount() const +size_t CCPACSRotorHub::GetRotorBladeCount() const { int rotorBladeCount = 0; for (int i=1; i<=GetRotorBladeAttachmentCount(); i++) { @@ -66,7 +71,7 @@ int CCPACSRotorHub::GetRotorBladeCount() const } // Returns the rotor blade for a given index -CTiglAttachedRotorBlade& CCPACSRotorHub::GetRotorBlade(int index) const +const CTiglAttachedRotorBlade& CCPACSRotorHub::GetRotorBlade(size_t index) const { int rotorBladeIndex = index; int rotorBladeAttachmentIndex = 1; @@ -77,16 +82,37 @@ CTiglAttachedRotorBlade& CCPACSRotorHub::GetRotorBlade(int index) const return GetRotorBladeAttachment(rotorBladeAttachmentIndex).GetAttachedRotorBlade(rotorBladeIndex); } -// Returns the parent configuration -CCPACSConfiguration& CCPACSRotorHub::GetConfiguration() const +CTiglAttachedRotorBlade& CCPACSRotorHub::GetRotorBlade(size_t index) { - return m_parent->GetConfiguration(); + int rotorBladeIndex = index; + int rotorBladeAttachmentIndex = 1; + while (rotorBladeIndex > GetRotorBladeAttachment(rotorBladeAttachmentIndex).GetNumberOfBlades()) { + rotorBladeIndex -= GetRotorBladeAttachment(rotorBladeAttachmentIndex).GetNumberOfBlades(); + rotorBladeAttachmentIndex++; + } + return GetRotorBladeAttachment(rotorBladeAttachmentIndex).GetAttachedRotorBlade(rotorBladeIndex); } // Returns the parent rotor -CCPACSRotor& CCPACSRotorHub::GetRotor() const +const CCPACSRotor& CCPACSRotorHub::GetRotor() const { return *m_parent; } +CCPACSRotor& CCPACSRotorHub::GetRotor() +{ + return *m_parent; +} + +// Returns the parent configuration +const CCPACSConfiguration& CCPACSRotorHub::GetConfiguration() const +{ + return m_parent->GetConfiguration(); +} + +CCPACSConfiguration& CCPACSRotorHub::GetConfiguration() +{ + return m_parent->GetConfiguration(); +} + } // end namespace tigl diff --git a/src/rotor/CCPACSRotorHub.h b/src/rotor/CCPACSRotorHub.h index 7a5987c1b8..6ff55d8882 100644 --- a/src/rotor/CCPACSRotorHub.h +++ b/src/rotor/CCPACSRotorHub.h @@ -48,22 +48,26 @@ class CCPACSRotorHub : public generated::CPACSRotorHub TIGL_EXPORT TiglRotorHubType GetDefaultedType() const; // Returns the rotor blade attachment count - TIGL_EXPORT int GetRotorBladeAttachmentCount() const; + TIGL_EXPORT size_t GetRotorBladeAttachmentCount() const; // Returns the rotor blade attachment for a given index - TIGL_EXPORT CCPACSRotorBladeAttachment& GetRotorBladeAttachment(int index) const; + TIGL_EXPORT const CCPACSRotorBladeAttachment& GetRotorBladeAttachment(size_t index) const; + TIGL_EXPORT CCPACSRotorBladeAttachment& GetRotorBladeAttachment(size_t index); // Returns the rotor blade count - TIGL_EXPORT int GetRotorBladeCount() const; + TIGL_EXPORT size_t GetRotorBladeCount() const; // Returns the rotor blade for a given index - TIGL_EXPORT CTiglAttachedRotorBlade& GetRotorBlade(int index) const; - - // Returns the parent configuration - TIGL_EXPORT CCPACSConfiguration& GetConfiguration() const; + TIGL_EXPORT const CTiglAttachedRotorBlade& GetRotorBlade(size_t index) const; + TIGL_EXPORT CTiglAttachedRotorBlade& GetRotorBlade(size_t index); // Returns the parent rotor - TIGL_EXPORT CCPACSRotor& GetRotor() const; + TIGL_EXPORT const CCPACSRotor& GetRotor() const; + TIGL_EXPORT CCPACSRotor& GetRotor(); + + // Returns the parent configuration + TIGL_EXPORT const CCPACSConfiguration& GetConfiguration() const; + TIGL_EXPORT CCPACSConfiguration& GetConfiguration(); }; } // end namespace tigl diff --git a/src/rotor/CCPACSRotorProfiles.cpp b/src/rotor/CCPACSRotorProfiles.cpp index 2f3fbd290b..c36269aa35 100644 --- a/src/rotor/CCPACSRotorProfiles.cpp +++ b/src/rotor/CCPACSRotorProfiles.cpp @@ -83,7 +83,7 @@ bool CCPACSRotorProfiles::HasProfile(std::string uid) const } // Returns the wing profile for a given uid. -CCPACSWingProfile& CCPACSRotorProfiles::GetProfile(std::string uid) const +const CCPACSWingProfile& CCPACSRotorProfiles::GetProfile(std::string uid) const { for (auto& p : m_rotorAirfoils) if (p->GetUID() == uid) @@ -92,4 +92,9 @@ CCPACSWingProfile& CCPACSRotorProfiles::GetProfile(std::string uid) const throw CTiglError("Rotor profile \"" + uid + "\" not found in CPACS file!", TIGL_UID_ERROR); } +CCPACSWingProfile& CCPACSRotorProfiles::GetProfile(std::string uid) +{ + return const_cast(std::as_const(*this).GetProfile(uid)); +} + } // end namespace tigl diff --git a/src/rotor/CCPACSRotorProfiles.h b/src/rotor/CCPACSRotorProfiles.h index 1f846b994e..cfe84a50ef 100644 --- a/src/rotor/CCPACSRotorProfiles.h +++ b/src/rotor/CCPACSRotorProfiles.h @@ -53,7 +53,8 @@ class CCPACSRotorProfiles : public generated::CPACSRotorAirfoils TIGL_EXPORT bool HasProfile(std::string uid) const; // Returns the wing profile for a given index or uid. - TIGL_EXPORT CCPACSWingProfile& GetProfile(std::string uid) const; + TIGL_EXPORT const CCPACSWingProfile& GetProfile(std::string uid) const; + TIGL_EXPORT CCPACSWingProfile& GetProfile(std::string uid); // Invalidates internal state TIGL_EXPORT void Invalidate(const boost::optional& source = boost::none) const; diff --git a/src/rotor/CCPACSRotors.cpp b/src/rotor/CCPACSRotors.cpp index 9b41cb2878..06c56121b1 100644 --- a/src/rotor/CCPACSRotors.cpp +++ b/src/rotor/CCPACSRotors.cpp @@ -46,45 +46,13 @@ void CCPACSRotors::Invalidate(const boost::optional& source) const } } -// Returns the total count of rotors in a configuration -int CCPACSRotors::GetRotorCount() const -{ - return (static_cast(m_rotors.size())); -} - -// Returns the rotor for a given index. -CCPACSRotor& CCPACSRotors::GetRotor(int index) const -{ - index --; - if (index < 0 || index >= GetRotorCount()) { - throw CTiglError("Invalid index in CCPACSRotors::GetRotor", TIGL_INDEX_ERROR); - } - return (*m_rotors[index]); -} - -// Returns the rotor for a given UID. -CCPACSRotor& CCPACSRotors::GetRotor(const std::string& UID) const -{ - return (*m_rotors[GetRotorIndex(UID)-1]); -} - -// Returns the rotor index for a given UID. -int CCPACSRotors::GetRotorIndex(const std::string& UID) const +// Returns the parent configuration +const CCPACSConfiguration& CCPACSRotors::GetConfiguration() const { - for (int i=0; i < GetRotorCount(); i++) { - const std::string tmpUID(m_rotors[i]->GetUID()); - if (tmpUID == UID) { - return i+1; - } - } - - // UID not there - throw CTiglError("Invalid UID in CCPACSRotors::GetRotorIndex", TIGL_UID_ERROR); - return -1; + return m_parent->GetConfiguration(); } -// Returns the parent configuration -CCPACSConfiguration& CCPACSRotors::GetConfiguration() const +CCPACSConfiguration& CCPACSRotors::GetConfiguration() { return m_parent->GetConfiguration(); } diff --git a/src/rotor/CCPACSRotors.h b/src/rotor/CCPACSRotors.h index 49f90aa4cd..65eccc9bca 100644 --- a/src/rotor/CCPACSRotors.h +++ b/src/rotor/CCPACSRotors.h @@ -46,20 +46,9 @@ class CCPACSRotors : public generated::CPACSRotors // Invalidates internal state TIGL_EXPORT void Invalidate(const boost::optional& source = boost::none) const; - // Returns the total count of rotors in a configuration - TIGL_EXPORT int GetRotorCount() const; - - // Returns the rotor for a given index. - TIGL_EXPORT CCPACSRotor& GetRotor(int index) const; - - // Returns the rotor for a given UID. - TIGL_EXPORT CCPACSRotor& GetRotor(const std::string& UID) const; - - // Returns the rotor index for a given UID. - TIGL_EXPORT int GetRotorIndex(const std::string& UID) const; - // Returns the parent configuration - TIGL_EXPORT CCPACSConfiguration& GetConfiguration() const; + TIGL_EXPORT const CCPACSConfiguration& GetConfiguration() const; + TIGL_EXPORT CCPACSConfiguration& GetConfiguration(); }; } // end namespace tigl diff --git a/src/rotor/CTiglAttachedRotorBlade.cpp b/src/rotor/CTiglAttachedRotorBlade.cpp index e4ba2448e7..b20863c73f 100644 --- a/src/rotor/CTiglAttachedRotorBlade.cpp +++ b/src/rotor/CTiglAttachedRotorBlade.cpp @@ -90,25 +90,45 @@ void CTiglAttachedRotorBlade::Update() } // Returns the original unattached rotor blade -CCPACSWing& CTiglAttachedRotorBlade::GetUnattachedRotorBlade() const +const CCPACSWing& CTiglAttachedRotorBlade::GetUnattachedRotorBlade() const +{ + return *rotorBlade; +} + +CCPACSWing& CTiglAttachedRotorBlade::GetUnattachedRotorBlade() { return *rotorBlade; } // Returns the parent rotor blade attachment this rotor blade belongs to -CCPACSRotorBladeAttachment& CTiglAttachedRotorBlade::GetRotorBladeAttachment() const +const CCPACSRotorBladeAttachment& CTiglAttachedRotorBlade::GetRotorBladeAttachment() const +{ + return *parent; +} + +CCPACSRotorBladeAttachment& CTiglAttachedRotorBlade::GetRotorBladeAttachment() { return *parent; } // Returns the parent rotor -CCPACSRotor& CTiglAttachedRotorBlade::GetRotor() const +const CCPACSRotor& CTiglAttachedRotorBlade::GetRotor() const +{ + return parent->GetRotor(); +} + +CCPACSRotor& CTiglAttachedRotorBlade::GetRotor() { return parent->GetRotor(); } // Returns the parent configuration -CCPACSConfiguration& CTiglAttachedRotorBlade::GetConfiguration() const +const CCPACSConfiguration& CTiglAttachedRotorBlade::GetConfiguration() const +{ + return parent->GetConfiguration(); +} + +CCPACSConfiguration& CTiglAttachedRotorBlade::GetConfiguration() { return parent->GetConfiguration(); } diff --git a/src/rotor/CTiglAttachedRotorBlade.h b/src/rotor/CTiglAttachedRotorBlade.h index d97a533937..430c3a9303 100644 --- a/src/rotor/CTiglAttachedRotorBlade.h +++ b/src/rotor/CTiglAttachedRotorBlade.h @@ -66,16 +66,20 @@ class CTiglAttachedRotorBlade : public CTiglRelativelyPositionedComponent } // Returns the original unattached rotor blade - TIGL_EXPORT CCPACSWing& GetUnattachedRotorBlade() const; + TIGL_EXPORT const CCPACSWing& GetUnattachedRotorBlade() const; + TIGL_EXPORT CCPACSWing& GetUnattachedRotorBlade(); // Returns the parent rotor blade attachment this rotor blade belongs to - TIGL_EXPORT CCPACSRotorBladeAttachment& GetRotorBladeAttachment() const; + TIGL_EXPORT const CCPACSRotorBladeAttachment& GetRotorBladeAttachment() const; + TIGL_EXPORT CCPACSRotorBladeAttachment& GetRotorBladeAttachment(); // Returns the parent rotor - TIGL_EXPORT CCPACSRotor& GetRotor() const; + TIGL_EXPORT const CCPACSRotor& GetRotor() const; + TIGL_EXPORT CCPACSRotor& GetRotor(); // Returns the parent configuration - TIGL_EXPORT CCPACSConfiguration& GetConfiguration() const; + TIGL_EXPORT const CCPACSConfiguration& GetConfiguration() const; + TIGL_EXPORT CCPACSConfiguration& GetConfiguration(); // Returns the azimuth angle of this rotor blade TIGL_EXPORT double GetAzimuthAngle() const; diff --git a/src/structural_elements/CCPACSDoors.cpp b/src/structural_elements/CCPACSDoors.cpp deleted file mode 100644 index 130d22cb6b..0000000000 --- a/src/structural_elements/CCPACSDoors.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/* -* Copyright (c) 2018 RISC Software GmbH -* -* 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 "CCPACSDoors.h" - -namespace tigl -{ - -CCPACSDoors::CCPACSDoors(CCPACSStructuralElements* parent, CTiglUIDManager* uidMgr) - : generated::CPACSDoors(parent, uidMgr) -{ -} - -} // namespace tigl diff --git a/src/structural_elements/CCPACSDoors.h b/src/structural_elements/CCPACSDoors.h deleted file mode 100644 index bf5e4a0b98..0000000000 --- a/src/structural_elements/CCPACSDoors.h +++ /dev/null @@ -1,30 +0,0 @@ -/* -* Copyright (c) 2018 RISC Software GmbH -* -* 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/CPACSDoors.h" - -namespace tigl -{ - -class CCPACSDoors : public generated::CPACSDoors -{ -public: - TIGL_EXPORT CCPACSDoors(CCPACSStructuralElements* parent, CTiglUIDManager* uidMgr); -}; - -} // namespace tigl diff --git a/src/structural_elements/CCPACSPressureBulkheads.cpp b/src/structural_elements/CCPACSPressureBulkheads.cpp deleted file mode 100644 index e9c22f6153..0000000000 --- a/src/structural_elements/CCPACSPressureBulkheads.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/* -* Copyright (c) 2018 RISC Software GmbH -* -* 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 "CCPACSPressureBulkheads.h" - -namespace tigl -{ -CCPACSPressureBulkheads::CCPACSPressureBulkheads(CCPACSStructuralElements* parent, CTiglUIDManager* uidMgr) - : generated::CPACSPressureBulkheads(parent, uidMgr) -{ -} - -} // namespace tigl diff --git a/src/structural_elements/CCPACSPressureBulkheads.h b/src/structural_elements/CCPACSPressureBulkheads.h deleted file mode 100644 index cfa7451b29..0000000000 --- a/src/structural_elements/CCPACSPressureBulkheads.h +++ /dev/null @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2018 RISC Software GmbH -* -* 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/CPACSPressureBulkheads.h" - -namespace tigl -{ -class CCPACSPressureBulkheads : public generated::CPACSPressureBulkheads -{ -public: - TIGL_EXPORT CCPACSPressureBulkheads(CCPACSStructuralElements* parent, CTiglUIDManager* uidMgr); -}; - -} // namespace tigl diff --git a/src/wing/CCPACSWing.h b/src/wing/CCPACSWing.h index 9ef6490efc..cc8f1ddd50 100644 --- a/src/wing/CCPACSWing.h +++ b/src/wing/CCPACSWing.h @@ -28,7 +28,7 @@ #include "tigl_config.h" #include "CTiglTransformation.h" #include "CTiglRelativelyPositionedComponent.h" -#include "CCPACSWingSections.h" +#include "generated/CPACSWingSections.h" #include "CCPACSWingSegments.h" #include "CCPACSWingComponentSegments.h" #include "CCPACSPositionings.h" diff --git a/src/wing/CCPACSWingCells.cpp b/src/wing/CCPACSWingCells.cpp index 65b1c8326c..bd16245ee8 100644 --- a/src/wing/CCPACSWingCells.cpp +++ b/src/wing/CCPACSWingCells.cpp @@ -33,31 +33,4 @@ void CCPACSWingCells::Invalidate(const boost::optional& source) con m_cells[i]->Invalidate(source); } } - -int CCPACSWingCells::GetCellCount() const -{ - return static_cast(m_cells.size()); -} - -const CCPACSWingCell& CCPACSWingCells::GetCell(int index) const -{ - index--; - if (index < 0 || index >= GetCellCount()) { - throw CTiglError("Illegal index in CCPACSWingCells::GetCell", TIGL_INDEX_ERROR); - } - return *m_cells[index]; -} - -const CCPACSWingCell &CCPACSWingCells::GetCell(const std::string &UID) const -{ - for (int i=0; i < GetCellCount(); i++) { - const std::string tmpUID(m_cells[i]->GetUID()); - if (tmpUID == UID) { - return *m_cells[i]; - } - } - - // UID not there - throw CTiglError("Invalid UID in CCPACSWingCells::GetCell", TIGL_UID_ERROR); -} } // namespace tigl diff --git a/src/wing/CCPACSWingCells.h b/src/wing/CCPACSWingCells.h index 1e8e40a0d8..73540128b3 100644 --- a/src/wing/CCPACSWingCells.h +++ b/src/wing/CCPACSWingCells.h @@ -36,13 +36,6 @@ class CCPACSWingCells : public generated::CPACSWingCells TIGL_EXPORT void Invalidate(const boost::optional& source = boost::none) const; - // Returns the total count of wing cells for that wing component segment - TIGL_EXPORT int GetCellCount() const; - - // Returns the wing cell for a given index. - TIGL_EXPORT const CCPACSWingCell& GetCell(int index) const; - - TIGL_EXPORT const CCPACSWingCell& GetCell(const std::string& UID) const; }; } // end namespace tigl diff --git a/src/wing/CCPACSWingComponentSegments.cpp b/src/wing/CCPACSWingComponentSegments.cpp index 1f9b67769c..804c21b51a 100644 --- a/src/wing/CCPACSWingComponentSegments.cpp +++ b/src/wing/CCPACSWingComponentSegments.cpp @@ -40,49 +40,4 @@ void CCPACSWingComponentSegments::Invalidate(const boost::optional& } } -// Gets a componentSegment by index. -CCPACSWingComponentSegment& CCPACSWingComponentSegments::GetComponentSegment(int index) -{ - index--; - if (index < 0 || index >= GetComponentSegmentCount()) { - throw CTiglError("Invalid index value in CCPACSWingComponentSegments::GetComponentSegment", TIGL_INDEX_ERROR); - } - return *m_componentSegments[index]; -} - -const CCPACSWingComponentSegment& CCPACSWingComponentSegments::GetComponentSegment(int index) const -{ - index--; - if (index < 0 || index >= GetComponentSegmentCount()) { - throw CTiglError("Invalid index value in CCPACSWingComponentSegments::GetComponentSegment", TIGL_INDEX_ERROR); - } - return *m_componentSegments[index]; -} - -// Gets a componentSegment by uid. -CCPACSWingComponentSegment & CCPACSWingComponentSegments::GetComponentSegment(const std::string& componentSegmentUID) -{ - for (std::size_t i = 0; i < m_componentSegments.size(); i++) { - if (m_componentSegments[i]->GetUID() == componentSegmentUID) { - return *m_componentSegments[i]; - } - } - throw CTiglError("Invalid uid in CCPACSWingComponentSegments::GetComponentSegment", TIGL_UID_ERROR); -} - -const CCPACSWingComponentSegment & CCPACSWingComponentSegments::GetComponentSegment(const std::string& componentSegmentUID) const -{ - for (std::size_t i = 0; i < m_componentSegments.size(); i++) { - if (m_componentSegments[i]->GetUID() == componentSegmentUID) { - return *m_componentSegments[i]; - } - } - throw CTiglError("Invalid uid in CCPACSWingComponentSegments::GetComponentSegment", TIGL_UID_ERROR); -} - -// Gets total componentSegment count -int CCPACSWingComponentSegments::GetComponentSegmentCount() const -{ - return static_cast(m_componentSegments.size()); -} } // end namespace tigl diff --git a/src/wing/CCPACSWingComponentSegments.h b/src/wing/CCPACSWingComponentSegments.h index 3604c28a3b..c45e6e8051 100644 --- a/src/wing/CCPACSWingComponentSegments.h +++ b/src/wing/CCPACSWingComponentSegments.h @@ -43,14 +43,6 @@ class CCPACSWingComponentSegments : public generated::CPACSComponentSegments // Invalidates internal state TIGL_EXPORT void Invalidate(const boost::optional& source = boost::none) const; - // Gets a segment by index - TIGL_EXPORT CCPACSWingComponentSegment & GetComponentSegment(int index); - TIGL_EXPORT const CCPACSWingComponentSegment & GetComponentSegment(int index) const; - TIGL_EXPORT CCPACSWingComponentSegment & GetComponentSegment(const std::string& componentSegmentUID); - TIGL_EXPORT const CCPACSWingComponentSegment & GetComponentSegment(const std::string& componentSegmentUID) const; - - // Gets total segment count - TIGL_EXPORT int GetComponentSegmentCount() const; }; } // end namespace tigl diff --git a/src/wing/CCPACSWingRibsDefinitions.cpp b/src/wing/CCPACSWingRibsDefinitions.cpp index 6d6ec2cdd3..a67cd38a5e 100644 --- a/src/wing/CCPACSWingRibsDefinitions.cpp +++ b/src/wing/CCPACSWingRibsDefinitions.cpp @@ -34,45 +34,5 @@ void CCPACSWingRibsDefinitions::Invalidate(const boost::optional& s } } -int CCPACSWingRibsDefinitions::GetRibsDefinitionCount() const -{ - return static_cast(m_ribsDefinitions.size()); -} - -const CCPACSWingRibsDefinition& CCPACSWingRibsDefinitions::GetRibsDefinition(const int index) const -{ - const int idx = index - 1; - if (idx < 0 || idx >= GetRibsDefinitionCount()) { - LOG(ERROR) << "Invalid index value"; - throw CTiglError("Invalid index value in CCPACSWingRibsDefinitions::GetRibsDefinition", TIGL_INDEX_ERROR); - } - return static_cast(*(m_ribsDefinitions[idx])); -} - -CCPACSWingRibsDefinition& CCPACSWingRibsDefinitions::GetRibsDefinition(const int index) -{ - // forward call to const method - return const_cast(static_cast(*this).GetRibsDefinition(index)); -} - -const CCPACSWingRibsDefinition& CCPACSWingRibsDefinitions::GetRibsDefinition(const std::string& uid) const -{ - for (const auto& r : m_ribsDefinitions) { - if (r->GetUID() == uid) { - return *r; - } - } - - const std::string& referenceUID = CTiglWingStructureReference(*GetParent()).GetUID(); - LOG(ERROR) << "Ribs Definition \"" << uid << "\" not found in component segment or trailing edge device with UID \"" << referenceUID << "\""; - throw CTiglError("Ribs Definition \"" + uid + "\" not found in component segment or trailing edge device with UID \"" + referenceUID + "\". Please check the CPACS document!", TIGL_ERROR); -} - -CCPACSWingRibsDefinition& CCPACSWingRibsDefinitions::GetRibsDefinition(const std::string& uid) -{ - // forward call to const method - return const_cast(static_cast(*this).GetRibsDefinition(uid)); -} - } // end namespace tigl diff --git a/src/wing/CCPACSWingRibsDefinitions.h b/src/wing/CCPACSWingRibsDefinitions.h index 08bd03f40d..a794f66d6f 100644 --- a/src/wing/CCPACSWingRibsDefinitions.h +++ b/src/wing/CCPACSWingRibsDefinitions.h @@ -34,13 +34,6 @@ class CCPACSWingRibsDefinitions : public generated::CPACSWingRibsDefinitions TIGL_EXPORT void Invalidate(const boost::optional& source = boost::none) const; - TIGL_EXPORT int GetRibsDefinitionCount() const; - - TIGL_EXPORT const CCPACSWingRibsDefinition& GetRibsDefinition(int index) const; - TIGL_EXPORT CCPACSWingRibsDefinition& GetRibsDefinition(int index); - - TIGL_EXPORT const CCPACSWingRibsDefinition& GetRibsDefinition(const std::string& uid) const; - TIGL_EXPORT CCPACSWingRibsDefinition& GetRibsDefinition(const std::string& uid); }; } // end namespace tigl diff --git a/src/wing/CCPACSWingSections.cpp b/src/wing/CCPACSWingSections.cpp deleted file mode 100644 index 1d0b4ef8fb..0000000000 --- a/src/wing/CCPACSWingSections.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* -* Copyright (C) 2007-2013 German Aerospace Center (DLR/SC) -* -* Created: 2010-08-13 Markus Litz -* 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. -*/ -/** -* @file -* @brief Implementation of CPACS wing sections handling routines. -*/ - -#include "CCPACSWingSections.h" -#include "CCPACSWingSection.h" -#include "CTiglError.h" - -namespace tigl -{ -CCPACSWingSections::CCPACSWingSections(CCPACSWing* parent, CTiglUIDManager* uidMgr) - : generated::CPACSWingSections(parent, uidMgr) {} - -CCPACSWingSections::CCPACSWingSections(CCPACSEnginePylon* parent, CTiglUIDManager* uidMgr) - : generated::CPACSWingSections(parent, uidMgr) {} - -// Get section count -int CCPACSWingSections::GetSectionCount() const -{ - return static_cast(m_sections.size()); -} - -// Returns the section for a given index -CCPACSWingSection& CCPACSWingSections::GetSection(int index) const -{ - index--; - if (index < 0 || index >= GetSectionCount()) { - throw CTiglError("Invalid index in CCPACSWingSections::GetSection", TIGL_INDEX_ERROR); - } - return *m_sections[index]; -} - -// Gets a section by uid. -CCPACSWingSection& CCPACSWingSections::GetSection(const std::string& sectionUID) -{ - for (std::size_t i = 0; i < m_sections.size(); i++) { - if (m_sections[i]->GetUID() == sectionUID) { - return *m_sections[i]; - } - } - throw CTiglError("Invalid uid in CCPACSWingSections::GetSection", TIGL_UID_ERROR); -} - -} // end namespace tigl diff --git a/src/wing/CCPACSWingSections.h b/src/wing/CCPACSWingSections.h deleted file mode 100644 index 089254d51f..0000000000 --- a/src/wing/CCPACSWingSections.h +++ /dev/null @@ -1,48 +0,0 @@ -/* -* Copyright (C) 2007-2013 German Aerospace Center (DLR/SC) -* -* Created: 2010-08-13 Markus Litz -* 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. -*/ -/** -* @file -* @brief Implementation of CPACS wing sections handling routines. -*/ - -#ifndef CCPACSWINGSECTIONS_H -#define CCPACSWINGSECTIONS_H - -#include "generated/CPACSWingSections.h" - -namespace tigl -{ - -class CCPACSWingSections : public generated::CPACSWingSections -{ -public: - TIGL_EXPORT CCPACSWingSections(CCPACSWing* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CCPACSWingSections(CCPACSEnginePylon* parent, CTiglUIDManager* uidMgr); - - // Get section count - TIGL_EXPORT int GetSectionCount() const; - - // Returns the section for a given index - TIGL_EXPORT CCPACSWingSection& GetSection(int index) const; - - // Returns the section for a given uid - TIGL_EXPORT CCPACSWingSection& GetSection(const std::string& sectionsUID); -}; - -} // end namespace tigl - -#endif // CCPACSWINGSECTIONS_H diff --git a/src/wing/CCPACSWingSegment.cpp b/src/wing/CCPACSWingSegment.cpp index 6f91b7af69..8ee38c2aba 100644 --- a/src/wing/CCPACSWingSegment.cpp +++ b/src/wing/CCPACSWingSegment.cpp @@ -34,7 +34,7 @@ #include "CCPACSEnginePylon.h" #include "CCPACSWingSegments.h" #include "CCPACSWingProfiles.h" -#include "CCPACSGuideCurveProfiles.h" +#include "generated/CPACSGuideCurveProfiles.h" #include "CCPACSGuideCurveAlgo.h" #include "CCPACSWingProfileGetPointAlgo.h" #include "CCPACSConfiguration.h" diff --git a/src/wing/CCPACSWingSegments.cpp b/src/wing/CCPACSWingSegments.cpp index cc25a82049..ee1a6f8db4 100644 --- a/src/wing/CCPACSWingSegments.cpp +++ b/src/wing/CCPACSWingSegments.cpp @@ -63,52 +63,6 @@ void CCPACSWingSegments::RemoveSegment(CCPACSWingSegment& ref) InvalidateParent(); } -// Gets a segment by index. -CCPACSWingSegment& CCPACSWingSegments::GetSegment(int index) -{ - index--; - if (index < 0 || index >= GetSegmentCount()) { - throw CTiglError("Invalid index value in CCPACSWingSegments::GetSegment", TIGL_INDEX_ERROR); - } - return *m_segments[index]; -} - -const CCPACSWingSegment& CCPACSWingSegments::GetSegment(int index) const -{ - index--; - if (index < 0 || index >= GetSegmentCount()) { - throw CTiglError("Invalid index value in CCPACSWingSegments::GetSegment", TIGL_INDEX_ERROR); - } - return *m_segments[index]; -} - -// Gets a segment by uid. -CCPACSWingSegment& CCPACSWingSegments::GetSegment(const std::string& segmentUID) -{ - for (std::size_t i = 0; i < m_segments.size(); i++) { - if (m_segments[i]->GetUID() == segmentUID) { - return *m_segments[i]; - } - } - throw CTiglError("Invalid uid in CCPACSWingSegments::GetSegment", TIGL_UID_ERROR); -} - -const CCPACSWingSegment& CCPACSWingSegments::GetSegment(const std::string& segmentUID) const -{ - for (std::size_t i = 0; i < m_segments.size(); i++) { - if (m_segments[i]->GetUID() == segmentUID) { - return *m_segments[i]; - } - } - throw CTiglError("Invalid uid in CCPACSWingSegments::GetSegment", TIGL_UID_ERROR); -} - -// Gets total segment count -int CCPACSWingSegments::GetSegmentCount() const -{ - return static_cast(m_segments.size()); -} - void CCPACSWingSegments::InvalidateParent() const { // Invalidate wing or EnginePylon diff --git a/src/wing/CCPACSWingSegments.h b/src/wing/CCPACSWingSegments.h index 94455b1fd7..b584104bd5 100644 --- a/src/wing/CCPACSWingSegments.h +++ b/src/wing/CCPACSWingSegments.h @@ -47,15 +47,6 @@ class CCPACSWingSegments : public generated::CPACSWingSegments TIGL_EXPORT CCPACSWingSegment& AddSegment() override; TIGL_EXPORT void RemoveSegment(CCPACSWingSegment& ref) override; - // Gets a segment by index or UID. - TIGL_EXPORT CCPACSWingSegment& GetSegment(const int index); - TIGL_EXPORT const CCPACSWingSegment& GetSegment(const int index) const; - TIGL_EXPORT CCPACSWingSegment& GetSegment(const std::string& segmentUID); - TIGL_EXPORT const CCPACSWingSegment& GetSegment(const std::string& segmentUID) const; - - // Gets total segment count - TIGL_EXPORT int GetSegmentCount() const; - const CTiglRelativelyPositionedComponent* GetParentComponent() const { return m_parentVariant; diff --git a/src/wing/CCPACSWingSparSegments.cpp b/src/wing/CCPACSWingSparSegments.cpp index 8d5c940c4a..157b62c06b 100644 --- a/src/wing/CCPACSWingSparSegments.cpp +++ b/src/wing/CCPACSWingSparSegments.cpp @@ -34,31 +34,4 @@ void CCPACSWingSparSegments::Invalidate(const boost::optional& sour s->Invalidate(source); } } - -int CCPACSWingSparSegments::GetSparSegmentCount() const -{ - return static_cast(m_sparSegments.size()); -} - -CCPACSWingSparSegment& CCPACSWingSparSegments::GetSparSegment(int index) const -{ - const int idx = index - 1; - if (idx < 0 || idx >= GetSparSegmentCount()) { - LOG(ERROR) << "Invalid index value"; - throw CTiglError("Invalid index value in CCPACSWingSparSegments::getSparSegment", TIGL_INDEX_ERROR); - } - return (*(m_sparSegments[idx])); -} - -CCPACSWingSparSegment& CCPACSWingSparSegments::GetSparSegment(const std::string& uid) const -{ - for (auto& s : m_sparSegments) { - if (s->GetUID() == uid) { - return *s; - } - } - const std::string& referenceUID = CTiglWingStructureReference(*GetParent()->GetParent()).GetUID(); - LOG(ERROR) << "Spar Segment \"" << uid << "\" not found in component segment or trailing edge device with UID \"" << referenceUID << "\""; - throw CTiglError("Spar Segment \"" + uid + "\" not found in component segment or trailing edge device with UID \"" + referenceUID + "\". Please check the CPACS document!", TIGL_ERROR); -} } // end namespace tigl diff --git a/src/wing/CCPACSWingSparSegments.h b/src/wing/CCPACSWingSparSegments.h index 71c044c664..82a91cca0f 100644 --- a/src/wing/CCPACSWingSparSegments.h +++ b/src/wing/CCPACSWingSparSegments.h @@ -37,9 +37,6 @@ class CCPACSWingSparSegments : public generated::CPACSSparSegments TIGL_EXPORT void Invalidate(const boost::optional& source = boost::none) const; - TIGL_EXPORT int GetSparSegmentCount() const; - TIGL_EXPORT CCPACSWingSparSegment& GetSparSegment(int index) const; - TIGL_EXPORT CCPACSWingSparSegment& GetSparSegment(const std::string& uid) const; }; } // end namespace tigl diff --git a/src/wing/CCPACSWings.cpp b/src/wing/CCPACSWings.cpp index 9400f23ca9..ada08959a6 100644 --- a/src/wing/CCPACSWings.cpp +++ b/src/wing/CCPACSWings.cpp @@ -42,53 +42,6 @@ CCPACSWings::CCPACSWings(CCPACSRotorcraftModel* parent, CTiglUIDManager* uidMgr) CCPACSWings::CCPACSWings(CCPACSAircraftModel* parent, CTiglUIDManager* uidMgr) : generated::CPACSWings(parent, uidMgr) {} -// Returns the total count of wings in a configuration -int CCPACSWings::GetWingCount() const -{ - return static_cast(m_wings.size()); -} - -// Returns the count of wings in a configuration with the property isRotorBlade set to true -int CCPACSWings::GetRotorBladeCount() const -{ - int nRotorBlades = 0; - for (int i = 1; i <= GetWingCount(); i++) { - if (GetWing(i).IsRotorBlade()) { - nRotorBlades++; - } - } - return nRotorBlades; -} - -// Returns the wing for a given index. -CCPACSWing& CCPACSWings::GetWing(int index) const -{ - index --; - if (index < 0 || index >= GetWingCount()) { - throw CTiglError("Invalid index in CCPACSWings::GetWing", TIGL_INDEX_ERROR); - } - return *m_wings[index]; -} - -// Returns the wing for a given UID. -CCPACSWing& CCPACSWings::GetWing(const std::string& UID) const -{ - return *m_wings[GetWingIndex(UID)-1]; -} - -// Returns the wing index for a given UID. -int CCPACSWings::GetWingIndex(const std::string& UID) const -{ - for (int i=0; i < GetWingCount(); i++) { - const std::string tmpUID(m_wings[i]->GetUID()); - if (tmpUID == UID) { - return i+1; - } - } - - // UID not there - throw CTiglError("Invalid UID in CCPACSWings::GetWingIndex", TIGL_UID_ERROR); -} bool CCPACSWings::HasWing(const std::string & uid) const { diff --git a/src/wing/CCPACSWings.h b/src/wing/CCPACSWings.h index 57e7d049ac..a90fa73800 100644 --- a/src/wing/CCPACSWings.h +++ b/src/wing/CCPACSWings.h @@ -43,22 +43,6 @@ class CCPACSWings : public generated::CPACSWings // Invalidates internal state TIGL_EXPORT void Invalidate(const boost::optional& source = boost::none) const; - // Returns the total count of wings in a configuration - TIGL_EXPORT int GetWingCount() const; - - // Returns the count of wings in a configuration with the property isRotorBlade set to true - TIGL_EXPORT int GetRotorBladeCount() const; - - // Returns the wing for a given index. - TIGL_EXPORT CCPACSWing& GetWing(int index) const; - - // Returns the wing for a given UID. - TIGL_EXPORT CCPACSWing& GetWing(const std::string& UID) const; - - - // Returns the wing index for a given UID. - TIGL_EXPORT int GetWingIndex(const std::string& UID) const; - TIGL_EXPORT bool HasWing(const std::string& uid) const; }; diff --git a/tests/integrationtests/TestData/simple_test_rotors.cpacs.xml b/tests/integrationtests/TestData/simple_test_rotors.cpacs.xml new file mode 100644 index 0000000000..d240196789 --- /dev/null +++ b/tests/integrationtests/TestData/simple_test_rotors.cpacs.xml @@ -0,0 +1,1325 @@ + + +
+ SimpleTestRotors + Dataset containing simple rotors for TIGL tests + Philipp Kunze, DLR-AS + 2014-04-23T12:00:00 + 1.4.0 + 3.2 + + + Converted to cpacs 3.0 using cpacs2to3 - does not include structure update + cpacs2to3 + 2018-01-15T09:22:23 + 1.1 + 3.0 + + + Added missing UIDs. + fix_errors.py + 2019-04-29T20:48:28 + 1.2.0 + 3.0 + + + Converted to CPACS 3.1 using cpacs2to3 + cpacs2to3 + 2020-04-26T02:01:36 + 1.3.0 + 3.1 + + + Converted to CPACS 3.2 using cpacs2to3 + cpacs2to3 + 2021-04-23T18:02:02 + 1.4.0 + 3.2 + + +
+ + + + RotorTestModel + Model containing simple rotors for TIGL tests + + 1 + 1 + + 0.0 + 0.0 + 0.0 + + + + + MainRotor1 + MainRotor1 description + mainRotor + + + 1 + 1 + 1 + + + 0 + -3 + 0 + + + 2.94 + 0 + 2.90 + + + + MainRotor1Hub + MainRotor1Hub + articulated + + + 4 + + + MainRotor1_leadLagHinge + MainRotor1_leadLagHinge + + + 0.18 + 0.0 + 0.0 + + + leadLag + -4 + 1440.0 + 3450.0 + 10.0 + + + MainRotor1_flapHinge + + + 0.0025 + 0 + 0 + + + flap + + + MainRotor1_pitchHinge + + + 0.20 + 0 + 0 + + + pitch + + + MainRotor_blade + + + + 420 + + + MainRotor2 + MainRotor2 description + MainRotor1 + mainRotor + + + 1 + 1 + 1 + + + 0 + -3 + 0 + + + -0.02093 + 0 + 0.39945 + + + + MainRotor2Hub + MainRotor2Hub + articulated + + + 4 + + + MainRotor2_leadLagHinge + + + 0.18 + 0.0 + 0.0 + + + leadLag + -4 + 1440.0 + 3450.0 + 10.0 + + + MainRotor2_flapHinge + + + 0.0025 + 0 + 0 + + + flap + + + MainRotor2_pitchHinge + + + 0.20 + 0 + 0 + + + pitch + + + MainRotor_blade + + + + -420 + + + TailRotor + TailRotor description + tailRotor + + + 1 + 1 + 1 + + + 90 + 3 + 0 + + + 9.00 + -0.40 + 3.00 + + + + TailRotorHub + TailRotorHub + articulated + + + 15;195 + + + TailRotor_flapHinge1 + + + 0 + 0 + 0 + + + flap + + + TailRotor_pitchHinge1 + + + 0.05 + 0 + 0 + + + pitch + + + TailRotor_blade + + + 135;315 + + + TailRotor_flapHinge2 + + + 0 + 0 + 0 + + + flap + + + TailRotor_pitchHinge2 + + + 0.05 + 0 + 0 + + + pitch + + + TailRotor_blade + + + + 2220 + + + Propeller + Propeller description + propeller + + + 1 + 1 + 1 + + + 0 + -90 + 0 + + + 2.20 + 3.00 + 1.50 + + + + PropellerHub + PropellerHub + rigid + + + 10 + + + Propeller_pitchHinge + + + 0.10 + 0 + 0 + + + pitch + 10 + + + Propeller_blade + + + + 3300 + + + + + MainRotor_blade + MainRotor_blade description + + + 1 + 1 + 1 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + +
+ MainRotor_blade_section1 + + + 0.30 + 0.30 + 0.30 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + + MainRotor_blade_section1_element_1 + NACA0012 + + + 1 + 1 + 1 + + + 0 + 0 + -90 + + + 0 + 0.25 + 0 + + + + +
+
+ MainRotor_blade_section2 + + + 0.30 + 0.30 + 0.30 + + + -4.545 + 0 + 0 + + + 0 + 0 + 0 + + + + + MainRotor_blade_section2_element1 + NACA0012 + + + 1 + 1 + 1 + + + 0 + 0 + -90 + + + 0 + 0.25 + 0 + + + + +
+
+ MainRotor_blade_section3 + + + 0.30 + 0.30 + 0.30 + + + -3.49 + 0 + 0 + + + 0 + 0 + 0 + + + + + MainRotor_blade_section3_element1 + NACA0010 + + + 1 + 1 + 1 + + + 0 + 0 + -90 + + + 0 + 0.25 + 0 + + + + +
+
+ MainRotor_blade_section4 + + + 0.20 + 0.20 + 0.20 + + + -4.32 + 0 + 0 + + + 0 + 0 + 0 + + + + + MainRotor_blade_section4_element1 + NACA0010 + + + 1 + 1 + 1 + + + 0 + 0 + -90 + + + 0 + 0.25 + 0 + + + + +
+
+ + + MainRotor_blade_positioning1 + 1.0 + 90 + 0 + MainRotor_blade_section1 + + + MainRotor_blade_positioning2 + 2.75 + 90 + 0 + MainRotor_blade_section1 + MainRotor_blade_section2 + + + MainRotor_blade_positioning3 + 0.75 + 90 + 0 + MainRotor_blade_section2 + MainRotor_blade_section3 + + + MainRotor_blade_positioning4 + 0.5 + 90 + 0 + MainRotor_blade_section3 + MainRotor_blade_section4 + + + + + MainRotor_blade_segment1 + MainRotor_blade_section1_element1 + MainRotor_blade_section2_element1 + + + MainRotor_blade_segment2 + MainRotor_blade_section2_element1 + MainRotor_blade_section3_element1 + + + MainRotor_blade_segment3 + MainRotor_blade_section3_element1 + MainRotor_blade_section4_element1 + + +
+ + TailRotor_blade + TailRotor_blade description + + + 1 + 1 + 1 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + +
+ TailRotor_blade_section1 + + + 0.18 + 0.18 + 0.18 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + + TailRotor_blade_section1_element_1 + NACA0010 + + + 1 + 1 + 1 + + + 0 + 0 + -90 + + + 0 + 0.25 + 0 + + + + +
+
+ TailRotor_blade_section2 + + + 0.18 + 0.18 + 0.18 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + + TailRotor_blade_section2_element1 + NACA0010 + + + 1 + 1 + 1 + + + 0 + 0 + -90 + + + 0 + 0.25 + 0 + + + + +
+
+ + + TailRotor_blade_positioning1 + 0.25 + 90 + 0 + TailRotor_blade_section1 + + + TailRotor_blade_positioning2 + 0.75 + 90 + 0 + TailRotor_blade_section1 + TailRotor_blade_section2 + + + + + TailRotor_blade_segment1 + TailRotor_blade_section1_element1 + TailRotor_blade_section2_element1 + + +
+ + Propeller_blade + Propeller_blade description + + + 0.625 + 0.625 + 0.625 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + +
+ Propeller_blade_section1 + + + 0.29 + 0.29 + 0.29 + + + 14.56 + 0 + 29.77 + + + 0 + 0 + 0 + + + + + Propeller_blade_section1_element_1 + NACA0010 + + + 1 + 1 + 1.75 + + + 0 + 0 + -90 + + + 0 + 0.5 + 0 + + + + +
+
+ Propeller_blade_section2 + + + 0.29 + 0.29 + 0.29 + + + 13.71 + 0 + 21.31 + + + 0 + 0 + 0 + + + + + Propeller_blade_section2_element1 + NACA0010 + + + 1 + 1 + 1.04 + + + 0 + 0 + -90 + + + 0 + 0.5 + 0 + + + + +
+
+ Propeller_blade_section3 + + + 0.30 + 0.30 + 0.30 + + + 12.82 + 0 + 16.96 + + + 0 + 0 + 0 + + + + + Propeller_blade_section3_element1 + NACA0010 + + + 1 + 1 + 0.68 + + + 0 + 0 + -90 + + + 0 + 0.5 + 0 + + + + +
+
+ Propeller_blade_section4 + + + 0.31 + 0.31 + 0.31 + + + 10.44 + 0 + -3.72 + + + 0 + 0 + 0 + + + + + Propeller_blade_section4_element1 + NACA0010 + + + 1 + 1 + 0.51 + + + 0 + 0 + -90 + + + 0 + 0.5 + 0 + + + + +
+
+ Propeller_blade_section5 + + + 0.32 + 0.32 + 0.32 + + + 5.97 + 0 + -11.42 + + + 0 + 0 + 0 + + + + + Propeller_blade_section5_element1 + NACA0010 + + + 1 + 1 + 0.39 + + + 0 + 0 + -90 + + + 0 + 0.5 + 0 + + + + +
+
+ Propeller_blade_section6 + + + 0.31 + 0.31 + 0.31 + + + 2.19 + 0 + -15.38 + + + 0 + 0 + 0 + + + + + Propeller_blade_section6_element1 + NACA0010 + + + 1 + 1 + 0.31 + + + 0 + 0 + -90 + + + 0 + 0.5 + 0 + + + + +
+
+ Propeller_blade_section7 + + + 0.29 + 0.29 + 0.29 + + + -1.02 + 0 + -27.34 + + + 0 + 0 + 0 + + + + + Propeller_blade_section7_element1 + NACA0010 + + + 1 + 1 + 0.24 + + + 0 + 0 + -90 + + + 0 + 0.5 + 0 + + + + +
+
+ Propeller_blade_section8 + + + 0.26 + 0.26 + 0.26 + + + -4.09 + 0 + -36.61 + + + 0 + 0 + 0 + + + + + Propeller_blade_section8_element1 + NACA0010 + + + 1 + 1 + 0.21 + + + 0 + 0 + -90 + + + 0 + 0.5 + 0 + + + + +
+
+ Propeller_blade_section9 + + + 0.25 + 0.25 + 0.25 + + + -7.48 + 0 + -41.67 + + + 0 + 0 + 0 + + + + + Propeller_blade_section9_element1 + NACA0010 + + + 1 + 1 + 0.18 + + + 0 + 0 + -90 + + + 0 + 0.5 + 0 + + + + +
+
+ Propeller_blade_section10 + + + 0.22 + 0.22 + 0.22 + + + -9.18 + 0 + -42.55 + + + 0 + 0 + 0 + + + + + Propeller_blade_section10_element1 + NACA0010 + + + 1 + 1 + 0.18 + + + 0 + 0 + -90 + + + 0 + 0.5 + 0 + + + + +
+
+ + + Propeller_blade_positioning1 + 0.250 + 90 + 0 + Propeller_blade_section1 + + + Propeller_blade_positioning2 + 0.045 + 90 + 0 + Propeller_blade_section1 + Propeller_blade_section2 + + + Propeller_blade_positioning3 + 0.070 + 90 + 0 + Propeller_blade_section2 + Propeller_blade_section3 + + + Propeller_blade_positioning4 + 0.093 + 90 + 0 + Propeller_blade_section3 + Propeller_blade_section4 + + + Propeller_blade_positioning5 + 0.107 + 90 + 0 + Propeller_blade_section4 + Propeller_blade_section5 + + + Propeller_blade_positioning6 + 0.113 + 90 + 0 + Propeller_blade_section5 + Propeller_blade_section6 + + + Propeller_blade_positioning7 + 0.108 + 90 + 0 + Propeller_blade_section6 + Propeller_blade_section7 + + + Propeller_blade_positioning8 + 0.093 + 90 + 0 + Propeller_blade_section7 + Propeller_blade_section8 + + + Propeller_blade_positioning9 + 0.070 + 90 + 0 + Propeller_blade_section8 + Propeller_blade_section9 + + + Propeller_blade_positioning10 + 0.041 + 90 + 0 + Propeller_blade_section9 + Propeller_blade_section10 + + + + + Propeller_blade_segment1 + Propeller_blade_section1_element1 + Propeller_blade_section2_element1 + + + Propeller_blade_segment2 + Propeller_blade_section2_element1 + Propeller_blade_section3_element1 + + + Propeller_blade_segment3 + Propeller_blade_section3_element1 + Propeller_blade_section4_element1 + + + Propeller_blade_segment4 + Propeller_blade_section4_element1 + Propeller_blade_section5_element1 + + + Propeller_blade_segment5 + Propeller_blade_section5_element1 + Propeller_blade_section6_element1 + + + Propeller_blade_segment6 + Propeller_blade_section6_element1 + Propeller_blade_section7_element1 + + + Propeller_blade_segment7 + Propeller_blade_section7_element1 + Propeller_blade_section8_element1 + + + Propeller_blade_segment8 + Propeller_blade_section8_element1 + Propeller_blade_section9_element1 + + + Propeller_blade_segment9 + Propeller_blade_section9_element1 + Propeller_blade_section10_element1 + + +
+
+
+
+ + + + NACA0.00.00.12 + NACA 4 Series Profile + + 1.0;0.9875;0.975;0.9625;0.95;0.9375;0.925;0.9125;0.9;0.8875;0.875;0.8625;0.85;0.8375;0.825;0.8125;0.8;0.7875;0.775;0.7625;0.75;0.7375;0.725;0.7125;0.7;0.6875;0.675;0.6625;0.65;0.6375;0.625;0.6125;0.6;0.5875;0.575;0.5625;0.55;0.5375;0.525;0.5125;0.5;0.4875;0.475;0.4625;0.45;0.4375;0.425;0.4125;0.4;0.3875;0.375;0.3625;0.35;0.3375;0.325;0.3125;0.3;0.2875;0.275;0.2625;0.25;0.2375;0.225;0.2125;0.2;0.1875;0.175;0.1625;0.15;0.1375;0.125;0.1125;0.1;0.0875;0.075;0.0625;0.05;0.0375;0.025;0.0125;0.0;0.0125;0.025;0.0375;0.05;0.0625;0.075;0.0875;0.1;0.1125;0.125;0.1375;0.15;0.1625;0.175;0.1875;0.2;0.2125;0.225;0.2375;0.25;0.2625;0.275;0.2875;0.3;0.3125;0.325;0.3375;0.35;0.3625;0.375;0.3875;0.4;0.4125;0.425;0.4375;0.45;0.4625;0.475;0.4875;0.5;0.5125;0.525;0.5375;0.55;0.5625;0.575;0.5875;0.6;0.6125;0.625;0.6375;0.65;0.6625;0.675;0.6875;0.7;0.7125;0.725;0.7375;0.75;0.7625;0.775;0.7875;0.8;0.8125;0.825;0.8375;0.85;0.8625;0.875;0.8875;0.9;0.9125;0.925;0.9375;0.95;0.9625;0.975;0.9875;1.0 + 0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0 + 0.00126;0.0030004180415;0.00471438572941;0.00640256842113;0.00806559133343;0.00970403933653;0.0113184567357;0.0129093470398;0.0144771727147;0.0160223549226;0.0175452732434;0.0190462653789;0.0205256268372;0.0219836105968;0.0234204267471;0.024836242105;0.0262311798047;0.0276053188583;0.0289586936852;0.0302912936071;0.0316030623052;0.0328938972373;0.0341636490097;0.0354121207001;0.0366390671268;0.0378441940595;0.0390271573644;0.0401875620783;0.0413249614032;0.042438855614;0.043528690869;0.0445938579126;0.0456336906587;0.04664746464;0.0476343953088;0.0485936361694;0.0495242767241;0.0504253402064;0.0512957810767;0.0521344822472;0.0529402520006;0.0537118205596;0.0544478362583;0.0551468612564;0.0558073667285;0.0564277274483;0.0570062156697;0.0575409941929;0.0580301084765;0.0584714776309;0.0588628840933;0.059201961739;0.0594861821311;0.0597128385384;0.059879027262;0.0599816256958;0.060017266394;0.059982306219;0.05987278938;0.0596844028137;0.059412421875;0.059051643633;0.0585963041308;0.0580399746271;0.0573754299024;0.0565944788455;0.0556877432118;0.054644363746;0.0534516022043;0.0520942903127;0.0505540468987;0.0488081315259;0.0468277042382;0.0445750655553;0.0419990347204;0.0390266537476;0.0355468568262;0.0313738751622;0.0261471986426;0.0189390266528;0.0;-0.0189390266528;-0.0261471986426;-0.0313738751622;-0.0355468568262;-0.0390266537476;-0.0419990347204;-0.0445750655553;-0.0468277042382;-0.0488081315259;-0.0505540468987;-0.0520942903127;-0.0534516022043;-0.054644363746;-0.0556877432118;-0.0565944788455;-0.0573754299024;-0.0580399746271;-0.0585963041308;-0.059051643633;-0.059412421875;-0.0596844028137;-0.05987278938;-0.059982306219;-0.060017266394;-0.0599816256958;-0.059879027262;-0.0597128385384;-0.0594861821311;-0.059201961739;-0.0588628840933;-0.0584714776309;-0.0580301084765;-0.0575409941929;-0.0570062156697;-0.0564277274483;-0.0558073667285;-0.0551468612564;-0.0544478362583;-0.0537118205596;-0.0529402520006;-0.0521344822472;-0.0512957810767;-0.0504253402064;-0.0495242767241;-0.0485936361694;-0.0476343953088;-0.04664746464;-0.0456336906587;-0.0445938579126;-0.043528690869;-0.042438855614;-0.0413249614032;-0.0401875620783;-0.0390271573644;-0.0378441940595;-0.0366390671268;-0.0354121207001;-0.0341636490097;-0.0328938972373;-0.0316030623052;-0.0302912936071;-0.0289586936852;-0.0276053188583;-0.0262311798047;-0.024836242105;-0.0234204267471;-0.0219836105968;-0.0205256268372;-0.0190462653789;-0.0175452732434;-0.0160223549226;-0.0144771727147;-0.0129093470398;-0.0113184567357;-0.00970403933653;-0.00806559133343;-0.00640256842113;-0.00471438572941;-0.0030004180415;-0.00126 + + + + NACA0.00.00.10 + NACA 4 Series Profile + + 1.0;0.9875;0.975;0.9625;0.95;0.9375;0.925;0.9125;0.9;0.8875;0.875;0.8625;0.85;0.8375;0.825;0.8125;0.8;0.7875;0.775;0.7625;0.75;0.7375;0.725;0.7125;0.7;0.6875;0.675;0.6625;0.65;0.6375;0.625;0.6125;0.6;0.5875;0.575;0.5625;0.55;0.5375;0.525;0.5125;0.5;0.4875;0.475;0.4625;0.45;0.4375;0.425;0.4125;0.4;0.3875;0.375;0.3625;0.35;0.3375;0.325;0.3125;0.3;0.2875;0.275;0.2625;0.25;0.2375;0.225;0.2125;0.2;0.1875;0.175;0.1625;0.15;0.1375;0.125;0.1125;0.1;0.0875;0.075;0.0625;0.05;0.0375;0.025;0.0125;0.0;0.0125;0.025;0.0375;0.05;0.0625;0.075;0.0875;0.1;0.1125;0.125;0.1375;0.15;0.1625;0.175;0.1875;0.2;0.2125;0.225;0.2375;0.25;0.2625;0.275;0.2875;0.3;0.3125;0.325;0.3375;0.35;0.3625;0.375;0.3875;0.4;0.4125;0.425;0.4375;0.45;0.4625;0.475;0.4875;0.5;0.5125;0.525;0.5375;0.55;0.5625;0.575;0.5875;0.6;0.6125;0.625;0.6375;0.65;0.6625;0.675;0.6875;0.7;0.7125;0.725;0.7375;0.75;0.7625;0.775;0.7875;0.8;0.8125;0.825;0.8375;0.85;0.8625;0.875;0.8875;0.9;0.9125;0.925;0.9375;0.95;0.9625;0.975;0.9875;1.0 + 0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0 + 0.00105;0.002500348;0.003928655;0.005335474;0.006721326;0.008086699;0.009432047;0.010757789;0.012064311;0.013351962;0.014621061;0.015871888;0.017104689;0.018319675;0.019517022;0.020696868;0.021859317;0.023004432;0.024132245;0.025242745;0.026335885;0.027411581;0.028469708;0.029510101;0.030532556;0.031536828;0.032522631;0.033489635;0.034437468;0.035365713;0.036273909;0.037161548;0.038028076;0.038872887;0.039695329;0.040494697;0.041270231;0.042021117;0.042746484;0.043445402;0.044116877;0.04475985;0.045373197;0.045955718;0.046506139;0.047023106;0.04750518;0.047950828;0.048358424;0.048726231;0.049052403;0.049334968;0.049571818;0.049760699;0.049899189;0.049984688;0.050014389;0.049985255;0.049893991;0.049737002;0.049510352;0.049209703;0.048830253;0.048366646;0.047812858;0.047162066;0.046406453;0.04553697;0.044543002;0.043411909;0.042128372;0.040673443;0.039023087;0.037145888;0.034999196;0.032522211;0.029622381;0.026144896;0.021789332;0.015782522;0;-0.015782522;-0.021789332;-0.026144896;-0.029622381;-0.032522211;-0.034999196;-0.037145888;-0.039023087;-0.040673443;-0.042128372;-0.043411909;-0.044543002;-0.04553697;-0.046406453;-0.047162066;-0.047812858;-0.048366646;-0.048830253;-0.049209703;-0.049510352;-0.049737002;-0.049893991;-0.049985255;-0.050014389;-0.049984688;-0.049899189;-0.049760699;-0.049571818;-0.049334968;-0.049052403;-0.048726231;-0.048358424;-0.047950828;-0.04750518;-0.047023106;-0.046506139;-0.045955718;-0.045373197;-0.04475985;-0.044116877;-0.043445402;-0.042746484;-0.042021117;-0.041270231;-0.040494697;-0.039695329;-0.038872887;-0.038028076;-0.037161548;-0.036273909;-0.035365713;-0.034437468;-0.033489635;-0.032522631;-0.031536828;-0.030532556;-0.029510101;-0.028469708;-0.027411581;-0.026335885;-0.025242745;-0.024132245;-0.023004432;-0.021859317;-0.020696868;-0.019517022;-0.018319675;-0.017104689;-0.015871888;-0.014621061;-0.013351962;-0.012064311;-0.010757789;-0.009432047;-0.008086699;-0.006721326;-0.005335474;-0.003928655;-0.002500348;-0.00105 + + + + +
+
diff --git a/tests/integrationtests/TestData/simpletest.cpacs.xml b/tests/integrationtests/TestData/simpletest.cpacs.xml new file mode 100644 index 0000000000..50b78211d8 --- /dev/null +++ b/tests/integrationtests/TestData/simpletest.cpacs.xml @@ -0,0 +1,538 @@ + + +
+ Cpacs2Test + Simple Wing for unit testing + Martin Siggel + 2012-10-09T15:12:47 + 0.5.0 + 3.2 + + + Converted to cpacs 3.0 using cpacs2to3 - does not include structure update + cpacs2to3 + 2018-01-15T09:22:57 + 0.2 + 3.0 + + + Added missing UIDs. + fix_errors.py + 2019-04-29T20:48:26 + 0.3.0 + 3.0 + + + Converted to CPACS 3.1 using cpacs2to3 + cpacs2to3 + 2020-04-26T02:01:33 + 0.4.0 + 3.1 + + + Converted to CPACS 3.2 using cpacs2to3 + cpacs2to3 + 2021-04-23T18:02:00 + 0.5.0 + 3.2 + + +
+ + + + Cpacs2Test + + 1 + 1 + + 0 + 0 + 0 + + + + + name + description + + + 1.0 + 0.5 + 0.5 + + + 0.0 + 0.0 + 0.0 + + + 0.0 + 0.0 + 0.0 + + + +
+ D150_Fuselage_1Section1 + + + 1.0 + 1.0 + 1.0 + + + 0.0 + 0.0 + 0.0 + + + 0 + 0 + 0 + + + + + D150_Fuselage_1Section1 + fuselageCircleProfileuID + + + 1.0 + 1.0 + 1.0 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + +
+
+ D150_Fuselage_1Section2 + + + 1.0 + 1.0 + 1.0 + + + 0.0 + 0.0 + 0.0 + + + 0.5 + 0 + 0 + + + + + D150_Fuselage_1Section2 + fuselageCircleProfileuID + + + 1 + 1 + 1 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + +
+
+ D150_Fuselage_1Section3 + + + 1.0 + 1.0 + 1.0 + + + 0.0 + 0.0 + 0.0 + + + 0 + 0 + 0 + + + + + D150_Fuselage_1Section3 + fuselageCircleProfileuID + + + 1 + 1 + 1 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + +
+
+ + + D150_Fuselage_1Positioning1 + -0.5 + 90 + 0 + D150_Fuselage_1Section1ID + + + D150_Fuselage_1Positioning3 + 2 + 90 + 0 + D150_Fuselage_1Section1ID + D150_Fuselage_1Section3ID + + + + + D150_Fuselage_1Segment2 + D150_Fuselage_1Section1IDElement1 + D150_Fuselage_1Section2IDElement1 + + + D150_Fuselage_1Segment3 + D150_Fuselage_1Section2IDElement1 + D150_Fuselage_1Section3IDElement1 + + +
+
+ + + Wing + SimpleFuselage + This wing has been generated to test CATIA2CPACS. + + + 1 + 1 + 1 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + +
+ Cpacs2Test - Wing Section 1 + Cpacs2Test - Wing Section 1 + + + 1 + 1 + 1 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + + Cpacs2Test - Wing Section 1 Main Element + Cpacs2Test - Wing Section 1 Main Element + NACA0012 + + + 1 + 1 + 1 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + +
+
+ Cpacs2Test - Wing Section 2 + Cpacs2Test - Wing Section 2 + + + 1 + 1 + 1 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + + Cpacs2Test - Wing Section 2 Main Element + Cpacs2Test - Wing Section 2 Main Element + NACA0012 + + + 1 + 1 + 1 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + +
+
+ Cpacs2Test - Wing Section 3 + Cpacs2Test - Wing Section 3 + + + 1 + 1 + 1 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + + Cpacs2Test - Wing Section 3 Main Element + Cpacs2Test - Wing Section 3 Main Element + NACA0012 + + + 0.5 + 0.5 + 0.5 + + + 0 + 0 + 0 + + + 0.5 + 0 + 0 + + + + +
+
+ + + Cpacs2Test - Wing Section 1 Positioning + Cpacs2Test - Wing Section 1 Positioning + 0 + 0 + 0 + Cpacs2Test_Wing_Sec1 + + + Cpacs2Test - Wing Section 2 Positioning + Cpacs2Test - Wing Section 2 Positioning + 1 + 0 + 0 + Cpacs2Test_Wing_Sec1 + Cpacs2Test_Wing_Sec2 + + + Cpacs2Test - Wing Section 3 Positioning + Cpacs2Test - Wing Section 3 Positioning + 1 + 0 + 0 + Cpacs2Test_Wing_Sec2 + Cpacs2Test_Wing_Sec3 + + + + + Fuselage Segment from Cpacs2Test - Wing Section 1 Main Element to Cpacs2Test - Wing Section 2 Main Element + Fuselage Segment from Cpacs2Test - Wing Section 1 Main Element to Cpacs2Test - Wing Section 2 Main Element + Cpacs2Test_Wing_Sec1_El1 + Cpacs2Test_Wing_Sec2_El1 + + + Fuselage Segment from Cpacs2Test - Wing Section 2 Main Element to Cpacs2Test - Wing Section 3 Main Element + Fuselage Segment from Cpacs2Test - Wing Section 2 Main Element to Cpacs2Test - Wing Section 3 Main Element + Cpacs2Test_Wing_Sec2_El1 + Cpacs2Test_Wing_Sec3_El1 + + + + + Wing_CS1 + Cpacs2Test_Wing_Sec1_El1 + Cpacs2Test_Wing_Sec3_El1 + + + + + MySkinMat + 0.0 + + + + + + + MyCellMat + 0.0 + + + + 0.8 + 0.8 + + + 1.0 + 1.0 + + + + 0 + WING_CS1 + + + 0 + WING_CS1 + + + + + 0.5 + WING_CS1 + + + 0.5 + WING_CS1 + + + + + + + + + MySkinMat + + + + + + +
+
+
+
+ + + + NACA0.00.00.12 + NACA 4 Series Profile + + 1.0;0.9875;0.975;0.9625;0.95;0.9375;0.925;0.9125;0.9;0.8875;0.875;0.8625;0.85;0.8375;0.825;0.8125;0.8;0.7875;0.775;0.7625;0.75;0.7375;0.725;0.7125;0.7;0.6875;0.675;0.6625;0.65;0.6375;0.625;0.6125;0.6;0.5875;0.575;0.5625;0.55;0.5375;0.525;0.5125;0.5;0.4875;0.475;0.4625;0.45;0.4375;0.425;0.4125;0.4;0.3875;0.375;0.3625;0.35;0.3375;0.325;0.3125;0.3;0.2875;0.275;0.2625;0.25;0.2375;0.225;0.2125;0.2;0.1875;0.175;0.1625;0.15;0.1375;0.125;0.1125;0.1;0.0875;0.075;0.0625;0.05;0.0375;0.025;0.0125;0.0;0.0125;0.025;0.0375;0.05;0.0625;0.075;0.0875;0.1;0.1125;0.125;0.1375;0.15;0.1625;0.175;0.1875;0.2;0.2125;0.225;0.2375;0.25;0.2625;0.275;0.2875;0.3;0.3125;0.325;0.3375;0.35;0.3625;0.375;0.3875;0.4;0.4125;0.425;0.4375;0.45;0.4625;0.475;0.4875;0.5;0.5125;0.525;0.5375;0.55;0.5625;0.575;0.5875;0.6;0.6125;0.625;0.6375;0.65;0.6625;0.675;0.6875;0.7;0.7125;0.725;0.7375;0.75;0.7625;0.775;0.7875;0.8;0.8125;0.825;0.8375;0.85;0.8625;0.875;0.8875;0.9;0.9125;0.925;0.9375;0.95;0.9625;0.975;0.9875;1.0 + 0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0 + -0.00126;-0.0030004180415;-0.00471438572941;-0.00640256842113;-0.00806559133343;-0.00970403933653;-0.0113184567357;-0.0129093470398;-0.0144771727147;-0.0160223549226;-0.0175452732434;-0.0190462653789;-0.0205256268372;-0.0219836105968;-0.0234204267471;-0.024836242105;-0.0262311798047;-0.0276053188583;-0.0289586936852;-0.0302912936071;-0.0316030623052;-0.0328938972373;-0.0341636490097;-0.0354121207001;-0.0366390671268;-0.0378441940595;-0.0390271573644;-0.0401875620783;-0.0413249614032;-0.042438855614;-0.043528690869;-0.0445938579126;-0.0456336906587;-0.04664746464;-0.0476343953088;-0.0485936361694;-0.0495242767241;-0.0504253402064;-0.0512957810767;-0.0521344822472;-0.0529402520006;-0.0537118205596;-0.0544478362583;-0.0551468612564;-0.0558073667285;-0.0564277274483;-0.0570062156697;-0.0575409941929;-0.0580301084765;-0.0584714776309;-0.0588628840933;-0.059201961739;-0.0594861821311;-0.0597128385384;-0.059879027262;-0.0599816256958;-0.060017266394;-0.059982306219;-0.05987278938;-0.0596844028137;-0.059412421875;-0.059051643633;-0.0585963041308;-0.0580399746271;-0.0573754299024;-0.0565944788455;-0.0556877432118;-0.054644363746;-0.0534516022043;-0.0520942903127;-0.0505540468987;-0.0488081315259;-0.0468277042382;-0.0445750655553;-0.0419990347204;-0.0390266537476;-0.0355468568262;-0.0313738751622;-0.0261471986426;-0.0189390266528;0.0;0.0189390266528;0.0261471986426;0.0313738751622;0.0355468568262;0.0390266537476;0.0419990347204;0.0445750655553;0.0468277042382;0.0488081315259;0.0505540468987;0.0520942903127;0.0534516022043;0.054644363746;0.0556877432118;0.0565944788455;0.0573754299024;0.0580399746271;0.0585963041308;0.059051643633;0.059412421875;0.0596844028137;0.05987278938;0.059982306219;0.060017266394;0.0599816256958;0.059879027262;0.0597128385384;0.0594861821311;0.059201961739;0.0588628840933;0.0584714776309;0.0580301084765;0.0575409941929;0.0570062156697;0.0564277274483;0.0558073667285;0.0551468612564;0.0544478362583;0.0537118205596;0.0529402520006;0.0521344822472;0.0512957810767;0.0504253402064;0.0495242767241;0.0485936361694;0.0476343953088;0.04664746464;0.0456336906587;0.0445938579126;0.043528690869;0.042438855614;0.0413249614032;0.0401875620783;0.0390271573644;0.0378441940595;0.0366390671268;0.0354121207001;0.0341636490097;0.0328938972373;0.0316030623052;0.0302912936071;0.0289586936852;0.0276053188583;0.0262311798047;0.024836242105;0.0234204267471;0.0219836105968;0.0205256268372;0.0190462653789;0.0175452732434;0.0160223549226;0.0144771727147;0.0129093470398;0.0113184567357;0.00970403933653;0.00806559133343;0.00640256842113;0.00471438572941;0.0030004180415;0.00126 + + + + + + Circle + Profile build up from set of Points on Circle where may Dimensions are 1..-1 + + 0.0;0.0;0.0;0.0;0.0 + 0.0;1.0;0.0;-1.0;0.0 + 1.0;0.0;-1.0;0.0;1.0 + + + + +
+ + + + halfCube + 10.0 + 1. + + + +
diff --git a/tests/integrationtests/test_update_code_gen.py b/tests/integrationtests/test_update_code_gen.py new file mode 100644 index 0000000000..8ed813ef5a --- /dev/null +++ b/tests/integrationtests/test_update_code_gen.py @@ -0,0 +1,70 @@ +import unittest + +from tixi3.tixi3wrapper import Tixi3 +from tigl3.tigl3wrapper import Tigl3 + +from tigl3 import configuration + +from tigl3.import_export_helper import export_shapes + +class SimpleTest(unittest.TestCase): + + def setUp(self): + self.tixi = Tixi3() + self.tigl = Tigl3() + self.assertIsNone(self.tixi.open("TestData/simpletest.cpacs.xml")) + self.assertIsNone(self.tigl.open(self.tixi,"")) + + mgr = configuration.CCPACSConfigurationManager_get_instance() + self.config = mgr.get_configuration(self.tigl._handle.value) + uid_mgr = self.config.get_uidmanager() + + def tearDown(self): + self.tigl.close() + self.tixi.close() + + def test_fuselages(self): + self.assertEqual(self.config.get_fuselages().get_fuselage_count(),1) + self.assertEqual(self.config.get_fuselages().get_fuselage_index("SimpleFuselage"), 1) + self.assertIsInstance(self.config.get_fuselages(), configuration.CPACSFuselages) + self.assertIsInstance(self.config.get_fuselages().get_fuselage(1), configuration.CCPACSFuselage) + with self.assertRaises(IndexError): + self.config.get_fuselages().get_fuselage(0) + self.config.get_fuselages().get_fuselage(2) + + +class SimpleTestRotor(unittest.TestCase): + + def setUp(self): + self.tixi = Tixi3() + self.tigl = Tigl3() + self.assertIsNone(self.tixi.open("TestData/simple_test_rotors.cpacs.xml")) + self.assertIsNone(self.tigl.open(self.tixi,"")) + + mgr = configuration.CCPACSConfigurationManager_get_instance() + self.config = mgr.get_configuration(self.tigl._handle.value) + uid_mgr = self.config.get_uidmanager() + + + def tearDown(self): + self.tigl.close() + self.tixi.close() + + def test_rotors(self): + self.assertIsInstance(self.config.get_rotor(1), configuration.CPACSRotor) + self.assertIsInstance(self.config.get_rotor(1).get_parent(), configuration.CCPACSRotors) + self.assertIsInstance(self.config.get_rotor(1).get_parent().get_rotor(1), configuration.CCPACSRotor) + self.assertIsInstance(self.config.get_rotor(1).get_parent().get_rotor("MainRotor2"), configuration.CCPACSRotor) + self.assertEqual(self.config.get_rotor(1).get_parent().get_rotor_count(), 4) + self.assertEqual(self.config.get_rotor(1).get_parent().get_rotor_index("MainRotor2"), 2) + with self.assertRaises(IndexError): + #test function in CCPACSConfiguration + self.config.get_rotor(0) + self.config.get_rotor(5) + #test function in CCPACSRotors + self.config.get_rotor(1).get_parent().get_rotor(0) + self.config.get_rotor(1).get_parent().get_rotor(5) + +if __name__== "__main__": + unittest.main() + diff --git a/tests/unittests/testDuct.cpp b/tests/unittests/testDuct.cpp index 6ef0358522..2069dafcd1 100644 --- a/tests/unittests/testDuct.cpp +++ b/tests/unittests/testDuct.cpp @@ -24,6 +24,7 @@ #include "tigl.h" #include "CCPACSConfigurationManager.h" +#include "CCPACSFuselage.h" #include "CTiglUIDManager.h" #include "CCPACSDuct.h" #include "CNamedShape.h" @@ -40,6 +41,7 @@ #include + /******************************************************************************/ class DuctSimple : public ::testing::Test @@ -119,7 +121,7 @@ TEST_F(DuctSimple, DuctLevel) EXPECT_EQ(ductsN.size(), 32); // Check if ducts are solids - for (std::unique_ptr& d : ductsN) + for (auto& d : ductsN) { auto loftD = d->GetLoft(); const TopoDS_Shape& shapeD = loftD->Shape(); diff --git a/tests/unittests/testFuselageStandardProfileRectangle.cpp b/tests/unittests/testFuselageStandardProfileRectangle.cpp index 3b2cd82f2a..3ac126d65a 100644 --- a/tests/unittests/testFuselageStandardProfileRectangle.cpp +++ b/tests/unittests/testFuselageStandardProfileRectangle.cpp @@ -22,6 +22,7 @@ #include #include "CCPACSConfigurationManager.h" #include "CCPACSConfiguration.h" +#include "CCPACSFuselage.h" #include "CNamedShape.h" class FuselageStandardProfile : public ::testing::Test diff --git a/tests/unittests/testFuselageStandardProfileSuperellipse.cpp b/tests/unittests/testFuselageStandardProfileSuperellipse.cpp index 6191d93fed..dda8b99329 100644 --- a/tests/unittests/testFuselageStandardProfileSuperellipse.cpp +++ b/tests/unittests/testFuselageStandardProfileSuperellipse.cpp @@ -18,6 +18,7 @@ #include "tigl.h" #include "Debugging.h" #include "tiglcommonfunctions.h" +#include "CCPACSFuselage.h" #include "BRepBuilderAPI_Transform.hxx" #include #include "CCPACSConfigurationManager.h" diff --git a/tests/unittests/test_fuelTanks.py b/tests/unittests/test_fuelTanks.py index 4186407dfa..56a7912ed4 100644 --- a/tests/unittests/test_fuelTanks.py +++ b/tests/unittests/test_fuelTanks.py @@ -59,9 +59,9 @@ def tearDown(self): def test_configuration(self): tank1_uID = "tank1" - self.assertEqual(self.config.get_fuel_tanks_count(), 8) + self.assertEqual(self.config.get_fuel_tank_count(), 8) self.assertIsInstance( - self.config.get_fuel_tank(1), configuration.CCPACSFuelTank + self.config.get_fuel_tank(1), configuration.CPACSFuelTank ) self.assertIsInstance( self.config.get_fuel_tank(tank1_uID), @@ -72,7 +72,7 @@ def test_configuration(self): 1, ) self.assertIsInstance( - self.config.get_fuel_tanks(), configuration.CCPACSFuelTanks + self.config.get_fuel_tanks(), configuration.CPACSFuelTanks ) def test_fuelTanks(self): @@ -85,20 +85,20 @@ def test_fuelTanks(self): self.assertEqual(fuelTanks.get_fuel_tank(1).get_defaulted_uid(), tank1_uID) self.assertIsInstance( fuelTanks.get_fuel_tank(tank1_uID), - configuration.CCPACSFuelTank, + configuration.CPACSFuelTank, ) self.assertEqual( fuelTanks.get_fuel_tank_index(tank1_uID), 1, ) - self.assertEqual(fuelTanks.get_fuel_tanks_count(), 8) + self.assertEqual(fuelTanks.get_fuel_tank_count(), 8) # Test availability of generated class: - self.assertIsInstance(fuelTanks, configuration.CCPACSFuelTanks) + self.assertIsInstance(fuelTanks, configuration.CPACSFuelTanks) def test_genericFuelTank(self): # Test custom class methods: - self.assertIsInstance(self.fuelTank.get_vessels(), configuration.CCPACSVessels) + self.assertIsInstance(self.fuelTank.get_vessels(), configuration.CPACSVessels) # Test availability of generated class: self.assertEqual(self.fuelTank.get_name(), "Simple tank 1") @@ -109,19 +109,19 @@ def test_vessels(self): vessel1_uID = "tank1_outerVessel" ## Test accessability of childs: - self.assertIsInstance(vessels.get_vessel(1), configuration.CCPACSVessel) + self.assertIsInstance(vessels.get_vessel(1), configuration.CPACSVessel) self.assertEqual(vessels.get_vessel(1).get_defaulted_uid(), vessel1_uID) self.assertIsInstance( - vessels.get_vessel(vessel1_uID), configuration.CCPACSVessel + vessels.get_vessel(vessel1_uID), configuration.CPACSVessel ) self.assertEqual( vessels.get_vessel_index(vessel1_uID), 1, ) - self.assertEqual(vessels.get_vessels_count(), 2) + self.assertEqual(vessels.get_vessel_count(), 2) # Test availability of generated class: - self.assertIsInstance(vessels.get_parent(), configuration.CCPACSFuelTank) + self.assertIsInstance(vessels.get_parent(), configuration.CPACSFuelTank) def test_vessel_general(self): diff --git a/tests/unittests/tiglControlSurfaceDevice.cpp b/tests/unittests/tiglControlSurfaceDevice.cpp index dc3c156425..15a45df532 100644 --- a/tests/unittests/tiglControlSurfaceDevice.cpp +++ b/tests/unittests/tiglControlSurfaceDevice.cpp @@ -213,13 +213,13 @@ TEST_F(TiglControlSurfaceDevice, tiglControlSurfaceGetAndSetControlParameter) } -TEST_F(TiglControlSurfaceDevice, CCPACSTrailingEdgeDevices) +TEST_F(TiglControlSurfaceDevice, CPACSTrailingEdgeDevices) { tigl::CCPACSConfigurationManager & manager = tigl::CCPACSConfigurationManager::GetInstance(); tigl::CCPACSConfiguration & config = manager.GetConfiguration(tiglHandle); tigl::CCPACSWing& wing = config.GetWing(1); tigl::CCPACSWingComponentSegment& componentSegment = static_cast(wing.GetComponentSegment(1)); - tigl::CCPACSTrailingEdgeDevices& devices = *componentSegment.GetControlSurfaces()->GetTrailingEdgeDevices(); + tigl::generated::CPACSTrailingEdgeDevices& devices = *componentSegment.GetControlSurfaces()->GetTrailingEdgeDevices(); // trailing edge device count ASSERT_EQ(devices.GetTrailingEdgeDeviceCount(), 3); diff --git a/tests/unittests/tiglExports.cpp b/tests/unittests/tiglExports.cpp index ad9099e822..0716c8aea7 100644 --- a/tests/unittests/tiglExports.cpp +++ b/tests/unittests/tiglExports.cpp @@ -27,6 +27,7 @@ #include "CTiglExportVtk.h" #include "CCPACSConfigurationManager.h" #include "CCPACSConfiguration.h" +#include "CCPACSFuselage.h" #include "CCPACSWing.h" #include "CTiglExporterFactory.h" #include "CGlobalExporterConfigs.h" diff --git a/tests/unittests/tiglFuselageGuideCurves.cpp b/tests/unittests/tiglFuselageGuideCurves.cpp index a6f26bae8a..7aadebbb55 100644 --- a/tests/unittests/tiglFuselageGuideCurves.cpp +++ b/tests/unittests/tiglFuselageGuideCurves.cpp @@ -37,8 +37,9 @@ #include "GeomAPI_IntCS.hxx" #include "CTiglError.h" #include "CTiglLogging.h" +#include "CCPACSFuselage.h" #include "CCPACSGuideCurveProfile.h" -#include "CCPACSGuideCurveProfiles.h" +#include "generated/CPACSGuideCurveProfiles.h" #include "CCPACSFuselageProfileGetPointAlgo.h" #include "CCPACSGuideCurveAlgo.h" #include "CCPACSFuselageSegment.h" diff --git a/tests/unittests/tiglFuselageSegment.cpp b/tests/unittests/tiglFuselageSegment.cpp index 2960901a9a..10bcb37a49 100644 --- a/tests/unittests/tiglFuselageSegment.cpp +++ b/tests/unittests/tiglFuselageSegment.cpp @@ -23,6 +23,7 @@ #include "tigl.h" #include "CCPACSConfigurationManager.h" #include "CCPACSFuselageSegment.h" +#include "CCPACSFuselage.h" #define _USE_MATH_DEFINES diff --git a/tests/unittests/tiglMakeLoft.cpp b/tests/unittests/tiglMakeLoft.cpp index 08efe14d30..4e14730122 100644 --- a/tests/unittests/tiglMakeLoft.cpp +++ b/tests/unittests/tiglMakeLoft.cpp @@ -21,6 +21,7 @@ #include "CTiglMakeLoft.h" #include "CTiglError.h" #include "CCPACSConfigurationManager.h" +#include "CCPACSFuselage.h" #include #include diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index 7f7468071c..990e7ecca5 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -25,7 +25,7 @@ #include "testUtils.h" #include "CCPACSFuelTank.h" -#include "CCPACSFuelTanks.h" +#include "generated/CPACSFuelTanks.h" #include "CCPACSConfigurationManager.h" #include "CTiglUIDManager.h" @@ -116,9 +116,9 @@ class FuelTanks : public ::testing::Test // Dummy objects for exception testing DummyAircraftModel dummyAircraft; tigl::CTiglUIDManager dummyUidMgr; - tigl::CCPACSFuelTanks dummyTanks{&dummyAircraft, &dummyUidMgr}; + tigl::generated::CPACSFuelTanks dummyTanks{&dummyAircraft, &dummyUidMgr}; tigl::CCPACSFuelTank dummyTank{&dummyTanks, &dummyUidMgr}; - tigl::CCPACSVessels dummyVessels{&dummyTank, &dummyUidMgr}; + tigl::generated::CPACSVessels dummyVessels{&dummyTank, &dummyUidMgr}; tigl::CCPACSVessel dummyVessel{&dummyVessels, &dummyUidMgr}; }; @@ -130,18 +130,18 @@ TEST_F(FuelTanks, configuration) auto& config = fuelTank->GetConfiguration(); std::string uID = "tank1"; - EXPECT_EQ(config.GetFuelTanksCount(), 8); + EXPECT_EQ(config.GetFuelTankCount(), 8); EXPECT_EQ(config.GetFuelTank(1).GetDefaultedUID(), uID); EXPECT_NO_THROW(config.GetFuelTank(uID)); EXPECT_EQ(config.GetFuelTankIndex(uID), 1); CheckExceptionMessage([&]() { config.GetFuelTank("not_existing_tank"); }, - "Could not find fuelTank with uid not_existing_tank"); + "Invalid UID in CPACSFuelTanks::GetFuelTank. \"not_existing_tank\" not found in CPACS file!" ); CheckExceptionMessage([&]() { config.GetFuelTankIndex("not_existing_tank"); }, - "Could not find fuelTank with uid not_existing_tank"); + "Invalid UID in CPACSFuelTanks::GetFuelTankIndex"); - CheckExceptionMessage([&]() { config.GetFuelTank(99); }, "Invalid index in CCPACSFuelTanks::GetFuelTank"); + CheckExceptionMessage([&]() { config.GetFuelTank(99); }, "Invalid index in std::vector>::GetFuelTank"); } TEST_F(FuelTanks, fuelTanks) @@ -151,7 +151,7 @@ TEST_F(FuelTanks, fuelTanks) EXPECT_EQ(fuelTanks->GetFuelTank(1).GetDefaultedUID(), uID); EXPECT_NO_THROW(fuelTanks->GetFuelTank(uID)); EXPECT_EQ(fuelTanks->GetFuelTankIndex(uID), 1); - EXPECT_EQ(fuelTanks->GetFuelTanksCount(), 8); + EXPECT_EQ(fuelTanks->GetFuelTankCount(), 8); } TEST_F(FuelTanks, fuelTank) @@ -179,19 +179,19 @@ TEST_F(FuelTanks, fuelTank) TEST_F(FuelTanks, vessels) { - EXPECT_EQ(vessels.GetVesselsCount(), 2); + EXPECT_EQ(vessels.GetVesselCount(), 2); EXPECT_EQ(vessels.GetVessel(1).GetDefaultedUID(), "tank1_outerVessel"); EXPECT_EQ(vessels.GetVessel("tank1_outerVessel").GetDefaultedUID(), "tank1_outerVessel"); EXPECT_EQ(vessels.GetVesselIndex("tank1_outerVessel"), 1); EXPECT_EQ(vessels.GetVessels().at(0)->GetDefaultedUID(), "tank1_outerVessel"); CheckExceptionMessage([&]() { vessels.GetVessel("not_existing_vessel"); }, - "Could not find vessel with uid not_existing_vessel"); + "Invalid UID in CPACSVessels::GetVessel. \"not_existing_vessel\" not found in CPACS file!"); CheckExceptionMessage([&]() { vessels.GetVesselIndex("not_existing_vessel"); }, - "Could not find vessel with uid not_existing_vessel"); + "Invalid UID in CPACSVessels::GetVesselIndex"); - CheckExceptionMessage([&]() { vessels.GetVessel(99); }, "Invalid index in CCPACSVessels::GetVessel"); + CheckExceptionMessage([&]() { vessels.GetVessel(99); }, "Invalid index in std::vector>::GetVessel"); } TEST_F(FuelTanks, vessel_general) @@ -258,7 +258,7 @@ TEST_F(FuelTanks, vessel_sections) EXPECT_NO_THROW(constSegments->GetSection("outerVessel_section1")); EXPECT_THROW(vessel_segments->GetSection("outerVessel_notExistingSection"), tigl::CTiglError); - CheckExceptionMessage([&]() { vessel_segments->GetSection(4); }, invalidIndexMessage); + CheckExceptionMessage([&]() { vessel_segments->GetSection(4); }, "Invalid index in CCPACSVessel::GetSection"); CheckExceptionMessage([&]() { vessel_parametric->GetSection(2); }, tankTypeExceptionString); CheckExceptionMessage([&]() { vessel_parametric->GetSection("outerVessel_notExistingSection"); }, tankTypeExceptionString); @@ -283,7 +283,7 @@ TEST_F(FuelTanks, vessel_segments) EXPECT_NO_THROW(vessel_segments->GetSegment("outerVessel_segment1")); CheckExceptionMessage([&]() { vessel_segments->GetSegment(3); }, - "Invalid index value in CCPACSFuselageSegments::GetSegment"); + "Invalid index in CCPACSVessel::GetSegment"); } TEST_F(FuelTanks, vessel_guide_curves) diff --git a/tests/unittests/tiglWingGuideCurves.cpp b/tests/unittests/tiglWingGuideCurves.cpp index 2527cbbb2c..57a1e106bd 100644 --- a/tests/unittests/tiglWingGuideCurves.cpp +++ b/tests/unittests/tiglWingGuideCurves.cpp @@ -44,7 +44,7 @@ #include "CTiglError.h" #include "CTiglTransformation.h" #include "CCPACSGuideCurveProfile.h" -#include "CCPACSGuideCurveProfiles.h" +#include "generated/CPACSGuideCurveProfiles.h" #include "generated/CPACSGuideCurve.h" #include "CCPACSGuideCurves.h" #include "CCPACSWingProfileGetPointAlgo.h" diff --git a/thirdparty/cpacs_gen b/thirdparty/cpacs_gen index 6f4fc1bf23..bf52f35f36 160000 --- a/thirdparty/cpacs_gen +++ b/thirdparty/cpacs_gen @@ -1 +1 @@ -Subproject commit 6f4fc1bf23a2f39b7d82600d2b7ea0336c0fb7b9 +Subproject commit bf52f35f36f9b8745e6004eb0914f76de33ef01f