// PositionInterpolator.H: PositionInterpolator nodes.

// This file has been generated using nodegen 0.5a.
// Restrict manual editing to the sections delimited by
// . the comments "utility includes" and "end of utility includes"
// . the comments "utility members" and "end of utility members"

#ifndef _PositionInterpolator_H_
#define _PositionInterpolator_H_

#include "xrml.H"
#include "Interpolator.H"
#include "Children.H"

// utility includes
// end of utility includes

namespace xrml {
#define PositionInterpolatorTypeId 	"PositionInterpolator"
extern bool IsPositionInterpolator(SFNode*);

class PositionInterpolator: public virtual SFNode, public Interpolator, public Children {
private:
  //
  void clone_here(const PositionInterpolator&);
  void destruct(void);
  
  // field/eventOut update status bits
  // Use xxx_is_updated() and xxx_clear_update() to inspect/reset.
  enum status_bits {
    key_updated = 0x1,
    keyValue_updated = 0x2,
    value_changed_updated = 0x4 
  };
  
protected:
  // raw eventOut posting:
  void post_value_changed(void);

public:
  //
  int major_version(void), minor_version(void);
  bool is_leaf_class(void);
  
  PositionInterpolator();
  PositionInterpolator(const PositionInterpolator&);
  PositionInterpolator& operator=(const PositionInterpolator&);
  virtual ~PositionInterpolator();
  
  //
  SFNode*          	instantiate(Proto * =0);
  void             	render(void);
  
  // state values:
  // Do not assign directly unless you know very well what you are doing.
  //  MFFloat          	key;
  MFVec3f          	keyValue;
  
  // eventIns:
  void             	set_fraction(const SFFloat&);
  
  // set_<exposedField> eventIns: with forwarding and eventOut generation
  void             	set_key(const MFFloat&);
  void             	set_keyValue(const MFVec3f&);
  
  // field assignement: no forwarding or eventOut generation!
  bool             	assign_key(const MFFloat&);
  bool             	assign_keyValue(const MFVec3f&);
  
  // eventOuts:
  SFVec3f            	value_changed;
  void             	post_value_changed(const SFVec3f& val);
  
  // update status
  inline bool      	key_is_updated(void) { return (status & key_updated); }
  inline void      	key_clear_update(void) { status &= ~key_updated; }
  inline bool      	keyValue_is_updated(void) { return (status & keyValue_updated); }
  inline void      	keyValue_clear_update(void) { status &= ~keyValue_updated; }
  inline bool      	value_changed_is_updated(void) { return (status & value_changed_updated); }
  inline void      	value_changed_clear_update(void) { status &= ~value_changed_updated; }
  
  // utility members
  
protected:
  SFVec3f interpolate(float t);

  inline void util_init(void) { }
  inline void util_clone(const PositionInterpolator& src) { }
  inline void util_destruct(void) { }
};

// end of utility members
} // namespace xrml
#endif /*_PositionInterpolator_H_*/
