/* 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 "vtkLabelHierarchyIteratorWrap.h"
#include "vtkLabelHierarchyCompositeIteratorWrap.h"
#include "vtkObjectWrap.h"
#include "vtkIdTypeArrayWrap.h"
#include "vtkLabelHierarchyWrap.h"
#include "vtkPolyDataWrap.h"
#include "../../plus/plus.h"

using namespace v8;

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

VtkLabelHierarchyCompositeIteratorWrap::VtkLabelHierarchyCompositeIteratorWrap()
{ }

VtkLabelHierarchyCompositeIteratorWrap::VtkLabelHierarchyCompositeIteratorWrap(vtkSmartPointer<vtkLabelHierarchyCompositeIterator> _native)
{ native = _native; }

VtkLabelHierarchyCompositeIteratorWrap::~VtkLabelHierarchyCompositeIteratorWrap()
{ }

void VtkLabelHierarchyCompositeIteratorWrap::Init(v8::Local<v8::Object> exports)
{
	Nan::SetAccessor(exports, Nan::New("vtkLabelHierarchyCompositeIterator").ToLocalChecked(), ConstructorGetter);
	Nan::SetAccessor(exports, Nan::New("LabelHierarchyCompositeIterator").ToLocalChecked(), ConstructorGetter);
}

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

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

	Nan::SetPrototypeMethod(tpl, "AddIterator", AddIterator);
	Nan::SetPrototypeMethod(tpl, "addIterator", AddIterator);

	Nan::SetPrototypeMethod(tpl, "Begin", Begin);
	Nan::SetPrototypeMethod(tpl, "begin", Begin);

	Nan::SetPrototypeMethod(tpl, "BoxAllNodes", BoxAllNodes);
	Nan::SetPrototypeMethod(tpl, "boxAllNodes", BoxAllNodes);

	Nan::SetPrototypeMethod(tpl, "BoxNode", BoxNode);
	Nan::SetPrototypeMethod(tpl, "boxNode", BoxNode);

	Nan::SetPrototypeMethod(tpl, "ClearIterators", ClearIterators);
	Nan::SetPrototypeMethod(tpl, "clearIterators", ClearIterators);

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

	Nan::SetPrototypeMethod(tpl, "GetHierarchy", GetHierarchy);
	Nan::SetPrototypeMethod(tpl, "getHierarchy", GetHierarchy);

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

	Nan::SetPrototypeMethod(tpl, "IsAtEnd", IsAtEnd);
	Nan::SetPrototypeMethod(tpl, "isAtEnd", IsAtEnd);

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

	Nan::SetPrototypeMethod(tpl, "Next", Next);
	Nan::SetPrototypeMethod(tpl, "next", Next);

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

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

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

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

void VtkLabelHierarchyCompositeIteratorWrap::AddIterator(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkLabelHierarchyCompositeIteratorWrap *wrapper = ObjectWrap::Unwrap<VtkLabelHierarchyCompositeIteratorWrap>(info.Holder());
	vtkLabelHierarchyCompositeIterator *native = (vtkLabelHierarchyCompositeIterator *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsObject() && (Nan::New(VtkLabelHierarchyIteratorWrap::ptpl))->HasInstance(info[0]))
	{
		VtkLabelHierarchyIteratorWrap *a0 = ObjectWrap::Unwrap<VtkLabelHierarchyIteratorWrap>(info[0]->ToObject());
		if(info.Length() > 1 && info[1]->IsInt32())
		{
						if(info.Length() != 2)
			{
				Nan::ThrowError("Too many parameters.");
				return;
			}
			native->AddIterator(
				(vtkLabelHierarchyIterator *) a0->native.GetPointer(),
				info[1]->Int32Value()
			);
			return;
		}
				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->AddIterator(
			(vtkLabelHierarchyIterator *) a0->native.GetPointer()
		);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkLabelHierarchyCompositeIteratorWrap::Begin(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkLabelHierarchyCompositeIteratorWrap *wrapper = ObjectWrap::Unwrap<VtkLabelHierarchyCompositeIteratorWrap>(info.Holder());
	vtkLabelHierarchyCompositeIterator *native = (vtkLabelHierarchyCompositeIterator *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsObject() && (Nan::New(VtkIdTypeArrayWrap::ptpl))->HasInstance(info[0]))
	{
		VtkIdTypeArrayWrap *a0 = ObjectWrap::Unwrap<VtkIdTypeArrayWrap>(info[0]->ToObject());
				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->Begin(
			(vtkIdTypeArray *) a0->native.GetPointer()
		);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkLabelHierarchyCompositeIteratorWrap::BoxAllNodes(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkLabelHierarchyCompositeIteratorWrap *wrapper = ObjectWrap::Unwrap<VtkLabelHierarchyCompositeIteratorWrap>(info.Holder());
	vtkLabelHierarchyCompositeIterator *native = (vtkLabelHierarchyCompositeIterator *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsObject() && (Nan::New(VtkPolyDataWrap::ptpl))->HasInstance(info[0]))
	{
		VtkPolyDataWrap *a0 = ObjectWrap::Unwrap<VtkPolyDataWrap>(info[0]->ToObject());
				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->BoxAllNodes(
			(vtkPolyData *) a0->native.GetPointer()
		);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

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

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

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

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

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

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

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

