+//=================================================================================
+// function : execute
+// purpose :
+//=================================================================================
+bool TransformationGUI_MirrorDlg::execute (ObjectList& objects)
+{
+ bool res = false;
+ bool toCreateCopy = IsPreview() || GroupPoints->CheckButton1->isChecked();
+
+ GEOM::GEOM_Object_var anObj;
+
+ GEOM::GEOM_ITransformOperations_var anOper = GEOM::GEOM_ITransformOperations::_narrow(getOperation());
+
+ switch (getConstructorId()) {
+ case 0:
+ {
+ if (toCreateCopy) {
+ for (int i = 0; i < myObjects.count(); i++) {
+ anObj = anOper->MirrorPointCopy(myObjects[i].get(), myArgument.get());
+ if (!anObj->_is_nil())
+ objects.push_back(anObj._retn());
+ }
+ }
+ else {
+ for (int i = 0; i < myObjects.count(); i++) {
+ anObj = anOper->MirrorPoint(myObjects[i].get(), myArgument.get());
+ if (!anObj->_is_nil())
+ objects.push_back(anObj._retn());
+ }
+ }
+ res = true;
+ break;
+ }
+ case 1:
+ {
+ if (toCreateCopy) {
+ for (int i = 0; i < myObjects.count(); i++) {
+ anObj = anOper->MirrorAxisCopy(myObjects[i].get(), myArgument.get());
+ if (!anObj->_is_nil())
+ objects.push_back(anObj._retn());
+ }
+ }
+ else {
+ for (int i = 0; i < myObjects.count(); i++) {
+ anObj = anOper->MirrorAxis(myObjects[i].get(), myArgument.get());
+ if (!anObj->_is_nil())
+ objects.push_back(anObj._retn());
+ }
+ }
+ res = true;
+ break;
+ }
+ case 2:
+ {
+ if (toCreateCopy) {
+ for (int i = 0; i < myObjects.count(); i++) {
+ anObj = anOper->MirrorPlaneCopy(myObjects[i].get(), myArgument.get());
+ if (!anObj->_is_nil())
+ objects.push_back(anObj._retn());
+ }
+ }
+ else {
+ for (int i = 0; i < myObjects.count(); i++) {
+ anObj = anOper->MirrorPlane(myObjects[i].get(), myArgument.get());
+ if (!anObj->_is_nil())
+ objects.push_back(anObj._retn());
+ }
+ }
+ res = true;
+ break;
+ }
+ }
+
+ return res;
+}