Commit a24902e2 authored by T.J. Corona's avatar T.J. Corona
Browse files

Mesh - ExtractTessellation: use edge uses

parent 6a3e33f5
......@@ -664,6 +664,9 @@ void extractOrderedTessellation( const OneDimensionalEntities& oneDimEntities,
for (auto ent=oneDimEntities.cbegin(); ent != oneDimEntities.cend(); ++ent)
{
// Grab the orientation of the entity
int orientation = ent->orientation();
// Collect the cells associated with the edge connected to the edge use
CellSet cs = c->findAssociatedCells(*ent);
......@@ -683,8 +686,16 @@ void extractOrderedTessellation( const OneDimensionalEntities& oneDimEntities,
for (pc.initCellTraversal(); pc.fetchNextCell(numPts, pointIds);)
{
// ... we construct a link and add it to our ordered loop.
link.Handles[0] = ps.find( pointIds[0] );
link.Handles[1] = ps.find( pointIds[1] );
if (orientation == 1)
{
link.Handles[0] = ps.find( pointIds[0] );
link.Handles[1] = ps.find( pointIds[1] );
}
else
{
link.Handles[0] = ps.find( pointIds[1] );
link.Handles[1] = ps.find( pointIds[0] );
}
orderedEdge.insert_link(link);
}
orderedEdge.merge_chains();
......@@ -697,13 +708,13 @@ void extractOrderedTessellation( const OneDimensionalEntities& oneDimEntities,
}
}
void extractOrderedTessellation( const smtk::model::Edge& edge,
void extractOrderedTessellation( const smtk::model::EdgeUse& edgeUse,
const smtk::mesh::CollectionPtr& c,
PreAllocatedTessellation& tess)
{
// Collect the cells associated with the edge
smtk::mesh::CellSet cells = c->findAssociatedCells(edge);
extractOrderedTessellation(edge,c,cells.points(),tess);
smtk::mesh::CellSet cells = c->findAssociatedCells(edgeUse.edge());
extractOrderedTessellation(edgeUse,c,cells.points(),tess);
}
void extractOrderedTessellation( const smtk::model::Loop& loop,
......@@ -714,10 +725,10 @@ void extractOrderedTessellation( const smtk::model::Loop& loop,
smtk::mesh::CellSet cells(c,cellRange);
// Grab the edge uses from the loop.
smtk::model::EdgeUses euses = loop.edgeUses();
smtk::model::EdgeUses edgeUses = loop.edgeUses();
// Loop over the edge uses
for (auto eu=euses.crbegin(); eu!=euses.crend(); ++eu)
for (auto eu=edgeUses.crbegin(); eu!=edgeUses.crend(); ++eu)
{
// Collect the cells associated with the edge connected to the edge use
cells = set_union(cells, c->findAssociatedCells(eu->edge()));
......@@ -726,14 +737,14 @@ void extractOrderedTessellation( const smtk::model::Loop& loop,
extractOrderedTessellation(loop,c,cells.points(),tess);
}
void extractOrderedTessellation( const smtk::model::Edge& edge,
void extractOrderedTessellation( const smtk::model::EdgeUse& edgeUse,
const smtk::mesh::CollectionPtr& c,
const smtk::mesh::PointSet& ps,
PreAllocatedTessellation& tess)
{
smtk::model::Edges edges;
edges.push_back(edge);
extractOrderedTessellation<smtk::model::Edges>(edges,c,ps,tess);
smtk::model::EdgeUses edgeUses;
edgeUses.push_back(edgeUse);
extractOrderedTessellation<smtk::model::EdgeUses>(edgeUses,c,ps,tess);
}
void extractOrderedTessellation( const smtk::model::Loop& loop,
......@@ -742,13 +753,7 @@ void extractOrderedTessellation( const smtk::model::Loop& loop,
PreAllocatedTessellation& tess)
{
smtk::model::EdgeUses euses = loop.edgeUses();
smtk::model::Edges edges;
for (auto eu=euses.cbegin(); eu!=euses.cend(); ++eu)
{
edges.push_back(eu->edge());
}
extractOrderedTessellation<smtk::model::Edges>(edges,c,ps,tess);
extractOrderedTessellation<smtk::model::EdgeUses>(euses,c,ps,tess);
}
}
......
......@@ -167,7 +167,7 @@ SMTKCORE_EXPORT void extractTessellation( const smtk::model::EntityRef&,
const smtk::mesh::CollectionPtr&,
PreAllocatedTessellation& );
SMTKCORE_EXPORT void extractOrderedTessellation(
const smtk::model::Edge&,
const smtk::model::EdgeUse&,
const smtk::mesh::CollectionPtr&,
PreAllocatedTessellation& );
SMTKCORE_EXPORT void extractOrderedTessellation(
......@@ -192,7 +192,7 @@ SMTKCORE_EXPORT void extractTessellation( const smtk::model::EntityRef&,
const smtk::mesh::PointSet&,
PreAllocatedTessellation& );
SMTKCORE_EXPORT void extractOrderedTessellation(
const smtk::model::Edge&,
const smtk::model::EdgeUse&,
const smtk::mesh::CollectionPtr&,
const smtk::mesh::PointSet&,
PreAllocatedTessellation& );
......
......@@ -15,7 +15,7 @@
#include "smtk/mesh/ExtractTessellation.h"
#include "smtk/model/Edge.h"
#include "smtk/model/EdgeUse.h"
#include "smtk/model/Loop.h"
namespace py = pybind11;
......@@ -73,7 +73,7 @@ PySharedPtrClass< smtk::mesh::Tessellation > pybind11_init_smtk_mesh_Tessellatio
void pybind11_init__ZN4smtk4mesh26extractOrderedTessellationERKNS_5model4EdgeERKNSt3__110shared_ptrINS0_10CollectionEEERNS0_24PreAllocatedTessellationE(py::module &m)
{
m.def("extractOrderedTessellation", (void (*)(::smtk::model::Edge const &, ::smtk::mesh::CollectionPtr const &, ::smtk::mesh::PreAllocatedTessellation &)) &smtk::mesh::extractOrderedTessellation, "", py::arg("arg0"), py::arg("arg1"), py::arg("arg2"));
m.def("extractOrderedTessellation", (void (*)(::smtk::model::EdgeUse const &, ::smtk::mesh::CollectionPtr const &, ::smtk::mesh::PreAllocatedTessellation &)) &smtk::mesh::extractOrderedTessellation, "", py::arg("arg0"), py::arg("arg1"), py::arg("arg2"));
}
void pybind11_init__ZN4smtk4mesh26extractOrderedTessellationERKNS_5model4LoopERKNSt3__110shared_ptrINS0_10CollectionEEERNS0_24PreAllocatedTessellationE(py::module &m)
......@@ -83,7 +83,7 @@ void pybind11_init__ZN4smtk4mesh26extractOrderedTessellationERKNS_5model4LoopERK
void pybind11_init__ZN4smtk4mesh26extractOrderedTessellationERKNS_5model4EdgeERKNSt3__110shared_ptrINS0_10CollectionEEERKNS0_8PointSetERNS0_24PreAllocatedTessellationE(py::module &m)
{
m.def("extractOrderedTessellation", (void (*)(::smtk::model::Edge const &, ::smtk::mesh::CollectionPtr const &, ::smtk::mesh::PointSet const &, ::smtk::mesh::PreAllocatedTessellation &)) &smtk::mesh::extractOrderedTessellation, "", py::arg("arg0"), py::arg("arg1"), py::arg("arg2"), py::arg("arg3"));
m.def("extractOrderedTessellation", (void (*)(::smtk::model::EdgeUse const &, ::smtk::mesh::CollectionPtr const &, ::smtk::mesh::PointSet const &, ::smtk::mesh::PreAllocatedTessellation &)) &smtk::mesh::extractOrderedTessellation, "", py::arg("arg0"), py::arg("arg1"), py::arg("arg2"), py::arg("arg3"));
}
void pybind11_init__ZN4smtk4mesh26extractOrderedTessellationERKNS_5model4LoopERKNSt3__110shared_ptrINS0_10CollectionEEERKNS0_8PointSetERNS0_24PreAllocatedTessellationE(py::module &m)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment