OpenVDB 12.0.0
 
Loading...
Searching...
No Matches
PointDelete.h
Go to the documentation of this file.
1// Copyright Contributors to the OpenVDB Project
2// SPDX-License-Identifier: Apache-2.0
3
4/// @author Nick Avramoussis, Francisco Gochez, Dan Bailey
5///
6/// @file PointDelete.h
7///
8/// @brief Methods for deleting points based on group membership
9
10#ifndef OPENVDB_POINTS_POINT_DELETE_HAS_BEEN_INCLUDED
11#define OPENVDB_POINTS_POINT_DELETE_HAS_BEEN_INCLUDED
12
13#include "PointDataGrid.h"
14#include "PointGroup.h"
15#include "IndexIterator.h"
16#include "IndexFilter.h"
17
18#include <openvdb/tools/Prune.h>
20#include <openvdb/util/Assert.h>
21
22#include <memory>
23#include <string>
24#include <vector>
25
26namespace openvdb {
28namespace OPENVDB_VERSION_NAME {
29namespace points {
30
31/// @brief Delete points that are members of specific groups
32///
33/// @details This method will delete points which are members of any of the supplied groups and
34/// will optionally drop the groups from the tree. An invert flag can be used to
35/// delete points that belong to none of the groups.
36///
37/// @param pointTree the point tree
38/// @param groups the groups from which to delete points
39/// @param invert if enabled, points not belonging to any of the groups will be deleted
40/// @param drop if enabled and invert is disabled, the groups will be dropped from the tree
41///
42/// @note If the invert flag is true, none of the groups will be dropped after deleting points
43/// regardless of the value of the drop parameter.
44
45template <typename PointDataTreeT>
46inline void deleteFromGroups(PointDataTreeT& pointTree,
47 const std::vector<std::string>& groups,
48 bool invert = false,
49 bool drop = true);
50
51/// @brief Delete points that are members of a group
52///
53/// @details This method will delete points which are members of the supplied group and will
54/// optionally drop the group from the tree. An invert flag can be used to
55/// delete points that belong to none of the groups.
56///
57/// @param pointTree the point tree with the group to delete
58/// @param group the name of the group to delete
59/// @param invert if enabled, points not belonging to any of the groups will be deleted
60/// @param drop if enabled and invert is disabled, the group will be dropped from the tree
61///
62/// @note If the invert flag is true, the group will not be dropped after deleting points
63/// regardless of the value of the drop parameter.
64
65template <typename PointDataTreeT>
66inline void deleteFromGroup(PointDataTreeT& pointTree,
67 const std::string& group,
68 bool invert = false,
69 bool drop = true);
70
71} // namespace points
72} // namespace OPENVDB_VERSION_NAME
73} // namespace openvdb
74
76
77#endif // OPENVDB_POINTS_POINT_DELETE_HAS_BEEN_INCLUDED
Index filters primarily designed to be used with a FilterIndexIter.
Index Iterators.
A LeafManager manages a linear array of pointers to a given tree's leaf nodes, as well as optional au...
Attribute-owned data structure for points. Point attributes are stored in leaf nodes and ordered by v...
Point group manipulation in a VDB Point Grid.
Defined various multi-threaded utility functions for trees.
void deleteFromGroups(PointDataTreeT &pointTree, const std::vector< std::string > &groups, bool invert=false, bool drop=true)
Delete points that are members of specific groups.
Definition PointDeleteImpl.h:136
void deleteFromGroup(PointDataTreeT &pointTree, const std::string &group, bool invert=false, bool drop=true)
Delete points that are members of a group.
Definition PointDeleteImpl.h:191
Definition Exceptions.h:13
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition version.h.in:121
#define OPENVDB_USE_VERSION_NAMESPACE
Definition version.h.in:218