diff --git a/register_selection_tools.cpp b/register_selection_tools.cpp index f3a5e39..ff0b2f6 100644 --- a/register_selection_tools.cpp +++ b/register_selection_tools.cpp @@ -152,6 +152,14 @@ void RegisterSelectionTools(ProMeshRegistry& reg, string baseGrp) "max deviation angle || value = 1D; min = 0D; max = 180D #" "select flipped edges || value = true", TOOLTIP_SELECT_EDGES_BY_DIRECTION) + .add_function("SelectSubsetEdgesByDirection", &SelectSubsetEdgesByDirection, grp, "", + "mesh #" + "subset index#" + "direction#" + "min deviation angle || value = 0D; min = 0D; max = 180D #" + "max deviation angle || value = 1D; min = 0D; max = 180D #" + "select flipped edges || value = true", + TOOLTIP_SELECT_SUBSET_EDGES_BY_DIRECTION) .add_function("SelectShortPolychains", &SelectShortPolychains, grp, "", "mesh # maxChainLength || min=0D; value=1D # closedChainsOnly", TOOLTIP_SELECT_SHORT_POLYCHAINS) diff --git a/tools/selection_tools.cpp b/tools/selection_tools.cpp index b40f371..2f00635 100644 --- a/tools/selection_tools.cpp +++ b/tools/selection_tools.cpp @@ -566,6 +566,21 @@ void SelectEdgesByDirection( maxDeviationAngle, selectFlipped); } +void SelectSubsetEdgesByDirection( + Mesh* m, + int subsetIndex, + const vector3& dir, + number minDeviationAngle, + number maxDeviationAngle, + bool selectFlipped) +{ + Selector& sel = m->selector(); + SubsetHandler& sh = m->subset_handler(); + Mesh::position_accessor_t aaPos = m->position_accessor(); + SelectSubsetEdgesByDirection(sel, sh, subsetIndex, aaPos, dir, minDeviationAngle, + maxDeviationAngle, selectFlipped); +} + //////////////////////////////////////////////////////////////////////////////// // FACES void SelectBoundaryFaces(Mesh* obj) diff --git a/tools/selection_tools.h b/tools/selection_tools.h index f9fa9ad..4dd102b 100644 --- a/tools/selection_tools.h +++ b/tools/selection_tools.h @@ -120,6 +120,7 @@ #define TOOLTIP_SELECT_ANISOTROPIC_ELEMENTS "Selects elements and associated long edges wich have a shortest-to-longest edge ratio smaller than the specified one." #define TOOLTIP_SELECT_ELEMENTS_BY_SPLIT_PLANE "Selects elements whose center lies in front of the specified plane." #define TOOLTIP_SELECT_EDGES_BY_DIRECTION "Selects all edges which do not deviate further from the specified direction than the given angle. A minimal required deviation angle can also be specified." +#define TOOLTIP_SELECT_SUBSET_EDGES_BY_DIRECTION "Selects all subset edges which do not deviate further from the specified direction than the given angle. A minimal required deviation angle can also be specified." #define TOOLTIP_SELECT_ELEMENTS_IN_COORDINATE_RANGE "Selects all elements whose center lies in the specified range." #define TOOLTIP_DESELECT_ELEMENTS_IN_COORDINATE_RANGE "Deselects all elements whose center lies in the specified range." #define TOOLTIP_SELECT_VERTEX_IN_BOX "Selects all vertices in the given box" @@ -323,6 +324,14 @@ void SelectEdgesByDirection( number maxDeviationAngle, bool selectFlipped); +void SelectSubsetEdgesByDirection( + Mesh* m, + int subsetIndex, + const vector3& dir, + number minDeviationAngle, + number maxDeviationAngle, + bool selectFlipped); + void SelectBoundaryFaces(Mesh* obj); void SelectInnerFaces(Mesh* obj);