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

Some copy constructors aren't declared in SWIG #4957

Closed
jmarrec opened this issue Sep 4, 2023 · 0 comments · Fixed by #4960
Closed

Some copy constructors aren't declared in SWIG #4957

jmarrec opened this issue Sep 4, 2023 · 0 comments · Fixed by #4960

Comments

@jmarrec
Copy link
Collaborator

jmarrec commented Sep 4, 2023

Issue overview

@shorowit reported this change of behavior between 3.6.1 and 3.7.0-alpha. This used to work in 3.6.1, and now the copy constructor isn't swigg'ed.

[6] 3_7_0(main)> OpenStudio::Point3d.new(OpenStudio::Point3d.new(0, 0, 0))
ArgumentError: Wrong arguments for overloaded method 'Point3d.new'.
Possible C/C++ prototypes are:
    Point3d.new()
    Point3d.new(double x, double y, double z)

from (pry):6:in `initialize'
[7] 3_7_0(main)> OpenStudio::Vector3d.new(OpenStudio::Vector3d.new(0, 0, 0))
ArgumentError: Wrong arguments for overloaded method 'Vector3d.new'.
Possible C/C++ prototypes are:
    Vector3d.new()
    Vector3d.new(double x, double y, double z)

Possible Solution

This is due to this commit of mine, where I applied Rule of 1 in the C++ code, not realizing that this had an impact on SWIG: 565bea0#diff-9ef35a3df57f646ab394775dab1b9d3212fd52c1d5bbce281c2585c6df05a952

For these geometry classes, it's probably a good idea to ensure that the copy ctor is swigged.

Details

Environment

Some additional details about your environment for this issue (if relevant):

  • Platform (Operating system, version): all
  • Version of OpenStudio (if using an intermediate build, include SHA): 3.7.0-alpha, 0ab0280

Context

https://github.com/NREL/OpenStudio-HPXML/blob/5e218b5d148effc86f12cbdeb682c21fe8a63db1/BuildResidentialHPXML/resources/geometry.rb#L2360

length = OpenStudio::Vector3d.new(point_one - point_two).length
jmarrec added a commit that referenced this issue Sep 5, 2023
@jmarrec jmarrec self-assigned this Sep 5, 2023
jmarrec added a commit that referenced this issue Sep 6, 2023
#4957 - Some copy constructors aren't declared in SWIG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant