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

Function ReadPropertyPointFromArray

src/Util.cc:8–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6
7
8void ReadPropertyPointFromArray(v8::Local<v8::Array> arr, double* x, double* y, double*z)
9{
10 Nan::HandleScope scope;
11
12 double defaultValue =0.0;
13 int length = arr->Length();
14 if (length >= 1) {
15 auto element0 = Nan::Get(arr,0).ToLocalChecked();
16 *x = Nan::To<double>(element0).FromMaybe(defaultValue);
17 }
18 if (length >= 2) {
19 auto element1 = Nan::Get(arr,1).ToLocalChecked();
20 *y = Nan::To<double>(element1).FromMaybe(defaultValue);
21 }
22 if (length >= 3) {
23 auto element2 = Nan::Get(arr,2).ToLocalChecked();
24 *z = Nan::To<double>(element2).FromMaybe(defaultValue);
25 }
26
27}
28
29
30//void ReadPropertyPoint(Handle<Object> obj,const char* name,double* x,double* y, double*z )

Callers 1

ReadPointFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected