text: /* this file has been autogenerated by vtkNodeJsWrap */
  /* editing this might proof futile */
  
  #define VTK_WRAPPING_CXX
  #define VTK_STREAMS_FWD_ONLY
  #include <nan.h>
  
  #include "vtkDirectionEncoderWrap.h"
  #include "vtkSphericalDirectionEncoderWrap.h"
  #include "vtkObjectBaseWrap.h"
  #include "../../plus/plus.h"
  
  using namespace v8;
  
  extern Nan::Persistent<v8::Object> vtkNodeJsNoWrap;
  Nan::Persistent<v8::FunctionTemplate> VtkSphericalDirectionEncoderWrap::ptpl;
  
  VtkSphericalDirectionEncoderWrap::VtkSphericalDirectionEncoderWrap()
  { }
  
  VtkSphericalDirectionEncoderWrap::VtkSphericalDirectionEncoderWrap(vtkSmartPointer<vtkSphericalDirectionEncoder> _native)
  { native = _native; }
  
  VtkSphericalDirectionEncoderWrap::~VtkSphericalDirectionEncoderWrap()
  { }
  
  void VtkSphericalDirectionEncoderWrap::Init(v8::Local<v8::Object> exports)
  {
  	Nan::SetAccessor(exports, Nan::New("vtkSphericalDirectionEncoder").ToLocalChecked(), ConstructorGetter);
  	Nan::SetAccessor(exports, Nan::New("SphericalDirectionEncoder").ToLocalChecked(), ConstructorGetter);
  }
  
  void VtkSphericalDirectionEncoderWrap::ConstructorGetter(
  	v8::Local<v8::String> property,
  	const Nan::PropertyCallbackInfo<v8::Value>& info)
  {
  	InitPtpl();
  	info.GetReturnValue().Set(Nan::New(ptpl)->GetFunction());
  }
  
  void VtkSphericalDirectionEncoderWrap::InitPtpl()
  {
  	if (!ptpl.IsEmpty()) return;
  	v8::Local<v8::FunctionTemplate> tpl = Nan::New<v8::FunctionTemplate>(New);
  	VtkDirectionEncoderWrap::InitPtpl( );
  	tpl->Inherit(Nan::New<FunctionTemplate>(VtkDirectionEncoderWrap::ptpl));
  	tpl->SetClassName(Nan::New("VtkSphericalDirectionEncoderWrap").ToLocalChecked());
  	tpl->InstanceTemplate()->SetInternalFieldCount(1);
  
  	Nan::SetPrototypeMethod(tpl, "GetDecodedGradient", GetDecodedGradient);
  	Nan::SetPrototypeMethod(tpl, "getDecodedGradient", GetDecodedGradient);
  
  	Nan::SetPrototypeMethod(tpl, "GetEncodedDirection", GetEncodedDirection);
  	Nan::SetPrototypeMethod(tpl, "getEncodedDirection", GetEncodedDirection);
  
  	Nan::SetPrototypeMethod(tpl, "GetNumberOfEncodedDirections", GetNumberOfEncodedDirections);
  	Nan::SetPrototypeMethod(tpl, "getNumberOfEncodedDirections", GetNumberOfEncodedDirections);
  
  	Nan::SetPrototypeMethod(tpl, "NewInstance", NewInstance);
  	Nan::SetPrototypeMethod(tpl, "newInstance", NewInstance);
  
  	Nan::SetPrototypeMethod(tpl, "SafeDownCast", SafeDownCast);
  	Nan::SetPrototypeMethod(tpl, "safeDownCast", SafeDownCast);
  
  #ifdef VTK_NODE_PLUS_VTKSPHERICALDIRECTIONENCODERWRAP_INITPTPL
  	VTK_NODE_PLUS_VTKSPHERICALDIRECTIONENCODERWRAP_INITPTPL
  #endif
  	ptpl.Reset( tpl );
  }
  
  void VtkSphericalDirectionEncoderWrap::New(const Nan::FunctionCallbackInfo<v8::Value>& info)
  {
  	if(!info.IsConstructCall())
  	{
  		Nan::ThrowError("Constructor not called in a construct call.");
  		return;
  	}
  
  	if(info.Length() == 0)
  	{
  		vtkSmartPointer<vtkSphericalDirectionEncoder> native = vtkSmartPointer<vtkSphericalDirectionEncoder>::New();
  		VtkSphericalDirectionEncoderWrap* obj = new VtkSphericalDirectionEncoderWrap(native);
  		obj->Wrap(info.This());
  	}
  	else
  	{
  		if(info[0]->ToObject() != vtkNodeJsNoWrap )
  		{
  			Nan::ThrowError("Parameter Error");
  			return;
  		}
  	}
  
  	info.GetReturnValue().Set(info.This());
  }
  
  void VtkSphericalDirectionEncoderWrap::GetDecodedGradient(const Nan::FunctionCallbackInfo<v8::Value>& info)
  {
  	VtkSphericalDirectionEncoderWrap *wrapper = ObjectWrap::Unwrap<VtkSphericalDirectionEncoderWrap>(info.Holder());
  	vtkSphericalDirectionEncoder *native = (vtkSphericalDirectionEncoder *)wrapper->native.GetPointer();
  	if(info.Length() > 0 && info[0]->IsInt32())
  	{
  		float const * r;
  		if(info.Length() != 1)
  		{
  			Nan::ThrowError("Too many parameters.");
  			return;
  		}
  		r = native->GetDecodedGradient(
  			info[0]->Int32Value()
  		);
  		Local<v8::ArrayBuffer> ab = v8::ArrayBuffer::New(v8::Isolate::GetCurrent(), 3 * sizeof(float));
  		Local<v8::Float32Array> at = v8::Float32Array::New(ab, 0, 3);
  		memcpy(ab->GetContents().Data(), r, 3 * sizeof(float));
  		info.GetReturnValue().Set(at);
  		return;
  	}
  	Nan::ThrowError("Parameter mismatch");
  }
  
  void VtkSphericalDirectionEncoderWrap::GetEncodedDirection(const Nan::FunctionCallbackInfo<v8::Value>& info)
  {
  	VtkSphericalDirectionEncoderWrap *wrapper = ObjectWrap::Unwrap<VtkSphericalDirectionEncoderWrap>(info.Holder());
  	vtkSphericalDirectionEncoder *native = (vtkSphericalDirectionEncoder *)wrapper->native.GetPointer();
  	size_t i;
  	if(info.Length() > 0 && info[0]->IsFloat32Array())
  	{
  		v8::Local<v8::Float32Array>a0(v8::Local<v8::Float32Array>::Cast(info[0]->ToObject()));
  		if( a0->Length() < 3 )
  		{
  			Nan::ThrowError("Array too short.");
  			return;
  		}
  
  		int r;
  		if(info.Length() != 1)
  		{
  			Nan::ThrowError("Too many parameters.");
  			return;
  		}
  		r = native->GetEncodedDirection(
  			(float *)(a0->Buffer()->GetContents().Data())
  		);
  		info.GetReturnValue().Set(Nan::New(r));
  		return;
  	}
  	else if(info.Length() > 0 && info[0]->IsArray())
  	{
  		v8::Local<v8::Array>a0(v8::Local<v8::Array>::Cast(info[0]->ToObject()));
  		float b0[3];
  		if( a0->Length() < 3 )
  		{
  			Nan::ThrowError("Array too short.");
  			return;
  		}
  
  		for( i = 0; i < 3; i++ )
  		{
  			if( !a0->Get(i)->IsNumber() )
  			{
  				Nan::ThrowError("Array contents invalid.");
  				return;
  			}
  			b0[i] = a0->Get(i)->NumberValue();
  		}
  		int r;
  		if(info.Length() != 1)
  		{
  			Nan::ThrowError("Too many parameters.");
  			return;
  		}
  		r = native->GetEncodedDirection(
  			b0
  		);
  		info.GetReturnValue().Set(Nan::New(r));
  		return;
  	}
  	Nan::ThrowError("Parameter mismatch");
  }
  
  void VtkSphericalDirectionEncoderWrap::GetNumberOfEncodedDirections(const Nan::FunctionCallbackInfo<v8::Value>& info)
  {
  	VtkSphericalDirectionEncoderWrap *wrapper = ObjectWrap::Unwrap<VtkSphericalDirectionEncoderWrap>(info.Holder());
  	vtkSphericalDirectionEncoder *native = (vtkSphericalDirectionEncoder *)wrapper->native.GetPointer();
  	int r;
  	if(info.Length() != 0)
  	{
  		Nan::ThrowError("Too many parameters.");
  		return;
  	}
  	r = native->GetNumberOfEncodedDirections();
  	info.GetReturnValue().Set(Nan::New(r));
  }
  
  void VtkSphericalDirectionEncoderWrap::NewInstance(const Nan::FunctionCallbackInfo<v8::Value>& info)
  {
  	VtkSphericalDirectionEncoderWrap *wrapper = ObjectWrap::Unwrap<VtkSphericalDirectionEncoderWrap>(info.Holder());
  	vtkSphericalDirectionEncoder *native = (vtkSphericalDirectionEncoder *)wrapper->native.GetPointer();
  	vtkSphericalDirectionEncoder * r;
  	if(info.Length() != 0)
  	{
  		Nan::ThrowError("Too many parameters.");
  		return;
  	}
  	r = native->NewInstance();
  	VtkSphericalDirectionEncoderWrap::InitPtpl();
  	v8::Local<v8::Value> argv[1] =
  		{ Nan::New(vtkNodeJsNoWrap) };
  	v8::Local<v8::Function> cons =
  		Nan::New<v8::FunctionTemplate>(VtkSphericalDirectionEncoderWrap::ptpl)->GetFunction();
  	v8::Local<v8::Object> wo = cons->NewInstance(1, argv);
  	VtkSphericalDirectionEncoderWrap *w = new VtkSphericalDirectionEncoderWrap();
  	w->native = r;
  	w->Wrap(wo);
  	info.GetReturnValue().Set(wo);
  }
  
  void VtkSphericalDirectionEncoderWrap::SafeDownCast(const Nan::FunctionCallbackInfo<v8::Value>& info)
  {
  	VtkSphericalDirectionEncoderWrap *wrapper = ObjectWrap::Unwrap<VtkSphericalDirectionEncoderWrap>(info.Holder());
  	vtkSphericalDirectionEncoder *native = (vtkSphericalDirectionEncoder *)wrapper->native.GetPointer();
  	if(info.Length() > 0 && info[0]->IsObject() && (Nan::New(VtkObjectBaseWrap::ptpl))->HasInstance(info[0]))
  	{
  		VtkObjectBaseWrap *a0 = ObjectWrap::Unwrap<VtkObjectBaseWrap>(info[0]->ToObject());
  		vtkSphericalDirectionEncoder * r;
  		if(info.Length() != 1)
  		{
  			Nan::ThrowError("Too many parameters.");
  			return;
  		}
  		r = native->SafeDownCast(
  			(vtkObjectBase *) a0->native.GetPointer()
  		);
  		VtkSphericalDirectionEncoderWrap::InitPtpl();
  		v8::Local<v8::Value> argv[1] =
  			{ Nan::New(vtkNodeJsNoWrap) };
  		v8::Local<v8::Function> cons =
  			Nan::New<v8::FunctionTemplate>(VtkSphericalDirectionEncoderWrap::ptpl)->GetFunction();
  		v8::Local<v8::Object> wo = cons->NewInstance(1, argv);
  		VtkSphericalDirectionEncoderWrap *w = new VtkSphericalDirectionEncoderWrap();
  		w->native = r;
  		w->Wrap(wo);
  		info.GetReturnValue().Set(wo);
  		return;
  	}
  	Nan::ThrowError("Parameter mismatch");
  }
  
  