21#ifndef GENERATED_AGX_PHYSICS_GEOMETRY_TRIANGLE_H_PLUGIN
22#define GENERATED_AGX_PHYSICS_GEOMETRY_TRIANGLE_H_PLUGIN
24#define AGX_ENTITY_WRAPPER 1
30# pragma warning( disable : 4505 )
32# pragma warning( disable : 4251 )
34# pragma warning( disable : 4355 )
36# pragma warning( disable: 4714 )
63 class TriangleInstance;
64 class TriangleSemantics;
95 static const size_t verticesArraySize = 3;
97 static const size_t normalsArraySize = 3;
99 static const size_t colorsArraySize = 3;
101 static const size_t indicesArraySize = 3;
107 virtual void configure(agx::TiXmlElement* eEntity)
override;
115 #ifndef AGX_PHYSICS_GEOMETRY_TRIANGLE_DATA_SET_OVERRIDE
116 #define AGX_PHYSICS_GEOMETRY_TRIANGLE_DATA_SET
120 TriangleInstance operator[] (
size_t index);
125 static const size_t verticesArraySize = 3;
127 static const size_t normalsArraySize = 3;
129 static const size_t colorsArraySize = 3;
131 static const size_t indicesArraySize = 3;
146 virtual ~TriangleData() {}
147 virtual void setNumElements(
agx::Index numElements)
override;
150 TriangleData& operator= (
const TriangleData&) {
return *
this; }
163 agx::Real const& getCameraDistance()
const;
168 void setCameraDistance(
agx::Real const& value);
172 friend class TrianglePtr;
173 friend class TriangleInstance;
239 TriangleInstance(TriangleData* data,
agx::Index index);
244 TriangleData* getData();
245 const TriangleData* getData()
const;
251 agx::Vec3f const& vertices(
size_t index)
const;
256 agx::Vec3f const& normals(
size_t index)
const;
287 inline TriangleInstance
agx::Physics::Geometry::TriangleData::operator[] (
size_t index) {
return TriangleInstance(
this, (
agx::Index)index); }
294 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
301 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
309 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
310 EntityPtr::getModel()->fullPath().c_str(), TriangleModel::instance()->fullPath().c_str());
318 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
319 EntityPtr::getModel()->fullPath().c_str(), TriangleModel::instance()->fullPath().c_str());
325 AGX_FORCE_INLINE TriangleSemantics* TrianglePtr::operator->() {
return (TriangleSemantics* )
this; }
326 AGX_FORCE_INLINE const TriangleSemantics* TrianglePtr::operator->()
const {
return (
const TriangleSemantics* )
this; }
350 AGX_FORCE_INLINE agx::Real& TrianglePtr::cameraDistance() { verifyIndex();
return getData()->cameraDistance[calculateIndex()]; }
351 AGX_FORCE_INLINE agx::Real const& TrianglePtr::cameraDistance()
const { verifyIndex();
return getData()->cameraDistance[calculateIndex()]; }
360 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
367 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
395 AGX_FORCE_INLINE agx::Real& TriangleInstance::cameraDistance() { verifyIndex();
return getData()->cameraDistance[getIndex()]; }
396 AGX_FORCE_INLINE agx::Real const& TriangleInstance::cameraDistance()
const { verifyIndex();
return getData()->cameraDistance[getIndex()]; }
407AGX_TYPE_BINDING(
agx::Physics::Geometry::TriangleInstance, "Physics.Geometry.TriangleInstance")
413#undef AGX_ENTITY_WRAPPER
414#undef AGX_ENTITY_NAMESPACE
#define AGX_DECLARE_POINTER_TYPES(type)
#define AGX_TYPE_BINDING(_Type, _Name)
#define AGXPHYSICS_EXPORT
Type-specific Array used for fast access into the data held by a Buffer.
Entity instance provides access to a single instance in an EntityStorage.
bool isInstanceOf(agxData::EntityModel *model) const
agxData::EntityData * getData()
An abstract description of a data entity stored using SOA (structure of arrays) pattern in a EntitySt...
Accessor to a entity instance stored in a EntityStorage, to allow SOA (structure of arrays) data to b...
EntityPtr & operator=(const EntityPtr &other)=default
bool isInstanceOf(agxData::EntityModel *model) const
agxData::EntityData * getData()
agxData::EntityInstance instance()
Data storage for a collection of entity instances of a specified EntityModel.
agx::String fullPath() const
Abstract description of the data attributes for the Physics.Geometry.Triangle entity.
virtual void construct(agxData::EntityPtr instance) override
virtual void configure(agx::TiXmlElement *eEntity) override
static agxData::ScalarAttributeT< agx::Vec3f > * normalsAttribute
static TrianglePtr createInstance()
Create and return a pointer to a new instance in the default storage for this entity model.
static agxData::ScalarAttributeT< agx::Vec4f > * colorsAttribute
static agxData::ScalarAttributeT< agx::Real > * cameraDistanceAttribute
virtual agxData::EntityData * createData(agxData::EntityStorage *storage) override
TriangleModel(const agx::String &name="Triangle")
void construct(agx::Physics::Geometry::TrianglePtr triangle)
static agxData::ScalarAttributeT< agx::Vec3f > * verticesAttribute
virtual void shutdownCleanup() override
This is part of internal cleanup and should not be called by users.
static agxData::ScalarAttributeT< agx::UInt32 > * indicesAttribute
virtual void initAttributeAccessors() override
static TriangleModel * instance()
static agxData::EntityStorage * defaultStorage()
Pointer to a entity instance of type Physics.Geometry.Triangle.
AGXPHYSICS_EXPORT TrianglePtr(const agxData::EntityInstance &instance)
AGXPHYSICS_EXPORT agx::Vec3f & vertices(size_t index)
AGXPHYSICS_EXPORT TriangleSemantics * operator->()
const TriangleData * getData() const
AGXPHYSICS_EXPORT agxData::Array< agx::UInt32 > indices()
AGXPHYSICS_EXPORT TriangleInstance instance()
AGXPHYSICS_EXPORT agxData::Array< agx::Vec3f > const normals() const
AGXPHYSICS_EXPORT agxData::Array< agx::Vec3f > normals()
AGXPHYSICS_EXPORT const TriangleInstance instance() const
AGXPHYSICS_EXPORT agxData::Array< agx::Vec4f > colors()
AGXPHYSICS_EXPORT agx::Vec4f const & colors(size_t index) const
AGXPHYSICS_EXPORT TrianglePtr(const agxData::EntityPtr &ptr)
AGXPHYSICS_EXPORT TrianglePtr(agxData::EntityStorage *storage, agx::Index id)
AGXPHYSICS_EXPORT agx::Vec3f const & normals(size_t index) const
AGXPHYSICS_EXPORT const TriangleSemantics * operator->() const
AGXPHYSICS_EXPORT agxData::Array< agx::Vec3f > const vertices() const
AGXPHYSICS_EXPORT agxData::Array< agx::Vec3f > vertices()
TriangleInstance InstanceType
AGXPHYSICS_EXPORT agx::UInt32 const & indices(size_t index) const
AGXPHYSICS_EXPORT agx::Vec3f & normals(size_t index)
AGXPHYSICS_EXPORT agxData::Array< agx::UInt32 > const indices() const
AGXPHYSICS_EXPORT agx::Vec3f const & vertices(size_t index) const
AGXPHYSICS_EXPORT agxData::Array< agx::Vec4f > const colors() const
AGXPHYSICS_EXPORT agx::Real & cameraDistance()
AGXPHYSICS_EXPORT agx::Vec4f & colors(size_t index)
AGXPHYSICS_EXPORT agx::Real const & cameraDistance() const
AGXPHYSICS_EXPORT agx::UInt32 & indices(size_t index)
AGXPHYSICS_EXPORT TrianglePtr()
A class holding 4 dimensional vectors and providing basic arithmetic.
Vector containing 'raw' data.
#define agxAssertN(expr, format,...)
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
Contains classes for low level data storage for AGX.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.