// PhBSchlickPhaseFunction.H: PhBSchlickPhaseFunction nodes.

// This file has been generated using nodegen 0.51.
// 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 _PhBSchlickPhaseFunction_H_
#define _PhBSchlickPhaseFunction_H_

#include "xrml.H"
#include "PhBIsotropicPhaseFunction.H"

// utility includes
// end of utility includes

namespace xrml {
#define PhBSchlickPhaseFunctionTypeId 	"PhBSchlickPhaseFunction"
extern bool IsPhBSchlickPhaseFunction(SFNode*);

class PhBSchlickPhaseFunction: public virtual SFNode, public PhBIsotropicPhaseFunction {
private:
  //
  void clone_here(const PhBSchlickPhaseFunction&);
  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);
  
  PhBSchlickPhaseFunction();
  PhBSchlickPhaseFunction(const PhBSchlickPhaseFunction&);
  PhBSchlickPhaseFunction& operator=(const PhBSchlickPhaseFunction&);
  virtual ~PhBSchlickPhaseFunction();
  
  //
  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
  float albedo(const Vec3& inDir, int modes);
  Vec3 sample(const Vec3& inDir, float xi1, float xi2, int modes);
  float eval(const Vec3& inDir, const Vec3& outDir, int modes, float *pdf);
  
protected:
  inline void util_init(void) { }
  inline void util_clone(const PhBSchlickPhaseFunction& src) { }
  inline void util_destruct(void) { }
};

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