Main Page   Namespace List   Class Hierarchy   Compound List   Namespace Members   Compound Members   Related Pages  

MFVec2f Class Reference

Encapsulates an MFVec2f. More...

Inheritance diagram for MFVec2f:

FieldValue List of all members.

Public Methods

 MFVec2f (size_t length=0, SFVec2f::ConstArrayPointer values=0) throw (std::bad_alloc)
 Construct from an array of vector values.

 MFVec2f (const MFVec2f &mfvec2f) throw (std::bad_alloc)
 Copy constructor.

virtual ~MFVec2f () throw ()
 Destructor.

MFVec2f & operator= (const MFVec2f &mfvec2f) throw (std::bad_alloc)
 Assignment operator.

SFVec2f::ConstArrayReference getElement (size_t index) const throw ()
 Get element.

void setElement (size_t index, SFVec2f::ConstArrayReference value) throw ()
 Set element.

size_t getLength () const throw ()
 Get the length.

void setLength (size_t length) throw (std::bad_alloc)
 Set the length.

void addElement (SFVec2f::ConstArrayReference value) throw (std::bad_alloc)
 Add an element to the end of the sequence.

void insertElement (size_t index, SFVec2f::ConstArrayReference value) throw (std::bad_alloc)
 Insert an element into the sequence.

void removeElement (size_t index) throw ()
 Remove an element from the sequence.

virtual std::auto_ptr< FieldValueclone () const throw (std::bad_alloc)
 Virtual copy constructor.

virtual FieldValueassign (const FieldValue &value) throw (std::bad_cast, std::bad_alloc)
 Virtual assignment.

virtual Type type () const throw ()
 Get the FieldValue::Type associated with this class.


Private Methods

virtual void print (std::ostream &) const
 Print to an output stream.


Private Attributes

void * values

Detailed Description

Encapsulates an MFVec2f.


Constructor & Destructor Documentation

MFVec2f size_t    length = 0,
SFVec2f::ConstArrayPointer    values = 0
throw (std::bad_alloc) [explicit]
 

Construct from an array of vector values.

Parameters:
length the number of vector values in the passed array
values a pointer to an array of 2-element arrays comprising vector values to initialize the MFVec2f.

MFVec2f const MFVec2f &    mfvec2f throw (std::bad_alloc)
 

Copy constructor.

Parameters:
mfvec2f the object to copy
Exceptions:
std::bad_alloc if memory allocation fails.

~MFVec2f   throw () [virtual]
 

Destructor.


Member Function Documentation

void addElement SFVec2f::ConstArrayReference    value throw (std::bad_alloc)
 

Add an element to the end of the sequence.

Parameters:
value the value to add.
Exceptions:
std::bad_alloc if memory allocation fails.

FieldValue & assign const FieldValue   value throw (std::bad_cast, std::bad_alloc) [virtual]
 

Virtual assignment.

Returns:
a reference to the object.
Exceptions:
std::bad_cast if value is not an MFVec2f object.
std::bad_alloc if memory allocation fails.

Implements FieldValue.

std::auto_ptr< FieldValue > clone   const throw (std::bad_alloc) [virtual]
 

Virtual copy constructor.

Returns:
a pointer to a copy of the object.
Exceptions:
std::bad_alloc if memory allocation fails.

Implements FieldValue.

SFVec2f::ConstArrayReference getElement size_t    index const throw ()
 

Get element.

Parameters:
index 

size_t getLength   const throw ()
 

Get the length.

Returns:
the number of vector values

void insertElement size_t    index,
SFVec2f::ConstArrayReference    value
throw (std::bad_alloc)
 

Insert an element into the sequence.

Parameters:
index the index where the new value should be inserted.
value a 2D vector.
Exceptions:
std::bad_alloc if memory allocation fails.
Precondition:
index is a valid index.

MFVec2f & operator= const MFVec2f &    mfvec2f throw (std::bad_alloc)
 

Assignment operator.

Parameters:
mfvec2f the object to copy into this one
Exceptions:
std::bad_alloc if memory allocation fails.

void print std::ostream &    out const [private, virtual]
 

Print to an output stream.

Parameters:
out an output stream.

Implements FieldValue.

void removeElement size_t    index throw ()
 

Remove an element from the sequence.

Parameters:
index the index of the value to remove.
Precondition:
index is a valid index.

void setElement size_t    index,
SFVec2f::ConstArrayReference    value
throw ()
 

Set element.

Parameters:
index 
value 

void setLength size_t    length throw (std::bad_alloc)
 

Set the length.

If the new length is smaller than the current length, the array is truncated. If the new length is greater than the current length, the new values are initialized to the default vector (0, 0).

Parameters:
length the new length
Exceptions:
std::bad_alloc if memory allocation fails.

FieldValue::Type type   const throw () [virtual]
 

Get the FieldValue::Type associated with this class.

Returns:
FieldValue::mfvec2f.

Implements FieldValue.