AGX Dynamics
2.37.3.2
AnalysisBox.h
Go to the documentation of this file.
1
/*
2
Copyright 2007-2024. 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 having been
9
advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10
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
#ifndef AGX_ANALYSISBOX_H
18
#define AGX_ANALYSISBOX_H
19
20
#include <
agx/Referenced.h
>
21
#include <
agx/Bound.h
>
22
#include <
agxSDK/Simulation.h
>
23
24
namespace
agx
25
{
26
AGX_DECLARE_POINTER_TYPES
(
AnalysisBox
);
27
31
class
AGXPHYSICS_EXPORT
AnalysisBox
:
public
agx::Referenced
32
{
33
public
:
34
typedef
HashSet<agx::Index>
ParticleIdSet
;
35
36
public
:
44
AnalysisBox
(
agxSDK::Simulation
* simulation,
const
agx::Vec3
& center,
const
agx::Vec3
& halfVec);
45
47
void
updateContents();
48
50
void
setAnalysisBound(
const
agx::Vec3
& center,
const
agx::Vec3
& halfVec);
51
53
agx::Bound3
getAnalysisBound()
const
;
54
56
Real
getParticleMassInsideBound();
57
59
ParticleIdSet getParticlesInside()
const
;
60
62
bool
containsParticle(
agx::Index
particleId)
const
;
63
65
bool
containsPoint(
const
agx::Vec3
& point);
66
68
bool
getEnable()
const
;
69
71
void
setEnable(
bool
enable);
72
74
agx::Vec3
getBoundCenter();
75
77
agx::Vec3
getBoundHalfVec();
78
79
void
printContents();
80
81
protected
:
83
virtual
~
AnalysisBox
();
84
void
updateBound(
const
agx::Vec3
& center,
const
agx::Vec3
& halfVec);
85
86
agx::ParticleSystem
* getParticleSystem();
87
89
// Variables
91
protected
:
92
agxSDK::Simulation
*
m_simulation
;
93
agx::Bound3
m_bound
;
94
RigidBodyPtrVector
m_rigidBodiesInside
;
95
ParticleIdSet
m_particleIdsInside
;
96
bool
m_enabled
;
97
};
98
99
AGX_FORCE_INLINE
agx::Bound3
AnalysisBox::getAnalysisBound
()
const
{
return
m_bound; }
100
101
AGX_FORCE_INLINE
agx::AnalysisBox::ParticleIdSet
AnalysisBox::getParticlesInside
()
const
{
return
m_particleIdsInside; }
102
103
AGX_FORCE_INLINE
bool
AnalysisBox::getEnable
()
const
{
return
m_enabled; }
104
105
AGX_FORCE_INLINE
void
AnalysisBox::setEnable
(
bool
enable) { m_enabled = enable; }
106
}
107
108
#endif
agx::AnalysisBox::m_bound
agx::Bound3 m_bound
Definition:
AnalysisBox.h:93
agx::BoundT< Vec3 >
agx::HashSet< agx::Index >
agx::AnalysisBox::setEnable
void setEnable(bool enable)
Set true/false to enable/enable the Analysis Box.
Definition:
AnalysisBox.h:105
AGXPHYSICS_EXPORT
#define AGXPHYSICS_EXPORT
AGX_DECLARE_POINTER_TYPES
#define AGX_DECLARE_POINTER_TYPES(type)
Definition:
Referenced.h:254
agx::AnalysisBox::m_rigidBodiesInside
RigidBodyPtrVector m_rigidBodiesInside
Definition:
AnalysisBox.h:94
AGX_FORCE_INLINE
#define AGX_FORCE_INLINE
Definition:
Object.h:59
agx::AnalysisBox::getAnalysisBound
agx::Bound3 getAnalysisBound() const
Get the bound of the Analysis Box.
Definition:
AnalysisBox.h:99
agx::Referenced
Base class providing referencing counted objects.
Definition:
Referenced.h:119
agx::ParticleSystem
A basic particle system that contains all the storages and buffers required for basic operation and a...
Definition:
ParticleSystem.h:67
agx::VectorPOD
Vector containing 'raw' data.
Definition:
Vector.h:245
agx
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Definition:
AddedMassInteraction.h:22
agx::AnalysisBox::getEnable
bool getEnable() const
Return true/false if the box is enabled.
Definition:
AnalysisBox.h:103
agx::Index
UInt32 Index
Definition:
Integer.h:52
Referenced.h
agx::AnalysisBox
Class that can be used to extract data from elements in a simulation within a specified bound...
Definition:
AnalysisBox.h:31
agx::Vec3T< Real >
Bound.h
Simulation.h
agxSDK::Simulation
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition:
Simulation.h:126
agx::AnalysisBox::m_particleIdsInside
ParticleIdSet m_particleIdsInside
Definition:
AnalysisBox.h:95
agx::AnalysisBox::ParticleIdSet
HashSet< agx::Index > ParticleIdSet
Definition:
AnalysisBox.h:34
agx::Real
double Real
Definition:
Real.h:42
agx::AnalysisBox::m_simulation
agxSDK::Simulation * m_simulation
Definition:
AnalysisBox.h:92
agx::AnalysisBox::m_enabled
bool m_enabled
Definition:
AnalysisBox.h:96
agx::AnalysisBox::getParticlesInside
ParticleIdSet getParticlesInside() const
Returns the particles ids inside the Analysis Box.
Definition:
AnalysisBox.h:101
include
agx
AnalysisBox.h
Generated on Fri Apr 12 2024 12:40:20 for AGX Dynamics by
1.8.13