void testExtensionCord::copyTest() { edm::ExtensionCord<int> cord1; edm::ExtensionCord<int> cord2(cord1); { int value(1); edm::ValueHolderECGetter<int> getter(value); edm::SimpleOutlet<int> outlet(getter, cord1 ); CPPUNIT_ASSERT( 1 == *cord2); } CPPUNIT_ASSERT(!cord2.connected()); }
void TransformObjectWindow::on_button_rotate() { int dx, dy, dz; string reference = " with reference "; if (rotate_point.get_active_row_number() == 0) { Coordinate center = object->getCenterOnWorld(); dx = center.getx(); dy = center.gety(); dz = center.getz(); reference += "on its center"; } else if (rotate_point.get_active_row_number() == 1) { dx = 0; dy = 0; dz = 0; reference += "on world's center"; } else { string dx_string = rotate_x_field.get_text().raw(); string dy_string = rotate_y_field.get_text().raw(); string dz_string = rotate_z_field.get_text().raw(); dx = atoi(dx_string.c_str()); dy = atoi(dy_string.c_str()); dz = atoi(dz_string.c_str()); reference += "(" + to_string(dx) + ", " + to_string(dy) + ", " + to_string(dz) + ")"; } string angle_string = rotate_degree_field.get_text().raw(); int angle = atoi(angle_string.c_str()); string axis = rotate_axis.get_active_text(); if (rotate_axis.get_active_row_number() == 0) { rotate_service.rotateX(this->object, dx, dy, dz, angle); } else if (rotate_axis.get_active_row_number() == 1) { rotate_service.rotateY(this->object, dx, dy, dz, angle); } else if (rotate_axis.get_active_row_number() == 2) { rotate_service.rotateZ(this->object, dx, dy, dz, angle); } else { string x1_string = rotate_axis_x1_field.get_text().raw(); string y1_string = rotate_axis_y1_field.get_text().raw(); string z1_string = rotate_axis_z1_field.get_text().raw(); string x2_string = rotate_axis_x2_field.get_text().raw(); string y2_string = rotate_axis_y2_field.get_text().raw(); string z2_string = rotate_axis_z2_field.get_text().raw(); int x1 = atoi(x1_string.c_str()); int y1 = atoi(y1_string.c_str()); int z1 = atoi(z1_string.c_str()); Coordinate cord1(x1, y1, z1); int x2 = atoi(x2_string.c_str()); int y2 = atoi(y2_string.c_str()); int z2 = atoi(z2_string.c_str()); Coordinate cord2(x2, y2, z2); Vector vec(cord1, cord2); rotate_service.rotateAxis(this->object, vec, angle); axis = "Axis [(" + to_string(x1) + ", " + to_string(y1) + ", " + to_string(z1) + "), (" + to_string(x2) + ", " + to_string(y2) + ", " + to_string(z2) + ")] "; reference = ""; } this->mainWindow->getViewport()->queue_draw(); this->mainWindow->getLogTextView()->add_log_line( this->object->getTypeName() + " named [" + this->object->getName() + "] was rotated in " + to_string(angle) + "º around " + axis + reference + "\n" ); hide(); }