Mesh: modernize C++: return braced init list

This commit is contained in:
wmayer
2023-08-19 01:06:43 +02:00
parent 0e444a554d
commit 9d780d223a
12 changed files with 17 additions and 17 deletions

View File

@@ -965,7 +965,7 @@ inline void MeshFacet::GetEdge (unsigned short usSide, MeshHelpEdge &rclEdge) co
inline std::pair<PointIndex, PointIndex> MeshFacet::GetEdge (unsigned short usSide) const
{
return std::pair<PointIndex, PointIndex>(_aulPoints[usSide], _aulPoints[(usSide+1)%3]);
return {_aulPoints[usSide], _aulPoints[(usSide+1)%3]};
}
inline void MeshFacet::Transpose (PointIndex ulOrig, PointIndex ulNew)

View File

@@ -186,7 +186,7 @@ std::vector<FacetIndex> MeshEvalOrientation::GetIndices() const
FacetIndex ulStartFacet, ulVisited;
if (_rclMesh.CountFacets() == 0)
return std::vector<FacetIndex>();
return {};
// reset VISIT flags
MeshAlgorithm cAlg(_rclMesh);

View File

@@ -58,7 +58,7 @@ MeshSegment MeshSurfaceSegment::FindSegment(FacetIndex index) const
return segment;
}
return MeshSegment();
return {};
}
// --------------------------------------------------------

View File

@@ -135,7 +135,7 @@ PyObject* EdgePy::unbound(PyObject *args)
Py::Boolean EdgePy::getBound() const
{
return Py::Boolean(getEdgePtr()->isBound());
return {getEdgePtr()->isBound()};
}
Py::List EdgePy::getPoints() const

View File

@@ -136,7 +136,7 @@ Py::Long FacetPy::getIndex() const
Py::Boolean FacetPy::getBound() const
{
return Py::Boolean(getFacetPtr()->isBound());
return {getFacetPtr()->isBound()};
}
Py::Object FacetPy::getNormal() const

View File

@@ -397,14 +397,14 @@ public:
/** @name Iterator */
//@{
const_point_iterator points_begin() const
{ return const_point_iterator(this, 0); }
{ return {this, 0}; }
const_point_iterator points_end() const
{ return const_point_iterator(this, countPoints()); }
{ return {this, countPoints()}; }
const_facet_iterator facets_begin() const
{ return const_facet_iterator(this, 0); }
{ return {this, 0}; }
const_facet_iterator facets_end() const
{ return const_facet_iterator(this, countFacets()); }
{ return {this, countFacets()}; }
using const_segment_iterator = std::vector<Segment>::const_iterator;
const_segment_iterator segments_begin() const

View File

@@ -93,7 +93,7 @@ Py::Long MeshPointPy::getIndex() const
Py::Boolean MeshPointPy::getBound() const
{
return Py::Boolean(getMeshPointPtr()->Index != UINT_MAX);
return {getMeshPointPtr()->Index != UINT_MAX};
}
Py::Object MeshPointPy::getNormal() const

View File

@@ -95,9 +95,9 @@ public:
};
const_facet_iterator facets_begin() const
{ return const_facet_iterator(this, _indices.begin()); }
{ return {this, _indices.begin()}; }
const_facet_iterator facets_end() const
{ return const_facet_iterator(this, _indices.end()); }
{ return {this, _indices.end()}; }
};
} // namespace Mesh

View File

@@ -1362,7 +1362,7 @@ void DockEvaluateMeshImp::closeEvent(QCloseEvent*)
*/
QSize DockEvaluateMeshImp::sizeHint () const
{
return QSize(371, 579);
return {371, 579};
}
#include "moc_DlgEvaluateMeshImp.cpp"

View File

@@ -73,7 +73,7 @@ QVariant PropertyMeshKernelItem::value(const App::Property*) const
}
QString str = QObject::tr("[Points: %1, Edges: %2, Faces: %3]").arg(ctP).arg(ctE).arg(ctF);
return QVariant(str);
return {str};
}
QVariant PropertyMeshKernelItem::toolTip(const App::Property* prop) const
@@ -103,7 +103,7 @@ void PropertyMeshKernelItem::setEditorData(QWidget *editor, const QVariant& data
QVariant PropertyMeshKernelItem::editorData(QWidget *editor) const
{
Q_UNUSED(editor);
return QVariant();
return {};
}
int PropertyMeshKernelItem::countPoints() const

View File

@@ -581,7 +581,7 @@ inline void glNormal(float* n)
// Helper function: convert Vec to SbVec3f
inline SbVec3f sbvec3f(const Base::Vector3f& _v)
{
return SbVec3f(_v.x, _v.y, _v.z);
return {_v.x, _v.y, _v.z};
}
SO_NODE_SOURCE(SoFCMeshObjectShape)

View File

@@ -96,7 +96,7 @@ public:
}
std::vector<std::string> getDisplayModes() const override
{
return std::vector<std::string>();
return {};
}
void setCoords(const std::vector<Base::Vector3f>& v)
{