Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Python wrapper returns SwigPyObject instead of CPACSWalls (Issue #1012) #1035

Merged
merged 3 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
joergbrech marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,22 @@
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

Check warning on line 44 in src/structural_elements/CCPACSFuselageWallSegment.h

View check run for this annotation

Codecov / codecov/patch

src/structural_elements/CCPACSFuselageWallSegment.h#L44

Added line #L44 was not covered by tests
{
return TIGL_INTENT_INNER_STRUCTURE | TIGL_INTENT_PHYSICAL;
}

TiglGeometricComponentType GetComponentType() const override
TIGL_EXPORT TiglGeometricComponentType GetComponentType() const override

Check warning on line 49 in src/structural_elements/CCPACSFuselageWallSegment.h

View check run for this annotation

Codecov / codecov/patch

src/structural_elements/CCPACSFuselageWallSegment.h#L49

Added line #L49 was not covered by tests
{
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
Loading