-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '466-add-local_switch_tuple-for-edgemesh' of https://git…
…hub.com/wildmeshing/wildmeshing-toolkit into 434-edgemesh-to-trimesh-multimesh-register
- Loading branch information
Showing
9 changed files
with
98 additions
and
11 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
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,17 @@ | ||
|
||
#include "is_ccw.hpp" | ||
#include <cassert> | ||
#include <wmtk/utils/TupleInspector.hpp> | ||
|
||
namespace wmtk::autogen::edge_mesh { | ||
bool is_ccw(const Tuple& tuple) | ||
{ | ||
assert(tuple_is_valid_for_ccw(tuple)); | ||
using namespace utils; | ||
return TupleInspector::local_vid(tuple) == 0; | ||
} | ||
bool tuple_is_valid_for_ccw(const Tuple& tuple) | ||
{ | ||
return true; | ||
} | ||
} // namespace wmtk::autogen::edge_mesh |
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,8 @@ | ||
#pragma once | ||
#include <wmtk/Tuple.hpp> | ||
|
||
namespace wmtk::autogen::edge_mesh { | ||
bool is_ccw(const Tuple& t); | ||
// validates whether the tuple local ids are valid for computing ccw'ness | ||
bool tuple_is_valid_for_ccw(const Tuple& t); | ||
} // namespace wmtk::autogen::edge_mesh |
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,27 @@ | ||
#include "local_switch_tuple.hpp" | ||
#include <stdexcept> | ||
#include <wmtk/utils/TupleInspector.hpp> | ||
|
||
namespace wmtk::autogen::edge_mesh { | ||
Tuple local_switch_tuple(const Tuple& tuple, PrimitiveType pt) | ||
{ | ||
using namespace utils; | ||
const long global_cid = TupleInspector::global_cid(tuple); | ||
const long hash = TupleInspector::hash(tuple); | ||
switch (pt) { | ||
case PrimitiveType::Vertex: | ||
return Tuple( | ||
1 - TupleInspector::local_vid(tuple), | ||
TupleInspector::local_eid(tuple), | ||
TupleInspector::local_fid(tuple), | ||
global_cid, | ||
hash); | ||
|
||
case PrimitiveType::Edge: | ||
case PrimitiveType::Face: | ||
case PrimitiveType::Tetrahedron: | ||
default: throw std::runtime_error("Tuple switch: Invalid primitive type"); break; | ||
} | ||
return Tuple(); | ||
} | ||
} // namespace wmtk::autogen::edge_mesh |
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,7 @@ | ||
#pragma once | ||
#include <wmtk/Primitive.hpp> | ||
#include <wmtk/Tuple.hpp> | ||
|
||
namespace wmtk::autogen::edge_mesh { | ||
Tuple local_switch_tuple(const Tuple& t, PrimitiveType pt); | ||
} |
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
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
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
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