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

using namespace v8;

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

VtkOggTheoraWriterWrap::VtkOggTheoraWriterWrap()
{ }

VtkOggTheoraWriterWrap::VtkOggTheoraWriterWrap(vtkSmartPointer<vtkOggTheoraWriter> _native)
{ native = _native; }

VtkOggTheoraWriterWrap::~VtkOggTheoraWriterWrap()
{ }

void VtkOggTheoraWriterWrap::Init(v8::Local<v8::Object> exports)
{
	Nan::SetAccessor(exports, Nan::New("vtkOggTheoraWriter").ToLocalChecked(), ConstructorGetter);
	Nan::SetAccessor(exports, Nan::New("OggTheoraWriter").ToLocalChecked(), ConstructorGetter);
}

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

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

	Nan::SetPrototypeMethod(tpl, "End", End);
	Nan::SetPrototypeMethod(tpl, "end", End);

	Nan::SetPrototypeMethod(tpl, "GetQuality", GetQuality);
	Nan::SetPrototypeMethod(tpl, "getQuality", GetQuality);

	Nan::SetPrototypeMethod(tpl, "GetQualityMaxValue", GetQualityMaxValue);
	Nan::SetPrototypeMethod(tpl, "getQualityMaxValue", GetQualityMaxValue);

	Nan::SetPrototypeMethod(tpl, "GetQualityMinValue", GetQualityMinValue);
	Nan::SetPrototypeMethod(tpl, "getQualityMinValue", GetQualityMinValue);

	Nan::SetPrototypeMethod(tpl, "GetRate", GetRate);
	Nan::SetPrototypeMethod(tpl, "getRate", GetRate);

	Nan::SetPrototypeMethod(tpl, "GetRateMaxValue", GetRateMaxValue);
	Nan::SetPrototypeMethod(tpl, "getRateMaxValue", GetRateMaxValue);

	Nan::SetPrototypeMethod(tpl, "GetRateMinValue", GetRateMinValue);
	Nan::SetPrototypeMethod(tpl, "getRateMinValue", GetRateMinValue);

	Nan::SetPrototypeMethod(tpl, "GetSubsampling", GetSubsampling);
	Nan::SetPrototypeMethod(tpl, "getSubsampling", GetSubsampling);

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

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

	Nan::SetPrototypeMethod(tpl, "SetQuality", SetQuality);
	Nan::SetPrototypeMethod(tpl, "setQuality", SetQuality);

	Nan::SetPrototypeMethod(tpl, "SetRate", SetRate);
	Nan::SetPrototypeMethod(tpl, "setRate", SetRate);

	Nan::SetPrototypeMethod(tpl, "SetSubsampling", SetSubsampling);
	Nan::SetPrototypeMethod(tpl, "setSubsampling", SetSubsampling);

	Nan::SetPrototypeMethod(tpl, "Start", Start);
	Nan::SetPrototypeMethod(tpl, "start", Start);

	Nan::SetPrototypeMethod(tpl, "SubsamplingOff", SubsamplingOff);
	Nan::SetPrototypeMethod(tpl, "subsamplingOff", SubsamplingOff);

	Nan::SetPrototypeMethod(tpl, "SubsamplingOn", SubsamplingOn);
	Nan::SetPrototypeMethod(tpl, "subsamplingOn", SubsamplingOn);

	Nan::SetPrototypeMethod(tpl, "Write", Write);
	Nan::SetPrototypeMethod(tpl, "write", Write);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

