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

using namespace v8;

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

VtkDotProductSimilarityWrap::VtkDotProductSimilarityWrap()
{ }

VtkDotProductSimilarityWrap::VtkDotProductSimilarityWrap(vtkSmartPointer<vtkDotProductSimilarity> _native)
{ native = _native; }

VtkDotProductSimilarityWrap::~VtkDotProductSimilarityWrap()
{ }

void VtkDotProductSimilarityWrap::Init(v8::Local<v8::Object> exports)
{
	Nan::SetAccessor(exports, Nan::New("vtkDotProductSimilarity").ToLocalChecked(), ConstructorGetter);
	Nan::SetAccessor(exports, Nan::New("DotProductSimilarity").ToLocalChecked(), ConstructorGetter);
}

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

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

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

	Nan::SetPrototypeMethod(tpl, "GetDiagonal", GetDiagonal);
	Nan::SetPrototypeMethod(tpl, "getDiagonal", GetDiagonal);

	Nan::SetPrototypeMethod(tpl, "GetFirstSecond", GetFirstSecond);
	Nan::SetPrototypeMethod(tpl, "getFirstSecond", GetFirstSecond);

	Nan::SetPrototypeMethod(tpl, "GetLowerDiagonal", GetLowerDiagonal);
	Nan::SetPrototypeMethod(tpl, "getLowerDiagonal", GetLowerDiagonal);

	Nan::SetPrototypeMethod(tpl, "GetMinimumThreshold", GetMinimumThreshold);
	Nan::SetPrototypeMethod(tpl, "getMinimumThreshold", GetMinimumThreshold);

	Nan::SetPrototypeMethod(tpl, "GetSecondFirst", GetSecondFirst);
	Nan::SetPrototypeMethod(tpl, "getSecondFirst", GetSecondFirst);

	Nan::SetPrototypeMethod(tpl, "GetUpperDiagonal", GetUpperDiagonal);
	Nan::SetPrototypeMethod(tpl, "getUpperDiagonal", GetUpperDiagonal);

	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, "SetDiagonal", SetDiagonal);
	Nan::SetPrototypeMethod(tpl, "setDiagonal", SetDiagonal);

	Nan::SetPrototypeMethod(tpl, "SetFirstSecond", SetFirstSecond);
	Nan::SetPrototypeMethod(tpl, "setFirstSecond", SetFirstSecond);

	Nan::SetPrototypeMethod(tpl, "SetLowerDiagonal", SetLowerDiagonal);
	Nan::SetPrototypeMethod(tpl, "setLowerDiagonal", SetLowerDiagonal);

	Nan::SetPrototypeMethod(tpl, "SetMinimumThreshold", SetMinimumThreshold);
	Nan::SetPrototypeMethod(tpl, "setMinimumThreshold", SetMinimumThreshold);

	Nan::SetPrototypeMethod(tpl, "SetSecondFirst", SetSecondFirst);
	Nan::SetPrototypeMethod(tpl, "setSecondFirst", SetSecondFirst);

	Nan::SetPrototypeMethod(tpl, "SetUpperDiagonal", SetUpperDiagonal);
	Nan::SetPrototypeMethod(tpl, "setUpperDiagonal", SetUpperDiagonal);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

