Field3D
ResizableField Class Reference

#include <Field.h>

Inheritance diagram for ResizableField:
WritableField< Data_T >

List of all members.

Public Types

typedef ResizableField< Data_T > class_type
typedef boost::intrusive_ptr
< ResizableField
Ptr

Public Member Functions

void copyFrom (typename Field< Data_T >::Ptr other)
 Copies the data from another Field, also resizes.
template<class Data_T2 >
void copyFrom (typename Field< Data_T2 >::Ptr other)
 Copies the data from another Field of another template class, also resizes.
void matchDefinition (FieldRes::Ptr fieldToMatch)
 Sets up this field so that resolution and mapping matches the other.
void setSize (const V3i &size)
 Resizes the object.
void setSize (const Box3i &extents)
 Resizes the object.
void setSize (const Box3i &extents, const Box3i &dataWindow)
 Resizes the object.
void setSize (const V3i &size, int padding)
 Resizes the object with padding.

Static Public Member Functions

static const char * classType ()
static const char * staticClassName ()

Public Attributes

 DEFINE_FIELD_RTTI_ABSTRACT_CLASS

Protected Types

typedef WritableField< Data_T > base

Protected Member Functions

virtual void sizeChanged ()
 Subclasses should re-implement this if they need to perform memory allocations, etc. every time the size of the storage changes.

Static Protected Attributes

static TemplatedFieldType
< ResizableField< Data_T > > 
ms_classType

Detailed Description

This class adds the ability to resize the data storage object. Most Field subclasses will derive from this class. Only classes that cannot implement sizeChanged() in a reasonable manner should derive from Field or WritableField.


Member Typedef Documentation

typedef boost::intrusive_ptr<ResizableField> ResizableField::Ptr

Reimplemented from WritableField< Data_T >.

Reimplemented in SparseField, MACField, DenseField, and EmptyField.

Definition at line 805 of file Field.h.

Reimplemented from WritableField< Data_T >.

Reimplemented in SparseField, DenseField, EmptyField, and MACField.

Definition at line 809 of file Field.h.

typedef WritableField<Data_T> ResizableField::base [protected]

Reimplemented from WritableField< Data_T >.

Reimplemented in SparseField, MACField, EmptyField, and DenseField.

Definition at line 859 of file Field.h.


Member Function Documentation

static const char* ResizableField::staticClassName ( ) [inline, static]

Reimplemented from WritableField< Data_T >.

Reimplemented in SparseField, DenseField, and MACField.

Definition at line 812 of file Field.h.

  {
    return "ResizableField";
  }
static const char* ResizableField::classType ( ) [inline, static]

Reimplemented from WritableField< Data_T >.

Reimplemented in SparseField, DenseField, EmptyField, and MACField.

Definition at line 817 of file Field.h.

void ResizableField::setSize ( const V3i size)
void ResizableField::setSize ( const Box3i extents)

Resizes the object.

Warning:
Never call this from a constructor. It calls the virtual function sizeChanged().
void ResizableField::setSize ( const Box3i extents,
const Box3i dataWindow 
)

Resizes the object.

Warning:
Never call this from a constructor. It calls the virtual function sizeChanged().
void ResizableField::setSize ( const V3i size,
int  padding 
)

Resizes the object with padding.

Warning:
Never call this from a constructor. It calls the virtual function sizeChanged().
void ResizableField::copyFrom ( typename Field< Data_T >::Ptr  other)

Copies the data from another Field, also resizes.

template<class Data_T2 >
void ResizableField::copyFrom ( typename Field< Data_T2 >::Ptr  other)

Copies the data from another Field of another template class, also resizes.

void ResizableField::matchDefinition ( FieldRes::Ptr  fieldToMatch)

Sets up this field so that resolution and mapping matches the other.

virtual void ResizableField::sizeChanged ( ) [inline, protected, virtual]

Subclasses should re-implement this if they need to perform memory allocations, etc. every time the size of the storage changes.

Note:
Make sure to call the base class version in subclasses!

Reimplemented in SparseField, MACField, and DenseField.

Definition at line 866 of file Field.h.

Referenced by ResizableField< Data_T >::setSize().

  { base::m_mapping->setExtents(base::m_extents); }

Member Data Documentation

Reimplemented from WritableField< Data_T >.

Reimplemented in SparseField, MACField, and DenseField.

Definition at line 855 of file Field.h.


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