// PhBNormalMap.H: PhBNormalMap 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 _PhBNormalMap_H_
#define _PhBNormalMap_H_

#include "xrml.H"
#include "PhBSurfaceDistortion.H"
#include "PhBTexture.H"
#include "Transform.H"

// utility includes
// end of utility includes

namespace xrml {
#define PhBNormalMapTypeId 	"PhBNormalMap"
extern bool IsPhBNormalMap(SFNode*);

class PhBNormalMap: public virtual SFNode, public PhBSurfaceDistortion {
private:
  //
  void clone_here(const PhBNormalMap&);
  void destruct(void);
  
  // field/eventOut update status bits
  // Use xxx_is_updated() and xxx_clear_update() to inspect/reset.
  enum status_bits {
    texture_updated = 0x1,
    transform_updated = 0x2 
  };
  
public:
  //
  int major_version(void), minor_version(void);
  bool is_leaf_class(void);
  
  PhBNormalMap();
  PhBNormalMap(const PhBNormalMap&);
  PhBNormalMap& operator=(const PhBNormalMap&);
  virtual ~PhBNormalMap();
  
  //
  SFNode*          	instantiate(Proto * =0);
  void             	render(void);
  
  // state values:
  // Do not assign directly unless you know very well what you are doing.
  //  PhBTexture*      	texture;
  //  Transform*       	transform;
  
  // set_<exposedField> eventIns: with forwarding and eventOut generation
  void             	set_texture(SFNode*);
  void             	set_transform(SFNode*);
  
  // field assignement: no forwarding or eventOut generation!
  bool             	assign_texture(SFNode*);
  bool             	assign_transform(SFNode*);
  
  // update status
  inline bool      	texture_is_updated(void) { return (status & texture_updated); }
  inline void      	texture_clear_update(void) { status &= ~texture_updated; }
  inline bool      	transform_is_updated(void) { return (status & transform_updated); }
  inline void      	transform_clear_update(void) { status &= ~transform_updated; }
  
  // utility members
  Mat3 distort(const Vec3 point);
  
protected:
  inline void util_init(void) { }
  inline void util_clone(const PhBNormalMap& src) { }
  inline void util_destruct(void) { }
};

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