-
Notifications
You must be signed in to change notification settings - Fork 193
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
#4957 - Some copy constructors aren't declared in SWIG #4960
Changes from all commits
2cdc9c2
1b93313
2601399
9c8001d
f9d1e88
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,11 +27,11 @@ class UTILITIES_API Point3d | |
/// constructor with x, y, z | ||
Point3d(double x, double y, double z); | ||
|
||
// Copy and move operators are implicitly declared | ||
// Point3d(const Point3d& other) = default; | ||
// Point3d(Point3d&& other) = default; | ||
// Point3d& operator=(const Point3d&) = default; | ||
// Point3d& operator=(Point3d&&) = default; | ||
// Copy and move operators are implicitly declared, but we want the copy ctor for SWIG so we have to define all of them | ||
Point3d(const Point3d& other) = default; | ||
Point3d(Point3d&& other) noexcept = default; | ||
Point3d& operator=(const Point3d&) = default; | ||
Point3d& operator=(Point3d&&) noexcept = default; | ||
Comment on lines
+30
to
+34
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Put back the copy ctor for swig. Have to declare all of them or the move operations are implicitly deleted |
||
// ~Point3d() noexcept = default; | ||
|
||
/// get x | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,8 +104,8 @@ Vector3d Surface3dEdge::asVector() const { | |
} | ||
|
||
std::ostream& operator<<(std::ostream& os, const Surface3dEdge& edge) { | ||
os << "Surface3dEdge: start=" << edge.start() << ", end=" << edge.end() << ", count=" << edge.count() | ||
<< ", firstSurface=" << edge.firstSurfaceName(); | ||
os << "Surface3dEdge: start=" << edge.start() << ", end=" << edge.end() << ", count=" << edge.count() << ", firstSurface='" | ||
<< edge.firstSurfaceName() << "'"; | ||
return os; | ||
} | ||
|
||
|
@@ -118,10 +118,23 @@ Surface3d::Surface3d(std::vector<Point3d> t_vertices, std::string t_name, size_t | |
itnext = std::begin(vertices); | ||
} | ||
|
||
edges.emplace_back(*it, *itnext, t_name, t_surfNum); | ||
edges.emplace_back(*it, *itnext, name, surfNum); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix an unrelated issue, t_name (the parameter) was moved from, so it's generally an empty string. |
||
} | ||
} | ||
|
||
std::ostream& operator<<(std::ostream& os, const Surface3d& surface3d) { | ||
os << "Surface3d "; | ||
if (!surface3d.name.empty()) { | ||
os << "'" << surface3d.name << "' "; | ||
} | ||
os << "= [\n"; | ||
for (const auto& pt : surface3d.vertices) { | ||
os << " " << pt << ",\n"; | ||
} | ||
os << "]"; | ||
return os; | ||
} | ||
|
||
bool Surface3d::operator<(const Surface3d& rhs) const { | ||
return this->name < rhs.name; | ||
} | ||
|
@@ -492,4 +505,8 @@ double Polyhedron::calcDivergenceTheoremVolume() const { | |
return volume; | ||
} | ||
|
||
std::vector<Surface3d> Polyhedron::surface3ds() const { | ||
return m_surfaces; | ||
} | ||
|
||
} // namespace openstudio |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -138,6 +138,8 @@ class UTILITIES_API Polyhedron | |
* proportion of conflicted edges / total number of edges */ | ||
std::vector<Surface3d> findSurfacesWithIncorrectOrientation() const; | ||
|
||
std::vector<Surface3d> surface3ds() const; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Convenience getter for inspection / debugging in Polyhedron |
||
|
||
protected: | ||
void performEdgeMatching(); | ||
void resetEdgeMatching(); | ||
|
@@ -164,6 +166,7 @@ using PolyhedronVector = std::vector<Polyhedron>; | |
|
||
/// ostream operator | ||
UTILITIES_API std::ostream& operator<<(std::ostream& os, const Surface3dEdge& edge); | ||
UTILITIES_API std::ostream& operator<<(std::ostream& os, const Surface3d& surface3d); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add an ostream operator<< for convenience |
||
|
||
} // namespace openstudio | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the new Surface3d::operator<< in the swig interface file