/* 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 "vtkThreadedImageAlgorithmWrap.h"
#include "vtkImageShiftScaleWrap.h"
#include "vtkObjectBaseWrap.h"
#include "../../plus/plus.h"

using namespace v8;

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

VtkImageShiftScaleWrap::VtkImageShiftScaleWrap()
{ }

VtkImageShiftScaleWrap::VtkImageShiftScaleWrap(vtkSmartPointer<vtkImageShiftScale> _native)
{ native = _native; }

VtkImageShiftScaleWrap::~VtkImageShiftScaleWrap()
{ }

void VtkImageShiftScaleWrap::Init(v8::Local<v8::Object> exports)
{
	Nan::SetAccessor(exports, Nan::New("vtkImageShiftScale").ToLocalChecked(), ConstructorGetter);
	Nan::SetAccessor(exports, Nan::New("ImageShiftScale").ToLocalChecked(), ConstructorGetter);
}

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

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

	Nan::SetPrototypeMethod(tpl, "ClampOverflowOff", ClampOverflowOff);
	Nan::SetPrototypeMethod(tpl, "clampOverflowOff", ClampOverflowOff);

	Nan::SetPrototypeMethod(tpl, "ClampOverflowOn", ClampOverflowOn);
	Nan::SetPrototypeMethod(tpl, "clampOverflowOn", ClampOverflowOn);

	Nan::SetPrototypeMethod(tpl, "GetClampOverflow", GetClampOverflow);
	Nan::SetPrototypeMethod(tpl, "getClampOverflow", GetClampOverflow);

	Nan::SetPrototypeMethod(tpl, "GetOutputScalarType", GetOutputScalarType);
	Nan::SetPrototypeMethod(tpl, "getOutputScalarType", GetOutputScalarType);

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

	Nan::SetPrototypeMethod(tpl, "GetShift", GetShift);
	Nan::SetPrototypeMethod(tpl, "getShift", GetShift);

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

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

	Nan::SetPrototypeMethod(tpl, "SetClampOverflow", SetClampOverflow);
	Nan::SetPrototypeMethod(tpl, "setClampOverflow", SetClampOverflow);

	Nan::SetPrototypeMethod(tpl, "SetOutputScalarType", SetOutputScalarType);
	Nan::SetPrototypeMethod(tpl, "setOutputScalarType", SetOutputScalarType);

	Nan::SetPrototypeMethod(tpl, "SetOutputScalarTypeToChar", SetOutputScalarTypeToChar);
	Nan::SetPrototypeMethod(tpl, "setOutputScalarTypeToChar", SetOutputScalarTypeToChar);

	Nan::SetPrototypeMethod(tpl, "SetOutputScalarTypeToDouble", SetOutputScalarTypeToDouble);
	Nan::SetPrototypeMethod(tpl, "setOutputScalarTypeToDouble", SetOutputScalarTypeToDouble);

	Nan::SetPrototypeMethod(tpl, "SetOutputScalarTypeToFloat", SetOutputScalarTypeToFloat);
	Nan::SetPrototypeMethod(tpl, "setOutputScalarTypeToFloat", SetOutputScalarTypeToFloat);

	Nan::SetPrototypeMethod(tpl, "SetOutputScalarTypeToInt", SetOutputScalarTypeToInt);
	Nan::SetPrototypeMethod(tpl, "setOutputScalarTypeToInt", SetOutputScalarTypeToInt);

	Nan::SetPrototypeMethod(tpl, "SetOutputScalarTypeToLong", SetOutputScalarTypeToLong);
	Nan::SetPrototypeMethod(tpl, "setOutputScalarTypeToLong", SetOutputScalarTypeToLong);

	Nan::SetPrototypeMethod(tpl, "SetOutputScalarTypeToShort", SetOutputScalarTypeToShort);
	Nan::SetPrototypeMethod(tpl, "setOutputScalarTypeToShort", SetOutputScalarTypeToShort);

	Nan::SetPrototypeMethod(tpl, "SetOutputScalarTypeToUnsignedChar", SetOutputScalarTypeToUnsignedChar);
	Nan::SetPrototypeMethod(tpl, "setOutputScalarTypeToUnsignedChar", SetOutputScalarTypeToUnsignedChar);

	Nan::SetPrototypeMethod(tpl, "SetOutputScalarTypeToUnsignedInt", SetOutputScalarTypeToUnsignedInt);
	Nan::SetPrototypeMethod(tpl, "setOutputScalarTypeToUnsignedInt", SetOutputScalarTypeToUnsignedInt);

	Nan::SetPrototypeMethod(tpl, "SetOutputScalarTypeToUnsignedLong", SetOutputScalarTypeToUnsignedLong);
	Nan::SetPrototypeMethod(tpl, "setOutputScalarTypeToUnsignedLong", SetOutputScalarTypeToUnsignedLong);

	Nan::SetPrototypeMethod(tpl, "SetOutputScalarTypeToUnsignedShort", SetOutputScalarTypeToUnsignedShort);
	Nan::SetPrototypeMethod(tpl, "setOutputScalarTypeToUnsignedShort", SetOutputScalarTypeToUnsignedShort);

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

	Nan::SetPrototypeMethod(tpl, "SetShift", SetShift);
	Nan::SetPrototypeMethod(tpl, "setShift", SetShift);

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

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

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

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

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

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

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

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

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

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

void VtkImageShiftScaleWrap::SafeDownCast(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkImageShiftScaleWrap *wrapper = ObjectWrap::Unwrap<VtkImageShiftScaleWrap>(info.Holder());
	vtkImageShiftScale *native = (vtkImageShiftScale *)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());
		vtkImageShiftScale * r;
		if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		r = native->SafeDownCast(
			(vtkObjectBase *) a0->native.GetPointer()
		);
		VtkImageShiftScaleWrap::InitPtpl();
		v8::Local<v8::Value> argv[1] =
			{ Nan::New(vtkNodeJsNoWrap) };
		v8::Local<v8::Function> cons =
			Nan::New<v8::FunctionTemplate>(VtkImageShiftScaleWrap::ptpl)->GetFunction();
		v8::Local<v8::Object> wo = cons->NewInstance(1, argv);
		VtkImageShiftScaleWrap *w = new VtkImageShiftScaleWrap();
		w->native = r;
		w->Wrap(wo);
		info.GetReturnValue().Set(wo);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

