// PhBToggleTexture.H: PhBToggleTexture 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 _PhBToggleTexture_H_
#define _PhBToggleTexture_H_

#include "xrml.H"
#include "PhBImageTextureBase.H"

// utility includes
// end of utility includes

namespace xrml {
#define PhBToggleTextureTypeId 	"PhBToggleTexture"
extern bool IsPhBToggleTexture(SFNode*);

class PhBToggleTexture: public virtual SFNode, public PhBImageTextureBase {
private:
  //
  void clone_here(const PhBToggleTexture&);
  void destruct(void);
  
  // field/eventOut update status bits
  // Use xxx_is_updated() and xxx_clear_update() to inspect/reset.
  enum status_bits {
    url_updated = 0x1,
    clamping_updated = 0x2,
    repeating_updated = 0x4 
  };
  
public:
  //
  int major_version(void), minor_version(void);
  bool is_leaf_class(void);
  
  PhBToggleTexture();
  PhBToggleTexture(const PhBToggleTexture&);
  PhBToggleTexture& operator=(const PhBToggleTexture&);
  virtual ~PhBToggleTexture();
  
  //
  SFNode*          	instantiate(Proto * =0);
  void             	render(void);
  
  // state values:
  // Do not assign directly unless you know very well what you are doing.
  //  MFString         	url;
  //  SFBool           	clamping;
  //  SFBool           	repeating;
  
  // set_<exposedField> eventIns: with forwarding and eventOut generation
  void             	set_clamping(const SFBool&);
  void             	set_repeating(const SFBool&);
  
  // field assignement: no forwarding or eventOut generation!
  bool             	assign_url(const MFString&);
  bool             	assign_clamping(const SFBool&);
  bool             	assign_repeating(const SFBool&);
  
  // update status
  inline bool      	url_is_updated(void) { return (status & url_updated); }
  inline void      	url_clear_update(void) { status &= ~url_updated; }
  inline bool      	clamping_is_updated(void) { return (status & clamping_updated); }
  inline void      	clamping_clear_update(void) { status &= ~clamping_updated; }
  inline bool      	repeating_is_updated(void) { return (status & repeating_updated); }
  inline void      	repeating_clear_update(void) { status &= ~repeating_updated; }
  
  // utility members
  float value[2];       // dummy var to return 2 channels
  long  nrChannels(void) { return(2); }

protected:
  float *getpixel(long i, long j);

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

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