Sha256: 17a9ae5468d7c06ed0717711290931eefc536ddec733fce36c8c1fc4046b4616

Contents?: true

Size: 1.08 KB

Versions: 16

Compression:

Stored size: 1.08 KB

Contents

#include "reflex/ruby/shape.h"


#include "rays/ruby/polygon.h"
#include "defs.h"


RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(Reflex::PolygonShape)

#define THIS      to<Reflex::PolygonShape*>(self)

#define CHECK     RUCY_CHECK_OBJ(Reflex::PolygonShape, self)

#define CALL(fun) RUCY_CALL_SUPER(THIS, fun)


static
VALUE alloc(VALUE klass)
{
	return value(new Reflex::RubyShape<Reflex::PolygonShape>, klass);
}

static
VALUE set_polygon(VALUE self, VALUE polygon)
{
	CHECK;

	THIS->set_polygon(to<Rays::Polygon&>(polygon));
	return polygon;
}

static
VALUE get_polygon(VALUE self)
{
	CHECK;
	return value(THIS->polygon());
}


static Class cPolygonShape;

void
Init_polygon_shape ()
{
	Module mReflex = rb_define_module("Reflex");

	cPolygonShape = mReflex.define_class("PolygonShape", Reflex::shape_class());
	rb_define_alloc_func(cPolygonShape, alloc);
	rb_define_method(cPolygonShape, "polygon=", RUBY_METHOD_FUNC(set_polygon), 1);
	rb_define_method(cPolygonShape, "polygon", RUBY_METHOD_FUNC(get_polygon), 0);
}


namespace Reflex
{


	Class
	polygon_shape_class ()
	{
		return cPolygonShape;
	}


}// Reflex

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
reflexion-0.1.29 .doc/ext/reflex/polygon_shape.cpp
reflexion-0.1.28 .doc/ext/reflex/polygon_shape.cpp
reflexion-0.1.27 .doc/ext/reflex/polygon_shape.cpp
reflexion-0.1.26 .doc/ext/reflex/polygon_shape.cpp
reflexion-0.1.25 .doc/ext/reflex/polygon_shape.cpp
reflexion-0.1.24 .doc/ext/reflex/polygon_shape.cpp
reflexion-0.1.23 .doc/ext/reflex/polygon_shape.cpp
reflexion-0.1.22 .doc/ext/reflex/polygon_shape.cpp
reflexion-0.1.21 .doc/ext/reflex/polygon_shape.cpp
reflexion-0.1.20 .doc/ext/reflex/polygon_shape.cpp
reflexion-0.1.19 .doc/ext/reflex/polygon_shape.cpp
reflexion-0.1.17 .doc/ext/reflex/polygon_shape.cpp
reflexion-0.1.16 .doc/ext/reflex/polygon_shape.cpp
reflexion-0.1.15 .doc/ext/reflex/polygon_shape.cpp
reflexion-0.1.14 .doc/ext/reflex/polygon_shape.cpp
reflexion-0.1.13 .doc/ext/reflex/polygon_shape.cpp