 |
AGX Dynamics
2.38.0.2
|
Go to the documentation of this file.
17 #ifndef AGX_PARAMETER_H
18 #define AGX_PARAMETER_H
21 # pragma warning( disable: 4714 )// const' marked as __forceinline not inlined
32 namespace agxData {
class FunctionValue; }
93 size_t getIndex()
const;
98 MetaType getMetaType()
const;
108 bool isRequired()
const;
113 void setRequired(
bool flag);
141 virtual bool isValid()
const = 0;
171 virtual bool hasGlobalResult()
const;
174 virtual void rebind()
override;
177 virtual void update() = 0;
178 virtual void commit() = 0;
186 virtual void _bind(
Object *binding) = 0;
193 void setTask(
Task *task,
size_t index);
195 virtual void prepareGlobalResultSorting(
size_t numJobs);
221 virtual void configure(TiXmlElement *eParameter)
override;
227 virtual bool isValid()
const override;
234 virtual void _bind(
Object *binding)
override;
235 virtual void update()
override;
236 virtual void commit()
override;
261 virtual void configure(TiXmlElement *eParameter)
override;
273 template <
typename T>
274 const T& get()
const;
281 template <
typename T>
282 void set(
const T& value);
285 template <
typename T>
286 void write(
const T& value,
const Task* owner);
291 void setExpression(
const String& expression);
297 virtual bool isValid()
const override;
301 void setReal(
Real value );
304 virtual void update()
override;
305 virtual void commit()
override;
309 virtual void _bind(
Object *binding)
override;
335 virtual void configure(TiXmlElement *eParameter)
override;
359 template <
typename T>
362 template <
typename T>
368 void setLocalSize(
size_t numElements);
373 size_t getLocalSize()
const;
378 size_t getNumElements()
const;
384 void setGlobalResultMode(
UInt mode);
389 UInt getGlobalResultMode()
const;
397 virtual bool hasGlobalResult()
const override;
400 virtual bool isValid()
const override;
403 virtual void update()
override;
404 virtual void commit()
override;
408 virtual void _bind(
Object *binding)
override;
409 virtual void prepareGlobalResultSorting(
size_t numJobs)
override;
414 void parentBindCallback(
Parameter *parent);
415 void parentUnbindCallback(
Parameter *parent);
422 size_t m_localMemorySize;
423 UInt m_globalResultMode;
440 virtual void configure(TiXmlElement *eParameter)
override;
447 const Object* get()
const;
449 template <
typename T>
452 template <
typename T>
453 const T* get()
const;
455 virtual bool isValid()
const override;
458 virtual void update()
override;
459 virtual void commit()
override;
463 virtual void _bind(
Object *binding)
override;
466 virtual void destroyCallback(
agx::Object*
object)
override;
489 virtual void configure(TiXmlElement *eParameter)
override;
510 agxData::EntityData *getData();
512 template <
typename T>
518 void setGlobalResultMode(
UInt mode);
523 UInt getGlobalResultMode()
const;
532 void setData(agxData::EntityData *dataSet);
536 virtual bool isValid()
const override;
539 virtual void update()
override;
540 virtual void commit()
override;
542 virtual bool hasGlobalResult()
const override;
546 virtual void _bind(
Object *binding)
override;
547 virtual void prepareGlobalResultSorting(
size_t numJobs)
override;
550 void addChildParameter(
Parameter* parameter);
558 agxData::EntityDataRef m_dataSet;
560 UInt m_globalResultMode;
562 bool m_childrenNeedCommit;
575 virtual void configure(TiXmlElement *eParameter)
override;
594 template <
typename T>
598 virtual bool isValid()
const override;
600 virtual void update()
override;
601 virtual void commit()
override;
605 virtual void _bind(
Object *binding)
override;
614 struct AttributeAccess
616 AttributeAccess() : attribute(
nullptr), buffer(
nullptr), mode(
agx::InvalidIndex) {}
637 virtual void configure(TiXmlElement *eParameter)
override;
656 template <
typename T>
660 virtual bool isValid()
const override;
662 virtual void update()
override;
663 virtual void commit()
override;
667 virtual void _bind(
Object *binding)
override;
676 struct AttributeAccess
678 AttributeAccess() : attribute(
nullptr), buffer(
nullptr), mode(
agx::InvalidIndex) {}
716 template <
typename T>
719 agxAssertN(agxData::getFormat<T>() ==
m_format,
"%s: Type mismatch, parameter is type %s, dereferencing using type %s", this->
getPath().c_str(),
m_format->fullName().c_str(), agxData::getFormat<T>()->fullName().c_str());
720 agxAssertN(m_value && m_value->
isValid(),
"%s: Can not dereference an unbound parameter", this->getPath().c_str());
721 return m_value->
get<T>();
724 template <
typename T>
735 template <
typename T>
743 agxAssert(m_format->is(agxData::getFormat<T>()));
744 *(T*)this->ptr() = value;
749 return const_cast<void *
>(m_value->ptr());
760 return this->get<Real>();
770 template <
typename T>
774 agxAssertN(agxData::getFormat<T>() ==
m_format,
"%s: Type mismatch, parameter is type %s, dereferencing using type %s", this->
getPath().c_str(),
m_format->fullName().c_str(), agxData::getFormat<T>()->fullName().c_str());
776 return m_buffer ? m_buffer->getArray<T>() :
static_cast<agxData::Array<T>&
>(s_dummyArray);
779 template <
typename T>
798 template <
typename T>
808 template <
typename T>
818 template <
typename T>
834 template <
typename T>
842 template <
typename T>
A representation of a task/kernel parameter, which can be bound using a string path or explicitly to ...
Abstract representation of a value.
void write(const T &value, const Task *owner)
Only for internal use from the task containing this Parameter.
agxData::Buffer * getBuffer()
Arrays are fast accessors into the data, or a portion of it, held by a Buffer.
size_t getNumElements() const
AGXCORE_EXPORT Format * getFormat(const agx::String &typeFormatName)
agxData::Array< T > & get()
Access the data of the current buffer binding.
Representation of a path, a list of name components.
An abstract description of a data entity stored using SOA (structure of arrays) pattern in a EntitySt...
agxData::EntityModel * getEntityModel()
AGXCORE_EXPORT Type * getType(const agx::String &name)
agxData::EntityModel * getEntityModel()
GlobalResultStorage * getGlobalResult()
void unbind()
Remove current binding and bind path.
Data storage for a collection of entity instances of a specified EntityModel.
Callback1< Value * > CallbackType
agxData::Format * getFormat()
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
agxData::EntityInstance getBinding()
UInt getGlobalResultMode() const
Contains classes for low level data storage for AGX.
agxData::Type * getType() override
A model is an abstract representation of the class of an agx::Object.
Type-specific Array used for fast access into the data held by a Buffer.
#define AGX_DECLARE_VECTOR_TYPES(type)
MetaType
Specify which kind of parameter.
A representation of a generic task.
Event1< Parameter * > Event
size_t getElementArraySize() const
AGXTERRAIN_EXPORT TimingStorage & getStorage()
const ParameterRefVector & getChildParameters() const
UInt8 getAccessMode() const
void set(agxData::Value *value)
Set the parameter value.
agx::Object * getBinding()
EntityInstance parameter.
Inheritance with partial specialization due to bug with ref_ptr containers.
Abstract representation of a data buffer.
agxData::FormatRef m_format
Entity instance provides access to a single instance in an EntityStorage.
Representation of a name string.
bool AGXPHYSICS_EXPORT write(const std::string &filename, const agxStream::Serializable *data)
Write a Serializable object to a file.
UInt getGlobalResultMode() const
agx::Object is a refcounted object with a name.
Templated callback with one argument.
agxData::EntityStorage * getStorage()
const agx::Path & getBindPath() const
#define AGX_DECLARE_POINTER_TYPES(type)
agx::Path getPath() const
size_t getLocalSize() const
agxData::EntityPtr getBinding()
agxData::Value * getValue()
MetaType getMetaType() const
An agx::Device is an abstract representation of a device on which data can be stored and processed.
#define agxAssertN(expr, format,...)
void AGXPHYSICS_EXPORT init()
Initialize AGX Dynamics API including thread resources and must be executed before using the AGX API.
const AGXCORE_EXPORT InvalidIndexStruct InvalidIndex
An abstract attribute description, part of an Entity.
agxData::EntityModel * getEntityModel()
Accessor to a entity instance stored in a EntityStorage, to allow SOA (structure of arrays) data to b...
virtual agxData::Type * getType()
agxData::EntityData * getData()
HashTable< String, UnresolvedParameterRef > ParameterTable
AGXCORE_EXPORT agx::UInt getAccessMode(const agx::String &modeName)
GlobalResultBuffer * getGlobalResult()