MCPcopy Create free account
hub / github.com/OpenWebCAD/node-occ / NAN_METHOD

Function NAN_METHOD

src/Edge.cc:169–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167Nan::Persistent<v8::FunctionTemplate> Edge::_template;
168
169NAN_METHOD(Edge::static_createLine)
170{
171 v8::Local<v8::Value> arg1 = info[0];
172 v8::Local<v8::Value> arg2 = info[1];
173 if (arg1.IsEmpty() || arg2.IsEmpty()) {
174 return Nan::ThrowError("expecting 2 arguments : <vertex|point> , <vertex|point> ");
175 }
176
177 Vertex* v1 = getOrCreateVertex(info[0]);
178 Vertex* v2 = getOrCreateVertex(info[1]);
179 if (!v1 || !v2) {
180 return Nan::ThrowError("expecting 2 arguments : <vertex|point> , <vertex|point> ");
181 }
182
183 v8::Local<v8::Object> instance = Nan::NewInstance(Constructor<Edge>()).ToLocalChecked();
184 Edge* pThis = Nan::ObjectWrap::Unwrap<Edge>(Nan::To<v8::Object>(instance).ToLocalChecked());
185
186 pThis->createLine(v1, v2);
187 info.GetReturnValue().Set(instance);
188}
189
190NAN_METHOD(Edge::static_createCircle)
191{

Callers

nothing calls this directly

Calls 14

getOrCreateVertexFunction · 0.85
ReadPointFunction · 0.85
ReadDirFunction · 0.85
ReadDoubleFunction · 0.85
makeInstanceFunction · 0.85
extractEdgePolygonFunction · 0.85
makeFloat32ArrayFunction · 0.85
createLineMethod · 0.80
createCircleMethod · 0.80
createArc3PMethod · 0.80
polygonizeMethod · 0.80

Tested by

no test coverage detected