-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Code is stubbed out only. Signed-off-by: Michael Jackson <[email protected]>
- Loading branch information
1 parent
a85bfd3
commit 44aac8f
Showing
9 changed files
with
488 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
src/Plugins/ComplexCore/docs/RemoveFlaggedTrianglesFilter.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Remove Flagged Triangles # | ||
|
||
## Group (Subgroup) ## | ||
|
||
Surface Meshing (Misc) | ||
|
||
## Description ## | ||
|
||
This **Filter** removes **Triangles** from the supplied **Triangle Geometry** that are flagged by a boolean mask array. | ||
Specifically, **Triangles** flagged as _true_ are removed from the **Geometry**. A new reduced **Triangle Geometry** is created | ||
that contains all the remaining **Triangles**. It is unknown until run time how many **Triangles** will be removed from the | ||
**Geometry**. Therefore, this **Filter** requires that a new **Data Container** be created to contain the reduced **Triangle Geometry**. | ||
This new **Data Container** will NOT contain copies of any **Feature** or **Ensemble** **Attribute Matrices** from the original **Data Container**. | ||
Additionally, all **Vertex** data will be copied, with tuples _removed_ for any **Vertices** removed by the **Filter**. | ||
The user must supply a name for the reduced **Data Container**. | ||
|
||
_Note:_ Since it cannot be known before run time how many **Vertices** will be removed, the new **Vertex Geometry** and | ||
all associated **Vertex** data to be copied will be initialized to have size 0. | ||
|
||
## Parameters ## | ||
|
||
None | ||
|
||
## Required Geometry ### | ||
|
||
**Triangle Geometry** | ||
|
||
## Required Objects ## | ||
|
||
| Kind | Default Name | Type | Component Dimensions | Description | | ||
|------|--------------|------|----------------------|---------------------------------------------------------------------| | ||
| **Data Container** | TriangleDataContainer | N/A | N/A | **Data Container** holding the **Triangle Geometry** to reduce | | ||
| **Triangle Attribute Array** | Mask | bool | (1) | Mask array specifying which **Triangles** to remove | | ||
|
||
## Created Objects ## | ||
|
||
| Kind | Default Name | Type | Component Dimensions | Description | | ||
|----------------------------|----------------------------|------|----------------------|------------------------------------------------------------| | ||
| Reduced **Data Container** | ReducedVertexDataContainer | N/A | N/A | **Data Container** holding the reduced **Vertex Geometry** | | ||
|
||
## Example Pipelines ## | ||
|
||
|
||
|
||
## License & Copyright ## | ||
|
||
Please see the description file distributed with this plugin. | ||
|
||
## DREAM3D Mailing Lists ## | ||
|
||
If you need more help with a filter, please consider asking your question on the DREAM3D Users mailing list: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
src/Plugins/ComplexCore/src/ComplexCore/Filters/Algorithms/RemoveFlaggedTriangles.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#include "RemoveFlaggedTriangles.hpp" | ||
|
||
#include "complex/DataStructure/DataArray.hpp" | ||
#include "complex/DataStructure/DataGroup.hpp" | ||
|
||
using namespace complex; | ||
|
||
// ----------------------------------------------------------------------------- | ||
RemoveFlaggedTriangles::RemoveFlaggedTriangles(DataStructure& dataStructure, const IFilter::MessageHandler& mesgHandler, const std::atomic_bool& shouldCancel, RemoveFlaggedTrianglesInputValues* inputValues) | ||
: m_DataStructure(dataStructure) | ||
, m_InputValues(inputValues) | ||
, m_ShouldCancel(shouldCancel) | ||
, m_MessageHandler(mesgHandler) | ||
{ | ||
} | ||
|
||
// ----------------------------------------------------------------------------- | ||
RemoveFlaggedTriangles::~RemoveFlaggedTriangles() noexcept = default; | ||
|
||
// ----------------------------------------------------------------------------- | ||
const std::atomic_bool& RemoveFlaggedTriangles::getCancel() | ||
{ | ||
return m_ShouldCancel; | ||
} | ||
|
||
// ----------------------------------------------------------------------------- | ||
Result<> RemoveFlaggedTriangles::operator()() | ||
{ | ||
/** | ||
* This section of the code should contain the actual algorithmic codes that | ||
* will accomplish the goal of the file. | ||
* | ||
* If you can parallelize the code there are a number of examples on how to do that. | ||
* GenerateIPFColors is one example | ||
* | ||
* If you need to determine what kind of array you have (Int32Array, Float32Array, etc) | ||
* look to the ExecuteDataFunction() in complex/Utilities/FilterUtilities.hpp template | ||
* function to help with that code. | ||
* An Example algorithm class is `CombineAttributeArrays` and `RemoveFlaggedVertices` | ||
* | ||
* There are other utility classes that can help alleviate the amount of code that needs | ||
* to be written. | ||
* | ||
* REMOVE THIS COMMENT BLOCK WHEN YOU ARE FINISHED WITH THE FILTER_HUMAN_NAME | ||
*/ | ||
|
||
return {}; | ||
} |
66 changes: 66 additions & 0 deletions
66
src/Plugins/ComplexCore/src/ComplexCore/Filters/Algorithms/RemoveFlaggedTriangles.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#pragma once | ||
|
||
#include "ComplexCore/ComplexCore_export.hpp" | ||
|
||
#include "complex/DataStructure/DataPath.hpp" | ||
#include "complex/DataStructure/DataStructure.hpp" | ||
#include "complex/Filter/IFilter.hpp" | ||
#include "complex/Parameters/DataGroupSelectionParameter.hpp" | ||
#include "complex/Parameters/ArraySelectionParameter.hpp" | ||
#include "complex/Parameters/ArraySelectionParameter.hpp" | ||
#include "complex/Parameters/StringParameter.hpp" | ||
|
||
|
||
/** | ||
* This is example code to put in the Execute Method of the filter. | ||
RemoveFlaggedTrianglesInputValues inputValues; | ||
inputValues.TriangleGeometry = filterArgs.value<DataPath>(k_TriangleGeometry_Key); | ||
inputValues.MaskArrayPath = filterArgs.value<DataPath>(k_MaskArrayPath_Key); | ||
inputValues.RegionIDsArrayPath = filterArgs.value<DataPath>(k_RegionIDsArrayPath_Key); | ||
inputValues.ReducedTriangleGeometry = filterArgs.value<StringParameter::ValueType>(k_ReducedTriangleGeometry_Key); | ||
return RemoveFlaggedTriangles(dataStructure, messageHandler, shouldCancel, &inputValues)(); | ||
*/ | ||
|
||
namespace complex | ||
{ | ||
|
||
struct COMPLEXCORE_EXPORT RemoveFlaggedTrianglesInputValues | ||
{ | ||
DataPath TriangleGeometry; | ||
DataPath MaskArrayPath; | ||
DataPath RegionIDsArrayPath; | ||
StringParameter::ValueType ReducedTriangleGeometry; | ||
|
||
}; | ||
|
||
/** | ||
* @class ConditionalSetValue | ||
* @brief This filter replaces values in the target array with a user specified value | ||
* where a bool mask array specifies. | ||
*/ | ||
|
||
class COMPLEXCORE_EXPORT RemoveFlaggedTriangles | ||
{ | ||
public: | ||
RemoveFlaggedTriangles(DataStructure& dataStructure, const IFilter::MessageHandler& mesgHandler, const std::atomic_bool& shouldCancel, RemoveFlaggedTrianglesInputValues* inputValues); | ||
~RemoveFlaggedTriangles() noexcept; | ||
|
||
RemoveFlaggedTriangles(const RemoveFlaggedTriangles&) = delete; | ||
RemoveFlaggedTriangles(RemoveFlaggedTriangles&&) noexcept = delete; | ||
RemoveFlaggedTriangles& operator=(const RemoveFlaggedTriangles&) = delete; | ||
RemoveFlaggedTriangles& operator=(RemoveFlaggedTriangles&&) noexcept = delete; | ||
|
||
Result<> operator()(); | ||
|
||
const std::atomic_bool& getCancel(); | ||
|
||
private: | ||
DataStructure& m_DataStructure; | ||
const RemoveFlaggedTrianglesInputValues* m_InputValues = nullptr; | ||
const std::atomic_bool& m_ShouldCancel; | ||
const IFilter::MessageHandler& m_MessageHandler; | ||
}; | ||
|
||
} // namespace complex |
Oops, something went wrong.