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

using namespace v8;

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

VtkTecplotReaderWrap::VtkTecplotReaderWrap()
{ }

VtkTecplotReaderWrap::VtkTecplotReaderWrap(vtkSmartPointer<vtkTecplotReader> _native)
{ native = _native; }

VtkTecplotReaderWrap::~VtkTecplotReaderWrap()
{ }

void VtkTecplotReaderWrap::Init(v8::Local<v8::Object> exports)
{
	Nan::SetAccessor(exports, Nan::New("vtkTecplotReader").ToLocalChecked(), ConstructorGetter);
	Nan::SetAccessor(exports, Nan::New("TecplotReader").ToLocalChecked(), ConstructorGetter);
}

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

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

	Nan::SetPrototypeMethod(tpl, "GetBlockName", GetBlockName);
	Nan::SetPrototypeMethod(tpl, "getBlockName", GetBlockName);

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

	Nan::SetPrototypeMethod(tpl, "GetDataArrayName", GetDataArrayName);
	Nan::SetPrototypeMethod(tpl, "getDataArrayName", GetDataArrayName);

	Nan::SetPrototypeMethod(tpl, "GetDataArrayStatus", GetDataArrayStatus);
	Nan::SetPrototypeMethod(tpl, "getDataArrayStatus", GetDataArrayStatus);

	Nan::SetPrototypeMethod(tpl, "GetDataAttributeName", GetDataAttributeName);
	Nan::SetPrototypeMethod(tpl, "getDataAttributeName", GetDataAttributeName);

	Nan::SetPrototypeMethod(tpl, "GetDataTitle", GetDataTitle);
	Nan::SetPrototypeMethod(tpl, "getDataTitle", GetDataTitle);

	Nan::SetPrototypeMethod(tpl, "GetNumberOfBlocks", GetNumberOfBlocks);
	Nan::SetPrototypeMethod(tpl, "getNumberOfBlocks", GetNumberOfBlocks);

	Nan::SetPrototypeMethod(tpl, "GetNumberOfDataArrays", GetNumberOfDataArrays);
	Nan::SetPrototypeMethod(tpl, "getNumberOfDataArrays", GetNumberOfDataArrays);

	Nan::SetPrototypeMethod(tpl, "GetNumberOfDataAttributes", GetNumberOfDataAttributes);
	Nan::SetPrototypeMethod(tpl, "getNumberOfDataAttributes", GetNumberOfDataAttributes);

	Nan::SetPrototypeMethod(tpl, "GetNumberOfVariables", GetNumberOfVariables);
	Nan::SetPrototypeMethod(tpl, "getNumberOfVariables", GetNumberOfVariables);

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

	Nan::SetPrototypeMethod(tpl, "IsDataAttributeCellBased", IsDataAttributeCellBased);
	Nan::SetPrototypeMethod(tpl, "isDataAttributeCellBased", IsDataAttributeCellBased);

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

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

	Nan::SetPrototypeMethod(tpl, "SetDataArrayStatus", SetDataArrayStatus);
	Nan::SetPrototypeMethod(tpl, "setDataArrayStatus", SetDataArrayStatus);

	Nan::SetPrototypeMethod(tpl, "SetFileName", SetFileName);
	Nan::SetPrototypeMethod(tpl, "setFileName", SetFileName);

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

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

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

void VtkTecplotReaderWrap::GetBlockName(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkTecplotReaderWrap *wrapper = ObjectWrap::Unwrap<VtkTecplotReaderWrap>(info.Holder());
	vtkTecplotReader *native = (vtkTecplotReader *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsInt32())
	{
		char const * r;
		if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		r = native->GetBlockName(
			info[0]->Int32Value()
		);
		info.GetReturnValue().Set(Nan::New(r).ToLocalChecked());
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkTecplotReaderWrap::GetClassName(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkTecplotReaderWrap *wrapper = ObjectWrap::Unwrap<VtkTecplotReaderWrap>(info.Holder());
	vtkTecplotReader *native = (vtkTecplotReader *)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 VtkTecplotReaderWrap::GetDataArrayName(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkTecplotReaderWrap *wrapper = ObjectWrap::Unwrap<VtkTecplotReaderWrap>(info.Holder());
	vtkTecplotReader *native = (vtkTecplotReader *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsInt32())
	{
		char const * r;
		if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		r = native->GetDataArrayName(
			info[0]->Int32Value()
		);
		info.GetReturnValue().Set(Nan::New(r).ToLocalChecked());
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkTecplotReaderWrap::GetDataArrayStatus(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkTecplotReaderWrap *wrapper = ObjectWrap::Unwrap<VtkTecplotReaderWrap>(info.Holder());
	vtkTecplotReader *native = (vtkTecplotReader *)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->GetDataArrayStatus(
			*a0
		);
		info.GetReturnValue().Set(Nan::New(r));
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkTecplotReaderWrap::GetDataAttributeName(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkTecplotReaderWrap *wrapper = ObjectWrap::Unwrap<VtkTecplotReaderWrap>(info.Holder());
	vtkTecplotReader *native = (vtkTecplotReader *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsInt32())
	{
		char const * r;
		if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		r = native->GetDataAttributeName(
			info[0]->Int32Value()
		);
		info.GetReturnValue().Set(Nan::New(r).ToLocalChecked());
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

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

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

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

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

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

void VtkTecplotReaderWrap::IsA(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkTecplotReaderWrap *wrapper = ObjectWrap::Unwrap<VtkTecplotReaderWrap>(info.Holder());
	vtkTecplotReader *native = (vtkTecplotReader *)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 VtkTecplotReaderWrap::IsDataAttributeCellBased(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkTecplotReaderWrap *wrapper = ObjectWrap::Unwrap<VtkTecplotReaderWrap>(info.Holder());
	vtkTecplotReader *native = (vtkTecplotReader *)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->IsDataAttributeCellBased(
			*a0
		);
		info.GetReturnValue().Set(Nan::New(r));
		return;
	}
	else if(info.Length() > 0 && info[0]->IsInt32())
	{
		int r;
		if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		r = native->IsDataAttributeCellBased(
			info[0]->Int32Value()
		);
		info.GetReturnValue().Set(Nan::New(r));
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

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

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

void VtkTecplotReaderWrap::SetDataArrayStatus(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkTecplotReaderWrap *wrapper = ObjectWrap::Unwrap<VtkTecplotReaderWrap>(info.Holder());
	vtkTecplotReader *native = (vtkTecplotReader *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsString())
	{
		Nan::Utf8String a0(info[0]);
		if(info.Length() > 1 && info[1]->IsInt32())
		{
						if(info.Length() != 2)
			{
				Nan::ThrowError("Too many parameters.");
				return;
			}
			native->SetDataArrayStatus(
				*a0,
				info[1]->Int32Value()
			);
			return;
		}
	}
	Nan::ThrowError("Parameter mismatch");
}

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

