- try {
- Handle(Geom_Surface) surf = BRep_Tool::Surface(TopoDS::Face(myShape2));
- Handle(Geom_Plane) myPlane = Handle(Geom_Plane)::DownCast(surf);
- const gp_Ax3 pos = myPlane->Position();
- const gp_Pnt loc = pos.Location(); /* location of the plane */
- const gp_Dir dir = pos.Direction(); /* Main direction of the plane (Z axis) */
-
- /* plane used for mirroring */
- gp_Ax2 pln(loc, dir);
- gp_Trsf theTransformation;
- theTransformation.SetMirror(pln);
- BRepBuilderAPI_Transform myBRepTransformation(myShape1, theTransformation, Standard_False);
-
- this->mySimulationTopoDs = myBRepTransformation.Shape();
- if(mySimulationTopoDs.IsNull())
- return;
- else
- myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
- }
- catch(Standard_Failure) {
- MESSAGE("Exception catched in MakeMirrorSimulationAndDisplay");
- return;
- }
- return;
+ GEOM::GEOM_Object_var anObj;
+
+ switch ( getConstructorId() )
+ {
+ case 0 :
+ {
+ if (toCreateCopy)
+ for (int i = 0; i < myObjects.length(); i++)
+ {
+ anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->MirrorPointCopy( myObjects[i], myArgument );
+ if ( !anObj->_is_nil() )
+ objects.push_back( anObj._retn() );
+ }
+ else
+ for (int i = 0; i < myObjects.length(); i++)
+ {
+ anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->MirrorPoint( myObjects[i], myArgument );
+ if ( !anObj->_is_nil() )
+ objects.push_back( anObj._retn() );
+ }
+ res = true;
+ break;
+ }
+ case 1 :
+ {
+ if (toCreateCopy)
+ for (int i = 0; i < myObjects.length(); i++)
+ {
+ anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->MirrorAxisCopy( myObjects[i], myArgument );
+ if ( !anObj->_is_nil() )
+ objects.push_back( anObj._retn() );
+ }
+ else
+ for (int i = 0; i < myObjects.length(); i++)
+ {
+ anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->MirrorAxis( myObjects[i], myArgument );
+ if ( !anObj->_is_nil() )
+ objects.push_back( anObj._retn() );
+ }
+ res = true;
+ break;
+ }
+ case 2:
+ {
+ if (toCreateCopy)
+ for (int i = 0; i < myObjects.length(); i++)
+ {
+ anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->MirrorPlaneCopy( myObjects[i], myArgument );
+ if ( !anObj->_is_nil() )
+ objects.push_back( anObj._retn() );
+ }
+ else
+ for (int i = 0; i < myObjects.length(); i++)
+ {
+ anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->MirrorPlane( myObjects[i], myArgument );
+ if ( !anObj->_is_nil() )
+ objects.push_back( anObj._retn() );
+ }
+ res = true;
+ break;
+ }
+ }
+
+ return res;
+}
+
+//=================================================================================
+// function : closeEvent
+// purpose :
+//=================================================================================
+void TransformationGUI_MirrorDlg::closeEvent( QCloseEvent* e )
+{
+ GEOMBase_Skeleton::closeEvent( e );
+}
+
+
+//=================================================================================
+// function : CreateCopyModeChanged()
+// purpose :
+//=================================================================================
+void TransformationGUI_MirrorDlg::CreateCopyModeChanged(bool isCreateCopy)
+{
+ this->GroupBoxName->setEnabled(isCreateCopy);