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

Method Init

src/Wire.cc:136–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134}
135
136void Wire::Init(v8::Local<v8::Object> target)
137{
138 // Prepare constructor template
139 v8::Local<v8::FunctionTemplate> tpl = Nan::New<v8::FunctionTemplate>(Wire::New);
140 tpl->SetClassName(Nan::New("Wire").ToLocalChecked());
141
142 // object has one internal filed ( the C++ object)
143 tpl->InstanceTemplate()->SetInternalFieldCount(1);
144
145 _template.Reset(tpl);
146
147 // Prototype
148 v8::Local<v8::ObjectTemplate> proto = tpl->PrototypeTemplate();
149
150 Base::InitProto(proto);
151
152 EXPOSE_METHOD(Wire,getEdges);
153 EXPOSE_METHOD(Wire,getVertices);
154 EXPOSE_READ_ONLY_PROPERTY_INTEGER(Wire, numVertices);
155 EXPOSE_READ_ONLY_PROPERTY_INTEGER(Wire, numEdges);
156 EXPOSE_READ_ONLY_PROPERTY_BOOLEAN(Wire, isClosed);
157
158 Nan::Set(target,Nan::New("Wire").ToLocalChecked(), Nan::GetFunction(tpl).ToLocalChecked());
159}
160
161NAN_METHOD(Wire::getEdges)
162{

Callers 3

ShapeIteratorMethod · 0.45
fixShapeMethod · 0.45
extractShapeFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected