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

using namespace v8;

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

VtkDicerWrap::VtkDicerWrap()
{ }

VtkDicerWrap::VtkDicerWrap(vtkSmartPointer<vtkDicer> _native)
{ native = _native; }

VtkDicerWrap::~VtkDicerWrap()
{ }

void VtkDicerWrap::Init(v8::Local<v8::Object> exports)
{
	Nan::SetAccessor(exports, Nan::New("vtkDicer").ToLocalChecked(), ConstructorGetter);
	Nan::SetAccessor(exports, Nan::New("Dicer").ToLocalChecked(), ConstructorGetter);
}

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

void VtkDicerWrap::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("VtkDicerWrap").ToLocalChecked());
	tpl->InstanceTemplate()->SetInternalFieldCount(1);

	Nan::SetPrototypeMethod(tpl, "FieldDataOff", FieldDataOff);
	Nan::SetPrototypeMethod(tpl, "fieldDataOff", FieldDataOff);

	Nan::SetPrototypeMethod(tpl, "FieldDataOn", FieldDataOn);
	Nan::SetPrototypeMethod(tpl, "fieldDataOn", FieldDataOn);

	Nan::SetPrototypeMethod(tpl, "GetDiceMode", GetDiceMode);
	Nan::SetPrototypeMethod(tpl, "getDiceMode", GetDiceMode);

	Nan::SetPrototypeMethod(tpl, "GetDiceModeMaxValue", GetDiceModeMaxValue);
	Nan::SetPrototypeMethod(tpl, "getDiceModeMaxValue", GetDiceModeMaxValue);

	Nan::SetPrototypeMethod(tpl, "GetDiceModeMinValue", GetDiceModeMinValue);
	Nan::SetPrototypeMethod(tpl, "getDiceModeMinValue", GetDiceModeMinValue);

	Nan::SetPrototypeMethod(tpl, "GetFieldData", GetFieldData);
	Nan::SetPrototypeMethod(tpl, "getFieldData", GetFieldData);

	Nan::SetPrototypeMethod(tpl, "GetMemoryLimit", GetMemoryLimit);
	Nan::SetPrototypeMethod(tpl, "getMemoryLimit", GetMemoryLimit);

	Nan::SetPrototypeMethod(tpl, "GetMemoryLimitMaxValue", GetMemoryLimitMaxValue);
	Nan::SetPrototypeMethod(tpl, "getMemoryLimitMaxValue", GetMemoryLimitMaxValue);

	Nan::SetPrototypeMethod(tpl, "GetMemoryLimitMinValue", GetMemoryLimitMinValue);
	Nan::SetPrototypeMethod(tpl, "getMemoryLimitMinValue", GetMemoryLimitMinValue);

	Nan::SetPrototypeMethod(tpl, "GetNumberOfActualPieces", GetNumberOfActualPieces);
	Nan::SetPrototypeMethod(tpl, "getNumberOfActualPieces", GetNumberOfActualPieces);

	Nan::SetPrototypeMethod(tpl, "GetNumberOfPieces", GetNumberOfPieces);
	Nan::SetPrototypeMethod(tpl, "getNumberOfPieces", GetNumberOfPieces);

	Nan::SetPrototypeMethod(tpl, "GetNumberOfPiecesMaxValue", GetNumberOfPiecesMaxValue);
	Nan::SetPrototypeMethod(tpl, "getNumberOfPiecesMaxValue", GetNumberOfPiecesMaxValue);

	Nan::SetPrototypeMethod(tpl, "GetNumberOfPiecesMinValue", GetNumberOfPiecesMinValue);
	Nan::SetPrototypeMethod(tpl, "getNumberOfPiecesMinValue", GetNumberOfPiecesMinValue);

	Nan::SetPrototypeMethod(tpl, "GetNumberOfPointsPerPiece", GetNumberOfPointsPerPiece);
	Nan::SetPrototypeMethod(tpl, "getNumberOfPointsPerPiece", GetNumberOfPointsPerPiece);

	Nan::SetPrototypeMethod(tpl, "GetNumberOfPointsPerPieceMaxValue", GetNumberOfPointsPerPieceMaxValue);
	Nan::SetPrototypeMethod(tpl, "getNumberOfPointsPerPieceMaxValue", GetNumberOfPointsPerPieceMaxValue);

	Nan::SetPrototypeMethod(tpl, "GetNumberOfPointsPerPieceMinValue", GetNumberOfPointsPerPieceMinValue);
	Nan::SetPrototypeMethod(tpl, "getNumberOfPointsPerPieceMinValue", GetNumberOfPointsPerPieceMinValue);

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

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

	Nan::SetPrototypeMethod(tpl, "SetDiceMode", SetDiceMode);
	Nan::SetPrototypeMethod(tpl, "setDiceMode", SetDiceMode);

	Nan::SetPrototypeMethod(tpl, "SetDiceModeToMemoryLimitPerPiece", SetDiceModeToMemoryLimitPerPiece);
	Nan::SetPrototypeMethod(tpl, "setDiceModeToMemoryLimitPerPiece", SetDiceModeToMemoryLimitPerPiece);

	Nan::SetPrototypeMethod(tpl, "SetDiceModeToNumberOfPointsPerPiece", SetDiceModeToNumberOfPointsPerPiece);
	Nan::SetPrototypeMethod(tpl, "setDiceModeToNumberOfPointsPerPiece", SetDiceModeToNumberOfPointsPerPiece);

	Nan::SetPrototypeMethod(tpl, "SetDiceModeToSpecifiedNumberOfPieces", SetDiceModeToSpecifiedNumberOfPieces);
	Nan::SetPrototypeMethod(tpl, "setDiceModeToSpecifiedNumberOfPieces", SetDiceModeToSpecifiedNumberOfPieces);

	Nan::SetPrototypeMethod(tpl, "SetFieldData", SetFieldData);
	Nan::SetPrototypeMethod(tpl, "setFieldData", SetFieldData);

	Nan::SetPrototypeMethod(tpl, "SetMemoryLimit", SetMemoryLimit);
	Nan::SetPrototypeMethod(tpl, "setMemoryLimit", SetMemoryLimit);

	Nan::SetPrototypeMethod(tpl, "SetNumberOfPieces", SetNumberOfPieces);
	Nan::SetPrototypeMethod(tpl, "setNumberOfPieces", SetNumberOfPieces);

	Nan::SetPrototypeMethod(tpl, "SetNumberOfPointsPerPiece", SetNumberOfPointsPerPiece);
	Nan::SetPrototypeMethod(tpl, "setNumberOfPointsPerPiece", SetNumberOfPointsPerPiece);

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

void VtkDicerWrap::New(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	if(!info.IsConstructCall())
	{
		Nan::ThrowError("Constructor not called in a construct call.");
		return;
	}

	if(info.Length() == 0)
	{
		Nan::ThrowError("Cannot create instance of abstract class.");
		return;
	}
	else
	{
		if(info[0]->ToObject() != vtkNodeJsNoWrap )
		{
			Nan::ThrowError("Parameter Error");
			return;
		}
	}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

