/* 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 "vtkScalarsToColorsWrap.h"
#include "vtkColorTransferFunctionWrap.h"
#include "vtkObjectWrap.h"
#include "../../plus/plus.h"

using namespace v8;

extern Nan::Persistent<v8::Object> vtkNodeJsNoWrap;
Nan::Persistent<v8::FunctionTemplate> VtkColorTransferFunctionWrap::ptpl;

VtkColorTransferFunctionWrap::VtkColorTransferFunctionWrap()
{ }

VtkColorTransferFunctionWrap::VtkColorTransferFunctionWrap(vtkSmartPointer<vtkColorTransferFunction> _native)
{ native = _native; }

VtkColorTransferFunctionWrap::~VtkColorTransferFunctionWrap()
{ }

void VtkColorTransferFunctionWrap::Init(v8::Local<v8::Object> exports)
{
	Nan::SetAccessor(exports, Nan::New("vtkColorTransferFunction").ToLocalChecked(), ConstructorGetter);
	Nan::SetAccessor(exports, Nan::New("ColorTransferFunction").ToLocalChecked(), ConstructorGetter);
}

void VtkColorTransferFunctionWrap::ConstructorGetter(
	v8::Local<v8::String> property,
	const Nan::PropertyCallbackInfo<v8::Value>& info)
{
	InitPtpl();
	info.GetReturnValue().Set(Nan::New(ptpl)->GetFunction());
}

void VtkColorTransferFunctionWrap::InitPtpl()
{
	if (!ptpl.IsEmpty()) return;
	v8::Local<v8::FunctionTemplate> tpl = Nan::New<v8::FunctionTemplate>(New);
	VtkScalarsToColorsWrap::InitPtpl( );
	tpl->Inherit(Nan::New<FunctionTemplate>(VtkScalarsToColorsWrap::ptpl));
	tpl->SetClassName(Nan::New("VtkColorTransferFunctionWrap").ToLocalChecked());
	tpl->InstanceTemplate()->SetInternalFieldCount(1);

	Nan::SetPrototypeMethod(tpl, "AddHSVPoint", AddHSVPoint);
	Nan::SetPrototypeMethod(tpl, "addHSVPoint", AddHSVPoint);

	Nan::SetPrototypeMethod(tpl, "AddHSVSegment", AddHSVSegment);
	Nan::SetPrototypeMethod(tpl, "addHSVSegment", AddHSVSegment);

	Nan::SetPrototypeMethod(tpl, "AddRGBPoint", AddRGBPoint);
	Nan::SetPrototypeMethod(tpl, "addRGBPoint", AddRGBPoint);

	Nan::SetPrototypeMethod(tpl, "AddRGBSegment", AddRGBSegment);
	Nan::SetPrototypeMethod(tpl, "addRGBSegment", AddRGBSegment);

	Nan::SetPrototypeMethod(tpl, "AdjustRange", AdjustRange);
	Nan::SetPrototypeMethod(tpl, "adjustRange", AdjustRange);

	Nan::SetPrototypeMethod(tpl, "AllowDuplicateScalarsOff", AllowDuplicateScalarsOff);
	Nan::SetPrototypeMethod(tpl, "allowDuplicateScalarsOff", AllowDuplicateScalarsOff);

	Nan::SetPrototypeMethod(tpl, "AllowDuplicateScalarsOn", AllowDuplicateScalarsOn);
	Nan::SetPrototypeMethod(tpl, "allowDuplicateScalarsOn", AllowDuplicateScalarsOn);

	Nan::SetPrototypeMethod(tpl, "ClampingOff", ClampingOff);
	Nan::SetPrototypeMethod(tpl, "clampingOff", ClampingOff);

	Nan::SetPrototypeMethod(tpl, "ClampingOn", ClampingOn);
	Nan::SetPrototypeMethod(tpl, "clampingOn", ClampingOn);

	Nan::SetPrototypeMethod(tpl, "DeepCopy", DeepCopy);
	Nan::SetPrototypeMethod(tpl, "deepCopy", DeepCopy);

	Nan::SetPrototypeMethod(tpl, "GetAboveRangeColor", GetAboveRangeColor);
	Nan::SetPrototypeMethod(tpl, "getAboveRangeColor", GetAboveRangeColor);

	Nan::SetPrototypeMethod(tpl, "GetAllowDuplicateScalars", GetAllowDuplicateScalars);
	Nan::SetPrototypeMethod(tpl, "getAllowDuplicateScalars", GetAllowDuplicateScalars);

	Nan::SetPrototypeMethod(tpl, "GetBelowRangeColor", GetBelowRangeColor);
	Nan::SetPrototypeMethod(tpl, "getBelowRangeColor", GetBelowRangeColor);

	Nan::SetPrototypeMethod(tpl, "GetBlueValue", GetBlueValue);
	Nan::SetPrototypeMethod(tpl, "getBlueValue", GetBlueValue);

	Nan::SetPrototypeMethod(tpl, "GetClamping", GetClamping);
	Nan::SetPrototypeMethod(tpl, "getClamping", GetClamping);

	Nan::SetPrototypeMethod(tpl, "GetClampingMaxValue", GetClampingMaxValue);
	Nan::SetPrototypeMethod(tpl, "getClampingMaxValue", GetClampingMaxValue);

	Nan::SetPrototypeMethod(tpl, "GetClampingMinValue", GetClampingMinValue);
	Nan::SetPrototypeMethod(tpl, "getClampingMinValue", GetClampingMinValue);

	Nan::SetPrototypeMethod(tpl, "GetClassName", GetClassName);
	Nan::SetPrototypeMethod(tpl, "getClassName", GetClassName);

	Nan::SetPrototypeMethod(tpl, "GetColor", GetColor);
	Nan::SetPrototypeMethod(tpl, "getColor", GetColor);

	Nan::SetPrototypeMethod(tpl, "GetColorSpace", GetColorSpace);
	Nan::SetPrototypeMethod(tpl, "getColorSpace", GetColorSpace);

	Nan::SetPrototypeMethod(tpl, "GetColorSpaceMaxValue", GetColorSpaceMaxValue);
	Nan::SetPrototypeMethod(tpl, "getColorSpaceMaxValue", GetColorSpaceMaxValue);

	Nan::SetPrototypeMethod(tpl, "GetColorSpaceMinValue", GetColorSpaceMinValue);
	Nan::SetPrototypeMethod(tpl, "getColorSpaceMinValue", GetColorSpaceMinValue);

	Nan::SetPrototypeMethod(tpl, "GetGreenValue", GetGreenValue);
	Nan::SetPrototypeMethod(tpl, "getGreenValue", GetGreenValue);

	Nan::SetPrototypeMethod(tpl, "GetHSVWrap", GetHSVWrap);
	Nan::SetPrototypeMethod(tpl, "getHSVWrap", GetHSVWrap);

	Nan::SetPrototypeMethod(tpl, "GetNanColor", GetNanColor);
	Nan::SetPrototypeMethod(tpl, "getNanColor", GetNanColor);

	Nan::SetPrototypeMethod(tpl, "GetNodeValue", GetNodeValue);
	Nan::SetPrototypeMethod(tpl, "getNodeValue", GetNodeValue);

	Nan::SetPrototypeMethod(tpl, "GetRange", GetRange);
	Nan::SetPrototypeMethod(tpl, "getRange", GetRange);

	Nan::SetPrototypeMethod(tpl, "GetRedValue", GetRedValue);
	Nan::SetPrototypeMethod(tpl, "getRedValue", GetRedValue);

	Nan::SetPrototypeMethod(tpl, "GetScale", GetScale);
	Nan::SetPrototypeMethod(tpl, "getScale", GetScale);

	Nan::SetPrototypeMethod(tpl, "GetSize", GetSize);
	Nan::SetPrototypeMethod(tpl, "getSize", GetSize);

	Nan::SetPrototypeMethod(tpl, "GetUseAboveRangeColor", GetUseAboveRangeColor);
	Nan::SetPrototypeMethod(tpl, "getUseAboveRangeColor", GetUseAboveRangeColor);

	Nan::SetPrototypeMethod(tpl, "GetUseBelowRangeColor", GetUseBelowRangeColor);
	Nan::SetPrototypeMethod(tpl, "getUseBelowRangeColor", GetUseBelowRangeColor);

	Nan::SetPrototypeMethod(tpl, "HSVWrapOff", HSVWrapOff);
	Nan::SetPrototypeMethod(tpl, "hSVWrapOff", HSVWrapOff);

	Nan::SetPrototypeMethod(tpl, "HSVWrapOn", HSVWrapOn);
	Nan::SetPrototypeMethod(tpl, "hSVWrapOn", HSVWrapOn);

	Nan::SetPrototypeMethod(tpl, "IsA", IsA);
	Nan::SetPrototypeMethod(tpl, "isA", IsA);

	Nan::SetPrototypeMethod(tpl, "NewInstance", NewInstance);
	Nan::SetPrototypeMethod(tpl, "newInstance", NewInstance);

	Nan::SetPrototypeMethod(tpl, "RemoveAllPoints", RemoveAllPoints);
	Nan::SetPrototypeMethod(tpl, "removeAllPoints", RemoveAllPoints);

	Nan::SetPrototypeMethod(tpl, "RemovePoint", RemovePoint);
	Nan::SetPrototypeMethod(tpl, "removePoint", RemovePoint);

	Nan::SetPrototypeMethod(tpl, "SafeDownCast", SafeDownCast);
	Nan::SetPrototypeMethod(tpl, "safeDownCast", SafeDownCast);

	Nan::SetPrototypeMethod(tpl, "SetAboveRangeColor", SetAboveRangeColor);
	Nan::SetPrototypeMethod(tpl, "setAboveRangeColor", SetAboveRangeColor);

	Nan::SetPrototypeMethod(tpl, "SetAllowDuplicateScalars", SetAllowDuplicateScalars);
	Nan::SetPrototypeMethod(tpl, "setAllowDuplicateScalars", SetAllowDuplicateScalars);

	Nan::SetPrototypeMethod(tpl, "SetBelowRangeColor", SetBelowRangeColor);
	Nan::SetPrototypeMethod(tpl, "setBelowRangeColor", SetBelowRangeColor);

	Nan::SetPrototypeMethod(tpl, "SetClamping", SetClamping);
	Nan::SetPrototypeMethod(tpl, "setClamping", SetClamping);

	Nan::SetPrototypeMethod(tpl, "SetColorSpace", SetColorSpace);
	Nan::SetPrototypeMethod(tpl, "setColorSpace", SetColorSpace);

	Nan::SetPrototypeMethod(tpl, "SetColorSpaceToDiverging", SetColorSpaceToDiverging);
	Nan::SetPrototypeMethod(tpl, "setColorSpaceToDiverging", SetColorSpaceToDiverging);

	Nan::SetPrototypeMethod(tpl, "SetColorSpaceToHSV", SetColorSpaceToHSV);
	Nan::SetPrototypeMethod(tpl, "setColorSpaceToHSV", SetColorSpaceToHSV);

	Nan::SetPrototypeMethod(tpl, "SetColorSpaceToLab", SetColorSpaceToLab);
	Nan::SetPrototypeMethod(tpl, "setColorSpaceToLab", SetColorSpaceToLab);

	Nan::SetPrototypeMethod(tpl, "SetColorSpaceToRGB", SetColorSpaceToRGB);
	Nan::SetPrototypeMethod(tpl, "setColorSpaceToRGB", SetColorSpaceToRGB);

	Nan::SetPrototypeMethod(tpl, "SetHSVWrap", SetHSVWrap);
	Nan::SetPrototypeMethod(tpl, "setHSVWrap", SetHSVWrap);

	Nan::SetPrototypeMethod(tpl, "SetNanColor", SetNanColor);
	Nan::SetPrototypeMethod(tpl, "setNanColor", SetNanColor);

	Nan::SetPrototypeMethod(tpl, "SetNodeValue", SetNodeValue);
	Nan::SetPrototypeMethod(tpl, "setNodeValue", SetNodeValue);

	Nan::SetPrototypeMethod(tpl, "SetScale", SetScale);
	Nan::SetPrototypeMethod(tpl, "setScale", SetScale);

	Nan::SetPrototypeMethod(tpl, "SetScaleToLinear", SetScaleToLinear);
	Nan::SetPrototypeMethod(tpl, "setScaleToLinear", SetScaleToLinear);

	Nan::SetPrototypeMethod(tpl, "SetScaleToLog10", SetScaleToLog10);
	Nan::SetPrototypeMethod(tpl, "setScaleToLog10", SetScaleToLog10);

	Nan::SetPrototypeMethod(tpl, "SetUseAboveRangeColor", SetUseAboveRangeColor);
	Nan::SetPrototypeMethod(tpl, "setUseAboveRangeColor", SetUseAboveRangeColor);

	Nan::SetPrototypeMethod(tpl, "SetUseBelowRangeColor", SetUseBelowRangeColor);
	Nan::SetPrototypeMethod(tpl, "setUseBelowRangeColor", SetUseBelowRangeColor);

	Nan::SetPrototypeMethod(tpl, "ShallowCopy", ShallowCopy);
	Nan::SetPrototypeMethod(tpl, "shallowCopy", ShallowCopy);

	Nan::SetPrototypeMethod(tpl, "UseAboveRangeColorOff", UseAboveRangeColorOff);
	Nan::SetPrototypeMethod(tpl, "useAboveRangeColorOff", UseAboveRangeColorOff);

	Nan::SetPrototypeMethod(tpl, "UseAboveRangeColorOn", UseAboveRangeColorOn);
	Nan::SetPrototypeMethod(tpl, "useAboveRangeColorOn", UseAboveRangeColorOn);

	Nan::SetPrototypeMethod(tpl, "UseBelowRangeColorOff", UseBelowRangeColorOff);
	Nan::SetPrototypeMethod(tpl, "useBelowRangeColorOff", UseBelowRangeColorOff);

	Nan::SetPrototypeMethod(tpl, "UseBelowRangeColorOn", UseBelowRangeColorOn);
	Nan::SetPrototypeMethod(tpl, "useBelowRangeColorOn", UseBelowRangeColorOn);

#ifdef VTK_NODE_PLUS_VTKCOLORTRANSFERFUNCTIONWRAP_INITPTPL
	VTK_NODE_PLUS_VTKCOLORTRANSFERFUNCTIONWRAP_INITPTPL
#endif
	ptpl.Reset( tpl );
}

void VtkColorTransferFunctionWrap::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<vtkColorTransferFunction> native = vtkSmartPointer<vtkColorTransferFunction>::New();
		VtkColorTransferFunctionWrap* obj = new VtkColorTransferFunctionWrap(native);
		obj->Wrap(info.This());
	}
	else
	{
		if(info[0]->ToObject() != vtkNodeJsNoWrap )
		{
			Nan::ThrowError("Parameter Error");
			return;
		}
	}

	info.GetReturnValue().Set(info.This());
}

void VtkColorTransferFunctionWrap::AddHSVPoint(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsNumber())
	{
		if(info.Length() > 1 && info[1]->IsNumber())
		{
			if(info.Length() > 2 && info[2]->IsNumber())
			{
				if(info.Length() > 3 && info[3]->IsNumber())
				{
					if(info.Length() > 4 && info[4]->IsNumber())
					{
						if(info.Length() > 5 && info[5]->IsNumber())
						{
							int r;
							if(info.Length() != 6)
							{
								Nan::ThrowError("Too many parameters.");
								return;
							}
							r = native->AddHSVPoint(
								info[0]->NumberValue(),
								info[1]->NumberValue(),
								info[2]->NumberValue(),
								info[3]->NumberValue(),
								info[4]->NumberValue(),
								info[5]->NumberValue()
							);
							info.GetReturnValue().Set(Nan::New(r));
							return;
						}
					}
					int r;
					if(info.Length() != 4)
					{
						Nan::ThrowError("Too many parameters.");
						return;
					}
					r = native->AddHSVPoint(
						info[0]->NumberValue(),
						info[1]->NumberValue(),
						info[2]->NumberValue(),
						info[3]->NumberValue()
					);
					info.GetReturnValue().Set(Nan::New(r));
					return;
				}
			}
		}
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkColorTransferFunctionWrap::AddHSVSegment(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsNumber())
	{
		if(info.Length() > 1 && info[1]->IsNumber())
		{
			if(info.Length() > 2 && info[2]->IsNumber())
			{
				if(info.Length() > 3 && info[3]->IsNumber())
				{
					if(info.Length() > 4 && info[4]->IsNumber())
					{
						if(info.Length() > 5 && info[5]->IsNumber())
						{
							if(info.Length() > 6 && info[6]->IsNumber())
							{
								if(info.Length() > 7 && info[7]->IsNumber())
								{
																		if(info.Length() != 8)
									{
										Nan::ThrowError("Too many parameters.");
										return;
									}
									native->AddHSVSegment(
										info[0]->NumberValue(),
										info[1]->NumberValue(),
										info[2]->NumberValue(),
										info[3]->NumberValue(),
										info[4]->NumberValue(),
										info[5]->NumberValue(),
										info[6]->NumberValue(),
										info[7]->NumberValue()
									);
									return;
								}
							}
						}
					}
				}
			}
		}
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkColorTransferFunctionWrap::AddRGBPoint(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsNumber())
	{
		if(info.Length() > 1 && info[1]->IsNumber())
		{
			if(info.Length() > 2 && info[2]->IsNumber())
			{
				if(info.Length() > 3 && info[3]->IsNumber())
				{
					if(info.Length() > 4 && info[4]->IsNumber())
					{
						if(info.Length() > 5 && info[5]->IsNumber())
						{
							int r;
							if(info.Length() != 6)
							{
								Nan::ThrowError("Too many parameters.");
								return;
							}
							r = native->AddRGBPoint(
								info[0]->NumberValue(),
								info[1]->NumberValue(),
								info[2]->NumberValue(),
								info[3]->NumberValue(),
								info[4]->NumberValue(),
								info[5]->NumberValue()
							);
							info.GetReturnValue().Set(Nan::New(r));
							return;
						}
					}
					int r;
					if(info.Length() != 4)
					{
						Nan::ThrowError("Too many parameters.");
						return;
					}
					r = native->AddRGBPoint(
						info[0]->NumberValue(),
						info[1]->NumberValue(),
						info[2]->NumberValue(),
						info[3]->NumberValue()
					);
					info.GetReturnValue().Set(Nan::New(r));
					return;
				}
			}
		}
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkColorTransferFunctionWrap::AddRGBSegment(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsNumber())
	{
		if(info.Length() > 1 && info[1]->IsNumber())
		{
			if(info.Length() > 2 && info[2]->IsNumber())
			{
				if(info.Length() > 3 && info[3]->IsNumber())
				{
					if(info.Length() > 4 && info[4]->IsNumber())
					{
						if(info.Length() > 5 && info[5]->IsNumber())
						{
							if(info.Length() > 6 && info[6]->IsNumber())
							{
								if(info.Length() > 7 && info[7]->IsNumber())
								{
																		if(info.Length() != 8)
									{
										Nan::ThrowError("Too many parameters.");
										return;
									}
									native->AddRGBSegment(
										info[0]->NumberValue(),
										info[1]->NumberValue(),
										info[2]->NumberValue(),
										info[3]->NumberValue(),
										info[4]->NumberValue(),
										info[5]->NumberValue(),
										info[6]->NumberValue(),
										info[7]->NumberValue()
									);
									return;
								}
							}
						}
					}
				}
			}
		}
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkColorTransferFunctionWrap::AdjustRange(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	size_t i;
	if(info.Length() > 0 && info[0]->IsFloat64Array())
	{
		v8::Local<v8::Float64Array>a0(v8::Local<v8::Float64Array>::Cast(info[0]->ToObject()));
		if( a0->Length() < 2 )
		{
			Nan::ThrowError("Array too short.");
			return;
		}

		int r;
		if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		r = native->AdjustRange(
			(double *)(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()));
		double b0[2];
		if( a0->Length() < 2 )
		{
			Nan::ThrowError("Array too short.");
			return;
		}

		for( i = 0; i < 2; 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->AdjustRange(
			b0
		);
		info.GetReturnValue().Set(Nan::New(r));
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkColorTransferFunctionWrap::AllowDuplicateScalarsOff(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
		if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	native->AllowDuplicateScalarsOff();
}

void VtkColorTransferFunctionWrap::AllowDuplicateScalarsOn(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
		if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	native->AllowDuplicateScalarsOn();
}

void VtkColorTransferFunctionWrap::ClampingOff(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
		if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	native->ClampingOff();
}

void VtkColorTransferFunctionWrap::ClampingOn(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
		if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	native->ClampingOn();
}

void VtkColorTransferFunctionWrap::DeepCopy(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsObject() && (Nan::New(VtkScalarsToColorsWrap::ptpl))->HasInstance(info[0]))
	{
		VtkScalarsToColorsWrap *a0 = ObjectWrap::Unwrap<VtkScalarsToColorsWrap>(info[0]->ToObject());
				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->DeepCopy(
			(vtkScalarsToColors *) a0->native.GetPointer()
		);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkColorTransferFunctionWrap::GetAboveRangeColor(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	double const * r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetAboveRangeColor();
	Local<v8::ArrayBuffer> ab = v8::ArrayBuffer::New(v8::Isolate::GetCurrent(), 3 * sizeof(double));
	Local<v8::Float64Array> at = v8::Float64Array::New(ab, 0, 3);
	memcpy(ab->GetContents().Data(), r, 3 * sizeof(double));
	info.GetReturnValue().Set(at);
}

void VtkColorTransferFunctionWrap::GetAllowDuplicateScalars(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	int r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetAllowDuplicateScalars();
	info.GetReturnValue().Set(Nan::New(r));
}

void VtkColorTransferFunctionWrap::GetBelowRangeColor(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	double const * r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetBelowRangeColor();
	Local<v8::ArrayBuffer> ab = v8::ArrayBuffer::New(v8::Isolate::GetCurrent(), 3 * sizeof(double));
	Local<v8::Float64Array> at = v8::Float64Array::New(ab, 0, 3);
	memcpy(ab->GetContents().Data(), r, 3 * sizeof(double));
	info.GetReturnValue().Set(at);
}

void VtkColorTransferFunctionWrap::GetBlueValue(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsNumber())
	{
		double r;
		if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		r = native->GetBlueValue(
			info[0]->NumberValue()
		);
		info.GetReturnValue().Set(Nan::New(r));
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkColorTransferFunctionWrap::GetClamping(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	int r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetClamping();
	info.GetReturnValue().Set(Nan::New(r));
}

void VtkColorTransferFunctionWrap::GetClampingMaxValue(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	int r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetClampingMaxValue();
	info.GetReturnValue().Set(Nan::New(r));
}

void VtkColorTransferFunctionWrap::GetClampingMinValue(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	int r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetClampingMinValue();
	info.GetReturnValue().Set(Nan::New(r));
}

void VtkColorTransferFunctionWrap::GetClassName(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	char const * r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetClassName();
	info.GetReturnValue().Set(Nan::New(r).ToLocalChecked());
}

void VtkColorTransferFunctionWrap::GetColor(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	size_t i;
	if(info.Length() > 0 && info[0]->IsNumber())
	{
		if(info.Length() > 1 && info[1]->IsFloat64Array())
		{
			v8::Local<v8::Float64Array>a1(v8::Local<v8::Float64Array>::Cast(info[1]->ToObject()));
			if( a1->Length() < 3 )
			{
				Nan::ThrowError("Array too short.");
				return;
			}

						if(info.Length() != 2)
			{
				Nan::ThrowError("Too many parameters.");
				return;
			}
			native->GetColor(
				info[0]->NumberValue(),
				(double *)(a1->Buffer()->GetContents().Data())
			);
			return;
		}
		else if(info.Length() > 1 && info[1]->IsArray())
		{
			v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject()));
			double b1[3];
			if( a1->Length() < 3 )
			{
				Nan::ThrowError("Array too short.");
				return;
			}

			for( i = 0; i < 3; i++ )
			{
				if( !a1->Get(i)->IsNumber() )
				{
					Nan::ThrowError("Array contents invalid.");
					return;
				}
				b1[i] = a1->Get(i)->NumberValue();
			}
						if(info.Length() != 2)
			{
				Nan::ThrowError("Too many parameters.");
				return;
			}
			native->GetColor(
				info[0]->NumberValue(),
				b1
			);
			return;
		}
		double const * r;
		if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		r = native->GetColor(
			info[0]->NumberValue()
		);
		Local<v8::ArrayBuffer> ab = v8::ArrayBuffer::New(v8::Isolate::GetCurrent(), 3 * sizeof(double));
		Local<v8::Float64Array> at = v8::Float64Array::New(ab, 0, 3);
		memcpy(ab->GetContents().Data(), r, 3 * sizeof(double));
		info.GetReturnValue().Set(at);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkColorTransferFunctionWrap::GetColorSpace(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	int r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetColorSpace();
	info.GetReturnValue().Set(Nan::New(r));
}

void VtkColorTransferFunctionWrap::GetColorSpaceMaxValue(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	int r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetColorSpaceMaxValue();
	info.GetReturnValue().Set(Nan::New(r));
}

void VtkColorTransferFunctionWrap::GetColorSpaceMinValue(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	int r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetColorSpaceMinValue();
	info.GetReturnValue().Set(Nan::New(r));
}

void VtkColorTransferFunctionWrap::GetGreenValue(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsNumber())
	{
		double r;
		if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		r = native->GetGreenValue(
			info[0]->NumberValue()
		);
		info.GetReturnValue().Set(Nan::New(r));
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkColorTransferFunctionWrap::GetHSVWrap(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	int r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetHSVWrap();
	info.GetReturnValue().Set(Nan::New(r));
}

void VtkColorTransferFunctionWrap::GetNanColor(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	double const * r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetNanColor();
	Local<v8::ArrayBuffer> ab = v8::ArrayBuffer::New(v8::Isolate::GetCurrent(), 3 * sizeof(double));
	Local<v8::Float64Array> at = v8::Float64Array::New(ab, 0, 3);
	memcpy(ab->GetContents().Data(), r, 3 * sizeof(double));
	info.GetReturnValue().Set(at);
}

void VtkColorTransferFunctionWrap::GetNodeValue(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	size_t i;
	if(info.Length() > 0 && info[0]->IsInt32())
	{
		if(info.Length() > 1 && info[1]->IsFloat64Array())
		{
			v8::Local<v8::Float64Array>a1(v8::Local<v8::Float64Array>::Cast(info[1]->ToObject()));
			if( a1->Length() < 6 )
			{
				Nan::ThrowError("Array too short.");
				return;
			}

			int r;
			if(info.Length() != 2)
			{
				Nan::ThrowError("Too many parameters.");
				return;
			}
			r = native->GetNodeValue(
				info[0]->Int32Value(),
				(double *)(a1->Buffer()->GetContents().Data())
			);
			info.GetReturnValue().Set(Nan::New(r));
			return;
		}
		else if(info.Length() > 1 && info[1]->IsArray())
		{
			v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject()));
			double b1[6];
			if( a1->Length() < 6 )
			{
				Nan::ThrowError("Array too short.");
				return;
			}

			for( i = 0; i < 6; i++ )
			{
				if( !a1->Get(i)->IsNumber() )
				{
					Nan::ThrowError("Array contents invalid.");
					return;
				}
				b1[i] = a1->Get(i)->NumberValue();
			}
			int r;
			if(info.Length() != 2)
			{
				Nan::ThrowError("Too many parameters.");
				return;
			}
			r = native->GetNodeValue(
				info[0]->Int32Value(),
				b1
			);
			info.GetReturnValue().Set(Nan::New(r));
			return;
		}
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkColorTransferFunctionWrap::GetRange(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	double const * r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetRange();
	Local<v8::ArrayBuffer> ab = v8::ArrayBuffer::New(v8::Isolate::GetCurrent(), 2 * sizeof(double));
	Local<v8::Float64Array> at = v8::Float64Array::New(ab, 0, 2);
	memcpy(ab->GetContents().Data(), r, 2 * sizeof(double));
	info.GetReturnValue().Set(at);
}

void VtkColorTransferFunctionWrap::GetRedValue(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsNumber())
	{
		double r;
		if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		r = native->GetRedValue(
			info[0]->NumberValue()
		);
		info.GetReturnValue().Set(Nan::New(r));
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkColorTransferFunctionWrap::GetScale(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	int r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetScale();
	info.GetReturnValue().Set(Nan::New(r));
}

void VtkColorTransferFunctionWrap::GetSize(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	int r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetSize();
	info.GetReturnValue().Set(Nan::New(r));
}

void VtkColorTransferFunctionWrap::GetUseAboveRangeColor(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	int r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetUseAboveRangeColor();
	info.GetReturnValue().Set(Nan::New(r));
}

void VtkColorTransferFunctionWrap::GetUseBelowRangeColor(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	int r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetUseBelowRangeColor();
	info.GetReturnValue().Set(Nan::New(r));
}

void VtkColorTransferFunctionWrap::HSVWrapOff(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
		if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	native->HSVWrapOff();
}

void VtkColorTransferFunctionWrap::HSVWrapOn(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
		if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	native->HSVWrapOn();
}

void VtkColorTransferFunctionWrap::IsA(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsString())
	{
		Nan::Utf8String a0(info[0]);
		int r;
		if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		r = native->IsA(
			*a0
		);
		info.GetReturnValue().Set(Nan::New(r));
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkColorTransferFunctionWrap::NewInstance(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	vtkColorTransferFunction * r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->NewInstance();
	VtkColorTransferFunctionWrap::InitPtpl();
	v8::Local<v8::Value> argv[1] =
		{ Nan::New(vtkNodeJsNoWrap) };
	v8::Local<v8::Function> cons =
		Nan::New<v8::FunctionTemplate>(VtkColorTransferFunctionWrap::ptpl)->GetFunction();
	v8::Local<v8::Object> wo = cons->NewInstance(1, argv);
	VtkColorTransferFunctionWrap *w = new VtkColorTransferFunctionWrap();
	w->native = r;
	w->Wrap(wo);
	info.GetReturnValue().Set(wo);
}

void VtkColorTransferFunctionWrap::RemoveAllPoints(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
		if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	native->RemoveAllPoints();
}

void VtkColorTransferFunctionWrap::RemovePoint(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsNumber())
	{
		int r;
		if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		r = native->RemovePoint(
			info[0]->NumberValue()
		);
		info.GetReturnValue().Set(Nan::New(r));
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkColorTransferFunctionWrap::SafeDownCast(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsObject() && (Nan::New(VtkObjectWrap::ptpl))->HasInstance(info[0]))
	{
		VtkObjectWrap *a0 = ObjectWrap::Unwrap<VtkObjectWrap>(info[0]->ToObject());
		vtkColorTransferFunction * r;
		if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		r = native->SafeDownCast(
			(vtkObject *) a0->native.GetPointer()
		);
		VtkColorTransferFunctionWrap::InitPtpl();
		v8::Local<v8::Value> argv[1] =
			{ Nan::New(vtkNodeJsNoWrap) };
		v8::Local<v8::Function> cons =
			Nan::New<v8::FunctionTemplate>(VtkColorTransferFunctionWrap::ptpl)->GetFunction();
		v8::Local<v8::Object> wo = cons->NewInstance(1, argv);
		VtkColorTransferFunctionWrap *w = new VtkColorTransferFunctionWrap();
		w->native = r;
		w->Wrap(wo);
		info.GetReturnValue().Set(wo);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkColorTransferFunctionWrap::SetAboveRangeColor(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	size_t i;
	if(info.Length() > 0 && info[0]->IsFloat64Array())
	{
		v8::Local<v8::Float64Array>a0(v8::Local<v8::Float64Array>::Cast(info[0]->ToObject()));
		if( a0->Length() < 3 )
		{
			Nan::ThrowError("Array too short.");
			return;
		}

				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->SetAboveRangeColor(
			(double *)(a0->Buffer()->GetContents().Data())
		);
		return;
	}
	else if(info.Length() > 0 && info[0]->IsArray())
	{
		v8::Local<v8::Array>a0(v8::Local<v8::Array>::Cast(info[0]->ToObject()));
		double 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();
		}
				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->SetAboveRangeColor(
			b0
		);
		return;
	}
	else if(info.Length() > 0 && info[0]->IsNumber())
	{
		if(info.Length() > 1 && info[1]->IsNumber())
		{
			if(info.Length() > 2 && info[2]->IsNumber())
			{
								if(info.Length() != 3)
				{
					Nan::ThrowError("Too many parameters.");
					return;
				}
				native->SetAboveRangeColor(
					info[0]->NumberValue(),
					info[1]->NumberValue(),
					info[2]->NumberValue()
				);
				return;
			}
		}
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkColorTransferFunctionWrap::SetAllowDuplicateScalars(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsInt32())
	{
				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->SetAllowDuplicateScalars(
			info[0]->Int32Value()
		);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkColorTransferFunctionWrap::SetBelowRangeColor(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	size_t i;
	if(info.Length() > 0 && info[0]->IsFloat64Array())
	{
		v8::Local<v8::Float64Array>a0(v8::Local<v8::Float64Array>::Cast(info[0]->ToObject()));
		if( a0->Length() < 3 )
		{
			Nan::ThrowError("Array too short.");
			return;
		}

				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->SetBelowRangeColor(
			(double *)(a0->Buffer()->GetContents().Data())
		);
		return;
	}
	else if(info.Length() > 0 && info[0]->IsArray())
	{
		v8::Local<v8::Array>a0(v8::Local<v8::Array>::Cast(info[0]->ToObject()));
		double 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();
		}
				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->SetBelowRangeColor(
			b0
		);
		return;
	}
	else if(info.Length() > 0 && info[0]->IsNumber())
	{
		if(info.Length() > 1 && info[1]->IsNumber())
		{
			if(info.Length() > 2 && info[2]->IsNumber())
			{
								if(info.Length() != 3)
				{
					Nan::ThrowError("Too many parameters.");
					return;
				}
				native->SetBelowRangeColor(
					info[0]->NumberValue(),
					info[1]->NumberValue(),
					info[2]->NumberValue()
				);
				return;
			}
		}
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkColorTransferFunctionWrap::SetClamping(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsInt32())
	{
				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->SetClamping(
			info[0]->Int32Value()
		);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkColorTransferFunctionWrap::SetColorSpace(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsInt32())
	{
				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->SetColorSpace(
			info[0]->Int32Value()
		);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkColorTransferFunctionWrap::SetColorSpaceToDiverging(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
		if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	native->SetColorSpaceToDiverging();
}

void VtkColorTransferFunctionWrap::SetColorSpaceToHSV(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
		if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	native->SetColorSpaceToHSV();
}

void VtkColorTransferFunctionWrap::SetColorSpaceToLab(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
		if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	native->SetColorSpaceToLab();
}

void VtkColorTransferFunctionWrap::SetColorSpaceToRGB(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
		if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	native->SetColorSpaceToRGB();
}

void VtkColorTransferFunctionWrap::SetHSVWrap(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsInt32())
	{
				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->SetHSVWrap(
			info[0]->Int32Value()
		);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkColorTransferFunctionWrap::SetNanColor(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	size_t i;
	if(info.Length() > 0 && info[0]->IsFloat64Array())
	{
		v8::Local<v8::Float64Array>a0(v8::Local<v8::Float64Array>::Cast(info[0]->ToObject()));
		if( a0->Length() < 3 )
		{
			Nan::ThrowError("Array too short.");
			return;
		}

				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->SetNanColor(
			(double *)(a0->Buffer()->GetContents().Data())
		);
		return;
	}
	else if(info.Length() > 0 && info[0]->IsArray())
	{
		v8::Local<v8::Array>a0(v8::Local<v8::Array>::Cast(info[0]->ToObject()));
		double 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();
		}
				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->SetNanColor(
			b0
		);
		return;
	}
	else if(info.Length() > 0 && info[0]->IsNumber())
	{
		if(info.Length() > 1 && info[1]->IsNumber())
		{
			if(info.Length() > 2 && info[2]->IsNumber())
			{
								if(info.Length() != 3)
				{
					Nan::ThrowError("Too many parameters.");
					return;
				}
				native->SetNanColor(
					info[0]->NumberValue(),
					info[1]->NumberValue(),
					info[2]->NumberValue()
				);
				return;
			}
		}
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkColorTransferFunctionWrap::SetNodeValue(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	size_t i;
	if(info.Length() > 0 && info[0]->IsInt32())
	{
		if(info.Length() > 1 && info[1]->IsFloat64Array())
		{
			v8::Local<v8::Float64Array>a1(v8::Local<v8::Float64Array>::Cast(info[1]->ToObject()));
			if( a1->Length() < 6 )
			{
				Nan::ThrowError("Array too short.");
				return;
			}

			int r;
			if(info.Length() != 2)
			{
				Nan::ThrowError("Too many parameters.");
				return;
			}
			r = native->SetNodeValue(
				info[0]->Int32Value(),
				(double *)(a1->Buffer()->GetContents().Data())
			);
			info.GetReturnValue().Set(Nan::New(r));
			return;
		}
		else if(info.Length() > 1 && info[1]->IsArray())
		{
			v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject()));
			double b1[6];
			if( a1->Length() < 6 )
			{
				Nan::ThrowError("Array too short.");
				return;
			}

			for( i = 0; i < 6; i++ )
			{
				if( !a1->Get(i)->IsNumber() )
				{
					Nan::ThrowError("Array contents invalid.");
					return;
				}
				b1[i] = a1->Get(i)->NumberValue();
			}
			int r;
			if(info.Length() != 2)
			{
				Nan::ThrowError("Too many parameters.");
				return;
			}
			r = native->SetNodeValue(
				info[0]->Int32Value(),
				b1
			);
			info.GetReturnValue().Set(Nan::New(r));
			return;
		}
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkColorTransferFunctionWrap::SetScale(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsInt32())
	{
				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->SetScale(
			info[0]->Int32Value()
		);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkColorTransferFunctionWrap::SetScaleToLinear(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
		if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	native->SetScaleToLinear();
}

void VtkColorTransferFunctionWrap::SetScaleToLog10(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
		if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	native->SetScaleToLog10();
}

void VtkColorTransferFunctionWrap::SetUseAboveRangeColor(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsInt32())
	{
				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->SetUseAboveRangeColor(
			info[0]->Int32Value()
		);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkColorTransferFunctionWrap::SetUseBelowRangeColor(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsInt32())
	{
				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->SetUseBelowRangeColor(
			info[0]->Int32Value()
		);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkColorTransferFunctionWrap::ShallowCopy(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsObject() && (Nan::New(VtkColorTransferFunctionWrap::ptpl))->HasInstance(info[0]))
	{
		VtkColorTransferFunctionWrap *a0 = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info[0]->ToObject());
				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->ShallowCopy(
			(vtkColorTransferFunction *) a0->native.GetPointer()
		);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkColorTransferFunctionWrap::UseAboveRangeColorOff(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
		if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	native->UseAboveRangeColorOff();
}

void VtkColorTransferFunctionWrap::UseAboveRangeColorOn(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
		if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	native->UseAboveRangeColorOn();
}

void VtkColorTransferFunctionWrap::UseBelowRangeColorOff(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
		if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	native->UseBelowRangeColorOff();
}

void VtkColorTransferFunctionWrap::UseBelowRangeColorOn(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkColorTransferFunctionWrap *wrapper = ObjectWrap::Unwrap<VtkColorTransferFunctionWrap>(info.Holder());
	vtkColorTransferFunction *native = (vtkColorTransferFunction *)wrapper->native.GetPointer();
		if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	native->UseBelowRangeColorOn();
}

