Skip to content

Commit

Permalink
Merge pull request #1035 from DLR-SC/issue1012
Browse files Browse the repository at this point in the history
 Fix Python wrapper returns SwigPyObject instead of CPACSWalls (Issue #1012)
  • Loading branch information
joergbrech authored Nov 28, 2024
2 parents b9c75f1 + bc1edbf commit 8c80c8b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
11 changes: 10 additions & 1 deletion bindings/python_internal/configuration.i
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
#include "CCPACSExternalObject.h"
#include "CTiglShapeCache.h"
#include "CTiglError.h"
#include "CCPACSWalls.h"
#include "CCPACSWallPosition.h"
#include "CCPACSFuselageWallSegment.h"
#include "CCPACSWingSegment.h"
#include "CCPACSFuselageSegment.h"
#include "CTiglWingConnection.h"
Expand Down Expand Up @@ -87,6 +89,7 @@
#include "generated/CPACSBoundingElementUIDs.h"
#include "generated/CPACSStructuralWallElement.h"
#include "generated/CPACSStructuralWallElements.h"
#include "generated/CPACSWalls.h"
#include "generated/CPACSWallPositionUIDs.h"
#include "generated/CPACSWallPosition.h"
#include "generated/CPACSWallPositions.h"
Expand Down Expand Up @@ -177,7 +180,6 @@
%include "generated/CPACSLateralCap_placement.h"
%boost_optional(tigl::generated::CPACSLateralCap)
%include "generated/CPACSLateralCap.h"

%boost_optional(tigl::generated::CPACSBoundingElementUIDs)
%include "generated/CPACSBoundingElementUIDs.h"
%include "generated/CPACSStructuralWallElement.h"
Expand All @@ -187,8 +189,14 @@
%include "generated/CPACSWallPositions.h"
%include "generated/CPACSWallSegment.h"
%include "generated/CPACSWallSegments.h"
%boost_optional(tigl::CCPACSWalls)
%boost_optional(tigl::generated::CPACSWalls)
%boost_optional(tigl::CCPACSWallPosition)
%boost_optional(tigl::CCPACSFuselageWallSegment)
%include "generated/CPACSWalls.h"
%include "CCPACSWalls.h"
%include "CCPACSWallPosition.h"
%include "CCPACSFuselageWallSegment.h"

// ----------------- Engines ---------------------------//
%boost_optional(tigl::CCPACSEngines)
Expand Down Expand Up @@ -516,6 +524,7 @@ class CCPACSWingRibsPositioning;
%factory(tigl::ITiglGeometricComponent& tigl::CTiglUIDManager::GetGeometricComponent,
tigl::CCPACSFuselage,
tigl::CCPACSFuselageSegment,
tigl::CCPACSFuselageWallSegment,
tigl::CCPACSWing,
tigl::CCPACSWingSegment,
tigl::CCPACSWingComponentSegment,
Expand Down
8 changes: 4 additions & 4 deletions src/structural_elements/CCPACSFuselageWallSegment.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,22 @@ class CCPACSFuselageWallSegment : public generated::CPACSWallSegment, public CTi
public:
TIGL_EXPORT CCPACSFuselageWallSegment(CCPACSWallSegments* parent, CTiglUIDManager* uidMgr);

std::string GetDefaultedUID() const override
TIGL_EXPORT std::string GetDefaultedUID() const override
{
return GetUID().value_or("UnknownWallSegment");
}

TiglGeometricComponentIntent GetComponentIntent() const override
TIGL_EXPORT TiglGeometricComponentIntent GetComponentIntent() const override
{
return TIGL_INTENT_INNER_STRUCTURE | TIGL_INTENT_PHYSICAL;
}

TiglGeometricComponentType GetComponentType() const override
TIGL_EXPORT TiglGeometricComponentType GetComponentType() const override
{
return TIGL_COMPONENT_FUSELAGE_WALL;
}

TopoDS_Compound GetCutPlanes() const;
TIGL_EXPORT TopoDS_Compound GetCutPlanes() const;

TIGL_EXPORT void SetPhi(const double& value) override;
TIGL_EXPORT void SetDoubleSidedExtrusion(const boost::optional<bool>& value) override;
Expand Down
8 changes: 4 additions & 4 deletions src/structural_elements/CCPACSWalls.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ namespace tigl
class CCPACSWalls : public generated::CPACSWalls
{
public:
CCPACSWalls(CCPACSFuselageStructure* parent, CTiglUIDManager* uidMgr);
TIGL_EXPORT CCPACSWalls(CCPACSFuselageStructure* parent, CTiglUIDManager* uidMgr);

const CCPACSFuselageWallSegment& GetWallSegment(const std::string& uid) const;
const CCPACSWallPosition& GetWallPosition(const std::string& uid) const;
TIGL_EXPORT const CCPACSFuselageWallSegment& GetWallSegment(const std::string& uid) const;
TIGL_EXPORT const CCPACSWallPosition& GetWallPosition(const std::string& uid) const;

void Invalidate(const boost::optional<std::string>& source = boost::none) const;
TIGL_EXPORT void Invalidate(const boost::optional<std::string>& source = boost::none) const;
};

} // namespace tigl
Expand Down

0 comments on commit 8c80c8b

Please sign in to comment.