Skip to content

Commit

Permalink
Expose the default Pole figure names so they can be used externally.
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
  • Loading branch information
imikejackson committed Apr 13, 2023
1 parent b483b46 commit ed67bc5
Show file tree
Hide file tree
Showing 24 changed files with 217 additions and 36 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ can set to allow the orientation transformations to accept this layout.

EbsdLib is dependent on:

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

## Rotation Convention ##

Expand Down
15 changes: 12 additions & 3 deletions Source/EbsdLib/LaueOps/CubicLowOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -958,14 +958,23 @@ EbsdLib::Rgb CubicLowOps::generateRodriguesColor(double r1, double r2, double r3
return EbsdLib::RgbColor::dRgb(static_cast<int32_t>(red * 255), static_cast<int32_t>(green * 255), static_cast<int32_t>(blue * 255), 255);
}

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
std::array<std::string, 3> CubicLowOps::getDefaultPoleFigureNames() const
{
return {"<001>", "<011>", "<111>"};
}

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
std::vector<EbsdLib::UInt8ArrayType::Pointer> CubicLowOps::generatePoleFigure(PoleFigureConfiguration_t& config) const
{
std::string label0 = std::string("<001>");
std::string label1 = std::string("<011>");
std::string label2 = std::string("<111>");
std::array<std::string, 3>labels = getDefaultPoleFigureNames();
std::string label0 = labels[0];
std::string label1 = labels[1];
std::string label2 = labels[2];
if(!config.labels.empty())
{
label0 = config.labels.at(0);
Expand Down
6 changes: 6 additions & 0 deletions Source/EbsdLib/LaueOps/CubicLowOps.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,12 @@ class EbsdLib_EXPORT CubicLowOps : public LaueOps
*/
std::vector<EbsdLib::UInt8ArrayType::Pointer> generatePoleFigure(PoleFigureConfiguration_t& config) const override;

/**
* @brief Returns the names for each of the three standard pole figures that are generated. For example
*<001>, <011> and <111> for a cubic system
*/
std::array<std::string, 3> getDefaultPoleFigureNames() const override;

/**
* @brief generateStandardTriangle Generates an RGBA array that is a color "Standard" IPF Triangle Legend used for IPF Color Maps.
* @return
Expand Down
18 changes: 15 additions & 3 deletions Source/EbsdLib/LaueOps/CubicOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1745,14 +1745,26 @@ EbsdLib::Rgb CubicOps::generateRodriguesColor(double r1, double r2, double r3) c
return EbsdLib::RgbColor::dRgb(static_cast<int32_t>(red * 255), static_cast<int32_t>(green * 255), static_cast<int32_t>(blue * 255), 255);
}

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
std::array<std::string, 3> CubicOps::getDefaultPoleFigureNames() const
{
return { "<001>",
"<011>",
"<111>"};
}

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
std::vector<EbsdLib::UInt8ArrayType::Pointer> CubicOps::generatePoleFigure(PoleFigureConfiguration_t& config) const
{
std::string label0 = std::string("<001>");
std::string label1 = std::string("<011>");
std::string label2 = std::string("<111>");
std::array<std::string, 3>labels = getDefaultPoleFigureNames();
std::string label0 = labels[0];
std::string label1 = labels[1];
std::string label2 = labels[2];

if(!config.labels.empty())
{
label0 = config.labels.at(0);
Expand Down
6 changes: 6 additions & 0 deletions Source/EbsdLib/LaueOps/CubicOps.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,12 @@ class EbsdLib_EXPORT CubicOps : public LaueOps
*/
std::vector<EbsdLib::UInt8ArrayType::Pointer> generatePoleFigure(PoleFigureConfiguration_t& config) const override;

/**
* @brief Returns the names for each of the three standard pole figures that are generated. For example
*<001>, <011> and <111> for a cubic system
*/
std::array<std::string, 3> getDefaultPoleFigureNames() const override;

/**
* @brief generateStandardTriangle Generates an RGBA array that is a color "Standard" IPF Triangle Legend used for IPF Color Maps.
* @return
Expand Down
15 changes: 12 additions & 3 deletions Source/EbsdLib/LaueOps/HexagonalLowOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1263,14 +1263,23 @@ EbsdLib::Rgb HexagonalLowOps::generateRodriguesColor(double r1, double r2, doubl
return EbsdLib::RgbColor::dRgb(static_cast<int32_t>(red * 255), static_cast<int32_t>(green * 255), static_cast<int32_t>(blue * 255), 255);
}

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
std::array<std::string, 3> HexagonalLowOps::getDefaultPoleFigureNames() const
{
return {"<0001>", "<11-20>", "<2-1-10>"};
}

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
std::vector<EbsdLib::UInt8ArrayType::Pointer> HexagonalLowOps::generatePoleFigure(PoleFigureConfiguration_t& config) const
{
std::string label0 = std::string("<0001>");
std::string label1 = std::string("<11-20>");
std::string label2 = std::string("<2-1-10>");
std::array<std::string, 3>labels = getDefaultPoleFigureNames();
std::string label0 = labels[0];
std::string label1 = labels[1];
std::string label2 = labels[2];
if(!config.labels.empty())
{
label0 = config.labels.at(0);
Expand Down
6 changes: 6 additions & 0 deletions Source/EbsdLib/LaueOps/HexagonalLowOps.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,12 @@ class EbsdLib_EXPORT HexagonalLowOps : public LaueOps
*/
std::vector<EbsdLib::UInt8ArrayType::Pointer> generatePoleFigure(PoleFigureConfiguration_t& config) const override;

/**
* @brief Returns the names for each of the three standard pole figures that are generated. For example
*<001>, <011> and <111> for a cubic system
*/
std::array<std::string, 3> getDefaultPoleFigureNames() const override;

/**
* @brief generateStandardTriangle Generates an RGBA array that is a color "Standard" IPF Triangle Legend used for IPF Color Maps.
* @return
Expand Down
16 changes: 13 additions & 3 deletions Source/EbsdLib/LaueOps/HexagonalOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1324,14 +1324,24 @@ EbsdLib::Rgb HexagonalOps::generateRodriguesColor(double r1, double r2, double r
return EbsdLib::RgbColor::dRgb(static_cast<int32_t>(red * 255), static_cast<int32_t>(green * 255), static_cast<int32_t>(blue * 255), 255);
}

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
std::array<std::string, 3> HexagonalOps::getDefaultPoleFigureNames() const
{
return {"<0001>", "<10-10>", "<2-1-10>"};
}

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
std::vector<EbsdLib::UInt8ArrayType::Pointer> HexagonalOps::generatePoleFigure(PoleFigureConfiguration_t& config) const
{
std::string label0 = std::string("<0001>");
std::string label1 = std::string("<10-10>");
std::string label2 = std::string("<2-1-10>");
std::array<std::string, 3>labels = getDefaultPoleFigureNames();
std::string label0 = labels[0];
std::string label1 = labels[1];
std::string label2 = labels[2];

if(!config.labels.empty())
{
label0 = config.labels.at(0);
Expand Down
6 changes: 6 additions & 0 deletions Source/EbsdLib/LaueOps/HexagonalOps.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,12 @@ class EbsdLib_EXPORT HexagonalOps : public LaueOps
*/
std::vector<EbsdLib::UInt8ArrayType::Pointer> generatePoleFigure(PoleFigureConfiguration_t& config) const override;

/**
* @brief Returns the names for each of the three standard pole figures that are generated. For example
*<001>, <011> and <111> for a cubic system
*/
std::array<std::string, 3> getDefaultPoleFigureNames() const override;

/**
* @brief generateStandardTriangle Generates an RGBA array that is a color "Standard" IPF Triangle Legend used for IPF Color Maps.
* @return
Expand Down
6 changes: 6 additions & 0 deletions Source/EbsdLib/LaueOps/LaueOps.h
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,12 @@ class EbsdLib_EXPORT LaueOps
*/
virtual std::vector<EbsdLib::UInt8ArrayType::Pointer> generatePoleFigure(PoleFigureConfiguration_t& config) const = 0;

/**
* @brief Returns the names for each of the three standard pole figures that are generated. For example
*<001>, <011> and <111> for a cubic system
*/
virtual std::array<std::string, 3> getDefaultPoleFigureNames() const = 0;

protected:
LaueOps();

Expand Down
16 changes: 13 additions & 3 deletions Source/EbsdLib/LaueOps/MonoclinicOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -669,14 +669,24 @@ EbsdLib::Rgb MonoclinicOps::generateRodriguesColor(double r1, double r2, double
return EbsdLib::RgbColor::dRgb(static_cast<int32_t>(red * 255), static_cast<int32_t>(green * 255), static_cast<int32_t>(blue * 255), 255);
}

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
std::array<std::string, 3> MonoclinicOps::getDefaultPoleFigureNames() const
{
return {"<001>", "<100>", "<010>"};
}

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
std::vector<EbsdLib::UInt8ArrayType::Pointer> MonoclinicOps::generatePoleFigure(PoleFigureConfiguration_t& config) const
{
std::string label0 = std::string("<001>");
std::string label1 = std::string("<100>");
std::string label2 = std::string("<010>");
std::array<std::string, 3>labels = getDefaultPoleFigureNames();
std::string label0 = labels[0];
std::string label1 = labels[1];
std::string label2 = labels[2];

if(!config.labels.empty())
{
label0 = config.labels.at(0);
Expand Down
6 changes: 6 additions & 0 deletions Source/EbsdLib/LaueOps/MonoclinicOps.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,12 @@ class EbsdLib_EXPORT MonoclinicOps : public LaueOps
*/
std::vector<EbsdLib::UInt8ArrayType::Pointer> generatePoleFigure(PoleFigureConfiguration_t& config) const override;

/**
* @brief Returns the names for each of the three standard pole figures that are generated. For example
*<001>, <011> and <111> for a cubic system
*/
std::array<std::string, 3> getDefaultPoleFigureNames() const override;

/**
* @brief generateStandardTriangle Generates an RGBA array that is a color "Standard" IPF Triangle Legend used for IPF Color Maps.
* @return
Expand Down
15 changes: 12 additions & 3 deletions Source/EbsdLib/LaueOps/OrthoRhombicOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -672,15 +672,24 @@ EbsdLib::Rgb OrthoRhombicOps::generateRodriguesColor(double r1, double r2, doubl
return EbsdLib::RgbColor::dRgb(static_cast<int32_t>(red * 255), static_cast<int32_t>(green * 255), static_cast<int32_t>(blue * 255), 255);
}

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
std::array<std::string, 3> OrthoRhombicOps::getDefaultPoleFigureNames() const
{
return {"<001>", "<100>", "<010>"};
}

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
std::vector<EbsdLib::UInt8ArrayType::Pointer> OrthoRhombicOps::generatePoleFigure(PoleFigureConfiguration_t& config) const
{
std::array<std::string, 3>labels = getDefaultPoleFigureNames();
std::string label0 = labels[0];
std::string label1 = labels[1];
std::string label2 = labels[2];

std::string label0 = std::string("<001>");
std::string label1 = std::string("<100>");
std::string label2 = std::string("<010>");
if(!config.labels.empty())
{
label0 = config.labels.at(0);
Expand Down
6 changes: 6 additions & 0 deletions Source/EbsdLib/LaueOps/OrthoRhombicOps.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,12 @@ class EbsdLib_EXPORT OrthoRhombicOps : public LaueOps
*/
std::vector<EbsdLib::UInt8ArrayType::Pointer> generatePoleFigure(PoleFigureConfiguration_t& config) const override;

/**
* @brief Returns the names for each of the three standard pole figures that are generated. For example
*<001>, <011> and <111> for a cubic system
*/
std::array<std::string, 3> getDefaultPoleFigureNames() const override;

/**
* @brief generateStandardTriangle Generates an RGBA array that is a color "Standard" IPF Triangle Legend used for IPF Color Maps.
* @return
Expand Down
16 changes: 13 additions & 3 deletions Source/EbsdLib/LaueOps/TetragonalLowOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -665,14 +665,24 @@ EbsdLib::Rgb TetragonalLowOps::generateRodriguesColor(double r1, double r2, doub
return EbsdLib::RgbColor::dRgb(static_cast<int32_t>(red * 255), static_cast<int32_t>(green * 255), static_cast<int32_t>(blue * 255), 255);
}

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
std::array<std::string, 3> TetragonalLowOps::getDefaultPoleFigureNames() const
{
return {"<001>", "<100>", "<010>"};
}

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
std::vector<EbsdLib::UInt8ArrayType::Pointer> TetragonalLowOps::generatePoleFigure(PoleFigureConfiguration_t& config) const
{
std::string label0 = std::string("<001>");
std::string label1 = std::string("<100>");
std::string label2 = std::string("<010>");
std::array<std::string, 3>labels = getDefaultPoleFigureNames();
std::string label0 = labels[0];
std::string label1 = labels[1];
std::string label2 = labels[2];

if(!config.labels.empty())
{
label0 = config.labels.at(0);
Expand Down
6 changes: 6 additions & 0 deletions Source/EbsdLib/LaueOps/TetragonalLowOps.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,12 @@ class EbsdLib_EXPORT TetragonalLowOps : public LaueOps
*/
std::vector<EbsdLib::UInt8ArrayType::Pointer> generatePoleFigure(PoleFigureConfiguration_t& config) const override;

/**
* @brief Returns the names for each of the three standard pole figures that are generated. For example
*<001>, <011> and <111> for a cubic system
*/
std::array<std::string, 3> getDefaultPoleFigureNames() const override;

/**
* @brief generateStandardTriangle Generates an RGBA array that is a color "Standard" IPF Triangle Legend used for IPF Color Maps.
* @return
Expand Down
16 changes: 13 additions & 3 deletions Source/EbsdLib/LaueOps/TetragonalOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -702,14 +702,24 @@ EbsdLib::Rgb TetragonalOps::generateRodriguesColor(double r1, double r2, double
return EbsdLib::RgbColor::dRgb(static_cast<int32_t>(red * 255), static_cast<int32_t>(green * 255), static_cast<int32_t>(blue * 255), 255);
}

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
std::array<std::string, 3> TetragonalOps::getDefaultPoleFigureNames() const
{
return {"<001>", "<100>", "<110>"};
}

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
std::vector<EbsdLib::UInt8ArrayType::Pointer> TetragonalOps::generatePoleFigure(PoleFigureConfiguration_t& config) const
{
std::string label0 = std::string("<001>");
std::string label1 = std::string("<100>");
std::string label2 = std::string("<110>");
std::array<std::string, 3>labels = getDefaultPoleFigureNames();
std::string label0 = labels[0];
std::string label1 = labels[1];
std::string label2 = labels[2];

if(!config.labels.empty())
{
label0 = config.labels.at(0);
Expand Down
6 changes: 6 additions & 0 deletions Source/EbsdLib/LaueOps/TetragonalOps.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,12 @@ class EbsdLib_EXPORT TetragonalOps : public LaueOps
*/
std::vector<EbsdLib::UInt8ArrayType::Pointer> generatePoleFigure(PoleFigureConfiguration_t& config) const override;

/**
* @brief Returns the names for each of the three standard pole figures that are generated. For example
*<001>, <011> and <111> for a cubic system
*/
std::array<std::string, 3> getDefaultPoleFigureNames() const override;

/**
* @brief generateStandardTriangle Generates an RGBA array that is a color "Standard" IPF Triangle Legend used for IPF Color Maps.
* @return
Expand Down
16 changes: 13 additions & 3 deletions Source/EbsdLib/LaueOps/TriclinicOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -664,14 +664,24 @@ EbsdLib::Rgb TriclinicOps::generateRodriguesColor(double r1, double r2, double r
return EbsdLib::RgbColor::dRgb(static_cast<int32_t>(red * 255), static_cast<int32_t>(green * 255), static_cast<int32_t>(blue * 255), 255);
}

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
std::array<std::string, 3> TriclinicOps::getDefaultPoleFigureNames() const
{
return {"<001>", "<100>", "<010>"};
}

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
std::vector<EbsdLib::UInt8ArrayType::Pointer> TriclinicOps::generatePoleFigure(PoleFigureConfiguration_t& config) const
{
std::string label0 = std::string("<001>");
std::string label1 = std::string("<100>");
std::string label2 = std::string("<010>");
std::array<std::string, 3>labels = getDefaultPoleFigureNames();
std::string label0 = labels[0];
std::string label1 = labels[1];
std::string label2 = labels[2];

if(!config.labels.empty())
{
label0 = config.labels.at(0);
Expand Down
6 changes: 6 additions & 0 deletions Source/EbsdLib/LaueOps/TriclinicOps.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,12 @@ class EbsdLib_EXPORT TriclinicOps : public LaueOps
*/
std::vector<EbsdLib::UInt8ArrayType::Pointer> generatePoleFigure(PoleFigureConfiguration_t& config) const override;

/**
* @brief Returns the names for each of the three standard pole figures that are generated. For example
*<001>, <011> and <111> for a cubic system
*/
std::array<std::string, 3> getDefaultPoleFigureNames() const override;

/**
* @brief generateStandardTriangle Generates an RGBA array that is a color "Standard" IPF Triangle Legend used for IPF Color Maps.
* @return
Expand Down

0 comments on commit ed67bc5

Please sign in to comment.