3ds Max C++ API Reference
Loading...
Searching...
No Matches
IFieldHelper Class Referenceabstract

#include <C:/adskgit/3dsmax/3dsmax/3dswin/src/maxsdk/include/IFieldHelper.h>

Inheritance diagram for IFieldHelper:

Public Types

enum class  FieldType { FieldTypeFloat = 0 , FieldTypePoint3 = 1 , FieldTypeBoth = 2 }
Public Types inherited from BaseInterface
enum  LifetimeType { noRelease , immediateRelease , wantsRelease , serverControlled }

Public Member Functions

virtual FieldType GetFieldType () const =0
 Get the type of force field data this field helper provides.
virtual FieldType GetUIFieldType () const =0
 Get the type of force field data the user has selected in the user interface.
virtual bool IsFieldOK (TimeValue t) const =0
 Get the status of the Field helper.
virtual void SetGizmoShape (FieldHelperShape type)=0
 Set the shape of the gizmo that the helper uses.
virtual FieldHelperShape GetGizmoShape () const =0
 Get the shape of the gizmo currently in use by the helper.
virtual void SetScale (TimeValue t, float value)=0
 Set the scale of the gizmo that the helper uses.
virtual float GetScale (TimeValue t, Interval &valid) const =0
 Get the scale of the gizmo that the helper uses.
virtual void SetSectionRadius (TimeValue t, float value)=0
 Set the section radius of the torus gizmo that the helper uses.
virtual float GetSectionRadius (TimeValue t, Interval &valid) const =0
 Get the section radius of the torus gizmo that the helper uses.
virtual void GetGizmoMesh (::Mesh &meshOut, TimeValue t, Interval &valid)=0
 Get the mesh of the gizmo that the helper uses.
virtual bool IsUnbounded ()
 Determine whether the field is unbounded.
virtual IFloatFieldSamplerGetFloatSampler (TimeValue t, Interval &valid)
 Get a thread-safe floating-point sampler for the field.
virtual IPoint3FieldSamplerGetPoint3Sampler (TimeValue t, Interval &valid)
 Get a thread-safe Point3 sampler for the field.
Public Member Functions inherited from FPMixinInterface
 FPMixinInterface ()
virtual LifetimeType LifetimeControl ()
virtual CoreExport bool RegisterNotifyCallback (InterfaceNotifyCallback *incb)
virtual void UnRegisterNotifyCallback (InterfaceNotifyCallback *incb)
CoreExport ~FPMixinInterface ()
virtual BaseInterfaceGetInterface (Interface_ID id)
virtual FPInterfaceDescGetDescByID (Interface_ID id)
virtual Interface_ID GetID ()
Public Member Functions inherited from FPInterface
virtual FPInterfaceDescGetDesc ()=0
virtual CoreExport FPStatus Invoke (FunctionID fid, TimeValue t=0, FPParams *params=NULL)
virtual FPStatus Invoke (FunctionID fid, FPParams *params)
virtual CoreExport FPStatus Invoke (FunctionID fid, TimeValue t, FPValue &result, FPParams *params=NULL)
virtual FPStatus Invoke (FunctionID fid, FPValue &result, FPParams *params=NULL)
virtual CoreExport FunctionID FindFn (const MCHAR *name)
virtual CoreExport BOOL IsEnabled (FunctionID actionID)
virtual CoreExport BOOL IsChecked (FunctionID actionID)
virtual CoreExport BOOL IsVisible (FunctionID actionID)
virtual CoreExport FunctionID GetIsEnabled (FunctionID actionID)
virtual CoreExport FunctionID GetIsChecked (FunctionID actionID)
virtual CoreExport FunctionID GetIsVisible (FunctionID actionID)
virtual ActionTableGetActionTable ()
virtual void EnableActions (BOOL onOff)
Public Member Functions inherited from BaseInterface
virtual UtilExport ~BaseInterface ()
 Destructor.
virtual BaseInterfaceAcquireInterface ()
virtual void ReleaseInterface ()
virtual void DeleteInterface ()
virtual BaseInterfaceCloneInterface (void *remapDir=nullptr)
Public Member Functions inherited from InterfaceServer
virtual UtilExport ~InterfaceServer ()
 Destructor.
template<class InterfaceType>
InterfaceType * GetTypedInterface ()

Additional Inherited Members

Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown.
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned.
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown.
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown.
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned.
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown.
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned.
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown.
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned.
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown.
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects.
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned.
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown.
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned.
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown.
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen.
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown.
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown.
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen.
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown.
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen.
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown.
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen.
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown.
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown.
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen.
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown.
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown.
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator.
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator.
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary.
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary.
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc.
static UtilExport voidmalloc_nullchecked (size_t size)
 Allocates memory via malloc without invoking 3dsmax's out of memory handler with potential CER.
static UtilExport voidcalloc_nullchecked (size_t num, size_t size)
 Allocates memory via calloc without invoking 3dsmax's out of memory handler with potential CER.
static UtilExport voidrealloc_nullchecked (void *memblock, size_t size)
 Reallocates memory via realloc without invoking 3dsmax's out of memory handler with potential CER.
static UtilExport voidLocalAlloc_nullchecked (unsigned int uFlags, size_t size)
 Allocates memory via LocalAlloc without invoking 3dsmax's out of memory handler with potential CER.
Static Public Attributes inherited from FPInterface
static CoreExport FPInterfaceDesc nullInterface
Protected Member Functions inherited from FPMixinInterface
 FPMixinInterface (const FPMixinInterface &rhs)
FPMixinInterfaceoperator= (const FPMixinInterface &rhs)
Protected Member Functions inherited from FPInterface
virtual FPStatus _dispatch_fn (FunctionID fid, TimeValue t, FPValue &result, FPParams *p)
Protected Attributes inherited from FPMixinInterface
Tab< InterfaceNotifyCallback * > * interfaceNotifyCBs

Member Enumeration Documentation

◆ FieldType

enum class FieldType
strong
Enumerator
FieldTypeFloat 
FieldTypePoint3 
FieldTypeBoth 
124 {
125 FieldTypeFloat = 0,
126 FieldTypePoint3 = 1,
127 FieldTypeBoth = 2
128 };

Member Function Documentation

◆ GetFieldType()

virtual FieldType GetFieldType ( ) const
pure virtual

Get the type of force field data this field helper provides.

Field helpers can provide floating-point and/or Point3 data for any point located inside the field bounds. This function allows the application to query the Field for the type of data it can provide.

Returns
the FieldType(s) supported. See IFieldHelper::FieldType, above.

◆ GetUIFieldType()

virtual FieldType GetUIFieldType ( ) const
pure virtual

Get the type of force field data the user has selected in the user interface.

The Field helper may allow the user to select the type of data the helper returns. This function allows the application to query the Field for the type of data selected in the user interface. If the helper does not allow the user to select the data type, this will return the same value as GetFieldType, above.

Returns
the FieldType(s) supported. See IFieldHelper::FieldType, above.

◆ IsFieldOK()

virtual bool IsFieldOK ( TimeValue t) const
pure virtual

Get the status of the Field helper.

The Field helper may have options, such as using a mesh object or other target to control the shape or other attributes of the field. If these are not ready, this function can be used to indicate this. The IFieldHelper user should call this method to be sure the field is ready for use. If it is not ready, the helper can be ignored.

Returns
'true' if the Field is ready for use; 'false' otherwise.

◆ SetGizmoShape()

virtual void SetGizmoShape ( FieldHelperShape type)
pure virtual

Set the shape of the gizmo that the helper uses.

The Field helper can use a number of shapes as its boundary. This method sets the shape to be used. See FieldHelperShape, above.

Parameters
[in]type: The shape to be used for the field

◆ GetGizmoShape()

virtual FieldHelperShape GetGizmoShape ( ) const
pure virtual

Get the shape of the gizmo currently in use by the helper.

The Field helper can use a number of shapes as its boundary. This method gets the shape currently in use. See FieldHelperShape, above.

Returns
the shape currently in use by the helper. See FieldHelperShape, above.

◆ SetScale()

virtual void SetScale ( TimeValue t,
float value )
pure virtual

Set the scale of the gizmo that the helper uses.

This method sets the scale of the helper's gizmo shape at the given time.

Parameters
[in]t: The time to set the gizmo scale
[in]value: The scale of the field in local space units

◆ GetScale()

virtual float GetScale ( TimeValue t,
Interval & valid ) const
pure virtual

Get the scale of the gizmo that the helper uses.

This method gets the scale of the helper's gizmo shape at the given time.

Parameters
[in]t: The time to get the gizmo scale
[in/out]valid : The validity interval of the scale, intersected with the incoming interval.
Returns
the scale of the gizmo, in local space units

◆ SetSectionRadius()

virtual void SetSectionRadius ( TimeValue t,
float value )
pure virtual

Set the section radius of the torus gizmo that the helper uses.

This method sets the section radius of the helper's torus gizmo shape at the given time.

Parameters
[in]t: The time to set the section radius
[in]value: The section radius of the field in local space units

◆ GetSectionRadius()

virtual float GetSectionRadius ( TimeValue t,
Interval & valid ) const
pure virtual

Get the section radius of the torus gizmo that the helper uses.

This method gets the section radius of the helper's torus gizmo shape at the given time.

Parameters
[in]t: The time to get the gizmo section radius
[in/out]valid : The validity interval of the section radius, intersected with the incoming interval.
Returns
the section radius of the gizmo, in local space units

◆ GetGizmoMesh()

virtual void GetGizmoMesh ( ::Mesh & meshOut,
TimeValue t,
Interval & valid )
pure virtual

Get the mesh of the gizmo that the helper uses.

When using the FieldHelperShape::shape_object gizmo type, this method gets the mesh for the helper's gizmo shape at the given time.

Parameters
[out]meshOut: The Mesh that will receive the helper's gizmo mesh
[in]t: The time to get the gizmo mesh
[in/out]valid : The validity interval of the gizmo mesh, intersected with the incoming interval.

◆ IsUnbounded()

virtual bool IsUnbounded ( )
inlinevirtual

Determine whether the field is unbounded.

Some field helpers have an option to produce a value for any point in space, not bounded by the gizmo. The shape_linear type (see FieldHelperShape) is one such field. If this returns 'true', then the field helper's bounding box can be disregarded and any point in space can be queried.

Returns
'true' if the field is unbounded, 'false' otherwise
250 {
251 return false;
252 }

◆ GetFloatSampler()

virtual IFloatFieldSampler * GetFloatSampler ( TimeValue t,
Interval & valid )
inlinevirtual

Get a thread-safe floating-point sampler for the field.

This method returns a pointer to a thread-safe sampler for the field which will return a floating-point value if the point lies within the field.

Parameters
[in]t: The time to get the sampler
[in/out]valid : The validity interval of the sampler, intersected with the incoming interval.
Returns
a pointer to the IFloatFieldSampler, or nullptr if the Field does not support floating-point data output. The caller is the owner of this pointer and is responsible for deleting it when finished using it. Also, care must be taken to only use the pointer while it is valid, since it depends on the lifetime of the Field which it samples.
272 {
273 return nullptr;
274 }

◆ GetPoint3Sampler()

virtual IPoint3FieldSampler * GetPoint3Sampler ( TimeValue t,
Interval & valid )
inlinevirtual

Get a thread-safe Point3 sampler for the field.

This method returns a pointer to a thread-safe sampler for the field which will return a Point3 value if the point lies within the field.

Parameters
[in]t: The time to get the sampler
[in/out]valid : The validity interval of the sampler, intersected with the incoming interval.
Returns
a pointer to the IPoint3FieldSampler, or nullptr if the Field does not support Point3 data output. The caller is the owner of this pointer and is responsible for deleting it when finished using it. Also, care must be taken to only use the pointer while it is valid, since it depends on the lifetime of the Field which it samples.
292 {
293 return nullptr;
294 }