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

using namespace v8;

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

VtkThresholdTextureCoordsWrap::VtkThresholdTextureCoordsWrap()
{ }

VtkThresholdTextureCoordsWrap::VtkThresholdTextureCoordsWrap(vtkSmartPointer<vtkThresholdTextureCoords> _native)
{ native = _native; }

VtkThresholdTextureCoordsWrap::~VtkThresholdTextureCoordsWrap()
{ }

void VtkThresholdTextureCoordsWrap::Init(v8::Local<v8::Object> exports)
{
	Nan::SetAccessor(exports, Nan::New("vtkThresholdTextureCoords").ToLocalChecked(), ConstructorGetter);
	Nan::SetAccessor(exports, Nan::New("ThresholdTextureCoords").ToLocalChecked(), ConstructorGetter);
}

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

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

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

	Nan::SetPrototypeMethod(tpl, "GetInTextureCoord", GetInTextureCoord);
	Nan::SetPrototypeMethod(tpl, "getInTextureCoord", GetInTextureCoord);

	Nan::SetPrototypeMethod(tpl, "GetLowerThreshold", GetLowerThreshold);
	Nan::SetPrototypeMethod(tpl, "getLowerThreshold", GetLowerThreshold);

	Nan::SetPrototypeMethod(tpl, "GetOutTextureCoord", GetOutTextureCoord);
	Nan::SetPrototypeMethod(tpl, "getOutTextureCoord", GetOutTextureCoord);

	Nan::SetPrototypeMethod(tpl, "GetTextureDimension", GetTextureDimension);
	Nan::SetPrototypeMethod(tpl, "getTextureDimension", GetTextureDimension);

	Nan::SetPrototypeMethod(tpl, "GetTextureDimensionMaxValue", GetTextureDimensionMaxValue);
	Nan::SetPrototypeMethod(tpl, "getTextureDimensionMaxValue", GetTextureDimensionMaxValue);

	Nan::SetPrototypeMethod(tpl, "GetTextureDimensionMinValue", GetTextureDimensionMinValue);
	Nan::SetPrototypeMethod(tpl, "getTextureDimensionMinValue", GetTextureDimensionMinValue);

	Nan::SetPrototypeMethod(tpl, "GetUpperThreshold", GetUpperThreshold);
	Nan::SetPrototypeMethod(tpl, "getUpperThreshold", GetUpperThreshold);

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

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

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

	Nan::SetPrototypeMethod(tpl, "SetInTextureCoord", SetInTextureCoord);
	Nan::SetPrototypeMethod(tpl, "setInTextureCoord", SetInTextureCoord);

	Nan::SetPrototypeMethod(tpl, "SetOutTextureCoord", SetOutTextureCoord);
	Nan::SetPrototypeMethod(tpl, "setOutTextureCoord", SetOutTextureCoord);

	Nan::SetPrototypeMethod(tpl, "SetTextureDimension", SetTextureDimension);
	Nan::SetPrototypeMethod(tpl, "setTextureDimension", SetTextureDimension);

	Nan::SetPrototypeMethod(tpl, "ThresholdBetween", ThresholdBetween);
	Nan::SetPrototypeMethod(tpl, "thresholdBetween", ThresholdBetween);

	Nan::SetPrototypeMethod(tpl, "ThresholdByLower", ThresholdByLower);
	Nan::SetPrototypeMethod(tpl, "thresholdByLower", ThresholdByLower);

	Nan::SetPrototypeMethod(tpl, "ThresholdByUpper", ThresholdByUpper);
	Nan::SetPrototypeMethod(tpl, "thresholdByUpper", ThresholdByUpper);

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

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

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

void VtkThresholdTextureCoordsWrap::GetClassName(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkThresholdTextureCoordsWrap *wrapper = ObjectWrap::Unwrap<VtkThresholdTextureCoordsWrap>(info.Holder());
	vtkThresholdTextureCoords *native = (vtkThresholdTextureCoords *)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 VtkThresholdTextureCoordsWrap::GetInTextureCoord(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkThresholdTextureCoordsWrap *wrapper = ObjectWrap::Unwrap<VtkThresholdTextureCoordsWrap>(info.Holder());
	vtkThresholdTextureCoords *native = (vtkThresholdTextureCoords *)wrapper->native.GetPointer();
	double const * r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetInTextureCoord();
	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 VtkThresholdTextureCoordsWrap::GetLowerThreshold(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkThresholdTextureCoordsWrap *wrapper = ObjectWrap::Unwrap<VtkThresholdTextureCoordsWrap>(info.Holder());
	vtkThresholdTextureCoords *native = (vtkThresholdTextureCoords *)wrapper->native.GetPointer();
	double r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetLowerThreshold();
	info.GetReturnValue().Set(Nan::New(r));
}

void VtkThresholdTextureCoordsWrap::GetOutTextureCoord(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkThresholdTextureCoordsWrap *wrapper = ObjectWrap::Unwrap<VtkThresholdTextureCoordsWrap>(info.Holder());
	vtkThresholdTextureCoords *native = (vtkThresholdTextureCoords *)wrapper->native.GetPointer();
	double const * r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetOutTextureCoord();
	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 VtkThresholdTextureCoordsWrap::GetTextureDimension(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkThresholdTextureCoordsWrap *wrapper = ObjectWrap::Unwrap<VtkThresholdTextureCoordsWrap>(info.Holder());
	vtkThresholdTextureCoords *native = (vtkThresholdTextureCoords *)wrapper->native.GetPointer();
	int r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetTextureDimension();
	info.GetReturnValue().Set(Nan::New(r));
}

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

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

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

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

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

void VtkThresholdTextureCoordsWrap::SetInTextureCoord(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkThresholdTextureCoordsWrap *wrapper = ObjectWrap::Unwrap<VtkThresholdTextureCoordsWrap>(info.Holder());
	vtkThresholdTextureCoords *native = (vtkThresholdTextureCoords *)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->SetInTextureCoord(
			(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->SetInTextureCoord(
			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->SetInTextureCoord(
					info[0]->NumberValue(),
					info[1]->NumberValue(),
					info[2]->NumberValue()
				);
				return;
			}
		}
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkThresholdTextureCoordsWrap::SetOutTextureCoord(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkThresholdTextureCoordsWrap *wrapper = ObjectWrap::Unwrap<VtkThresholdTextureCoordsWrap>(info.Holder());
	vtkThresholdTextureCoords *native = (vtkThresholdTextureCoords *)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->SetOutTextureCoord(
			(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->SetOutTextureCoord(
			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->SetOutTextureCoord(
					info[0]->NumberValue(),
					info[1]->NumberValue(),
					info[2]->NumberValue()
				);
				return;
			}
		}
	}
	Nan::ThrowError("Parameter mismatch");
}

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

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

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

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

