Skip to content

Commit 940e6ad

Browse files
authored
Merge pull request #1509 from LLNL/feature/han12/2d_shaping
Initial 2D intersection shaping
2 parents 049c839 + efea85f commit 940e6ad

12 files changed

+1616
-350
lines changed

RELEASE-NOTES.md

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ to use Open Cascade's file I/O capabilities in support of Quest applications.
4242
of `loadExternalData` in `sidre::IOManager` and `sidre::Group`.
4343
- Adds intersection routines between `primal::Ray` objects and `primal::NURBSCurve`/`primal::NURBSPatch` objects.
4444
- Adds LineFileTagCombiner to Lumberjack to allow combining messages if line number, file, and tag are equal.
45+
- Adds some support for 2D shaping in `quest::IntersectionShaper`, using STL meshes with zero for z-coordinates or in-memory triangles as input.
4546

4647
### Changed
4748
- `primal::NumericArray` has been moved to `core`. The header is `core/NumericArray.hpp`.

src/axom/primal/geometry/Polygon.hpp

+21-4
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,28 @@ class Polygon
100100
~Polygon() { m_vertices.clear(); }
101101

102102
/*!
103-
* \brief Copy assignment operator for Polygon. Suppress CUDA warnings for
104-
* dynamic axom::Array.
103+
* \brief Copy assignment operator for Polygon (static array specialization).
104+
* Specializations are necessary to remove warnings.
105105
*/
106-
AXOM_SUPPRESS_HD_WARN
107-
AXOM_HOST_DEVICE
106+
template <PolygonArray P_ARRAY_TYPE = ARRAY_TYPE,
107+
std::enable_if_t<P_ARRAY_TYPE == PolygonArray::Static, int> = 0>
108+
AXOM_HOST_DEVICE Polygon& operator=(const Polygon& other)
109+
{
110+
if(this == &other)
111+
{
112+
return *this;
113+
}
114+
115+
m_vertices = other.m_vertices;
116+
return *this;
117+
}
118+
119+
/*!
120+
* \brief Copy assignment operator for Polygon.
121+
* (dynamic array specialization)
122+
*/
123+
template <PolygonArray P_ARRAY_TYPE = ARRAY_TYPE,
124+
std::enable_if_t<P_ARRAY_TYPE == PolygonArray::Dynamic, int> = 0>
108125
Polygon& operator=(const Polygon& other)
109126
{
110127
if(this == &other)

src/axom/primal/tests/primal_point.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,15 @@ void check_point_policy()
4141
//------------------------------------------------------------------------------
4242
TEST(primal_point, point_default_constructor)
4343
{
44-
static const int DIM = 2;
44+
static const int DIM = 3;
4545
using CoordType = double;
4646
using QPoint = primal::Point<CoordType, DIM>;
4747

4848
QPoint pt;
4949

5050
EXPECT_EQ(pt[0], CoordType());
51+
EXPECT_EQ(pt[1], CoordType());
52+
EXPECT_EQ(pt[2], CoordType());
5153
EXPECT_EQ(pt.dimension(), DIM);
5254
}
5355

src/axom/primal/tests/primal_surface_intersect.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ void checkIntersections(const primal::Ray<CoordType, 3>& ray,
9090
<< "\n\t" << ray << "\n\t" << patch;
9191

9292
sstr << "\ns (" << u.size() << "): ";
93-
for(auto i = 0u; i < u.size(); ++i)
93+
for(auto i = 0; i < u.size(); ++i)
9494
{
9595
sstr << std::setprecision(16) << "(" << u[i] << "," << v[i] << "),";
9696
}

0 commit comments

Comments
 (0)