openvrml::sfvec3d Class Reference

A 3-component vector node field value. More...

#include <openvrml/field_value.h>

Inheritance diagram for openvrml::sfvec3d:

List of all members.

Public Types

typedef vec3d value_type
 Type of value.

Public Member Functions

 sfvec3d (const vec3d &vec=vec3d()) throw ()
 Construct.
 sfvec3d (const sfvec3d &sfv)
 Construct a copy.
virtual ~sfvec3d () throw ()
 Destroy.
sfvec3doperator= (const sfvec3d &sfv) throw ( std::bad_alloc )
 Assign.
const value_typevalue () const throw ()
 Access.
void value (const value_type &val) throw ( std::bad_alloc )
 Mutate.
void swap (sfvec3d &sfv) throw ()
 Swap.

Static Public Attributes

static const type_id field_value_type_id = sfvec3d_id
 field_value::type_id for this class.

Private Member Functions

virtual std::auto_ptr
< field_value
do_clone () const throw ( std::bad_alloc )
 Polymorphically construct a copy.
virtual sfvec3ddo_assign (const field_value &value) throw ( std::bad_cast )
 Virtual assignment.
virtual type_id do_type () const throw ()
 Get the field_value::type_id associated with this class.
virtual void print (std::ostream &) const
 Print to an output stream.

Related Functions

(Note that these are not member functions.)

bool operator== (const sfvec3d &lhs, const sfvec3d &rhs) throw()
 Compare for equality.
bool operator!= (const sfvec3d &lhs, const sfvec3d &rhs) throw()
 Compare for inequality.
template<> void swap (openvrml::sfvec3d &a, openvrml::sfvec3d &b)
 Swap the values of a and b.

Detailed Description

A 3-component vector node field value.

Model of
Field Value

Member Typedef Documentation


Constructor & Destructor Documentation

openvrml::sfvec3d::sfvec3d ( const vec3d vec = vec3d()) throw () [explicit]

Construct.

Parameters:
[in]vecinitial value.
openvrml::sfvec3d::sfvec3d ( const sfvec3d sfv)

Construct a copy.

Parameters:
[in]sfvthe instance to copy.
openvrml::sfvec3d::~sfvec3d ( ) throw () [virtual]

Destroy.


Member Function Documentation

openvrml::sfvec3d & openvrml::sfvec3d::operator= ( const sfvec3d sfv) throw ( std::bad_alloc )

Assign.

Parameters:
[in]sfvthe value to assign.
Returns:
a reference to the instance.
Exceptions:
std::bad_allocif memory allocation fails.
const openvrml::sfvec3d::value_type & openvrml::sfvec3d::value ( ) const throw ()

Access.

Returns:
the vector value.

Reimplemented from openvrml::field_value.

void openvrml::sfvec3d::value ( const value_type val) throw ( std::bad_alloc )

Mutate.

Parameters:
[in]valthe new value.
Exceptions:
std::bad_allocif memory allocation fails.
void openvrml::sfvec3d::swap ( sfvec3d sfv) throw ()

Swap.

Parameters:
[in,out]sfvthe value to swap with this one.
std::auto_ptr< openvrml::field_value > openvrml::sfvec3d::do_clone ( ) const throw ( std::bad_alloc ) [private, virtual]

Polymorphically construct a copy.

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

Implements openvrml::field_value.

openvrml::sfvec3d & openvrml::sfvec3d::do_assign ( const field_value value) throw ( std::bad_cast ) [private, virtual]

Virtual assignment.

Parameters:
[in]valuethe new value to give the object.
Returns:
a reference to the object.
Exceptions:
std::bad_castif value is not an SFBool.

Implements openvrml::field_value.

openvrml::field_value::type_id openvrml::sfvec3d::do_type ( ) const throw () [private, virtual]

Get the field_value::type_id associated with this class.

Returns:
field_value::sfvec3d.

Implements openvrml::field_value.

void openvrml::sfvec3d::print ( std::ostream &  out) const [private, virtual]

Print to an output stream.

Parameters:
[in,out]outan output stream.

Implements openvrml::field_value.


Friends And Related Function Documentation

bool operator== ( const sfvec3d lhs,
const sfvec3d rhs 
) throw() [related]

Compare for equality.

Parameters:
[in]lhsleft-hand operand.
[in]rhsright-hand operand.
Returns:
true if lhs and rhs have the same value; false otherwise.
bool operator!= ( const sfvec3d lhs,
const sfvec3d rhs 
) throw() [related]

Compare for inequality.

Parameters:
[in]lhsleft-hand operand.
[in]rhsright-hand operand.
Returns:
true if lhs and rhs do not have the same value; false otherwise.
template<> void swap ( openvrml::sfvec3d a,
openvrml::sfvec3d b 
) [related]

Swap the values of a and b.

Does not throw.

Parameters:
[in,out]a
[in,out]b

Member Data Documentation