27 #include "../../../../geometry/MultiCurve.h" 28 #include "../../common/Utils.h" 35 if(args.Holder().IsEmpty())
36 return ::v8::ThrowException(::v8::String::New(
"In order to use isClosed method you must use object notation: \"isclosed = obj.isClosed();\""));
41 return ::v8::ThrowException(::v8::String::New(
"Invalid geometry in isClosed method!"));
45 ::v8::Handle<::v8::Boolean> jis = ::v8::Boolean::New(is);
54 if(args.Holder().IsEmpty())
55 return ::v8::ThrowException(::v8::String::New(
"In order to use getLength method you must use object notation: \"len = obj.getLength();\""));
60 return ::v8::ThrowException(::v8::String::New(
"Invalid geometry in getLength method!"));
64 ::v8::Local<::v8::Number> jlen = ::v8::Number::New(len);
66 return hs.Close(jlen);
76 ::v8::Local<::v8::FunctionTemplate> result = ::v8::FunctionTemplate::New();
77 result->Inherit(geomTpl);
79 ::v8::Handle<::v8::ObjectTemplate> prototype = result->PrototypeTemplate();
81 prototype->Set(::v8::String::NewSymbol(
"isClosed"), ::v8::FunctionTemplate::New(
MultiCurve_IsClosed));
82 prototype->Set(::v8::String::NewSymbol(
"getLength"), ::v8::FunctionTemplate::New(
MultiCurve_GetLength));
::v8::Handle<::v8::Value > MultiCurve_GetLength(const ::v8::Arguments &args)
::v8::Persistent<::v8::FunctionTemplate > & GetMultiCurveTemplate()
It returns a reference to the persistent template of a MultiCurve object.
bool isClosed() const
It returns true if this MultiCurve is closed [StartPoint ( ) = EndPoint ( ) for each Curve in this Mu...
::v8::Handle<::v8::Value > MultiCurve_IsClosed(const ::v8::Arguments &args)
MultiCurve is a class that represents a 1-dimensional GeometryCollection whose elements are curves...
double getLength() const
It returns the Length of this MultiCurve which is equal to the sum of the lengths of the element Curv...
static::v8::Persistent<::v8::FunctionTemplate > sg_mcurve_template
::v8::Persistent<::v8::FunctionTemplate > & GetGeometryCollectionTemplate()
It returns a reference to the persistent template of a GeometryCollection object. ...