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

using namespace v8;

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

VtkRIBPropertyWrap::VtkRIBPropertyWrap()
{ }

VtkRIBPropertyWrap::VtkRIBPropertyWrap(vtkSmartPointer<vtkRIBProperty> _native)
{ native = _native; }

VtkRIBPropertyWrap::~VtkRIBPropertyWrap()
{ }

void VtkRIBPropertyWrap::Init(v8::Local<v8::Object> exports)
{
	Nan::SetAccessor(exports, Nan::New("vtkRIBProperty").ToLocalChecked(), ConstructorGetter);
	Nan::SetAccessor(exports, Nan::New("RIBProperty").ToLocalChecked(), ConstructorGetter);
}

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

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

	Nan::SetPrototypeMethod(tpl, "AddDisplacementShaderParameter", AddDisplacementShaderParameter);
	Nan::SetPrototypeMethod(tpl, "addDisplacementShaderParameter", AddDisplacementShaderParameter);

	Nan::SetPrototypeMethod(tpl, "AddParameter", AddParameter);
	Nan::SetPrototypeMethod(tpl, "addParameter", AddParameter);

	Nan::SetPrototypeMethod(tpl, "AddSurfaceShaderParameter", AddSurfaceShaderParameter);
	Nan::SetPrototypeMethod(tpl, "addSurfaceShaderParameter", AddSurfaceShaderParameter);

	Nan::SetPrototypeMethod(tpl, "AddVariable", AddVariable);
	Nan::SetPrototypeMethod(tpl, "addVariable", AddVariable);

	Nan::SetPrototypeMethod(tpl, "GetDeclarations", GetDeclarations);
	Nan::SetPrototypeMethod(tpl, "getDeclarations", GetDeclarations);

	Nan::SetPrototypeMethod(tpl, "GetDisplacementShader", GetDisplacementShader);
	Nan::SetPrototypeMethod(tpl, "getDisplacementShader", GetDisplacementShader);

	Nan::SetPrototypeMethod(tpl, "GetDisplacementShaderParameters", GetDisplacementShaderParameters);
	Nan::SetPrototypeMethod(tpl, "getDisplacementShaderParameters", GetDisplacementShaderParameters);

	Nan::SetPrototypeMethod(tpl, "GetParameters", GetParameters);
	Nan::SetPrototypeMethod(tpl, "getParameters", GetParameters);

	Nan::SetPrototypeMethod(tpl, "GetSurfaceShader", GetSurfaceShader);
	Nan::SetPrototypeMethod(tpl, "getSurfaceShader", GetSurfaceShader);

	Nan::SetPrototypeMethod(tpl, "GetSurfaceShaderParameters", GetSurfaceShaderParameters);
	Nan::SetPrototypeMethod(tpl, "getSurfaceShaderParameters", GetSurfaceShaderParameters);

	Nan::SetPrototypeMethod(tpl, "GetSurfaceShaderUsesDefaultParameters", GetSurfaceShaderUsesDefaultParameters);
	Nan::SetPrototypeMethod(tpl, "getSurfaceShaderUsesDefaultParameters", GetSurfaceShaderUsesDefaultParameters);

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

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

	Nan::SetPrototypeMethod(tpl, "SetDisplacementShader", SetDisplacementShader);
	Nan::SetPrototypeMethod(tpl, "setDisplacementShader", SetDisplacementShader);

	Nan::SetPrototypeMethod(tpl, "SetDisplacementShaderParameter", SetDisplacementShaderParameter);
	Nan::SetPrototypeMethod(tpl, "setDisplacementShaderParameter", SetDisplacementShaderParameter);

	Nan::SetPrototypeMethod(tpl, "SetParameter", SetParameter);
	Nan::SetPrototypeMethod(tpl, "setParameter", SetParameter);

	Nan::SetPrototypeMethod(tpl, "SetSurfaceShader", SetSurfaceShader);
	Nan::SetPrototypeMethod(tpl, "setSurfaceShader", SetSurfaceShader);

	Nan::SetPrototypeMethod(tpl, "SetSurfaceShaderParameter", SetSurfaceShaderParameter);
	Nan::SetPrototypeMethod(tpl, "setSurfaceShaderParameter", SetSurfaceShaderParameter);

	Nan::SetPrototypeMethod(tpl, "SetSurfaceShaderUsesDefaultParameters", SetSurfaceShaderUsesDefaultParameters);
	Nan::SetPrototypeMethod(tpl, "setSurfaceShaderUsesDefaultParameters", SetSurfaceShaderUsesDefaultParameters);

	Nan::SetPrototypeMethod(tpl, "SetVariable", SetVariable);
	Nan::SetPrototypeMethod(tpl, "setVariable", SetVariable);

	Nan::SetPrototypeMethod(tpl, "SurfaceShaderUsesDefaultParametersOff", SurfaceShaderUsesDefaultParametersOff);
	Nan::SetPrototypeMethod(tpl, "surfaceShaderUsesDefaultParametersOff", SurfaceShaderUsesDefaultParametersOff);

	Nan::SetPrototypeMethod(tpl, "SurfaceShaderUsesDefaultParametersOn", SurfaceShaderUsesDefaultParametersOn);
	Nan::SetPrototypeMethod(tpl, "surfaceShaderUsesDefaultParametersOn", SurfaceShaderUsesDefaultParametersOn);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

void VtkRIBPropertyWrap::SetDisplacementShader(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkRIBPropertyWrap *wrapper = ObjectWrap::Unwrap<VtkRIBPropertyWrap>(info.Holder());
	vtkRIBProperty *native = (vtkRIBProperty *)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->SetDisplacementShader(
			*a0
		);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

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

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

void VtkRIBPropertyWrap::SetSurfaceShader(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkRIBPropertyWrap *wrapper = ObjectWrap::Unwrap<VtkRIBPropertyWrap>(info.Holder());
	vtkRIBProperty *native = (vtkRIBProperty *)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->SetSurfaceShader(
			*a0
		);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

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

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

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

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

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

