AGX Dynamics  2.35.0.1
MergeIgnoreFilter.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or
9 having been advised so by Algoryx Simulation AB for a time limited evaluation,
10 or having purchased a valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #pragma once
18 
19 #include <agx/HashSet.h>
22 #include <agxStream/InputArchive.h>
23 
24 
25 namespace agxSDK
26 {
33  {
34  public:
41  void addRejection(agx::UInt32 group1, agx::UInt32 group2);
42 
49  void removeRejection(agx::UInt32 group1, agx::UInt32 group2);
50 
51 
59  agx::Bool rejects(agx::UInt32 group1, agx::UInt32 group2) const;
60 
68  agx::Bool rejects(const agx::UInt32Vector& groups1, const agx::UInt32Vector& groups2) const;
69 
70  void store(agxStream::OutputArchive& archive) const;
72 
73  public:
79  static agx::UInt32 nameToId(const agx::Name& name);
80 
87 
93 
94 
95  private:
96  // Set of pairs of UInt32 groups IDs, each pair stored with the smallest
97  // group ID in the high half of the UInt64 and the higher group ID in the
98  // low half.
99  agx::HashSet<agx::UInt64> m_rejectPairs;
100  };
101 }
#define AGXPHYSICS_EXPORT
A collection of merge ignore group ID pairs for which merge should be rejected.
void removeRejection(agx::UInt32 group1, agx::UInt32 group2)
Forget a previously added rejection pair.
static agx::Bool isNameId(agx::UInt32 id)
Check if the given group ID corresponds to a named group.
agx::Bool rejects(agx::UInt32 group1, agx::UInt32 group2) const
Check if the given group pair is on the rejection list.
static agx::UInt32 nameToId(const agx::Name &name)
Compute the group ID that corresponds to the given group name.
void store(agxStream::OutputArchive &archive) const
agx::Bool rejects(const agx::UInt32Vector &groups1, const agx::UInt32Vector &groups2) const
Check if there is any pair in the cartesian product of the given group lists for which a rejection ha...
static const agx::UInt32 MAX_UNAMED_GROUP_ID
The maximum ID that may be used to create an unamed group.
void restore(agxStream::InputArchive &archive)
void addRejection(agx::UInt32 group1, agx::UInt32 group2)
Add a rejection for the given group pair.
Class for reading a binary stream of serialized data.
Definition: InputArchive.h:52
Class for writing serialized data in binary format to a stream.
Definition: OutputArchive.h:57
Representation of a name string.
Definition: Name.h:33
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:31
uint32_t UInt32
Definition: Integer.h:40
bool Bool
Definition: Integer.h:48