H3D API  2.4.1
Public Member Functions | List of all members
H3D::MFieldClass Class Referenceabstract

Base class for all fields created with the MField template. More...

#include <H3D/MField.h>

Inheritance diagram for H3D::MFieldClass:
Inheritance graph

Public Member Functions

virtual ~MFieldClass ()
 Virtual destructor.
 
virtual int setValueFromVoidPtr (void *data, unsigned int nr_elements, unsigned int size, int id=0)
 
virtual int getValueAsVoidPtr (void *data, unsigned int &nr_elements, unsigned int size, int id=0)=0
 Get the value of the data copied into a memory buffer. More...
 
virtual unsigned int valueTypeSize ()=0
 Returns the size in bytes of the value type the mfield encapsulates.
 
virtual unsigned int size ()=0
 Returns the number of values that is stored in the mfield.
 
virtual int setValueFromVoidPtr (const void *data, unsigned int nr_elements, unsigned int size, int id=0)=0
 Set the value of the field given a pointer to where the value of the field is. More...
 

Detailed Description

Base class for all fields created with the MField template.

Member Function Documentation

◆ getValueAsVoidPtr()

virtual int H3D::MFieldClass::getValueAsVoidPtr ( void *  data,
unsigned int &  nr_elements,
unsigned int  size,
int  id = 0 
)
pure virtual

Get the value of the data copied into a memory buffer.

Parameters
dataBuffer to copy the data into.
nr_elementsThis parameter will be set to the nr of values in the mfield.
sizeThe size of the buffer.
idThe id of the node that owns the field.
Returns
If successful: The number of bytes that was copied into the Otherwise -1.

Implemented in H3D::MFieldBase< Type, VectorClass, BaseField >, H3D::MFieldBase< Vec3f, std::vector< Vec3f >, ParsableMField >, H3D::MFieldBase< Vec3d, std::vector< Vec3d >, ParsableMField >, H3D::MFieldBase< Type, std::vector< Type >, ParsableMField >, H3D::MFieldBase< string, std::vector< string >, ParsableMField >, H3D::MFieldBase< Quaternion, std::vector< Quaternion >, ParsableMField >, H3D::MFieldBase< RGBA, std::vector< RGBA >, ParsableMField >, H3D::MFieldBase< bool, std::vector< bool >, ParsableMField >, H3D::MFieldBase< Matrix4f, std::vector< Matrix4f >, ParsableMField >, H3D::MFieldBase< RefClass *, FieldInternals::MFNodeAutoRefVector< RefClass >, Field >, H3D::MFieldBase< Node *, FieldInternals::MFNodeAutoRefVector< Node >, Field >, H3D::MFieldBase< Matrix4d, std::vector< Matrix4d >, ParsableMField >, H3D::MFieldBase< Matrix3d, std::vector< Matrix3d >, ParsableMField >, H3D::MFieldBase< Vec4f, std::vector< Vec4f >, ParsableMField >, H3D::MFieldBase< Vec4d, std::vector< Vec4d >, ParsableMField >, H3D::MFieldBase< Vec2f, std::vector< Vec2f >, ParsableMField >, H3D::MFieldBase< Vec2d, std::vector< Vec2d >, ParsableMField >, H3D::MFieldBase< Rotation, std::vector< Rotation >, ParsableMField >, H3D::MFieldBase< RGB, std::vector< RGB >, ParsableMField >, H3D::MFieldBase< H3DFloat, std::vector< H3DFloat >, ParsableMField >, H3D::MFieldBase< Matrix3f, std::vector< Matrix3f >, ParsableMField >, H3D::MFieldBase< H3DInt32, std::vector< H3DInt32 >, ParsableMField >, and H3D::MFieldBase< H3DDouble, std::vector< H3DDouble >, ParsableMField >.

◆ setValueFromVoidPtr() [1/2]

virtual int H3D::MFieldClass::setValueFromVoidPtr ( const void *  data,
unsigned int  nr_elements,
unsigned int  size,
int  id = 0 
)
pure virtual

Set the value of the field given a pointer to where the value of the field is.

Parameters
dataA pointer to the data.
nr_elementsThe number of values in the mfield.
sizeThe size in bytes of the each value stored in the data.
idThe id of the node that owns the field.
Returns
0 if successful, -1 otherwise.

Implemented in H3D::MFieldBase< Type, VectorClass, BaseField >, H3D::MFieldBase< Vec3f, std::vector< Vec3f >, ParsableMField >, H3D::MFieldBase< Vec3d, std::vector< Vec3d >, ParsableMField >, H3D::MFieldBase< Type, std::vector< Type >, ParsableMField >, H3D::MFieldBase< string, std::vector< string >, ParsableMField >, H3D::MFieldBase< Quaternion, std::vector< Quaternion >, ParsableMField >, H3D::MFieldBase< RGBA, std::vector< RGBA >, ParsableMField >, H3D::MFieldBase< bool, std::vector< bool >, ParsableMField >, H3D::MFieldBase< Matrix4f, std::vector< Matrix4f >, ParsableMField >, H3D::MFieldBase< RefClass *, FieldInternals::MFNodeAutoRefVector< RefClass >, Field >, H3D::MFieldBase< Node *, FieldInternals::MFNodeAutoRefVector< Node >, Field >, H3D::MFieldBase< Matrix4d, std::vector< Matrix4d >, ParsableMField >, H3D::MFieldBase< Matrix3d, std::vector< Matrix3d >, ParsableMField >, H3D::MFieldBase< Vec4f, std::vector< Vec4f >, ParsableMField >, H3D::MFieldBase< Vec4d, std::vector< Vec4d >, ParsableMField >, H3D::MFieldBase< Vec2f, std::vector< Vec2f >, ParsableMField >, H3D::MFieldBase< Vec2d, std::vector< Vec2d >, ParsableMField >, H3D::MFieldBase< Rotation, std::vector< Rotation >, ParsableMField >, H3D::MFieldBase< RGB, std::vector< RGB >, ParsableMField >, H3D::MFieldBase< H3DFloat, std::vector< H3DFloat >, ParsableMField >, H3D::MFieldBase< Matrix3f, std::vector< Matrix3f >, ParsableMField >, H3D::MFieldBase< H3DInt32, std::vector< H3DInt32 >, ParsableMField >, and H3D::MFieldBase< H3DDouble, std::vector< H3DDouble >, ParsableMField >.

◆ setValueFromVoidPtr() [2/2]

virtual int H3D::MFieldClass::setValueFromVoidPtr ( void *  data,
unsigned int  nr_elements,
unsigned int  size,
int  id = 0 
)
inlinevirtual
Deprecated:
Use the version of this function which takes const void *

The documentation for this class was generated from the following file: