// PhBInterpolatedSpectrum.H: PhBInterpolatedSpectrum 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 _PhBInterpolatedSpectrum_H_
#define _PhBInterpolatedSpectrum_H_

#include "xrml.H"
#include "PhBSpectrum.H"

// utility includes
// end of utility includes

namespace xrml {
#define PhBInterpolatedSpectrumTypeId 	"PhBInterpolatedSpectrum"
extern bool IsPhBInterpolatedSpectrum(SFNode*);

class PhBInterpolatedSpectrum: public virtual SFNode, public PhBSpectrum {
private:
  //
  void clone_here(const PhBInterpolatedSpectrum&);
  void destruct(void);
  
  // field/eventOut update status bits
  // Use xxx_is_updated() and xxx_clear_update() to inspect/reset.
  enum status_bits {
    fraction_updated = 0x1,
    key_updated = 0x2,
    keySpectra_updated = 0x4 
  };
  
protected:
  // raw children nodes (can be PROTO) + synchronize methods:
  MFNode 	_keySpectra;
  void 	synchronize_keySpectra(void);

public:
  //
  int major_version(void), minor_version(void);
  bool is_leaf_class(void);
  
  PhBInterpolatedSpectrum();
  PhBInterpolatedSpectrum(const PhBInterpolatedSpectrum&);
  PhBInterpolatedSpectrum& operator=(const PhBInterpolatedSpectrum&);
  virtual ~PhBInterpolatedSpectrum();
  
  //
  SFNode*          	instantiate(Proto * =0);
  void             	render(void);
  
  // state values:
  // Do not assign directly unless you know very well what you are doing.
  SFFloat          	fraction;
  MFFloat          	key;
  array<PhBSpectrum*> 	keySpectra;
  
  // set_<exposedField> eventIns: with forwarding and eventOut generation
  void             	set_fraction(const SFFloat&);
  void             	set_key(const MFFloat&);
  void             	set_keySpectra(const MFNode&);
  
  // field assignement: no forwarding or eventOut generation!
  bool             	assign_fraction(const SFFloat&);
  bool             	assign_key(const MFFloat&);
  bool             	assign_keySpectra(const MFNode&);
  
  // update status
  inline bool      	fraction_is_updated(void) { return (status & fraction_updated); }
  inline void      	fraction_clear_update(void) { status &= ~fraction_updated; }
  inline bool      	key_is_updated(void) { return (status & key_updated); }
  inline void      	key_clear_update(void) { status &= ~key_updated; }
  inline bool      	keySpectra_is_updated(void) { return (status & keySpectra_updated); }
  inline void      	keySpectra_clear_update(void) { status &= ~keySpectra_updated; }
  
  // utility members
  
protected:
  inline void util_init(void) { }
  inline void util_clone(const PhBInterpolatedSpectrum& src) { }
  inline void util_destruct(void) { }
};

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