// PhBNoiseTexture.H: PhBNoiseTexture 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 _PhBNoiseTexture_H_
#define _PhBNoiseTexture_H_

#include "xrml.H"
#include "PhBTexture.H"

// utility includes
#include "PerlinNoise.H"
// end of utility includes

namespace xrml {
#define PhBNoiseTextureTypeId 	"PhBNoiseTexture"
extern bool IsPhBNoiseTexture(SFNode*);

class PhBNoiseTexture: public virtual SFNode, public PhBTexture {
private:
  //
  void clone_here(const PhBNoiseTexture&);
  void destruct(void);
  
  // field/eventOut update status bits
  // Use xxx_is_updated() and xxx_clear_update() to inspect/reset.
  enum status_bits {
    k_updated = 0x1 
  };
  
public:
  //
  int major_version(void), minor_version(void);
  bool is_leaf_class(void);
  
  PhBNoiseTexture();
  PhBNoiseTexture(const PhBNoiseTexture&);
  PhBNoiseTexture& operator=(const PhBNoiseTexture&);
  virtual ~PhBNoiseTexture();
  
  //
  SFNode*          	instantiate(Proto * =0);
  void             	render(void);
  
  // state values:
  // Do not assign directly unless you know very well what you are doing.
  SFFloat          	k;
  
  // set_<exposedField> eventIns: with forwarding and eventOut generation
  void             	set_k(const SFFloat&);
  
  // field assignement: no forwarding or eventOut generation!
  bool             	assign_k(const SFFloat&);
  
  // update status
  inline bool      	k_is_updated(void) { return (status & k_updated); }
  inline void      	k_clear_update(void) { status &= ~k_updated; }
  
  // utility members
  PerlinNoise           noise;
  bool                  noiseInit;
  float                 value[2];       // let value point to tis float anytime, but change value (2nd value = 1 - 1st value)

  long  nrChannels(void) { return(2); }
  float *values(double u, double v, int *nrChannels);
  void Dvalues(double u, double v, float *dX, float *dY, float *dZ);
  
protected:
  inline void util_init(void) { noiseInit = false; }
  inline void util_clone(const PhBNoiseTexture& src) { util_init(); }
  inline void util_destruct(void) { }
};

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