Skip to content

Commit ed67bc5

Browse files
committed
Expose the default Pole figure names so they can be used externally.
Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
1 parent b483b46 commit ed67bc5

24 files changed

+217
-36
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ can set to allow the orientation transformations to accept this layout.
4848

4949
EbsdLib is dependent on:
5050

51-
+ Qt5 5.12.x (minimum)
52-
+ Eigen 3.5
53-
+ HDF5 1.8.20 or 1.10.4 (HDF5 is optional only if you want the HDF5 functionality)
51+
+ Qt5 5.15.x (minimum)
52+
+ Eigen 3.4
53+
+ HDF5 1.10.4 (HDF5 is optional only if you want the HDF5 functionality)
5454

5555
## Rotation Convention ##
5656

Source/EbsdLib/LaueOps/CubicLowOps.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -958,14 +958,23 @@ EbsdLib::Rgb CubicLowOps::generateRodriguesColor(double r1, double r2, double r3
958958
return EbsdLib::RgbColor::dRgb(static_cast<int32_t>(red * 255), static_cast<int32_t>(green * 255), static_cast<int32_t>(blue * 255), 255);
959959
}
960960

961+
// -----------------------------------------------------------------------------
962+
//
963+
// -----------------------------------------------------------------------------
964+
std::array<std::string, 3> CubicLowOps::getDefaultPoleFigureNames() const
965+
{
966+
return {"<001>", "<011>", "<111>"};
967+
}
968+
961969
// -----------------------------------------------------------------------------
962970
//
963971
// -----------------------------------------------------------------------------
964972
std::vector<EbsdLib::UInt8ArrayType::Pointer> CubicLowOps::generatePoleFigure(PoleFigureConfiguration_t& config) const
965973
{
966-
std::string label0 = std::string("<001>");
967-
std::string label1 = std::string("<011>");
968-
std::string label2 = std::string("<111>");
974+
std::array<std::string, 3>labels = getDefaultPoleFigureNames();
975+
std::string label0 = labels[0];
976+
std::string label1 = labels[1];
977+
std::string label2 = labels[2];
969978
if(!config.labels.empty())
970979
{
971980
label0 = config.labels.at(0);

Source/EbsdLib/LaueOps/CubicLowOps.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,12 @@ class EbsdLib_EXPORT CubicLowOps : public LaueOps
224224
*/
225225
std::vector<EbsdLib::UInt8ArrayType::Pointer> generatePoleFigure(PoleFigureConfiguration_t& config) const override;
226226

227+
/**
228+
* @brief Returns the names for each of the three standard pole figures that are generated. For example
229+
*<001>, <011> and <111> for a cubic system
230+
*/
231+
std::array<std::string, 3> getDefaultPoleFigureNames() const override;
232+
227233
/**
228234
* @brief generateStandardTriangle Generates an RGBA array that is a color "Standard" IPF Triangle Legend used for IPF Color Maps.
229235
* @return

Source/EbsdLib/LaueOps/CubicOps.cpp

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1745,14 +1745,26 @@ EbsdLib::Rgb CubicOps::generateRodriguesColor(double r1, double r2, double r3) c
17451745
return EbsdLib::RgbColor::dRgb(static_cast<int32_t>(red * 255), static_cast<int32_t>(green * 255), static_cast<int32_t>(blue * 255), 255);
17461746
}
17471747

1748+
// -----------------------------------------------------------------------------
1749+
//
1750+
// -----------------------------------------------------------------------------
1751+
std::array<std::string, 3> CubicOps::getDefaultPoleFigureNames() const
1752+
{
1753+
return { "<001>",
1754+
"<011>",
1755+
"<111>"};
1756+
}
1757+
17481758
// -----------------------------------------------------------------------------
17491759
//
17501760
// -----------------------------------------------------------------------------
17511761
std::vector<EbsdLib::UInt8ArrayType::Pointer> CubicOps::generatePoleFigure(PoleFigureConfiguration_t& config) const
17521762
{
1753-
std::string label0 = std::string("<001>");
1754-
std::string label1 = std::string("<011>");
1755-
std::string label2 = std::string("<111>");
1763+
std::array<std::string, 3>labels = getDefaultPoleFigureNames();
1764+
std::string label0 = labels[0];
1765+
std::string label1 = labels[1];
1766+
std::string label2 = labels[2];
1767+
17561768
if(!config.labels.empty())
17571769
{
17581770
label0 = config.labels.at(0);

Source/EbsdLib/LaueOps/CubicOps.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,12 @@ class EbsdLib_EXPORT CubicOps : public LaueOps
224224
*/
225225
std::vector<EbsdLib::UInt8ArrayType::Pointer> generatePoleFigure(PoleFigureConfiguration_t& config) const override;
226226

227+
/**
228+
* @brief Returns the names for each of the three standard pole figures that are generated. For example
229+
*<001>, <011> and <111> for a cubic system
230+
*/
231+
std::array<std::string, 3> getDefaultPoleFigureNames() const override;
232+
227233
/**
228234
* @brief generateStandardTriangle Generates an RGBA array that is a color "Standard" IPF Triangle Legend used for IPF Color Maps.
229235
* @return

Source/EbsdLib/LaueOps/HexagonalLowOps.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,14 +1263,23 @@ EbsdLib::Rgb HexagonalLowOps::generateRodriguesColor(double r1, double r2, doubl
12631263
return EbsdLib::RgbColor::dRgb(static_cast<int32_t>(red * 255), static_cast<int32_t>(green * 255), static_cast<int32_t>(blue * 255), 255);
12641264
}
12651265

1266+
// -----------------------------------------------------------------------------
1267+
//
1268+
// -----------------------------------------------------------------------------
1269+
std::array<std::string, 3> HexagonalLowOps::getDefaultPoleFigureNames() const
1270+
{
1271+
return {"<0001>", "<11-20>", "<2-1-10>"};
1272+
}
1273+
12661274
// -----------------------------------------------------------------------------
12671275
//
12681276
// -----------------------------------------------------------------------------
12691277
std::vector<EbsdLib::UInt8ArrayType::Pointer> HexagonalLowOps::generatePoleFigure(PoleFigureConfiguration_t& config) const
12701278
{
1271-
std::string label0 = std::string("<0001>");
1272-
std::string label1 = std::string("<11-20>");
1273-
std::string label2 = std::string("<2-1-10>");
1279+
std::array<std::string, 3>labels = getDefaultPoleFigureNames();
1280+
std::string label0 = labels[0];
1281+
std::string label1 = labels[1];
1282+
std::string label2 = labels[2];
12741283
if(!config.labels.empty())
12751284
{
12761285
label0 = config.labels.at(0);

Source/EbsdLib/LaueOps/HexagonalLowOps.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,12 @@ class EbsdLib_EXPORT HexagonalLowOps : public LaueOps
225225
*/
226226
std::vector<EbsdLib::UInt8ArrayType::Pointer> generatePoleFigure(PoleFigureConfiguration_t& config) const override;
227227

228+
/**
229+
* @brief Returns the names for each of the three standard pole figures that are generated. For example
230+
*<001>, <011> and <111> for a cubic system
231+
*/
232+
std::array<std::string, 3> getDefaultPoleFigureNames() const override;
233+
228234
/**
229235
* @brief generateStandardTriangle Generates an RGBA array that is a color "Standard" IPF Triangle Legend used for IPF Color Maps.
230236
* @return

Source/EbsdLib/LaueOps/HexagonalOps.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,14 +1324,24 @@ EbsdLib::Rgb HexagonalOps::generateRodriguesColor(double r1, double r2, double r
13241324
return EbsdLib::RgbColor::dRgb(static_cast<int32_t>(red * 255), static_cast<int32_t>(green * 255), static_cast<int32_t>(blue * 255), 255);
13251325
}
13261326

1327+
// -----------------------------------------------------------------------------
1328+
//
1329+
// -----------------------------------------------------------------------------
1330+
std::array<std::string, 3> HexagonalOps::getDefaultPoleFigureNames() const
1331+
{
1332+
return {"<0001>", "<10-10>", "<2-1-10>"};
1333+
}
1334+
13271335
// -----------------------------------------------------------------------------
13281336
//
13291337
// -----------------------------------------------------------------------------
13301338
std::vector<EbsdLib::UInt8ArrayType::Pointer> HexagonalOps::generatePoleFigure(PoleFigureConfiguration_t& config) const
13311339
{
1332-
std::string label0 = std::string("<0001>");
1333-
std::string label1 = std::string("<10-10>");
1334-
std::string label2 = std::string("<2-1-10>");
1340+
std::array<std::string, 3>labels = getDefaultPoleFigureNames();
1341+
std::string label0 = labels[0];
1342+
std::string label1 = labels[1];
1343+
std::string label2 = labels[2];
1344+
13351345
if(!config.labels.empty())
13361346
{
13371347
label0 = config.labels.at(0);

Source/EbsdLib/LaueOps/HexagonalOps.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,12 @@ class EbsdLib_EXPORT HexagonalOps : public LaueOps
225225
*/
226226
std::vector<EbsdLib::UInt8ArrayType::Pointer> generatePoleFigure(PoleFigureConfiguration_t& config) const override;
227227

228+
/**
229+
* @brief Returns the names for each of the three standard pole figures that are generated. For example
230+
*<001>, <011> and <111> for a cubic system
231+
*/
232+
std::array<std::string, 3> getDefaultPoleFigureNames() const override;
233+
228234
/**
229235
* @brief generateStandardTriangle Generates an RGBA array that is a color "Standard" IPF Triangle Legend used for IPF Color Maps.
230236
* @return

Source/EbsdLib/LaueOps/LaueOps.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,12 @@ class EbsdLib_EXPORT LaueOps
287287
*/
288288
virtual std::vector<EbsdLib::UInt8ArrayType::Pointer> generatePoleFigure(PoleFigureConfiguration_t& config) const = 0;
289289

290+
/**
291+
* @brief Returns the names for each of the three standard pole figures that are generated. For example
292+
*<001>, <011> and <111> for a cubic system
293+
*/
294+
virtual std::array<std::string, 3> getDefaultPoleFigureNames() const = 0;
295+
290296
protected:
291297
LaueOps();
292298

0 commit comments

Comments
 (0)