Skip to content

Commit

Permalink
Extend the FindSizes filter to operate on any geometry
Browse files Browse the repository at this point in the history
The FindSizes filter will now operator on feature that belong to any geometry.
Update the documentation to reflect the new functionality. Also add a unit
test to ensure the filter functions properly for all geometries.

This extension requires the additions for SIMPL for IGeometry element sizes.
To break a circular dependence, the API of GeometryMath had to include forward
declares, so places where that API was used (e.g., SampleSurfaceMes) have been
updated to reflect this.
  • Loading branch information
Donegan Sean P Civ USAF AFMC AFRL/RXCM committed Oct 19, 2016
1 parent bf2f636 commit 0491262
Show file tree
Hide file tree
Showing 8 changed files with 681 additions and 91 deletions.
6 changes: 3 additions & 3 deletions Source/Plugins/Sampling/SamplingFilters/SampleSurfaceMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class SampleSurfaceMeshImpl
for(size_t iter = start; iter < end; iter++)
{
// find bounding box for current feature
GeometryMath::FindBoundingBoxOfFaces(m_Faces, m_FaceIds->getElementList(iter), ll, ur);
GeometryMath::FindBoundingBoxOfFaces(m_Faces.get(), m_FaceIds->getElementList(iter), ll, ur);
GeometryMath::FindDistanceBetweenPoints(ll, ur, radius);

// check points in vertex array to see if they are in the bounding box of the feature
Expand All @@ -103,7 +103,7 @@ class SampleSurfaceMeshImpl
point = m_Points->getVertexPointer(i);
if(m_PolyIds[i] == 0 && GeometryMath::PointInBox(point, ll, ur) == true)
{
code = GeometryMath::PointInPolyhedron(m_Faces, m_FaceIds->getElementList(iter), m_FaceBBs, point, ll, ur, radius, distToBoundary);
code = GeometryMath::PointInPolyhedron(m_Faces.get(), m_FaceIds->getElementList(iter), m_FaceBBs.get(), point, ll, ur, radius, distToBoundary);
if(code == 'i' || code == 'V' || code == 'E' || code == 'F')
{
m_PolyIds[i] = iter;
Expand Down Expand Up @@ -329,7 +329,7 @@ void SampleSurfaceMesh::execute()
faceLists->insertCellReference(g2, (linkLoc[g2])++, i);
}
// find bounding box for each face
GeometryMath::FindBoundingBoxOfFace(triangleGeom, i, ll, ur);
GeometryMath::FindBoundingBoxOfFace(triangleGeom.get(), i, ll, ur);
faceBBs->setCoords(2 * i, ll);
faceBBs->setCoords(2 * i + 1, ur);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,30 @@ Find Feature Sizes {#findsizes}
Statistics (Morphological)

## Description ##
This **Filter** calculates the sizes of all **Features**. The **Filter** simply iterates through all **Cells** querying for the **Feature** that owns them and keeping a tally for each **Feature**. The tally is then stored as *NumCells* and the *Volume* and *EquivalentDiameter* are also calculated (and stored) by knowing the volume of each **Cell**.
This **Filter** calculates the sizes of all **Features**. The **Filter** simply iterates through all **Elements** querying for the **Feature** that owns them and keeping a tally for each **Feature**. The tally is then stored as *NumElements* and the *Volume* and *EquivalentDiameter* are also calculated (and stored) by knowing the volume of each **Element**.

During the computation of the **Feature** sizes, the size of each individual **Element** is computed and stored in the corresponding **Geometry**. By default, these sizes are deleted after executing the **Filter** to save memory. If you wish to store the **Element** sizes, select the *Save Element Sizes* option. The sizes will be stored within the **Geometry** definition itself, not as a separate **Attribute Array**.

## Parameters ##
None
| Name | Type | Description |
|------|------| ----------- |
| Save Element Sizes | bool | Whether the to store the individual **Element** sizes |

## Required Geometry ##
Image
Not Applicable

## Required Objects ##
| Kind | Default Name | Type | Component Dimensions | Description |
|------|--------------|-------------|---------|-----|
| **Cell Attribute Array** | FeatureIds | int32_t | (1) | Specifies to which **Feature** each **Cell** belongs |
| **Attribute Matrix** | CellFeatureData | Cell Feature | N/A | **Feature Attribute Matrix** of the selected _Feature Ids_ |
| **Element Attribute Array** | FeatureIds | int32_t | (1) | Specifies to which **Feature** each **Element** belongs |
| **Attribute Matrix** | FeatureData | Feature | N/A | **Feature Attribute Matrix** of the selected _Feature Ids_ |

## Created Objects ##
| Kind | Default Name | Type | Component Dimensions | Description |
|------|--------------|-------------|---------|-----|
| **Feature Attribute Array** | EquivalentDiameters | float | (1) | Diameter of a sphere with the same volume as the **Feature** |
| **Feature Attribute Array** | NumCells | int32_t | (1) | Number of **Cells** that are owned by the **Feature**. This value does not place any distinction between **Cells** that may be of a different size |
| **Feature Attribute Array** | Volumes | float | (1) | Volume of the **Feature**. This value may be "redundant" from the NumCells value if all **Cells** are the same size and is calculable from the EquivalentDiameters value |
| **Feature Attribute Array** | NumElements | int32_t | (1) | Number of **Elements** that are owned by the **Feature**. This value does not place any distinction between **Elements** that may be of a different size |
| **Feature Attribute Array** | Volumes | float | (1) | Volume of the **Feature**. This value may be "redundant" from the NumElements value if all **Elements** are the same size and is calculable from the EquivalentDiameters value |

## License & Copyright ##

Expand Down
Loading

0 comments on commit 0491262

Please sign in to comment.