Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,19 @@ class CalculateFaceIPFColorsImpl
const UInt32Array& m_CrystalStructures;
UInt8Array& m_FirstColors;
UInt8Array& m_SecondColors;
ebsdlib::ColorKeyKind m_ColorKey;

public:
CalculateFaceIPFColorsImpl(const Int32Array& labels, const Int32Array& phases, const Float64Array& normals, const Float32Array& eulers, const UInt32Array& crystalStructures, UInt8Array& firstColors,
UInt8Array& secondColors)
UInt8Array& secondColors, ebsdlib::ColorKeyKind colorKey)
: m_Labels(labels)
, m_Phases(phases)
, m_Normals(normals)
, m_Eulers(eulers)
, m_CrystalStructures(crystalStructures)
, m_FirstColors(firstColors)
, m_SecondColors(secondColors)
, m_ColorKey(colorKey)
{
}
virtual ~CalculateFaceIPFColorsImpl() = default;
Expand Down Expand Up @@ -92,7 +94,7 @@ class CalculateFaceIPFColorsImpl
refDir[1] = m_Normals[3 * i + 1];
refDir[2] = m_Normals[3 * i + 2];

argb = ops[m_CrystalStructures[phase1]]->generateIPFColor(dEuler, refDir, false);
argb = ops[m_CrystalStructures[phase1]]->generateIPFColor(dEuler, refDir, false, m_ColorKey);
m_FirstColors[3 * i] = RgbColor::dRed(argb);
m_FirstColors[3 * i + 1] = RgbColor::dGreen(argb);
m_FirstColors[3 * i + 2] = RgbColor::dBlue(argb);
Expand All @@ -118,7 +120,7 @@ class CalculateFaceIPFColorsImpl
refDir[1] = -m_Normals[3 * i + 1];
refDir[2] = -m_Normals[3 * i + 2];

argb = ops[m_CrystalStructures[phase1]]->generateIPFColor(dEuler, refDir, false);
argb = ops[m_CrystalStructures[phase1]]->generateIPFColor(dEuler, refDir, false, m_ColorKey);
m_SecondColors[3 * i + 0] = RgbColor::dRed(argb);
m_SecondColors[3 * i + 1] = RgbColor::dGreen(argb);
m_SecondColors[3 * i + 2] = RgbColor::dBlue(argb);
Expand Down Expand Up @@ -188,7 +190,7 @@ Result<> ComputeFaceIPFColoring::operator()()
ParallelDataAlgorithm parallelTask;
parallelTask.setRange(0, numTriangles);
parallelTask.requireArraysInMemory(algArrays);
parallelTask.execute(CalculateFaceIPFColorsImpl(faceLabels, phases, faceNormals, eulerAngles, crystalStructures, firstIpfColors, secondIpfColors));
parallelTask.execute(CalculateFaceIPFColorsImpl(faceLabels, phases, faceNormals, eulerAngles, crystalStructures, firstIpfColors, secondIpfColors, m_InputValues->ColorKey));

return {};
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#include "simplnx/Parameters/ArrayCreationParameter.hpp"
#include "simplnx/Parameters/ArraySelectionParameter.hpp"

#include <EbsdLib/Core/EbsdLibConstants.h>

namespace nx::core
{

Expand All @@ -20,6 +22,7 @@
DataPath CrystalStructuresArrayPath;
std::string FirstFaceIPFColorsArrayName;
std::string SecondFaceIPFColorsArrayName;
ebsdlib::ColorKeyKind ColorKey = ebsdlib::ColorKeyKind::TSL;

Check failure on line 25 in src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeFaceIPFColoring.hpp

View workflow job for this annotation

GitHub Actions / build (windows-2022, v143)

unexpected token(s) preceding ';' [D:\a\simplnx\simplnx\build\Plugins\OrientationAnalysis\OrientationAnalysis.vcxproj]

Check failure on line 25 in src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeFaceIPFColoring.hpp

View workflow job for this annotation

GitHub Actions / build (windows-2022, v143)

'TSL': is not a member of 'ebsdlib' [D:\a\simplnx\simplnx\build\Plugins\OrientationAnalysis\OrientationAnalysis.vcxproj]

Check failure on line 25 in src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeFaceIPFColoring.hpp

View workflow job for this annotation

GitHub Actions / build (windows-2022, v143)

'ColorKeyKind': the symbol to the left of a '::' must be a type [D:\a\simplnx\simplnx\build\Plugins\OrientationAnalysis\OrientationAnalysis.vcxproj]

Check failure on line 25 in src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeFaceIPFColoring.hpp

View workflow job for this annotation

GitHub Actions / build (windows-2022, v143)

syntax error: '=' [D:\a\simplnx\simplnx\build\Plugins\OrientationAnalysis\OrientationAnalysis.vcxproj]

Check failure on line 25 in src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeFaceIPFColoring.hpp

View workflow job for this annotation

GitHub Actions / build (windows-2022, v143)

'ColorKey': unknown override specifier [D:\a\simplnx\simplnx\build\Plugins\OrientationAnalysis\OrientationAnalysis.vcxproj]

Check failure on line 25 in src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeFaceIPFColoring.hpp

View workflow job for this annotation

GitHub Actions / build (windows-2022, v143)

'ColorKeyKind': is not a member of 'ebsdlib' [D:\a\simplnx\simplnx\build\Plugins\OrientationAnalysis\OrientationAnalysis.vcxproj]

Check failure on line 25 in src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeFaceIPFColoring.hpp

View workflow job for this annotation

GitHub Actions / build (ubuntu-22.04, clang++-14)

no type named 'ColorKeyKind' in namespace 'ebsdlib'

Check failure on line 25 in src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeFaceIPFColoring.hpp

View workflow job for this annotation

GitHub Actions / build (ubuntu-22.04, g++-11)

‘ColorKeyKind’ in namespace ‘ebsdlib’ does not name a type

Check failure on line 25 in src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeFaceIPFColoring.hpp

View workflow job for this annotation

GitHub Actions / build (macos-14)

no type named 'ColorKeyKind' in namespace 'ebsdlib'
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ComputeIPFColorsImpl
{
public:
ComputeIPFColorsImpl(ComputeIPFColors* filter, nx::core::FloatVec3 referenceDir, nx::core::Float32Array& eulers, nx::core::Int32Array& phases, nx::core::UInt32Array& crystalStructures,
int32_t numPhases, const nx::core::IDataArray* goodVoxels, nx::core::UInt8Array& colors)
int32_t numPhases, const nx::core::IDataArray* goodVoxels, nx::core::UInt8Array& colors, ebsdlib::ColorKeyKind colorKey)
: m_Filter(filter)
, m_ReferenceDir(referenceDir)
, m_CellEulerAngles(eulers.getDataStoreRef())
Expand All @@ -31,6 +31,7 @@ class ComputeIPFColorsImpl
, m_NumPhases(numPhases)
, m_GoodVoxels(goodVoxels)
, m_CellIPFColors(colors.getDataStoreRef())
, m_ColorKey(colorKey)
{
}

Expand Down Expand Up @@ -82,7 +83,7 @@ class ComputeIPFColorsImpl

if(phase < m_NumPhases && calcIPF && m_CrystalStructures[phase] < ebsdlib::CrystalStructure::LaueGroupEnd)
{
argb = ops[m_CrystalStructures[phase]]->generateIPFColor(dEuler.data(), refDir.data(), false);
argb = ops[m_CrystalStructures[phase]]->generateIPFColor(dEuler.data(), refDir.data(), false, m_ColorKey);
m_CellIPFColors.setValue(index, static_cast<uint8_t>(nx::core::RgbColor::dRed(argb)));
m_CellIPFColors.setValue(index + 1, static_cast<uint8_t>(nx::core::RgbColor::dGreen(argb)));
m_CellIPFColors.setValue(index + 2, static_cast<uint8_t>(nx::core::RgbColor::dBlue(argb)));
Expand Down Expand Up @@ -123,6 +124,7 @@ class ComputeIPFColorsImpl
int32_t m_NumPhases = 0;
const nx::core::IDataArray* m_GoodVoxels = nullptr;
nx::core::UInt8AbstractDataStore& m_CellIPFColors;
ebsdlib::ColorKeyKind m_ColorKey = ebsdlib::ColorKeyKind::TSL;
};
} // namespace

Expand Down Expand Up @@ -178,7 +180,7 @@ Result<> ComputeIPFColors::operator()()
dataAlg.setRange(0, totalPoints);
dataAlg.requireArraysInMemory(algArrays);

dataAlg.execute(ComputeIPFColorsImpl(this, normRefDir, eulers, phases, crystalStructures, numPhases, goodVoxelsArray, ipfColors));
dataAlg.execute(ComputeIPFColorsImpl(this, normRefDir, eulers, phases, crystalStructures, numPhases, goodVoxelsArray, ipfColors, m_InputValues->colorKey));

if(m_PhaseWarningCount > 0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#include "simplnx/DataStructure/IDataArray.hpp"
#include "simplnx/Filter/IFilter.hpp"

#include <EbsdLib/Core/EbsdLibConstants.h>

#include <vector>

namespace nx::core
Expand All @@ -25,6 +27,7 @@ struct ORIENTATIONANALYSIS_EXPORT ComputeIPFColorsInputValues
DataPath cellEulerAnglesArrayPath;
DataPath crystalStructuresArrayPath;
DataPath cellIpfColorsArrayPath;
ebsdlib::ColorKeyKind colorKey = ebsdlib::ColorKeyKind::TSL;
};

/**
Expand Down
Loading
Loading