Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 470b83a

Browse filesBrowse files
committed
Bug fixes for latest release
FindTriangleGeomShapes & FindShapes: Fix memory leak CalculateArrayHistogram: Allow the use of existing data containers FindVolFractions: Calculate Volume Fractions for ALL phases Texture.hpp: Change API to handle STL style containers. This required updating many other classes. SGMDFTableModel: Update API to take STL containers, Update parsing functions that take data from the UI in the form of a table row. All data is stored as floats instead of a mix of float and string. MatchCrystallography: Fix walking off the end of an array StatsGeneratorUtilities: Update calls to API where possible. To fix all instances we would need to back-port the complete standalone EBSDLib which is not going to happen for this release. Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
1 parent 23e6784 commit 470b83a
Copy full SHA for 470b83a
Expand file treeCollapse file tree

19 files changed

+597
-532
lines changed

‎Source/OrientationLib/Test/ODFTest.cpp

Copy file name to clipboardExpand all lines: Source/OrientationLib/Test/ODFTest.cpp
+11-13Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,8 @@
6060
class ODFTest
6161
{
6262
public:
63-
ODFTest()
64-
{
65-
}
66-
virtual ~ODFTest()
67-
{
68-
}
63+
ODFTest() = default;
64+
virtual ~ODFTest() = default;
6965

7066
// -----------------------------------------------------------------------------
7167
//
@@ -78,21 +74,23 @@ class ODFTest
7874

7975
void CubicODFTest()
8076
{
77+
using ContainerType = std::vector<float>;
78+
8179
// Resize the ODF vector properly for Cubic
82-
std::vector<float> odf(CubicOps::k_OdfSize);
83-
std::vector<float> e1s(2);
84-
std::vector<float> e2s(2);
85-
std::vector<float> e3s(2);
86-
std::vector<float> weights(2);
87-
std::vector<float> sigmas(2);
80+
ContainerType odf(CubicOps::k_OdfSize);
81+
ContainerType e1s(2);
82+
ContainerType e2s(2);
83+
ContainerType e3s(2);
84+
ContainerType weights(2);
85+
ContainerType sigmas(2);
8886

8987
POPULATE_DATA(0, 35, 45, 0, 1000.0, 2.0)
9088
POPULATE_DATA(1, 59, 37, 63, 1000.0, 1.0)
9189

9290
// Calculate the ODF Data
9391

9492
size_t numEntries = e1s.size();
95-
Texture::CalculateCubicODFData(&(e1s.front()), &(e2s.front()), &(e3s.front()), &(weights.front()), &(sigmas.front()), true, &(odf.front()), numEntries);
93+
Texture::CalculateCubicODFData<float, ContainerType>(e1s, e2s, e3s, weights, sigmas, true, odf, numEntries);
9694

9795
size_t npoints = 1000;
9896
std::vector<float> x001(npoints * 3);

‎Source/OrientationLib/Test/TextureTest.cpp

Copy file name to clipboardExpand all lines: Source/OrientationLib/Test/TextureTest.cpp
+13-16Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -58,40 +58,37 @@ class TextureTest
5858

5959
void operator()()
6060
{
61-
QVector<float> e1s;
62-
QVector<float> e2s;
63-
QVector<float> e3s;
64-
QVector<float> weights;
65-
QVector<float> sigmas;
66-
QVector<float> odf;
61+
using Container = QVector<float>;
62+
Container e1s;
63+
Container e2s;
64+
Container e3s;
65+
Container weights;
66+
Container sigmas;
67+
Container odf;
6768

6869
CubicOps cubicOps;
6970
HexagonalOps hexagonalOps;
7071
OrthoRhombicOps orthOps;
7172

7273
size_t numEntries = e1s.size();
7374
odf.resize(cubicOps.getODFSize());
74-
Texture::CalculateCubicODFData(e1s.data(), e2s.data(), e3s.data(), weights.data(), sigmas.data(), true, odf.data(), numEntries);
75+
Texture::CalculateCubicODFData<float, Container>(e1s, e2s, e3s, weights, sigmas, true, odf, numEntries);
7576
odf.resize(hexagonalOps.getODFSize());
76-
Texture::CalculateHexODFData(e1s.data(), e2s.data(), e3s.data(), weights.data(), sigmas.data(), true,
77-
odf.data(), numEntries);
78-
77+
Texture::CalculateHexODFData<float, Container>(e1s, e2s, e3s, weights, sigmas, true, odf, numEntries);
7978

8079
odf.resize(orthOps.getODFSize());
81-
Texture::CalculateOrthoRhombicODFData(e1s.data(), e2s.data(), e3s.data(), weights.data(), sigmas.data(), true,
82-
odf.data(), numEntries);
83-
80+
Texture::CalculateOrthoRhombicODFData<float, Container>(e1s, e2s, e3s, weights, sigmas, true, odf, numEntries);
8481

85-
//int size = 1000;
82+
// int size = 1000;
8683
// Now generate the actual XY point data that gets plotted.
8784
// These are the output vectors
8885
QVector<float> angles;
8986
QVector<float> axes;
9087
QVector<float> mdf(CubicOps::k_MdfSize);
9188

92-
Texture::CalculateMDFData<float, CubicOps>(angles.data(), axes.data(), weights.data(), odf.data(), mdf.data(), angles.size());
93-
89+
Texture::CalculateMDFData<float, CubicOps>(angles, axes, weights, odf, mdf, angles.size());
9490
}
91+
9592
private:
9693
TextureTest(const TextureTest&); // Copy Constructor Not Implemented
9794
void operator=(const TextureTest&); // Move assignment Not Implemented

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.