| 84 | } |
| 85 | |
| 86 | NAN_METHOD(Base::translate) |
| 87 | { |
| 88 | |
| 89 | CHECK_THIS_DEFINED(Base); |
| 90 | const Base* pThis = ObjectWrap::Unwrap<Base>(info.This()); |
| 91 | |
| 92 | try { |
| 93 | |
| 94 | gp_Trsf transformation; |
| 95 | |
| 96 | double x=0,y=0,z=0; |
| 97 | if (info.Length() == 3) { |
| 98 | ReadDouble(info[0], x); |
| 99 | ReadDouble(info[1], y); |
| 100 | ReadDouble(info[2], z); |
| 101 | } |
| 102 | else if (info.Length() == 1) { |
| 103 | ReadPoint(info[0], &x, &y, &z); |
| 104 | } |
| 105 | else { |
| 106 | return Nan::ThrowError("Wrong Arguments"); |
| 107 | } |
| 108 | transformation.SetTranslation(gp_Vec(x,y,z)); |
| 109 | |
| 110 | v8::Local<v8::Object> copy = pThis->Clone(); |
| 111 | |
| 112 | pThis->Unwrap(copy)->setShape(BRepBuilderAPI_Transform(pThis->shape(), transformation,Standard_True).Shape()); |
| 113 | |
| 114 | return info.GetReturnValue().Set(copy); |
| 115 | |
| 116 | } CATCH_AND_RETHROW("Failed to calculate a translated shape "); |
| 117 | |
| 118 | } |
| 119 | |
| 120 | NAN_METHOD(Base::rotate) |
| 121 | { |
nothing calls this directly
no test coverage detected