Momentum Scripting v1
Loading...
Searching...
No Matches
Emitter.h
1/*
2Copyright 2007-2025. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material without having a written signed agreement with Algoryx Simulation AB.
9
10Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
11from using this software, unless otherwise stated in written agreements with
12Algoryx Simulation AB.
13*/
14#ifndef MOMENTUM_EMITTER_H
15#define MOMENTUM_EMITTER_H
16
17#include "momentum_namespace.h"
18#include "momentum_export.h"
19#include "macros.h"
20
21#include <string>
22
23#include "Vec3.h"
24#include "Vec4.h"
25
26#ifndef SWIG
28namespace agx
29{
30 class Emitter;
31}
33#endif
34
35namespace MOMENTUM_NAMESPACE
36{
37 class Geometry;
38 class BodyDistribution;
39 class ParticleDistribution;
40
44 class MOMENTUM_EXPORT Emitter
45 {
46 public:
53 {
54 PARTICLES=0,
55 RIGID_BODIES=1
56 };
57
58 public:
60 Emitter();
62#ifndef SWIG
64
67 Emitter(agx::Emitter*);
69#endif
70
76 double getMassFlowRate() const;
77
83 double getEmittedMass() const;
84
89 unsigned int getNumEmittedBodies() const;
90
95 Vec4 getColor() const;
96
101 std::shared_ptr<Geometry> getEmitterGeometry() const;
102
108
114
120 std::shared_ptr< BodyDistribution > getBodyDistribution() const;
121
127 std::shared_ptr< ParticleDistribution > getParticleDistribution() const;
128
135 bool getUseFixedPosition( agx::Int axis ) const;
136
143 bool getUseFixedRotation( agx::Int axis ) const;
144
145#ifndef AGX_MOMENTUM_ANALYSIS_API
146
156 void setUseFixedPosition( bool enable, agx::Int axis );
157
158
169 void setUseFixedRotation( bool enable, agx::Int axis );
170
178 void setMassFlowRate(double rate);
179
188 void setMaximumAllowedEmittedMass(double maximumMass);
189
196 void setColor(const Vec4& color);
197
204 void setVelocity(const Vec3& velocity);
205
214 bool addCollisionGroup(const std::string& name);
215
221 bool removeCollisionGroup(const std::string& name);
222
223#endif
224
230 bool hasCollisionGroup(const std::string& name) const;
231
236 std::vector<std::string> getCollisionGroups() const;
237
242 std::string getName() const;
243
245 std::string __str__() const;
247
248#ifndef SWIG
250 agx::Emitter* m_emitter;
252#endif
253 };
254
255 V1_DECLARE_CONTAINER_TYPE(Emitter);
256}
257
258#endif
A class that encapsulated the Emitter objects in the simulation that creates GranularBody flows in th...
Definition: Emitter.h:45
Vec4 getColor() const
Get the color of the GranularBodies that are created in the emitter.
void setUseFixedRotation(bool enable, agx::Int axis)
Set if a fixed rotation should be used on objects created from this emitter.
bool removeCollisionGroup(const std::string &name)
Remove a named collision group from this Emitter.
std::vector< std::string > getCollisionGroups() const
Get a list of all collision groups that this emitter has.
std::shared_ptr< Geometry > getEmitterGeometry() const
Get the geometry in that the emitter is coupled to.
std::shared_ptr< ParticleDistribution > getParticleDistribution() const
If the current EmitMode of the emitter is PARTICLES and a ParticleDistribution object is set to the E...
bool hasCollisionGroup(const std::string &name) const
Checks if this Emitter has a named collision group.
void setVelocity(const Vec3 &velocity)
Set the velocity of the emitted Granular Bodies from the Emitter.
bool getUseFixedRotation(agx::Int axis) const
EmitMode getEmitMode() const
Get the emit mode of the emitter.
unsigned int getNumEmittedBodies() const
Get the number of GranularBodies created in the Emitter.
void setMaximumAllowedEmittedMass(double maximumMass)
Set the maximum allowed emitted mass of the Emitter.
EmitMode
An emitter can be in two different modes:
Definition: Emitter.h:53
double getMassFlowRate() const
Get the total mass of created GranularBodies in the Emitter.
std::shared_ptr< BodyDistribution > getBodyDistribution() const
If the current EmitMode of the emitter is RIGID_BODIES, this will return the BodyDistribution current...
double getMaximumAllowedEmittedMass() const
Get the maximum allowed emitted mass in the emitter.
std::string getName() const
Get the name of the Emitter.
double getEmittedMass() const
Get the total mass of created GranularBodies in the Emitter.
void setUseFixedPosition(bool enable, agx::Int axis)
Set if fixed position should be used on objects created from this emitter.
void setMassFlowRate(double rate)
Set the mass flow that will be created in the emitter.
bool addCollisionGroup(const std::string &name)
Add a named collision group to this Emitter that can be used for contact filtering during a simulatio...
void setColor(const Vec4 &color)
Set the color of the GranularBodies that are created in the emitter.
bool getUseFixedPosition(agx::Int axis) const
A 3 dimensional vector which can be used to define a point or a vector and contains basic arithmetic.
Definition: Vec3.h:40
A 4 dimensional vector and contains basic arithmetic.
Definition: Vec4.h:33
Namespace for Momentum Scripting API.
Definition: AffineMatrix4x4.h:29