From 9f66a04c1ca82942fe2ca02fd2842990007f88f1 Mon Sep 17 00:00:00 2001 From: yfr Date: Fri, 3 Oct 2003 09:50:25 +0000 Subject: [PATCH] DCQ : New GEOM Architecture --- src/GEOMGUI/BooleanGUI.cxx | 128 -- src/GEOMGUI/BooleanGUI.h | 58 - src/GEOMGUI/GEOM_icons.po | 349 ----- src/GEOMGUI/GEOM_msg_en.po | 1179 ----------------- src/GEOMGUI/GEOM_msg_fr.po | 1130 ---------------- src/GEOMGUI/GeometryGUI_1Sel1Spin.cxx | 54 - src/GEOMGUI/GeometryGUI_1Sel1Spin.h | 47 - src/GEOMGUI/GeometryGUI_1Sel1Spin_QTD.cxx | 89 -- src/GEOMGUI/GeometryGUI_1Sel1Spin_QTD.h | 46 - src/GEOMGUI/GeometryGUI_1Sel4Spin.cxx | 67 - src/GEOMGUI/GeometryGUI_1Sel4Spin.h | 51 - src/GEOMGUI/GeometryGUI_1Sel4Spin_QTD.cxx | 132 -- src/GEOMGUI/GeometryGUI_1Sel4Spin_QTD.h | 55 - src/GEOMGUI/GeometryGUI_1Sel_QTD.cxx | 74 -- src/GEOMGUI/GeometryGUI_1Sel_QTD.h | 42 - src/GEOMGUI/GeometryGUI_1Spin.cxx | 56 - src/GEOMGUI/GeometryGUI_1Spin.h | 47 - src/GEOMGUI/GeometryGUI_1Spin_QTD.cxx | 68 - src/GEOMGUI/GeometryGUI_1Spin_QTD.h | 40 - src/GEOMGUI/GeometryGUI_2Sel1Spin.cxx | 54 - src/GEOMGUI/GeometryGUI_2Sel1Spin.h | 47 - src/GEOMGUI/GeometryGUI_2Sel1Spin_QTD.cxx | 105 -- src/GEOMGUI/GeometryGUI_2Sel1Spin_QTD.h | 49 - src/GEOMGUI/GeometryGUI_2Sel2Spin.cxx | 57 - src/GEOMGUI/GeometryGUI_2Sel2Spin.h | 48 - src/GEOMGUI/GeometryGUI_2Sel2Spin_QTD.cxx | 116 -- src/GEOMGUI/GeometryGUI_2Sel2Spin_QTD.h | 51 - src/GEOMGUI/GeometryGUI_2Sel3Spin.cxx | 60 - src/GEOMGUI/GeometryGUI_2Sel3Spin.h | 49 - src/GEOMGUI/GeometryGUI_2Sel3Spin_QTD.cxx | 127 -- src/GEOMGUI/GeometryGUI_2Sel3Spin_QTD.h | 53 - src/GEOMGUI/GeometryGUI_2Sel_QTD.cxx | 90 -- src/GEOMGUI/GeometryGUI_2Sel_QTD.h | 45 - src/GEOMGUI/GeometryGUI_2Spin.cxx | 60 - src/GEOMGUI/GeometryGUI_2Spin.h | 48 - src/GEOMGUI/GeometryGUI_2Spin_QTD.cxx | 79 -- src/GEOMGUI/GeometryGUI_2Spin_QTD.h | 42 - src/GEOMGUI/GeometryGUI_3Spin.cxx | 63 - src/GEOMGUI/GeometryGUI_3Spin.h | 49 - src/GEOMGUI/GeometryGUI_3Spin_QTD.cxx | 90 -- src/GEOMGUI/GeometryGUI_3Spin_QTD.h | 44 - src/GEOMGUI/GeometryGUI_ArcDlg.cxx | 507 ------- src/GEOMGUI/GeometryGUI_ArcDlg.h | 125 -- src/GEOMGUI/GeometryGUI_ArchimedeDlg.cxx | 470 ------- src/GEOMGUI/GeometryGUI_ArchimedeDlg.h | 127 -- src/GEOMGUI/GeometryGUI_BndBoxDlg.cxx | 487 ------- src/GEOMGUI/GeometryGUI_BndBoxDlg.h | 119 -- src/GEOMGUI/GeometryGUI_BoxDlg.cxx | 411 ------ src/GEOMGUI/GeometryGUI_BoxDlg.h | 83 -- src/GEOMGUI/GeometryGUI_CenterMassDlg.cxx | 527 -------- src/GEOMGUI/GeometryGUI_CenterMassDlg.h | 121 -- src/GEOMGUI/GeometryGUI_ChamferDlg.cxx | 934 ------------- src/GEOMGUI/GeometryGUI_ChamferDlg.h | 172 --- src/GEOMGUI/GeometryGUI_CheckShape.cxx | 402 ------ src/GEOMGUI/GeometryGUI_CheckShape.h | 110 -- src/GEOMGUI/GeometryGUI_CircleDlg.cxx | 504 ------- src/GEOMGUI/GeometryGUI_CircleDlg.h | 126 -- src/GEOMGUI/GeometryGUI_CommonDlg.cxx | 253 ---- src/GEOMGUI/GeometryGUI_CommonDlg.h | 76 -- src/GEOMGUI/GeometryGUI_CompoundDlg.cxx | 375 ------ src/GEOMGUI/GeometryGUI_CompoundDlg.h | 106 -- src/GEOMGUI/GeometryGUI_ConeDlg.cxx | 434 ------ src/GEOMGUI/GeometryGUI_ConeDlg.h | 94 -- src/GEOMGUI/GeometryGUI_CutDlg.cxx | 251 ---- src/GEOMGUI/GeometryGUI_CutDlg.h | 76 -- src/GEOMGUI/GeometryGUI_CylinderDlg.cxx | 415 ------ src/GEOMGUI/GeometryGUI_CylinderDlg.h | 92 -- src/GEOMGUI/GeometryGUI_DistanceDlg.cxx | 589 -------- src/GEOMGUI/GeometryGUI_DistanceDlg.h | 125 -- src/GEOMGUI/GeometryGUI_EdgeDlg.cxx | 462 ------- src/GEOMGUI/GeometryGUI_EdgeDlg.h | 118 -- src/GEOMGUI/GeometryGUI_EllipseDlg.cxx | 533 -------- src/GEOMGUI/GeometryGUI_EllipseDlg.h | 133 -- src/GEOMGUI/GeometryGUI_FaceDlg.cxx | 420 ------ src/GEOMGUI/GeometryGUI_FaceDlg.h | 113 -- src/GEOMGUI/GeometryGUI_FilletDlg.cxx | 842 ------------ src/GEOMGUI/GeometryGUI_FilletDlg.h | 163 --- src/GEOMGUI/GeometryGUI_FillingDlg.cxx | 644 --------- src/GEOMGUI/GeometryGUI_FillingDlg.h | 127 -- src/GEOMGUI/GeometryGUI_FillingHoleDlg.cxx | 542 -------- src/GEOMGUI/GeometryGUI_FillingHoleDlg.h | 133 -- src/GEOMGUI/GeometryGUI_FuseDlg.cxx | 251 ---- src/GEOMGUI/GeometryGUI_FuseDlg.h | 76 -- src/GEOMGUI/GeometryGUI_InertiaDlg.cxx | 566 -------- src/GEOMGUI/GeometryGUI_InertiaDlg.h | 124 -- src/GEOMGUI/GeometryGUI_LineDlg.cxx | 518 -------- src/GEOMGUI/GeometryGUI_LineDlg.h | 125 -- src/GEOMGUI/GeometryGUI_MaxToleranceDlg.cxx | 547 -------- src/GEOMGUI/GeometryGUI_MaxToleranceDlg.h | 119 -- src/GEOMGUI/GeometryGUI_MirrorDlg.cxx | 525 -------- src/GEOMGUI/GeometryGUI_MirrorDlg.h | 118 -- src/GEOMGUI/GeometryGUI_MultiRotationDlg.cxx | 986 -------------- src/GEOMGUI/GeometryGUI_MultiRotationDlg.h | 162 --- .../GeometryGUI_MultiTranslationDlg.cxx | 1063 --------------- src/GEOMGUI/GeometryGUI_MultiTranslationDlg.h | 169 --- src/GEOMGUI/GeometryGUI_NbIsosDlg.cxx | 135 -- src/GEOMGUI/GeometryGUI_NbIsosDlg.h | 61 - src/GEOMGUI/GeometryGUI_OrientationDlg.cxx | 608 --------- src/GEOMGUI/GeometryGUI_OrientationDlg.h | 124 -- src/GEOMGUI/GeometryGUI_PartitionDlg.cxx | 530 -------- src/GEOMGUI/GeometryGUI_PartitionDlg.h | 127 -- src/GEOMGUI/GeometryGUI_PipeDlg.cxx | 514 ------- src/GEOMGUI/GeometryGUI_PipeDlg.h | 119 -- src/GEOMGUI/GeometryGUI_PlaneDlg.cxx | 570 -------- src/GEOMGUI/GeometryGUI_PlaneDlg.h | 95 -- src/GEOMGUI/GeometryGUI_PointDlg.cxx | 786 ----------- src/GEOMGUI/GeometryGUI_PointDlg.h | 153 --- src/GEOMGUI/GeometryGUI_PrismDlg.cxx | 608 --------- src/GEOMGUI/GeometryGUI_PrismDlg.h | 129 -- src/GEOMGUI/GeometryGUI_PropertiesDlg.cxx | 467 ------- src/GEOMGUI/GeometryGUI_PropertiesDlg.h | 116 -- src/GEOMGUI/GeometryGUI_RevolDlg.cxx | 560 -------- src/GEOMGUI/GeometryGUI_RevolDlg.h | 133 -- src/GEOMGUI/GeometryGUI_RotationDlg.cxx | 548 -------- src/GEOMGUI/GeometryGUI_RotationDlg.h | 132 -- src/GEOMGUI/GeometryGUI_ScaleDlg.cxx | 535 -------- src/GEOMGUI/GeometryGUI_ScaleDlg.h | 121 -- src/GEOMGUI/GeometryGUI_SectionDlg.cxx | 252 ---- src/GEOMGUI/GeometryGUI_SectionDlg.h | 76 -- src/GEOMGUI/GeometryGUI_SewingDlg.cxx | 393 ------ src/GEOMGUI/GeometryGUI_SewingDlg.h | 111 -- src/GEOMGUI/GeometryGUI_ShellDlg.cxx | 202 --- src/GEOMGUI/GeometryGUI_ShellDlg.h | 69 - src/GEOMGUI/GeometryGUI_Skeleton.cxx | 175 --- src/GEOMGUI/GeometryGUI_Skeleton.h | 76 -- src/GEOMGUI/GeometryGUI_Skeleton_QTD.cxx | 111 -- src/GEOMGUI/GeometryGUI_Skeleton_QTD.h | 50 - src/GEOMGUI/GeometryGUI_SolidDlg.cxx | 200 --- src/GEOMGUI/GeometryGUI_SolidDlg.h | 67 - src/GEOMGUI/GeometryGUI_SphereDlg.cxx | 340 ----- src/GEOMGUI/GeometryGUI_SphereDlg.h | 82 -- src/GEOMGUI/GeometryGUI_SpinBox.cxx | 101 -- src/GEOMGUI/GeometryGUI_SpinBox.h | 60 - src/GEOMGUI/GeometryGUI_SubShapeDlg.cxx | 745 ----------- src/GEOMGUI/GeometryGUI_SubShapeDlg.h | 139 -- src/GEOMGUI/GeometryGUI_SuppressFacesDlg.cxx | 523 -------- src/GEOMGUI/GeometryGUI_SuppressFacesDlg.h | 130 -- src/GEOMGUI/GeometryGUI_SuppressHoleDlg.cxx | 969 -------------- src/GEOMGUI/GeometryGUI_SuppressHoleDlg.h | 162 --- src/GEOMGUI/GeometryGUI_TorusDlg.cxx | 400 ------ src/GEOMGUI/GeometryGUI_TorusDlg.h | 92 -- src/GEOMGUI/GeometryGUI_TranslationDlg.cxx | 563 -------- src/GEOMGUI/GeometryGUI_TranslationDlg.h | 127 -- src/GEOMGUI/GeometryGUI_TransparencyDlg.cxx | 249 ---- src/GEOMGUI/GeometryGUI_TransparencyDlg.h | 96 -- src/GEOMGUI/GeometryGUI_VectorDlg.cxx | 708 ---------- src/GEOMGUI/GeometryGUI_VectorDlg.h | 150 --- src/GEOMGUI/GeometryGUI_WhatisDlg.cxx | 449 ------- src/GEOMGUI/GeometryGUI_WhatisDlg.h | 111 -- src/GEOMGUI/GeometryGUI_WireDlg.cxx | 375 ------ src/GEOMGUI/GeometryGUI_WireDlg.h | 106 -- src/GEOMGUI/GeometryGUI_WorkingPlaneDlg.cxx | 423 ------ src/GEOMGUI/GeometryGUI_WorkingPlaneDlg.h | 113 -- src/GEOMGUI/GeometryGUI_aParameterDlg.cxx | 166 --- src/GEOMGUI/GeometryGUI_aParameterDlg.h | 71 - src/GEOMGUI/PrimitiveGUI.cxx | 239 ---- src/GEOMGUI/PrimitiveGUI.h | 65 - 157 files changed, 39535 deletions(-) delete mode 100644 src/GEOMGUI/BooleanGUI.cxx delete mode 100644 src/GEOMGUI/BooleanGUI.h delete mode 100644 src/GEOMGUI/GEOM_icons.po delete mode 100644 src/GEOMGUI/GEOM_msg_en.po delete mode 100644 src/GEOMGUI/GEOM_msg_fr.po delete mode 100644 src/GEOMGUI/GeometryGUI_1Sel1Spin.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_1Sel1Spin.h delete mode 100644 src/GEOMGUI/GeometryGUI_1Sel1Spin_QTD.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_1Sel1Spin_QTD.h delete mode 100644 src/GEOMGUI/GeometryGUI_1Sel4Spin.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_1Sel4Spin.h delete mode 100644 src/GEOMGUI/GeometryGUI_1Sel4Spin_QTD.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_1Sel4Spin_QTD.h delete mode 100644 src/GEOMGUI/GeometryGUI_1Sel_QTD.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_1Sel_QTD.h delete mode 100644 src/GEOMGUI/GeometryGUI_1Spin.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_1Spin.h delete mode 100644 src/GEOMGUI/GeometryGUI_1Spin_QTD.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_1Spin_QTD.h delete mode 100644 src/GEOMGUI/GeometryGUI_2Sel1Spin.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_2Sel1Spin.h delete mode 100644 src/GEOMGUI/GeometryGUI_2Sel1Spin_QTD.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_2Sel1Spin_QTD.h delete mode 100644 src/GEOMGUI/GeometryGUI_2Sel2Spin.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_2Sel2Spin.h delete mode 100644 src/GEOMGUI/GeometryGUI_2Sel2Spin_QTD.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_2Sel2Spin_QTD.h delete mode 100644 src/GEOMGUI/GeometryGUI_2Sel3Spin.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_2Sel3Spin.h delete mode 100644 src/GEOMGUI/GeometryGUI_2Sel3Spin_QTD.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_2Sel3Spin_QTD.h delete mode 100644 src/GEOMGUI/GeometryGUI_2Sel_QTD.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_2Sel_QTD.h delete mode 100644 src/GEOMGUI/GeometryGUI_2Spin.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_2Spin.h delete mode 100644 src/GEOMGUI/GeometryGUI_2Spin_QTD.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_2Spin_QTD.h delete mode 100644 src/GEOMGUI/GeometryGUI_3Spin.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_3Spin.h delete mode 100644 src/GEOMGUI/GeometryGUI_3Spin_QTD.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_3Spin_QTD.h delete mode 100644 src/GEOMGUI/GeometryGUI_ArcDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_ArcDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_ArchimedeDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_ArchimedeDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_BndBoxDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_BndBoxDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_BoxDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_BoxDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_CenterMassDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_CenterMassDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_ChamferDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_ChamferDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_CheckShape.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_CheckShape.h delete mode 100644 src/GEOMGUI/GeometryGUI_CircleDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_CircleDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_CommonDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_CommonDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_CompoundDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_CompoundDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_ConeDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_ConeDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_CutDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_CutDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_CylinderDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_CylinderDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_DistanceDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_DistanceDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_EdgeDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_EdgeDlg.h delete mode 100755 src/GEOMGUI/GeometryGUI_EllipseDlg.cxx delete mode 100755 src/GEOMGUI/GeometryGUI_EllipseDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_FaceDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_FaceDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_FilletDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_FilletDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_FillingDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_FillingDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_FillingHoleDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_FillingHoleDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_FuseDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_FuseDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_InertiaDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_InertiaDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_LineDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_LineDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_MaxToleranceDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_MaxToleranceDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_MirrorDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_MirrorDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_MultiRotationDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_MultiRotationDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_MultiTranslationDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_MultiTranslationDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_NbIsosDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_NbIsosDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_OrientationDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_OrientationDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_PartitionDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_PartitionDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_PipeDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_PipeDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_PlaneDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_PlaneDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_PointDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_PointDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_PrismDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_PrismDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_PropertiesDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_PropertiesDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_RevolDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_RevolDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_RotationDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_RotationDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_ScaleDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_ScaleDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_SectionDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_SectionDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_SewingDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_SewingDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_ShellDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_ShellDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_Skeleton.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_Skeleton.h delete mode 100644 src/GEOMGUI/GeometryGUI_Skeleton_QTD.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_Skeleton_QTD.h delete mode 100644 src/GEOMGUI/GeometryGUI_SolidDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_SolidDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_SphereDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_SphereDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_SpinBox.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_SpinBox.h delete mode 100644 src/GEOMGUI/GeometryGUI_SubShapeDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_SubShapeDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_SuppressFacesDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_SuppressFacesDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_SuppressHoleDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_SuppressHoleDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_TorusDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_TorusDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_TranslationDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_TranslationDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_TransparencyDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_TransparencyDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_VectorDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_VectorDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_WhatisDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_WhatisDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_WireDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_WireDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_WorkingPlaneDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_WorkingPlaneDlg.h delete mode 100644 src/GEOMGUI/GeometryGUI_aParameterDlg.cxx delete mode 100644 src/GEOMGUI/GeometryGUI_aParameterDlg.h delete mode 100644 src/GEOMGUI/PrimitiveGUI.cxx delete mode 100644 src/GEOMGUI/PrimitiveGUI.h diff --git a/src/GEOMGUI/BooleanGUI.cxx b/src/GEOMGUI/BooleanGUI.cxx deleted file mode 100644 index b311a8d13..000000000 --- a/src/GEOMGUI/BooleanGUI.cxx +++ /dev/null @@ -1,128 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : BooleanGUI.cxx -// Author : Damien COQUERET -// Module : GEOM -// $Header: - -using namespace std; -#include "BooleanGUI.h" - -#include "QAD_Application.h" -#include "SALOMEGUI_QtCatchCorbaException.hxx" - -#include "GeometryGUI_FuseDlg.h" // Method FUSE -#include "GeometryGUI_CommonDlg.h" // Method COMMON -#include "GeometryGUI_CutDlg.h" // Method CUT -#include "GeometryGUI_SectionDlg.h" // Method SECTION - -//======================================================================= -// function : BooleanGUI() -// purpose : Constructor -//======================================================================= -BooleanGUI::BooleanGUI() : - QObject() -{ - myGeomGUI = GeometryGUI::GetGeometryGUI(); - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); -} - - -//======================================================================= -// function : ~BooleanGUI() -// purpose : Destructor -//======================================================================= -BooleanGUI::~BooleanGUI() -{ -} - - -//======================================================================= -// function : OnGUIEvent() -// purpose : -//======================================================================= -bool BooleanGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent) -{ - myGeomGUI->EmitSignalDeactivateDialog(); - SALOME_Selection* Sel = SALOME_Selection::Selection(myGeomGUI->GetActiveStudy()->getSelection()); - - switch (theCommandID) - { - case 4011: // FUSE - { - GeometryGUI_FuseDlg *aDlg = new GeometryGUI_FuseDlg(parent, "", this, Sel); - break; - } - case 4012: // COMMON - { - GeometryGUI_CommonDlg *aDlg = new GeometryGUI_CommonDlg(parent, "", this, Sel); - break; - } - case 4013: // CUT - { - GeometryGUI_CutDlg *aDlg = new GeometryGUI_CutDlg(parent, "", this, Sel); - break; - } - case 4014: // SECTION - { - GeometryGUI_SectionDlg *aDlg = new GeometryGUI_SectionDlg(parent, "", this, Sel); - break; - } - default: - { - parent->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID)); - break; - } - } - return true; -} - - -//======================================================================= -// function : MakeBooleanAndDisplay() -// purpose : -//======================================================================= -void BooleanGUI::MakeBooleanAndDisplay(GEOM::GEOM_Shape_ptr Shape1, GEOM::GEOM_Shape_ptr Shape2, const short operation) -{ - try { - GEOM::GEOM_Shape_ptr result = myGeom->MakeBoolean(Shape1, Shape2, operation); - if(result->_is_nil()) { - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE")); - return; - } - - TopoDS_Shape S = myGeomGUI->GetShapeReader().GetShape(myGeom, result); - Standard_CString type; - myGeomGUI->GetShapeTypeString(S,type); - result->NameType(type); - - if (myGeomGUI->Display(result, "")) - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE")); - } - catch (const SALOME::SALOME_Exception& S_ex) { - QtCatchCorbaException(S_ex); - } - return; -} diff --git a/src/GEOMGUI/BooleanGUI.h b/src/GEOMGUI/BooleanGUI.h deleted file mode 100644 index bfc348c08..000000000 --- a/src/GEOMGUI/BooleanGUI.h +++ /dev/null @@ -1,58 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : BooleanGUI.h -// Author : Damien COQUERET -// Module : GEOM -// $Header: - -#ifndef BOOLEANGUI_H -#define BOOLEANGUI_H - -#include "GeometryGUI.h" - -//================================================================================= -// class : BooleanGUI -// purpose : -//================================================================================= -class BooleanGUI : public QObject -{ - Q_OBJECT /* for QT compatibility */ - -public : - BooleanGUI(); - ~BooleanGUI(); - - bool OnGUIEvent(int theCommandID, QAD_Desktop* parent); - - void MakeBooleanAndDisplay(GEOM::GEOM_Shape_ptr Shape1, - GEOM::GEOM_Shape_ptr Shape2, - const short operation); - -private: - GeometryGUI* myGeomGUI; - GEOM::GEOM_Gen_var myGeom; /* Current Geom Component */ - -}; - -#endif diff --git a/src/GEOMGUI/GEOM_icons.po b/src/GEOMGUI/GEOM_icons.po deleted file mode 100644 index 3195286cc..000000000 --- a/src/GEOMGUI/GEOM_icons.po +++ /dev/null @@ -1,349 +0,0 @@ -# This is a Qt message file in .po format. Each msgid starts with -# a scope. This scope should *NOT* be translated - eg. translating -# from French to English, "Foo::Bar" would be translated to "Pub", -# not "Foo::Pub". -msgid "" -msgstr "" -"Project-Id-Version: PROJECT VERSION\n" -"POT-Creation-Date: 2001-06-14 09:11:49 PM CEST\n" -"PO-Revision-Date: 2003-09-22 16:39+0200\n" -"Last-Translator: FULLNAME \n" -"Content-Type: text/plain; charset=iso-8859-1\n" - -#Select -msgid "ICON_SELECT" -msgstr "select1.png" - -#: QAD_ObjectBrowser.cxx:140 -msgid "ICON_OBJBROWSER_Geometry" -msgstr "geometry.png" - -#: QAD_ObjectBrowser.cxx:140 -msgid "ICON_OBJBROWSER_COMPOUND" -msgstr "tree_compound.png" - -#: QAD_ObjectBrowser.cxx:140 -msgid "ICON_OBJBROWSER_COMPSOLID" -msgstr "tree_compsolid.png" - -#: QAD_ObjectBrowser.cxx:140 -msgid "ICON_OBJBROWSER_EDGE" -msgstr "tree_edge.png" - -#: QAD_ObjectBrowser.cxx:140 -msgid "ICON_OBJBROWSER_FACE" -msgstr "tree_face.png" - -#: QAD_ObjectBrowser.cxx:140 -msgid "ICON_OBJBROWSER_SHAPE" -msgstr "tree_shape.png" - -#: QAD_ObjectBrowser.cxx:140 -msgid "ICON_OBJBROWSER_SHELL" -msgstr "tree_shell.png" - -#: QAD_ObjectBrowser.cxx:140 -msgid "ICON_OBJBROWSER_SOLID" -msgstr "tree_solid.png" - -#: QAD_ObjectBrowser.cxx:140 -msgid "ICON_OBJBROWSER_VERTEX" -msgstr "tree_vertex.png" - -#: QAD_ObjectBrowser.cxx:140 -msgid "ICON_OBJBROWSER_WIRE" -msgstr "tree_wire.png" - -#BoxDlg -msgid "ICON_DLG_BOX_2P" -msgstr "box2points.png" - -#BoxDlg -msgid "ICON_DLG_BOX_DXYZ" -msgstr "boxdxyz.png" - -#CylinderDlg -msgid "ICON_DLG_CYLINDER_PV" -msgstr "cylinderpointvector.png" - -#CylinderDlg -msgid "ICON_DLG_CYLINDER_DXYZ" -msgstr "cylinderdxyz.png" - -#SphereDlg -msgid "ICON_DLG_SPHERE_P" -msgstr "spherepoint.png" - -#SphereDlg -msgid "ICON_DLG_SPHERE_DXYZ" -msgstr "spheredxyz.png" - -#torusDlg -msgid "ICON_DLG_TORUS_PV" -msgstr "toruspointvector.png" - -#ConeDlg -msgid "ICON_DLG_CONE_PV" -msgstr "conepointvector.png" - -#torusDlg -msgid "ICON_DLG_TORUS_DXYZ" -msgstr "torusdxyz.png" - -#ConeDlg -msgid "ICON_DLG_CONE_DXYZ" -msgstr "conedxyz.png" - -#LineDlg -msgid "ICON_DLG_LINE_2P" -msgstr "line2points.png" - -#LineDlg -msgid "ICON_DLG_LINE_EDGE" -msgstr "lineedge.png" - -#LineDlg -msgid "ICON_DLG_LINE_PV" -msgstr "linepointvector.png" - -#CircleDlg -msgid "ICON_DLG_CIRCLE_PV" -msgstr "circlepointvector.png" - -#VectorDlg -msgid "ICON_DLG_VECTOR_2P" -msgstr "vector2points.png" - -#vectorDlg -msgid "ICON_DLG_VECTOR_DXYZ" -msgstr "vectordxyz.png" - -#PlaneDlg -msgid "ICON_DLG_PLANE_DXYZ" -msgstr "planedxyz.png" - -#PlaneDlg -msgid "ICON_DLG_PLANE_FACE" -msgstr "planeface.png" - -#PlaneDlg -msgid "ICON_DLG_PLANE_PV" -msgstr "planepointvector.png" - -#WorkingPlaneDlg -msgid "ICON_DLG_WPLANE_FACE" -msgstr "planeworkingface.png" - -#PointDlg -msgid "ICON_DLG_POINT" -msgstr "point2.png" - -#PoinDlg -msgid "ICON_DLG_POINT_EDGE" -msgstr "pointonedge.png" - -#ArcDlg -msgid "ICON_DLG_ARC" -msgstr "arc.png" - -#ArchimedeDlg -msgid "ICON_DLG_ARCHIMEDE" -msgstr "archimede.png" - -#PartitionDlg -msgid "ICON_DLG_PARTITION" -msgstr "partition.png" - -#PartitionDlg -msgid "ICON_DLG_PARTITION_KEEP_FACES" -msgstr "partitionkeep.png" - -#CenterMassDlg -msgid "ICON_DLG_CENTERMASS" -msgstr "centergravity.png" - -#BoundingBoxDlg -msgid "ICON_DLG_BOUNDING_BOX" -msgstr "bounding.png" - -#CommonDlg -msgid "ICON_DLG_COMMON" -msgstr "common.png" - -#CompoundDlg -msgid "ICON_DLG_BUILD_COMPOUND" -msgstr "build_compound.png" - -#CutDlg -msgid "ICON_DLG_CUT" -msgstr "cut.png" - -#EdgeDlg -msgid "ICON_DLG_BUILD_EDGE" -msgstr "build_edge.png" - -#FaceDlg -msgid "ICON_DLG_BUILD_FACE" -msgstr "build_face.png" - -#ShellDlg -msgid "ICON_DLG_BUILD_SHELL" -msgstr "build_shell.png" - -#SolidDlg -msgid "ICON_DLG_BUILD_SOLID" -msgstr "build_solid.png" - -#WireDlg -msgid "ICON_DLG_BUILD_WIRE" -msgstr "build_wire.png" - -#FillingDlg -msgid "ICON_DLG_FILLING" -msgstr "filling.png" - -#FuseDlg -msgid "ICON_DLG_FUSE" -msgstr "fuse.png" - -#InertiaDlg -msgid "ICON_DLG_INERTIA" -msgstr "axisinertia.png" - -#ToleranceDlg -msgid "ICON_DLG_TOLERANCE" -msgstr "tolerance.png" - -#BasicPropertiesDlg -msgid "ICON_DLG_BASICPROPERTIES" -msgstr "basicproperties.png" - -#WhatisDlg -msgid "ICON_DLG_WHATIS" -msgstr "whatis.png" - -#MinDistDlg -msgid "ICON_DLG_MINDIST" -msgstr "mindist.png" - -#MirrorDlg -msgid "ICON_DLG_MIRROR" -msgstr "mirrorPlane.png" - -#TranslationDlg -msgid "ICON_DLG_TRANSLATION" -msgstr "translation.png" - -#RotationDlg -msgid "ICON_DLG_ROTATION" -msgstr "rotate.png" - -#ScaleDlg -msgid "ICON_DLG_SCALE" -msgstr "scale.png" - -#OrientationDlg -msgid "ICON_DLG_ORIENTATION" -msgstr "orientation.png" - -#SewingDlg -msgid "ICON_DLG_SEWING" -msgstr "sewing.png" - -#PipeDlg -msgid "ICON_DLG_PIPE" -msgstr "pipe.png" - -#PrismDlg -msgid "ICON_DLG_PRISM" -msgstr "prism.png" - -#RevolutionDlg -msgid "ICON_DLG_REVOL" -msgstr "revol.png" - -#SectionDlg -msgid "ICON_DLG_SECTION" -msgstr "section.png" - -#SubShapeDlg -msgid "ICON_DLG_SUBSHAPE" -msgstr "subshape.png" - -#FilletDlg -msgid "ICON_DLG_FILLET" -msgstr "fillet.png" - -#ChamferDlg -msgid "ICON_DLG_CHAMFER" -msgstr "chamfer.png" - -#FilletDlg -msgid "ICON_DLG_FILLET_ALL" -msgstr "filletall.png" - -#ChamferDlg -msgid "ICON_DLG_CHAMFER_ALL" -msgstr "chamferall.png" - -#FilletDlg -msgid "ICON_DLG_FILLET_EDGE" -msgstr "filletedge.png" - -#ChamferDlg -msgid "ICON_DLG_CHAMFER_EDGE" -msgstr "chamferedge.png" - -#FilletDlg -msgid "ICON_DLG_FILLET_FACE" -msgstr "filletface.png" - -#ChamferDlg -msgid "ICON_DLG_CHAMFER_FACE" -msgstr "chamferface.png" - -#ChamferDlg -msgid "ICON_DLG_CHECKSHAPE" -msgstr "check.png" - -#SupressFaceDlg -msgid "ICON_DLG_SUPRESS_FACE" -msgstr "supressface.png" - -#SupressHoleDlg -msgid "ICON_DLG_SUPRESS_HOLE" -msgstr "supresshole.png" - -#SupressHoleDlg -msgid "ICON_DLG_SUPRESS_HOLE_FACE_SHELL" -msgstr "supressHolesOnFaceShell.png" - -#MultiTranslationDlg -msgid "ICON_DLG_MULTITRANSLATION_SIMPLE" -msgstr "multitranslationsimple.png" - -#MultiTranslationDlg -msgid "ICON_DLG_MULTITRANSLATION" -msgstr "multitranslation.png" - -#MultiTranslationDlg -msgid "ICON_DLG_MULTITRANSLATION_DOUBLE" -msgstr "multitranslationdouble.png" - -#MultiRotationDlg -msgid "ICON_DLG_MULTIROTATION_SIMPLE" -msgstr "multirotationsimple.png" - -#MultiRotationDlg -msgid "ICON_DLG_MULTIROTATION" -msgstr "multirotation.png" - -#MultiRotationDlg -msgid "ICON_DLG_MULTIROTATION_DOUBLE" -msgstr "multirotationdouble.png" - -#EllipseDlg -msgid "ICON_DLG_ELLIPSE_PV" -msgstr "ellipsepointvector.png" - - diff --git a/src/GEOMGUI/GEOM_msg_en.po b/src/GEOMGUI/GEOM_msg_en.po deleted file mode 100644 index 3c2b93cc8..000000000 --- a/src/GEOMGUI/GEOM_msg_en.po +++ /dev/null @@ -1,1179 +0,0 @@ -# This is a Qt message file in .po format. Each msgid starts with -# a scope. This scope should *NOT* be translated - eg. translating -# from French to English, "Foo::Bar" would be translated to "Pub", -# not "Foo::Pub". -msgid "" -msgstr "" -"Project-Id-Version: PROJECT VERSION\n" -"POT-Creation-Date: 2002-03-19 09:35:48 AM CET\n" -"PO-Revision-Date: 2003-09-22 16:38+0200\n" -"Last-Translator: FULLNAME \n" -"Content-Type: text/plain; charset=iso-8859-1\n" - -# -#============================================================================== -# - -#Button Apply -msgid "GEOM_BUT_APPLY" -msgstr "&Apply" - -#Button Close -msgid "GEOM_BUT_CLOSE" -msgstr "&Close" - -#Button Cancel -msgid "GEOM_BUT_CANCEL" -msgstr "&Cancel" - -#Button Ok -msgid "GEOM_BUT_OK" -msgstr "&Ok" - -#Button Yes -msgid "GEOM_BUT_YES" -msgstr "&Yes" - -#Button No -msgid "GEOM_BUT_NO" -msgstr "&No" - -#Button Help -msgid "GEOM_BUT_HELP" -msgstr "&Help" - -#Button Explode -msgid "GEOM_BUT_EXPLODE" -msgstr "&Explode" - - -# -#============================================================================== -# - -#: GeometryGUI.cxx:563 -msgid "GEOM_INF_LOADED" -msgstr "File %1 loaded." - -# -#============================================================================== -# - -#: GeometryGUI.cxx:3069 -msgid "GEOM_PRP_COMMAND" -msgstr "No command associated with this id = %1." - -#: GeometryGUI.cxx:4977 -msgid "GEOM_PRP_ABORT" -msgstr "Operation aborted" - -#: GeometryGUI.cxx:5058 -msgid "GEOM_PRP_DONE" -msgstr "Operation done" - -#: GeometryGUI.cxx:3717 -msgid "GEOM_PRP_LOADING" -msgstr "Loading %1 ..." - -#: GeometryGUI.cxx:1412 -msgid "GEOM_PRP_NULLSHAPE" -msgstr "Error, null or inappropriate shape !" - -#: GeometryGUI.cxx:5072 -msgid "GEOM_PRP_READY" -msgstr "Ready" - -#: GeometryGUI.cxx:1690 -msgid "GEOM_PRP_SELECT_SUBSHAPES" -msgstr "Select Sub Shapes" - -msgid "GEOM_CONFIRM" -msgstr "Confirm operation" - -msgid "GEOM_CONFIRM_INFO" -msgstr "Shape contains %1 sub shapes !" - - -msgid "GEOM_PRP_NOT_FOR_VTK_VIEWER" -msgstr "Not allowed in VTK viewer" - -#: GeometryGUI.cxx:1690 -msgid "GEOM_PRP_SHAPE_IN_STUDY" -msgstr "Main shape must be in the study before" - -#: GeometryGUI.cxx:1690 -msgid "GEOM_PRP_SELECT_EDGE" -msgstr "Select edges and click on Apply" - -#: GeometryGUI.cxx:1690 -msgid "GEOM_PRP_SELECT_FACE" -msgstr "Select faces to suppress and click on Ok/Apply" - -#: GeometryGUI.cxx:1690 -msgid "GEOM_PRP_SELECT_FIRST" -msgstr "Select main shape first" - -#: GeometryGUI.cxx:1690 -msgid "GEOM_PRP_MIN_DIST" -msgstr "Min Distance not computed" - -# -#============================================================================== -# - -#: GeometryGUI.cxx:3698 -msgid "GEOM_MEN_ALL_FILES" -msgstr "All Files ( * )" - -#: GeometryGUI.cxx:4389 -msgid "GEOM_MEN_ANGLE" -msgstr "Angle :" - -#: GeometryGUI.cxx:3941 -msgid "GEOM_MEN_COMPONENT" -msgstr "Geometry" - -#: GeometryGUI.cxx:4389 -msgid "GEOM_MEN_ENTER_ANGLE" -msgstr "Enter An Angle In Degrees" - -#: GeometryGUI.cxx:3758 -msgid "GEOM_MEN_EXPORT" -msgstr "Export" - -#: GeometryGUI.cxx:3648 -msgid "GEOM_MEN_IMPORT" -msgstr "Import" - -#: GeometryGUI.cxx:3761 -msgid "GEOM_MEN_IMPORT_BREP" -msgstr "BREP Files ( *.brep )" - -#: GeometryGUI.cxx:3762 -msgid "GEOM_MEN_IMPORT_IGES" -msgstr "IGES Files ( *.iges *.igs )" - -#: GeometryGUI.cxx:3763 -msgid "GEOM_MEN_IMPORT_STEP" -msgstr "STEP Files ( *.step *.stp )" - -#: GeometryGUI.cxx:2931 -msgid "GEOM_MEN_ISOS" -msgstr "Select Number Of Isos" - -#: GeometryGUI.cxx:4278 -msgid "GEOM_MEN_POPUP_NAME" -msgstr "%1 Objects" - -#: GeometryGUI.cxx:4414 -msgid "GEOM_MEN_SKETCHER_X" -msgstr "Enter a length to set X" - -#: GeometryGUI.cxx:4438 -msgid "GEOM_MEN_SKETCHER_Y" -msgstr "Enter a length to set Y" - -#: GeometryGUI.cxx:2898 -msgid "GEOM_MEN_TRANSPARENCY" -msgstr "Transparency" - -#: GeometryGUI.cxx:4413 -msgid "GEOM_MEN_X" -msgstr "X :" - -#: GeometryGUI.cxx:4437 -msgid "GEOM_MEN_Y" -msgstr "Y :" - -#: GeometryGUI_NbIsosDlg.cxx:36 -msgid "GEOM_MEN_ISOU" -msgstr "Isos u :" - -#: GeometryGUI_NbIsosDlg.cxx:53 -msgid "GEOM_MEN_ISOV" -msgstr "Isos v :" - -#: GeometryGUI_TransparencyDlg.cxx:31 -msgid "GEOM_MEN_TRANSPARENCY_LABEL" -msgstr "Transparency :" - -msgid "GEOM_MEN_STEP_LABEL" -msgstr "Step :" - - -msgid "GEOM_IDENTICAL_NAMES_SELECT_BY_MOUSE" -msgstr "Identical names : select by mouse !" - -msgid "GEOM_NAME_INCORRECT" -msgstr "Object name not found" - -# -#============================================================================== -# - -#: GeometryGUI.cxx:892 -msgid "GEOM_WRN_RADIUS_NULL" -msgstr "Radius is null" - -#: GeometryGUI.cxx:3854 -msgid "GEOM_WRN_WARNING" -msgstr "Warning" - -#: GeometryGUI.cxx:3854 -msgid "GEOM_REALLY_DELETE" -msgstr "Do you really want to delete object(s) ?" - -# -#============================================================================== -# - -#Object -msgid "GEOM_OBJECT" -msgstr "Object" - -#Main object -msgid "GEOM_MAIN_OBJECT" -msgstr "Main Object" - -#Tool object -msgid "GEOM_TOOL_OBJECT" -msgstr "Tool Object" - -#Base Object -msgid "GEOM_BASE_OBJECT" -msgstr "Base Object" - -#Path Object -msgid "GEOM_PATH_OBJECT" -msgstr "Path Object" - -#Objects -msgid "GEOM_OBJECTS" -msgstr "Objects" - -#Object i -msgid "GEOM_OBJECT_I" -msgstr "Object %1" - -#Object and result -msgid "GEOM_OBJECT_RESULT" -msgstr "Object And Result" - -#Point -msgid "GEOM_POINT" -msgstr "Point" - -#Base point -msgid "GEOM_BASE_POINT" -msgstr "Base Point" - -#Center Point -msgid "GEOM_CENTER_POINT" -msgstr "Center Point" - -#Diagonal Points -msgid "GEOM_DIAGONAL_POINTS" -msgstr "Diagonal Points" - -#Central Point -msgid "GEOM_CENTRAL_POINT" -msgstr "Central Point" - -#Points -msgid "GEOM_POINTS" -msgstr "Points" - -#Point i -msgid "GEOM_POINT_I" -msgstr "Point %1" - -#Arguments -msgid "GEOM_ARGUMENTS" -msgstr "Arguments" - -#Center -msgid "GEOM_CENTER" -msgstr "Center" - -#Radius -msgid "GEOM_RADIUS" -msgstr "Radius :" - -#Radius i -msgid "GEOM_RADIUS_I" -msgstr "Radius %1 :" - -#Height -msgid "GEOM_HEIGHT" -msgstr "Height :" - -#Length -msgid "GEOM_LENGTH" -msgstr "Length is :" - -#Weight -msgid "GEOM_WEIGHT" -msgstr "Weight :" - -#Coordinates -msgid "GEOM_COORDINATES" -msgstr "Coordinates" - -#Coor. -msgid "GEOM_COOR" -msgstr "Coord. :" - -#Reverse -msgid "GEOM_REVERSE" -msgstr "Reverse" - -#Reverse U -msgid "GEOM_REVERSE_U" -msgstr "Reverse U" - -#Reverse V -msgid "GEOM_REVERSE_V" -msgstr "Reverse V" - -#Angle -msgid "GEOM_ANGLE" -msgstr "Angle :" - -#Axis -msgid "GEOM_AXIS" -msgstr "Axis" - -#Matrix -msgid "GEOM_MATRIX" -msgstr "Matrix :" - -#Vector Length -msgid "GEOM_VECTOR_LENGTH" -msgstr "Vector Length :" - -#Reverse Vector -msgid "GEOM_REVERSE_VECTOR" -msgstr "Reverse Vector" - -#Plane Mirror -msgid "GEOM_PLANE_MIRROR" -msgstr "Plane Mirror" - -#Face Selection -msgid "GEOM_FACE_SELECTION" -msgstr "Face Selection" - -#Base -msgid "GEOM_BASE" -msgstr "Base" - -#Water Density -msgid "GEOM_WATER_DENSITY" -msgstr "Water Density :" - -#Meshing Deflection -msgid "GEOM_MESHING_DEFLECTION" -msgstr "Meshing Deflect. :" - -#Dimensions -msgid "GEOM_DIMENSIONS" -msgstr "Dimensions" - -#Precision -msgid "GEOM_PRECISION" -msgstr "Precision :" - -#Selection -msgid "GEOM_SELECTION" -msgstr "Selection" - -#Nb. Times -msgid "GEOM_NB_TIMES" -msgstr "Nb. Times :" - -#Nb. Times U -msgid "GEOM_NB_TIMES_U" -msgstr "Nb. Times U :" - -#Nb. Times V -msgid "GEOM_NB_TIMES_V" -msgstr "Nb. Times V :" - -#Step -msgid "GEOM_STEP" -msgstr "Step :" - -#Step V -msgid "GEOM_STEP_V" -msgstr "Step V :" - -#Step U -msgid "GEOM_STEP_U" -msgstr "Step U :" - -# -#============================================================================== -# - -#Partition -msgid "GEOM_PARTITION" -msgstr "Partition" - -#Tolerance -msgid "GEOM_TOLERANCE" -msgstr "Tolerance" - -#Orientation -msgid "GEOM_ORIENTATION" -msgstr "Orientation" - -#Pipe -msgid "GEOM_PIPE" -msgstr "Pipe" - -#Revolution -msgid "GEOM_REVOLUTION" -msgstr "Revolution" - -#Rotation -msgid "GEOM_ROTATION" -msgstr "Rotation" - -#Archimede -msgid "GEOM_ARCHIMEDE" -msgstr "Archimede" - -#Common -msgid "GEOM_COMMON" -msgstr "Common" - -#Cut -msgid "GEOM_CUT" -msgstr "Cut" - -#Distance -msgid "GEOM_DISTANCE" -msgstr "Distance" - -#Filling -msgid "GEOM_FILLING" -msgstr "Filling" - -#Fuse -msgid "GEOM_FUSE" -msgstr "Fuse" - -#Scale -msgid "GEOM_SCALE" -msgstr "Scale" - -#Section -msgid "GEOM_SECTION" -msgstr "Section" - -#Sewing -msgid "GEOM_SEWING" -msgstr "Sewing" - -#Translation -msgid "GEOM_TRANSLATION" -msgstr "Translation" - -#Working Plane -msgid "GEOM_WPLANE" -msgstr "Working Plane" - -#Mirror -msgid "GEOM_MIRROR" -msgstr "Mirror" - -#Prism -msgid "GEOM_PRISM" -msgstr "Prism" - -#Sub Shapes -msgid "GEOM_SUB_SHAPE" -msgstr "Sub Shapes" - -#Supress Face -msgid "GEOM_SUPRESSFACE" -msgstr "Supress Face" - -#Fillet -msgid "GEOM_FILLET" -msgstr "Fillet" - -#Chamfer -msgid "GEOM_CHAMFER" -msgstr "Chamfer" - -#Check Shape -msgid "GEOM_CHECK_SHAPE" -msgstr "Check Shape" - -#Whatis -msgid "GEOM_WHATIS" -msgstr "Whatis" - -#Bounding Box -msgid "GEOM_BNDBOX" -msgstr "Bounding Box" - -#Center Of Mass -msgid "GEOM_CMASS" -msgstr "Center Of Mass" - -#Basic Properties -msgid "GEOM_PROPERTIES" -msgstr "Basic Properties" - -#Multi-Translation -msgid "GEOM_MULTITRANSLATION" -msgstr "Multi-Translation" - -#Multi-Rotation -msgid "GEOM_MULTIROTATION" -msgstr "Multi-Rotation" - -# -#============================================================================== -# - -#Arc -msgid "GEOM_ARC" -msgstr "Arc" - -#Box -msgid "GEOM_BOX" -msgstr "Box" - -#Circle -msgid "GEOM_CIRCLE" -msgstr "Circle" - -#Ellipse -msgid "GEOM_ELLIPSE" -msgstr "Ellipse" - -msgid "GEOM_ELLIPSE_TITLE" -msgstr "Ellipse Construction" - -#Radius major -msgid "GEOM_RADIUS_MAJOR" -msgstr "Major radius :" - -#Radius minor -msgid "GEOM_RADIUS_MINOR" -msgstr "Minor radius :" - -#Compound -msgid "GEOM_COMPOUND" -msgstr "Compound" - -#CompSolid -msgid "GEOM_COMPOUNDSOLID" -msgstr "CompSolid" - -#Cone -msgid "GEOM_CONE" -msgstr "Cone" - -#Cylinder -msgid "GEOM_CYLINDER" -msgstr "Cylinder" - -#Edge -msgid "GEOM_EDGE" -msgstr "Edge" - -#Face -msgid "GEOM_FACE" -msgstr "Face" - -#Faces -msgid "GEOM_FACES" -msgstr "Faces" - -#Line -msgid "GEOM_LINE" -msgstr "Line" - -#Plane -msgid "GEOM_PLANE" -msgstr "Plane" - -#Shape -msgid "GEOM_SHAPE" -msgstr "Shape" - -#Shell -msgid "GEOM_SHELL" -msgstr "Shell" - -#Solid -msgid "GEOM_SOLID" -msgstr "Solid" - -#Sphere -msgid "GEOM_SPHERE" -msgstr "Sphere" - -#Conical Face -msgid "GEOM_SURFCONE" -msgstr "Conical Face" - -#Cylindrical Face -msgid "GEOM_SURFCYLINDER" -msgstr "Cylindrical Face" - -#Spherical Face -msgid "GEOM_SURFSPHERE" -msgstr "Spherical Face" - -#Toroidal Face -msgid "GEOM_SURFTORUS" -msgstr "Toroidal Face" - -#Torus -msgid "GEOM_TORUS" -msgstr "Torus" - -#Vector -msgid "GEOM_VECTOR" -msgstr "Vector" - -#Vector U -msgid "GEOM_VECTOR_U" -msgstr "Vector U" - -#Vector V -msgid "GEOM_VECTOR_V" -msgstr "Vector V" - -#Vertex -msgid "GEOM_VERTEX" -msgstr "Vertex" - -#Wire -msgid "GEOM_WIRE" -msgstr "Wire" - -#Parameter -msgid "GEOM_PARAMETER" -msgstr "Parameter :" - -# -#============================================================================== -# - -#Min -msgid "GEOM_MIN" -msgstr "Min :" - -#Max -msgid "GEOM_MAX" -msgstr "Max :" - -#X -msgid "GEOM_X" -msgstr "X :" - -#Y -msgid "GEOM_Y" -msgstr "Y :" - -#Z -msgid "GEOM_Z" -msgstr "Z :" - -#DX -msgid "GEOM_DX" -msgstr "Dx :" - -#DY -msgid "GEOM_DY" -msgstr "Dy :" - -#DZ -msgid "GEOM_DZ" -msgstr "Dz :" - -#D1 -msgid "GEOM_D1" -msgstr "D1 :" - -#D2 -msgid "GEOM_D2" -msgstr "D2 :" - -# -#============================================================================== -# - -#: GeometryGUI.cxx -msgid "GEOM_STEP_TITLE" -msgstr "Step value for GUI constructions" - -#: GeometryGUI_ArcDlg.cxx:45 -msgid "GEOM_ARC_TITLE" -msgstr "Arc Construction" - -#: GeometryGUI_ArchimedeDlg.cxx:55 -msgid "GEOM_ARCHIMEDE_TITLE" -msgstr "Archimede Construction" - -#: GeometryGUI_BndBoxDlg.cxx:59 -msgid "GEOM_BNDBOX_TITLE" -msgstr "Bounding Box Informations" - -#: GeometryGUI_BndBoxDlg.cxx:82 -msgid "GEOM_BNDBOX_OBJDIM" -msgstr "Object And Its Dimensions" - -#: GeometryGUI_BoxDlg.cxx:50 -msgid "GEOM_BOX_TITLE" -msgstr "Box Construction" - -#: GeometryGUI_BoxDlg.cxx:50 -msgid "GEOM_BOX_OBJ" -msgstr "Dimensions At Origin" - -#: GeometryGUI_ChamferDlg.cxx:58 -msgid "GEOM_CHAMFER_TITLE" -msgstr "Chamfer Construction" - -#: GeometryGUI_ChamferDlg.cxx:58 -msgid "GEOM_CHAMFER_ALL" -msgstr "Chamfer On Whole Shape" - -#: GeometryGUI_ChamferDlg.cxx:58 -msgid "GEOM_CHAMFER_EDGES" -msgstr "Chamfer On Edges From Shape" - -#: GeometryGUI_ChamferDlg.cxx:58 -msgid "GEOM_CHAMFER_FACES" -msgstr "Chamfer On Faces From Shape" - -#: GeometryGUI_CircleDlg.cxx:48 -msgid "GEOM_CIRCLE_TITLE" -msgstr "Circle Construction" - -#: GeometryGUI_CenterMassDlg.cxx:77 -msgid "GEOM_CMASS_TITLE" -msgstr "Center Of Mass Construction" - -msgid "GEOM_PLANE_SIZE" -msgstr "Size of plane :" - -#: GeometryGUI_CommonDlg.cxx:47 -msgid "GEOM_COMMON_TITLE" -msgstr "BOOLEAN : Common Of Two Objects" - -#: GeometryGUI_CompoundDlg.cxx:44 -msgid "GEOM_COMPOUND_TITLE" -msgstr "Create A Compound" - -#: GeometryGUI_ConeDlg.cxx:49 -msgid "GEOM_CONE_TITLE" -msgstr "Cone Construction" - -#: GeometryGUI_CutDlg.cxx:48 -msgid "GEOM_CUT_TITLE" -msgstr "BOOLEAN : Cut Of Two Objects" -# -#: GeometryGUI_CylinderDlg.cxx:47 -msgid "GEOM_CYLINDER_TITLE" -msgstr "Cylinder Construction" - -#: GeometryGUI_CheckShape.cxx:60 -msgid "GEOM_CHECK_TITLE" -msgstr "Check Shape Informations" - -#: GeometryGUI_CheckShape.cxx:83 -msgid "GEOM_CHECK_INFOS" -msgstr "Object And Its Topological Informations" - -#: GeometryGUI_DistanceDlg.cxx:57 -msgid "GEOM_MINDIST_TITLE" -msgstr "Minimun Distance Between Two Objects" - -#: GeometryGUI_DistanceDlg.cxx:57 -msgid "GEOM_MINDIST_OBJ" -msgstr "Objects And Results" - -#: GeometryGUI_EdgeDlg.cxx:47 -msgid "GEOM_EDGE_TITLE" -msgstr "Create An Edge" - -#: GeometryGUI_FilletDlg.cxx:58 -msgid "GEOM_FILLET_TITLE" -msgstr "Fillet Construction" - -#: GeometryGUI_FilletDlg.cxx:58 -msgid "GEOM_FILLET_ALL" -msgstr "Fillet On Whole Shape" - -#: GeometryGUI_FilletDlg.cxx:58 -msgid "GEOM_FILLET_EDGES" -msgstr "Fillet On Edges From Shape" - -#: GeometryGUI_FilletDlg.cxx:58 -msgid "GEOM_FILLET_FACES" -msgstr "Fillet On Faces From Shape" - -#: GeometryGUI_FaceDlg.cxx:49 -msgid "GEOM_FACE_TITLE" -msgstr "Create A Face" - -#: GeometryGUI_FaceDlg.cxx:78 -msgid "GEOM_FACE_FFW" -msgstr "Face from a wire" - -#: GeometryGUI_FaceDlg.cxx:103 -msgid "GEOM_FACE_OPT" -msgstr "Try to create a planar face" - -#: GeometryGUI_FillingDlg.cxx:53 -msgid "GEOM_FILLING_TITLE" -msgstr "Filling Surface With Curves" - -#: GeometryGUI_FillingDlg.cxx:112 -msgid "GEOM_FILLING_ARG" -msgstr "Arguments And Parameters" - -#: GeometryGUI_FillingDlg.cxx:128 -msgid "GEOM_FILLING_MIN_DEG" -msgstr "Min deg" - -#: GeometryGUI_FillingDlg.cxx:142 -msgid "GEOM_FILLING_MAX_DEG" -msgstr "Max deg" - -#: GeometryGUI_FillingDlg.cxx:150 -msgid "GEOM_FILLING_TOL_2D" -msgstr "Tol. 2D :" - -#: GeometryGUI_FillingDlg.cxx:170 -msgid "GEOM_FILLING_COMPOUND" -msgstr "Curves Comp." - -#: GeometryGUI_FillingDlg.cxx:184 -msgid "GEOM_FILLING_TOL_3D" -msgstr "Tol. 3D :" - -#: GeometryGUI_FillingDlg.cxx:192 -msgid "GEOM_FILLING_NB_ITER" -msgstr "Nb. Iter :" - -#: GeometryGUI_FuseDlg.cxx:48 -msgid "GEOM_FUSE_TITLE" -msgstr "BOOLEAN : Fuse Two Objects" - -#: GeometryGUI_InertiaDlg.cxx:42 -msgid "GEOM_INERTIA_TITLE" -msgstr "Calculs Of Inertia" - -#: GeometryGUI_InertiaDlg.cxx:50 -msgid "GEOM_INERTIA_CONSTR" -msgstr "Matrix And Moments Of Inertia" - -#: GeometryGUI_InertiaDlg.cxx:100 -msgid "GEOM_INERTIA_I" -msgstr "%1:1 :" - -#: GeometryGUI_InertiaDlg.cxx:182 -msgid "GEOM_INERTIA_IXYZ" -msgstr "IX & IY & IZ :" - -#: GeometryGUI_LineDlg.cxx:50 -msgid "GEOM_LINE_TITLE" -msgstr "Line Construction" - -#: GeometryGUI_MaxToleranceDlg.cxx:53 -msgid "GEOM_TOLERANCE_TITLE" -msgstr "Maximum Tolerance" - -#: GeometryGUI_MaxToleranceDlg.cxx:84 -msgid "GEOM_TOLERANCE_CONSTR" -msgstr "Object And Its Tolerances" - -#: GeometryGUI_MaxToleranceDlg.cxx:121 -msgid "GEOM_TOLERANCE_FACE" -msgstr "Face :" - -#: GeometryGUI_MaxToleranceDlg.cxx:138 -msgid "GEOM_TOLERANCE_EDGE" -msgstr "Edge :" - -#: GeometryGUI_MaxToleranceDlg.cxx:155 -msgid "GEOM_TOLERANCE_VERTEX" -msgstr "Vertex :" - -#: GeometryGUI_MirrorDlg.cxx:52 -msgid "GEOM_MIRROR_TITLE" -msgstr "Mirror An Object" - -#: GeometryGUI_OrientationDlg.cxx:46 -msgid "GEOM_ORIENTATION_TITLE" -msgstr "Change Orientation" - -#: GeometryGUI_OrientationDlg.cxx:134 -msgid "GEOM_ORIENTATION_OPT" -msgstr "Reverse orientation with normal vectors simulation" - -#: GeometryGUI_PartitionDlg.cxx:45 -msgid "GEOM_PARTITION_TITLE" -msgstr "Partition Of Object With Tool" - -#: GeometryGUI_PartitionDlg.cxx:45 -msgid "GEOM_KEEP_OBJECT" -msgstr "Keep Object" - -#: GeometryGUI_PartitionDlg.cxx:45 -msgid "GEOM_PARTITION_ORIENTATION" -msgstr "Change Orientation" - -#: GeometryGUI_PipeDlg.cxx:47 -msgid "GEOM_PIPE_TITLE" -msgstr "Pipe Construction" - -#: GeometryGUI_PointDlg.cxx:52 -msgid "GEOM_POINT_TITLE" -msgstr "Point Construction" - -#: GeometryGUI_PlaneDlg.cxx:60 -msgid "GEOM_PLANE_TITLE" -msgstr "Plane Construction" - -#: GeometryGUI_PlaneDlg.cxx:172 -msgid "GEOM_PLANE_PVC" -msgstr "Point + Coordinate Vector" - -#: GeometryGUI_PlaneDlg.cxx:133 -msgid "GEOM_PLANE_PV" -msgstr "Point + Vector" - -#: GeometryGUI_PrismDlg.cxx:54 -msgid "GEOM_PRISM_TITLE" -msgstr "Prism Construction" - -#: GeometryGUI_PrismDlg.cxx:83 -msgid "GEOM_PRISM_BSV" -msgstr "Base Shape + Vector" - -#: GeometryGUI_PropertiesDlg.cxx:56 -msgid "GEOM_PROPERTIES_TITLE" -msgstr "Basic Properties Informations" - -#: GeometryGUI_PropertiesDlg.cxx:78 -msgid "GEOM_PROPERTIES_CONSTR" -msgstr "Object And Its Properties" - -#: GeometryGUI_PropertiesDlg.cxx:114 -msgid "GEOM_PROPERTIES_SURFACE" -msgstr "Surface is :" - -#: GeometryGUI_PropertiesDlg.cxx:120 -msgid "GEOM_PROPERTIES_VOLUME" -msgstr "Volume is :" - -#: GeometryGUI_RevolDlg.cxx:49 -msgid "GEOM_REVOLUTION_TITLE" -msgstr "Construction By Revolution" - -#: GeometryGUI_RotationDlg.cxx:51 -msgid "GEOM_ROTATION_TITLE" -msgstr "Rotation Of An Object" - -#: GeometryGUI_ScaleDlg.cxx:52 -msgid "GEOM_SCALE_TITLE" -msgstr "Scale An Object" - -#: GeometryGUI_ScaleDlg.cxx:117 -msgid "GEOM_SCALE_FACTOR" -msgstr "Scale Factor :" - -#: GeometryGUI_SectionDlg.cxx:50 -msgid "GEOM_SECTION_TITLE" -msgstr "BOOLEAN : Section Of Two Objects" - -#: GeometryGUI_SewingDlg.cxx:48 -msgid "GEOM_SEWING_TITLE" -msgstr "Sewing Topologies" - -#: GeometryGUI_ShellDlg.cxx:53 -msgid "GEOM_SHELL_TITLE" -msgstr "Shell Construction" - -#: GeometryGUI_SolidDlg.cxx:74 -msgid "GEOM_SOLID_TITLE" -msgstr "Solid Construction" - -#: GeometryGUI_SphereDlg.cxx:50 -msgid "GEOM_SPHERE_TITLE" -msgstr "Sphere Construction" - -#: GeometryGUI_SphereDlg.cxx:113 -msgid "GEOM_SPHERE_CR" -msgstr "Center + Radius" - -#: GeometryGUI_SphereDlg.cxx:146 -msgid "GEOM_SPHERE_RO" -msgstr "Radius At Origin" - -#: GeometryGUI_SubShapeDlg.cxx:55 -msgid "GEOM_SUBSHAPE_TITLE" -msgstr "Sub Shapes Selection" - -#: GeometryGUI_SubShapeDlg.cxx:131 -msgid "GEOM_SUBSHAPE_TYPE" -msgstr "Sub Shapes Type :" - -#: GeometryGUI_SubShapeDlg.cxx:137 -msgid "GEOM_SUBSHAPE_SELECT" -msgstr "Select Sub Shapes" - -#: GeometryGUI_TorusDlg.cxx:51 -msgid "GEOM_TORUS_TITLE" -msgstr "Torus Construction" - -#: GeometryGUI_SuppressFacesDlg.cxx:103 -msgid "GEOM_SUPRESSFACE_TITLE" -msgstr "Suppress Faces In An Object" - -#: GeometryGUI_SuppressFacesDlg.cxx:164 -msgid "GEOM_SUPRESSFACE_SELECT" -msgstr "Select Faces To Suppress" - -#: GeometryGUI_TranslationDlg.cxx:78 -msgid "GEOM_TRANSLATION_COOR" -msgstr "Translation With Coordinates" - -msgid "GEOM_TRANSPARENCY_TITLE" -msgstr "Transparency" - -msgid "GEOM_TRANSPARENCY_OPAQUE" -msgstr "Opaque" - -msgid "GEOM_TRANSPARENCY_TRANSPARENT" -msgstr "Transparent" - -msgid "GEOM_SUPPRESSHOLE_TITLE" -msgstr "Suppress holes" - -msgid "GEOM_SUPPRESSHOLE_SELECTFACE" -msgstr "Select the face with hole" - -msgid "GEOM_SUPPRESSHOLE_SELECTWIRE" -msgstr "Select wire on face" - -msgid "GEOM_SUPPRESSHOLE_SELECTFACE_END" -msgstr "Select end face (if hole traversing)" - -msgid "GEOM_SUPPRESSHOLE_SELECTWIRE_END" -msgstr "Select end wire (if hole traversing)" - -msgid "GEOM_SUPPRESSHOLE_FACE_SHELL" -msgstr "Face or shell" - -msgid "GEOM_SUPPRESSHOLE_SELECT_HOLES_ON_FACE" -msgstr "Select hole(s) on the face" - -#: GeometryGUI_TranslationDlg.cxx:56 -msgid "GEOM_TRANSLATION_TITLE" -msgstr "Translation Of An Object" - -#: GeometryGUI_VectorDlg.cxx:54 -msgid "GEOM_VECTOR_TITLE" -msgstr "Vector Construction" - -#: GeometryGUI_WhatisDlg.cxx:63 -msgid "GEOM_WHATIS_TITLE" -msgstr "Whatis Informations" - -#: GeometryGUI_WhatisDlg.cxx:86 -msgid "GEOM_WHATIS_OBJECT" -msgstr "Object And Its Topological Informations" - -#: GeometryGUI_WireDlg.cxx:46 -msgid "GEOM_WIRE_TITLE" -msgstr "Create A Wire" - -#: GeometryGUI_WireDlg.cxx:103 -msgid "GEOM_WIRE_CONNECT" -msgstr "Wire creation from wires/edges connected" - -#: GeometryGUI_WorkingPlaneDlg.cxx:50 -msgid "GEOM_WPLANE_TITLE" -msgstr "Working Plane Selection" - -#: GeometryGUI_WorkingPlaneDlg.cxx:107 -msgid "GEOM_WPLANE_FACE" -msgstr "Plane Or Planar Face" - -#: GeometryGUI_multiTranslationDlg.cxx:107 -msgid "GEOM_MULTITRANSLATION_TITLE" -msgstr "Multi-Translation" - -#: GeometryGUI_multiTranslationDlg.cxx:107 -msgid "GEOM_MULTITRANSLATION_SIMPLE" -msgstr "Multi Translation Simple" - -#: GeometryGUI_multiTranslationDlg.cxx:107 -msgid "GEOM_MULTITRANSLATION_DOUBLE" -msgstr "Multi Translation Double" - -#: GeometryGUI_multiRotationDlg.cxx:107 -msgid "GEOM_MULTIROTATION_TITLE" -msgstr "Multi-Rotation" - -#: GeometryGUI_multiRotationDlg.cxx:107 -msgid "GEOM_MULTIROTATION_SIMPLE" -msgstr "Multi Rotation Simple" - -#: GeometryGUI_multiRotationDlg.cxx:107 -msgid "GEOM_MULTIROTATION_DOUBLE" -msgstr "Multi Rotation Double" - -msgid "GEOM_PARAM_POINT" -msgstr "Parametric point" - - -# -#============================================================================== -# - -#: GeometryGUI.cxx:4613 -msgid "GEOM_MEN_WIREFRAME" -msgstr "Wireframe" - -#: GeometryGUI.cxx:4613 -msgid "GEOM_MEN_SHADING" -msgstr "\nShading" - -msgid "GeometryGUI_PartitionDlg::RECONSTRUCTION_LIMIT" -msgstr "Reconstruction Limit" - -msgid "GeometryGUI_PartitionDlg::SUPPRESS_RESULT" -msgstr "Suppress Result" - -msgid "GeometryGUI_PartitionDlg::SUPPRESS_RESULT_INSIDE" -msgstr "Inside" - -msgid "GeometryGUI_PartitionDlg::SUPPRESS_RESULT_OUTSIDE" -msgstr "Outside" - -msgid "GeometryGUI_PartitionDlg::RECONSTRUCTION_LIMIT_SHAPE" -msgstr "Shape" -msgid "GeometryGUI_PartitionDlg::RECONSTRUCTION_LIMIT_SOLID" -msgstr "Solid" -msgid "GeometryGUI_PartitionDlg::RECONSTRUCTION_LIMIT_SHELL" -msgstr "Shell" -msgid "GeometryGUI_PartitionDlg::RECONSTRUCTION_LIMIT_FACE" -msgstr "Face" -msgid "GeometryGUI_PartitionDlg::RECONSTRUCTION_LIMIT_WIRE" -msgstr "Wire" -msgid "GeometryGUI_PartitionDlg::RECONSTRUCTION_LIMIT_EDGE" -msgstr "Edge" -msgid "GeometryGUI_PartitionDlg::RECONSTRUCTION_LIMIT_VERTEX" -msgstr "Vertex" diff --git a/src/GEOMGUI/GEOM_msg_fr.po b/src/GEOMGUI/GEOM_msg_fr.po deleted file mode 100644 index fdeb94661..000000000 --- a/src/GEOMGUI/GEOM_msg_fr.po +++ /dev/null @@ -1,1130 +0,0 @@ -# This is a Qt message file in .po format. Each msgid starts with -# a scope. This scope should *NOT* be translated - eg. translating -# from French to English, "Foo::Bar" would be translated to "Pub", -# not "Foo::Pub". -msgid "" -msgstr "" -"Project-Id-Version: PROJECT VERSION\n" -"POT-Creation-Date: 2002-03-19 09:35:48 AM CET\n" -"PO-Revision-Date: YYYY-MM-DD\n" -"Last-Translator: FULLNAME \n" -"Content-Type: text/plain; charset=iso-8859-1\n" - -# -#============================================================================== -# - -#Button Apply -msgid "GEOM_BUT_APPLY" -msgstr "&Appliquer" - -#Button Close -msgid "GEOM_BUT_CLOSE" -msgstr "&Fermer" - -#Button Cancel -msgid "GEOM_BUT_CANCEL" -msgstr "&Annuler" - -#Button Ok -msgid "GEOM_BUT_OK" -msgstr "&Ok" - -#Button Yes -msgid "GEOM_BUT_YES" -msgstr "&Oui" - -#Button Help -msgid "GEOM_BUT_HELP" -msgstr "&Aide" - - -#Button Explode -msgid "GEOM_BUT_EXPLODE" -msgstr "&Exploser" - -# -#============================================================================== -# - -#: GeometryGUI.cxx:563 -msgid "GEOM_INF_LOADED" -msgstr "Le fichier %1 est chargé." - -# -#============================================================================== -# - -#: GeometryGUI.cxx:3069 -msgid "GEOM_PRP_COMMAND" -msgstr "Pas de commande associée à l'id = %1." - -#: GeometryGUI.cxx:4977 -msgid "GEOM_PRP_ABORT" -msgstr "L'opération a echoué" - -#: GeometryGUI.cxx:5058 -msgid "GEOM_PRP_DONE" -msgstr "Opération effectuée" - -#: GeometryGUI.cxx:3717 -msgid "GEOM_PRP_LOADING" -msgstr "Chargement de %1 ..." - -#: GeometryGUI.cxx:1412 -msgid "GEOM_PRP_NULLSHAPE" -msgstr "Erreur, objet inconsistant ou inapproprié !" - -#: GeometryGUI.cxx:5072 -msgid "GEOM_PRP_READY" -msgstr "Prêt..." - -#: GeometryGUI.cxx:1690 -msgid "GEOM_PRP_SELECT_SUBSHAPES" -msgstr "Selection de sous objets" - -msgid "GEOM_CONFIRM" -msgstr "Confirmer cette operation" - -msgid "GEOM_CONFIRM_INFO" -msgstr "L'objet contient %1 sous objets" - - -msgid "GEOM_PRP_NOT_FOR_VTK_VIEWER" -msgstr "Non permis dans viewer VTK" - -#: GeometryGUI.cxx:1690 -msgid "GEOM_PRP_SHAPE_IN_STUDY" -msgstr "La shape principale doit etre avant dans l'etude" - -#: GeometryGUI.cxx:1690 -msgid "GEOM_PRP_SELECT_EDGE" -msgstr "Selectionner les edges et clicker sur Apply" - -#: GeometryGUI.cxx:1690 -msgid "GEOM_PRP_SELECT_FACE" -msgstr "Select les faces a supprimer et clicker sur Ok/Apply" - -#: GeometryGUI.cxx:1690 -msgid "GEOM_PRP_SELECT_FIRST" -msgstr "Selectionner la shape principale en premier" - -#: GeometryGUI.cxx:1690 -msgid "GEOM_PRP_MIN_DIST" -msgstr "Min Distance non calculer" - -# -#============================================================================== -# - -#: GeometryGUI.cxx:3698 -msgid "GEOM_MEN_ALL_FILES" -msgstr "Tous fichiers ( * )" - -#: GeometryGUI.cxx:4389 -msgid "GEOM_MEN_ANGLE" -msgstr "Angle :" - -#: GeometryGUI.cxx:3941 -msgid "GEOM_MEN_COMPONENT" -msgstr "Géometrie" - -#: GeometryGUI.cxx:4389 -msgid "GEOM_MEN_ENTER_ANGLE" -msgstr "Saisir un angle en degrés" - -#: GeometryGUI.cxx:3758 -msgid "GEOM_MEN_EXPORT" -msgstr "Exporter" - -#: GeometryGUI.cxx:3648 -msgid "GEOM_MEN_IMPORT" -msgstr "Importer" - -#: GeometryGUI.cxx:3761 -msgid "GEOM_MEN_IMPORT_BREP" -msgstr "Fichiers BREP ( *.brep )" - -#: GeometryGUI.cxx:3762 -msgid "GEOM_MEN_IMPORT_IGES" -msgstr "Fichiers IGES ( *.iges *.igs )" - -#: GeometryGUI.cxx:3763 -msgid "GEOM_MEN_IMPORT_STEP" -msgstr "Fichiers STEP ( *.step *.stp )" - -#: GeometryGUI.cxx:2931 -msgid "GEOM_MEN_ISOS" -msgstr "Choisir un nombre d'isos" - -#: GeometryGUI.cxx:4278 -msgid "GEOM_MEN_POPUP_NAME" -msgstr "%1 Objets" - -#: GeometryGUI.cxx:4414 -msgid "GEOM_MEN_SKETCHER_X" -msgstr "Saisir une longueur pour fixer X" - -#: GeometryGUI.cxx:4438 -msgid "GEOM_MEN_SKETCHER_Y" -msgstr "Saisir une longueur pour fixer Y" - -#: GeometryGUI.cxx:2898 -msgid "GEOM_MEN_TRANSPARENCY" -msgstr "Transparence" - -#: GeometryGUI.cxx:4413 -msgid "GEOM_MEN_X" -msgstr "X :" - -#: GeometryGUI.cxx:4437 -msgid "GEOM_MEN_Y" -msgstr "Y :" - -#: GeometryGUI_NbIsosDlg.cxx:36 -msgid "GEOM_MEN_ISOU" -msgstr "Isos u :" - -#: GeometryGUI_NbIsosDlg.cxx:53 -msgid "GEOM_MEN_ISOV" -msgstr "Isos v :" - -#: GeometryGUI_TransparencyDlg.cxx:31 -msgid "GEOM_MEN_TRANSPARENCY_LABEL" -msgstr "Transparence :" - -msgid "GEOM_MEN_STEP_LABEL" -msgstr "Increment" - -msgid "GEOM_IDENTICAL_NAMES_SELECT_BY_MOUSE" -msgstr "Noms identiques : selectionner avec la souris !" - -msgid "GEOM_NAME_INCORRECT" -msgstr "Le nom saisi n'existe pas" - - - -# -#============================================================================== -# - -#: GeometryGUI.cxx:892 -msgid "GEOM_WRN_RADIUS_NULL" -msgstr "Le rayon est nul" - -#: GeometryGUI.cxx:3854 -msgid "GEOM_WRN_WARNING" -msgstr "Avertissement" - -# -#============================================================================== -# - -#Object -msgid "GEOM_OBJECT" -msgstr "Objet" - -#Main object -msgid "GEOM_MAIN_OBJECT" -msgstr "Objet Principal" - -#Tool object -msgid "GEOM_TOOL_OBJECT" -msgstr "Objet Outil" - -#Base Object -msgid "GEOM_BASE_OBJECT" -msgstr "Objet De Base" - -#Path Object -msgid "GEOM_PATH_OBJECT" -msgstr "Objet Chemin" - -#Objects -msgid "GEOM_OBJECTS" -msgstr "Objets" - -#Object i -msgid "GEOM_OBJECT_I" -msgstr "Objet %1" - -#Object and result -msgid "GEOM_OBJECT_RESULT" -msgstr "Objet Et Résultat" - -#Point -msgid "GEOM_POINT" -msgstr "Point" - -#Base point -msgid "GEOM_BASE_POINT" -msgstr "Point De Base" - -#Center Point -msgid "GEOM_CENTER_POINT" -msgstr "Point Centre" - -#Diagonal Points -msgid "GEOM__DIAGONAL_POINTS" -msgstr "Points Diagonaux" - -#Central Point -msgid "GEOM_CENTRAL_POINT" -msgstr "Point Central" - -#Points -msgid "GEOM_POINTS" -msgstr "Points" - -#Point i -msgid "GEOM_POINT_I" -msgstr "Point %1" - -#Arguments -msgid "GEOM_ARGUMENTS" -msgstr "Arguments" - -#Center -msgid "GEOM_CENTER" -msgstr "Centre" - -#Radius -msgid "GEOM_RADIUS" -msgstr "Rayon" - -#Radius i -msgid "GEOM_RADIUS_I" -msgstr "Rayon %1" - -#Height -msgid "GEOM_HEIGHT" -msgstr "Hauteur" - -#Length -msgid "GEOM_LENGTH" -msgstr "Longueur :" - -#Weight -msgid "GEOM_WEIGHT" -msgstr "poids" - -#Coordinates -msgid "GEOM_COORDINATES" -msgstr "Coordonnées" - -#Coor. -msgid "GEOM_COOR" -msgstr "Coord. :" - -#Reverse -msgid "GEOM_REVERSE" -msgstr "Renverser" - -#Reverse U -msgid "GEOM_REVERSE_U" -msgstr "Renverser U" - -#Reverse V -msgid "GEOM_REVERSE_V" -msgstr "Reverser V" - -#Angle -msgid "GEOM_ANGLE" -msgstr "Angle :" - -#Axis -msgid "GEOM_AXIS" -msgstr "Axe" - -#Matrix -msgid "GEOM_MATRIX" -msgstr "Matrice :" - -#Vector Length -msgid "GEOM_VECTOR_LENGTH" -msgstr "Longueur Du Vecteur :" - -#Reverse Vector -msgid "GEOM_REVERSE_VECTOR" -msgstr "Renverser Le Vecteur" - -#Plane Mirror -msgid "GEOM_PLANE_MIRROR" -msgstr "Plan Miroir" - -#Face Selection -msgid "GEOM_FACE_SELECTION" -msgstr "Selection de Face" - -#Base -msgid "GEOM_BASE" -msgstr "Base" - -#Water Density -msgid "GEOM_WATER_DENSITY" -msgstr "Densité de l'eau :" - -#Meshing Deflection -msgid "GEOM_MESHING_DEFLECTION" -msgstr "Déflection Du Maillage :" - -#Dimensions -msgid "GEOM_DIMENSIONS" -msgstr "Dimensions" - -#Precision -msgid "GEOM_PRECISION" -msgstr "Précision :" - -#Selection -msgid "GEOM_SELECTION" -msgstr "Sélection" - -#Nb. Times -msgid "GEOM_NB_TIMES" -msgstr "Nb. Fois :" - -#Nb. Times U -msgid "GEOM_NB_TIMES_U" -msgstr "Nb. Fois U :" - -#Nb. Times V -msgid "GEOM_NB_TIMES_V" -msgstr "Nb. Fois V :" - -#Step -msgid "GEOM_STEP" -msgstr "Pas :" - -#Step V -msgid "GEOM_STEP_V" -msgstr "Pas V :" - -#Step U -msgid "GEOM_STEP_U" -msgstr "Pas U :" - -# -#============================================================================== -# - -#Partition -msgid "GEOM_PARTITION" -msgstr "Partition" - -#Tolerance -msgid "GEOM_TOLERANCE" -msgstr "Tolérance" - -#Orientation -msgid "GEOM_ORIENTATION" -msgstr "Orientation" - -#Pipe -msgid "GEOM_PIPE" -msgstr "Pipe" - -#Revolution -msgid "GEOM_REVOLUTION" -msgstr "Révolution" - -#Rotation -msgid "GEOM_ROTATION" -msgstr "Rotation" - -#Archimede -msgid "GEOM_ARCHIMEDE" -msgstr "Archimède" - -#Common -msgid "GEOM_COMMON" -msgstr "Joindre" - -#Cut -msgid "GEOM_CUT" -msgstr "Couper" - -#Distance -msgid "GEOM_DISTANCE" -msgstr "Distance" - -#Filling -msgid "GEOM_FILLING" -msgstr "Surface Par Courbes" - -#Fuse -msgid "GEOM_FUSE" -msgstr "Fusionner" - -#Scale -msgid "GEOM_SCALE" -msgstr "Echelle" - -#Section -msgid "GEOM_SECTION" -msgstr "Section" - -#Sewing -msgid "GEOM_SEWING" -msgstr "Coudre" - -#Translation -msgid "GEOM_TRANSLATION" -msgstr "Translation" - -#Working Plane -msgid "GEOM_WPLANE" -msgstr "Plan de Travail" - -#Mirror -msgid "GEOM_MIRROR" -msgstr "Miroir" - -#Prism -msgid "GEOM_PRISM" -msgstr "Extrusion" - -#Sub Shapes -msgid "GEOM_SUB_SHAPE" -msgstr "Sous Shapes" - -#Supress Face -msgid "GEOM_SUPRESSFACE" -msgstr "Supression de Face" - -#Fillet -msgid "GEOM_FILLET" -msgstr "Conge" - -#Chamfer -msgid "GEOM_CHAMFER" -msgstr "Chanfrein" - -#Check Shape -msgid "GEOM_CHECK_SHAPE" -msgstr "Check Shape" - -#Whatis -msgid "GEOM_WHATIS" -msgstr "Whatis" - -#Bounding Box -msgid "GEOM_BNDBOX" -msgstr "Boite Anglobante" - -#Center Of Mass -msgid "GEOM_CMASS" -msgstr "Centre de Masse" - -#Basic Properties -msgid "GEOM_PROPERTIES" -msgstr "Basiques Proprietes" - -#Multi-Translation -msgid "GEOM_MULTITRANSLATION" -msgstr "Multi-Translation" - -#Multi-Rotation -msgid "GEOM_MULTIROTATION" -msgstr "Multi-Rotation" - -# -#============================================================================== -# - -#Arc -msgid "GEOM_ARC" -msgstr "Arc" - -#Box -msgid "GEOM_BOX" -msgstr "Boite" - -#Circle -msgid "GEOM_CIRCLE" -msgstr "Cercle" - -#Compound -msgid "GEOM_COMPOUND" -msgstr "Compound" - -#CompSolid -msgid "GEOM_COMPOUNDSOLID" -msgstr "CompSolid" - -#Cone -msgid "GEOM_CONE" -msgstr "Cone" - -#Cylinder -msgid "GEOM_CYLINDER" -msgstr "Cylindre" - -#Edge -msgid "GEOM_EDGE" -msgstr "Edge" - -#Face -msgid "GEOM_FACE" -msgstr "Face" - -#Faces -msgid "GEOM_FACES" -msgstr "Faces" - -#Line -msgid "GEOM_LINE" -msgstr "Ligne" - -#Plane -msgid "GEOM_PLANE" -msgstr "Plan" - -#Shape -msgid "GEOM_SHAPE" -msgstr "Shape" - -#Shell -msgid "GEOM_SHELL" -msgstr "Shell" - -#Solid -msgid "GEOM_SOLID" -msgstr "Solide" - -#Sphere -msgid "GEOM_SPHERE" -msgstr "Sphère" - -#Conical Face -msgid "GEOM_SURFCONE" -msgstr "Face Conique" - -#Cylindrical Face -msgid "GEOM_SURFCYLINDER" -msgstr "Face Cylindrique" - -#Spherical Face -msgid "GEOM_SURFSPHERE" -msgstr "Face Sphèrique" - -#Toroidal Face -msgid "GEOM_SURFTORUS" -msgstr "Face Toroique" - -#Torus -msgid "GEOM_TORUS" -msgstr "Tore" - -#Vector -msgid "GEOM_VECTOR" -msgstr "Vecteur" - -#Vector U -msgid "GEOM_VECTOR_U" -msgstr "Vecteur U" - -#Vector V -msgid "GEOM_VECTOR_V" -msgstr "Vecteur V" - -#Vertex -msgid "GEOM_VERTEX" -msgstr "Vertex" - -#Wire -msgid "GEOM_WIRE" -msgstr "Wire" - -#Parameter -msgid "GEOM_PARAMETER" -msgstr "Paramètre :" - - -# -#============================================================================== -# - -#Min -msgid "GEOM_MIN" -msgstr "Min :" - -#Max -msgid "GEOM_MAX" -msgstr "Max :" - -#X -msgid "GEOM_X" -msgstr "X :" - -#Y -msgid "GEOM_Y" -msgstr "Y :" - -#Z -msgid "GEOM_Z" -msgstr "Z :" - -#DX -msgid "GEOM_DX" -msgstr "Dx :" - -#DY -msgid "GEOM_DY" -msgstr "Dy :" - -#DZ -msgid "GEOM_DZ" -msgstr "Dz :" - -#D1 -msgid "GEOM_D1" -msgstr "D1 :" - -#D2 -msgid "GEOM_D2" -msgstr "D2 :" - -# -#============================================================================== -# - -#: GeometryGUI.cxx -msgid "GEOM_STEP_TITLE" -msgstr "Increment par défaut lors des constructions" - -#: GeometryGUI_ArcDlg.cxx:45 -msgid "GEOM_ARC_TITLE" -msgstr "Construction d'un Arc" - -#: GeometryGUI_ArchimedeDlg.cxx:55 -msgid "GEOM_ARCHIMEDE_TITLE" -msgstr "Construction d'Archimède" - -#: GeometryGUI_BndBoxDlg.cxx:59 -msgid "GEOM_BNDBOX_TITLE" -msgstr "Boite Englobante" - -#: GeometryGUI_BndBoxDlg.cxx:82 -msgid "GEOM_BNDBOX_OBJDIM" -msgstr "Objet and ses dimensions" - -#: GeometryGUI_BoxDlg.cxx:50 -msgid "GEOM_BOX_TITLE" -msgstr "Construction d'une Boite" - -#: GeometryGUI_BoxDlg.cxx:50 -msgid "GEOM_BOX_OBJ" -msgstr "Dimensions A l'Origine" - -#: GeometryGUI_ChamferDlg.cxx:58 -msgid "GEOM_CHAMFER_TITLE" -msgstr "Construction d'un Chanfrein" - -#: GeometryGUI_ChamferDlg.cxx:58 -msgid "GEOM_CHAMFER_ALL" -msgstr "Chanfrein sur toute la Shape" - -#: GeometryGUI_ChamferDlg.cxx:58 -msgid "GEOM_CHAMFER_EDGES" -msgstr "Chanfrein sur Edges de la Shape" - -#: GeometryGUI_ChamferDlg.cxx:58 -msgid "GEOM_CHAMFER_FACES" -msgstr "Chanfrein sur Faces de la Shape" - -#: GeometryGUI_CircleDlg.cxx:48 -msgid "GEOM_CIRCLE_TITLE" -msgstr "Construction d'un Cercle" - -#: GeometryGUI_CenterMassDlg.cxx:77 -msgid "GEOM_CMASS_TITLE" -msgstr "Centre De Gravité" - -msgid "GEOM_PLANE_SIZE" -msgstr "Taille du plan :" - -#: GeometryGUI_CommonDlg.cxx:47 -msgid "GEOM_COMMON_TITLE" -msgstr "BOOLEEN : Jonction De Deux Objets" - -#: GeometryGUI_CompoundDlg.cxx:44 -msgid "GEOM_COMPOUND_TITLE" -msgstr "Création d'un Compound" - -#: GeometryGUI_ConeDlg.cxx:49 -msgid "GEOM_CONE_TITLE" -msgstr "Construction d'un Cone" - -#: GeometryGUI_CutDlg.cxx:48 -msgid "GEOM_CUT_TITLE" -msgstr "BOOLEEN : Couper Deux Objets" -# -#: GeometryGUI_CylinderDlg.cxx:47 -msgid "GEOM_CYLINDER_TITLE" -msgstr "Construction d'un Cylindre" - -#: GeometryGUI_CheckShape.cxx:60 -msgid "GEOM_CHECK_TITLE" -msgstr "Check Shape" - -#: GeometryGUI_CheckShape.cxx:83 -msgid "GEOM_CHECK_INFOS" -msgstr "Objet et ses Informations Topologiques" - -#: GeometryGUI_DistanceDlg.cxx:57 -msgid "GEOM_MINDIST_TITLE" -msgstr "Distance Minimale entre Deux Objets" - -#: GeometryGUI_DistanceDlg.cxx:57 -msgid "GEOM_MINDIST_OBJ" -msgstr "Objets Et Resultats" - -#: GeometryGUI_EdgeDlg.cxx:47 -msgid "GEOM_EDGE_TITLE" -msgstr "Création d'un Edge" - -#: GeometryGUI_FilletDlg.cxx:58 -msgid "GEOM_FILLET_TITLE" -msgstr "Construction d'un Congé" - -#: GeometryGUI_FilletDlg.cxx:58 -msgid "GEOM_FILLET_ALL" -msgstr "Congé sur toute la Shape" - -#: GeometryGUI_FilletDlg.cxx:58 -msgid "GEOM_FILLET_EDGES" -msgstr "Congé sur Edges de la Shape" - -#: GeometryGUI_FilletDlg.cxx:58 -msgid "GEOM_FILLET_FACES" -msgstr "Congé sur Faces de la Shape" - -#: GeometryGUI_FaceDlg.cxx:49 -msgid "GEOM_FACE_TITLE" -msgstr "Création d'une Face" - -#: GeometryGUI_FaceDlg.cxx:78 -msgid "GEOM_FACE_FFW" -msgstr "Face a partir d'un wire" - -#: GeometryGUI_FaceDlg.cxx:103 -msgid "GEOM_FACE_OPT" -msgstr "Création d'une Face plane" - -#: GeometryGUI_FillingDlg.cxx:53 -msgid "GEOM_FILLING_TITLE" -msgstr "Surface Par Courbes" - -#: GeometryGUI_FillingDlg.cxx:112 -msgid "GEOM_FILLING_ARG" -msgstr "Argument Et Parametres" - -#: GeometryGUI_FillingDlg.cxx:128 -msgid "GEOM_FILLING_MIN_DEG" -msgstr "Min. Deg" - -#: GeometryGUI_FillingDlg.cxx:142 -msgid "GEOM_FILLING_MAX_DEG" -msgstr "Max. Deg" - -#: GeometryGUI_FillingDlg.cxx:150 -msgid "GEOM_FILLING_TOL_2D" -msgstr "Tol. 2D" - -#: GeometryGUI_FillingDlg.cxx:170 -msgid "GEOM_FILLING_COMPOUND" -msgstr "Compound de Courbes" - -#: GeometryGUI_FillingDlg.cxx:184 -msgid "GEOM_FILLING_TOL_3D" -msgstr "Tol. 3D" - -#: GeometryGUI_FillingDlg.cxx:192 -msgid "GEOM_FILLING_NB_ITER" -msgstr "Nb. Iter" - -#: GeometryGUI_FuseDlg.cxx:48 -msgid "GEOM_FUSE_TITLE" -msgstr "BOOLEEN : Fusionner deux Objets" - -#: GeometryGUI_InertiaDlg.cxx:42 -msgid "GEOM_INERTIA_TITLE" -msgstr "Calculs d'Inertie" - -#: GeometryGUI_InertiaDlg.cxx:50 -msgid "GEOM_INERTIA_CONSTR" -msgstr "Matrice Et Moments d'Inertie" - -#: GeometryGUI_InertiaDlg.cxx:100 -msgid "GEOM_INERTIA_I" -msgstr "%1:1" - -#: GeometryGUI_InertiaDlg.cxx:182 -msgid "GEOM_INERTIA_IXYZ" -msgstr "IX & IY & IZ" - -#: GeometryGUI_LineDlg.cxx:50 -msgid "GEOM_LINE_TITLE" -msgstr "Construction d'une Ligne" - -#: GeometryGUI_MaxToleranceDlg.cxx:53 -msgid "GEOM_TOLERANCE_TITLE" -msgstr "Tolerance Maximale" - -#: GeometryGUI_MaxToleranceDlg.cxx:84 -msgid "GEOM_TOLERANCE_CONSTR" -msgstr "Object et ses Tolerances" - -#: GeometryGUI_MaxToleranceDlg.cxx:121 -msgid "GEOM_TOLERANCE_FACE" -msgstr "Face :" - -#: GeometryGUI_MaxToleranceDlg.cxx:138 -msgid "GEOM_TOLERANCE_EDGE" -msgstr "Edge :" - -#: GeometryGUI_MaxToleranceDlg.cxx:155 -msgid "GEOM_TOLERANCE_VERTEX" -msgstr "Vertex :" - -#: GeometryGUI_MirrorDlg.cxx:52 -msgid "GEOM_MIRROR_TITLE" -msgstr "Methode Miroir" - -#: GeometryGUI_OrientationDlg.cxx:46 -msgid "GEOM_ORIENTATION_TITLE" -msgstr "Changer l'Orientation" - -#: GeometryGUI_OrientationDlg.cxx:134 -msgid "GEOM_ORIENTATION_OPT" -msgstr "Renverser l'orientation avec une simulation de vecteur normal" - -#: GeometryGUI_PartitionDlg.cxx:45 -msgid "GEOM_PARTITION_TITLE" -msgstr "Partition d'Objects Avec Outils" - -#: GeometryGUI_PartitionDlg.cxx:45 -msgid "GEOM_KEEP_OBJECT" -msgstr "Objet garde" - -#: GeometryGUI_PartitionDlg.cxx:45 -msgid "GEOM_PARTITION_ORIENTATION" -msgstr "Change l'orientation" - -#: GeometryGUI_PipeDlg.cxx:47 -msgid "GEOM_PIPE_TITLE" -msgstr "Construction d'une Pipe" - -#: GeometryGUI_PointDlg.cxx:52 -msgid "GEOM_POINT_TITLE" -msgstr "Construction d'un Point" - -#: GeometryGUI_PlaneDlg.cxx:60 -msgid "GEOM_PLANE_TITLE" -msgstr "Construction d'un Plan" - -#: GeometryGUI_PlaneDlg.cxx:172 -msgid "GEOM_PLANE_PVC" -msgstr "Point + Vecteur Coordonnes" - -#: GeometryGUI_PlaneDlg.cxx:133 -msgid "GEOM_PLANE_PV" -msgstr "Point + Vecteur" - -#: GeometryGUI_PrismDlg.cxx:54 -msgid "GEOM_PRISM_TITLE" -msgstr "Extruder une Shape de base" - -#: GeometryGUI_PrismDlg.cxx:83 -msgid "GEOM_PRISM_BSV" -msgstr "Shape de base + Vecteur" - -#: GeometryGUI_PropertiesDlg.cxx:56 -msgid "GEOM_PROPERTIES_TITLE" -msgstr "Proprietes Basiques" - -#: GeometryGUI_PropertiesDlg.cxx:78 -msgid "GEOM_PROPERTIES_CONSTR" -msgstr "Objet et ses Proprietes" - -#: GeometryGUI_PropertiesDlg.cxx:114 -msgid "GEOM_PROPERTIES_SURFACE" -msgstr "Surface :" - -#: GeometryGUI_PropertiesDlg.cxx:120 -msgid "GEOM_PROPERTIES_VOLUME" -msgstr "Volume :" - -#: GeometryGUI_RevolDlg.cxx:49 -msgid "GEOM_REVOLUTION_TITLE" -msgstr "Construction Par Revolution" - -#: GeometryGUI_RotationDlg.cxx:51 -msgid "GEOM_ROTATION_TITLE" -msgstr "Rotation d'un Objet" - -#: GeometryGUI_ScaleDlg.cxx:52 -msgid "GEOM_SCALE_TITLE" -msgstr "Echelle d'un Objet" - -#: GeometryGUI_ScaleDlg.cxx:117 -msgid "GEOM_SCALE_FACTOR" -msgstr "Facteur d'echelle" - -#: GeometryGUI_SectionDlg.cxx:50 -msgid "GEOM_SECTION_TITLE" -msgstr "BOOLEEN : Section De Deux Objets" - -#: GeometryGUI_SewingDlg.cxx:48 -msgid "GEOM_SEWING_TITLE" -msgstr "Coudre des Topologies" - -#: GeometryGUI_ShellDlg.cxx:53 -msgid "GEOM_SHELL_TITLE" -msgstr "Construction d'une Shell" - -#: GeometryGUI_ShellDlg.cxx:74 -msgid "GEOM_SHELL_LIST" -msgstr "List de Faces Connectees" - -#: GeometryGUI_SphereDlg.cxx:50 -msgid "GEOM_SPHERE_TITLE" -msgstr "Construction d'une Sphere" - -#: GeometryGUI_SphereDlg.cxx:113 -msgid "GEOM_SPHERE_CR" -msgstr "Centre + rayon" - -#: GeometryGUI_SphereDlg.cxx:146 -msgid "GEOM_SPHERE_RO" -msgstr "Rayon a l'origine" - -#: GeometryGUI_SubShapeDlg.cxx:55 -msgid "GEOM_SUBSHAPE_TITLE" -msgstr "Selection de Sous Shapes" - -#: GeometryGUI_SubShapeDlg.cxx:131 -msgid "GEOM_SUBSHAPE_TYPE" -msgstr "Type de Sous Shapes" - -#: GeometryGUI_SubShapeDlg.cxx:137 -msgid "GEOM_SUBSHAPE_SELECT" -msgstr "Selectionner de Sous Shapes" - -#: GeometryGUI_TorusDlg.cxx:51 -msgid "GEOM_TORUS_TITLE" -msgstr "Constructiond'un Tore" - -#: GeometryGUI_SuppressFacesDlg.cxx:103 -msgid "GEOM_SUPRESSFACE_TITLE" -msgstr "Supprimer des Faces dans un Objet" - -#: GeometryGUI_SuppressFacesDlg.cxx:164 -msgid "GEOM_SUPRESSFACE_SELECT" -msgstr "Selectionner les Faces a Supprimer" - -#: GeometryGUI_TranslationDlg.cxx:78 -msgid "GEOM_TRANSLATION_COOR" -msgstr "Translation Avec Coordonnees" - -msgid "GEOM_TRANSPARENCY_TITLE" -msgstr "Transparence" - -msgid "GEOM_TRANSPARENCY_OPAQUE" -msgstr "Opaque" - -msgid "GEOM_TRANSPARENCY_TRANSPARENT" -msgstr "Transparent" - -msgid "GEOM_SUPPRESSHOLE_TITLE" -msgstr "Suppression de trous" - -msgid "GEOM_SUPPRESSHOLE_SELECTFACE" -msgstr "Selection de la face initiale" - -msgid "GEOM_SUPPRESSHOLE_SELECTWIRE" -msgstr "Selection du contour/trou sur la face" - -msgid "GEOM_SUPPRESSHOLE_SELECTFACE_END" -msgstr "Selection de la face terminale (si trou traversant)" - -msgid "GEOM_SUPPRESSHOLE_SELECTWIRE_END" -msgstr "Selection de contour final (si trou traversant)" - -msgid "GEOM_SUPPRESSHOLE_FACE_SHELL" -msgstr "Face ou shell" - -msgid "GEOM_SUPPRESSHOLE_SELECT_HOLES_ON_FACE" -msgstr "Selection de trou(s) sur la face" - -#: GeometryGUI_TranslationDlg.cxx:56 -msgid "GEOM_TRANSLATION_TITLE" -msgstr "Translation d'un Objet" - -#: GeometryGUI_VectorDlg.cxx:54 -msgid "GEOM_VECTOR_TITLE" -msgstr "Construction d'un Vecteur" - -#: GeometryGUI_WhatisDlg.cxx:63 -msgid "GEOM_WHATIS_TITLE" -msgstr "Whatis" - -#: GeometryGUI_WhatisDlg.cxx:86 -msgid "GEOM_WHATIS_OBJECT" -msgstr "Objet et ses Informations Topologiques" - -#: GeometryGUI_WireDlg.cxx:46 -msgid "GEOM_WIRE_TITLE" -msgstr "Creer un Wire" - -#: GeometryGUI_WireDlg.cxx:103 -msgid "GEOM_WIRE_CONNECT" -msgstr "Creation d'un Wire a partir de wires/edges connectes" - -#: GeometryGUI_WorkingPlaneDlg.cxx:50 -msgid "GEOM_WPALNE_TITLE" -msgstr "plan de travail" - -#: GeometryGUI_WorkingPlaneDlg.cxx:107 -msgid "GEOM_WPALNE_FACE" -msgstr "Plan Ou Face plane" - -#: GeometryGUI_multiTranslationDlg.cxx:107 -msgid "GEOM_MULTITRANSLATION_TITLE" -msgstr "Multi-Translation" - -#: GeometryGUI_multiTranslationDlg.cxx:107 -msgid "GEOM_MULTITRANSLATION_SIMPLE" -msgstr "Multi Translation Simple" - -#: GeometryGUI_multiTranslationDlg.cxx:107 -msgid "GEOM_MULTITRANSLATION_DOUBLE" -msgstr "Multi Translation Double" - -#: GeometryGUI_multiRotationDlg.cxx:107 -msgid "GEOM_MULTIROTATION_TITLE" -msgstr "Multi-Rotation" - -#: GeometryGUI_multiRotationDlg.cxx:107 -msgid "GEOM_MULTIROTATION_SIMPLE" -msgstr "Multi Rotation Simple" - -#: GeometryGUI_multiRotationDlg.cxx:107 -msgid "GEOM_MULTIROTATION_DOUBLE" -msgstr "Multi Rotation Double" - -msgid "GEOM_PARAM_POINT" -msgstr "Point paramétrique" - -# -#============================================================================== -# - -#: GeometryGUI.cxx:4613 -msgid "GEOM_MEN_WIREFRAME" -msgstr "Filaire" - -#: GeometryGUI.cxx:4613 -msgid "GEOM_MEN_SHADING" -msgstr "Ombré" diff --git a/src/GEOMGUI/GeometryGUI_1Sel1Spin.cxx b/src/GEOMGUI/GeometryGUI_1Sel1Spin.cxx deleted file mode 100644 index 06dc53e52..000000000 --- a/src/GEOMGUI/GeometryGUI_1Sel1Spin.cxx +++ /dev/null @@ -1,54 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_1Sel1Spin.cxx -// Author : Damien COQUERET -// Module : GEOM -// $Header: - -#include "GeometryGUI_1Sel1Spin.h" - -#include -#include -#include - -/* - * Constructs a GeometryGUI_1Sel1Spin which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' - */ -GeometryGUI_1Sel1Spin::GeometryGUI_1Sel1Spin(QWidget* parent, const char* name, WFlags fl) - :GeometryGUI_1Sel1Spin_QTD(parent, name, fl) -{ - SpinBox1->close(TRUE); - SpinBox_DX = new GeometryGUI_SpinBox(GroupBox1, "SpinBox_DX"); - Layout2->addWidget(SpinBox_DX, 0, 1); -} - - -/* - * Destroys the object and frees any allocated resources - */ -GeometryGUI_1Sel1Spin::~GeometryGUI_1Sel1Spin() -{ - // no need to delete child widgets, Qt does it all for us -} diff --git a/src/GEOMGUI/GeometryGUI_1Sel1Spin.h b/src/GEOMGUI/GeometryGUI_1Sel1Spin.h deleted file mode 100644 index 410b1b96f..000000000 --- a/src/GEOMGUI/GeometryGUI_1Sel1Spin.h +++ /dev/null @@ -1,47 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_1Sel1Spin.h -// Author : Damien COQUERET -// Module : GEOM -// $Header: - -#ifndef GEOMETRYGUI_1SEL1SPIN_H -#define GEOMETRYGUI_1SEL1SPIN_H - -#include "GeometryGUI_1Sel1Spin_QTD.h" -#include "GeometryGUI_SpinBox.h" - -class GeometryGUI_1Sel1Spin : public GeometryGUI_1Sel1Spin_QTD -{ - Q_OBJECT - -public: - GeometryGUI_1Sel1Spin( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); - ~GeometryGUI_1Sel1Spin(); - - GeometryGUI_SpinBox* SpinBox_DX; - -}; - -#endif // GEOMETRYGUI_1SEL1SPIN_H diff --git a/src/GEOMGUI/GeometryGUI_1Sel1Spin_QTD.cxx b/src/GEOMGUI/GeometryGUI_1Sel1Spin_QTD.cxx deleted file mode 100644 index 90b8d7402..000000000 --- a/src/GEOMGUI/GeometryGUI_1Sel1Spin_QTD.cxx +++ /dev/null @@ -1,89 +0,0 @@ -/**************************************************************************** -** Form implementation generated from reading ui file 'GeometryGUI_1Sel1Spin_QTD.ui' -** -** Created: mar sep 23 16:05:08 2003 -** by: The User Interface Compiler (uic) -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ -#include "GeometryGUI_1Sel1Spin_QTD.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Constructs a GeometryGUI_1Sel1Spin_QTD which is a child of 'parent', with the - * name 'name' and widget flags set to 'f'. - */ -GeometryGUI_1Sel1Spin_QTD::GeometryGUI_1Sel1Spin_QTD( QWidget* parent, const char* name, WFlags fl ) - : QWidget( parent, name, fl ) -{ - if ( !name ) - setName( "GeometryGUI_1Sel1Spin_QTD" ); - resize( 129, 87 ); - setCaption( trUtf8( "GeometryGUI_1Sel1Spin_QTD" ) ); - GeometryGUI_1Sel1Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "GeometryGUI_1Sel1Spin_QTDLayout"); - - GroupBox1 = new QGroupBox( this, "GroupBox1" ); - GroupBox1->setTitle( trUtf8( "" ) ); - GroupBox1->setColumnLayout(0, Qt::Vertical ); - GroupBox1->layout()->setSpacing( 6 ); - GroupBox1->layout()->setMargin( 11 ); - GroupBox1Layout = new QGridLayout( GroupBox1->layout() ); - GroupBox1Layout->setAlignment( Qt::AlignTop ); - - Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1"); - - PushButton1 = new QPushButton( GroupBox1, "PushButton1" ); - PushButton1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton1->sizePolicy().hasHeightForWidth() ) ); - PushButton1->setText( trUtf8( "" ) ); - - Layout1->addWidget( PushButton1, 0, 1 ); - - TextLabel1 = new QLabel( GroupBox1, "TextLabel1" ); - TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) ); - TextLabel1->setText( trUtf8( "TL1" ) ); - - Layout1->addWidget( TextLabel1, 0, 0 ); - - LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" ); - - Layout1->addWidget( LineEdit1, 0, 2 ); - - Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2"); - - TextLabel2 = new QLabel( GroupBox1, "TextLabel2" ); - TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) ); - TextLabel2->setText( trUtf8( "TL2" ) ); - - Layout2->addWidget( TextLabel2, 0, 0 ); - - SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" ); - SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) ); - - Layout2->addWidget( SpinBox1, 0, 1 ); - - Layout1->addMultiCellLayout( Layout2, 1, 1, 0, 2 ); - QSpacerItem* spacer = new QSpacerItem( 0, 16, QSizePolicy::Minimum, QSizePolicy::Expanding ); - Layout1->addItem( spacer, 2, 2 ); - - GroupBox1Layout->addLayout( Layout1, 0, 0 ); - - GeometryGUI_1Sel1Spin_QTDLayout->addWidget( GroupBox1, 0, 0 ); -} - -/* - * Destroys the object and frees any allocated resources - */ -GeometryGUI_1Sel1Spin_QTD::~GeometryGUI_1Sel1Spin_QTD() -{ - // no need to delete child widgets, Qt does it all for us -} - diff --git a/src/GEOMGUI/GeometryGUI_1Sel1Spin_QTD.h b/src/GEOMGUI/GeometryGUI_1Sel1Spin_QTD.h deleted file mode 100644 index f82126363..000000000 --- a/src/GEOMGUI/GeometryGUI_1Sel1Spin_QTD.h +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** Form interface generated from reading ui file 'GeometryGUI_1Sel1Spin_QTD.ui' -** -** Created: mar sep 23 16:05:08 2003 -** by: The User Interface Compiler (uic) -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ -#ifndef GEOMETRYGUI_1SEL1SPIN_QTD_H -#define GEOMETRYGUI_1SEL1SPIN_QTD_H - -#include -#include -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QSpinBox; - -class GeometryGUI_1Sel1Spin_QTD : public QWidget -{ - Q_OBJECT - -public: - GeometryGUI_1Sel1Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); - ~GeometryGUI_1Sel1Spin_QTD(); - - QGroupBox* GroupBox1; - QPushButton* PushButton1; - QLabel* TextLabel1; - QLineEdit* LineEdit1; - QLabel* TextLabel2; - QSpinBox* SpinBox1; - - -protected: - QGridLayout* GeometryGUI_1Sel1Spin_QTDLayout; - QGridLayout* GroupBox1Layout; - QGridLayout* Layout1; - QGridLayout* Layout2; -}; - -#endif // GEOMETRYGUI_1SEL1SPIN_QTD_H diff --git a/src/GEOMGUI/GeometryGUI_1Sel4Spin.cxx b/src/GEOMGUI/GeometryGUI_1Sel4Spin.cxx deleted file mode 100644 index 0ca01867a..000000000 --- a/src/GEOMGUI/GeometryGUI_1Sel4Spin.cxx +++ /dev/null @@ -1,67 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_1Sel4Spin.cxx -// Author : Damien COQUERET -// Module : GEOM -// $Header: - -#include "GeometryGUI_1Sel4Spin.h" - -#include -#include -#include - -/* - * Constructs a GeometryGUI_1Sel4Spin which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' - */ -GeometryGUI_1Sel4Spin::GeometryGUI_1Sel4Spin(QWidget* parent, const char* name, WFlags fl) - :GeometryGUI_1Sel4Spin_QTD(parent, name, fl) -{ - SpinBox1->close(TRUE); - SpinBox2->close(TRUE); - SpinBox3->close(TRUE); - SpinBox4->close(TRUE); - - SpinBox_DX = new GeometryGUI_SpinBox(GroupBox1, "SpinBox_DX"); - Layout3->addWidget(SpinBox_DX, 0, 2); - - SpinBox_DY = new GeometryGUI_SpinBox( GroupBox1, "SpinBox_DY"); - Layout3->addWidget(SpinBox_DY, 0, 4); - - SpinBox_DZ = new GeometryGUI_SpinBox( GroupBox1, "SpinBox_DZ"); - Layout3->addWidget(SpinBox_DZ, 0, 6); - - SpinBox_S = new GeometryGUI_SpinBox( GroupBox1, "SpinBox_S"); - Layout4->addWidget(SpinBox_S, 0, 1); -} - - -/* - * Destroys the object and frees any allocated resources - */ -GeometryGUI_1Sel4Spin::~GeometryGUI_1Sel4Spin() -{ - // no need to delete child widgets, Qt does it all for us -} diff --git a/src/GEOMGUI/GeometryGUI_1Sel4Spin.h b/src/GEOMGUI/GeometryGUI_1Sel4Spin.h deleted file mode 100644 index fae6bdbb2..000000000 --- a/src/GEOMGUI/GeometryGUI_1Sel4Spin.h +++ /dev/null @@ -1,51 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_1Sel4Spin.h -// Author : Damien COQUERET -// Module : GEOM -// $Header: - -#ifndef GEOMETRYGUI_1SEL4SPIN_H -#define GEOMETRYGUI_1SEL4SPIN_H - -#include "GeometryGUI_1Sel4Spin_QTD.h" -#include "GeometryGUI_SpinBox.h" - -class GeometryGUI_1Sel4Spin : public GeometryGUI_1Sel4Spin_QTD -{ - Q_OBJECT - -public: - GeometryGUI_1Sel4Spin( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); - ~GeometryGUI_1Sel4Spin(); - - GeometryGUI_SpinBox* SpinBox_DX; - GeometryGUI_SpinBox* SpinBox_DY; - GeometryGUI_SpinBox* SpinBox_DZ; - - GeometryGUI_SpinBox* SpinBox_S; - -}; - -#endif // GEOMETRYGUI_1SEL4SPIN_H diff --git a/src/GEOMGUI/GeometryGUI_1Sel4Spin_QTD.cxx b/src/GEOMGUI/GeometryGUI_1Sel4Spin_QTD.cxx deleted file mode 100644 index 428d0fa8f..000000000 --- a/src/GEOMGUI/GeometryGUI_1Sel4Spin_QTD.cxx +++ /dev/null @@ -1,132 +0,0 @@ -/**************************************************************************** -** Form implementation generated from reading ui file 'GeometryGUI_1Sel4Spin_QTD.ui' -** -** Created: mar sep 23 16:05:09 2003 -** by: The User Interface Compiler (uic) -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ -#include "GeometryGUI_1Sel4Spin_QTD.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Constructs a GeometryGUI_1Sel4Spin_QTD which is a child of 'parent', with the - * name 'name' and widget flags set to 'f'. - */ -GeometryGUI_1Sel4Spin_QTD::GeometryGUI_1Sel4Spin_QTD( QWidget* parent, const char* name, WFlags fl ) - : QWidget( parent, name, fl ) -{ - if ( !name ) - setName( "GeometryGUI_1Sel4Spin_QTD" ); - resize( 284, 119 ); - setCaption( trUtf8( "GeometryGUI_1Sel4Spin_QTD" ) ); - GeometryGUI_1Sel4Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "GeometryGUI_1Sel4Spin_QTDLayout"); - - GroupBox1 = new QGroupBox( this, "GroupBox1" ); - GroupBox1->setTitle( trUtf8( "" ) ); - GroupBox1->setColumnLayout(0, Qt::Vertical ); - GroupBox1->layout()->setSpacing( 6 ); - GroupBox1->layout()->setMargin( 11 ); - GroupBox1Layout = new QGridLayout( GroupBox1->layout() ); - GroupBox1Layout->setAlignment( Qt::AlignTop ); - - Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1"); - - Layout3 = new QGridLayout( 0, 1, 1, 0, 6, "Layout3"); - - TextLabel5 = new QLabel( GroupBox1, "TextLabel5" ); - TextLabel5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel5->sizePolicy().hasHeightForWidth() ) ); - TextLabel5->setText( trUtf8( "TL5" ) ); - - Layout3->addWidget( TextLabel5, 0, 5 ); - - TextLabel3 = new QLabel( GroupBox1, "TextLabel3" ); - TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) ); - TextLabel3->setText( trUtf8( "TL3" ) ); - - Layout3->addWidget( TextLabel3, 0, 1 ); - - TextLabel4 = new QLabel( GroupBox1, "TextLabel4" ); - TextLabel4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel4->sizePolicy().hasHeightForWidth() ) ); - TextLabel4->setText( trUtf8( "TL4" ) ); - - Layout3->addWidget( TextLabel4, 0, 3 ); - - SpinBox3 = new QSpinBox( GroupBox1, "SpinBox3" ); - SpinBox3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox3->sizePolicy().hasHeightForWidth() ) ); - - Layout3->addWidget( SpinBox3, 0, 6 ); - - SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" ); - SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) ); - - Layout3->addWidget( SpinBox1, 0, 2 ); - - TextLabel2 = new QLabel( GroupBox1, "TextLabel2" ); - TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) ); - TextLabel2->setText( trUtf8( "TL2" ) ); - - Layout3->addWidget( TextLabel2, 0, 0 ); - - SpinBox2 = new QSpinBox( GroupBox1, "SpinBox2" ); - SpinBox2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox2->sizePolicy().hasHeightForWidth() ) ); - - Layout3->addWidget( SpinBox2, 0, 4 ); - - Layout1->addLayout( Layout3, 1, 0 ); - QSpacerItem* spacer = new QSpacerItem( 0, 16, QSizePolicy::Minimum, QSizePolicy::Expanding ); - Layout1->addItem( spacer, 3, 0 ); - - Layout4 = new QGridLayout( 0, 1, 1, 0, 6, "Layout4"); - - TextLabel6 = new QLabel( GroupBox1, "TextLabel6" ); - TextLabel6->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel6->sizePolicy().hasHeightForWidth() ) ); - TextLabel6->setText( trUtf8( "TL6" ) ); - - Layout4->addWidget( TextLabel6, 0, 0 ); - - SpinBox4 = new QSpinBox( GroupBox1, "SpinBox4" ); - - Layout4->addWidget( SpinBox4, 0, 1 ); - - Layout1->addLayout( Layout4, 2, 0 ); - - Layout2 = new QHBoxLayout( 0, 0, 6, "Layout2"); - - TextLabel1 = new QLabel( GroupBox1, "TextLabel1" ); - TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) ); - TextLabel1->setText( trUtf8( "TL1" ) ); - Layout2->addWidget( TextLabel1 ); - - PushButton1 = new QPushButton( GroupBox1, "PushButton1" ); - PushButton1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton1->sizePolicy().hasHeightForWidth() ) ); - PushButton1->setText( trUtf8( "" ) ); - Layout2->addWidget( PushButton1 ); - - LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" ); - Layout2->addWidget( LineEdit1 ); - - Layout1->addLayout( Layout2, 0, 0 ); - - GroupBox1Layout->addLayout( Layout1, 0, 0 ); - - GeometryGUI_1Sel4Spin_QTDLayout->addWidget( GroupBox1, 0, 0 ); -} - -/* - * Destroys the object and frees any allocated resources - */ -GeometryGUI_1Sel4Spin_QTD::~GeometryGUI_1Sel4Spin_QTD() -{ - // no need to delete child widgets, Qt does it all for us -} - diff --git a/src/GEOMGUI/GeometryGUI_1Sel4Spin_QTD.h b/src/GEOMGUI/GeometryGUI_1Sel4Spin_QTD.h deleted file mode 100644 index a072ab249..000000000 --- a/src/GEOMGUI/GeometryGUI_1Sel4Spin_QTD.h +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** Form interface generated from reading ui file 'GeometryGUI_1Sel4Spin_QTD.ui' -** -** Created: mar sep 23 16:05:09 2003 -** by: The User Interface Compiler (uic) -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ -#ifndef GEOMETRYGUI_1SEL4SPIN_QTD_H -#define GEOMETRYGUI_1SEL4SPIN_QTD_H - -#include -#include -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QSpinBox; - -class GeometryGUI_1Sel4Spin_QTD : public QWidget -{ - Q_OBJECT - -public: - GeometryGUI_1Sel4Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); - ~GeometryGUI_1Sel4Spin_QTD(); - - QGroupBox* GroupBox1; - QLabel* TextLabel5; - QLabel* TextLabel3; - QLabel* TextLabel4; - QSpinBox* SpinBox3; - QSpinBox* SpinBox1; - QLabel* TextLabel2; - QSpinBox* SpinBox2; - QLabel* TextLabel6; - QSpinBox* SpinBox4; - QLabel* TextLabel1; - QPushButton* PushButton1; - QLineEdit* LineEdit1; - - -protected: - QGridLayout* GeometryGUI_1Sel4Spin_QTDLayout; - QGridLayout* GroupBox1Layout; - QGridLayout* Layout1; - QGridLayout* Layout3; - QGridLayout* Layout4; - QHBoxLayout* Layout2; -}; - -#endif // GEOMETRYGUI_1SEL4SPIN_QTD_H diff --git a/src/GEOMGUI/GeometryGUI_1Sel_QTD.cxx b/src/GEOMGUI/GeometryGUI_1Sel_QTD.cxx deleted file mode 100644 index 85d7d8ef5..000000000 --- a/src/GEOMGUI/GeometryGUI_1Sel_QTD.cxx +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** Form implementation generated from reading ui file 'GeometryGUI_1Sel_QTD.ui' -** -** Created: lun sep 22 17:38:06 2003 -** by: The User Interface Compiler (uic) -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ -#include "GeometryGUI_1Sel_QTD.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Constructs a GeometryGUI_1Sel_QTD which is a child of 'parent', with the - * name 'name' and widget flags set to 'f'. - */ -GeometryGUI_1Sel_QTD::GeometryGUI_1Sel_QTD( QWidget* parent, const char* name, WFlags fl ) - : QWidget( parent, name, fl ) -{ - if ( !name ) - setName( "GeometryGUI_1Sel_QTD" ); - resize( 129, 57 ); - setCaption( trUtf8( "GeometryGUI_1Sel_QTD" ) ); - GeometryGUI_1Sel_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "GeometryGUI_1Sel_QTDLayout"); - - GroupBox1 = new QGroupBox( this, "GroupBox1" ); - GroupBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupBox1->sizePolicy().hasHeightForWidth() ) ); - GroupBox1->setTitle( trUtf8( "" ) ); - GroupBox1->setColumnLayout(0, Qt::Vertical ); - GroupBox1->layout()->setSpacing( 6 ); - GroupBox1->layout()->setMargin( 11 ); - GroupBox1Layout = new QGridLayout( GroupBox1->layout() ); - GroupBox1Layout->setAlignment( Qt::AlignTop ); - - Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1"); - - PushButton1 = new QPushButton( GroupBox1, "PushButton1" ); - PushButton1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton1->sizePolicy().hasHeightForWidth() ) ); - PushButton1->setText( trUtf8( "" ) ); - - Layout1->addWidget( PushButton1, 0, 1 ); - QSpacerItem* spacer = new QSpacerItem( 0, 16, QSizePolicy::Minimum, QSizePolicy::Expanding ); - Layout1->addItem( spacer, 1, 2 ); - - LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" ); - - Layout1->addWidget( LineEdit1, 0, 2 ); - - TextLabel1 = new QLabel( GroupBox1, "TextLabel1" ); - TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) ); - TextLabel1->setText( trUtf8( "TL1" ) ); - - Layout1->addWidget( TextLabel1, 0, 0 ); - - GroupBox1Layout->addLayout( Layout1, 0, 0 ); - - GeometryGUI_1Sel_QTDLayout->addWidget( GroupBox1, 0, 0 ); -} - -/* - * Destroys the object and frees any allocated resources - */ -GeometryGUI_1Sel_QTD::~GeometryGUI_1Sel_QTD() -{ - // no need to delete child widgets, Qt does it all for us -} - diff --git a/src/GEOMGUI/GeometryGUI_1Sel_QTD.h b/src/GEOMGUI/GeometryGUI_1Sel_QTD.h deleted file mode 100644 index 3850db4b1..000000000 --- a/src/GEOMGUI/GeometryGUI_1Sel_QTD.h +++ /dev/null @@ -1,42 +0,0 @@ -/**************************************************************************** -** Form interface generated from reading ui file 'GeometryGUI_1Sel_QTD.ui' -** -** Created: lun sep 22 17:38:05 2003 -** by: The User Interface Compiler (uic) -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ -#ifndef GEOMETRYGUI_1SEL_QTD_H -#define GEOMETRYGUI_1SEL_QTD_H - -#include -#include -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; - -class GeometryGUI_1Sel_QTD : public QWidget -{ - Q_OBJECT - -public: - GeometryGUI_1Sel_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); - ~GeometryGUI_1Sel_QTD(); - - QGroupBox* GroupBox1; - QPushButton* PushButton1; - QLineEdit* LineEdit1; - QLabel* TextLabel1; - - -protected: - QGridLayout* GeometryGUI_1Sel_QTDLayout; - QGridLayout* GroupBox1Layout; - QGridLayout* Layout1; -}; - -#endif // GEOMETRYGUI_1SEL_QTD_H diff --git a/src/GEOMGUI/GeometryGUI_1Spin.cxx b/src/GEOMGUI/GeometryGUI_1Spin.cxx deleted file mode 100644 index 7653374de..000000000 --- a/src/GEOMGUI/GeometryGUI_1Spin.cxx +++ /dev/null @@ -1,56 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_1Spin.cxx -// Author : Damien COQUERET -// Module : GEOM -// $Header: - -#include "GeometryGUI_1Spin.h" - -#include -#include -#include - -/* - * Constructs a GeometryGUI_1Spin which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' - */ -GeometryGUI_1Spin::GeometryGUI_1Spin(QWidget* parent, const char* name, WFlags fl) - :GeometryGUI_1Spin_QTD(parent, name, fl) -{ - SpinBox1->close(TRUE); - - SpinBox_DX = new GeometryGUI_SpinBox(GroupBox1, "SpinBox_DX"); - Layout1->addWidget(SpinBox_DX, 0, 1); - -} - - -/* - * Destroys the object and frees any allocated resources - */ -GeometryGUI_1Spin::~GeometryGUI_1Spin() -{ - // no need to delete child widgets, Qt does it all for us -} diff --git a/src/GEOMGUI/GeometryGUI_1Spin.h b/src/GEOMGUI/GeometryGUI_1Spin.h deleted file mode 100644 index d36bc9c76..000000000 --- a/src/GEOMGUI/GeometryGUI_1Spin.h +++ /dev/null @@ -1,47 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_1Spin.h -// Author : Damien COQUERET -// Module : GEOM -// $Header: - -#ifndef GEOMETRYGUI_1SPIN_H -#define GEOMETRYGUI_1SPIN_H - -#include "GeometryGUI_1Spin_QTD.h" -#include "GeometryGUI_SpinBox.h" - -class GeometryGUI_1Spin : public GeometryGUI_1Spin_QTD -{ - Q_OBJECT - -public: - GeometryGUI_1Spin(QWidget* parent = 0, const char* name = 0, WFlags fl = 0); - ~GeometryGUI_1Spin(); - - GeometryGUI_SpinBox* SpinBox_DX; - -}; - -#endif // GEOMETRYGUI_1SPIN_H diff --git a/src/GEOMGUI/GeometryGUI_1Spin_QTD.cxx b/src/GEOMGUI/GeometryGUI_1Spin_QTD.cxx deleted file mode 100644 index 7b2c994d1..000000000 --- a/src/GEOMGUI/GeometryGUI_1Spin_QTD.cxx +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** Form implementation generated from reading ui file 'GeometryGUI_1Spin_QTD.ui' -** -** Created: jeu sep 25 12:22:29 2003 -** by: The User Interface Compiler (uic) -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ -#include "GeometryGUI_1Spin_QTD.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Constructs a GeometryGUI_1Spin_QTD which is a child of 'parent', with the - * name 'name' and widget flags set to 'f'. - */ -GeometryGUI_1Spin_QTD::GeometryGUI_1Spin_QTD( QWidget* parent, const char* name, WFlags fl ) - : QWidget( parent, name, fl ) -{ - if ( !name ) - setName( "GeometryGUI_1Spin_QTD" ); - resize( 124, 55 ); - setCaption( trUtf8( "GeometryGUI_1Spin_QTD" ) ); - GeometryGUI_1Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "GeometryGUI_1Spin_QTDLayout"); - - GroupBox1 = new QGroupBox( this, "GroupBox1" ); - GroupBox1->setTitle( trUtf8( "" ) ); - GroupBox1->setColumnLayout(0, Qt::Vertical ); - GroupBox1->layout()->setSpacing( 6 ); - GroupBox1->layout()->setMargin( 11 ); - GroupBox1Layout = new QGridLayout( GroupBox1->layout() ); - GroupBox1Layout->setAlignment( Qt::AlignTop ); - - Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1"); - QSpacerItem* spacer = new QSpacerItem( 0, 16, QSizePolicy::Minimum, QSizePolicy::Expanding ); - Layout1->addItem( spacer, 3, 1 ); - - SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" ); - SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) ); - - Layout1->addWidget( SpinBox1, 0, 1 ); - - TextLabel1 = new QLabel( GroupBox1, "TextLabel1" ); - TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) ); - TextLabel1->setText( trUtf8( "TL1" ) ); - - Layout1->addWidget( TextLabel1, 0, 0 ); - - GroupBox1Layout->addLayout( Layout1, 0, 0 ); - - GeometryGUI_1Spin_QTDLayout->addWidget( GroupBox1, 0, 0 ); -} - -/* - * Destroys the object and frees any allocated resources - */ -GeometryGUI_1Spin_QTD::~GeometryGUI_1Spin_QTD() -{ - // no need to delete child widgets, Qt does it all for us -} - diff --git a/src/GEOMGUI/GeometryGUI_1Spin_QTD.h b/src/GEOMGUI/GeometryGUI_1Spin_QTD.h deleted file mode 100644 index e0acda271..000000000 --- a/src/GEOMGUI/GeometryGUI_1Spin_QTD.h +++ /dev/null @@ -1,40 +0,0 @@ -/**************************************************************************** -** Form interface generated from reading ui file 'GeometryGUI_1Spin_QTD.ui' -** -** Created: jeu sep 25 12:22:29 2003 -** by: The User Interface Compiler (uic) -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ -#ifndef GEOMETRYGUI_1SPIN_QTD_H -#define GEOMETRYGUI_1SPIN_QTD_H - -#include -#include -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QGroupBox; -class QLabel; -class QSpinBox; - -class GeometryGUI_1Spin_QTD : public QWidget -{ - Q_OBJECT - -public: - GeometryGUI_1Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); - ~GeometryGUI_1Spin_QTD(); - - QGroupBox* GroupBox1; - QSpinBox* SpinBox1; - QLabel* TextLabel1; - - -protected: - QGridLayout* GeometryGUI_1Spin_QTDLayout; - QGridLayout* GroupBox1Layout; - QGridLayout* Layout1; -}; - -#endif // GEOMETRYGUI_1SPIN_QTD_H diff --git a/src/GEOMGUI/GeometryGUI_2Sel1Spin.cxx b/src/GEOMGUI/GeometryGUI_2Sel1Spin.cxx deleted file mode 100644 index 3eb5fd957..000000000 --- a/src/GEOMGUI/GeometryGUI_2Sel1Spin.cxx +++ /dev/null @@ -1,54 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_2Sel1Spin.cxx -// Author : Damien COQUERET -// Module : GEOM -// $Header: - -#include "GeometryGUI_2Sel1Spin.h" - -#include -#include -#include - -/* - * Constructs a GeometryGUI_2Sel1Spin which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' - */ -GeometryGUI_2Sel1Spin::GeometryGUI_2Sel1Spin(QWidget* parent, const char* name, WFlags fl) - :GeometryGUI_2Sel1Spin_QTD(parent, name, fl) -{ - SpinBox1->close(TRUE); - SpinBox_DX = new GeometryGUI_SpinBox(GroupBox1, "SpinBox_DX"); - Layout2->addWidget(SpinBox_DX, 0, 1); -} - - -/* - * Destroys the object and frees any allocated resources - */ -GeometryGUI_2Sel1Spin::~GeometryGUI_2Sel1Spin() -{ - // no need to delete child widgets, Qt does it all for us -} diff --git a/src/GEOMGUI/GeometryGUI_2Sel1Spin.h b/src/GEOMGUI/GeometryGUI_2Sel1Spin.h deleted file mode 100644 index d495e696d..000000000 --- a/src/GEOMGUI/GeometryGUI_2Sel1Spin.h +++ /dev/null @@ -1,47 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_2Sel1Spin.h -// Author : Damien COQUERET -// Module : GEOM -// $Header: - -#ifndef GEOMETRYGUI_2SEL1SPIN_H -#define GEOMETRYGUI_2SEL1SPIN_H - -#include "GeometryGUI_2Sel1Spin_QTD.h" -#include "GeometryGUI_SpinBox.h" - -class GeometryGUI_2Sel1Spin : public GeometryGUI_2Sel1Spin_QTD -{ - Q_OBJECT - -public: - GeometryGUI_2Sel1Spin( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); - ~GeometryGUI_2Sel1Spin(); - - GeometryGUI_SpinBox* SpinBox_DX; - -}; - -#endif // GEOMETRYGUI_2SEL1SPIN_H diff --git a/src/GEOMGUI/GeometryGUI_2Sel1Spin_QTD.cxx b/src/GEOMGUI/GeometryGUI_2Sel1Spin_QTD.cxx deleted file mode 100644 index bbaa84e50..000000000 --- a/src/GEOMGUI/GeometryGUI_2Sel1Spin_QTD.cxx +++ /dev/null @@ -1,105 +0,0 @@ -/**************************************************************************** -** Form implementation generated from reading ui file 'GeometryGUI_2Sel1Spin_QTD.ui' -** -** Created: mar sep 23 16:05:09 2003 -** by: The User Interface Compiler (uic) -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ -#include "GeometryGUI_2Sel1Spin_QTD.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Constructs a GeometryGUI_2Sel1Spin_QTD which is a child of 'parent', with the - * name 'name' and widget flags set to 'f'. - */ -GeometryGUI_2Sel1Spin_QTD::GeometryGUI_2Sel1Spin_QTD( QWidget* parent, const char* name, WFlags fl ) - : QWidget( parent, name, fl ) -{ - if ( !name ) - setName( "GeometryGUI_2Sel1Spin_QTD" ); - resize( 129, 117 ); - setCaption( trUtf8( "GeometryGUI_2Sel1Spin_QTD" ) ); - GeometryGUI_2Sel1Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "GeometryGUI_2Sel1Spin_QTDLayout"); - - GroupBox1 = new QGroupBox( this, "GroupBox1" ); - GroupBox1->setTitle( trUtf8( "" ) ); - GroupBox1->setColumnLayout(0, Qt::Vertical ); - GroupBox1->layout()->setSpacing( 6 ); - GroupBox1->layout()->setMargin( 11 ); - GroupBox1Layout = new QGridLayout( GroupBox1->layout() ); - GroupBox1Layout->setAlignment( Qt::AlignTop ); - - Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1"); - - LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" ); - - Layout1->addWidget( LineEdit1, 0, 2 ); - - PushButton2 = new QPushButton( GroupBox1, "PushButton2" ); - PushButton2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton2->sizePolicy().hasHeightForWidth() ) ); - PushButton2->setText( trUtf8( "" ) ); - - Layout1->addWidget( PushButton2, 1, 1 ); - - TextLabel1 = new QLabel( GroupBox1, "TextLabel1" ); - TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) ); - TextLabel1->setText( trUtf8( "TL1" ) ); - - Layout1->addWidget( TextLabel1, 0, 0 ); - - LineEdit2 = new QLineEdit( GroupBox1, "LineEdit2" ); - - Layout1->addWidget( LineEdit2, 1, 2 ); - - PushButton1 = new QPushButton( GroupBox1, "PushButton1" ); - PushButton1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton1->sizePolicy().hasHeightForWidth() ) ); - PushButton1->setText( trUtf8( "" ) ); - - Layout1->addWidget( PushButton1, 0, 1 ); - - TextLabel2 = new QLabel( GroupBox1, "TextLabel2" ); - TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) ); - TextLabel2->setText( trUtf8( "TL2" ) ); - - Layout1->addWidget( TextLabel2, 1, 0 ); - - Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2"); - - SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" ); - SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) ); - - Layout2->addWidget( SpinBox1, 0, 1 ); - - TextLabel3 = new QLabel( GroupBox1, "TextLabel3" ); - TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) ); - TextLabel3->setText( trUtf8( "TL3" ) ); - - Layout2->addWidget( TextLabel3, 0, 0 ); - - Layout1->addMultiCellLayout( Layout2, 2, 2, 0, 2 ); - QSpacerItem* spacer = new QSpacerItem( 0, 16, QSizePolicy::Minimum, QSizePolicy::Expanding ); - Layout1->addItem( spacer, 3, 2 ); - - GroupBox1Layout->addLayout( Layout1, 0, 0 ); - - GeometryGUI_2Sel1Spin_QTDLayout->addWidget( GroupBox1, 0, 0 ); -} - -/* - * Destroys the object and frees any allocated resources - */ -GeometryGUI_2Sel1Spin_QTD::~GeometryGUI_2Sel1Spin_QTD() -{ - // no need to delete child widgets, Qt does it all for us -} - diff --git a/src/GEOMGUI/GeometryGUI_2Sel1Spin_QTD.h b/src/GEOMGUI/GeometryGUI_2Sel1Spin_QTD.h deleted file mode 100644 index 75fd43adc..000000000 --- a/src/GEOMGUI/GeometryGUI_2Sel1Spin_QTD.h +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** Form interface generated from reading ui file 'GeometryGUI_2Sel1Spin_QTD.ui' -** -** Created: mar sep 23 16:05:09 2003 -** by: The User Interface Compiler (uic) -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ -#ifndef GEOMETRYGUI_2SEL1SPIN_QTD_H -#define GEOMETRYGUI_2SEL1SPIN_QTD_H - -#include -#include -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QSpinBox; - -class GeometryGUI_2Sel1Spin_QTD : public QWidget -{ - Q_OBJECT - -public: - GeometryGUI_2Sel1Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); - ~GeometryGUI_2Sel1Spin_QTD(); - - QGroupBox* GroupBox1; - QLineEdit* LineEdit1; - QPushButton* PushButton2; - QLabel* TextLabel1; - QLineEdit* LineEdit2; - QPushButton* PushButton1; - QLabel* TextLabel2; - QSpinBox* SpinBox1; - QLabel* TextLabel3; - - -protected: - QGridLayout* GeometryGUI_2Sel1Spin_QTDLayout; - QGridLayout* GroupBox1Layout; - QGridLayout* Layout1; - QGridLayout* Layout2; -}; - -#endif // GEOMETRYGUI_2SEL1SPIN_QTD_H diff --git a/src/GEOMGUI/GeometryGUI_2Sel2Spin.cxx b/src/GEOMGUI/GeometryGUI_2Sel2Spin.cxx deleted file mode 100644 index 27a1c95a6..000000000 --- a/src/GEOMGUI/GeometryGUI_2Sel2Spin.cxx +++ /dev/null @@ -1,57 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_2Sel2Spin.cxx -// Author : Damien COQUERET -// Module : GEOM -// $Header: - -#include "GeometryGUI_2Sel2Spin.h" - -#include -#include -#include - -/* - * Constructs a GeometryGUI_2Sel1Spin which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' - */ -GeometryGUI_2Sel2Spin::GeometryGUI_2Sel2Spin(QWidget* parent, const char* name, WFlags fl) - :GeometryGUI_2Sel2Spin_QTD(parent, name, fl) -{ - SpinBox1->close(TRUE); - SpinBox2->close(TRUE); - SpinBox_DX = new GeometryGUI_SpinBox(GroupBox1, "SpinBox_DX"); - Layout2->addWidget(SpinBox_DX, 0, 1); - SpinBox_DY = new GeometryGUI_SpinBox(GroupBox1, "SpinBox_DY"); - Layout2->addWidget(SpinBox_DY, 1, 1); -} - - -/* - * Destroys the object and frees any allocated resources - */ -GeometryGUI_2Sel2Spin::~GeometryGUI_2Sel2Spin() -{ - // no need to delete child widgets, Qt does it all for us -} diff --git a/src/GEOMGUI/GeometryGUI_2Sel2Spin.h b/src/GEOMGUI/GeometryGUI_2Sel2Spin.h deleted file mode 100644 index ab8da718e..000000000 --- a/src/GEOMGUI/GeometryGUI_2Sel2Spin.h +++ /dev/null @@ -1,48 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_2Sel2Spin.h -// Author : Damien COQUERET -// Module : GEOM -// $Header: - -#ifndef GEOMETRYGUI_2SEL2SPIN_H -#define GEOMETRYGUI_2SEL2SPIN_H - -#include "GeometryGUI_2Sel2Spin_QTD.h" -#include "GeometryGUI_SpinBox.h" - -class GeometryGUI_2Sel2Spin : public GeometryGUI_2Sel2Spin_QTD -{ - Q_OBJECT - -public: - GeometryGUI_2Sel2Spin(QWidget* parent = 0, const char* name = 0, WFlags fl = 0); - ~GeometryGUI_2Sel2Spin(); - - GeometryGUI_SpinBox* SpinBox_DX; - GeometryGUI_SpinBox* SpinBox_DY; - -}; - -#endif // GEOMETRYGUI_2SEL2SPIN_H diff --git a/src/GEOMGUI/GeometryGUI_2Sel2Spin_QTD.cxx b/src/GEOMGUI/GeometryGUI_2Sel2Spin_QTD.cxx deleted file mode 100644 index 21b947185..000000000 --- a/src/GEOMGUI/GeometryGUI_2Sel2Spin_QTD.cxx +++ /dev/null @@ -1,116 +0,0 @@ -/**************************************************************************** -** Form implementation generated from reading ui file 'GeometryGUI_2Sel2Spin_QTD.ui' -** -** Created: jeu sep 25 12:10:29 2003 -** by: The User Interface Compiler (uic) -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ -#include "GeometryGUI_2Sel2Spin_QTD.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Constructs a GeometryGUI_2Sel2Spin_QTD which is a child of 'parent', with the - * name 'name' and widget flags set to 'f'. - */ -GeometryGUI_2Sel2Spin_QTD::GeometryGUI_2Sel2Spin_QTD( QWidget* parent, const char* name, WFlags fl ) - : QWidget( parent, name, fl ) -{ - if ( !name ) - setName( "GeometryGUI_2Sel2Spin_QTD" ); - resize( 129, 145 ); - setCaption( trUtf8( "GeometryGUI_2Sel2Spin_QTD" ) ); - GeometryGUI_2Sel2Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "GeometryGUI_2Sel2Spin_QTDLayout"); - - GroupBox1 = new QGroupBox( this, "GroupBox1" ); - GroupBox1->setTitle( trUtf8( "" ) ); - GroupBox1->setColumnLayout(0, Qt::Vertical ); - GroupBox1->layout()->setSpacing( 6 ); - GroupBox1->layout()->setMargin( 11 ); - GroupBox1Layout = new QGridLayout( GroupBox1->layout() ); - GroupBox1Layout->setAlignment( Qt::AlignTop ); - - Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1"); - - LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" ); - - Layout1->addWidget( LineEdit1, 0, 2 ); - - Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2"); - - SpinBox2 = new QSpinBox( GroupBox1, "SpinBox2" ); - SpinBox2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox2->sizePolicy().hasHeightForWidth() ) ); - - Layout2->addWidget( SpinBox2, 1, 1 ); - - TextLabel4 = new QLabel( GroupBox1, "TextLabel4" ); - TextLabel4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel4->sizePolicy().hasHeightForWidth() ) ); - TextLabel4->setText( trUtf8( "TL4" ) ); - - Layout2->addWidget( TextLabel4, 1, 0 ); - - TextLabel3 = new QLabel( GroupBox1, "TextLabel3" ); - TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) ); - TextLabel3->setText( trUtf8( "TL3" ) ); - - Layout2->addWidget( TextLabel3, 0, 0 ); - - SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" ); - SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) ); - - Layout2->addWidget( SpinBox1, 0, 1 ); - - Layout1->addMultiCellLayout( Layout2, 2, 2, 0, 2 ); - - PushButton2 = new QPushButton( GroupBox1, "PushButton2" ); - PushButton2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton2->sizePolicy().hasHeightForWidth() ) ); - PushButton2->setText( trUtf8( "" ) ); - - Layout1->addWidget( PushButton2, 1, 1 ); - - TextLabel2 = new QLabel( GroupBox1, "TextLabel2" ); - TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) ); - TextLabel2->setText( trUtf8( "TL2" ) ); - - Layout1->addWidget( TextLabel2, 1, 0 ); - QSpacerItem* spacer = new QSpacerItem( 0, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); - Layout1->addItem( spacer, 3, 2 ); - - TextLabel1 = new QLabel( GroupBox1, "TextLabel1" ); - TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) ); - TextLabel1->setText( trUtf8( "TL1" ) ); - - Layout1->addWidget( TextLabel1, 0, 0 ); - - PushButton1 = new QPushButton( GroupBox1, "PushButton1" ); - PushButton1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton1->sizePolicy().hasHeightForWidth() ) ); - PushButton1->setText( trUtf8( "" ) ); - - Layout1->addWidget( PushButton1, 0, 1 ); - - LineEdit2 = new QLineEdit( GroupBox1, "LineEdit2" ); - - Layout1->addWidget( LineEdit2, 1, 2 ); - - GroupBox1Layout->addLayout( Layout1, 0, 0 ); - - GeometryGUI_2Sel2Spin_QTDLayout->addWidget( GroupBox1, 0, 0 ); -} - -/* - * Destroys the object and frees any allocated resources - */ -GeometryGUI_2Sel2Spin_QTD::~GeometryGUI_2Sel2Spin_QTD() -{ - // no need to delete child widgets, Qt does it all for us -} - diff --git a/src/GEOMGUI/GeometryGUI_2Sel2Spin_QTD.h b/src/GEOMGUI/GeometryGUI_2Sel2Spin_QTD.h deleted file mode 100644 index 5a620ada9..000000000 --- a/src/GEOMGUI/GeometryGUI_2Sel2Spin_QTD.h +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** Form interface generated from reading ui file 'GeometryGUI_2Sel2Spin_QTD.ui' -** -** Created: jeu sep 25 12:10:29 2003 -** by: The User Interface Compiler (uic) -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ -#ifndef GEOMETRYGUI_2SEL2SPIN_QTD_H -#define GEOMETRYGUI_2SEL2SPIN_QTD_H - -#include -#include -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QSpinBox; - -class GeometryGUI_2Sel2Spin_QTD : public QWidget -{ - Q_OBJECT - -public: - GeometryGUI_2Sel2Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); - ~GeometryGUI_2Sel2Spin_QTD(); - - QGroupBox* GroupBox1; - QLineEdit* LineEdit1; - QSpinBox* SpinBox2; - QLabel* TextLabel4; - QLabel* TextLabel3; - QSpinBox* SpinBox1; - QPushButton* PushButton2; - QLabel* TextLabel2; - QLabel* TextLabel1; - QPushButton* PushButton1; - QLineEdit* LineEdit2; - - -protected: - QGridLayout* GeometryGUI_2Sel2Spin_QTDLayout; - QGridLayout* GroupBox1Layout; - QGridLayout* Layout1; - QGridLayout* Layout2; -}; - -#endif // GEOMETRYGUI_2SEL2SPIN_QTD_H diff --git a/src/GEOMGUI/GeometryGUI_2Sel3Spin.cxx b/src/GEOMGUI/GeometryGUI_2Sel3Spin.cxx deleted file mode 100644 index 6a5cfa9d7..000000000 --- a/src/GEOMGUI/GeometryGUI_2Sel3Spin.cxx +++ /dev/null @@ -1,60 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_2Sel3Spin.cxx -// Author : Damien COQUERET -// Module : GEOM -// $Header: - -#include "GeometryGUI_2Sel3Spin.h" - -#include -#include -#include - -/* - * Constructs a GeometryGUI_2Sel1Spin which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' - */ -GeometryGUI_2Sel3Spin::GeometryGUI_2Sel3Spin(QWidget* parent, const char* name, WFlags fl) - :GeometryGUI_2Sel3Spin_QTD(parent, name, fl) -{ - SpinBox1->close(TRUE); - SpinBox2->close(TRUE); - SpinBox3->close(TRUE); - SpinBox_DX = new GeometryGUI_SpinBox(GroupBox1, "SpinBox_DX"); - Layout2->addWidget(SpinBox_DX, 0, 1); - SpinBox_DY = new GeometryGUI_SpinBox(GroupBox1, "SpinBox_DY"); - Layout2->addWidget(SpinBox_DY, 1, 1); - SpinBox_DZ = new GeometryGUI_SpinBox(GroupBox1, "SpinBox_DZ"); - Layout2->addWidget(SpinBox_DZ, 2, 1); -} - - -/* - * Destroys the object and frees any allocated resources - */ -GeometryGUI_2Sel3Spin::~GeometryGUI_2Sel3Spin() -{ - // no need to delete child widgets, Qt does it all for us -} diff --git a/src/GEOMGUI/GeometryGUI_2Sel3Spin.h b/src/GEOMGUI/GeometryGUI_2Sel3Spin.h deleted file mode 100644 index a104b4f6b..000000000 --- a/src/GEOMGUI/GeometryGUI_2Sel3Spin.h +++ /dev/null @@ -1,49 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_2Sel3Spin.h -// Author : Damien COQUERET -// Module : GEOM -// $Header: - -#ifndef GEOMETRYGUI_2SEL3SPIN_H -#define GEOMETRYGUI_2SEL3SPIN_H - -#include "GeometryGUI_2Sel3Spin_QTD.h" -#include "GeometryGUI_SpinBox.h" - -class GeometryGUI_2Sel3Spin : public GeometryGUI_2Sel3Spin_QTD -{ - Q_OBJECT - -public: - GeometryGUI_2Sel3Spin(QWidget* parent = 0, const char* name = 0, WFlags fl = 0); - ~GeometryGUI_2Sel3Spin(); - - GeometryGUI_SpinBox* SpinBox_DX; - GeometryGUI_SpinBox* SpinBox_DY; - GeometryGUI_SpinBox* SpinBox_DZ; - -}; - -#endif // GEOMETRYGUI_2SEL3SPIN_H diff --git a/src/GEOMGUI/GeometryGUI_2Sel3Spin_QTD.cxx b/src/GEOMGUI/GeometryGUI_2Sel3Spin_QTD.cxx deleted file mode 100644 index d8778a631..000000000 --- a/src/GEOMGUI/GeometryGUI_2Sel3Spin_QTD.cxx +++ /dev/null @@ -1,127 +0,0 @@ -/**************************************************************************** -** Form implementation generated from reading ui file 'GeometryGUI_2Sel3Spin_QTD.ui' -** -** Created: jeu sep 25 16:18:43 2003 -** by: The User Interface Compiler (uic) -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ -#include "GeometryGUI_2Sel3Spin_QTD.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Constructs a GeometryGUI_2Sel3Spin_QTD which is a child of 'parent', with the - * name 'name' and widget flags set to 'f'. - */ -GeometryGUI_2Sel3Spin_QTD::GeometryGUI_2Sel3Spin_QTD( QWidget* parent, const char* name, WFlags fl ) - : QWidget( parent, name, fl ) -{ - if ( !name ) - setName( "GeometryGUI_2Sel3Spin_QTD" ); - resize( 129, 173 ); - setCaption( trUtf8( "GeometryGUI_2Sel3Spin_QTD" ) ); - GeometryGUI_2Sel3Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "GeometryGUI_2Sel3Spin_QTDLayout"); - - GroupBox1 = new QGroupBox( this, "GroupBox1" ); - GroupBox1->setTitle( trUtf8( "" ) ); - GroupBox1->setColumnLayout(0, Qt::Vertical ); - GroupBox1->layout()->setSpacing( 6 ); - GroupBox1->layout()->setMargin( 11 ); - GroupBox1Layout = new QGridLayout( GroupBox1->layout() ); - GroupBox1Layout->setAlignment( Qt::AlignTop ); - - Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1"); - - LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" ); - - Layout1->addWidget( LineEdit1, 0, 2 ); - - TextLabel1 = new QLabel( GroupBox1, "TextLabel1" ); - TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) ); - TextLabel1->setText( trUtf8( "TL1" ) ); - - Layout1->addWidget( TextLabel1, 0, 0 ); - - TextLabel2 = new QLabel( GroupBox1, "TextLabel2" ); - TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) ); - TextLabel2->setText( trUtf8( "TL2" ) ); - - Layout1->addWidget( TextLabel2, 1, 0 ); - - Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2"); - - TextLabel3 = new QLabel( GroupBox1, "TextLabel3" ); - TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) ); - TextLabel3->setText( trUtf8( "TL3" ) ); - - Layout2->addWidget( TextLabel3, 0, 0 ); - - SpinBox2 = new QSpinBox( GroupBox1, "SpinBox2" ); - SpinBox2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox2->sizePolicy().hasHeightForWidth() ) ); - - Layout2->addWidget( SpinBox2, 1, 1 ); - - TextLabel4 = new QLabel( GroupBox1, "TextLabel4" ); - TextLabel4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel4->sizePolicy().hasHeightForWidth() ) ); - TextLabel4->setText( trUtf8( "TL4" ) ); - - Layout2->addWidget( TextLabel4, 1, 0 ); - - TextLabel5 = new QLabel( GroupBox1, "TextLabel5" ); - TextLabel5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel5->sizePolicy().hasHeightForWidth() ) ); - TextLabel5->setText( trUtf8( "TL4" ) ); - - Layout2->addWidget( TextLabel5, 2, 0 ); - - SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" ); - SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) ); - - Layout2->addWidget( SpinBox1, 0, 1 ); - - SpinBox3 = new QSpinBox( GroupBox1, "SpinBox3" ); - SpinBox3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox3->sizePolicy().hasHeightForWidth() ) ); - - Layout2->addWidget( SpinBox3, 2, 1 ); - - Layout1->addMultiCellLayout( Layout2, 2, 2, 0, 2 ); - - PushButton1 = new QPushButton( GroupBox1, "PushButton1" ); - PushButton1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton1->sizePolicy().hasHeightForWidth() ) ); - PushButton1->setText( trUtf8( "" ) ); - - Layout1->addWidget( PushButton1, 0, 1 ); - QSpacerItem* spacer = new QSpacerItem( 0, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); - Layout1->addItem( spacer, 3, 2 ); - - LineEdit2 = new QLineEdit( GroupBox1, "LineEdit2" ); - - Layout1->addWidget( LineEdit2, 1, 2 ); - - PushButton2 = new QPushButton( GroupBox1, "PushButton2" ); - PushButton2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton2->sizePolicy().hasHeightForWidth() ) ); - PushButton2->setText( trUtf8( "" ) ); - - Layout1->addWidget( PushButton2, 1, 1 ); - - GroupBox1Layout->addLayout( Layout1, 0, 0 ); - - GeometryGUI_2Sel3Spin_QTDLayout->addWidget( GroupBox1, 0, 0 ); -} - -/* - * Destroys the object and frees any allocated resources - */ -GeometryGUI_2Sel3Spin_QTD::~GeometryGUI_2Sel3Spin_QTD() -{ - // no need to delete child widgets, Qt does it all for us -} - diff --git a/src/GEOMGUI/GeometryGUI_2Sel3Spin_QTD.h b/src/GEOMGUI/GeometryGUI_2Sel3Spin_QTD.h deleted file mode 100644 index 3821a7bfe..000000000 --- a/src/GEOMGUI/GeometryGUI_2Sel3Spin_QTD.h +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** Form interface generated from reading ui file 'GeometryGUI_2Sel3Spin_QTD.ui' -** -** Created: jeu sep 25 16:18:43 2003 -** by: The User Interface Compiler (uic) -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ -#ifndef GEOMETRYGUI_2SEL3SPIN_QTD_H -#define GEOMETRYGUI_2SEL3SPIN_QTD_H - -#include -#include -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QSpinBox; - -class GeometryGUI_2Sel3Spin_QTD : public QWidget -{ - Q_OBJECT - -public: - GeometryGUI_2Sel3Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); - ~GeometryGUI_2Sel3Spin_QTD(); - - QGroupBox* GroupBox1; - QLineEdit* LineEdit1; - QLabel* TextLabel1; - QLabel* TextLabel2; - QLabel* TextLabel3; - QSpinBox* SpinBox2; - QLabel* TextLabel4; - QLabel* TextLabel5; - QSpinBox* SpinBox1; - QSpinBox* SpinBox3; - QPushButton* PushButton1; - QLineEdit* LineEdit2; - QPushButton* PushButton2; - - -protected: - QGridLayout* GeometryGUI_2Sel3Spin_QTDLayout; - QGridLayout* GroupBox1Layout; - QGridLayout* Layout1; - QGridLayout* Layout2; -}; - -#endif // GEOMETRYGUI_2SEL3SPIN_QTD_H diff --git a/src/GEOMGUI/GeometryGUI_2Sel_QTD.cxx b/src/GEOMGUI/GeometryGUI_2Sel_QTD.cxx deleted file mode 100644 index 0e0f4c23e..000000000 --- a/src/GEOMGUI/GeometryGUI_2Sel_QTD.cxx +++ /dev/null @@ -1,90 +0,0 @@ -/**************************************************************************** -** Form implementation generated from reading ui file 'GeometryGUI_2Sel_QTD.ui' -** -** Created: mar sep 23 16:05:09 2003 -** by: The User Interface Compiler (uic) -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ -#include "GeometryGUI_2Sel_QTD.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Constructs a GeometryGUI_2Sel_QTD which is a child of 'parent', with the - * name 'name' and widget flags set to 'f'. - */ -GeometryGUI_2Sel_QTD::GeometryGUI_2Sel_QTD( QWidget* parent, const char* name, WFlags fl ) - : QWidget( parent, name, fl ) -{ - if ( !name ) - setName( "GeometryGUI_2Sel_QTD" ); - resize( 129, 87 ); - setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)7, 0, 0, sizePolicy().hasHeightForWidth() ) ); - setCaption( trUtf8( "GeometryGUI_2Sel_QTD" ) ); - GeometryGUI_2Sel_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "GeometryGUI_2Sel_QTDLayout"); - - GroupBox1 = new QGroupBox( this, "GroupBox1" ); - GroupBox1->setTitle( trUtf8( "" ) ); - GroupBox1->setColumnLayout(0, Qt::Vertical ); - GroupBox1->layout()->setSpacing( 6 ); - GroupBox1->layout()->setMargin( 11 ); - GroupBox1Layout = new QGridLayout( GroupBox1->layout() ); - GroupBox1Layout->setAlignment( Qt::AlignTop ); - - Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1"); - - PushButton1 = new QPushButton( GroupBox1, "PushButton1" ); - PushButton1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton1->sizePolicy().hasHeightForWidth() ) ); - PushButton1->setText( trUtf8( "" ) ); - - Layout1->addWidget( PushButton1, 0, 1 ); - QSpacerItem* spacer = new QSpacerItem( 0, 16, QSizePolicy::Minimum, QSizePolicy::Expanding ); - Layout1->addItem( spacer, 2, 2 ); - - LineEdit2 = new QLineEdit( GroupBox1, "LineEdit2" ); - - Layout1->addWidget( LineEdit2, 1, 2 ); - - PushButton2 = new QPushButton( GroupBox1, "PushButton2" ); - PushButton2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton2->sizePolicy().hasHeightForWidth() ) ); - PushButton2->setText( trUtf8( "" ) ); - - Layout1->addWidget( PushButton2, 1, 1 ); - - TextLabel1 = new QLabel( GroupBox1, "TextLabel1" ); - TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) ); - TextLabel1->setText( trUtf8( "TL1" ) ); - - Layout1->addWidget( TextLabel1, 0, 0 ); - - TextLabel2 = new QLabel( GroupBox1, "TextLabel2" ); - TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) ); - TextLabel2->setText( trUtf8( "TL2" ) ); - - Layout1->addWidget( TextLabel2, 1, 0 ); - - LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" ); - - Layout1->addWidget( LineEdit1, 0, 2 ); - - GroupBox1Layout->addLayout( Layout1, 0, 0 ); - - GeometryGUI_2Sel_QTDLayout->addWidget( GroupBox1, 0, 0 ); -} - -/* - * Destroys the object and frees any allocated resources - */ -GeometryGUI_2Sel_QTD::~GeometryGUI_2Sel_QTD() -{ - // no need to delete child widgets, Qt does it all for us -} - diff --git a/src/GEOMGUI/GeometryGUI_2Sel_QTD.h b/src/GEOMGUI/GeometryGUI_2Sel_QTD.h deleted file mode 100644 index 95e04bfbd..000000000 --- a/src/GEOMGUI/GeometryGUI_2Sel_QTD.h +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** -** Form interface generated from reading ui file 'GeometryGUI_2Sel_QTD.ui' -** -** Created: mar sep 23 16:05:09 2003 -** by: The User Interface Compiler (uic) -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ -#ifndef GEOMETRYGUI_2SEL_QTD_H -#define GEOMETRYGUI_2SEL_QTD_H - -#include -#include -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; - -class GeometryGUI_2Sel_QTD : public QWidget -{ - Q_OBJECT - -public: - GeometryGUI_2Sel_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); - ~GeometryGUI_2Sel_QTD(); - - QGroupBox* GroupBox1; - QPushButton* PushButton1; - QLineEdit* LineEdit2; - QPushButton* PushButton2; - QLabel* TextLabel1; - QLabel* TextLabel2; - QLineEdit* LineEdit1; - - -protected: - QGridLayout* GeometryGUI_2Sel_QTDLayout; - QGridLayout* GroupBox1Layout; - QGridLayout* Layout1; -}; - -#endif // GEOMETRYGUI_2SEL_QTD_H diff --git a/src/GEOMGUI/GeometryGUI_2Spin.cxx b/src/GEOMGUI/GeometryGUI_2Spin.cxx deleted file mode 100644 index 5ec679f6b..000000000 --- a/src/GEOMGUI/GeometryGUI_2Spin.cxx +++ /dev/null @@ -1,60 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_2Spin.cxx -// Author : Damien COQUERET -// Module : GEOM -// $Header: - -#include "GeometryGUI_2Spin.h" - -#include -#include -#include - -/* - * Constructs a GeometryGUI_2Spin which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' - */ -GeometryGUI_2Spin::GeometryGUI_2Spin(QWidget* parent, const char* name, WFlags fl) - :GeometryGUI_2Spin_QTD(parent, name, fl) -{ - SpinBox1->close(TRUE); - SpinBox2->close(TRUE); - - SpinBox_DX = new GeometryGUI_SpinBox(GroupBox1, "SpinBox_DX"); - Layout1->addWidget(SpinBox_DX, 0, 1); - - SpinBox_DY = new GeometryGUI_SpinBox(GroupBox1, "SpinBox_DY"); - Layout1->addWidget(SpinBox_DY, 1, 1); - -} - - -/* - * Destroys the object and frees any allocated resources - */ -GeometryGUI_2Spin::~GeometryGUI_2Spin() -{ - // no need to delete child widgets, Qt does it all for us -} diff --git a/src/GEOMGUI/GeometryGUI_2Spin.h b/src/GEOMGUI/GeometryGUI_2Spin.h deleted file mode 100644 index c01348aeb..000000000 --- a/src/GEOMGUI/GeometryGUI_2Spin.h +++ /dev/null @@ -1,48 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_2Spin.h -// Author : Damien COQUERET -// Module : GEOM -// $Header: - -#ifndef GEOMETRYGUI_2SPIN_H -#define GEOMETRYGUI_2SPIN_H - -#include "GeometryGUI_2Spin_QTD.h" -#include "GeometryGUI_SpinBox.h" - -class GeometryGUI_2Spin : public GeometryGUI_2Spin_QTD -{ - Q_OBJECT - -public: - GeometryGUI_2Spin(QWidget* parent = 0, const char* name = 0, WFlags fl = 0); - ~GeometryGUI_2Spin(); - - GeometryGUI_SpinBox* SpinBox_DX; - GeometryGUI_SpinBox* SpinBox_DY; - -}; - -#endif // GEOMETRYGUI_2SPIN_H diff --git a/src/GEOMGUI/GeometryGUI_2Spin_QTD.cxx b/src/GEOMGUI/GeometryGUI_2Spin_QTD.cxx deleted file mode 100644 index 95c966afe..000000000 --- a/src/GEOMGUI/GeometryGUI_2Spin_QTD.cxx +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** Form implementation generated from reading ui file 'GeometryGUI_2Spin_QTD.ui' -** -** Created: jeu sep 25 12:10:30 2003 -** by: The User Interface Compiler (uic) -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ -#include "GeometryGUI_2Spin_QTD.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Constructs a GeometryGUI_2Spin_QTD which is a child of 'parent', with the - * name 'name' and widget flags set to 'f'. - */ -GeometryGUI_2Spin_QTD::GeometryGUI_2Spin_QTD( QWidget* parent, const char* name, WFlags fl ) - : QWidget( parent, name, fl ) -{ - if ( !name ) - setName( "GeometryGUI_2Spin_QTD" ); - resize( 124, 83 ); - setCaption( trUtf8( "GeometryGUI_2Spin_QTD" ) ); - GeometryGUI_2Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "GeometryGUI_2Spin_QTDLayout"); - - GroupBox1 = new QGroupBox( this, "GroupBox1" ); - GroupBox1->setTitle( trUtf8( "" ) ); - GroupBox1->setColumnLayout(0, Qt::Vertical ); - GroupBox1->layout()->setSpacing( 6 ); - GroupBox1->layout()->setMargin( 11 ); - GroupBox1Layout = new QGridLayout( GroupBox1->layout() ); - GroupBox1Layout->setAlignment( Qt::AlignTop ); - - Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1"); - - SpinBox2 = new QSpinBox( GroupBox1, "SpinBox2" ); - SpinBox2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox2->sizePolicy().hasHeightForWidth() ) ); - - Layout1->addWidget( SpinBox2, 1, 1 ); - QSpacerItem* spacer = new QSpacerItem( 0, 16, QSizePolicy::Minimum, QSizePolicy::Expanding ); - Layout1->addItem( spacer, 3, 1 ); - - SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" ); - SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) ); - - Layout1->addWidget( SpinBox1, 0, 1 ); - - TextLabel1 = new QLabel( GroupBox1, "TextLabel1" ); - TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) ); - TextLabel1->setText( trUtf8( "TL1" ) ); - - Layout1->addWidget( TextLabel1, 0, 0 ); - - TextLabel2 = new QLabel( GroupBox1, "TextLabel2" ); - TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) ); - TextLabel2->setText( trUtf8( "TL2" ) ); - - Layout1->addWidget( TextLabel2, 1, 0 ); - - GroupBox1Layout->addLayout( Layout1, 0, 0 ); - - GeometryGUI_2Spin_QTDLayout->addWidget( GroupBox1, 0, 0 ); -} - -/* - * Destroys the object and frees any allocated resources - */ -GeometryGUI_2Spin_QTD::~GeometryGUI_2Spin_QTD() -{ - // no need to delete child widgets, Qt does it all for us -} - diff --git a/src/GEOMGUI/GeometryGUI_2Spin_QTD.h b/src/GEOMGUI/GeometryGUI_2Spin_QTD.h deleted file mode 100644 index 9ade2f2fa..000000000 --- a/src/GEOMGUI/GeometryGUI_2Spin_QTD.h +++ /dev/null @@ -1,42 +0,0 @@ -/**************************************************************************** -** Form interface generated from reading ui file 'GeometryGUI_2Spin_QTD.ui' -** -** Created: jeu sep 25 12:10:30 2003 -** by: The User Interface Compiler (uic) -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ -#ifndef GEOMETRYGUI_2SPIN_QTD_H -#define GEOMETRYGUI_2SPIN_QTD_H - -#include -#include -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QGroupBox; -class QLabel; -class QSpinBox; - -class GeometryGUI_2Spin_QTD : public QWidget -{ - Q_OBJECT - -public: - GeometryGUI_2Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); - ~GeometryGUI_2Spin_QTD(); - - QGroupBox* GroupBox1; - QSpinBox* SpinBox2; - QSpinBox* SpinBox1; - QLabel* TextLabel1; - QLabel* TextLabel2; - - -protected: - QGridLayout* GeometryGUI_2Spin_QTDLayout; - QGridLayout* GroupBox1Layout; - QGridLayout* Layout1; -}; - -#endif // GEOMETRYGUI_2SPIN_QTD_H diff --git a/src/GEOMGUI/GeometryGUI_3Spin.cxx b/src/GEOMGUI/GeometryGUI_3Spin.cxx deleted file mode 100644 index ba44a7f2a..000000000 --- a/src/GEOMGUI/GeometryGUI_3Spin.cxx +++ /dev/null @@ -1,63 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_3Spin.cxx -// Author : Damien COQUERET -// Module : GEOM -// $Header: - -#include "GeometryGUI_3Spin.h" - -#include -#include -#include - -/* - * Constructs a GeometryGUI_3Spin which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' - */ -GeometryGUI_3Spin::GeometryGUI_3Spin(QWidget* parent, const char* name, WFlags fl) - :GeometryGUI_3Spin_QTD(parent, name, fl) -{ - SpinBox1->close(TRUE); - SpinBox2->close(TRUE); - SpinBox3->close(TRUE); - - SpinBox_DX = new GeometryGUI_SpinBox(GroupBox1, "SpinBox_DX"); - Layout1->addWidget(SpinBox_DX, 0, 1); - - SpinBox_DY = new GeometryGUI_SpinBox(GroupBox1, "SpinBox_DY"); - Layout1->addWidget(SpinBox_DY, 1, 1); - - SpinBox_DZ = new GeometryGUI_SpinBox(GroupBox1, "SpinBox_DZ"); - Layout1->addWidget(SpinBox_DZ, 2, 1); -} - - -/* - * Destroys the object and frees any allocated resources - */ -GeometryGUI_3Spin::~GeometryGUI_3Spin() -{ - // no need to delete child widgets, Qt does it all for us -} diff --git a/src/GEOMGUI/GeometryGUI_3Spin.h b/src/GEOMGUI/GeometryGUI_3Spin.h deleted file mode 100644 index 6407f4861..000000000 --- a/src/GEOMGUI/GeometryGUI_3Spin.h +++ /dev/null @@ -1,49 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_3Spin.h -// Author : Damien COQUERET -// Module : GEOM -// $Header: - -#ifndef GEOMETRYGUI_3SPIN_H -#define GEOMETRYGUI_3SPIN_H - -#include "GeometryGUI_3Spin_QTD.h" -#include "GeometryGUI_SpinBox.h" - -class GeometryGUI_3Spin : public GeometryGUI_3Spin_QTD -{ - Q_OBJECT - -public: - GeometryGUI_3Spin( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); - ~GeometryGUI_3Spin(); - - GeometryGUI_SpinBox* SpinBox_DX; - GeometryGUI_SpinBox* SpinBox_DY; - GeometryGUI_SpinBox* SpinBox_DZ; - -}; - -#endif // GEOMETRYGUI_3SPIN_H diff --git a/src/GEOMGUI/GeometryGUI_3Spin_QTD.cxx b/src/GEOMGUI/GeometryGUI_3Spin_QTD.cxx deleted file mode 100644 index 472015dbc..000000000 --- a/src/GEOMGUI/GeometryGUI_3Spin_QTD.cxx +++ /dev/null @@ -1,90 +0,0 @@ -/**************************************************************************** -** Form implementation generated from reading ui file 'GeometryGUI_3Spin_QTD.ui' -** -** Created: mar sep 23 16:05:10 2003 -** by: The User Interface Compiler (uic) -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ -#include "GeometryGUI_3Spin_QTD.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Constructs a GeometryGUI_3Spin_QTD which is a child of 'parent', with the - * name 'name' and widget flags set to 'f'. - */ -GeometryGUI_3Spin_QTD::GeometryGUI_3Spin_QTD( QWidget* parent, const char* name, WFlags fl ) - : QWidget( parent, name, fl ) -{ - if ( !name ) - setName( "GeometryGUI_3Spin_QTD" ); - resize( 124, 111 ); - setCaption( trUtf8( "GeometryGUI_3Spin_QTD" ) ); - GeometryGUI_3Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "GeometryGUI_3Spin_QTDLayout"); - - GroupBox1 = new QGroupBox( this, "GroupBox1" ); - GroupBox1->setTitle( trUtf8( "" ) ); - GroupBox1->setColumnLayout(0, Qt::Vertical ); - GroupBox1->layout()->setSpacing( 6 ); - GroupBox1->layout()->setMargin( 11 ); - GroupBox1Layout = new QGridLayout( GroupBox1->layout() ); - GroupBox1Layout->setAlignment( Qt::AlignTop ); - - Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1"); - - SpinBox2 = new QSpinBox( GroupBox1, "SpinBox2" ); - SpinBox2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox2->sizePolicy().hasHeightForWidth() ) ); - - Layout1->addWidget( SpinBox2, 1, 1 ); - QSpacerItem* spacer = new QSpacerItem( 0, 16, QSizePolicy::Minimum, QSizePolicy::Expanding ); - Layout1->addItem( spacer, 3, 1 ); - - TextLabel3 = new QLabel( GroupBox1, "TextLabel3" ); - TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) ); - TextLabel3->setText( trUtf8( "TL3" ) ); - - Layout1->addWidget( TextLabel3, 2, 0 ); - - SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" ); - SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) ); - - Layout1->addWidget( SpinBox1, 0, 1 ); - - SpinBox3 = new QSpinBox( GroupBox1, "SpinBox3" ); - SpinBox3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox3->sizePolicy().hasHeightForWidth() ) ); - - Layout1->addWidget( SpinBox3, 2, 1 ); - - TextLabel1 = new QLabel( GroupBox1, "TextLabel1" ); - TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) ); - TextLabel1->setText( trUtf8( "TL1" ) ); - - Layout1->addWidget( TextLabel1, 0, 0 ); - - TextLabel2 = new QLabel( GroupBox1, "TextLabel2" ); - TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) ); - TextLabel2->setText( trUtf8( "TL2" ) ); - - Layout1->addWidget( TextLabel2, 1, 0 ); - - GroupBox1Layout->addLayout( Layout1, 0, 0 ); - - GeometryGUI_3Spin_QTDLayout->addWidget( GroupBox1, 0, 0 ); -} - -/* - * Destroys the object and frees any allocated resources - */ -GeometryGUI_3Spin_QTD::~GeometryGUI_3Spin_QTD() -{ - // no need to delete child widgets, Qt does it all for us -} - diff --git a/src/GEOMGUI/GeometryGUI_3Spin_QTD.h b/src/GEOMGUI/GeometryGUI_3Spin_QTD.h deleted file mode 100644 index 18dc38960..000000000 --- a/src/GEOMGUI/GeometryGUI_3Spin_QTD.h +++ /dev/null @@ -1,44 +0,0 @@ -/**************************************************************************** -** Form interface generated from reading ui file 'GeometryGUI_3Spin_QTD.ui' -** -** Created: mar sep 23 16:05:09 2003 -** by: The User Interface Compiler (uic) -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ -#ifndef GEOMETRYGUI_3SPIN_QTD_H -#define GEOMETRYGUI_3SPIN_QTD_H - -#include -#include -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QGroupBox; -class QLabel; -class QSpinBox; - -class GeometryGUI_3Spin_QTD : public QWidget -{ - Q_OBJECT - -public: - GeometryGUI_3Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); - ~GeometryGUI_3Spin_QTD(); - - QGroupBox* GroupBox1; - QSpinBox* SpinBox2; - QLabel* TextLabel3; - QSpinBox* SpinBox1; - QSpinBox* SpinBox3; - QLabel* TextLabel1; - QLabel* TextLabel2; - - -protected: - QGridLayout* GeometryGUI_3Spin_QTDLayout; - QGridLayout* GroupBox1Layout; - QGridLayout* Layout1; -}; - -#endif // GEOMETRYGUI_3SPIN_QTD_H diff --git a/src/GEOMGUI/GeometryGUI_ArcDlg.cxx b/src/GEOMGUI/GeometryGUI_ArcDlg.cxx deleted file mode 100644 index cd536c58c..000000000 --- a/src/GEOMGUI/GeometryGUI_ArcDlg.cxx +++ /dev/null @@ -1,507 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_ArcDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_ArcDlg.h" - -#include "GeometryGUI.h" -#include "QAD_Application.h" -#include "QAD_Desktop.h" -#include "QAD_Tools.h" -#include "utilities.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -//================================================================================= -// class : GeometryGUI_ArcDlg() -// purpose : Constructs a GeometryGUI_ArcDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_ArcDlg::GeometryGUI_ArcDlg( QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_ARC"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - - if ( !name ) - setName( "GeometryGUI_ArcDlg" ); - resize( 303, 251 ); - setCaption( tr( "GEOM_ARC_TITLE" ) ); - setSizeGripEnabled( TRUE ); - GeometryGUI_ArcDlgLayout = new QGridLayout( this ); - GeometryGUI_ArcDlgLayout->setSpacing( 6 ); - GeometryGUI_ArcDlgLayout->setMargin( 11 ); - - /***************************************************************/ - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "GEOM_ARC" ) ); - GroupConstructors->setExclusive( TRUE ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setText( tr( "" ) ); - Constructor1->setPixmap( image0 ); - Constructor1->setChecked( TRUE ); - Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) ); - Constructor1->setMinimumSize( QSize( 50, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer, 0, 1 ); - GeometryGUI_ArcDlgLayout->addWidget( GroupConstructors, 0, 0 ); - - /***************************************************************/ - GroupC1 = new QGroupBox( this, "GroupC1" ); - GroupC1->setTitle( tr( "GEOM_POINTS" ) ); - GroupC1->setFrameShape( QGroupBox::Box ); - GroupC1->setFrameShadow( QGroupBox::Sunken ); - GroupC1->setColumnLayout(0, Qt::Vertical ); - GroupC1->layout()->setSpacing( 0 ); - GroupC1->layout()->setMargin( 0 ); - GroupC1Layout = new QGridLayout( GroupC1->layout() ); - GroupC1Layout->setAlignment( Qt::AlignTop ); - GroupC1Layout->setSpacing( 6 ); - GroupC1Layout->setMargin( 11 ); - TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" ); - TextLabelC1A1->setText( tr( "GEOM_POINT_I" ).arg( "1" ) ); - TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A1->setFrameShape( QLabel::NoFrame ); - TextLabelC1A1->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabelC1A1, 0, 0 ); - SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" ); - SelectButtonC1A1->setText( tr( "" ) ); - SelectButtonC1A1->setPixmap( image1 ); - SelectButtonC1A1->setToggleButton( FALSE ); - GroupC1Layout->addWidget( SelectButtonC1A1, 0, 1 ); - LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" ); - GroupC1Layout->addWidget( LineEditC1A1, 0, 2 ); - TextLabelC1A2 = new QLabel( GroupC1, "TextLabelC1A2" ); - TextLabelC1A2->setText( tr( "GEOM_POINT_I" ).arg( "2" ) ); - TextLabelC1A2->setMinimumSize( QSize( 50, 0 ) ); - GroupC1Layout->addWidget( TextLabelC1A2, 1, 0 ); - SelectButtonC1A2 = new QPushButton( GroupC1, "SelectButtonC1A2" ); - SelectButtonC1A2->setText( tr( "" ) ); - SelectButtonC1A2->setPixmap( image1 ); - GroupC1Layout->addWidget( SelectButtonC1A2, 1, 1 ); - LineEditC1A2 = new QLineEdit( GroupC1, "LineEditC1A2" ); - GroupC1Layout->addWidget( LineEditC1A2, 1, 2 ); - TextLabelC1A3 = new QLabel( GroupC1, "TextLabelC1A3" ); - TextLabelC1A3->setText( tr( "GEOM_POINT_I" ).arg( "3" ) ); - TextLabelC1A3->setMinimumSize( QSize( 50, 0 ) ); - GroupC1Layout->addWidget( TextLabelC1A3, 2, 0 ); - SelectButtonC1A3 = new QPushButton( GroupC1, "SelectButtonC1A3" ); - SelectButtonC1A3->setText( tr( "" ) ); - SelectButtonC1A3->setPixmap( image1 ); - GroupC1Layout->addWidget( SelectButtonC1A3, 2, 1 ); - LineEditC1A3 = new QLineEdit( GroupC1, "LineEditC1A3" ); - GroupC1Layout->addWidget( LineEditC1A3, 2, 2 ); - GeometryGUI_ArcDlgLayout->addWidget( GroupC1, 1, 0 ); - /***************************************************************/ - - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); - GroupButtons->setTitle( tr( "" ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 3 ); - buttonApply = new QPushButton( GroupButtons, "buttonApply" ); - buttonApply->setText( tr( "GEOM_BUT_APPLY" ) ); - buttonApply->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonApply, 0, 1 ); - QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_9, 0, 2 ); - buttonOk = new QPushButton( GroupButtons, "buttonOk" ); - buttonOk->setText( tr( "GEOM_BUT_OK" ) ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - GeometryGUI_ArcDlgLayout->addWidget( GroupButtons, 2, 0 ); - /***************************************************************/ - - Init(Sel) ; /* Initialisations */ - - /* Move widget on the botton right corner of main widget */ - QAD_Tools::alignWidget(this, parent, AlignBottom | AlignRight); - /* Display Dialog */ - this->show() ; -} - - -//================================================================================= -// function : ~GeometryGUI_ArcDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_ArcDlg::~GeometryGUI_ArcDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_ArcDlg::Init( SALOME_Selection* Sel ) -{ - - GroupC1->show(); - myConstructorId = 0 ; - Constructor1->setChecked( TRUE ); - myEditCurrentArgument = LineEditC1A1 ; - mySelection = Sel; - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - myOkPoint1 = myOkPoint2 = myOkPoint3 = false ; - mySimulationTopoDs.Nullify() ; - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - - // TODO : previous selection into argument ? - - /* Filter definitions */ - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - myVertexFilter = new GEOM_ShapeTypeFilter( TopAbs_VERTEX, myGeom ); - mySelection->AddFilter(myVertexFilter) ; - - /* signals and slots connections */ - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ; - connect( buttonApply, SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) ); - connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) ); - connect( SelectButtonC1A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( SelectButtonC1A2, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( SelectButtonC1A3, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - - connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ; - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - /* to close dialog if study change */ - connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ; -} - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_ArcDlg::ConstructorsClicked(int constructorId) -{ - /* only a constructor now */ - return ; -} - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_ArcDlg::ClickOnOk() -{ - this->ClickOnApply() ; - this->ClickOnCancel() ; - - return ; -} - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_ArcDlg::ClickOnApply() -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - myGeomGUI->GetDesktop()->putInfo( tr("") ) ; - switch(myConstructorId) - { - case 0 : - { - if(myOkPoint1 && myOkPoint2 && myOkPoint3 ) { - myGeomGUI->MakeArcAndDisplay( myPoint1, myPoint2, myPoint3 ) ; - } - break ; - } - } - // accept(); - return ; -} - - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void GeometryGUI_ArcDlg::ClickOnCancel() -{ - mySelection->ClearFilters() ; - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->ResetState() ; - reject() ; - return ; -} - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -//================================================================================= -void GeometryGUI_ArcDlg::SelectionIntoArgument() -{ - myEditCurrentArgument->setText("") ; - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - - QString aString = ""; /* name of future selection */ - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; - if ( nbSel != 1 ) { - if ( myEditCurrentArgument == LineEditC1A1 ) { - myEditCurrentArgument->setText("") ; - myOkPoint1 = false ; - } - else if ( myEditCurrentArgument == LineEditC1A2 ) { - myEditCurrentArgument->setText("") ; - myOkPoint2 = false ; - } - else if ( myEditCurrentArgument == LineEditC1A3 ) { - myEditCurrentArgument->setText("") ; - myOkPoint3 = false ; - } - return ; - } - - // nbSel == 1 ! - TopoDS_Shape S; - if( !myGeomGUI->GetTopoFromSelection(mySelection, S) ) - return ; - - if ( myEditCurrentArgument == LineEditC1A1 && myGeomGUI->VertexToPoint( S, this->myPoint1 ) ) { - myEditCurrentArgument->setText(aString) ; - myOkPoint1 = true ; - } - else if ( myEditCurrentArgument == LineEditC1A2 && myGeomGUI->VertexToPoint( S, this->myPoint2 ) ) { - myEditCurrentArgument->setText(aString) ; - myOkPoint2 = true ; - } - else if ( myEditCurrentArgument == LineEditC1A3 && myGeomGUI->VertexToPoint( S, this->myPoint3 ) ) { - myEditCurrentArgument->setText(aString) ; - myOkPoint3 = true ; - } - - /* Simulation */ - if( myOkPoint1 && myOkPoint2 && myOkPoint3 ) { - this->MakeArcSimulationAndDisplay() ; - } - - return ; -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_ArcDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - switch (myConstructorId) - { - case 0: /* default constructor */ - { - mySelection->AddFilter(myVertexFilter) ; - if(send == SelectButtonC1A1) { - LineEditC1A1->setFocus() ; - myEditCurrentArgument = LineEditC1A1; - } - else if(send == SelectButtonC1A2) { - LineEditC1A2->setFocus() ; - myEditCurrentArgument = LineEditC1A2; - } - else if(send == SelectButtonC1A3) { - LineEditC1A3->setFocus() ; - myEditCurrentArgument = LineEditC1A3; - } - SelectionIntoArgument() ; - break; - } - } -} - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_ArcDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if( send == LineEditC1A1 ) - myEditCurrentArgument = LineEditC1A1 ; - else if ( send == LineEditC1A2 ) - myEditCurrentArgument = LineEditC1A2 ; - else if ( send == LineEditC1A3 ) - myEditCurrentArgument = LineEditC1A3 ; - else - return ; - - /* User name of object input management */ - /* If successfull the selection is changed and signal emitted... */ - /* so SelectionIntoArgument() is automatically called. */ - const QString objectUserName = myEditCurrentArgument->text() ; - QWidget* thisWidget = (QWidget*)this ; - if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) { - myEditCurrentArgument->setText( objectUserName ) ; - } - return ; -} - - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void GeometryGUI_ArcDlg::DeactivateActiveDialog() -{ - if ( GroupConstructors->isEnabled() ) { - GroupConstructors->setEnabled(false) ; - GroupC1->setEnabled(false) ; - GroupButtons->setEnabled(false) ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->EraseSimulationShape() ; - mySelection->ClearFilters() ; - } - return ; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_ArcDlg::ActivateThisDialog() -{ - /* Emit a signal to deactivate the active dialog */ - myGeomGUI->EmitSignalDeactivateDialog() ; - GroupConstructors->setEnabled(true) ; - GroupC1->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - if( !mySimulationTopoDs.IsNull() ) - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - return ; -} - - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void GeometryGUI_ArcDlg::enterEvent(QEvent* e) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; - return ; -} - - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_ArcDlg::closeEvent( QCloseEvent* e ) -{ - /* same than click on cancel button */ - this->ClickOnCancel() ; - return ; -} - - -//================================================================================= -// function : MakeArcSimulationAndDisplay() -// purpose : -//================================================================================= -void GeometryGUI_ArcDlg::MakeArcSimulationAndDisplay() -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - try { - if ( myPoint2.IsEqual( myPoint1, Precision::Confusion() ) ) { - myEditCurrentArgument->setText("") ; - return; - } - if ( myPoint2.IsEqual( myPoint3, Precision::Confusion() ) ) { - myEditCurrentArgument->setText("") ; - return; - } - - gp_Vec v1( this->myPoint2, this->myPoint1 ) ; - gp_Vec v2( this->myPoint2, this->myPoint3 ) ; - if( v1.IsParallel(v2, Precision::Angular() ) ) { - myEditCurrentArgument->setText("") ; - return ; - } - - GC_MakeArcOfCircle Arc( this->myPoint1, this->myPoint2, this->myPoint3 ); - if ( Arc.IsDone() ) { - Handle(Geom_TrimmedCurve) curve = Arc.Value() ; - mySimulationTopoDs = BRepBuilderAPI_MakeEdge(curve).Shape() ; - myGeomGUI->DisplaySimulationShape(mySimulationTopoDs) ; - } - } - catch(Standard_Failure) { - MESSAGE( "Exception catched in MakeArcSimulationAndDisplay" ) ; - } - return ; -} diff --git a/src/GEOMGUI/GeometryGUI_ArcDlg.h b/src/GEOMGUI/GeometryGUI_ArcDlg.h deleted file mode 100644 index 40384fee5..000000000 --- a/src/GEOMGUI/GeometryGUI_ArcDlg.h +++ /dev/null @@ -1,125 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_ArcDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_ARC_H -#define DIALOGBOX_ARC_H - -#include "SALOME_Selection.h" -#include "GEOM_ShapeTypeFilter.hxx" - -#include -#include -#include -#include -#include - -#include -#include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QRadioButton; -class GeometryGUI; - -//================================================================================= -// class : GeometryGUI_ArcDlg -// purpose : -//================================================================================= -class GeometryGUI_ArcDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_ArcDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 ); - ~GeometryGUI_ArcDlg(); - -private : - - GEOM::GEOM_Gen_var myGeom ; /* Current Geom object */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - SALOME_Selection* mySelection ; /* User shape selection */ - TopoDS_Shape mySimulationTopoDs; /* Shape used for simulation display */ - gp_Pnt myPoint1 ; - gp_Pnt myPoint2 ; - gp_Pnt myPoint3; - - bool myOkPoint1 ; - bool myOkPoint2; - bool myOkPoint3; - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - int myConstructorId ; /* Current constructor id = radio button id */ - Handle(GEOM_ShapeTypeFilter) myVertexFilter ; /* Filter selection */ - - void closeEvent( QCloseEvent* e ) ; - void enterEvent( QEvent* e); - void Init( SALOME_Selection* Sel ) ; - void MakeArcSimulationAndDisplay() ; - - QButtonGroup* GroupConstructors; - QRadioButton* Constructor1; - QGroupBox* GroupButtons; - QPushButton* buttonOk; - QPushButton* buttonCancel; - QPushButton* buttonApply; - QGroupBox* GroupC1; - QLineEdit* LineEditC1A1; - QPushButton* SelectButtonC1A1; - QLabel* TextLabelC1A1; - QLabel* TextLabelC1A2; - QPushButton* SelectButtonC1A2; - QLineEdit* LineEditC1A2; - QLabel* TextLabelC1A3; - QPushButton* SelectButtonC1A3; - QLineEdit* LineEditC1A3; - -private slots: - - void ConstructorsClicked(int constructorId); - void ClickOnOk(); - void ClickOnCancel(); - void ClickOnApply(); - void SetEditCurrentArgument() ; - void SelectionIntoArgument() ; - void DeactivateActiveDialog() ; - void LineEditReturnPressed() ; - void ActivateThisDialog() ; - -protected: - QGridLayout* GeometryGUI_ArcDlgLayout; - QGridLayout* GroupConstructorsLayout; - QGridLayout* GroupButtonsLayout; - QGridLayout* GroupC1Layout; -}; - -#endif // DIALOGBOX_ARC_H diff --git a/src/GEOMGUI/GeometryGUI_ArchimedeDlg.cxx b/src/GEOMGUI/GeometryGUI_ArchimedeDlg.cxx deleted file mode 100644 index 61159318f..000000000 --- a/src/GEOMGUI/GeometryGUI_ArchimedeDlg.cxx +++ /dev/null @@ -1,470 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_ArchimedeDlg.cxx -// Author : Nicolas REJNERI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_ArchimedeDlg.h" - -#include "GeometryGUI.h" -#include "QAD_Application.h" -#include "QAD_Desktop.h" -#include "QAD_Tools.h" -#include "utilities.h" - -#include "SALOME_InteractiveObject.hxx" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -//================================================================================= -// class : GeometryGUI_ArchimedeDlg() -// purpose : Constructs a GeometryGUI_ArchimedeDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_ArchimedeDlg::GeometryGUI_ArchimedeDlg( QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_ARCHIMEDE"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - - if ( !name ) - setName( "GeometryGUI_ArchimedeDlg" ); - resize( 303, 219 ); - setCaption( tr( "GEOM_ARCHIMEDE_TITLE" ) ); - setSizeGripEnabled( TRUE ); - GeometryGUI_ArchimedeDlgLayout = new QGridLayout( this ); - GeometryGUI_ArchimedeDlgLayout->setSpacing( 6 ); - GeometryGUI_ArchimedeDlgLayout->setMargin( 11 ); - - /***************************************************************/ - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "GEOM_ARCHIMEDE" ) ); - GroupConstructors->setExclusive( TRUE ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setText( tr( "" ) ); - Constructor1->setPixmap( image0 ); - Constructor1->setChecked( TRUE ); - Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) ); - Constructor1->setMinimumSize( QSize( 50, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer, 0, 1 ); - GeometryGUI_ArchimedeDlgLayout->addWidget( GroupConstructors, 0, 0 ); - - /***************************************************************/ - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); - GroupButtons->setTitle( tr( "" ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 3 ); - buttonApply = new QPushButton( GroupButtons, "buttonApply" ); - buttonApply->setText( tr( "GEOM_BUT_APPLY" ) ); - buttonApply->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonApply, 0, 1 ); - QSpacerItem* spacer_1 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_1, 0, 2 ); - buttonOk = new QPushButton( GroupButtons, "buttonOk" ); - buttonOk->setText( tr( "GEOM_BUT_OK" ) ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - GeometryGUI_ArchimedeDlgLayout->addWidget( GroupButtons, 2, 0 ); - - GroupC1 = new QGroupBox( this, "GroupC1" ); - GroupC1->setTitle( tr( "GEOM_ARGUMENTS" ) ); - GroupC1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, GroupC1->sizePolicy().hasHeightForWidth() ) ); - GroupC1->setColumnLayout(0, Qt::Vertical ); - GroupC1->layout()->setSpacing( 0 ); - GroupC1->layout()->setMargin( 0 ); - GroupC1Layout = new QGridLayout( GroupC1->layout() ); - GroupC1Layout->setAlignment( Qt::AlignTop ); - GroupC1Layout->setSpacing( 6 ); - GroupC1Layout->setMargin( 11 ); - LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" ); - GroupC1Layout->addWidget( LineEditC1A1, 0, 2 ); - - LineEditC1A2 = new QLineEdit( GroupC1, "LineEditC1A2" ); - LineEditC1A2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC1A2->sizePolicy().hasHeightForWidth() ) ); - LineEditC1A2->setMinimumSize( QSize( 40, 0 ) ); - LineEditC1A2->setMaximumSize( QSize( 32767, 32767 ) ); - GroupC1Layout->addWidget( LineEditC1A2, 1, 2 ); - - LineEditC1A3 = new QLineEdit( GroupC1, "LineEditC1A3" ); - LineEditC1A3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC1A3->sizePolicy().hasHeightForWidth() ) ); - LineEditC1A3->setMinimumSize( QSize( 40, 0 ) ); - LineEditC1A3->setMaximumSize( QSize( 32767, 32767 ) ); - GroupC1Layout->addWidget( LineEditC1A3, 2, 2 ); - - LineEditC1A4 = new QLineEdit( GroupC1, "LineEditC1A4" ); - LineEditC1A4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC1A4->sizePolicy().hasHeightForWidth() ) ); - LineEditC1A4->setMinimumSize( QSize( 40, 0 ) ); - LineEditC1A4->setMaximumSize( QSize( 32767, 32767 ) ); - GroupC1Layout->addWidget( LineEditC1A4, 3, 2 ); - - SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" ); - SelectButtonC1A1->setText( tr( "" ) ); - SelectButtonC1A1->setPixmap( image1 ); - GroupC1Layout->addWidget( SelectButtonC1A1, 0, 1 ); - TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" ); - TextLabelC1A1->setText( tr( "GEOM_OBJECTS" ) ); - TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A1->setFrameShape( QLabel::NoFrame ); - TextLabelC1A1->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabelC1A1, 0, 0 ); - - TextLabelC1A2 = new QLabel( GroupC1, "TextLabelC1A2" ); - TextLabelC1A2->setText( tr( "GEOM_WEIGHT" ) ); - TextLabelC1A2->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A2->setFrameShape( QLabel::NoFrame ); - TextLabelC1A2->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabelC1A2, 1, 0 ); - - TextLabelC1A3 = new QLabel( GroupC1, "TextLabelC1A3" ); - TextLabelC1A3->setText( tr( "GEOM_WATER_DENSITY" ) ); - TextLabelC1A3->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A3->setFrameShape( QLabel::NoFrame ); - TextLabelC1A3->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabelC1A3, 2, 0 ); - - TextLabelC1A4 = new QLabel( GroupC1, "TextLabelC1A4" ); - TextLabelC1A4->setText( tr( "GEOM_MESHING_DEFLECTION" ) ); - TextLabelC1A4->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A4->setFrameShape( QLabel::NoFrame ); - TextLabelC1A4->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabelC1A4, 3, 0 ); - - GeometryGUI_ArchimedeDlgLayout->addWidget( GroupC1, 1, 0 ); - /***************************************************************/ - - Init(Sel) ; /* Initialisations */ - -/* Move widget on the botton right corner of main widget */ - QAD_Tools::alignWidget(this, parent, AlignBottom | AlignRight); - /* Display Dialog */ - this->show() ; -} - - -//================================================================================= -// function : ~GeometryGUI_ArchimedeDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_ArchimedeDlg::~GeometryGUI_ArchimedeDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_ArchimedeDlg::Init( SALOME_Selection* Sel ) -{ - LineEditC1A2->setMaxLength( 10 ); - LineEditC1A3->setMaxLength( 10 ); - LineEditC1A4->setMaxLength( 10 ); - this->myVa = new QDoubleValidator( 0, +999999.999, 3, LineEditC1A2 ) ; - this->myVb = new QDoubleValidator( 0, +999999.999, 3, LineEditC1A3 ) ; - this->myVc = new QDoubleValidator( 0, +999999.999, 3, LineEditC1A4 ) ; - LineEditC1A2->setValidator( myVa ) ; - LineEditC1A3->setValidator( myVb ) ; - LineEditC1A4->setValidator( myVc ) ; - - GroupC1->show(); - myConstructorId = 0 ; - Constructor1->setChecked( TRUE ); - myEditCurrentArgument = LineEditC1A1 ; - mySelection = Sel; - - this->myWeight = 100.0 ; - LineEditC1A2->setText("100.0") ; - this->myWaterDensity = 1.0 ; - LineEditC1A3->setText("1.0") ; - this->myMeshingDeflection = 0.01 ; - LineEditC1A4->setText("0.01") ; - - myOkWeight = myOkWaterDensity = myOkMeshingDeflection = true ; - myOkIO = false ; - - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - - /* Filter definitions */ - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - - /* signals and slots connections */ - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ; - connect( buttonApply, SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) ); - connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) ); - - connect( SelectButtonC1A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - - connect( LineEditC1A2, SIGNAL (textChanged(const QString&) ), this, SLOT( TextChangedInLineEdit(const QString&) ) ) ; - connect( LineEditC1A3, SIGNAL (textChanged(const QString&) ), this, SLOT( TextChangedInLineEdit(const QString&) ) ) ; - connect( LineEditC1A4, SIGNAL (textChanged(const QString&) ), this, SLOT( TextChangedInLineEdit(const QString&) ) ) ; - - connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ; - /* to close dialog if study change */ - connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ; - connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - - return ; -} - - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_ArchimedeDlg::ConstructorsClicked(int constructorId) -{ - return ; -} - - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_ArchimedeDlg::ClickOnOk() -{ - this->ClickOnApply() ; - this->ClickOnCancel() ; - - return ; -} - - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_ArchimedeDlg::ClickOnApply() -{ - switch(myConstructorId) - { - case 0 : - { - if(myOkIO && myOkWeight && myOkWaterDensity && myOkMeshingDeflection ) { - myGeomGUI->Archimede( myIO, myWeight, myWaterDensity, myMeshingDeflection ); - } - } - break ; - } - // accept(); - return ; -} - - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void GeometryGUI_ArchimedeDlg::ClickOnCancel() -{ - myGeomGUI->ResetState() ; - reject() ; - return ; -} - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -//================================================================================= -void GeometryGUI_ArchimedeDlg::SelectionIntoArgument() -{ - myEditCurrentArgument->setText("") ; - QString aString = ""; - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; - if ( nbSel != 1 ) { - myEditCurrentArgument->setText("") ; - myOkIO = false ; - } - else { - myEditCurrentArgument->setText(aString) ; - myIO = mySelection->firstIObject(); - myOkIO = true ; - } - return ; -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_ArchimedeDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - switch (myConstructorId) - { - case 0: /* default constructor */ - { - if(send == SelectButtonC1A1) { - LineEditC1A1->setFocus() ; - myEditCurrentArgument = LineEditC1A1; - } - SelectionIntoArgument() ; - break; - } - } - return ; -} - - -//================================================================================= -// function : TextChangedInLineEdit() -// purpose : -//================================================================================= -void GeometryGUI_ArchimedeDlg::TextChangedInLineEdit(const QString& newText) -{ - QLineEdit* send = (QLineEdit*)sender(); - QString newT = strdup(newText) ; - int i ; - - if(send == LineEditC1A2) { - if( myVa->validate(newT, i) == myVa->Acceptable ) { - this->myWeight = newText.toFloat() ; - myOkWeight = true ; - } - else { - myOkWeight = false ; - } - } - else if(send == LineEditC1A3) { - if( myVb->validate(newT, i) == myVb->Acceptable ) { - this->myWaterDensity = newText.toFloat() ; - myOkWaterDensity = true ; - } - else { - myOkWaterDensity = false ; - } - } - else if(send == LineEditC1A4) { - if( myVc->validate(newT, i) == myVc->Acceptable ) { - this->myMeshingDeflection = newText.toFloat() ; - myOkMeshingDeflection = true ; - } - else { - myOkMeshingDeflection = false ; - } - } - - return ; -} - - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void GeometryGUI_ArchimedeDlg::DeactivateActiveDialog() -{ - if ( GroupConstructors->isEnabled() ) { - GroupConstructors->setEnabled(false) ; - GroupC1->setEnabled(false) ; - GroupButtons->setEnabled(false) ; - } - return ; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_ArchimedeDlg::ActivateThisDialog() -{ - /* Emit a signal to deactivate the active dialog */ - myGeomGUI->EmitSignalDeactivateDialog() ; - GroupConstructors->setEnabled(true) ; - GroupC1->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - return ; -} - - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void GeometryGUI_ArchimedeDlg::enterEvent(QEvent* e) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; - return ; -} - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_ArchimedeDlg::closeEvent( QCloseEvent* e ) -{ - /* same than click on cancel button */ - this->ClickOnCancel() ; - return ; -} - - diff --git a/src/GEOMGUI/GeometryGUI_ArchimedeDlg.h b/src/GEOMGUI/GeometryGUI_ArchimedeDlg.h deleted file mode 100644 index f233b43c8..000000000 --- a/src/GEOMGUI/GeometryGUI_ArchimedeDlg.h +++ /dev/null @@ -1,127 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_ArchimedeDlg.h -// Author : Nicolas REJNERI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_ARCHIMEDE_H -#define DIALOGBOX_ARCHIMEDE_H - -#include "SALOME_Selection.h" -#include "GEOM_ShapeTypeFilter.hxx" - -#include -#include -#include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QRadioButton; -class GeometryGUI; - - -//================================================================================= -// class : GeometryGUI_ArchimedeDlg -// purpose : -//================================================================================= -class GeometryGUI_ArchimedeDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_ArchimedeDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 ); - ~GeometryGUI_ArchimedeDlg(); - -private: - - void Init( SALOME_Selection* Sel ) ; - void closeEvent( QCloseEvent* e ) ; - void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */ - - GEOM::GEOM_Gen_var myGeom ; /* Current GeomI object */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - SALOME_Selection* mySelection ; /* User shape selection */ - - Handle(SALOME_InteractiveObject) myIO ; - - Standard_Real myWeight ; - Standard_Real myWaterDensity ; - Standard_Real myMeshingDeflection ; - - bool myOkIO ; - bool myOkWeight ; - bool myOkWaterDensity ; - bool myOkMeshingDeflection ; - - int myConstructorId ; /* Current constructor id = radio button id */ - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - - QDoubleValidator *myVa ; /* Double validator for numeric input */ - QDoubleValidator *myVb ; /* Double validator for numeric input */ - QDoubleValidator *myVc ; /* Double validator for numeric input */ - - QButtonGroup* GroupConstructors; - QRadioButton* Constructor1; - QGroupBox* GroupButtons; - QPushButton* buttonApply; - QPushButton* buttonOk; - QPushButton* buttonCancel; - QGroupBox* GroupC1; - QLineEdit* LineEditC1A1; - QLineEdit* LineEditC1A2; - QLineEdit* LineEditC1A3; - QLineEdit* LineEditC1A4; - QPushButton* SelectButtonC1A1; - QLabel* TextLabelC1A1; - QLabel* TextLabelC1A2; - QLabel* TextLabelC1A3; - QLabel* TextLabelC1A4; - -private slots: - - void ConstructorsClicked(int constructorId); - void ClickOnOk(); - void ClickOnCancel(); - void ClickOnApply(); - void SetEditCurrentArgument() ; - void TextChangedInLineEdit(const QString&) ; - void SelectionIntoArgument() ; - void DeactivateActiveDialog() ; - void ActivateThisDialog() ; - -protected: - QGridLayout* GeometryGUI_ArchimedeDlgLayout; - QGridLayout* GroupConstructorsLayout; - QGridLayout* GroupButtonsLayout; - QGridLayout* GroupC1Layout; -}; - -#endif // DIALOGBOX_ARCHIMEDE_H diff --git a/src/GEOMGUI/GeometryGUI_BndBoxDlg.cxx b/src/GEOMGUI/GeometryGUI_BndBoxDlg.cxx deleted file mode 100644 index 495aa46cc..000000000 --- a/src/GEOMGUI/GeometryGUI_BndBoxDlg.cxx +++ /dev/null @@ -1,487 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_BndBoxDlg.cxx -// Author : Nicolas REJNERI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_BndBoxDlg.h" - -#include "GeometryGUI.h" -#include "QAD_Application.h" -#include "QAD_Desktop.h" -#include "utilities.h" - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -//================================================================================= -// class : GeometryGUI_BndBoxDlg() -// purpose : Constructs a GeometryGUI_BndBoxDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_BndBoxDlg::GeometryGUI_BndBoxDlg( QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_BOUNDING_BOX"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - - if ( !name ) - setName( "GeometryGUI_BndBoxDlg" ); - resize( 303, 275 ); - setCaption( tr( "GEOM_BNDBOX_TITLE" ) ); - setSizeGripEnabled( TRUE ); - GeometryGUI_BndBoxDlgLayout = new QGridLayout( this ); - GeometryGUI_BndBoxDlgLayout->setSpacing( 6 ); - GeometryGUI_BndBoxDlgLayout->setMargin( 11 ); - - /***************************************************************/ - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "GEOM_BNDBOX" ) ); - GroupConstructors->setExclusive( TRUE ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setText( tr( "" ) ); - Constructor1->setPixmap( image0 ); - Constructor1->setChecked( TRUE ); - Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, - Constructor1->sizePolicy().hasHeightForWidth() ) ); - Constructor1->setMinimumSize( QSize( 60, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer, 0, 1 ); - GeometryGUI_BndBoxDlgLayout->addWidget( GroupConstructors, 0, 0 ); - - /***************************************************************/ - GroupConstructor1 = new QGroupBox( this, "GroupConstructor1" ); - GroupConstructor1->setTitle( tr( "GEOM_BNDBOX_OBJDIM" ) ); - GroupConstructor1->setColumnLayout(0, Qt::Vertical ); - GroupConstructor1->layout()->setSpacing( 0 ); - GroupConstructor1->layout()->setMargin( 0 ); - GroupConstructor1Layout = new QGridLayout( GroupConstructor1->layout() ); - GroupConstructor1Layout->setAlignment( Qt::AlignTop ); - GroupConstructor1Layout->setSpacing( 6 ); - GroupConstructor1Layout->setMargin( 11 ); - LineEditC1A1 = new QLineEdit( GroupConstructor1, "LineEditC1A1" ); - LineEditC1A1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC1A1->sizePolicy().hasHeightForWidth() ) ); -// GroupConstructor1Layout->addWidget( LineEditC1A1, 0, 2 ); - SelectButtonC1A1 = new QPushButton( GroupConstructor1, "SelectButtonC1A1" ); - SelectButtonC1A1->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); - SelectButtonC1A1->setText( tr( "" ) ); - SelectButtonC1A1->setPixmap( image1 ); -// GroupConstructor1Layout->addWidget( SelectButtonC1A1, 0, 1 ); - - TextLabelC1A1 = new QLabel( GroupConstructor1, "TextLabelC1A1" ); - TextLabelC1A1->setText( tr( "GEOM_OBJECT" ) ); - TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A1->setFrameShape( QLabel::NoFrame ); - TextLabelC1A1->setFrameShadow( QLabel::Plain ); -// GroupConstructor1Layout->addWidget( TextLabelC1A1, 0, 0 ); - - QHBoxLayout* bl = new QHBoxLayout; - bl->setMargin(0); bl->setSpacing(6); - bl->addWidget(TextLabelC1A1); bl->addWidget(SelectButtonC1A1); bl->addWidget(LineEditC1A1); - GroupConstructor1Layout->addMultiCellLayout(bl, 0, 0, 0, 2); - - TextLabel_Min = new QLabel( GroupConstructor1, "TextLabel_Min" ); - TextLabel_Min->setText( tr( "GEOM_MIN" ) ); - TextLabel_Min->setMinimumSize( QSize( 50, 0 ) ); - TextLabel_Min->setFrameShape( QLabel::NoFrame ); - TextLabel_Min->setFrameShadow( QLabel::Plain ); - GroupConstructor1Layout->addWidget( TextLabel_Min, 1, 1 ); - - TextLabel_Max = new QLabel( GroupConstructor1, "TextLabel_Max" ); - TextLabel_Max->setText( tr( "GEOM_MAX" ) ); - TextLabel_Max->setMinimumSize( QSize( 50, 0 ) ); - TextLabel_Max->setFrameShape( QLabel::NoFrame ); - TextLabel_Max->setFrameShadow( QLabel::Plain ); - GroupConstructor1Layout->addWidget( TextLabel_Max, 1, 2 ); - - TextLabel_X = new QLabel( GroupConstructor1, "TextLabel_X" ); - TextLabel_X->setText( tr( "GEOM_X" ) ); - TextLabel_X->setMinimumSize( QSize( 50, 0 ) ); - TextLabel_X->setFrameShape( QLabel::NoFrame ); - TextLabel_X->setFrameShadow( QLabel::Plain ); - GroupConstructor1Layout->addWidget( TextLabel_X, 2, 0 ); - LineEdit_MinX = new QLineEdit( GroupConstructor1, "LineEdit_MinX" ); - LineEdit_MinX->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, - LineEdit_MinX->sizePolicy().hasHeightForWidth() ) ); - //LineEdit_MinX->setEnabled( FALSE ); - LineEdit_MinX->setReadOnly( TRUE ); - GroupConstructor1Layout->addWidget( LineEdit_MinX, 2, 1 ); - LineEdit_MaxX = new QLineEdit( GroupConstructor1, "LineEdit_MaxX" ); - LineEdit_MaxX->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, - LineEdit_MaxX->sizePolicy().hasHeightForWidth() ) ); - //LineEdit_MaxX->setEnabled( FALSE ); - LineEdit_MaxX->setReadOnly( TRUE ); - GroupConstructor1Layout->addWidget( LineEdit_MaxX, 2, 2 ); - - TextLabel_Y = new QLabel( GroupConstructor1, "TextLabel_Y" ); - TextLabel_Y->setText( tr( "GEOM_Y" ) ); - TextLabel_Y->setMinimumSize( QSize( 50, 0 ) ); - TextLabel_Y->setFrameShape( QLabel::NoFrame ); - TextLabel_Y->setFrameShadow( QLabel::Plain ); - GroupConstructor1Layout->addWidget( TextLabel_Y, 3, 0 ); - LineEdit_MinY = new QLineEdit( GroupConstructor1, "LineEdit_MinY" ); - LineEdit_MinY->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, - LineEdit_MinY->sizePolicy().hasHeightForWidth() ) ); - //LineEdit_MinY->setEnabled( FALSE ); - LineEdit_MinY->setReadOnly( TRUE ); - GroupConstructor1Layout->addWidget( LineEdit_MinY, 3, 1 ); - LineEdit_MaxY = new QLineEdit( GroupConstructor1, "LineEdit_MaxY" ); - LineEdit_MaxY->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, - LineEdit_MaxY->sizePolicy().hasHeightForWidth() ) ); - //LineEdit_MaxY->setEnabled( FALSE ); - LineEdit_MaxY->setReadOnly( TRUE ); - GroupConstructor1Layout->addWidget( LineEdit_MaxY, 3, 2 ); - - TextLabel_Z = new QLabel( GroupConstructor1, "TextLabel_Z" ); - TextLabel_Z->setText( tr( "GEOM_Z" ) ); - TextLabel_Z->setMinimumSize( QSize( 50, 0 ) ); - TextLabel_Z->setFrameShape( QLabel::NoFrame ); - TextLabel_Z->setFrameShadow( QLabel::Plain ); - GroupConstructor1Layout->addWidget( TextLabel_Z, 4, 0 ); - LineEdit_MinZ = new QLineEdit( GroupConstructor1, "LineEdit_MinZ" ); - LineEdit_MinZ->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, - LineEdit_MinZ->sizePolicy().hasHeightForWidth() ) ); - //LineEdit_MinZ->setEnabled( FALSE ); - LineEdit_MinZ->setReadOnly( TRUE ); - GroupConstructor1Layout->addWidget( LineEdit_MinZ, 4, 1 ); - LineEdit_MaxZ = new QLineEdit( GroupConstructor1, "LineEdit_MaxZ" ); - LineEdit_MaxZ->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, - LineEdit_MaxZ->sizePolicy().hasHeightForWidth() ) ); - //LineEdit_MaxZ->setEnabled( FALSE ); - LineEdit_MaxZ->setReadOnly( TRUE ); - GroupConstructor1Layout->addWidget( LineEdit_MaxZ, 4, 2 ); - - GeometryGUI_BndBoxDlgLayout->addWidget( GroupConstructor1, 1, 0 ); - - /***************************************************************/ - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); - GroupButtons->setTitle( tr( "" ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 1 ); - - QSpacerItem* spacer_8 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_8, 0, 0 ); - QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_9, 0, 2 ); - - GeometryGUI_BndBoxDlgLayout->addWidget( GroupButtons, 2, 0 ); - /***************************************************************/ - - Init(Sel) ; /* Initialisations */ -} - - -//================================================================================= -// function : ~GeometryGUI_BndBoxDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_BndBoxDlg::~GeometryGUI_BndBoxDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_BndBoxDlg::Init( SALOME_Selection* Sel ) -{ - myConstructorId = 0 ; - Constructor1->setChecked( TRUE ); - myEditCurrentArgument = LineEditC1A1 ; - mySelection = Sel; - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - - // TODO : previous selection into argument ? - - /* Filter definitions */ - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - - /* signals and slots connections */ - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ; - connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) ); - connect( SelectButtonC1A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - - connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ; - /* to close dialog if study change */ - connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ; - - mySimulationTopoDs.Nullify() ; - - /* Move widget on the botton right corner of main widget */ - int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; - this->show() ; /* displays Dialog */ - - return ; -} - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_BndBoxDlg::ConstructorsClicked(int constructorId) -{ - return ; -} - - - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void GeometryGUI_BndBoxDlg::ClickOnCancel() -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->ResetState() ; - reject() ; - return ; -} - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -//================================================================================= -void GeometryGUI_BndBoxDlg::SelectionIntoArgument() -{ - LineEdit_MinX->setText("") ; - LineEdit_MinY->setText("") ; - LineEdit_MinZ->setText("") ; - LineEdit_MaxX->setText("") ; - LineEdit_MaxY->setText("") ; - LineEdit_MaxZ->setText("") ; - myEditCurrentArgument->setText("") ; - mySimulationTopoDs.Nullify() ; - - QString aString = ""; /* future the name of selection */ - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; - if ( nbSel != 1 ) { - return ; - } - - /* nbSel == 1 */ - TopoDS_Shape S; - if( !myGeomGUI->GetTopoFromSelection(mySelection, S) ) - return ; - - if( S.IsNull() ) { - myEditCurrentArgument->setText( "" ); - return ; - } - - LineEditC1A1->setText(aString) ; - this->CalculateAndDisplayBndBox(S) ; - - return ; -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_BndBoxDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - switch (myConstructorId) - { - case 0: /* default constructor */ - { - if(send == SelectButtonC1A1) { - LineEditC1A1->setFocus() ; - myEditCurrentArgument = LineEditC1A1; - } - SelectionIntoArgument() ; - break; - } - } - return ; -} - - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_BndBoxDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if( send == LineEditC1A1 ) - myEditCurrentArgument = LineEditC1A1 ; - else - return ; - - /* User name of object input management */ - /* If successfull the selection is changed and signal emitted... */ - /* so SelectionIntoArgument() is automatically called. */ - const QString objectUserName = myEditCurrentArgument->text() ; - QWidget* thisWidget = (QWidget*)this ; - if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) { - myEditCurrentArgument->setText( objectUserName ) ; - } - - return ; -} - - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void GeometryGUI_BndBoxDlg::DeactivateActiveDialog() -{ - if ( GroupConstructors->isEnabled() ) { - disconnect( mySelection, 0, this, 0 ); - GroupConstructors->setEnabled(false) ; - GroupConstructor1->setEnabled(false) ; - GroupButtons->setEnabled(false) ; - } - return ; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_BndBoxDlg::ActivateThisDialog() -{ - /* Emit a signal to deactivate the active dialog */ - myGeomGUI->EmitSignalDeactivateDialog() ; - GroupConstructors->setEnabled(true) ; - GroupConstructor1->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - return ; -} - - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void GeometryGUI_BndBoxDlg::enterEvent(QEvent* e) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; - return ; -} - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_BndBoxDlg::closeEvent( QCloseEvent* e ) -{ - /* same than click on cancel button */ - this->ClickOnCancel() ; - return ; -} - - -//================================================================================= -// function : CalculateAndDisplayBndBox() -// purpose : -//================================================================================= -void GeometryGUI_BndBoxDlg::CalculateAndDisplayBndBox(const TopoDS_Shape& S) -{ - LineEdit_MinX->setText("") ; - LineEdit_MinY->setText("") ; - LineEdit_MinZ->setText("") ; - LineEdit_MaxX->setText("") ; - LineEdit_MaxY->setText("") ; - LineEdit_MaxZ->setText("") ; - if( S.IsNull() ) - return ; - - Standard_Real axmin,aymin,azmin,axmax,aymax,azmax; - Bnd_Box B; - try { - BRepBndLib::Add(S,B); - B.Get(axmin,aymin,azmin,axmax,aymax,azmax); - LineEdit_MinX->setText( tr("%1").arg( axmin, 12, 'f', 6 ) ) ; - LineEdit_MinY->setText( tr("%1").arg( aymin, 12, 'f', 6 ) ) ; - LineEdit_MinZ->setText( tr("%1").arg( azmin, 12, 'f', 6 ) ) ; - LineEdit_MaxX->setText( tr("%1").arg( axmax, 12, 'f', 6 ) ) ; - LineEdit_MaxY->setText( tr("%1").arg( aymax, 12, 'f', 6 ) ) ; - LineEdit_MaxZ->setText( tr("%1").arg( azmax, 12, 'f', 6 ) ) ; - - mySimulationTopoDs = BRepPrimAPI_MakeBox( gp_Pnt(axmin,aymin,azmin), - gp_Pnt(axmax,aymax,azmax) ).Shape(); - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - } - catch(Standard_Failure) { - MESSAGE("Catch intercepted in CalculateAndDisplayBndBox()" << endl ) ; - } - return ; -} diff --git a/src/GEOMGUI/GeometryGUI_BndBoxDlg.h b/src/GEOMGUI/GeometryGUI_BndBoxDlg.h deleted file mode 100644 index 546dde539..000000000 --- a/src/GEOMGUI/GeometryGUI_BndBoxDlg.h +++ /dev/null @@ -1,119 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_BndBoxDlg.h -// Author : Nicolas REJNERI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_BNDBOX_H -#define DIALOGBOX_BNDBOX_H - -#include "SALOME_Selection.h" -#include "GEOM_ShapeTypeFilter.hxx" - -#include -#include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QRadioButton; -class GeometryGUI; - -//================================================================================= -// class : DialogBox_PROPERTIES -// purpose : -//================================================================================= -class GeometryGUI_BndBoxDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_BndBoxDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 ); - ~GeometryGUI_BndBoxDlg(); - -private: - - void Init( SALOME_Selection* Sel ) ; - void closeEvent( QCloseEvent* e ) ; - void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */ - void CalculateAndDisplayBndBox(const TopoDS_Shape& S) ; - - GEOM::GEOM_Gen_var myGeom ; /* Current GeomI object */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - SALOME_Selection* mySelection ; /* User shape selection */ - int myConstructorId ; /* Current constructor id = radio button id */ - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - TopoDS_Shape mySimulationTopoDs ; /* Shape used for simulation display */ - - QButtonGroup* GroupConstructors; - QRadioButton* Constructor1; - QGroupBox* GroupConstructor1; - QLineEdit* LineEditC1A1; - QPushButton* SelectButtonC1A1; - QLabel* TextLabelC1A1; - - QLabel* TextLabel_Min; - QLabel* TextLabel_Max; - - QLabel* TextLabel_X; - QLabel* TextLabel_Y; - QLabel* TextLabel_Z; - - QLineEdit* LineEdit_MinX; - QLineEdit* LineEdit_MinY; - QLineEdit* LineEdit_MinZ; - - QLineEdit* LineEdit_MaxX; - QLineEdit* LineEdit_MaxY; - QLineEdit* LineEdit_MaxZ; - - QGroupBox* GroupButtons; - QPushButton* buttonApply; - QPushButton* buttonOk; - QPushButton* buttonCancel; - -private slots: - - void ConstructorsClicked(int constructorId); - void ClickOnCancel(); - void SetEditCurrentArgument() ; - void LineEditReturnPressed() ; - void SelectionIntoArgument() ; - void DeactivateActiveDialog() ; - void ActivateThisDialog() ; - -protected: - QGridLayout* GeometryGUI_BndBoxDlgLayout; - QGridLayout* GroupConstructorsLayout; - QGridLayout* GroupConstructor1Layout; - QGridLayout* GroupButtonsLayout; -}; - -#endif // DIALOGBOX_BNDBOX_H diff --git a/src/GEOMGUI/GeometryGUI_BoxDlg.cxx b/src/GEOMGUI/GeometryGUI_BoxDlg.cxx deleted file mode 100644 index 56e6110e7..000000000 --- a/src/GEOMGUI/GeometryGUI_BoxDlg.cxx +++ /dev/null @@ -1,411 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_BoxDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_BoxDlg.h" - -#include - -#include "GeometryGUI.h" -#include "QAD_Desktop.h" -#include "QAD_Config.h" - -//================================================================================= -// class : GeometryGUI_BoxDlg() -// purpose : Constructs a GeometryGUI_BoxDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_BoxDlg::GeometryGUI_BoxDlg(QWidget* parent, const char* name, PrimitiveGUI* thePrimitiveGUI, SALOME_Selection* Sel, bool modal, WFlags fl) - :GeometryGUI_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM", tr("ICON_DLG_BOX_2P"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM", tr("ICON_DLG_BOX_DXYZ"))); - QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap("GEOM", tr("ICON_SELECT"))); - - setCaption(tr("GEOM_BOX_TITLE")); - - /***************************************************************/ - GroupConstructors->setTitle(tr("GEOM_BOX")); - RadioButton1->setPixmap(image0); - RadioButton2->setPixmap(image1); - RadioButton3->close(TRUE); - - GroupPoints = new GeometryGUI_2Sel_QTD(this, "GroupPoints"); - GroupPoints->GroupBox1->setTitle(tr("GEOM_DIAGONAL_POINTS")); - GroupPoints->TextLabel1->setText(tr("GEOM_POINT_I").arg("1")); - GroupPoints->TextLabel2->setText(tr("GEOM_POINT_I").arg("2")); - GroupPoints->PushButton1->setPixmap(image2); - GroupPoints->PushButton2->setPixmap(image2); - - GroupDimensions = new GeometryGUI_3Spin(this, "GroupDimensions"); - GroupDimensions->GroupBox1->setTitle(tr("GEOM_BOX_OBJ")); - GroupDimensions->TextLabel1->setText(tr("GEOM_DX")); - GroupDimensions->TextLabel2->setText(tr("GEOM_DY")); - GroupDimensions->TextLabel3->setText(tr("GEOM_DZ")); - - Layout1->addWidget(GroupPoints, 1, 0); - Layout1->addWidget(GroupDimensions, 1, 0); - /***************************************************************/ - - /* Initialisations */ - myPrimitiveGUI = thePrimitiveGUI; - Init(); -} - - -//================================================================================= -// function : ~DialogBox_Box() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_BoxDlg::~GeometryGUI_BoxDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_BoxDlg::Init() -{ - /* init variables */ - myConstructorId = 0; - myEditCurrentArgument = GroupPoints->LineEdit1; - - myPoint1.SetCoord(0.0, 0.0, 0.0); - myPoint2.SetCoord(0.0, 0.0, 0.0); - myOkPoint1 = myOkPoint2 = false; - - /* Vertices Filter for all arguments */ - myVertexFilter = new GEOM_ShapeTypeFilter(TopAbs_VERTEX, myGeom); - mySelection->AddFilter(myVertexFilter); - - /* Get setting of step value from file configuration */ - QString St = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep"); - step = St.toDouble(); - - /* min, max, step and decimals for spin boxes */ - GroupDimensions->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3); - GroupDimensions->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3); - GroupDimensions->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3); - - double initValue = 200.0; - GroupDimensions->SpinBox_DX->SetValue(initValue); - GroupDimensions->SpinBox_DY->SetValue(initValue); - GroupDimensions->SpinBox_DZ->SetValue(initValue); - - /* signals and slots connections */ - connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); - connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); - connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int))); - - connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); - connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); - - connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); - connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); - - connect(GroupDimensions->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(GroupDimensions->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(GroupDimensions->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - - connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; - - /* displays Dialog */ - GroupDimensions->hide(); - GroupPoints->show(); - this->show(); - - return; -} - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_BoxDlg::ConstructorsClicked(int constructorId) -{ - myConstructorId = constructorId; - mySelection->ClearFilters(); - myGeomGUI->EraseSimulationShape(); - disconnect(mySelection, 0, this, 0); - myOkPoint1 = myOkPoint2 = false; - - switch (constructorId) - { - case 0: - { - GroupDimensions->hide(); - resize(0, 0); - GroupPoints->show(); - - myEditCurrentArgument = GroupPoints->LineEdit1; - GroupPoints->LineEdit1->setText(""); - GroupPoints->LineEdit2->setText(""); - - /* filter for next selection */ - mySelection->AddFilter(myVertexFilter); - connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - break; - } - case 1: - { - GroupPoints->hide(); - resize( 0, 0 ); - GroupDimensions->show(); - - double initValue = 200.0; - GroupDimensions->SpinBox_DX->SetValue(initValue); - GroupDimensions->SpinBox_DY->SetValue(initValue); - GroupDimensions->SpinBox_DZ->SetValue(initValue); - - myPoint1.SetCoord(0.0, 0.0, 0.0) ; - myPoint2.SetCoord(initValue, initValue, initValue); - - mySimulationTopoDs = BRepPrimAPI_MakeBox(myPoint1, myPoint2).Shape(); - myGeomGUI->DisplaySimulationShape(mySimulationTopoDs); - break; - } - } - return; -} - - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_BoxDlg::ClickOnOk() -{ - this->ClickOnApply(); - ClickOnCancel(); - return; -} - - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_BoxDlg::ClickOnApply() -{ - myGeomGUI->GetDesktop()->putInfo(tr("")); - if (mySimulationTopoDs.IsNull()) - return; - myGeomGUI->EraseSimulationShape(); - mySimulationTopoDs.Nullify(); - - switch(myConstructorId) - { - case 0 : - { - if(myOkPoint1 && myOkPoint2) - myPrimitiveGUI->MakeBoxAndDisplay(myPoint1, myPoint2); - break; - } - case 1 : - { - /* Recup args and call method */ - double vx = GroupDimensions->SpinBox_DX->GetValue(); - double vy = GroupDimensions->SpinBox_DY->GetValue(); - double vz = GroupDimensions->SpinBox_DZ->GetValue(); - myPoint1.SetCoord(0.0, 0.0, 0.0); - myPoint2.SetCoord(vx, vy, vz); - myPrimitiveGUI->MakeBoxAndDisplay(myPoint1, myPoint2); - break; - } - } - return; -} - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed -//================================================================================= -void GeometryGUI_BoxDlg::SelectionIntoArgument() -{ - myGeomGUI->EraseSimulationShape(); - myEditCurrentArgument->setText(""); - QString aString = ""; /* name of selection */ - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString); - if (nbSel != 1) { - if (myEditCurrentArgument == GroupPoints->LineEdit1) - myOkPoint1 = false; - else if ( myEditCurrentArgument == GroupPoints->LineEdit2) - myOkPoint2 = false; - return; - } - - // nbSel == 1 - TopoDS_Shape S; - if(!myGeomGUI->GetTopoFromSelection(mySelection, S)) - return; - - if(myEditCurrentArgument == GroupPoints->LineEdit1 && myGeomGUI->VertexToPoint(S, myPoint1)) { - myEditCurrentArgument->setText(aString); - myOkPoint1 = true; - } - else if(myEditCurrentArgument == GroupPoints->LineEdit2 && myGeomGUI->VertexToPoint(S, myPoint2)) { - myEditCurrentArgument->setText(aString); - myOkPoint2 = true; - } - - if(myOkPoint1 && myOkPoint2 && TestBoxDimensions(myPoint1, myPoint2)) { - mySimulationTopoDs = BRepPrimAPI_MakeBox(myPoint1, myPoint2).Shape(); - myGeomGUI->DisplaySimulationShape(mySimulationTopoDs); - } - return; -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_BoxDlg::SetEditCurrentArgument() -{ - if(myConstructorId != 0) - return; - - QPushButton* send = (QPushButton*)sender(); - - if(send == GroupPoints->PushButton1) { - GroupPoints->LineEdit1->setFocus(); - myEditCurrentArgument = GroupPoints->LineEdit1; - } - else if(send == GroupPoints->PushButton2) { - GroupPoints->LineEdit2->setFocus(); - myEditCurrentArgument = GroupPoints->LineEdit2; - } - mySelection->AddFilter(myVertexFilter); - this->SelectionIntoArgument(); - - return; -} - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_BoxDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if(send == GroupPoints->LineEdit1) - myEditCurrentArgument = GroupPoints->LineEdit1; - else if (send == GroupPoints->LineEdit2) - myEditCurrentArgument = GroupPoints->LineEdit2; - else - return; - - GeometryGUI_Skeleton::LineEditReturnPressed(); - return; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_BoxDlg::ActivateThisDialog() -{ - GeometryGUI_Skeleton::ActivateThisDialog(); - connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - if(!mySimulationTopoDs.IsNull()) - myGeomGUI->DisplaySimulationShape(mySimulationTopoDs); - return; -} - - -//================================================================================= -// function : enterEvent [REDEFINED] -// purpose : -//================================================================================= -void GeometryGUI_BoxDlg::enterEvent(QEvent* e) -{ - if (GroupConstructors->isEnabled()) - return; - this->ActivateThisDialog(); - return; -} - - -//================================================================================= -// function : ValueChangedInSpinBox() -// purpose : -//================================================================================= -void GeometryGUI_BoxDlg::ValueChangedInSpinBox(double newValue) -{ - myGeomGUI->EraseSimulationShape(); - mySimulationTopoDs.Nullify(); - QObject* send = (QObject*)sender(); - double vx, vy, vz; - - if(send == GroupDimensions->SpinBox_DX ) { - vx = newValue; - vy = GroupDimensions->SpinBox_DY->GetValue(); - vz = GroupDimensions->SpinBox_DZ->GetValue(); - } else if (send == GroupDimensions->SpinBox_DY) { - vx = GroupDimensions->SpinBox_DX->GetValue(); - vy = newValue; - vz = GroupDimensions->SpinBox_DZ->GetValue(); - } else if (send == GroupDimensions->SpinBox_DZ) { - vx = GroupDimensions->SpinBox_DX->GetValue(); - vy = GroupDimensions->SpinBox_DY->GetValue(); - vz = newValue; - } - - myPoint1.SetCoord(0.0, 0.0, 0.0); - myPoint2.SetCoord(vx, vy, vz); - - if(TestBoxDimensions(myPoint1, myPoint2)) { - mySimulationTopoDs = BRepPrimAPI_MakeBox(myPoint1, myPoint2).Shape(); - myGeomGUI->DisplaySimulationShape(mySimulationTopoDs); - } - return; -} - - -//================================================================================= -// function : TestBoxDimensions() -// purpose : -//================================================================================= -bool GeometryGUI_BoxDlg::TestBoxDimensions(gp_Pnt P1, gp_Pnt P2) -{ - if ((fabs(P1.X() - P2.X()) > Precision::Confusion()) && - (fabs(P1.Y() - P2.Y()) > Precision::Confusion()) && - (fabs(P1.Z() - P2.Z()) > Precision::Confusion())) - return true; - return false; -} diff --git a/src/GEOMGUI/GeometryGUI_BoxDlg.h b/src/GEOMGUI/GeometryGUI_BoxDlg.h deleted file mode 100644 index 2da1afbe9..000000000 --- a/src/GEOMGUI/GeometryGUI_BoxDlg.h +++ /dev/null @@ -1,83 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_BoxDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_BOX_H -#define DIALOGBOX_BOX_H - -#include "GeometryGUI_Skeleton.h" -#include "GeometryGUI_2Sel_QTD.h" -#include "GeometryGUI_3Spin.h" - -#include "PrimitiveGUI.h" - -#include - -//================================================================================= -// class : GeometryGUI_BoxDlg -// purpose : -//================================================================================= -class GeometryGUI_BoxDlg : public GeometryGUI_Skeleton -{ - Q_OBJECT - -public: - GeometryGUI_BoxDlg(QWidget* parent = 0, const char* name = 0, PrimitiveGUI* thePrimitiveGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0); - ~GeometryGUI_BoxDlg(); - -private : - void Init(); - void enterEvent(QEvent* e); - bool TestBoxDimensions(gp_Pnt P1, gp_Pnt P2); - - PrimitiveGUI* myPrimitiveGUI; - - double step; - int myConstructorId; - Handle(GEOM_ShapeTypeFilter) myVertexFilter; /* filter for selection */ - - gp_Pnt myPoint1; /* Points containing the vector */ - gp_Pnt myPoint2; - bool myOkPoint1; /* true when myPoint is defined */ - bool myOkPoint2; - - GeometryGUI_2Sel_QTD* GroupPoints; - GeometryGUI_3Spin* GroupDimensions; - -private slots: - void ClickOnOk(); - void ClickOnApply(); - void ActivateThisDialog(); - void LineEditReturnPressed(); - void SelectionIntoArgument(); - void SetEditCurrentArgument(); - void ConstructorsClicked(int constructorId); - void ValueChangedInSpinBox(double newValue); - -}; - -#endif // DIALOGBOX_BOX_H diff --git a/src/GEOMGUI/GeometryGUI_CenterMassDlg.cxx b/src/GEOMGUI/GeometryGUI_CenterMassDlg.cxx deleted file mode 100644 index 4f5d2ac19..000000000 --- a/src/GEOMGUI/GeometryGUI_CenterMassDlg.cxx +++ /dev/null @@ -1,527 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_CenterMassDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_CenterMassDlg.h" -#include "GeometryGUI.h" - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -//================================================================================= -// class : GeometryGUI_CenterMassDlg() -// purpose : Constructs a GeometryGUI_CenterMassDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_CenterMassDlg::GeometryGUI_CenterMassDlg( QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_CENTERMASS"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - - if ( !name ) - setName( "GeometryGUI_CenterMassDlg" ); - resize( 398, 219 ); - setCaption( tr( "GEOM_CMASS_TITLE" ) ); - setSizeGripEnabled( TRUE ); - GeometryGUI_CenterMassDlgLayout = new QGridLayout( this ); - GeometryGUI_CenterMassDlgLayout->setSpacing( 6 ); - GeometryGUI_CenterMassDlgLayout->setMargin( 11 ); - - /***************************************************************/ - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); - GroupButtons->setTitle( tr( "" ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 3 ); - buttonApply = new QPushButton( GroupButtons, "buttonApply" ); - buttonApply->setText( tr( "GEOM_BUT_APPLY" ) ); - buttonApply->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonApply, 0, 1 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer, 0, 2 ); - buttonOk = new QPushButton( GroupButtons, "buttonOk" ); - buttonOk->setText( tr( "GEOM_BUT_OK" ) ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - GeometryGUI_CenterMassDlgLayout->addWidget( GroupButtons, 2, 0 ); - - /***************************************************************/ - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "GEOM_CMASS" ) ); - GroupConstructors->setExclusive( TRUE ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setText( tr( "" ) ); - Constructor1->setPixmap( image0 ); - Constructor1->setChecked( TRUE ); - Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) ); - Constructor1->setMinimumSize( QSize( 50, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer_2, 0, 1 ); - GeometryGUI_CenterMassDlgLayout->addWidget( GroupConstructors, 0, 0 ); - - /***************************************************************/ - GroupC1 = new QGroupBox( this, "GroupC1" ); - GroupC1->setTitle( tr( "GEOM_OBJECT_RESULT" ) ); - GroupC1->setMinimumSize( QSize( 0, 0 ) ); - GroupC1->setFrameShape( QGroupBox::Box ); - GroupC1->setFrameShadow( QGroupBox::Sunken ); - GroupC1->setColumnLayout(0, Qt::Vertical ); - GroupC1->layout()->setSpacing( 0 ); - GroupC1->layout()->setMargin( 0 ); - GroupC1Layout = new QGridLayout( GroupC1->layout() ); - GroupC1Layout->setAlignment( Qt::AlignTop ); - GroupC1Layout->setSpacing( 6 ); - GroupC1Layout->setMargin( 11 ); - SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" ); - SelectButtonC1A1->setText( tr( "" ) ); - SelectButtonC1A1->setPixmap( image1 ); - SelectButtonC1A1->setToggleButton( FALSE ); - GroupC1Layout->addWidget( SelectButtonC1A1, 0, 1 ); - LineEdit_X = new QLineEdit( GroupC1, "LineEdit_X" ); - LineEdit_X->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEdit_X->sizePolicy().hasHeightForWidth() ) ); - LineEdit_X->setMinimumSize( QSize( 70, 0 ) ); - //LineEdit_X->setEnabled( FALSE ); - LineEdit_X->setReadOnly( TRUE ); - GroupC1Layout->addWidget( LineEdit_X, 1, 2 ); - TextLabel_Z = new QLabel( GroupC1, "TextLabel_Z" ); - TextLabel_Z->setText( tr( "GEOM_Z" ) ); - TextLabel_Z->setMinimumSize( QSize( 15, 0 ) ); - TextLabel_Z->setFrameShape( QLabel::NoFrame ); - TextLabel_Z->setFrameShadow( QLabel::Plain ); - TextLabel_Z->setMaximumSize( QSize( 15, 32767 ) ); - GroupC1Layout->addWidget( TextLabel_Z, 1, 5 ); - LineEdit_Z = new QLineEdit( GroupC1, "LineEdit_Z" ); - LineEdit_Z->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEdit_Z->sizePolicy().hasHeightForWidth() ) ); - LineEdit_Z->setMinimumSize( QSize( 70, 0 ) ); - //LineEdit_Z->setEnabled( FALSE ); - LineEdit_Z->setReadOnly( TRUE ); - GroupC1Layout->addWidget( LineEdit_Z, 1, 6 ); - TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" ); - TextLabelC1A1->setText( tr( "GEOM_OBJECT" ) ); - TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A1->setFrameShape( QLabel::NoFrame ); - TextLabelC1A1->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabelC1A1, 0, 0 ); - LineEdit_Y = new QLineEdit( GroupC1, "LineEdit_Y" ); - LineEdit_Y->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEdit_Y->sizePolicy().hasHeightForWidth() ) ); - LineEdit_Y->setMinimumSize( QSize( 70, 0 ) ); - //LineEdit_Y->setEnabled( FALSE ); - LineEdit_Y->setReadOnly( TRUE ); - GroupC1Layout->addWidget( LineEdit_Y, 1, 4 ); - TextLabel_Y = new QLabel( GroupC1, "TextLabel_Y" ); - TextLabel_Y->setText( tr( "GEOM_Y" ) ); - TextLabel_Y->setMinimumSize( QSize( 15, 0 ) ); - TextLabel_Y->setFrameShape( QLabel::NoFrame ); - TextLabel_Y->setFrameShadow( QLabel::Plain ); - TextLabel_Y->setMaximumSize( QSize( 15, 32767 ) ); - GroupC1Layout->addWidget( TextLabel_Y, 1, 3 ); - TextLabel_X = new QLabel( GroupC1, "TextLabel_X" ); - TextLabel_X->setText( tr( "GEOM_X" ) ); - TextLabel_X->setMinimumSize( QSize( 15, 0 ) ); - TextLabel_X->setFrameShape( QLabel::NoFrame ); - TextLabel_X->setFrameShadow( QLabel::Plain ); - TextLabel_X->setMaximumSize( QSize( 15, 32767 ) ); - GroupC1Layout->addWidget( TextLabel_X, 1, 1 ); - TextLabel_Center = new QLabel( GroupC1, "TextLabel_Center" ); - TextLabel_Center->setText( tr( "GEOM_CENTER" ) ); - TextLabel_Center->setMinimumSize( QSize( 50, 0 ) ); - TextLabel_Center->setFrameShape( QLabel::NoFrame ); - TextLabel_Center->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabel_Center, 1, 0 ); - LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" ); - LineEditC1A1->setMinimumSize( QSize( 260, 0 ) ); - GroupC1Layout->addMultiCellWidget( LineEditC1A1, 0, 0, 2, 6 ); - GeometryGUI_CenterMassDlgLayout->addWidget( GroupC1, 1, 0 ); - /***************************************************************/ - - Init(Sel) ; /* Initialisations */ - -} - - -//================================================================================= -// function : ~GeometryGUI_CenterMassDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_CenterMassDlg::~GeometryGUI_CenterMassDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_CenterMassDlg::Init( SALOME_Selection* Sel ) -{ - LineEdit_X->setMaxLength( 9 ); - LineEdit_Y->setMaxLength( 9 ); - LineEdit_Z->setMaxLength( 9 ); - QDoubleValidator *Va = new QDoubleValidator( -999999, +999999, 3, LineEdit_X ) ; - QDoubleValidator *Vb = new QDoubleValidator( -999999, +999999, 3, LineEdit_Y ) ; - QDoubleValidator *Vc = new QDoubleValidator( -999999, +999999, 3, LineEdit_Z ) ; - LineEdit_X->setValidator( Va ) ; - LineEdit_Y->setValidator( Vb ) ; - LineEdit_Z->setValidator( Vc ) ; - - myConstructorId = 0 ; - - LineEdit_X->setText("") ; - LineEdit_Y->setText("") ; - LineEdit_Z->setText("") ; - - Constructor1->setChecked( TRUE ); - myEditCurrentArgument = LineEditC1A1 ; - mySelection = Sel; - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - mySimulationTopoDs.Nullify() ; - myShape.Nullify() ; - myOkCenterMass = false ; - - // TODO : previous selection into argument ? - - /* Filter definitions */ - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - - /* signals and slots connections */ - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ) ; - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ; - connect( buttonApply, SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) ); - connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) ); - connect( SelectButtonC1A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - - connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ; - /* to close dialog if study change */ - connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ; - - /* Move widget on the botton right corner of main widget */ - int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; - this->show() ; /* displays Dialog */ - - return ; -} - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_CenterMassDlg::ConstructorsClicked(int constructorId) -{ - return ; -} - - - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void GeometryGUI_CenterMassDlg::ClickOnCancel() -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->ResetState() ; - reject() ; - return ; -} - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_CenterMassDlg::ClickOnOk() -{ - this->ClickOnApply() ; - this->ClickOnCancel() ; - - return ; -} - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_CenterMassDlg::ClickOnApply() -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - myGeomGUI->GetDesktop()->putInfo( tr("") ) ; - if( myOkCenterMass) { - myGeomGUI->MakeCDGAndDisplay( myGeomShape ) ; - } - return ; -} - - - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -//================================================================================= -void GeometryGUI_CenterMassDlg::SelectionIntoArgument() -{ - myGeomGUI->EraseSimulationShape() ; - myEditCurrentArgument->setText("") ; - myOkCenterMass = false ; - Standard_Boolean testResult ; - - LineEdit_X->setText("") ; - LineEdit_Y->setText("") ; - LineEdit_Z->setText("") ; - - QString aString = ""; /* future the name of selection */ - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; - if ( nbSel != 1 ) { - return ; - } - - /* nbSel == 1 */ - Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject() ; - if( !myGeomGUI->GetTopoFromSelection(mySelection, this->myShape) ) - return ; - - myGeomShape = myGeomGUI->ConvertIOinGEOMShape(IO, testResult) ; - if( !testResult ) - return ; - myEditCurrentArgument->setText(aString) ; - if( this->CalculateAndDisplayCenterMass() ) { - myOkCenterMass = true ; - } - - return ; -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_CenterMassDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - switch (myConstructorId) - { - case 0: /* default constructor */ - { - if(send == SelectButtonC1A1) { - LineEditC1A1->setFocus() ; - myEditCurrentArgument = LineEditC1A1; - } - SelectionIntoArgument() ; - break; - } - } - return ; -} - - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_CenterMassDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if( send == LineEditC1A1 ) - myEditCurrentArgument = LineEditC1A1 ; - else - return ; - - /* User name of object input management */ - /* If successfull the selection is changed and signal emitted... */ - /* so SelectionIntoArgument() is automatically called. */ - const QString objectUserName = myEditCurrentArgument->text() ; - QWidget* thisWidget = (QWidget*)this ; - if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) { - myEditCurrentArgument->setText( objectUserName ) ; - } - return ; -} - - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void GeometryGUI_CenterMassDlg::DeactivateActiveDialog() -{ - if ( GroupConstructors->isEnabled() ) { - myGeomGUI->EraseSimulationShape() ; - disconnect( mySelection, 0, this, 0 ); - GroupConstructors->setEnabled(false) ; - GroupC1->setEnabled(false) ; - GroupButtons->setEnabled(false) ; - } - return ; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_CenterMassDlg::ActivateThisDialog() -{ - /* Emit a signal to deactivate the active dialog */ - myGeomGUI->EmitSignalDeactivateDialog() ; - GroupConstructors->setEnabled(true) ; - GroupC1->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - if( !mySimulationTopoDs.IsNull() ) - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - return ; -} - - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void GeometryGUI_CenterMassDlg::enterEvent(QEvent* e) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; - return ; -} - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_CenterMassDlg::closeEvent( QCloseEvent* e ) -{ - /* same than click on cancel button */ - this->ClickOnCancel() ; - return ; -} - - -//================================================================================= -// function : CalculateAndDisplayCenterMass() -// purpose : -//================================================================================= -bool GeometryGUI_CenterMassDlg::CalculateAndDisplayCenterMass() -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - - try { - - QString resString; - GProp_GProps System; - - if ( this->myShape.ShapeType() == TopAbs_VERTEX) { - myGeomGUI->VertexToPoint( this->myShape, this->myCenterMass ); - } - else if ( this->myShape.ShapeType() == TopAbs_EDGE || this->myShape.ShapeType() == TopAbs_WIRE ) { - BRepGProp::LinearProperties(this->myShape, System); - this->myCenterMass = System.CentreOfMass() ; - } - else if ( this->myShape.ShapeType() == TopAbs_FACE || this->myShape.ShapeType() == TopAbs_SHELL ) { - BRepGProp::SurfaceProperties(this->myShape, System); - this->myCenterMass = System.CentreOfMass() ; - } - else { - BRepGProp::VolumeProperties(this->myShape, System); - this->myCenterMass = System.CentreOfMass() ; - } - - BRepBuilderAPI_MakeVertex V(this->myCenterMass) ; - mySimulationTopoDs = V.Shape() ; - - resString = tr("%1").arg( myCenterMass.X(), 12, 'f', 6 ) ; - LineEdit_X->setText(resString) ; - - resString = tr("%1").arg( myCenterMass.Y(), 12, 'f', 6 ) ; - LineEdit_Y->setText(resString) ; - - resString = tr("%1").arg( myCenterMass.Z(), 12, 'f', 6 ) ; - LineEdit_Z->setText(resString) ; - - - if( !mySimulationTopoDs.IsNull() ) { - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - return true ; - } - } - catch(Standard_Failure) { - MESSAGE("Catch intercepted in CalculateAndDisplayCenterMass()" << endl ) ; - } - return false ; -} - - diff --git a/src/GEOMGUI/GeometryGUI_CenterMassDlg.h b/src/GEOMGUI/GeometryGUI_CenterMassDlg.h deleted file mode 100644 index c56720724..000000000 --- a/src/GEOMGUI/GeometryGUI_CenterMassDlg.h +++ /dev/null @@ -1,121 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_CenterMassDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM - -#ifndef DIALOGBOX_CMASS_H -#define DIALOGBOX_CMASS_H - -#include "SALOME_Selection.h" -#include "GEOM_ShapeTypeFilter.hxx" - -#include -#include -#include - -#include -#include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QRadioButton; -class GeometryGUI; - -//================================================================================= -// class : GeometryGUI_CenterMassDlg -// purpose : -//================================================================================= -class GeometryGUI_CenterMassDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_CenterMassDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 ); - ~GeometryGUI_CenterMassDlg(); - -private: - - void Init( SALOME_Selection* Sel ) ; - void closeEvent( QCloseEvent* e ) ; - void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */ - bool CalculateAndDisplayCenterMass() ; - - GEOM::GEOM_Gen_var myGeom ; /* Current GeomI object */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - SALOME_Selection* mySelection ; /* User shape selection */ - TopoDS_Shape mySimulationTopoDs; /* Shape used for simulation display */ - - GEOM::GEOM_Shape_var myGeomShape ; /* is myBase */ - TopoDS_Shape myShape ; /* Shape argument */ - gp_Pnt myCenterMass ; - bool myOkCenterMass ; /* true after center of mass simulation calculation */ - - int myConstructorId ; /* Current constructor id = radio button id */ - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - - QGroupBox* GroupButtons; - QPushButton* buttonOk; - QPushButton* buttonCancel; - QPushButton* buttonApply; - QButtonGroup* GroupConstructors; - QRadioButton* Constructor1; - QGroupBox* GroupC1; - QPushButton* SelectButtonC1A1; - QLineEdit* LineEdit_X; - QLabel* TextLabel_Z; - QLineEdit* LineEdit_Z; - QLabel* TextLabelC1A1; - QLineEdit* LineEdit_Y; - QLabel* TextLabel_Y; - QLabel* TextLabel_X; - QLabel* TextLabel_Center; - QLineEdit* LineEditC1A1; - -private slots: - - void ConstructorsClicked(int constructorId); - void ClickOnCancel(); - void ClickOnOk() ; - void ClickOnApply(); - void SetEditCurrentArgument() ; - void LineEditReturnPressed() ; - void SelectionIntoArgument() ; - void DeactivateActiveDialog() ; - void ActivateThisDialog() ; - -protected: - QGridLayout* GeometryGUI_CenterMassDlgLayout; - QGridLayout* GroupButtonsLayout; - QGridLayout* GroupConstructorsLayout; - QGridLayout* GroupC1Layout; -}; - -#endif // DIALOGBOX_CMASS_H diff --git a/src/GEOMGUI/GeometryGUI_ChamferDlg.cxx b/src/GEOMGUI/GeometryGUI_ChamferDlg.cxx deleted file mode 100644 index c0892f768..000000000 --- a/src/GEOMGUI/GeometryGUI_ChamferDlg.cxx +++ /dev/null @@ -1,934 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_ChamferDlg.cxx -// Author : Damien COQUERET -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_ChamferDlg.h" - -#include "GeometryGUI.h" -#include "QAD_Application.h" -#include "QAD_Desktop.h" -#include "QAD_Config.h" -#include "QAD_RightFrame.h" -#include "OCCViewer_Viewer3d.h" -#include "utilities.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - -//================================================================================= -// class : GeometryGUI_ChamferDlg() -// purpose : Constructs a GeometryGUI_ChamferDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_ChamferDlg::GeometryGUI_ChamferDlg( QWidget* parent, - const char* name, - SALOME_Selection* Sel, - Handle (AIS_InteractiveContext) ic, - bool modal, - WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - /***************************************************************/ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_CHAMFER_ALL"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_CHAMFER_EDGE"))); - QPixmap image3(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_CHAMFER_FACE"))); - - if ( !name ) - setName( "GeometryGUI_ChamferDlg" ); - resize( 365, 220 ); - setCaption( tr( "GEOM_CHAMFER_TITLE" ) ); - setSizeGripEnabled( TRUE ); - GeometryGUI_ChamferDlgLayout = new QGridLayout( this ); - GeometryGUI_ChamferDlgLayout->setSpacing( 6 ); - GeometryGUI_ChamferDlgLayout->setMargin( 11 ); - - /***************************************************************/ - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); - GroupButtons->setTitle( tr( "" ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 3 ); - buttonApply = new QPushButton( GroupButtons, "buttonApply" ); - buttonApply->setText( tr( "GEOM_BUT_APPLY" ) ); - buttonApply->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonApply, 0, 1 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer, 0, 2 ); - buttonOk = new QPushButton( GroupButtons, "buttonOk" ); - buttonOk->setText( tr( "GEOM_BUT_OK" ) ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - GeometryGUI_ChamferDlgLayout->addWidget( GroupButtons, 2, 0 ); - - /***************************************************************/ - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "GEOM_CHAMFER" ) ); - GroupConstructors->setExclusive( TRUE ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setText( tr( "" ) ); - Constructor1->setPixmap( image0 ); - Constructor1->setChecked( TRUE ); - Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) ); - Constructor1->setMinimumSize( QSize( 50, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - Constructor2 = new QRadioButton( GroupConstructors, "Constructor2" ); - Constructor2->setText( tr( "" ) ); - Constructor2->setPixmap( image2 ); - Constructor2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor2->sizePolicy().hasHeightForWidth() ) ); - Constructor2->setMinimumSize( QSize( 50, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor2, 0, 2 ); - QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer_2, 0, 3 ); - QSpacerItem* spacer_3 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer_3, 0, 1 ); - Constructor3 = new QRadioButton( GroupConstructors, "Constructor3" ); - Constructor3->setText( tr( "" ) ); - Constructor3->setPixmap( image3 ); - Constructor3->setMinimumSize( QSize( 50, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor3, 0, 4 ); - QSpacerItem* spacer_4 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer_4, 0, 5 ); - GeometryGUI_ChamferDlgLayout->addWidget( GroupConstructors, 0, 0 ); - - /***************************************************************/ - GroupC1 = new QGroupBox( this, "GroupC1" ); - GroupC1->setTitle( tr( "GEOM_CHAMFER_ALL" ) ); - GroupC1->setMinimumSize( QSize( 0, 0 ) ); - GroupC1->setFrameShape( QGroupBox::Box ); - GroupC1->setFrameShadow( QGroupBox::Sunken ); - GroupC1->setColumnLayout(0, Qt::Vertical ); - GroupC1->layout()->setSpacing( 0 ); - GroupC1->layout()->setMargin( 0 ); - GroupC1Layout = new QGridLayout( GroupC1->layout() ); - GroupC1Layout->setAlignment( Qt::AlignTop ); - GroupC1Layout->setSpacing( 6 ); - GroupC1Layout->setMargin( 11 ); - - TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" ); - TextLabelC1A1->setText( tr( "GEOM_MAIN_OBJECT" ) ); - TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A1->setFrameShape( QLabel::NoFrame ); - TextLabelC1A1->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabelC1A1, 0, 0 ); - - TextLabelC1A2 = new QLabel( GroupC1, "TextLabelC1A2" ); - TextLabelC1A2->setText( tr( "GEOM_D1" ) ); - TextLabelC1A2->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A2->setFrameShape( QLabel::NoFrame ); - TextLabelC1A2->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabelC1A2, 1, 0 ); - - TextLabelC1A3 = new QLabel( GroupC1, "TextLabelC1A3" ); - TextLabelC1A3->setText( tr( "GEOM_D2" ) ); - TextLabelC1A3->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A3->setFrameShape( QLabel::NoFrame ); - TextLabelC1A3->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabelC1A3, 2, 0 ); - - LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" ); - GroupC1Layout->addWidget( LineEditC1A1, 0, 2 ); - -// LineEditC1A2 = new QLineEdit( GroupC1, "LineEditC1A2" ); -// LineEditC1A2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC1A2->sizePolicy().hasHeightForWidth() ) ); -// GroupC1Layout->addWidget( LineEditC1A2, 1, 2 ); - -// LineEditC1A3 = new QLineEdit( GroupC1, "LineEditC1A3" ); -// LineEditC1A3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC1A3->sizePolicy().hasHeightForWidth() ) ); -// GroupC1Layout->addWidget( LineEditC1A3, 2, 2 ); - - SpinBox_C1A2 = new GeometryGUI_SpinBox( GroupC1, "GeomSpinBox_C1A2" ) ; - SpinBox_C1A2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, SpinBox_C1A2->sizePolicy().hasHeightForWidth() ) ); - GroupC1Layout->addWidget( SpinBox_C1A2, 1, 2 ); - - SpinBox_C1A3 = new GeometryGUI_SpinBox( GroupC1, "GeomSpinBox_C1A3" ) ; - SpinBox_C1A3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, SpinBox_C1A3->sizePolicy().hasHeightForWidth() ) ); - GroupC1Layout->addWidget( SpinBox_C1A3, 2, 2 ); - - SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" ); - SelectButtonC1A1->setText( tr( "" ) ); - SelectButtonC1A1->setPixmap( image1 ); - SelectButtonC1A1->setToggleButton( FALSE ); - SelectButtonC1A1->setMaximumSize( QSize( 28, 32767 ) ); - GroupC1Layout->addWidget( SelectButtonC1A1, 0, 1 ); - GeometryGUI_ChamferDlgLayout->addWidget( GroupC1, 1, 0 ); - - /***************************************************************/ - GroupC2 = new QGroupBox( this, "GroupC2" ); - GroupC2->setTitle( tr( "GEOM_CHAMFER_EDGES" ) ); - GroupC2->setMinimumSize( QSize( 0, 0 ) ); - GroupC2->setFrameShape( QGroupBox::Box ); - GroupC2->setFrameShadow( QGroupBox::Sunken ); - GroupC2->setColumnLayout(0, Qt::Vertical ); - GroupC2->layout()->setSpacing( 0 ); - GroupC2->layout()->setMargin( 0 ); - GroupC2Layout = new QGridLayout( GroupC2->layout() ); - GroupC2Layout->setAlignment( Qt::AlignTop ); - GroupC2Layout->setSpacing( 6 ); - GroupC2Layout->setMargin( 11 ); - - TextLabelC2A1 = new QLabel( GroupC2, "TextLabelC2A1" ); - TextLabelC2A1->setText( tr( "GEOM_MAIN_OBJECT" ) ); - TextLabelC2A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC2A1->setFrameShape( QLabel::NoFrame ); - TextLabelC2A1->setFrameShadow( QLabel::Plain ); - GroupC2Layout->addWidget( TextLabelC2A1, 0, 0 ); - - TextLabelC2A2 = new QLabel( GroupC2, "TextLabelC2A2" ); - TextLabelC2A2->setText( tr( "GEOM_D1" ) ); - TextLabelC2A2->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC2A2->setFrameShape( QLabel::NoFrame ); - TextLabelC2A2->setFrameShadow( QLabel::Plain ); - GroupC2Layout->addWidget( TextLabelC2A2, 1, 0 ); - - TextLabelC2A3 = new QLabel( GroupC2, "TextLabelC2A3" ); - TextLabelC2A3->setText( tr( "GEOM_D2" ) ); - TextLabelC2A3->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC2A3->setFrameShape( QLabel::NoFrame ); - TextLabelC2A3->setFrameShadow( QLabel::Plain ); - GroupC2Layout->addWidget( TextLabelC2A3, 2, 0 ); - - LineEditC2A1 = new QLineEdit( GroupC2, "LineEditC2A1" ); - GroupC2Layout->addWidget( LineEditC2A1, 0, 2 ); - - // LineEditC2A2 = new QLineEdit( GroupC2, "LineEditC2A2" ); -// LineEditC2A2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC2A2->sizePolicy().hasHeightForWidth() ) ); -// GroupC2Layout->addWidget( LineEditC2A2, 1, 2 ); - -// LineEditC2A3 = new QLineEdit( GroupC2, "LineEditC2A3" ); -// LineEditC2A3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC2A3->sizePolicy().hasHeightForWidth() ) ); -// GroupC2Layout->addWidget( LineEditC2A3, 2, 2 ); - - SpinBox_C2A2 = new GeometryGUI_SpinBox( GroupC2, "GeomSpinBox_C2A2" ) ; - SpinBox_C2A2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, SpinBox_C2A2->sizePolicy().hasHeightForWidth() ) ); - GroupC2Layout->addWidget( SpinBox_C2A2, 1, 2 ); - - SpinBox_C2A3 = new GeometryGUI_SpinBox( GroupC2, "GeomSpinBox_C2A3" ) ; - SpinBox_C2A3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, SpinBox_C2A3->sizePolicy().hasHeightForWidth() ) ); - GroupC2Layout->addWidget( SpinBox_C2A3, 2, 2 ); - - SelectButtonC2A1 = new QPushButton( GroupC2, "SelectButtonC2A1" ); - SelectButtonC2A1->setText( tr( "" ) ); - SelectButtonC2A1->setPixmap( image1 ); - SelectButtonC2A1->setToggleButton( FALSE ); - SelectButtonC2A1->setMaximumSize( QSize( 28, 32767 ) ); - GroupC2Layout->addWidget( SelectButtonC2A1, 0, 1 ); - GeometryGUI_ChamferDlgLayout->addWidget( GroupC2, 1, 0 ); - - /***************************************************************/ - GroupC3 = new QGroupBox( this, "GroupC3" ); - GroupC3->setTitle( tr( "GEOM_CHAMFER_FACES" ) ); - GroupC3->setMinimumSize( QSize( 0, 0 ) ); - GroupC3->setFrameShape( QGroupBox::Box ); - GroupC3->setFrameShadow( QGroupBox::Sunken ); - GroupC3->setColumnLayout(0, Qt::Vertical ); - GroupC3->layout()->setSpacing( 0 ); - GroupC3->layout()->setMargin( 0 ); - GroupC3Layout = new QGridLayout( GroupC3->layout() ); - GroupC3Layout->setAlignment( Qt::AlignTop ); - GroupC3Layout->setSpacing( 6 ); - GroupC3Layout->setMargin( 11 ); - - TextLabelC3A1 = new QLabel( GroupC3, "TextLabelC3A1" ); - TextLabelC3A1->setText( tr( "GEOM_MAIN_OBJECT" ) ); - TextLabelC3A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC3A1->setFrameShape( QLabel::NoFrame ); - TextLabelC3A1->setFrameShadow( QLabel::Plain ); - GroupC3Layout->addWidget( TextLabelC3A1, 0, 0 ); - - TextLabelC3A2 = new QLabel( GroupC3, "TextLabelC3A2" ); - TextLabelC3A2->setText( tr( "GEOM_D1" ) ); - TextLabelC3A2->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC3A2->setFrameShape( QLabel::NoFrame ); - TextLabelC3A2->setFrameShadow( QLabel::Plain ); - GroupC3Layout->addWidget( TextLabelC3A2, 1, 0 ); - - TextLabelC3A3 = new QLabel( GroupC3, "TextLabelC3A3" ); - TextLabelC3A3->setText( tr( "GEOM_D2" ) ); - TextLabelC3A3->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC3A3->setFrameShape( QLabel::NoFrame ); - TextLabelC3A3->setFrameShadow( QLabel::Plain ); - GroupC3Layout->addWidget( TextLabelC3A3, 2, 0 ); - - LineEditC3A1 = new QLineEdit( GroupC3, "LineEditC3A1" ); - GroupC3Layout->addWidget( LineEditC3A1, 0, 2 ); - - // LineEditC3A2 = new QLineEdit( GroupC3, "LineEditC3A2" ); -// LineEditC3A2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC3A2->sizePolicy().hasHeightForWidth() ) ); -// GroupC3Layout->addWidget( LineEditC3A2, 1, 2 ); - -// LineEditC3A3 = new QLineEdit( GroupC3, "LineEditC3A3" ); -// LineEditC3A3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC3A3->sizePolicy().hasHeightForWidth() ) ); -// GroupC3Layout->addWidget( LineEditC3A3, 2, 2 ); - - SpinBox_C3A2 = new GeometryGUI_SpinBox( GroupC3, "GeomSpinBox_C3A2" ) ; - SpinBox_C3A2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, SpinBox_C3A2->sizePolicy().hasHeightForWidth() ) ); - GroupC3Layout->addWidget( SpinBox_C3A2, 1, 2 ); - - SpinBox_C3A3 = new GeometryGUI_SpinBox( GroupC3, "GeomSpinBox_C3A3" ) ; - SpinBox_C3A3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, SpinBox_C3A3->sizePolicy().hasHeightForWidth() ) ); - GroupC3Layout->addWidget( SpinBox_C3A3, 2, 2 ); - - SelectButtonC3A1 = new QPushButton( GroupC3, "SelectButtonC3A1" ); - SelectButtonC3A1->setText( tr( "" ) ); - SelectButtonC3A1->setPixmap( image1 ); - SelectButtonC3A1->setToggleButton( FALSE ); - SelectButtonC3A1->setMaximumSize( QSize( 28, 32767 ) ); - GroupC3Layout->addWidget( SelectButtonC3A1, 0, 1 ); - GeometryGUI_ChamferDlgLayout->addWidget( GroupC3, 1, 0 ); - - /* Initialisation */ - Init( Sel, ic ) ; -} - - -//================================================================================= -// function : ~GeometryGUI_ChamferDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_ChamferDlg::~GeometryGUI_ChamferDlg() -{ - /* no need to delete child widgets, Qt does it all for us */ - this->destroy(TRUE, TRUE) ; -} - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_ChamferDlg::Init( SALOME_Selection* Sel, Handle (AIS_InteractiveContext) ic ) -{ - - /* Get setting of step value from file configuration */ - double step ; - QString St = QAD_CONFIG->getSetting( "Geometry:SettingsGeomStep" ) ; - step = St.toDouble() ; - - /* min, max, step and decimals for spin boxes */ - SpinBox_C1A2->RangeStepAndValidator( 0.001, 999.999, step, 3 ) ; /* myD1 */ - SpinBox_C1A2->SetValue( 50 ) ; - SpinBox_C1A3->RangeStepAndValidator( 0.001, 999.999, step, 3 ) ; /* myD2 */ - SpinBox_C1A3->SetValue( 50 ) ; - - SpinBox_C2A2->RangeStepAndValidator( 0.001, 999.999, step, 3 ) ; - SpinBox_C2A2->SetValue( 50 ) ; - SpinBox_C2A3->RangeStepAndValidator( 0.001, 999.999, step, 3 ) ; - SpinBox_C2A3->SetValue( 50 ) ; - - SpinBox_C3A2->RangeStepAndValidator( 0.001, 999.999, step, 3 ) ; - SpinBox_C3A2->SetValue( 50 ) ; - SpinBox_C3A3->RangeStepAndValidator( 0.001, 999.999, step, 3 ) ; - SpinBox_C3A3->SetValue( 50 ) ; - - GroupC1->show(); - GroupC2->hide() ; - GroupC3->hide() ; - myConstructorId = 0 ; - Constructor1->setChecked( TRUE ); - - mySelection = Sel ; - myEditCurrentArgument = LineEditC1A1 ; - myShape.Nullify() ; - myD1 = 50.0 ; - myOkD1 = true ; - myD2 = 50.0 ; - myOkD2 = true ; - myIC = ic ; - myUseLocalContext = false ; - myOkShape = false ; - - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - - mySimulationTopoDs.Nullify() ; - - /* Filters definition */ - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - - /* signals and slots connections */ - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); - connect( buttonApply, SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ; - connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) ); - connect( SelectButtonC1A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( SelectButtonC2A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( SelectButtonC3A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - - connect( SpinBox_C1A2, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ; - connect( SpinBox_C2A2, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ; - connect( SpinBox_C3A2, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ; - - connect( SpinBox_C1A3, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ; - connect( SpinBox_C2A3, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ; - connect( SpinBox_C3A3, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ; - - connect( LineEditC1A1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - connect( LineEditC2A1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - connect( LineEditC3A1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ; - /* to close dialog if study change */ - connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ; - - /* Move widget on the botton right corner of main widget */ - int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; - this->show() ; /* Displays Dialog */ - - return ; -} - - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_ChamferDlg::ConstructorsClicked(int constructorId) -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - - myEditCurrentArgument->setText(tr("")) ; - - if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) { - OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer(); - myIC = v3d->getAISContext(); - if(myUseLocalContext ) { - myIC->CloseLocalContext(this->myLocalContextId); - myGeomGUI->OnDisplayAll(true) ; - myUseLocalContext = false ; - } - } - - myOkShape = false ; - myD1 = 50.0 ; - myD2 = 50.0 ; - myOkD1 = true ; - myOkD2 = true ; - myConstructorId = constructorId ; - - switch (constructorId) - { - case 0: /* Chamfer All */ - { - GroupC1->show(); - GroupC2->hide() ; - GroupC3->hide() ; - myEditCurrentArgument = LineEditC1A1 ; - SpinBox_C1A2->SetValue( 50 ) ; - SpinBox_C1A3->SetValue( 50 ) ; - LineEditC1A1->setText(tr("")) ; - myShapeType = -1; - break; - } - - case 1: /* Chamfer edges */ - { - myShapeType = 6; - GroupC1->hide(); - GroupC2->show() ; - GroupC3->hide() ; - myEditCurrentArgument = LineEditC2A1 ; - SpinBox_C2A2->SetValue( 50 ) ; - SpinBox_C2A3->SetValue( 50 ) ; - LineEditC2A1->setText(tr("")) ; - break ; - } - - case 2: /* Chamfer Faces */ - { - myShapeType = 4; - GroupC1->hide(); - GroupC2->hide() ; - GroupC3->show() ; - myEditCurrentArgument = LineEditC3A1 ; - SpinBox_C3A2->SetValue( 50 ) ; - SpinBox_C3A3->SetValue( 50 ) ; - LineEditC3A1->setText(tr("")) ; - break ; - } - } - return ; -} - - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_ChamferDlg::ClickOnApply() -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - - bool testResult = false ; - myGeomGUI->GetDesktop()->putInfo( tr("") ) ; - - switch(myConstructorId) - { - case 0 : /* Chamfer All */ - { - if(myOkD1 && myOkD2) { - if( myOkShape ) { - testResult = myGeomGUI->OnChamferGetAll( myShape, myD1, myD2, myShapeType, myShapeIOR ) ; - } - } - if( !testResult ) { - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT")) ; - } - else { - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE")) ; - } - /* Reset all arguments and local context to allow user a new selection ...*/ - this->ResetStateOfDialog() ; - break ; - } - - case 1 : /* Chamfer Edge */ - { - if(myOkD1 && myOkD2) { - if( myOkShape ) { - testResult = myGeomGUI->OnChamferGetSelected( myShape, myShapeIOR, myD1, myD2, myShapeType, - myLocalContextId, myUseLocalContext ); - } - } - if( !testResult ) { - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT")) ; - } - else { - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE")) ; - } - /* Reset all arguments and local context to allow user a new selection ...*/ - this->ResetStateOfDialog() ; - break ; - } - - case 2 : /* Chamfer Face */ - { - if(myOkD1 && myOkD2) { - if( myOkShape ) { - testResult = myGeomGUI->OnChamferGetSelected( myShape, myShapeIOR, myD1, myD2, myShapeType, - myLocalContextId, myUseLocalContext ) ; - } - } - if( !testResult ) { - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT")) ; - } - else { - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE")) ; - } - /* Reset all arguments and local context to allow user a new selection ...*/ - this->ResetStateOfDialog() ; - break ; - } - } - - // accept(); - return ; -} - - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void GeometryGUI_ChamferDlg::ClickOnCancel() -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->ResetState() ; - - if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) { - OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer(); - myIC = v3d->getAISContext(); - if(this->myUseLocalContext ) { - myIC->CloseLocalContext(this->myLocalContextId) ; - this->myUseLocalContext = false ; - myGeomGUI->OnDisplayAll(true) ; - } - } - - reject() ; - return ; -} - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_ChamferDlg::ClickOnOk() -{ - this->ClickOnApply() ; - this->ClickOnCancel() ; - - return ; -} - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection has changed -//================================================================================= -void GeometryGUI_ChamferDlg::SelectionIntoArgument() -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - - /* Reset all arguments and local context when selection as changed */ - this->ResetStateOfDialog() ; - - /* Future name of argument */ - QString aString = ""; - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; - if ( nbSel == 1 ) { - - TopoDS_Shape S ; - Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject() ; - - if( !myGeomGUI->GetTopoFromSelection(mySelection, S) ) - return ; - - if( !IO->hasEntry() ) { - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY")) ; - return ; - } - - if ( !S.IsNull() && S.ShapeType() <= 2 ) { - if ( IO->IsInstance(STANDARD_TYPE(GEOM_InteractiveObject)) ) { - Handle(GEOM_InteractiveObject) GIObject = Handle(GEOM_InteractiveObject)::DownCast( IO ); - myShapeIOR = GIObject->getIOR(); /* the Geom IOR string of selection */ - myEditCurrentArgument->setText(aString) ; - myShape = S ; - myOkShape = true ; - } - - if ( IO->hasEntry() ) { - SALOMEDS::Study_var aStudy = myGeomGUI->GetActiveStudy()->getStudyDocument(); - SALOMEDS::SObject_var obj = aStudy->FindObjectID( IO->getEntry() ); - SALOMEDS::GenericAttribute_var anAttr; - SALOMEDS::AttributeIOR_var anIOR; - if ( !obj->_is_nil() ) { - if (obj->FindAttribute(anAttr, "AttributeIOR")) { - anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr); - myShapeIOR = anIOR->Value(); - myOkShape = true ; - myShape = S ; - myEditCurrentArgument->setText(aString) ; - } - } - } - - MakePreview(); - - } - } else - return; - - if( myOkShape && myShapeType!=-1 && myConstructorId != 0 ) { - /* local context is defined into the method */ - myGeomGUI->PrepareSubShapeSelection( this->myShapeType, this->myLocalContextId ) ; - myUseLocalContext = true ; - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SELECT_EDGE")) ; - } -} - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_ChamferDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if( send == LineEditC1A1 ) - myEditCurrentArgument = LineEditC1A1 ; - else if ( send == LineEditC2A1 ) - myEditCurrentArgument = LineEditC2A1 ; - else if ( send == LineEditC3A1 ) - myEditCurrentArgument = LineEditC3A1 ; - else - return ; - - /* User name of object input management */ - /* If successfull the selection is changed and signal emitted... */ - /* so SelectionIntoArgument() is automatically called. */ - const QString objectUserName = myEditCurrentArgument->text() ; - QWidget* thisWidget = (QWidget*)this ; - if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) { - myEditCurrentArgument->setText( objectUserName ) ; - } - return ; -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_ChamferDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - - switch (myConstructorId) - { - case 0: - { - if(send == SelectButtonC1A1) { - LineEditC1A1->setFocus() ; - myEditCurrentArgument = LineEditC1A1; - SelectionIntoArgument() ; - } - break; - } - - case 1: - { - if(send ==SelectButtonC2A1 ) { - LineEditC2A1->setFocus() ; - myEditCurrentArgument = LineEditC2A1; - SelectionIntoArgument() ; - } - break; - } - - case 2: - { - if(send ==SelectButtonC3A1 ) { - LineEditC3A1->setFocus() ; - myEditCurrentArgument = LineEditC3A1; - SelectionIntoArgument() ; - } - break; - } - - } - return ; -} - -//================================================================================= -// function : ValueChangedInSpinBox() -// purpose : -//================================================================================= -void GeometryGUI_ChamferDlg::ValueChangedInSpinBox( double newValue ) -{ - QObject* send = (QObject*)sender(); - - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - - - if( send == SpinBox_C1A2 || send == SpinBox_C2A2 || send == SpinBox_C3A2 ) { /* D1 */ - myD1 = newValue ; - myOkD1 = true ; - MakePreview(); - return ; - } - if( send == SpinBox_C1A3 || send == SpinBox_C2A3 || send == SpinBox_C3A3 ) { /* D2 */ - myD2 = newValue ; - myOkD2 = true ; - MakePreview(); - return ; - } -} - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void GeometryGUI_ChamferDlg::DeactivateActiveDialog() -{ - if ( GroupConstructors->isEnabled() ) { - this->ResetStateOfDialog() ; - GroupConstructors->setEnabled(false) ; - GroupC1->setEnabled(false) ; - GroupC2->setEnabled(false) ; - GroupC3->setEnabled(false) ; - GroupButtons->setEnabled(false) ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->ResetState() ; - myGeomGUI->SetActiveDialogBox(0) ; - myGeomGUI->OnDisplayAll(true) ; - } - return ; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_ChamferDlg::ActivateThisDialog() -{ - /* Emit a signal to deactivate the active dialog */ - myGeomGUI->EmitSignalDeactivateDialog() ; - - GroupConstructors->setEnabled(true) ; - GroupC1->setEnabled(true) ; - GroupC2->setEnabled(true) ; - GroupC3->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - - if( !mySimulationTopoDs.IsNull() ) - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - return ; -} - - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void GeometryGUI_ChamferDlg::enterEvent( QEvent* e) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; - return ; -} - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_ChamferDlg::closeEvent( QCloseEvent* e ) -{ - /* same than click on cancel button */ - this->ClickOnCancel() ; - return ; -} - - -//================================================================================= -// function : ResetStateOfDialog() -// purpose : -//================================================================================= -void GeometryGUI_ChamferDlg::ResetStateOfDialog() -{ - this->myOkShape = false ; - this->myEditCurrentArgument->setText("") ; - - /* Close its local contact if opened */ - if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) { - OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer(); - myIC = v3d->getAISContext(); - if(this->myUseLocalContext) { - myIC->CloseLocalContext(this->myLocalContextId) ; - this->myUseLocalContext = false ; - myGeomGUI->OnDisplayAll(true) ; - } - } - return ; -} - -void GeometryGUI_ChamferDlg::MakePreview() -{ - TopoDS_Shape tds ; - try - { - BRepFilletAPI_MakeChamfer MC(myShape); - switch (myConstructorId) - { - case 0: /* Chamfer All */ - { - TopTools_IndexedDataMapOfShapeListOfShape M; - TopExp::MapShapesAndAncestors(myShape,TopAbs_EDGE,TopAbs_FACE,M); - for (int i = 1;i<=M.Extent();i++) - { - TopoDS_Edge E = TopoDS::Edge(M.FindKey(i)); - TopoDS_Face F = TopoDS::Face(M.FindFromIndex(i).First()); - if (!BRepTools::IsReallyClosed(E, F) && !BRep_Tool::Degenerated(E)) - MC.Add(myD1, myD2,E,F); - } - tds = MC.Shape(); - break; - } -// case 1: /* Chamfer edges */ -// case 2: /* Chamfer Faces */ - } - if (!tds.IsNull()) - { - mySimulationTopoDs = tds; - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - } - - } - catch(Standard_Failure) - { - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - } -} diff --git a/src/GEOMGUI/GeometryGUI_ChamferDlg.h b/src/GEOMGUI/GeometryGUI_ChamferDlg.h deleted file mode 100644 index 22fe93ffa..000000000 --- a/src/GEOMGUI/GeometryGUI_ChamferDlg.h +++ /dev/null @@ -1,172 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_ChamferDlg.h -// Author : Damien COQUERET -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_CHAMFER_H -#define DIALOGBOX_CHAMFER_H - -#include "SALOME_Selection.h" -#include "GEOM_ShapeTypeFilter.hxx" -#include "GeometryGUI_SpinBox.h" - -// Qt Includes -#include -#include -#include - -// Open CASCADE Includes -#include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QFrame; -class QGroupBox; -class QLineEdit; -class QPushButton; -class QRadioButton; -class QToolButton; -class QLabel; -class GeometryGUI; - -//================================================================================= -// class : GeometryGUI_ChamferDlg -// purpose : -//================================================================================= -class GeometryGUI_ChamferDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_ChamferDlg( QWidget* parent = 0, - const char* name = 0, - SALOME_Selection* Sel = 0, - Handle (AIS_InteractiveContext) ic = 0, - bool modal = FALSE, - WFlags fl = 0 ); - - ~GeometryGUI_ChamferDlg(); - -private : - - void Init( SALOME_Selection* Sel, Handle (AIS_InteractiveContext) ic ) ; - void closeEvent( QCloseEvent* e ) ; - void enterEvent( QEvent* e); - void ResetStateOfDialog() ; - - /* Interactive and local context management see also : bool myUseLocalContext() */ - Handle (AIS_InteractiveContext) myIC ; /* Interactive context */ - Standard_Integer myLocalContextId ; /* identify a local context used by this method */ - bool myUseLocalContext ; /* true when this method as opened a local context */ - - QDoubleValidator *myVa ; /* Double validator for numeric input */ - QDoubleValidator *myVb ; /* Double validator for numeric input */ - - GEOM::GEOM_Gen_var myGeom ; /* Current Geom object */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - SALOME_Selection* mySelection ; /* User shape selection */ - - TopoDS_Shape myShape ; - bool myOkShape ; - char* myShapeIOR ; - - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - int myConstructorId ; /* Current constructor id = radio button id */ - int myShapeType ; - - TopoDS_Shape mySimulationTopoDs ; /* Shape used for simulation display */ - void MakePreview(); - - bool myOkD1 ; - double myD1 ; - bool myOkD2 ; - double myD2 ; - - QButtonGroup* GroupConstructors; - - QRadioButton* Constructor1; - QRadioButton* Constructor2; - QRadioButton* Constructor3; - - QGroupBox* GroupButtons; - QPushButton* buttonOk; - QPushButton* buttonCancel; - QPushButton* buttonApply; - - QGroupBox* GroupC1; - QPushButton* SelectButtonC1A1; - QLineEdit* LineEditC1A1; - QLabel* TextLabelC1A1; - GeometryGUI_SpinBox* SpinBox_C1A2 ; - QLabel* TextLabelC1A2; - GeometryGUI_SpinBox* SpinBox_C1A3 ; - QLabel* TextLabelC1A3; - - QGroupBox* GroupC2; - QPushButton* SelectButtonC2A1; - QLineEdit* LineEditC2A1; - QLabel* TextLabelC2A1; - GeometryGUI_SpinBox* SpinBox_C2A2 ; - QLabel* TextLabelC2A2; - GeometryGUI_SpinBox* SpinBox_C2A3; - QLabel* TextLabelC2A3; - - QGroupBox* GroupC3; - QPushButton* SelectButtonC3A1; - QLineEdit* LineEditC3A1; - QLabel* TextLabelC3A1; - GeometryGUI_SpinBox* SpinBox_C3A2 ; - QLabel* TextLabelC3A2; - GeometryGUI_SpinBox* SpinBox_C3A3; - QLabel* TextLabelC3A3; - -private slots: - - void ConstructorsClicked(int constructorId); - void ClickOnOk(); - void ClickOnCancel(); - void ClickOnApply(); - void SetEditCurrentArgument() ; - void SelectionIntoArgument() ; - void LineEditReturnPressed() ; - void DeactivateActiveDialog() ; - void ActivateThisDialog() ; - void ValueChangedInSpinBox( double newValue ) ; - -protected: - - QGridLayout* GeometryGUI_ChamferDlgLayout; - QGridLayout* GroupButtonsLayout; - QGridLayout* GroupConstructorsLayout; - QGridLayout* GroupC1Layout; - QGridLayout* GroupC2Layout; - QGridLayout* GroupC3Layout; -}; - -#endif // DIALOGBOX_CHAMFER_H - diff --git a/src/GEOMGUI/GeometryGUI_CheckShape.cxx b/src/GEOMGUI/GeometryGUI_CheckShape.cxx deleted file mode 100644 index d0dfc9fea..000000000 --- a/src/GEOMGUI/GeometryGUI_CheckShape.cxx +++ /dev/null @@ -1,402 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_CheckShape.cxx -// Author : Nicolas REJNERI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_CheckShape.h" - -#include "GeometryGUI.h" -#include "QAD_Application.h" -#include "QAD_Desktop.h" -#include "utilities.h" - -// Open Cascade Include -#include - -// QT Includes -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -//================================================================================= -// class : GeometryGUI_CheckShape() -// purpose : Constructs a GeometryGUI_CheckShape which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_CheckShape::GeometryGUI_CheckShape( QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_CHECKSHAPE"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - - if ( !name ) - setName( "DialogBox_CHECKSHAPE" ); - resize( 303, 275 ); - setCaption( tr( "GEOM_CHECK_TITLE" ) ); - setSizeGripEnabled( TRUE ); - GeometryGUI_CheckShapeLayout = new QGridLayout( this ); - GeometryGUI_CheckShapeLayout->setSpacing( 6 ); - GeometryGUI_CheckShapeLayout->setMargin( 11 ); - - /***************************************************************/ - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "GEOM_CHECK_SHAPE" ) ); - GroupConstructors->setExclusive( TRUE ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setText( tr( "" ) ); - Constructor1->setPixmap( image0 ); - Constructor1->setChecked( TRUE ); - Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, - Constructor1->sizePolicy().hasHeightForWidth() ) ); - Constructor1->setMinimumSize( QSize( 60, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer, 0, 1 ); - GeometryGUI_CheckShapeLayout->addWidget( GroupConstructors, 0, 0 ); - - /***************************************************************/ - GroupConstructor1 = new QGroupBox( this, "GroupConstructor1" ); - GroupConstructor1->setTitle( tr( "GEOM_CHECK_INFOS") ); - GroupConstructor1->setColumnLayout(0, Qt::Vertical ); - GroupConstructor1->layout()->setSpacing( 0 ); - GroupConstructor1->layout()->setMargin( 0 ); - GroupConstructor1Layout = new QGridLayout( GroupConstructor1->layout() ); - GroupConstructor1Layout->setAlignment( Qt::AlignTop ); - GroupConstructor1Layout->setSpacing( 6 ); - GroupConstructor1Layout->setMargin( 11 ); - LineEditC1A1 = new QLineEdit( GroupConstructor1, "LineEditC1A1" ); - LineEditC1A1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC1A1->sizePolicy().hasHeightForWidth() ) ); - GroupConstructor1Layout->addWidget( LineEditC1A1, 0, 2 ); - SelectButtonC1A1 = new QPushButton( GroupConstructor1, "SelectButtonC1A1" ); - SelectButtonC1A1->setText( tr( "" ) ); - SelectButtonC1A1->setPixmap( image1 ); - GroupConstructor1Layout->addWidget( SelectButtonC1A1, 0, 1 ); - TextLabelC1A1 = new QLabel( GroupConstructor1, "TextLabelC1A1" ); - TextLabelC1A1->setText( tr( "GEOM_OBJECTS" ) ); - TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A1->setFrameShape( QLabel::NoFrame ); - TextLabelC1A1->setFrameShadow( QLabel::Plain ); - GroupConstructor1Layout->addWidget( TextLabelC1A1, 0, 0 ); - - Text = new QTextView(GroupConstructor1); - Text->setTextFormat( Qt::PlainText ); - GroupConstructor1Layout->addMultiCellWidget( Text, 1, 1, 0, 2 ); - - GeometryGUI_CheckShapeLayout->addWidget( GroupConstructor1, 1, 0 ); - - /***************************************************************/ - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); - GroupButtons->setTitle( tr( "" ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 1 ); - // buttonApply = new QPushButton( GroupButtons, "buttonApply" ); -// buttonApply->setText( tr( "GEOM_BUT_APPLY" ) ); -// buttonApply->setAutoDefault( TRUE ); -// GroupButtonsLayout->addWidget( buttonApply, 0, 1 ); - QSpacerItem* spacer_8 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_8, 0, 0 ); - QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_9, 0, 2 ); -// buttonOk = new QPushButton( GroupButtons, "buttonOk" ); -// buttonOk->setText( tr( "GEOM_BUT_OK" ) ); -// buttonOk->setAutoDefault( TRUE ); -// buttonOk->setDefault( TRUE ); -// GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - GeometryGUI_CheckShapeLayout->addWidget( GroupButtons, 2, 0 ); - /***************************************************************/ - - Init(Sel) ; /* Initialisations */ -} - - -//================================================================================= -// function : ~GeometryGUI_CheckShape() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_CheckShape::~GeometryGUI_CheckShape() -{ - // no need to delete child widgets, Qt does it all for us -} - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_CheckShape::Init( SALOME_Selection* Sel ) -{ - myConstructorId = 0 ; - Constructor1->setChecked( TRUE ); - myEditCurrentArgument = LineEditC1A1 ; - mySelection = Sel; - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - - // TODO : previous selection into argument ? - - /* Filter definitions */ - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - - /* signals and slots connections */ - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ; - connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) ); - connect( SelectButtonC1A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - - connect( LineEditC1A1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - - connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ; - /* to close dialog if study change */ - connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ; - - SelectedName = ""; - - /* Move widget on the botton right corner of main widget */ - int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; - this->show() ; /* displays Dialog */ - - return ; -} - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_CheckShape::ConstructorsClicked(int constructorId) -{ - return ; -} - - - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void GeometryGUI_CheckShape::ClickOnCancel() -{ - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->ResetState() ; - reject() ; - return ; -} - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -//================================================================================= -void GeometryGUI_CheckShape::SelectionIntoArgument() -{ - Text->setText("") ; - myEditCurrentArgument->setText("") ; - - SelectedName = ""; /* future the name of selection */ - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, SelectedName) ; - if ( nbSel != 1 ) { - return ; - } - - /* nbSel == 1 */ - TopoDS_Shape S; - if( !myGeomGUI->GetTopoFromSelection(mySelection, S) ) - return ; - - if( S.IsNull() ) { - myEditCurrentArgument->setText( "" ); - return ; - } - - LineEditC1A1->setText(SelectedName) ; - this->Check(S) ; - - return ; -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_CheckShape::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - switch (myConstructorId) - { - case 0: /* default constructor */ - { - if(send == SelectButtonC1A1) { - LineEditC1A1->setFocus() ; - myEditCurrentArgument = LineEditC1A1; - } - SelectionIntoArgument() ; - break; - } - } - return ; -} - - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_CheckShape::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if( send == LineEditC1A1 ) - myEditCurrentArgument = LineEditC1A1 ; - else - return ; - - /* User name of object input management */ - /* If successfull the selection is changed and signal emitted... */ - /* so SelectionIntoArgument() is automatically called. */ - const QString objectUserName = myEditCurrentArgument->text() ; - QWidget* thisWidget = (QWidget*)this ; - if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) { - myEditCurrentArgument->setText( objectUserName ) ; - } - return ; -} - - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void GeometryGUI_CheckShape::DeactivateActiveDialog() -{ - if ( GroupConstructors->isEnabled() ) { - disconnect( mySelection, 0, this, 0 ); - GroupConstructors->setEnabled(false) ; - GroupConstructor1->setEnabled(false) ; - GroupButtons->setEnabled(false) ; - } - return ; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_CheckShape::ActivateThisDialog() -{ - /* Emit a signal to deactivate the active dialog */ - myGeomGUI->EmitSignalDeactivateDialog() ; - GroupConstructors->setEnabled(true) ; - GroupConstructor1->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - return ; -} - - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void GeometryGUI_CheckShape::enterEvent(QEvent* e) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; - return ; -} - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_CheckShape::closeEvent( QCloseEvent* e ) -{ - /* same than click on cancel button */ - this->ClickOnCancel() ; - return ; -} - - -//================================================================================= -// function : Check() -// purpose : -//================================================================================= -void GeometryGUI_CheckShape::Check(const TopoDS_Shape S) -{ - - if( S.IsNull() ) - return ; - - try { - BRepCheck_Analyzer ana(S,false); - if (ana.IsValid()) - Text->setText( "This Shape seems to be valid." ); - else - Text->setText( "This Shape is not valid." ); - } - catch(Standard_Failure) { - MESSAGE("Catch intercepted in Check()" << endl ) ; - } - return ; -} diff --git a/src/GEOMGUI/GeometryGUI_CheckShape.h b/src/GEOMGUI/GeometryGUI_CheckShape.h deleted file mode 100644 index ce9b51789..000000000 --- a/src/GEOMGUI/GeometryGUI_CheckShape.h +++ /dev/null @@ -1,110 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_CheckShape.h -// Author : Nicolas REJNERI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_CHECKSHAPE_H -#define DIALOGBOX_CHECKSHAPE_H - -#include "SALOME_Selection.h" -#include "GEOM_ShapeTypeFilter.hxx" - -#include - -#include -#include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QRadioButton; -class QTextView; -class GeometryGUI; - -//================================================================================= -// class : GeometryGUI_CheckShape -// purpose : -//================================================================================= -class GeometryGUI_CheckShape : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_CheckShape( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 ); - ~GeometryGUI_CheckShape(); - -private: - - void Init( SALOME_Selection* Sel ) ; - void closeEvent( QCloseEvent* e ) ; - void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */ - void Check(const TopoDS_Shape S) ; - - GEOM::GEOM_Gen_var myGeom ; /* Current GeomI object */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - SALOME_Selection* mySelection ; /* User shape selection */ - - int myConstructorId ; /* Current constructor id = radio button id */ - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - - QButtonGroup* GroupConstructors; - QRadioButton* Constructor1; - QGroupBox* GroupConstructor1; - QLineEdit* LineEditC1A1; - QPushButton* SelectButtonC1A1; - QLabel* TextLabelC1A1; - - QTextView* Text; - QString SelectedName; - - QGroupBox* GroupButtons; - QPushButton* buttonApply; - QPushButton* buttonOk; - QPushButton* buttonCancel; - -private slots: - - void ConstructorsClicked(int constructorId); - void ClickOnCancel(); - void SetEditCurrentArgument() ; - void LineEditReturnPressed() ; - void SelectionIntoArgument() ; - void DeactivateActiveDialog() ; - void ActivateThisDialog() ; - -protected: - QGridLayout* GeometryGUI_CheckShapeLayout; - QGridLayout* GroupConstructorsLayout; - QGridLayout* GroupConstructor1Layout; - QGridLayout* GroupButtonsLayout; -}; - -#endif // DIALOGBOX_CHECKSHAPE_H diff --git a/src/GEOMGUI/GeometryGUI_CircleDlg.cxx b/src/GEOMGUI/GeometryGUI_CircleDlg.cxx deleted file mode 100644 index ba0c36640..000000000 --- a/src/GEOMGUI/GeometryGUI_CircleDlg.cxx +++ /dev/null @@ -1,504 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_CircleDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_CircleDlg.h" - -#include "GeometryGUI.h" -#include "QAD_Application.h" -#include "QAD_Desktop.h" -#include "QAD_Config.h" -#include "utilities.h" - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -//================================================================================= -// class : GeometryGUI_CircleDlg() -// purpose : Constructs a GeometryGUI_CircleDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_CircleDlg::GeometryGUI_CircleDlg( QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_CIRCLE_PV"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - - if ( !name ) - setName( "GeometryGUI_CircleDlg" ); - resize( 303, 251 ); - setCaption( tr( "GEOM_CIRCLE_TITLE" ) ); - setSizeGripEnabled( TRUE ); - GeometryGUI_CircleDlgLayout = new QGridLayout( this ); - GeometryGUI_CircleDlgLayout->setSpacing( 6 ); - GeometryGUI_CircleDlgLayout->setMargin( 11 ); - - /***************************************************************/ - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "GEOM_CIRCLE" ) ); - GroupConstructors->setExclusive( TRUE ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setText( tr( "" ) ); - Constructor1->setPixmap( image0 ); - Constructor1->setChecked( TRUE ); - Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) ); - Constructor1->setMinimumSize( QSize( 50, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer, 0, 1 ); - GeometryGUI_CircleDlgLayout->addWidget( GroupConstructors, 0, 0 ); - - /***************************************************************/ - GroupC1 = new QGroupBox( this, "GroupC1" ); - GroupC1->setTitle( tr( "GEOM_ARGUMENTS" ) ); - GroupC1->setFrameShape( QGroupBox::Box ); - GroupC1->setFrameShadow( QGroupBox::Sunken ); - GroupC1->setColumnLayout(0, Qt::Vertical ); - GroupC1->layout()->setSpacing( 0 ); - GroupC1->layout()->setMargin( 0 ); - GroupC1Layout = new QGridLayout( GroupC1->layout() ); - GroupC1Layout->setAlignment( Qt::AlignTop ); - GroupC1Layout->setSpacing( 6 ); - GroupC1Layout->setMargin( 11 ); - - TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" ); - TextLabelC1A1->setText( tr( "GEOM_CENTER_POINT" ) ); - TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A1->setFrameShape( QLabel::NoFrame ); - TextLabelC1A1->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabelC1A1, 0, 0 ); - SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" ); - SelectButtonC1A1->setText( tr( "" ) ); - SelectButtonC1A1->setPixmap( image1 ); - SelectButtonC1A1->setToggleButton( FALSE ); - GroupC1Layout->addWidget( SelectButtonC1A1, 0, 1 ); - LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" ); - GroupC1Layout->addWidget( LineEditC1A1, 0, 2 ); - TextLabelC1A2 = new QLabel( GroupC1, "TextLabelC1A2" ); - TextLabelC1A2->setText( tr( "GEOM_VECTOR" ) ); - TextLabelC1A2->setMinimumSize( QSize( 50, 0 ) ); - GroupC1Layout->addWidget( TextLabelC1A2, 1, 0 ); - SelectButtonC1A2 = new QPushButton( GroupC1, "SelectButtonC1A2" ); - SelectButtonC1A2->setText( tr( "" ) ); - SelectButtonC1A2->setPixmap( image1 ); - GroupC1Layout->addWidget( SelectButtonC1A2, 1, 1 ); - LineEditC1A2 = new QLineEdit( GroupC1, "LineEditC1A2" ); - GroupC1Layout->addWidget( LineEditC1A2, 1, 2 ); - TextLabelC1A3 = new QLabel( GroupC1, "TextLabelC1A3" ); - TextLabelC1A3->setText( tr( "GEOM_RADIUS" ) ); - TextLabelC1A3->setMinimumSize( QSize( 50, 0 ) ); - GroupC1Layout->addWidget( TextLabelC1A3, 2, 0 ); - SpinBox_C1A3 = new GeometryGUI_SpinBox( GroupC1, "GeomSpinBox_C1A3" ) ; - GroupC1Layout->addWidget( SpinBox_C1A3, 2, 2 ); - GeometryGUI_CircleDlgLayout->addWidget( GroupC1, 1, 0 ); - /***************************************************************/ - - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); - GroupButtons->setTitle( tr( "" ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - buttonOk = new QPushButton( GroupButtons, "buttonOk" ); - buttonOk->setText( tr( "GEOM_BUT_OK" ) ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - buttonApply = new QPushButton( GroupButtons, "buttonApply" ); - buttonApply->setText( tr( "GEOM_BUT_APPLY" ) ); - buttonApply->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonApply, 0, 1 ); - QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_9, 0, 2 ); - buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 3 ); - GeometryGUI_CircleDlgLayout->addWidget( GroupButtons, 2, 0 ); - /***************************************************************/ - - Init(Sel) ; /* Initialisations */ -} - - -//================================================================================= -// function : ~GeometryGUI_CircleDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_CircleDlg::~GeometryGUI_CircleDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_CircleDlg::Init( SALOME_Selection* Sel ) -{ - double step ; - QString St = QAD_CONFIG->getSetting( "Geometry:SettingsGeomStep" ) ; - step = St.toDouble() ; - - /* min, max, step and decimals for spin boxes */ - SpinBox_C1A3->RangeStepAndValidator( 0.001, 999.999, step, 3 ) ; - SpinBox_C1A3->SetValue( 100.0 ) ; /* = myRadius */ - - GroupC1->show(); - myConstructorId = 0 ; - Constructor1->setChecked( TRUE ); - myEditCurrentArgument = LineEditC1A1 ; - mySelection = Sel; - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - myRadius = 100.0 ; - myOkPoint1 = myOkDir = false ; - mySimulationTopoDs.Nullify() ; - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - - // TODO : previous selection into argument ? - - /* Filter definitions */ - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - myEdgeFilter = new GEOM_EdgeFilter( StdSelect_Line, myGeom ); - myVertexFilter = new GEOM_ShapeTypeFilter( TopAbs_VERTEX, myGeom ); - - mySelection->AddFilter(myVertexFilter) ; /* first filter used */ - - /* signals and slots connections */ - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ; - connect( buttonApply, SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) ); - connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) ); - connect( SelectButtonC1A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( SelectButtonC1A2, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - - connect( LineEditC1A1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - connect( LineEditC1A2, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - - connect( SpinBox_C1A3, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ; - connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ; - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - /* to close dialog if study change */ - connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ; - - /* Move widget on the botton right corner of main widget */ - int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; - this->show() ; /* displays Dialog */ - - return ; -} - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_CircleDlg::ConstructorsClicked(int constructorId) -{ - /* only a constructor now */ - return ; -} - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_CircleDlg::ClickOnOk() -{ - this->ClickOnApply() ; - this->ClickOnCancel() ; - - return ; -} - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_CircleDlg::ClickOnApply() -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - switch(myConstructorId) - { - case 0 : - { - if(myOkPoint1 && myOkDir) { - myGeomGUI->MakeCircleAndDisplay( myPoint1, myDir, myRadius) ; - } - break ; - } - } - // accept(); - return ; -} - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void GeometryGUI_CircleDlg::ClickOnCancel() -{ - mySelection->ClearFilters() ; - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->ResetState() ; - reject() ; - return ; -} - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -//================================================================================= -void GeometryGUI_CircleDlg::SelectionIntoArgument() -{ - - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - - /* Future name of selection */ - QString aString = ""; - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; - if ( nbSel != 1 ) { - if ( myEditCurrentArgument == LineEditC1A1 ) { - LineEditC1A1->setText("") ; - myOkPoint1 = false ; - } - else if ( myEditCurrentArgument == LineEditC1A2 ) { - LineEditC1A2->setText("") ; - myOkDir = false ; - } - return ; - } - - /* nbSel == 1 */ - TopoDS_Shape S; - if( !myGeomGUI->GetTopoFromSelection(mySelection, S) ) - return ; - - /* gp_Pnt : not used */ - if ( myEditCurrentArgument == LineEditC1A1 && myGeomGUI->VertexToPoint(S, myPoint1) ) { - LineEditC1A1->setText(aString) ; - myOkPoint1 = true ; - } - else if ( myEditCurrentArgument == LineEditC1A2 /*&& myGeomGUI->LinearLocationAndDirection(S, notUsed, myDir) */) { - BRepAdaptor_Curve curv(TopoDS::Edge(S)); - myDir = curv.Line().Direction(); - LineEditC1A2->setText(aString) ; - myOkDir = true ; - } - - if( myOkPoint1 && myOkDir ) { - MakeCircleSimulationAndDisplay() ; - } - return ; -} - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_CircleDlg::SetEditCurrentArgument() -{ - mySelection->ClearFilters() ; - QPushButton* send = (QPushButton*)sender(); - switch (myConstructorId) - { - case 0: /* default constructor */ - { - if(send == SelectButtonC1A1) { - LineEditC1A1->setFocus() ; - myEditCurrentArgument = LineEditC1A1; - mySelection->AddFilter(myVertexFilter) ; - } - else if(send == SelectButtonC1A2) { - LineEditC1A2->setFocus() ; - myEditCurrentArgument = LineEditC1A2; - mySelection->AddFilter(myEdgeFilter) ; - } - SelectionIntoArgument() ; - break; - } - } - return ; -} - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_CircleDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if( send == LineEditC1A1 ) - myEditCurrentArgument = LineEditC1A1 ; - else if ( send == LineEditC1A2 ) - myEditCurrentArgument = LineEditC1A2 ; - else - return ; - - /* User name of object input management */ - /* If successfull the selection is changed and signal emitted... */ - /* so SelectionIntoArgument() is automatically called. */ - const QString objectUserName = myEditCurrentArgument->text() ; - QWidget* thisWidget = (QWidget*)this ; - if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) { - myEditCurrentArgument->setText( objectUserName ) ; - } - return ; -} - - -//================================================================================= -// function : ValueChangedInSpinBox() -// purpose : -//================================================================================= -void GeometryGUI_CircleDlg::ValueChangedInSpinBox( double newValue ) -{ - myRadius = newValue ; - - if (myOkPoint1 && myOkDir) { - MakeCircleSimulationAndDisplay() ; - } - else { - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - } - return ; -} - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void GeometryGUI_CircleDlg::DeactivateActiveDialog() -{ - if ( GroupConstructors->isEnabled() ) { - GroupConstructors->setEnabled(false) ; - GroupC1->setEnabled(false) ; - GroupButtons->setEnabled(false) ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->EraseSimulationShape() ; - mySelection->ClearFilters() ; - } - return ; -} - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_CircleDlg::ActivateThisDialog() -{ - /* Emit a signal to deactivate the active dialog */ - myGeomGUI->EmitSignalDeactivateDialog() ; - GroupConstructors->setEnabled(true) ; - GroupC1->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - if( !mySimulationTopoDs.IsNull() ) - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - return ; -} - - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void GeometryGUI_CircleDlg::enterEvent(QEvent* e) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; -} - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_CircleDlg::closeEvent( QCloseEvent* e ) -{ - this->ClickOnCancel() ; /* same than click on cancel button */ -} - - -//================================================================================= -// function : MakeCircleSimulationAndDisplay() -// purpose : -//================================================================================= -void GeometryGUI_CircleDlg::MakeCircleSimulationAndDisplay() -{ - myGeomGUI->EraseSimulationShape() ; - - try { - gp_Ax2 axis( this->myPoint1, this->myDir ) ; - gp_Circ circ( axis, this->myRadius); - BRepBuilderAPI_MakeEdge MakeEdge( circ ); - mySimulationTopoDs = MakeEdge.Shape(); - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - } - catch(Standard_Failure) { - MESSAGE( "Exception catched in MakeCircleSimulationAndDisplay" ) ; - } - return ; -} diff --git a/src/GEOMGUI/GeometryGUI_CircleDlg.h b/src/GEOMGUI/GeometryGUI_CircleDlg.h deleted file mode 100644 index 8254f30b4..000000000 --- a/src/GEOMGUI/GeometryGUI_CircleDlg.h +++ /dev/null @@ -1,126 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_CircleDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_CIRCLE_H -#define DIALOGBOX_CIRCLE_H - -#include "SALOME_Selection.h" -#include "GEOM_ShapeTypeFilter.hxx" -#include "GEOM_EdgeFilter.hxx" -#include "GeometryGUI_SpinBox.h" - -#include -#include -#include - -#include -#include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QRadioButton; -class GeometryGUI; - - -//================================================================================= -// class : GeometryGUI_CircleDlg -// purpose : -//================================================================================= -class GeometryGUI_CircleDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_CircleDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 ); - ~GeometryGUI_CircleDlg(); - -private : - - GEOM::GEOM_Gen_var myGeom ; /* Current Geom object */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - SALOME_Selection* mySelection ; /* User shape selection */ - TopoDS_Shape mySimulationTopoDs; /* Shape used for simulation display */ - gp_Pnt myPoint1 ; - gp_Dir myDir ; - Standard_Real myRadius ; - bool myOkPoint1 ; - bool myOkDir ; - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - int myConstructorId ; /* Current constructor id = radio button id */ - Handle(GEOM_ShapeTypeFilter) myVertexFilter ; /* Filter selection */ - Handle(GEOM_EdgeFilter) myEdgeFilter; - - void closeEvent( QCloseEvent* e ) ; - void enterEvent( QEvent* e); - void Init( SALOME_Selection* Sel ) ; - void MakeCircleSimulationAndDisplay() ; - - QButtonGroup* GroupConstructors; - QRadioButton* Constructor1; - QGroupBox* GroupButtons; - QPushButton* buttonOk; - QPushButton* buttonCancel; - QPushButton* buttonApply; - QGroupBox* GroupC1; - QPushButton* SelectButtonC1A2; - QLineEdit* LineEditC1A1; - QPushButton* SelectButtonC1A1; - QLabel* TextLabelC1A2; - QLineEdit* LineEditC1A2; - QLabel* TextLabelC1A1; - QLabel* TextLabelC1A3; - - GeometryGUI_SpinBox* SpinBox_C1A3; - -private slots: - - void ConstructorsClicked(int constructorId); - void ClickOnOk(); - void ClickOnCancel(); - void ClickOnApply(); - void SetEditCurrentArgument() ; - void SelectionIntoArgument() ; - void LineEditReturnPressed() ; - void DeactivateActiveDialog() ; - void ActivateThisDialog() ; - void ValueChangedInSpinBox( double newValue ) ; - -protected: - QGridLayout* GeometryGUI_CircleDlgLayout; - QGridLayout* GroupConstructorsLayout; - QGridLayout* GroupButtonsLayout; - QGridLayout* GroupC1Layout; -}; - -#endif // DIALOGBOX_CIRCLE_H diff --git a/src/GEOMGUI/GeometryGUI_CommonDlg.cxx b/src/GEOMGUI/GeometryGUI_CommonDlg.cxx deleted file mode 100644 index 580d1d1e1..000000000 --- a/src/GEOMGUI/GeometryGUI_CommonDlg.cxx +++ /dev/null @@ -1,253 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_CommonDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_CommonDlg.h" - -#include "GeometryGUI.h" -#include "QAD_Desktop.h" - -//================================================================================= -// class : GeometryGUI_CommonDlg() -// purpose : Constructs a GeometryGUI_CommonDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_CommonDlg::GeometryGUI_CommonDlg(QWidget* parent, const char* name, BooleanGUI* theBooleanGUI, SALOME_Selection* Sel, bool modal, WFlags fl) - :GeometryGUI_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_COMMON"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT"))); - - setCaption(tr("GEOM_COMMON_TITLE")); - - /***************************************************************/ - GroupConstructors->setTitle(tr("GEOM_COMMON")); - RadioButton1->setPixmap(image0); - RadioButton2->close(TRUE); - RadioButton3->close(TRUE); - - GroupCommon = new GeometryGUI_2Sel_QTD(this, "GroupCommon"); - GroupCommon->GroupBox1->setTitle(tr("GEOM_ARGUMENTS")); - GroupCommon->TextLabel1->setText(tr("GEOM_OBJECT_I").arg("1")); - GroupCommon->TextLabel2->setText(tr("GEOM_OBJECT_I").arg("2")); - GroupCommon->PushButton1->setPixmap(image1); - GroupCommon->PushButton2->setPixmap(image1); - - Layout1->addWidget(GroupCommon, 1, 0); - /***************************************************************/ - - /* Initialisation */ - myBooleanGUI = theBooleanGUI; - Init(); -} - - -//================================================================================= -// function : ~GeometryGUI_CommonDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_CommonDlg::~GeometryGUI_CommonDlg() -{ - /* no need to delete child widgets, Qt does it all for us */ -} - - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_CommonDlg::Init() -{ - /* init variables */ - myEditCurrentArgument = GroupCommon->LineEdit1; - - myShape1.Nullify(); - myShape2.Nullify(); - myOkShape1 = myOkShape2 = false; - - /* signals and slots connections */ - connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); - connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); - - connect(GroupCommon->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); - connect(GroupCommon->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); - - connect(GroupCommon->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); - connect(GroupCommon->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); - - connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - - /* displays Dialog */ - GroupCommon->show(); - this->show(); - - return; -} - - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_CommonDlg::ClickOnOk() -{ - this->ClickOnApply(); - ClickOnCancel(); - return ; -} - - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_CommonDlg::ClickOnApply() -{ - myGeomGUI->GetDesktop()->putInfo(tr("")); - - if(myOkShape1 && myOkShape2) - myBooleanGUI->MakeBooleanAndDisplay(myGeomShape1 ,myGeomShape2, 1); - - return; -} - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection has changed -//================================================================================= -void GeometryGUI_CommonDlg::SelectionIntoArgument() -{ - myEditCurrentArgument->setText(""); - QString aString = ""; - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString); - if(nbSel != 1) { - if(myEditCurrentArgument == GroupCommon->LineEdit1) - myOkShape1 = false; - else if( myEditCurrentArgument == GroupCommon->LineEdit2) - myOkShape2 = false; - return; - } - - /* nbSel == 1 */ - TopoDS_Shape S; - Standard_Boolean testResult; - Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject(); - - if(!myGeomGUI->GetTopoFromSelection(mySelection, S)) - return; - - if(myEditCurrentArgument == GroupCommon->LineEdit1) { - myGeomShape1 = myGeomGUI->ConvertIOinGEOMShape(IO, testResult); - if(!testResult) - return; - myShape1 = S; - GroupCommon->LineEdit1->setText(aString); - myOkShape1 = true; - } - else if(myEditCurrentArgument == GroupCommon->LineEdit2) { - myGeomShape2 = myGeomGUI->ConvertIOinGEOMShape(IO, testResult); - if(!testResult) - return; - myShape2 = S; - GroupCommon->LineEdit2->setText(aString); - myOkShape2 = true; - } - return; -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_CommonDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - - if(send == GroupCommon->PushButton1) { - GroupCommon->LineEdit1->setFocus(); - myEditCurrentArgument = GroupCommon->LineEdit1; - } - else if(send == GroupCommon->PushButton2) { - GroupCommon->LineEdit2->setFocus(); - myEditCurrentArgument = GroupCommon->LineEdit2; - } - SelectionIntoArgument(); - - return; -} - - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_CommonDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if(send == GroupCommon->LineEdit1) - myEditCurrentArgument = GroupCommon->LineEdit1; - else if(send == GroupCommon->LineEdit2) - myEditCurrentArgument = GroupCommon->LineEdit2; - else - return; - - GeometryGUI_Skeleton::LineEditReturnPressed(); - return; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_CommonDlg::ActivateThisDialog() -{ - GeometryGUI_Skeleton::ActivateThisDialog(); - connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - return; -} - - -//================================================================================= -// function : enterEvent() -// purpose : when mouse enter onto the QWidget -//================================================================================= -void GeometryGUI_CommonDlg::enterEvent(QEvent * e) -{ - if (GroupConstructors->isEnabled()) - return; - this->ActivateThisDialog(); - return; -} diff --git a/src/GEOMGUI/GeometryGUI_CommonDlg.h b/src/GEOMGUI/GeometryGUI_CommonDlg.h deleted file mode 100644 index 6596eeab9..000000000 --- a/src/GEOMGUI/GeometryGUI_CommonDlg.h +++ /dev/null @@ -1,76 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_CommonDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_COMMON_H -#define DIALOGBOX_COMMON_H - -#include "GeometryGUI_Skeleton.h" -#include "GeometryGUI_2Sel_QTD.h" - -#include "BooleanGUI.h" - -#include - -//================================================================================= -// class : GeometryGUI_CommonDlg -// purpose : -//================================================================================= -class GeometryGUI_CommonDlg : public GeometryGUI_Skeleton -{ - Q_OBJECT - -public: - GeometryGUI_CommonDlg(QWidget* parent = 0, const char* name = 0, BooleanGUI* theBooleanGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0); - ~GeometryGUI_CommonDlg(); - -private: - void Init(); - void enterEvent(QEvent * e); - - BooleanGUI* myBooleanGUI; - - TopoDS_Shape myShape1; /* topology used */ - TopoDS_Shape myShape2; /* topology used */ - GEOM::GEOM_Shape_var myGeomShape1; /* is myShape1 */ - GEOM::GEOM_Shape_var myGeomShape2; /* is myShape2 */ - bool myOkShape1; - bool myOkShape2; /* to check when arguments are defined */ - - GeometryGUI_2Sel_QTD* GroupCommon; - -private slots: - void ClickOnOk(); - void ClickOnApply(); - void SetEditCurrentArgument(); - void SelectionIntoArgument(); - void LineEditReturnPressed(); - void ActivateThisDialog(); - -}; - -#endif // DIALOGBOX_COMMON_H diff --git a/src/GEOMGUI/GeometryGUI_CompoundDlg.cxx b/src/GEOMGUI/GeometryGUI_CompoundDlg.cxx deleted file mode 100644 index a1a6346af..000000000 --- a/src/GEOMGUI/GeometryGUI_CompoundDlg.cxx +++ /dev/null @@ -1,375 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_CompoundDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_CompoundDlg.h" - -#include "GeometryGUI.h" -#include "QAD_Application.h" -#include "QAD_Desktop.h" -#include "utilities.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -//================================================================================= -// class : GeometryGUI_CompoundDlg() -// purpose : Constructs a GeometryGUI_CompoundDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_CompoundDlg::GeometryGUI_CompoundDlg( QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_BUILD_COMPOUND"))); - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - if ( !name ) - setName( "GeometryGUI_CompoundDlg" ); - resize( 303, 175 ); - setCaption( tr( "GEOM_COMPOUND_TITLE" ) ); - setSizeGripEnabled( TRUE ); - GeometryGUI_CompoundDlgLayout = new QGridLayout( this ); - GeometryGUI_CompoundDlgLayout->setSpacing( 6 ); - GeometryGUI_CompoundDlgLayout->setMargin( 11 ); - - /***************************************************************/ - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "GEOM_COMPOUND" ) ); - GroupConstructors->setExclusive( TRUE ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setText( tr( "" ) ); - Constructor1->setPixmap( image1 ); - Constructor1->setChecked( TRUE ); - Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) ); - Constructor1->setMinimumSize( QSize( 50, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer, 0, 1 ); - GeometryGUI_CompoundDlgLayout->addWidget( GroupConstructors, 0, 0 ); - - /***************************************************************/ - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); - GroupButtons->setTitle( tr( "" ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 3 ); - buttonApply = new QPushButton( GroupButtons, "buttonApply" ); - buttonApply->setText( tr( "GEOM_BUT_APPLY" ) ); - buttonApply->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonApply, 0, 1 ); - QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_9, 0, 2 ); - buttonOk = new QPushButton( GroupButtons, "buttonOk" ); - buttonOk->setText( tr( "GEOM_BUT_OK" ) ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - GeometryGUI_CompoundDlgLayout->addWidget( GroupButtons, 2, 0 ); - - /***************************************************************/ - GroupC1 = new QGroupBox( this, "GroupC1" ); - GroupC1->setTitle( tr( "GEOM_ARGUMENTS" ) ); - GroupC1->setMinimumSize( QSize( 0, 0 ) ); - GroupC1->setFrameShape( QGroupBox::Box ); - GroupC1->setFrameShadow( QGroupBox::Sunken ); - GroupC1->setColumnLayout(0, Qt::Vertical ); - GroupC1->layout()->setSpacing( 0 ); - GroupC1->layout()->setMargin( 0 ); - GroupC1Layout = new QGridLayout( GroupC1->layout() ); - GroupC1Layout->setAlignment( Qt::AlignTop ); - GroupC1Layout->setSpacing( 6 ); - GroupC1Layout->setMargin( 11 ); - TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" ); - TextLabelC1A1->setText( tr( "GEOM_OBJECTS" ) ); - TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A1->setFrameShape( QLabel::NoFrame ); - TextLabelC1A1->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabelC1A1, 0, 0 ); - SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" ); - SelectButtonC1A1->setText( tr( "" ) ); - SelectButtonC1A1->setPixmap( image0 ); - SelectButtonC1A1->setToggleButton( FALSE ); - GroupC1Layout->addWidget( SelectButtonC1A1, 0, 1 ); - LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" ); - GroupC1Layout->addWidget( LineEditC1A1, 0, 2 ); - GeometryGUI_CompoundDlgLayout->addWidget( GroupC1, 1, 0 ); - /***************************************************************/ - - Init(Sel) ; /* Initialisations */ -} - - -//================================================================================= -// function : ~GeometryGUI_CompoundDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_CompoundDlg::~GeometryGUI_CompoundDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_CompoundDlg::Init( SALOME_Selection* Sel ) -{ - - GroupC1->show(); - myConstructorId = 0 ; - Constructor1->setChecked( TRUE ); - myEditCurrentArgument = LineEditC1A1 ; - mySelection = Sel; - this->myOkListShapes = false ; - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - - // TODO : previous selection into argument ? - - /* Filter definitions */ - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - - /* signals and slots connections */ - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); - connect( buttonApply, SIGNAL( clicked() ), this, SLOT(ClickOnApply() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ; - connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) ); - - connect( SelectButtonC1A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ; - /* to close dialog if study change */ - connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ; - - /* Move widget on the botton right corner of main widget */ - int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; - this->show() ; /* displays Dialog */ - - return ; -} - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_CompoundDlg::ConstructorsClicked(int constructorId) -{ - return ; -} - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_CompoundDlg::ClickOnOk() -{ - this->ClickOnApply() ; - this->ClickOnCancel() ; - - return ; -} - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_CompoundDlg::ClickOnApply() -{ - switch(myConstructorId) - { - case 0 : - { - if(myOkListShapes) { - myGeomGUI->MakeCompoundAndDisplay( myListShapes ) ; - } - break ; - } - } - // accept(); - return ; -} - - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void GeometryGUI_CompoundDlg::ClickOnCancel() -{ - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->ResetState() ; - reject() ; - return ; -} - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -//================================================================================= -void GeometryGUI_CompoundDlg::SelectionIntoArgument() -{ - /* All this for first constructor */ - // if(myEditCurrentArgument == LineEditC1A1 ) - - myOkListShapes = false; - myEditCurrentArgument->setText("") ; - QString aString = ""; /* name of selection */ - - int nbSel = mySelection->IObjectCount() ; - if ( nbSel == 0 ) - return; - aString = tr( "%1_objects" ).arg( nbSel ); - - myGeomGUI->ConvertListOfIOInListOfIOR(mySelection->StoredIObjects(), myListShapes) ; - myEditCurrentArgument->setText(aString) ; - myOkListShapes = true ; - /* no simulation */ - return ; -} - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_CompoundDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - switch (myConstructorId) - { - case 0: /* default constructor */ - { - if(send == SelectButtonC1A1) { - LineEditC1A1->setFocus() ; - myEditCurrentArgument = LineEditC1A1; - } - SelectionIntoArgument() ; - break; - } - } - return ; -} - - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_CompoundDlg::LineEditReturnPressed() -{ - return ; -} - - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void GeometryGUI_CompoundDlg::DeactivateActiveDialog() -{ - if ( GroupConstructors->isEnabled() ) { - disconnect( mySelection, 0, this, 0 ); - GroupConstructors->setEnabled(false) ; - GroupC1->setEnabled(false) ; - GroupButtons->setEnabled(false) ; - } - return ; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_CompoundDlg::ActivateThisDialog() -{ - /* Emit a signal to deactivate the active dialog */ - myGeomGUI->EmitSignalDeactivateDialog() ; - GroupConstructors->setEnabled(true) ; - GroupC1->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - return ; -} - - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void GeometryGUI_CompoundDlg::enterEvent(QEvent* e) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; - return ; -} - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_CompoundDlg::closeEvent( QCloseEvent* e ) -{ - /* same than click on cancel button */ - this->ClickOnCancel() ; - return ; -} diff --git a/src/GEOMGUI/GeometryGUI_CompoundDlg.h b/src/GEOMGUI/GeometryGUI_CompoundDlg.h deleted file mode 100644 index 8bdbbc810..000000000 --- a/src/GEOMGUI/GeometryGUI_CompoundDlg.h +++ /dev/null @@ -1,106 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_CompoundDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_COMPOUND_H -#define DIALOGBOX_COMPOUND_H - -#include "SALOME_Selection.h" -#include "GEOM_ShapeTypeFilter.hxx" - -#include -#include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QRadioButton; -class GeometryGUI; - - -//================================================================================= -// class : GeometryGUI_CompoundDlg -// purpose : -//================================================================================= -class GeometryGUI_CompoundDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_CompoundDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 ); - ~GeometryGUI_CompoundDlg(); - -private: - - void Init( SALOME_Selection* Sel ) ; - void closeEvent( QCloseEvent* e ) ; - void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */ - - GEOM::GEOM_Gen_var myGeom ; /* Current Geom object */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - SALOME_Selection* mySelection ; /* User shape selection */ - GEOM::GEOM_Gen::ListOfIOR myListShapes ; - bool myOkListShapes ; /* to check when arguments is defined */ - int myConstructorId ; /* Current constructor id = radio button id */ - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - - QButtonGroup* GroupConstructors; - QRadioButton* Constructor1; - QGroupBox* GroupButtons; - QPushButton* buttonOk; - QPushButton* buttonCancel; - QPushButton* buttonApply; - QGroupBox* GroupC1; - QLabel* TextLabelC1A1; - QPushButton* SelectButtonC1A1; - QLineEdit* LineEditC1A1; - -private slots: - - void ConstructorsClicked(int constructorId); - void ClickOnOk(); - void ClickOnCancel(); - void ClickOnApply(); - void SetEditCurrentArgument() ; - void LineEditReturnPressed() ; - void SelectionIntoArgument() ; - void DeactivateActiveDialog() ; - void ActivateThisDialog() ; - -protected: - QGridLayout* GeometryGUI_CompoundDlgLayout; - QGridLayout* GroupConstructorsLayout; - QGridLayout* GroupButtonsLayout; - QGridLayout* GroupC1Layout; -}; - -#endif // DIALOGBOX_COMPOUND_H diff --git a/src/GEOMGUI/GeometryGUI_ConeDlg.cxx b/src/GEOMGUI/GeometryGUI_ConeDlg.cxx deleted file mode 100644 index d634c7d46..000000000 --- a/src/GEOMGUI/GeometryGUI_ConeDlg.cxx +++ /dev/null @@ -1,434 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_ConeDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_ConeDlg.h" - -#include -#include -#include - -#include "GeometryGUI.h" -#include "QAD_Desktop.h" -#include "QAD_Config.h" - -//================================================================================= -// class : GeometryGUI_ConeDlg() -// purpose : Constructs a GeometryGUI_ConeDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_ConeDlg::GeometryGUI_ConeDlg(QWidget* parent, const char* name, PrimitiveGUI* thePrimitiveGUI, SALOME_Selection* Sel, bool modal, WFlags fl) - :GeometryGUI_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_CONE_PV"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_CONE_DXYZ"))); - QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT"))); - - setCaption(tr("GEOM_CONE_TITLE")); - - /***************************************************************/ - GroupConstructors->setTitle(tr("GEOM_CONE")); - RadioButton1->setPixmap(image0); - RadioButton2->setPixmap(image1); - RadioButton3->close(TRUE); - - GroupPoints = new GeometryGUI_2Sel3Spin(this, "GroupPoints"); - GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS")); - GroupPoints->TextLabel1->setText(tr("GEOM_BASE_POINT")); - GroupPoints->TextLabel2->setText(tr("GEOM_VECTOR")); - GroupPoints->TextLabel3->setText(tr("GEOM_RADIUS_I").arg("1")); - GroupPoints->TextLabel4->setText(tr("GEOM_RADIUS_I").arg("2")); - GroupPoints->TextLabel5->setText(tr("GEOM_HEIGHT")); - GroupPoints->PushButton1->setPixmap(image2); - GroupPoints->PushButton2->setPixmap(image2); - - GroupDimensions = new GeometryGUI_3Spin(this, "GroupDimensions"); - GroupDimensions->GroupBox1->setTitle(tr("GEOM_BOX_OBJ")); - GroupDimensions->TextLabel1->setText(tr("GEOM_RADIUS_I").arg("1")); - GroupDimensions->TextLabel2->setText(tr("GEOM_RADIUS_I").arg("2")); - GroupDimensions->TextLabel3->setText(tr("GEOM_HEIGHT")); - - Layout1->addWidget(GroupPoints, 1, 0); - Layout1->addWidget(GroupDimensions, 1, 0); - /***************************************************************/ - - /* Initialisations */ - myPrimitiveGUI = thePrimitiveGUI; - Init(); -} - - -//================================================================================= -// function : ~GeometryGUI_ConeDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_ConeDlg::~GeometryGUI_ConeDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_ConeDlg::Init() -{ - /* init variables */ - myConstructorId = 0; - myEditCurrentArgument = GroupPoints->LineEdit1; - - myRadius1 = 100.0; - myRadius2 = 0.0; - myHeight = 300.0; - - myOkRadius1 = myOkRadius2 = myOkHeight = true; - myOkPoint1 = myOkDir = false; - - myEdgeFilter = new GEOM_EdgeFilter(StdSelect_Line, myGeom); - myVertexFilter = new GEOM_ShapeTypeFilter(TopAbs_VERTEX, myGeom); - mySelection->AddFilter(myVertexFilter); - - /* Get setting of step value from file configuration */ - QString St = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep"); - step = St.toDouble(); - - /* min, max, step and decimals for spin boxes & initial values */ - GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3); - GroupPoints->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, step, 3); - GroupPoints->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3); - GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3); - GroupDimensions->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, step, 3); - GroupDimensions->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3); - - GroupPoints->SpinBox_DX->SetValue(myRadius1); - GroupPoints->SpinBox_DY->SetValue(myRadius2); - GroupPoints->SpinBox_DZ->SetValue(myHeight); - GroupDimensions->SpinBox_DX->SetValue(myRadius1); - GroupDimensions->SpinBox_DY->SetValue(myRadius2); - GroupDimensions->SpinBox_DZ->SetValue(myHeight); - - /* signals and slots connections */ - connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); - connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); - connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int))); - - connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); - connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); - - connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); - connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); - - connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(GroupPoints->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(GroupPoints->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(GroupDimensions->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(GroupDimensions->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(GroupDimensions->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - - connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; - - /* displays Dialog */ - GroupDimensions->hide(); - GroupPoints->show(); - this->show(); - - return ; -} - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_ConeDlg::ConstructorsClicked(int constructorId) -{ - myConstructorId = constructorId; - mySelection->ClearFilters(); - myGeomGUI->EraseSimulationShape(); - disconnect(mySelection, 0, this, 0); - myOkHeight = myOkRadius1 = myOkRadius2 = true; - myRadius1 = 100.0; - myRadius2 = 0.0; - myHeight = 300.0; - - switch(myConstructorId) - { - case 0 : - { - GroupDimensions->hide(); - resize(0, 0); - GroupPoints->show(); - myOkPoint1 = myOkDir = false; - - myEditCurrentArgument = GroupPoints->LineEdit1; - GroupPoints->LineEdit1->setText(tr("")); - GroupPoints->LineEdit2->setText(tr("")); - - GroupPoints->SpinBox_DX->SetValue(myRadius1); - GroupPoints->SpinBox_DY->SetValue(myRadius2); - GroupPoints->SpinBox_DZ->SetValue(myHeight); - - /* filter for next selection */ - mySelection->AddFilter(myVertexFilter); - connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - break; - } - case 1 : - { - GroupPoints->hide(); - resize( 0, 0 ); - GroupDimensions->show(); - myOkPoint1 = myOkDir = true; - - GroupDimensions->SpinBox_DX->SetValue(myRadius1); - GroupDimensions->SpinBox_DY->SetValue(myRadius2); - GroupDimensions->SpinBox_DZ->SetValue(myHeight); - - myPoint1.SetCoord(0.0, 0.0, 0.0); - myDir.SetCoord(0.0, 0.0, 1.0); - - MakeConeSimulationAndDisplay(); - break; - } - } - return ; -} - - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_ConeDlg::ClickOnOk() -{ - this->ClickOnApply(); - ClickOnCancel(); - return; -} - - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_ConeDlg::ClickOnApply() -{ - myGeomGUI->GetDesktop()->putInfo(tr("")); - if (mySimulationTopoDs.IsNull()) - return; - myGeomGUI->EraseSimulationShape(); - mySimulationTopoDs.Nullify(); - - if(myOkPoint1 && myOkDir && myOkRadius1 && myOkRadius2 && myOkHeight) { - gp_Dir aDir = myDir; - /* allows user to reverse direction of construction with a negative height */ - if(this->myHeight < -Precision::Confusion()) - aDir.Reverse(); - myPrimitiveGUI->MakeConeAndDisplay(myPoint1, aDir, myRadius1, myRadius2, fabs(myHeight)); - } - return ; -} - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -//================================================================================= -void GeometryGUI_ConeDlg::SelectionIntoArgument() -{ - myGeomGUI->EraseSimulationShape(); - myEditCurrentArgument->setText(""); - QString aString = ""; /* name of selection */ - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString); - if(nbSel != 1) { - if(myEditCurrentArgument == GroupPoints->LineEdit1) - myOkPoint1 = false; - else if (myEditCurrentArgument == GroupPoints->LineEdit2) - myOkDir = false; - return; - } - - /* nbSel == 1 */ - TopoDS_Shape S; - if(!myGeomGUI->GetTopoFromSelection(mySelection, S)) - return; - - /* gp_Pnt : not used */ - if (myEditCurrentArgument == GroupPoints->LineEdit1 && myGeomGUI->VertexToPoint(S, myPoint1)) { - GroupPoints->LineEdit1->setText(aString); - myOkPoint1 = true; - } - else if (myEditCurrentArgument == GroupPoints->LineEdit2) { - BRepAdaptor_Curve curv(TopoDS::Edge(S)); - myDir = curv.Line().Direction(); - GroupPoints->LineEdit2->setText(aString); - myOkDir = true; - } - - if(myOkPoint1 && myOkDir && myOkRadius1 && myOkRadius2 && myOkHeight) - MakeConeSimulationAndDisplay(); - return; -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_ConeDlg::SetEditCurrentArgument() -{ - if(myConstructorId != 0) - return; - - QPushButton* send = (QPushButton*)sender(); - - if(send == GroupPoints->PushButton1) { - GroupPoints->LineEdit1->setFocus(); - myEditCurrentArgument = GroupPoints->LineEdit1; - mySelection->AddFilter(myVertexFilter); - } - else if(send == GroupPoints->PushButton2) { - GroupPoints->LineEdit2->setFocus(); - myEditCurrentArgument = GroupPoints->LineEdit2; - mySelection->AddFilter(myEdgeFilter); - } - this->SelectionIntoArgument(); - - return; -} - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_ConeDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if(send == GroupPoints->LineEdit1) - myEditCurrentArgument = GroupPoints->LineEdit1; - else if (send == GroupPoints->LineEdit2) - myEditCurrentArgument = GroupPoints->LineEdit2; - else - return; - - GeometryGUI_Skeleton::LineEditReturnPressed(); - return; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_ConeDlg::ActivateThisDialog() -{ - GeometryGUI_Skeleton::ActivateThisDialog(); - connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - if(!mySimulationTopoDs.IsNull()) - myGeomGUI->DisplaySimulationShape(mySimulationTopoDs); - return; -} - - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void GeometryGUI_ConeDlg::enterEvent(QEvent* e) -{ - if (GroupConstructors->isEnabled()) - return; - this->ActivateThisDialog(); - return; -} - - -//================================================================================= -// function : ValueChangedInSpinBox() -// purpose : -//================================================================================= -void GeometryGUI_ConeDlg::ValueChangedInSpinBox(double newValue) -{ - myGeomGUI->EraseSimulationShape(); - mySimulationTopoDs.Nullify(); - QObject* send = (QObject*)sender(); - - if(send == GroupPoints->SpinBox_DX || send == GroupDimensions->SpinBox_DX) { - myRadius1 = newValue; - myOkRadius1 = true; - } - else if(send == GroupPoints->SpinBox_DY || send == GroupDimensions->SpinBox_DY) { - myRadius2 = newValue; - myOkRadius2 = true; - } - else if(send == GroupPoints->SpinBox_DZ || send == GroupDimensions->SpinBox_DZ) { - myHeight = newValue; - myOkHeight = true; - } - - if (myOkPoint1 && myOkDir && myOkRadius1 && myOkRadius2 && myOkHeight) - MakeConeSimulationAndDisplay(); - return; -} - - -//================================================================================= -// function : MakeConeSimulationAndDisplay() -// purpose : -//================================================================================= -void GeometryGUI_ConeDlg::MakeConeSimulationAndDisplay() -{ - myGeomGUI->EraseSimulationShape(); - mySimulationTopoDs.Nullify(); - gp_Dir aDir = myDir; - - try { - /* allows user to reverse direction of construction with a negative height */ - if(this->myHeight < -Precision::Confusion()) - aDir.Reverse(); - - gp_Ax2 anAxis(this->myPoint1, aDir); - - if(fabs(myRadius1 - myRadius2) <= Precision::Confusion()) - mySimulationTopoDs = BRepPrimAPI_MakeCylinder(anAxis, (myRadius1+myRadius2)/2.0, fabs(myHeight)).Shape(); - else { - if(fabs(myHeight) > Precision::Confusion()) - mySimulationTopoDs = BRepPrimAPI_MakeCone(anAxis, myRadius1, myRadius2, fabs(myHeight)).Shape(); - } - myGeomGUI->DisplaySimulationShape(mySimulationTopoDs); - } - catch(Standard_Failure) { - MESSAGE("Exception catched in MakeConeSimulationAndDisplay"); - } - return; -} diff --git a/src/GEOMGUI/GeometryGUI_ConeDlg.h b/src/GEOMGUI/GeometryGUI_ConeDlg.h deleted file mode 100644 index 6330ea97c..000000000 --- a/src/GEOMGUI/GeometryGUI_ConeDlg.h +++ /dev/null @@ -1,94 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_ConeDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_CONE_H -#define DIALOGBOX_CONE_H - -#include "GeometryGUI_Skeleton.h" -#include "GeometryGUI_2Sel3Spin.h" -#include "GeometryGUI_3Spin.h" - -#include "PrimitiveGUI.h" - -#include "GEOM_EdgeFilter.hxx" - -#include -#include - -//================================================================================= -// class : GeometryGUI_ConeDlg -// purpose : -//================================================================================= -class GeometryGUI_ConeDlg : public GeometryGUI_Skeleton -{ - Q_OBJECT - -public: - GeometryGUI_ConeDlg(QWidget* parent = 0, const char* name = 0, PrimitiveGUI* thePrimitiveGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0); - ~GeometryGUI_ConeDlg(); - -private: - void Init(); - void enterEvent(QEvent* e); - void MakeConeSimulationAndDisplay(); - - PrimitiveGUI* myPrimitiveGUI; - - double step; - int myConstructorId; - Handle(GEOM_ShapeTypeFilter) myVertexFilter; - Handle(GEOM_EdgeFilter) myEdgeFilter; /* Filter selection */ - - gp_Pnt myPoint1; /* topology used */ - gp_Dir myDir; - bool myOkPoint1; /* to check when arguments is defined */ - bool myOkDir; - - Standard_Real myRadius1; - Standard_Real myRadius2; - Standard_Real myHeight; - bool myOkRadius1; - bool myOkRadius2; - bool myOkHeight; - - GeometryGUI_2Sel3Spin* GroupPoints; - GeometryGUI_3Spin* GroupDimensions; - -private slots: - void ClickOnOk(); - void ClickOnApply(); - void ActivateThisDialog(); - void LineEditReturnPressed(); - void SelectionIntoArgument(); - void SetEditCurrentArgument(); - void ConstructorsClicked(int constructorId); - void ValueChangedInSpinBox(double newValue); - -}; - -#endif // DIALOGBOX_CONE_H diff --git a/src/GEOMGUI/GeometryGUI_CutDlg.cxx b/src/GEOMGUI/GeometryGUI_CutDlg.cxx deleted file mode 100644 index 02e74bedc..000000000 --- a/src/GEOMGUI/GeometryGUI_CutDlg.cxx +++ /dev/null @@ -1,251 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_CutDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_CutDlg.h" - -#include "GeometryGUI.h" -#include "QAD_Desktop.h" - -//================================================================================= -// class : GeometryGUI_CutDlg() -// purpose : Constructs a GeometryGUI_CutDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_CutDlg::GeometryGUI_CutDlg(QWidget* parent, const char* name, BooleanGUI* theBooleanGUI, SALOME_Selection* Sel, bool modal, WFlags fl) - :GeometryGUI_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_CUT"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT"))); - - setCaption(tr("GEOM_CUT_TITLE")); - - /***************************************************************/ - GroupConstructors->setTitle(tr("GEOM_CUT")); - RadioButton1->setPixmap(image0); - RadioButton2->close(TRUE); - RadioButton3->close(TRUE); - - GroupCut = new GeometryGUI_2Sel_QTD(this, "GroupCut"); - GroupCut->GroupBox1->setTitle(tr("GEOM_ARGUMENTS")); - GroupCut->TextLabel1->setText(tr("GEOM_OBJECT_I").arg("1")); - GroupCut->TextLabel2->setText(tr("GEOM_OBJECT_I").arg("2")); - GroupCut->PushButton1->setPixmap(image1); - GroupCut->PushButton2->setPixmap(image1); - - Layout1->addWidget(GroupCut, 1, 0); - /***************************************************************/ - - /* Initialisation */ - myBooleanGUI = theBooleanGUI; - Init(); -} - - -//================================================================================= -// function : ~GeometryGUI_CutDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_CutDlg::~GeometryGUI_CutDlg() -{ - /* no need to delete child widgets, Qt does it all for us */ -} - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_CutDlg::Init() -{ - /* init variables */ - myEditCurrentArgument = GroupCut->LineEdit1; - - myShape1.Nullify(); - myShape2.Nullify(); - myOkShape1 = myOkShape2 = false; - - /* signals and slots connections */ - connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); - connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); - - connect(GroupCut->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); - connect(GroupCut->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); - - connect(GroupCut->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); - connect(GroupCut->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); - - connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - - /* displays Dialog */ - GroupCut->show(); - this->show(); - - return; -} - - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_CutDlg::ClickOnOk() -{ - this->ClickOnApply(); - ClickOnCancel(); - return ; -} - - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_CutDlg::ClickOnApply() -{ - myGeomGUI->GetDesktop()->putInfo(tr("")); - - if(myOkShape1 && myOkShape2) - myBooleanGUI->MakeBooleanAndDisplay(myGeomShape1 ,myGeomShape2, 2); - - return; -} - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection has changed -//================================================================================= -void GeometryGUI_CutDlg::SelectionIntoArgument() -{ - myEditCurrentArgument->setText(""); - QString aString = ""; - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString); - if(nbSel != 1) { - if(myEditCurrentArgument == GroupCut->LineEdit1) - myOkShape1 = false; - else if( myEditCurrentArgument == GroupCut->LineEdit2) - myOkShape2 = false; - return; - } - - /* nbSel == 1 */ - TopoDS_Shape S; - Standard_Boolean testResult; - Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject(); - - if(!myGeomGUI->GetTopoFromSelection(mySelection, S)) - return; - - if(myEditCurrentArgument == GroupCut->LineEdit1) { - myGeomShape1 = myGeomGUI->ConvertIOinGEOMShape(IO, testResult); - if(!testResult) - return; - myShape1 = S; - GroupCut->LineEdit1->setText(aString); - myOkShape1 = true; - } - else if(myEditCurrentArgument == GroupCut->LineEdit2) { - myGeomShape2 = myGeomGUI->ConvertIOinGEOMShape(IO, testResult); - if(!testResult) - return; - myShape2 = S; - GroupCut->LineEdit2->setText(aString); - myOkShape2 = true; - } - return; -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_CutDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - - if(send == GroupCut->PushButton1) { - GroupCut->LineEdit1->setFocus(); - myEditCurrentArgument = GroupCut->LineEdit1; - } - else if(send == GroupCut->PushButton2) { - GroupCut->LineEdit2->setFocus(); - myEditCurrentArgument = GroupCut->LineEdit2; - } - SelectionIntoArgument(); - - return; -} - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_CutDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if(send == GroupCut->LineEdit1) - myEditCurrentArgument = GroupCut->LineEdit1; - else if(send == GroupCut->LineEdit2) - myEditCurrentArgument = GroupCut->LineEdit2; - else - return; - - GeometryGUI_Skeleton::LineEditReturnPressed(); - return; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_CutDlg::ActivateThisDialog() -{ - GeometryGUI_Skeleton::ActivateThisDialog(); - connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - return; -} - - -//================================================================================= -// function : enterEvent() -// purpose : when mouse enter onto the QWidget -//================================================================================= -void GeometryGUI_CutDlg::enterEvent(QEvent * e) -{ - if(GroupConstructors->isEnabled()) - return; - this->ActivateThisDialog(); - return; -} diff --git a/src/GEOMGUI/GeometryGUI_CutDlg.h b/src/GEOMGUI/GeometryGUI_CutDlg.h deleted file mode 100644 index be8456c62..000000000 --- a/src/GEOMGUI/GeometryGUI_CutDlg.h +++ /dev/null @@ -1,76 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_CutDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_CUT_H -#define DIALOGBOX_CUT_H - -#include "GeometryGUI_Skeleton.h" -#include "GeometryGUI_2Sel_QTD.h" - -#include "BooleanGUI.h" - -#include - -//================================================================================= -// class : GeometryGUI_CutDlg -// purpose : -//================================================================================= -class GeometryGUI_CutDlg : public GeometryGUI_Skeleton -{ - Q_OBJECT - -public: - GeometryGUI_CutDlg( QWidget* parent = 0, const char* name = 0, BooleanGUI* theBooleanGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 ); - ~GeometryGUI_CutDlg(); - -private: - void Init(); - void enterEvent(QEvent* e); - - BooleanGUI* myBooleanGUI; - - TopoDS_Shape myShape1; /* topology used to fuse */ - TopoDS_Shape myShape2; /* topology used to fuse */ - GEOM::GEOM_Shape_var myGeomShape1; /* is myShape1 */ - GEOM::GEOM_Shape_var myGeomShape2; /* is myShape2 */ - bool myOkShape1; /* to check when arguments are defined */ - bool myOkShape2; - - GeometryGUI_2Sel_QTD* GroupCut; - -private slots: - void ClickOnOk(); - void ClickOnApply(); - void SetEditCurrentArgument(); - void SelectionIntoArgument(); - void LineEditReturnPressed(); - void ActivateThisDialog(); - -}; - -#endif // DIALOGBOX_CUT_H diff --git a/src/GEOMGUI/GeometryGUI_CylinderDlg.cxx b/src/GEOMGUI/GeometryGUI_CylinderDlg.cxx deleted file mode 100644 index 110775224..000000000 --- a/src/GEOMGUI/GeometryGUI_CylinderDlg.cxx +++ /dev/null @@ -1,415 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_CylinderDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_CylinderDlg.h" - -#include -#include - -#include "GeometryGUI.h" -#include "QAD_Desktop.h" -#include "QAD_Config.h" - -//================================================================================= -// class : GeometryGUI_CylinderDlg() -// purpose : Constructs a GeometryGUI_CylinderDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_CylinderDlg::GeometryGUI_CylinderDlg(QWidget* parent, const char* name, PrimitiveGUI* thePrimitiveGUI, SALOME_Selection* Sel, bool modal, WFlags fl) - :GeometryGUI_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_CYLINDER_PV"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_CYLINDER_DXYZ"))); - QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT"))); - - setCaption(tr("GEOM_CYLINDER_TITLE")); - - /***************************************************************/ - GroupConstructors->setTitle(tr("GEOM_CYLINDER")); - RadioButton1->setPixmap(image0); - RadioButton2->setPixmap(image1); - RadioButton3->close(TRUE); - - GroupPoints = new GeometryGUI_2Sel2Spin(this, "GroupPoints"); - GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS")); - GroupPoints->TextLabel1->setText(tr("GEOM_BASE_POINT")); - GroupPoints->TextLabel2->setText(tr("GEOM_VECTOR")); - GroupPoints->TextLabel3->setText(tr("GEOM_RADIUS")); - GroupPoints->TextLabel4->setText(tr("GEOM_HEIGHT")); - GroupPoints->PushButton1->setPixmap(image2); - GroupPoints->PushButton2->setPixmap(image2); - - GroupDimensions = new GeometryGUI_2Spin(this, "GroupDimensions"); - GroupDimensions->GroupBox1->setTitle(tr("GEOM_BOX_OBJ")); - GroupDimensions->TextLabel1->setText(tr("GEOM_HEIGHT")); - GroupDimensions->TextLabel2->setText(tr("GEOM_RADIUS")); - - Layout1->addWidget(GroupPoints, 1, 0); - Layout1->addWidget(GroupDimensions, 1, 0); - /***************************************************************/ - - /* Initialisations */ - myPrimitiveGUI = thePrimitiveGUI; - Init(); -} - - -//================================================================================= -// function : ~GeometryGUI_CylinderDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_CylinderDlg::~GeometryGUI_CylinderDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_CylinderDlg::Init() -{ - /* init variables */ - myConstructorId = 0; - myEditCurrentArgument = GroupPoints->LineEdit1; - - myRadius = 100.0; - myHeight = 300.0; - myOkRadius = myOkHeight = true; - myOkPoint1 = myOkDir = false; - - myEdgeFilter = new GEOM_EdgeFilter(StdSelect_Line, myGeom); - myVertexFilter = new GEOM_ShapeTypeFilter(TopAbs_VERTEX, myGeom); - mySelection->AddFilter(myVertexFilter); - - /* Get setting of step value from file configuration */ - QString St = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep"); - step = St.toDouble(); - - /* min, max, step and decimals for spin boxes & initial values */ - /* First constructor : radius */ - GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3); - /* First constructor : algebric height */ - GroupPoints->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3); - /* Second constructor : radius */ - GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3); - /* Second constructor : algebric height */ - GroupDimensions->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3); - - GroupPoints->SpinBox_DX->SetValue(myRadius); - GroupPoints->SpinBox_DY->SetValue(myHeight); - GroupDimensions->SpinBox_DX->SetValue(myRadius); - GroupDimensions->SpinBox_DY->SetValue(myHeight); - - /* signals and slots connections */ - connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); - connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); - connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int))); - - connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); - connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); - - connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); - connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); - - connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(GroupPoints->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(GroupDimensions->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(GroupDimensions->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - - connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; - - /* displays Dialog */ - GroupDimensions->hide(); - GroupPoints->show(); - this->show(); - - return ; -} - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_CylinderDlg::ConstructorsClicked(int constructorId) -{ - myConstructorId = constructorId; - mySelection->ClearFilters(); - myGeomGUI->EraseSimulationShape(); - disconnect(mySelection, 0, this, 0); - myOkHeight = myOkRadius = true; - myRadius = 100.0; - myHeight = 300.0; - - switch(myConstructorId) - { - case 0 : - { - GroupDimensions->hide(); - resize(0, 0); - GroupPoints->show(); - myOkPoint1 = myOkDir = false; - - myEditCurrentArgument = GroupPoints->LineEdit1; - GroupPoints->LineEdit1->setText(tr("")); - GroupPoints->LineEdit2->setText(tr("")); - - GroupPoints->SpinBox_DX->SetValue(myRadius); - GroupPoints->SpinBox_DY->SetValue(myHeight); - - /* filter for next selection */ - mySelection->AddFilter(myVertexFilter); - connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - break; - } - case 1 : - { - GroupPoints->hide(); - resize( 0, 0 ); - GroupDimensions->show(); - myOkPoint1 = myOkDir = true; - - GroupDimensions->SpinBox_DX->SetValue(myRadius); - GroupDimensions->SpinBox_DY->SetValue(myHeight); - myPoint1.SetCoord(0.0, 0.0, 0.0); - myDir.SetCoord(0.0, 0.0, 1.0); - - MakeCylinderSimulationAndDisplay(); - break; - } - } - return ; -} - - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_CylinderDlg::ClickOnOk() -{ - this->ClickOnApply(); - ClickOnCancel(); - return; -} - - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_CylinderDlg::ClickOnApply() -{ - myGeomGUI->GetDesktop()->putInfo(tr("")); - if (mySimulationTopoDs.IsNull()) - return; - myGeomGUI->EraseSimulationShape(); - mySimulationTopoDs.Nullify(); - - if(myOkPoint1 && myOkDir && myOkRadius && myOkHeight) { - gp_Dir aDir = myDir; - /* allows user to reverse direction of construction with a negative height */ - if(this->myHeight < -Precision::Confusion()) - aDir.Reverse(); - myPrimitiveGUI->MakeCylinderAndDisplay(myPoint1, aDir, myRadius, fabs(myHeight)); - } - return; -} - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -//================================================================================= -void GeometryGUI_CylinderDlg::SelectionIntoArgument() -{ - myGeomGUI->EraseSimulationShape(); - myEditCurrentArgument->setText(""); - QString aString = ""; /* name of selection */ - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString); - if(nbSel != 1) { - if(myEditCurrentArgument == GroupPoints->LineEdit1) - myOkPoint1 = false; - else if (myEditCurrentArgument == GroupPoints->LineEdit2) - myOkDir = false; - return; - } - - /* nbSel == 1 */ - TopoDS_Shape S; - if(!myGeomGUI->GetTopoFromSelection(mySelection, S)) - return; - - /* gp_Pnt : not used */ - if (myEditCurrentArgument == GroupPoints->LineEdit1 && myGeomGUI->VertexToPoint(S, myPoint1)) { - GroupPoints->LineEdit1->setText(aString); - myOkPoint1 = true; - } - else if (myEditCurrentArgument == GroupPoints->LineEdit2) { - BRepAdaptor_Curve curv(TopoDS::Edge(S)); - myDir = curv.Line().Direction(); - GroupPoints->LineEdit2->setText(aString); - myOkDir = true; - } - - if(myOkPoint1 && myOkDir && myOkRadius && myOkHeight) - MakeCylinderSimulationAndDisplay(); - return; -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_CylinderDlg::SetEditCurrentArgument() -{ - if(myConstructorId != 0) - return; - - QPushButton* send = (QPushButton*)sender(); - - if(send == GroupPoints->PushButton1) { - GroupPoints->LineEdit1->setFocus(); - myEditCurrentArgument = GroupPoints->LineEdit1; - mySelection->AddFilter(myVertexFilter); - } - else if(send == GroupPoints->PushButton2) { - GroupPoints->LineEdit2->setFocus(); - myEditCurrentArgument = GroupPoints->LineEdit2; - mySelection->AddFilter(myEdgeFilter); - } - this->SelectionIntoArgument(); - - return; -} - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_CylinderDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if(send == GroupPoints->LineEdit1) - myEditCurrentArgument = GroupPoints->LineEdit1; - else if (send == GroupPoints->LineEdit2) - myEditCurrentArgument = GroupPoints->LineEdit2; - else - return; - - GeometryGUI_Skeleton::LineEditReturnPressed(); - return; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_CylinderDlg::ActivateThisDialog() -{ - GeometryGUI_Skeleton::ActivateThisDialog(); - connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - if(!mySimulationTopoDs.IsNull()) - myGeomGUI->DisplaySimulationShape(mySimulationTopoDs); - return; -} - - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void GeometryGUI_CylinderDlg::enterEvent(QEvent* e) -{ - if (GroupConstructors->isEnabled()) - return; - this->ActivateThisDialog(); - return; -} - - -//================================================================================= -// function : ValueChangedInSpinBox -// purpose : -//================================================================================= -void GeometryGUI_CylinderDlg::ValueChangedInSpinBox( double newValue ) -{ - myGeomGUI->EraseSimulationShape(); - mySimulationTopoDs.Nullify(); - QObject* send = (QObject*)sender(); - - /* radius */ - if(send == GroupPoints->SpinBox_DX || send == GroupDimensions->SpinBox_DX) { - myRadius = newValue; - myOkRadius = true; - } /* algebric height */ - else if(send == GroupPoints->SpinBox_DY || send == GroupDimensions->SpinBox_DY) { - myHeight = newValue; - myOkHeight = true; - } - - if (myOkPoint1 && myOkDir && myOkRadius && myOkHeight) - MakeCylinderSimulationAndDisplay(); - return; -} - - -//================================================================================= -// function : MakeCylinderSimulationAndDisplay() -// purpose : -//================================================================================= -void GeometryGUI_CylinderDlg::MakeCylinderSimulationAndDisplay() -{ - myGeomGUI->EraseSimulationShape(); - mySimulationTopoDs.Nullify(); - gp_Dir aDir = this->myDir; - - try { - /* allows user to reverse direction of construction with a negative height */ - if(this->myHeight < -Precision::Confusion()) - aDir.Reverse(); - - gp_Ax2 anAxis(this->myPoint1, aDir); - - mySimulationTopoDs = BRepPrimAPI_MakeCylinder(anAxis, this->myRadius, fabs(myHeight)).Shape(); - myGeomGUI->DisplaySimulationShape(mySimulationTopoDs); - } - catch(Standard_Failure) { - MESSAGE("Exception catched in MakeCylinderSimulationAndDisplay"); - } - return; -} diff --git a/src/GEOMGUI/GeometryGUI_CylinderDlg.h b/src/GEOMGUI/GeometryGUI_CylinderDlg.h deleted file mode 100644 index 5a32e71cf..000000000 --- a/src/GEOMGUI/GeometryGUI_CylinderDlg.h +++ /dev/null @@ -1,92 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_CylinderDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_CYLINDER_H -#define DIALOGBOX_CYLINDER_H - -#include "GeometryGUI_Skeleton.h" -#include "GeometryGUI_2Sel2Spin.h" -#include "GeometryGUI_2Spin.h" - -#include "PrimitiveGUI.h" - -#include "GEOM_EdgeFilter.hxx" - -#include -#include - -//================================================================================= -// class : GeometryGUI_CylinderDlg -// purpose : -//================================================================================= -class GeometryGUI_CylinderDlg : public GeometryGUI_Skeleton -{ - Q_OBJECT - -public: - GeometryGUI_CylinderDlg(QWidget* parent = 0, const char* name = 0, PrimitiveGUI* thePrimitiveGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0); - ~GeometryGUI_CylinderDlg(); - -private: - void Init(); - void enterEvent(QEvent* e); - void MakeCylinderSimulationAndDisplay(); - - PrimitiveGUI* myPrimitiveGUI; - - double step; - int myConstructorId; - Handle(GEOM_ShapeTypeFilter) myVertexFilter; - Handle(GEOM_EdgeFilter) myEdgeFilter; /* Filter selection */ - - gp_Pnt myPoint1; /* topology used */ - gp_Dir myDir; - bool myOkPoint1; /* to check when arguments is defined */ - bool myOkDir; - - Standard_Real myRadius; - Standard_Real myHeight; - bool myOkRadius; - bool myOkHeight; - - GeometryGUI_2Sel2Spin* GroupPoints; - GeometryGUI_2Spin* GroupDimensions; - -private slots: - void ClickOnOk(); - void ClickOnApply(); - void ActivateThisDialog(); - void LineEditReturnPressed(); - void SelectionIntoArgument(); - void SetEditCurrentArgument(); - void ConstructorsClicked(int constructorId); - void ValueChangedInSpinBox(double newValue); - -}; - -#endif // DIALOGBOX_CYLINDER_H diff --git a/src/GEOMGUI/GeometryGUI_DistanceDlg.cxx b/src/GEOMGUI/GeometryGUI_DistanceDlg.cxx deleted file mode 100644 index cc60a3c14..000000000 --- a/src/GEOMGUI/GeometryGUI_DistanceDlg.cxx +++ /dev/null @@ -1,589 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_DistanceDlg.cxx -// Author : Nicolas REJNERI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_DistanceDlg.h" - -#include "GeometryGUI.h" -#include "QAD_Application.h" -#include "QAD_Desktop.h" -#include "QAD_RightFrame.h" -#include "utilities.h" - -#include "OCCViewer_Viewer3d.h" -#include "OCCViewer_ViewFrame.h" - -// Open CASCADE Includes -#include -#include -#include - -// QT Includes -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -//================================================================================= -// class : GeometryGUI_DistanceDlg() -// purpose : Constructs a GeometryGUI_DistanceDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_DistanceDlg::GeometryGUI_DistanceDlg( QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_MINDIST"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - - if ( !name ) - setName( "GeometryGUI_DistanceDlg" ); - resize( 322, 220 ); - setCaption( tr( "GEOM_MINDIST_TITLE" ) ); - setSizeGripEnabled( TRUE ); - - GeometryGUI_DistanceDlgLayout = new QGridLayout( this ); - GeometryGUI_DistanceDlgLayout->setSpacing( 6 ); - GeometryGUI_DistanceDlgLayout->setMargin( 11 ); - - /***************************************************************/ - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "GEOM_DISTANCE" ) ); - GroupConstructors->setExclusive( TRUE ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer, 0, 1 ); - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setText( tr( "" ) ); - Constructor1->setPixmap( image0 ); - Constructor1->setChecked( TRUE ); - Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) ); - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - GeometryGUI_DistanceDlgLayout->addWidget( GroupConstructors, 0, 0 ); - - /***************************************************************/ - GroupConstructor1 = new QGroupBox( this, "GroupConstructor1" ); - GroupConstructor1->setTitle( tr( "GEOM_MINDIST_OBJ" ) ); - GroupConstructor1->setColumnLayout(0, Qt::Vertical ); - GroupConstructor1->layout()->setSpacing( 0 ); - GroupConstructor1->layout()->setMargin( 0 ); - GroupConstructor1Layout = new QGridLayout( GroupConstructor1->layout() ); - GroupConstructor1Layout->setAlignment( Qt::AlignTop ); - GroupConstructor1Layout->setSpacing( 6 ); - GroupConstructor1Layout->setMargin( 11 ); - LineEditC1A2Shape = new QLineEdit( GroupConstructor1, "LineEditC1A2Shape" ); - LineEditC1A2Shape->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC1A2Shape->sizePolicy().hasHeightForWidth() ) ); - GroupConstructor1Layout->addWidget( LineEditC1A2Shape, 1, 2 ); - LineEditC1A1Shape = new QLineEdit( GroupConstructor1, "LineEditC1A1Shape" ); - LineEditC1A1Shape->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC1A1Shape->sizePolicy().hasHeightForWidth() ) ); - GroupConstructor1Layout->addWidget( LineEditC1A1Shape, 0, 2 ); - SelectButtonC1A1Shape = new QPushButton( GroupConstructor1, "SelectButtonC1A1Shape" ); - SelectButtonC1A1Shape->setText( tr( "" ) ); - SelectButtonC1A1Shape->setPixmap( image1 ); - GroupConstructor1Layout->addWidget( SelectButtonC1A1Shape, 0, 1 ); - SelectButtonC1A2Shape = new QPushButton( GroupConstructor1, "SelectButtonC1A2Shape" ); - SelectButtonC1A2Shape->setText( tr( "" ) ); - SelectButtonC1A2Shape->setPixmap( image1 ); - GroupConstructor1Layout->addWidget( SelectButtonC1A2Shape, 1, 1 ); - TextLabelC1A2Shape = new QLabel( GroupConstructor1, "TextLabelC1A2Shape" ); - TextLabelC1A2Shape->setText( tr( "GEOM_OBJECT_I" ).arg("2") ); - TextLabelC1A2Shape->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A2Shape->setFrameShape( QLabel::NoFrame ); - TextLabelC1A2Shape->setFrameShadow( QLabel::Plain ); - GroupConstructor1Layout->addWidget( TextLabelC1A2Shape, 1, 0 ); - TextLabelC1A1Shape = new QLabel( GroupConstructor1, "TextLabelC1A1Shape" ); - TextLabelC1A1Shape->setText( tr( "GEOM_OBJECT_I" ).arg("1") ); - TextLabelC1A1Shape->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A1Shape->setFrameShape( QLabel::NoFrame ); - TextLabelC1A1Shape->setFrameShadow( QLabel::Plain ); - GroupConstructor1Layout->addWidget( TextLabelC1A1Shape, 0, 0 ); - GeometryGUI_DistanceDlgLayout->addWidget( GroupConstructor1, 1, 0 ); - - TextLabel_Length = new QLabel( GroupConstructor1, "TextLabel_Length" ); - TextLabel_Length->setText( tr( "GEOM_LENGTH" ) ); - TextLabel_Length->setMinimumSize( QSize( 50, 0 ) ); - TextLabel_Length->setFrameShape( QLabel::NoFrame ); - TextLabel_Length->setFrameShadow( QLabel::Plain ); - GroupConstructor1Layout->addWidget( TextLabel_Length, 2, 0 ); - LineEdit_Length = new QLineEdit( GroupConstructor1, "LineEdit_Length" ); - LineEdit_Length->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEdit_Length->sizePolicy().hasHeightForWidth() ) ); - // LineEdit_Length->setEnabled( FALSE ); - LineEdit_Length->setReadOnly( TRUE ); - GroupConstructor1Layout->addWidget( LineEdit_Length, 2, 2 ); - - /***************************************************************/ - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); - GroupButtons->setTitle( tr( "" ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 3 ); - buttonApply = new QPushButton( GroupButtons, "buttonApply" ); - buttonApply->setText( tr( "GEOM_BUT_APPLY" ) ); - buttonApply->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonApply, 0, 1 ); - QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_9, 0, 2 ); - buttonOk = new QPushButton( GroupButtons, "buttonOk" ); - buttonOk->setText( tr( "GEOM_BUT_OK" ) ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - GeometryGUI_DistanceDlgLayout->addWidget( GroupButtons, 2, 0 ); - - /* Initialisation */ - Init( Sel ) ; -} - - -//================================================================================= -// function : ~GeometryGUI_DistanceDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_DistanceDlg::~GeometryGUI_DistanceDlg() -{ - /* no need to delete child widgets, Qt does it all for us */ - this->destroy(TRUE, TRUE) ; -} - - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_DistanceDlg::Init( SALOME_Selection* Sel ) -{ - mySelection = Sel ; - myShape1.Nullify() ; - myShape2.Nullify() ; - myConstructorId = 0 ; - - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - - GroupConstructor1->show(); - myConstructorId = 0 ; - myEditCurrentArgument = LineEditC1A1Shape ; - Constructor1->setChecked( TRUE ); - myOkShape1 = myOkShape2 = false ; - - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - - // TODO previous selection into argument ? - - /* signals and slots connections */ - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ; - connect( buttonApply, SIGNAL( clicked() ), this, SLOT(ClickOnApply() ) ); - connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) ); - connect( SelectButtonC1A1Shape, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( SelectButtonC1A2Shape, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - - connect( LineEditC1A1Shape, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - connect( LineEditC1A2Shape, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ; - /* to close dialog if study change */ - connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ; - - /* Move widget on the botton right corner of main widget */ - int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; - this->show() ; /* Displays Dialog */ - - return ; -} - - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_DistanceDlg::ConstructorsClicked(int constructorId) -{ - EraseDistance(); - myGeomGUI->EraseSimulationShape() ; - - switch (constructorId) - { - case 0: - { - GroupConstructor1->show(); - myConstructorId = constructorId ; - myEditCurrentArgument = LineEditC1A1Shape ; - LineEditC1A2Shape->setText(tr("")) ; - Constructor1->setChecked( TRUE ); - myOkShape1 = myOkShape2 = false ; - break; - } - } - return ; -} - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_DistanceDlg::ClickOnOk() -{ - this->ClickOnApply() ; - this->ClickOnCancel() ; - - return ; -} - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_DistanceDlg::ClickOnApply() -{ - EraseDistance() ; - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - myGeomGUI->GetDesktop()->putInfo( tr("") ) ; - switch(myConstructorId) - { - case 0 : - { - if(myOkShape1 && myOkShape2) { - this->MakeDistanceSimulationAndDisplay(myShape1 ,myShape2) ; - } - break ; - } - } - - // accept(); - return ; -} - - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void GeometryGUI_DistanceDlg::ClickOnCancel() -{ - EraseDistance() ; - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->ResetState() ; - reject() ; - return ; -} - - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection has changed -//================================================================================= -void GeometryGUI_DistanceDlg::SelectionIntoArgument() -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - - LineEdit_Length->setText("") ; - myEditCurrentArgument->setText("") ; /* by default */ - QString aString = ""; /* the name of selection */ - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; - if ( nbSel != 1 ) { - switch (myConstructorId) - { - case 0: - { - if ( myEditCurrentArgument == LineEditC1A1Shape ) { - myOkShape1 = false ; - } - else if ( myEditCurrentArgument == LineEditC1A2Shape ) { - myOkShape2 = false ; - } - break ; - } - } - return ; - } - - /* nbSel == 1 */ - TopoDS_Shape S; - Standard_Boolean testResult ; - Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject() ; - - if( !myGeomGUI->GetTopoFromSelection(mySelection, S) ) - return ; - - if ( myEditCurrentArgument == LineEditC1A1Shape ) { - myGeomShape1 = myGeomGUI->ConvertIOinGEOMShape(IO, testResult) ; - if( !testResult ) - return ; - myShape1 = S ; - LineEditC1A1Shape->setText(aString) ; - myOkShape1 = true ; - } - else if ( myEditCurrentArgument == LineEditC1A2Shape ) { - myGeomShape2 = myGeomGUI->ConvertIOinGEOMShape(IO, testResult) ; - if( !testResult ) - return ; - myShape2 = S ; - LineEditC1A2Shape->setText(aString) ; - myOkShape2 = true ; - } - - return ; -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_DistanceDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - - switch (myConstructorId) - { - case 0: /* default constructor */ - { - if( send == SelectButtonC1A1Shape ) { - LineEditC1A1Shape->setFocus() ; - myEditCurrentArgument = LineEditC1A1Shape ; - } - else if(send == SelectButtonC1A2Shape) { - LineEditC1A2Shape->setFocus() ; - myEditCurrentArgument = LineEditC1A2Shape; - } - SelectionIntoArgument() ; - break; - } - } - return ; -} - - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_DistanceDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if( send == LineEditC1A1Shape ) - myEditCurrentArgument = LineEditC1A1Shape ; - else if ( send == LineEditC1A2Shape ) - myEditCurrentArgument = LineEditC1A2Shape ; - else - return ; - - /* User name of object input management */ - /* If successfull the selection is changed and signal emitted... */ - /* so SelectionIntoArgument() is automatically called. */ - const QString objectUserName = myEditCurrentArgument->text() ; - QWidget* thisWidget = (QWidget*)this ; - if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) { - myEditCurrentArgument->setText( objectUserName ) ; - } - return ; -} - - - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void GeometryGUI_DistanceDlg::DeactivateActiveDialog() -{ - if ( GroupConstructors->isEnabled() ) { - - GroupConstructors->setEnabled(false) ; - GroupConstructor1->setEnabled(false) ; - GroupButtons->setEnabled(false) ; - disconnect( mySelection, 0, this, 0 ); - } - return ; -} - - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_DistanceDlg::closeEvent( QCloseEvent* e ) -{ - this->ClickOnCancel() ; /* same than click on cancel button */ -} - - -//================================================================================= -// function : enterEvent() -// purpose : when mouse enter onto the QWidget -//================================================================================= -void GeometryGUI_DistanceDlg::enterEvent( QEvent * ) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; -} - - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_DistanceDlg::ActivateThisDialog() -{ - /* Emit a signal to deactivate any active dialog */ - myGeomGUI->EmitSignalDeactivateDialog() ; - GroupConstructors->setEnabled(true) ; - GroupConstructor1->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - - connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - - if( !mySimulationTopoDs.IsNull() ) - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - - return ; -} - - - -//================================================================================= -// function : MakeDistanceSimulationAndDisplay() -// purpose : -//================================================================================= -void GeometryGUI_DistanceDlg::MakeDistanceSimulationAndDisplay(const TopoDS_Shape& S1, const TopoDS_Shape& S2) -{ - LineEdit_Length->setText("") ; - EraseDistance() ; - myGeomGUI->EraseSimulationShape() ; - - BRepExtrema_DistShapeShape dst( S1, S2 ); - if (dst.IsDone()) { - int i; - for (i=1; i<= dst.NbSolution(); i++) { - gp_Pnt P1,P2; - P1 = (dst.PointOnShape1(i)); - P2 = (dst.PointOnShape2(i)); - - Standard_Real Dist = P1.Distance(P2); - if (Dist<=1.e-9) { - BRepBuilderAPI_MakeVertex MakeVertex(P1); - mySimulationTopoDs = MakeVertex.Vertex(); - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - - LineEdit_Length->setText("0.0") ; - } else { - BRepBuilderAPI_MakeEdge MakeEdge(P1, P2); - mySimulationTopoDs = MakeEdge.Edge(); - - TopoDS_Vertex V1 = BRepBuilderAPI_MakeVertex(P1); - TopoDS_Vertex V2 = BRepBuilderAPI_MakeVertex(P2); - - QString S; - S.sprintf("%.1f",Dist); - Handle(AIS_LengthDimension) Distance = new AIS_LengthDimension (V1,V2, new Geom_Plane (0.,0.,1.,0.), - Dist, TCollection_ExtendedString(strdup(S))); - - LineEdit_Length->setText(S) ; - - if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC ) - return ; - - OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer(); - Handle (AIS_InteractiveContext) ic = v3d->getAISContext(); - ic->Display( Distance ); - ic->UpdateCurrentViewer(); - } - } - } else - myGeomGUI->GetDesktop()->putInfo( tr( "GEOM_PRP_MIN_DIST" ) ); -} - - -//================================================================================= -// function : EraseDistance() -// purpose : -//================================================================================= -void GeometryGUI_DistanceDlg::EraseDistance() -{ - int count = myGeomGUI->GetActiveStudy()->getStudyFramesCount(); - for ( int i = 0; i < count; i++ ) - if (myGeomGUI->GetActiveStudy()->getStudyFrame(i)->getTypeView() == VIEW_OCC ) { - OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getStudyFrame(i)->getRightFrame()->getViewFrame())->getViewer(); - Handle (AIS_InteractiveContext) ic = v3d->getAISContext(); - - AIS_ListOfInteractive L; - ic->DisplayedObjects(AIS_KOI_Relation,-1,L); - AIS_ListIteratorOfListOfInteractive ite(L); - while (ite.More()) { - ic->Remove( ite.Value() ); - ic->UpdateCurrentViewer(); - ite.Next(); - } - } -} diff --git a/src/GEOMGUI/GeometryGUI_DistanceDlg.h b/src/GEOMGUI/GeometryGUI_DistanceDlg.h deleted file mode 100644 index 742fe38e2..000000000 --- a/src/GEOMGUI/GeometryGUI_DistanceDlg.h +++ /dev/null @@ -1,125 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_DistanceDlg.h -// Author : Nicolas REJNERI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_DISTANCE_H -#define DIALOGBOX_DISTANCE_H - -#include "SALOME_Selection.h" -#include "GEOM_ShapeTypeFilter.hxx" - -#include -#include - -#include -#include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QFrame; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QRadioButton; -class GeometryGUI; - - -//================================================================================= -// class : GeometryGUI_DistanceDlg -// purpose : -//================================================================================= -class GeometryGUI_DistanceDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_DistanceDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 ); - ~GeometryGUI_DistanceDlg(); - -private: - - void Init( SALOME_Selection* Sel ) ; - void closeEvent( QCloseEvent* e ) ; - void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */ - void MakeDistanceSimulationAndDisplay( const TopoDS_Shape& S1, const TopoDS_Shape& S2 ) ; - void EraseDistance() ; - - GEOM::GEOM_Gen_var myGeom ; /* Current GeomI object */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - SALOME_Selection* mySelection ; /* User shape selection */ - TopoDS_Shape myShape1 ; - TopoDS_Shape myShape2 ; - GEOM::GEOM_Shape_var myGeomShape1 ; - GEOM::GEOM_Shape_var myGeomShape2 ; - bool myOkShape1 ; - bool myOkShape2 ; /* to check when arguments are defined */ - int myConstructorId ; /* Current constructor id = radio button id */ - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - TopoDS_Shape mySimulationTopoDs; /* Shape used for simulation display */ - - QButtonGroup* GroupConstructors; - QRadioButton* Constructor1; - - QGroupBox* GroupConstructor1; - QLineEdit* LineEditC1A1Shape; - QLineEdit* LineEditC1A2Shape; - QPushButton* SelectButtonC1A1Shape; - QPushButton* SelectButtonC1A2Shape; - QLabel* TextLabelC1A2Shape; - QLabel* TextLabelC1A1Shape; - - QLabel* TextLabel_Length; - QLineEdit* LineEdit_Length; - - QGroupBox* GroupButtons; - QPushButton* buttonApply; - QPushButton* buttonOk; - QPushButton* buttonCancel; - -private slots: - - void ConstructorsClicked(int constructorId); - void ClickOnOk(); - void ClickOnCancel(); - void ClickOnApply(); - void SetEditCurrentArgument() ; - void SelectionIntoArgument() ; - void LineEditReturnPressed() ; - void DeactivateActiveDialog() ; - void ActivateThisDialog() ; - -protected: - QGridLayout* GeometryGUI_DistanceDlgLayout; - QGridLayout* GroupConstructorsLayout; - QGridLayout* GroupButtonsLayout; - QGridLayout* GroupConstructor1Layout; -}; - -#endif // DIALOGBOX_DISTANCE_H diff --git a/src/GEOMGUI/GeometryGUI_EdgeDlg.cxx b/src/GEOMGUI/GeometryGUI_EdgeDlg.cxx deleted file mode 100644 index 6d212261f..000000000 --- a/src/GEOMGUI/GeometryGUI_EdgeDlg.cxx +++ /dev/null @@ -1,462 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_EdgeDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_EdgeDlg.h" - -#include "GeometryGUI.h" -#include "QAD_Application.h" -#include "QAD_Desktop.h" -#include "utilities.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - - -//================================================================================= -// class : GeometryGUI_EdgeDlg() -// purpose : Constructs a GeometryGUI_EdgeDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_EdgeDlg::GeometryGUI_EdgeDlg( QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_BUILD_EDGE"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - - if ( !name ) - setName( "GeometryGUI_EdgeDlg" ); - resize( 303, 225 ); - setCaption( tr( "GEOM_EDGE_TITLE" ) ); - setSizeGripEnabled( TRUE ); - GeometryGUI_EdgeDlgLayout = new QGridLayout( this ); - GeometryGUI_EdgeDlgLayout->setSpacing( 6 ); - GeometryGUI_EdgeDlgLayout->setMargin( 11 ); - - /***************************************************************/ - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "GEOM_EDGE" ) ); - GroupConstructors->setExclusive( TRUE ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setText( tr( "" ) ); - Constructor1->setPixmap( image0 ); - Constructor1->setChecked( TRUE ); - Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) ); - Constructor1->setMinimumSize( QSize( 50, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer, 0, 1 ); - GeometryGUI_EdgeDlgLayout->addWidget( GroupConstructors, 0, 0 ); - - /***************************************************************/ - GroupC1 = new QGroupBox( this, "GroupC1" ); - GroupC1->setTitle( tr( "GEOM_POINTS" ) ); - GroupC1->setMinimumSize( QSize( 0, 0 ) ); - GroupC1->setFrameShape( QGroupBox::Box ); - GroupC1->setFrameShadow( QGroupBox::Sunken ); - GroupC1->setColumnLayout(0, Qt::Vertical ); - GroupC1->layout()->setSpacing( 0 ); - GroupC1->layout()->setMargin( 0 ); - GroupC1Layout = new QGridLayout( GroupC1->layout() ); - GroupC1Layout->setAlignment( Qt::AlignTop ); - GroupC1Layout->setSpacing( 6 ); - GroupC1Layout->setMargin( 11 ); - SelectButtonC1A2 = new QPushButton( GroupC1, "SelectButtonC1A2" ); - SelectButtonC1A2->setText( tr( "" ) ); - SelectButtonC1A2->setPixmap( image1 ); - GroupC1Layout->addWidget( SelectButtonC1A2, 1, 1 ); - LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" ); - GroupC1Layout->addWidget( LineEditC1A1, 0, 2 ); - LineEditC1A2 = new QLineEdit( GroupC1, "LineEditC1A2" ); - GroupC1Layout->addWidget( LineEditC1A2, 1, 2 ); - SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" ); - SelectButtonC1A1->setText( tr( "" ) ); - SelectButtonC1A1->setPixmap( image1 ); - SelectButtonC1A1->setToggleButton( FALSE ); - GroupC1Layout->addWidget( SelectButtonC1A1, 0, 1 ); - TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" ); - TextLabelC1A1->setText( tr( "GEOM_POINT_I" ).arg("1") ); - TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A1->setFrameShape( QLabel::NoFrame ); - TextLabelC1A1->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabelC1A1, 0, 0 ); - TextLabelC1A2 = new QLabel( GroupC1, "TextLabelC1A2" ); - TextLabelC1A2->setText( tr( "GEOM_POINT_I" ).arg("2") ); - TextLabelC1A2->setMinimumSize( QSize( 50, 0 ) ); - GroupC1Layout->addWidget( TextLabelC1A2, 1, 0 ); - GeometryGUI_EdgeDlgLayout->addWidget( GroupC1, 1, 0 ); - - /***************************************************************/ - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); - GroupButtons->setTitle( tr( "" ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 3 ); - buttonApply = new QPushButton( GroupButtons, "buttonApply" ); - buttonApply->setText( tr( "GEOM_BUT_APPLY" ) ); - buttonApply->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonApply, 0, 1 ); - QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_9, 0, 2 ); - buttonOk = new QPushButton( GroupButtons, "buttonOk" ); - buttonOk->setText( tr( "GEOM_BUT_OK" ) ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - GeometryGUI_EdgeDlgLayout->addWidget( GroupButtons, 2, 0 ); - /***************************************************************/ - - Init(Sel) ; /* Initialisations */ -} - - -//================================================================================= -// function : ~GeometryGUI_EdgeDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_EdgeDlg::~GeometryGUI_EdgeDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_EdgeDlg::Init( SALOME_Selection* Sel ) -{ - - GroupC1->show(); - // GroupC2->hide(); - // GroupC3->hide(); - myConstructorId = 0 ; - Constructor1->setChecked( TRUE ); - myEditCurrentArgument = LineEditC1A1 ; - mySelection = Sel; - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - myPoint1.SetCoord( 0.0, 0.0, 0.0 ); - myPoint2.SetCoord( 0.0, 0.0, 0.0 ); - myOkPoint1 = myOkPoint2 = false ; - mySimulationTopoDs.Nullify() ; - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - - // TODO : previous selection into argument ? - - /* Filters definition */ - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - myVertexFilter = new GEOM_ShapeTypeFilter( TopAbs_VERTEX, myGeom ); - mySelection->AddFilter(myVertexFilter) ; /* first filter used */ - - /* signals and slots connections */ - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ; - connect( buttonApply, SIGNAL( clicked() ), this, SLOT(ClickOnApply() ) ); - connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) ); - connect( SelectButtonC1A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( SelectButtonC1A2, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - - connect( LineEditC1A1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - connect( LineEditC1A2, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - - connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ; - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - /* to close dialog if study change */ - connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ; - - /* Move widget on the botton right corner of main widget */ - int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; - this->show() ; /* displays Dialog */ - - return ; -} - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_EdgeDlg::ConstructorsClicked(int constructorId) -{ - switch (constructorId) - { - case 0: - { - break; - } - } - return ; -} - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_EdgeDlg::ClickOnOk() -{ - this->ClickOnApply() ; - this->ClickOnCancel() ; - - return ; -} - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_EdgeDlg::ClickOnApply() -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - myGeomGUI->GetDesktop()->putInfo( tr("") ) ; - switch(myConstructorId) - { - case 0 : - { - if(myOkPoint1 && myOkPoint2) - myGeomGUI->MakeLinearEdgeAndDisplay( myPoint1, myPoint2 ) ; - break ; - } - } - // accept(); - return ; -} - - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void GeometryGUI_EdgeDlg::ClickOnCancel() -{ - mySelection->ClearFilters() ; - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->ResetState() ; - reject() ; - return ; -} - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -//================================================================================= -void GeometryGUI_EdgeDlg::SelectionIntoArgument() -{ - myEditCurrentArgument->setText("") ; - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - - QString aString = ""; /* name of future selection */ - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; - if ( nbSel != 1 ) { - if ( myEditCurrentArgument == LineEditC1A1 ) { - myOkPoint1 = false ; - } - else if ( myEditCurrentArgument == LineEditC1A2 ) { - myOkPoint2 = false ; - } - return ; - } - - // nbSel == 1 ! - TopoDS_Shape S; - if( !myGeomGUI->GetTopoFromSelection(mySelection, S) ) - return ; - - if ( myConstructorId == 0 && myEditCurrentArgument == LineEditC1A1 && myGeomGUI->VertexToPoint(S, myPoint1) ) { - myEditCurrentArgument->setText(aString) ; - myOkPoint1 = true ; - } - else if ( myConstructorId == 0 && myEditCurrentArgument == LineEditC1A2 && myGeomGUI->VertexToPoint(S, myPoint2) ) { - myEditCurrentArgument->setText(aString) ; - myOkPoint2 = true ; - } - - if( myOkPoint1 && myOkPoint2 && myPoint1.Distance(myPoint2) > Precision::Confusion() ) { - mySimulationTopoDs = BRepBuilderAPI_MakeEdge( myPoint1, myPoint2 ).Shape(); - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - } - return ; -} - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_EdgeDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if( send == LineEditC1A1 ) - myEditCurrentArgument = LineEditC1A1 ; - else if ( send == LineEditC1A2 ) - myEditCurrentArgument = LineEditC1A2 ; - else - return ; - - /* User name of object input management */ - /* If successfull the selection is changed and signal emitted... */ - /* so SelectionIntoArgument() is automatically called. */ - const QString objectUserName = myEditCurrentArgument->text() ; - QWidget* thisWidget = (QWidget*)this ; - if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) { - myEditCurrentArgument->setText( objectUserName ) ; - } - return ; -} - - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_EdgeDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - mySelection->ClearFilters() ; - switch (myConstructorId) - { - case 0: /* default constructor */ - { - if(send == SelectButtonC1A1) { - LineEditC1A1->setFocus() ; - myEditCurrentArgument = LineEditC1A1; - } - else if(send == SelectButtonC1A2) { - LineEditC1A2->setFocus() ; - myEditCurrentArgument = LineEditC1A2; - } - mySelection->AddFilter(myVertexFilter) ; - SelectionIntoArgument() ; - break; - } - } - return ; -} - - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void GeometryGUI_EdgeDlg::DeactivateActiveDialog() -{ - if ( GroupConstructors->isEnabled() ) { - - GroupConstructors->setEnabled(false) ; - GroupC1->setEnabled(false) ; - // TODO other constructors - // - GroupButtons->setEnabled(false) ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->EraseSimulationShape() ; - mySelection->ClearFilters() ; - } - return ; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_EdgeDlg::ActivateThisDialog() -{ - /* Emit a signal to deactivate the active dialog */ - myGeomGUI->EmitSignalDeactivateDialog() ; - GroupConstructors->setEnabled(true) ; - GroupC1->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - - connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - if( !mySimulationTopoDs.IsNull() ) - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - - return ; -} - - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void GeometryGUI_EdgeDlg::enterEvent(QEvent* e) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; - return ; -} - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_EdgeDlg::closeEvent( QCloseEvent* e ) -{ - /* same than click on cancel button */ - this->ClickOnCancel() ; - return ; -} diff --git a/src/GEOMGUI/GeometryGUI_EdgeDlg.h b/src/GEOMGUI/GeometryGUI_EdgeDlg.h deleted file mode 100644 index facdddc5f..000000000 --- a/src/GEOMGUI/GeometryGUI_EdgeDlg.h +++ /dev/null @@ -1,118 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_EdgeDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_EDGE_H -#define DIALOGBOX_EDGE_H - -#include "SALOME_Selection.h" -#include "GEOM_ShapeTypeFilter.hxx" - -#include -#include -#include - -#include -#include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QRadioButton; -class GeometryGUI; - - -//================================================================================= -// class : GeometryGUI_EdgeDlg -// purpose : -//================================================================================= -class GeometryGUI_EdgeDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_EdgeDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 ); - ~GeometryGUI_EdgeDlg(); - -private : - - GEOM::GEOM_Gen_var myGeom ; /* Current Geom object */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - TopoDS_Shape mySimulationTopoDs; /* Shape used for simulation display */ - SALOME_Selection* mySelection ; /* User shape selection */ - gp_Pnt myPoint1 ; /* Points containing the vector */ - gp_Pnt myPoint2 ; - - bool myOkPoint1 ; /* true when myPoint is defined */ - bool myOkPoint2 ; - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - int myConstructorId ; /* Current constructor id = radio button id */ - Handle(GEOM_ShapeTypeFilter) myVertexFilter; /* Filter selection */ - - void closeEvent( QCloseEvent* e ) ; - void enterEvent( QEvent* e); - void Init( SALOME_Selection* Sel ) ; - - QButtonGroup* GroupConstructors; - QRadioButton* Constructor1; - QGroupBox* GroupC1; - QPushButton* SelectButtonC1A2; - QLineEdit* LineEditC1A1; - QLineEdit* LineEditC1A2; - QPushButton* SelectButtonC1A1; - QLabel* TextLabelC1A1; - QLabel* TextLabelC1A2; - QGroupBox* GroupButtons; - QPushButton* buttonOk; - QPushButton* buttonCancel; - QPushButton* buttonApply; - -private slots: - - void ConstructorsClicked(int constructorId); - void ClickOnOk(); - void ClickOnCancel(); - void ClickOnApply(); - void SetEditCurrentArgument() ; - void LineEditReturnPressed() ; - void SelectionIntoArgument() ; - void DeactivateActiveDialog() ; - void ActivateThisDialog() ; - -protected: - QGridLayout* GeometryGUI_EdgeDlgLayout; - QGridLayout* GroupConstructorsLayout; - QGridLayout* GroupC1Layout; - QGridLayout* GroupButtonsLayout; -}; - -#endif // DIALOGBOX_EDGE_H diff --git a/src/GEOMGUI/GeometryGUI_EllipseDlg.cxx b/src/GEOMGUI/GeometryGUI_EllipseDlg.cxx deleted file mode 100755 index c8acdaa42..000000000 --- a/src/GEOMGUI/GeometryGUI_EllipseDlg.cxx +++ /dev/null @@ -1,533 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_EllipseDlg.cxx -// Author : Nicolas REJNERI -// Module : GEOM -// $Header$ - -#include "GeometryGUI_EllipseDlg.h" - -#include "GeometryGUI.h" -#include "gp_Elips.hxx" -#include "QAD_Application.h" -#include "QAD_Desktop.h" -#include "QAD_Config.h" -#include "utilities.h" - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -//================================================================================= -// class : GeometryGUI_EllipseDlg() -// purpose : Constructs a GeometryGUI_EllipseDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_EllipseDlg::GeometryGUI_EllipseDlg( QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl ) - : QDialog( parent, name, modal, fl ) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_ELLIPSE_PV"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - - if ( !name ) - setName( "GeometryGUI_EllipseDlg" ); - resize( 303, 285 ); - setCaption( tr( "GEOM_ELLIPSE_TITLE" ) ); - - GeometryGUI_EllipseDlgLayout = new QGridLayout( this ); - GeometryGUI_EllipseDlgLayout->setSpacing( 6 ); - GeometryGUI_EllipseDlgLayout->setMargin( 11 ); - - /***************************************************************/ - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "GEOM_ELLIPSE" ) ); - GroupConstructors->setExclusive( TRUE ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setText( tr( "" ) ); - Constructor1->setPixmap( image0 ); - Constructor1->setChecked( TRUE ); - Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) ); - Constructor1->setMinimumSize( QSize( 50, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer, 0, 1 ); - GeometryGUI_EllipseDlgLayout->addWidget( GroupConstructors, 0, 0 ); - - /***************************************************************/ - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setTitle( tr( "" ) ); - GroupButtons->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, GroupButtons->sizePolicy().hasHeightForWidth() ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - buttonApply = new QPushButton( GroupButtons, "buttonApply" ); - buttonApply->setText( tr( "GEOM_BUT_APPLY" ) ); - buttonApply->setAutoDefault( TRUE ); - buttonApply->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonApply, 0, 2 ); - buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 3 ); - QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_2, 0, 1 ); - buttonOk = new QPushButton( GroupButtons, "buttonOk" ); - buttonOk->setText( tr( "GEOM_BUT_OK" ) ); - buttonOk->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - GeometryGUI_EllipseDlgLayout->addWidget( GroupButtons, 2, 0 ); - - /***************************************************************/ - GroupC1 = new QGroupBox( this, "GroupC1" ); - GroupC1->setTitle( tr( "GEOM_ARGUMENTS" ) ); - GroupC1->setMinimumSize( QSize( 0, 150 ) ); - GroupC1->setFrameShape( QGroupBox::Box ); - GroupC1->setFrameShadow( QGroupBox::Sunken ); - GroupC1->setColumnLayout(0, Qt::Vertical ); - GroupC1->layout()->setSpacing( 0 ); - GroupC1->layout()->setMargin( 0 ); - GroupC1Layout = new QGridLayout( GroupC1->layout() ); - GroupC1Layout->setAlignment( Qt::AlignTop ); - GroupC1Layout->setSpacing( 6 ); - GroupC1Layout->setMargin( 11 ); - LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" ); - GroupC1Layout->addWidget( LineEditC1A1, 0, 2 ); - LineEditC1A2 = new QLineEdit( GroupC1, "LineEditC1A2" ); - GroupC1Layout->addWidget( LineEditC1A2, 1, 2 ); - TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" ); - TextLabelC1A1->setText( tr( "GEOM_CENTER" ) ); - TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A1->setFrameShape( QLabel::NoFrame ); - TextLabelC1A1->setFrameShadow( QLabel::Plain ); - - GroupC1Layout->addWidget( TextLabelC1A1, 0, 0 ); - TextLabelC1A4 = new QLabel( GroupC1, "TextLabelC1A4" ); - TextLabelC1A4->setText( tr( "GEOM_RADIUS_MINOR" ) ); - TextLabelC1A4->setMinimumSize( QSize( 50, 0 ) ); - GroupC1Layout->addMultiCellWidget( TextLabelC1A4, 3, 3, 0, 1 ); - - TextLabelC1A3 = new QLabel( GroupC1, "TextLabelC1A3" ); - TextLabelC1A3->setText( tr( "GEOM_RADIUS_MAJOR" ) ); - TextLabelC1A3->setMinimumSize( QSize( 50, 0 ) ); - GroupC1Layout->addWidget( TextLabelC1A3, 2, 0 ); - - TextLabelC1A2 = new QLabel( GroupC1, "TextLabelC1A2" ); - TextLabelC1A2->setText( tr( "GEOM_VECTOR" ) ); - TextLabelC1A2->setMinimumSize( QSize( 50, 0 ) ); - - GroupC1Layout->addWidget( TextLabelC1A2, 1, 0 ); - SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" ); - SelectButtonC1A1->setText( tr( "" ) ); - SelectButtonC1A1->setPixmap( image1 ); - SelectButtonC1A1->setToggleButton( FALSE ); - GroupC1Layout->addWidget( SelectButtonC1A1, 0, 1 ); - SelectButtonC1A2 = new QPushButton( GroupC1, "SelectButtonC1A2" ); - SelectButtonC1A2->setText( tr( "" ) ); - SelectButtonC1A2->setPixmap( image1 ); - GroupC1Layout->addWidget( SelectButtonC1A2, 1, 1 ); - - SpinBox_C1A3 = new GeometryGUI_SpinBox( GroupC1, "GeomSpinBox_C1A3" ); - GroupC1Layout->addWidget( SpinBox_C1A3, 2, 2 ) ; - SpinBox_C1A4 = new GeometryGUI_SpinBox( GroupC1, "GeomSpinBox_C1A4" ); - GroupC1Layout->addWidget( SpinBox_C1A4, 3, 2 ); - - GeometryGUI_EllipseDlgLayout->addWidget( GroupC1, 1, 0 ); - /***************************************************************/ - - Init(Sel) ; /* Initialisations */ -} - - -//================================================================================= -// function : ~GeometryGUI_EllipseDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_EllipseDlg::~GeometryGUI_EllipseDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_EllipseDlg::Init( SALOME_Selection* Sel ) -{ - double step ; - QString St = QAD_CONFIG->getSetting( "Geometry:SettingsGeomStep" ) ; - step = St.toDouble() ; - - /* min, max, step and decimals for spin boxes */ - SpinBox_C1A3->RangeStepAndValidator( 0.00001, 999999.99999, step, 5 ) ; - SpinBox_C1A3->SetValue( 200.0 ) ; /* = myMajorRadius */ - myMajorRadius = 200.0 ; - - /* min, max, step and decimals for spin boxes */ - SpinBox_C1A4->RangeStepAndValidator( 0.00001, 999999.99999, step, 5 ) ; - SpinBox_C1A4->SetValue( 100.0 ) ; /* = myMinorRadius */ - myMinorRadius = 100.0 ; - - GroupC1->show(); - myConstructorId = 0 ; - Constructor1->setChecked( TRUE ); - myEditCurrentArgument = LineEditC1A1 ; - mySelection = Sel; - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - myOkPoint = myOkDir = false ; - mySimulationTopoDs.Nullify() ; - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - - // TODO : previous selection into argument ? - - /* Filter definitions */ - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - myEdgeFilter = new GEOM_EdgeFilter( StdSelect_Line, myGeom ); - myVertexFilter = new GEOM_ShapeTypeFilter( TopAbs_VERTEX, myGeom ); - - mySelection->AddFilter(myVertexFilter) ; /* first filter used */ - - /* signals and slots connections */ - connect( buttonOk, SIGNAL( pressed() ), this, SLOT( ClickOnOk() ) ); - connect( buttonCancel, SIGNAL( pressed() ), this, SLOT( ClickOnCancel() ) ) ; - connect( buttonApply, SIGNAL( pressed() ), this, SLOT( ClickOnApply() ) ); - connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) ); - connect( SelectButtonC1A1, SIGNAL (pressed() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( SelectButtonC1A2, SIGNAL (pressed() ), this, SLOT( SetEditCurrentArgument() ) ) ; - - connect( LineEditC1A1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - connect( LineEditC1A2, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - - connect( SpinBox_C1A3, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ; - connect( SpinBox_C1A4, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ; - - connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ; - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - /* to close dialog if study change */ - connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ; - - /* Move widget on the botton right corner of main widget */ - int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; - this->show() ; /* displays Dialog */ - - return ; -} - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_EllipseDlg::ConstructorsClicked(int constructorId) -{ - /* only a constructor now */ - return ; -} - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_EllipseDlg::ClickOnOk() -{ - this->ClickOnApply() ; - this->ClickOnCancel() ; - - return ; -} - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_EllipseDlg::ClickOnApply() -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - switch(myConstructorId) - { - case 0 : - { - if(myOkPoint && myOkDir) { - myGeomGUI->MakeEllipseAndDisplay( myPoint, myDir, myMajorRadius, myMinorRadius ) ; - } - break ; - } - } - return ; -} - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void GeometryGUI_EllipseDlg::ClickOnCancel() -{ - mySelection->ClearFilters() ; - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->ResetState() ; - reject() ; - return ; -} - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -//================================================================================= -void GeometryGUI_EllipseDlg::SelectionIntoArgument() -{ - - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - - /* Future name of selection */ - QString aString = ""; - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; - if ( nbSel != 1 ) { - if ( myEditCurrentArgument == LineEditC1A1 ) { - LineEditC1A1->setText("") ; - myOkPoint = false ; - } - else if ( myEditCurrentArgument == LineEditC1A2 ) { - LineEditC1A2->setText("") ; - myOkDir = false ; - } - return ; - } - - /* nbSel == 1 */ - TopoDS_Shape S; - if( !myGeomGUI->GetTopoFromSelection(mySelection, S) ) - return ; - - /* gp_Pnt : not used */ - if ( myEditCurrentArgument == LineEditC1A1 && myGeomGUI->VertexToPoint(S, myPoint) ) { - LineEditC1A1->setText(aString) ; - myOkPoint = true ; - } - else if ( myEditCurrentArgument == LineEditC1A2 /*&& myGeomGUI->LinearLocationAndDirection(S, notUsed, myDir) */) { - BRepAdaptor_Curve curv(TopoDS::Edge(S)); - myDir = curv.Line().Direction(); - LineEditC1A2->setText(aString) ; - myOkDir = true ; - } - - if( myOkPoint && myOkDir ) { - this->MakeEllipseSimulationAndDisplay() ; - } - return ; -} - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_EllipseDlg::SetEditCurrentArgument() -{ - mySelection->ClearFilters() ; - QPushButton* send = (QPushButton*)sender(); - switch (myConstructorId) - { - case 0: /* default constructor */ - { - if(send == SelectButtonC1A1) { - LineEditC1A1->setFocus() ; - myEditCurrentArgument = LineEditC1A1; - mySelection->AddFilter(myVertexFilter) ; - } - else if(send == SelectButtonC1A2) { - LineEditC1A2->setFocus() ; - myEditCurrentArgument = LineEditC1A2; - mySelection->AddFilter(myEdgeFilter) ; - } - SelectionIntoArgument() ; - break; - } - } - return ; -} - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_EllipseDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if( send == LineEditC1A1 ) - myEditCurrentArgument = LineEditC1A1 ; - else if ( send == LineEditC1A2 ) - myEditCurrentArgument = LineEditC1A2 ; - else - return ; - - /* User name of object input management */ - /* If successfull the selection is changed and signal emitted... */ - /* so SelectionIntoArgument() is automatically called. */ - const QString objectUserName = myEditCurrentArgument->text() ; - QWidget* thisWidget = (QWidget*)this ; - if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) { - myEditCurrentArgument->setText( objectUserName ) ; - } - return ; -} - - -//================================================================================= -// function : ValueChangedInSpinBox() -// purpose : -//================================================================================= -void GeometryGUI_EllipseDlg::ValueChangedInSpinBox( double newValue ) -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - - GeometryGUI_SpinBox* send = (GeometryGUI_SpinBox*)sender(); - if(send == SpinBox_C1A3) - myMajorRadius = newValue ; - else if(send == SpinBox_C1A4) - myMinorRadius = newValue ; - else - return ; - - if (myOkPoint && myOkDir) { - MakeEllipseSimulationAndDisplay() ; - } - - return ; -} - - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void GeometryGUI_EllipseDlg::DeactivateActiveDialog() -{ - if ( GroupConstructors->isEnabled() ) { - GroupConstructors->setEnabled(false) ; - GroupC1->setEnabled(false) ; - GroupButtons->setEnabled(false) ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->EraseSimulationShape() ; - mySelection->ClearFilters() ; - } - return ; -} - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_EllipseDlg::ActivateThisDialog() -{ - /* Emit a signal to deactivate the active dialog */ - myGeomGUI->EmitSignalDeactivateDialog() ; - GroupConstructors->setEnabled(true) ; - GroupC1->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - if( !mySimulationTopoDs.IsNull() ) - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - return ; -} - - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void GeometryGUI_EllipseDlg::enterEvent(QEvent* e) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; -} - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_EllipseDlg::closeEvent( QCloseEvent* e ) -{ - this->ClickOnCancel() ; /* same than click on cancel button */ -} - - -//================================================================================= -// function : MakeEllipseSimulationAndDisplay() -// purpose : -//================================================================================= -void GeometryGUI_EllipseDlg::MakeEllipseSimulationAndDisplay() -{ - myGeomGUI->EraseSimulationShape() ; - - if( myMajorRadius < myMinorRadius ) - return ; - - try { - const gp_Ax2 axis( this->myPoint, this->myDir ) ; - gp_Elips ellipse( axis, this->myMajorRadius, this->myMinorRadius ); - - BRepBuilderAPI_MakeEdge MakeEdge( ellipse ); - mySimulationTopoDs = MakeEdge.Shape(); - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - } - catch(Standard_Failure) { - MESSAGE( "Exception catched in MakeEllipseSimulationAndDisplay" ) ; - } - return ; -} diff --git a/src/GEOMGUI/GeometryGUI_EllipseDlg.h b/src/GEOMGUI/GeometryGUI_EllipseDlg.h deleted file mode 100755 index 521cec8c4..000000000 --- a/src/GEOMGUI/GeometryGUI_EllipseDlg.h +++ /dev/null @@ -1,133 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_EllipseDlg.h -// Author : Nicolas REJNERI -// Module : GEOM -// $Header$ - -#ifndef GEOMETRYGUI_ELLIPSE_H -#define GEOMETRYGUI_ELLIPSE_H - -#include "SALOME_Selection.h" -#include "GEOM_ShapeTypeFilter.hxx" -#include "GEOM_EdgeFilter.hxx" -#include "GeometryGUI_SpinBox.h" - -#include -#include -#include - -#include -#include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QRadioButton; -class QSpinBox; -class GeometryGUI; - - -//================================================================================= -// class : GeometryGUI_EllipseDlg -// purpose : -//================================================================================= -class GeometryGUI_EllipseDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_EllipseDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 ); - ~GeometryGUI_EllipseDlg(); - -private : - - void closeEvent( QCloseEvent* e ) ; - void enterEvent( QEvent* e ); - void Init(SALOME_Selection* Sel) ; - void MakeEllipseSimulationAndDisplay() ; - - GEOM::GEOM_Gen_var myGeom ; /* Current GeomI object */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - TopoDS_Shape mySimulationTopoDs ; /* Shape used for simulation display */ - SALOME_Selection* mySelection ; /* User shape selection */ - - gp_Pnt myPoint ; /* Central point of ellipse */ - bool myOkPoint ; /* true when myPoint is defined */ - - gp_Dir myDir ; /* to set normal axis of ellipse */ - bool myOkDir ; /* true when myPoint is defined */ - - Standard_Real myMajorRadius ; - Standard_Real myMinorRadius ; - - int myConstructorId ; /* Current constructor id = radio button id */ - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - - Handle(GEOM_ShapeTypeFilter) myVertexFilter; /* filter for selection */ - Handle(GEOM_EdgeFilter) myEdgeFilter; /* filter for selection */ - - QButtonGroup* GroupConstructors; - QRadioButton* Constructor1; - QGroupBox* GroupButtons; - QPushButton* buttonApply; - QPushButton* buttonCancel; - QPushButton* buttonOk; - QGroupBox* GroupC1; - QLineEdit* LineEditC1A1; - QLineEdit* LineEditC1A2; - QLabel* TextLabelC1A1; - QLabel* TextLabelC1A4; - QLabel* TextLabelC1A3; - QLabel* TextLabelC1A2; - QPushButton* SelectButtonC1A1; - QPushButton* SelectButtonC1A2; - GeometryGUI_SpinBox* SpinBox_C1A3; - GeometryGUI_SpinBox* SpinBox_C1A4; - -private slots: - - void ConstructorsClicked(int constructorId); - void ClickOnOk(); - void ClickOnCancel(); - void ClickOnApply(); - void SetEditCurrentArgument() ; - void SelectionIntoArgument() ; - void LineEditReturnPressed() ; - void DeactivateActiveDialog() ; - void ActivateThisDialog() ; - void ValueChangedInSpinBox(double newValue) ; - -protected: - QGridLayout* GeometryGUI_EllipseDlgLayout; - QGridLayout* GroupConstructorsLayout; - QGridLayout* GroupButtonsLayout; - QGridLayout* GroupC1Layout; -}; - -#endif // GEOMETRYGUI_ELLIPSE_H diff --git a/src/GEOMGUI/GeometryGUI_FaceDlg.cxx b/src/GEOMGUI/GeometryGUI_FaceDlg.cxx deleted file mode 100644 index 499d5002a..000000000 --- a/src/GEOMGUI/GeometryGUI_FaceDlg.cxx +++ /dev/null @@ -1,420 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_FaceDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_FaceDlg.h" -#include "GeometryGUI.h" - -#include "QAD_Application.h" -#include "QAD_Desktop.h" -#include "utilities.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - - -//================================================================================= -// class : GeometryGUI_FaceDlg() -// purpose : Constructs a GeometryGUI_FaceDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_FaceDlg::GeometryGUI_FaceDlg( QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_BUILD_FACE"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - - if ( !name ) - setName( "GeometryGUI_FaceDlg" ); - resize( 303, 208 ); - setCaption( tr( "GEOM_FACE_TITLE" ) ); - setSizeGripEnabled( TRUE ); - GeometryGUI_FaceDlgLayout = new QGridLayout( this ); - GeometryGUI_FaceDlgLayout->setSpacing( 6 ); - GeometryGUI_FaceDlgLayout->setMargin( 11 ); - - /***************************************************************/ - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "GEOM_FACE" ) ); - GroupConstructors->setExclusive( TRUE ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setText( tr( "" ) ); - Constructor1->setPixmap( image0 ); - Constructor1->setChecked( TRUE ); - Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) ); - Constructor1->setMinimumSize( QSize( 50, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer, 0, 1 ); - GeometryGUI_FaceDlgLayout->addWidget( GroupConstructors, 0, 0 ); - - /***************************************************************/ - GroupC1 = new QGroupBox( this, "GroupC1" ); - GroupC1->setTitle( tr( "GEOM_FACE_FFW" ) ); - GroupC1->setMinimumSize( QSize( 0, 0 ) ); - GroupC1->setFrameShape( QGroupBox::Box ); - GroupC1->setFrameShadow( QGroupBox::Sunken ); - GroupC1->setColumnLayout(0, Qt::Vertical ); - GroupC1->layout()->setSpacing( 0 ); - GroupC1->layout()->setMargin( 0 ); - GroupC1Layout = new QGridLayout( GroupC1->layout() ); - GroupC1Layout->setAlignment( Qt::AlignTop ); - GroupC1Layout->setSpacing( 6 ); - GroupC1Layout->setMargin( 11 ); - TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" ); - TextLabelC1A1->setText( tr( "GEOM_WIRE" ) ); - TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A1->setFrameShape( QLabel::NoFrame ); - TextLabelC1A1->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabelC1A1, 0, 0 ); - SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" ); - SelectButtonC1A1->setText( tr( "" ) ); - SelectButtonC1A1->setPixmap( image1 ); - SelectButtonC1A1->setToggleButton( FALSE ); - GroupC1Layout->addWidget( SelectButtonC1A1, 0, 1 ); - LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" ); - GroupC1Layout->addWidget( LineEditC1A1, 0, 2 ); - CheckBox1 = new QCheckBox( GroupC1, "CheckBox1" ); - CheckBox1->setText( tr( "GEOM_FACE_OPT" ) ); - CheckBox1->setChecked( TRUE ); - GroupC1Layout->addWidget( CheckBox1, 1, 2); - GeometryGUI_FaceDlgLayout->addWidget( GroupC1, 1, 0 ); - - /***************************************************************/ - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); - GroupButtons->setTitle( tr( "" ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 3 ); - buttonApply = new QPushButton( GroupButtons, "buttonApply" ); - buttonApply->setText( tr( "GEOM_BUT_APPLY" ) ); - buttonApply->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonApply, 0, 1 ); - QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_9, 0, 2 ); - buttonOk = new QPushButton( GroupButtons, "buttonOk" ); - buttonOk->setText( tr( "GEOM_BUT_OK" ) ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - GeometryGUI_FaceDlgLayout->addWidget( GroupButtons, 2, 0 ); - - Init(Sel) ; /* Initialisations */ -} - - -//================================================================================= -// function : ~GeometryGUI_FaceDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_FaceDlg::~GeometryGUI_FaceDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_FaceDlg::Init( SALOME_Selection* Sel ) -{ - - GroupC1->show(); - myConstructorId = 0 ; - Constructor1->setChecked( TRUE ); - CheckBox1->setChecked( TRUE ); - - myEditCurrentArgument = LineEditC1A1 ; - mySelection = Sel; - this->myOkShape = false ; - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - - // TODO previous selection into argument ? - - /* Filter definitions */ - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - myWireFilter = new GEOM_ShapeTypeFilter( TopAbs_WIRE, myGeom ); - mySelection->AddFilter(myWireFilter) ; /* first filter used */ - - /* signals and slots connections */ - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ; - connect( buttonApply, SIGNAL( clicked() ), this, SLOT(ClickOnApply() ) ); - connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) ); - - connect( LineEditC1A1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - - connect( SelectButtonC1A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ; - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - /* to close dialog if study change */ - connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ; - - /* Move widget on the botton right corner of main widget */ - int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; - this->show() ; /* displays Dialog */ - - return ; -} - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_FaceDlg::ConstructorsClicked(int constructorId) -{ - return ; -} - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_FaceDlg::ClickOnOk() -{ - this->ClickOnApply() ; - this->ClickOnCancel() ; - - return ; -} - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_FaceDlg::ClickOnApply() -{ - myGeomGUI->GetDesktop()->putInfo( tr("") ) ; - switch(myConstructorId) - { - case 0 : - { - if(myOkShape) { - myGeomGUI->MakeFaceAndDisplay(this->myGeomShape, this->CheckBox1->isChecked() ) ; - } - break ; - } - } - // accept(); - return ; -} - - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void GeometryGUI_FaceDlg::ClickOnCancel() -{ - mySelection->ClearFilters() ; - myGeomGUI->ResetState() ; - disconnect( mySelection, 0, this, 0 ); - reject() ; - return ; -} - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -//================================================================================= -void GeometryGUI_FaceDlg::SelectionIntoArgument() -{ - /* All this for first constructor */ - // if(myEditCurrentArgument == LineEditC1A1 ) - - myOkShape = false; - myEditCurrentArgument->setText("") ; - QString aString = ""; /* future the name of selection */ - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; - if ( nbSel != 1 ) - return ; - - // nbSel == 1 ! - Standard_Boolean testResult ; - Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject() ; - if( !myGeomGUI->GetTopoFromSelection(this->mySelection, this->myShape) ) - return ; - - myGeomShape = myGeomGUI->ConvertIOinGEOMShape(IO, testResult) ; - if( !testResult ) - return ; - - myEditCurrentArgument->setText(aString) ; - this->myOkShape = true ; - - /* no simulation */ - return ; -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_FaceDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - mySelection->ClearFilters() ; - - switch (myConstructorId) - { - case 0: /* default constructor */ - { - if(send == SelectButtonC1A1) { - LineEditC1A1->setFocus() ; - myEditCurrentArgument = LineEditC1A1; - mySelection->AddFilter(myWireFilter) ; - } - SelectionIntoArgument() ; - break; - } - } - return ; -} - - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_FaceDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if( send == LineEditC1A1 ) - myEditCurrentArgument = LineEditC1A1 ; - else - return ; - - /* User name of object input management */ - /* If successfull the selection is changed and signal emitted... */ - /* so SelectionIntoArgument() is automatically called. */ - const QString objectUserName = myEditCurrentArgument->text() ; - QWidget* thisWidget = (QWidget*)this ; - if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) { - myEditCurrentArgument->setText( objectUserName ) ; - } - return ; -} - - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void GeometryGUI_FaceDlg::DeactivateActiveDialog() -{ - if ( GroupConstructors->isEnabled() ) { - disconnect( mySelection, 0, this, 0 ); - mySelection->ClearFilters() ; - GroupConstructors->setEnabled(false) ; - GroupC1->setEnabled(false) ; - GroupButtons->setEnabled(false) ; - } - return ; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_FaceDlg::ActivateThisDialog() -{ - /* Emit a signal to deactivate the active dialog */ - myGeomGUI->EmitSignalDeactivateDialog() ; - GroupConstructors->setEnabled(true) ; - GroupC1->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - return ; -} - - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void GeometryGUI_FaceDlg::enterEvent(QEvent* e) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; - return ; -} - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_FaceDlg::closeEvent( QCloseEvent* e ) -{ - /* same than click on cancel button */ - this->ClickOnCancel() ; - return ; -} diff --git a/src/GEOMGUI/GeometryGUI_FaceDlg.h b/src/GEOMGUI/GeometryGUI_FaceDlg.h deleted file mode 100644 index 2b33a5161..000000000 --- a/src/GEOMGUI/GeometryGUI_FaceDlg.h +++ /dev/null @@ -1,113 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_FaceDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_FACE_H -#define DIALOGBOX_FACE_H - - -#include "SALOME_Selection.h" -#include "GEOM_ShapeTypeFilter.hxx" - -#include -#include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QCheckBox; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QRadioButton; -class GeometryGUI; - - -//================================================================================= -// class : GeometryGUI_FaceDlg -// purpose : -//================================================================================= -class GeometryGUI_FaceDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_FaceDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 ); - ~GeometryGUI_FaceDlg(); - -private: - - void Init( SALOME_Selection* Sel ) ; - void closeEvent( QCloseEvent* e ) ; - void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */ - - GEOM::GEOM_Gen_var myGeom ; /* Current GeomI object */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - SALOME_Selection* mySelection ; /* User shape selection */ - - TopoDS_Shape myShape ; /* topology used to fuse */ - GEOM::GEOM_Shape_var myGeomShape ; /* is myShape */ - bool myOkShape ; /* to check when arguments is defined */ - - int myConstructorId ; /* Current constructor id = radio button id */ - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - Handle(GEOM_ShapeTypeFilter) myWireFilter; /* Filter selection */ - - QButtonGroup* GroupConstructors; - QRadioButton* Constructor1; - QGroupBox* GroupC1; - QLabel* TextLabelC1A1; - QPushButton* SelectButtonC1A1; - QLineEdit* LineEditC1A1; - QCheckBox* CheckBox1; - QGroupBox* GroupButtons; - QPushButton* buttonOk; - QPushButton* buttonCancel; - QPushButton* buttonApply; - -private slots: - - void ConstructorsClicked(int constructorId); - void ClickOnOk(); - void ClickOnCancel(); - void ClickOnApply(); - void SetEditCurrentArgument() ; - void SelectionIntoArgument() ; - void LineEditReturnPressed() ; - void DeactivateActiveDialog() ; - void ActivateThisDialog() ; - -protected: - QGridLayout* GeometryGUI_FaceDlgLayout; - QGridLayout* GroupConstructorsLayout; - QGridLayout* GroupC1Layout; - QGridLayout* GroupButtonsLayout; -}; - -#endif // DIALOGBOX_FACE_H diff --git a/src/GEOMGUI/GeometryGUI_FilletDlg.cxx b/src/GEOMGUI/GeometryGUI_FilletDlg.cxx deleted file mode 100644 index f15159b06..000000000 --- a/src/GEOMGUI/GeometryGUI_FilletDlg.cxx +++ /dev/null @@ -1,842 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_FilletDlg.cxx -// Author : Damien COQUERET -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_FilletDlg.h" - -#include "GeometryGUI.h" -#include "QAD_Application.h" -#include "QAD_Desktop.h" -#include "QAD_Config.h" -#include "utilities.h" -#include "QAD_RightFrame.h" -#include "OCCViewer_Viewer3d.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include - - -//================================================================================= -// class : GeometryGUI_FilletDlg() -// purpose : Constructs a GeometryGUI_FilletDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_FilletDlg::GeometryGUI_FilletDlg( QWidget* parent, - const char* name, - SALOME_Selection* Sel, - Handle (AIS_InteractiveContext) ic, - bool modal, - WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - /***************************************************************/ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_FILLET_ALL"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_FILLET_EDGE"))); - QPixmap image3(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_FILLET_FACE"))); - - if ( !name ) - setName( "GeometryGUI_FilletDlg" ); - resize( 365, 220 ); - setCaption( tr( "GEOM_FILLET_TITLE" ) ); - setSizeGripEnabled( TRUE ); - GeometryGUI_FilletDlgLayout = new QGridLayout( this ); - GeometryGUI_FilletDlgLayout->setSpacing( 6 ); - GeometryGUI_FilletDlgLayout->setMargin( 11 ); - - /***************************************************************/ - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); - GroupButtons->setTitle( tr( "" ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 3 ); - buttonApply = new QPushButton( GroupButtons, "buttonApply" ); - buttonApply->setText( tr( "GEOM_BUT_APPLY" ) ); - buttonApply->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonApply, 0, 1 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer, 0, 2 ); - buttonOk = new QPushButton( GroupButtons, "buttonOk" ); - buttonOk->setText( tr( "GEOM_BUT_OK" ) ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - GeometryGUI_FilletDlgLayout->addWidget( GroupButtons, 2, 0 ); - - /***************************************************************/ - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "GEOM_FILLET" ) ); - GroupConstructors->setExclusive( TRUE ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setText( tr( "" ) ); - Constructor1->setPixmap( image0 ); - Constructor1->setChecked( TRUE ); - Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) ); - Constructor1->setMinimumSize( QSize( 50, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - Constructor2 = new QRadioButton( GroupConstructors, "Constructor2" ); - Constructor2->setText( tr( "" ) ); - Constructor2->setPixmap( image2 ); - Constructor2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor2->sizePolicy().hasHeightForWidth() ) ); - Constructor2->setMinimumSize( QSize( 50, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor2, 0, 2 ); - QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer_2, 0, 3 ); - QSpacerItem* spacer_3 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer_3, 0, 1 ); - Constructor3 = new QRadioButton( GroupConstructors, "Constructor3" ); - Constructor3->setText( tr( "" ) ); - Constructor3->setPixmap( image3 ); - Constructor3->setMinimumSize( QSize( 50, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor3, 0, 4 ); - QSpacerItem* spacer_4 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer_4, 0, 5 ); - GeometryGUI_FilletDlgLayout->addWidget( GroupConstructors, 0, 0 ); - - /***************************************************************/ - GroupC1 = new QGroupBox( this, "GroupC1" ); - GroupC1->setTitle( tr( "GEOM_FILLET_ALL" ) ); - GroupC1->setMinimumSize( QSize( 0, 0 ) ); - GroupC1->setFrameShape( QGroupBox::Box ); - GroupC1->setFrameShadow( QGroupBox::Sunken ); - GroupC1->setColumnLayout(0, Qt::Vertical ); - GroupC1->layout()->setSpacing( 0 ); - GroupC1->layout()->setMargin( 0 ); - GroupC1Layout = new QGridLayout( GroupC1->layout() ); - GroupC1Layout->setAlignment( Qt::AlignTop ); - GroupC1Layout->setSpacing( 6 ); - GroupC1Layout->setMargin( 11 ); - - TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" ); - TextLabelC1A1->setText( tr( "GEOM_MAIN_OBJECT" ) ); - TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A1->setFrameShape( QLabel::NoFrame ); - TextLabelC1A1->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabelC1A1, 0, 0 ); - - TextLabelC1A2 = new QLabel( GroupC1, "TextLabelC1A2" ); - TextLabelC1A2->setText( tr( "GEOM_RADIUS" ) ); - TextLabelC1A2->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A2->setFrameShape( QLabel::NoFrame ); - TextLabelC1A2->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabelC1A2, 1, 0 ); - - LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" ); - GroupC1Layout->addWidget( LineEditC1A1, 0, 2 ); - - SpinBox_C1A2 = new GeometryGUI_SpinBox( GroupC1, "GeomSpinBox_C1A2" ) ; - SpinBox_C1A2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, SpinBox_C1A2->sizePolicy().hasHeightForWidth() ) ); - GroupC1Layout->addWidget( SpinBox_C1A2, 1, 2 ); - - SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" ); - SelectButtonC1A1->setText( tr( "" ) ); - SelectButtonC1A1->setPixmap( image1 ); - SelectButtonC1A1->setToggleButton( FALSE ); - SelectButtonC1A1->setMaximumSize( QSize( 28, 32767 ) ); - GroupC1Layout->addWidget( SelectButtonC1A1, 0, 1 ); - GeometryGUI_FilletDlgLayout->addWidget( GroupC1, 1, 0 ); - - /***************************************************************/ - GroupC2 = new QGroupBox( this, "GroupC2" ); - GroupC2->setTitle( tr( "GEOM_FILLET_EDGES" ) ); - GroupC2->setMinimumSize( QSize( 0, 0 ) ); - GroupC2->setFrameShape( QGroupBox::Box ); - GroupC2->setFrameShadow( QGroupBox::Sunken ); - GroupC2->setColumnLayout(0, Qt::Vertical ); - GroupC2->layout()->setSpacing( 0 ); - GroupC2->layout()->setMargin( 0 ); - GroupC2Layout = new QGridLayout( GroupC2->layout() ); - GroupC2Layout->setAlignment( Qt::AlignTop ); - GroupC2Layout->setSpacing( 6 ); - GroupC2Layout->setMargin( 11 ); - - TextLabelC2A1 = new QLabel( GroupC2, "TextLabelC2A1" ); - TextLabelC2A1->setText( tr( "GEOM_MAIN_OBJECT" ) ); - TextLabelC2A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC2A1->setFrameShape( QLabel::NoFrame ); - TextLabelC2A1->setFrameShadow( QLabel::Plain ); - GroupC2Layout->addWidget( TextLabelC2A1, 0, 0 ); - - TextLabelC2A2 = new QLabel( GroupC2, "TextLabelC2A2" ); - TextLabelC2A2->setText( tr( "GEOM_RADIUS" ) ); - TextLabelC2A2->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC2A2->setFrameShape( QLabel::NoFrame ); - TextLabelC2A2->setFrameShadow( QLabel::Plain ); - GroupC2Layout->addWidget( TextLabelC2A2, 1, 0 ); - - LineEditC2A1 = new QLineEdit( GroupC2, "LineEditC2A1" ); - GroupC2Layout->addWidget( LineEditC2A1, 0, 2 ); - - SpinBox_C2A2 = new GeometryGUI_SpinBox( GroupC2, "GeomSpinBox_C2A2" ) ; - SpinBox_C2A2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, SpinBox_C2A2->sizePolicy().hasHeightForWidth() ) ); - GroupC2Layout->addWidget( SpinBox_C2A2, 1, 2 ); - - SelectButtonC2A1 = new QPushButton( GroupC2, "SelectButtonC2A1" ); - SelectButtonC2A1->setText( tr( "" ) ); - SelectButtonC2A1->setPixmap( image1 ); - SelectButtonC2A1->setToggleButton( FALSE ); - SelectButtonC2A1->setMaximumSize( QSize( 28, 32767 ) ); - GroupC2Layout->addWidget( SelectButtonC2A1, 0, 1 ); - GeometryGUI_FilletDlgLayout->addWidget( GroupC2, 1, 0 ); - - /***************************************************************/ - GroupC3 = new QGroupBox( this, "GroupC3" ); - GroupC3->setTitle( tr( "GEOM_FILLET_FACES" ) ); - GroupC3->setMinimumSize( QSize( 0, 0 ) ); - GroupC3->setFrameShape( QGroupBox::Box ); - GroupC3->setFrameShadow( QGroupBox::Sunken ); - GroupC3->setColumnLayout(0, Qt::Vertical ); - GroupC3->layout()->setSpacing( 0 ); - GroupC3->layout()->setMargin( 0 ); - GroupC3Layout = new QGridLayout( GroupC3->layout() ); - GroupC3Layout->setAlignment( Qt::AlignTop ); - GroupC3Layout->setSpacing( 6 ); - GroupC3Layout->setMargin( 11 ); - - TextLabelC3A1 = new QLabel( GroupC3, "TextLabelC3A1" ); - TextLabelC3A1->setText( tr( "GEOM_MAIN_OBJECT" ) ); - TextLabelC3A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC3A1->setFrameShape( QLabel::NoFrame ); - TextLabelC3A1->setFrameShadow( QLabel::Plain ); - GroupC3Layout->addWidget( TextLabelC3A1, 0, 0 ); - - TextLabelC3A2 = new QLabel( GroupC3, "TextLabelC3A2" ); - TextLabelC3A2->setText( tr( "GEOM_RADIUS" ) ); - TextLabelC3A2->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC3A2->setFrameShape( QLabel::NoFrame ); - TextLabelC3A2->setFrameShadow( QLabel::Plain ); - GroupC3Layout->addWidget( TextLabelC3A2, 1, 0 ); - - LineEditC3A1 = new QLineEdit( GroupC3, "LineEditC3A1" ); - GroupC3Layout->addWidget( LineEditC3A1, 0, 2 ); - - SpinBox_C3A2 = new GeometryGUI_SpinBox( GroupC3, "GeomSpinBox_C3A2" ) ; - SpinBox_C3A2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, SpinBox_C3A2->sizePolicy().hasHeightForWidth() ) ); - GroupC3Layout->addWidget( SpinBox_C3A2, 1, 2 ); - - SelectButtonC3A1 = new QPushButton( GroupC3, "SelectButtonC3A1" ); - SelectButtonC3A1->setText( tr( "" ) ); - SelectButtonC3A1->setPixmap( image1 ); - SelectButtonC3A1->setToggleButton( FALSE ); - SelectButtonC3A1->setMaximumSize( QSize( 28, 32767 ) ); - GroupC3Layout->addWidget( SelectButtonC3A1, 0, 1 ); - GeometryGUI_FilletDlgLayout->addWidget( GroupC3, 1, 0 ); - - /* Initialisation */ - Init( Sel, ic ) ; -} - - -//================================================================================= -// function : ~GeometryGUI_FilletDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_FilletDlg::~GeometryGUI_FilletDlg() -{ - /* no need to delete child widgets, Qt does it all for us */ - this->destroy(TRUE, TRUE) ; -} - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_FilletDlg::Init( SALOME_Selection* Sel, Handle (AIS_InteractiveContext) ic ) -{ - - /* Get setting of step value from file configuration */ - double step ; - QString St = QAD_CONFIG->getSetting( "Geometry:SettingsGeomStep" ) ; - step = St.toDouble() ; - - /* min, max, step and decimals for spin boxes */ - SpinBox_C1A2->RangeStepAndValidator( 0.001, 999.999, step, 3 ) ; - SpinBox_C1A2->SetValue( 50 ) ; - SpinBox_C2A2->RangeStepAndValidator( 0.001, 999.999, step, 3 ) ; - SpinBox_C2A2->SetValue( 50 ) ; - SpinBox_C3A2->RangeStepAndValidator( 0.001, 999.999, step, 3 ) ; - SpinBox_C3A2->SetValue( 50 ) ; - - GroupC1->show(); - GroupC2->hide() ; - GroupC3->hide() ; - myConstructorId = 0 ; - Constructor1->setChecked( TRUE ); - - mySelection = Sel ; - myEditCurrentArgument = LineEditC1A1 ; - myShape.Nullify() ; - myRadius = 50.0 ; - myOkRadius = true ; - myIC = ic ; - myLocalContextId = -1 ; - myUseLocalContext = false ; - myOkShape = false ; - - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - - mySimulationTopoDs.Nullify() ; - - /* Filters definition */ - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - - /* signals and slots connections */ - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); - connect( buttonApply, SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ; - connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) ); - connect( SelectButtonC1A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( SelectButtonC2A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( SelectButtonC3A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - - connect( SpinBox_C1A2, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ; - connect( SpinBox_C2A2, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ; - connect( SpinBox_C3A2, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ; - - connect( LineEditC1A1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - connect( LineEditC2A1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - connect( LineEditC3A1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ; - /* to close dialog if study change */ - connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ; - - /* Move widget on the botton right corner of main widget */ - int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; - this->show() ; /* Displays Dialog */ - - return ; -} - - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_FilletDlg::ConstructorsClicked(int constructorId) -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - - myEditCurrentArgument->setText(tr("")) ; - - if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) { - OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer(); - myIC = v3d->getAISContext(); // myIC = myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getViewerOCC()->getAISContext(); - if(this->myUseLocalContext) { - myIC->CloseLocalContext(this->myLocalContextId) ; - myGeomGUI->OnDisplayAll(true) ; - this->myUseLocalContext = false ; - } - } - - myOkShape = false ; - myRadius = 50.0 ; - myOkRadius = true ; - myConstructorId = constructorId ; - - // connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - - switch (constructorId) - { - case 0: /* Fillet All */ - { - myShapeType = -1; - GroupC1->show(); - GroupC2->hide() ; - GroupC3->hide() ; - myEditCurrentArgument = LineEditC1A1 ; - SpinBox_C1A2->SetValue( 50 ) ;; - LineEditC1A1->setText(tr("")) ; - break; - } - - case 1: /* Fillet edges */ - { - myShapeType = 6; - GroupC1->hide(); - GroupC2->show() ; - GroupC3->hide() ; - myEditCurrentArgument = LineEditC2A1 ; - SpinBox_C2A2->SetValue( 50 ) ;; - LineEditC2A1->setText(tr("")) ; - break ; - } - - case 2: /* Fillet Faces */ - { - myShapeType = 4; - GroupC1->hide(); - GroupC2->hide() ; - GroupC3->show() ; - myEditCurrentArgument = LineEditC3A1 ; - SpinBox_C3A2->SetValue( 50 ) ;; - LineEditC3A1->setText(tr("")) ; - break ; - } - } - return ; -} - - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_FilletDlg::ClickOnApply() -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - - bool testResult = false ; - myGeomGUI->GetDesktop()->putInfo( tr("") ) ; - switch(myConstructorId) - { - case 0 : /* Fillet All */ - { - if(myOkRadius) { - if( myOkShape ) { - testResult = myGeomGUI->OnFilletGetAll( myShape, myRadius, myShapeType, myShapeIOR ) ; - } - } - if( !testResult ) { - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT")) ; - } else { - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE")) ; - } - /* Reset all arguments and local context to allow user a new selection ...*/ - this->ResetStateOfDialog() ; - break ; - } - - case 1 : /* Fillet Edge */ - { - if(myOkRadius) { - if( myOkShape ) { - testResult = myGeomGUI->OnFilletGetSelected( myShape, myShapeIOR, myRadius, myShapeType, myLocalContextId, myUseLocalContext ); - } - } - if( !testResult ) { - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT")) ; - } else { - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE")) ; - } - /* Reset all arguments and local context to allow user a new selection ...*/ - this->ResetStateOfDialog() ; - break ; - } - - case 2 : /* Fillet Face */ - { - if(myOkRadius) { - if( myOkShape ) { - testResult = myGeomGUI->OnFilletGetSelected( myShape, myShapeIOR, myRadius, myShapeType, myLocalContextId, myUseLocalContext ) ; - } - } - if( !testResult ) { - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT")) ; - } else { - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE")) ; - } - /* Reset all arguments and local context to allow user a new selection ...*/ - this->ResetStateOfDialog() ; - break ; - } - } - - // accept(); - return ; -} - - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void GeometryGUI_FilletDlg::ClickOnCancel() -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->ResetState() ; - if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) { - OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer(); - myIC = v3d->getAISContext(); // myIC = myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getViewerOCC()->getAISContext(); - if(this->myUseLocalContext) { - myIC->CloseLocalContext(this->myLocalContextId) ; - this->myUseLocalContext = false ; - myGeomGUI->OnDisplayAll(true) ; - } - } - reject() ; - return ; -} - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_FilletDlg::ClickOnOk() -{ - this->ClickOnApply() ; - this->ClickOnCancel() ; - return ; -} - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_FilletDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if( send == LineEditC1A1 ) - myEditCurrentArgument = LineEditC1A1 ; - else if ( send == LineEditC2A1 ) - myEditCurrentArgument = LineEditC2A1 ; - else if ( send == LineEditC3A1 ) - myEditCurrentArgument = LineEditC3A1 ; - else - return ; - - /* User name of object input management */ - /* If successfull the selection is changed and signal emitted... */ - /* so SelectionIntoArgument() is automatically called. */ - const QString objectUserName = myEditCurrentArgument->text() ; - QWidget* thisWidget = (QWidget*)this ; - if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) { - myEditCurrentArgument->setText( objectUserName ) ; - } - return ; -} - - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection has changed -//================================================================================= -void GeometryGUI_FilletDlg::SelectionIntoArgument() -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - - /* Reset all arguments and local context when selection as changed */ - this->ResetStateOfDialog() ; - - /* Future name of argument */ - QString aString = ""; - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; - if ( nbSel == 1 ) { - - TopoDS_Shape S ; - Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject() ; - - if( !myGeomGUI->GetTopoFromSelection(mySelection, S) ) - return ; - - if( !IO->hasEntry() ) { - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY")) ; - return ; - } - - if ( !S.IsNull() && S.ShapeType() <= 2 ) { - if ( IO->IsInstance(STANDARD_TYPE(GEOM_InteractiveObject)) ) { - Handle(GEOM_InteractiveObject) GIObject = Handle(GEOM_InteractiveObject)::DownCast( IO ); - myShapeIOR = GIObject->getIOR(); /* the Geom IOR string of selection */ - myEditCurrentArgument->setText(aString) ; - myShape = S ; - myOkShape = true ; - } - - if ( IO->hasEntry() ) { - SALOMEDS::Study_var aStudy = myGeomGUI->GetActiveStudy()->getStudyDocument(); - SALOMEDS::SObject_var obj = aStudy->FindObjectID( IO->getEntry() ); - SALOMEDS::GenericAttribute_var anAttr; - SALOMEDS::AttributeIOR_var anIOR; - if ( !obj->_is_nil() ) { - if (obj->FindAttribute(anAttr, "AttributeIOR")) { - anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr); - myShapeIOR = anIOR->Value(); - myOkShape = true ; - myShape = S ; - myEditCurrentArgument->setText(aString) ; - } - } - } - } - - MakePreview(); - - } else - return; - - if( myOkShape && myShapeType!=-1 && myConstructorId != 0 ) { - /* local context is defined into the method */ - myGeomGUI->PrepareSubShapeSelection( this->myShapeType, this->myLocalContextId ) ; - myUseLocalContext = true ; - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SELECT_EDGE")) ; - } -} - - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_FilletDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - - switch (myConstructorId) - { - case 0: - { - if(send == SelectButtonC1A1) { - LineEditC1A1->setFocus() ; - myEditCurrentArgument = LineEditC1A1; - SelectionIntoArgument() ; - } - break; - } - - case 1: - { - if(send ==SelectButtonC2A1 ) { - LineEditC2A1->setFocus() ; - myEditCurrentArgument = LineEditC2A1; - SelectionIntoArgument() ; - } - break; - } - - case 2: - { - if(send ==SelectButtonC3A1 ) { - LineEditC3A1->setFocus() ; - myEditCurrentArgument = LineEditC3A1; - SelectionIntoArgument() ; - } - break; - } - } - return ; -} - -//================================================================================= -// function : ValueChangedInSpinBox() -// purpose : -//================================================================================= -void GeometryGUI_FilletDlg::ValueChangedInSpinBox( double newValue ) -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - - myRadius = newValue ; - myOkRadius = true ; - - MakePreview(); -} - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void GeometryGUI_FilletDlg::DeactivateActiveDialog() -{ - if ( GroupConstructors->isEnabled() ) { - this->ResetStateOfDialog() ; - GroupConstructors->setEnabled(false) ; - GroupC1->setEnabled(false) ; - GroupC2->setEnabled(false) ; - GroupC3->setEnabled(false) ; - GroupButtons->setEnabled(false) ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->ResetState() ; - myGeomGUI->SetActiveDialogBox(0) ; - myGeomGUI->OnDisplayAll(true) ; - } - return ; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_FilletDlg::ActivateThisDialog() -{ - /* Emit a signal to deactivate the active dialog */ - myGeomGUI->EmitSignalDeactivateDialog() ; - - GroupConstructors->setEnabled(true) ; - GroupC1->setEnabled(true) ; - GroupC2->setEnabled(true) ; - GroupC3->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - - if( !mySimulationTopoDs.IsNull() ) - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - return ; -} - - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void GeometryGUI_FilletDlg::enterEvent( QEvent* e) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; - return ; -} - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_FilletDlg::closeEvent( QCloseEvent* e ) -{ - /* same than click on cancel button */ - this->ClickOnCancel() ; - return ; -} - - -//================================================================================= -// function : ResetStateOfDialog() -// purpose : -//================================================================================= -void GeometryGUI_FilletDlg::ResetStateOfDialog() -{ - this->myOkShape = false ; - this->myEditCurrentArgument->setText("") ; - - /* Close its local contact if opened */ - if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) { - OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer(); - myIC = v3d->getAISContext(); // myIC = myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getViewerOCC()->getAISContext(); - if(this->myUseLocalContext) { - myIC->CloseLocalContext(this->myLocalContextId) ; - this->myUseLocalContext = false ; - myGeomGUI->OnDisplayAll(true) ; - } - } - return ; -} - - -void GeometryGUI_FilletDlg::MakePreview() -{ - TopoDS_Shape tds ; - try - { - BRepFilletAPI_MakeFillet fill(myShape); - switch (myConstructorId) - { - case 0: /* Fillet All */ - { - TopExp_Explorer Exp ( myShape, TopAbs_EDGE ); - for (Exp; Exp.More(); Exp.Next()) - { - TopoDS_Edge E =TopoDS::Edge(Exp.Current()); - fill.Add(E); - } - for (int i = 1;i<=fill.NbContours();i++) - fill.SetRadius(myRadius,i); - - tds = fill.Shape(); - break; - } -// case 1: /* Fillet edges */ -// case 2: /* Fillet Faces */ - } - if (!tds.IsNull()) - { - mySimulationTopoDs = tds; - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - } - } - catch(Standard_Failure) - { - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - } -} diff --git a/src/GEOMGUI/GeometryGUI_FilletDlg.h b/src/GEOMGUI/GeometryGUI_FilletDlg.h deleted file mode 100644 index 775bcc9f6..000000000 --- a/src/GEOMGUI/GeometryGUI_FilletDlg.h +++ /dev/null @@ -1,163 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_FilletDlg.h -// Author : Damien COQUERET -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_FILLET_H -#define DIALOGBOX_FILLET_H - -#include "SALOME_Selection.h" -#include "GEOM_ShapeTypeFilter.hxx" -#include "GeometryGUI_SpinBox.h" - -// Qt Includes -#include -#include -#include - -// Open CASCADE Includes -#include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QFrame; -class QGroupBox; -class QLineEdit; -class QPushButton; -class QRadioButton; -class QToolButton; -class QLabel; -class GeometryGUI; - -//================================================================================= -// class : GeometryGUI_FilletDlg -// purpose : -//================================================================================= -class GeometryGUI_FilletDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_FilletDlg( QWidget* parent = 0, - const char* name = 0, - SALOME_Selection* Sel = 0, - Handle (AIS_InteractiveContext) ic = 0, - bool modal = FALSE, - WFlags fl = 0 ); - - ~GeometryGUI_FilletDlg(); - -private : - - void Init( SALOME_Selection* Sel, Handle (AIS_InteractiveContext) ic ) ; - void closeEvent( QCloseEvent* e ) ; - void enterEvent( QEvent* e); - void ResetStateOfDialog() ; - - /* Interactive and local context management see also : bool myUseLocalContext() */ - Handle (AIS_InteractiveContext) myIC ; /* Interactive context */ - Standard_Integer myLocalContextId ; /* identify a local context used by this method */ - bool myUseLocalContext ; /* true when this method as opened a local context */ - - QDoubleValidator *myVa ; /* Double validator for numeric input */ - - GEOM::GEOM_Gen_var myGeom ; /* Current Geom object */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - SALOME_Selection* mySelection ; /* User shape selection */ - - TopoDS_Shape mySimulationTopoDs ; /* Shape used for simulation display */ - void MakePreview(); - - TopoDS_Shape myShape ; - bool myOkShape ; - char* myShapeIOR ; - - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - int myConstructorId ; /* Current constructor id = radio button id */ - int myShapeType ; - - bool myOkRadius ; - double myRadius ; - - QButtonGroup* GroupConstructors; - - QRadioButton* Constructor1; - QRadioButton* Constructor2; - QRadioButton* Constructor3; - - QGroupBox* GroupButtons; - QPushButton* buttonOk; - QPushButton* buttonCancel; - QPushButton* buttonApply; - - QGroupBox* GroupC1; - QPushButton* SelectButtonC1A1; - QLineEdit* LineEditC1A1; - QLabel* TextLabelC1A1; - GeometryGUI_SpinBox* SpinBox_C1A2 ; - QLabel* TextLabelC1A2; - - QGroupBox* GroupC2; - QPushButton* SelectButtonC2A1; - QLineEdit* LineEditC2A1; - QLabel* TextLabelC2A1; - GeometryGUI_SpinBox* SpinBox_C2A2 ; - QLabel* TextLabelC2A2; - - QGroupBox* GroupC3; - QPushButton* SelectButtonC3A1; - QLineEdit* LineEditC3A1; - QLabel* TextLabelC3A1; - GeometryGUI_SpinBox* SpinBox_C3A2 ; - QLabel* TextLabelC3A2; - -private slots: - - void ConstructorsClicked(int constructorId); - void ClickOnOk(); - void ClickOnCancel(); - void ClickOnApply(); - void SetEditCurrentArgument() ; - void SelectionIntoArgument() ; - void DeactivateActiveDialog() ; - void LineEditReturnPressed() ; - void ActivateThisDialog() ; - void ValueChangedInSpinBox( double newValue ) ; - -protected: - - QGridLayout* GeometryGUI_FilletDlgLayout; - QGridLayout* GroupButtonsLayout; - QGridLayout* GroupConstructorsLayout; - QGridLayout* GroupC1Layout; - QGridLayout* GroupC2Layout; - QGridLayout* GroupC3Layout; -}; - -#endif // DIALOGBOX_FILLET_H - diff --git a/src/GEOMGUI/GeometryGUI_FillingDlg.cxx b/src/GEOMGUI/GeometryGUI_FillingDlg.cxx deleted file mode 100644 index 1feb85b1f..000000000 --- a/src/GEOMGUI/GeometryGUI_FillingDlg.cxx +++ /dev/null @@ -1,644 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_FillingDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_FillingDlg.h" - -#include "GeometryGUI.h" -#include "GEOM_ShapeTypeFilter.hxx" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - - -//================================================================================= -// class : GeometryGUI_FillingDlg() -// purpose : Constructs a GeometryGUI_FillingDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_FillingDlg::GeometryGUI_FillingDlg( QWidget* parent, - const char* name, - SALOME_Selection* Sel, - bool modal, - WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_FILLING"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - - if ( !name ) - setName( "GeometryGUI_FillingDlg" ); - resize( 303, 275 ); - setCaption( tr( "GEOM_FILLING_TITLE" ) ); - setSizeGripEnabled( TRUE ); - GeometryGUI_FillingDlgLayout = new QGridLayout( this ); - GeometryGUI_FillingDlgLayout->setSpacing( 6 ); - GeometryGUI_FillingDlgLayout->setMargin( 11 ); - - - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "GEOM_FILLING" ) ); - GroupConstructors->setExclusive( TRUE ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setText( tr( "" ) ); - Constructor1->setPixmap( image0 ); - Constructor1->setChecked( TRUE ); - Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) ); - Constructor1->setMinimumSize( QSize( 50, 0 ) ); - - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer, 0, 1 ); - - GeometryGUI_FillingDlgLayout->addWidget( GroupConstructors, 0, 0 ); - - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); - GroupButtons->setTitle( tr( "" ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 3 ); - buttonApply = new QPushButton( GroupButtons, "buttonApply" ); - buttonApply->setText( tr( "GEOM_BUT_APPLY" ) ); - buttonApply->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonApply, 0, 1 ); - QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_9, 0, 2 ); - buttonOk = new QPushButton( GroupButtons, "buttonOk" ); - buttonOk->setText( tr( "GEOM_BUT_OK" ) ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - - GeometryGUI_FillingDlgLayout->addWidget( GroupButtons, 2, 0 ); - -// GroupC1 = new QGroupBox( this, "GroupC1" ); -// GroupC1->setTitle( tr( "GEOM_FILLING_ARG" ) ); -// GroupC1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, GroupC1->sizePolicy().hasHeightForWidth() ) ); -// GroupC1->setColumnLayout(0, Qt::Vertical ); -// GroupC1->layout()->setSpacing( 0 ); -// GroupC1->layout()->setMargin( 0 ); -// GroupC1Layout = new QGridLayout( GroupC1->layout() ); -// GroupC1Layout->setAlignment( Qt::AlignTop ); -// GroupC1Layout->setSpacing( 6 ); -// GroupC1Layout->setMargin( 11 ); - -// LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" ); -// LineEditC1A1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC1A1->sizePolicy().hasHeightForWidth() ) ); - -// GroupC1Layout->addMultiCellWidget( LineEditC1A1, 0, 0, 3, 5 ); - -// TextLabelC1A2 = new QLabel( GroupC1, "TextLabelC1A2" ); -// TextLabelC1A2->setText( tr( "GEOM_FILLING_MIN_DEG" ) ); -// TextLabelC1A2->setMinimumSize( QSize( 50, 0 ) ); -// TextLabelC1A2->setFrameShape( QLabel::NoFrame ); -// TextLabelC1A2->setFrameShadow( QLabel::Plain ); - -// GroupC1Layout->addWidget( TextLabelC1A2, 1, 0 ); - -// LineEditC1A2 = new QLineEdit( GroupC1, "LineEditC1A2" ); -// LineEditC1A2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC1A2->sizePolicy().hasHeightForWidth() ) ); -// LineEditC1A2->setMinimumSize( QSize( 40, 0 ) ); - -// GroupC1Layout->addMultiCellWidget( LineEditC1A2, 1, 1, 1, 2 ); - -// TextLabelC1A3 = new QLabel( GroupC1, "TextLabelC1A3" ); -// TextLabelC1A3->setText( tr( "GEOM_FILLING_MAX_DEG" ) ); -// TextLabelC1A3->setMinimumSize( QSize( 50, 0 ) ); -// TextLabelC1A3->setFrameShape( QLabel::NoFrame ); -// TextLabelC1A3->setFrameShadow( QLabel::Plain ); - -// GroupC1Layout->addWidget( TextLabelC1A3, 1, 4 ); - -// TextLabelC1A5 = new QLabel( GroupC1, "TextLabelC1A5" ); -// TextLabelC1A5->setText( tr( "GEOM_FILLING_TOL_2D" ) ); -// TextLabelC1A5->setMinimumSize( QSize( 50, 0 ) ); -// TextLabelC1A5->setFrameShape( QLabel::NoFrame ); -// TextLabelC1A5->setFrameShadow( QLabel::Plain ); - -// GroupC1Layout->addWidget( TextLabelC1A5, 2, 4 ); - -// LineEditC1A3 = new QLineEdit( GroupC1, "LineEditC1A3" ); -// LineEditC1A3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC1A3->sizePolicy().hasHeightForWidth() ) ); -// LineEditC1A3->setMinimumSize( QSize( 40, 0 ) ); - -// GroupC1Layout->addWidget( LineEditC1A3, 1, 5 ); - -// LineEditC1A5 = new QLineEdit( GroupC1, "LineEditC1A5" ); -// LineEditC1A5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC1A5->sizePolicy().hasHeightForWidth() ) ); -// LineEditC1A5->setMinimumSize( QSize( 40, 0 ) ); - -// GroupC1Layout->addWidget( LineEditC1A5, 2, 5 ); - -// TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" ); -// TextLabelC1A1->setText( tr( "GEOM_FILLING_COMPOUND" ) ); -// TextLabelC1A1->setMinimumSize( QSize( 90, 0 ) ); -// TextLabelC1A1->setFrameShape( QLabel::NoFrame ); -// TextLabelC1A1->setFrameShadow( QLabel::Plain ); - -// GroupC1Layout->addMultiCellWidget( TextLabelC1A1, 0, 0, 0, 1 ); - -// SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" ); -// SelectButtonC1A1->setText( tr( "" ) ); -// SelectButtonC1A1->setPixmap( image1 ); - -// GroupC1Layout->addWidget( SelectButtonC1A1, 0, 2 ); - -// TextLabelC1A4 = new QLabel( GroupC1, "TextLabelC1A4" ); -// TextLabelC1A4->setText( tr( "GEOM_FILLING_TOL_3D" ) ); -// TextLabelC1A4->setMinimumSize( QSize( 50, 0 ) ); -// TextLabelC1A4->setFrameShape( QLabel::NoFrame ); -// TextLabelC1A4->setFrameShadow( QLabel::Plain ); - -// GroupC1Layout->addWidget( TextLabelC1A4, 2, 0 ); - -// TextLabelC1A6 = new QLabel( GroupC1, "TextLabelC1A6" ); -// TextLabelC1A6->setText( tr( "GEOM_FILLING_NB_ITER" ) ); -// TextLabelC1A6->setMinimumSize( QSize( 50, 0 ) ); -// TextLabelC1A6->setFrameShape( QLabel::NoFrame ); -// TextLabelC1A6->setFrameShadow( QLabel::Plain ); - -// GroupC1Layout->addWidget( TextLabelC1A6, 3, 0 ); - -// LineEditC1A4 = new QLineEdit( GroupC1, "LineEditC1A4" ); -// LineEditC1A4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC1A4->sizePolicy().hasHeightForWidth() ) ); -// LineEditC1A4->setMinimumSize( QSize( 40, 0 ) ); - -// GroupC1Layout->addMultiCellWidget( LineEditC1A4, 2, 2, 1, 2 ); - -// LineEditC1A6 = new QLineEdit( GroupC1, "LineEditC1A6" ); -// LineEditC1A6->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC1A6->sizePolicy().hasHeightForWidth() ) ); -// LineEditC1A6->setMinimumSize( QSize( 40, 0 ) ); - -// GroupC1Layout->addMultiCellWidget( LineEditC1A6, 3, 3, 1, 2 ); -// QSpacerItem* spacer_3 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); -// GroupC1Layout->addItem( spacer_3, 1, 3 ); -// QSpacerItem* spacer_4 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); -// GroupC1Layout->addItem( spacer_4, 2, 3 ); -// QSpacerItem* spacer_5 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); -// GroupC1Layout->addMultiCell( spacer_5, 3, 3, 3, 5 ); - -// GeometryGUI_FillingDlgLayout->addWidget( GroupC1, 1, 0 ); - - GroupC1 = new QGroupBox( this, "GroupC1" ); - GroupC1->setMinimumSize( QSize( 0, 0 ) ); - GroupC1->setFrameShape( QGroupBox::Box ); - GroupC1->setFrameShadow( QGroupBox::Sunken ); - GroupC1->setTitle( tr( "GEOM_FILLING_ARG" ) ); - GroupC1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, GroupC1->sizePolicy().hasHeightForWidth() ) ); - GroupC1->setColumnLayout(0, Qt::Vertical ); - GroupC1->layout()->setSpacing( 0 ); - GroupC1->layout()->setMargin( 0 ); - GroupC1Layout = new QGridLayout( GroupC1->layout() ); - GroupC1Layout->setAlignment( Qt::AlignTop ); - GroupC1Layout->setSpacing( 6 ); - GroupC1Layout->setMargin( 11 ); - - LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" ); - LineEditC1A1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC1A1->sizePolicy().hasHeightForWidth() ) ); - - GroupC1Layout->addMultiCellWidget( LineEditC1A1, 0, 0, 3, 6 ); - - TextLabelC1A2 = new QLabel( GroupC1, "TextLabelC1A2" ); - TextLabelC1A2->setText( tr( "GEOM_FILLING_MIN_DEG" ) ); - TextLabelC1A2->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A2->setFrameShape( QLabel::NoFrame ); - TextLabelC1A2->setFrameShadow( QLabel::Plain ); - - GroupC1Layout->addWidget( TextLabelC1A2, 1, 0 ); - - TextLabelC1A5 = new QLabel( GroupC1, "TextLabelC1A5" ); - TextLabelC1A5->setText( tr( "GEOM_FILLING_TOL_2D" ) ); - TextLabelC1A5->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A5->setFrameShape( QLabel::NoFrame ); - TextLabelC1A5->setFrameShadow( QLabel::Plain ); - - GroupC1Layout->addWidget( TextLabelC1A5, 2, 5 ); - - LineEditC1A5 = new QLineEdit( GroupC1, "LineEditC1A5" ); - LineEditC1A5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC1A5->sizePolicy().hasHeightForWidth() ) ); - LineEditC1A5->setMinimumSize( QSize( 40, 0 ) ); - - GroupC1Layout->addWidget( LineEditC1A5, 2, 6 ); - - TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" ); - TextLabelC1A1->setText( tr( "GEOM_FILLING_COMPOUND" ) ); - TextLabelC1A1->setMinimumSize( QSize( 90, 0 ) ); - TextLabelC1A1->setFrameShape( QLabel::NoFrame ); - TextLabelC1A1->setFrameShadow( QLabel::Plain ); - - GroupC1Layout->addMultiCellWidget( TextLabelC1A1, 0, 0, 0, 1 ); - - SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" ); - SelectButtonC1A1->setText( tr( "" ) ); - SelectButtonC1A1->setPixmap( image1 ); - SelectButtonC1A1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, SelectButtonC1A1->sizePolicy().hasHeightForWidth() ) ); - - GroupC1Layout->addWidget( SelectButtonC1A1, 0, 2 ); - - TextLabelC1A4 = new QLabel( GroupC1, "TextLabelC1A4" ); - TextLabelC1A4->setText( tr( "GEOM_FILLING_TOL_3D" ) ); - TextLabelC1A4->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A4->setFrameShape( QLabel::NoFrame ); - TextLabelC1A4->setFrameShadow( QLabel::Plain ); - - GroupC1Layout->addWidget( TextLabelC1A4, 2, 0 ); - - TextLabelC1A6 = new QLabel( GroupC1, "TextLabelC1A6" ); - TextLabelC1A6->setText( tr( "GEOM_FILLING_NB_ITER" ) ); - TextLabelC1A6->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A6->setFrameShape( QLabel::NoFrame ); - TextLabelC1A6->setFrameShadow( QLabel::Plain ); - - GroupC1Layout->addWidget( TextLabelC1A6, 3, 0 ); - QSpacerItem* spacer_3 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupC1Layout->addItem( spacer_3, 1, 3 ); - QSpacerItem* spacer_4 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupC1Layout->addMultiCell( spacer_4, 2, 2, 3, 4 ); - QSpacerItem* spacer_5 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupC1Layout->addMultiCell( spacer_5, 3, 3, 3, 6 ); - - SpinBox_C1A2 = new QSpinBox( GroupC1, "SpinBox_C1A2" ); - SpinBox_C1A2->setMinValue( 1 ); - SpinBox_C1A2->setMaxValue( 15 ); - SpinBox_C1A2->setWrapping( TRUE ); - - GroupC1Layout->addMultiCellWidget( SpinBox_C1A2, 1, 1, 1, 2 ); - - LineEditC1A4 = new QLineEdit( GroupC1, "LineEditC1A4" ); - LineEditC1A4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC1A4->sizePolicy().hasHeightForWidth() ) ); - LineEditC1A4->setMinimumSize( QSize( 40, 0 ) ); - - GroupC1Layout->addMultiCellWidget( LineEditC1A4, 2, 2, 1, 2 ); - - TextLabelC1A3 = new QLabel( GroupC1, "TextLabelC1A3" ); - TextLabelC1A3->setText( tr( "GEOM_FILLING_MAX_DEG" ) ); - TextLabelC1A3->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A3->setFrameShape( QLabel::NoFrame ); - TextLabelC1A3->setFrameShadow( QLabel::Plain ); - - GroupC1Layout->addMultiCellWidget( TextLabelC1A3, 1, 1, 4, 5 ); - - SpinBox_C1A3 = new QSpinBox( GroupC1, "SpinBox_C1A3" ); - SpinBox_C1A3->setMinValue( 1 ); - SpinBox_C1A3->setMaxValue( 15 ); - SpinBox_C1A3->setWrapping( TRUE ); - - GroupC1Layout->addWidget( SpinBox_C1A3, 1, 6 ); - - SpinBox_C1A6 = new QSpinBox( GroupC1, "SpinBox_C1A6" ); - SpinBox_C1A6->setMinValue( 1 ); - SpinBox_C1A6->setMaxValue( 30 ); - SpinBox_C1A6->setWrapping( TRUE ); - - GroupC1Layout->addMultiCellWidget( SpinBox_C1A6, 3, 3, 1, 2 ); - - GeometryGUI_FillingDlgLayout->addWidget( GroupC1, 1, 0 ); - - /* Initialisations */ - Init(Sel) ; -} - - -//================================================================================= -// function : ~GeometryGUI_FillingDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_FillingDlg::~GeometryGUI_FillingDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_FillingDlg::Init( SALOME_Selection* Sel ) -{ - - LineEditC1A4->setMaxLength( 10 ); /* myTol3D */ - LineEditC1A5->setMaxLength( 10 ); /* myTol2D */ - QDoubleValidator *Vc = new QDoubleValidator( 0.00001, +10000.0, 3, LineEditC1A4 ) ; - QDoubleValidator *Vd = new QDoubleValidator( 0.00001, +10000.0, 3, LineEditC1A5 ) ; - LineEditC1A4->setValidator( Vc) ; - LineEditC1A5->setValidator( Vd) ; - - GroupC1->show(); - myConstructorId = 0 ; - Constructor1->setChecked( TRUE ); - myEditCurrentArgument = LineEditC1A1 ; - mySelection = Sel; - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - - SpinBox_C1A2->setValue(2) ; /* myMinDeg */ - SpinBox_C1A3->setValue(5) ; /* myMaxDeg */ - LineEditC1A4->setText("0.0001") ; /* myTol3D */ - LineEditC1A5->setText("0.0001") ; /* myTol2D */ - SpinBox_C1A6->setValue(5) ; /* myNbIter */ - - this->myMinDeg = 2 ; - this->myMaxDeg = 5 ; - this->myTol3D = 0.0001 ; - this->myTol2D = 0.0001 ; - this->myNbIter = 5 ; - - myOkSectionShape = false ; - mySectionShape.Nullify() ; - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - - // TODO previous selection into argument ? - - /* Filter definitions */ - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - myCompoundFilter = new GEOM_ShapeTypeFilter( TopAbs_COMPOUND, myGeom ); - /* first filter used */ - mySelection->AddFilter(myCompoundFilter) ; - - /* signals and slots connections */ - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ; - connect( buttonApply, SIGNAL( clicked() ), this, SLOT(ClickOnApply() ) ); - connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) ); - connect( SelectButtonC1A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - - connect( LineEditC1A1, SIGNAL (returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - - connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ; - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - /* to close dialog if study change */ - connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ; - - /* Move widget on the botton right corner of main widget */ - int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; - /* Displays Dialog */ - this->show() ; - - return ; -} - - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_FillingDlg::ConstructorsClicked(int constructorId) -{ - return ; -} - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_FillingDlg::ClickOnOk() -{ - this->ClickOnApply() ; - this->ClickOnCancel() ; - - return ; -} - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_FillingDlg::ClickOnApply() -{ - switch(myConstructorId) - { - case 0 : - { - this->myMinDeg = SpinBox_C1A2->value() ; - this->myMaxDeg = SpinBox_C1A3->value() ; - this->myTol3D = LineEditC1A4->text().toDouble(); - this->myTol2D = LineEditC1A5->text().toDouble(); - this->myNbIter = SpinBox_C1A6->value() ; - if(myOkSectionShape) { - myGeomGUI->MakeFillingAndDisplay( myGeomShape, myMinDeg, myMaxDeg, myTol3D, myTol2D, myNbIter) ; - } - break ; - } - } - return ; -} - - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void GeometryGUI_FillingDlg::ClickOnCancel() -{ - mySelection->ClearFilters() ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->ResetState() ; - reject() ; - return ; -} - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -//================================================================================= -void GeometryGUI_FillingDlg::SelectionIntoArgument() -{ - myEditCurrentArgument->setText("") ; - QString aString = ""; /* name of selection */ - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; - if ( nbSel != 1 ) { - if ( myEditCurrentArgument == LineEditC1A1 ) { - myOkSectionShape = false ; - } - return ; - } - - // nbSel == 1 - TopoDS_Shape S; - Standard_Boolean testResult ; - Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject() ; - if( !myGeomGUI->GetTopoFromSelection(mySelection, S) ) - return ; - - if ( myEditCurrentArgument == LineEditC1A1 && S.ShapeType() == TopAbs_COMPOUND ) { - myEditCurrentArgument->setText(aString) ; - myGeomShape = myGeomGUI->ConvertIOinGEOMShape(IO, testResult) ; - if( !testResult ) - return ; - myOkSectionShape = true ; - } - /* no simulation */ - return ; -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_FillingDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - mySelection->ClearFilters() ; - switch (myConstructorId) - { - case 0: /* default constructor */ - { - if(send == SelectButtonC1A1) { - LineEditC1A1->setFocus() ; - myEditCurrentArgument = LineEditC1A1; - mySelection->AddFilter(myCompoundFilter) ; - } - SelectionIntoArgument() ; - break; - } - } - return ; -} - - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_FillingDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if( send == LineEditC1A1 ) - myEditCurrentArgument = LineEditC1A1 ; - else - return ; - - /* User name of object input management */ - /* If successfull the selection is changed and signal emitted... */ - /* so SelectionIntoArgument() is automatically called. */ - const QString objectUserName = myEditCurrentArgument->text() ; - QWidget* thisWidget = (QWidget*)this ; - if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) { - myEditCurrentArgument->setText( objectUserName ) ; - } - return ; -} - - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void GeometryGUI_FillingDlg::DeactivateActiveDialog() -{ - if ( GroupConstructors->isEnabled() ) { - GroupConstructors->setEnabled(false) ; - GroupC1->setEnabled(false) ; - GroupButtons->setEnabled(false) ; - disconnect( mySelection, 0, this, 0 ); - mySelection->ClearFilters() ; - } - return ; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_FillingDlg::ActivateThisDialog() -{ - /* Emit a signal to deactivate the active dialog */ - myGeomGUI->EmitSignalDeactivateDialog() ; - GroupConstructors->setEnabled(true) ; - GroupC1->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - return ; -} - - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void GeometryGUI_FillingDlg::enterEvent(QEvent* e) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; - return ; -} - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_FillingDlg::closeEvent( QCloseEvent* e ) -{ - /* same than click on cancel button */ - this->ClickOnCancel() ; - return ; -} diff --git a/src/GEOMGUI/GeometryGUI_FillingDlg.h b/src/GEOMGUI/GeometryGUI_FillingDlg.h deleted file mode 100644 index b41726884..000000000 --- a/src/GEOMGUI/GeometryGUI_FillingDlg.h +++ /dev/null @@ -1,127 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_FillingDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_FILLING_H -#define DIALOGBOX_FILLING_H - -#include "SALOME_Selection.h" -#include "GEOM_ShapeTypeFilter.hxx" - -#include -#include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QGroupBox; -class QLabel; -class QLineEdit; -class QSpinBox; -class QPushButton; -class QRadioButton; -class GeometryGUI; - - -//================================================================================= -// class : GeometryGUI_FillingDlg -// purpose : -//================================================================================= -class GeometryGUI_FillingDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_FillingDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 ); - ~GeometryGUI_FillingDlg(); - -private: - - void Init( SALOME_Selection* Sel ) ; - void closeEvent( QCloseEvent* e ) ; - void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */ - - GEOM::GEOM_Gen_var myGeom ; /* Current GeomI object */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - SALOME_Selection* mySelection ; /* User shape selection */ - GEOM::GEOM_Shape_var myGeomShape ; /* is mySectionShape */ - TopoDS_Shape mySectionShape ; - Standard_Integer myMinDeg ; - Standard_Integer myMaxDeg ; - Standard_Real myTol3D ; - Standard_Real myTol2D ; - Standard_Integer myNbIter ; - - bool myOkSectionShape ; /* to check when arguments is defined */ - int myConstructorId ; /* Current constructor id = radio button id */ - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - Handle(GEOM_ShapeTypeFilter) myCompoundFilter ; /* Filter selection */ - - QButtonGroup* GroupConstructors; - QRadioButton* Constructor1; - QGroupBox* GroupButtons; - QPushButton* buttonApply; - QPushButton* buttonOk; - QPushButton* buttonCancel; - QGroupBox* GroupC1; - QLineEdit* LineEditC1A1; - QLabel* TextLabelC1A2; - QLabel* TextLabelC1A3; - QLabel* TextLabelC1A5; - - QLineEdit* LineEditC1A5; - QLabel* TextLabelC1A1; - QPushButton* SelectButtonC1A1; - QLabel* TextLabelC1A4; - QLabel* TextLabelC1A6; - QLineEdit* LineEditC1A4; - - QSpinBox* SpinBox_C1A2; - QSpinBox* SpinBox_C1A3; - QSpinBox* SpinBox_C1A6; - -private slots: - - void ConstructorsClicked(int constructorId); - void ClickOnOk(); - void ClickOnCancel(); - void ClickOnApply(); - void SetEditCurrentArgument() ; - void SelectionIntoArgument() ; - void LineEditReturnPressed() ; - void DeactivateActiveDialog() ; - void ActivateThisDialog() ; - -protected: - QGridLayout* GeometryGUI_FillingDlgLayout; - QGridLayout* GroupConstructorsLayout; - QGridLayout* GroupButtonsLayout; - QGridLayout* GroupC1Layout; -}; - -#endif // DIALOGBOX_FILLING_H diff --git a/src/GEOMGUI/GeometryGUI_FillingHoleDlg.cxx b/src/GEOMGUI/GeometryGUI_FillingHoleDlg.cxx deleted file mode 100644 index 9e26e9498..000000000 --- a/src/GEOMGUI/GeometryGUI_FillingHoleDlg.cxx +++ /dev/null @@ -1,542 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_FillingHoleDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_FillingHoleDlg.h" - -#include "GeometryGUI.h" -#include "QAD_Application.h" -#include "QAD_Desktop.h" -#include "utilities.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -//================================================================================= -// class : GeometryGUI_FillingHoleDlg() -// purpose : Constructs a GeometryGUI_FillingHoleDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_FillingHoleDlg::GeometryGUI_FillingHoleDlg( QWidget* parent, - const char* name, - SALOME_Selection* Sel, - Handle (AIS_InteractiveContext) ic, - bool modal, - WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_SEWING"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - - if ( !name ) - setName( "GeometryGUI_FillingHoleDlg" ); - resize( 303, 203 ); - setCaption( tr( "Filling hole" ) ); - setSizeGripEnabled( TRUE ); - GeometryGUI_FillingHoleDlgLayout = new QGridLayout( this ); - GeometryGUI_FillingHoleDlgLayout->setSpacing( 6 ); - GeometryGUI_FillingHoleDlgLayout->setMargin( 11 ); - - /***************************************************************/ - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "" ) ); - GroupConstructors->setExclusive( TRUE ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setText( tr( "" ) ); - Constructor1->setPixmap( image0 ); - Constructor1->setChecked( TRUE ); - Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) ); - Constructor1->setMinimumSize( QSize( 50, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer, 0, 1 ); - GeometryGUI_FillingHoleDlgLayout->addWidget( GroupConstructors, 0, 0 ); - - /***************************************************************/ - GroupC1 = new QGroupBox( this, "GroupC1" ); - GroupC1->setTitle( tr( "" ) ); - GroupC1->setMinimumSize( QSize( 0, 0 ) ); - GroupC1->setFrameShape( QGroupBox::Box ); - GroupC1->setFrameShadow( QGroupBox::Sunken ); - GroupC1->setColumnLayout(0, Qt::Vertical ); - GroupC1->layout()->setSpacing( 0 ); - GroupC1->layout()->setMargin( 0 ); - GroupC1Layout = new QGridLayout( GroupC1->layout() ); - GroupC1Layout->setAlignment( Qt::AlignTop ); - GroupC1Layout->setSpacing( 6 ); - GroupC1Layout->setMargin( 11 ); - Layout2 = new QHBoxLayout; - Layout2->setSpacing( 6 ); - Layout2->setMargin( 0 ); - TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" ); - TextLabelC1A1->setText( tr( "Main object" ) ); - TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A1->setFrameShape( QLabel::NoFrame ); - TextLabelC1A1->setFrameShadow( QLabel::Plain ); - Layout2->addWidget( TextLabelC1A1 ); - SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" ); - SelectButtonC1A1->setText( tr( "" ) ); - SelectButtonC1A1->setPixmap( image1 ); - SelectButtonC1A1->setToggleButton( FALSE ); - SelectButtonC1A1->setMaximumSize( QSize( 28, 32767 ) ); - Layout2->addWidget( SelectButtonC1A1 ); - LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" ); - LineEditC1A1->setAlignment( int( QLineEdit::AlignLeft ) ); - Layout2->addWidget( LineEditC1A1 ); - GroupC1Layout->addLayout( Layout2, 0, 0 ); - CheckBox1 = new QCheckBox( GroupC1, "CheckBox1" ); - CheckBox1->setText( tr( "Select edges of hole on main object" ) ); - CheckBox1->setChecked( FALSE ); - GroupC1Layout->addWidget( CheckBox1, 1, 0 ); - GeometryGUI_FillingHoleDlgLayout->addWidget( GroupC1, 1, 0 ); - - /***************************************************************/ - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setTitle( tr( "" ) ); - GroupButtons->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, GroupButtons->sizePolicy().hasHeightForWidth() ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - buttonClose = new QPushButton( GroupButtons, "buttonClose" ); - buttonClose->setText( tr( "&Close" ) ); - buttonClose->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonClose, 0, 3 ); - buttonOk = new QPushButton( GroupButtons, "buttonOk" ); - buttonOk->setText( tr( "&Ok" ) ); - buttonOk->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - buttonApply = new QPushButton( GroupButtons, "buttonApply" ); - buttonApply->setText( tr( "&Apply" ) ); - buttonApply->setAutoDefault( TRUE ); - buttonApply->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonApply, 0, 1 ); - QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_2, 0, 2 ); - GeometryGUI_FillingHoleDlgLayout->addWidget( GroupButtons, 2, 0 ); - - /* Initialisations */ - Init(Sel, ic) ; - -} - - -//================================================================================= -// function : ~GeometryGUI_FillingHoleDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_FillingHoleDlg::~GeometryGUI_FillingHoleDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_FillingHoleDlg::Init( SALOME_Selection* Sel, Handle (AIS_InteractiveContext) ic ) -{ - - GroupC1->show(); - myConstructorId = 0 ; - Constructor1->setChecked( TRUE ); - myEditCurrentArgument = LineEditC1A1 ; - mySelection = Sel; - myShape.Nullify() ; - - myIC = ic ; - myUseLocalContext = false ; - myOkShape = false ; - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - - /* Select sub shapes mode not checked */ - CheckBox1->setChecked( FALSE ); - myOkSelectSubMode = false ; - - // TODO : previous selection into argument ? - - /* Filter definitions */ - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - - /* signals and slots connections */ - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); - connect( buttonApply, SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) ); - connect( buttonClose, SIGNAL( clicked() ), this, SLOT( ClickOnClose() ) ); - connect( GroupConstructors, SIGNAL( clicked(int) ), this, SLOT( ConstructorsClicked(int) )); - - connect( LineEditC1A1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - connect( SelectButtonC1A1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() )); - connect( CheckBox1, SIGNAL( stateChanged(int) ), this, SLOT( ActivateUserSelection() )); - - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() )); - connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ; - connect( myGeomGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( ClickOnClose() )); - - /* Move widget on the botton right corner of main widget */ - int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; - this->show() ; /* display Dialog */ - - return ; -} - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_FillingHoleDlg::ConstructorsClicked(int constructorId) -{ - return ; -} - - -//================================================================================= -// function : ClickOnOk() -// purpose : Same than click on apply but close this dialog. -//================================================================================= -void GeometryGUI_FillingHoleDlg::ClickOnOk() -{ - this->ClickOnApply() ; - accept(); - - return ; -} - - - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_FillingHoleDlg::ClickOnApply() -{ - bool testResult = false ; - myGeomGUI->GetDesktop()->putInfo( tr("") ) ; - - switch(myConstructorId) - { - case 0 : - { - if( myOkShape && myOkSelectSubMode ) { - testResult = myGeomGUI->OnFillingHole( myShape, myShapeIOR, myLocalContextId, myUseLocalContext ) ; - } - if( !testResult ) { - myGeomGUI->GetDesktop()->putInfo(tr("Operation aborted")) ; - } - else { - myGeomGUI->GetDesktop()->putInfo(tr("Operation done")); - } - /* Reset arguments to allow a new selection */ - this->ResetStateOfDialog() ; - break ; - } - } - return ; -} - - - -//================================================================================= -// function : ClickOnClose() -// purpose : -//================================================================================= -void GeometryGUI_FillingHoleDlg::ClickOnClose() -{ - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->ResetState() ; - - if(myUseLocalContext) { - myIC->CloseLocalContext(myLocalContextId) ; - this->myUseLocalContext = false ; - myGeomGUI->OnDisplayAll(true) ; - } - reject() ; - return ; -} - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -// : used only by SelectButtonC1A1 (LineEditC1A1) -//================================================================================= -void GeometryGUI_FillingHoleDlg::SelectionIntoArgument() -{ - - /* Reset argument and local context when selection as changed */ - this->ResetStateOfDialog() ; - - QString aString = ""; /* name of selection */ - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; - if ( nbSel != 1 ) - return ; - - /* nbSel == 1 */ - TopoDS_Shape S ; - Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject() ; - - if( !myGeomGUI->GetTopoFromSelection(mySelection, S) ) - return ; - -// if( !IO->hasEntry() ) { -// myGeomGUI->GetDesktop()->putInfo(tr("Main shape must be in the study before")) ; -// return ; -// } - - /* Test the exact type of topology to fill an hole */ - if ( !S.IsNull() && ( S.ShapeType() == TopAbs_SOLID || S.ShapeType() == TopAbs_SHELL || S.ShapeType() == TopAbs_COMPOUND ) ) { - - if ( IO->IsInstance(STANDARD_TYPE(GEOM_InteractiveObject)) ) { - Handle(GEOM_InteractiveObject) GIObject = Handle(GEOM_InteractiveObject)::DownCast( IO ); - myShapeIOR = GIObject->getIOR(); /* the Geom IOR string of selection */ - LineEditC1A1->setText(aString) ; - myShape = S ; - myOkShape = true ; - return; - } - - if ( IO->hasEntry() ) { - SALOMEDS::Study_var aStudy = myGeomGUI->GetActiveStudy()->getStudyDocument(); - SALOMEDS::SObject_var obj = aStudy->FindObjectID( IO->getEntry() ); - SALOMEDS::GenericAttribute_var anAttr; - SALOMEDS::AttributeIOR_var anIOR; - if ( !obj->_is_nil() ) { - if (obj->FindAttribute(anAttr, "AttributeIOR")) { - anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr); - myShapeIOR = anIOR->Value(); - myOkShape = true ; - myShape = S ; - LineEditC1A1->setText(aString) ; - return; - } - } - } - - } - return ; -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_FillingHoleDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - switch (myConstructorId) - { - case 0: /* default constructor */ - { - if(send == SelectButtonC1A1) { - LineEditC1A1->setFocus() ; - myEditCurrentArgument = LineEditC1A1; - SelectionIntoArgument() ; - } - break; - } - } - return ; -} - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_FillingHoleDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if( send == LineEditC1A1 ) - myEditCurrentArgument = LineEditC1A1 ; - else - return ; - - /* User name of object input management */ - /* If successfull the selection is changed and signal emitted... */ - /* so SelectionIntoArgument() is automatically called. */ - const QString objectUserName = myEditCurrentArgument->text() ; - QWidget* thisWidget = (QWidget*)this ; - if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) { - myEditCurrentArgument->setText( objectUserName ) ; - } - return ; -} - - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void GeometryGUI_FillingHoleDlg::DeactivateActiveDialog() -{ - if ( GroupConstructors->isEnabled() ) { - - this->ResetStateOfDialog() ; - - disconnect( mySelection, 0, this, 0 ); - GroupConstructors->setEnabled(false) ; - GroupC1->setEnabled(false) ; - GroupButtons->setEnabled(false) ; - myGeomGUI->ResetState() ; - myGeomGUI->SetActiveDialogBox(0) ; - myGeomGUI->OnDisplayAll(true) ; - } - return ; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_FillingHoleDlg::ActivateThisDialog() -{ - /* Emit a signal to deactivate other active dialog */ - myGeomGUI->EmitSignalDeactivateDialog() ; - GroupConstructors->setEnabled(true) ; - GroupC1->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - return ; -} - - -//================================================================================= -// function : enterEvent() -// purpose : Mouse enter onto the dialog to activate it -//================================================================================= -void GeometryGUI_FillingHoleDlg::enterEvent(QEvent* e) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; - return ; -} - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_FillingHoleDlg::closeEvent( QCloseEvent* e ) -{ - /* same than click on cancel button */ - this->ClickOnClose() ; - return ; -} - - -//================================================================================= -// function : ActivateUserSelection() -// purpose : Activate selection of faces when CheckBox1->isChecked()... -//================================================================================= -void GeometryGUI_FillingHoleDlg::ActivateUserSelection() -{ - - if( !this->myOkShape ) { - this->ResetStateOfDialog() ; - myGeomGUI->GetDesktop()->putInfo(tr("Select main shape first")) ; - return ; - } - - this->myOkSelectSubMode = CheckBox1->isChecked() ; - - if( this->myUseLocalContext ) { - myIC->CloseLocalContext(myLocalContextId) ; - this->myUseLocalContext = false ; - myGeomGUI->OnDisplayAll(true) ; - } - - if( myOkShape && myOkSelectSubMode ) { - /* local context is defined into the method : GEOM::EDGE sub selection */ - TopAbs_ShapeEnum aType = TopAbs_EDGE ; - myGeomGUI->PrepareSubShapeSelection( int(aType), this->myLocalContextId ) ; - myUseLocalContext = true ; - myGeomGUI->GetDesktop()->putInfo(tr("Select edges to fill an hole and click on Ok/Apply")) ; - } - return ; -} - - - -//================================================================================= -// function : ResetStateOfDialog() -// purpose : Completely reset the state of method including local context -//================================================================================= -void GeometryGUI_FillingHoleDlg::ResetStateOfDialog() -{ - this->myOkShape = false ; - this->myEditCurrentArgument->setText("") ; - - /* Select sub shapes mode not checked */ - this->myOkSelectSubMode = false ; - this->CheckBox1->setChecked( FALSE ); - - /* Close its local contact if opened */ - if( this->myUseLocalContext ) { - myIC->CloseLocalContext(this->myLocalContextId) ; - this->myUseLocalContext = false ; - myGeomGUI->OnDisplayAll(true) ; - } - return ; -} - - - diff --git a/src/GEOMGUI/GeometryGUI_FillingHoleDlg.h b/src/GEOMGUI/GeometryGUI_FillingHoleDlg.h deleted file mode 100644 index 8e0b758df..000000000 --- a/src/GEOMGUI/GeometryGUI_FillingHoleDlg.h +++ /dev/null @@ -1,133 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_FillingHoleDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -#ifndef GEOMETRYGUI_FILLINGHOLE_H -#define GEOMETRYGUI_FILLINGHOLE_H - -#include "SALOME_Selection.h" -#include "GEOM_ShapeTypeFilter.hxx" - -#include -#include - -#include CORBA_SERVER_HEADER(SALOMEDS_Attributes) - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QCheckBox; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QRadioButton; -class GeometryGUI; - - -//================================================================================= -// class : GeometryGUI_FillingHoleDlg -// purpose : -//================================================================================= -class GeometryGUI_FillingHoleDlg : public QDialog -{ - Q_OBJECT - -public : - GeometryGUI_FillingHoleDlg( QWidget* parent = 0, - const char* name = 0, - SALOME_Selection* Sel = 0, - Handle (AIS_InteractiveContext) ic = 0, - bool modal = FALSE, - WFlags fl = 0 ); - - ~GeometryGUI_FillingHoleDlg(); - -private : - - void Init( SALOME_Selection* Sel, Handle (AIS_InteractiveContext) ic ) ; - void closeEvent( QCloseEvent* e ) ; - void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */ - void ResetStateOfDialog() ; - - /* Interactive and local context management see also : bool myUseLocalContext() */ - Handle (AIS_InteractiveContext) myIC ; /* Interactive context */ - Standard_Integer myLocalContextId ; /* identify a local context used by this method */ - bool myUseLocalContext ; /* true when this method as opened a local context */ - - GEOM::GEOM_Gen_var myGeom ; /* Current Geom object */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - SALOME_Selection* mySelection ; /* User shape selection */ - - TopoDS_Shape myShape ; - char* myShapeIOR ; - bool myOkShape ; - - bool myOkSelectSubMode ; /* true = sub mode selection activated */ - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - int myConstructorId ; /* Current constructor id = radio button id */ - - QButtonGroup* GroupConstructors; - QRadioButton* Constructor1; - - QGroupBox* GroupC1; - QLabel* TextLabelC1A1; - QPushButton* SelectButtonC1A1; - QLineEdit* LineEditC1A1; - QCheckBox* CheckBox1; - - QGroupBox* GroupButtons; - QPushButton* buttonOk; - QPushButton* buttonApply; - QPushButton* buttonClose; - - -private slots: - - void ConstructorsClicked(int constructorId); - void ClickOnOk(); - void ClickOnApply() ; - void ClickOnClose(); - - void LineEditReturnPressed() ; - void SetEditCurrentArgument() ; - void SelectionIntoArgument() ; - void DeactivateActiveDialog() ; - void ActivateThisDialog() ; - void ActivateUserSelection() ; - -protected: - - QGridLayout* GeometryGUI_FillingHoleDlgLayout; - QGridLayout* GroupConstructorsLayout; - QGridLayout* GroupC1Layout; - QHBoxLayout* Layout2; - QGridLayout* GroupButtonsLayout; -}; - -#endif // GEOMETRYGUI_FILLINGHOLE_H diff --git a/src/GEOMGUI/GeometryGUI_FuseDlg.cxx b/src/GEOMGUI/GeometryGUI_FuseDlg.cxx deleted file mode 100644 index d8b274079..000000000 --- a/src/GEOMGUI/GeometryGUI_FuseDlg.cxx +++ /dev/null @@ -1,251 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_FuseDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_FuseDlg.h" - -#include "GeometryGUI.h" -#include "QAD_Desktop.h" - -//================================================================================= -// class : GeometryGUI_FuseDlg() -// purpose : Constructs a GeometryGUI_FuseDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_FuseDlg::GeometryGUI_FuseDlg(QWidget* parent, const char* name, BooleanGUI* theBooleanGUI, SALOME_Selection* Sel, bool modal, WFlags fl) - :GeometryGUI_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_FUSE"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT"))); - - setCaption(tr("GEOM_FUSE_TITLE")); - - /***************************************************************/ - GroupConstructors->setTitle(tr("GEOM_FUSE")); - RadioButton1->setPixmap(image0); - RadioButton2->close(TRUE); - RadioButton3->close(TRUE); - - GroupFuse = new GeometryGUI_2Sel_QTD(this, "GroupFuse"); - GroupFuse->GroupBox1->setTitle(tr("GEOM_ARGUMENTS")); - GroupFuse->TextLabel1->setText(tr("GEOM_OBJECT_I").arg("1")); - GroupFuse->TextLabel2->setText(tr("GEOM_OBJECT_I").arg("2")); - GroupFuse->PushButton1->setPixmap(image1); - GroupFuse->PushButton2->setPixmap(image1); - - Layout1->addWidget(GroupFuse, 1, 0); - /***************************************************************/ - - /* Initialisation */ - myBooleanGUI = theBooleanGUI; - Init(); -} - - -//================================================================================= -// function : ~GeometryGUI_FuseDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_FuseDlg::~GeometryGUI_FuseDlg() -{ - /* no need to delete child widgets, Qt does it all for us */ -} - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_FuseDlg::Init() -{ - /* init variables */ - myEditCurrentArgument = GroupFuse->LineEdit1; - - myShape1.Nullify(); - myShape2.Nullify(); - myOkShape1 = myOkShape2 = false; - - /* signals and slots connections */ - connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); - connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); - - connect(GroupFuse->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); - connect(GroupFuse->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); - - connect(GroupFuse->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); - connect(GroupFuse->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); - - connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - - /* displays Dialog */ - GroupFuse->show(); - this->show(); - - return; -} - - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_FuseDlg::ClickOnOk() -{ - this->ClickOnApply(); - ClickOnCancel(); - return ; -} - - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_FuseDlg::ClickOnApply() -{ - myGeomGUI->GetDesktop()->putInfo(tr("")); - - if(myOkShape1 && myOkShape2) - myBooleanGUI->MakeBooleanAndDisplay(myGeomShape1 ,myGeomShape2, 3); - - return; -} - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection has changed -//================================================================================= -void GeometryGUI_FuseDlg::SelectionIntoArgument() -{ - myEditCurrentArgument->setText(""); - QString aString = ""; - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString); - if(nbSel != 1) { - if(myEditCurrentArgument == GroupFuse->LineEdit1) - myOkShape1 = false; - else if( myEditCurrentArgument == GroupFuse->LineEdit2) - myOkShape2 = false; - return; - } - - /* nbSel == 1 */ - TopoDS_Shape S; - Standard_Boolean testResult; - Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject(); - - if(!myGeomGUI->GetTopoFromSelection(mySelection, S)) - return; - - if(myEditCurrentArgument == GroupFuse->LineEdit1) { - myGeomShape1 = myGeomGUI->ConvertIOinGEOMShape(IO, testResult); - if(!testResult) - return; - myShape1 = S; - GroupFuse->LineEdit1->setText(aString); - myOkShape1 = true; - } - else if(myEditCurrentArgument == GroupFuse->LineEdit2) { - myGeomShape2 = myGeomGUI->ConvertIOinGEOMShape(IO, testResult); - if(!testResult) - return; - myShape2 = S; - GroupFuse->LineEdit2->setText(aString); - myOkShape2 = true; - } - return; -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_FuseDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - - if(send == GroupFuse->PushButton1) { - GroupFuse->LineEdit1->setFocus(); - myEditCurrentArgument = GroupFuse->LineEdit1; - } - else if(send == GroupFuse->PushButton2) { - GroupFuse->LineEdit2->setFocus(); - myEditCurrentArgument = GroupFuse->LineEdit2; - } - SelectionIntoArgument(); - - return; -} - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_FuseDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if(send == GroupFuse->LineEdit1) - myEditCurrentArgument = GroupFuse->LineEdit1; - else if(send == GroupFuse->LineEdit2) - myEditCurrentArgument = GroupFuse->LineEdit2; - else - return; - - GeometryGUI_Skeleton::LineEditReturnPressed(); - return; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_FuseDlg::ActivateThisDialog() -{ - GeometryGUI_Skeleton::ActivateThisDialog(); - connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - return; -} - - -//================================================================================= -// function : enterEvent() -// purpose : when mouse enter onto the QWidget -//================================================================================= -void GeometryGUI_FuseDlg::enterEvent(QEvent* e) -{ - if(GroupConstructors->isEnabled()) - return; - this->ActivateThisDialog(); - return; -} diff --git a/src/GEOMGUI/GeometryGUI_FuseDlg.h b/src/GEOMGUI/GeometryGUI_FuseDlg.h deleted file mode 100644 index 5e0835c9d..000000000 --- a/src/GEOMGUI/GeometryGUI_FuseDlg.h +++ /dev/null @@ -1,76 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_FuseDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_FUSE_H -#define DIALOGBOX_FUSE_H - -#include "GeometryGUI_Skeleton.h" -#include "GeometryGUI_2Sel_QTD.h" - -#include "BooleanGUI.h" - -#include - -//================================================================================= -// class : GeometryGUI_FuseDlg -// purpose : -//================================================================================= -class GeometryGUI_FuseDlg : public GeometryGUI_Skeleton -{ - Q_OBJECT - -public: - GeometryGUI_FuseDlg(QWidget* parent = 0, const char* name = 0, BooleanGUI* theBooleanGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0); - ~GeometryGUI_FuseDlg(); - -private: - void Init(); - void enterEvent(QEvent* e); - - BooleanGUI* myBooleanGUI; - - TopoDS_Shape myShape1; /* topology used to fuse */ - TopoDS_Shape myShape2; /* topology used to fuse */ - GEOM::GEOM_Shape_var myGeomShape1; /* is myShape1 */ - GEOM::GEOM_Shape_var myGeomShape2; /* is myShape2 */ - bool myOkShape1; /* to check when arguments are defined */ - bool myOkShape2; - - GeometryGUI_2Sel_QTD* GroupFuse; - -private slots: - void ClickOnOk(); - void ClickOnApply(); - void SetEditCurrentArgument(); - void SelectionIntoArgument(); - void LineEditReturnPressed(); - void ActivateThisDialog(); - -}; - -#endif // DIALOGBOX_FUSE_H diff --git a/src/GEOMGUI/GeometryGUI_InertiaDlg.cxx b/src/GEOMGUI/GeometryGUI_InertiaDlg.cxx deleted file mode 100644 index 99a6c46c6..000000000 --- a/src/GEOMGUI/GeometryGUI_InertiaDlg.cxx +++ /dev/null @@ -1,566 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_InertiaDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM - -using namespace std; -#include "GeometryGUI_InertiaDlg.h" - -#include "GeometryGUI.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -//================================================================================= -// class : GeometryGUI_InertiaDlg() -// purpose : Constructs a GeometryGUI_InertiaDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_InertiaDlg::GeometryGUI_InertiaDlg( QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_INERTIA"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - - if ( !name ) - setName( "GeometryGUI_InertiaDlg" ); - resize( 356, 303 ); - setCaption( tr( "GEOM_INERTIA_TITLE" ) ); - setSizeGripEnabled( TRUE ); - GeometryGUI_InertiaDlgLayout = new QGridLayout( this ); - GeometryGUI_InertiaDlgLayout->setSpacing( 6 ); - GeometryGUI_InertiaDlgLayout->setMargin( 11 ); - - /***************************************************************/ - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "GEOM_INERTIA_CONSTR" ) ); - GroupConstructors->setExclusive( TRUE ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer, 0, 1 ); - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setText( tr( "" ) ); - Constructor1->setPixmap( image0 ); - Constructor1->setChecked( TRUE ); - Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) ); - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - GeometryGUI_InertiaDlgLayout->addWidget( GroupConstructors, 0, 0 ); - - /***************************************************************/ - GroupC1 = new QGroupBox( this, "GroupC1" ); - GroupC1->setTitle( tr( "GEOM_OBJECT_RESULT" ) ); - GroupC1->setColumnLayout(0, Qt::Vertical ); - GroupC1->layout()->setSpacing( 0 ); - GroupC1->layout()->setMargin( 0 ); - GroupC1Layout = new QGridLayout( GroupC1->layout() ); - GroupC1Layout->setAlignment( Qt::AlignTop ); - GroupC1Layout->setSpacing( 6 ); - GroupC1Layout->setMargin( 11 ); - TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" ); - TextLabelC1A1->setText( tr( "GEOM_OBJECT" ) ); - TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A1->setFrameShape( QLabel::NoFrame ); - TextLabelC1A1->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabelC1A1, 0, 0 ); - SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" ); - SelectButtonC1A1->setText( tr( "" ) ); - SelectButtonC1A1->setPixmap( image1 ); - GroupC1Layout->addWidget( SelectButtonC1A1, 0, 1 ); - LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" ); - LineEditC1A1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC1A1->sizePolicy().hasHeightForWidth() ) ); - LineEditC1A1->setMinimumSize( QSize( 220, 0 ) ); - GroupC1Layout->addMultiCellWidget( LineEditC1A1, 0, 0, 2, 4 ); - TextLabel_Matrix = new QLabel( GroupC1, "TextLabel_Matrix" ); - TextLabel_Matrix->setText( tr( "GEOM_MATRIX" ) ); - TextLabel_Matrix->setMinimumSize( QSize( 50, 0 ) ); - TextLabel_Matrix->setFrameShape( QLabel::NoFrame ); - TextLabel_Matrix->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabel_Matrix, 1, 0 ); - TextLabelMatrix_11 = new QLabel( GroupC1, "TextLabelMatrix_11" ); - TextLabelMatrix_11->setText( tr( "GEOM_INERTIA_I" ).arg("1") ); - TextLabelMatrix_11->setMinimumSize( QSize( 0, 0 ) ); - TextLabelMatrix_11->setFrameShape( QLabel::NoFrame ); - TextLabelMatrix_11->setFrameShadow( QLabel::Plain ); - TextLabelMatrix_11->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); - GroupC1Layout->addWidget( TextLabelMatrix_11, 1, 1 ); - TextLabelMatrix_21 = new QLabel( GroupC1, "TextLabelMatrix_21" ); - TextLabelMatrix_21->setText( tr( "GEOM_INERTIA_I" ).arg("2") ); - TextLabelMatrix_21->setMinimumSize( QSize( 0, 0 ) ); - TextLabelMatrix_21->setFrameShape( QLabel::NoFrame ); - TextLabelMatrix_21->setFrameShadow( QLabel::Plain ); - TextLabelMatrix_21->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); - GroupC1Layout->addWidget( TextLabelMatrix_21, 2, 1 ); - TextLabelMatrix_31 = new QLabel( GroupC1, "TextLabelMatrix_31" ); - TextLabelMatrix_31->setText( tr( "GEOM_INERTIA_I" ).arg("3") ); - TextLabelMatrix_31->setMinimumSize( QSize( 0, 0 ) ); - TextLabelMatrix_31->setFrameShape( QLabel::NoFrame ); - TextLabelMatrix_31->setFrameShadow( QLabel::Plain ); - TextLabelMatrix_31->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); - GroupC1Layout->addWidget( TextLabelMatrix_31, 3, 1 ); - LineEdit_L1C1 = new QLineEdit( GroupC1, "LineEdit_L1C1" ); - LineEdit_L1C1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEdit_L1C1->sizePolicy().hasHeightForWidth() ) ); - LineEdit_L1C1->setMinimumSize( QSize( 70, 0 ) ); - //LineEdit_L1C1->setEnabled( FALSE ); - LineEdit_L1C1->setReadOnly( TRUE ); - LineEdit_L1C1->setText( tr( "" ) ); - GroupC1Layout->addWidget( LineEdit_L1C1, 1, 2 ); - LineEdit_L1C2 = new QLineEdit( GroupC1, "LineEdit_L1C2" ); - LineEdit_L1C2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEdit_L1C2->sizePolicy().hasHeightForWidth() ) ); - LineEdit_L1C2->setMinimumSize( QSize( 70, 0 ) ); - //LineEdit_L1C2->setEnabled( FALSE ); - LineEdit_L1C2->setReadOnly( TRUE ); - GroupC1Layout->addWidget( LineEdit_L1C2, 1, 3 ); - LineEdit_L1C3 = new QLineEdit( GroupC1, "LineEdit_L1C3" ); - LineEdit_L1C3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEdit_L1C3->sizePolicy().hasHeightForWidth() ) ); - LineEdit_L1C3->setMinimumSize( QSize( 70, 0 ) ); - //LineEdit_L1C3->setEnabled( FALSE ); - LineEdit_L1C3->setReadOnly( TRUE ); - GroupC1Layout->addWidget( LineEdit_L1C3, 1, 4 ); - LineEdit_L2C1 = new QLineEdit( GroupC1, "LineEdit_L2C1" ); - LineEdit_L2C1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEdit_L2C1->sizePolicy().hasHeightForWidth() ) ); - LineEdit_L2C1->setMinimumSize( QSize( 70, 0 ) ); - //LineEdit_L2C1->setEnabled( FALSE ); - LineEdit_L2C1->setReadOnly( TRUE ); - GroupC1Layout->addWidget( LineEdit_L2C1, 2, 2 ); - LineEdit_L2C2 = new QLineEdit( GroupC1, "LineEdit_L2C2" ); - LineEdit_L2C2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEdit_L2C2->sizePolicy().hasHeightForWidth() ) ); - LineEdit_L2C2->setMinimumSize( QSize( 70, 0 ) ); - //LineEdit_L2C2->setEnabled( FALSE ); - LineEdit_L2C2->setReadOnly( TRUE ); - GroupC1Layout->addWidget( LineEdit_L2C2, 2, 3 ); - LineEdit_L2C3 = new QLineEdit( GroupC1, "LineEdit_L2C3" ); - LineEdit_L2C3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEdit_L2C3->sizePolicy().hasHeightForWidth() ) ); - LineEdit_L2C3->setMinimumSize( QSize( 70, 0 ) ); - //LineEdit_L2C3->setEnabled( FALSE ); - LineEdit_L2C3->setReadOnly( TRUE ); - GroupC1Layout->addWidget( LineEdit_L2C3, 2, 4 ); - LineEdit_L3C1 = new QLineEdit( GroupC1, "LineEdit_L3C1" ); - LineEdit_L3C1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEdit_L3C1->sizePolicy().hasHeightForWidth() ) ); - LineEdit_L3C1->setMinimumSize( QSize( 70, 0 ) ); - //LineEdit_L3C1->setEnabled( FALSE ); - LineEdit_L3C1->setReadOnly( TRUE ); - GroupC1Layout->addWidget( LineEdit_L3C1, 3, 2 ); - LineEdit_L3C2 = new QLineEdit( GroupC1, "LineEdit_L3C2" ); - LineEdit_L3C2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEdit_L3C2->sizePolicy().hasHeightForWidth() ) ); - LineEdit_L3C2->setMinimumSize( QSize( 70, 0 ) ); - //LineEdit_L3C2->setEnabled( FALSE ); - LineEdit_L3C2->setReadOnly( TRUE ); - GroupC1Layout->addWidget( LineEdit_L3C2, 3, 3 ); - LineEdit_L3C3 = new QLineEdit( GroupC1, "LineEdit_L3C3" ); - LineEdit_L3C3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEdit_L3C3->sizePolicy().hasHeightForWidth() ) ); - LineEdit_L3C3->setMinimumSize( QSize( 70, 0 ) ); - //LineEdit_L3C3->setEnabled( FALSE ); - LineEdit_L3C3->setReadOnly( TRUE ); - GroupC1Layout->addWidget( LineEdit_L3C3, 3, 4 ); - LineEdit_IX = new QLineEdit( GroupC1, "LineEdit_IX" ); - LineEdit_IX->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEdit_IX->sizePolicy().hasHeightForWidth() ) ); - LineEdit_IX->setMinimumSize( QSize( 70, 0 ) ); - //LineEdit_IX->setEnabled( FALSE ); - LineEdit_IX->setReadOnly( TRUE ); - GroupC1Layout->addWidget( LineEdit_IX, 4, 2 ); - LineEdit_IY = new QLineEdit( GroupC1, "LineEdit_IY" ); - LineEdit_IY->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEdit_IY->sizePolicy().hasHeightForWidth() ) ); - LineEdit_IY->setMinimumSize( QSize( 70, 0 ) ); - //LineEdit_IY->setEnabled( FALSE ); - LineEdit_IY->setReadOnly( TRUE ); - GroupC1Layout->addWidget( LineEdit_IY, 4, 3 ); - LineEdit_IZ = new QLineEdit( GroupC1, "LineEdit_IZ" ); - LineEdit_IZ->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEdit_IZ->sizePolicy().hasHeightForWidth() ) ); - LineEdit_IZ->setMinimumSize( QSize( 70, 0 ) ); - //LineEdit_IZ->setEnabled( FALSE ); - LineEdit_IZ->setReadOnly( TRUE ); - GroupC1Layout->addWidget( LineEdit_IZ, 4, 4 ); - TextLabel_IXIYIZ = new QLabel( GroupC1, "TextLabel_IXIYIZ" ); - TextLabel_IXIYIZ->setText( tr( "GEOM_INERTIA_IXYZ" ) ); - TextLabel_IXIYIZ->setMinimumSize( QSize( 50, 0 ) ); - TextLabel_IXIYIZ->setFrameShape( QLabel::NoFrame ); - TextLabel_IXIYIZ->setFrameShadow( QLabel::Plain ); - TextLabel_IXIYIZ->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); - GroupC1Layout->addMultiCellWidget( TextLabel_IXIYIZ, 4, 4, 0, 1 ); - GeometryGUI_InertiaDlgLayout->addWidget( GroupC1, 1, 0 ); - - /***************************************************************/ - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); - GroupButtons->setTitle( tr( "" ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 1 ); - - QSpacerItem* spacer_8 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_8, 0, 0 ); - QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_9, 0, 2 ); - - GeometryGUI_InertiaDlgLayout->addWidget( GroupButtons, 2, 0 ); - /***************************************************************/ - - Init(Sel) ; /* Initialisations */ -} - - -//================================================================================= -// function : ~GeometryGUI_InertiaDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_InertiaDlg::~GeometryGUI_InertiaDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_InertiaDlg::Init( SALOME_Selection* Sel ) -{ - - LineEdit_L1C1->setMaxLength( 10 ); - LineEdit_L1C2->setMaxLength( 10 ); - LineEdit_L1C3->setMaxLength( 10 ); - LineEdit_L2C1->setMaxLength( 10 ); - LineEdit_L2C2->setMaxLength( 10 ); - LineEdit_L2C3->setMaxLength( 10 ); - LineEdit_L3C1->setMaxLength( 10 ); - LineEdit_L3C2->setMaxLength( 10 ); - LineEdit_L3C3->setMaxLength( 10 ); - - LineEdit_IX->setMaxLength( 10 ); - LineEdit_IY->setMaxLength( 10 ); - LineEdit_IZ->setMaxLength( 10 ); - - myConstructorId = 0 ; - Constructor1->setChecked( TRUE ); - myEditCurrentArgument = LineEditC1A1 ; - mySelection = Sel; - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - - // TODO : previous selection into argument ? - - /* Filter definitions */ - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - - /* signals and slots connections */ - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ; - connect( GroupConstructors, SIGNAL(clicked(int) ), this, SLOT( ConstructorsClicked(int) ) ); - connect( SelectButtonC1A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - - connect( LineEditC1A1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ; - - /* to close dialog if study change */ - connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ; - - /* Move widget on the botton right corner of main widget */ - int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; - this->show() ; /* displays Dialog */ - return ; -} - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_InertiaDlg::ConstructorsClicked(int constructorId) -{ - return ; -} - - - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void GeometryGUI_InertiaDlg::ClickOnCancel() -{ - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->ResetState() ; - reject() ; - return ; -} - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -//================================================================================= -void GeometryGUI_InertiaDlg::SelectionIntoArgument() -{ - LineEdit_L1C1->setText("") ; - LineEdit_L1C2->setText("") ; - LineEdit_L1C3->setText("") ; - LineEdit_L2C1->setText("") ; - LineEdit_L2C2->setText("") ; - LineEdit_L2C3->setText("") ; - LineEdit_L3C1->setText("") ; - LineEdit_L3C2->setText("") ; - LineEdit_L3C3->setText("") ; - - LineEdit_IX->setText("") ; - LineEdit_IY->setText("") ; - LineEdit_IZ->setText("") ; - - myEditCurrentArgument->setText("") ; - QString aString = ""; /* future the name of selection */ - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; - if ( nbSel != 1 ) { - return ; - } - - /* nbSel == 1 */ - TopoDS_Shape S; - if( !myGeomGUI->GetTopoFromSelection(mySelection, S) || S.IsNull() ) - return ; - - LineEditC1A1->setText(aString) ; - this->CalculateAndDisplayInertia(S) ; - return ; -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_InertiaDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - switch (myConstructorId) - { - case 0: /* default constructor */ - { - if(send == SelectButtonC1A1) { - LineEditC1A1->setFocus() ; - myEditCurrentArgument = LineEditC1A1; - } - SelectionIntoArgument() ; - break; - } - } - return ; -} - - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_InertiaDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if( send == LineEditC1A1 ) - myEditCurrentArgument = LineEditC1A1 ; - else - return ; - - /* User name of object input management */ - /* If successfull the selection is changed and signal emitted... */ - /* so SelectionIntoArgument() is automatically called. */ - const QString objectUserName = myEditCurrentArgument->text() ; - QWidget* thisWidget = (QWidget*)this ; - if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) { - myEditCurrentArgument->setText( objectUserName ) ; - } - return ; - return ; -} - - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void GeometryGUI_InertiaDlg::DeactivateActiveDialog() -{ - if ( GroupConstructors->isEnabled() ) { - disconnect( mySelection, 0, this, 0 ); - GroupConstructors->setEnabled(false) ; - GroupC1->setEnabled(false) ; - GroupButtons->setEnabled(false) ; - } - return ; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_InertiaDlg::ActivateThisDialog() -{ - /* Emit a signal to deactivate the active dialog */ - myGeomGUI->EmitSignalDeactivateDialog() ; - GroupConstructors->setEnabled(true) ; - GroupC1->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - return ; -} - - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void GeometryGUI_InertiaDlg::enterEvent(QEvent* e) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; - return ; -} - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_InertiaDlg::closeEvent( QCloseEvent* e ) -{ - /* same than click on cancel button */ - this->ClickOnCancel() ; - return ; -} - - -//================================================================================= -// function : CalculateAndDisplayInertia() -// purpose : -//================================================================================= -void GeometryGUI_InertiaDlg::CalculateAndDisplayInertia(const TopoDS_Shape& S) -{ - LineEdit_L1C1->setText("") ; - LineEdit_L1C2->setText("") ; - LineEdit_L1C3->setText("") ; - LineEdit_L2C1->setText("") ; - LineEdit_L2C2->setText("") ; - LineEdit_L2C3->setText("") ; - LineEdit_L3C1->setText("") ; - LineEdit_L3C2->setText("") ; - LineEdit_L3C3->setText("") ; - - LineEdit_IX->setText("") ; - LineEdit_IY->setText("") ; - LineEdit_IZ->setText("") ; - - - if( S.IsNull() ) - return ; - - try { - - QString resString; - GProp_GProps System; - - if ( S.ShapeType() == TopAbs_VERTEX || S.ShapeType() == TopAbs_EDGE || S.ShapeType() == TopAbs_WIRE ) { - BRepGProp::LinearProperties(S, System); - } - else if ( S.ShapeType() == TopAbs_FACE || S.ShapeType() == TopAbs_SHELL ) { - BRepGProp::SurfaceProperties(S, System); - } - else { - BRepGProp::VolumeProperties(S, System); - } - - gp_Mat I = System.MatrixOfInertia() ; - GProp_PrincipalProps Pr = System.PrincipalProperties(); - Standard_Real Ix,Iy,Iz; - Pr.Moments(Ix,Iy,Iz); - - /* matrix 3x3 */ - resString = tr("%1").arg( I(1,1), 12, 'f', 6 ) ; - LineEdit_L1C1->setText(resString) ; - resString = tr("%1").arg( I(1,2), 12, 'f', 6 ) ; - LineEdit_L1C2->setText(resString) ; - resString = tr("%1").arg( I(1,3), 12, 'f', 6 ) ; - LineEdit_L1C3->setText(resString) ; - - resString = tr("%1").arg( I(2,1), 12, 'f', 6 ) ; - LineEdit_L2C1->setText(resString) ; - resString = tr("%1").arg( I(2,2), 12, 'f', 6 ) ; - LineEdit_L2C2->setText(resString) ; - resString = tr("%1").arg( I(2,3), 12, 'f', 6 ) ; - LineEdit_L2C3->setText(resString) ; - - resString = tr("%1").arg( I(3,1), 12, 'f', 6 ) ; - LineEdit_L3C1->setText(resString) ; - resString = tr("%1").arg( I(3,2), 12, 'f', 6 ) ; - LineEdit_L3C2->setText(resString) ; - resString = tr("%1").arg( I(3,3), 12, 'f', 6 ) ; - LineEdit_L3C3->setText(resString) ; - - /* moments */ - resString = tr("%1").arg( Ix, 12, 'f', 6 ) ; - LineEdit_IX->setText(resString) ; - resString = tr("%1").arg( Ix, 12, 'f', 6 ) ; - LineEdit_IY->setText(resString) ; - resString = tr("%1").arg( Iz, 12, 'f', 6 ) ; - LineEdit_IZ->setText(resString) ; - - } - catch(Standard_Failure) { - MESSAGE("Catch intercepted in CalculateAndDisplayInertia()" << endl ) ; - } - return ; -} - - diff --git a/src/GEOMGUI/GeometryGUI_InertiaDlg.h b/src/GEOMGUI/GeometryGUI_InertiaDlg.h deleted file mode 100644 index c64f81700..000000000 --- a/src/GEOMGUI/GeometryGUI_InertiaDlg.h +++ /dev/null @@ -1,124 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_InertiaDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_INERTIA_H -#define DIALOGBOX_INERTIA_H - -#include "SALOME_Selection.h" -#include "GEOM_ShapeTypeFilter.hxx" - -#include -#include -#include - -#include -#include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QRadioButton; -class GeometryGUI; - - -//================================================================================= -// class : GeometryGUI_InertiaDlg -// purpose : -//================================================================================= -class GeometryGUI_InertiaDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_InertiaDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 ); - ~GeometryGUI_InertiaDlg(); - - void Init( SALOME_Selection* Sel ) ; - void closeEvent( QCloseEvent* e ) ; - void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */ - void CalculateAndDisplayInertia(const TopoDS_Shape& S) ; - - GEOM::GEOM_Gen_var myGeom ; /* Current GeomI object */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - SALOME_Selection* mySelection ; - - int myConstructorId ; /* Current constructor id = radio button id */ - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - - - QButtonGroup* GroupConstructors; - QRadioButton* Constructor1; - QGroupBox* GroupC1; - QLabel* TextLabelC1A1; - QPushButton* SelectButtonC1A1; - QLineEdit* LineEditC1A1; - QLabel* TextLabel_Matrix; - QLabel* TextLabelMatrix_11; - QLabel* TextLabelMatrix_21; - QLabel* TextLabelMatrix_31; - QLineEdit* LineEdit_L1C1; - QLineEdit* LineEdit_L1C2; - QLineEdit* LineEdit_L1C3; - QLineEdit* LineEdit_L2C1; - QLineEdit* LineEdit_L2C2; - QLineEdit* LineEdit_L2C3; - QLineEdit* LineEdit_L3C1; - QLineEdit* LineEdit_L3C2; - QLineEdit* LineEdit_L3C3; - QLineEdit* LineEdit_IX; - QLineEdit* LineEdit_IY; - QLineEdit* LineEdit_IZ; - QLabel* TextLabel_IXIYIZ; - QGroupBox* GroupButtons; - QPushButton* buttonApply; - QPushButton* buttonOk; - QPushButton* buttonCancel; - -private slots: - - void ConstructorsClicked(int constructorId); - void ClickOnCancel(); - void SetEditCurrentArgument() ; - void LineEditReturnPressed() ; - void SelectionIntoArgument() ; - void DeactivateActiveDialog() ; - void ActivateThisDialog() ; - -protected: - QGridLayout* GeometryGUI_InertiaDlgLayout; - QGridLayout* GroupConstructorsLayout; - QGridLayout* GroupC1Layout; - QGridLayout* GroupButtonsLayout; -}; - -#endif // DIALOGBOX_INERTIA_H diff --git a/src/GEOMGUI/GeometryGUI_LineDlg.cxx b/src/GEOMGUI/GeometryGUI_LineDlg.cxx deleted file mode 100644 index c943a303d..000000000 --- a/src/GEOMGUI/GeometryGUI_LineDlg.cxx +++ /dev/null @@ -1,518 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_LineDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_LineDlg.h" - -#include "GeometryGUI.h" - -#include - -#include "QAD_Application.h" -#include "QAD_Desktop.h" -#include "utilities.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -//================================================================================= -// class : GeometryGUI_LineDlg() -// purpose : Constructs a GeometryGUI_LineDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_LineDlg::GeometryGUI_LineDlg( QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_LINE_2P"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_LINE_PV"))); - QPixmap image3(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_LINE_EDGE"))); - - if ( !name ) - setName( "GeometryGUI_LineDlg" ); - resize( 303, 225 ); - setCaption( tr( "GEOM_LINE_TITLE" ) ); - setSizeGripEnabled( TRUE ); - GeometryGUI_LineDlgLayout = new QGridLayout( this ); - GeometryGUI_LineDlgLayout->setSpacing( 6 ); - GeometryGUI_LineDlgLayout->setMargin( 11 ); - - /***************************************************************/ - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "GEOM_LINE" ) ); - GroupConstructors->setExclusive( TRUE ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setText( tr( "" ) ); - Constructor1->setPixmap( image0 ); - Constructor1->setChecked( TRUE ); - Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) ); - Constructor1->setMinimumSize( QSize( 50, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - - QSpacerItem* spacer_3 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer_3, 0, 5 ); - GeometryGUI_LineDlgLayout->addWidget( GroupConstructors, 0, 0 ); - - /***************************************************************/ - GroupC1 = new QGroupBox( this, "GroupC1" ); - GroupC1->setTitle( tr( "GEOM_POINTS" ) ); - GroupC1->setMinimumSize( QSize( 0, 0 ) ); - GroupC1->setFrameShape( QGroupBox::Box ); - GroupC1->setFrameShadow( QGroupBox::Sunken ); - GroupC1->setColumnLayout(0, Qt::Vertical ); - GroupC1->layout()->setSpacing( 0 ); - GroupC1->layout()->setMargin( 0 ); - GroupC1Layout = new QGridLayout( GroupC1->layout() ); - GroupC1Layout->setAlignment( Qt::AlignTop ); - GroupC1Layout->setSpacing( 6 ); - GroupC1Layout->setMargin( 11 ); - SelectButtonC1A2 = new QPushButton( GroupC1, "SelectButtonC1A2" ); - SelectButtonC1A2->setText( tr( "" ) ); - SelectButtonC1A2->setPixmap( image1 ); - GroupC1Layout->addWidget( SelectButtonC1A2, 1, 1 ); - LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" ); - GroupC1Layout->addWidget( LineEditC1A1, 0, 2 ); - LineEditC1A2 = new QLineEdit( GroupC1, "LineEditC1A2" ); - GroupC1Layout->addWidget( LineEditC1A2, 1, 2 ); - SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" ); - SelectButtonC1A1->setText( tr( "" ) ); - SelectButtonC1A1->setPixmap( image1 ); - SelectButtonC1A1->setToggleButton( FALSE ); - GroupC1Layout->addWidget( SelectButtonC1A1, 0, 1 ); - TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" ); - TextLabelC1A1->setText( tr( "GEOM_POINT_I" ).arg("1") ); - TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A1->setFrameShape( QLabel::NoFrame ); - TextLabelC1A1->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabelC1A1, 0, 0 ); - TextLabelC1A2 = new QLabel( GroupC1, "TextLabelC1A2" ); - TextLabelC1A2->setText( tr( "GEOM_POINT_I" ).arg("2") ); - TextLabelC1A2->setMinimumSize( QSize( 50, 0 ) ); - GroupC1Layout->addWidget( TextLabelC1A2, 1, 0 ); - GeometryGUI_LineDlgLayout->addWidget( GroupC1, 1, 0 ); - - /***************************************************************/ - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); - GroupButtons->setTitle( tr( "" ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 3 ); - buttonApply = new QPushButton( GroupButtons, "buttonApply" ); - buttonApply->setText( tr( "GEOM_BUT_APPLY" ) ); - buttonApply->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonApply, 0, 1 ); - QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_9, 0, 2 ); - buttonOk = new QPushButton( GroupButtons, "buttonOk" ); - buttonOk->setText( tr( "GEOM_BUT_OK" ) ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - GeometryGUI_LineDlgLayout->addWidget( GroupButtons, 2, 0 ); - - Init(Sel) ; /* Initialisations */ -} - - -//================================================================================= -// function : ~GeometryGUI_LineDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_LineDlg::~GeometryGUI_LineDlg() -{ - /* no need to delete child widgets, Qt does it all for us */ -} - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_LineDlg::Init( SALOME_Selection* Sel ) -{ - - GroupC1->show(); - // GroupC2->hide(); - // GroupC3->hide(); - myConstructorId = 0 ; - Constructor1->setChecked( TRUE ); - myEditCurrentArgument = LineEditC1A1 ; - mySelection = Sel; - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - myPoint1.SetCoord( 0.0, 0.0, 0.0 ); - myPoint2.SetCoord( 0.0, 0.0, 0.0 ); - myOkPoint1 = myOkPoint2 = false ; - mySimulationTopoDs.Nullify() ; - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - - // TODO : previous selection into argument ? - - /* Filters definition */ - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - myVertexFilter = new GEOM_ShapeTypeFilter( TopAbs_VERTEX, myGeom ); - myEdgeFilter = new GEOM_ShapeTypeFilter( TopAbs_EDGE, myGeom ); - mySelection->AddFilter(myVertexFilter) ; /* first filter used */ - - /* signals and slots connections */ - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ; - connect( buttonApply, SIGNAL( clicked() ), this, SLOT(ClickOnApply() ) ); - connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) ); - connect( SelectButtonC1A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( SelectButtonC1A2, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - - connect( LineEditC1A1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - connect( LineEditC1A2, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - - connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ; - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - /* to close dialog if study change */ - connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ; - - /* Move widget on the botton right corner of main widget */ - int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; - this->show() ; /* displays Dialog */ - - return ; -} - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_LineDlg::ConstructorsClicked(int constructorId) -{ - myGeomGUI->EraseSimulationShape() ; - - switch (constructorId) - { - case 0: - { - GroupC1->show(); - // - // - myConstructorId = constructorId ; - myEditCurrentArgument = LineEditC1A1 ; - Constructor1->setChecked( TRUE ); - LineEditC1A1->setText(tr("")) ; - LineEditC1A2->setText(tr("")) ; - myOkPoint1 = myOkPoint2 = false ; - /* filter for next selections */ - mySelection->ClearFilters() ; - mySelection->AddFilter( myVertexFilter ); - connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - break; - } - case 1: - { - break; - } - case 2: - { - break; - } - } - return ; -} - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_LineDlg::ClickOnOk() -{ - this->ClickOnApply() ; - this->ClickOnCancel() ; - - return ; -} - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_LineDlg::ClickOnApply() -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - switch(myConstructorId) - { - case 0 : - { - if(myOkPoint1 && myOkPoint2) - myGeomGUI->MakeLineAndDisplay( myPoint1, myPoint2 ) ; - break ; - } - case 1 : - { - break ; - } - case 2 : - { - break ; - } - } - // accept(); - return ; -} - - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void GeometryGUI_LineDlg::ClickOnCancel() -{ - mySelection->ClearFilters() ; - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->ResetState() ; - reject() ; - return ; -} - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_LineDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender() ; - if( send == LineEditC1A1 ) - myEditCurrentArgument = LineEditC1A1 ; - else if ( send == LineEditC1A2 ) - myEditCurrentArgument = LineEditC1A2 ; - else - return ; - - /* User name of object input management */ - /* If successfull the selection is changed and signal emitted... */ - /* so SelectionIntoArgument() is automatically called. */ - const QString objectUserName = myEditCurrentArgument->text() ; - QWidget* thisWidget = (QWidget*)this ; - if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) { - myEditCurrentArgument->setText( objectUserName ) ; - } - return ; -} - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -//================================================================================= -void GeometryGUI_LineDlg::SelectionIntoArgument() -{ - - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - QString aString = ""; /* name of selection */ - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; - if ( nbSel != 1 ) { - if ( myEditCurrentArgument == LineEditC1A1 ) { - myEditCurrentArgument->setText("") ; - myOkPoint1 = false ; - } - else if ( myEditCurrentArgument == LineEditC1A2 ) { - myEditCurrentArgument->setText("") ; - myOkPoint2 = false ; - } - return ; - } - - // nbSel == 1 ! - TopoDS_Shape S; - if( !myGeomGUI->GetTopoFromSelection(mySelection, S) ) - return ; - - /* Constructor 1 treatment */ - if ( myConstructorId == 0 && myEditCurrentArgument == LineEditC1A1 && myGeomGUI->VertexToPoint(S, myPoint1) ) { - myEditCurrentArgument->setText(aString) ; - myOkPoint1 = true ; - } - else if ( myConstructorId == 0 && myEditCurrentArgument == LineEditC1A2 && myGeomGUI->VertexToPoint(S, myPoint2) ) { - myEditCurrentArgument->setText(aString) ; - myOkPoint2 = true ; - } - - if( myOkPoint1 && myOkPoint2 && myPoint1.Distance(myPoint2) > Precision::Confusion() ) { - mySimulationTopoDs = BRepBuilderAPI_MakeEdge( myPoint1, myPoint2 ).Shape(); - /* Try to add an arrow at simulation shape */ - bool notNeedToTest = this->AddArrowToSimulation(mySimulationTopoDs) ; - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - } - return ; -} - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_LineDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - mySelection->ClearFilters() ; - switch (myConstructorId) - { - case 0: /* default constructor */ - { - if(send == SelectButtonC1A1) { - LineEditC1A1->setFocus() ; - myEditCurrentArgument = LineEditC1A1; - } - else if(send == SelectButtonC1A2) { - LineEditC1A2->setFocus() ; - myEditCurrentArgument = LineEditC1A2; - } - mySelection->AddFilter(myVertexFilter) ; - SelectionIntoArgument() ; - break; - } - } - return ; -} - - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void GeometryGUI_LineDlg::DeactivateActiveDialog() -{ - if ( GroupConstructors->isEnabled() ) { - GroupConstructors->setEnabled(false) ; - GroupC1->setEnabled(false) ; - GroupButtons->setEnabled(false) ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->EraseSimulationShape() ; - mySelection->ClearFilters() ; - } - return ; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_LineDlg::ActivateThisDialog() -{ - /* Emit a signal to deactivate the active dialog */ - myGeomGUI->EmitSignalDeactivateDialog() ; - GroupConstructors->setEnabled(true) ; - GroupC1->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - - connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - if( !mySimulationTopoDs.IsNull() ) - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - - return ; -} - - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void GeometryGUI_LineDlg::enterEvent(QEvent* e) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; -} - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_LineDlg::closeEvent( QCloseEvent* e ) -{ - this->ClickOnCancel() ; /* same than click on cancel button */ -} - -//================================================================================= -// function : AddArrowToSimulation() -// purpose : An arrow (cone topology) is added to 'modifiedShape' -// : to simulate a vector or an 'oriented line' display. The result is in 'modifiedShape'. -// : If an arrow can't be added returns false and 'modifiedShape' isn't modified ! -//================================================================================= -bool GeometryGUI_LineDlg::AddArrowToSimulation( TopoDS_Shape& modifiedShape ) -{ - TopoDS_Shape arrow ; - /* Try to add a cone simulation shape to show direction of a linear edge */ - if( myGeomGUI->CreateArrowForLinearEdge( modifiedShape, arrow ) ) { - TopoDS_Compound Comp ; - BRep_Builder B; - B.MakeCompound (Comp); - B.Add( Comp, modifiedShape ) ; - B.Add( Comp, arrow ) ; - modifiedShape = Comp ; - return true ; - } - return false ; -} - diff --git a/src/GEOMGUI/GeometryGUI_LineDlg.h b/src/GEOMGUI/GeometryGUI_LineDlg.h deleted file mode 100644 index 830ccdc28..000000000 --- a/src/GEOMGUI/GeometryGUI_LineDlg.h +++ /dev/null @@ -1,125 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_LineDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_LINE_H -#define DIALOGBOX_LINE_H - -#include "SALOME_Selection.h" -#include "GEOM_ShapeTypeFilter.hxx" - -#include -#include -#include -#include - -#include -#include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QRadioButton; -class GeometryGUI; - -//================================================================================= -// class : GeometryGUI_LineDlg -// purpose : -//================================================================================= -class GeometryGUI_LineDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_LineDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 ); - ~GeometryGUI_LineDlg(); - -private : - - GEOM::GEOM_Gen_var myGeom ; /* Current Geom object */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - TopoDS_Shape mySimulationTopoDs; /* Shape used for simulation display */ - SALOME_Selection* mySelection ; /* User shape selection */ - gp_Pnt myPoint1 ; /* Points containing the vector */ - gp_Pnt myPoint2 ; - - bool myOkPoint1 ; /* Are true when myPoint is defined */ - bool myOkPoint2 ; - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - int myConstructorId ; /* Current constructor id = radio button id */ - Handle(GEOM_ShapeTypeFilter) myVertexFilter; /* Filter selection */ - Handle(GEOM_ShapeTypeFilter) myEdgeFilter; /* Filter selection */ - - void closeEvent( QCloseEvent* e ) ; - void enterEvent( QEvent* e); - void Init( SALOME_Selection* Sel ) ; - - bool AddArrowToSimulation( TopoDS_Shape& modifiedShape ) ; - - QButtonGroup* GroupConstructors; - QRadioButton* Constructor1; - QRadioButton* Constructor2; - QRadioButton* Constructor3; - - QGroupBox* GroupC1; - QLabel* TextLabelC1A1; - QPushButton* SelectButtonC1A2; - QLineEdit* LineEditC1A1; - QLabel* TextLabelC1A2; - QLineEdit* LineEditC1A2; - QPushButton* SelectButtonC1A1; - - QGroupBox* GroupButtons; - QPushButton* buttonOk; - QPushButton* buttonCancel; - QPushButton* buttonApply; - -private slots: - - void ConstructorsClicked(int constructorId); - void ClickOnOk(); - void ClickOnCancel(); - void ClickOnApply(); - void SetEditCurrentArgument() ; - void LineEditReturnPressed() ; - void SelectionIntoArgument() ; - void DeactivateActiveDialog() ; - void ActivateThisDialog() ; - -protected: - QGridLayout* GeometryGUI_LineDlgLayout; - QGridLayout* GroupConstructorsLayout; - QGridLayout* GroupC1Layout; - QGridLayout* GroupButtonsLayout; -}; - -#endif // DIALOGBOX_LINE_H diff --git a/src/GEOMGUI/GeometryGUI_MaxToleranceDlg.cxx b/src/GEOMGUI/GeometryGUI_MaxToleranceDlg.cxx deleted file mode 100644 index 5b60d9df3..000000000 --- a/src/GEOMGUI/GeometryGUI_MaxToleranceDlg.cxx +++ /dev/null @@ -1,547 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_MaxToleranceDlg.cxx -// Author : Nicolas REJNERI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_MaxToleranceDlg.h" - -#include "GeometryGUI.h" -#include "QAD_Application.h" -#include "QAD_Desktop.h" -#include "utilities.h" - -// Open CASCADE Includes -#include -#include - -// QT Includes -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - - -//================================================================================= -// class : GeometryGUI_MaxToleranceDlg() -// purpose : Constructs a GeometryGUI_MaxToleranceDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_MaxToleranceDlg::GeometryGUI_MaxToleranceDlg( QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_TOLERANCE"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - - if ( !name ) - setName( "GeometryGUI_MaxToleranceDlg" ); - resize( 303, 275 ); - setCaption( tr( "GEOM_TOLERANCE_TITLE" ) ); - setSizeGripEnabled( TRUE ); - GeometryGUI_MaxToleranceDlgLayout = new QGridLayout( this ); - GeometryGUI_MaxToleranceDlgLayout->setSpacing( 6 ); - GeometryGUI_MaxToleranceDlgLayout->setMargin( 11 ); - - /***************************************************************/ - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "GEOM_TOLERANCE" ) ); - GroupConstructors->setExclusive( TRUE ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setText( tr( "" ) ); - Constructor1->setPixmap( image0 ); - Constructor1->setChecked( TRUE ); - Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, - Constructor1->sizePolicy().hasHeightForWidth() ) ); - Constructor1->setMinimumSize( QSize( 60, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer, 0, 1 ); - GeometryGUI_MaxToleranceDlgLayout->addWidget( GroupConstructors, 0, 0 ); - - /***************************************************************/ - GroupConstructor1 = new QGroupBox( this, "GroupConstructor1" ); - GroupConstructor1->setTitle( tr( "GEOM_TOLERANCE_CONSTR" ) ); - GroupConstructor1->setColumnLayout(0, Qt::Vertical ); - GroupConstructor1->layout()->setSpacing( 0 ); - GroupConstructor1->layout()->setMargin( 0 ); - GroupConstructor1Layout = new QGridLayout( GroupConstructor1->layout() ); - GroupConstructor1Layout->setAlignment( Qt::AlignTop ); - GroupConstructor1Layout->setSpacing( 6 ); - GroupConstructor1Layout->setMargin( 11 ); - - LineEditC1A1 = new QLineEdit( GroupConstructor1, "LineEditC1A1" ); - LineEditC1A1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC1A1->sizePolicy().hasHeightForWidth() ) ); -// GroupConstructor1Layout->addWidget( LineEditC1A1, 0, 2 ); - SelectButtonC1A1 = new QPushButton( GroupConstructor1, "SelectButtonC1A1" ); - SelectButtonC1A1->setText( tr( "" ) ); - SelectButtonC1A1->setPixmap( image1 ); -// GroupConstructor1Layout->addWidget( SelectButtonC1A1, 0, 1 ); - TextLabelC1A1 = new QLabel( GroupConstructor1, "TextLabelC1A1" ); - TextLabelC1A1->setText( tr( "GEOM_OBJECT" ) ); - TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A1->setFrameShape( QLabel::NoFrame ); - TextLabelC1A1->setFrameShadow( QLabel::Plain ); -// GroupConstructor1Layout->addWidget( TextLabelC1A1, 0, 0 ); - - QHBoxLayout* bl = new QHBoxLayout; - bl->setMargin(0); bl->setSpacing(6); - bl->addWidget(TextLabelC1A1); bl->addWidget(SelectButtonC1A1); bl->addWidget(LineEditC1A1); - GroupConstructor1Layout->addMultiCellLayout(bl, 0, 0, 0, 2); - - TextLabel_Min = new QLabel( GroupConstructor1, "TextLabel_Min" ); - TextLabel_Min->setText( tr( "GEOM_MIN" ) ); - TextLabel_Min->setMinimumSize( QSize( 50, 0 ) ); - TextLabel_Min->setFrameShape( QLabel::NoFrame ); - TextLabel_Min->setFrameShadow( QLabel::Plain ); - GroupConstructor1Layout->addWidget( TextLabel_Min, 1, 1 ); - - TextLabel_Max = new QLabel( GroupConstructor1, "TextLabel_Max" ); - TextLabel_Max->setText( tr( "GEOM_MAX" ) ); - TextLabel_Max->setMinimumSize( QSize( 50, 0 ) ); - TextLabel_Max->setFrameShape( QLabel::NoFrame ); - TextLabel_Max->setFrameShadow( QLabel::Plain ); - GroupConstructor1Layout->addWidget( TextLabel_Max, 1, 2 ); - - TextLabel_Face = new QLabel( GroupConstructor1, "TextLabel_Face" ); - TextLabel_Face->setText( tr( "GEOM_TOLERANCE_FACE" ) ); - TextLabel_Face->setMinimumSize( QSize( 50, 0 ) ); - TextLabel_Face->setFrameShape( QLabel::NoFrame ); - TextLabel_Face->setFrameShadow( QLabel::Plain ); - GroupConstructor1Layout->addWidget( TextLabel_Face, 2, 0 ); - LineEdit_MinFace = new QLineEdit( GroupConstructor1, "LineEdit_MinFace" ); - LineEdit_MinFace->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, - LineEdit_MinFace->sizePolicy().hasHeightForWidth() ) ); - //LineEdit_MinFace->setEnabled( FALSE ); - LineEdit_MinFace->setReadOnly( TRUE ); - GroupConstructor1Layout->addWidget( LineEdit_MinFace, 2, 1 ); - LineEdit_MaxFace = new QLineEdit( GroupConstructor1, "LineEdit_MaxFace" ); - LineEdit_MaxFace->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, - LineEdit_MaxFace->sizePolicy().hasHeightForWidth() ) ); - //LineEdit_MaxFace->setEnabled( FALSE ); - LineEdit_MaxFace->setReadOnly( TRUE ); - GroupConstructor1Layout->addWidget( LineEdit_MaxFace, 2, 2 ); - - TextLabel_Edge = new QLabel( GroupConstructor1, "TextLabel_Edge" ); - TextLabel_Edge->setText( tr( "GEOM_TOLERANCE_EDGE" ) ); - TextLabel_Edge->setMinimumSize( QSize( 50, 0 ) ); - TextLabel_Edge->setFrameShape( QLabel::NoFrame ); - TextLabel_Edge->setFrameShadow( QLabel::Plain ); - GroupConstructor1Layout->addWidget( TextLabel_Edge, 3, 0 ); - LineEdit_MinEdge = new QLineEdit( GroupConstructor1, "LineEdit_MinEdge" ); - LineEdit_MinEdge->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, - LineEdit_MinEdge->sizePolicy().hasHeightForWidth() ) ); - //LineEdit_MinEdge->setEnabled( FALSE ); - LineEdit_MinEdge->setReadOnly( TRUE ); - GroupConstructor1Layout->addWidget( LineEdit_MinEdge, 3, 1 ); - LineEdit_MaxEdge = new QLineEdit( GroupConstructor1, "LineEdit_MaxEdge" ); - LineEdit_MaxEdge->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, - LineEdit_MaxEdge->sizePolicy().hasHeightForWidth() ) ); - //LineEdit_MaxEdge->setEnabled( FALSE ); - LineEdit_MaxEdge->setReadOnly( TRUE ); - GroupConstructor1Layout->addWidget( LineEdit_MaxEdge, 3, 2 ); - - TextLabel_Vertex = new QLabel( GroupConstructor1, "TextLabel_Vertex" ); - TextLabel_Vertex->setText( tr( "GEOM_TOLERANCE_VERTEX" ) ); - TextLabel_Vertex->setMinimumSize( QSize( 50, 0 ) ); - TextLabel_Vertex->setFrameShape( QLabel::NoFrame ); - TextLabel_Vertex->setFrameShadow( QLabel::Plain ); - GroupConstructor1Layout->addWidget( TextLabel_Vertex, 4, 0 ); - LineEdit_MinVertex = new QLineEdit( GroupConstructor1, "LineEdit_MinVertex" ); - LineEdit_MinVertex->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, - LineEdit_MinVertex->sizePolicy().hasHeightForWidth() ) ); - //LineEdit_MinVertex->setEnabled( FALSE ); - LineEdit_MinVertex->setReadOnly( TRUE ); - GroupConstructor1Layout->addWidget( LineEdit_MinVertex, 4, 1 ); - LineEdit_MaxVertex = new QLineEdit( GroupConstructor1, "LineEdit_MaxVertex" ); - LineEdit_MaxVertex->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, - LineEdit_MaxVertex->sizePolicy().hasHeightForWidth() ) ); - //LineEdit_MaxVertex->setEnabled( FALSE ); - LineEdit_MaxVertex->setReadOnly( TRUE ); - GroupConstructor1Layout->addWidget( LineEdit_MaxVertex, 4, 2 ); - - GeometryGUI_MaxToleranceDlgLayout->addWidget( GroupConstructor1, 1, 0 ); - - /***************************************************************/ - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); - GroupButtons->setTitle( tr( "" ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 1 ); - // buttonApply = new QPushButton( GroupButtons, "buttonApply" ); -// buttonApply->setText( tr( "GEOM_BUT_APPLY" ) ); -// buttonApply->setAutoDefault( TRUE ); -// GroupButtonsLayout->addWidget( buttonApply, 0, 1 ); - QSpacerItem* spacer_8 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_8, 0, 0 ); - QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_9, 0, 2 ); -// buttonOk = new QPushButton( GroupButtons, "buttonOk" ); -// buttonOk->setText( tr( "GEOM_BUT_OK" ) ); -// buttonOk->setAutoDefault( TRUE ); -// buttonOk->setDefault( TRUE ); -// GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - GeometryGUI_MaxToleranceDlgLayout->addWidget( GroupButtons, 2, 0 ); - /***************************************************************/ - - Init(Sel) ; /* Initialisations */ -} - - -//================================================================================= -// function : ~GeometryGUI_MaxToleranceDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_MaxToleranceDlg::~GeometryGUI_MaxToleranceDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_MaxToleranceDlg::Init( SALOME_Selection* Sel ) -{ - myConstructorId = 0 ; - Constructor1->setChecked( TRUE ); - myEditCurrentArgument = LineEditC1A1 ; - mySelection = Sel; - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - - // TODO : previous selection into argument ? - - /* Filter definitions */ - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - - /* signals and slots connections */ - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ; - connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) ); - connect( SelectButtonC1A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - - connect( LineEditC1A1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - - connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ; - /* to close dialog if study change */ - connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ; - - /* Move widget on the botton right corner of main widget */ - int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; - this->show() ; /* displays Dialog */ - return ; -} - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_MaxToleranceDlg::ConstructorsClicked(int constructorId) -{ - return ; -} - - - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void GeometryGUI_MaxToleranceDlg::ClickOnCancel() -{ - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->ResetState() ; - reject() ; - return ; -} - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -//================================================================================= -void GeometryGUI_MaxToleranceDlg::SelectionIntoArgument() -{ - LineEdit_MinFace->setText("") ; - LineEdit_MinEdge->setText("") ; - LineEdit_MinVertex->setText("") ; - LineEdit_MaxFace->setText("") ; - LineEdit_MaxEdge->setText("") ; - LineEdit_MaxVertex->setText("") ; - myEditCurrentArgument->setText("") ; - - QString aString = ""; /* future the name of selection */ - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; - if ( nbSel != 1 ) { - return ; - } - - /* nbSel == 1 */ - TopoDS_Shape S; - if( !myGeomGUI->GetTopoFromSelection(mySelection, S) ) - return ; - - if( S.IsNull() ) { - myEditCurrentArgument->setText( "" ); - return ; - } - - LineEditC1A1->setText(aString) ; - this->CalculateMaxTolerance(S) ; - - return ; -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_MaxToleranceDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - switch (myConstructorId) - { - case 0: /* default constructor */ - { - if(send == SelectButtonC1A1) { - LineEditC1A1->setFocus() ; - myEditCurrentArgument = LineEditC1A1; - } - SelectionIntoArgument() ; - break; - } - } - return ; -} - - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_MaxToleranceDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if( send == LineEditC1A1 ) - myEditCurrentArgument = LineEditC1A1 ; - else - return ; - - /* User name of object input management */ - /* If successfull the selection is changed and signal emitted... */ - /* so SelectionIntoArgument() is automatically called. */ - const QString objectUserName = myEditCurrentArgument->text() ; - QWidget* thisWidget = (QWidget*)this ; - if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) { - myEditCurrentArgument->setText( objectUserName ) ; - } - return ; -} - - - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void GeometryGUI_MaxToleranceDlg::DeactivateActiveDialog() -{ - if ( GroupConstructors->isEnabled() ) { - disconnect( mySelection, 0, this, 0 ); - GroupConstructors->setEnabled(false) ; - GroupConstructor1->setEnabled(false) ; - GroupButtons->setEnabled(false) ; - } - return ; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_MaxToleranceDlg::ActivateThisDialog() -{ - /* Emit a signal to deactivate the active dialog */ - myGeomGUI->EmitSignalDeactivateDialog() ; - GroupConstructors->setEnabled(true) ; - GroupConstructor1->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - return ; -} - - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void GeometryGUI_MaxToleranceDlg::enterEvent(QEvent* e) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; - return ; -} - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_MaxToleranceDlg::closeEvent( QCloseEvent* e ) -{ - /* same than click on cancel button */ - this->ClickOnCancel() ; - return ; -} - - -//================================================================================= -// function : CalculateMaxTolerance() -// purpose : -//================================================================================= -void GeometryGUI_MaxToleranceDlg::CalculateMaxTolerance(const TopoDS_Shape& S) -{ - LineEdit_MinFace->setText("") ; - LineEdit_MinEdge->setText("") ; - LineEdit_MinVertex->setText("") ; - LineEdit_MaxFace->setText("") ; - LineEdit_MaxEdge->setText("") ; - LineEdit_MaxVertex->setText("") ; - if( S.IsNull() ) - return ; - - Standard_Real T,TMF,TME,TMV,TmF,TmE,TmV; - Standard_Integer nbF,nbE,nbV; - TMF=TME=TMV=-RealLast(); - TmF=TmE=TmV=RealLast(); - nbF=nbE=nbV=0; - - bool m_isFace = false; - bool m_isEdge = false; - bool m_isVertex = false; - try - { - for( TopExp_Explorer ExF(S,TopAbs_FACE); ExF.More(); ExF.Next() ) - { - m_isFace = true; - TopoDS_Face Face=TopoDS::Face(ExF.Current()); - T=BRep_Tool::Tolerance(Face); - if(T>TMF) TMF=T; - if(TTME) TME=T; - if(TTMV) TMV=T; - if(TsetText( tr("%1").arg( TmF, 5, 'e', 8 ) ) ; - LineEdit_MaxFace->setText( tr("%1").arg( TMF, 5, 'e', 8 ) ) ; - } - else - { - LineEdit_MinFace->setText( "" ) ; - LineEdit_MaxFace->setText( "" ) ; - } - if (m_isEdge) - { - LineEdit_MinEdge->setText( tr("%1").arg( TmE, 5, 'e', 8 ) ) ; - LineEdit_MaxEdge->setText( tr("%1").arg( TME, 5, 'e', 8 ) ) ; - } - else - { - LineEdit_MinEdge->setText( "" ) ; - LineEdit_MaxEdge->setText( "" ) ; - } - if (m_isVertex) - { - LineEdit_MinVertex->setText( tr("%1").arg( TmV, 5, 'e', 8 ) ) ; - LineEdit_MaxVertex->setText( tr("%1").arg( TMV, 5, 'e', 8 ) ) ; - } - else - { - LineEdit_MinVertex->setText( "" ) ; - LineEdit_MaxVertex->setText( "" ) ; - } - } - catch(Standard_Failure) - { - MESSAGE("Catch intercepted in CalculateMaxTolerance()" << endl ) ; - } - return ; -} diff --git a/src/GEOMGUI/GeometryGUI_MaxToleranceDlg.h b/src/GEOMGUI/GeometryGUI_MaxToleranceDlg.h deleted file mode 100644 index 7da3e4111..000000000 --- a/src/GEOMGUI/GeometryGUI_MaxToleranceDlg.h +++ /dev/null @@ -1,119 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_MaxToleranceDlg.h -// Author : Nicolas REJNERI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_MAXTOLERANCE_H -#define DIALOGBOX_MAXTOLERANCE_H - -#include "SALOME_Selection.h" -#include "GEOM_ShapeTypeFilter.hxx" - -#include -#include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QRadioButton; -class GeometryGUI; - -//================================================================================= -// class : DialogBox_PROPERTIES -// purpose : -//================================================================================= -class GeometryGUI_MaxToleranceDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_MaxToleranceDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 ); - ~GeometryGUI_MaxToleranceDlg(); - -private: - - void Init( SALOME_Selection* Sel ) ; - void closeEvent( QCloseEvent* e ) ; - void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */ - void CalculateMaxTolerance(const TopoDS_Shape& S) ; - - GEOM::GEOM_Gen_var myGeom ; /* Current GeomI object */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - SALOME_Selection* mySelection ; /* User shape selection */ - - int myConstructorId ; /* Current constructor id = radio button id */ - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - - QButtonGroup* GroupConstructors; - QRadioButton* Constructor1; - QGroupBox* GroupConstructor1; - QLineEdit* LineEditC1A1; - QPushButton* SelectButtonC1A1; - QLabel* TextLabelC1A1; - - QLabel* TextLabel_Min; - QLabel* TextLabel_Max; - - QLabel* TextLabel_Face; - QLabel* TextLabel_Edge; - QLabel* TextLabel_Vertex; - - QLineEdit* LineEdit_MinFace; - QLineEdit* LineEdit_MinEdge; - QLineEdit* LineEdit_MinVertex; - - QLineEdit* LineEdit_MaxFace; - QLineEdit* LineEdit_MaxEdge; - QLineEdit* LineEdit_MaxVertex; - - QGroupBox* GroupButtons; - QPushButton* buttonApply; - QPushButton* buttonOk; - QPushButton* buttonCancel; - -private slots: - - void ConstructorsClicked(int constructorId); - void ClickOnCancel(); - void SetEditCurrentArgument() ; - void LineEditReturnPressed() ; - void SelectionIntoArgument() ; - void DeactivateActiveDialog() ; - void ActivateThisDialog() ; - -protected: - QGridLayout* GeometryGUI_MaxToleranceDlgLayout; - QGridLayout* GroupConstructorsLayout; - QGridLayout* GroupConstructor1Layout; - QGridLayout* GroupButtonsLayout; -}; - -#endif // DIALOGBOX_MAXTOLERANCE_H diff --git a/src/GEOMGUI/GeometryGUI_MirrorDlg.cxx b/src/GEOMGUI/GeometryGUI_MirrorDlg.cxx deleted file mode 100644 index ccfc924c3..000000000 --- a/src/GEOMGUI/GeometryGUI_MirrorDlg.cxx +++ /dev/null @@ -1,525 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_MirrorDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_MirrorDlg.h" - -#include "GeometryGUI.h" - -#include "QAD_Application.h" -#include "QAD_Desktop.h" -#include "utilities.h" - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - - - -//================================================================================= -// class : GeometryGUI_MirrorDlg() -// purpose : Constructs a GeometryGUI_MirrorDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_MirrorDlg::GeometryGUI_MirrorDlg( QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_MIRROR"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - - if ( !name ) - setName( "GeometryGUI_MirrorDlg" ); - resize( 303, 225 ); - setCaption( tr( "GEOM_MIRROR_TITLE" ) ); - setSizeGripEnabled( TRUE ); - GeometryGUI_MirrorDlgLayout = new QGridLayout( this ); - GeometryGUI_MirrorDlgLayout->setSpacing( 6 ); - GeometryGUI_MirrorDlgLayout->setMargin( 11 ); - - /***************************************************************/ - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); - GroupButtons->setTitle( tr( "" ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 3 ); - buttonApply = new QPushButton( GroupButtons, "buttonApply" ); - buttonApply->setText( tr( "GEOM_BUT_APPLY" ) ); - buttonApply->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonApply, 0, 1 ); - QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_9, 0, 2 ); - buttonOk = new QPushButton( GroupButtons, "buttonOk" ); - buttonOk->setText( tr( "GEOM_BUT_OK" ) ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - - GeometryGUI_MirrorDlgLayout->addWidget( GroupButtons, 2, 0 ); - - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "GEOM_MIRROR" ) ); - GroupConstructors->setExclusive( TRUE ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer_2, 0, 1 ); - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setText( tr( "" ) ); - Constructor1->setPixmap( image0 ); - Constructor1->setChecked( TRUE ); - Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) ); - Constructor1->setMinimumSize( QSize( 50, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - GeometryGUI_MirrorDlgLayout->addWidget( GroupConstructors, 0, 0 ); - - /***************************************************************/ - GroupC1 = new QGroupBox( this, "GroupC1" ); - GroupC1->setTitle( tr( "GEOM_ARGUMENTS" ) ); - GroupC1->setColumnLayout(0, Qt::Vertical ); - GroupC1->layout()->setSpacing( 0 ); - GroupC1->layout()->setMargin( 0 ); - GroupC1Layout = new QGridLayout( GroupC1->layout() ); - GroupC1Layout->setAlignment( Qt::AlignTop ); - GroupC1Layout->setSpacing( 6 ); - GroupC1Layout->setMargin( 11 ); - TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" ); - TextLabelC1A1->setText( tr( "GEOM_OBJECT" ) ); - TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A1->setFrameShape( QLabel::NoFrame ); - TextLabelC1A1->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabelC1A1, 0, 0 ); - TextLabelC1A2 = new QLabel( GroupC1, "TextLabelC1A2" ); - TextLabelC1A2->setText( tr( "GEOM_PLANE_MIRROR" ) ); - TextLabelC1A2->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A2->setFrameShape( QLabel::NoFrame ); - TextLabelC1A2->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabelC1A2, 1, 0 ); - SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" ); - SelectButtonC1A1->setText( tr( "" ) ); - SelectButtonC1A1->setPixmap( image1 ); - GroupC1Layout->addWidget( SelectButtonC1A1, 0, 1 ); - SelectButtonC1A2 = new QPushButton( GroupC1, "SelectButtonC1A2" ); - SelectButtonC1A2->setText( tr( "" ) ); - SelectButtonC1A2->setPixmap( image1 ); - GroupC1Layout->addWidget( SelectButtonC1A2, 1, 1 ); - LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" ); - LineEditC1A1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC1A1->sizePolicy().hasHeightForWidth() ) ); - GroupC1Layout->addWidget( LineEditC1A1, 0, 2 ); - LineEditC1A2 = new QLineEdit( GroupC1, "LineEditC1A2" ); - GroupC1Layout->addWidget( LineEditC1A2, 1, 2 ); - GeometryGUI_MirrorDlgLayout->addWidget( GroupC1, 1, 0 ); - - /* Initialisation */ - Init( Sel ) ; -} - - -//================================================================================= -// function : ~GeometryGUI_MirrorDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_MirrorDlg::~GeometryGUI_MirrorDlg() -{ - /* no need to delete child widgets, Qt does it all for us */ -} - - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_MirrorDlg::Init( SALOME_Selection* Sel ) -{ - mySelection = Sel ; - myShape1.Nullify() ; - myShape2.Nullify() ; - mySimulationTopoDs.Nullify() ; - myConstructorId = 0 ; - - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - GroupC1->show(); - - myEditCurrentArgument = LineEditC1A1 ; - Constructor1->setChecked( TRUE ); - myOkShape1 = myOkShape2 = false ; - - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - /* Filter definition */ - - myFaceFilter = new GEOM_FaceFilter( StdSelect_Plane, myGeom ); - - // TODO previous selection into argument ? - - /* signals and slots connections */ - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ; - connect( buttonApply, SIGNAL( clicked() ), this, SLOT(ClickOnApply() ) ); - connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) ); - connect( SelectButtonC1A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( SelectButtonC1A2, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - - connect( LineEditC1A1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - connect( LineEditC1A2, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ; - /* to close dialog if study change */ - connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ; - - /* Move widget on the botton right corner of main widget */ - int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; - this->show() ; /* Displays Dialog */ - - return ; -} - - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_MirrorDlg::ConstructorsClicked(int constructorId) -{ - GeometryGUI::GetGeometryGUI()->EraseSimulationShape() ; - - switch (constructorId) - { - case 0: - { - GroupC1->show(); - myConstructorId = constructorId ; - myEditCurrentArgument = LineEditC1A1 ; - LineEditC1A2->setText(tr("")) ; - Constructor1->setChecked( TRUE ); - myOkShape1 = myOkShape2 = false ; - break; - } - } - return ; -} - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_MirrorDlg::ClickOnOk() -{ - this->ClickOnApply() ; - this->ClickOnCancel() ; - - return ; -} - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_MirrorDlg::ClickOnApply() -{ - myGeomGUI->GetDesktop()->putInfo( tr("") ) ; - switch(myConstructorId) - { - case 0 : - { - if(myOkShape1 && myOkShape2) { - myGeomGUI->MakeMirrorAndDisplay(myGeomShape1 ,myGeomShape2 ) ; - } - break ; - } - } - // accept(); - return ; -} - - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void GeometryGUI_MirrorDlg::ClickOnCancel() -{ - mySelection->ClearFilters() ; - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->ResetState() ; - reject() ; - return ; -} - - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection has changed -//================================================================================= -void GeometryGUI_MirrorDlg::SelectionIntoArgument() -{ - myEditCurrentArgument->setText("") ; - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - - QString aString = ""; /* name of selection */ - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; - if ( nbSel != 1 ) { - switch (myConstructorId) - { - case 0: - { - if ( myEditCurrentArgument == LineEditC1A1 ) { - myOkShape1 = false ; - } - else if ( myEditCurrentArgument == LineEditC1A2 ) { - myOkShape2 = false ; - } - break ; - } - } - return ; - } - - /* nbSel == 1 */ - TopoDS_Shape S; - Standard_Boolean testResult ; - Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject() ; - if( !myGeomGUI->GetTopoFromSelection(mySelection, S) ) - return ; - - if ( myEditCurrentArgument == LineEditC1A1 ) { - myGeomShape1 = myGeomGUI->ConvertIOinGEOMShape(IO, testResult) ; - if( !testResult ) - return ; - myShape1 = S ; - LineEditC1A1->setText(aString) ; - myOkShape1 = true ; - } - else if ( myEditCurrentArgument == LineEditC1A2 ) { - myGeomShape2 = myGeomGUI->ConvertIOinGEOMShape(IO, testResult) ; - if( !testResult ) - return ; - myShape2 = S ; - LineEditC1A2->setText(aString) ; - myOkShape2 = true ; - } - - if(myOkShape1 && myOkShape2) { - MakeMirrorSimulationAndDisplay( myShape1, myShape2 ) ; - } - - return ; -} - - - -//================================================================================= -// function : MakeMirrorSimulationAndDisplay() -// purpose : S1 is a shape and S2 a mirror. -//================================================================================= -void GeometryGUI_MirrorDlg::MakeMirrorSimulationAndDisplay( const TopoDS_Shape& S1, const TopoDS_Shape& S2 ) -{ - this->mySimulationTopoDs.Nullify() ; - - try { - Handle(Geom_Surface) surf = BRep_Tool::Surface(TopoDS::Face(S2)) ; - 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( S1, theTransformation, Standard_False ) ; - - this->mySimulationTopoDs = myBRepTransformation.Shape() ; - if( this->mySimulationTopoDs.IsNull() ) - return ; - else - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - } - catch(Standard_Failure) { - MESSAGE( "Exception catched in MakeMirrorSimulationAndDisplay" ) ; - return ; - } - return ; -} - - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_MirrorDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - - switch (myConstructorId) - { - case 0: - { - if( send == SelectButtonC1A1 ) { - LineEditC1A1->setFocus() ; - myEditCurrentArgument = LineEditC1A1 ; - mySelection->ClearFilters() ; - SelectionIntoArgument() ; - } - else if(send == SelectButtonC1A2) { - LineEditC1A2->setFocus() ; - myEditCurrentArgument = LineEditC1A2; - mySelection->AddFilter(myFaceFilter) ; - SelectionIntoArgument() ; - } - break; - } - } - return ; -} - - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_MirrorDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if( send == LineEditC1A1 ) - myEditCurrentArgument = LineEditC1A1 ; - else if ( send == LineEditC1A2 ) - myEditCurrentArgument = LineEditC1A2 ; - else - return ; - - /* User name of object input management */ - /* If successfull the selection is changed and signal emitted... */ - /* so SelectionIntoArgument() is automatically called. */ - const QString objectUserName = myEditCurrentArgument->text() ; - QWidget* thisWidget = (QWidget*)this ; - if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) { - myEditCurrentArgument->setText( objectUserName ) ; - } - return ; -} - - - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void GeometryGUI_MirrorDlg::DeactivateActiveDialog() -{ - if ( GroupConstructors->isEnabled() ) { - GroupConstructors->setEnabled(false) ; - GroupC1->setEnabled(false) ; - GroupButtons->setEnabled(false) ; - disconnect( mySelection, 0, this, 0 ); - } - return ; -} - - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_MirrorDlg::closeEvent( QCloseEvent* e ) -{ - this->ClickOnCancel() ; /* same than click on cancel button */ -} - - -//================================================================================= -// function : enterEvent() -// purpose : when mouse enter onto the QWidget -//================================================================================= -void GeometryGUI_MirrorDlg::enterEvent( QEvent * ) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; -} - - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_MirrorDlg::ActivateThisDialog() -{ - /* Emit a signal to deactivate any active dialog */ - myGeomGUI->EmitSignalDeactivateDialog() ; - GroupConstructors->setEnabled(true) ; - GroupC1->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - return ; -} diff --git a/src/GEOMGUI/GeometryGUI_MirrorDlg.h b/src/GEOMGUI/GeometryGUI_MirrorDlg.h deleted file mode 100644 index adc4d7d33..000000000 --- a/src/GEOMGUI/GeometryGUI_MirrorDlg.h +++ /dev/null @@ -1,118 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_MirrorDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_MIRROR_H -#define DIALOGBOX_MIRROR_H - -#include "SALOME_Selection.h" -#include "GEOM_FaceFilter.hxx" - -#include - -#include -#include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QRadioButton; -class GeometryGUI; - - -//================================================================================= -// class : GeometryGUI_MirrorDlg -// purpose : -//================================================================================= -class GeometryGUI_MirrorDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_MirrorDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 ); - ~GeometryGUI_MirrorDlg(); - -private : - - void closeEvent( QCloseEvent* e ) ; - void enterEvent( QEvent* e); /* Mouse enter the QWidget */ - void Init( SALOME_Selection* Sel ) ; - void MakeMirrorSimulationAndDisplay( const TopoDS_Shape& S1, const TopoDS_Shape& S2 ) ; - - GEOM::GEOM_Gen_var myGeom ; /* Current GeomI object */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - SALOME_Selection* mySelection ; /* User shape selection */ - TopoDS_Shape myShape1 ; /* topology used */ - TopoDS_Shape myShape2 ; /* topology used */ - GEOM::GEOM_Shape_var myGeomShape1 ; /* is myShape1 */ - GEOM::GEOM_Shape_var myGeomShape2 ; /* is myShape2 */ - TopoDS_Shape mySimulationTopoDs; /* Shape used for simulation display */ - bool myOkShape1 ; - bool myOkShape2 ; /* to check when arguments are defined */ - int myConstructorId ; /* Current constructor id = radio button id */ - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - Handle(GEOM_FaceFilter) myFaceFilter; /* To filter selections */ - - QGroupBox* GroupButtons; - QPushButton* buttonApply; - QPushButton* buttonOk; - QPushButton* buttonCancel; - QButtonGroup* GroupConstructors; - QRadioButton* Constructor1; - QGroupBox* GroupC1; - QLabel* TextLabelC1A1; - QLabel* TextLabelC1A2; - QPushButton* SelectButtonC1A1; - QPushButton* SelectButtonC1A2; - QLineEdit* LineEditC1A1; - QLineEdit* LineEditC1A2; - -private slots : - - void ConstructorsClicked(int constructorId); - void ClickOnOk(); - void ClickOnCancel(); - void ClickOnApply(); - void SetEditCurrentArgument() ; - void SelectionIntoArgument() ; - void LineEditReturnPressed() ; - void DeactivateActiveDialog() ; - void ActivateThisDialog() ; - -protected: - QGridLayout* GeometryGUI_MirrorDlgLayout; - QGridLayout* GroupButtonsLayout; - QGridLayout* GroupConstructorsLayout; - QGridLayout* GroupC1Layout; -}; - -#endif // DIALOGBOX_MIRROR_H diff --git a/src/GEOMGUI/GeometryGUI_MultiRotationDlg.cxx b/src/GEOMGUI/GeometryGUI_MultiRotationDlg.cxx deleted file mode 100644 index 537f06022..000000000 --- a/src/GEOMGUI/GeometryGUI_MultiRotationDlg.cxx +++ /dev/null @@ -1,986 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_MultiTranslationDlg.cxx -// Author : Damien COQUERET -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_MultiRotationDlg.h" - -#include "GeometryGUI.h" -#include "QAD_Application.h" -#include "QAD_Desktop.h" -#include "QAD_Config.h" -#include "utilities.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -//================================================================================= -// class : GeometryGUI_MultiRotationDlg() -// purpose : Constructs a GeometryGUI_MultiRotationDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_MultiRotationDlg::GeometryGUI_MultiRotationDlg( QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_MULTIROTATION_SIMPLE"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_MULTIROTATION_DOUBLE"))); - - if ( !name ) - setName( "GeometryGUI_MultiTranlationDlg" ); - resize( 303, 251 ); - setCaption( tr( "GEOM_MULTIROTATION_TITLE" ) ); - setSizeGripEnabled( TRUE ); - GeometryGUI_MultiRotationDlgLayout = new QGridLayout( this ); - GeometryGUI_MultiRotationDlgLayout->setSpacing( 6 ); - GeometryGUI_MultiRotationDlgLayout->setMargin( 11 ); - - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "GEOM_MULTIROTATION" ) ); - GroupConstructors->setExclusive( TRUE ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setText( tr( "" ) ); - Constructor1->setPixmap( image0 ); - Constructor1->setChecked( TRUE ); - Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) ); - Constructor1->setMinimumSize( QSize( 50, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - Constructor2 = new QRadioButton( GroupConstructors, "Constructor2" ); - Constructor2->setText( tr( "" ) ); - Constructor2->setPixmap( image2 ); - Constructor2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor2->sizePolicy().hasHeightForWidth() ) ); - Constructor2->setMinimumSize( QSize( 50, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor2, 0, 2 ); - QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer_2, 0, 3 ); - QSpacerItem* spacer_3 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer_3, 0, 1 ); - - GeometryGUI_MultiRotationDlgLayout->addWidget( GroupConstructors, 0, 0 ); - - /***************************************************************/ - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); - GroupButtons->setTitle( tr( "" ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 3 ); - buttonApply = new QPushButton( GroupButtons, "buttonApply" ); - buttonApply->setText( tr( "GEOM_BUT_APPLY" ) ); - buttonApply->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonApply, 0, 1 ); - QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_9, 0, 2 ); - buttonOk = new QPushButton( GroupButtons, "buttonOk" ); - buttonOk->setText( tr( "GEOM_BUT_OK" ) ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - GeometryGUI_MultiRotationDlgLayout->addWidget( GroupButtons, 2, 0 ); - - /***************************************************************/ - GroupC1 = new QGroupBox( this, "GroupC1" ); - GroupC1->setTitle( tr( "GEOM_MULTIROTATION_SIMPLE" ) ); - GroupC1->setMinimumSize( QSize( 0, 0 ) ); - GroupC1->setFrameShape( QGroupBox::Box ); - GroupC1->setFrameShadow( QGroupBox::Sunken ); - GroupC1->setColumnLayout(0, Qt::Vertical ); - GroupC1->layout()->setSpacing( 0 ); - GroupC1->layout()->setMargin( 0 ); - GroupC1Layout = new QGridLayout( GroupC1->layout() ); - GroupC1Layout->setAlignment( Qt::AlignTop ); - GroupC1Layout->setSpacing( 6 ); - GroupC1Layout->setMargin( 11 ); - - TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" ); - TextLabelC1A1->setText( tr( "GEOM_MAIN_OBJECT" ) ); - TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A1->setFrameShape( QLabel::NoFrame ); - TextLabelC1A1->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabelC1A1, 0, 0 ); - - TextLabelC1A2 = new QLabel( GroupC1, "TextLabelC1A2" ); - TextLabelC1A2->setText( tr( "GEOM_VECTOR" ) ); - TextLabelC1A2->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A2->setFrameShape( QLabel::NoFrame ); - TextLabelC1A2->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabelC1A2, 1, 0 ); - - TextLabelC1A3 = new QLabel( GroupC1, "TextLabelC1A3" ); - TextLabelC1A3->setText( tr( "GEOM_NB_TIMES" ) ); - TextLabelC1A3->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A3->setFrameShape( QLabel::NoFrame ); - TextLabelC1A3->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabelC1A3, 2, 0 ); - - LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" ); - GroupC1Layout->addWidget( LineEditC1A1, 0, 2 ); - - LineEditC1A2 = new QLineEdit( GroupC1, "LineEditC1A2" ); - GroupC1Layout->addWidget( LineEditC1A2, 1, 2 ); - - /* a QSpinBox */ - SpinBox_C1A3 = new QSpinBox( GroupC1, "SpinBox_C1A3" ) ; - SpinBox_C1A3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, SpinBox_C1A3->sizePolicy().hasHeightForWidth() ) ); - GroupC1Layout->addWidget( SpinBox_C1A3, 2, 2 ); - - SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" ); - SelectButtonC1A1->setText( tr( "" ) ); - SelectButtonC1A1->setPixmap( image1 ); - SelectButtonC1A1->setToggleButton( FALSE ); - SelectButtonC1A1->setMaximumSize( QSize( 28, 32767 ) ); - GroupC1Layout->addWidget( SelectButtonC1A1, 0, 1 ); - - SelectButtonC1A2 = new QPushButton( GroupC1, "SelectButtonC1A2" ); - SelectButtonC1A2->setText( tr( "" ) ); - SelectButtonC1A2->setPixmap( image1 ); - SelectButtonC1A2->setToggleButton( FALSE ); - SelectButtonC1A2->setMaximumSize( QSize( 28, 32767 ) ); - GroupC1Layout->addWidget( SelectButtonC1A2, 1, 1 ); - - GeometryGUI_MultiRotationDlgLayout->addWidget( GroupC1, 1, 0 ); - - /***************************************************************/ - - GroupC2 = new QGroupBox( this, "GroupC2" ); - GroupC2->setTitle( tr( "GEOM_MULTIROTATION_DOUBLE" ) ); - GroupC2->setMinimumSize( QSize( 0, 0 ) ); - GroupC2->setFrameShape( QGroupBox::Box ); - GroupC2->setFrameShadow( QGroupBox::Sunken ); - GroupC2->setColumnLayout(0, Qt::Vertical ); - GroupC2->layout()->setSpacing( 0 ); - GroupC2->layout()->setMargin( 0 ); - GroupC2Layout = new QGridLayout( GroupC2->layout() ); - GroupC2Layout->setAlignment( Qt::AlignTop ); - GroupC2Layout->setSpacing( 6 ); - GroupC2Layout->setMargin( 11 ); - - TextLabelC2A1 = new QLabel( GroupC2, "TextLabelC2A1" ); - TextLabelC2A1->setText( tr( "GEOM_MAIN_OBJECT" ) ); - TextLabelC2A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC2A1->setFrameShape( QLabel::NoFrame ); - TextLabelC2A1->setFrameShadow( QLabel::Plain ); - GroupC2Layout->addWidget( TextLabelC2A1, 0, 0 ); - - TextLabelC2A2 = new QLabel( GroupC2, "TextLabelC2A2" ); - TextLabelC2A2->setText( tr( "GEOM_VECTOR" ) ); - TextLabelC2A2->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC2A2->setFrameShape( QLabel::NoFrame ); - TextLabelC2A2->setFrameShadow( QLabel::Plain ); - GroupC2Layout->addWidget( TextLabelC2A2, 1, 0 ); - - TextLabelC2A3 = new QLabel( GroupC2, "TextLabelC2A3" ); - TextLabelC2A3->setText( tr( "GEOM_ANGLE" ) ); - TextLabelC2A3->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC2A3->setFrameShape( QLabel::NoFrame ); - TextLabelC2A3->setFrameShadow( QLabel::Plain ); - GroupC2Layout->addWidget( TextLabelC2A3, 2, 0 ); - - TextLabelC2A4 = new QLabel( GroupC2, "TextLabelC2A4" ); - TextLabelC2A4->setText( tr( "GEOM_NB_TIMES" ) ); - TextLabelC2A4->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC2A4->setFrameShape( QLabel::NoFrame ); - TextLabelC2A4->setFrameShadow( QLabel::Plain ); - GroupC2Layout->addWidget( TextLabelC2A4, 3, 0 ); - - TextLabelC2A5 = new QLabel( GroupC2, "TextLabelC2A5" ); - TextLabelC2A5->setText( tr( "GEOM_STEP" ) ); - TextLabelC2A5->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC2A5->setFrameShape( QLabel::NoFrame ); - TextLabelC2A5->setFrameShadow( QLabel::Plain ); - GroupC2Layout->addWidget( TextLabelC2A5, 5, 0 ); - - TextLabelC2A6 = new QLabel( GroupC2, "TextLabelC2A6" ); - TextLabelC2A6->setText( tr( "GEOM_NB_TIMES" ) ); - TextLabelC2A6->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC2A6->setFrameShape( QLabel::NoFrame ); - TextLabelC2A6->setFrameShadow( QLabel::Plain ); - GroupC2Layout->addWidget( TextLabelC2A6, 6, 0 ); - - LineEditC2A1 = new QLineEdit( GroupC2, "LineEditC2A1" ); - GroupC2Layout->addWidget( LineEditC2A1, 0, 2 ); - - LineEditC2A2 = new QLineEdit( GroupC2, "LineEditC2A2" ); - GroupC2Layout->addWidget( LineEditC2A2, 1, 2 ); - - /* a GeometryGUI_SpinBox */ - SpinBox_C2A3 = new GeometryGUI_SpinBox( GroupC2, "GeomSpinBox_C2A3" ) ; - SpinBox_C2A3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, SpinBox_C2A3->sizePolicy().hasHeightForWidth() ) ); - GroupC2Layout->addWidget( SpinBox_C2A3, 2, 2 ); - /* a QSpinBox */ - SpinBox_C2A4 = new QSpinBox( GroupC2, "SpinBox_C2A4" ) ; - SpinBox_C2A4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, SpinBox_C2A4->sizePolicy().hasHeightForWidth() ) ); - GroupC2Layout->addWidget( SpinBox_C2A4, 3, 2 ); - - /* a GeometryGUI_SpinBox */ - SpinBox_C2A5 = new GeometryGUI_SpinBox( GroupC2, "GeomSpinBox_C2A5" ) ; - SpinBox_C2A5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, SpinBox_C2A5->sizePolicy().hasHeightForWidth() ) ); - GroupC2Layout->addWidget( SpinBox_C2A5, 5, 2 ); - /* a QSpinBox */ - SpinBox_C2A6 = new QSpinBox( GroupC2, "SpinBox_C2A6" ) ; - SpinBox_C2A6->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, SpinBox_C2A6->sizePolicy().hasHeightForWidth() ) ); - GroupC2Layout->addWidget( SpinBox_C2A6, 6, 2 ); - - CheckBoxReverse = new QCheckBox( GroupC2, "CheckBoxReverse" ); - CheckBoxReverse->setText( tr( "GEOM_REVERSE" ) ); - GroupC2Layout->addWidget( CheckBoxReverse, 4, 0 ); - - SelectButtonC2A1 = new QPushButton( GroupC2, "SelectButtonC2A1" ); - SelectButtonC2A1->setText( tr( "" ) ); - SelectButtonC2A1->setPixmap( image1 ); - SelectButtonC2A1->setToggleButton( FALSE ); - SelectButtonC2A1->setMaximumSize( QSize( 28, 32767 ) ); - GroupC2Layout->addWidget( SelectButtonC2A1, 0, 1 ); - - SelectButtonC2A2 = new QPushButton( GroupC2, "SelectButtonC2A2" ); - SelectButtonC2A2->setText( tr( "" ) ); - SelectButtonC2A2->setPixmap( image1 ); - SelectButtonC2A2->setToggleButton( FALSE ); - SelectButtonC2A2->setMaximumSize( QSize( 28, 32767 ) ); - GroupC2Layout->addWidget( SelectButtonC2A2, 1, 1 ); - - GeometryGUI_MultiRotationDlgLayout->addWidget( GroupC2, 1, 0 ); - - /***************************************************************/ - - Init(Sel) ; /* Initialisations */ -} - -//================================================================================= -// function : ~GeometryGUI_MultiRotationDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_MultiRotationDlg::~GeometryGUI_MultiRotationDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_MultiRotationDlg::Init( SALOME_Selection* Sel ) -{ - - /* Get setting of step value from file configuration */ - double step ; - QString St = QAD_CONFIG->getSetting( "Geometry:SettingsGeomStep" ) ; - step = St.toDouble() ; - - /* min, max, step and decimals for geom spin boxes */ - SpinBox_C2A3->RangeStepAndValidator( -999.999, 999.999, step, 3 ) ; /* angle : constructor 2 */ - SpinBox_C2A3->SetValue( 45.0 ) ; - SpinBox_C2A5->RangeStepAndValidator( -999.999, 999.999, step, 3 ) ; /* step : constructor 2 */ - SpinBox_C2A5->SetValue( 50.0 ) ; - - /* min, max, step for QT spin boxes */ - SpinBox_C1A3->setMinValue( 2 ); /* myNbTimes : constructor 1 */ - SpinBox_C1A3->setMaxValue( 10000 ); - SpinBox_C1A3->setWrapping( TRUE ); - SpinBox_C1A3->setValue(2) ; - - SpinBox_C2A4->setMinValue( 2 ); /* myNbTimes1 : constructor 2 */ - SpinBox_C2A4->setMaxValue( 10000 ); - SpinBox_C2A4->setWrapping( TRUE ); - SpinBox_C2A4->setValue(2) ; - - SpinBox_C2A6->setMinValue( 2 ); /* myNbTimes2 : constructor 2 */ - SpinBox_C2A6->setMaxValue( 10000 ); - SpinBox_C2A6->setWrapping( TRUE ); - SpinBox_C2A6->setValue(2) ; - - myAng = 45.0 ; - myStep = 50.0 ; - myNbTimes1 = 2; - myNbTimes2 = 2; - - GroupC1->show(); - GroupC2->hide() ; - myConstructorId = 0 ; - Constructor1->setChecked( TRUE ); - myEditCurrentArgument = LineEditC1A1 ; - mySelection = Sel; - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - - myOkBase = myOkDir = false ; - mySimulationTopoDs.Nullify() ; - myBase.Nullify() ; - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - - // TODO : set previous selection into argument ? - - /* Filter definitions */ - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - myEdgeFilter = new GEOM_EdgeFilter( StdSelect_Line, myGeom ); - - /* signals and slots connections */ - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ; - connect( buttonApply, SIGNAL( clicked() ), this, SLOT(ClickOnApply() ) ); - connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) ); - connect( SelectButtonC1A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( SelectButtonC1A2, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( SelectButtonC2A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( SelectButtonC2A2, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - - connect( LineEditC1A1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - connect( LineEditC1A2, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - connect( LineEditC2A1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - connect( LineEditC2A2, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - - /* GeometryGUI_SpinBox */ - connect( SpinBox_C2A3, SIGNAL ( valueChanged( double) ), this, SLOT( valueChangedInSpinBox( double) ) ) ; - connect( SpinBox_C2A5, SIGNAL ( valueChanged( double) ), this, SLOT( valueChangedInSpinBox( double) ) ) ; - - /* QSpinBox */ - connect( SpinBox_C1A3, SIGNAL ( valueChanged(int) ), this, SLOT( ValueChangedInt(int) ) ) ; /* Not const ! */ - connect( SpinBox_C2A4, SIGNAL ( valueChanged(int) ), this, SLOT( ValueChangedInt(int) ) ) ; - connect( SpinBox_C2A6, SIGNAL ( valueChanged(int) ), this, SLOT( ValueChangedInt(int) ) ) ; - - connect( CheckBoxReverse, SIGNAL (stateChanged(int) ), this, SLOT( ReverseAngle(int) ) ) ; - - connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ; - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - /* to close dialog if study change */ - connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ; - - /* Move widget on the botton right corner of main widget */ - int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; - this->show() ; /* displays Dialog */ - - return ; -} - -//================================================================================= -// function : ReverseAngle() -// purpose : 'state' not used here -//================================================================================= -void GeometryGUI_MultiRotationDlg::ReverseAngle(int state) -{ - myAng = -myAng ; - SpinBox_C2A3->SetValue( myAng ) ; - if( myOkBase && myOkDir ) { - MakeMultiRotationSimulationAndDisplay() ; - } - else { - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - } - return ; -} - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_MultiRotationDlg::ConstructorsClicked(int constructorId) -{ - myEditCurrentArgument->setText(tr("")) ; - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - - myAng = 45.0 ; - myStep = 50.0 ; - myNbTimes1 = 2; - myNbTimes2 = 2; - - myOkBase = myOkDir = false ; - myConstructorId = constructorId ; - - switch (constructorId) - { - case 0: /* Rotate simple */ - { - GroupC1->show(); - GroupC2->hide() ; - myEditCurrentArgument = LineEditC1A1 ; - SpinBox_C1A3->setValue( 2 ) ; - LineEditC1A1->setText(tr("")) ; - LineEditC1A2->setText(tr("")) ; - break; - } - - case 1: /* Rotate double */ - { - GroupC1->hide(); - GroupC2->show() ; - myEditCurrentArgument = LineEditC2A1 ; - SpinBox_C2A3->SetValue( 45.0 ) ; - SpinBox_C2A4->setValue( 2 ) ; - SpinBox_C2A5->SetValue( 50.0 ) ; - SpinBox_C2A6->setValue( 2 ) ; - LineEditC2A1->setText(tr("")) ; - LineEditC2A2->setText(tr("")) ; - break ; - } - } - return ; -} - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_MultiRotationDlg::ClickOnOk() -{ - this->ClickOnApply() ; - this->ClickOnCancel() ; - - return ; -} - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_MultiRotationDlg::ClickOnApply() -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - myGeomGUI->GetDesktop()->putInfo( tr("") ) ; - switch(myConstructorId) - { - case 0 : - { - if(myOkBase && myOkDir) { - myGeomGUI->MakeMultiRotation1DAndDisplay( myGeomShape, myDir, myLoc, myNbTimes1 ) ; - } - break ; - } - case 1 : - { - if(myOkBase && myOkDir) { - myGeomGUI->MakeMultiRotation2DAndDisplay( myGeomShape, myDir, myLoc, myAng, myNbTimes1, myStep, myNbTimes2 ) ; - } - break ; - } - } - return ; -} - - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void GeometryGUI_MultiRotationDlg::ClickOnCancel() -{ - mySelection->ClearFilters() ; - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->ResetState() ; - reject() ; - return ; -} - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_MultiRotationDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender() ; - if( send == LineEditC1A1 ) - myEditCurrentArgument = LineEditC1A1 ; - else if ( send == LineEditC1A2 ) - myEditCurrentArgument = LineEditC1A2 ; - else if ( send == LineEditC2A1 ) - myEditCurrentArgument = LineEditC2A1; - else if ( send == LineEditC2A2 ) - myEditCurrentArgument = LineEditC2A2 ; - else - return ; - - /* User name of object input management */ - /* If successfull the selection is changed and signal emitted... */ - /* so SelectionIntoArgument() is automatically called. */ - const QString objectUserName = myEditCurrentArgument->text() ; - QWidget* thisWidget = (QWidget*)this ; - if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) { - myEditCurrentArgument->setText( objectUserName ) ; - } - return ; -} - - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -//================================================================================= -void GeometryGUI_MultiRotationDlg::SelectionIntoArgument() -{ - myEditCurrentArgument->setText("") ; - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - - /* Name of future selection */ - QString aString = ""; - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; - - TopoDS_Shape S; - Standard_Boolean testResult ; - - switch (myConstructorId) - { - case 0 : - { - if ( nbSel != 1 ) { - if ( myEditCurrentArgument == LineEditC1A1 ) { - myEditCurrentArgument->setText("") ; - myOkBase = false ; - } - else if ( myEditCurrentArgument == LineEditC1A2 ) { - myEditCurrentArgument->setText("") ; - myOkDir = false ; - } - return ; - } - - Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject() ; - if( !myGeomGUI->GetTopoFromSelection(mySelection, S) ) - return ; - - if ( myEditCurrentArgument == LineEditC1A1 ) { - myGeomShape = myGeomGUI->ConvertIOinGEOMShape(IO, testResult) ; - if( !testResult ) - return ; - myEditCurrentArgument->setText(aString) ; - myBase = S ; - myOkBase = true ; - } - else if ( myEditCurrentArgument == LineEditC1A2 ) { - BRepAdaptor_Curve curv(TopoDS::Edge(S)); - myDir = curv.Line().Direction(); - myLoc = curv.Line().Location(); - myEditCurrentArgument->setText(aString) ; - myOkDir = true ; - } - - if (myOkBase && myOkDir ) { - MakeMultiRotationSimulationAndDisplay() ; - } - else { - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - } - break; - } - case 1 : - { - if ( nbSel != 1 ) { - if ( myEditCurrentArgument == LineEditC2A1 ) { - myEditCurrentArgument->setText("") ; - myOkBase = false ; - } - else if ( myEditCurrentArgument == LineEditC2A2 ) { - myEditCurrentArgument->setText("") ; - myOkDir = false ; - } - return ; - } - - Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject() ; - if( !myGeomGUI->GetTopoFromSelection(mySelection, S) ) - return ; - - if ( myEditCurrentArgument == LineEditC2A1 ) { - myGeomShape = myGeomGUI->ConvertIOinGEOMShape(IO, testResult) ; - if( !testResult ) - return ; - myEditCurrentArgument->setText(aString) ; - myBase = S ; - myOkBase = true ; - } - else if ( myEditCurrentArgument == LineEditC2A2 ) { - BRepAdaptor_Curve curv(TopoDS::Edge(S)); - myDir = curv.Line().Direction(); - myLoc = curv.Line().Location(); - myEditCurrentArgument->setText(aString) ; - myOkDir = true ; - } - - if ( myOkBase && myOkDir ) { - MakeMultiRotationSimulationAndDisplay() ; - } - else { - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - } - break; - } - } - - return ; -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_MultiRotationDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - switch (myConstructorId) - { - case 0 : - { - if(send == SelectButtonC1A1) { - LineEditC1A1->setFocus() ; - myEditCurrentArgument = LineEditC1A1; - mySelection->ClearFilters() ; - } - else if(send == SelectButtonC1A2) { - LineEditC1A2->setFocus() ; - myEditCurrentArgument = LineEditC1A2; - mySelection->AddFilter(myEdgeFilter) ; - } - SelectionIntoArgument() ; - break; - } - case 1 : - { - if(send == SelectButtonC2A1) { - LineEditC2A1->setFocus() ; - myEditCurrentArgument = LineEditC2A1; - mySelection->ClearFilters() ; - } - else if(send == SelectButtonC2A2) { - LineEditC2A2->setFocus() ; - myEditCurrentArgument = LineEditC2A2; - mySelection->AddFilter(myEdgeFilter) ; - } - SelectionIntoArgument() ; - break; - } - } - return ; -} - -//================================================================================= -// function : ValueChangedInt() -// purpose : -//================================================================================= -void GeometryGUI_MultiRotationDlg::ValueChangedInt( int newIntValue ) -{ - QSpinBox* send = (QSpinBox*)sender(); - - if( send == SpinBox_C1A3 ) { - myNbTimes1 = newIntValue ; - } - else if(send == SpinBox_C2A4 ) { - myNbTimes1 = newIntValue ; - } - else if(send == SpinBox_C2A6 ) { - myNbTimes2 = newIntValue ; - } - - switch (myConstructorId) - { - case 0 : - { - if (myOkBase && myOkDir ) { - MakeMultiRotationSimulationAndDisplay() ; - } - else { - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - } - break; - } - case 1 : - { - if (myOkBase && myOkDir ) { - MakeMultiRotationSimulationAndDisplay() ; - } - else { - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - } - break; - } - } - return ; -} - - -//================================================================================= -// function : ValueChangedInSpinBox() -// purpose : (specifig for GeometryGUI_SpinBox) -//================================================================================= -void GeometryGUI_MultiRotationDlg::ValueChangedInSpinBox( double newValue ) -{ - GeometryGUI_SpinBox* send = (GeometryGUI_SpinBox*)sender(); - - if( send == SpinBox_C2A3 ) { - myAng = newValue ; - } - else if( send == SpinBox_C2A5 ) { - myStep = newValue ; - } - - switch (myConstructorId) - { - case 0 : - { - if (myOkBase && myOkDir ) { - MakeMultiRotationSimulationAndDisplay() ; - } - else { - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - } - break; - } - case 1 : - { - if (myOkBase && myOkDir ) { - MakeMultiRotationSimulationAndDisplay() ; - } - else { - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - } - break; - } - } - return ; -} - - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void GeometryGUI_MultiRotationDlg::DeactivateActiveDialog() -{ - if ( GroupConstructors->isEnabled() ) { - GroupConstructors->setEnabled(false) ; - GroupC1->setEnabled(false) ; - GroupC2->setEnabled(false) ; - GroupButtons->setEnabled(false) ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->EraseSimulationShape() ; - mySelection->ClearFilters() ; - myGeomGUI->ResetState() ; - myGeomGUI->SetActiveDialogBox(0) ; - myGeomGUI->OnDisplayAll(true) ; - } - return ; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_MultiRotationDlg::ActivateThisDialog() -{ - /* Emit a signal to deactivate the active dialog */ - myGeomGUI->EmitSignalDeactivateDialog() ; - GroupConstructors->setEnabled(true) ; - GroupC1->setEnabled(true) ; - GroupC2->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - if( !mySimulationTopoDs.IsNull() ) - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - return ; -} - - - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void GeometryGUI_MultiRotationDlg::enterEvent(QEvent* e) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; - return ; -} - - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_MultiRotationDlg::closeEvent( QCloseEvent* e ) -{ - this->ClickOnCancel() ; /* same than click on cancel button */ - return ; -} - - -//================================================================================= -// function : MakeMultiRotationSimulationAndDisplay() -// purpose : -//================================================================================= -void GeometryGUI_MultiRotationDlg::MakeMultiRotationSimulationAndDisplay() -{ - myGeomGUI->EraseSimulationShape() ; - gp_Trsf theTransformation ; - gp_Trsf theTransformation1 ; - gp_Trsf theTransformation2 ; - mySimulationTopoDs.Nullify() ; - - int i ; - int j ; - Standard_Real DX ; - Standard_Real DY ; - Standard_Real DZ ; - GProp_GProps System ; - gp_Pnt myPoint ; - TopoDS_Compound compound; - BRep_Builder B; - - B.MakeCompound( compound ); - - if ( myBase.ShapeType() == TopAbs_VERTEX) { - myGeomGUI->VertexToPoint( myBase, myPoint ); - } - else if ( myBase.ShapeType() == TopAbs_EDGE || myBase.ShapeType() == TopAbs_WIRE ) { - BRepGProp::LinearProperties(myBase, System); - myPoint = System.CentreOfMass() ; - } - else if ( myBase.ShapeType() == TopAbs_FACE || myBase.ShapeType() == TopAbs_SHELL ) { - BRepGProp::SurfaceProperties(myBase, System); - myPoint = System.CentreOfMass() ; - } - else { - BRepGProp::VolumeProperties(myBase, System); - myPoint = System.CentreOfMass() ; - } - - TopoDS_Shape S = BRepBuilderAPI_MakeVertex(myPoint).Shape(); - - try { - switch (myConstructorId) - { - case 0 : - { - gp_Ax1 AX1( myLoc, myDir ) ; - Standard_Real angle = 360/myNbTimes1; - for ( i = 0; i < myNbTimes1; i++ ) { - theTransformation.SetRotation(AX1, i*angle*PI180) ; - BRepBuilderAPI_Transform myBRepTransformation(S, theTransformation, Standard_False) ; - B.Add( compound, myBRepTransformation.Shape() ); - } - mySimulationTopoDs = compound; - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - break; - } - case 1 : - { - gp_Ax1 AX2( myLoc, myDir ) ; - Handle(Geom_Line) Line = new Geom_Line(AX2); - gp_Pnt P2 = GeomAPI_ProjectPointOnCurve( myPoint, Line ) ; - if ( myPoint.IsEqual(P2, Precision::Confusion() ) ) - return; - gp_Vec Vec(P2, myPoint) ; - Vec.Normalize(); - - for ( i = 0; i < myNbTimes2; i++ ) { - for ( j = 0; j < myNbTimes1; j++ ) { - DX = i * myStep * Vec.X() ; - DY = i * myStep * Vec.Y() ; - DZ = i * myStep * Vec.Z() ; - myVec.SetCoord( DX, DY, DZ ) ; - - theTransformation1.SetTranslation(myVec) ; - theTransformation2.SetRotation(AX2, j*myAng*PI180) ; - BRepBuilderAPI_Transform myBRepTransformation1(S, theTransformation1, Standard_False) ; - BRepBuilderAPI_Transform myBRepTransformation2(myBRepTransformation1.Shape(), theTransformation2, Standard_False) ; - B.Add( compound, myBRepTransformation2.Shape() ); - } - } - mySimulationTopoDs = compound ; - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - break; - } - } - } - catch(Standard_Failure) { - MESSAGE( "Exception catched in MakeMultitranslationSimulationAndDisplay" ) ; - return ; - } - return ; -} diff --git a/src/GEOMGUI/GeometryGUI_MultiRotationDlg.h b/src/GEOMGUI/GeometryGUI_MultiRotationDlg.h deleted file mode 100644 index 13f6804ad..000000000 --- a/src/GEOMGUI/GeometryGUI_MultiRotationDlg.h +++ /dev/null @@ -1,162 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_MultiRotationDlg.h -// Author : Damien COQUERET -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_MULTIROTATION_H -#define DIALOGBOX_MULTIROTATION_H - - -#include "SALOME_Selection.h" -#include "GEOM_ShapeTypeFilter.hxx" -#include "GEOM_EdgeFilter.hxx" -#include "GeometryGUI_SpinBox.h" - -#include -#include -#include - -#include -#include -#include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QCheckBox; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QSpinBox; -class QRadioButton; -class GeometryGUI; - -//================================================================================= -// class : GeometryGUI_MultiRotationDlg -// purpose : -//================================================================================= -class GeometryGUI_MultiRotationDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_MultiRotationDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 ); - ~GeometryGUI_MultiRotationDlg(); - -private : - - GEOM::GEOM_Gen_var myGeom ; /* Current Geom object */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - TopoDS_Shape mySimulationTopoDs ; /* Shape used for simulation display */ - SALOME_Selection* mySelection ; /* User shape selection */ - TopoDS_Shape myBase ; - GEOM::GEOM_Shape_var myGeomShape ; /* is myBase */ - - gp_Vec myVec ; - int myNbTimes1 ; - int myNbTimes2 ; - Standard_Real myAng ; - Standard_Real myStep ; - gp_Dir myDir ; - gp_Pnt myLoc ; - - bool myOkBase ; - bool myOkDir ; - bool myOkAng ; - - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - int myConstructorId ; /* Current constructor id = radio button id */ - Handle(GEOM_EdgeFilter) myEdgeFilter; /* Filter selection */ - - void closeEvent( QCloseEvent* e ) ; - void enterEvent( QEvent* e); - void Init( SALOME_Selection* Sel ) ; - void MakeMultiRotationSimulationAndDisplay() ; - - QButtonGroup* GroupConstructors; - QRadioButton* Constructor1; - QRadioButton* Constructor2; - - QGroupBox* GroupButtons; - QPushButton* buttonOk; - QPushButton* buttonCancel; - QPushButton* buttonApply; - - QGroupBox* GroupC1; - QPushButton* SelectButtonC1A1; - QPushButton* SelectButtonC1A2; - QLabel* TextLabelC1A1; - QLabel* TextLabelC1A2; - QLabel* TextLabelC1A3; - QLineEdit* LineEditC1A1; - QLineEdit* LineEditC1A2; - QSpinBox* SpinBox_C1A3; /* int : Nb times */ - - QGroupBox* GroupC2; - QPushButton* SelectButtonC2A1; - QPushButton* SelectButtonC2A2; - QLabel* TextLabelC2A1; - QLabel* TextLabelC2A2; - QLabel* TextLabelC2A3; - QLabel* TextLabelC2A4; - QLabel* TextLabelC2A5; - QLabel* TextLabelC2A6; - - QLineEdit* LineEditC2A1; - QLineEdit* LineEditC2A2; - GeometryGUI_SpinBox* SpinBox_C2A3 ; /* double : angle */ - QSpinBox* SpinBox_C2A4; /* int : Nb times 1 */ - GeometryGUI_SpinBox* SpinBox_C2A5 ; /* double : step value */ - QSpinBox* SpinBox_C2A6; /* int : Nb times 2 */ - - QCheckBox* CheckBoxReverse; - -private slots: - - void ConstructorsClicked(int constructorId); - void ClickOnOk(); - void ClickOnCancel(); - void ClickOnApply(); - void SetEditCurrentArgument() ; - void SelectionIntoArgument() ; - void LineEditReturnPressed() ; - void DeactivateActiveDialog() ; - void ActivateThisDialog() ; - void ReverseAngle(int) ; - void ValueChangedInSpinBox( double newValue ) ; /* for GeometryGUI_SpinBox */ - void ValueChangedInt( int newIntValue ) ; /* for QT spin box ! not const ! */ - -protected: - QGridLayout* GeometryGUI_MultiRotationDlgLayout; - QGridLayout* GroupConstructorsLayout; - QGridLayout* GroupButtonsLayout; - QGridLayout* GroupC1Layout; - QGridLayout* GroupC2Layout; -}; - -#endif // DIALOGBOX_MULTIROTATION_H diff --git a/src/GEOMGUI/GeometryGUI_MultiTranslationDlg.cxx b/src/GEOMGUI/GeometryGUI_MultiTranslationDlg.cxx deleted file mode 100644 index 31d544d8a..000000000 --- a/src/GEOMGUI/GeometryGUI_MultiTranslationDlg.cxx +++ /dev/null @@ -1,1063 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_MultiTranslationDlg.cxx -// Author : Damien COQUERET -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_MultiTranslationDlg.h" - -#include "GeometryGUI.h" -#include "QAD_Application.h" -#include "QAD_Desktop.h" -#include "QAD_Config.h" -#include "utilities.h" - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -//================================================================================= -// class : GeometryGUI_MultiTranslationDlg() -// purpose : Constructs a GeometryGUI_MultiTranslationDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_MultiTranslationDlg::GeometryGUI_MultiTranslationDlg( QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_MULTITRANSLATION_SIMPLE"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_MULTITRANSLATION_DOUBLE"))); - - if ( !name ) - setName( "GeometryGUI_MultiTranlationDlg" ); - resize( 303, 251 ); - setCaption( tr( "GEOM_MULTITRANSLATION_TITLE" ) ); - setSizeGripEnabled( TRUE ); - GeometryGUI_MultiTranslationDlgLayout = new QGridLayout( this ); - GeometryGUI_MultiTranslationDlgLayout->setSpacing( 6 ); - GeometryGUI_MultiTranslationDlgLayout->setMargin( 11 ); - - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "GEOM_MULTITRANSLATION" ) ); - GroupConstructors->setExclusive( TRUE ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setText( tr( "" ) ); - Constructor1->setPixmap( image0 ); - Constructor1->setChecked( TRUE ); - Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) ); - Constructor1->setMinimumSize( QSize( 50, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - Constructor2 = new QRadioButton( GroupConstructors, "Constructor2" ); - Constructor2->setText( tr( "" ) ); - Constructor2->setPixmap( image2 ); - Constructor2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor2->sizePolicy().hasHeightForWidth() ) ); - Constructor2->setMinimumSize( QSize( 50, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor2, 0, 2 ); - QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer_2, 0, 3 ); - QSpacerItem* spacer_3 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer_3, 0, 1 ); - - GeometryGUI_MultiTranslationDlgLayout->addWidget( GroupConstructors, 0, 0 ); - - /***************************************************************/ - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); - GroupButtons->setTitle( tr( "" ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 3 ); - buttonApply = new QPushButton( GroupButtons, "buttonApply" ); - buttonApply->setText( tr( "GEOM_BUT_APPLY" ) ); - buttonApply->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonApply, 0, 1 ); - QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_9, 0, 2 ); - buttonOk = new QPushButton( GroupButtons, "buttonOk" ); - buttonOk->setText( tr( "GEOM_BUT_OK" ) ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - GeometryGUI_MultiTranslationDlgLayout->addWidget( GroupButtons, 2, 0 ); - - /***************************************************************/ - GroupC1 = new QGroupBox( this, "GroupC1" ); - GroupC1->setTitle( tr( "GEOM_MULTITRANSLATION_SIMPLE" ) ); - GroupC1->setMinimumSize( QSize( 0, 0 ) ); - GroupC1->setFrameShape( QGroupBox::Box ); - GroupC1->setFrameShadow( QGroupBox::Sunken ); - GroupC1->setColumnLayout(0, Qt::Vertical ); - GroupC1->layout()->setSpacing( 0 ); - GroupC1->layout()->setMargin( 0 ); - GroupC1Layout = new QGridLayout( GroupC1->layout() ); - GroupC1Layout->setAlignment( Qt::AlignTop ); - GroupC1Layout->setSpacing( 6 ); - GroupC1Layout->setMargin( 11 ); - - TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" ); - TextLabelC1A1->setText( tr( "GEOM_MAIN_OBJECT" ) ); - TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A1->setFrameShape( QLabel::NoFrame ); - TextLabelC1A1->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabelC1A1, 0, 0 ); - - TextLabelC1A2 = new QLabel( GroupC1, "TextLabelC1A2" ); - TextLabelC1A2->setText( tr( "GEOM_VECTOR_U" ) ); - TextLabelC1A2->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A2->setFrameShape( QLabel::NoFrame ); - TextLabelC1A2->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabelC1A2, 1, 0 ); - - TextLabelC1A3 = new QLabel( GroupC1, "TextLabelC1A3" ); - TextLabelC1A3->setText( tr( "GEOM_STEP_U" ) ); - TextLabelC1A3->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A3->setFrameShape( QLabel::NoFrame ); - TextLabelC1A3->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabelC1A3, 2, 0 ); - - TextLabelC1A4 = new QLabel( GroupC1, "TextLabelC1A4" ); - TextLabelC1A4->setText( tr( "GEOM_NB_TIMES_U" ) ); - TextLabelC1A4->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A4->setFrameShape( QLabel::NoFrame ); - TextLabelC1A4->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabelC1A4, 3, 0 ); - - LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" ); - GroupC1Layout->addWidget( LineEditC1A1, 0, 2 ); - - LineEditC1A2 = new QLineEdit( GroupC1, "LineEditC1A2" ); - GroupC1Layout->addWidget( LineEditC1A2, 1, 2 ); - - /* a GeometryGUI_SpinBox */ - SpinBox_C1A3 = new GeometryGUI_SpinBox( GroupC1, "GeomSpinBox_C1A3" ) ; - SpinBox_C1A3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, SpinBox_C1A3->sizePolicy().hasHeightForWidth() ) ); - GroupC1Layout->addWidget( SpinBox_C1A3, 2, 2 ); - /* a QSpinBox */ - SpinBox_C1A4 = new QSpinBox( GroupC1, "SpinBox_C1A4" ) ; - SpinBox_C1A4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, SpinBox_C1A4->sizePolicy().hasHeightForWidth() ) ); - GroupC1Layout->addWidget( SpinBox_C1A4, 3, 2 ); - - CheckBoxReverse0 = new QCheckBox( GroupC1, "CheckBoxReverse0" ); - CheckBoxReverse0->setText( tr( "GEOM_REVERSE_U" ) ); - GroupC1Layout->addWidget( CheckBoxReverse0, 5, 0 ); - - SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" ); - SelectButtonC1A1->setText( tr( "" ) ); - SelectButtonC1A1->setPixmap( image1 ); - SelectButtonC1A1->setToggleButton( FALSE ); - SelectButtonC1A1->setMaximumSize( QSize( 28, 32767 ) ); - GroupC1Layout->addWidget( SelectButtonC1A1, 0, 1 ); - - SelectButtonC1A2 = new QPushButton( GroupC1, "SelectButtonC1A2" ); - SelectButtonC1A2->setText( tr( "" ) ); - SelectButtonC1A2->setPixmap( image1 ); - SelectButtonC1A2->setToggleButton( FALSE ); - SelectButtonC1A2->setMaximumSize( QSize( 28, 32767 ) ); - GroupC1Layout->addWidget( SelectButtonC1A2, 1, 1 ); - - GeometryGUI_MultiTranslationDlgLayout->addWidget( GroupC1, 1, 0 ); - - /***************************************************************/ - - GroupC2 = new QGroupBox( this, "GroupC2" ); - GroupC2->setTitle( tr( "GEOM_MULTITRANSLATION_DOUBLE" ) ); - GroupC2->setMinimumSize( QSize( 0, 0 ) ); - GroupC2->setFrameShape( QGroupBox::Box ); - GroupC2->setFrameShadow( QGroupBox::Sunken ); - GroupC2->setColumnLayout(0, Qt::Vertical ); - GroupC2->layout()->setSpacing( 0 ); - GroupC2->layout()->setMargin( 0 ); - GroupC2Layout = new QGridLayout( GroupC2->layout() ); - GroupC2Layout->setAlignment( Qt::AlignTop ); - GroupC2Layout->setSpacing( 6 ); - GroupC2Layout->setMargin( 11 ); - - TextLabelC2A1 = new QLabel( GroupC2, "TextLabelC2A1" ); - TextLabelC2A1->setText( tr( "GEOM_MAIN_OBJECT" ) ); - TextLabelC2A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC2A1->setFrameShape( QLabel::NoFrame ); - TextLabelC2A1->setFrameShadow( QLabel::Plain ); - GroupC2Layout->addWidget( TextLabelC2A1, 0, 0 ); - - TextLabelC2A2 = new QLabel( GroupC2, "TextLabelC2A2" ); - TextLabelC2A2->setText( tr( "GEOM_VECTOR_U" ) ); - TextLabelC2A2->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC2A2->setFrameShape( QLabel::NoFrame ); - TextLabelC2A2->setFrameShadow( QLabel::Plain ); - GroupC2Layout->addWidget( TextLabelC2A2, 1, 0 ); - - TextLabelC2A3 = new QLabel( GroupC2, "TextLabelC2A3" ); - TextLabelC2A3->setText( tr( "GEOM_VECTOR_V" ) ); - TextLabelC2A3->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC2A3->setFrameShape( QLabel::NoFrame ); - TextLabelC2A3->setFrameShadow( QLabel::Plain ); - GroupC2Layout->addWidget( TextLabelC2A3, 2, 0 ); - - TextLabelC2A4 = new QLabel( GroupC2, "TextLabelC2A4" ); - TextLabelC2A4->setText( tr( "GEOM_STEP_U" ) ); - TextLabelC2A4->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC2A4->setFrameShape( QLabel::NoFrame ); - TextLabelC2A4->setFrameShadow( QLabel::Plain ); - GroupC2Layout->addWidget( TextLabelC2A4, 3, 0 ); - - TextLabelC2A5 = new QLabel( GroupC2, "TextLabelC2A5" ); - TextLabelC2A5->setText( tr( "GEOM_NB_TIMES_U" ) ); - TextLabelC2A5->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC2A5->setFrameShape( QLabel::NoFrame ); - TextLabelC2A5->setFrameShadow( QLabel::Plain ); - GroupC2Layout->addWidget( TextLabelC2A5, 4, 0 ); - - TextLabelC2A6 = new QLabel( GroupC2, "TextLabelC2A6" ); - TextLabelC2A6->setText( tr( "GEOM_STEP_V" ) ); - TextLabelC2A6->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC2A6->setFrameShape( QLabel::NoFrame ); - TextLabelC2A6->setFrameShadow( QLabel::Plain ); - GroupC2Layout->addWidget( TextLabelC2A6, 6, 0 ); - - TextLabelC2A7 = new QLabel( GroupC2, "TextLabelC2A7" ); - TextLabelC2A7->setText( tr( "GEOM_NB_TIMES_V" ) ); - TextLabelC2A7->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC2A7->setFrameShape( QLabel::NoFrame ); - TextLabelC2A7->setFrameShadow( QLabel::Plain ); - GroupC2Layout->addWidget( TextLabelC2A7, 7, 0 ); - - LineEditC2A1 = new QLineEdit( GroupC2, "LineEditC2A1" ); - GroupC2Layout->addWidget( LineEditC2A1, 0, 2 ); - - LineEditC2A2 = new QLineEdit( GroupC2, "LineEditC2A2" ); - GroupC2Layout->addWidget( LineEditC2A2, 1, 2 ); - - LineEditC2A3 = new QLineEdit( GroupC2, "LineEditC2A3" ); - GroupC2Layout->addWidget( LineEditC2A3, 2, 2 ); - - /* a GeometryGUI_SpinBox */ - SpinBox_C2A4 = new GeometryGUI_SpinBox( GroupC2, "GeomSpinBox_C2A4" ) ; - SpinBox_C2A4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, SpinBox_C2A4->sizePolicy().hasHeightForWidth() ) ); - GroupC2Layout->addWidget( SpinBox_C2A4, 3, 2 ); - /* a QSpinBox */ - SpinBox_C2A5 = new QSpinBox( GroupC2, "SpinBox_C2A5" ) ; - SpinBox_C2A5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, SpinBox_C2A5->sizePolicy().hasHeightForWidth() ) ); - GroupC2Layout->addWidget( SpinBox_C2A5, 4, 2 ); - - /* a GeometryGUI_SpinBox */ - SpinBox_C2A6 = new GeometryGUI_SpinBox( GroupC2, "GeomSpinBox_C2A6" ) ; - SpinBox_C2A6->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, SpinBox_C2A6->sizePolicy().hasHeightForWidth() ) ); - GroupC2Layout->addWidget( SpinBox_C2A6, 6, 2 ); - /* a QSpinBox */ - SpinBox_C2A7 = new QSpinBox( GroupC2, "SpinBox_C2A7" ) ; - SpinBox_C2A7->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, SpinBox_C2A7->sizePolicy().hasHeightForWidth() ) ); - GroupC2Layout->addWidget( SpinBox_C2A7, 7, 2 ); - - - CheckBoxReverse1 = new QCheckBox( GroupC2, "CheckBoxReverse1" ); - CheckBoxReverse1->setText( tr( "GEOM_REVERSE_U" ) ); - GroupC2Layout->addWidget( CheckBoxReverse1, 5, 0 ); - - CheckBoxReverse2 = new QCheckBox( GroupC2, "CheckBoxReverse2" ); - CheckBoxReverse2->setText( tr( "GEOM_REVERSE_V" ) ); - GroupC2Layout->addWidget( CheckBoxReverse2, 8, 0 ); - - SelectButtonC2A1 = new QPushButton( GroupC2, "SelectButtonC2A1" ); - SelectButtonC2A1->setText( tr( "" ) ); - SelectButtonC2A1->setPixmap( image1 ); - SelectButtonC2A1->setToggleButton( FALSE ); - SelectButtonC2A1->setMaximumSize( QSize( 28, 32767 ) ); - GroupC2Layout->addWidget( SelectButtonC2A1, 0, 1 ); - - SelectButtonC2A2 = new QPushButton( GroupC2, "SelectButtonC2A2" ); - SelectButtonC2A2->setText( tr( "" ) ); - SelectButtonC2A2->setPixmap( image1 ); - SelectButtonC2A2->setToggleButton( FALSE ); - SelectButtonC2A2->setMaximumSize( QSize( 28, 32767 ) ); - GroupC2Layout->addWidget( SelectButtonC2A2, 1, 1 ); - - SelectButtonC2A3 = new QPushButton( GroupC2, "SelectButtonC2A3" ); - SelectButtonC2A3->setText( tr( "" ) ); - SelectButtonC2A3->setPixmap( image1 ); - SelectButtonC2A3->setToggleButton( FALSE ); - SelectButtonC2A3->setMaximumSize( QSize( 28, 32767 ) ); - GroupC2Layout->addWidget( SelectButtonC2A3, 2, 1 ); - - GeometryGUI_MultiTranslationDlgLayout->addWidget( GroupC2, 1, 0 ); - - /***************************************************************/ - - - Init(Sel) ; /* Initialisations */ -} - -//================================================================================= -// function : ~GeometryGUI_MultiTranslationDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_MultiTranslationDlg::~GeometryGUI_MultiTranslationDlg() -{ - // no need to delete child widgets, Qt does it all for us - this->destroy(TRUE, TRUE) ; -} - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_MultiTranslationDlg::Init( SALOME_Selection* Sel ) -{ - - /* Get setting of step value from file configuration */ - double step ; - QString St = QAD_CONFIG->getSetting( "Geometry:SettingsGeomStep" ) ; - step = St.toDouble() ; - - /* min, max, step and decimals for geom spin boxes */ - SpinBox_C1A3->RangeStepAndValidator( -999.999, 999.999, step, 3 ) ; /* step U : constructor 1 */ - SpinBox_C1A3->SetValue( 50 ) ; - SpinBox_C2A4->RangeStepAndValidator( -999.999, 999.999, step, 3 ) ; /* step U : constructor 2 */ - SpinBox_C2A4->SetValue( 50 ) ; - SpinBox_C2A6->RangeStepAndValidator( -999.999, 999.999, step, 3 ) ; /* step V : constructor 2 */ - SpinBox_C2A6->SetValue( 50 ) ; - - /* min, max, step for QT spin boxes */ - SpinBox_C1A4->setMinValue( 1 ); /* myNbTimes1 : constructor 1 */ - SpinBox_C1A4->setMaxValue( 10000 ); - SpinBox_C1A4->setWrapping( TRUE ); - SpinBox_C1A4->setValue(2) ; - - SpinBox_C2A5->setMinValue( 1 ); /* myNbTimes1 : constructor 2 */ - SpinBox_C2A5->setMaxValue( 10000 ); - SpinBox_C2A5->setWrapping( TRUE ); - SpinBox_C2A5->setValue(2) ; - - SpinBox_C2A7->setMinValue( 1 ); /* myNbTimes2 : constructor 2 */ - SpinBox_C2A7->setMaxValue( 10000 ); - SpinBox_C2A7->setWrapping( TRUE ); - SpinBox_C2A7->setValue(2) ; - - myStep1 = 50.0 ; - myStep2 = 50.0 ; - myNbTimes1 = 2 ; - myNbTimes2 = 2 ; - - GroupC1->show(); - GroupC2->hide() ; - myConstructorId = 0 ; - Constructor1->setChecked( TRUE ); - myEditCurrentArgument = LineEditC1A1 ; - mySelection = Sel; - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - - myOkBase = myOkDir1 = myOkDir2 = false ; - mySimulationTopoDs.Nullify() ; - myBase.Nullify() ; - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - - // TODO : set previous selection into argument ? - - /* Filter definitions */ - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - myEdgeFilter = new GEOM_EdgeFilter( StdSelect_Line, myGeom ); - - /* signals and slots connections */ - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ; - connect( buttonApply, SIGNAL( clicked() ), this, SLOT(ClickOnApply() ) ); - - connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) ); - connect( SelectButtonC1A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( SelectButtonC1A2, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( SelectButtonC2A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( SelectButtonC2A2, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( SelectButtonC2A3, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - - /* GeometryGUI_SpinBox */ - connect( SpinBox_C1A3, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ; - connect( SpinBox_C2A4, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ; - connect( SpinBox_C2A6, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ; - - connect( LineEditC1A1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - connect( LineEditC1A2, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - connect( LineEditC2A1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - connect( LineEditC2A2, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - connect( LineEditC2A3, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - - /* QSpinBox */ - connect( SpinBox_C1A4, SIGNAL ( valueChanged(int) ), this, SLOT( ValueChangedInt(int) ) ) ; /* Not const ! */ - connect( SpinBox_C2A5, SIGNAL ( valueChanged(int) ), this, SLOT( ValueChangedInt(int) ) ) ; - connect( SpinBox_C2A7, SIGNAL ( valueChanged(int) ), this, SLOT( ValueChangedInt(int) ) ) ; - - connect( CheckBoxReverse0, SIGNAL (stateChanged(int) ), this, SLOT( ReverseAngle1(int) ) ) ; - connect( CheckBoxReverse1, SIGNAL (stateChanged(int) ), this, SLOT( ReverseAngle1(int) ) ) ; - connect( CheckBoxReverse2, SIGNAL (stateChanged(int) ), this, SLOT( ReverseAngle2(int) ) ) ; - - connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ; - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - /* to close dialog if study change */ - connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ; - - /* Move widget on the botton right corner of main widget */ - int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; - this->show() ; /* displays Dialog */ - - return ; -} - -//================================================================================= -// function : ReverseAngle1() -// purpose : 'state' not used here -//================================================================================= -void GeometryGUI_MultiTranslationDlg::ReverseAngle1(int state) -{ - myStep1 = -myStep1 ; - SpinBox_C1A3->SetValue( myStep1 ) ; - SpinBox_C2A4->SetValue( myStep1 ) ; - if( myOkBase && myOkDir1 ) { - MakeMultiTranslationSimulationAndDisplay() ; - } - else { - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - } - return ; -} - - -//================================================================================= -// function : ReverseAngle2() -// purpose : 'state' not used here -//================================================================================= -void GeometryGUI_MultiTranslationDlg::ReverseAngle2(int state) -{ - myStep2 = -myStep2 ; - SpinBox_C2A6->SetValue( myStep2 ) ; - if( myOkBase && myOkDir1 && myOkDir2 ) { - MakeMultiTranslationSimulationAndDisplay() ; - } - else { - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - } - return ; -} - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_MultiTranslationDlg::ConstructorsClicked(int constructorId) -{ - myEditCurrentArgument->setText(tr("")) ; - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - - myStep1 = 50.0 ; - myStep2 = 50.0 ; - myNbTimes1 = 2; - myNbTimes2 = 2; - - myOkBase = myOkDir1 = myOkDir2 = false ; - myConstructorId = constructorId ; - - switch (constructorId) - { - case 0: /* Translate simple */ - { - GroupC1->show(); - GroupC2->hide() ; - myEditCurrentArgument = LineEditC1A1 ; - SpinBox_C1A3->SetValue(50) ; - SpinBox_C1A4->setValue(2) ; - LineEditC1A1->setText(tr("")) ; - LineEditC1A2->setText(tr("")) ; - break; - } - - case 1: /* Translate double */ - { - GroupC1->hide(); - GroupC2->show() ; - myEditCurrentArgument = LineEditC2A1 ; - SpinBox_C2A4->SetValue(50) ; - SpinBox_C2A5->setValue(2) ; - SpinBox_C2A6->SetValue(50) ; - SpinBox_C2A7->setValue(2) ; - LineEditC2A1->setText(tr("")) ; - LineEditC2A2->setText(tr("")) ; - LineEditC2A3->setText(tr("")) ; - break ; - } - - } - - return ; -} - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_MultiTranslationDlg::ClickOnOk() -{ - this->ClickOnApply() ; - this->ClickOnCancel() ; - - return ; -} - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_MultiTranslationDlg::ClickOnApply() -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - myGeomGUI->GetDesktop()->putInfo( tr("") ) ; - switch(myConstructorId) - { - case 0 : - { - if(myOkBase && myOkDir1 ) { - myGeomGUI->MakeMultiTranslation1DAndDisplay( myGeomShape, myDir1, myStep1, myNbTimes1 ) ; - } - break ; - } - case 1 : - { - if(myOkBase && myOkDir1 && myOkDir2 ) { - myGeomGUI->MakeMultiTranslation2DAndDisplay( myGeomShape, myDir1, myStep1, myNbTimes1, myDir2, myStep2, myNbTimes2 ) ; - } - break ; - } - } - return ; -} - - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void GeometryGUI_MultiTranslationDlg::ClickOnCancel() -{ - mySelection->ClearFilters() ; - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->ResetState() ; - reject() ; - return ; -} - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_MultiTranslationDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender() ; - if( send == LineEditC1A1 ) - myEditCurrentArgument = LineEditC1A1 ; - else if ( send == LineEditC1A2 ) - myEditCurrentArgument = LineEditC1A2 ; - else if ( send == LineEditC2A1 ) - myEditCurrentArgument = LineEditC2A1; - else if ( send == LineEditC2A2 ) - myEditCurrentArgument = LineEditC2A2 ; - else if ( send == LineEditC2A3 ) - myEditCurrentArgument = LineEditC2A3 ; - else - return ; - - /* User name of object input management */ - /* If successfull the selection is changed and signal emitted... */ - /* so SelectionIntoArgument() is automatically called. */ - const QString objectUserName = myEditCurrentArgument->text() ; - QWidget* thisWidget = (QWidget*)this ; - if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) { - myEditCurrentArgument->setText( objectUserName ) ; - } - return ; -} - - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -//================================================================================= -void GeometryGUI_MultiTranslationDlg::SelectionIntoArgument() -{ - myEditCurrentArgument->setText("") ; - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - - /* Future name of selection */ - QString aString = ""; - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; - - TopoDS_Shape S; - Standard_Boolean testResult ; - - switch (myConstructorId) - { - case 0 : - { - if ( nbSel != 1 ) { - if ( myEditCurrentArgument == LineEditC1A1 ) { - myEditCurrentArgument->setText("") ; - myOkBase = false ; - } - else if ( myEditCurrentArgument == LineEditC1A2 ) { - myEditCurrentArgument->setText("") ; - myOkDir1 = false ; - } - return ; - } - - Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject() ; - if( !myGeomGUI->GetTopoFromSelection(mySelection, S) ) - return ; - - if ( myEditCurrentArgument == LineEditC1A1 ) { - myGeomShape = myGeomGUI->ConvertIOinGEOMShape(IO, testResult) ; - if( !testResult ) - return ; - myEditCurrentArgument->setText(aString) ; - myBase = S ; - myOkBase = true ; - } - else if ( myEditCurrentArgument == LineEditC1A2 ) { - BRepAdaptor_Curve curv(TopoDS::Edge(S)); - myDir1 = curv.Line().Direction(); - myEditCurrentArgument->setText(aString) ; - myOkDir1 = true ; - } - - if (myOkBase && myOkDir1 ) { - MakeMultiTranslationSimulationAndDisplay() ; - } - else { - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - } - break; - } - case 1 : - { - if ( nbSel != 1 ) { - if ( myEditCurrentArgument == LineEditC2A1 ) { - myEditCurrentArgument->setText("") ; - myOkBase = false ; - } - else if ( myEditCurrentArgument == LineEditC2A2 ) { - myEditCurrentArgument->setText("") ; - myOkDir1 = false ; - } - else if ( myEditCurrentArgument == LineEditC2A3 ) { - myEditCurrentArgument->setText("") ; - myOkDir2 = false ; - } - return ; - } - - Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject() ; - if( !myGeomGUI->GetTopoFromSelection(mySelection, S) ) - return ; - - if ( myEditCurrentArgument == LineEditC2A1 ) { - myGeomShape = myGeomGUI->ConvertIOinGEOMShape(IO, testResult) ; - if( !testResult ) - return ; - myEditCurrentArgument->setText(aString) ; - myBase = S ; - myOkBase = true ; - } - else if ( myEditCurrentArgument == LineEditC2A2 ) { - BRepAdaptor_Curve curv(TopoDS::Edge(S)); - myDir1 = curv.Line().Direction(); - myEditCurrentArgument->setText(aString) ; - myOkDir1 = true ; - } - else if ( myEditCurrentArgument == LineEditC2A3 ) { - BRepAdaptor_Curve curv(TopoDS::Edge(S)); - myDir2 = curv.Line().Direction(); - myEditCurrentArgument->setText(aString) ; - myOkDir2 = true ; - } - - if (myOkBase && myOkDir1 && myOkDir2 ) { - MakeMultiTranslationSimulationAndDisplay() ; - } - else { - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - } - break; - } - } - - return ; -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_MultiTranslationDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - switch (myConstructorId) - { - case 0 : - { - if(send == SelectButtonC1A1) { - LineEditC1A1->setFocus() ; - myEditCurrentArgument = LineEditC1A1; - mySelection->ClearFilters() ; - } - else if(send == SelectButtonC1A2) { - LineEditC1A2->setFocus() ; - myEditCurrentArgument = LineEditC1A2; - mySelection->AddFilter(myEdgeFilter) ; - } - SelectionIntoArgument() ; - break; - } - case 1 : - { - if(send == SelectButtonC2A1) { - LineEditC2A1->setFocus() ; - myEditCurrentArgument = LineEditC2A1; - mySelection->ClearFilters() ; - } - else if(send == SelectButtonC2A2) { - LineEditC2A2->setFocus() ; - myEditCurrentArgument = LineEditC2A2; - mySelection->AddFilter(myEdgeFilter) ; - } - else if(send == SelectButtonC2A3) { - LineEditC2A3->setFocus() ; - myEditCurrentArgument = LineEditC2A3; - mySelection->AddFilter(myEdgeFilter) ; - } - SelectionIntoArgument() ; - break; - } - } - return ; -} - - -//================================================================================= -// function : ValueChangedInt() -// purpose : (General QT SpinBox) -//================================================================================= -void GeometryGUI_MultiTranslationDlg::ValueChangedInt( int newIntValue ) -{ - QSpinBox* send = (QSpinBox*)sender(); - - /* First constructor */ - if( send == SpinBox_C1A4 ) { - myNbTimes1 = newIntValue ; - } - /* Second constructor */ - else if( send == SpinBox_C2A5 ) { - myNbTimes1 = newIntValue ; - } - else if( send == SpinBox_C2A7 ) { - myNbTimes2 = newIntValue ; - } - - switch (myConstructorId) - { - case 0 : - { - if (myOkBase && myOkDir1 ) { - MakeMultiTranslationSimulationAndDisplay() ; - } - else { - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - } - break; - } - case 1 : - { - if (myOkBase && myOkDir1 && myOkDir2 ) { - MakeMultiTranslationSimulationAndDisplay() ; - } - else { - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - } - break; - } - } - return ; -} - - -//================================================================================= -// function : ValueChangedInSpinBox() -// purpose : (specifig for GeometryGUI_SpinBox) -//================================================================================= -void GeometryGUI_MultiTranslationDlg::ValueChangedInSpinBox( double newValue ) -{ - GeometryGUI_SpinBox* send = (GeometryGUI_SpinBox*)sender(); - - /* First constructor */ - if( send == SpinBox_C1A3 ) { - myStep1 = newValue ; - } - /* Second constructor */ - else if( send == SpinBox_C2A4 ) { - myStep1 = newValue ; - } - else if( send == SpinBox_C2A6 ) { - myStep2 = newValue ; - } - - switch (myConstructorId) - { - case 0 : - { - if (myOkBase && myOkDir1 ) { - MakeMultiTranslationSimulationAndDisplay() ; - } - else { - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - } - break; - } - case 1 : - { - if (myOkBase && myOkDir1 && myOkDir2 ) { - MakeMultiTranslationSimulationAndDisplay() ; - } - else { - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - } - break; - } - } - return ; -} - - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void GeometryGUI_MultiTranslationDlg::DeactivateActiveDialog() -{ - if ( GroupConstructors->isEnabled() ) { - GroupConstructors->setEnabled(false) ; - GroupC1->setEnabled(false) ; - GroupC2->setEnabled(false) ; - GroupButtons->setEnabled(false) ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->EraseSimulationShape() ; - mySelection->ClearFilters() ; - myGeomGUI->ResetState() ; - myGeomGUI->SetActiveDialogBox(0) ; - myGeomGUI->OnDisplayAll(true) ; - } - return ; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_MultiTranslationDlg::ActivateThisDialog() -{ - /* Emit a signal to deactivate the active dialog */ - myGeomGUI->EmitSignalDeactivateDialog() ; - GroupConstructors->setEnabled(true) ; - GroupC1->setEnabled(true) ; - GroupC2->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - if( !mySimulationTopoDs.IsNull() ) - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - return ; -} - - - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void GeometryGUI_MultiTranslationDlg::enterEvent(QEvent* e) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; - return ; -} - - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_MultiTranslationDlg::closeEvent( QCloseEvent* e ) -{ - this->ClickOnCancel() ; /* same than click on cancel button */ - return ; -} - - -//================================================================================= -// function : MakeMultiTranslationSimulationAndDisplay() -// purpose : -//================================================================================= -void GeometryGUI_MultiTranslationDlg::MakeMultiTranslationSimulationAndDisplay() -{ - myGeomGUI->EraseSimulationShape() ; - gp_Trsf theTransformation ; - mySimulationTopoDs.Nullify() ; - - int i ; - int j ; - Standard_Real DX ; - Standard_Real DY ; - Standard_Real DZ ; - GProp_GProps System ; - gp_Pnt myPoint ; - TopoDS_Compound compound; - BRep_Builder B; - - B.MakeCompound( compound ); - TopoDS_Shape S ; - - try { - - BRepGProp::LinearProperties(myBase, System); - myPoint = System.CentreOfMass() ; - S = BRepBuilderAPI_MakeVertex(myPoint).Shape(); - - switch (myConstructorId) - { - case 0 : - { - gp_Vec Vec(myDir1) ; - Vec.Normalize(); - - for ( i = 0; i < myNbTimes1; i++ ) { - DX = i * myStep1 * Vec.X() ; - DY = i * myStep1 * Vec.Y() ; - DZ = i * myStep1 * Vec.Z() ; - myVec.SetCoord( DX, DY, DZ ) ; - - theTransformation.SetTranslation(myVec) ; - BRepBuilderAPI_Transform myBRepTransformation(S, theTransformation, Standard_False) ; - B.Add( compound, myBRepTransformation.Shape() ); - } - mySimulationTopoDs = compound; - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - break; - } - case 1 : - { - gp_Vec Vec1(myDir1) ; - Vec1.Normalize(); - gp_Vec Vec2(myDir2) ; - Vec2.Normalize(); - - for ( i = 0; i < myNbTimes1; i++ ) { - for ( j = 0; j < myNbTimes2; j++ ) { - DX = i * myStep1 * Vec1.X() + j * myStep2 * Vec2.X() ; - DY = i * myStep1 * Vec1.Y() + j * myStep2 * Vec2.Y() ; - DZ = i * myStep1 * Vec1.Z() + j * myStep2 * Vec2.Z() ; - myVec.SetCoord( DX, DY, DZ ) ; - - theTransformation.SetTranslation(myVec) ; - BRepBuilderAPI_Transform myBRepTransformation(S, theTransformation, Standard_False) ; - B.Add( compound, myBRepTransformation.Shape() ); - } - } - mySimulationTopoDs = compound ; - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - break; - } - } - } - catch(Standard_Failure) { - MESSAGE( "Exception catched in MakeMultitranslationSimulationAndDisplay" ) ; - return ; - } - return ; -} diff --git a/src/GEOMGUI/GeometryGUI_MultiTranslationDlg.h b/src/GEOMGUI/GeometryGUI_MultiTranslationDlg.h deleted file mode 100644 index d0b366dc9..000000000 --- a/src/GEOMGUI/GeometryGUI_MultiTranslationDlg.h +++ /dev/null @@ -1,169 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_MultiTranslationDlg.h -// Author : Damien COQUERET -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_MULTITRANSLATION_H -#define DIALOGBOX_MULTITRANSLATION_H - -#include "SALOME_Selection.h" -#include "GEOM_ShapeTypeFilter.hxx" -#include "GEOM_EdgeFilter.hxx" -#include "GeometryGUI_SpinBox.h" - -#include -#include - -#include -#include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QCheckBox; -class QGroupBox; -class QLabel; -class QSpinBox; -class QLineEdit; -class QPushButton; -class QSpinBox; -class QRadioButton; -class GeometryGUI; - -//================================================================================= -// class : GeometryGUI_MultiTranslationDlg -// purpose : -//================================================================================= -class GeometryGUI_MultiTranslationDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_MultiTranslationDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 ); - ~GeometryGUI_MultiTranslationDlg(); - -private : - - GEOM::GEOM_Gen_var myGeom ; /* Current Geom object */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - TopoDS_Shape mySimulationTopoDs ; /* Shape used for simulation display */ - SALOME_Selection* mySelection ; /* User shape selection */ - TopoDS_Shape myBase ; - GEOM::GEOM_Shape_var myGeomShape ; /* is myBase */ - - gp_Vec myVec ; - int myNbTimes1 ; - int myNbTimes2 ; - Standard_Real myStep1 ; - Standard_Real myStep2 ; - gp_Dir myDir1 ; - gp_Dir myDir2 ; - - bool myOkBase ; - bool myOkDir1 ; - bool myOkDir2 ; - - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - int myConstructorId ; /* Current constructor id = radio button id */ - Handle(GEOM_EdgeFilter) myEdgeFilter; /* Filter selection */ - - void closeEvent( QCloseEvent* e ) ; - void enterEvent( QEvent* e); - void Init( SALOME_Selection* Sel ) ; - void MakeMultiTranslationSimulationAndDisplay() ; - - QButtonGroup* GroupConstructors; - QRadioButton* Constructor1; - QRadioButton* Constructor2; - - QGroupBox* GroupButtons; - QPushButton* buttonOk; - QPushButton* buttonCancel; - QPushButton* buttonApply; - - QGroupBox* GroupC1; - QPushButton* SelectButtonC1A2; - QLineEdit* LineEditC1A1; - QLineEdit* LineEditC1A2; - QPushButton* SelectButtonC1A1; - QLabel* TextLabelC1A1; - QLabel* TextLabelC1A2; - - QLabel* TextLabelC1A3; - QLabel* TextLabelC1A4; - GeometryGUI_SpinBox* SpinBox_C1A3 ; - QSpinBox* SpinBox_C1A4 ; - - QGroupBox* GroupC2; - QPushButton* SelectButtonC2A2; - QLineEdit* LineEditC2A1; - QLineEdit* LineEditC2A2; - QPushButton* SelectButtonC2A1; - QLineEdit* LineEditC2A3; - QPushButton* SelectButtonC2A3; - QLabel* TextLabelC2A1; - QLabel* TextLabelC2A2; - QLabel* TextLabelC2A3; - - QLabel* TextLabelC2A4; - QLabel* TextLabelC2A5; - QLabel* TextLabelC2A6; - QLabel* TextLabelC2A7; - GeometryGUI_SpinBox* SpinBox_C2A4 ; - QSpinBox* SpinBox_C2A5; - GeometryGUI_SpinBox* SpinBox_C2A6 ; - QSpinBox* SpinBox_C2A7 ; - - QCheckBox* CheckBoxReverse0; - QCheckBox* CheckBoxReverse1; - QCheckBox* CheckBoxReverse2; - -private slots: - - void ConstructorsClicked(int constructorId); - void ClickOnOk(); - void ClickOnCancel(); - void ClickOnApply(); - void SetEditCurrentArgument() ; - void SelectionIntoArgument() ; - void DeactivateActiveDialog() ; - void ActivateThisDialog() ; - void LineEditReturnPressed() ; - void ReverseAngle1(int) ; - void ReverseAngle2(int) ; - void ValueChangedInSpinBox( double newValue ) ; /* for GeometryGUI_SpinBox */ - void ValueChangedInt( int newIntValue ) ; /* for QT spin box ! not const ! */ - -protected: - QGridLayout* GeometryGUI_MultiTranslationDlgLayout; - QGridLayout* GroupConstructorsLayout; - QGridLayout* GroupButtonsLayout; - QGridLayout* GroupC1Layout; - QGridLayout* GroupC2Layout; -}; - -#endif // DIALOGBOX_MULTITRANSLATION_H diff --git a/src/GEOMGUI/GeometryGUI_NbIsosDlg.cxx b/src/GEOMGUI/GeometryGUI_NbIsosDlg.cxx deleted file mode 100644 index 849cb1a1d..000000000 --- a/src/GEOMGUI/GeometryGUI_NbIsosDlg.cxx +++ /dev/null @@ -1,135 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_NbIsosDlg.cxx -// Author : -// Module : GEOM -// $Header: - -using namespace std; -#include "GeometryGUI_NbIsosDlg.h" -#include "GeometryGUI.h" -#include "QAD_Tools.h" - -#include -#include -#include -#include -#include - -//================================================================================= -// class : GeometryGUI_NbIsosDlg() -// purpose : Constructs a GeometryGUI_NbIsosDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_NbIsosDlg::GeometryGUI_NbIsosDlg( QWidget* parent, const char* name, bool modal, WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - if ( !name ) - setName( "GeometryGUI_NbIsosDlg" ); - setCaption( name ); - setSizeGripEnabled( TRUE ); - QGridLayout* MyDialogLayout = new QGridLayout( this ); - MyDialogLayout->setSpacing( 6 ); - MyDialogLayout->setMargin( 11 ); - - /***************************************************************/ - QGroupBox* GroupC1 = new QGroupBox( this, "GroupC1" ); - GroupC1->setColumnLayout(0, Qt::Vertical ); - GroupC1->layout()->setSpacing( 0 ); - GroupC1->layout()->setMargin( 0 ); - QGridLayout* GroupC1Layout = new QGridLayout( GroupC1->layout() ); - GroupC1Layout->setAlignment( Qt::AlignTop ); - GroupC1Layout->setSpacing( 6 ); - GroupC1Layout->setMargin( 11 ); - - TextLabel1 = new QLabel( GroupC1, "TextLabel1" ); - TextLabel1->setText( tr( "GEOM_MEN_ISOU") ); - GroupC1Layout->addWidget( TextLabel1, 0, 0 ); - - SpinBoxU = new QSpinBox( GroupC1, "SpinBoxU" ); - SpinBoxU->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - SpinBoxU->setMinValue( 1 ); - SpinBoxU->setValue( 1 ); - GroupC1Layout->addWidget( SpinBoxU, 0, 1 ); - - TextLabel2 = new QLabel( GroupC1, "TextLabel2" ); - TextLabel2->setText( tr( "GEOM_MEN_ISOV") ) ; - GroupC1Layout->addWidget( TextLabel2, 0, 2 ); - - SpinBoxV = new QSpinBox( GroupC1, "SpinBoxV"); - SpinBoxV->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - SpinBoxV->setValue( 1 ); - SpinBoxV->setMinValue( 1 ); - GroupC1Layout->addWidget( SpinBoxV, 0, 3 ); - - /***************************************************************/ - QGroupBox* GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - - buttonOk = new QPushButton( GroupButtons, "buttonOk" ); - buttonOk->setText( tr( "GEOM_BUT_OK" ) ) ; - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - - GroupButtonsLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 ); - - buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - buttonCancel->setText( tr( "GEOM_BUT_CANCEL" ) ) ; - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 2 ); - /***************************************************************/ - - MyDialogLayout->addWidget( GroupC1, 0, 0 ); - MyDialogLayout->addWidget( GroupButtons, 1, 0 ); - - /* Retrieve GeomGUI */ - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - - // signals and slots connections - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); - - /* Move widget on the botton right corner of main widget */ - QAD_Tools::centerWidget( this, parent ); -} - - -//================================================================================= -// function : ~GeometryGUI_NbIsosDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_NbIsosDlg::~GeometryGUI_NbIsosDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - diff --git a/src/GEOMGUI/GeometryGUI_NbIsosDlg.h b/src/GEOMGUI/GeometryGUI_NbIsosDlg.h deleted file mode 100644 index a5d3498cd..000000000 --- a/src/GEOMGUI/GeometryGUI_NbIsosDlg.h +++ /dev/null @@ -1,61 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_NbIsosDlg.h -// Author : -// Module : GEOM -// $Header: - -#ifndef GEOMETRYGUI_NBISOSDLG_H -#define GEOMETRYGUI_NBISOSDLG_H - -#include - -class QLabel; -class QSpinBox; -class QPushButton; -class GeometryGUI; - -//================================================================================= -// class : GeometryGUI_NbIsosDlg -// purpose : -//================================================================================= -class GeometryGUI_NbIsosDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_NbIsosDlg( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); - ~GeometryGUI_NbIsosDlg(); - - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - - QPushButton* buttonOk; - QPushButton* buttonCancel; - QLabel* TextLabel1 ; - QLabel* TextLabel2 ; - QSpinBox* SpinBoxU ; - QSpinBox* SpinBoxV ; -}; - -#endif // GEOMETRYGUI_NBISOSDLG_H diff --git a/src/GEOMGUI/GeometryGUI_OrientationDlg.cxx b/src/GEOMGUI/GeometryGUI_OrientationDlg.cxx deleted file mode 100644 index 1970e6e97..000000000 --- a/src/GEOMGUI/GeometryGUI_OrientationDlg.cxx +++ /dev/null @@ -1,608 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_OrientationDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_OrientationDlg.h" - -#include "GeometryGUI.h" -#include "QAD_Application.h" -#include "QAD_Desktop.h" -#include "QAD_Config.h" -#include "utilities.h" - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -//================================================================================= -// class : GeometryGUI_OrientationDlg() -// purpose : Constructs a GeometryGUI_OrientationDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_OrientationDlg::GeometryGUI_OrientationDlg( QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_ORIENTATION"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - if ( !name ) - setName( "GeometryGUI_OrientationDlg" ); - resize( 303, 242 ); - setCaption( tr( "GEOM_ORIENTATION_TITLE" ) ); - setSizeGripEnabled( TRUE ); - GeometryGUI_OrientationDlgLayout = new QGridLayout( this ); - GeometryGUI_OrientationDlgLayout->setSpacing( 6 ); - GeometryGUI_OrientationDlgLayout->setMargin( 11 ); - - /***************************************************************/ - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "GEOM_ORIENTATION" ) ); - GroupConstructors->setExclusive( TRUE ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setText( tr( "" ) ); - Constructor1->setPixmap( image0 ); - Constructor1->setChecked( TRUE ); - Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) ); - Constructor1->setMinimumSize( QSize( 50, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer, 0, 1 ); - GeometryGUI_OrientationDlgLayout->addWidget( GroupConstructors, 0, 0 ); - - /***************************************************************/ - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); - GroupButtons->setTitle( tr( "" ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 3 ); - buttonApply = new QPushButton( GroupButtons, "buttonApply" ); - buttonApply->setText( tr( "GEOM_BUT_APPLY" ) ); - buttonApply->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonApply, 0, 1 ); - QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_9, 0, 2 ); - buttonOk = new QPushButton( GroupButtons, "buttonOk" ); - buttonOk->setText( tr( "GEOM_BUT_OK" ) ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - GeometryGUI_OrientationDlgLayout->addWidget( GroupButtons, 2, 0 ); - - /***************************************************************/ - GroupC1 = new QGroupBox( this, "GroupC1" ); - GroupC1->setTitle( tr( "GEOM_ARGUMENTS" ) ); - GroupC1->setMinimumSize( QSize( 0, 0 ) ); - GroupC1->setFrameShape( QGroupBox::Box ); - GroupC1->setFrameShadow( QGroupBox::Sunken ); - GroupC1->setColumnLayout(0, Qt::Vertical ); - GroupC1->layout()->setSpacing( 0 ); - GroupC1->layout()->setMargin( 0 ); - GroupC1Layout = new QGridLayout( GroupC1->layout() ); - GroupC1Layout->setAlignment( Qt::AlignTop ); - GroupC1Layout->setSpacing( 6 ); - GroupC1Layout->setMargin( 11 ); - LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" ); - GroupC1Layout->addWidget( LineEditC1A1, 0, 2 ); - - /* Spin box construction */ - SpinBox_C1A2 = new GeometryGUI_SpinBox( GroupC1, "GeomSpinBox_C1A2" ) ; - GroupC1Layout->addWidget( SpinBox_C1A2, 1, 2 ); - - SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" ); - SelectButtonC1A1->setText( tr( "" ) ); - SelectButtonC1A1->setPixmap( image1 ); - SelectButtonC1A1->setToggleButton( FALSE ); - GroupC1Layout->addWidget( SelectButtonC1A1, 0, 1 ); - TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" ); - TextLabelC1A1->setText( tr( "GEOM_OBJECT" ) ); - TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A1->setFrameShape( QLabel::NoFrame ); - TextLabelC1A1->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabelC1A1, 0, 0 ); - TextLabelC1A2 = new QLabel( GroupC1, "TextLabelC1A2" ); - TextLabelC1A2->setText( tr( "GEOM_VECTOR_LENGTH" ) ); - TextLabelC1A2->setMinimumSize( QSize( 50, 0 ) ); - GroupC1Layout->addWidget( TextLabelC1A2, 1, 0 ); - CheckBoxReverse = new QCheckBox( GroupC1, "CheckBoxReverse" ); - CheckBoxReverse->setText( tr( "GEOM_ORIENTATION_OPT" ) ); - GroupC1Layout->addMultiCellWidget( CheckBoxReverse, 2, 2, 0, 2 ); - GeometryGUI_OrientationDlgLayout->addWidget( GroupC1, 1, 0 ); - /***************************************************************/ - - Init(Sel) ; /* Initialisations */ - -} - -//================================================================================= -// function : ~GeometryGUI_OrientationDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_OrientationDlg::~GeometryGUI_OrientationDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_OrientationDlg::Init( SALOME_Selection* Sel ) -{ - - double step ; - QString St = QAD_CONFIG->getSetting( "Geometry:SettingsGeomStep" ) ; - step = St.toDouble() ; - - /* min, max, step and decimals for spin boxes */ - SpinBox_C1A2->RangeStepAndValidator( 0.001, 999.999, step, 3 ) ; - SpinBox_C1A2->SetValue( 25.0 ) ; /* = myLength */ - - GroupC1->show(); - myConstructorId = 0 ; - Constructor1->setChecked( TRUE ); - CheckBoxReverse->setChecked( FALSE ); - myEditCurrentArgument = LineEditC1A1 ; - mySelection = Sel; - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - - myLength = 25.0 ; - myOkShape = false ; - myOkLength = true; - mySimulationTopoDs.Nullify() ; - myShape.Nullify() ; - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - - // TODO : previous selection into argument ? - - /* Filter definitions */ - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - - /* signals and slots connections */ - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ; - connect( buttonApply, SIGNAL( clicked() ), this, SLOT(ClickOnApply() ) ); - connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) ); - connect( SelectButtonC1A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( CheckBoxReverse, SIGNAL (stateChanged(int) ), this, SLOT( ReverseOrientation(int) ) ) ; - - connect( LineEditC1A1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - connect( SpinBox_C1A2, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ; - - connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ; - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - /* to close dialog if study change */ - connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ; - - /* Move widget on the botton right corner of main widget */ - int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; - this->show() ; /* displays Dialog */ - - return ; -} - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_OrientationDlg::ConstructorsClicked(int constructorId) -{ - return ; -} - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_OrientationDlg::ClickOnOk() -{ - this->ClickOnApply() ; - this->ClickOnCancel() ; - - return ; -} - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_OrientationDlg::ClickOnApply() -{ - /* Leave simulation display in this method ! */ - myGeomGUI->GetDesktop()->putInfo( tr("") ) ; - - switch(myConstructorId) - { - case 0 : - { - if(myOkShape && CheckBoxReverse->isChecked() && myOkLength == true ) { - myGeomGUI->MakeOrientationChangeAndDisplay( myGeomShape ) ; - CheckBoxReverse->setChecked( FALSE ); - } - break ; - } - } - // accept(); - return ; -} - - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void GeometryGUI_OrientationDlg::ClickOnCancel() -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->ResetState() ; - reject() ; - return ; -} - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_OrientationDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if( send == LineEditC1A1 ) - myEditCurrentArgument = LineEditC1A1 ; - else - return ; - - /* User name of object input management */ - /* If successfull the selection is changed and signal emitted... */ - /* so SelectionIntoArgument() is automatically called. */ - const QString objectUserName = myEditCurrentArgument->text() ; - QWidget* thisWidget = (QWidget*)this ; - if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) { - myEditCurrentArgument->setText( objectUserName ) ; - } - return ; -} - - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -//================================================================================= -void GeometryGUI_OrientationDlg::SelectionIntoArgument() -{ - myGeomGUI->EraseSimulationShape() ; - this->mySimulationTopoDs.Nullify() ; - - /* Name of future selection */ - QString aString = ""; - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; - if ( nbSel != 1 ) { - if ( myEditCurrentArgument == LineEditC1A1 ) { - LineEditC1A1->setText("") ; - this->myOkShape = false ; - } - return ; - } - - /* nbSel == 1 ! */ - TopoDS_Shape S; - Standard_Boolean testResult ; - Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject() ; - if( !myGeomGUI->GetTopoFromSelection(mySelection, S) ) - return ; - - /* Constructor */ - if ( myEditCurrentArgument == LineEditC1A1 ) { - myGeomShape = myGeomGUI->ConvertIOinGEOMShape(IO, testResult) ; - if( !testResult ) - return ; - LineEditC1A1->setText(aString) ; - myShape = S ; - myOkShape = true ; - } - - if( myOkShape && myOkLength ) { - MakeOrientationSimulationAndDisplay( this->myShape, this->myLength ) ; - } - return ; -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_OrientationDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - switch (myConstructorId) - { - case 0: /* default constructor */ - { - if(send == SelectButtonC1A1) { - LineEditC1A1->setFocus() ; - myEditCurrentArgument = LineEditC1A1 ; - } - SelectionIntoArgument() ; - break; - } - } - return ; -} - - -//================================================================================= -// function : ValueChangedInSpinBox() -// purpose : -//================================================================================= -void GeometryGUI_OrientationDlg::ValueChangedInSpinBox( double newValue ) -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - - QObject* send = (QObject*)sender() ; - if( send == SpinBox_C1A2 ) { - this->myLength = newValue ; - myOkLength = true ; - } - - if ( myConstructorId == 0 && myOkShape && myOkLength == true ) { - MakeOrientationSimulationAndDisplay( this->myShape, this->myLength ) ; - } - return ; -} - - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void GeometryGUI_OrientationDlg::DeactivateActiveDialog() -{ - if ( GroupConstructors->isEnabled() ) { - GroupConstructors->setEnabled(false) ; - GroupButtons->setEnabled(false) ; - GroupC1->setEnabled(false) ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->EraseSimulationShape() ; - } - return ; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_OrientationDlg::ActivateThisDialog() -{ - /* Emit a signal to deactivate the active dialog */ - myGeomGUI->EmitSignalDeactivateDialog() ; - GroupConstructors->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - GroupC1->setEnabled(true) ; - - connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - if( !mySimulationTopoDs.IsNull() ) - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - - return ; -} - - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void GeometryGUI_OrientationDlg::enterEvent(QEvent* e) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; - return ; -} - - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_OrientationDlg::closeEvent( QCloseEvent* e ) -{ - /* same than click on cancel button */ - this->ClickOnCancel() ; - return ; -} - - - -//=========================================================================================== -// function : ReverseOrientation() -// purpose : -//=========================================================================================== -void GeometryGUI_OrientationDlg::ReverseOrientation(int state) -{ - if( this->myOkShape && myOkLength == true ) { - MakeOrientationSimulationAndDisplay( this->myShape, this-> myLength ) ; - } - return ; -} - - -//=========================================================================================== -// function : MakeOrientationSimulationAndDisplay() -// purpose : Create 'aCompound1' and 'aCompound2' each contains edges oriented -// : respectively FORWARD and REVERSE for all faces of 'aTopoDS' -// : These edges represent normal vectors on faces of 'aTopoDS' -// : For a unique edge an arrow is displayed to show its orientation. -//=========================================================================================== -void GeometryGUI_OrientationDlg::MakeOrientationSimulationAndDisplay(const TopoDS_Shape& aTopoDS, Standard_Real length ) -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - - TopoDS_Compound aCompound1, aCompound2 ; - TopoDS_Compound NullComp ; - BRep_Builder aBuilder1, aBuilder2; - aCompound1 = aCompound2 = NullComp ; - aBuilder1.MakeCompound(aCompound1) ; - aBuilder2.MakeCompound(aCompound2) ; - - if( aTopoDS.IsNull() ) - return ; - - /* Case of an edge */ - if( aTopoDS.ShapeType() == TopAbs_EDGE ) { - /* Try to display a cone simulation shape to show direction of edge */ - TopoDS_Shape tmpShape = aTopoDS ; - if( this->CheckBoxReverse->isChecked() ) { - if( aTopoDS.Orientation() == TopAbs_FORWARD) - tmpShape.Orientation(TopAbs_REVERSED) ; - else - tmpShape.Orientation(TopAbs_FORWARD) ; - } - if( myGeomGUI->CreateArrowForLinearEdge( tmpShape, mySimulationTopoDs ) ) { - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - } - return ; - } - - - gp_Pnt P1, P2 ; - gp_Vec V, V1, V2 ; - TopExp_Explorer ex( aTopoDS, TopAbs_FACE ); - int test = 0 ; - while (ex.More()) { - - const TopoDS_Face& F = TopoDS::Face(ex.Current()); - /* find the center of the minmax */ - BRepAdaptor_Surface SF(F); - Standard_Real u, v, x; - - u = SF.FirstUParameter(); - x = SF.LastUParameter(); - if ( Precision::IsInfinite(u) ) { - if( Precision::IsInfinite(x) ) u = 0.0 ; else u = x ; - } - else if ( !Precision::IsInfinite(x) ) - u = (u+x) / 2.0 ; - - v = SF.FirstVParameter(); - x = SF.LastVParameter(); - if ( Precision::IsInfinite(v) ) { - if ( Precision::IsInfinite(x) ) v = 0.0 ; else v = x ; - } - else if ( !Precision::IsInfinite(x) ) - v = (v+x) / 2.0 ; - - SF.D1( u, v, P1, V1, V2 ); - V = V1.Crossed(V2); - x = V.Magnitude(); - if ( x > 1.e-10 ) - V.Multiply( length/x ); - else { - V.SetCoord( length/2.0, 0.0, 0.0 ) ; - MESSAGE ("Null normal in Orientation " << endl ) ; - } - - P2 = P1; - /* test orientation of each face and displays forward (aCompound1) */ - if( F.Orientation() == TopAbs_FORWARD ) - P2.Translate(V); - else - P2.Translate(-V) ; - BRepBuilderAPI_MakeEdge anEdge(P1, P2) ; - aBuilder1.Add( aCompound1, anEdge ) ; - - P2 = P1; - /* test orientation of each face and displays forward (aCompound2) */ - if( F.Orientation() == TopAbs_FORWARD ) - P2.Translate(-V); - else - P2.Translate(V) ; - anEdge = BRepBuilderAPI_MakeEdge(P1, P2) ; - aBuilder2.Add( aCompound2, anEdge ) ; - - ex.Next(); - test++ ; - } - - /* display simulation compounds */ - if( test > 0 && this->CheckBoxReverse->isChecked() ) { - mySimulationTopoDs = aCompound1 ; - } - else if ( test > 0 && !CheckBoxReverse->isChecked() ) { - mySimulationTopoDs = aCompound2 ; - } - if(!mySimulationTopoDs.IsNull() ) - myGeomGUI->DisplaySimulationShape(mySimulationTopoDs) ; - - return ; -} diff --git a/src/GEOMGUI/GeometryGUI_OrientationDlg.h b/src/GEOMGUI/GeometryGUI_OrientationDlg.h deleted file mode 100644 index 81b439e1a..000000000 --- a/src/GEOMGUI/GeometryGUI_OrientationDlg.h +++ /dev/null @@ -1,124 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_OrientationDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_ORIENTATION_H -#define DIALOGBOX_ORIENTATION_H - -#include "SALOME_Selection.h" -#include "GEOM_ShapeTypeFilter.hxx" -#include "GeometryGUI_SpinBox.h" - -#include - -#include -#include -#include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QCheckBox; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QRadioButton; -class GeometryGUI; - - -//================================================================================= -// class : DialogBox_ORIENTATION -// purpose : -//================================================================================= -class GeometryGUI_OrientationDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_OrientationDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 ); - ~GeometryGUI_OrientationDlg(); - -private : - - GEOM::GEOM_Gen_var myGeom ; /* Current Geom object */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - TopoDS_Shape mySimulationTopoDs ; /* Shape used for simulation display */ - SALOME_Selection* mySelection ; /* User shape selection */ - GEOM::GEOM_Shape_var myGeomShape ; /* is myShape */ - TopoDS_Shape myShape ; /* topology used */ - Standard_Real myLength ; /* to simulate normal vector */ - bool myOkShape ; - bool myOkLength ; - QDoubleValidator *myVa ; /* Double validator for numeric input */ - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - int myConstructorId ; /* Current constructor id = radio button id */ - - void closeEvent( QCloseEvent* e ) ; - void enterEvent( QEvent* e); - void Init( SALOME_Selection* Sel ) ; - void MakeOrientationSimulationAndDisplay( const TopoDS_Shape& aTopoDS, Standard_Real length ) ; - - QButtonGroup* GroupConstructors; - QRadioButton* Constructor1; - QGroupBox* GroupButtons; - QPushButton* buttonOk; - QPushButton* buttonCancel; - QPushButton* buttonApply; - QGroupBox* GroupC1; - QLineEdit* LineEditC1A1; - GeometryGUI_SpinBox* SpinBox_C1A2 ; - - QPushButton* SelectButtonC1A1; - QLabel* TextLabelC1A1; - QLabel* TextLabelC1A2; - QCheckBox* CheckBoxReverse; - -private slots: - - void ConstructorsClicked(int constructorId); - void ClickOnOk(); - void ClickOnCancel(); - void ClickOnApply(); - void SetEditCurrentArgument() ; - void SelectionIntoArgument() ; - void LineEditReturnPressed() ; - void DeactivateActiveDialog() ; - void ActivateThisDialog() ; - void ReverseOrientation(int state) ; - void ValueChangedInSpinBox( double newValue ) ; - -protected: - - QGridLayout* GeometryGUI_OrientationDlgLayout; - QGridLayout* GroupConstructorsLayout; - QGridLayout* GroupButtonsLayout; - QGridLayout* GroupC1Layout; -}; - -#endif // DIALOGBOX_ORIENTATION_H diff --git a/src/GEOMGUI/GeometryGUI_PartitionDlg.cxx b/src/GEOMGUI/GeometryGUI_PartitionDlg.cxx deleted file mode 100644 index 92f753c90..000000000 --- a/src/GEOMGUI/GeometryGUI_PartitionDlg.cxx +++ /dev/null @@ -1,530 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_PartitionDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_PartitionDlg.h" - -#include "GeometryGUI.h" -#include "QAD_Application.h" -#include "QAD_Desktop.h" -#include "utilities.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define MIN_EDIT_SIZE 150 - -//================================================================================= -// class : GeometryGUI_PartitionDlg() -// purpose : Constructs a GeometryGUI_PartitionDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_PartitionDlg::GeometryGUI_PartitionDlg( QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_PARTITION"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); -// QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap( "GeometryGUI",tr("ICON_DLG_PARTITION_KEEP_FACES"))); - - if ( !name ) - setName( "GeometryGUI_PartitionDlg" ); - setCaption( tr( "GEOM_PARTITION_TITLE" ) ); - setSizeGripEnabled( TRUE ); - QGridLayout* GeometryGUI_PartitionDlgLayout = new QGridLayout( this ); - GeometryGUI_PartitionDlgLayout->setSpacing( 6 ); - GeometryGUI_PartitionDlgLayout->setMargin( 11 ); - - /***************************************************************/ - /* Constructor group */ - /***************************************************************/ - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "GEOM_PARTITION" ) ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - QGridLayout* GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setPixmap( image0 ); - Constructor1->setChecked( TRUE ); - Constructor1->setMinimumSize( QSize( 50, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - GroupConstructorsLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ), 1, 0 ); - - GeometryGUI_PartitionDlgLayout->addWidget( GroupConstructors, 0, 0 ); - - /***************************************************************/ - /* Arguments group */ - /***************************************************************/ - /* Shapes and Tools */ - GroupC1 = new QGroupBox( this, "GroupC1" ); - GroupC1->setTitle( tr( "GEOM_PARTITION" ) ); - GroupC1->setColumnLayout(0, Qt::Vertical ); - GroupC1->layout()->setSpacing( 0 ); - GroupC1->layout()->setMargin( 0 ); - QGridLayout* GroupC1Layout = new QGridLayout( GroupC1->layout() ); - GroupC1Layout->setAlignment( Qt::AlignTop ); - GroupC1Layout->setSpacing( 6 ); - GroupC1Layout->setMargin( 11 ); - - TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" ); - TextLabelC1A1->setText( tr( "GEOM_OBJECTS" ) ); - GroupC1Layout->addWidget( TextLabelC1A1, 0, 0 ); - SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" ); - SelectButtonC1A1->setPixmap( image1 ); - SelectButtonC1A1->setToggleButton( FALSE ); - GroupC1Layout->addWidget( SelectButtonC1A1, 0, 1 ); - LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" ); - LineEditC1A1->setMinimumSize(MIN_EDIT_SIZE, 0); - GroupC1Layout->addWidget( LineEditC1A1, 0, 2 ); - - TextLabelC1A2 = new QLabel( GroupC1, "TextLabelC1A2" ); - TextLabelC1A2->setText( tr( "GEOM_TOOL_OBJECT" ) ); - GroupC1Layout->addWidget( TextLabelC1A2, 1, 0 ); - SelectButtonC1A2 = new QPushButton( GroupC1, "SelectButtonC1A2" ); - SelectButtonC1A2->setPixmap( image1 ); - SelectButtonC1A2->setToggleButton( FALSE ); - GroupC1Layout->addWidget( SelectButtonC1A2, 1, 1 ); - LineEditC1A2 = new QLineEdit( GroupC1, "LineEditC1A2" ); - LineEditC1A2->setMinimumSize(MIN_EDIT_SIZE, 0); - GroupC1Layout->addWidget( LineEditC1A2, 1, 2 ); - - /* Limit */ - TextLabelComboBox1 = new QLabel( GroupC1, "TextLabelComboBox1" ); - TextLabelComboBox1->setText( tr( "RECONSTRUCTION_LIMIT") ); - GroupC1Layout->addWidget( TextLabelComboBox1, 2, 0 ); - ComboBox1 = new QComboBox( FALSE, GroupC1, "ComboBox1" ); - ComboBox1->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) ); - ComboBox1->setMinimumSize(MIN_EDIT_SIZE, 0); - GroupC1Layout->addWidget( ComboBox1, 2, 2 ); - - GeometryGUI_PartitionDlgLayout->addWidget( GroupC1, 1, 0 ); - - /***************************************************************/ - /* Result suppresion */ - /***************************************************************/ - GroupC2 = new QGroupBox( this, "GroupC2" ); - GroupC2->setTitle( tr( "SUPPRESS_RESULT") ); - GroupC2->setColumnLayout(0, Qt::Vertical ); - GroupC2->layout()->setSpacing( 0 ); - GroupC2->layout()->setMargin( 0 ); - QGridLayout* GroupC2Layout = new QGridLayout( GroupC2->layout() ); - GroupC2Layout->setAlignment( Qt::AlignTop ); - GroupC2Layout->setSpacing( 6 ); - GroupC2Layout->setMargin( 11 ); - - TextLabelC2A1 = new QLabel( GroupC2, "TextLabelC2A1" ); - TextLabelC2A1->setText( tr( "SUPPRESS_RESULT_INSIDE") ); - GroupC2Layout->addWidget( TextLabelC2A1, 0, 0 ); - SelectButtonC2A1 = new QPushButton( GroupC2, "SelectButtonC2A1" ); - SelectButtonC2A1->setPixmap( image1 ); - GroupC2Layout->addWidget( SelectButtonC2A1, 0, 1 ); - LineEditC2A1 = new QLineEdit( GroupC2, "LineEditC2A1" ); - GroupC2Layout->addWidget( LineEditC2A1, 0, 2 ); - - TextLabelC2A2 = new QLabel( GroupC2, "TextLabelC2A2" ); - TextLabelC2A2->setText( tr( "SUPPRESS_RESULT_OUTSIDE") ); - GroupC2Layout->addWidget( TextLabelC2A2, 1, 0 ); - SelectButtonC2A2 = new QPushButton( GroupC2, "SelectButtonC2A2" ); - SelectButtonC2A2->setPixmap( image1 ); - GroupC2Layout->addWidget( SelectButtonC2A2, 1, 1 ); - LineEditC2A2 = new QLineEdit( GroupC2, "LineEditC2A2" ); - GroupC2Layout->addWidget( LineEditC2A2, 1, 2 ); - - GeometryGUI_PartitionDlgLayout->addWidget( GroupC2, 2, 0 ); - - /***************************************************************/ - /* , , buttons */ - /***************************************************************/ - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - - buttonOk = new QPushButton( GroupButtons, "buttonOk" ); - buttonOk->setText( tr( "GEOM_BUT_OK" ) ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - - buttonApply = new QPushButton( GroupButtons, "buttonApply" ); - buttonApply->setText( tr( "GEOM_BUT_APPLY" ) ); - buttonApply->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonApply, 0, 1 ); - - GroupButtonsLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 2 ); - - buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 3 ); - - GeometryGUI_PartitionDlgLayout->addWidget( GroupButtons, 3, 0 ); - - /***************************************************************/ - Init(Sel) ; /* Initialisations */ -} - - -//================================================================================= -// function : ~GeometryGUI_PartitionDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_PartitionDlg::~GeometryGUI_PartitionDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_PartitionDlg::Init( SALOME_Selection* Sel ) -{ - myEditCurrentArgument = LineEditC1A1 ; - mySelection = Sel; - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - myOkListShapes = myOkListTools = myOkKeepShape = myOkRemoveShape = false ; - - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - - /* type for sub shape selection */ -// ComboBox1->insertItem( tr( "RECONSTRUCTION_LIMIT_SHAPE" ) ); - ComboBox1->insertItem( tr( "RECONSTRUCTION_LIMIT_SOLID" ) ); - ComboBox1->insertItem( tr( "RECONSTRUCTION_LIMIT_SHELL" ) ); - ComboBox1->insertItem( tr( "RECONSTRUCTION_LIMIT_FACE" ) ); - ComboBox1->insertItem( tr( "RECONSTRUCTION_LIMIT_WIRE" ) ); - ComboBox1->insertItem( tr( "RECONSTRUCTION_LIMIT_EDGE" ) ); - ComboBox1->insertItem( tr( "RECONSTRUCTION_LIMIT_VERTEX" ) ); - - /* Current item is 'Shape' */ - ComboBox1->setCurrentItem(0); - myLimit = ComboBox1->currentItem(); - - /* Filter definitions */ - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - - /* signals and slots connections */ - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ; - connect( buttonApply, SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) ); -// connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) ); - connect( ComboBox1, SIGNAL( activated(int) ), this, SLOT( ComboTextChanged() ) ); - - connect( SelectButtonC1A1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( SelectButtonC1A2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - - connect( SelectButtonC2A1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( SelectButtonC2A2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - - connect( LineEditC1A1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - connect( LineEditC1A2, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - connect( LineEditC2A1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - connect( LineEditC2A2, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - - connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ; - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - /* to close dialog if study change */ - connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ; - - /* Move widget on the botton right corner of main widget */ - int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; - this->show() ; /* displays Dialog */ - - ComboTextChanged(); - return ; -} - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_PartitionDlg::ClickOnOk() -{ - this->ClickOnApply() ; - this->ClickOnCancel() ; - - return ; -} - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_PartitionDlg::ClickOnApply() -{ - myGeomGUI->GetDesktop()->putInfo( tr("") ) ; - if (myOkListShapes || myOkListTools || myOkKeepShape || myOkRemoveShape) - { - GEOM::shape_type limit; - switch (myLimit) { -// case 0: limit = GEOM::SOLID ; break; - case 0: limit = GEOM::SHAPE ; break; - case 1: limit = GEOM::SHELL ; break; - case 2: limit = GEOM::FACE ; break; - case 3: limit = GEOM::WIRE ; break; - case 4: limit = GEOM::EDGE ; break; - case 5: limit = GEOM::VERTEX; break; - default:limit = GEOM::SHAPE; - } - myGeomGUI->MakePartitionAndDisplay (myListShapes, - myListTools, - myListKeepInside, - myListRemoveInside, - limit); - - } - // accept(); - return ; -} - - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void GeometryGUI_PartitionDlg::ClickOnCancel() -{ - myGeomGUI->EraseSimulationShape() ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->ResetState() ; - reject() ; - return ; -} - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : -//================================================================================= -// void GeometryGUI_PartitionDlg::ConstructorsClicked(int constructorId) -// { -// } - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -//================================================================================= -void GeometryGUI_PartitionDlg::SelectionIntoArgument() -{ - myEditCurrentArgument->setText("") ; - QString aString = ""; /* name of selection */ - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; - - if ( nbSel < 1 ) { - if ( myEditCurrentArgument == LineEditC1A1 ) { - myOkListShapes = false ; - } - else if ( myEditCurrentArgument == LineEditC1A2 ) { - myOkListTools = false ; - } - else if ( myEditCurrentArgument == LineEditC2A1 ) { - myOkListTools = false ; - } - else if ( myEditCurrentArgument == LineEditC2A2 ) { - myOkListTools = false ; - } - return ; - } - - if ( myEditCurrentArgument == LineEditC1A1 ) { - myGeomGUI->ConvertListOfIOInListOfIOR(mySelection->StoredIObjects(), myListShapes) ; - myEditCurrentArgument->setText(aString) ; - myOkListShapes = true ; - } - else if ( myEditCurrentArgument == LineEditC1A2 ) { - myGeomGUI->ConvertListOfIOInListOfIOR(mySelection->StoredIObjects(), myListTools) ; - myEditCurrentArgument->setText(aString) ; - myOkListTools = true ; - } - else if ( myEditCurrentArgument == LineEditC2A1 ) { - myGeomGUI->ConvertListOfIOInListOfIOR(mySelection->StoredIObjects(), myListRemoveInside) ; - myEditCurrentArgument->setText(aString) ; - myOkKeepShape = true ; - } - else if ( myEditCurrentArgument == LineEditC2A2 ) { - myGeomGUI->ConvertListOfIOInListOfIOR(mySelection->StoredIObjects(), myListKeepInside) ; - myEditCurrentArgument->setText(aString) ; - myOkRemoveShape = true ; - } - /* no simulation */ - return ; -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_PartitionDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - - if (send == SelectButtonC1A1) { - LineEditC1A1->setFocus() ; - myEditCurrentArgument = LineEditC1A1 ; - } - else if(send == SelectButtonC1A2) { - LineEditC1A2->setFocus() ; - myEditCurrentArgument = LineEditC1A2 ; - } - else if(send == SelectButtonC2A1) { - LineEditC2A1->setFocus() ; - myEditCurrentArgument = LineEditC2A1 ; - } - else if(send == SelectButtonC2A2) { - LineEditC2A2->setFocus() ; - myEditCurrentArgument = LineEditC2A2 ; - } - SelectionIntoArgument() ; - - return ; -} - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_PartitionDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if( send == LineEditC1A1 ) - myEditCurrentArgument = LineEditC1A1 ; - else if ( send == LineEditC1A2 ) - myEditCurrentArgument = LineEditC1A2 ; - else if ( send == LineEditC2A1 ) - myEditCurrentArgument = LineEditC2A1 ; - else if ( send == LineEditC2A2 ) - myEditCurrentArgument = LineEditC2A2 ; - else - return ; - - /* User name of object input management */ - /* If successfull the selection is changed and signal emitted... */ - /* so SelectionIntoArgument() is automatically called. */ - const QString objectUserName = myEditCurrentArgument->text() ; - QWidget* thisWidget = (QWidget*)this ; - if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) { - myEditCurrentArgument->setText( objectUserName ) ; - } - return ; -} - - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= - -void GeometryGUI_PartitionDlg::DeactivateActiveDialog() -{ - if ( GroupConstructors->isEnabled() ) { - GroupConstructors->setEnabled(false) ; - GroupC1->setEnabled(false) ; - GroupC2->setEnabled(false) ; - GroupButtons->setEnabled(false) ; - } - return ; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_PartitionDlg::ActivateThisDialog() -{ - /* Emit a signal to deactivate the active dialog */ - myGeomGUI->EmitSignalDeactivateDialog() ; - GroupConstructors->setEnabled(true) ; - GroupC1->setEnabled(true) ; - GroupC2->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - return ; -} - - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void GeometryGUI_PartitionDlg::enterEvent(QEvent* e) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; - return ; -} - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_PartitionDlg::closeEvent( QCloseEvent* e ) -{ - /* same than click on cancel button */ - this->ClickOnCancel() ; - return ; -} - -//======================================================================= -//function : ComboTextChanged -//purpose : -//======================================================================= - -void GeometryGUI_PartitionDlg::ComboTextChanged() -{ - - myLimit = ComboBox1->currentItem(); - GroupC2->setEnabled( ComboBox1->currentItem() < 3 ); - - return ; -} diff --git a/src/GEOMGUI/GeometryGUI_PartitionDlg.h b/src/GEOMGUI/GeometryGUI_PartitionDlg.h deleted file mode 100644 index 72725819b..000000000 --- a/src/GEOMGUI/GeometryGUI_PartitionDlg.h +++ /dev/null @@ -1,127 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_PartitionDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_PARTITION_H -#define DIALOGBOX_PARTITION_H - -#include "SALOME_Selection.h" -#include "GEOM_ShapeTypeFilter.hxx" - -#include - -class QButtonGroup; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QRadioButton; -class QComboBox; -class GeometryGUI; - - -//================================================================================= -// class : GeometryGUI_PartitionDlg -// purpose : -//================================================================================= -class GeometryGUI_PartitionDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_PartitionDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 ); - ~GeometryGUI_PartitionDlg(); - -private: - - void Init( SALOME_Selection* Sel ) ; - void closeEvent( QCloseEvent* e ) ; - void enterEvent ( QEvent * ) ; /* Mouse enter the QWidget */ - - GEOM::GEOM_Gen_var myGeom ; /* Current Geom object */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - SALOME_Selection* mySelection ; /* User shape selection */ - - GEOM::GEOM_Gen::ListOfIOR myListShapes ; - GEOM::GEOM_Gen::ListOfIOR myListTools ; - GEOM::GEOM_Gen::ListOfIOR myListRemoveInside ; - GEOM::GEOM_Gen::ListOfIOR myListKeepInside ; - - bool myOkListShapes ; /* to check when argument is defined */ - bool myOkListTools ; /* to check when argument is defined */ - bool myOkKeepShape ; /* to check when argument is defined */ - bool myOkRemoveShape ; /* to check when argument is defined */ - int myLimit; - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - - /* common buttons */ - QGroupBox* GroupButtons; - QPushButton* buttonOk; - QPushButton* buttonCancel; - QPushButton* buttonApply; - - /* constructor radiobuttons */ - QButtonGroup* GroupConstructors; - QRadioButton* Constructor1; - - /* Arguments group */ - QGroupBox* GroupC1; - QLineEdit* LineEditC1A1; - QLabel* TextLabelC1A1; - QPushButton* SelectButtonC1A1; - QLineEdit* LineEditC1A2; - QLabel* TextLabelC1A2; - QPushButton* SelectButtonC1A2; - - /* limit */ - QComboBox* ComboBox1; - QLabel* TextLabelComboBox1; - - /* Keep Inside and Remove Inside feilds */ - QGroupBox* GroupC2; - QLineEdit* LineEditC2A1; - QLabel* TextLabelC2A1; - QPushButton* SelectButtonC2A1; - QLineEdit* LineEditC2A2; - QLabel* TextLabelC2A2; - QPushButton* SelectButtonC2A2; - -private slots: - - //void ConstructorsClicked(int constructorId); - void ClickOnOk(); - void ClickOnCancel(); - void ClickOnApply(); - void SetEditCurrentArgument() ; - void LineEditReturnPressed() ; - void SelectionIntoArgument() ; - void DeactivateActiveDialog() ; - void ActivateThisDialog() ; - void ComboTextChanged() ; -}; - -#endif // DIALOGBOX_PARTITION_H diff --git a/src/GEOMGUI/GeometryGUI_PipeDlg.cxx b/src/GEOMGUI/GeometryGUI_PipeDlg.cxx deleted file mode 100644 index 0e45fb8a8..000000000 --- a/src/GEOMGUI/GeometryGUI_PipeDlg.cxx +++ /dev/null @@ -1,514 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_PipeDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_PipeDlg.h" - -#include "GeometryGUI.h" -#include "QAD_Application.h" -#include "QAD_Desktop.h" -#include "utilities.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - - -//================================================================================= -// class : GeometryGUI_PipeDlg() -// purpose : Constructs a GeometryGUI_PipeDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_PipeDlg::GeometryGUI_PipeDlg( QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_PIPE"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - - if ( !name ) - setName( "GeometryGUI_PipeDlg" ); - resize( 303, 225 ); - setCaption( tr( "GEOM_PIPE_TITLE" ) ); - setSizeGripEnabled( TRUE ); - GeometryGUI_PipeDlgLayout = new QGridLayout( this ); - GeometryGUI_PipeDlgLayout->setSpacing( 6 ); - GeometryGUI_PipeDlgLayout->setMargin( 11 ); - - /***************************************************************/ - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "GEOM_PIPE" ) ); - GroupConstructors->setExclusive( TRUE ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setText( tr( "" ) ); - Constructor1->setPixmap( image0 ); - Constructor1->setChecked( TRUE ); - Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) ); - Constructor1->setMinimumSize( QSize( 50, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer, 0, 1 ); - GeometryGUI_PipeDlgLayout->addWidget( GroupConstructors, 0, 0 ); - - - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); - GroupButtons->setTitle( tr( "" ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 3 ); - buttonApply = new QPushButton( GroupButtons, "buttonApply" ); - buttonApply->setText( tr( "GEOM_BUT_APPLY" ) ); - buttonApply->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonApply, 0, 1 ); - QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_9, 0, 2 ); - buttonOk = new QPushButton( GroupButtons, "buttonOk" ); - buttonOk->setText( tr( "GEOM_BUT_OK" ) ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - GeometryGUI_PipeDlgLayout->addWidget( GroupButtons, 2, 0 ); - - /***************************************************************/ - GroupC1 = new QGroupBox( this, "GroupC1" ); - GroupC1->setTitle( tr( "GEOM_ARGUMENTS" ) ); - GroupC1->setMinimumSize( QSize( 0, 0 ) ); - GroupC1->setFrameShape( QGroupBox::Box ); - GroupC1->setFrameShadow( QGroupBox::Sunken ); - GroupC1->setColumnLayout(0, Qt::Vertical ); - GroupC1->layout()->setSpacing( 0 ); - GroupC1->layout()->setMargin( 0 ); - GroupC1Layout = new QGridLayout( GroupC1->layout() ); - GroupC1Layout->setAlignment( Qt::AlignTop ); - GroupC1Layout->setSpacing( 6 ); - GroupC1Layout->setMargin( 11 ); - LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" ); - GroupC1Layout->addWidget( LineEditC1A1, 0, 2 ); - SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" ); - SelectButtonC1A1->setText( tr( "" ) ); - SelectButtonC1A1->setPixmap( image1 ); - SelectButtonC1A1->setToggleButton( FALSE ); - GroupC1Layout->addWidget( SelectButtonC1A1, 0, 1 ); - TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" ); - TextLabelC1A1->setText( tr( "GEOM_BASE_OBJECT" ) ); - TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A1->setFrameShape( QLabel::NoFrame ); - TextLabelC1A1->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabelC1A1, 0, 0 ); - TextLabelC1A2 = new QLabel( GroupC1, "TextLabelC1A2" ); - TextLabelC1A2->setText( tr( "GEOM_PATH_OBJECT" ) ); - TextLabelC1A2->setMinimumSize( QSize( 50, 0 ) ); - GroupC1Layout->addWidget( TextLabelC1A2, 1, 0 ); - SelectButtonC1A2 = new QPushButton( GroupC1, "SelectButtonC1A2" ); - SelectButtonC1A2->setText( tr( "" ) ); - SelectButtonC1A2->setPixmap( image1 ); - GroupC1Layout->addWidget( SelectButtonC1A2, 1, 1 ); - LineEditC1A2 = new QLineEdit( GroupC1, "LineEditC1A2" ); - GroupC1Layout->addWidget( LineEditC1A2, 1, 2 ); - GeometryGUI_PipeDlgLayout->addWidget( GroupC1, 1, 0 ); - /***************************************************************/ - - /* Initialisation */ - Init( Sel ) ; -} - - -//================================================================================= -// function : ~GeometryGUI_PipeDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_PipeDlg::~GeometryGUI_PipeDlg() -{ - /* no need to delete child widgets, Qt does it all for us */ -} - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_PipeDlg::Init( SALOME_Selection* Sel ) -{ - mySelection = Sel ; - myShape1.Nullify() ; - myShape2.Nullify() ; - myConstructorId = 0 ; - - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - - GroupC1->show(); - myConstructorId = 0 ; - myEditCurrentArgument = LineEditC1A1 ; - Constructor1->setChecked( TRUE ); - myOkShape1 = myOkShape2 = false ; - - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - mySimulationTopoDs.Nullify() ; - - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - - // TODO : previous selection into argument ? - - /* signals and slots connections */ - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ; - connect( buttonApply, SIGNAL( clicked() ), this, SLOT(ClickOnApply() ) ); - connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) ); - connect( SelectButtonC1A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( SelectButtonC1A2, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - - connect( LineEditC1A1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - connect( LineEditC1A2, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ; - /* to close dialog if study change */ - connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ; - - /* Move widget on the botton right corner of main widget */ - int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; - this->show() ; /* Displays Dialog */ - - return ; -} - - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_PipeDlg::ConstructorsClicked(int constructorId) -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - //GeometryGUI::GetGeometryGUI()->EraseSimulationShape() ; - - switch (constructorId) - { - case 0: - { - break; - } - } - return ; -} - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_PipeDlg::ClickOnOk() -{ - this->ClickOnApply() ; - this->ClickOnCancel() ; - - return ; -} - - -//================================================================================= -// function : ClickOnAply() -// purpose : -//================================================================================= -void GeometryGUI_PipeDlg::ClickOnApply() -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - myGeomGUI->GetDesktop()->putInfo( tr("") ) ; - - switch(myConstructorId) - { - case 0 : - { - if(myOkShape1 && myOkShape2) { - myGeomGUI->MakePipeAndDisplay(myGeomShape2 ,myGeomShape1) ; - } - break ; - } - } - // accept(); - return ; -} - - - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void GeometryGUI_PipeDlg::ClickOnCancel() -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->ResetState() ; - reject() ; - return ; -} - - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection has changed -//================================================================================= -void GeometryGUI_PipeDlg::SelectionIntoArgument() -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - - myEditCurrentArgument->setText("") ; - QString aString = ""; /* name of future selection */ - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; - if ( nbSel != 1 ) { - switch (myConstructorId) - { - case 0: - { - if ( myEditCurrentArgument == LineEditC1A1 ) { - myOkShape1 = false ; - } - else if ( myEditCurrentArgument == LineEditC1A2 ) { - myOkShape2 = false ; - } - break ; - } - } - return ; - } - - /* nbSel == 1 */ - TopoDS_Shape S; - Standard_Boolean testResult ; - Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject() ; - - if( !myGeomGUI->GetTopoFromSelection(mySelection, S) ) - return ; - - if ( myEditCurrentArgument == LineEditC1A1 && - S.ShapeType() != TopAbs_COMPSOLID && - S.ShapeType() != TopAbs_COMPOUND && - S.ShapeType() != TopAbs_SOLID && - S.ShapeType() != TopAbs_SHAPE ) { - myGeomShape1 = myGeomGUI->ConvertIOinGEOMShape(IO, testResult) ; - if( !testResult ) - return ; - myShape1 = S ; - LineEditC1A1->setText(aString) ; - myOkShape1 = true ; - } - else if ( myEditCurrentArgument == LineEditC1A2 && ( S.ShapeType() == TopAbs_WIRE || S.ShapeType() == TopAbs_EDGE) ) { - myGeomShape2 = myGeomGUI->ConvertIOinGEOMShape(IO, testResult) ; - if( !testResult ) - return ; - myShape2 = S ; - LineEditC1A2->setText(aString) ; - myOkShape2 = true ; - } - - if (myOkShape1 && myOkShape2 && !myShape1.IsNull() && !myShape2.IsNull()) - { - //Make preview - TopoDS_Shape tds ; - TopoDS_Wire aWire ; - - if( myShape2.ShapeType() == TopAbs_WIRE ) - aWire = TopoDS::Wire(myShape2) ; - else - if ( myShape2.ShapeType() == TopAbs_EDGE ) - { - TopoDS_Edge aEdge = TopoDS::Edge(myShape2) ; - aWire = BRepBuilderAPI_MakeWire(aEdge); - - } - - try - { - tds = BRepOffsetAPI_MakePipe(aWire,myShape1 ) ; - if ( BRepAlgoAPI::IsValid(tds) ) - { - //Draw Pipe - mySimulationTopoDs = tds; - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - } - } - catch(Standard_Failure) - { - } - } -} - - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_PipeDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - switch (myConstructorId) - { - case 0: /* default constructor */ - { - if( send == SelectButtonC1A1 ) { - LineEditC1A1->setFocus() ; - myEditCurrentArgument = LineEditC1A1 ; - } - else if(send == SelectButtonC1A2) { - LineEditC1A2->setFocus() ; - myEditCurrentArgument = LineEditC1A2; - } - SelectionIntoArgument() ; - break; - } - } - return ; -} - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_PipeDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if( send == LineEditC1A1 ) - myEditCurrentArgument = LineEditC1A1 ; - else if ( send == LineEditC1A2 ) - myEditCurrentArgument = LineEditC1A2 ; - else - return ; - - /* User name of object input management */ - /* If successfull the selection is changed and signal emitted... */ - /* so SelectionIntoArgument() is automatically called. */ - const QString objectUserName = myEditCurrentArgument->text() ; - QWidget* thisWidget = (QWidget*)this ; - if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) { - myEditCurrentArgument->setText( objectUserName ) ; - } - return ; -} - - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void GeometryGUI_PipeDlg::DeactivateActiveDialog() -{ - if ( GroupConstructors->isEnabled() ) { - GroupConstructors->setEnabled(false) ; - GroupC1->setEnabled(false) ; - GroupButtons->setEnabled(false) ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->EraseSimulationShape() ; - } - return ; -} - - - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_PipeDlg::closeEvent( QCloseEvent* e ) -{ - this->ClickOnCancel() ; /* same than click on cancel button */ -} - - -//================================================================================= -// function : enterEvent() -// purpose : when mouse enter onto the QWidget -//================================================================================= -void GeometryGUI_PipeDlg::enterEvent( QEvent * ) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; -} - - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_PipeDlg::ActivateThisDialog() -{ - /* Emit a signal to deactivate any active dialog */ - myGeomGUI->EmitSignalDeactivateDialog() ; - GroupConstructors->setEnabled(true) ; - GroupC1->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - if( !mySimulationTopoDs.IsNull() ) - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - return ; -} diff --git a/src/GEOMGUI/GeometryGUI_PipeDlg.h b/src/GEOMGUI/GeometryGUI_PipeDlg.h deleted file mode 100644 index bbae793a9..000000000 --- a/src/GEOMGUI/GeometryGUI_PipeDlg.h +++ /dev/null @@ -1,119 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_PipeDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_PIPE_H -#define DIALOGBOX_PIPE_H - -#include "SALOME_Selection.h" -#include "GEOM_ShapeTypeFilter.hxx" - -#include - -#include -#include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QRadioButton; -class GeometryGUI; - - -//================================================================================= -// class : GeometryGUI_PipeDlg -// purpose : -//================================================================================= -class GeometryGUI_PipeDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_PipeDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 ); - ~GeometryGUI_PipeDlg(); - -private: - - void Init( SALOME_Selection* Sel ) ; - void closeEvent( QCloseEvent* e ) ; - void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */ - - GEOM::GEOM_Gen_var myGeom ; /* Current GeomI object */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - SALOME_Selection* mySelection ; /* User shape selection */ - TopoDS_Shape myShape1 ; /* topology used */ - TopoDS_Shape myShape2 ; /* topology used */ - GEOM::GEOM_Shape_var myGeomShape1 ; /* is myShape1 */ - GEOM::GEOM_Shape_var myGeomShape2 ; /* is myShape2 */ - bool myOkShape1 ; - bool myOkShape2 ; /* to check when arguments are defined */ - int myConstructorId ; /* Current constructor id = radio button id */ - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - // Handle(GEOM_ShapeTypeFilter) myEdgFilter ; /* Filter selection */ - // Handle(GEOM_ShapeTypeFilter) myWireFilter ; /* Filter selection */ - - TopoDS_Shape mySimulationTopoDs ; /* Shape used for simulation display */ - - QButtonGroup* GroupConstructors; - QRadioButton* Constructor1; - QGroupBox* GroupButtons; - QPushButton* buttonOk; - QPushButton* buttonCancel; - QPushButton* buttonApply; - QGroupBox* GroupC1; - QLineEdit* LineEditC1A1; - QPushButton* SelectButtonC1A1; - QLabel* TextLabelC1A1; - QLabel* TextLabelC1A2; - QPushButton* SelectButtonC1A2; - QLineEdit* LineEditC1A2; - -private slots: - - void ConstructorsClicked(int constructorId); - void ClickOnOk(); - void ClickOnCancel(); - void ClickOnApply(); - void SetEditCurrentArgument() ; - void SelectionIntoArgument() ; - void LineEditReturnPressed() ; - void DeactivateActiveDialog() ; - void ActivateThisDialog() ; - -protected: - QGridLayout* GeometryGUI_PipeDlgLayout; - QGridLayout* GroupConstructorsLayout; - QGridLayout* GroupButtonsLayout; - QGridLayout* GroupC1Layout; -}; - -#endif // DIALOGBOX_PIPE_H diff --git a/src/GEOMGUI/GeometryGUI_PlaneDlg.cxx b/src/GEOMGUI/GeometryGUI_PlaneDlg.cxx deleted file mode 100644 index 83446080c..000000000 --- a/src/GEOMGUI/GeometryGUI_PlaneDlg.cxx +++ /dev/null @@ -1,570 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_PlaneDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_PlaneDlg.h" - -#include -#include -#include -#include -#include -#include - -#include "GeometryGUI.h" -#include "QAD_Desktop.h" -#include "QAD_Config.h" - -//================================================================================= -// class : GeometryGUI_PlaneDlg() -// purpose : Constructs a GeometryGUI_PlaneDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_PlaneDlg::GeometryGUI_PlaneDlg(QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl) - :GeometryGUI_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_PLANE_PV"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_PLANE_DXYZ"))); - QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_PLANE_FACE"))); - QPixmap image3(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT"))); - - setCaption(tr("GEOM_PLANE_TITLE")); - - /***************************************************************/ - GroupConstructors->setTitle(tr("GEOM_PLANE")); - RadioButton1->setPixmap(image0); - RadioButton2->setPixmap(image1); - RadioButton3->setPixmap(image2); - - GroupPointDirection = new GeometryGUI_2Sel1Spin(this, "GroupPointDirection"); - GroupPointDirection->GroupBox1->setTitle(tr("GEOM_PLANE_PV")); - GroupPointDirection->TextLabel1->setText(tr("GEOM_POINT")); - GroupPointDirection->TextLabel2->setText(tr("GEOM_VECTOR")); - GroupPointDirection->TextLabel3->setText(tr("GEOM_PLANE_SIZE")); - GroupPointDirection->PushButton1->setPixmap(image3); - GroupPointDirection->PushButton2->setPixmap(image3); - - GroupPointPlusCoordinates = new GeometryGUI_1Sel4Spin(this, "GroupPointPlusCoordinates" ); - GroupPointPlusCoordinates->GroupBox1->setTitle(tr("GEOM_PLANE_PVC")); - GroupPointPlusCoordinates->TextLabel1->setText(tr("GEOM_POINT")); - GroupPointPlusCoordinates->TextLabel2->setText(tr("GEOM_COOR")); - GroupPointPlusCoordinates->TextLabel3->setText(tr("GEOM_DX")); - GroupPointPlusCoordinates->TextLabel4->setText(tr("GEOM_DY")); - GroupPointPlusCoordinates->TextLabel5->setText(tr("GEOM_DZ")); - GroupPointPlusCoordinates->TextLabel6->setText(tr("GEOM_PLANE_SIZE")); - GroupPointPlusCoordinates->PushButton1->setPixmap(image3); - - GroupFace = new GeometryGUI_1Sel1Spin(this, "GroupFace"); - GroupFace->GroupBox1->setTitle(tr("GEOM_FACE")); - GroupFace->TextLabel1->setText(tr("GEOM_SELECTION")); - GroupFace->TextLabel2->setText(tr("GEOM_PLANE_SIZE")); - GroupFace->PushButton1->setPixmap(image3); - - Layout1->addWidget(GroupPointDirection, 1, 0); - Layout1->addWidget(GroupPointPlusCoordinates, 1, 0); - Layout1->addWidget(GroupFace, 1, 0); - /***************************************************************/ - - /* Initialisation */ - Init(Sel); -} - - -//================================================================================= -// function : ~GeometryGUI_PlaneDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_PlaneDlg::~GeometryGUI_PlaneDlg() -{ - /* no need to delete child widgets, Qt does it all for us */ -} - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_PlaneDlg::Init( SALOME_Selection* Sel ) -{ - /* init variables */ - myConstructorId = 0; - myEditCurrentArgument = GroupPointDirection->LineEdit1; - - myPoint1.SetCoord(0.0, 0.0, 0.0); - myOkPoint1 = myOkDirection = myOkCoordinates = myOkPlanarFace = false; - - /* Filters definition */ - myVertexFilter = new GEOM_ShapeTypeFilter(TopAbs_VERTEX, myGeom); - myEdgeFilter = new GEOM_ShapeTypeFilter(TopAbs_EDGE, myGeom); - myFaceFilter = new GEOM_FaceFilter(StdSelect_Plane, myGeom); - /* Filter for the next selection */ - mySelection->AddFilter(myVertexFilter); - - /* Get setting of step value from file configuration */ - QString St = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep"); - step = St.toDouble(); - this->myTrimSize = 2000.0; - - /* min, max, step and decimals for spin boxes */ - GroupPointDirection->SpinBox_DX->RangeStepAndValidator(+0.001, 10000000.0, step, 5); - GroupPointDirection->SpinBox_DX->SetValue(myTrimSize); - - GroupPointPlusCoordinates->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3); - GroupPointPlusCoordinates->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3); - GroupPointPlusCoordinates->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3); - GroupPointPlusCoordinates->SpinBox_DX->SetValue(1.0); - GroupPointPlusCoordinates->SpinBox_DY->SetValue(1.0); - GroupPointPlusCoordinates->SpinBox_DZ->SetValue(1.0); - GroupPointPlusCoordinates->SpinBox_S->RangeStepAndValidator(+0.001, 10000000.0, step, 5); - GroupPointPlusCoordinates->SpinBox_S->SetValue(myTrimSize) ; - - GroupFace->SpinBox_DX->RangeStepAndValidator(+0.001, 10000000.0, step, 5); - GroupFace->SpinBox_DX->SetValue(myTrimSize); - - /* signals and slots connections */ - connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); - connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); - connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int))); - - connect(GroupPointDirection->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); - connect(GroupPointDirection->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); - connect(GroupPointPlusCoordinates->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); - connect(GroupFace->PushButton1, SIGNAL(clicked()), this, SLOT( SetEditCurrentArgument())); - - connect(GroupPointDirection->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); - connect(GroupPointDirection->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); - connect(GroupPointPlusCoordinates->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); - connect(GroupFace->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); - - connect(GroupPointPlusCoordinates->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(GroupPointPlusCoordinates->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(GroupPointPlusCoordinates->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(GroupPointPlusCoordinates->SpinBox_S, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(GroupPointDirection->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(GroupFace->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - - connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - - /* Displays Dialog */ - GroupPointPlusCoordinates->hide(); - GroupFace->hide(); - GroupPointDirection->show(); - this->show(); - - return ; -} - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_PlaneDlg::ConstructorsClicked(int constructorId) -{ - myConstructorId = constructorId; - mySelection->ClearFilters(); - myGeomGUI->EraseSimulationShape(); - connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - myOkPoint1 = myOkDirection = myOkCoordinates = myOkPlanarFace = false; - - switch (constructorId) - { - case 0: /* plane from a point and a direction (vector, edge...) */ - { - GroupPointPlusCoordinates->hide(); - GroupFace->hide(); - resize(0, 0); - GroupPointDirection->show(); - - myEditCurrentArgument = GroupPointDirection->LineEdit1; - GroupPointDirection->LineEdit1->setText(tr("")); - GroupPointDirection->LineEdit2->setText(tr("")); - - /* for the first argument */ - mySelection->AddFilter(myVertexFilter); - break; - } - case 1: /* plane from a point and vector coordinates */ - { - GroupPointDirection->hide(); - GroupFace->hide(); - resize(0, 0); - GroupPointPlusCoordinates->show(); - - myEditCurrentArgument = GroupPointPlusCoordinates->LineEdit1; - GroupPointPlusCoordinates->LineEdit1->setText(tr("")); - GroupPointPlusCoordinates->SpinBox_DX->SetValue(1.0); - GroupPointPlusCoordinates->SpinBox_DY->SetValue(1.0); - GroupPointPlusCoordinates->SpinBox_DZ->SetValue(1.0); - myOkCoordinates = true; - - /* for the first argument */ - mySelection->AddFilter(myVertexFilter); - break; - } - case 2: /* plane from a planar face selection */ - { - GroupPointDirection->hide(); - GroupPointPlusCoordinates->hide(); - resize(0, 0); - GroupFace->show(); - - myEditCurrentArgument = GroupFace->LineEdit1; - GroupFace->LineEdit1->setText(tr("")); - - /* for the first argument */ - mySelection->AddFilter(myFaceFilter); - break; - } - } - return; -} - - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_PlaneDlg::ClickOnOk() -{ - this->ClickOnApply(); - ClickOnCancel(); - return ; -} - - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_PlaneDlg::ClickOnApply() -{ - myGeomGUI->GetDesktop()->putInfo(tr("")); - if (mySimulationTopoDs.IsNull()) - return; - myGeomGUI->EraseSimulationShape(); - mySimulationTopoDs.Nullify(); - - switch(myConstructorId) - { - case 0 : /* args are myPoint1 and myDx, myDy, myDz from a vector(edge) */ - { - if(myOkPoint1 && myOkDirection) - myGeomGUI->MakePlaneAndDisplay(myPoint1, myDx, myDy, myDz, myTrimSize); - break; - } - case 1 : /* args are myPoint1 and myDx, myDy, myDz from a Spin Box */ - { - if(myOkPoint1) - myGeomGUI->MakePlaneAndDisplay(myPoint1, myDx, myDy, myDz, myTrimSize); - break; - } - case 2 : /* arg is a planar face selection */ - { - if(myOkPlanarFace) - myGeomGUI->MakePlaneAndDisplay(myPoint1, myDx, myDy, myDz, myTrimSize); - break; - } - } - return; -} - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection has changed -//================================================================================= -void GeometryGUI_PlaneDlg::SelectionIntoArgument() -{ - myGeomGUI->EraseSimulationShape(); - mySimulationTopoDs.Nullify(); - QString aString = ""; - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString); - if(nbSel != 1) { - switch (myConstructorId) - { - case 0: - { - if(myEditCurrentArgument == GroupPointDirection->LineEdit1) { - GroupPointDirection->LineEdit1->setText(""); - myOkPoint1 = false ; - } - else if(myEditCurrentArgument == GroupPointDirection->LineEdit2) { - GroupPointDirection->LineEdit2->setText(""); - myOkDirection = false ; - } - break; - } - case 1: - { - if(myEditCurrentArgument == GroupPointPlusCoordinates->LineEdit1) { - GroupPointPlusCoordinates->LineEdit1->setText("") ; - myOkPoint1 = false ; - } - break; - } - case 2: - { - if(myEditCurrentArgument == GroupFace->LineEdit1) { - GroupFace->LineEdit1->setText("") ; - if(aString.compare("") == 0) - myOkPlanarFace = false; - else - myOkPlanarFace = true; - } - break; - } - } - return ; - } - - /* nbSel == 1 */ - TopoDS_Shape S; - if(!myGeomGUI->GetTopoFromSelection(mySelection, S)) - return ; - - /* FIRST CONSTRUCTOR */ - if(myEditCurrentArgument == GroupPointDirection->LineEdit1 && myGeomGUI->VertexToPoint(S, myPoint1)) { - GroupPointDirection->LineEdit1->setText(aString); - myOkPoint1 = true; - } - else if( myEditCurrentArgument == GroupPointDirection->LineEdit2) { - /* We verify if the selection is a linear edge */ - gp_Pnt Pfirst, Plast; - if( myGeomGUI->LinearEdgeExtremities(S, Pfirst, Plast)) { - myGeomGUI->GetBipointDxDyDz(Pfirst, Plast, myDx, myDy, myDz); - GroupPointDirection->LineEdit2->setText(aString); - myOkDirection = true; - this->myTrimSize = GroupPointDirection->SpinBox_DX->GetValue(); - } - } - - /* SECOND CONSTRUCTOR */ - else if(myEditCurrentArgument == GroupPointPlusCoordinates->LineEdit1 && myGeomGUI->VertexToPoint(S, myPoint1)) { - GroupPointPlusCoordinates->LineEdit1->setText(aString); - /* Get arguments */ - myDx = GroupPointPlusCoordinates->SpinBox_DX->GetValue(); - myDy = GroupPointPlusCoordinates->SpinBox_DY->GetValue(); - myDz = GroupPointPlusCoordinates->SpinBox_DZ->GetValue(); - this->myTrimSize = GroupPointPlusCoordinates->SpinBox_S->GetValue(); - myOkPoint1 = true; - myOkCoordinates = true; - } - - /* THIRD CONSTRUCTOR */ - else if(myEditCurrentArgument == GroupFace->LineEdit1) { - if(myOkPlanarFace) { - GroupFace->LineEdit1->setText(aString); - BRepAdaptor_Surface surf(TopoDS::Face(S)); - gp_Pln Plane = surf.Plane(); - - gp_Pnt myPoint1 = Plane.Location(); - gp_Ax1 ax = Plane.Axis(); - myDx = (ax.Direction()).X(); - myDy = (ax.Direction()).Y(); - myDz = (ax.Direction()).Z(); - this->myTrimSize = GroupFace->SpinBox_DX->GetValue(); - } - } - - /* Call method simulation */ - if((myOkPoint1 && myOkDirection) || (myOkPoint1 && myOkCoordinates) || myOkPlanarFace) { - if(myDx*myDx + myDy*myDy + myDz*myDz > Precision::Confusion()*Precision::Confusion()) - MakePlaneSimulationAndDisplay(myPoint1, myDx, myDy, myDz, myTrimSize) ; - } - return; -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_PlaneDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - mySelection->ClearFilters() ; - - switch (myConstructorId) - { - case 0: - { - if(send == GroupPointDirection->PushButton1) { - GroupPointDirection->LineEdit1->setFocus(); - myEditCurrentArgument = GroupPointDirection->LineEdit1; - mySelection->AddFilter(myVertexFilter); - } - else if(send == GroupPointDirection->PushButton2) { - GroupPointDirection->LineEdit2->setFocus(); - myEditCurrentArgument = GroupPointDirection->LineEdit2; - /* Edge filter here */ - mySelection->AddFilter(myEdgeFilter); - SelectionIntoArgument(); - } - break; - } - case 1: - { - if(send == GroupPointPlusCoordinates->PushButton1) { - GroupPointPlusCoordinates->LineEdit1->setFocus(); - myEditCurrentArgument = GroupPointPlusCoordinates->LineEdit1; - /* Vertex filter here */ - mySelection->AddFilter(myVertexFilter); - SelectionIntoArgument(); - } - break; - } - case 2: - { - if(send == GroupFace->PushButton1) { - GroupFace->LineEdit1->setFocus(); - myEditCurrentArgument = GroupFace->LineEdit1; - /* Face filter here */ - mySelection->AddFilter(myFaceFilter); - SelectionIntoArgument(); - } - break; - } - } - return ; -} - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_PlaneDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if(send == GroupPointDirection->LineEdit1) - myEditCurrentArgument = GroupPointDirection->LineEdit1; - else if (send == GroupPointDirection->LineEdit2) - myEditCurrentArgument = GroupPointDirection->LineEdit2; - else if (send == GroupPointPlusCoordinates->LineEdit1) - myEditCurrentArgument = GroupPointPlusCoordinates->LineEdit1; - else if (send == GroupFace->LineEdit1) - myEditCurrentArgument = GroupFace->LineEdit1; - else - return; - - GeometryGUI_Skeleton::LineEditReturnPressed(); - return ; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_PlaneDlg::ActivateThisDialog() -{ - GeometryGUI_Skeleton::ActivateThisDialog(); - connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - if(!mySimulationTopoDs.IsNull()) - myGeomGUI->DisplaySimulationShape(mySimulationTopoDs); - return; -} - - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void GeometryGUI_PlaneDlg::enterEvent(QEvent* e) -{ - if (GroupConstructors->isEnabled()) - return; - this->ActivateThisDialog(); - return; -} - - -//================================================================================= -// function : ValueChangedInSpinBox() -// purpose : -//================================================================================= -void GeometryGUI_PlaneDlg::ValueChangedInSpinBox( double newValue ) -{ - myGeomGUI->EraseSimulationShape(); - mySimulationTopoDs.Nullify(); - QObject* send = (QObject*)sender() ; - - if(send == GroupPointPlusCoordinates->SpinBox_DX) { - myDx = newValue; - myDy = GroupPointPlusCoordinates->SpinBox_DY->GetValue(); - myDz = GroupPointPlusCoordinates->SpinBox_DZ->GetValue(); - } else if(send == GroupPointPlusCoordinates->SpinBox_DY) { - myDx = GroupPointPlusCoordinates->SpinBox_DX->GetValue(); - myDy = newValue; - myDz = GroupPointPlusCoordinates->SpinBox_DZ->GetValue(); - } else if(send == GroupPointPlusCoordinates->SpinBox_DZ) { - myDx = GroupPointPlusCoordinates->SpinBox_DX->GetValue(); - myDy = GroupPointPlusCoordinates->SpinBox_DY->GetValue(); - myDz = newValue; - } else if(send == GroupPointDirection->SpinBox_DX || send == GroupPointPlusCoordinates->SpinBox_S || send == GroupFace->SpinBox_DX) { - myTrimSize = newValue; - } else - return; - - if((myOkPoint1 && myOkDirection) || (myOkPoint1 && myOkCoordinates) || myOkPlanarFace) { - if (myDx*myDx + myDy*myDy + myDz*myDz > Precision::Confusion() * Precision::Confusion()) - MakePlaneSimulationAndDisplay( myPoint1, myDx, myDy, myDz, myTrimSize); - } - - return ; -} - - -//================================================================================= -// function : MakePlaneSimulationAndDisplay(() -// purpose : -//================================================================================= -void GeometryGUI_PlaneDlg::MakePlaneSimulationAndDisplay(const gp_Pnt& P1, - const Standard_Real dx, - const Standard_Real dy, - const Standard_Real dz, - const Standard_Real trimsize) -{ - try { - gp_Dir aDirection(dx, dy, dz); - /* We make a trimmed plane */ - gp_Pln gplane(P1, aDirection); - mySimulationTopoDs = BRepBuilderAPI_MakeFace(gplane, -trimsize, +trimsize, -trimsize, +trimsize); - } - catch(Standard_Failure) { - MESSAGE( "Exception catched in MakePlaneSimulation" << endl ); - return; - } - - myGeomGUI->DisplaySimulationShape(mySimulationTopoDs); - return ; -} diff --git a/src/GEOMGUI/GeometryGUI_PlaneDlg.h b/src/GEOMGUI/GeometryGUI_PlaneDlg.h deleted file mode 100644 index 38435a02b..000000000 --- a/src/GEOMGUI/GeometryGUI_PlaneDlg.h +++ /dev/null @@ -1,95 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_PlaneDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_PLANE_H -#define DIALOGBOX_PLANE_H - -#include "GeometryGUI_Skeleton.h" -#include "GeometryGUI_2Sel1Spin.h" -#include "GeometryGUI_1Sel4Spin.h" -#include "GeometryGUI_1Sel1Spin.h" - -#include "GEOM_FaceFilter.hxx" -#include - -//================================================================================= -// class : GeometryGUI_PlaneDlg -// purpose : -//================================================================================= -class GeometryGUI_PlaneDlg : public GeometryGUI_Skeleton -{ - Q_OBJECT - -public: - GeometryGUI_PlaneDlg(QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0); - ~GeometryGUI_PlaneDlg(); - -private : - void Init(SALOME_Selection* Sel); - void enterEvent(QEvent* e); - - double step; - int myConstructorId; - Handle(GEOM_ShapeTypeFilter) myVertexFilter; /* Filters selection */ - Handle(GEOM_ShapeTypeFilter) myEdgeFilter; - Handle(GEOM_FaceFilter) myFaceFilter; - - gp_Pnt myPoint1; /* Point on the plane */ - - Standard_Real myDx; - Standard_Real myDy; - Standard_Real myDz; - Standard_Real myTrimSize; - - bool myOkPoint1; /* true when argument is defined */ - bool myOkDirection; - bool myOkCoordinates; - bool myOkPlanarFace; - - GeometryGUI_2Sel1Spin* GroupPointDirection; - GeometryGUI_1Sel4Spin* GroupPointPlusCoordinates; - GeometryGUI_1Sel1Spin* GroupFace; - -private slots: - void ClickOnOk(); - void ClickOnApply(); - void ActivateThisDialog(); - void SelectionIntoArgument(); - void LineEditReturnPressed(); - void SetEditCurrentArgument(); - void ConstructorsClicked(int constructorId); - void ValueChangedInSpinBox(double newValue); - void MakePlaneSimulationAndDisplay(const gp_Pnt& P, - const Standard_Real dx, - const Standard_Real dy, - const Standard_Real dz, - const Standard_Real trimSize); - -}; - -#endif // DIALOGBOX_PLANE_H diff --git a/src/GEOMGUI/GeometryGUI_PointDlg.cxx b/src/GEOMGUI/GeometryGUI_PointDlg.cxx deleted file mode 100644 index 2423b809f..000000000 --- a/src/GEOMGUI/GeometryGUI_PointDlg.cxx +++ /dev/null @@ -1,786 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_PointDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_PointDlg.h" - -#include "GeometryGUI.h" -#include "QAD_Application.h" -#include "QAD_RightFrame.h" -#include "QAD_Config.h" -#include "QAD_Desktop.h" -#include "QAD_Tools.h" -#include "OCCViewer_Viewer3d.h" -#include "utilities.h" - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - - -//================================================================================= -// class : GeometryGUI_PointDlg() -// purpose : Constructs a GeometryGUI_PointDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_PointDlg::GeometryGUI_PointDlg( QWidget* parent, - const char* name, - SALOME_Selection* Sel, - const Handle (AIS_InteractiveContext)& ic, - bool modal, - WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_POINT"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_POINT_EDGE"))); - - if ( !name ) - setName( "GeometryGUI_PointDlg" ); - resize( 303, 185 ); - setCaption( tr( "GEOM_POINT_TITLE" ) ); - setSizeGripEnabled( TRUE ); - GeometryGUI_PointDlgLayout = new QGridLayout( this ); - GeometryGUI_PointDlgLayout->setSpacing( 6 ); - GeometryGUI_PointDlgLayout->setMargin( 11 ); - - /***************************************************************/ - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); - GroupButtons->setTitle( tr( "" ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 3 ); - buttonApply = new QPushButton( GroupButtons, "buttonApply" ); - buttonApply->setText( tr( "GEOM_BUT_APPLY" ) ); - buttonApply->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonApply, 0, 1 ); - QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_9, 0, 2 ); - buttonOk = new QPushButton( GroupButtons, "buttonOk" ); - buttonOk->setText( tr( "GEOM_BUT_OK" ) ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - GeometryGUI_PointDlgLayout->addWidget( GroupButtons, 2, 0 ); - - /***************************************************************/ - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "Constructors" ) ); - GroupConstructors->setExclusive( TRUE ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setText( tr( "" ) ); - Constructor1->setPixmap( image0 ); - Constructor1->setChecked( FALSE ); - Constructor1->setMinimumSize( QSize( 50, 0 ) ); - - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer_2, 0, 1 ); - - Constructor2 = new QRadioButton( GroupConstructors, "Constructor2" ); - Constructor2->setText( tr( "" ) ); - Constructor2->setPixmap( image2 ); - Constructor2->setChecked( TRUE ); - Constructor2->setMinimumSize( QSize( 50, 0 ) ); - - GroupConstructorsLayout->addWidget( Constructor2, 0, 2 ); - QSpacerItem* spacer_3 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer_3, 0, 3 ); - - GeometryGUI_PointDlgLayout->addWidget( GroupConstructors, 0, 0 ); - - - /***************************************************************/ - GroupCoordinates = new QGroupBox( this, "GroupCoordinates" ); - GroupCoordinates->setTitle( tr( "GEOM_COORDINATES" ) ); - GroupCoordinates->setColumnLayout(0, Qt::Vertical ); - GroupCoordinates->layout()->setSpacing( 0 ); - GroupCoordinates->layout()->setMargin( 0 ); - GroupCoordinatesLayout = new QGridLayout( GroupCoordinates->layout() ); - GroupCoordinatesLayout->setAlignment( Qt::AlignTop ); - GroupCoordinatesLayout->setSpacing( 6 ); - GroupCoordinatesLayout->setMargin( 11 ); - - TextLabel_X = new QLabel( GroupCoordinates, "TextLabel_X" ); - TextLabel_X->setText( tr( "GEOM_X" ) ); - GroupCoordinatesLayout->addWidget( TextLabel_X, 0, 0 ); - TextLabel_Y = new QLabel( GroupCoordinates, "TextLabel_Y" ); - TextLabel_Y->setText( tr( "GEOM_Y" ) ); - GroupCoordinatesLayout->addWidget( TextLabel_Y, 0, 2 ); - TextLabel_Z = new QLabel( GroupCoordinates, "TextLabel_Z" ); - TextLabel_Z->setText( tr( "GEOM_Z" ) ); - GroupCoordinatesLayout->addWidget( TextLabel_Z, 0, 4 ); - - /* Spin boxes construction */ - SpinBox_X = new GeometryGUI_SpinBox( GroupCoordinates, "GeomSpinBox_X" ) ; - GroupCoordinatesLayout->addWidget( SpinBox_X, 0, 1 ); - SpinBox_Y = new GeometryGUI_SpinBox( GroupCoordinates, "GeomSpinBox_Y" ) ; - GroupCoordinatesLayout->addWidget( SpinBox_Y, 0, 3 ); - SpinBox_Z = new GeometryGUI_SpinBox( GroupCoordinates, "GeomSpinBox_Z" ) ; - GroupCoordinatesLayout->addWidget( SpinBox_Z, 0, 5 ); - GeometryGUI_PointDlgLayout->addWidget( GroupCoordinates, 1, 0 ); - - /***************************************************************/ - GroupWithEdge = new QGroupBox( this, "GroupWithEdge" ); - GroupWithEdge->setTitle( tr( "GEOM_PARAM_POINT" ) ); - GroupWithEdge->setFrameShape( QGroupBox::Box ); - GroupWithEdge->setFrameShadow( QGroupBox::Sunken ); - GroupWithEdge->setColumnLayout(0, Qt::Vertical ); - GroupWithEdge->layout()->setSpacing( 0 ); - GroupWithEdge->layout()->setMargin( 0 ); - GroupWithEdgeLayout = new QGridLayout( GroupWithEdge->layout() ); - GroupWithEdgeLayout->setAlignment( Qt::AlignTop ); - GroupWithEdgeLayout->setSpacing( 6 ); - GroupWithEdgeLayout->setMargin( 11 ); - - LineEdit_Edge = new QLineEdit( GroupWithEdge, "LineEdit_Edge" ); - GroupWithEdgeLayout->addWidget( LineEdit_Edge, 0, 2 ); - - SelectButton_Edge = new QPushButton( GroupWithEdge, "SelectButton_Edge" ); - SelectButton_Edge->setText( tr( "" ) ); - SelectButton_Edge->setPixmap( image1 ); - SelectButton_Edge->setToggleButton( FALSE ); - GroupWithEdgeLayout->addWidget( SelectButton_Edge, 0, 1 ); - - /* Spin box */ - SpinBox_Parameter = new GeometryGUI_SpinBox( GroupWithEdge, "SpinBox_Parameter" ); - GroupWithEdgeLayout->addWidget( SpinBox_Parameter, 1, 2 ); - - TextLabel_Edge = new QLabel( GroupWithEdge, "TextLabel_Edge" ); - TextLabel_Edge->setText( tr( "GEOM_EDGE" ) ); - TextLabel_Edge->setMinimumSize( QSize( 50, 0 ) ); - TextLabel_Edge->setFrameShape( QLabel::NoFrame ); - TextLabel_Edge->setFrameShadow( QLabel::Plain ); - GroupWithEdgeLayout->addWidget( TextLabel_Edge, 0, 0 ); - - TextLabel_Parameter = new QLabel( GroupWithEdge, "TextLabel_Parameter" ); - TextLabel_Parameter->setText( tr( "GEOM_PARAMETER" ) ); - TextLabel_Parameter->setMinimumSize( QSize( 50, 0 ) ); - TextLabel_Parameter->setFrameShape( QLabel::NoFrame ); - TextLabel_Parameter->setFrameShadow( QLabel::Plain ); - GroupWithEdgeLayout->addWidget( TextLabel_Parameter, 1, 0 ); - - GeometryGUI_PointDlgLayout->addWidget( GroupWithEdge, 1, 0 ); - /***************************************************************/ - - /* Initialisation and display */ - Init(Sel, ic) ; - - /* Move widget on the botton right corner of main widget */ - QAD_Tools::alignWidget(this, parent, AlignBottom | AlignRight); - /* Display Dialog */ - this->show() ; -} - - -//======================================================================= -// function : ~GeometryGUI_PointDlg() -// purpose : Destructor -//======================================================================= -GeometryGUI_PointDlg::~GeometryGUI_PointDlg() -{ - /* no need to delete child widgets, Qt does it all for us */ -} - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_PointDlg::Init(SALOME_Selection* Sel, const Handle(AIS_InteractiveContext)& ic) -{ - - /* Get setting of step value from file configuration */ - double step ; - QString St = QAD_CONFIG->getSetting( "Geometry:SettingsGeomStep" ) ; - step = St.toDouble() ; - - /* min, max, step and decimals for spin boxes */ - SpinBox_X->RangeStepAndValidator( -999.999, 999.999, step, 3 ) ; - SpinBox_X->SetValue( 0.0 ) ; - SpinBox_Y->RangeStepAndValidator( -999.999, 999.999, step, 3 ) ; - SpinBox_Y->SetValue( 0.0 ) ; - SpinBox_Z->RangeStepAndValidator( -999.999, 999.999, step, 3 ) ; - SpinBox_Z->SetValue( 0.0 ) ; - - /* spin box for parameter on edge */ - double specificStep = 0.1 ; - SpinBox_Parameter->RangeStepAndValidator( -999999.99999, 999999.99999, specificStep, 5 ) ; - SpinBox_Parameter->SetValue( 0.50 ) ; - myParameter = 0.50 ; - - GroupCoordinates->show(); - GroupWithEdge->hide() ; - myConstructorId = 0 ; - Constructor1->setChecked( TRUE ); - - /* filter for the second constructor */ - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - myEdgeFilter = new GEOM_ShapeTypeFilter( TopAbs_EDGE, myGeom ); - - bool displayPoint = false ; - mySelection = Sel ; - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - myGeomGUI->SetState(POINT_METHOD) ; - - mySelection = Sel; - myOkEdge = false ; - - /* manages local context selection */ - myIC = ic ; - - if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) { - myLocalContextId = myIC->OpenLocalContext(); - myGeomGUI->SetDisplayedObjectList(); - /* sub shapes selection */ - myLocalContextMode = TopAbs_VERTEX ; - myIC->ActivateStandardMode(myLocalContextMode) ; - myUseLocalContext = true ; - } else { - myUseLocalContext = false ; - } - - - myPoint.SetCoord( 0.0, 0.0, 0.0 ) ; - TopoDS_Shape S; - - if( myGeomGUI->GetTopoFromSelection(mySelection, S) ) { - - /* Filter a possibly previous selection and try to put it into coordinates */ - if( myGeomGUI->VertexToPoint( S, myPoint) ) - displayPoint = false ; - else - displayPoint = true ; - } - else { - displayPoint = true ; - } - - mySimulationTopoDs.Nullify() ; - PointIntoCoordinates(myPoint, displayPoint) ; - - /* signals and slots connections */ - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ); - connect( buttonApply, SIGNAL( clicked() ), this, SLOT(ClickOnApply() ) ); - connect( SelectButton_Edge, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - - connect( GroupConstructors, SIGNAL(clicked(int) ), this, SLOT( ConstructorsClicked(int) ) ) ; - - connect( SpinBox_X, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double ) ) ) ; - connect( SpinBox_Y, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double ) ) ) ; - connect( SpinBox_Z, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double ) ) ) ; - - connect( SpinBox_Parameter, SIGNAL ( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) ) ; - connect( LineEdit_Edge, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - - connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ),this, SLOT( DeactivateActiveDialog() ) ) ; - connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ; - // connect( mySelection, SIGNAL ( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ) ; done in constructor clicked ! - - /* Move widget on the botton right corner of main widget */ - int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; - this->show() ; /* Displays this Dialog */ -} - - - -//================================================================================= -// function : ValueChangedInSpinBox() -// purpose : -//================================================================================= -void GeometryGUI_PointDlg::ValueChangedInSpinBox( double newValue ) -{ - GeometryGUI_SpinBox* send = (GeometryGUI_SpinBox*)sender() ; - double vx, vy, vz ; - if( send == SpinBox_X ) { - vx = newValue ; - vy = SpinBox_Y->GetValue() ; - vz = SpinBox_Z->GetValue() ; - } else if ( send == SpinBox_Y ) { - vx = SpinBox_X->GetValue() ; - vy = newValue ; - vz = SpinBox_Z->GetValue() ; - } else if (send == SpinBox_Z ) { - vx = SpinBox_X->GetValue() ; - vy = SpinBox_Y->GetValue() ; - vz = newValue ; - } else if (send == SpinBox_Parameter ) { - myParameter = newValue ; - } else - return ; - - - switch (myConstructorId) { - case 0: // default constructor - { - myPoint.SetCoord(vx, vy, vz) ; - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs = BRepBuilderAPI_MakeVertex (myPoint).Shape() ; - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - break ; - } - case 1: - { - this->SelectionIntoArgument() ; - break ; - } - } - - return ; -} - - - -//======================================================================= -// funcion : PointIntoCoordinates() -// purpose : Sets user point coordinates into this dialog Spin boxes -// : and displays it or not according to 'bool displayPoint' -//======================================================================= -void GeometryGUI_PointDlg::PointIntoCoordinates(gp_Pnt P, bool displayPoint) -{ - switch (myConstructorId) { - case 0 : { - SpinBox_X->SetValue( P.X() ) ; - SpinBox_Y->SetValue( P.Y() ) ; - SpinBox_Z->SetValue( P.Z() ) ; - this->myPoint.SetCoord( P.X(), P.Y(), P.Z() ) ; - if( displayPoint ) { - mySimulationTopoDs = BRepBuilderAPI_MakeVertex(P).Shape() ; - myGeomGUI->DisplaySimulationShape(mySimulationTopoDs) ; - } - break ; - } - case 1 : - { - // TODO - break ; - } - } - - return ; -} - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_PointDlg::ConstructorsClicked(int constructorId) -{ - myGeomGUI->EraseSimulationShape() ; - myConstructorId = constructorId ; - switch (constructorId) - { - case 0: - { - if ( myUseLocalContext == false && myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) { - myLocalContextId = myIC->OpenLocalContext(); - myGeomGUI->SetDisplayedObjectList(); - /* sub shapes selection */ - myLocalContextMode = TopAbs_VERTEX ; - myIC->ActivateStandardMode(myLocalContextMode) ; - myUseLocalContext = true ; - } - mySelection->ClearFilters() ; - GroupCoordinates->show(); - GroupWithEdge->hide() ; - /* Display point simulation */ - PointIntoCoordinates( this->myPoint, true ) ; - disconnect( mySelection, 0, this, 0 ); - break; - } - case 1: - { - if ( myUseLocalContext == true && myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) { - myIC->CloseLocalContext(myLocalContextId) ; - myUseLocalContext = false ; - } - LineEdit_Edge->setText("") ; - mySelection->AddFilter( myEdgeFilter ); - GroupCoordinates->hide(); - GroupWithEdge->show() ; - myOkEdge = false ; - connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - break; - } - } - return ; -} - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_PointDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if( send == LineEdit_Edge ) { - /* User name of object input management */ - /* If successfull the selection is changed and signal emitted... */ - /* so SelectionIntoArgument() is automatically called. */ - const QString objectUserName = send->text() ; - QWidget* thisWidget = (QWidget*)this ; - if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) { - LineEdit_Edge->setText( objectUserName ) ; - } - } - return ; -} - - - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_PointDlg::ClickOnOk() -{ - this->ClickOnApply() ; - this->ClickOnCancel() ; - - return ; -} - -//======================================================================= -// function : ClickOnApply() -// purpose : -//======================================================================= -void GeometryGUI_PointDlg::ClickOnApply() -{ - - myGeomGUI->EraseSimulationShape() ; - - /* Close local context */ - if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) { - myIC->CloseLocalContext(myLocalContextId) ; - myUseLocalContext = false ; - } - - switch (myConstructorId) { - - case 0 : - { - /* Recup args and call method */ - double x = SpinBox_X->GetValue() ; - double y = SpinBox_Y->GetValue() ; - double z = SpinBox_Z->GetValue() ; - - myGeomGUI->MakePointAndDisplay(x,y,z) ; /* WARNING : no display if a local context is opened */ - if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) { - /* no display if a local context is opened */ - myLocalContextId = myIC->OpenLocalContext(); - myGeomGUI->SetDisplayedObjectList(); - /* sub shapes selection */ - myLocalContextMode = TopAbs_VERTEX ; - myIC->ActivateStandardMode(myLocalContextMode); - myUseLocalContext = true ; - } - break ; - } - case 1 : - { - if( myOkEdge == true ) { - /* this constructor method has no idl interface : we use same than constructor 0 */ - myGeomGUI->MakePointAndDisplay( myPoint.X(), myPoint.Y(), myPoint.Z() ) ; - } - break ; - } - } - - return ; -} - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed (for constructors not using local context) -//================================================================================= -void GeometryGUI_PointDlg::SelectionIntoArgument() -{ - myGeomGUI->EraseSimulationShape() ; - LineEdit_Edge->setText("") ; - QString aString = "" ; /* future name of selection */ - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; - if ( nbSel != 1 ) { - this->myOkEdge = false ; - return ; - } - - // nbSel == 1 - TopoDS_Shape S; - if( !myGeomGUI->GetTopoFromSelection(mySelection, S) ) - return ; - - switch (myConstructorId) - { - case 0: - break ; - case 1: - { - LineEdit_Edge->setText(aString) ; - if( S.ShapeType() == TopAbs_EDGE ) { - if( CalculateVertexOnCurve( TopoDS::Edge(S), myParameter, mySimulationTopoDs) ) { - if ( myGeomGUI->VertexToPoint( mySimulationTopoDs, myPoint ) ) { - this->myOkEdge = true ; - myGeomGUI->DisplaySimulationShape(mySimulationTopoDs) ; - } - } - } - break ; - } - } - return ; -} - - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_PointDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - switch (myConstructorId) - { - case 0: // default constructor - break; - case 1: - { - if(send == SelectButton_Edge) { - LineEdit_Edge->setFocus() ; - SelectionIntoArgument() ; - } - break; - } - } - return ; -} - - -//======================================================================= -// function : UseLocalContext() -// purpose : Return true when this method has opened a local context -// : Used from GeometryGUI -//======================================================================= -bool GeometryGUI_PointDlg::UseLocalContext() -{ - return this->myUseLocalContext ; -} - - -//======================================================================= -// function : closeEvent() -// purpose : -//======================================================================= -void GeometryGUI_PointDlg::closeEvent(QCloseEvent* e) -{ - this->ClickOnCancel() ; /* same than click on cancel button */ -} - - -//======================================================================= -// function : ClickOnCancel() -// purpose : -//======================================================================= -void GeometryGUI_PointDlg::ClickOnCancel() -{ - if ( myConstructorId == 0 && myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) { - OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer(); - myIC = v3d->getAISContext(); - if ( myIC->HasOpenedContext() ) { - myIC->CloseLocalContext(myLocalContextId) ; - myUseLocalContext = false ; - } - } - mySelection->ClearFilters() ; - myGeomGUI->SetActiveDialogBox(0) ; - myGeomGUI->EraseSimulationShape() ; - myGeomGUI->ResetState() ; - reject() ; - return ; -} - - -//================================================================================= -// function : enterEvent() -// purpose : to reactivate this dialog box when mouse enter onto the window -//================================================================================= -void GeometryGUI_PointDlg::enterEvent( QEvent* e) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; -} - - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : public slot to deactivate if active -//================================================================================= -void GeometryGUI_PointDlg::DeactivateActiveDialog() -{ - if ( GroupConstructors->isEnabled() ) { - - mySelection->ClearFilters() ; - GroupConstructors->setEnabled(false) ; - GroupCoordinates->setEnabled(false) ; - GroupWithEdge->setEnabled(false) ; - GroupButtons->setEnabled(false) ; - myGeomGUI->EraseSimulationShape() ; - myGeomGUI->ResetState() ; - myGeomGUI->SetActiveDialogBox(0) ; - if ( myConstructorId == 0 && myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) { - myIC->CloseLocalContext(myLocalContextId) ; - myUseLocalContext = false ; - } - } - - return ; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_PointDlg::ActivateThisDialog( ) -{ - - if ( !GroupConstructors->isEnabled() ) { /* if not active */ - - myGeomGUI->EmitSignalDeactivateDialog() ; - GroupConstructors->setEnabled(true) ; - GroupCoordinates->setEnabled(true) ; - GroupWithEdge->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - - myGeomGUI->SetState(POINT_METHOD) ; - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - - if ( myConstructorId == 0 ) { - - mySelection->ClearFilters() ; - if( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) { - OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer(); - myIC = v3d->getAISContext(); - myLocalContextId = myIC->OpenLocalContext(); - myGeomGUI->SetDisplayedObjectList(); - /* sub shapes selection */ - myLocalContextMode = TopAbs_VERTEX ; - myIC->ActivateStandardMode(myLocalContextMode); - myUseLocalContext = true ; - } - } - - if ( myConstructorId == 1 ) - mySelection->AddFilter( myEdgeFilter ); - - if( !mySimulationTopoDs.IsNull() ) - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - - } - return ; -} - - -//================================================================================= -// function : CalculateVertexOnCurve() -// purpose : Calculate a Vertex on the curve given by 'anEdge'. -// : The position of resultVertex is given by aParameter. -// : For a linear edge, aParameter=0.0 gives the first vertex of edge -// : aParameter=1.0 gives the last vertex of edge -// : aParameter=0.5 gives the vertex on the middle of edge -// : It is possible to get vertices out of edge using values > 1.0 or < 0.0 -//================================================================================= -bool GeometryGUI_PointDlg::CalculateVertexOnCurve(const TopoDS_Edge& anEdge, const Standard_Real aParameter, TopoDS_Shape& resultVertex) -{ - if( anEdge.IsNull() || !BRepAlgoAPI::IsValid(anEdge) ) - return false ; - - Standard_Real first, last ; - Handle(Geom_Curve) curv = BRep_Tool::Curve(anEdge, first, last); - if( !curv->IsCN(0) ) - return false ; - - Standard_Real param; - if( anEdge.Orientation() == TopAbs_FORWARD ) { - param = first + (last-first) * aParameter ; - } - else { - param = last + (first-last) * aParameter ; - } - gp_Pnt paramPoint ; - curv->D0( param, paramPoint ) ; - resultVertex = BRepBuilderAPI_MakeVertex(paramPoint); - return true ; -} - diff --git a/src/GEOMGUI/GeometryGUI_PointDlg.h b/src/GEOMGUI/GeometryGUI_PointDlg.h deleted file mode 100644 index 2de8161ee..000000000 --- a/src/GEOMGUI/GeometryGUI_PointDlg.h +++ /dev/null @@ -1,153 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_PointDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_POINT_H -#define DIALOGBOX_POINT_H - -#include "SALOME_Selection.h" -#include "GEOM_ShapeTypeFilter.hxx" -#include "GeometryGUI_SpinBox.h" - -#include -#include - -#include -#include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QFrame; -class QGroupBox; -class QLabel; -class QSpinBox; -class QPushButton; -class QRadioButton; -class GeometryGUI; - -#include -#include -#include -#include -#include - - -//================================================================================= -// class : GeometryGUI_PointDlg -// purpose : -//================================================================================= -class GeometryGUI_PointDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_PointDlg( QWidget* parent = 0, const char* name = 0, - SALOME_Selection* Sel = 0, - const Handle(AIS_InteractiveContext)& ic = 0, - bool modal = FALSE, - WFlags fl = 0 ); - - ~GeometryGUI_PointDlg(); - -private : - - SALOME_Selection* mySelection ; /* Current selection */ - TopoDS_Shape mySimulationTopoDs; /* Shape used to display a simulation */ - gp_Pnt myPoint ; /* Is 'mySimulationTopoDs' */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - GEOM::GEOM_Gen_var myGeom ; /* Current GeomI object */ - - /* Interactive and local context management see also : bool UseLocalContext() */ - Handle (AIS_InteractiveContext) myIC ; /* Interactive context from IAPP */ - Standard_Integer myLocalContextId ; /* identify a local context for this method */ - TopAbs_ShapeEnum myLocalContextMode ; /* identify a selection mode into local context */ - bool myUseLocalContext ; /* true when method as opened a local context */ - - int myConstructorId ; /* Current constructor id = radio button id */ - double myParameter ; /* Parameter used to create a vertex on edge (point on curve) */ - bool myOkEdge ; /* true when an edge is selected by user */ - - Handle(GEOM_ShapeTypeFilter) myEdgeFilter; /* filter for selection */ - - void Init(SALOME_Selection* Sel, const Handle(AIS_InteractiveContext)& ic) ; /* Initialize dialog */ - void enterEvent(QEvent* e); - void closeEvent(QCloseEvent* e) ; - - QButtonGroup* GroupConstructors; - QRadioButton* Constructor1; - QRadioButton* Constructor2; - - QGroupBox* GroupCoordinates; - QLabel* TextLabel_X; - QLabel* TextLabel_Y; - QLabel* TextLabel_Z; - - GeometryGUI_SpinBox* SpinBox_X ; - GeometryGUI_SpinBox* SpinBox_Y ; - GeometryGUI_SpinBox* SpinBox_Z ; - - QGroupBox* GroupWithEdge; - QLabel* TextLabel_Edge; - QPushButton* SelectButton_Edge; - QLineEdit* LineEdit_Edge; - QLabel* TextLabel_Parameter; - GeometryGUI_SpinBox* SpinBox_Parameter; - - QGroupBox* GroupButtons; - QPushButton* buttonApply; - QPushButton* buttonOk; - QPushButton* buttonCancel; - -private slots: - - void ConstructorsClicked(int constructorId); - void ClickOnOk(); - void ClickOnCancel(); - void ClickOnApply(); - void SetEditCurrentArgument() ; - void LineEditReturnPressed() ; - void SelectionIntoArgument() ; - void DeactivateActiveDialog() ; - void ActivateThisDialog() ; - void ValueChangedInSpinBox( double newValue ) ; - bool CalculateVertexOnCurve(const TopoDS_Edge& anEdge, const Standard_Real aParameter, TopoDS_Shape& resultVertex) ; - -public: - void PointIntoCoordinates(gp_Pnt P, bool displayPoint) ; - bool UseLocalContext() ; /* return true if method has opened a local context */ - -protected: - QGridLayout* GeometryGUI_PointDlgLayout; - QGridLayout* GroupConstructorsLayout; - QGridLayout* GroupCoordinatesLayout; - QGridLayout* GroupWithEdgeLayout; - QGridLayout* GroupButtonsLayout; -}; - -#endif // DIALOGBOX_POINT_H diff --git a/src/GEOMGUI/GeometryGUI_PrismDlg.cxx b/src/GEOMGUI/GeometryGUI_PrismDlg.cxx deleted file mode 100644 index 21ce8eba7..000000000 --- a/src/GEOMGUI/GeometryGUI_PrismDlg.cxx +++ /dev/null @@ -1,608 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_PrismDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_PrismDlg.h" - -#include "GeometryGUI.h" -#include "QAD_Application.h" -#include "QAD_Desktop.h" -#include "QAD_Config.h" -#include "utilities.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - - -//================================================================================= -// class : GeometryGUI_PrismDlg() -// purpose : Constructs a GeometryGUI_PrismDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_PrismDlg::GeometryGUI_PrismDlg( QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_PRISM"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - - if ( !name ) - setName( "GeometryGUI_PrismDlg" ); - resize( 303, 225 ); - setCaption( tr( "GEOM_PRISM_TITLE" ) ); - setSizeGripEnabled( TRUE ); - GeometryGUI_PrismDlgLayout = new QGridLayout( this ); - GeometryGUI_PrismDlgLayout->setSpacing( 6 ); - GeometryGUI_PrismDlgLayout->setMargin( 11 ); - - /**************************************************************/ - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "GEOM_PRISM" ) ); - GroupConstructors->setExclusive( TRUE ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setText( tr( "" ) ); - Constructor1->setPixmap( image0 ); - Constructor1->setChecked( TRUE ); - Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) ); - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer, 0, 2 ); - GeometryGUI_PrismDlgLayout->addWidget( GroupConstructors, 0, 0 ); - - /**************************************************************/ - GroupConstructor1 = new QGroupBox( this, "GroupConstructor1" ); - GroupConstructor1->setTitle( tr( "GEOM_PRISM_BSV" ) ); - GroupConstructor1->setColumnLayout(0, Qt::Vertical ); - GroupConstructor1->layout()->setSpacing( 0 ); - GroupConstructor1->layout()->setMargin( 0 ); - GroupConstructor1Layout = new QGridLayout( GroupConstructor1->layout() ); - GroupConstructor1Layout->setAlignment( Qt::AlignTop ); - GroupConstructor1Layout->setSpacing( 6 ); - GroupConstructor1Layout->setMargin( 11 ); - LineEditC1A2Line = new QLineEdit( GroupConstructor1, "LineEditC1A2Line" ); - LineEditC1A2Line->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC1A2Line->sizePolicy().hasHeightForWidth() ) ); - GroupConstructor1Layout->addMultiCellWidget( LineEditC1A2Line, 1, 1, 2, 3 ); - LineEditC1A1Base = new QLineEdit( GroupConstructor1, "LineEditC1A1Base" ); - LineEditC1A1Base->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC1A1Base->sizePolicy().hasHeightForWidth() ) ); - GroupConstructor1Layout->addMultiCellWidget( LineEditC1A1Base, 0, 0, 2, 3 ); - SelectButtonC1A1Base = new QPushButton( GroupConstructor1, "SelectButtonC1A1Base" ); - SelectButtonC1A1Base->setText( tr( "" ) ); - SelectButtonC1A1Base->setPixmap( image1 ); - GroupConstructor1Layout->addWidget( SelectButtonC1A1Base, 0, 1 ); - SelectButtonC1A2Line = new QPushButton( GroupConstructor1, "SelectButtonC1A2Line" ); - SelectButtonC1A2Line->setText( tr( "" ) ); - SelectButtonC1A2Line->setPixmap( image1 ); - GroupConstructor1Layout->addWidget( SelectButtonC1A2Line, 1, 1 ); - TextLabelBase = new QLabel( GroupConstructor1, "TextLabelBase" ); - TextLabelBase->setText( tr( "GEOM_BASE" ) ); - TextLabelBase->setMinimumSize( QSize( 50, 0 ) ); - TextLabelBase->setFrameShape( QLabel::NoFrame ); - TextLabelBase->setFrameShadow( QLabel::Plain ); - GroupConstructor1Layout->addWidget( TextLabelBase, 0, 0 ); - TextLabelVector = new QLabel( GroupConstructor1, "TextLabelVector" ); - TextLabelVector->setText( tr( "GEOM_VECTOR" ) ); - TextLabelVector->setMinimumSize( QSize( 50, 0 ) ); - TextLabelVector->setFrameShape( QLabel::NoFrame ); - TextLabelVector->setFrameShadow( QLabel::Plain ); - GroupConstructor1Layout->addWidget( TextLabelVector, 1, 0 ); - - SpinBox_C1A3Height = new GeometryGUI_SpinBox( GroupConstructor1, "GeomSpinBox_C1A3Height" ) ; - SpinBox_C1A3Height->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, SpinBox_C1A3Height->sizePolicy().hasHeightForWidth() ) ); - GroupConstructor1Layout->addWidget( SpinBox_C1A3Height, 2, 3 ); - - CheckBoxC3A1Reverse = new QCheckBox( GroupConstructor1, "CheckBoxC3A1Reverse" ); - CheckBoxC3A1Reverse->setText( tr( "GEOM_REVERSE" ) ); - GroupConstructor1Layout->addMultiCellWidget( CheckBoxC3A1Reverse, 2, 2, 0, 1 ); - TextLabelHeight = new QLabel( GroupConstructor1, "TextLabelHeight" ); - TextLabelHeight->setText( tr( "GEOM_HEIGHT" ) ); - TextLabelHeight->setMinimumSize( QSize( 50, 0 ) ); - TextLabelHeight->setFrameShape( QLabel::NoFrame ); - TextLabelHeight->setFrameShadow( QLabel::Plain ); - GroupConstructor1Layout->addWidget( TextLabelHeight, 2, 2 ); - GeometryGUI_PrismDlgLayout->addWidget( GroupConstructor1, 1, 0 ); - - /**************************************************************/ - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); - GroupButtons->setTitle( tr( "" ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 3 ); - buttonApply = new QPushButton( GroupButtons, "buttonApply" ); - buttonApply->setText( tr( "GEOM_BUT_APPLY" ) ); - buttonApply->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonApply, 0, 1 ); - QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_9, 0, 2 ); - buttonOk = new QPushButton( GroupButtons, "buttonOk" ); - buttonOk->setText( tr( "GEOM_BUT_OK" ) ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - GeometryGUI_PrismDlgLayout->addWidget( GroupButtons, 2, 0 ); - - /* Initialisation */ - Init( Sel ) ; -} - - -//================================================================================= -// function : ~GeometryGUI_PrismDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_PrismDlg::~GeometryGUI_PrismDlg() -{ - /* no need to delete child widgets, Qt does it all for us */ -} - - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_PrismDlg::Init( SALOME_Selection* Sel ) -{ - - double step ; - QString St = QAD_CONFIG->getSetting( "Geometry:SettingsGeomStep" ) ; - step = St.toDouble() ; - - /* min, max, step and decimals for spin boxes */ - SpinBox_C1A3Height->RangeStepAndValidator( 0.001, 999.999, step, 3 ) ; - SpinBox_C1A3Height->SetValue( 100.0 ) ; /* = myHeight */ - - myHeight = 100.000 ; - mySelection = Sel ; - mySimulationTopoDs.Nullify() ; - myBaseTopo.Nullify() ; - myConstructorId = 0 ; - myDx = myDy = myDz = 0.0 ; - - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - - GroupConstructor1->show(); - myConstructorId = 0 ; - myEditCurrentArgument = LineEditC1A1Base ; - Constructor1->setChecked( TRUE ); - myOkBase = myOkLine = false ; - - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - - /* Retrieves geom component */ - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - /* Filters definition */ - myEdgeFilter = new GEOM_ShapeTypeFilter( TopAbs_EDGE, myGeom ); - - - // TODO first selection into selection ? - - /* signals and slots connections */ - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ; - connect( buttonApply, SIGNAL( clicked() ), this, SLOT(ClickOnApply() ) ); - - connect( GroupConstructors, SIGNAL(clicked(int) ), this, SLOT( ConstructorsClicked(int) ) ); - connect( SelectButtonC1A1Base, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( SelectButtonC1A2Line, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - - connect( LineEditC1A1Base, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - connect( LineEditC1A2Line, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - - connect( CheckBoxC3A1Reverse, SIGNAL (stateChanged(int) ), this, SLOT( ReverseVector(int) ) ) ; - - connect( SpinBox_C1A3Height, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ; - - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ; - /* to close dialog if study change */ - connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ; - - /* Move widget on the botton right corner of main widget */ - int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; - this->show() ; /* Displays Dialog */ - - return ; -} - - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_PrismDlg::ConstructorsClicked(int constructorId) -{ - myGeomGUI->EraseSimulationShape() ; - - switch (constructorId) - { - case 0: /* base shape + an edge used as a vector */ - { - GroupConstructor1->show(); - myConstructorId = constructorId ; - myEditCurrentArgument = LineEditC1A1Base ; - LineEditC1A2Line->setText(tr("")) ; - - SpinBox_C1A3Height->SetValue(100) ; - myHeight = 100.0 ; - - Constructor1->setChecked( TRUE ); - myOkBase = myOkLine = false ; - SelectionIntoArgument() ; - break; - } - } - return ; -} - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_PrismDlg::ClickOnOk() -{ - this->ClickOnApply() ; - this->ClickOnCancel() ; - - return ; -} - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_PrismDlg::ClickOnApply() -{ - gp_Pnt P1, P2 ; - - if( !myOkBase || !myOkLine ) - return ; - - try { - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - gp_Vec Vec(myDx, myDy, myDz ); - Vec.Normalize() ; - Vec *= myHeight ; - P1.SetCoord( 0.0, 0.0, 0.0 ) ; - P2.SetCoord( Vec.X(), Vec.Y(), Vec.Z() ) ; - switch(myConstructorId) - { - case 0 : - { - if( myOkBase && myOkLine ) { - myGeomGUI->MakePrismAndDisplay( myGeomShape, P1, P2 ) ; - } - break ; - } - } - } - catch(Standard_Failure) { - MESSAGE("Exception intercepted in GeometryGUI_PrismDlg" << endl ) ; - return ; - } - - return ; -} - - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void GeometryGUI_PrismDlg::ClickOnCancel() -{ - mySelection->ClearFilters() ; - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->ResetState() ; - reject() ; - return ; -} - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection has changed -//================================================================================= -void GeometryGUI_PrismDlg::SelectionIntoArgument() -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - - /* Future the name of selection */ - QString aString = ""; - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; - if ( nbSel != 1 ) { - switch (myConstructorId) - { - case 0: - { - if ( myEditCurrentArgument == LineEditC1A1Base ) { - LineEditC1A1Base->setText("") ; - myOkBase = false ; - } - else if ( myEditCurrentArgument == LineEditC1A2Line ) { - LineEditC1A2Line->setText("") ; - myOkLine = false ; - } - break ; - } - } - return ; - } - - /* nbSel == 1 */ - TopoDS_Shape S; - if( !myGeomGUI->GetTopoFromSelection(mySelection, S) ) - return ; - - gp_Pnt aPoint1, aPoint2 ; - - if ( myEditCurrentArgument == LineEditC1A1Base ) { - Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject() ; - Standard_Boolean testResult ; - myGeomShape = myGeomGUI->ConvertIOinGEOMShape(IO, testResult) ; - if( !testResult) - return ; - if ( S.ShapeType() <= 2 ) - return; - - LineEditC1A1Base->setText(aString) ; - myBaseTopo = S ; - myOkBase = true ; - } - - else if ( myEditCurrentArgument == LineEditC1A2Line && myGeomGUI->LinearEdgeExtremities(S, aPoint1, aPoint2) ) { - myGeomGUI->GetBipointDxDyDz( aPoint1, aPoint2, myDx, myDy, myDz ) ; - myEditCurrentArgument->setText(aString) ; - myOkLine = true ; - } - - if( myOkBase && myOkLine ) { - MakePrismSimulationAndDisplay( myBaseTopo ) ; - } - return ; -} - - - -//================================================================================= -// function : MakePrismSimulationAndDisplay() -// purpose : -//================================================================================= -void GeometryGUI_PrismDlg::MakePrismSimulationAndDisplay( const TopoDS_Shape& S ) -{ - try { - gp_Vec Vec(myDx, myDy, myDz ); - Vec.Normalize() ; - Vec *= myHeight ; - mySimulationTopoDs = BRepPrimAPI_MakePrism(S, Vec, Standard_False).Shape() ; - } - catch(Standard_Failure) { - MESSAGE( "Exception catched in MakePrismSimulationAndDisplay" << endl ) ; - return ; - } - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - return ; -} - - - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_PrismDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - mySelection->ClearFilters() ; - - switch (myConstructorId) - { - case 0: /* default constructor */ - { - if( send == SelectButtonC1A1Base ) { - LineEditC1A1Base->setFocus() ; - myEditCurrentArgument = LineEditC1A1Base ; - } - else if(send == SelectButtonC1A2Line) { - LineEditC1A2Line->setFocus() ; - myEditCurrentArgument = LineEditC1A2Line; - mySelection->AddFilter(myEdgeFilter) ; - } - SelectionIntoArgument() ; - break; - } - } - return ; -} - -//================================================================================= -// function : ValueChangedInSpinBox() -// purpose : -//================================================================================= -void GeometryGUI_PrismDlg::ValueChangedInSpinBox( double newValue ) -{ - QObject* send = (QObject*)sender(); - - if( send == SpinBox_C1A3Height ) { - myHeight = newValue ; - if( myOkBase && myOkLine ) { - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - MakePrismSimulationAndDisplay( myBaseTopo ) ; - } - } - return ; -} - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_PrismDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if( send == LineEditC1A1Base ) - myEditCurrentArgument = LineEditC1A1Base ; - else if ( send == LineEditC1A2Line ) - myEditCurrentArgument = LineEditC1A2Line ; - else - return ; - - /* User name of object input management */ - /* If successfull the selection is changed and signal emitted... */ - /* so SelectionIntoArgument() is automatically called. */ - const QString objectUserName = myEditCurrentArgument->text() ; - QWidget* thisWidget = (QWidget*)this ; - if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) { - myEditCurrentArgument->setText( objectUserName ) ; - } - return ; -} - - - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void GeometryGUI_PrismDlg::DeactivateActiveDialog() -{ - if ( GroupConstructors->isEnabled() ) { - GroupConstructors->setEnabled(false) ; - GroupConstructor1->setEnabled(false) ; - GroupButtons->setEnabled(false) ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->EraseSimulationShape() ; - } - return ; -} - - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_PrismDlg::closeEvent( QCloseEvent* e ) -{ - this->ClickOnCancel() ; /* same than click on cancel button */ -} - - -//================================================================================= -// function : enterEvent() -// purpose : when mouse enter onto the QWidget -//================================================================================= -void GeometryGUI_PrismDlg::enterEvent( QEvent * ) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; -} - - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_PrismDlg::ActivateThisDialog() -{ - /* Emit a signal to deactivate any active dialog */ - myGeomGUI->EmitSignalDeactivateDialog() ; - GroupConstructors->setEnabled(true) ; - GroupConstructor1->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - - connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - if( !mySimulationTopoDs.IsNull() ) - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - return ; -} - - -//================================================================================= -// function : ReverseVector() -// purpose : 'state' not used here -//================================================================================= -void GeometryGUI_PrismDlg::ReverseVector(int state) -{ - myDx = -myDx ; - myDy = -myDy ; - myDz = -myDz ; - if(myOkBase && myOkLine) { - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - MakePrismSimulationAndDisplay( myBaseTopo ) ; - } - return ; -} diff --git a/src/GEOMGUI/GeometryGUI_PrismDlg.h b/src/GEOMGUI/GeometryGUI_PrismDlg.h deleted file mode 100644 index 8425fc152..000000000 --- a/src/GEOMGUI/GeometryGUI_PrismDlg.h +++ /dev/null @@ -1,129 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_PrismDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_PRISM_H -#define DIALOGBOX_PRISM_H - -#include "SALOME_Selection.h" -#include "GEOM_ShapeTypeFilter.hxx" -#include "GeometryGUI_SpinBox.h" - -#include - -#include -#include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QCheckBox; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QRadioButton; -class GeometryGUI; - - -//================================================================================= -// class : GeometryGUI_PrismDlg -// purpose : -//================================================================================= -class GeometryGUI_PrismDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_PrismDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 ); - ~GeometryGUI_PrismDlg(); - -private : - - void Init( SALOME_Selection* Sel ) ; - void closeEvent( QCloseEvent* e ) ; - void enterEvent( QEvent* e); - void MakePrismSimulationAndDisplay( const TopoDS_Shape& S) ; - - GEOM::GEOM_Gen_var myGeom ; /* Current Geom object */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - TopoDS_Shape mySimulationTopoDs; /* Shape used for simulation display */ - SALOME_Selection* mySelection ; /* User shape selection */ - Standard_Real myDx ; - Standard_Real myDy ; - Standard_Real myDz ; - Standard_Real myHeight ; /* Height used for prism (extrusion) */ - TopoDS_Shape myBaseTopo ; /* topology used as base of prism */ - GEOM::GEOM_Shape_var myGeomShape ; /* that is myBaseTopo */ - bool myOkBase ; - bool myOkLine ; /* to check when arguments myDx, myDy, myDz are defined */ - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - int myConstructorId ; /* Current constructor id = radio button id */ - Handle(GEOM_ShapeTypeFilter) myEdgeFilter; /* Filters selection */ - - QButtonGroup* GroupConstructors; - QRadioButton* Constructor1; - QGroupBox* GroupConstructor1; - - QLineEdit* LineEditC1A1Base; - QLineEdit* LineEditC1A2Line; - QPushButton* SelectButtonC1A1Base; - QPushButton* SelectButtonC1A2Line; - QLabel* TextLabelBase; - QLabel* TextLabelVector; - GeometryGUI_SpinBox* SpinBox_C1A3Height; - QCheckBox* CheckBoxC3A1Reverse; - QLabel* TextLabelHeight; - - QGroupBox* GroupButtons; - QPushButton* buttonApply; - QPushButton* buttonOk; - QPushButton* buttonCancel; - -private slots: - - void ConstructorsClicked(int constructorId); - void ClickOnOk(); - void ClickOnCancel(); - void ClickOnApply(); - void SetEditCurrentArgument() ; - void SelectionIntoArgument() ; - void LineEditReturnPressed() ; - void DeactivateActiveDialog() ; - void ActivateThisDialog() ; - void ReverseVector(int state) ; - void ValueChangedInSpinBox( double newValue ) ; - -protected: - QGridLayout* GeometryGUI_PrismDlgLayout; - QGridLayout* GroupConstructorsLayout; - QGridLayout* GroupConstructor1Layout; - QGridLayout* GroupButtonsLayout; -}; - -#endif // DIALOGBOX_PRISM_H diff --git a/src/GEOMGUI/GeometryGUI_PropertiesDlg.cxx b/src/GEOMGUI/GeometryGUI_PropertiesDlg.cxx deleted file mode 100644 index ba6c71b3e..000000000 --- a/src/GEOMGUI/GeometryGUI_PropertiesDlg.cxx +++ /dev/null @@ -1,467 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_PropertiesDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_PropertiesDlg.h" - -#include "GeometryGUI.h" -#include "QAD_Application.h" -#include "QAD_Desktop.h" -#include "utilities.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - - -//================================================================================= -// class : GeometryGUI_PropertiesDlg() -// purpose : Constructs a GeometryGUI_PropertiesDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_PropertiesDlg::GeometryGUI_PropertiesDlg( QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_BASICPROPERTIES"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - - if ( !name ) - setName( "GeometryGUI_PropertiesDlg" ); - resize( 303, 275 ); - setCaption( tr( "GEOM_PROPERTIES_TITLE" ) ); - setSizeGripEnabled( TRUE ); - GeometryGUI_PropertiesDlgLayout = new QGridLayout( this ); - GeometryGUI_PropertiesDlgLayout->setSpacing( 6 ); - GeometryGUI_PropertiesDlgLayout->setMargin( 11 ); - - /***************************************************************/ - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "GEOM_PROPERTIES" ) ); - GroupConstructors->setExclusive( TRUE ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setText( tr( "" ) ); - Constructor1->setPixmap( image0 ); - Constructor1->setChecked( TRUE ); - Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) ); - Constructor1->setMinimumSize( QSize( 60, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer, 0, 1 ); - GeometryGUI_PropertiesDlgLayout->addWidget( GroupConstructors, 0, 0 ); - - /***************************************************************/ - GroupConstructor1 = new QGroupBox( this, "GroupConstructor1" ); - GroupConstructor1->setTitle( tr( "GEOM_PROPERTIES_CONSTR" ) ); - GroupConstructor1->setColumnLayout(0, Qt::Vertical ); - GroupConstructor1->layout()->setSpacing( 0 ); - GroupConstructor1->layout()->setMargin( 0 ); - GroupConstructor1Layout = new QGridLayout( GroupConstructor1->layout() ); - GroupConstructor1Layout->setAlignment( Qt::AlignTop ); - GroupConstructor1Layout->setSpacing( 6 ); - GroupConstructor1Layout->setMargin( 11 ); - LineEditC1A1 = new QLineEdit( GroupConstructor1, "LineEditC1A1" ); - LineEditC1A1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC1A1->sizePolicy().hasHeightForWidth() ) ); - GroupConstructor1Layout->addWidget( LineEditC1A1, 0, 2 ); - SelectButtonC1A1 = new QPushButton( GroupConstructor1, "SelectButtonC1A1" ); - SelectButtonC1A1->setText( tr( "" ) ); - SelectButtonC1A1->setPixmap( image1 ); - GroupConstructor1Layout->addWidget( SelectButtonC1A1, 0, 1 ); - TextLabelC1A1 = new QLabel( GroupConstructor1, "TextLabelC1A1" ); - TextLabelC1A1->setText( tr( "GEOM_OBJECT" ) ); - TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A1->setFrameShape( QLabel::NoFrame ); - TextLabelC1A1->setFrameShadow( QLabel::Plain ); - GroupConstructor1Layout->addWidget( TextLabelC1A1, 0, 0 ); - TextLabel_Length = new QLabel( GroupConstructor1, "TextLabel_Length" ); - TextLabel_Length->setText( tr( "GEOM_LENGTH" ) ); - TextLabel_Length->setMinimumSize( QSize( 50, 0 ) ); - TextLabel_Length->setFrameShape( QLabel::NoFrame ); - TextLabel_Length->setFrameShadow( QLabel::Plain ); - GroupConstructor1Layout->addWidget( TextLabel_Length, 1, 0 ); - LineEdit_Length = new QLineEdit( GroupConstructor1, "LineEdit_Length" ); - LineEdit_Length->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEdit_Length->sizePolicy().hasHeightForWidth() ) ); - // LineEdit_Length->setEnabled( FALSE ); - LineEdit_Length->setReadOnly( TRUE ); - GroupConstructor1Layout->addWidget( LineEdit_Length, 1, 2 ); - LineEdit_Surface = new QLineEdit( GroupConstructor1, "LineEdit_Surface" ); - LineEdit_Surface->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEdit_Surface->sizePolicy().hasHeightForWidth() ) ); - //LineEdit_Surface->setEnabled( FALSE ); - LineEdit_Surface->setReadOnly( TRUE ); - GroupConstructor1Layout->addWidget( LineEdit_Surface, 2, 2 ); - TextLabel_Surface = new QLabel( GroupConstructor1, "TextLabel_Surface" ); - TextLabel_Surface->setText( tr( "GEOM_PROPERTIES_SURFACE" ) ); - TextLabel_Surface->setMinimumSize( QSize( 50, 0 ) ); - TextLabel_Surface->setFrameShape( QLabel::NoFrame ); - TextLabel_Surface->setFrameShadow( QLabel::Plain ); - GroupConstructor1Layout->addWidget( TextLabel_Surface, 2, 0 ); - TextLabel_Volume = new QLabel( GroupConstructor1, "TextLabel_Volume" ); - TextLabel_Volume->setText( tr( "GEOM_PROPERTIES_VOLUME" ) ); - TextLabel_Volume->setMinimumSize( QSize( 50, 0 ) ); - TextLabel_Volume->setFrameShape( QLabel::NoFrame ); - TextLabel_Volume->setFrameShadow( QLabel::Plain ); - GroupConstructor1Layout->addWidget( TextLabel_Volume, 3, 0 ); - LineEdit_Volume = new QLineEdit( GroupConstructor1, "LineEdit_Volume" ); - LineEdit_Volume->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEdit_Volume->sizePolicy().hasHeightForWidth() ) ); - //LineEdit_Volume->setEnabled( FALSE ); - LineEdit_Volume->setReadOnly( TRUE ); - GroupConstructor1Layout->addWidget( LineEdit_Volume, 3, 2 ); - GeometryGUI_PropertiesDlgLayout->addWidget( GroupConstructor1, 1, 0 ); - - /***************************************************************/ - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); - GroupButtons->setTitle( tr( "" ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 1 ); - - QSpacerItem* spacer_8 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_8, 0, 0 ); - QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_9, 0, 2 ); - - GeometryGUI_PropertiesDlgLayout->addWidget( GroupButtons, 2, 0 ); - /***************************************************************/ - - Init(Sel) ; /* Initialisations */ -} - - -//================================================================================= -// function : ~GeometryGUI_PropertiesDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_PropertiesDlg::~GeometryGUI_PropertiesDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_PropertiesDlg::Init( SALOME_Selection* Sel ) -{ - myConstructorId = 0 ; - Constructor1->setChecked( TRUE ); - myEditCurrentArgument = LineEditC1A1 ; - mySelection = Sel; - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - - // TODO : previous selection into argument ? - - /* Filter definitions */ - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - - /* signals and slots connections */ - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ; - connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) ); - connect( SelectButtonC1A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - connect( LineEditC1A1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - - connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ; - /* to close dialog if study change */ - connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ; - - /* Move widget on the botton right corner of main widget */ - int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; - this->show() ; /* displays Dialog */ - return ; -} - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_PropertiesDlg::ConstructorsClicked(int constructorId) -{ - return ; -} - - - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void GeometryGUI_PropertiesDlg::ClickOnCancel() -{ - myGeomGUI->EraseSimulationShape() ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->EraseSimulationShape() ; - myGeomGUI->ResetState() ; - reject() ; - return ; -} - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -//================================================================================= -void GeometryGUI_PropertiesDlg::SelectionIntoArgument() -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - - LineEdit_Length->setText("") ; - LineEdit_Surface->setText("") ; - LineEdit_Volume->setText("") ; - myEditCurrentArgument->setText("") ; - - QString aString = ""; /* future the name of selection */ - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; - if ( nbSel != 1 ) { - return ; - } - - /* nbSel == 1 */ - TopoDS_Shape S; - if( !myGeomGUI->GetTopoFromSelection(mySelection, S) ) - return ; - - if( S.IsNull() || S.ShapeType() == TopAbs_VERTEX ) { - myEditCurrentArgument->setText( "" ); - return ; - } - - LineEditC1A1->setText(aString) ; - - /* Try to display of a cone simulation shape to show direction of a linear edge only in OCC viewer */ - if( myGeomGUI->CreateArrowForLinearEdge( S, mySimulationTopoDs ) ) { - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - } - this->CalculateAndDisplayProperties(S) ; - - return ; -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_PropertiesDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - switch (myConstructorId) - { - case 0: /* default constructor */ - { - if(send == SelectButtonC1A1) { - LineEditC1A1->setFocus() ; - myEditCurrentArgument = LineEditC1A1; - } - SelectionIntoArgument() ; - break; - } - } - return ; -} - - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_PropertiesDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if( send == LineEditC1A1 ) - myEditCurrentArgument = LineEditC1A1 ; - else - return ; - - /* User name of object input management */ - /* If successfull the selection is changed and signal emitted... */ - /* so SelectionIntoArgument() is automatically called. */ - const QString objectUserName = myEditCurrentArgument->text() ; - QWidget* thisWidget = (QWidget*)this ; - if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) { - myEditCurrentArgument->setText( objectUserName ) ; - } - return ; -} - - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void GeometryGUI_PropertiesDlg::DeactivateActiveDialog() -{ - if ( GroupConstructors->isEnabled() ) { - disconnect( mySelection, 0, this, 0 ); - GroupConstructors->setEnabled(false) ; - GroupConstructor1->setEnabled(false) ; - myGeomGUI->EraseSimulationShape() ; - GroupButtons->setEnabled(false) ; - } - return ; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_PropertiesDlg::ActivateThisDialog() -{ - /* Emit a signal to deactivate the active dialog */ - myGeomGUI->EmitSignalDeactivateDialog() ; - GroupConstructors->setEnabled(true) ; - GroupConstructor1->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - - if( !mySimulationTopoDs.IsNull() ) - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - - return ; -} - - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void GeometryGUI_PropertiesDlg::enterEvent(QEvent* e) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; - return ; -} - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_PropertiesDlg::closeEvent( QCloseEvent* e ) -{ - /* same than click on cancel button */ - this->ClickOnCancel() ; - return ; -} - - -//================================================================================= -// function : CalculateAndDisplayProperties() -// purpose : -//================================================================================= -void GeometryGUI_PropertiesDlg::CalculateAndDisplayProperties(const TopoDS_Shape& S) -{ - LineEdit_Length->setText("") ; - LineEdit_Surface->setText("") ; - LineEdit_Volume->setText("") ; - if( S.IsNull() ) - return ; - - Standard_Real result; - GProp_GProps LProps; - GProp_GProps SProps; - QString resString; - - try - { - BRepGProp::LinearProperties(S,LProps); - result = LProps.Mass(); - if (!IsEqual( result, 0.0)) - { - resString = tr("%1").arg( result, 12, 'f', 6 ) ; - LineEdit_Length->setText(resString) ; - } - - BRepGProp::SurfaceProperties(S, SProps); - result = SProps.Mass(); - if (!IsEqual( result, 0.0)) - { - resString = tr("%1").arg( result, 12, 'f', 6 ) ; - LineEdit_Surface->setText(resString) ; - } - - result = 0.0; - if (S.ShapeType() < TopAbs_SHELL) - { - for( TopExp_Explorer Exp(S,TopAbs_SOLID); Exp.More(); Exp.Next() ) - { - GProp_GProps VProps; - BRepGProp::VolumeProperties(Exp.Current(), VProps); - result += VProps.Mass(); - } - } - if (!IsEqual( result, 0.0 )) - { - resString = tr("%1").arg( result, 12, 'f', 6 ) ; - LineEdit_Volume->setText(resString) ; - } - } - catch(Standard_Failure) - { - MESSAGE("Catch intercepted in CalculateAndDisplayProperties()" << endl ) ; - } - return ; -} diff --git a/src/GEOMGUI/GeometryGUI_PropertiesDlg.h b/src/GEOMGUI/GeometryGUI_PropertiesDlg.h deleted file mode 100644 index 2251e2882..000000000 --- a/src/GEOMGUI/GeometryGUI_PropertiesDlg.h +++ /dev/null @@ -1,116 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_PropertiesDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM - -#ifndef DIALOGBOX_PROPERTIES_H -#define DIALOGBOX_PROPERTIES_H - -#include "SALOME_Selection.h" -#include "GEOM_ShapeTypeFilter.hxx" - -#include -#include -#include - -#include -#include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QRadioButton; -class GeometryGUI; - -//================================================================================= -// class : GeometryGUI_PropertiesDlg -// purpose : -//================================================================================= -class GeometryGUI_PropertiesDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_PropertiesDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 ); - ~GeometryGUI_PropertiesDlg(); - -private: - - void Init( SALOME_Selection* Sel ) ; - void closeEvent( QCloseEvent* e ) ; - void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */ - void CalculateAndDisplayProperties(const TopoDS_Shape& S) ; - - GEOM::GEOM_Gen_var myGeom ; /* Current GeomI object */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - SALOME_Selection* mySelection ; /* User shape selection */ - TopoDS_Shape mySimulationTopoDs ; /* Shape used for simulation display */ - - int myConstructorId ; /* Current constructor id = radio button id */ - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - - QButtonGroup* GroupConstructors; - QRadioButton* Constructor1; - QGroupBox* GroupConstructor1; - QLineEdit* LineEditC1A1; - QPushButton* SelectButtonC1A1; - QLabel* TextLabelC1A1; - - QLabel* TextLabel_Length; - QLabel* TextLabel_Surface; - QLabel* TextLabel_Volume; - - QLineEdit* LineEdit_Length; - QLineEdit* LineEdit_Surface; - QLineEdit* LineEdit_Volume; - - QGroupBox* GroupButtons; - QPushButton* buttonApply; - QPushButton* buttonOk; - QPushButton* buttonCancel; - -private slots: - - void ConstructorsClicked(int constructorId); - void ClickOnCancel(); - void SetEditCurrentArgument() ; - void LineEditReturnPressed() ; - void SelectionIntoArgument() ; - void DeactivateActiveDialog() ; - void ActivateThisDialog() ; - -protected: - QGridLayout* GeometryGUI_PropertiesDlgLayout; - QGridLayout* GroupConstructorsLayout; - QGridLayout* GroupConstructor1Layout; - QGridLayout* GroupButtonsLayout; -}; - -#endif // DIALOGBOX_PROPERTIES_H diff --git a/src/GEOMGUI/GeometryGUI_RevolDlg.cxx b/src/GEOMGUI/GeometryGUI_RevolDlg.cxx deleted file mode 100644 index 1cbea9437..000000000 --- a/src/GEOMGUI/GeometryGUI_RevolDlg.cxx +++ /dev/null @@ -1,560 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_RevolDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_RevolDlg.h" - -#include - -#include "GeometryGUI.h" -#include "QAD_Application.h" -#include "QAD_Desktop.h" -#include "QAD_Config.h" -#include "utilities.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -//================================================================================= -// class : GeometryGUI_RevolDlg() -// purpose : Constructs a GeometryGUI_RevolDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_RevolDlg::GeometryGUI_RevolDlg( QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_REVOL"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - - if ( !name ) - setName( "GeometryGUI_RevolDlg" ); - resize( 303, 251 ); - setCaption( tr( "GEOM_REVOLUTION_TITLE" ) ); - setSizeGripEnabled( TRUE ); - GeometryGUI_RevolDlgLayout = new QGridLayout( this ); - GeometryGUI_RevolDlgLayout->setSpacing( 6 ); - GeometryGUI_RevolDlgLayout->setMargin( 11 ); - - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "GEOM_REVOLUTION" ) ); - GroupConstructors->setExclusive( TRUE ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setText( tr( "" ) ); - Constructor1->setPixmap( image0 ); - Constructor1->setChecked( TRUE ); - Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) ); - Constructor1->setMinimumSize( QSize( 50, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer, 0, 1 ); - GeometryGUI_RevolDlgLayout->addWidget( GroupConstructors, 0, 0 ); - - /***************************************************************/ - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); - GroupButtons->setTitle( tr( "" ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 3 ); - buttonApply = new QPushButton( GroupButtons, "buttonApply" ); - buttonApply->setText( tr( "GEOM_BUT_APPLY" ) ); - buttonApply->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonApply, 0, 1 ); - QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_9, 0, 2 ); - buttonOk = new QPushButton( GroupButtons, "buttonOk" ); - buttonOk->setText( tr( "GEOM_BUT_OK" ) ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - GeometryGUI_RevolDlgLayout->addWidget( GroupButtons, 2, 0 ); - - /***************************************************************/ - GroupC1 = new QGroupBox( this, "GroupC1" ); - GroupC1->setTitle( tr( "GEOM_ARGUMENTS" ) ); - GroupC1->setFrameShape( QGroupBox::Box ); - GroupC1->setFrameShadow( QGroupBox::Sunken ); - GroupC1->setColumnLayout(0, Qt::Vertical ); - GroupC1->layout()->setSpacing( 0 ); - GroupC1->layout()->setMargin( 0 ); - GroupC1Layout = new QGridLayout( GroupC1->layout() ); - GroupC1Layout->setAlignment( Qt::AlignTop ); - GroupC1Layout->setSpacing( 6 ); - GroupC1Layout->setMargin( 11 ); - - TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" ); - TextLabelC1A1->setText( tr( "GEOM_OBJECT" ) ); - TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A1->setFrameShape( QLabel::NoFrame ); - TextLabelC1A1->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabelC1A1, 0, 0 ); - SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" ); - SelectButtonC1A1->setText( tr( "" ) ); - SelectButtonC1A1->setPixmap( image1 ); - SelectButtonC1A1->setToggleButton( FALSE ); - SelectButtonC1A1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, - SelectButtonC1A1->sizePolicy().hasHeightForWidth() ) ); - GroupC1Layout->addWidget( SelectButtonC1A1, 0, 1 ); - LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" ); - GroupC1Layout->addMultiCellWidget( LineEditC1A1, 0, 0, 2, 3 ); - - TextLabelC1A2 = new QLabel( GroupC1, "TextLabelC1A2" ); - TextLabelC1A2->setText( tr( "GEOM_AXIS" ) ); - TextLabelC1A2->setMinimumSize( QSize( 50, 0 ) ); - GroupC1Layout->addWidget( TextLabelC1A2, 1, 0 ); - SelectButtonC1A2 = new QPushButton( GroupC1, "SelectButtonC1A2" ); - SelectButtonC1A2->setText( tr( "" ) ); - SelectButtonC1A2->setPixmap( image1 ); - SelectButtonC1A2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, - SelectButtonC1A2->sizePolicy().hasHeightForWidth() ) ); - GroupC1Layout->addWidget( SelectButtonC1A2, 1, 1 ); - LineEditC1A2 = new QLineEdit( GroupC1, "LineEditC1A2" ); - GroupC1Layout->addMultiCellWidget( LineEditC1A2, 1, 1, 2, 3 ); - - CheckBoxReverse = new QCheckBox( GroupC1, "CheckBoxReverse" ); - CheckBoxReverse->setText( tr( "GEOM_REVERSE" ) ); - GroupC1Layout->addMultiCellWidget( CheckBoxReverse, 2, 2, 0, 1 ); - TextLabelC1A3 = new QLabel( GroupC1, "TextLabelC1A3" ); - TextLabelC1A3->setText( tr( "GEOM_ANGLE" ) ); - TextLabelC1A3->setMinimumSize( QSize( 50, 0 ) ); - GroupC1Layout->addWidget( TextLabelC1A3, 2, 2 ); - SpinBox_C1A3 = new GeometryGUI_SpinBox( GroupC1, "GeomSpinBox_C1A3" ) ; - GroupC1Layout->addWidget( SpinBox_C1A3, 2, 3 ); - - GeometryGUI_RevolDlgLayout->addWidget( GroupC1, 1, 0 ); - /***************************************************************/ - - Init(Sel) ; /* Initialisations */ -} - - -//================================================================================= -// function : ~GeometryGUI_RevolDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_RevolDlg::~GeometryGUI_RevolDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_RevolDlg::Init( SALOME_Selection* Sel ) -{ - - /* Get setting of step value from file configuration */ - double step ; - QString St = QAD_CONFIG->getSetting( "Geometry:SettingsGeomStep" ) ; - step = St.toDouble() ; - - /* min, max, step and decimals for spin boxes */ - SpinBox_C1A3->RangeStepAndValidator( -999.999, 999.999, step, 3 ) ; - SpinBox_C1A3->SetValue( 45.0 ) ; /* = myAngle */ - myAngle = 45.0 ; - - GroupC1->show(); - myConstructorId = 0 ; - Constructor1->setChecked( TRUE ); - myEditCurrentArgument = LineEditC1A1 ; - mySelection = Sel; - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - - myOkBase = false ; - myOkAxis = false ; - - mySimulationTopoDs.Nullify() ; - myBase.Nullify() ; - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - - // TODO : previous selection into argument - - /* Filter definitions */ - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - myEdgeFilter = new GEOM_EdgeFilter( StdSelect_Line, myGeom ); - - /* signals and slots connections */ - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ; - connect( buttonApply, SIGNAL( clicked() ), this, SLOT(ClickOnApply() ) ); - connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) ); - connect( SelectButtonC1A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( SelectButtonC1A2, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - - connect( SpinBox_C1A3, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ; - connect( CheckBoxReverse, SIGNAL (stateChanged(int) ), this, SLOT( ReverseAngle(int) ) ) ; - - connect( LineEditC1A1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - connect( LineEditC1A2, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - - connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ; - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - /* to close dialog if study change */ - connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ; - - /* Move widget on the botton right corner of main widget */ - int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; - this->show() ; /* displays Dialog */ - - return ; -} - -//================================================================================= -// function : ReverseAngle() -// purpose : 'state' not used here -//================================================================================= -void GeometryGUI_RevolDlg::ReverseAngle(int state) -{ - myAngle = -myAngle ; - SpinBox_C1A3->SetValue( myAngle ) ; - - if(myOkBase && myOkAxis) { - MakeRevolutionSimulationAndDisplay(myBase) ; - } else { - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - } - return ; -} - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_RevolDlg::ConstructorsClicked(int constructorId) -{ - /* only a constructor now */ - return ; -} - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_RevolDlg::ClickOnOk() -{ - this->ClickOnApply() ; - this->ClickOnCancel() ; - - return ; -} - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_RevolDlg::ClickOnApply() -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - myGeomGUI->GetDesktop()->putInfo( tr("") ) ; - - switch(myConstructorId) - { - case 0 : - { - if(myOkBase && myOkAxis) { - myGeomGUI->MakeRevolutionAndDisplay( myGeomShape, myLoc, myDir, myAngle*PI180 ) ; - } - break ; - } - } - return ; -} - - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void GeometryGUI_RevolDlg::ClickOnCancel() -{ - mySelection->ClearFilters() ; - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->ResetState() ; - reject() ; - return ; -} - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -//================================================================================= -void GeometryGUI_RevolDlg::SelectionIntoArgument() -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - - QString aString = ""; /* name of selection */ - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; - if ( nbSel != 1 ) { - if ( myEditCurrentArgument == LineEditC1A1 ) { - LineEditC1A1->setText("") ; - myOkBase = false ; - } - else if ( myEditCurrentArgument == LineEditC1A2 ) { - LineEditC1A2->setText("") ; - myOkAxis = false ; - } - return ; - } - - /* nbSel == 1 ! */ - TopoDS_Shape S; - Standard_Boolean testResult ; - Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject() ; - - if( !myGeomGUI->GetTopoFromSelection(mySelection, S) ) - return ; - - if ( myEditCurrentArgument == LineEditC1A1 ) { - myGeomShape = myGeomGUI->ConvertIOinGEOMShape(IO, testResult) ; - if( !testResult ) - return ; - - /* test if appropriate shape for revol */ - TopAbs_ShapeEnum aType = S.ShapeType() ; - if(aType != TopAbs_VERTEX && aType != TopAbs_EDGE && aType != TopAbs_WIRE && aType != TopAbs_FACE && aType != TopAbs_SHELL && aType != TopAbs_COMPOUND ) - return ; - - LineEditC1A1->setText(aString) ; - myBase = S ; - myOkBase = true ; - } - else if ( myEditCurrentArgument == LineEditC1A2 /*&& myGeomGUI->LinearLocationAndDirection(S, myLoc, myDir) */) { - BRepAdaptor_Curve curv(TopoDS::Edge(S)); - myDir = curv.Line().Direction(); - myLoc = curv.Line().Location(); - LineEditC1A2->setText(aString) ; - myOkAxis = true ; - } - - if( myOkBase && myOkAxis ) { - MakeRevolutionSimulationAndDisplay( myBase) ; - } - return ; -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_RevolDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - switch (myConstructorId) - { - case 0: /* default constructor */ - { - if(send == SelectButtonC1A1) { - LineEditC1A1->setFocus() ; - myEditCurrentArgument = LineEditC1A1; - mySelection->ClearFilters() ; - } - else if(send == SelectButtonC1A2) { - LineEditC1A2->setFocus() ; - myEditCurrentArgument = LineEditC1A2; - mySelection->AddFilter(myEdgeFilter) ; - } - SelectionIntoArgument() ; - break; - } - } - return ; -} - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_RevolDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if( send == LineEditC1A1 ) - myEditCurrentArgument = LineEditC1A1 ; - else if ( send == LineEditC1A2 ) - myEditCurrentArgument = LineEditC1A2 ; - else - return ; - - /* User name of object input management */ - /* If successfull the selection is changed and signal emitted... */ - /* so SelectionIntoArgument() is automatically called. */ - const QString objectUserName = myEditCurrentArgument->text() ; - QWidget* thisWidget = (QWidget*)this ; - if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) { - myEditCurrentArgument->setText( objectUserName ) ; - } - return ; -} - - -//================================================================================= -// function : ValueChangedInSpinBox() -// purpose : -//================================================================================= -void GeometryGUI_RevolDlg::ValueChangedInSpinBox( double newValue ) -{ - myAngle = newValue ; - if ( myOkBase && myOkAxis ) { - MakeRevolutionSimulationAndDisplay(myBase) ; - } - else { - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - } - return ; -} - - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void GeometryGUI_RevolDlg::DeactivateActiveDialog() -{ - if ( GroupConstructors->isEnabled() ) { - GroupConstructors->setEnabled(false) ; - GroupC1->setEnabled(false) ; - GroupButtons->setEnabled(false) ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->EraseSimulationShape() ; - mySelection->ClearFilters() ; - } - return ; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_RevolDlg::ActivateThisDialog() -{ - /* Emit a signal to deactivate the active dialog */ - myGeomGUI->EmitSignalDeactivateDialog() ; - GroupConstructors->setEnabled(true) ; - GroupC1->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - if( !mySimulationTopoDs.IsNull() ) - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - return ; -} - - - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void GeometryGUI_RevolDlg::enterEvent(QEvent* e) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; -} - - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_RevolDlg::closeEvent( QCloseEvent* e ) -{ - this->ClickOnCancel() ; /* same than click on cancel button */ -} - - -//================================================================================= -// function : MakeRevolutionSimulationAndDisplay() -// purpose : -//================================================================================= -void GeometryGUI_RevolDlg::MakeRevolutionSimulationAndDisplay( const TopoDS_Shape& S) -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - - if( S.IsNull() ) - return ; - - TopAbs_ShapeEnum aType = S.ShapeType() ; - if(aType != TopAbs_VERTEX && aType != TopAbs_EDGE && aType != TopAbs_WIRE && aType != TopAbs_FACE && aType != TopAbs_SHELL && aType !=TopAbs_COMPOUND ) - return ; - - try { - gp_Ax1 AX( this->myLoc, this->myDir); - mySimulationTopoDs = BRepPrimAPI_MakeRevol(S, AX, this->myAngle*PI180 ); - myGeomGUI->DisplaySimulationShape(mySimulationTopoDs) ; - } - catch(Standard_Failure) { - MESSAGE( "Exception catched in MakeRevolutionSimulationAndDisplay" ) ; - } - return ; -} diff --git a/src/GEOMGUI/GeometryGUI_RevolDlg.h b/src/GEOMGUI/GeometryGUI_RevolDlg.h deleted file mode 100644 index 5d4096c45..000000000 --- a/src/GEOMGUI/GeometryGUI_RevolDlg.h +++ /dev/null @@ -1,133 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_RevolDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_REVOLUTION_H -#define DIALOGBOX_REVOLUTION_H - -#include "SALOME_Selection.h" -#include "GEOM_ShapeTypeFilter.hxx" -#include "GEOM_EdgeFilter.hxx" -#include "GeometryGUI_SpinBox.h" - -#include -#include -#include - -#include -#include -#include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QCheckBox; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QRadioButton; -class GeometryGUI; - - -//================================================================================= -// class : GeometryGUI_RevolDlg -// purpose : -//================================================================================= -class GeometryGUI_RevolDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_RevolDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 ); - ~GeometryGUI_RevolDlg(); - -private : - - GEOM::GEOM_Gen_var myGeom ; /* Current Geom object */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - SALOME_Selection* mySelection ; /* User shape selection */ - TopoDS_Shape mySimulationTopoDs; /* Shape used for simulation display */ - TopoDS_Shape myBase ; - GEOM::GEOM_Shape_var myGeomShape ; /* is myBase */ - - gp_Pnt myLoc ; - gp_Dir myDir ; - - Standard_Real myAngle ; - - bool myOkBase ; - bool myOkAxis ; - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - int myConstructorId ; /* Current constructor id = radio button id */ - Handle(GEOM_EdgeFilter) myEdgeFilter; /* Filter selection */ - - void closeEvent( QCloseEvent* e ) ; - void enterEvent( QEvent* e); - void Init( SALOME_Selection* Sel ) ; - void MakeRevolutionSimulationAndDisplay( const TopoDS_Shape& S) ; - - QButtonGroup* GroupConstructors; - QRadioButton* Constructor1; - QGroupBox* GroupButtons; - QPushButton* buttonOk; - QPushButton* buttonCancel; - QPushButton* buttonApply; - QGroupBox* GroupC1; - QPushButton* SelectButtonC1A2; - QLineEdit* LineEditC1A1; - QLineEdit* LineEditC1A2; - QPushButton* SelectButtonC1A1; - QLabel* TextLabelC1A1; - QLabel* TextLabelC1A2; - GeometryGUI_SpinBox* SpinBox_C1A3 ; /* for angle */ - QLabel* TextLabelC1A3; - QCheckBox* CheckBoxReverse; - -private slots: - - void ConstructorsClicked(int constructorId); - void ClickOnOk(); - void ClickOnCancel(); - void ClickOnApply(); - void SetEditCurrentArgument() ; - void SelectionIntoArgument() ; - void LineEditReturnPressed() ; - void DeactivateActiveDialog() ; - void ActivateThisDialog() ; - void ReverseAngle(int state) ; - void ValueChangedInSpinBox( double newValue ) ; - -protected: - QGridLayout* GeometryGUI_RevolDlgLayout; - QGridLayout* GroupConstructorsLayout; - QGridLayout* GroupButtonsLayout; - QGridLayout* GroupC1Layout; -}; - -#endif // DIALOGBOX_REVOLUTION_H diff --git a/src/GEOMGUI/GeometryGUI_RotationDlg.cxx b/src/GEOMGUI/GeometryGUI_RotationDlg.cxx deleted file mode 100644 index 84e63dc42..000000000 --- a/src/GEOMGUI/GeometryGUI_RotationDlg.cxx +++ /dev/null @@ -1,548 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_RotationDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_RotationDlg.h" - -#include "GeometryGUI.h" -#include "QAD_Application.h" -#include "QAD_Desktop.h" -#include "QAD_Config.h" -#include "utilities.h" - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -//================================================================================= -// class : GeometryGUI_RotationDlg() -// purpose : Constructs a GeometryGUI_RotationDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_RotationDlg::GeometryGUI_RotationDlg( QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_ROTATION"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - - if ( !name ) - setName( "GeometryGUI_RotationDlg" ); - resize( 303, 251 ); - setCaption( tr( "GEOM_ROTATION_TITLE" ) ); - setSizeGripEnabled( TRUE ); - GeometryGUI_RotationDlgLayout = new QGridLayout( this ); - GeometryGUI_RotationDlgLayout->setSpacing( 6 ); - GeometryGUI_RotationDlgLayout->setMargin( 11 ); - - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "GEOM_ROTATION" ) ); - GroupConstructors->setExclusive( TRUE ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setText( tr( "" ) ); - Constructor1->setPixmap( image0 ); - Constructor1->setChecked( TRUE ); - Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) ); - Constructor1->setMinimumSize( QSize( 50, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer, 0, 1 ); - GeometryGUI_RotationDlgLayout->addWidget( GroupConstructors, 0, 0 ); - - /***************************************************************/ - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); - GroupButtons->setTitle( tr( "" ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 3 ); - buttonApply = new QPushButton( GroupButtons, "buttonApply" ); - buttonApply->setText( tr( "GEOM_BUT_APPLY" ) ); - buttonApply->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonApply, 0, 1 ); - QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_9, 0, 2 ); - buttonOk = new QPushButton( GroupButtons, "buttonOk" ); - buttonOk->setText( tr( "GEOM_BUT_OK" ) ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - GeometryGUI_RotationDlgLayout->addWidget( GroupButtons, 2, 0 ); - - /***************************************************************/ - GroupC1 = new QGroupBox( this, "GroupC1" ); - GroupC1->setTitle( tr( "GEOM_ARGUMENTS" ) ); - GroupC1->setFrameShape( QGroupBox::Box ); - GroupC1->setFrameShadow( QGroupBox::Sunken ); - GroupC1->setColumnLayout(0, Qt::Vertical ); - GroupC1->layout()->setSpacing( 0 ); - GroupC1->layout()->setMargin( 0 ); - GroupC1Layout = new QGridLayout( GroupC1->layout() ); - GroupC1Layout->setAlignment( Qt::AlignTop ); - GroupC1Layout->setSpacing( 6 ); - GroupC1Layout->setMargin( 11 ); - SelectButtonC1A2 = new QPushButton( GroupC1, "SelectButtonC1A2" ); - SelectButtonC1A2->setText( tr( "" ) ); - SelectButtonC1A2->setPixmap( image1 ); - SelectButtonC1A2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, - SelectButtonC1A2->sizePolicy().hasHeightForWidth() ) ); - GroupC1Layout->addWidget( SelectButtonC1A2, 1, 1 ); - - LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" ); - GroupC1Layout->addMultiCellWidget( LineEditC1A1, 0, 0, 2, 3 ); - LineEditC1A2 = new QLineEdit( GroupC1, "LineEditC1A2" ); - GroupC1Layout->addMultiCellWidget( LineEditC1A2, 1, 1, 2, 3 ); - SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" ); - SelectButtonC1A1->setText( tr( "" ) ); - SelectButtonC1A1->setPixmap( image1 ); - SelectButtonC1A1->setToggleButton( FALSE ); - SelectButtonC1A1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, - SelectButtonC1A1->sizePolicy().hasHeightForWidth() ) ); - GroupC1Layout->addWidget( SelectButtonC1A1, 0, 1 ); - - TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" ); - TextLabelC1A1->setText( tr( "GEOM_OBJECT" ) ); - TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A1->setFrameShape( QLabel::NoFrame ); - TextLabelC1A1->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabelC1A1, 0, 0 ); - TextLabelC1A2 = new QLabel( GroupC1, "TextLabelC1A2" ); - TextLabelC1A2->setText( tr( "GEOM_AXIS" ) ); - TextLabelC1A2->setMinimumSize( QSize( 50, 0 ) ); - GroupC1Layout->addWidget( TextLabelC1A2, 1, 0 ); - - SpinBox_C1A3 = new GeometryGUI_SpinBox( GroupC1, "GeomSpinBox_C1A3" ) ; - GroupC1Layout->addWidget( SpinBox_C1A3, 2, 3 ); - - TextLabelC1A3 = new QLabel( GroupC1, "TextLabelC1A3" ); - TextLabelC1A3->setText( tr( "GEOM_ANGLE" ) ); - TextLabelC1A3->setMinimumSize( QSize( 50, 0 ) ); - GroupC1Layout->addWidget( TextLabelC1A3, 2, 2 ); - CheckBoxReverse = new QCheckBox( GroupC1, "CheckBoxReverse" ); - CheckBoxReverse->setText( tr( "GEOM_REVERSE" ) ); - GroupC1Layout->addMultiCellWidget( CheckBoxReverse, 2, 2, 0, 1 ); - GeometryGUI_RotationDlgLayout->addWidget( GroupC1, 1, 0 ); - - Init(Sel) ; /* Initialisations */ -} - -//================================================================================= -// function : ~GeometryGUI_RotationDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_RotationDlg::~GeometryGUI_RotationDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_RotationDlg::Init( SALOME_Selection* Sel ) -{ - - /* Get setting of step value from file configuration */ - double step ; - QString St = QAD_CONFIG->getSetting( "Geometry:SettingsGeomStep" ) ; - step = St.toDouble() ; - - /* min, max, step and decimals for spin boxes */ - SpinBox_C1A3->RangeStepAndValidator( -999.999, 999.999, step, 3 ) ; - SpinBox_C1A3->SetValue( 45.0 ) ; /* = myAngle */ - myAngle = 45.0 ; - - GroupC1->show(); - myConstructorId = 0 ; - Constructor1->setChecked( TRUE ); - myEditCurrentArgument = LineEditC1A1 ; - mySelection = Sel; - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - myOkBase = myOkAxis = false ; - mySimulationTopoDs.Nullify() ; - myBase.Nullify() ; - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - - // TODO : set previous selection into argument ? - - /* Filter definitions */ - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - myEdgeFilter = new GEOM_EdgeFilter( StdSelect_Line, myGeom ); - - /* signals and slots connections */ - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ; - connect( buttonApply, SIGNAL( clicked() ), this, SLOT(ClickOnApply() ) ); - connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) ); - connect( SelectButtonC1A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( SelectButtonC1A2, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - - connect( LineEditC1A1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - connect( LineEditC1A2, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - - connect( SpinBox_C1A3, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ; - connect( CheckBoxReverse, SIGNAL (stateChanged(int) ), this, SLOT( ReverseAngle(int) ) ) ; - - connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ; - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - /* to close dialog if study change */ - connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ; - - /* Move widget on the botton right corner of main widget */ - int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; - this->show() ; /* displays Dialog */ - - return ; -} - -//================================================================================= -// function : ReverseAngle() -// purpose : 'state' not used here -//================================================================================= -void GeometryGUI_RotationDlg::ReverseAngle(int state) -{ - myAngle = -myAngle ; - SpinBox_C1A3->SetValue( myAngle ) ; - if( myOkBase && myOkAxis ) { - MakeRotationSimulationAndDisplay( myBase ) ; - } - else { - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - } - return ; -} - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_RotationDlg::ConstructorsClicked(int constructorId) -{ - /* only a constructor now */ - return ; -} - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_RotationDlg::ClickOnOk() -{ - this->ClickOnApply() ; - this->ClickOnCancel() ; - return ; -} - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_RotationDlg::ClickOnApply() -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - myGeomGUI->GetDesktop()->putInfo( tr("") ) ; - - switch(myConstructorId) - { - case 0 : - { - if(myOkBase && myOkAxis) { - myGeomGUI->MakeRotationAndDisplay( myGeomShape, myLoc, myDir, myAngle*PI180) ; - } - break ; - } - } - return ; -} - - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void GeometryGUI_RotationDlg::ClickOnCancel() -{ - mySelection->ClearFilters() ; - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->ResetState() ; - reject() ; - return ; -} - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -//================================================================================= -void GeometryGUI_RotationDlg::SelectionIntoArgument() -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - - QString aString = ""; /* name of future selection */ - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; - if ( nbSel != 1 ) { - if ( myEditCurrentArgument == LineEditC1A1 ) { - LineEditC1A1->setText("") ; - myOkBase = false ; - } - else if ( myEditCurrentArgument == LineEditC1A2 ) { - LineEditC1A2->setText("") ; - myOkAxis = false ; - } - return ; - } - - /* nbSel == 1 ! */ - TopoDS_Shape S; - Standard_Boolean testResult ; - Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject() ; - - if( !myGeomGUI->GetTopoFromSelection(mySelection, S) ) - return ; - - if ( myEditCurrentArgument == LineEditC1A1 ) { - myGeomShape = myGeomGUI->ConvertIOinGEOMShape(IO, testResult) ; - if( !testResult ) - return ; - LineEditC1A1->setText(aString) ; - myBase = S ; - myOkBase = true ; - } - else if ( myEditCurrentArgument == LineEditC1A2 /*&& myGeomGUI->LinearLocationAndDirection(S, myLoc, myDir) */) { - BRepAdaptor_Curve curv(TopoDS::Edge(S)); - myDir = curv.Line().Direction(); - myLoc = curv.Line().Location(); - LineEditC1A2->setText(aString) ; - myOkAxis = true ; - } - - if( myOkBase && myOkAxis ) { - MakeRotationSimulationAndDisplay( myBase) ; - } - return ; -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_RotationDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - switch (myConstructorId) - { - case 0: /* default constructor */ - { - if(send == SelectButtonC1A1) { - LineEditC1A1->setFocus() ; - myEditCurrentArgument = LineEditC1A1; - mySelection->ClearFilters() ; - } - else if(send == SelectButtonC1A2) { - LineEditC1A2->setFocus() ; - myEditCurrentArgument = LineEditC1A2; - mySelection->AddFilter(myEdgeFilter) ; - } - SelectionIntoArgument() ; - break; - } - } - return ; -} - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_RotationDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if( send == LineEditC1A1 ) - myEditCurrentArgument = LineEditC1A1 ; - else if ( send == LineEditC1A2 ) - myEditCurrentArgument = LineEditC1A2 ; - else - return ; - - /* User name of object input management */ - /* If successfull the selection is changed and signal emitted... */ - /* so SelectionIntoArgument() is automatically called. */ - const QString objectUserName = myEditCurrentArgument->text() ; - QWidget* thisWidget = (QWidget*)this ; - if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) { - myEditCurrentArgument->setText( objectUserName ) ; - } - return ; -} - - -//================================================================================= -// function : ValueChangedInSpinBox() -// purpose : -//================================================================================= -void GeometryGUI_RotationDlg::ValueChangedInSpinBox( double newValue ) -{ - myAngle = newValue ; - if (myOkBase && myOkAxis) { - MakeRotationSimulationAndDisplay(myBase) ; - } - else { - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - } - return ; -} - - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void GeometryGUI_RotationDlg::DeactivateActiveDialog() -{ - if ( GroupConstructors->isEnabled() ) { - GroupConstructors->setEnabled(false) ; - GroupC1->setEnabled(false) ; - GroupButtons->setEnabled(false) ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->EraseSimulationShape() ; - mySelection->ClearFilters() ; - } - return ; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_RotationDlg::ActivateThisDialog() -{ - /* Emit a signal to deactivate the active dialog */ - myGeomGUI->EmitSignalDeactivateDialog() ; - GroupConstructors->setEnabled(true) ; - GroupC1->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - if( !mySimulationTopoDs.IsNull() ) - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - return ; -} - - - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void GeometryGUI_RotationDlg::enterEvent(QEvent* e) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; -} - - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_RotationDlg::closeEvent( QCloseEvent* e ) -{ - this->ClickOnCancel() ; /* same than click on cancel button */ -} - - -//================================================================================= -// function : MakeRotationSimulationAndDisplay() -// purpose : -//================================================================================= -void GeometryGUI_RotationDlg::MakeRotationSimulationAndDisplay( const TopoDS_Shape& S) -{ - myGeomGUI->EraseSimulationShape() ; - - if( S.IsNull() ) - return ; - - try { - gp_Ax1 AX( this->myLoc, this->myDir ) ; - gp_Trsf theTransformation ; - theTransformation.SetRotation(AX, this->myAngle*PI180 ) ; - BRepBuilderAPI_Transform myBRepTransformation(S, theTransformation, Standard_False) ; - this->mySimulationTopoDs = myBRepTransformation.Shape() ; - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - } - catch(Standard_Failure) { - MESSAGE( "Exception catched in MakeRotationSimulationAndDisplay" ) ; - return ; - } - return ; -} diff --git a/src/GEOMGUI/GeometryGUI_RotationDlg.h b/src/GEOMGUI/GeometryGUI_RotationDlg.h deleted file mode 100644 index 36d6e3985..000000000 --- a/src/GEOMGUI/GeometryGUI_RotationDlg.h +++ /dev/null @@ -1,132 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_RotationDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_ROTATION_H -#define DIALOGBOX_ROTATION_H - - -#include "SALOME_Selection.h" -#include "GEOM_ShapeTypeFilter.hxx" -#include "GEOM_EdgeFilter.hxx" -#include "GeometryGUI_SpinBox.h" - -#include -#include -#include -#include - -#include -#include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QCheckBox; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QRadioButton; -class GeometryGUI; - -//================================================================================= -// class : GeometryGUI_RotationDlg -// purpose : -//================================================================================= -class GeometryGUI_RotationDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_RotationDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 ); - ~GeometryGUI_RotationDlg(); - -private : - - GEOM::GEOM_Gen_var myGeom ; /* Current Geom object */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - SALOME_Selection* mySelection ; /* User shape selection */ - TopoDS_Shape mySimulationTopoDs; /* Shape used for simulation display */ - TopoDS_Shape myBase ; - GEOM::GEOM_Shape_var myGeomShape ; /* is myBase */ - - gp_Pnt myLoc ; - gp_Dir myDir ; - Standard_Real myAngle ; - - bool myOkBase ; - bool myOkAxis ; - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - int myConstructorId ; /* Current constructor id = radio button id */ - Handle(GEOM_EdgeFilter) myEdgeFilter; /* Filter selection */ - - void closeEvent( QCloseEvent* e ) ; - void enterEvent( QEvent* e); - void Init( SALOME_Selection* Sel ) ; - void MakeRotationSimulationAndDisplay( const TopoDS_Shape& S) ; - - QButtonGroup* GroupConstructors; - QRadioButton* Constructor1; - QGroupBox* GroupButtons; - QPushButton* buttonOk; - QPushButton* buttonCancel; - QPushButton* buttonApply; - QGroupBox* GroupC1; - QPushButton* SelectButtonC1A2; - QLineEdit* LineEditC1A1; - QLineEdit* LineEditC1A2; - QPushButton* SelectButtonC1A1; - QLabel* TextLabelC1A1; - QLabel* TextLabelC1A2; - GeometryGUI_SpinBox* SpinBox_C1A3 ; /* for angle */ - QLabel* TextLabelC1A3; - QCheckBox* CheckBoxReverse; - -private slots: - - void ConstructorsClicked(int constructorId); - void ClickOnOk(); - void ClickOnCancel(); - void ClickOnApply(); - void SetEditCurrentArgument() ; - void SelectionIntoArgument() ; - void LineEditReturnPressed() ; - void DeactivateActiveDialog() ; - void ActivateThisDialog() ; - void ReverseAngle(int state) ; - void ValueChangedInSpinBox( double newValue ) ; - -protected: - QGridLayout* GeometryGUI_RotationDlgLayout; - QGridLayout* GroupConstructorsLayout; - QGridLayout* GroupButtonsLayout; - QGridLayout* GroupC1Layout; -}; - -#endif // DIALOGBOX_ROTATION_H diff --git a/src/GEOMGUI/GeometryGUI_ScaleDlg.cxx b/src/GEOMGUI/GeometryGUI_ScaleDlg.cxx deleted file mode 100644 index b91517b8a..000000000 --- a/src/GEOMGUI/GeometryGUI_ScaleDlg.cxx +++ /dev/null @@ -1,535 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_ScaleDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_ScaleDlg.h" - -#include "GeometryGUI.h" -#include "QAD_Application.h" -#include "QAD_Desktop.h" -#include "utilities.h" - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -//================================================================================= -// class : GeometryGUI_ScaleDlg() -// purpose : Constructs a GeometryGUI_ScaleDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_ScaleDlg::GeometryGUI_ScaleDlg( QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_SCALE"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - - if ( !name ) - setName( "GeometryGUI_ScaleDlg" ); - resize( 303, 253 ); - setCaption( tr( "GEOM_SCALE_TITLE" ) ); - setSizeGripEnabled( TRUE ); - GeometryGUI_ScaleDlgLayout = new QGridLayout( this ); - GeometryGUI_ScaleDlgLayout->setSpacing( 6 ); - GeometryGUI_ScaleDlgLayout->setMargin( 11 ); - - /***************************************************************/ - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "GEOM_SCALE" ) ); - GroupConstructors->setExclusive( TRUE ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer, 0, 1 ); - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setText( tr( "" ) ); - Constructor1->setPixmap( image0 ); - Constructor1->setChecked( TRUE ); - Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) ); - Constructor1->setMinimumSize( QSize( 50, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - GeometryGUI_ScaleDlgLayout->addWidget( GroupConstructors, 0, 0 ); - - /***************************************************************/ - GroupC1 = new QGroupBox( this, "GroupC1" ); - GroupC1->setTitle( tr( "GEOM_ARGUMENTS" ) ); - GroupC1->setColumnLayout(0, Qt::Vertical ); - GroupC1->layout()->setSpacing( 0 ); - GroupC1->layout()->setMargin( 0 ); - GroupC1Layout = new QGridLayout( GroupC1->layout() ); - GroupC1Layout->setAlignment( Qt::AlignTop ); - GroupC1Layout->setSpacing( 6 ); - GroupC1Layout->setMargin( 11 ); - TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" ); - TextLabelC1A1->setText( tr( "GEOM_OBJECT" ) ); - TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A1->setFrameShape( QLabel::NoFrame ); - TextLabelC1A1->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabelC1A1, 0, 0 ); - TextLabelC1A2 = new QLabel( GroupC1, "TextLabelC1A2" ); - TextLabelC1A2->setText( tr( "GEOM_CENTRAL_POINT" ) ); - TextLabelC1A2->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A2->setFrameShape( QLabel::NoFrame ); - TextLabelC1A2->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabelC1A2, 1, 0 ); - SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" ); - SelectButtonC1A1->setText( tr( "" ) ); - SelectButtonC1A1->setPixmap( image1 ); - GroupC1Layout->addWidget( SelectButtonC1A1, 0, 1 ); - SelectButtonC1A2 = new QPushButton( GroupC1, "SelectButtonC1A2" ); - SelectButtonC1A2->setText( tr( "" ) ); - SelectButtonC1A2->setPixmap( image1 ); - GroupC1Layout->addWidget( SelectButtonC1A2, 1, 1 ); - LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" ); - LineEditC1A1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC1A1->sizePolicy().hasHeightForWidth() ) ); - GroupC1Layout->addWidget( LineEditC1A1, 0, 2 ); - LineEditC1A2 = new QLineEdit( GroupC1, "LineEditC1A2" ); - GroupC1Layout->addWidget( LineEditC1A2, 1, 2 ); - LineEditC1A3 = new QLineEdit( GroupC1, "LineEditC1A3" ); - GroupC1Layout->addWidget( LineEditC1A3, 2, 2 ); - TextLabelC1A3 = new QLabel( GroupC1, "TextLabelC1A3" ); - TextLabelC1A3->setText( tr( "GEOM_SCALE_FACTOR" ) ); - TextLabelC1A3->setMinimumSize( QSize( 50, 0 ) ); - GroupC1Layout->addWidget( TextLabelC1A3, 2, 0 ); - GeometryGUI_ScaleDlgLayout->addWidget( GroupC1, 1, 0 ); - - /***************************************************************/ - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); - GroupButtons->setTitle( tr( "" ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 3 ); - buttonApply = new QPushButton( GroupButtons, "buttonApply" ); - buttonApply->setText( tr( "GEOM_BUT_APPLY" ) ); - buttonApply->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonApply, 0, 1 ); - QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_9, 0, 2 ); - buttonOk = new QPushButton( GroupButtons, "buttonOk" ); - buttonOk->setText( tr( "GEOM_BUT_OK" ) ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - GeometryGUI_ScaleDlgLayout->addWidget( GroupButtons, 2, 0 ); - - /* Initialisation */ - Init( Sel ) ; -} - -//================================================================================= -// function : ~GeometryGUI_ScaleDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_ScaleDlg::~GeometryGUI_ScaleDlg() -{ - /* no need to delete child widgets, Qt does it all for us */ -} - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_ScaleDlg::Init( SALOME_Selection* Sel ) -{ - - LineEditC1A3->setMaxLength( 10 ); - QDoubleValidator *Va = new QDoubleValidator( -999999, +999999, 3, LineEditC1A3 ) ; - LineEditC1A3->setValidator( Va ) ; - - GroupC1->show(); - myConstructorId = 0 ; - Constructor1->setChecked( TRUE ); - myEditCurrentArgument = LineEditC1A1 ; - mySelection = Sel; - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - myPoint1.SetCoord( 0.0, 0.0, 0.0 ); - myOkPoint1 = myOkBaseTopo = false ; - myFactor = 2.0 ; - LineEditC1A3->setText("2.0") ; - mySimulationTopoDs.Nullify() ; - myBaseTopo.Nullify() ; - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - - // TODO : previous selection into argument ? - - /* Filters definition */ - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - myVertexFilter = new GEOM_ShapeTypeFilter( TopAbs_VERTEX, myGeom ); - mySelection->AddFilter(myVertexFilter) ; /* first filter used */ - - /* signals and slots connections */ - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ; - connect( buttonApply, SIGNAL( clicked() ), this, SLOT(ClickOnApply() ) ); - connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) ); - connect( SelectButtonC1A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( SelectButtonC1A2, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - - connect( LineEditC1A1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - connect( LineEditC1A2, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - - connect( LineEditC1A3, SIGNAL (textChanged(const QString&) ), this, SLOT( TextChangedInLineEdit(const QString&) ) ) ; - connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ; - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - /* to close dialog if study change */ - connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ; - - /* Move widget on the botton right corner of main widget */ - int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; - this->show() ; /* displays Dialog */ - - return ; -} - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_ScaleDlg::ConstructorsClicked(int constructorId) -{ - myGeomGUI->EraseSimulationShape() ; - - switch (constructorId) - { - case 0: - { - GroupC1->show(); - myConstructorId = constructorId ; - myEditCurrentArgument = LineEditC1A1 ; - Constructor1->setChecked( TRUE ); - LineEditC1A1->setText(tr("")) ; - LineEditC1A2->setText(tr("")) ; - myOkPoint1 = myOkBaseTopo = false ; - myFactor = 2.0 ; - /* filter for next selections */ - mySelection->ClearFilters() ; - mySelection->AddFilter( myVertexFilter ); - connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - break; - } - } - return ; -} - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_ScaleDlg::ClickOnOk() -{ - this->ClickOnApply() ; - this->ClickOnCancel() ; - - return ; -} - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_ScaleDlg::ClickOnApply() -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - myGeomGUI->GetDesktop()->putInfo( tr("") ) ; - - switch(myConstructorId) - { - case 0 : - { - if( myOkBaseTopo && myOkPoint1 ) - myGeomGUI->MakeScaleAndDisplay(myGeomShape, myPoint1, myFactor ) ; - break ; - } - } - // accept(); - return ; -} - - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void GeometryGUI_ScaleDlg::ClickOnCancel() -{ - mySelection->ClearFilters() ; - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->ResetState() ; - reject() ; - return ; -} - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_ScaleDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if( send == LineEditC1A1 ) - myEditCurrentArgument = LineEditC1A1 ; - else if ( send == LineEditC1A2 ) - myEditCurrentArgument = LineEditC1A2 ; - else - return ; - - /* User name of object input management */ - /* If successfull the selection is changed and signal emitted... */ - /* so SelectionIntoArgument() is automatically called. */ - const QString objectUserName = myEditCurrentArgument->text() ; - QWidget* thisWidget = (QWidget*)this ; - if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) { - myEditCurrentArgument->setText( objectUserName ) ; - } - return ; -} - - -//================================================================================= -// function : TextChangedInLineEdit() -// purpose : -//================================================================================= -void GeometryGUI_ScaleDlg::TextChangedInLineEdit(const QString& newText) -{ - QLineEdit* send = (QLineEdit*)sender(); - if(send == LineEditC1A3) { - myGeomGUI->EraseSimulationShape() ; - myFactor = newText.toFloat(); - if( fabs(myFactor) > 0.00001 && myOkBaseTopo && myOkPoint1 ) - MakeScaleSimulationAndDisplay(myBaseTopo) ; - } - return ; -} - - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -//================================================================================= -void GeometryGUI_ScaleDlg::SelectionIntoArgument() -{ - myEditCurrentArgument->setText("") ; - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - - QString aString = ""; /* name of selection */ - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; - if ( nbSel != 1 ) { - if ( myEditCurrentArgument == LineEditC1A1 ) { - myEditCurrentArgument->setText("") ; - myOkBaseTopo = false ; - } - else if ( myEditCurrentArgument == LineEditC1A2 ) { - myEditCurrentArgument->setText("") ; - myOkPoint1 = false ; - } - return ; - } - - // nbSel == 1 - TopoDS_Shape S; - Standard_Boolean testResult ; - Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject() ; - if( !myGeomGUI->GetTopoFromSelection(mySelection, S) ) - return ; - - /* Constructor */ - if ( myEditCurrentArgument == LineEditC1A1 ) { - myGeomShape = myGeomGUI->ConvertIOinGEOMShape(IO, testResult) ; - if( !testResult ) - return ; - myEditCurrentArgument->setText(aString) ; - myBaseTopo = S ; - myOkBaseTopo = true ; - } - else if ( myEditCurrentArgument == LineEditC1A2 && myGeomGUI->VertexToPoint(S, myPoint1) ) { - myEditCurrentArgument->setText(aString) ; - myOkPoint1 = true ; - } - - if( myOkBaseTopo && myOkPoint1 ) { - MakeScaleSimulationAndDisplay( myBaseTopo ) ; - } - return ; -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_ScaleDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - switch (myConstructorId) - { - case 0: /* default constructor */ - { - if(send == SelectButtonC1A1) { - LineEditC1A1->setFocus() ; - myEditCurrentArgument = LineEditC1A1; - mySelection->ClearFilters() ; - SelectionIntoArgument() ; - } - else if(send == SelectButtonC1A2) { - LineEditC1A2->setFocus() ; - myEditCurrentArgument = LineEditC1A2; - mySelection->AddFilter(myVertexFilter) ; - SelectionIntoArgument() ; - } - break; - } - } - return ; -} - - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void GeometryGUI_ScaleDlg::DeactivateActiveDialog() -{ - if ( GroupConstructors->isEnabled() ) { - GroupConstructors->setEnabled(false) ; - GroupC1->setEnabled(false) ; - GroupButtons->setEnabled(false) ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->EraseSimulationShape() ; - mySelection->ClearFilters() ; - } - return ; -} - - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_ScaleDlg::ActivateThisDialog() -{ - /* Emit a signal to deactivate the active dialog */ - myGeomGUI->EmitSignalDeactivateDialog() ; - GroupConstructors->setEnabled(true) ; - GroupC1->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - - connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - if( !mySimulationTopoDs.IsNull() ) - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - - return ; -} - - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void GeometryGUI_ScaleDlg::enterEvent(QEvent* e) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; -} - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_ScaleDlg::closeEvent( QCloseEvent* e ) -{ - this->ClickOnCancel() ; /* same than click on cancel button */ -} - - -//================================================================================= -// function : MakeScaleSimulationAndDisplay() -// purpose : -//================================================================================= -void GeometryGUI_ScaleDlg::MakeScaleSimulationAndDisplay( const TopoDS_Shape& S ) -{ - this->mySimulationTopoDs.Nullify() ; - - try { - gp_Trsf theTransformation ; - theTransformation.SetScale( myPoint1, myFactor) ; - BRepBuilderAPI_Transform myBRepTransformation( S, theTransformation, Standard_False) ; - mySimulationTopoDs = myBRepTransformation.Shape() ; - if( mySimulationTopoDs.IsNull() ) - return ; - else - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - } - catch(Standard_Failure) { - MESSAGE( "Exception catched in MakeScaleSimulationAndDisplay" ) ; - return ; - } - return ; -} diff --git a/src/GEOMGUI/GeometryGUI_ScaleDlg.h b/src/GEOMGUI/GeometryGUI_ScaleDlg.h deleted file mode 100644 index e261ed585..000000000 --- a/src/GEOMGUI/GeometryGUI_ScaleDlg.h +++ /dev/null @@ -1,121 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_ScaleDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_SCALE_H -#define DIALOGBOX_SCALE_H - -#include "SALOME_Selection.h" -#include "GEOM_ShapeTypeFilter.hxx" - -#include - -#include -#include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QRadioButton; -class GeometryGUI; - - -//================================================================================= -// class : GeometryGUI_ScaleDlg -// purpose : -//================================================================================= -class GeometryGUI_ScaleDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_ScaleDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 ); - ~GeometryGUI_ScaleDlg(); - -private : - - void closeEvent( QCloseEvent* e ) ; - void enterEvent( QEvent* e ); - void Init(SALOME_Selection* Sel) ; - void MakeScaleSimulationAndDisplay( const TopoDS_Shape& S ) ; - - GEOM::GEOM_Gen_var myGeom ; /* Current GeomI object */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - TopoDS_Shape mySimulationTopoDs ; /* Shape used for simulation display */ - SALOME_Selection* mySelection ; /* User shape selection */ - gp_Pnt myPoint1 ; /* Points containing the vector */ - TopoDS_Shape myBaseTopo ; - GEOM::GEOM_Shape_var myGeomShape ; /* is myBaseTopo */ - Standard_Real myFactor ; - bool myOkPoint1 ; /* true when myPoint1 is defined */ - bool myOkBaseTopo ; /* true when myBaseTopo is defined */ - int myConstructorId ; /* Current constructor id = radio button id */ - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - Handle(GEOM_ShapeTypeFilter) myVertexFilter; /* filter for selection */ - - QButtonGroup* GroupConstructors; - QRadioButton* Constructor1; - QGroupBox* GroupC1; - QLabel* TextLabelC1A1; - QLabel* TextLabelC1A2; - QPushButton* SelectButtonC1A1; - QPushButton* SelectButtonC1A2; - QLineEdit* LineEditC1A1; - QLineEdit* LineEditC1A2; - QLineEdit* LineEditC1A3; - QLabel* TextLabelC1A3; - QGroupBox* GroupButtons; - QPushButton* buttonApply; - QPushButton* buttonOk; - QPushButton* buttonCancel; - -private slots : - - void ConstructorsClicked(int constructorId); - void ClickOnOk(); - void ClickOnCancel(); - void ClickOnApply(); - void SetEditCurrentArgument() ; - void SelectionIntoArgument() ; - void LineEditReturnPressed() ; - void DeactivateActiveDialog() ; - void ActivateThisDialog() ; - void TextChangedInLineEdit(const QString& newText) ; - -protected: - QGridLayout* GeometryGUI_ScaleDlgLayout; - QGridLayout* GroupConstructorsLayout; - QGridLayout* GroupC1Layout; - QGridLayout* GroupButtonsLayout; -}; - -#endif // DIALOGBOX_SCALE_H diff --git a/src/GEOMGUI/GeometryGUI_SectionDlg.cxx b/src/GEOMGUI/GeometryGUI_SectionDlg.cxx deleted file mode 100644 index 363a8c934..000000000 --- a/src/GEOMGUI/GeometryGUI_SectionDlg.cxx +++ /dev/null @@ -1,252 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_SectionDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_SectionDlg.h" - -#include "GeometryGUI.h" -#include "QAD_Desktop.h" - -//================================================================================= -// class : GeometryGUI_SectionDlg() -// purpose : Constructs a GeometryGUI_SectionDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_SectionDlg::GeometryGUI_SectionDlg(QWidget* parent, const char* name, BooleanGUI* theBooleanGUI, SALOME_Selection* Sel, bool modal, WFlags fl) - :GeometryGUI_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_SECTION"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT"))); - - setCaption(tr("GEOM_SECTION_TITLE")); - - /***************************************************************/ - GroupConstructors->setTitle(tr("GEOM_SECTION")); - RadioButton1->setPixmap(image0); - RadioButton2->close(TRUE); - RadioButton3->close(TRUE); - - GroupSection = new GeometryGUI_2Sel_QTD(this, "GroupSection"); - GroupSection->GroupBox1->setTitle(tr("GEOM_ARGUMENTS")); - GroupSection->TextLabel1->setText(tr("GEOM_OBJECT_I").arg("1")); - GroupSection->TextLabel2->setText(tr("GEOM_OBJECT_I").arg("2")); - GroupSection->PushButton1->setPixmap(image1); - GroupSection->PushButton2->setPixmap(image1); - - Layout1->addWidget(GroupSection, 1, 0); - /***************************************************************/ - - /* Initialisation */ - myBooleanGUI = theBooleanGUI; - Init(); -} - - -//================================================================================= -// function : ~GeometryGUI_SectionDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_SectionDlg::~GeometryGUI_SectionDlg() -{ - /* no need to delete child widgets, Qt does it all for us */ -} - - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_SectionDlg::Init() -{ - /* init variables */ - myEditCurrentArgument = GroupSection->LineEdit1; - - myShape1.Nullify(); - myShape2.Nullify(); - myOkShape1 = myOkShape2 = false; - - /* signals and slots connections */ - connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); - connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); - - connect(GroupSection->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); - connect(GroupSection->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); - - connect(GroupSection->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); - connect(GroupSection->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); - - connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - - /* displays Dialog */ - GroupSection->show(); - this->show(); - - return; -} - - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_SectionDlg::ClickOnOk() -{ - this->ClickOnApply(); - ClickOnCancel(); - return ; -} - - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_SectionDlg::ClickOnApply() -{ - myGeomGUI->GetDesktop()->putInfo(tr("")); - - if(myOkShape1 && myOkShape2) - myBooleanGUI->MakeBooleanAndDisplay(myGeomShape1 ,myGeomShape2, 4); - - return; -} - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection has changed -//================================================================================= -void GeometryGUI_SectionDlg::SelectionIntoArgument() -{ - myEditCurrentArgument->setText(""); - QString aString = ""; - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString); - if(nbSel != 1) { - if(myEditCurrentArgument == GroupSection->LineEdit1) - myOkShape1 = false; - else if( myEditCurrentArgument == GroupSection->LineEdit2) - myOkShape2 = false; - return; - } - - /* nbSel == 1 */ - TopoDS_Shape S; - Standard_Boolean testResult; - Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject(); - - if(!myGeomGUI->GetTopoFromSelection(mySelection, S)) - return; - - if(myEditCurrentArgument == GroupSection->LineEdit1) { - myGeomShape1 = myGeomGUI->ConvertIOinGEOMShape(IO, testResult); - if(!testResult) - return; - myShape1 = S; - GroupSection->LineEdit1->setText(aString); - myOkShape1 = true; - } - else if(myEditCurrentArgument == GroupSection->LineEdit2) { - myGeomShape2 = myGeomGUI->ConvertIOinGEOMShape(IO, testResult); - if(!testResult) - return; - myShape2 = S; - GroupSection->LineEdit2->setText(aString); - myOkShape2 = true; - } - return; -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_SectionDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - - if(send == GroupSection->PushButton1) { - GroupSection->LineEdit1->setFocus(); - myEditCurrentArgument = GroupSection->LineEdit1; - } - else if(send == GroupSection->PushButton2) { - GroupSection->LineEdit2->setFocus(); - myEditCurrentArgument = GroupSection->LineEdit2; - } - SelectionIntoArgument(); - - return; -} - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_SectionDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if(send == GroupSection->LineEdit1) - myEditCurrentArgument = GroupSection->LineEdit1; - else if(send == GroupSection->LineEdit2) - myEditCurrentArgument = GroupSection->LineEdit2; - else - return; - - GeometryGUI_Skeleton::LineEditReturnPressed(); - return; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_SectionDlg::ActivateThisDialog() -{ - GeometryGUI_Skeleton::ActivateThisDialog(); - connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - return; -} - - -//================================================================================= -// function : enterEvent() -// purpose : when mouse enter onto the QWidget -//================================================================================= -void GeometryGUI_SectionDlg::enterEvent(QEvent * e) -{ - if(GroupConstructors->isEnabled()) - return; - this->ActivateThisDialog(); - return; -} diff --git a/src/GEOMGUI/GeometryGUI_SectionDlg.h b/src/GEOMGUI/GeometryGUI_SectionDlg.h deleted file mode 100644 index fa7a2dc77..000000000 --- a/src/GEOMGUI/GeometryGUI_SectionDlg.h +++ /dev/null @@ -1,76 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_SectionDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header: - -#ifndef DIALOGBOX_SECTION_H -#define DIALOGBOX_SECTION_H - -#include "GeometryGUI_Skeleton.h" -#include "GeometryGUI_2Sel_QTD.h" - -#include "BooleanGUI.h" - -#include - -//================================================================================= -// class : GeometryGUI_SectionDlg -// purpose : -//================================================================================= -class GeometryGUI_SectionDlg : public GeometryGUI_Skeleton -{ - Q_OBJECT - -public: - GeometryGUI_SectionDlg(QWidget* parent = 0, const char* name = 0, BooleanGUI* theBooleanGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0); - ~GeometryGUI_SectionDlg(); - -private: - void Init(); - void enterEvent(QEvent* e); - - BooleanGUI* myBooleanGUI; - - TopoDS_Shape myShape1; /* topology used to fuse */ - TopoDS_Shape myShape2; /* topology used to fuse */ - GEOM::GEOM_Shape_var myGeomShape1; /* is myShape1 */ - GEOM::GEOM_Shape_var myGeomShape2; /* is myShape2 */ - bool myOkShape1; /* to check when arguments are defined */ - bool myOkShape2; - - GeometryGUI_2Sel_QTD* GroupSection; - -private slots: - void ClickOnOk(); - void ClickOnApply(); - void SetEditCurrentArgument(); - void SelectionIntoArgument(); - void LineEditReturnPressed(); - void ActivateThisDialog(); - -}; - -#endif // DIALOGBOX_SECTION_H diff --git a/src/GEOMGUI/GeometryGUI_SewingDlg.cxx b/src/GEOMGUI/GeometryGUI_SewingDlg.cxx deleted file mode 100644 index d74ba155d..000000000 --- a/src/GEOMGUI/GeometryGUI_SewingDlg.cxx +++ /dev/null @@ -1,393 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_SewingDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_SewingDlg.h" - -#include "GeometryGUI.h" -#include "QAD_Application.h" -#include "QAD_Desktop.h" -#include "utilities.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - - -//================================================================================= -// class : GeometryGUI_SewingDlg() -// purpose : Constructs a GeometryGUI_SewingDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_SewingDlg::GeometryGUI_SewingDlg( QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_SEWING"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - - if ( !name ) - setName( "GeometryGUI_SewingDlg" ); - resize( 303, 219 ); - setCaption( tr( "GEOM_SEWING_TITLE" ) ); - setSizeGripEnabled( TRUE ); - GeometryGUI_SewingDlgLayout = new QGridLayout( this ); - GeometryGUI_SewingDlgLayout->setSpacing( 6 ); - GeometryGUI_SewingDlgLayout->setMargin( 11 ); - - /***************************************************************/ - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "GEOM_SEWING" ) ); - GroupConstructors->setExclusive( TRUE ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setText( tr( "" ) ); - Constructor1->setPixmap( image0 ); - Constructor1->setChecked( TRUE ); - Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) ); - Constructor1->setMinimumSize( QSize( 50, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer, 0, 1 ); - GeometryGUI_SewingDlgLayout->addWidget( GroupConstructors, 0, 0 ); - - /***************************************************************/ - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); - GroupButtons->setTitle( tr( "" ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 3 ); - buttonApply = new QPushButton( GroupButtons, "buttonApply" ); - buttonApply->setText( tr( "GEOM_BUT_APPLY" ) ); - buttonApply->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonApply, 0, 1 ); - QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_9, 0, 2 ); - buttonOk = new QPushButton( GroupButtons, "buttonOk" ); - buttonOk->setText( tr( "GEOM_BUT_OK" ) ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - GeometryGUI_SewingDlgLayout->addWidget( GroupButtons, 2, 0 ); - GroupC1 = new QGroupBox( this, "GroupC1" ); - GroupC1->setTitle( tr( "GEOM_ARGUMENTS" ) ); - GroupC1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, GroupC1->sizePolicy().hasHeightForWidth() ) ); - GroupC1->setColumnLayout(0, Qt::Vertical ); - GroupC1->layout()->setSpacing( 0 ); - GroupC1->layout()->setMargin( 0 ); - GroupC1Layout = new QGridLayout( GroupC1->layout() ); - GroupC1Layout->setAlignment( Qt::AlignTop ); - GroupC1Layout->setSpacing( 6 ); - GroupC1Layout->setMargin( 11 ); - LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" ); - LineEditC1A1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC1A1->sizePolicy().hasHeightForWidth() ) ); - GroupC1Layout->addWidget( LineEditC1A1, 0, 2 ); - LineEditC1A2 = new QLineEdit( GroupC1, "LineEditC1A2" ); - LineEditC1A2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC1A2->sizePolicy().hasHeightForWidth() ) ); - LineEditC1A2->setMinimumSize( QSize( 40, 0 ) ); - LineEditC1A2->setMaximumSize( QSize( 32767, 32767 ) ); - GroupC1Layout->addWidget( LineEditC1A2, 1, 2 ); - SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" ); - SelectButtonC1A1->setText( tr( "" ) ); - SelectButtonC1A1->setPixmap( image1 ); - GroupC1Layout->addWidget( SelectButtonC1A1, 0, 1 ); - TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" ); - TextLabelC1A1->setText( tr( "GEOM_OBJECTS" ) ); - TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A1->setFrameShape( QLabel::NoFrame ); - TextLabelC1A1->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabelC1A1, 0, 0 ); - TextLabelC1A2 = new QLabel( GroupC1, "TextLabelC1A2" ); - TextLabelC1A2->setText( tr( "GEOM_PRECISION" ) ); - TextLabelC1A2->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A2->setFrameShape( QLabel::NoFrame ); - TextLabelC1A2->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabelC1A2, 1, 0 ); - GeometryGUI_SewingDlgLayout->addWidget( GroupC1, 1, 0 ); - /***************************************************************/ - - Init(Sel) ; /* Initialisations */ -} - - -//================================================================================= -// function : ~GeometryGUI_SewingDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_SewingDlg::~GeometryGUI_SewingDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_SewingDlg::Init( SALOME_Selection* Sel ) -{ - LineEditC1A1->setMaxLength( 10 ); - QDoubleValidator *Va = new QDoubleValidator( -0.000001, +10000.0, 3, LineEditC1A1 ) ; - LineEditC1A1->setValidator( Va ) ; - - GroupC1->show(); - myConstructorId = 0 ; - Constructor1->setChecked( TRUE ); - myEditCurrentArgument = LineEditC1A1 ; - mySelection = Sel; - this->myOkListShapes = false ; - this->myPrecision = 0.00001 ; - LineEditC1A2->setText("0.00001") ; - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - - // TODO previous selection into argument ? - - /* Filter definitions */ - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - - /* signals and slots connections */ - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ; - connect( buttonApply, SIGNAL( clicked() ), this, SLOT(ClickOnApply() ) ); - connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) ); - - connect( SelectButtonC1A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( LineEditC1A2, SIGNAL (returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ; - /* to close dialog if study change */ - connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ; - - /* Move widget on the botton right corner of main widget */ - int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; - this->show() ; /* displays Dialog */ - return ; -} - - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_SewingDlg::ConstructorsClicked(int constructorId) -{ - return ; -} - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_SewingDlg::ClickOnOk() -{ - this->ClickOnApply() ; - this->ClickOnCancel() ; - - return ; -} - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_SewingDlg::ClickOnApply() -{ - switch(myConstructorId) - { - case 0 : - { - if(myOkListShapes) { - myGeomGUI->MakeSewingAndDisplay( myListShapes, myPrecision ) ; - } - break ; - } - } - // accept(); - return ; -} - - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void GeometryGUI_SewingDlg::ClickOnCancel() -{ - myGeomGUI->ResetState() ; - reject() ; - return ; -} - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -//================================================================================= -void GeometryGUI_SewingDlg::SelectionIntoArgument() -{ - /* All this for first constructor */ - // if(myEditCurrentArgument == LineEditC1A1 ) - - myOkListShapes = false; - myEditCurrentArgument->setText("") ; - QString aString = ""; /* name of selection */ - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; - if ( nbSel < 2 ) { - return ; - } - - myGeomGUI->ConvertListOfIOInListOfIOR(mySelection->StoredIObjects(), myListShapes) ; - myEditCurrentArgument->setText(aString) ; - myOkListShapes = true ; - /* no simulation */ - return ; -} - - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_SewingDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - switch (myConstructorId) - { - case 0: /* default constructor */ - { - if(send == SelectButtonC1A1) { - LineEditC1A1->setFocus() ; - myEditCurrentArgument = LineEditC1A1; - } - SelectionIntoArgument() ; - break; - } - } - return ; -} - - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_SewingDlg::LineEditReturnPressed() -{ - this->myPrecision = LineEditC1A2->text().toFloat(); - return ; -} - - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void GeometryGUI_SewingDlg::DeactivateActiveDialog() -{ - if ( GroupConstructors->isEnabled() ) { - GroupConstructors->setEnabled(false) ; - GroupC1->setEnabled(false) ; - GroupButtons->setEnabled(false) ; - } - return ; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_SewingDlg::ActivateThisDialog() -{ - /* Emit a signal to deactivate the active dialog */ - myGeomGUI->EmitSignalDeactivateDialog() ; - GroupConstructors->setEnabled(true) ; - GroupC1->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - return ; -} - - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void GeometryGUI_SewingDlg::enterEvent(QEvent* e) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; - return ; -} - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_SewingDlg::closeEvent( QCloseEvent* e ) -{ - /* same than click on cancel button */ - this->ClickOnCancel() ; - return ; -} - diff --git a/src/GEOMGUI/GeometryGUI_SewingDlg.h b/src/GEOMGUI/GeometryGUI_SewingDlg.h deleted file mode 100644 index 8e2545bd6..000000000 --- a/src/GEOMGUI/GeometryGUI_SewingDlg.h +++ /dev/null @@ -1,111 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_SewingDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_SEWING_H -#define DIALOGBOX_SEWING_H - -#include "SALOME_Selection.h" -#include "GEOM_ShapeTypeFilter.hxx" - -#include - -#include -#include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QRadioButton; -class GeometryGUI; - - -//================================================================================= -// class : GeometryGUI_SewingDlg -// purpose : -//================================================================================= -class GeometryGUI_SewingDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_SewingDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 ); - ~GeometryGUI_SewingDlg(); - -private: - - void Init( SALOME_Selection* Sel ) ; - void closeEvent( QCloseEvent* e ) ; - void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */ - - GEOM::GEOM_Gen_var myGeom ; /* Current GeomI object */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - SALOME_Selection* mySelection ; /* User shape selection */ - GEOM::GEOM_Gen::ListOfIOR myListShapes ; - Standard_Real myPrecision ; - bool myOkListShapes ; /* to check when arguments is defined */ - int myConstructorId ; /* Current constructor id = radio button id */ - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - - QButtonGroup* GroupConstructors; - QRadioButton* Constructor1; - QGroupBox* GroupButtons; - QPushButton* buttonApply; - QPushButton* buttonOk; - QPushButton* buttonCancel; - QGroupBox* GroupC1; - QLineEdit* LineEditC1A1; - QLineEdit* LineEditC1A2; - QPushButton* SelectButtonC1A1; - QLabel* TextLabelC1A1; - QLabel* TextLabelC1A2; - -private slots: - - void ConstructorsClicked(int constructorId); - void ClickOnOk(); - void ClickOnCancel(); - void ClickOnApply(); - void SetEditCurrentArgument() ; - void LineEditReturnPressed() ; - void SelectionIntoArgument() ; - void DeactivateActiveDialog() ; - void ActivateThisDialog() ; - -protected: - QGridLayout* GeometryGUI_SewingDlgLayout; - QGridLayout* GroupConstructorsLayout; - QGridLayout* GroupButtonsLayout; - QGridLayout* GroupC1Layout; -}; - -#endif // DIALOGBOX_SEWING_H diff --git a/src/GEOMGUI/GeometryGUI_ShellDlg.cxx b/src/GEOMGUI/GeometryGUI_ShellDlg.cxx deleted file mode 100644 index 8aceaaeee..000000000 --- a/src/GEOMGUI/GeometryGUI_ShellDlg.cxx +++ /dev/null @@ -1,202 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_ShellDlg.cxx -// Author : Damien COQUERET -// Module : GEOM -// $Header: - -using namespace std; -#include "GeometryGUI_ShellDlg.h" - -#include "GeometryGUI.h" -#include "QAD_Desktop.h" - -//================================================================================= -// class : GeometryGUI_ShellDlg() -// purpose : Constructs a GeometryGUI_ShellDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_ShellDlg::GeometryGUI_ShellDlg(QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl) - :GeometryGUI_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM", tr("ICON_DLG_BUILD_SHELL"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM", tr("ICON_SELECT"))); - - setCaption(tr("GEOM_SHELL_TITLE")); - - /***************************************************************/ - GroupConstructors->setTitle(tr("GEOM_SHELL")); - RadioButton1->setPixmap(image0); - RadioButton2->close(TRUE); - RadioButton3->close(TRUE); - - GroupShell = new GeometryGUI_1Sel_QTD(this, "GroupShell"); - GroupShell->GroupBox1->setTitle(tr("GEOM_ARGUMENTS")); - GroupShell->TextLabel1->setText(tr("GEOM_OBJECTS")); - GroupShell->PushButton1->setPixmap(image1); - - Layout1->addWidget(GroupShell, 1, 0); - /***************************************************************/ - - /* Initialisations */ - Init(Sel); -} - - -//================================================================================= -// function : ~GeometryGUI_ShellDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_ShellDlg::~GeometryGUI_ShellDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_ShellDlg::Init( SALOME_Selection* Sel ) -{ - /* init variables */ - myEditCurrentArgument = GroupShell->LineEdit1; - myOkListShapes = false; - - myFaceFilter = new GEOM_FaceFilter( StdSelect_Plane, myGeom ); - /* Filter for the next selection */ - mySelection->AddFilter( myFaceFilter ) ; - - /* signals and slots connections */ - connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); - connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); - - connect(GroupShell->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); - - connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - - /* displays Dialog */ - GroupShell->show(); - this->show(); - - return; -} - - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_ShellDlg::ClickOnOk() -{ - this->ClickOnApply(); - ClickOnCancel(); - return ; -} - - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_ShellDlg::ClickOnApply() -{ - myGeomGUI->GetDesktop()->putInfo(tr("")); - - if(myOkListShapes) - myGeomGUI->MakeShellAndDisplay(myListShapes); - - return; -} - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -//================================================================================= -void GeometryGUI_ShellDlg::SelectionIntoArgument() -{ - myEditCurrentArgument->setText(""); - QString aString = ""; - - myOkListShapes = false; - int nbSel = mySelection->IObjectCount(); - if (nbSel == 0) - return; - - aString = tr("%1_objects").arg(nbSel); - - myGeomGUI->ConvertListOfIOInListOfIOR(mySelection->StoredIObjects(), myListShapes); - myEditCurrentArgument->setText(aString); - myOkListShapes = true; - - return; -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_ShellDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - mySelection->ClearFilters() ; - - if(send == GroupShell->PushButton1) { - GroupShell->LineEdit1->setFocus(); - myEditCurrentArgument = GroupShell->LineEdit1; - mySelection->AddFilter(myFaceFilter); - } - SelectionIntoArgument(); - - return ; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_ShellDlg::ActivateThisDialog() -{ - GeometryGUI_Skeleton::ActivateThisDialog(); - connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - return ; -} - - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void GeometryGUI_ShellDlg::enterEvent(QEvent* e) -{ - if (GroupConstructors->isEnabled()) - return; - this->ActivateThisDialog(); - return; -} diff --git a/src/GEOMGUI/GeometryGUI_ShellDlg.h b/src/GEOMGUI/GeometryGUI_ShellDlg.h deleted file mode 100644 index 49dde726e..000000000 --- a/src/GEOMGUI/GeometryGUI_ShellDlg.h +++ /dev/null @@ -1,69 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_ShellDlg.h -// Author : Damien COQUERET -// Module : GEOM -// $Header: - -#ifndef DIALOGBOX_SHELL_H -#define DIALOGBOX_SHELL_H - -#include "GeometryGUI_Skeleton.h" -#include "GeometryGUI_1Sel_QTD.h" - -#include "GEOM_FaceFilter.hxx" - -//================================================================================= -// class : GeometryGUI_ShellDlg -// purpose : -//================================================================================= -class GeometryGUI_ShellDlg : public GeometryGUI_Skeleton -{ - Q_OBJECT - -public: - GeometryGUI_ShellDlg(QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0); - ~GeometryGUI_ShellDlg(); - -private: - void Init(SALOME_Selection* Sel); - void enterEvent(QEvent * e); - - Handle(GEOM_FaceFilter) myFaceFilter; /* Filters selection */ - GEOM::GEOM_Gen::ListOfIOR myListShapes; - bool myOkListShapes; /* to check when arguments is defined */ - - GeometryGUI_1Sel_QTD* GroupShell ; - -private slots: - void ClickOnOk(); - void ClickOnApply(); - void SetEditCurrentArgument(); - void LineEditReturnPressed(); - void SelectionIntoArgument(); - void ActivateThisDialog(); - -}; - -#endif // DIALOGBOX_SHELL_H diff --git a/src/GEOMGUI/GeometryGUI_Skeleton.cxx b/src/GEOMGUI/GeometryGUI_Skeleton.cxx deleted file mode 100644 index cc39c3596..000000000 --- a/src/GEOMGUI/GeometryGUI_Skeleton.cxx +++ /dev/null @@ -1,175 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_Skeleton.cxx -// Author : Damien COQUERET -// Module : GEOM -// $Header: - -#include "GeometryGUI_Skeleton.h" - -#include "GeometryGUI.h" -#include "QAD_Application.h" - -//================================================================================= -// class : GeometryGUI_Skeleton() -// purpose : Constructs a GeometryGUI_Skeleton which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_Skeleton::GeometryGUI_Skeleton(QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl) - :GeometryGUI_Skeleton_QTD(parent, name, modal, fl) -{ - if (!name) - setName("GeometryGUI_Skeleton"); - - buttonCancel->setText(tr("GEOM_BUT_CLOSE")); - buttonOk->setText(tr("GEOM_BUT_OK")); - buttonApply->setText(tr("GEOM_BUT_APPLY")); - - GroupMedium->close(TRUE); - resize(0, 0); - - Init(Sel); -} - - -//================================================================================= -// function : ~GeometryGUI_Skeleton() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_Skeleton::~GeometryGUI_Skeleton() -{ - // no need to delete child widgets, Qt does it all for us - this->destroy(TRUE, TRUE); -} - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_Skeleton::Init(SALOME_Selection* Sel) -{ - /* init variables */ - mySelection = Sel; - mySimulationTopoDs.Nullify(); - - myGeomGUI = GeometryGUI::GetGeometryGUI(); - myGeomGUI->SetActiveDialogBox((QDialog*)this); - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - - /* signals and slots connections */ - connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); - connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); - connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); - - /* Move widget on the botton right corner of main widget */ -// int x, y; -// myGeomGUI->DefineDlgPosition( this, x, y ); - - /* displays Dialog */ - RadioButton1->setChecked(TRUE); - - return; -} - - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void GeometryGUI_Skeleton::ClickOnCancel() -{ - myGeomGUI->EraseSimulationShape(); - mySimulationTopoDs.Nullify(); - - mySelection->ClearFilters(); - disconnect(mySelection, 0, this, 0); - - myGeomGUI->ResetState(); - reject(); - - return; -} - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_Skeleton::LineEditReturnPressed() -{ - /* User name of object input management */ - /* If successfull the selection is changed and signal emitted... */ - /* so SelectionIntoArgument() is automatically called. */ - const QString objectUserName = myEditCurrentArgument->text(); - QWidget* thisWidget = (QWidget*)this; - if( myGeomGUI->SelectionByNameInDialogs(thisWidget, objectUserName, mySelection)) - myEditCurrentArgument->setText(objectUserName); - - return; -} - - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void GeometryGUI_Skeleton::DeactivateActiveDialog() -{ - this->setEnabled(false); - mySelection->ClearFilters(); - disconnect(mySelection, 0, this, 0); - myGeomGUI->EraseSimulationShape(); - myGeomGUI->SetActiveDialogBox(0); - return; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_Skeleton::ActivateThisDialog() -{ - /* Emit a signal to deactivate the active dialog */ - myGeomGUI->EmitSignalDeactivateDialog(); - this->setEnabled(true); - myGeomGUI->SetActiveDialogBox((QDialog*)this); - return; -} - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_Skeleton::closeEvent(QCloseEvent* e) -{ - /* same than click on cancel button */ - this->ClickOnCancel(); - return; -} diff --git a/src/GEOMGUI/GeometryGUI_Skeleton.h b/src/GEOMGUI/GeometryGUI_Skeleton.h deleted file mode 100644 index c7c360101..000000000 --- a/src/GEOMGUI/GeometryGUI_Skeleton.h +++ /dev/null @@ -1,76 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_Skeleton.h -// Author : Damine COQUERET -// Module : GEOM -// $Header: - -#ifndef GEOMETRYGUI_SKELETON_H -#define GEOMETRYGUI_SKELETON_H - -#include "GeometryGUI_Skeleton_QTD.h" - -#include "SALOME_Selection.h" -#include "GEOM_ShapeTypeFilter.hxx" - -#include -#include -#include -#include -#include -#include -#include -#include - -class GeometryGUI; - -class GeometryGUI_Skeleton : public GeometryGUI_Skeleton_QTD -{ - Q_OBJECT - -public: - GeometryGUI_Skeleton(QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0); - ~GeometryGUI_Skeleton(); - -private : - void Init(SALOME_Selection* Sel); - -protected: - void closeEvent(QCloseEvent* e); - - TopoDS_Shape mySimulationTopoDs; /* Shape used for simulation display */ - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - SALOME_Selection* mySelection ; /* User shape selection */ - GEOM::GEOM_Gen_var myGeom; /* Current GeomI object */ - GeometryGUI* myGeomGUI; /* Current GeomGUI object */ - -protected slots: - void ClickOnCancel(); - void LineEditReturnPressed(); - void DeactivateActiveDialog(); - void ActivateThisDialog(); - -}; - -#endif // GEOMETRYGUI_SKELETON_H diff --git a/src/GEOMGUI/GeometryGUI_Skeleton_QTD.cxx b/src/GEOMGUI/GeometryGUI_Skeleton_QTD.cxx deleted file mode 100644 index 3244050d3..000000000 --- a/src/GEOMGUI/GeometryGUI_Skeleton_QTD.cxx +++ /dev/null @@ -1,111 +0,0 @@ -/**************************************************************************** -** Form implementation generated from reading ui file 'GeometryGUI_Skeleton_QTD.ui' -** -** Created: mar sep 23 15:06:58 2003 -** by: The User Interface Compiler (uic) -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ -#include "GeometryGUI_Skeleton_QTD.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Constructs a GeometryGUI_Skeleton_QTD which is a child of 'parent', with the - * name 'name' and widget flags set to 'f'. - * - * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. - */ -GeometryGUI_Skeleton_QTD::GeometryGUI_Skeleton_QTD( QWidget* parent, const char* name, bool modal, WFlags fl ) - : QDialog( parent, name, modal, fl ) -{ - if ( !name ) - setName( "GeometryGUI_Skeleton_QTD" ); - resize( 307, 147 ); - setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)7, 0, 0, sizePolicy().hasHeightForWidth() ) ); - setCaption( trUtf8( "GeometryGUI_Skeleton_QTD" ) ); - setSizeGripEnabled( TRUE ); - GeometryGUI_Skeleton_QTDLayout = new QGridLayout( this, 1, 1, 11, 6, "GeometryGUI_Skeleton_QTDLayout"); - - Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1"); - - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, GroupButtons->sizePolicy().hasHeightForWidth() ) ); - GroupButtons->setTitle( trUtf8( "" ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 6 ); - GroupButtons->layout()->setMargin( 11 ); - GroupButtonsLayout = new QHBoxLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - - Layout3 = new QHBoxLayout( 0, 0, 6, "Layout3"); - - buttonOk = new QPushButton( GroupButtons, "buttonOk" ); - buttonOk->setText( trUtf8( "&Ok" ) ); - Layout3->addWidget( buttonOk ); - - buttonApply = new QPushButton( GroupButtons, "buttonApply" ); - buttonApply->setText( trUtf8( "&Apply" ) ); - Layout3->addWidget( buttonApply ); - QSpacerItem* spacer = new QSpacerItem( 91, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ); - Layout3->addItem( spacer ); - - buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - buttonCancel->setText( trUtf8( "&Cancel" ) ); - Layout3->addWidget( buttonCancel ); - GroupButtonsLayout->addLayout( Layout3 ); - - Layout1->addWidget( GroupButtons, 2, 0 ); - - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, GroupConstructors->sizePolicy().hasHeightForWidth() ) ); - GroupConstructors->setTitle( trUtf8( "" ) ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 6 ); - GroupConstructors->layout()->setMargin( 11 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - - Layout2 = new QHBoxLayout( 0, 0, 6, "Layout2"); - - RadioButton1 = new QRadioButton( GroupConstructors, "RadioButton1" ); - RadioButton1->setText( trUtf8( "" ) ); - Layout2->addWidget( RadioButton1 ); - - RadioButton2 = new QRadioButton( GroupConstructors, "RadioButton2" ); - RadioButton2->setText( trUtf8( "" ) ); - Layout2->addWidget( RadioButton2 ); - - RadioButton3 = new QRadioButton( GroupConstructors, "RadioButton3" ); - RadioButton3->setText( trUtf8( "" ) ); - Layout2->addWidget( RadioButton3 ); - - GroupConstructorsLayout->addLayout( Layout2, 0, 0 ); - - Layout1->addWidget( GroupConstructors, 0, 0 ); - - GroupMedium = new QGroupBox( this, "GroupMedium" ); - GroupMedium->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupMedium->sizePolicy().hasHeightForWidth() ) ); - GroupMedium->setTitle( trUtf8( "" ) ); - - Layout1->addWidget( GroupMedium, 1, 0 ); - - GeometryGUI_Skeleton_QTDLayout->addLayout( Layout1, 0, 0 ); -} - -/* - * Destroys the object and frees any allocated resources - */ -GeometryGUI_Skeleton_QTD::~GeometryGUI_Skeleton_QTD() -{ - // no need to delete child widgets, Qt does it all for us -} - diff --git a/src/GEOMGUI/GeometryGUI_Skeleton_QTD.h b/src/GEOMGUI/GeometryGUI_Skeleton_QTD.h deleted file mode 100644 index c5e398931..000000000 --- a/src/GEOMGUI/GeometryGUI_Skeleton_QTD.h +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** Form interface generated from reading ui file 'GeometryGUI_Skeleton_QTD.ui' -** -** Created: mar sep 23 15:06:57 2003 -** by: The User Interface Compiler (uic) -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ -#ifndef GEOMETRYGUI_SKELETON_QTD_H -#define GEOMETRYGUI_SKELETON_QTD_H - -#include -#include -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QGroupBox; -class QPushButton; -class QRadioButton; - -class GeometryGUI_Skeleton_QTD : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_Skeleton_QTD( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); - ~GeometryGUI_Skeleton_QTD(); - - QGroupBox* GroupButtons; - QPushButton* buttonOk; - QPushButton* buttonApply; - QPushButton* buttonCancel; - QButtonGroup* GroupConstructors; - QRadioButton* RadioButton1; - QRadioButton* RadioButton2; - QRadioButton* RadioButton3; - QGroupBox* GroupMedium; - - -protected: - QGridLayout* GeometryGUI_Skeleton_QTDLayout; - QGridLayout* Layout1; - QHBoxLayout* GroupButtonsLayout; - QHBoxLayout* Layout3; - QGridLayout* GroupConstructorsLayout; - QHBoxLayout* Layout2; -}; - -#endif // GEOMETRYGUI_SKELETON_QTD_H diff --git a/src/GEOMGUI/GeometryGUI_SolidDlg.cxx b/src/GEOMGUI/GeometryGUI_SolidDlg.cxx deleted file mode 100644 index 0173c0c11..000000000 --- a/src/GEOMGUI/GeometryGUI_SolidDlg.cxx +++ /dev/null @@ -1,200 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_SolidDlg.cxx -// Author : Damien COQUERET -// Module : GEOM -// $Header: - -using namespace std; -#include "GeometryGUI_SolidDlg.h" - -#include "GeometryGUI.h" -#include "QAD_Desktop.h" - -//================================================================================= -// class : GeometryGUI_SolidDlg() -// purpose : Constructs a GeometryGUI_SolidDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_SolidDlg::GeometryGUI_SolidDlg(QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl) - :GeometryGUI_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM", tr("ICON_DLG_BUILD_SOLID"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM", tr("ICON_SELECT"))); - - setCaption(tr("GEOM_SOLID_TITLE")); - - /***************************************************************/ - GroupConstructors->setTitle(tr("GEOM_SOLID")); - RadioButton1->setPixmap(image0); - RadioButton2->close(TRUE); - RadioButton3->close(TRUE); - - GroupSolid = new GeometryGUI_1Sel_QTD(this, "GroupSolid"); - GroupSolid->GroupBox1->setTitle(tr("GEOM_ARGUMENTS")); - GroupSolid->TextLabel1->setText(tr("GEOM_OBJECTS")); - GroupSolid->PushButton1->setPixmap(image1); - - Layout1->addWidget(GroupSolid, 1, 0); - /***************************************************************/ - - /* Initialisations */ - Init(Sel); -} - - -//================================================================================= -// function : ~GeometryGUI_SolidDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_SolidDlg::~GeometryGUI_SolidDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_SolidDlg::Init(SALOME_Selection* Sel) -{ - /* init variables */ - myEditCurrentArgument = GroupSolid->LineEdit1; - myOkListShapes = false; - - myShellFilter = new GEOM_ShapeTypeFilter(TopAbs_SHELL, myGeom); - /* filter for next selection */ - mySelection->AddFilter(myShellFilter); - - /* signals and slots connections */ - connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); - connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); - - connect(GroupSolid->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); - - connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - - /* displays Dialog */ - GroupSolid->show(); - this->show(); - - return; -} - - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_SolidDlg::ClickOnOk() -{ - this->ClickOnApply(); - ClickOnCancel(); - return ; -} - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_SolidDlg::ClickOnApply() -{ - myGeomGUI->GetDesktop()->putInfo(tr("")); - - if(myOkListShapes) - myGeomGUI->MakeSolidAndDisplay(myListShapes); - - return; -} - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -//================================================================================= -void GeometryGUI_SolidDlg::SelectionIntoArgument() -{ - myEditCurrentArgument->setText(""); - QString aString = ""; - - myOkListShapes = false; - int nbSel = mySelection->IObjectCount(); - if (nbSel == 0) - return; - - aString = tr("%1_objects").arg(nbSel); - - myGeomGUI->ConvertListOfIOInListOfIOR(mySelection->StoredIObjects(), myListShapes); - myEditCurrentArgument->setText(aString); - myOkListShapes = true; - - return ; -} - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_SolidDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - mySelection->ClearFilters() ; - - if(send == GroupSolid->PushButton1) { - GroupSolid->LineEdit1->setFocus(); - myEditCurrentArgument = GroupSolid->LineEdit1; - mySelection->AddFilter(myShellFilter); - } - SelectionIntoArgument(); - - return ; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_SolidDlg::ActivateThisDialog() -{ - GeometryGUI_Skeleton::ActivateThisDialog(); - connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - return ; -} - - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void GeometryGUI_SolidDlg::enterEvent(QEvent* e) -{ - if (GroupConstructors->isEnabled()) - return; - this->ActivateThisDialog(); - return; -} diff --git a/src/GEOMGUI/GeometryGUI_SolidDlg.h b/src/GEOMGUI/GeometryGUI_SolidDlg.h deleted file mode 100644 index b2d023c3a..000000000 --- a/src/GEOMGUI/GeometryGUI_SolidDlg.h +++ /dev/null @@ -1,67 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_SolidDlg.h -// Author : Damien COQUERET -// Module : GEOM -// $Header: - -#ifndef DIALOGBOX_SOLID_H -#define DIALOGBOX_SOLID_H - -#include "GeometryGUI_Skeleton.h" -#include "GeometryGUI_1Sel_QTD.h" - -//================================================================================= -// class : GeometryGUI_SolidDlg -// purpose : -//================================================================================= -class GeometryGUI_SolidDlg : public GeometryGUI_Skeleton -{ - Q_OBJECT - -public: - GeometryGUI_SolidDlg(QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0); - ~GeometryGUI_SolidDlg(); - -private: - void Init(SALOME_Selection* Sel); - void enterEvent(QEvent * e); - - Handle(GEOM_ShapeTypeFilter) myShellFilter; /* filter for selection */ - GEOM::GEOM_Gen::ListOfIOR myListShapes; - bool myOkListShapes; /* to check when arguments is defined */ - - GeometryGUI_1Sel_QTD* GroupSolid; - -private slots: - void ClickOnOk(); - void ClickOnApply(); - void SetEditCurrentArgument(); - void LineEditReturnPressed(); - void SelectionIntoArgument(); - void ActivateThisDialog(); - -}; - -#endif // DIALOGBOX_SOLID_H diff --git a/src/GEOMGUI/GeometryGUI_SphereDlg.cxx b/src/GEOMGUI/GeometryGUI_SphereDlg.cxx deleted file mode 100644 index 992e481b6..000000000 --- a/src/GEOMGUI/GeometryGUI_SphereDlg.cxx +++ /dev/null @@ -1,340 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_SphereDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_SphereDlg.h" - -#include - -#include "GeometryGUI.h" -#include "QAD_Desktop.h" -#include "QAD_Config.h" - -//================================================================================= -// class : GeometryGUI_SphereDlg() -// purpose : Constructs a GeometryGUI_SphereDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_SphereDlg::GeometryGUI_SphereDlg(QWidget* parent, const char* name, PrimitiveGUI* thePrimitiveGUI, SALOME_Selection* Sel, bool modal, WFlags fl) - :GeometryGUI_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_SPHERE_P"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_SPHERE_DXYZ"))); - QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT"))); - - setCaption(tr("GEOM_SPHERE_TITLE")); - - /***************************************************************/ - GroupConstructors->setTitle(tr("GEOM_SPHERE")); - RadioButton1->setPixmap(image0); - RadioButton2->setPixmap(image1); - RadioButton3->close(TRUE); - - GroupPoints = new GeometryGUI_1Sel1Spin(this, "GroupPoints"); - GroupPoints->GroupBox1->setTitle(tr("GEOM_SPHERE_CR")); - GroupPoints->TextLabel1->setText(tr("GEOM_CENTER")); - GroupPoints->TextLabel2->setText(tr("GEOM_RADIUS")); - GroupPoints->PushButton1->setPixmap(image2); - - GroupDimensions = new GeometryGUI_1Spin(this, "GroupDimensions"); - GroupDimensions->GroupBox1->setTitle(tr("GEOM_SPHERE_RO")); - GroupDimensions->TextLabel1->setText(tr("GEOM_RADIUS")); - - Layout1->addWidget(GroupPoints, 1, 0); - Layout1->addWidget(GroupDimensions, 1, 0); - /***************************************************************/ - - /* Initialisations */ - myPrimitiveGUI = thePrimitiveGUI; - Init(); -} - - -//================================================================================= -// function : ~GeometryGUI_SphereDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_SphereDlg::~GeometryGUI_SphereDlg() -{ - /* no need to delete child widgets, Qt does it all for us */ -} - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_SphereDlg::Init() -{ - /* init variables */ - myConstructorId = 0; - myEditCurrentArgument = GroupPoints->LineEdit1; - - myPoint1.SetCoord(0.0, 0.0, 0.0); - myRadius = 100.0; - myOkPoint1 = myOkRadius = false; - - /* Vertices Filter for all arguments */ - myVertexFilter = new GEOM_ShapeTypeFilter(TopAbs_VERTEX, myGeom); - mySelection->AddFilter(myVertexFilter); - - /* Get setting of step value from file configuration */ - QString St = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep"); - step = St.toDouble(); - - /* min, max, step and decimals for spin boxes */ - GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3); - GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3); - GroupPoints->SpinBox_DX->SetValue(myRadius); - GroupDimensions->SpinBox_DX->SetValue(myRadius); - - /* signals and slots connections */ - connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); - connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); - connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int))); - - connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); - connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); - connect(GroupDimensions->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - - connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; - - /* displays Dialog */ - GroupDimensions->hide(); - GroupPoints->show(); - this->show(); - - return; -} - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_SphereDlg::ConstructorsClicked(int constructorId) -{ - myConstructorId = constructorId; - mySelection->ClearFilters(); - myGeomGUI->EraseSimulationShape(); - disconnect(mySelection, 0, this, 0); - myRadius = 100.0; - myOkRadius = true; - - switch (constructorId) - { - case 0: - { - GroupDimensions->hide(); - resize(0, 0); - GroupPoints->show(); - - myEditCurrentArgument = GroupPoints->LineEdit1; - GroupPoints->LineEdit1->setText(""); - - GroupPoints->SpinBox_DX->SetValue(myRadius); - myOkPoint1 = false; - - /* filter for next selections */ - mySelection->AddFilter(myVertexFilter); - connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - break; - } - case 1: - { - GroupPoints->hide(); - resize( 0, 0 ); - GroupDimensions->show(); - - GroupDimensions->SpinBox_DX->SetValue(myRadius); - myPoint1.SetCoord(0.0, 0.0, 0.0); /* at origin */ - myOkPoint1 = true; - - mySimulationTopoDs = BRepPrimAPI_MakeSphere(myPoint1, myRadius).Shape(); - myGeomGUI->DisplaySimulationShape(mySimulationTopoDs); - break; - } - } - return ; -} - - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_SphereDlg::ClickOnOk() -{ - this->ClickOnApply(); - ClickOnCancel(); - return; -} - - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_SphereDlg::ClickOnApply() -{ - myGeomGUI->GetDesktop()->putInfo(tr("")); - if (mySimulationTopoDs.IsNull()) - return; - myGeomGUI->EraseSimulationShape(); - mySimulationTopoDs.Nullify(); - - if(myOkPoint1 && myOkRadius) - myPrimitiveGUI->MakeSphereAndDisplay(myPoint1, myRadius); - return ; -} - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -//================================================================================= -void GeometryGUI_SphereDlg::SelectionIntoArgument() -{ - myGeomGUI->EraseSimulationShape(); - myEditCurrentArgument->setText(""); - QString aString = ""; /* name of selection */ - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString); - if(nbSel != 1) { - if(myEditCurrentArgument == GroupPoints->LineEdit1) { - GroupPoints->LineEdit1->setText(""); - myOkPoint1 = false; - } - return; - } - - /* nbSel == 1 ! */ - TopoDS_Shape S; - if(!myGeomGUI->GetTopoFromSelection(mySelection, S)) - return; - - /* Constructor 1 treatment */ - if(myEditCurrentArgument == GroupPoints->LineEdit1 && myGeomGUI->VertexToPoint(S, myPoint1)) { - GroupPoints->LineEdit1->setText(aString); - myOkPoint1 = true; - } - - if(myOkPoint1 && myOkRadius) { - mySimulationTopoDs = BRepPrimAPI_MakeSphere(myPoint1, myRadius).Shape(); - myGeomGUI->DisplaySimulationShape(mySimulationTopoDs); - } - return ; -} - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_SphereDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if(send == GroupPoints->LineEdit1) - myEditCurrentArgument = GroupPoints->LineEdit1; - else - return; - - GeometryGUI_Skeleton::LineEditReturnPressed(); - return; -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_SphereDlg::SetEditCurrentArgument() -{ - if(myConstructorId != 0) - return; - - QPushButton* send = (QPushButton*)sender(); - - if(send == GroupPoints->PushButton1) { - GroupPoints->LineEdit1->setFocus(); - myEditCurrentArgument = GroupPoints->LineEdit1; - mySelection->AddFilter(myVertexFilter); - this->SelectionIntoArgument(); - } - - return; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_SphereDlg::ActivateThisDialog() -{ - GeometryGUI_Skeleton::ActivateThisDialog(); - connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - if(!mySimulationTopoDs.IsNull()) - myGeomGUI->DisplaySimulationShape(mySimulationTopoDs); - return; -} - - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void GeometryGUI_SphereDlg::enterEvent(QEvent* e) -{ - if (GroupConstructors->isEnabled()) - return; - this->ActivateThisDialog(); - return; -} - - -//================================================================================= -// function : ValueChangedInSpinBox() -// purpose : -//================================================================================= -void GeometryGUI_SphereDlg::ValueChangedInSpinBox(double newValue) -{ - myGeomGUI->EraseSimulationShape(); - mySimulationTopoDs.Nullify(); - myRadius = newValue; - myOkRadius = true; - - if (myOkPoint1 && myOkRadius) { - mySimulationTopoDs = BRepPrimAPI_MakeSphere(myPoint1, myRadius).Shape(); - myGeomGUI->DisplaySimulationShape(mySimulationTopoDs); - } - return; -} diff --git a/src/GEOMGUI/GeometryGUI_SphereDlg.h b/src/GEOMGUI/GeometryGUI_SphereDlg.h deleted file mode 100644 index 65de969b5..000000000 --- a/src/GEOMGUI/GeometryGUI_SphereDlg.h +++ /dev/null @@ -1,82 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_SphereDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_SPHERE_H -#define DIALOGBOX_SPHERE_H - -#include "GeometryGUI_Skeleton.h" -#include "GeometryGUI_1Sel1Spin.h" -#include "GeometryGUI_1Spin.h" - -#include "PrimitiveGUI.h" - -#include - -//================================================================================= -// class : GeometryGUI_SphereDlg -// purpose : -//================================================================================= -class GeometryGUI_SphereDlg : public GeometryGUI_Skeleton -{ - Q_OBJECT - -public: - GeometryGUI_SphereDlg(QWidget* parent = 0, const char* name = 0, PrimitiveGUI* thePrimitiveGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0); - ~GeometryGUI_SphereDlg(); - -private : - void Init(); - void enterEvent(QEvent* e); - - PrimitiveGUI* myPrimitiveGUI; - - double step; - int myConstructorId; - Handle(GEOM_ShapeTypeFilter) myVertexFilter; /* filter for selection */ - - gp_Pnt myPoint1; /* Points containing the vector */ - Standard_Real myRadius; - bool myOkRadius; /* Are true when myPoint is defined */ - bool myOkPoint1; - - GeometryGUI_1Sel1Spin* GroupPoints; - GeometryGUI_1Spin* GroupDimensions; - -private slots: - void ClickOnOk(); - void ClickOnApply(); - void ActivateThisDialog(); - void LineEditReturnPressed(); - void SelectionIntoArgument(); - void SetEditCurrentArgument(); - void ConstructorsClicked(int constructorId); - void ValueChangedInSpinBox(double newValue); - -}; - -#endif // DIALOGBOX_SPHERE_H diff --git a/src/GEOMGUI/GeometryGUI_SpinBox.cxx b/src/GEOMGUI/GeometryGUI_SpinBox.cxx deleted file mode 100644 index eec132f44..000000000 --- a/src/GEOMGUI/GeometryGUI_SpinBox.cxx +++ /dev/null @@ -1,101 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_SpinBox.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_SpinBox.h" -#include "GeometryGUI.h" -#include -//#include -//#include "utilities.h" - -//================================================================================= -// class : GeometryGUI_SpinBox() -// purpose : constructor of specific widget accepting floats in double precision. -//================================================================================= -GeometryGUI_SpinBox::GeometryGUI_SpinBox( QWidget* parent, const char* name ) -: QAD_SpinBoxDbl( parent, name) -{ - /* when step value is changed in myGeomGUI */ - connect( GeometryGUI::GetGeometryGUI(), SIGNAL( SignalDefaultStepValueChanged( double )), this, SLOT( SetStep( double ) ) ); -} - - -//================================================================================= -// function : SetStep() [SLOT] -// purpose : -//================================================================================= -void GeometryGUI_SpinBox::SetStep( double newStep ) -{ - setLineStep( newStep ); -} - -//================================================================================= -// function : ~GeometryGUI_SpinBox() -// purpose : destructor -//================================================================================= -GeometryGUI_SpinBox::~GeometryGUI_SpinBox() -{ -} - -//================================================================================= -// function : SetValue() -// purpose : -//================================================================================= -void GeometryGUI_SpinBox::SetValue( double v ) -{ - setValue( v ); -} - -//================================================================================= -// function : GetValue() -// purpose : returns a double -//================================================================================= -double GeometryGUI_SpinBox::GetValue( ) -{ - return value(); -} - -//================================================================================= -// function : GetString() -// purpose : returns a QString -//================================================================================= -QString GeometryGUI_SpinBox::GetString( ) -{ - return cleanText(); -} - -//================================================================================= -// function : RangeStepAndValidator() -// purpose : -//================================================================================= -void GeometryGUI_SpinBox::RangeStepAndValidator( double min, double max, double step, unsigned short decimals ) -{ - setRange( min, max ); - setLineStep( step ); - ( ( QDoubleValidator* )validator() )->setRange( min, max, decimals ) ; -} diff --git a/src/GEOMGUI/GeometryGUI_SpinBox.h b/src/GEOMGUI/GeometryGUI_SpinBox.h deleted file mode 100644 index d5c60d14f..000000000 --- a/src/GEOMGUI/GeometryGUI_SpinBox.h +++ /dev/null @@ -1,60 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_SpinBox.h -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -#ifndef GEOMSPINBOX_H -#define GEOMSPINBOX_H - -#include "QAD_SpinBoxDbl.h" - -class GeometryGUI ; - -//================================================================================= -// class : GeometryGUI_SpinBox -// purpose : Derivated from QSpinBox class and modified to accept floats -//================================================================================= -class GeometryGUI_SpinBox : public QAD_SpinBoxDbl -{ - Q_OBJECT - -public : - GeometryGUI_SpinBox( QWidget* parent, const char* name = 0 ); - ~GeometryGUI_SpinBox(); - - void RangeStepAndValidator( double min = -1000000.0, - double max = +1000000.0, - double step = 100.0, - unsigned short decimals = 3 ); - void SetValue( double v ); - double GetValue(); - QString GetString(); - -public slots: - void SetStep( double newStep ); - -}; -#endif // GEOMSPINBOX_H diff --git a/src/GEOMGUI/GeometryGUI_SubShapeDlg.cxx b/src/GEOMGUI/GeometryGUI_SubShapeDlg.cxx deleted file mode 100644 index 945ff3c76..000000000 --- a/src/GEOMGUI/GeometryGUI_SubShapeDlg.cxx +++ /dev/null @@ -1,745 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_SubShapeDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_SubShapeDlg.h" - -#include "GeometryGUI.h" -#include "QAD_Application.h" -#include "QAD_Desktop.h" -#include "QAD_RightFrame.h" -#include "OCCViewer_Viewer3d.h" -#include "utilities.h" - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -#include - -//================================================================================= -// class : GeometryGUI_SubShapeDlg() -// purpose : Constructs a GeometryGUI_SubShapeDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_SubShapeDlg::GeometryGUI_SubShapeDlg( QWidget* parent, - const char* name, - SALOME_Selection* Sel, - Handle (AIS_InteractiveContext) ic, - bool modal, - WFlags fl ) - - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_SUBSHAPE"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - - if ( !name ) - setName( "GeometryGUI_SUBSHAPE" ); - resize( 303, 239 ); - setCaption( tr( "GEOM_SUBSHAPE_TITLE" ) ); - setSizeGripEnabled( TRUE ); - GeometryGUI_SubShapeDlgLayout = new QGridLayout( this ); - GeometryGUI_SubShapeDlgLayout->setSpacing( 6 ); - GeometryGUI_SubShapeDlgLayout->setMargin( 11 ); - - /***************************************************************/ - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "GEOM_SUB_SHAPE" ) ); - GroupConstructors->setExclusive( TRUE ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setText( tr( "" ) ); - Constructor1->setPixmap( image0 ); - Constructor1->setChecked( TRUE ); - Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) ); - Constructor1->setMinimumSize( QSize( 50, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer, 0, 1 ); - GeometryGUI_SubShapeDlgLayout->addWidget( GroupConstructors, 0, 0 ); - - /***************************************************************/ - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); - GroupButtons->setTitle( tr( "" ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 3 ); - buttonApply = new QPushButton( GroupButtons, "buttonApply" ); - buttonApply->setText( tr( "GEOM_BUT_APPLY" ) ); - buttonApply->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonApply, 0, 1 ); - QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_9, 0, 2 ); - buttonOk = new QPushButton( GroupButtons, "buttonOk" ); - buttonOk->setText( tr( "GEOM_BUT_OK" ) ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - GeometryGUI_SubShapeDlgLayout->addWidget( GroupButtons, 2, 0 ); - - /***************************************************************/ - GroupC1 = new QGroupBox( this, "GroupC1" ); - GroupC1->setTitle( tr( "GEOM_ARGUMENTS" ) ); - GroupC1->setMinimumSize( QSize( 0, 0 ) ); - GroupC1->setFrameShape( QGroupBox::Box ); - GroupC1->setFrameShadow( QGroupBox::Sunken ); - GroupC1->setColumnLayout(0, Qt::Vertical ); - GroupC1->layout()->setSpacing( 0 ); - GroupC1->layout()->setMargin( 0 ); - GroupC1Layout = new QGridLayout( GroupC1->layout() ); - GroupC1Layout->setAlignment( Qt::AlignTop ); - GroupC1Layout->setSpacing( 6 ); - GroupC1Layout->setMargin( 11 ); - TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" ); - TextLabelC1A1->setText( tr( "GEOM_MAIN_OBJECT" ) ); - TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A1->setFrameShape( QLabel::NoFrame ); - TextLabelC1A1->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabelC1A1, 0, 0 ); - TextLabelComboBox1 = new QLabel( GroupC1, "TextLabelComboBox1" ); - TextLabelComboBox1->setText( tr( "GEOM_SUBSHAPE_TYPE" ) ); - GroupC1Layout->addMultiCellWidget( TextLabelComboBox1, 1, 1, 0, 1 ); - ComboBox1 = new QComboBox( FALSE, GroupC1, "ComboBox1" ); - ComboBox1->setMaxCount( 100 ); - GroupC1Layout->addMultiCellWidget( ComboBox1, 1, 1, 2, 3 ); - CheckBox1 = new QCheckBox( GroupC1, "CheckBox1" ); - CheckBox1->setText( tr( "GEOM_SUBSHAPE_SELECT" ) ); - CheckBox1->setChecked( FALSE ); - GroupC1Layout->addMultiCellWidget( CheckBox1, 2, 2, 0, 1 ); - LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" ); - GroupC1Layout->addMultiCellWidget( LineEditC1A1, 0, 0, 2, 3 ); - SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" ); - SelectButtonC1A1->setText( tr( "" ) ); - SelectButtonC1A1->setPixmap( image1 ); - SelectButtonC1A1->setToggleButton( FALSE ); - SelectButtonC1A1->setMaximumSize( QSize( 28, 32767 ) ); - GroupC1Layout->addWidget( SelectButtonC1A1, 0, 1 ); - GeometryGUI_SubShapeDlgLayout->addWidget( GroupC1, 1, 0 ); - /***************************************************************/ - - /* Initialisations */ - Init(Sel, ic) ; -} - - -//================================================================================= -// function : ~GeometryGUI_SubShapeDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_SubShapeDlg::~GeometryGUI_SubShapeDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_SubShapeDlg::Init( SALOME_Selection* Sel, Handle (AIS_InteractiveContext) ic ) -{ - - GroupC1->show(); - myConstructorId = 0 ; - Constructor1->setChecked( TRUE ); - myEditCurrentArgument = LineEditC1A1 ; - mySelection = Sel; - myShape.Nullify() ; - - myIC = ic ; - myUseLocalContext = false ; - myLocalContextId = -1; - myAbort = false ; - myOkShape = false ; - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - - /* type for sub shape selection */ - ComboBox1->insertItem("Compound"); - ComboBox1->insertItem("Compsolid"); - ComboBox1->insertItem("Solid"); - ComboBox1->insertItem("Shell"); - ComboBox1->insertItem("Face"); - ComboBox1->insertItem("Wire"); - ComboBox1->insertItem("Edge"); - ComboBox1->insertItem("Vertex"); - ComboBox1->insertItem("Shape"); - - myWithShape = true; - myShapeType = ComboBox1->currentItem(); - - /* Select sub shapes mode not checked */ - CheckBox1->setChecked( FALSE ); - myOkSelectSubMode = CheckBox1->isChecked(); - - // TODO : previous selection into argument ? - - /* Filter definitions */ - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - - /* signals and slots connections */ - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ; - connect( buttonApply, SIGNAL( clicked() ), this, SLOT(ClickOnApply() ) ); - connect( GroupConstructors, SIGNAL(clicked(int) ), this, SLOT( ConstructorsClicked(int) ) ); - - connect( SelectButtonC1A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( CheckBox1, SIGNAL (stateChanged(int) ), this, SLOT( AllOrNotAll() ) ) ; - - connect( LineEditC1A1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ); - connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ); - - connect( ComboBox1, SIGNAL( activated(int) ), this, SLOT( ComboTextChanged() ) ); - - /* Move widget on the botton right corner of main widget */ - int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; - this->show() ; /* display Dialog */ - return ; -} - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_SubShapeDlg::ConstructorsClicked(int constructorId) -{ - return ; -} - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_SubShapeDlg::ClickOnOk() -{ - this->ClickOnApply() ; - - /* User has aborted or not operation of explode all with many sub shapes */ - if( this->myAbort == false ) - this->ClickOnCancel() ; - else - this->myAbort = false ; - - return ; -} - - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_SubShapeDlg::ClickOnApply() -{ - myGeomGUI->GetDesktop()->putInfo( tr("") ) ; - bool testResult = false ; - - this->myAbort = false ; /* Not aborted by default */ - - switch(myConstructorId) - { - case 0 : - { - /* Explode all sub shapes */ - if( myOkShape && !myOkSelectSubMode ) { - - /* More than 30 subshapes : ask confirmation */ - unsigned int nb = NumberOfSubShapes( myShape, myShapeType ) ; - if( nb > 30 ) { - const QString caption = tr("GEOM_CONFIRM") ; - const QString text = tr("GEOM_CONFIRM_INFO").arg(nb) ; - const QString button0 = tr("GEOM_BUT_EXPLODE") ; - const QString button1 = tr("GEOM_BUT_CANCEL") ; - - if( QMessageBox::warning( this, caption, text, button0, button1 ) == 0 ) - testResult = myGeomGUI->OnSubShapeGetAll( myShape, myShapeIOR, myShapeType ) ; - else - this->myAbort = true ; /* aborted */ - } - else { - testResult = myGeomGUI->OnSubShapeGetAll( myShape, myShapeIOR, myShapeType ) ; - } - } - /* explode only selected sub shapes */ - else if( myOkShape && myOkSelectSubMode ) { - testResult = myGeomGUI->OnSubShapeGetSelected( myShape, myShapeIOR, myShapeType, myLocalContextId, myUseLocalContext ) ; - } - if( !testResult ) { - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT")) ; - this->myAbort = true; - } - else { - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE")) ; - } - /* Reset all arguments and local context to allow user a new selection ...*/ - this->ResetStateOfDialog() ; - break ; - } - } - return ; -} - - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void GeometryGUI_SubShapeDlg::ClickOnCancel() -{ - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->ResetState() ; - - if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) { - OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer(); - myIC = v3d->getAISContext(); - if(myUseLocalContext) { - myIC->CloseLocalContext(myLocalContextId) ; - myGeomGUI->OnDisplayAll(true) ; - this->myUseLocalContext = false ; - } - } - reject() ; - return ; -} - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -// : used only by SelectButtonC1A1 (LineEditC1A1) -//================================================================================= -void GeometryGUI_SubShapeDlg::SelectionIntoArgument() -{ - - /* Reset all arguments and local context when selection as changed */ - this->ResetStateOfDialog() ; - - QString aString = ""; /* future name of selection */ - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; - - if ( nbSel != 1 ) { - LineEditC1A1->setText("") ; - myOkShape = false; - return ; - } - - /* nbSel == 1 */ - TopoDS_Shape S ; - Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject() ; - - if( !myGeomGUI->GetTopoFromSelection(mySelection, S) ) - return ; - - if( !IO->hasEntry() ) { - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY")) ; - return ; - } - - if ( !S.IsNull() && S.ShapeType() != TopAbs_VERTEX ) - { - if ( IO->IsInstance(STANDARD_TYPE(GEOM_InteractiveObject)) ) - { - Handle(GEOM_InteractiveObject) GIObject = Handle(GEOM_InteractiveObject)::DownCast( IO ); - myShapeIOR = GIObject->getIOR(); /* the Geom IOR string of selection */ - LineEditC1A1->setText(aString) ; - myShape = S ; - myOkShape = true ; - } - else - { - SALOMEDS::Study_var aStudy = myGeomGUI->GetActiveStudy()->getStudyDocument(); - SALOMEDS::SObject_var obj = aStudy->FindObjectID( IO->getEntry() ); - SALOMEDS::GenericAttribute_var anAttr; - SALOMEDS::AttributeIOR_var anIOR; - if ( !obj->_is_nil() ) - { - if (obj->FindAttribute(anAttr, "AttributeIOR")) - { - anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr); - myShapeIOR = anIOR->Value(); - myOkShape = true ; - myShape = S ; - LineEditC1A1->setText(aString) ; - } - } - } - - int SelectedShapeType = ComboBox1->currentItem(); - int count = ComboBox1->count(); - if ( myWithShape ) count = count - 1; - - int i = 0; - while ( i <= myShape.ShapeType() ) { - ComboBox1->removeItem(0); - i++; - } - - if (myShape.ShapeType()==TopAbs_COMPOUND) - { - if (myWithShape == false) { - ComboBox1->insertItem("Shape"); - myWithShape = true; - } - } - else - { - if (myWithShape == true) { - ComboBox1->removeItem( ComboBox1->count() -1 ); - myWithShape = false; - } - } - - int count1 = ComboBox1->count(); - if ( myWithShape ) count1 = count1 - 1; - - if ( SelectedShapeType > myShape.ShapeType() ) { - if ( SelectedShapeType == 8 ) { - if ( myShape.ShapeType() != TopAbs_COMPOUND ) { - ComboBox1->setCurrentItem(0); - myShapeType = 8 - count1; - } - } else { - ComboBox1->setCurrentItem( count1 - count + SelectedShapeType ); - myShapeType = 8 - count1 + ComboBox1->currentItem(); - } - } else { - ComboBox1->setCurrentItem(0); - myShapeType = 8 - count1; - } - } -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_SubShapeDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - switch (myConstructorId) - { - case 0: /* default constructor */ - { - if(send == SelectButtonC1A1) { - LineEditC1A1->setFocus() ; - myEditCurrentArgument = LineEditC1A1; - SelectionIntoArgument() ; - } - break; - } - } - return ; -} - - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_SubShapeDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if( send == LineEditC1A1 ) - myEditCurrentArgument = LineEditC1A1 ; - else - return ; - - /* User name of object input management */ - /* If successfull the selection is changed and signal emitted... */ - /* so SelectionIntoArgument() is automatically called. */ - const QString objectUserName = myEditCurrentArgument->text() ; - QWidget* thisWidget = (QWidget*)this ; - if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) { - myEditCurrentArgument->setText( objectUserName ) ; - } - return ; -} - - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void GeometryGUI_SubShapeDlg::DeactivateActiveDialog() -{ - /* Check if active */ - if ( GroupConstructors->isEnabled() ) { - - this->ResetStateOfDialog() ; - - disconnect( mySelection, 0, this, 0 ); - GroupConstructors->setEnabled(false) ; - GroupC1->setEnabled(false) ; - GroupButtons->setEnabled(false) ; - myGeomGUI->ResetState() ; - myGeomGUI->SetActiveDialogBox(0) ; - myGeomGUI->OnDisplayAll(true) ; - } - return ; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_SubShapeDlg::ActivateThisDialog() -{ - /* Emit a signal to deactivate other active dialog */ - myGeomGUI->EmitSignalDeactivateDialog() ; - GroupConstructors->setEnabled(true) ; - GroupC1->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - return ; -} - - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void GeometryGUI_SubShapeDlg::enterEvent(QEvent* e) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; - return ; -} - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_SubShapeDlg::closeEvent( QCloseEvent* e ) -{ - /* same than click on cancel button */ - this->ClickOnCancel() ; - return ; -} - - -//================================================================================= -// function : AllOrNotAll() -// purpose : Allow user selection of all or only selected sub shapes -// : Called when 'CheckBox1' state change -//================================================================================= -void GeometryGUI_SubShapeDlg::AllOrNotAll() -{ - - /* No sub shape selection if main shape not selected */ - if( !this->myOkShape ) { - ResetStateOfDialog() ; - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SELECT_FIRST")) ; - return ; - } - - if (myShapeType ==TopAbs_SHAPE && myShape.ShapeType()==TopAbs_COMPOUND) - { - /* Select sub shapes mode not checked */ - myOkSelectSubMode = false ; - CheckBox1->setChecked( FALSE ); - //no meaning to allow user selection for type = shape - //TODO - add another message - //myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SELECT_FIRST")) ; - return ; - } - - myOkSelectSubMode = CheckBox1->isChecked() ; - - if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) { - OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer(); - myIC = v3d->getAISContext(); - if( this->myUseLocalContext ) { - myIC->CloseLocalContext(myLocalContextId) ; - this->myUseLocalContext = false ; - myGeomGUI->OnDisplayAll(true) ; - } - } else { - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NOT_FOR_VTK_VIEWER") ) ; - return; - } - - if( myOkShape && myOkSelectSubMode ) { - /* local context is defined into the method */ - myGeomGUI->PrepareSubShapeSelection( this->myShapeType, this->myLocalContextId ) ; - myUseLocalContext = true ; - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SELECT_FACE")) ; - } - return ; -} - - -//================================================================================= -// function : ResetStateOfDialog() -// purpose : Completely reset the state of method including local context -//================================================================================= -void GeometryGUI_SubShapeDlg::ResetStateOfDialog() -{ - /* To leave current selection if explode all as been aborted by user */ - if( this->myAbort == true ) { - this->myOkShape = false ; - this->myEditCurrentArgument->setText("") ; - } - else { - ; /* nothing to do : keep selection argument */ - } - - int SelectedShapeType = ComboBox1->currentItem(); - int count = ComboBox1->count(); - if ( myWithShape ) count = count - 1; - /* type for sub shape selection */ - ComboBox1->clear(); - ComboBox1->insertItem("Compound"); - ComboBox1->insertItem("Compsolid"); - ComboBox1->insertItem("Solid"); - ComboBox1->insertItem("Shell"); - ComboBox1->insertItem("Face"); - ComboBox1->insertItem("Wire"); - ComboBox1->insertItem("Edge"); - ComboBox1->insertItem("Vertex"); - ComboBox1->insertItem("Shape"); - this->myWithShape=true; - ComboBox1->setCurrentItem( 8 - count + SelectedShapeType ); - - - /* unpress buttons : due to abort box*/ - this->buttonApply->setDown(FALSE) ; - this->buttonOk->setDown(FALSE) ; - - /* Select sub shapes mode not checked */ - this->myOkSelectSubMode = false ; - this->CheckBox1->setChecked( FALSE ); - - /* Close its local contact if opened */ - if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) { - OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer(); - myIC = v3d->getAISContext(); - if( this->myUseLocalContext ) { - myIC->CloseLocalContext(this->myLocalContextId) ; - this->myUseLocalContext = false ; - myGeomGUI->OnDisplayAll(true) ; - } - } - return ; -} - - - -//================================================================================= -// function : ComboTextChanged() -// purpose : -//================================================================================= -void GeometryGUI_SubShapeDlg::ComboTextChanged() -{ - if ( myOkShape ) - this->myShapeType = ComboBox1->currentItem() + myShape.ShapeType() + 1; - else - this->myShapeType = ComboBox1->currentItem(); - - /* Select sub shapes mode not checked */ - CheckBox1->setChecked( FALSE ); - myOkSelectSubMode = FALSE ; - - if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) { - OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer(); - myIC = v3d->getAISContext(); - if( this->myUseLocalContext ) { - myIC->CloseLocalContext(myLocalContextId) ; - this->myUseLocalContext = false ; - myGeomGUI->OnDisplayAll(true) ; - } - } - return ; -} - - -//================================================================================= -// function : NumberOfSubShapes() -// purpose : -//================================================================================= -unsigned int GeometryGUI_SubShapeDlg::NumberOfSubShapes( const TopoDS_Shape& S, const int shapeType ) -{ - if( S.IsNull() ) - return 0 ; - - unsigned int index = 0 ; - TopExp_Explorer Exp( S, TopAbs_ShapeEnum(shapeType) ); - TopTools_MapOfShape M; - while ( Exp.More() ) { - if ( M.Add(Exp.Current()) ) - index++; - Exp.Next(); - } - M.Clear() ; - return index ; -} - - diff --git a/src/GEOMGUI/GeometryGUI_SubShapeDlg.h b/src/GEOMGUI/GeometryGUI_SubShapeDlg.h deleted file mode 100644 index 7435721de..000000000 --- a/src/GEOMGUI/GeometryGUI_SubShapeDlg.h +++ /dev/null @@ -1,139 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_SubShapeDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_SUBSHAPE_H -#define DIALOGBOX_SUBSHAPE_H - -#include "SALOME_Selection.h" -#include "GEOM_ShapeTypeFilter.hxx" - -#include - -#include -#include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QCheckBox; -class QComboBox; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QRadioButton; -class GeometryGUI; - - -//================================================================================= -// class : GeometryGUI_SubShapeDlg -// purpose : -//================================================================================= -class GeometryGUI_SubShapeDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_SubShapeDlg( QWidget* parent = 0, - const char* name = 0, - SALOME_Selection* Sel = 0, - Handle (AIS_InteractiveContext) ic = 0, - bool modal = FALSE, - WFlags fl = 0 ); - - ~GeometryGUI_SubShapeDlg(); - -private : - - void Init( SALOME_Selection* Sel, Handle (AIS_InteractiveContext) ic ) ; - void closeEvent( QCloseEvent* e ) ; - void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */ - void ResetStateOfDialog() ; - - unsigned int NumberOfSubShapes( const TopoDS_Shape& S, const int shapeType ) ; - - - /* Interactive and local context management see also : bool myUseLocalContext() */ - Handle (AIS_InteractiveContext) myIC ; /* Interactive context */ - Standard_Integer myLocalContextId ; /* identify a local context used by this method */ - bool myUseLocalContext ; /* true when this method as opened a local context */ - - GEOM::GEOM_Gen_var myGeom ; /* Current Geom object */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - SALOME_Selection* mySelection ; /* User shape selection */ - - TopoDS_Shape myShape ; - char* myShapeIOR ; - bool myOkShape ; - int myShapeType ; /* define a type of topology mode of sub selection */ - - bool myWithShape ; /* check if Shape item exists */ - - bool myOkSelectSubMode ; /* true = sub mode selection activated */ - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - int myConstructorId ; /* Current constructor id = radio button id */ - bool myAbort ; /* Indicate if sub Shape All has been aborted by user */ - - QButtonGroup* GroupConstructors; - QRadioButton* Constructor1; - QGroupBox* GroupButtons; - QPushButton* buttonOk; - QPushButton* buttonCancel; - QPushButton* buttonApply; - QGroupBox* GroupC1; - QPushButton* SelectButtonC1A1; - QLineEdit* LineEditC1A1; - QLabel* TextLabelC1A1; - QLabel* TextLabelComboBox1; - QComboBox* ComboBox1; - - QCheckBox* CheckBox1; - -private slots: - - void ConstructorsClicked(int constructorId); - void ClickOnOk(); - void ClickOnCancel(); - void ClickOnApply(); - void LineEditReturnPressed() ; - void SetEditCurrentArgument() ; - void SelectionIntoArgument() ; - void DeactivateActiveDialog() ; - void ActivateThisDialog() ; - void AllOrNotAll() ; - void ComboTextChanged() ; - -protected: - QGridLayout* GeometryGUI_SubShapeDlgLayout; - QGridLayout* GroupConstructorsLayout; - QGridLayout* GroupButtonsLayout; - QGridLayout* GroupC1Layout; -}; - -#endif // DIALOGBOX_SUBSHAPE_H diff --git a/src/GEOMGUI/GeometryGUI_SuppressFacesDlg.cxx b/src/GEOMGUI/GeometryGUI_SuppressFacesDlg.cxx deleted file mode 100644 index bdd7bfa90..000000000 --- a/src/GEOMGUI/GeometryGUI_SuppressFacesDlg.cxx +++ /dev/null @@ -1,523 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_SuppressFacesDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_SuppressFacesDlg.h" - -#include "GeometryGUI.h" -#include "QAD_Application.h" -#include "QAD_Desktop.h" -#include "utilities.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -//================================================================================= -// class : GeometryGUI_SuppressFacesDlg() -// purpose : Constructs a GeometryGUI_SuppressFacesDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_SuppressFacesDlg::GeometryGUI_SuppressFacesDlg( QWidget* parent, - const char* name, - SALOME_Selection* Sel, - Handle (AIS_InteractiveContext) ic, - bool modal, - WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_SUPRESS_FACE"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - - if ( !name ) - setName( "GeometryGUI_SuppressFacesDlg" ); - resize( 322, 203 ); - setCaption( tr( "GEOM_SUPRESSFACE_TITLE" ) ); - setSizeGripEnabled( TRUE ); - GeometryGUI_SuppressFacesDlgLayout = new QGridLayout( this ); - GeometryGUI_SuppressFacesDlgLayout->setSpacing( 6 ); - GeometryGUI_SuppressFacesDlgLayout->setMargin( 11 ); - - /***************************************************************/ - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "GEOM_SUPRESSFACE" ) ); - GroupConstructors->setExclusive( TRUE ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setText( tr( "" ) ); - Constructor1->setPixmap( image0 ); - Constructor1->setChecked( TRUE ); - Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) ); - Constructor1->setMinimumSize( QSize( 50, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer, 0, 1 ); - GeometryGUI_SuppressFacesDlgLayout->addWidget( GroupConstructors, 0, 0 ); - - /***************************************************************/ - GroupC1 = new QGroupBox( this, "GroupC1" ); - GroupC1->setTitle( tr( "GEOM_ARGUMENTS" ) ); - GroupC1->setMinimumSize( QSize( 0, 0 ) ); - GroupC1->setFrameShape( QGroupBox::Box ); - GroupC1->setFrameShadow( QGroupBox::Sunken ); - GroupC1->setColumnLayout(0, Qt::Vertical ); - GroupC1->layout()->setSpacing( 0 ); - GroupC1->layout()->setMargin( 0 ); - GroupC1Layout = new QGridLayout( GroupC1->layout() ); - GroupC1Layout->setAlignment( Qt::AlignTop ); - GroupC1Layout->setSpacing( 6 ); - GroupC1Layout->setMargin( 11 ); - Layout2 = new QHBoxLayout; - Layout2->setSpacing( 6 ); - Layout2->setMargin( 0 ); - TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" ); - TextLabelC1A1->setText( tr( "GEOM_MAIN_OBJECT" ) ); - TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A1->setFrameShape( QLabel::NoFrame ); - TextLabelC1A1->setFrameShadow( QLabel::Plain ); - Layout2->addWidget( TextLabelC1A1 ); - SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" ); - SelectButtonC1A1->setText( tr( "" ) ); - SelectButtonC1A1->setPixmap( image1 ); - SelectButtonC1A1->setToggleButton( FALSE ); - SelectButtonC1A1->setMaximumSize( QSize( 28, 32767 ) ); - Layout2->addWidget( SelectButtonC1A1 ); - LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" ); - LineEditC1A1->setAlignment( int( QLineEdit::AlignLeft ) ); - Layout2->addWidget( LineEditC1A1 ); - GroupC1Layout->addLayout( Layout2, 0, 0 ); - CheckBox1 = new QCheckBox( GroupC1, "CheckBox1" ); - CheckBox1->setText( tr( "GEOM_SUPRESSFACE_SELECT" ) ); - CheckBox1->setChecked( FALSE ); - GroupC1Layout->addWidget( CheckBox1, 1, 0 ); - GeometryGUI_SuppressFacesDlgLayout->addWidget( GroupC1, 1, 0 ); - - /***************************************************************/ - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setTitle( tr( "" ) ); - GroupButtons->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, GroupButtons->sizePolicy().hasHeightForWidth() ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - // - buttonOk = new QPushButton( GroupButtons, "buttonOk" ); - buttonOk->setText( tr( "GEOM_BUT_OK" ) ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - buttonApply = new QPushButton( GroupButtons, "buttonApply" ); - buttonApply->setText( tr( "GEOM_BUT_APPLY" ) ); - buttonApply->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonApply, 0, 1 ); - QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_2, 0, 2 ); - buttonClose = new QPushButton( GroupButtons, "buttonClose" ); - buttonClose->setText( tr( "GEOM_BUT_CLOSE" ) ); - buttonClose->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonClose, 0, 3 ); - GeometryGUI_SuppressFacesDlgLayout->addWidget( GroupButtons, 2, 0 ); - - /* Initialisations */ - Init(Sel, ic) ; - -} - - -//================================================================================= -// function : ~GeometryGUI_SuppressFacesDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_SuppressFacesDlg::~GeometryGUI_SuppressFacesDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_SuppressFacesDlg::Init( SALOME_Selection* Sel, Handle (AIS_InteractiveContext) ic ) -{ - - GroupC1->show(); - myConstructorId = 0 ; - Constructor1->setChecked( TRUE ); - myEditCurrentArgument = LineEditC1A1 ; - mySelection = Sel; - myShape.Nullify() ; - - myIC = ic ; - myUseLocalContext = false ; - myOkShape = false ; - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - - /* Select sub shapes mode not checked */ - CheckBox1->setChecked( FALSE ); - myOkSelectSubMode = false ; - - // TODO : previous selection into argument ? - - /* Filter definitions */ - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - - /* signals and slots connections */ - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); - connect( buttonApply, SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) ); - connect( buttonClose, SIGNAL( clicked() ), this, SLOT( ClickOnClose() ) ); - connect( GroupConstructors, SIGNAL( clicked(int) ), this, SLOT( ConstructorsClicked(int) )); - - connect( SelectButtonC1A1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() )); - connect( CheckBox1, SIGNAL( stateChanged(int) ), this, SLOT( ActivateUserSelection() )); - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() )); - connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ; - connect( myGeomGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( ClickOnClose() )); - - /* Move widget on the botton right corner of main widget */ - int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; - this->show() ; /* display Dialog */ - return ; -} - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_SuppressFacesDlg::ConstructorsClicked(int constructorId) -{ - return ; -} - - -//================================================================================= -// function : ClickOnOk() -// purpose : Same than click on apply but close this dialog. -//================================================================================= -void GeometryGUI_SuppressFacesDlg::ClickOnOk() -{ - this->ClickOnApply() ; - accept(); - - return ; -} - - - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_SuppressFacesDlg::ClickOnApply() -{ - bool testResult = false ; - switch(myConstructorId) - { - case 0 : - { - if( myOkShape && myOkSelectSubMode ) { - testResult = myGeomGUI->OnSuppressFaces( myShape, myShapeIOR, myLocalContextId, myUseLocalContext ) ; - } - if( !testResult ) { - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT")) ; - } - else { - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE")) ; - } - /* Reset arguments to allow a new selection */ - this->ResetStateOfDialog() ; - break ; - } - } - return ; -} - - - -//================================================================================= -// function : ClickOnClose() -// purpose : -//================================================================================= -void GeometryGUI_SuppressFacesDlg::ClickOnClose() -{ - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->ResetState() ; - - if(myUseLocalContext) { - myIC->CloseLocalContext(myLocalContextId) ; - this->myUseLocalContext = false ; - myGeomGUI->OnDisplayAll(true) ; - } - reject() ; - return ; -} - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -// : used only by SelectButtonC1A1 (LineEditC1A1) -//================================================================================= -void GeometryGUI_SuppressFacesDlg::SelectionIntoArgument() -{ - - /* Reset argument and local context when selection as changed */ - this->ResetStateOfDialog() ; - - QString aString = ""; /* name of selection */ - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; - if ( nbSel != 1 ) - return ; - - /* nbSel == 1 */ - TopoDS_Shape S ; - Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject() ; - - if( !myGeomGUI->GetTopoFromSelection(mySelection, S) ) - return ; - - if( !IO->hasEntry() ) { - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY")) ; - return ; - } - - /* Test the exact type of topology to suppress faces into */ - if ( !S.IsNull() && ( S.ShapeType() == TopAbs_SOLID || S.ShapeType() == TopAbs_SHELL || S.ShapeType() == TopAbs_COMPOUND ) ) { - - if ( IO->IsInstance(STANDARD_TYPE(GEOM_InteractiveObject)) ) { - Handle(GEOM_InteractiveObject) GIObject = Handle(GEOM_InteractiveObject)::DownCast( IO ); - myShapeIOR = GIObject->getIOR(); /* the Geom IOR string of selection */ - LineEditC1A1->setText(aString) ; - myShape = S ; - myOkShape = true ; - return; - } - - if ( IO->hasEntry() ) { - SALOMEDS::Study_var aStudy = myGeomGUI->GetActiveStudy()->getStudyDocument(); - SALOMEDS::SObject_var obj = aStudy->FindObjectID( IO->getEntry() ); - SALOMEDS::GenericAttribute_var anAttr; - SALOMEDS::AttributeIOR_var anIOR; - if ( !obj->_is_nil() ) { - if (obj->FindAttribute(anAttr, "AttributeIOR")) { - anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr); - myShapeIOR = anIOR->Value(); - myOkShape = true ; - myShape = S ; - LineEditC1A1->setText(aString) ; - return; - } - } - } - - } - return ; -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_SuppressFacesDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - switch (myConstructorId) - { - case 0: /* default constructor */ - { - if(send == SelectButtonC1A1) { - LineEditC1A1->setFocus() ; - myEditCurrentArgument = LineEditC1A1; - SelectionIntoArgument() ; - } - break; - } - } - return ; -} - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_SuppressFacesDlg::LineEditReturnPressed() -{ - return ; -} - - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void GeometryGUI_SuppressFacesDlg::DeactivateActiveDialog() -{ - if ( GroupConstructors->isEnabled() ) { - - this->ResetStateOfDialog() ; - - disconnect( mySelection, 0, this, 0 ); - GroupConstructors->setEnabled(false) ; - GroupC1->setEnabled(false) ; - GroupButtons->setEnabled(false) ; - myGeomGUI->ResetState() ; - myGeomGUI->SetActiveDialogBox(0) ; - myGeomGUI->OnDisplayAll(true) ; - } - return ; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_SuppressFacesDlg::ActivateThisDialog() -{ - /* Emit a signal to deactivate other active dialog */ - myGeomGUI->EmitSignalDeactivateDialog() ; - GroupConstructors->setEnabled(true) ; - GroupC1->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - return ; -} - - -//================================================================================= -// function : enterEvent() -// purpose : Mouse enter onto the dialog to activate it -//================================================================================= -void GeometryGUI_SuppressFacesDlg::enterEvent(QEvent* e) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; - return ; -} - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_SuppressFacesDlg::closeEvent( QCloseEvent* e ) -{ - /* same than click on cancel button */ - this->ClickOnClose() ; - return ; -} - - -//================================================================================= -// function : ActivateUserSelection() -// purpose : Activate selection of faces when CheckBox1->isChecked()... -//================================================================================= -void GeometryGUI_SuppressFacesDlg::ActivateUserSelection() -{ - if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) { - if( !this->myOkShape ) { - this->ResetStateOfDialog() ; - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SELECT_FIRST")) ; - return ; - } - - this->myOkSelectSubMode = CheckBox1->isChecked() ; - - if( this->myUseLocalContext ) { - myIC->CloseLocalContext(myLocalContextId) ; - this->myUseLocalContext = false ; - myGeomGUI->OnDisplayAll(true) ; - } - - if( myOkShape && myOkSelectSubMode ) { - /* local context is defined into the method : 4 = FACES sub selection */ - myGeomGUI->PrepareSubShapeSelection( int(TopAbs_FACE), this->myLocalContextId ) ; - myUseLocalContext = true ; - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SELECT_FACE")) ; - } - } else { - CheckBox1->setChecked( false ); - } - - return ; -} - - - -//================================================================================= -// function : ResetStateOfDialog() -// purpose : Completely reset the state of method including local context -//================================================================================= -void GeometryGUI_SuppressFacesDlg::ResetStateOfDialog() -{ - this->myOkShape = false ; - this->myEditCurrentArgument->setText("") ; - - /* Select sub shapes mode not checked */ - this->myOkSelectSubMode = false ; - this->CheckBox1->setChecked( FALSE ); - - /* Close its local contact if opened */ - if( this->myUseLocalContext ) { - myIC->CloseLocalContext(this->myLocalContextId) ; - this->myUseLocalContext = false ; - myGeomGUI->OnDisplayAll(true) ; - } - return ; -} diff --git a/src/GEOMGUI/GeometryGUI_SuppressFacesDlg.h b/src/GEOMGUI/GeometryGUI_SuppressFacesDlg.h deleted file mode 100644 index 6e332c6e7..000000000 --- a/src/GEOMGUI/GeometryGUI_SuppressFacesDlg.h +++ /dev/null @@ -1,130 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_SuppressFacesDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_SUPPRESSFACES_H -#define DIALOGBOX_SUPPRESSFACES_H - -#include "SALOME_Selection.h" -#include "GEOM_ShapeTypeFilter.hxx" - -#include -#include - -#include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QCheckBox; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QRadioButton; -class GeometryGUI; - - -//================================================================================= -// class : GeometryGUI_SuppressFacesDlg -// purpose : -//================================================================================= -class GeometryGUI_SuppressFacesDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_SuppressFacesDlg( QWidget* parent = 0, - const char* name = 0, - SALOME_Selection* Sel = 0, - Handle (AIS_InteractiveContext) ic = 0, - bool modal = FALSE, - WFlags fl = 0 ); - - ~GeometryGUI_SuppressFacesDlg(); - -private : - - void Init( SALOME_Selection* Sel, Handle (AIS_InteractiveContext) ic ) ; - void closeEvent( QCloseEvent* e ) ; - void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */ - void ResetStateOfDialog() ; - - /* Interactive and local context management see also : bool myUseLocalContext() */ - Handle (AIS_InteractiveContext) myIC ; /* Interactive context */ - Standard_Integer myLocalContextId ; /* identify a local context used by this method */ - bool myUseLocalContext ; /* true when this method as opened a local context */ - - GEOM::GEOM_Gen_var myGeom ; /* Current Geom object */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - SALOME_Selection* mySelection ; /* User shape selection */ - - TopoDS_Shape myShape ; - char* myShapeIOR ; - bool myOkShape ; - - bool myOkSelectSubMode ; /* true = sub mode selection activated */ - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - int myConstructorId ; /* Current constructor id = radio button id */ - - QButtonGroup* GroupConstructors; - QRadioButton* Constructor1; - QGroupBox* GroupC1; - QLabel* TextLabelC1A1; - QPushButton* SelectButtonC1A1; - QLineEdit* LineEditC1A1; - QGroupBox* GroupButtons; - QPushButton* buttonOk; - QPushButton* buttonApply; - QPushButton* buttonClose; - - QCheckBox* CheckBox1; - -private slots: - - void ConstructorsClicked(int constructorId); - void ClickOnOk(); - void ClickOnApply() ; - void ClickOnClose(); - - void LineEditReturnPressed() ; - void SetEditCurrentArgument() ; - void SelectionIntoArgument() ; - void DeactivateActiveDialog() ; - void ActivateThisDialog() ; - void ActivateUserSelection() ; - -protected: - QGridLayout* GeometryGUI_SuppressFacesDlgLayout; - QGridLayout* GroupConstructorsLayout; - QGridLayout* GroupC1Layout; - QHBoxLayout* Layout2; - QGridLayout* GroupButtonsLayout; -}; - -#endif // DIALOGBOX_SUPPRESSFACES_H diff --git a/src/GEOMGUI/GeometryGUI_SuppressHoleDlg.cxx b/src/GEOMGUI/GeometryGUI_SuppressHoleDlg.cxx deleted file mode 100644 index 3078160c9..000000000 --- a/src/GEOMGUI/GeometryGUI_SuppressHoleDlg.cxx +++ /dev/null @@ -1,969 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_SuppressHoleDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_SuppressHoleDlg.h" -#include "GeometryGUI.h" - -#include "TopExp_Explorer.hxx" - -#include "QAD_Application.h" -#include "QAD_Desktop.h" -#include "QAD_RightFrame.h" -#include "OCCViewer_Viewer3d.h" -#include "utilities.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -//================================================================================= -// class : GeometryGUI_SuppressHoleDlg() -// purpose : Constructs a GeometryGUI_SuppressHoleDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_SuppressHoleDlg::GeometryGUI_SuppressHoleDlg( QWidget* parent, - const char* name, - SALOME_Selection* Sel, - Handle (AIS_InteractiveContext) ic, - bool modal, - WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_SUPRESS_HOLE"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_SUPRESS_HOLE_FACE_SHELL"))); - - if ( !name ) - setName( "GeometryGUI_SuppressHoleDlg" ); - resize( 303, 204 ); - setCaption( tr( "GEOM_SUPPRESSHOLE_TITLE" ) ); - setSizeGripEnabled( TRUE ); - GeometryGUI_SuppressHoleLayout = new QGridLayout( this ); - GeometryGUI_SuppressHoleLayout->setSpacing( 6 ); - GeometryGUI_SuppressHoleLayout->setMargin( 11 ); - - - /***************************************************************/ - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "" ) ); - GroupConstructors->setExclusive( TRUE ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setText( tr( "" ) ); - Constructor1->setPixmap( image0 ); - Constructor1->setChecked( TRUE ); - Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) ); - Constructor1->setMinimumSize( QSize( 50, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer, 0, 1 ); - - Constructor2 = new QRadioButton( GroupConstructors, "Constructor2" ); - Constructor2->setText( tr( "" ) ); - Constructor2->setPixmap( image2 ); - Constructor2->setChecked( TRUE ); - Constructor2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor2->sizePolicy().hasHeightForWidth() ) ); - Constructor2->setMinimumSize( QSize( 50, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor2, 0, 2 ); - QSpacerItem* spacer_4 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer_4, 0, 3 ); - GeometryGUI_SuppressHoleLayout->addWidget( GroupConstructors, 0, 0 ); - - - /***************************************************************/ - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setTitle( tr( "" ) ); - GroupButtons->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, GroupButtons->sizePolicy().hasHeightForWidth() ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - GroupButtonsLayout = new QHBoxLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - - buttonOk = new QPushButton( GroupButtons, "buttonOk" ); - buttonOk->setText( tr( "GEOM_BUT_OK" ) ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); - buttonOk->setAccel( 276824143 ); - GroupButtonsLayout->addWidget( buttonOk ); - QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_2 ); - buttonApply = new QPushButton( GroupButtons, "buttonApply" ); - buttonApply->setText( tr( "GEOM_BUT_APPLY" ) ); - buttonApply->setAutoDefault( TRUE ); - buttonApply->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonApply ); - buttonClose = new QPushButton( GroupButtons, "buttonClose" ); - buttonClose->setText( tr( "GEOM_BUT_CLOSE" ) ); - buttonClose->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonClose ); - GeometryGUI_SuppressHoleLayout->addWidget( GroupButtons, 2, 0 ); - - /* First constructor */ - GroupC1 = new QGroupBox( this, "GroupC1" ); - GroupC1->setTitle( tr( "" ) ); - GroupC1->setMinimumSize( QSize( 0, 0 ) ); - GroupC1->setFrameShape( QGroupBox::Box ); - GroupC1->setFrameShadow( QGroupBox::Sunken ); - GroupC1->setColumnLayout(0, Qt::Vertical ); - GroupC1->layout()->setSpacing( 0 ); - GroupC1->layout()->setMargin( 0 ); - GroupC1Layout = new QGridLayout( GroupC1->layout() ); - GroupC1Layout->setAlignment( Qt::AlignTop ); - GroupC1Layout->setSpacing( 6 ); - GroupC1Layout->setMargin( 11 ); - - Layout2 = new QHBoxLayout; - Layout2->setSpacing( 6 ); - Layout2->setMargin( 0 ); - - TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" ); - TextLabelC1A1->setText( tr( "GEOM_MAIN_OBJECT" ) ); - TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A1->setFrameShape( QLabel::NoFrame ); - TextLabelC1A1->setFrameShadow( QLabel::Plain ); - Layout2->addWidget( TextLabelC1A1 ); - - SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" ); - SelectButtonC1A1->setText( tr( "" ) ); - SelectButtonC1A1->setPixmap( image1 ); - SelectButtonC1A1->setToggleButton( FALSE ); - SelectButtonC1A1->setMaximumSize( QSize( 28, 32767 ) ); - Layout2->addWidget( SelectButtonC1A1 ); - - LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" ); - LineEditC1A1->setAlignment( int( QLineEdit::AlignLeft ) ); - Layout2->addWidget( LineEditC1A1 ); - - GroupC1Layout->addLayout( Layout2, 0, 0 ); - - CheckBox1 = new QCheckBox( GroupC1, "CheckBox1" ); - CheckBox1->setText( tr( "GEOM_SUPPRESSHOLE_SELECTFACE" ) ); - CheckBox1->setChecked( FALSE ); - GroupC1Layout->addWidget( CheckBox1, 1, 0 ); - - CheckBox2 = new QCheckBox( GroupC1, "CheckBox2" ); - CheckBox2->setText( tr( "GEOM_SUPPRESSHOLE_SELECTWIRE" ) ); - CheckBox2->setChecked( FALSE ); - GroupC1Layout->addWidget( CheckBox2, 2, 0 ); - - CheckBox3 = new QCheckBox( GroupC1, "CheckBox3" ); - CheckBox3->setText( tr( "GEOM_SUPPRESSHOLE_SELECTFACE_END" ) ); - CheckBox3->setChecked( FALSE ); - GroupC1Layout->addWidget( CheckBox3, 3, 0 ); - GeometryGUI_SuppressHoleLayout->addWidget( GroupC1, 1, 0 ); - - /* Second constructor */ - GroupC2 = new QGroupBox( this, "GroupC2" ); - GroupC2->setTitle( tr( "" ) ); - GroupC2->setMinimumSize( QSize( 0, 0 ) ); - GroupC2->setFrameShape( QGroupBox::Box ); - GroupC2->setFrameShadow( QGroupBox::Sunken ); - GroupC2->setColumnLayout(0, Qt::Vertical ); - GroupC2->layout()->setSpacing( 0 ); - GroupC2->layout()->setMargin( 0 ); - GroupC2Layout = new QGridLayout( GroupC2->layout() ); - GroupC2Layout->setAlignment( Qt::AlignTop ); - GroupC2Layout->setSpacing( 6 ); - GroupC2Layout->setMargin( 11 ); - - Layout3 = new QHBoxLayout; - Layout3->setSpacing( 6 ); - Layout3->setMargin( 0 ); - - TextLabelC2A1 = new QLabel( GroupC2, "TextLabelC2A1" ); - TextLabelC2A1->setText( tr( "GEOM_SUPPRESSHOLE_FACE_SHELL" ) ); - TextLabelC2A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC2A1->setFrameShape( QLabel::NoFrame ); - TextLabelC2A1->setFrameShadow( QLabel::Plain ); - Layout3->addWidget( TextLabelC2A1 ); - - SelectButtonC2A1 = new QPushButton( GroupC2, "SelectButtonC2A1" ); - SelectButtonC2A1->setText( tr( "" ) ); - SelectButtonC2A1->setPixmap( image1 ); - SelectButtonC2A1->setToggleButton( FALSE ); - SelectButtonC2A1->setMaximumSize( QSize( 28, 32767 ) ); - Layout3->addWidget( SelectButtonC2A1 ); - - LineEditC2A1 = new QLineEdit( GroupC2, "LineEditC2A1" ); - LineEditC2A1->setAlignment( int( QLineEdit::AlignLeft ) ); - Layout3->addWidget( LineEditC2A1 ); - - GroupC2Layout->addLayout( Layout3, 0, 0 ); - QSpacerItem* spacer_3 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); - GroupC2Layout->addItem( spacer_3, 2, 0 ); - - CheckBoxC2_1 = new QCheckBox( GroupC2, "CheckBoxC2_1" ); - CheckBoxC2_1->setText( tr( "GEOM_SUPPRESSHOLE_SELECT_HOLES_ON_FACE" ) ); - CheckBoxC2_1->setChecked( FALSE ); - - GroupC2Layout->addWidget( CheckBoxC2_1, 1, 0 ); - GeometryGUI_SuppressHoleLayout->addWidget( GroupC2, 1, 0 ); - - - /* Initialisations */ - Init(Sel, ic) ; -} - - -//================================================================================= -// function : ~GeometryGUI_SuppressHoleDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_SuppressHoleDlg::~GeometryGUI_SuppressHoleDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_SuppressHoleDlg::Init( SALOME_Selection* Sel, Handle (AIS_InteractiveContext) ic ) -{ - GroupC1->show(); - GroupC2->hide(); - - myConstructorId = 0 ; - Constructor1->setChecked( TRUE ); - myEditCurrentArgument = LineEditC1A1 ; - mySelection = Sel; - myShape.Nullify() ; - - myIC = ic ; - myUseLocalContext = false ; - myOkShape = false ; - myOkSelectFace = false ; - - myListOfIdFace = new GEOM::GEOM_Shape::ListOfSubShapeID; - myListOfIdWire = new GEOM::GEOM_Shape::ListOfSubShapeID; - myListOfIdEndFace = new GEOM::GEOM_Shape::ListOfSubShapeID; - - myListOfIdFace->length(0) ; - myListOfIdWire->length(0) ; - myListOfIdEndFace->length(0) ; - - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - - /* Select sub modes not checked */ - CheckBox1->setChecked( FALSE ); /* sub mode GEOM::FACE */ - CheckBox2->setChecked( FALSE ); /* sub mode GEOM::WIRE */ - CheckBox3->setChecked( FALSE ); /* sub mode END GEOM::FACE */ - - CheckBoxC2_1->setChecked( FALSE ); /* sub mode GEOM::WIRE(S) */ - - // TODO : previous selection into argument ? - - /* Filter definitions */ - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - - /* signals and slots connections */ - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); - connect( buttonApply, SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) ); - connect( buttonClose, SIGNAL( clicked() ), this, SLOT( ClickOnClose() ) ); - connect( GroupConstructors, SIGNAL( clicked(int) ), this, SLOT( ConstructorsClicked(int) )); - - connect( SelectButtonC1A1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() )); - connect( SelectButtonC2A1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() )); - - connect( CheckBox1, SIGNAL( stateChanged(int) ), this, SLOT( ActivateUserFaceSelection() )); - connect( CheckBox2, SIGNAL( stateChanged(int) ), this, SLOT( ActivateUserWireSelection() )); - connect( CheckBox3, SIGNAL( stateChanged(int) ), this, SLOT( ActivateUserEndFaceSelection() )); - - connect( LineEditC1A1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - connect( LineEditC2A1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - - /* for the second constructor */ - connect( CheckBoxC2_1, SIGNAL( stateChanged(int) ), this, SLOT( ActivateUserWiresOnFaceShellSelection() )); - - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() )); - connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ; - connect( myGeomGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( ClickOnClose() )); - - /* Move widget on the botton right corner of main widget */ - int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; - this->show() ; /* display Dialog */ - return ; -} - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_SuppressHoleDlg::ConstructorsClicked(int constructorId) -{ - switch (constructorId) - { - case 0: - { - GroupC1->show(); - GroupC2->hide(); - myConstructorId = constructorId ; - myEditCurrentArgument = LineEditC1A1 ; - LineEditC1A1->setText(tr("")) ; - myOkShape = false ; - myOkSelectFace = false ; - this->ResetPartial() ; - connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - break; - } - case 1: - { - GroupC1->hide(); - GroupC2->show(); - myConstructorId = constructorId ; - myEditCurrentArgument = LineEditC2A1 ; - LineEditC2A1->setText(tr("")) ; - myOkShape = false ; - this->ResetPartial() ; - connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - this->ResetPartial() ; - break; - } - } - return ; -} - - -//================================================================================= -// function : ClickOnOk() -// purpose : Same than click on apply but close this dialog. -//================================================================================= -void GeometryGUI_SuppressHoleDlg::ClickOnOk() -{ - this->ClickOnApply() ; - accept(); - - return ; -} - - - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_SuppressHoleDlg::ClickOnApply() -{ - myGeomGUI->GetDesktop()->putInfo( tr("") ) ; - bool testResult = false ; - - if( !myOkShape ) - return ; - switch (myConstructorId) - { - case 0: /* default constructor */ - { - if( !myOkSelectFace ) - return ; - - if( CheckBox2->isChecked() ) { - - if( !CheckBox3->isChecked() ) { - - /* Call method to get sub shape selection of GEOM::WIRE */ - bool aTest = myGeomGUI->GetIndexSubShapeSelected(myFace, int(TopAbs_WIRE), myListOfIdWire, myLocalContextId, myUseLocalContext) ; - - myGeomGUI->OnDisplayAll(true) ; /* Display all objects so that next method using ic can memorize them */ - if( !aTest || myListOfIdWire->length() != 1 ) { - CheckBox2->setChecked(FALSE) ; - myGeomGUI->GetDesktop()->putInfo( tr("GEOM_PRP_ABORT") ) ; - } - else { - myListOfIdEndFace->length(0) ; /* no end face */ - QApplication::setOverrideCursor( Qt::waitCursor ); - testResult = myGeomGUI->OnSuppressHole( myShapeIOR, myListOfIdFace, myListOfIdWire, myListOfIdEndFace ) ; - QApplication::restoreOverrideCursor(); - } - } - else { /* CheckBox3->isChecked() */ - - /* Call method to get sub shape selection of END GEOM::FACE */ - bool aTest = myGeomGUI->GetIndexSubShapeSelected(myShape, int(TopAbs_FACE), myListOfIdEndFace, myLocalContextId, myUseLocalContext) ; - - myGeomGUI->OnDisplayAll(true) ; /* Display all objects so that next method using ic can memorize them */ - if( !aTest || myListOfIdEndFace->length() != 1 ) { - CheckBox3->setChecked(FALSE) ; - myGeomGUI->GetDesktop()->putInfo( tr("GEOM_PRP_ABORT") ) ; - } - else { - QApplication::setOverrideCursor( Qt::waitCursor ); - testResult = myGeomGUI->OnSuppressHole( myShapeIOR, myListOfIdFace, myListOfIdWire, myListOfIdEndFace ) ; - QApplication::restoreOverrideCursor(); - } - } - } - break ; - } - - case 1: /* second constructor */ - { - if( CheckBoxC2_1->isChecked() ) { - - /* Call method to get sub shape selection of one or more GEOM::WIRE(s) on a face or a shell */ - bool aTest = myGeomGUI->GetIndexSubShapeSelected(myShape, int(TopAbs_WIRE), myListOfIdWire, myLocalContextId, myUseLocalContext) ; - - myGeomGUI->OnDisplayAll(true) ; /* Display all objects so that next method using ic can memorize them */ - - if( !aTest || myListOfIdWire->length() < 1 ) { - CheckBoxC2_1->setChecked(FALSE) ; - myGeomGUI->GetDesktop()->putInfo( tr("GEOM_PRP_ABORT") ) ; - } - else { - QApplication::setOverrideCursor( Qt::waitCursor ); - testResult = myGeomGUI->OnSuppressHolesInFaceOrShell( myShapeIOR, myListOfIdWire ) ; - QApplication::restoreOverrideCursor(); - } - } - break ; - } - } - - - if( !testResult ) - myGeomGUI->GetDesktop()->putInfo( tr("GEOM_PRP_ABORT") ) ; - else - myGeomGUI->GetDesktop()->putInfo( tr("GEOM_PRP_DONE") ) ; - - /* Reset arguments to allow a new selection */ - this->ResetStateOfDialog() ; - return ; -} - - - -//================================================================================= -// function : ClickOnClose() -// purpose : -//================================================================================= -void GeometryGUI_SuppressHoleDlg::ClickOnClose() -{ - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->ResetState() ; - - if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) { - OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer(); - myIC = v3d->getAISContext(); // myIC = myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getViewerOCC()->getAISContext(); - if(myUseLocalContext) { - myIC->CloseLocalContext(myLocalContextId) ; - this->myUseLocalContext = false ; - myGeomGUI->OnDisplayAll(true) ; - } - } - - reject() ; - return ; -} - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -// : used only by SelectButtonC1A1 and SelectButtonC2A1 -//================================================================================= -void GeometryGUI_SuppressHoleDlg::SelectionIntoArgument() -{ - - /* Reset argument and local context when selection as changed */ - this->ResetStateOfDialog() ; - - QString aString = ""; /* Name of selection */ - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; - if ( nbSel != 1 ) - return ; - - /* nbSel == 1 */ - TopoDS_Shape S ; - Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject() ; - - if( !myGeomGUI->GetTopoFromSelection(mySelection, S) ) - return ; - - if ( S.IsNull() || S.ShapeType() == TopAbs_VERTEX || S.ShapeType() == TopAbs_EDGE || S.ShapeType() == TopAbs_WIRE ) { - return ; - } - - /* Test the exact type of topology to suppress faces into. */ - /* For the second constructor a face or shell selection is needed */ - if ( myConstructorId == 0 || ( myConstructorId == 1 && ( S.ShapeType() == TopAbs_FACE || S.ShapeType() == TopAbs_SHELL ) ) ) { - - if ( IO->IsInstance(STANDARD_TYPE(GEOM_InteractiveObject)) ) { - Handle(GEOM_InteractiveObject) GIObject = Handle(GEOM_InteractiveObject)::DownCast( IO ); - - /* The Geom IOR string of selection */ - myShapeIOR = GIObject->getIOR(); - myEditCurrentArgument->setText(aString) ; - myShape = S ; - myOkShape = true ; - return; - } - - if ( IO->hasEntry() ) { - SALOMEDS::Study_var aStudy = myGeomGUI->GetActiveStudy()->getStudyDocument(); - SALOMEDS::SObject_var obj = aStudy->FindObjectID( IO->getEntry() ); - SALOMEDS::GenericAttribute_var anAttr; - SALOMEDS::AttributeIOR_var anIOR; - if ( !obj->_is_nil() ) { - if (obj->FindAttribute(anAttr, "AttributeIOR")) { - anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr); - myShapeIOR = anIOR->Value(); - myOkShape = true ; - myShape = S ; - myEditCurrentArgument->setText(aString) ; - return; - } - } - } - - } - return ; -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_SuppressHoleDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - switch (myConstructorId) - { - case 0: /* default constructor */ - { - if(send == SelectButtonC1A1) { - LineEditC1A1->setFocus() ; - myEditCurrentArgument = LineEditC1A1; - SelectionIntoArgument() ; - } - break; - } - case 1: - { - if(send == SelectButtonC2A1) { - LineEditC2A1->setFocus() ; - myEditCurrentArgument = LineEditC2A1; - SelectionIntoArgument() ; - } - break; - } - } - return ; -} - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_SuppressHoleDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if( send == LineEditC1A1 ) - myEditCurrentArgument = LineEditC1A1 ; - else if ( send == LineEditC2A1) - myEditCurrentArgument = LineEditC2A1; - else - return ; - - /* User name of object input management */ - /* If successfull the selection is changed and signal emitted... */ - /* so SelectionIntoArgument() is automatically called. */ - const QString objectUserName = myEditCurrentArgument->text() ; - QWidget* thisWidget = (QWidget*)this ; - if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) { - myEditCurrentArgument->setText( objectUserName ) ; - } - - return ; -} - - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void GeometryGUI_SuppressHoleDlg::DeactivateActiveDialog() -{ - if ( GroupConstructors->isEnabled() ) { - - this->ResetStateOfDialog() ; - - disconnect( mySelection, 0, this, 0 ); - GroupConstructors->setEnabled(false) ; - GroupC1->setEnabled(false) ; - GroupC2->setEnabled(false) ; - GroupButtons->setEnabled(false) ; - - myGeomGUI->ResetState() ; - myGeomGUI->SetActiveDialogBox(0) ; - myGeomGUI->OnDisplayAll(true) ; - } - return ; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_SuppressHoleDlg::ActivateThisDialog() -{ - /* Emit a signal to deactivate other active dialog */ - myGeomGUI->EmitSignalDeactivateDialog() ; - - GroupConstructors->setEnabled(true) ; - GroupC1->setEnabled(true) ; - GroupC2->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - - connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - return ; -} - - -//================================================================================= -// function : enterEvent() -// purpose : Mouse enter onto the dialog to activate it -//================================================================================= -void GeometryGUI_SuppressHoleDlg::enterEvent(QEvent* e) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; - return ; -} - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_SuppressHoleDlg::closeEvent( QCloseEvent* e ) -{ - /* same than click on cancel button */ - this->ClickOnClose() ; - return ; -} - - -//================================================================================= -// function : ActivateUserFaceSelection() -// purpose : Called when CheckBox1 state has changed. (Face selection is ckecked) -// : Be careful user must first select a face then a wire ! -//================================================================================= -void GeometryGUI_SuppressHoleDlg::ActivateUserFaceSelection() -{ - if( !this->myOkShape ) { - this->ResetStateOfDialog() ; - myGeomGUI->GetDesktop()->putInfo( tr("GEOM_MAIN_OBJECT") ) ; - return ; - } - - /* Test the viewer type VTK */ - if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC ) { - myGeomGUI->GetDesktop()->putInfo( tr("GEOM_PRP_NOT_FOR_VTK_VIEWER") ) ; - this->ResetStateOfDialog() ; - return; - } - - if( CheckBox1->isChecked() ) { - - /* local context is opened into the method : Prepare GEOM::FACE sub selection */ - myGeomGUI->PrepareSubShapeSelection( int(TopAbs_FACE), this->myLocalContextId ) ; - myUseLocalContext = true ; - myGeomGUI->GetDesktop()->putInfo( tr("GEOM_SUPPRESSHOLE_SELECTFACE") ) ; - } - else { - this->ResetPartial() ; - } - - return ; -} - - -//================================================================================= -// function : ActivateUserWireSelection() -// purpose : Called when CheckBox2 state has changed. (Wire selection is ckecked) -// : Be careful user must first select a face then a wire ! -//================================================================================= -void GeometryGUI_SuppressHoleDlg::ActivateUserWireSelection() -{ - - if( !this->myOkShape ) { - this->ResetStateOfDialog() ; - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_MAIN_OBJECT") ) ; - return ; - } - - /* Test the type of viewer VTK */ - if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC ) { - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NOT_FOR_VTK_VIEWER") ) ; - this->ResetStateOfDialog() ; - return; - } - - if( CheckBox1->isChecked() ) { - - /* Get sub shape selection GEOM::FACE : local context is closed */ - bool aTest = myGeomGUI->GetIndexSubShapeSelected(myShape, int(TopAbs_FACE), myListOfIdFace, myLocalContextId, myUseLocalContext) ; - - myGeomGUI->OnDisplayAll(true) ; /* Display all objects so that next method using ic can memorize them */ - if( !aTest || myListOfIdFace->length() != 1 ) { - CheckBox1->setChecked(FALSE) ; - myOkSelectFace = false ; - myGeomGUI->GetDesktop()->putInfo( tr("GEOM_PRP_ABORT") ) ; - } - else { - myOkSelectFace = true ; - } - } - else { - this->ResetPartial() ; - return ; - } - - - if( CheckBox2->isChecked() ) { - - /* Get the face selection */ - this->myFace = FaceFromList(myShape, myListOfIdFace) ; - /* Local context is opened into the method : Prepare GEOM::WIRE sub selection into a face */ - myGeomGUI->PrepareSubShapeSelectionArgumentShape( this->myFace, int(TopAbs_WIRE), this->myLocalContextId ) ; - myUseLocalContext = true ; - myGeomGUI->GetDesktop()->putInfo( tr("GEOM_SUPPRESSHOLE_SELECTWIRE") ) ; - } - else { - this->ResetPartial() ; - } - - return ; -} - - - -//================================================================================= -// function : ActivateUserlEndFaceSelection() -// purpose : Called when CheckBox3 state has changed. ( Optional End Face selection ) -// : Be careful user must first select a face then a wire then this optional end face ! -//================================================================================= -void GeometryGUI_SuppressHoleDlg::ActivateUserEndFaceSelection() -{ - - if( !this->myOkShape ) { - this->ResetStateOfDialog() ; - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_MAIN_OBJECT") ) ; - return ; - } - - /* Test the type of viewer VTK */ - if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC ) { - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NOT_FOR_VTK_VIEWER") ) ; - this->ResetStateOfDialog() ; - return; - } - - - if( CheckBox2->isChecked() ) { - /* Call method to get sub shape selection for the GEOM::WIRE into myFace : local context is closed */ - bool aTest = myGeomGUI->GetIndexSubShapeSelected(this->myFace, int(TopAbs_WIRE), myListOfIdWire, myLocalContextId, myUseLocalContext) ; - - myGeomGUI->OnDisplayAll(true) ; /* Display all objects so that next method using ic can memorize them */ - - if( !aTest || myListOfIdWire->length() != 1 ) { - CheckBox2->setChecked(FALSE) ; - CheckBox3->setChecked(FALSE) ; - myGeomGUI->GetDesktop()->putInfo( tr("GEOM_PRP_ABORT") ) ; - return ; - } - } - else { - this->ResetPartial() ; - return ; - } - - - if( CheckBox3->isChecked() ) { - /* Local context is opened into the method : prepare GEOM::FACE(end) into myShape sub selection */ - myGeomGUI->PrepareSubShapeSelectionArgumentShape( this->myShape, int(TopAbs_FACE), this->myLocalContextId ) ; - myUseLocalContext = true ; - myGeomGUI->GetDesktop()->putInfo( tr("GEOM_SUPPRESSHOLE_SELECTFACE_END") ) ; - } - else { - this->ResetPartial() ; - } - - return ; -} - - - -//================================================================================= -// function : ActivateUserWiresOnFaceShellSelection() -// purpose : Called when CheckBoxC2_1 state has changed. -// : Only for second constructor ! -// : Prepare selection for wire(s) on main object that is a face or a shell -//================================================================================= -void GeometryGUI_SuppressHoleDlg::ActivateUserWiresOnFaceShellSelection() -{ - - if( !this->myOkShape ) { - this->ResetStateOfDialog() ; - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_MAIN_OBJECT") ) ; - return ; - } - - /* Test the type of viewer VTK */ - if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC ) { - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NOT_FOR_VTK_VIEWER") ) ; - this->ResetStateOfDialog() ; - return; - } - - if( CheckBoxC2_1->isChecked() ) { - /* Local context is opened to prepare GEOM::WIRE(S) selection into 'myShape' that is a (main) face */ - myGeomGUI->PrepareSubShapeSelectionArgumentShape( this->myShape, int(TopAbs_WIRE), this->myLocalContextId ) ; - myUseLocalContext = true ; - myGeomGUI->GetDesktop()->putInfo( tr("GEOM_SUPPRESSHOLE_SELECT_HOLES_ON_FACE") ) ; - } - else { - this->ResetPartial() ; - } - return ; -} - - - -//================================================================================= -// function : FaceFromList() -// purpose : Return the face (selected by user) that is a sub shape of 'aShape' -// : and which unique index is in 'ListOfSub'. -// : This allows opening a local context with this face loaded. -// : See : myGeomGUI->PrepareSubShapeSelectionArgumentShape(...) -//================================================================================= -TopoDS_Shape GeometryGUI_SuppressHoleDlg::FaceFromList( const TopoDS_Shape& aShape, - const GEOM::GEOM_Shape::ListOfSubShapeID& ListOfSub ) -{ - TopoDS_Shape tds ; - tds.Nullify() ; - if( ListOfSub.length() != 1 || aShape.IsNull() ) - return tds ; - - int i = ListOfSub[0] ; - TopExp_Explorer exp ; - int j = 1 ; - for( exp.Init(aShape, TopAbs_FACE); exp.More(); exp.Next() ) { - if(j == i) - return exp.Current() ; - j++ ; - } - return tds ; -} - - - - -//================================================================================= -// function : ResetStateOfDialog() -// purpose : Completely reset the state of method including local context -//================================================================================= -void GeometryGUI_SuppressHoleDlg::ResetStateOfDialog() -{ - this->myOkShape = false ; - this->myEditCurrentArgument->setText("") ; - - /* Partial reset and more ...*/ - this->ResetPartial() ; - - return ; -} - - -//================================================================================= -// function : ResetPartial() -// purpose : Partially reset to keep only main selection -//================================================================================= -void GeometryGUI_SuppressHoleDlg::ResetPartial() -{ - /* Select sub shape modes not checked */ - this->myOkSelectFace = false ; - this->CheckBox1->setChecked( FALSE ); - this->CheckBox2->setChecked( FALSE ); - this->CheckBox3->setChecked( FALSE ); - this->CheckBoxC2_1->setChecked( FALSE ); - - myListOfIdFace->length(0) ; - myListOfIdWire->length(0) ; - myListOfIdEndFace->length(0) ; - - /* Close its local contact if opened */ - if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) { - OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer(); - myIC = v3d->getAISContext(); // myIC = myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getViewerOCC()->getAISContext(); - if( this->myUseLocalContext ) { - myIC->CloseLocalContext(this->myLocalContextId) ; - this->myUseLocalContext = false ; - myGeomGUI->OnDisplayAll(true) ; - } - } - - return ; -} diff --git a/src/GEOMGUI/GeometryGUI_SuppressHoleDlg.h b/src/GEOMGUI/GeometryGUI_SuppressHoleDlg.h deleted file mode 100644 index 3e6e8554a..000000000 --- a/src/GEOMGUI/GeometryGUI_SuppressHoleDlg.h +++ /dev/null @@ -1,162 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_SuppressHoleDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -#ifndef GEOMETRYGUI_SUPPRESSHOLE_H -#define GEOMETRYGUI_SUPPRESSHOLE_H - -#include "SALOME_Selection.h" -#include "GEOM_ShapeTypeFilter.hxx" - -#include -#include - -#include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QCheckBox; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QRadioButton; -class GeometryGUI; - -//================================================================================= -// class : GeometryGUI_SuppressHoleDlg -// purpose : -//================================================================================= -class GeometryGUI_SuppressHoleDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_SuppressHoleDlg( QWidget* parent = 0, - const char* name = 0, - SALOME_Selection* Sel = 0, - Handle (AIS_InteractiveContext) ic = 0, - bool modal = FALSE, - WFlags fl = 0 ); - - ~GeometryGUI_SuppressHoleDlg(); - -private : - - void Init( SALOME_Selection* Sel, Handle (AIS_InteractiveContext) ic ) ; - void closeEvent( QCloseEvent* e ) ; - void enterEvent ( QEvent * ) ; /* Mouse enter the QWidget (to reactivate it) */ - - void ResetStateOfDialog() ; - void ResetPartial() ; - - /* Return the face selected by user from the main shape and index in a ListOfSub */ - TopoDS_Shape FaceFromList( const TopoDS_Shape& aShape, - const GEOM::GEOM_Shape::ListOfSubShapeID& ListOfSub ) ; - - Handle (AIS_InteractiveContext) myIC ; /* Interactive context */ - Standard_Integer myLocalContextId ; /* identify a local context used by this method */ - bool myUseLocalContext ; /* true when this method as opened a local context */ - - GEOM::GEOM_Gen_var myGeom ; /* Current Geom object */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - SALOME_Selection* mySelection ; /* User shape selection */ - - TopoDS_Shape myShape ; /* Main shape selected */ - TopoDS_Shape myFace ; /* Face selected */ - - char* myShapeIOR ; - bool myOkShape ; - - bool myOkSelectFace ; /* true = sub mode GEOM::FACE selection done */ - bool myOkSelectWire ; /* true = sub mode GEOM::WIRE selection done (first wire) */ - - GEOM::GEOM_Shape::ListOfSubShapeID_var myListOfIdFace ; /* After selection contains index of face into myShape */ - GEOM::GEOM_Shape::ListOfSubShapeID_var myListOfIdWire ; /* After selection contains index of wire into myFace */ - GEOM::GEOM_Shape::ListOfSubShapeID_var myListOfIdEndFace ; /* After selection contains index of end face into myShape */ - - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - int myConstructorId ; /* Current constructor id = radio button id */ - - QButtonGroup* GroupConstructors; - QRadioButton* Constructor1; - QGroupBox* GroupButtons; - QPushButton* buttonOk; - QPushButton* buttonApply; - QPushButton* buttonClose; - QGroupBox* GroupC1; - QLabel* TextLabelC1A1; - QPushButton* SelectButtonC1A1; - QLineEdit* LineEditC1A1; - QCheckBox* CheckBox1; - QCheckBox* CheckBox2; - QCheckBox* CheckBox3; - - /* Second constructor */ - QRadioButton* Constructor2; - QGroupBox* GroupC2; - QLabel* TextLabelC2A1; - QPushButton* SelectButtonC2A1; - QLineEdit* LineEditC2A1; - QCheckBox* CheckBoxC2_1; - - -private slots: - - void ConstructorsClicked(int constructorId); - void ClickOnOk(); - void ClickOnApply() ; - void ClickOnClose(); - - void LineEditReturnPressed() ; - void SetEditCurrentArgument() ; - void SelectionIntoArgument() ; - void DeactivateActiveDialog() ; - void ActivateThisDialog() ; - void ActivateUserFaceSelection() ; - void ActivateUserWireSelection() ; - void ActivateUserEndFaceSelection() ; - - /* For the second constructor */ - void ActivateUserWiresOnFaceShellSelection() ; - - -protected: - - QGridLayout* GeometryGUI_SuppressHoleLayout; - QGridLayout* GroupConstructorsLayout; - QHBoxLayout* GroupButtonsLayout; - QGridLayout* GroupC1Layout; - QHBoxLayout* Layout2; - - QGridLayout* GroupC2Layout; - QHBoxLayout* Layout3; -}; - -#endif // GEOMETRYGUI_SUPPRESSHOLE_H diff --git a/src/GEOMGUI/GeometryGUI_TorusDlg.cxx b/src/GEOMGUI/GeometryGUI_TorusDlg.cxx deleted file mode 100644 index 2f521918f..000000000 --- a/src/GEOMGUI/GeometryGUI_TorusDlg.cxx +++ /dev/null @@ -1,400 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_TorusDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_TorusDlg.h" - -#include -#include - -#include "GeometryGUI.h" -#include "QAD_Desktop.h" -#include "QAD_Config.h" - -//================================================================================= -// class : GeometryGUI_TorusDlg() -// purpose : Constructs a GeometryGUI_TorusDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_TorusDlg::GeometryGUI_TorusDlg(QWidget* parent, const char* name, PrimitiveGUI* thePrimitiveGUI, SALOME_Selection* Sel, bool modal, WFlags fl) - :GeometryGUI_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_TORUS_PV"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_TORUS_DXYZ"))); - QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT"))); - - setCaption(tr("GEOM_TORUS_TITLE")); - - /***************************************************************/ - GroupConstructors->setTitle(tr("GEOM_TORUS")); - RadioButton1->setPixmap(image0); - RadioButton2->setPixmap(image1); - RadioButton3->close(TRUE); - - GroupPoints = new GeometryGUI_2Sel2Spin(this, "GroupPoints"); - GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS")); - GroupPoints->TextLabel1->setText(tr("GEOM_BASE_POINT")); - GroupPoints->TextLabel2->setText(tr("GEOM_VECTOR")); - GroupPoints->TextLabel3->setText(tr("GEOM_RADIUS_I").arg("1")); - GroupPoints->TextLabel4->setText(tr("GEOM_RADIUS_I").arg("2")); - GroupPoints->PushButton1->setPixmap(image2); - GroupPoints->PushButton2->setPixmap(image2); - - GroupDimensions = new GeometryGUI_2Spin(this, "GroupDimensions"); - GroupDimensions->GroupBox1->setTitle(tr("GEOM_BOX_OBJ")); - GroupDimensions->TextLabel1->setText(tr("GEOM_RADIUS_I").arg("1")); - GroupDimensions->TextLabel2->setText(tr("GEOM_RADIUS_I").arg("2")); - - Layout1->addWidget(GroupPoints, 1, 0); - Layout1->addWidget(GroupDimensions, 1, 0); - /***************************************************************/ - - /* Initialisations */ - myPrimitiveGUI = thePrimitiveGUI; - Init(); -} - - -//================================================================================= -// function : ~GeometryGUI_TorusDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_TorusDlg::~GeometryGUI_TorusDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_TorusDlg::Init() -{ - /* init variables */ - myConstructorId = 0; - myEditCurrentArgument = GroupPoints->LineEdit1; - - myRadius1 = 300.0; - myRadius2 = 100.0; - myOkRadius1 = myOkRadius2 = true; - myOkPoint1 = myOkDir = false; - - myEdgeFilter = new GEOM_EdgeFilter(StdSelect_Line, myGeom); - myVertexFilter = new GEOM_ShapeTypeFilter(TopAbs_VERTEX, myGeom); - mySelection->AddFilter(myVertexFilter); - - /* Get setting of step value from file configuration */ - QString St = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep"); - step = St.toDouble(); - - /* min, max, step and decimals for spin boxes & initial values */ - GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3); - GroupPoints->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, step, 3); - GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3); - GroupDimensions->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, step, 3); - - GroupPoints->SpinBox_DX->SetValue(myRadius1); - GroupPoints->SpinBox_DY->SetValue(myRadius2); - GroupDimensions->SpinBox_DX->SetValue(myRadius1); - GroupDimensions->SpinBox_DY->SetValue(myRadius2); - - /* signals and slots connections */ - connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); - connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); - connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int))); - - connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); - connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); - - connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); - connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); - - connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(GroupPoints->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(GroupDimensions->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(GroupDimensions->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - - connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; - - /* displays Dialog */ - GroupDimensions->hide(); - GroupPoints->show(); - this->show(); - - return ; -} - - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_TorusDlg::ConstructorsClicked(int constructorId) -{ - myConstructorId = constructorId; - mySelection->ClearFilters(); - myGeomGUI->EraseSimulationShape(); - disconnect(mySelection, 0, this, 0); - myOkRadius1 = myOkRadius2 = true; - myRadius1 = 300.0; - myRadius2 = 100.0; - - switch(myConstructorId) - { - case 0 : - { - GroupDimensions->hide(); - resize(0, 0); - GroupPoints->show(); - myOkPoint1 = myOkDir = false; - - myEditCurrentArgument = GroupPoints->LineEdit1; - GroupPoints->LineEdit1->setText(tr("")); - GroupPoints->LineEdit2->setText(tr("")); - - GroupPoints->SpinBox_DX->SetValue(myRadius1); - GroupPoints->SpinBox_DY->SetValue(myRadius2); - - /* filter for next selection */ - mySelection->AddFilter(myVertexFilter); - connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - break ; - } - case 1 : - { - GroupPoints->hide(); - resize( 0, 0 ); - GroupDimensions->show(); - myOkPoint1 = myOkDir = true; - - GroupDimensions->SpinBox_DX->SetValue(myRadius1); - GroupDimensions->SpinBox_DY->SetValue(myRadius2); - myPoint1.SetCoord(0.0, 0.0, 0.0); - myDir.SetCoord(0.0, 0.0, 1.0); - - MakeTorusSimulationAndDisplay(); - break ; - } - } - return ; -} - - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_TorusDlg::ClickOnOk() -{ - this->ClickOnApply(); - ClickOnCancel(); - return; -} - - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_TorusDlg::ClickOnApply() -{ - myGeomGUI->GetDesktop()->putInfo(tr("")); - if (mySimulationTopoDs.IsNull()) - return; - myGeomGUI->EraseSimulationShape(); - mySimulationTopoDs.Nullify(); - - if(myOkPoint1 && myOkDir && myOkRadius1 && myOkRadius2 ) - myPrimitiveGUI->MakeTorusAndDisplay(myPoint1, myDir, myRadius1, myRadius2); - return ; -} - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -//================================================================================= -void GeometryGUI_TorusDlg::SelectionIntoArgument() -{ - myGeomGUI->EraseSimulationShape(); - myEditCurrentArgument->setText(""); - QString aString = ""; /* name of selection */ - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString); - if (nbSel != 1) { - if(myEditCurrentArgument == GroupPoints->LineEdit1) - myOkPoint1 = false; - else if (myEditCurrentArgument == GroupPoints->LineEdit2) - myOkDir = false; - return; - } - - /* nbSel == 1 */ - TopoDS_Shape S; - if(!myGeomGUI->GetTopoFromSelection(mySelection, S)) - return; - - /* gp_Pnt : not used */ - if (myEditCurrentArgument == GroupPoints->LineEdit1 && myGeomGUI->VertexToPoint(S, myPoint1)) { - GroupPoints->LineEdit1->setText(aString); - myOkPoint1 = true; - } - else if (myEditCurrentArgument == GroupPoints->LineEdit2) { - BRepAdaptor_Curve curv(TopoDS::Edge(S)); - myDir = curv.Line().Direction(); - GroupPoints->LineEdit2->setText(aString); - myOkDir = true; - } - - if(myOkPoint1 && myOkDir && myOkRadius1 && myOkRadius2) - MakeTorusSimulationAndDisplay(); - return; -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_TorusDlg::SetEditCurrentArgument() -{ - if(myConstructorId != 0) - return; - - QPushButton* send = (QPushButton*)sender(); - - if(send == GroupPoints->PushButton1) { - GroupPoints->LineEdit1->setFocus(); - myEditCurrentArgument = GroupPoints->LineEdit1; - mySelection->AddFilter(myVertexFilter); - } - else if(send == GroupPoints->PushButton2) { - GroupPoints->LineEdit2->setFocus(); - myEditCurrentArgument = GroupPoints->LineEdit2; - mySelection->AddFilter(myEdgeFilter); - } - this->SelectionIntoArgument(); - - return; -} - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_TorusDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if(send == GroupPoints->LineEdit1) - myEditCurrentArgument = GroupPoints->LineEdit1; - else if (send == GroupPoints->LineEdit2) - myEditCurrentArgument = GroupPoints->LineEdit2; - else - return; - - GeometryGUI_Skeleton::LineEditReturnPressed(); - return; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_TorusDlg::ActivateThisDialog() -{ - GeometryGUI_Skeleton::ActivateThisDialog(); - connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - if(!mySimulationTopoDs.IsNull()) - myGeomGUI->DisplaySimulationShape(mySimulationTopoDs); - return; -} - - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void GeometryGUI_TorusDlg::enterEvent(QEvent* e) -{ - if (GroupConstructors->isEnabled()) - return; - this->ActivateThisDialog(); - return; -} - - -//================================================================================= -// function : ValueChangedInSpinBox -// purpose : -//================================================================================= -void GeometryGUI_TorusDlg::ValueChangedInSpinBox(double newValue) -{ - myGeomGUI->EraseSimulationShape(); - mySimulationTopoDs.Nullify(); - QObject* send = (QObject*)sender(); - - if(send == GroupPoints->SpinBox_DX || send == GroupDimensions->SpinBox_DX) { - myRadius1 = newValue; - myOkRadius1 = true; - } - else if(send == GroupPoints->SpinBox_DY || send == GroupDimensions->SpinBox_DY) { - myRadius2 = newValue; - myOkRadius2 = true; - } - - if(myOkPoint1 && myOkDir && myOkRadius1 && myOkRadius2) - MakeTorusSimulationAndDisplay(); - return; -} - - -//================================================================================= -// function : MakeTorusSimulationAndDisplay() -// purpose : -//================================================================================= -void GeometryGUI_TorusDlg::MakeTorusSimulationAndDisplay() -{ - myGeomGUI->EraseSimulationShape(); - mySimulationTopoDs.Nullify(); - - try { - gp_Ax2 anAxis(this->myPoint1, this->myDir); - mySimulationTopoDs = BRepPrimAPI_MakeTorus(anAxis, this->myRadius1, this->myRadius2).Shape(); - myGeomGUI->DisplaySimulationShape(mySimulationTopoDs); - } - catch(Standard_Failure) { - MESSAGE("Exception catched in MakeTorusSimulationAndDisplay"); - } - return; -} diff --git a/src/GEOMGUI/GeometryGUI_TorusDlg.h b/src/GEOMGUI/GeometryGUI_TorusDlg.h deleted file mode 100644 index 64d9400c4..000000000 --- a/src/GEOMGUI/GeometryGUI_TorusDlg.h +++ /dev/null @@ -1,92 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_TorusDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_TORUS_H -#define DIALOGBOX_TORUS_H - -#include "GeometryGUI_Skeleton.h" -#include "GeometryGUI_2Sel2Spin.h" -#include "GeometryGUI_2Spin.h" - -#include "PrimitiveGUI.h" - -#include "GEOM_EdgeFilter.hxx" - -#include -#include - -//================================================================================= -// class : GeometryGUI_TorusDlg -// purpose : -//================================================================================= -class GeometryGUI_TorusDlg : public GeometryGUI_Skeleton -{ - Q_OBJECT - -public: - GeometryGUI_TorusDlg(QWidget* parent = 0, const char* name = 0, PrimitiveGUI* thePrimitiveGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0); - ~GeometryGUI_TorusDlg(); - -private: - void Init(); - void enterEvent(QEvent* e); - void MakeTorusSimulationAndDisplay(); - - PrimitiveGUI* myPrimitiveGUI; - - double step; - int myConstructorId; - Handle(GEOM_ShapeTypeFilter) myVertexFilter; - Handle(GEOM_EdgeFilter) myEdgeFilter; /* Filter selection */ - - gp_Pnt myPoint1; /* topology used */ - gp_Dir myDir; - bool myOkPoint1; /* to check when arguments is defined */ - bool myOkDir; - - Standard_Real myRadius1; - Standard_Real myRadius2; - bool myOkRadius1; - bool myOkRadius2; - - GeometryGUI_2Sel2Spin* GroupPoints; - GeometryGUI_2Spin* GroupDimensions; - -private slots: - void ClickOnOk(); - void ClickOnApply(); - void ActivateThisDialog(); - void LineEditReturnPressed(); - void SelectionIntoArgument(); - void SetEditCurrentArgument(); - void ConstructorsClicked(int constructorId); - void ValueChangedInSpinBox(double newValue); - -}; - -#endif // DIALOGBOX_TORUS_H diff --git a/src/GEOMGUI/GeometryGUI_TranslationDlg.cxx b/src/GEOMGUI/GeometryGUI_TranslationDlg.cxx deleted file mode 100644 index 9363938cb..000000000 --- a/src/GEOMGUI/GeometryGUI_TranslationDlg.cxx +++ /dev/null @@ -1,563 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_TranslationDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_TranslationDlg.h" - -#include "GeometryGUI.h" -#include "QAD_Application.h" -#include "QAD_Config.h" -#include "QAD_Desktop.h" -#include "utilities.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - - -//================================================================================= -// class : GeometryGUI_TranslationDlg() -// purpose : Constructs a GeometryGUI_TranslationDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_TranslationDlg::GeometryGUI_TranslationDlg( QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_TRANSLATION"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - - if ( !name ) - setName( "GeometryGUI_TranslationDlg" ); - resize( 303, 219 ); - setCaption( tr( "GEOM_TRANSLATION_TITLE" ) ); - setSizeGripEnabled( TRUE ); - GeometryGUI_TranslationDlgLayout = new QGridLayout( this ); - GeometryGUI_TranslationDlgLayout->setSpacing( 6 ); - GeometryGUI_TranslationDlgLayout->setMargin( 11 ); - - /***************************************************************/ - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "GEOM_TRANSLATION" ) ); - GroupConstructors->setExclusive( TRUE ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setText( tr( "" ) ); - Constructor1->setPixmap( image0 ); - Constructor1->setChecked( TRUE ); - Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) ); - Constructor1->setMinimumSize( QSize( 50, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer, 0, 1 ); - GeometryGUI_TranslationDlgLayout->addWidget( GroupConstructors, 0, 0 ); - - GroupC1 = new QGroupBox( this, "GroupC1" ); - GroupC1->setTitle( tr( "GEOM_TRANSLATION" ) ) ; - GroupC1->setMinimumSize( QSize( 0, 0 ) ); - GroupC1->setFrameShape( QGroupBox::Box ); - GroupC1->setFrameShadow( QGroupBox::Sunken ); - GroupC1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)5, GroupC1->sizePolicy().hasHeightForWidth() ) ); - GroupC1->setColumnLayout(0, Qt::Vertical ); - GroupC1->layout()->setSpacing( 0 ); - GroupC1->layout()->setMargin( 0 ); - GroupC1Layout = new QGridLayout( GroupC1->layout() ); - GroupC1Layout->setAlignment( Qt::AlignTop ); - GroupC1Layout->setSpacing( 6 ); - GroupC1Layout->setMargin( 11 ); - - TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" ); - TextLabelC1A1->setText( tr( "GEOM_OBJECT" ) ); - TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A1->setFrameShape( QLabel::NoFrame ); - TextLabelC1A1->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabelC1A1, 0, 0 ); - - SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" ); - SelectButtonC1A1->setText( tr( "" ) ); - SelectButtonC1A1->setPixmap( image1 ); - SelectButtonC1A1->setToggleButton( FALSE ); - SelectButtonC1A1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, SelectButtonC1A1->sizePolicy().hasHeightForWidth() ) ); - GroupC1Layout->addWidget( SelectButtonC1A1, 0, 1 ); - - LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" ); - GroupC1Layout->addWidget( LineEditC1A1, 0, 2 ); - - Layout1 = new QHBoxLayout; - Layout1->setSpacing( 6 ); - Layout1->setMargin( 0 ); - - TextLabel_DX = new QLabel( GroupC1, "TextLabel_DX" ); - TextLabel_DX->setText( tr( "GEOM_DX" ) ); - Layout1->addWidget( TextLabel_DX ); - - SpinBox_DX = new GeometryGUI_SpinBox( GroupC1, "SpinBox_DX" ); - SpinBox_DX->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, SpinBox_DX->sizePolicy().hasHeightForWidth() ) ); - Layout1->addWidget( SpinBox_DX ); - - TextLabel_DY = new QLabel( GroupC1, "TextLabel_DY" ); - TextLabel_DY->setText( tr( "GEOM_DY" ) ); - Layout1->addWidget( TextLabel_DY ); - - SpinBox_DY = new GeometryGUI_SpinBox( GroupC1, "SpinBox_DY" ); - SpinBox_DY->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, SpinBox_DY->sizePolicy().hasHeightForWidth() ) ); - Layout1->addWidget( SpinBox_DY ); - - TextLabel_DZ = new QLabel( GroupC1, "TextLabel_DZ" ); - TextLabel_DZ->setText( tr( "GEOM_DZ" ) ); - Layout1->addWidget( TextLabel_DZ ); - - SpinBox_DZ = new GeometryGUI_SpinBox( GroupC1, "SpinBox_DZ" ); - SpinBox_DZ->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, SpinBox_DZ->sizePolicy().hasHeightForWidth() ) ); - Layout1->addWidget( SpinBox_DZ ); - - GroupC1Layout->addMultiCellLayout( Layout1, 1, 1, 0, 2 ); - - GeometryGUI_TranslationDlgLayout->addWidget( GroupC1, 1, 0 ); - - - /***************************************************************/ - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); - GroupButtons->setTitle( tr( "" ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 3 ); - buttonApply = new QPushButton( GroupButtons, "buttonApply" ); - buttonApply->setText( tr( "GEOM_BUT_APPLY" ) ); - buttonApply->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonApply, 0, 1 ); - QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_9, 0, 2 ); - buttonOk = new QPushButton( GroupButtons, "buttonOk" ); - buttonOk->setText( tr( "GEOM_BUT_OK" ) ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - GeometryGUI_TranslationDlgLayout->addWidget( GroupButtons, 2, 0 ); - /***************************************************************/ - - Init(Sel) ; /* Initialisations */ -} - - - -//================================================================================= -// function : ~GeometryGUI_TranslationDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_TranslationDlg::~GeometryGUI_TranslationDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_TranslationDlg::Init( SALOME_Selection* Sel ) -{ - double step ; - QString St = QAD_CONFIG->getSetting( "Geometry:SettingsGeomStep" ) ; - step = St.toDouble() ; - - /* min, max, step and decimals for spin boxes */ - SpinBox_DX->RangeStepAndValidator( -999.999, 999.999, step, 3 ) ; - SpinBox_DX->SetValue( 100.0 ) ; - SpinBox_DY->RangeStepAndValidator( -999.999, 999.999, step, 3 ) ; - SpinBox_DY->SetValue( 100.0 ) ; - SpinBox_DZ->RangeStepAndValidator( -999.999, 999.999, step, 3 ) ; - SpinBox_DZ->SetValue( 100.0 ) ; - - GroupC1->show(); - myConstructorId = 0 ; - Constructor1->setChecked( TRUE ); - myEditCurrentArgument = LineEditC1A1 ; - mySelection = Sel; - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - myOkBase = false ; - - this->myVec.SetCoord( 100.0, 100.0, 100.0 ) ; - mySimulationTopoDs.Nullify() ; - myBase.Nullify() ; - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - - // TODO : previous selection into argument ? - - /* Filter definitions */ - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - // myEdgeFilter = new GEOM_ShapeTypeFilter( TopAbs_EDGE, myGeom ); - - /* signals and slots connections */ - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ; - connect( buttonApply, SIGNAL( clicked() ), this, SLOT(ClickOnApply() ) ); - connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) ); - connect( SelectButtonC1A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - - connect( SpinBox_DX, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ; - connect( SpinBox_DY, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ; - connect( SpinBox_DZ, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ; - - connect( LineEditC1A1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - - connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ; - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - /* to close dialog if study change */ - connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ; - - /* Move widget on the botton right corner of main widget */ - int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; - this->show() ; /* displays Dialog */ - - return ; -} - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_TranslationDlg::ConstructorsClicked(int constructorId) -{ - // myGeomGUI->EraseSimulationShape() ; - switch (constructorId) - { - case 0: - { - break; - } - case 1: - { - break; - } - } - return ; -} - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_TranslationDlg::ClickOnOk() -{ - this->ClickOnApply() ; - this->ClickOnCancel() ; - - return ; -} - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_TranslationDlg::ClickOnApply() -{ - myGeomGUI->EraseSimulationShape() ; - myGeomGUI->GetDesktop()->putInfo( tr("") ) ; - mySimulationTopoDs.Nullify() ; - switch(myConstructorId) - { - case 0 : - { - if(myOkBase) { - myGeomGUI->MakeTranslationAndDisplay( myGeomShape, myVec ) ; - } - break ; - } - case 1 : - { - break ; - } - } - - // accept(); - return ; -} - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void GeometryGUI_TranslationDlg::ClickOnCancel() -{ - mySelection->ClearFilters() ; - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->ResetState() ; - reject() ; - return ; -} - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -//================================================================================= -void GeometryGUI_TranslationDlg::SelectionIntoArgument() -{ - myEditCurrentArgument->setText("") ; - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - - /* Future name of selection */ - QString aString = ""; - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; - if ( nbSel != 1 ) { - if ( myEditCurrentArgument == LineEditC1A1 ) { - LineEditC1A1->setText("") ; - myOkBase = false ; - } - return ; - } - - /* nbSel == 1 ! */ - TopoDS_Shape S; - Standard_Boolean testResult ; - Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject() ; - - if( !myGeomGUI->GetTopoFromSelection(mySelection, S) ) - return ; - - if ( myConstructorId == 0 && myEditCurrentArgument == LineEditC1A1 ) { - myGeomShape = myGeomGUI->ConvertIOinGEOMShape(IO, testResult) ; - if( !testResult ) - return ; - LineEditC1A1->setText(aString) ; - myBase = S ; - myOkBase = true ; - } - - if( myOkBase ) { - MakeTranslationSimulationAndDisplay() ; - } - return ; -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_TranslationDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - switch (myConstructorId) - { - case 0: /* default constructor */ - { - if(send == SelectButtonC1A1) { - LineEditC1A1->setFocus() ; - myEditCurrentArgument = LineEditC1A1 ; - SelectionIntoArgument() ; - } - break; - } - case 1: - { - break; - } - } - return ; -} - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_TranslationDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if( send == LineEditC1A1 ) - myEditCurrentArgument = LineEditC1A1 ; - else - return ; - - /* User name of object input management */ - /* If successfull the selection is changed and signal emitted... */ - /* so SelectionIntoArgument() is automatically called. */ - const QString objectUserName = myEditCurrentArgument->text() ; - QWidget* thisWidget = (QWidget*)this ; - if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) { - myEditCurrentArgument->setText( objectUserName ) ; - } - return ; -} - - - -//================================================================================= -// function : ValueChangedInSpinBox() -// purpose : -//================================================================================= -void GeometryGUI_TranslationDlg::ValueChangedInSpinBox( double newValue ) -{ - - QObject* send = (QObject*)sender() ; - Standard_Real Dx, Dy, Dz ; - - if( send == SpinBox_DX ) { - Dx = newValue ; - Dy = SpinBox_DY->GetValue() ; - Dz = SpinBox_DZ->GetValue() ; - } else if( send == SpinBox_DY ) { - Dx = SpinBox_DX->GetValue() ; - Dy = newValue ; - Dz = SpinBox_DZ->GetValue() ; - } else if( send == SpinBox_DZ ) { - Dx = SpinBox_DX->GetValue() ; - Dy = SpinBox_DY->GetValue() ; - Dz = newValue ; - } - - this->myVec.SetCoord(Dx, Dy, Dz) ; - if ( myOkBase ) { - MakeTranslationSimulationAndDisplay() ; - } - else { - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - } - return ; -} - - - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void GeometryGUI_TranslationDlg::DeactivateActiveDialog() -{ - if ( GroupConstructors->isEnabled() ) { - GroupConstructors->setEnabled(false) ; - GroupC1->setEnabled(false) ; - GroupButtons->setEnabled(false) ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->EraseSimulationShape() ; - mySelection->ClearFilters() ; - } - return ; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_TranslationDlg::ActivateThisDialog() -{ - /* Emit a signal to deactivate the active dialog */ - myGeomGUI->EmitSignalDeactivateDialog() ; - GroupConstructors->setEnabled(true) ; - GroupC1->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - - connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - if( !mySimulationTopoDs.IsNull() ) - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - - return ; -} - - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void GeometryGUI_TranslationDlg::enterEvent(QEvent* e) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; -} - - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_TranslationDlg::closeEvent( QCloseEvent* e ) -{ - /* same than click on cancel button */ - this->ClickOnCancel() ; - return ; -} - - -//================================================================================= -// function : MakeTranslationSimulationAndDisplay() -// purpose : -//================================================================================= -void GeometryGUI_TranslationDlg::MakeTranslationSimulationAndDisplay() -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - - gp_Trsf theTransformation ; - theTransformation.SetTranslation(this->myVec) ; - - BRepBuilderAPI_Transform myBRepTransformation(this->myBase, theTransformation, Standard_False) ; - mySimulationTopoDs = myBRepTransformation.Shape() ; - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - return ; -} diff --git a/src/GEOMGUI/GeometryGUI_TranslationDlg.h b/src/GEOMGUI/GeometryGUI_TranslationDlg.h deleted file mode 100644 index 617bc4802..000000000 --- a/src/GEOMGUI/GeometryGUI_TranslationDlg.h +++ /dev/null @@ -1,127 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_TranslationDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_TRANSLATION_H -#define DIALOGBOX_TRANSLATION_H - -#include "SALOME_Selection.h" -#include "GEOM_ShapeTypeFilter.hxx" -#include "GeometryGUI_SpinBox.h" - -#include -#include -#include - -#include -#include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QRadioButton; -class GeometryGUI; - - -//================================================================================= -// class : GeometryGUI_TranslationDlg -// purpose : -//================================================================================= -class GeometryGUI_TranslationDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_TranslationDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 ); - ~GeometryGUI_TranslationDlg(); - -private : - - GEOM::GEOM_Gen_var myGeom ; /* Current Geom object */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - TopoDS_Shape mySimulationTopoDs; /* Shape used for simulation display */ - SALOME_Selection* mySelection ; /* User shape selection */ - TopoDS_Shape myBase ; - GEOM::GEOM_Shape_var myGeomShape ; /* is myBase */ - bool myOkBase ; - gp_Vec myVec ; - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - int myConstructorId ; /* Current constructor id = radio button id */ - Handle(GEOM_ShapeTypeFilter) myEdgeFilter; /* Filter selection */ - - void closeEvent( QCloseEvent* e ) ; - void enterEvent( QEvent* e); - void Init( SALOME_Selection* Sel ) ; - void MakeTranslationSimulationAndDisplay() ; - - QButtonGroup* GroupConstructors; - QRadioButton* Constructor1; - QGroupBox* GroupC1; - QLabel* TextLabel_DX; - QLabel* TextLabel_DY; - QLabel* TextLabel_DZ; - - GeometryGUI_SpinBox* SpinBox_DX ; - GeometryGUI_SpinBox* SpinBox_DY ; - GeometryGUI_SpinBox* SpinBox_DZ ; - - QLabel* TextLabelC1A1; - QPushButton* SelectButtonC1A1; - QLineEdit* LineEditC1A1; - QGroupBox* GroupButtons; - QPushButton* buttonOk; - QPushButton* buttonCancel; - QPushButton* buttonApply; - -private slots: - - void ConstructorsClicked(int constructorId); - void ClickOnOk(); - void ClickOnCancel(); - void ClickOnApply(); - void SetEditCurrentArgument() ; - void SelectionIntoArgument() ; - void LineEditReturnPressed() ; - void DeactivateActiveDialog() ; - void ActivateThisDialog() ; - void ValueChangedInSpinBox( double newValue ) ; - -protected: - QGridLayout* GeometryGUI_TranslationDlgLayout; - QGridLayout* GroupConstructorsLayout; - QGridLayout* GroupC1Layout; - QGridLayout* GroupButtonsLayout; - - QHBoxLayout* Layout1 ; -}; - -#endif // DIALOGBOX_TRANSLATION_H diff --git a/src/GEOMGUI/GeometryGUI_TransparencyDlg.cxx b/src/GEOMGUI/GeometryGUI_TransparencyDlg.cxx deleted file mode 100644 index 8925aeb1a..000000000 --- a/src/GEOMGUI/GeometryGUI_TransparencyDlg.cxx +++ /dev/null @@ -1,249 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_TransparencyDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM - -using namespace std; -#include "GeometryGUI_TransparencyDlg.h" -#include "GeometryGUI.h" - -#include "QAD_RightFrame.h" -#include "SALOME_ListIteratorOfListIO.hxx" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "VTKViewer_ViewFrame.h" -#include "VTKViewer_RenderWindowInteractor.h" - -//================================================================================= -// class : GeometryGUI_TransparencyDlg() -// purpose : Constructs a GeometryGUI_SUBSHAPE which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// -// : WARNING : this dialog is modal ! -// -//================================================================================= -GeometryGUI_TransparencyDlg::GeometryGUI_TransparencyDlg( QWidget* parent, - const char* name, - SALOME_Selection* Sel, - const Handle(AIS_InteractiveContext)& ic, - bool modal, - WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - if ( !name ) - setName( "GeometryGUI_TransparencyDlg" ); - resize( 152, 107 ); - setCaption( tr( "GEOM_TRANSPARENCY_TITLE" ) ); - setSizeGripEnabled( TRUE ); - GeometryGUI_TransparencyDlgLayout = new QGridLayout( this ); - GeometryGUI_TransparencyDlgLayout->setSpacing( 6 ); - GeometryGUI_TransparencyDlgLayout->setMargin( 11 ); - - /*************************************************************************/ - QGroupBox* GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - - buttonOk = new QPushButton( GroupButtons, "buttonOk" ); - buttonOk->setText( tr( "GEOM_BUT_OK" ) ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); - GroupButtonsLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 0 ); - GroupButtonsLayout->addWidget( buttonOk, 0, 1 ); - GroupButtonsLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 2 ); - - /*************************************************************************/ - QGroupBox* GroupC1 = new QGroupBox( this, "GroupC1" ); - GroupC1->setColumnLayout(0, Qt::Vertical ); - GroupC1->layout()->setSpacing( 0 ); - GroupC1->layout()->setMargin( 0 ); - QGridLayout* GroupC1Layout = new QGridLayout( GroupC1->layout() ); - GroupC1Layout->setAlignment( Qt::AlignTop ); - GroupC1Layout->setSpacing( 6 ); - GroupC1Layout->setMargin( 11 ); - - TextLabelOpaque = new QLabel( GroupC1, "TextLabelOpaque" ); - TextLabelOpaque->setText( tr( "GEOM_TRANSPARENCY_OPAQUE" ) ); - TextLabelOpaque->setAlignment( int( QLabel::AlignLeft ) ); - GroupC1Layout->addWidget( TextLabelOpaque, 0, 0 ); - GroupC1Layout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 ); - - TextLabelTransparent = new QLabel( GroupC1, "TextLabelTransparent" ); - TextLabelTransparent->setText( tr( "GEOM_TRANSPARENCY_TRANSPARENT" ) ); - TextLabelTransparent->setAlignment( int( QLabel::AlignRight ) ); - GroupC1Layout->addWidget( TextLabelTransparent, 0, 2 ); - - Slider1 = new QSlider( 0, 10, 1, 5, Horizontal, GroupC1, "Slider1" ); - Slider1->setMinimumSize( 300, 0 ); - Slider1->setTickmarks( QSlider::Left ); - GroupC1Layout->addMultiCellWidget( Slider1, 1, 1, 0, 2 ); - /*************************************************************************/ - - GeometryGUI_TransparencyDlgLayout->addWidget( GroupC1, 0, 0 ); - GeometryGUI_TransparencyDlgLayout->addWidget( GroupButtons, 1, 0 ); - - /* Initialisations */ - this->myGeomGUI = GeometryGUI::GetGeometryGUI() ; - this->myIc = ic ; - this->mySel = Sel ; - - /* First call valueChanged() method for initialisation */ - /* The default value of transparency will change with the selection */ - this->myFirstInit = true ; -// Slider1->setMaxValue( 10 ); -// Slider1->setValue( 5 ) ; - this->ValueHasChanged( Slider1->value() ) ; - - // signals and slots connections : after ValueHasChanged() - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); - connect( Slider1, SIGNAL( valueChanged(int) ), this, SLOT( ValueHasChanged(int) ) ); - - /* Move widget on the botton right corner of main widget */ - int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; - this->show() ; /* Displays this Dialog */ -} - - - - -//================================================================================= -// function : ~GeometryGUI_TransparencyDlg() -// purpose : -//================================================================================= -GeometryGUI_TransparencyDlg::~GeometryGUI_TransparencyDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - - -//======================================================================= -// function : ClickOnOk() -// purpose : -//======================================================================= -void GeometryGUI_TransparencyDlg::ClickOnOk() -{ - accept() ; - return ; -} - - -//======================================================================= -// function : ClickOnClose() -// purpose : -//======================================================================= -void GeometryGUI_TransparencyDlg::ClickOnClose() -{ - accept() ; - return ; -} - - -//================================================================================= -// function : ValueHasChanged() -// purpose : Called when value of slider change -// : or the first time as initilisation -//================================================================================= -void GeometryGUI_TransparencyDlg::ValueHasChanged( int newValue ) -{ - - if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK ) { - // VTK - // vtkQGLRenderWindowInteractor* myRenderInter= myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getVTKView()->getRWInteractor(); - VTKViewer_RenderWindowInteractor* myRenderInter= ((VTKViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor(); - SALOME_ListIteratorOfListIO It( this->mySel->StoredIObjects() ); - - Handle(SALOME_InteractiveObject) FirstIOS = mySel->firstIObject(); - if( !FirstIOS.IsNull() ) { - - /* The first time as initialisation */ - if( this->myFirstInit ) { - this->myFirstInit = false ; - float transp = ( myRenderInter->GetTransparency(FirstIOS))*10.0 ; - this->Slider1->setValue( int(transp) ) ; - } - } - - QApplication::setOverrideCursor( Qt::waitCursor ); - for( ;It.More(); It.Next() ) { - Handle(SALOME_InteractiveObject) IOS = It.Value(); - myRenderInter->SetTransparency( IOS, newValue/10.0 ); - } - QApplication::restoreOverrideCursor(); - } - - else if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) { - // OCC - SALOME_ListIteratorOfListIO It( this->mySel->StoredIObjects() ); - Handle(SALOME_InteractiveObject) FirstIOS = mySel->firstIObject() ; - if( !FirstIOS.IsNull() ) { - - /* The first time as initialisation */ - if( this->myFirstInit ) { - this->myFirstInit = false ; - Standard_Boolean found; - Handle(GEOM_AISShape) Shape = myGeomGUI->ConvertIOinGEOMAISShape(FirstIOS, found); - if( !found ) { - return ; - } - float transp = ( int( Shape->Transparency() * 10.0 + 0.001) ); - this->Slider1->setValue(int(transp) ) ; - return ; - } - } - - QApplication::setOverrideCursor( Qt::waitCursor ); - for( ;It.More(); It.Next() ) { - Handle(SALOME_InteractiveObject) IObject = It.Value(); - Standard_Boolean found; - Handle(GEOM_AISShape) Shape = myGeomGUI->ConvertIOinGEOMAISShape(IObject, found); - if( !found ) { - QApplication::restoreOverrideCursor(); - return ; - } - this->myIc->SetTransparency( Shape, newValue / 10.0, false ); - myIc->Redisplay( Shape, Standard_False, Standard_True ); - } - myIc->UpdateCurrentViewer(); - } - QApplication::restoreOverrideCursor(); - return ; -} diff --git a/src/GEOMGUI/GeometryGUI_TransparencyDlg.h b/src/GEOMGUI/GeometryGUI_TransparencyDlg.h deleted file mode 100644 index c9a2c2046..000000000 --- a/src/GEOMGUI/GeometryGUI_TransparencyDlg.h +++ /dev/null @@ -1,96 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_TransparencyDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_TRANSPARENCYDLG_H -#define DIALOGBOX_TRANSPARENCYDLG_H - -#include -#include - -#include "SALOME_Selection.h" -#include "SALOME_InteractiveObject.hxx" -#include "GEOM_InteractiveObject.hxx" -#include "GEOM_AISShape.hxx" - - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QFrame; -class QLabel; -class QPushButton; -class QSlider; -class GeometryGUI; - - - -//================================================================================= -// class : GeometryGUI_TransparencyDlg -// purpose : -// : WARNING : that is a MODAL dialog. -//================================================================================= -class GeometryGUI_TransparencyDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_TransparencyDlg( QWidget* parent = 0, - const char* name = 0, - SALOME_Selection* Sel = 0, - const Handle(AIS_InteractiveContext)& ic = 0, - bool modal = TRUE, - WFlags fl = 0 ); - - ~GeometryGUI_TransparencyDlg(); - -private : - - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - bool myFirstInit ; /* Inform for the first init */ - SALOME_Selection* mySel; /* User selection */ - Handle(AIS_InteractiveContext) myIc ; /* Interactive context */ - - QPushButton* buttonOk; - QLabel* TextLabelOpaque; - QLabel* TextLabelTransparent; - QSlider* Slider1; - -public slots: - - void ClickOnOk(); - void ClickOnClose(); - void ValueHasChanged( int newValue ) ; - -protected: - QGridLayout* GeometryGUI_TransparencyDlgLayout; - QHBoxLayout* Layout1; - QHBoxLayout* Layout2; -}; - -#endif // DIALOGBOX_TRANSPARENCYDLG_H - diff --git a/src/GEOMGUI/GeometryGUI_VectorDlg.cxx b/src/GEOMGUI/GeometryGUI_VectorDlg.cxx deleted file mode 100644 index 7be8439a4..000000000 --- a/src/GEOMGUI/GeometryGUI_VectorDlg.cxx +++ /dev/null @@ -1,708 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_VectorDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_VectorDlg.h" - -#include "GeometryGUI.h" -#include "QAD_Application.h" -#include "QAD_Desktop.h" -#include "QAD_Config.h" -#include "utilities.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - - - -//================================================================================= -// class : GeometryGUI_VectorDlg() -// purpose : Constructs a GeometryGUI_VectorDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_VectorDlg::GeometryGUI_VectorDlg( QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_VECTOR_2P"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_VECTOR_DXYZ"))); - - if ( !name ) - setName( "GeometryGUI_VectorDlg" ); - resize( 303, 221 ); - setCaption( tr( "GEOM_VECTOR_TITLE" ) ); - setSizeGripEnabled( TRUE ); - GeometryGUI_VectorDlgLayout = new QGridLayout( this ); - GeometryGUI_VectorDlgLayout->setSpacing( 6 ); - GeometryGUI_VectorDlgLayout->setMargin( 11 ); - - /***************************************************************/ - GroupPoints = new QGroupBox( this, "GroupPoints" ); - GroupPoints->setGeometry( QRect( 10, 10, 280, 90 ) ); - GroupPoints->setTitle( tr( "GEOM_POINTS" ) ); - GroupPoints->setFrameShape( QGroupBox::Box ); - GroupPoints->setFrameShadow( QGroupBox::Sunken ); - GroupPoints->setColumnLayout(0, Qt::Vertical ); - GroupPoints->layout()->setSpacing( 0 ); - GroupPoints->layout()->setMargin( 0 ); - GroupPointsLayout = new QGridLayout( GroupPoints->layout() ); - GroupPointsLayout->setAlignment( Qt::AlignTop ); - GroupPointsLayout->setSpacing( 6 ); - GroupPointsLayout->setMargin( 11 ); - SelectButtonPt2 = new QPushButton( GroupPoints, "SelectButtonPt2" ); - SelectButtonPt2->setText( tr( "" ) ); - SelectButtonPt2->setPixmap( image1 ); - GroupPointsLayout->addWidget( SelectButtonPt2, 1, 1 ); - LineEditPt1 = new QLineEdit( GroupPoints, "LineEditPt1" ); - GroupPointsLayout->addWidget( LineEditPt1, 0, 2 ); - LineEditPt2 = new QLineEdit( GroupPoints, "LineEditPt2" ); - GroupPointsLayout->addWidget( LineEditPt2, 1, 2 ); - SelectButtonPt1 = new QPushButton( GroupPoints, "SelectButtonPt1" ); - SelectButtonPt1->setText( tr( "" ) ); - SelectButtonPt1->setPixmap( image1 ); - SelectButtonPt1->setToggleButton( FALSE ); - GroupPointsLayout->addWidget( SelectButtonPt1, 0, 1 ); - TextLabelPt1 = new QLabel( GroupPoints, "TextLabelPt1" ); - TextLabelPt1->setText( tr( "GEOM_POINT_I" ).arg("1") ); - TextLabelPt1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelPt1->setFrameShape( QLabel::NoFrame ); - TextLabelPt1->setFrameShadow( QLabel::Plain ); - GroupPointsLayout->addWidget( TextLabelPt1, 0, 0 ); - TextLabelPt2 = new QLabel( GroupPoints, "TextLabelPt2" ); - TextLabelPt2->setText( tr( "GEOM_POINT_I" ).arg("2") ); - TextLabelPt2->setMinimumSize( QSize( 50, 0 ) ); - GroupPointsLayout->addWidget( TextLabelPt2, 1, 0 ); - GeometryGUI_VectorDlgLayout->addWidget( GroupPoints, 1, 0 ); - - /***************************************************************/ - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); - GroupButtons->setTitle( tr( "" ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 3 ); - buttonApply = new QPushButton( GroupButtons, "buttonApply" ); - buttonApply->setText( tr( "GEOM_BUT_APPLY" ) ); - buttonApply->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonApply, 0, 1 ); - QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_9, 0, 2 ); - buttonOk = new QPushButton( GroupButtons, "buttonOk" ); - buttonOk->setText( tr( "GEOM_BUT_OK" ) ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - GeometryGUI_VectorDlgLayout->addWidget( GroupButtons, 2, 0 ); - - /***************************************************************/ - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "GEOM_VECTOR" ) ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setText( tr( "" ) ); - Constructor1->setChecked( TRUE ); - Constructor1->setPixmap( image0 ); - Constructor1->setMinimumSize( QSize( 50, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer_2, 0, 3 ); - Constructor2 = new QRadioButton( GroupConstructors, "Constructor2" ); - Constructor2->setText( tr( "" ) ); - Constructor2->setPixmap( image2 ); - Constructor2->setMinimumSize( QSize( 50, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor2, 0, 2 ); - QSpacerItem* spacer_3 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer_3, 0, 1 ); - GeometryGUI_VectorDlgLayout->addWidget( GroupConstructors, 0, 0 ); - - /***************************************************************/ - GroupCoordinates = new QGroupBox( this, "GroupCoordinates" ); - GroupCoordinates->setGeometry( QRect( 10, 70, 280, 80 ) ); - GroupCoordinates->setTitle( tr( "GEOM_COORDINATES" ) ); - GroupCoordinates->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, GroupCoordinates->sizePolicy().hasHeightForWidth() ) ); - GroupCoordinates->setColumnLayout(0, Qt::Vertical ); - GroupCoordinates->layout()->setSpacing( 0 ); - GroupCoordinates->layout()->setMargin( 0 ); - GroupCoordinatesLayout = new QGridLayout( GroupCoordinates->layout() ); - GroupCoordinatesLayout->setAlignment( Qt::AlignTop ); - GroupCoordinatesLayout->setSpacing( 6 ); - GroupCoordinatesLayout->setMargin( 11 ); - - TextLabel_DZ = new QLabel( GroupCoordinates, "TextLabel_DZ" ); - TextLabel_DZ->setText( tr( "GEOM_DZ" ) ); - GroupCoordinatesLayout->addWidget( TextLabel_DZ, 0, 4 ); - TextLabel_DY = new QLabel( GroupCoordinates, "TextLabel_DY" ); - TextLabel_DY->setText( tr( "GEOM_DY" ) ); - GroupCoordinatesLayout->addWidget( TextLabel_DY, 0, 2 ); - TextLabel_DX = new QLabel( GroupCoordinates, "TextLabel_DX" ); - TextLabel_DX->setText( tr( "GEOM_DX" ) ); - GroupCoordinatesLayout->addWidget( TextLabel_DX, 0, 0 ); - - /* Spin boxes construction */ - SpinBox_DX = new GeometryGUI_SpinBox( GroupCoordinates, "GeomSpinBox_DX" ) ; - GroupCoordinatesLayout->addWidget( SpinBox_DX, 0, 1 ); - SpinBox_DY = new GeometryGUI_SpinBox( GroupCoordinates, "GeomSpinBox_DY" ) ; - GroupCoordinatesLayout->addWidget( SpinBox_DY, 0, 3 ); - SpinBox_DZ = new GeometryGUI_SpinBox( GroupCoordinates, "GeomSpinBox_DZ" ) ; - GroupCoordinatesLayout->addWidget( SpinBox_DZ, 0, 5 ); - - QSpacerItem* spacer2 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Minimum ); - GroupCoordinatesLayout->addItem( spacer2, 1, 3 ); - - /* QCheckBox to reverse vector */ - CheckBoxReverseVector = new QCheckBox( GroupCoordinates, "CheckBoxReverseVector" ); - CheckBoxReverseVector->setText( tr( "GEOM_REVERSE_VECTOR" ) ); - GroupCoordinatesLayout->addMultiCellWidget( CheckBoxReverseVector, 1, 1, 1, 5 ); - /* same position than GroupPoints */ - GeometryGUI_VectorDlgLayout->addWidget( GroupCoordinates, 1, 0 ); - - Init(Sel) ; /* Initialisations */ - -} - - -//================================================================================= -// function : ~GeometryGUI_VectorDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_VectorDlg::~GeometryGUI_VectorDlg() -{ - /* no need to delete child widgets, Qt does it all for us */ -} - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_VectorDlg::Init( SALOME_Selection* Sel ) -{ - - double step ; - QString St = QAD_CONFIG->getSetting( "Geometry:SettingsGeomStep" ) ; - step = St.toDouble() ; - - /* min, max, step and decimals for spin boxes */ - SpinBox_DX->RangeStepAndValidator( -999.999, 999.999, step, 3 ) ; - SpinBox_DX->SetValue( 0.0 ) ; - SpinBox_DY->RangeStepAndValidator( -999.999, 999.999, step, 3 ) ; - SpinBox_DY->SetValue( 0.0 ) ; - SpinBox_DZ->RangeStepAndValidator( -999.999, 999.999, step, 3 ) ; - SpinBox_DZ->SetValue( 200.0 ) ; - - GroupPoints->show(); - GroupCoordinates->hide() ; - myConstructorId = 0 ; - Constructor1->setChecked( TRUE ); - CheckBoxReverseVector->setChecked( FALSE ); - - myEditCurrentArgument = LineEditPt1 ; - mySelection = Sel; - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - myPoint1.SetCoord( 0.0, 0.0, 0.0 ); - myPoint2.SetCoord( 0.0, 0.0, 0.0 ); - myOkPoint1 = myOkPoint2 = false ; - mySimulationTopoDs.Nullify() ; - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - - // TODO : previous selection in argument ? - - - /* Filter definitions */ - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - myVertexFilter = new GEOM_ShapeTypeFilter( TopAbs_VERTEX, myGeom ); - myEdgeFilter = new GEOM_ShapeTypeFilter( TopAbs_EDGE, myGeom ); - mySelection->AddFilter(myVertexFilter) ; /* first filter used */ - - /* signals and slots connections */ - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ; - connect( buttonApply, SIGNAL( clicked() ), this, SLOT(ClickOnApply() ) ); - connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) ); - connect( SelectButtonPt1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( SelectButtonPt2, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - - connect( SpinBox_DX, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ; - connect( SpinBox_DY, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ; - connect( SpinBox_DZ, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ; - - connect( LineEditPt1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - connect( LineEditPt2, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - - connect( CheckBoxReverseVector, SIGNAL (stateChanged(int) ), this, SLOT( ReverseVector(int) ) ) ; - - connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ; - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - /* to close dialog if study change */ - connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ; - - /* Move widget on the botton right corner of main widget */ - int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; - this->show() ; /* displays Dialog */ - - return ; -} - -//================================================================================= -// function : ReverseVector() -// purpose : 'state' not used here -//================================================================================= -void GeometryGUI_VectorDlg::ReverseVector(int state) -{ - if( myConstructorId == 1 ) { - - myDx = -myDx ; - myDy = -myDy ; - myDz = -myDz ; - - SpinBox_DX->SetValue( myDx ) ; - SpinBox_DY->SetValue( myDy ) ; - SpinBox_DZ->SetValue( myDz ) ; - - myPoint1.SetCoord(0.0, 0.0, 0.0) ; - myPoint2.SetCoord(myDx, myDy, myDz) ; - - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - /* In the appropriate constructor */ - if( myPoint1.Distance(myPoint2) > Precision::Confusion() ) { - mySimulationTopoDs = BRepBuilderAPI_MakeEdge( myPoint1, myPoint2 ).Shape(); - /* Add arrow in simulation */ - bool noNeedToTest = AddArrowToSimulation(mySimulationTopoDs) ; - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - } - } - return ; -} - - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_VectorDlg::ConstructorsClicked(int constructorId) -{ - myGeomGUI->EraseSimulationShape() ; - mySelection->ClearFilters() ; - - switch (constructorId) - { - case 0: - { - GroupPoints->show(); - GroupCoordinates->hide() ; - myConstructorId = constructorId ; - myEditCurrentArgument = LineEditPt1 ; - Constructor1->setChecked( TRUE ); - LineEditPt1->setText(tr("")) ; - LineEditPt2->setText(tr("")) ; - myOkPoint1 = myOkPoint2 = false ; - - /* filter for next selections */ - mySelection->AddFilter( myVertexFilter ); - connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - break; - } - case 1: - { - GroupPoints->hide(); - GroupCoordinates->show(); - myConstructorId = constructorId ; - CheckBoxReverseVector->setChecked( FALSE ); - myOkPoint1 = myOkPoint2 = false ; - - myEditCurrentArgument = SpinBox_DX ; - myPoint1.SetCoord( 0.0, 0.0, 0.0 ) ; - myDx = 0.0 ; - myDy = 0.0 ; - myDz = 200.0 ; - - myPoint2.SetCoord( myDx, myDy, myDz ) ; - SpinBox_DX->SetValue( myDx ) ; - SpinBox_DY->SetValue( myDy ) ; - SpinBox_DZ->SetValue( myDz ) ; - - /* filter for next selections */ - mySelection->AddFilter( myEdgeFilter ); - connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - - if( myPoint1.Distance(myPoint2) > Precision::Confusion() ) { - mySimulationTopoDs = BRepBuilderAPI_MakeEdge( myPoint1, myPoint2 ).Shape(); - /* Add arrow in simulation */ - bool noNeedToTest = AddArrowToSimulation(mySimulationTopoDs) ; - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - } - break; - } - } - return ; -} - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_VectorDlg::ClickOnOk() -{ - this->ClickOnApply() ; - this->ClickOnCancel() ; - - return ; -} - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_VectorDlg::ClickOnApply() -{ - myGeomGUI->EraseSimulationShape() ; - myGeomGUI->GetDesktop()->putInfo( tr("") ) ; - mySimulationTopoDs.Nullify() ; - switch(myConstructorId) - { - case 0 : - { - if(myOkPoint1 && myOkPoint2) - myGeomGUI->MakeVectorAndDisplay( myPoint1, myPoint2 ) ; - break ; - } - case 1 : - { - /* Recup args and call method */ - myDx = SpinBox_DX->GetValue() ; - myDy = SpinBox_DY->GetValue() ; - myDz = SpinBox_DZ->GetValue() ; - myPoint1.SetCoord(0.0, 0.0, 0.0) ; - myPoint2.SetCoord(myDx, myDy, myDz) ; - myGeomGUI->MakeVectorAndDisplay( myPoint1, myPoint2 ) ; - break ; - } - } - - // accept(); - return ; -} - - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void GeometryGUI_VectorDlg::ClickOnCancel() -{ - mySelection->ClearFilters() ; - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->ResetState() ; - reject() ; - return ; -} - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -//================================================================================= -void GeometryGUI_VectorDlg::SelectionIntoArgument() -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - - /* Future name of shape */ - QString aString = ""; - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; - if ( nbSel != 1 ) { - if ( myEditCurrentArgument == LineEditPt1 ) { - LineEditPt1->setText("") ; - myOkPoint1 = false ; - } - else if ( myEditCurrentArgument == LineEditPt2 ) { - LineEditPt2->setText("") ; - myOkPoint2 = false ; - } - return ; - } - - TopoDS_Shape S; - if( !myGeomGUI->GetTopoFromSelection(mySelection, S) ) - return ; - - /* Constructors treatment */ - if ( myConstructorId == 0 && myEditCurrentArgument == LineEditPt1 && myGeomGUI->VertexToPoint(S, myPoint1) ) { - LineEditPt1->setText(aString) ; - myOkPoint1 = true ; - } - else if ( myConstructorId == 0 && myEditCurrentArgument == LineEditPt2 && myGeomGUI->VertexToPoint(S, myPoint2) ) { - LineEditPt2->setText(aString) ; - myOkPoint2 = true ; - } - else if( myConstructorId == 1) { - gp_Pnt P1, P2 ; - /* linear edge selection verified */ - if( myGeomGUI->LinearEdgeExtremities(S, P1, P2) ) { - - myGeomGUI->GetBipointDxDyDz( P1, P2, myDx, myDy, myDz ) ; - SpinBox_DX->SetValue( myDx ) ; - SpinBox_DY->SetValue( myDy ) ; - SpinBox_DZ->SetValue( myDz ) ; - - myPoint1.SetCoord(0.0, 0.0, 0.0) ; - myPoint2.SetCoord(myDx, myDy, myDz) ; - } - } - - Standard_Real d = myPoint1.Distance(myPoint2) ; - - if( ( myConstructorId == 0 && myOkPoint1 && myOkPoint2 && d > Precision::Confusion() ) || - ( myConstructorId == 1 && d > Precision::Confusion() ) ) { - mySimulationTopoDs = BRepBuilderAPI_MakeEdge( myPoint1, myPoint2 ).Shape(); - /* Add arrow in simulation */ - bool noNeedToTest = AddArrowToSimulation( mySimulationTopoDs ) ; - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - } - - return ; -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_VectorDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - switch (myConstructorId) - { - case 0: /* default constructor */ - { - if(send == SelectButtonPt1) { - LineEditPt1->setFocus() ; - myEditCurrentArgument = LineEditPt1; - } - else if(send == SelectButtonPt2) { - LineEditPt2->setFocus() ; - myEditCurrentArgument = LineEditPt2; - } - mySelection->AddFilter(myVertexFilter) ; - SelectionIntoArgument() ; - break; - } - } - return ; -} - - - -//================================================================================= -// function : ValueChangedInSpinBox() -// purpose : -//================================================================================= -void GeometryGUI_VectorDlg::ValueChangedInSpinBox( double newValue ) -{ - if(myConstructorId != 1) - return ; - - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - - QObject* send = (QObject*)sender() ; - if (send == SpinBox_DX) { - myDx = newValue ; - } else if( send == SpinBox_DY ) { - myDy = newValue ; - } else if( send == SpinBox_DZ ) { - myDz = newValue ; - } - - myPoint1.SetCoord(0.0, 0.0, 0.0) ; - myPoint2.SetCoord(myDx, myDy, myDz) ; - - if ( myConstructorId == 1 && myPoint1.Distance(myPoint2) > Precision::Confusion() ) { // mySimulationTopoDs - mySimulationTopoDs = BRepBuilderAPI_MakeEdge( myPoint1, myPoint2 ).Shape(); - /* Create simulation vector with an arrow */ - this->AddArrowToSimulation(mySimulationTopoDs ) ; - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - } - return ; -} - - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_VectorDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if( send == LineEditPt1 ) - myEditCurrentArgument = LineEditPt1 ; - else if ( send == LineEditPt2 ) - myEditCurrentArgument = LineEditPt2 ; - else - return ; - - /* User name of object input management */ - /* If successfull the selection is changed and signal emitted... */ - /* so SelectionIntoArgument() is automatically called. */ - QLineEdit* LE = (QLineEdit*)myEditCurrentArgument ; - const QString objectUserName = LE->text() ; - QWidget* thisWidget = (QWidget*)this ; - if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) { - LE->setText( objectUserName ) ; - } - return ; -} - - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void GeometryGUI_VectorDlg::DeactivateActiveDialog() -{ - if ( GroupConstructors->isEnabled() ) { - - GroupConstructors->setEnabled(false) ; - GroupCoordinates->setEnabled(false) ; - GroupButtons->setEnabled(false) ; - GroupPoints->setEnabled(false) ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->EraseSimulationShape() ; - mySelection->ClearFilters() ; - } - return ; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_VectorDlg::ActivateThisDialog() -{ - /* Emit a signal to deactivate the active dialog */ - myGeomGUI->EmitSignalDeactivateDialog() ; - - GroupConstructors->setEnabled(true) ; - GroupCoordinates->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - GroupPoints->setEnabled(true) ; - - connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - if( !mySimulationTopoDs.IsNull() ) - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - - return ; -} - - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void GeometryGUI_VectorDlg::enterEvent(QEvent* e) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; -} - - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_VectorDlg::closeEvent( QCloseEvent* e ) -{ - this->ClickOnCancel() ; /* same than click on cancel button */ -} - - -//================================================================================= -// function : AddArrowToSimulation() -// purpose : An arrow (cone topology) is added to 'modifiedShape' -// : to simulate a vector or an 'oriented line' display. The result is in 'modifiedShape'. -// : If an arrow can't be added returns false and 'modifiedShape' isn't modified ! -//================================================================================= -bool GeometryGUI_VectorDlg::AddArrowToSimulation( TopoDS_Shape& modifiedShape ) -{ - TopoDS_Shape arrow ; - /* Try to add a cone simulation shape to show direction of a linear edge */ - if( myGeomGUI->CreateArrowForLinearEdge( modifiedShape, arrow ) ) { - TopoDS_Compound Comp ; - BRep_Builder B; - B.MakeCompound (Comp); - B.Add( Comp, modifiedShape ) ; - B.Add( Comp, arrow ) ; - modifiedShape = Comp ; - return true ; - } - return false ; -} diff --git a/src/GEOMGUI/GeometryGUI_VectorDlg.h b/src/GEOMGUI/GeometryGUI_VectorDlg.h deleted file mode 100644 index 03582f257..000000000 --- a/src/GEOMGUI/GeometryGUI_VectorDlg.h +++ /dev/null @@ -1,150 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_VectorDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_VECTOR_H -#define DIALOGBOX_VECTOR_H - -#include "SALOME_Selection.h" -#include "GEOM_ShapeTypeFilter.hxx" -#include "GeometryGUI_SpinBox.h" - -#include -#include -#include -#include -#include -#include - -#include -#include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QFrame; -class QCheckBox; -class QGroupBox; -class QLineEdit; -class QPushButton; -class QRadioButton; -class QToolButton; -class QLabel; -class GeometryGUI; - - -//================================================================================= -// class : GeometryGUI_VectorDlg -// purpose : -//================================================================================= -class GeometryGUI_VectorDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_VectorDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 ); - ~GeometryGUI_VectorDlg(); - - bool AddArrowToSimulation( TopoDS_Shape& modifiedShape ) ; - -private : - - void closeEvent( QCloseEvent* e ) ; - void enterEvent( QEvent* e); - void Init( SALOME_Selection* Sel ) ; /* mouse enter the QWidget */ - - GEOM::GEOM_Gen_var myGeom ; /* Current Geom object */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - TopoDS_Shape mySimulationTopoDs; /* Shape used for simulation display */ - SALOME_Selection* mySelection ; /* User shape selection */ - gp_Pnt myPoint1 ; /* Points containing the vector */ - gp_Pnt myPoint2 ; - double myDx ; - double myDy ; - double myDz ; - bool myOkPoint1 ; /* Are true when myPoint is defined */ - bool myOkPoint2 ; - QWidget* myEditCurrentArgument; /* Current LineEdit or Spin box */ - int myConstructorId ; /* Current constructor id = radio button id */ - Handle(GEOM_ShapeTypeFilter) myVertexFilter; /* Filter selection */ - Handle(GEOM_ShapeTypeFilter) myEdgeFilter; /* Filter selection */ - - QGroupBox* GroupPoints; - QPushButton* SelectButtonPt1; - QPushButton* SelectButtonPt2; - QLabel* TextLabelPt1; - QLabel* TextLabelPt2; - - QButtonGroup* GroupConstructors; - QRadioButton* Constructor2; - QRadioButton* Constructor1; - - QGroupBox* GroupButtons; - QPushButton* buttonApply; - QPushButton* buttonOk; - QPushButton* buttonCancel; - - QLineEdit* LineEditPt1; - QLineEdit* LineEditPt2; - - QGroupBox* GroupCoordinates; - - GeometryGUI_SpinBox* SpinBox_DX ; - GeometryGUI_SpinBox* SpinBox_DY ; - GeometryGUI_SpinBox* SpinBox_DZ ; - QLabel* TextLabel_DZ; - QLabel* TextLabel_DX; - QLabel* TextLabel_DY; - - QCheckBox* CheckBoxReverseVector; - -private slots: - - void ConstructorsClicked(int constructorId); - void ClickOnOk(); - void ClickOnCancel(); - void ClickOnApply(); - void SetEditCurrentArgument() ; - void SelectionIntoArgument() ; - void LineEditReturnPressed() ; - void DeactivateActiveDialog() ; - void ActivateThisDialog() ; - void ReverseVector(int state) ; - void ValueChangedInSpinBox( double newValue ) ; - -protected: - - QGridLayout* GeometryGUI_VectorDlgLayout; - QGridLayout* GroupPointsLayout; - QGridLayout* GroupButtonsLayout; - QGridLayout* GroupConstructorsLayout; - QGridLayout* GroupCoordinatesLayout; - -}; - -#endif // DIALOGBOX_VECTOR_H diff --git a/src/GEOMGUI/GeometryGUI_WhatisDlg.cxx b/src/GEOMGUI/GeometryGUI_WhatisDlg.cxx deleted file mode 100644 index 97c2e81e3..000000000 --- a/src/GEOMGUI/GeometryGUI_WhatisDlg.cxx +++ /dev/null @@ -1,449 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_WhatisDlg.cxx -// Author : Nicolas REJNERI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_WhatisDlg.h" - -#include "GeometryGUI.h" -#include "QAD_Application.h" -#include "QAD_Desktop.h" -#include "utilities.h" - -// Open CASCADE Includes -//#include -#include -#include -#include -#include - -// QT Includes -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - - -//================================================================================= -// class : GeometryGUI_WhatisDlg() -// purpose : Constructs a GeometryGUI_WhatisDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_WhatisDlg::GeometryGUI_WhatisDlg( QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_WHATIS"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - - if ( !name ) - setName( "GeometryGUI_WhatisDlg" ); - resize( 303, 275 ); - setCaption( tr( "GEOM_WHATIS_TITLE" ) ); - setSizeGripEnabled( TRUE ); - GeometryGUI_WhatisDlgLayout = new QGridLayout( this ); - GeometryGUI_WhatisDlgLayout->setSpacing( 6 ); - GeometryGUI_WhatisDlgLayout->setMargin( 11 ); - - /***************************************************************/ - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "GEOM_WHATIS" ) ); - GroupConstructors->setExclusive( TRUE ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setText( tr( "" ) ); - Constructor1->setPixmap( image0 ); - Constructor1->setChecked( TRUE ); - Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, - Constructor1->sizePolicy().hasHeightForWidth() ) ); - Constructor1->setMinimumSize( QSize( 60, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer, 0, 1 ); - GeometryGUI_WhatisDlgLayout->addWidget( GroupConstructors, 0, 0 ); - - /***************************************************************/ - GroupConstructor1 = new QGroupBox( this, "GroupConstructor1" ); - GroupConstructor1->setTitle( tr( "GEOM_WHATIS_OBJECT" ) ); - GroupConstructor1->setColumnLayout(0, Qt::Vertical ); - GroupConstructor1->layout()->setSpacing( 0 ); - GroupConstructor1->layout()->setMargin( 0 ); - GroupConstructor1Layout = new QGridLayout( GroupConstructor1->layout() ); - GroupConstructor1Layout->setAlignment( Qt::AlignTop ); - GroupConstructor1Layout->setSpacing( 6 ); - GroupConstructor1Layout->setMargin( 11 ); - LineEditC1A1 = new QLineEdit( GroupConstructor1, "LineEditC1A1" ); - LineEditC1A1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC1A1->sizePolicy().hasHeightForWidth() ) ); - GroupConstructor1Layout->addWidget( LineEditC1A1, 0, 2 ); - SelectButtonC1A1 = new QPushButton( GroupConstructor1, "SelectButtonC1A1" ); - SelectButtonC1A1->setText( tr( "" ) ); - SelectButtonC1A1->setPixmap( image1 ); - GroupConstructor1Layout->addWidget( SelectButtonC1A1, 0, 1 ); - TextLabelC1A1 = new QLabel( GroupConstructor1, "TextLabelC1A1" ); - TextLabelC1A1->setText( tr( "GEOM_OBJECT" ) ); - TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A1->setFrameShape( QLabel::NoFrame ); - TextLabelC1A1->setFrameShadow( QLabel::Plain ); - GroupConstructor1Layout->addWidget( TextLabelC1A1, 0, 0 ); - - Text = new QTextView(GroupConstructor1); - Text->setTextFormat( Qt::PlainText ); - GroupConstructor1Layout->addMultiCellWidget( Text, 1, 1, 0, 2 ); - - GeometryGUI_WhatisDlgLayout->addWidget( GroupConstructor1, 1, 0 ); - - /***************************************************************/ - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); - GroupButtons->setTitle( tr( "" ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 1 ); - - QSpacerItem* spacer_8 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_8, 0, 0 ); - QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_9, 0, 2 ); - - GeometryGUI_WhatisDlgLayout->addWidget( GroupButtons, 2, 0 ); - /***************************************************************/ - - Init(Sel) ; /* Initialisations */ -} - - -//================================================================================= -// function : ~GeometryGUI_WhatisDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_WhatisDlg::~GeometryGUI_WhatisDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_WhatisDlg::Init( SALOME_Selection* Sel ) -{ - myConstructorId = 0 ; - Constructor1->setChecked( TRUE ); - myEditCurrentArgument = LineEditC1A1 ; - mySelection = Sel; - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - - // TODO : previous selection into argument ? - - /* Filter definitions */ - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - - /* signals and slots connections */ - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ; - connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) ); - connect( SelectButtonC1A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - - connect( LineEditC1A1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - - connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ; - /* to close dialog if study change */ - connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ; - - SelectedName = ""; - - /* Move widget on the botton right corner of main widget */ - int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; - this->show() ; /* displays Dialog */ - - return ; -} - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_WhatisDlg::ConstructorsClicked(int constructorId) -{ - return ; -} - - - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void GeometryGUI_WhatisDlg::ClickOnCancel() -{ - myGeomGUI->EraseSimulationShape() ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->ResetState() ; - reject() ; - return ; -} - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -//================================================================================= -void GeometryGUI_WhatisDlg::SelectionIntoArgument() -{ - myGeomGUI->EraseSimulationShape() ; - mySimulationTopoDs.Nullify() ; - - Text->setText("") ; - myEditCurrentArgument->setText("") ; - - SelectedName = ""; /* future the name of selection */ - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, SelectedName) ; - if ( nbSel != 1 ) { - return ; - } - - /* nbSel == 1 */ - TopoDS_Shape S; - if( !myGeomGUI->GetTopoFromSelection(mySelection, S) ) - return ; - - if( S.IsNull() ) { - myEditCurrentArgument->setText( "" ); - return ; - } - - /* Try to display of a cone simulation shape to show direction of a linear edge only in OCC viewer */ - if( myGeomGUI->CreateArrowForLinearEdge( S, mySimulationTopoDs ) ) { - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - } - LineEditC1A1->setText(SelectedName) ; - this->CalculateWhatis(S) ; - - return ; -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_WhatisDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - switch (myConstructorId) - { - case 0: /* default constructor */ - { - if(send == SelectButtonC1A1) { - LineEditC1A1->setFocus() ; - myEditCurrentArgument = LineEditC1A1; - } - SelectionIntoArgument() ; - break; - } - } - return ; -} - - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_WhatisDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if( send == LineEditC1A1 ) - myEditCurrentArgument = LineEditC1A1 ; - else - return ; - - /* User name of object input management */ - /* If successfull the selection is changed and signal emitted... */ - /* so SelectionIntoArgument() is automatically called. */ - const QString objectUserName = myEditCurrentArgument->text() ; - QWidget* thisWidget = (QWidget*)this ; - if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) { - myEditCurrentArgument->setText( objectUserName ) ; - } - return ; -} - - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void GeometryGUI_WhatisDlg::DeactivateActiveDialog() -{ - if ( GroupConstructors->isEnabled() ) { - disconnect( mySelection, 0, this, 0 ); - GroupConstructors->setEnabled(false) ; - GroupConstructor1->setEnabled(false) ; - myGeomGUI->EraseSimulationShape() ; - GroupButtons->setEnabled(false) ; - } - return ; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_WhatisDlg::ActivateThisDialog() -{ - /* Emit a signal to deactivate the active dialog */ - myGeomGUI->EmitSignalDeactivateDialog() ; - GroupConstructors->setEnabled(true) ; - GroupConstructor1->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - if( !mySimulationTopoDs.IsNull() ) - myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; - return ; -} - - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void GeometryGUI_WhatisDlg::enterEvent(QEvent* e) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; - return ; -} - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_WhatisDlg::closeEvent( QCloseEvent* e ) -{ - /* same than click on cancel button */ - this->ClickOnCancel() ; - return ; -} - - -//================================================================================= -// function : CalculateWhatis() -// purpose : -//================================================================================= -void GeometryGUI_WhatisDlg::CalculateWhatis(const TopoDS_Shape& S) -{ - - if( S.IsNull() ) - return ; - - TCollection_AsciiString Astr; - Astr = Astr + " Number of shapes in " + strdup(SelectedName.latin1()) + ": \n"; - - try { - // BRepTools_ShapeSet BS; - // BS.Add(S); - // BS.DumpExtent(Astr); - - int iType, nbTypes [TopAbs_SHAPE]; - for (iType = 0; iType < TopAbs_SHAPE; ++iType) - nbTypes[ iType ] = 0; - nbTypes[ S.ShapeType() ]++; - - TopTools_MapOfShape aMapOfShape; - aMapOfShape.Add( S ); - TopTools_ListOfShape aListOfShape; - aListOfShape.Append( S ); - - TopTools_ListIteratorOfListOfShape itL(aListOfShape); - for (; itL.More(); itL.Next()) - { - TopoDS_Iterator it(itL.Value()); - for (; it.More(); it.Next()) - { - TopoDS_Shape s = it.Value(); - if (aMapOfShape.Add( s )) - { - aListOfShape.Append( s ); - nbTypes[ s.ShapeType() ] ++; - } - } - } - - Astr = Astr + " VERTEX : " + TCollection_AsciiString(nbTypes[ TopAbs_VERTEX ]) + "\n"; - Astr = Astr + " EDGE : " + TCollection_AsciiString(nbTypes[ TopAbs_EDGE ]) + "\n"; - Astr = Astr + " WIRE : " + TCollection_AsciiString(nbTypes[ TopAbs_WIRE ]) + "\n"; - Astr = Astr + " FACE : " + TCollection_AsciiString(nbTypes[ TopAbs_FACE ]) + "\n"; - Astr = Astr + " SHELL : " + TCollection_AsciiString(nbTypes[ TopAbs_SHELL ]) + "\n"; - Astr = Astr + " SOLID : " + TCollection_AsciiString(nbTypes[ TopAbs_SOLID ]) + "\n"; - Astr = Astr + " COMPSOLID : " + TCollection_AsciiString(nbTypes[ TopAbs_COMPSOLID ]) + "\n"; - Astr = Astr + " COMPOUND : " + TCollection_AsciiString(nbTypes[ TopAbs_COMPOUND ]) + "\n"; - Astr = Astr + " SHAPE : " + TCollection_AsciiString(aMapOfShape.Extent()) + "\n"; - - Text->setText( Astr.ToCString() ); - } - catch(Standard_Failure) { - MESSAGE("Catch intercepted in CalculateWhatis()" << endl ) ; - } - return ; -} diff --git a/src/GEOMGUI/GeometryGUI_WhatisDlg.h b/src/GEOMGUI/GeometryGUI_WhatisDlg.h deleted file mode 100644 index 02a4e9f4a..000000000 --- a/src/GEOMGUI/GeometryGUI_WhatisDlg.h +++ /dev/null @@ -1,111 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_WhatisDlg.h -// Author : Nicolas REJNERI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_WHATIS_H -#define DIALOGBOX_WHATIS_H - -#include "SALOME_Selection.h" -#include "GEOM_ShapeTypeFilter.hxx" - -#include - -#include -#include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QRadioButton; -class QTextView; -class GeometryGUI; - -//================================================================================= -// class : DialogBox_PROPERTIES -// purpose : -//================================================================================= -class GeometryGUI_WhatisDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_WhatisDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 ); - ~GeometryGUI_WhatisDlg(); - -private: - - void Init( SALOME_Selection* Sel ) ; - void closeEvent( QCloseEvent* e ) ; - void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */ - void CalculateWhatis(const TopoDS_Shape& S) ; - - GEOM::GEOM_Gen_var myGeom ; /* Current GeomI object */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - SALOME_Selection* mySelection ; /* User shape selection */ - TopoDS_Shape mySimulationTopoDs ; /* Shape used for simulation display */ - - int myConstructorId ; /* Current constructor id = radio button id */ - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - - QButtonGroup* GroupConstructors; - QRadioButton* Constructor1; - QGroupBox* GroupConstructor1; - QLineEdit* LineEditC1A1; - QPushButton* SelectButtonC1A1; - QLabel* TextLabelC1A1; - - QTextView* Text; - QString SelectedName; - - QGroupBox* GroupButtons; - QPushButton* buttonApply; - QPushButton* buttonOk; - QPushButton* buttonCancel; - -private slots: - - void ConstructorsClicked(int constructorId); - void ClickOnCancel(); - void SetEditCurrentArgument() ; - void LineEditReturnPressed() ; - void SelectionIntoArgument() ; - void DeactivateActiveDialog() ; - void ActivateThisDialog() ; - -protected: - QGridLayout* GeometryGUI_WhatisDlgLayout; - QGridLayout* GroupConstructorsLayout; - QGridLayout* GroupConstructor1Layout; - QGridLayout* GroupButtonsLayout; -}; - -#endif // DIALOGBOX_WHATIS_H diff --git a/src/GEOMGUI/GeometryGUI_WireDlg.cxx b/src/GEOMGUI/GeometryGUI_WireDlg.cxx deleted file mode 100644 index add86fe1a..000000000 --- a/src/GEOMGUI/GeometryGUI_WireDlg.cxx +++ /dev/null @@ -1,375 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_WireDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_WireDlg.h" - -#include "GeometryGUI.h" -#include "QAD_Application.h" -#include "QAD_Desktop.h" -#include "utilities.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -//================================================================================= -// class : GeometryGUI_WireDlg() -// purpose : Constructs a GeometryGUI_WireDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_WireDlg::GeometryGUI_WireDlg( QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_BUILD_WIRE"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - - if ( !name ) - setName( "GeometryGUI_WireDlg" ); - resize( 303, 185 ); - setCaption( tr( "GEOM_WIRE_TITLE" ) ); - setSizeGripEnabled( TRUE ); - GeometryGUI_WireDlgLayout = new QGridLayout( this ); - GeometryGUI_WireDlgLayout->setSpacing( 6 ); - GeometryGUI_WireDlgLayout->setMargin( 11 ); - - /***************************************************************/ - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "GEOM_WIRE" ) ); - GroupConstructors->setExclusive( TRUE ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setText( tr( "" ) ); - Constructor1->setPixmap( image0 ); - Constructor1->setChecked( TRUE ); - Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) ); - Constructor1->setMinimumSize( QSize( 50, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer, 0, 1 ); - GeometryGUI_WireDlgLayout->addWidget( GroupConstructors, 0, 0 ); - - /***************************************************************/ - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); - GroupButtons->setTitle( tr( "" ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 3 ); - buttonApply = new QPushButton( GroupButtons, "buttonApply" ); - buttonApply->setText( tr( "GEOM_BUT_APPLY" ) ); - buttonApply->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonApply, 0, 1 ); - QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_9, 0, 2 ); - buttonOk = new QPushButton( GroupButtons, "buttonOk" ); - buttonOk->setText( tr( "GEOM_BUT_OK" ) ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - GeometryGUI_WireDlgLayout->addWidget( GroupButtons, 2, 0 ); - - /***************************************************************/ - GroupC1 = new QGroupBox( this, "GroupC1" ); - GroupC1->setTitle( tr( "GEOM_WIRE_CONNECT" ) ); - GroupC1->setMinimumSize( QSize( 0, 0 ) ); - GroupC1->setFrameShape( QGroupBox::Box ); - GroupC1->setFrameShadow( QGroupBox::Sunken ); - GroupC1->setColumnLayout(0, Qt::Vertical ); - GroupC1->layout()->setSpacing( 0 ); - GroupC1->layout()->setMargin( 0 ); - GroupC1Layout = new QGridLayout( GroupC1->layout() ); - GroupC1Layout->setAlignment( Qt::AlignTop ); - GroupC1Layout->setSpacing( 6 ); - GroupC1Layout->setMargin( 11 ); - TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" ); - TextLabelC1A1->setText( tr( "GEOM_OBJECTS" ) ); - TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A1->setFrameShape( QLabel::NoFrame ); - TextLabelC1A1->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabelC1A1, 0, 0 ); - SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" ); - SelectButtonC1A1->setText( tr( "" ) ); - SelectButtonC1A1->setPixmap( image1 ); - SelectButtonC1A1->setToggleButton( FALSE ); - GroupC1Layout->addWidget( SelectButtonC1A1, 0, 1 ); - LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" ); - GroupC1Layout->addWidget( LineEditC1A1, 0, 2 ); - GeometryGUI_WireDlgLayout->addWidget( GroupC1, 1, 0 ); - - Init(Sel) ; /* Initialisations */ -} - -//================================================================================= -// function : ~GeometryGUI_WireDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_WireDlg::~GeometryGUI_WireDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_WireDlg::Init( SALOME_Selection* Sel ) -{ - - GroupC1->show(); - myConstructorId = 0 ; - Constructor1->setChecked( TRUE ); - myEditCurrentArgument = LineEditC1A1 ; - mySelection = Sel; - this->myOkListShapes = false ; - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - - // TODO : previous selection into argument - - /* Filter definitions */ - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - - /* signals and slots connections */ - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ; - connect( buttonApply, SIGNAL( clicked() ), this, SLOT(ClickOnApply() ) ); - connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) ); - - connect( SelectButtonC1A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ; - connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - /* to close dialog if study change */ - connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ; - - /* Move widget on the botton right corner of main widget */ - int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; - this->show() ; /* displays Dialog */ - - return ; -} - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_WireDlg::ConstructorsClicked(int constructorId) -{ - return ; -} - - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_WireDlg::ClickOnApply() -{ - switch(myConstructorId) - { - case 0 : - { - if(myOkListShapes) { - myGeomGUI->MakeWireAndDisplay( myListShapes ) ; - } - break ; - } - } - // accept(); - return ; -} - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_WireDlg::ClickOnOk() -{ - this->ClickOnApply() ; - this->ClickOnCancel() ; - - return ; -} - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void GeometryGUI_WireDlg::ClickOnCancel() -{ - myGeomGUI->ResetState() ; - reject() ; - return ; -} - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -//================================================================================= -void GeometryGUI_WireDlg::SelectionIntoArgument() -{ - /* All this for first constructor */ - // if(myEditCurrentArgument == LineEditC1A1 ) - - myEditCurrentArgument->setText("") ; - myOkListShapes = false; - QString aString = ""; /* Future name of selection */ - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; - if(nbSel < 1) - return ; - - myGeomGUI->ConvertListOfIOInListOfIOR(mySelection->StoredIObjects(), myListShapes) ; - myEditCurrentArgument->setText(aString) ; - myOkListShapes = true ; - /* no simulation */ - return ; -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_WireDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - switch (myConstructorId) - { - case 0: /* default constructor */ - { - if(send == SelectButtonC1A1) { - LineEditC1A1->setFocus() ; - myEditCurrentArgument = LineEditC1A1; - } - SelectionIntoArgument() ; - break; - } - } - return ; -} - - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_WireDlg::LineEditReturnPressed() -{ - return ; -} - - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void GeometryGUI_WireDlg::DeactivateActiveDialog() -{ - if ( GroupConstructors->isEnabled() ) { - GroupConstructors->setEnabled(false) ; - GroupC1->setEnabled(false) ; - GroupButtons->setEnabled(false) ; - } - return ; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_WireDlg::ActivateThisDialog() -{ - /* Emit a signal to deactivate the active dialog */ - myGeomGUI->EmitSignalDeactivateDialog() ; - GroupConstructors->setEnabled(true) ; - GroupC1->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - return ; -} - - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void GeometryGUI_WireDlg::enterEvent(QEvent* e) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; - return ; -} - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_WireDlg::closeEvent( QCloseEvent* e ) -{ - /* same than click on cancel button */ - this->ClickOnCancel() ; - return ; -} - - diff --git a/src/GEOMGUI/GeometryGUI_WireDlg.h b/src/GEOMGUI/GeometryGUI_WireDlg.h deleted file mode 100644 index 5346ccaca..000000000 --- a/src/GEOMGUI/GeometryGUI_WireDlg.h +++ /dev/null @@ -1,106 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_WireDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -#ifndef DIALOGBOX_WIRE_H -#define DIALOGBOX_WIRE_H - -#include "SALOME_Selection.h" -#include "GEOM_ShapeTypeFilter.hxx" - -#include -#include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QRadioButton; -class GeometryGUI; - - -//================================================================================= -// class : GeometryGUI_WireDlg -// purpose : -//================================================================================= -class GeometryGUI_WireDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_WireDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 ); - ~GeometryGUI_WireDlg(); - -private: - - void Init( SALOME_Selection* Sel ) ; - void closeEvent( QCloseEvent* e ) ; - void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */ - - GEOM::GEOM_Gen_var myGeom ; /* Current GeomI object */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - SALOME_Selection* mySelection ; /* User shape selection */ - GEOM::GEOM_Gen::ListOfIOR myListShapes ; - bool myOkListShapes ; /* to check when arguments is defined */ - int myConstructorId ; /* Current constructor id = radio button id */ - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - - QButtonGroup* GroupConstructors; - QRadioButton* Constructor1; - QGroupBox* GroupButtons; - QPushButton* buttonOk; - QPushButton* buttonCancel; - QPushButton* buttonApply; - QGroupBox* GroupC1; - QLabel* TextLabelC1A1; - QPushButton* SelectButtonC1A1; - QLineEdit* LineEditC1A1; - -private slots: - - void ConstructorsClicked(int constructorId); - void ClickOnOk(); - void ClickOnCancel(); - void ClickOnApply(); - void SetEditCurrentArgument() ; - void LineEditReturnPressed() ; - void SelectionIntoArgument() ; - void DeactivateActiveDialog() ; - void ActivateThisDialog() ; - -protected: - QGridLayout* GeometryGUI_WireDlgLayout; - QGridLayout* GroupConstructorsLayout; - QGridLayout* GroupButtonsLayout; - QGridLayout* GroupC1Layout; -}; - -#endif // DIALOGBOX_WIRE_H diff --git a/src/GEOMGUI/GeometryGUI_WorkingPlaneDlg.cxx b/src/GEOMGUI/GeometryGUI_WorkingPlaneDlg.cxx deleted file mode 100644 index 536347dd8..000000000 --- a/src/GEOMGUI/GeometryGUI_WorkingPlaneDlg.cxx +++ /dev/null @@ -1,423 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_WorkingPlaneDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM - -using namespace std; -#include "GeometryGUI_WorkingPlaneDlg.h" - -#include "GeometryGUI.h" -#include "QAD_Application.h" -#include "QAD_Desktop.h" -#include "utilities.h" - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -//================================================================================= -// class : GeometryGUI_WorkingPlaneDlg() -// purpose : Constructs a GeometryGUI_WorkingPlaneDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -GeometryGUI_WorkingPlaneDlg::GeometryGUI_WorkingPlaneDlg( QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_WPLANE_FACE"))); - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - - if ( !name ) - setName( "GeometryGUI_WorkingPlaneDlg" ); - resize( 303, 185 ); - setCaption( tr( "GEOM_WPLANE_TITLE" ) ); - setSizeGripEnabled( TRUE ); - GeometryGUI_WorkingPlaneDlgLayout = new QGridLayout( this ); - GeometryGUI_WorkingPlaneDlgLayout->setSpacing( 6 ); - GeometryGUI_WorkingPlaneDlgLayout->setMargin( 11 ); - - /***************************************************************/ - GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); - GroupConstructors->setTitle( tr( "GEOM_WPLANE" ) ); - GroupConstructors->setExclusive( TRUE ); - GroupConstructors->setColumnLayout(0, Qt::Vertical ); - GroupConstructors->layout()->setSpacing( 0 ); - GroupConstructors->layout()->setMargin( 0 ); - GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); - GroupConstructorsLayout->setAlignment( Qt::AlignTop ); - GroupConstructorsLayout->setSpacing( 6 ); - GroupConstructorsLayout->setMargin( 11 ); - Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" ); - Constructor1->setText( tr( "" ) ); - Constructor1->setPixmap( image0 ); - Constructor1->setChecked( TRUE ); - Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) ); - Constructor1->setMinimumSize( QSize( 50, 0 ) ); - GroupConstructorsLayout->addWidget( Constructor1, 0, 0 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupConstructorsLayout->addItem( spacer, 0, 1 ); - GeometryGUI_WorkingPlaneDlgLayout->addWidget( GroupConstructors, 0, 0 ); - - /***************************************************************/ - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); - GroupButtons->setTitle( tr( "" ) ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 3 ); - buttonApply = new QPushButton( GroupButtons, "buttonApply" ); - buttonApply->setText( tr( "GEOM_BUT_APPLY" ) ); - buttonApply->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonApply, 0, 1 ); - QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupButtonsLayout->addItem( spacer_9, 0, 2 ); - buttonOk = new QPushButton( GroupButtons, "buttonOk" ); - buttonOk->setText( tr( "GEOM_BUT_OK" ) ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - GeometryGUI_WorkingPlaneDlgLayout->addWidget( GroupButtons, 2, 0 ); - - /***************************************************************/ - GroupC1 = new QGroupBox( this, "GroupC1" ); - GroupC1->setTitle( tr( "GEOM_WPLANE_FACE" ) ); - GroupC1->setMinimumSize( QSize( 0, 0 ) ); - GroupC1->setFrameShape( QGroupBox::Box ); - GroupC1->setFrameShadow( QGroupBox::Sunken ); - GroupC1->setColumnLayout(0, Qt::Vertical ); - GroupC1->layout()->setSpacing( 0 ); - GroupC1->layout()->setMargin( 0 ); - GroupC1Layout = new QGridLayout( GroupC1->layout() ); - GroupC1Layout->setAlignment( Qt::AlignTop ); - GroupC1Layout->setSpacing( 6 ); - GroupC1Layout->setMargin( 11 ); - TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" ); - TextLabelC1A1->setText( tr( "GEOM_SELECTION" ) ); - TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) ); - TextLabelC1A1->setFrameShape( QLabel::NoFrame ); - TextLabelC1A1->setFrameShadow( QLabel::Plain ); - GroupC1Layout->addWidget( TextLabelC1A1, 0, 0 ); - SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" ); - SelectButtonC1A1->setText( tr( "" ) ); - SelectButtonC1A1->setPixmap( image1 ); - SelectButtonC1A1->setToggleButton( FALSE ); - GroupC1Layout->addWidget( SelectButtonC1A1, 0, 1 ); - LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" ); - GroupC1Layout->addWidget( LineEditC1A1, 0, 2 ); - GeometryGUI_WorkingPlaneDlgLayout->addWidget( GroupC1, 1, 0 ); - /***************************************************************/ - - Init(Sel) ; /* Initialisations */ -} - -//================================================================================= -// function : ~GeometryGUI_WorkingPlaneDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -GeometryGUI_WorkingPlaneDlg::~GeometryGUI_WorkingPlaneDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void GeometryGUI_WorkingPlaneDlg::Init( SALOME_Selection* Sel ) -{ - - GroupC1->show(); - myConstructorId = 0 ; - Constructor1->setChecked( TRUE ); - myEditCurrentArgument = LineEditC1A1 ; - mySelection = Sel; - this->myOkPlane = false ; - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ; - - // TODO : previous selection into argument ? - - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); - /* Filter definition */ - myFaceFilter = new GEOM_FaceFilter( StdSelect_Plane, myGeom ); - mySelection->AddFilter( myFaceFilter ); /* filter for next selection */ - - /* signals and slots connections */ - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ; - connect( buttonApply, SIGNAL( clicked() ), this, SLOT(ClickOnApply() ) ); - connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) ); - - connect( LineEditC1A1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; - - connect( SelectButtonC1A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; - connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ; - /* to close dialog if study change */ - connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ; - - /* Move widget on the botton right corner of main widget */ - int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; - this->show() ; /* displays Dialog */ - - return ; -} - - -//================================================================================= -// function : ConstructorsClicked() -// purpose : Radio button management -//================================================================================= -void GeometryGUI_WorkingPlaneDlg::ConstructorsClicked(int constructorId) -{ - return ; -} - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void GeometryGUI_WorkingPlaneDlg::ClickOnOk() -{ - this->ClickOnApply() ; - this->ClickOnCancel() ; - - return ; -} - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void GeometryGUI_WorkingPlaneDlg::ClickOnApply() -{ - mySelection->ClearFilters() ; - myGeomGUI->GetDesktop()->putInfo( tr("") ) ; - switch(myConstructorId) - { - case 0 : - { - if(myOkPlane) { - myGeomGUI->MakeWorkingPlane( this->myLoc, this->myDir ) ; - } - break ; - } - } - // accept(); - return ; -} - - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void GeometryGUI_WorkingPlaneDlg::ClickOnCancel() -{ - mySelection->ClearFilters() ; - disconnect( mySelection, 0, this, 0 ); - myGeomGUI->ResetState() ; - reject() ; - return ; -} - - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -//================================================================================= -void GeometryGUI_WorkingPlaneDlg::SelectionIntoArgument() -{ - /* All this for first constructor */ - // if(myEditCurrentArgument == LineEditC1A1 ) - - myEditCurrentArgument->setText("") ; - QString aString = ""; /* future the name of selection */ - - int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; - if ( nbSel != 1 ) { - switch (myConstructorId) - { - case 0: - { - if ( myEditCurrentArgument == LineEditC1A1 ) { - myOkPlane = false ; - } - break ; - } - } - return ; - } - - /* nbSel == 1 */ - TopoDS_Shape S; - if( !myGeomGUI->GetTopoFromSelection(mySelection, S) ) - return ; - - if ( myEditCurrentArgument == LineEditC1A1 ) { - BRepAdaptor_Surface surf(TopoDS::Face(S)); - gp_Pln Plane = surf.Plane(); - myLoc = Plane.Location(); - myDir = Plane.Axis().Direction(); - - LineEditC1A1->setText(aString) ; - myOkPlane = true ; - } - - /* no simulation */ - return ; -} - - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void GeometryGUI_WorkingPlaneDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - switch (myConstructorId) - { - case 0: /* default constructor */ - { - if(send == SelectButtonC1A1) { - LineEditC1A1->setFocus() ; - myEditCurrentArgument = LineEditC1A1; - } - mySelection->AddFilter(myFaceFilter) ; - SelectionIntoArgument() ; - break; - } - } - return ; -} - - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void GeometryGUI_WorkingPlaneDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if( send == LineEditC1A1 ) - myEditCurrentArgument = LineEditC1A1 ; - return ; - - /* User name of object input management */ - /* If successfull the selection is changed and signal emitted... */ - /* so SelectionIntoArgument() is automatically called. */ - const QString objectUserName = myEditCurrentArgument->text() ; - QWidget* thisWidget = (QWidget*)this ; - if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) { - myEditCurrentArgument->setText( objectUserName ) ; - } - return ; -} - - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void GeometryGUI_WorkingPlaneDlg::DeactivateActiveDialog() -{ - if ( GroupConstructors->isEnabled() ) { - mySelection->ClearFilters() ; - disconnect( mySelection, 0, this, 0 ); - GroupConstructors->setEnabled(false) ; - GroupC1->setEnabled(false) ; - GroupButtons->setEnabled(false) ; - } - return ; -} - - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void GeometryGUI_WorkingPlaneDlg::ActivateThisDialog() -{ - /* Emit a signal to deactivate the active dialog */ - connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - myGeomGUI->EmitSignalDeactivateDialog() ; - GroupConstructors->setEnabled(true) ; - GroupC1->setEnabled(true) ; - GroupButtons->setEnabled(true) ; - return ; -} - - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void GeometryGUI_WorkingPlaneDlg::enterEvent(QEvent* e) -{ - if ( GroupConstructors->isEnabled() ) - return ; - ActivateThisDialog() ; - return ; -} - - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void GeometryGUI_WorkingPlaneDlg::closeEvent( QCloseEvent* e ) -{ - /* same than click on cancel button */ - this->ClickOnCancel() ; - return ; -} diff --git a/src/GEOMGUI/GeometryGUI_WorkingPlaneDlg.h b/src/GEOMGUI/GeometryGUI_WorkingPlaneDlg.h deleted file mode 100644 index 2f54705a8..000000000 --- a/src/GEOMGUI/GeometryGUI_WorkingPlaneDlg.h +++ /dev/null @@ -1,113 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_WorkingPlaneDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM - -#ifndef DIALOGBOX_WORKINGPLANE_H -#define DIALOGBOX_WORKINGPLANE_H - -#include "SALOME_Selection.h" -#include "GEOM_FaceFilter.hxx" - -#include -#include -#include -#include - -#include -#include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QRadioButton; -class GeometryGUI; - - -//================================================================================= -// class : GeometryGUI_WorkingPlaneDlg -// purpose : -//================================================================================= -class GeometryGUI_WorkingPlaneDlg : public QDialog -{ - Q_OBJECT -public: - GeometryGUI_WorkingPlaneDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 ); - ~GeometryGUI_WorkingPlaneDlg(); - -private: - - void Init( SALOME_Selection* Sel ) ; - void closeEvent( QCloseEvent* e ) ; - void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */ - - Handle(GEOM_FaceFilter) myFaceFilter; /* filter for selection */ - GEOM::GEOM_Gen_var myGeom ; /* Current GeomI object */ - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - SALOME_Selection* mySelection ; /* User shape selection */ - - gp_Pnt myLoc; - gp_Dir myDir; - bool myOkPlane ; /* to check when arguments are defined */ - - int myConstructorId ; /* Current constructor id = radio button id */ - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - - QButtonGroup* GroupConstructors; - QRadioButton* Constructor1; - QGroupBox* GroupButtons; - QPushButton* buttonOk; - QPushButton* buttonCancel; - QPushButton* buttonApply; - QGroupBox* GroupC1; - QLabel* TextLabelC1A1; - QPushButton* SelectButtonC1A1; - QLineEdit* LineEditC1A1; - -private slots: - - void ConstructorsClicked(int constructorId); - void ClickOnOk(); - void ClickOnCancel(); - void ClickOnApply(); - void SetEditCurrentArgument() ; - void LineEditReturnPressed() ; - void SelectionIntoArgument() ; - void DeactivateActiveDialog() ; - void ActivateThisDialog() ; - -protected: - QGridLayout* GeometryGUI_WorkingPlaneDlgLayout; - QGridLayout* GroupConstructorsLayout; - QGridLayout* GroupButtonsLayout; - QGridLayout* GroupC1Layout; -}; - -#endif // DIALOGBOX_WORKINGPLANE_H diff --git a/src/GEOMGUI/GeometryGUI_aParameterDlg.cxx b/src/GEOMGUI/GeometryGUI_aParameterDlg.cxx deleted file mode 100644 index ef9f50514..000000000 --- a/src/GEOMGUI/GeometryGUI_aParameterDlg.cxx +++ /dev/null @@ -1,166 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_aParameterDlg.cxx -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -using namespace std; -#include "GeometryGUI_aParameterDlg.h" -#include "GeometryGUI.h" -#include "QAD_SpinBoxDbl.h" -#include "QAD_Tools.h" - -#include - -#include -#include -#include -#include -#include -#include - -//====================================================================================== -// function : GeometryGUI_aParameterDlg() -// purpose : Constructs a GeometryGUI_aParametertDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f' -// -// avalue1 : is a float or integer used as default value in edit line -// aTitle1 : is the prompt for aValue1 -// aTitle : is the title for the user in dialog box -// -// bottom : the minimal value to be entered -// top : the maximum value to be entered -// decimals : number of decimals to be entered -// -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -// -//====================================================================================== -GeometryGUI_aParameterDlg::GeometryGUI_aParameterDlg( const char *aValue1, - const char *aTitle1, - QWidget* parent, - const char* name, - bool modal, - WFlags fl, - const double bottom, - const double top, - const int decimals ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - if ( !name ) - setName( "MyParameterDialog" ); - resize( 288, 81 ); - setCaption( name ); /* appears on the title bar */ - setSizeGripEnabled( TRUE ); - - QGridLayout* topLayout = new QGridLayout( this ); - topLayout->setSpacing( 6 ); - topLayout->setMargin( 11 ); - - QGroupBox* mainGrp = new QGroupBox( this, "mainGrp" ); - mainGrp->setColumnLayout(0, Qt::Vertical ); - mainGrp->layout()->setSpacing( 0 ); - mainGrp->layout()->setMargin( 0 ); - QGridLayout* mainGrpLayout = new QGridLayout( mainGrp->layout() ); - mainGrpLayout->setAlignment( Qt::AlignTop ); - mainGrpLayout ->setSpacing( 6 ); - mainGrpLayout->setMargin( 11 ); - topLayout->addWidget( mainGrp, 0, 0 ); - - /* aTitle1 : text prompt on left of edit line */ - QLabel* TextLabel1 = new QLabel( mainGrp, "TextLabel1" ); - TextLabel1->setText( tr( aTitle1 ) ); - mainGrpLayout->addWidget( TextLabel1, 0, 0 ); - - mySpinBox = new QAD_SpinBoxDbl( mainGrp, "mySpinBox" ); - mySpinBox->setPrecision( 12); - mySpinBox->setRange( bottom, top ); - (( QDoubleValidator* )(mySpinBox->validator()))->setRange(bottom, top, decimals); - mySpinBox->setValue(QString(aValue1).toDouble()); - mainGrpLayout->addWidget( mySpinBox, 0, 1 ); - - QGroupBox* btnGrp = new QGroupBox( this, "btnGrp" ); - btnGrp->setColumnLayout(0, Qt::Vertical ); - btnGrp->layout()->setSpacing( 0 ); - btnGrp->layout()->setMargin( 0 ); - QGridLayout* btnGrpLayout = new QGridLayout( btnGrp->layout() ); - btnGrpLayout->setAlignment( Qt::AlignTop ); - btnGrpLayout->setSpacing( 6 ); - btnGrpLayout->setMargin( 11 ); - topLayout->addWidget( btnGrp, 1, 0 ); - - /* Ok button */ - myButtonOk = new QPushButton( btnGrp, "buttonOk" ); - myButtonOk->setText( tr("GEOM_BUT_OK") ); - myButtonOk->setAutoDefault( TRUE ); - myButtonOk->setDefault( TRUE ); - btnGrpLayout->addWidget( myButtonOk, 0, 0 ); - - btnGrpLayout->addItem( new QSpacerItem(5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 1 ); - - /* Cancel button */ - myButtonCancel = new QPushButton( btnGrp, "buttonCancel" ); - myButtonCancel->setText( tr("GEOM_BUT_CANCEL") ); - myButtonCancel->setAutoDefault( TRUE ); - btnGrpLayout->addWidget( myButtonCancel, 0, 2 ); - - /* signals and slots connections */ - connect( myButtonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); - connect( myButtonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); - - /* Retrieve GeomGUI */ - myGeomGUI = GeometryGUI::GetGeometryGUI() ; - - /* Move widget on the botton right corner of main widget */ - QAD_Tools::centerWidget(this, parent); -} - - -//====================================================================================== -// function : ~GeometryGUI_aParameterDlg() destructor -// purpose : Destroys the object and frees any allocated resources -//====================================================================================== -GeometryGUI_aParameterDlg::~GeometryGUI_aParameterDlg() -{ // no need to delete child widgets, Qt does it all for us -} - -//====================================================================================== -// function : GeometryGUI_aParameterDlg::setValue -// purpose : sets value -//====================================================================================== -void GeometryGUI_aParameterDlg::setValue( double val ) -{ - mySpinBox->setValue( val ); -} - -//====================================================================================== -// function : GeometryGUI_aParameterDlg::getValue -// purpose : gets value -//====================================================================================== -double GeometryGUI_aParameterDlg::getValue() -{ - return mySpinBox->value(); -} - diff --git a/src/GEOMGUI/GeometryGUI_aParameterDlg.h b/src/GEOMGUI/GeometryGUI_aParameterDlg.h deleted file mode 100644 index 6e65998a4..000000000 --- a/src/GEOMGUI/GeometryGUI_aParameterDlg.h +++ /dev/null @@ -1,71 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : GeometryGUI_aParameterDlg.h -// Author : Lucien PIGNOLONI -// Module : GEOM -// $Header$ - -#ifndef GeometryGUI_aParameterDLG_H -#define GeometryGUI_aParameterDLG_H - -#include - -class QPushButton; -class GeometryGUI; -class QAD_SpinBoxDbl; - -//================================================================================= -// class : GeometryGUI_aParameterDlg -// purpose : -//================================================================================= -class GeometryGUI_aParameterDlg : public QDialog -{ - Q_OBJECT - -public: - GeometryGUI_aParameterDlg( const char* aValue1 = "25", - const char* aTitle1 = "Value :", - QWidget* parent = 0, - const char* name = 0, - bool modal = FALSE, - WFlags fl = 0, - const double bottom = -1E6, - const double top = +1E6, - const int decimals = 6 ) ; - - ~GeometryGUI_aParameterDlg(); - - void setValue( double val ); - double getValue(); - -private: - GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ - - QPushButton* myButtonOk; - QPushButton* myButtonCancel; - QAD_SpinBoxDbl* mySpinBox; - -}; - -#endif // GeometryGUI_aParameterDlg.h diff --git a/src/GEOMGUI/PrimitiveGUI.cxx b/src/GEOMGUI/PrimitiveGUI.cxx deleted file mode 100644 index ac53ff02a..000000000 --- a/src/GEOMGUI/PrimitiveGUI.cxx +++ /dev/null @@ -1,239 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : PrimitiveGUI.cxx -// Author : Damien COQUERET -// Module : GEOM -// $Header: - -using namespace std; -#include "PrimitiveGUI.h" - -#include "QAD_Application.h" -#include "SALOMEGUI_QtCatchCorbaException.hxx" - -#include "GeometryGUI_BoxDlg.h" // Method BOX -#include "GeometryGUI_CylinderDlg.h" // Method CYLINDER -#include "GeometryGUI_SphereDlg.h" // Method SPHERE -#include "GeometryGUI_TorusDlg.h" // Method TORUS -#include "GeometryGUI_ConeDlg.h" // Method CONE - -//======================================================================= -// function : PrimitiveGUI() -// purpose : Constructor -//======================================================================= -PrimitiveGUI::PrimitiveGUI() : - QObject() -{ - myGeomGUI = GeometryGUI::GetGeometryGUI(); - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM"); - myGeom = GEOM::GEOM_Gen::_narrow(comp); -} - - -//======================================================================= -// function : ~PrimitiveGUI() -// purpose : Destructor -//======================================================================= -PrimitiveGUI::~PrimitiveGUI() -{ -} - - -//======================================================================= -// function : OnGUIEvent() -// purpose : -//======================================================================= -bool PrimitiveGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent) -{ - myGeomGUI->EmitSignalDeactivateDialog(); - SALOME_Selection* Sel = SALOME_Selection::Selection(myGeomGUI->GetActiveStudy()->getSelection()); - - switch (theCommandID) - { - case 3021: // BOX - { - GeometryGUI_BoxDlg *aDlg = new GeometryGUI_BoxDlg(parent, "", this, Sel); - break; - } - case 3022: // CYLINDER - { - GeometryGUI_CylinderDlg *aDlg = new GeometryGUI_CylinderDlg(parent, "", this, Sel); - break; - } - case 3023: // SPHERE - { - GeometryGUI_SphereDlg *aDlg = new GeometryGUI_SphereDlg(parent, "", this, Sel); - break; - } - case 3024: // TORUS - { - GeometryGUI_TorusDlg *aDlg = new GeometryGUI_TorusDlg(parent, "", this, Sel); - break; - } - case 3025: // CONE - { - GeometryGUI_ConeDlg *aDlg = new GeometryGUI_ConeDlg(parent, "", this, Sel); - break; - } - default: - { - parent->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID)); - break; - } - } - return true; -} - - -//======================================================================= -// function : MakeBoxAndDisplay() -// purpose : -//======================================================================= -void PrimitiveGUI::MakeBoxAndDisplay(const gp_Pnt P1, const gp_Pnt P2) -{ - try { - GEOM::GEOM_Shape_var box = myGeom->MakeBox(P1.X(), P1.Y(), P1.Z(), P2.X(), P2.Y(), P2.Z()); - box->NameType(tr("GEOM_BOX")); - if(myGeomGUI->Display(box, "")) - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE")); - } - catch(const SALOME::SALOME_Exception& S_ex) { - QtCatchCorbaException(S_ex); - } -} - - -//===================================================================================== -// function : MakeCylinderAndDisplay() -// purpose : -//===================================================================================== -void PrimitiveGUI::MakeCylinderAndDisplay(const gp_Pnt BasePoint, const gp_Dir aDir, - const double Radius, const double aHeight) -{ - try { - if(Radius <= Precision::Confusion() || aHeight <= Precision::Confusion()) - return; - - GEOM::PointStruct pstruct = myGeom->MakePointStruct(BasePoint.X(), BasePoint.Y(), BasePoint.Z()); - GEOM::PointStruct d = myGeom->MakePointStruct(aDir.X(), aDir.Y(), aDir.Z()); - GEOM::DirStruct dstruct = myGeom->MakeDirection(d); - - GEOM::GEOM_Shape_var result = myGeom->MakeCylinder(pstruct, dstruct, Radius, aHeight); - if (result->_is_nil()) { - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT")); - return; - } - result->NameType(tr("GEOM_CYLINDER")); - if(myGeomGUI->Display(result, "")) - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE")); - } - catch(const SALOME::SALOME_Exception& S_ex) { - QtCatchCorbaException(S_ex); - } - return; -} - - -//===================================================================================== -// function : MakeSphere() -// purpose : -//===================================================================================== -void PrimitiveGUI::MakeSphereAndDisplay(const gp_Pnt aCenterPoint, const double aRadius) -{ - try { - if(aRadius <= Precision::Confusion()) - return; - - GEOM::GEOM_Shape_ptr result = myGeom->MakeSphere(aCenterPoint.X(),aCenterPoint.Y(),aCenterPoint.Z(), aRadius); - result->NameType(tr("GEOM_SPHERE")); - if (myGeomGUI->Display(result, "")) - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE")); - } - catch (const SALOME::SALOME_Exception& S_ex) { - QtCatchCorbaException(S_ex); - } - return; -} - - -//===================================================================================== -// function : MakeTorusAndDisplay() -// purpose : -//===================================================================================== -void PrimitiveGUI::MakeTorusAndDisplay(const gp_Pnt BasePoint, const gp_Dir aDir, - const double Radius1, const double Radius2) -{ - try { - if(Radius1 <= Precision::Confusion() || Radius2 <= Precision::Confusion()) - return; - - GEOM::PointStruct pstruct = myGeom->MakePointStruct(BasePoint.X(), BasePoint.Y(), BasePoint.Z()); - GEOM::PointStruct d = myGeom ->MakePointStruct(aDir.X(), aDir.Y(), aDir.Z()); - GEOM::DirStruct dstruct = myGeom->MakeDirection(d); - - GEOM::GEOM_Shape_var result = myGeom->MakeTorus(pstruct, dstruct, Radius1, Radius2); - if(result->_is_nil()) { - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT")); - return; - } - result->NameType(tr("GEOM_TORUS")); - if(myGeomGUI->Display(result, "")) - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE")); - } - catch(const SALOME::SALOME_Exception& S_ex) { - QtCatchCorbaException(S_ex); - } - return; -} - - -//===================================================================================== -// function : MakeConeAndDisplay() -// purpose : -//===================================================================================== -void PrimitiveGUI::MakeConeAndDisplay(const gp_Pnt BasePoint, const gp_Dir aDir, - const double Radius1, const double Radius2, const double aHeight) -{ - try { - if((Radius1 <= Precision::Confusion() && Radius2 <= Precision::Confusion()) || aHeight <= Precision::Confusion()) - return; - - GEOM::PointStruct pstruct = myGeom->MakePointStruct(BasePoint.X(), BasePoint.Y(), BasePoint.Z()); - GEOM::PointStruct d = myGeom->MakePointStruct(aDir.X(), aDir.Y(), aDir.Z()); - GEOM::DirStruct dstruct = myGeom->MakeDirection(d); - - GEOM::GEOM_Shape_var result = myGeom->MakeCone(pstruct, dstruct, Radius1, Radius2, aHeight); - if(result->_is_nil()) { - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT")); - return; - } - result->NameType(tr("GEOM_CONE")); - if(myGeomGUI->Display(result, "")) - myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE")); - } - catch(const SALOME::SALOME_Exception& S_ex) { - QtCatchCorbaException(S_ex); - } - return; -} diff --git a/src/GEOMGUI/PrimitiveGUI.h b/src/GEOMGUI/PrimitiveGUI.h deleted file mode 100644 index 6f1867921..000000000 --- a/src/GEOMGUI/PrimitiveGUI.h +++ /dev/null @@ -1,65 +0,0 @@ -// GEOM GEOMGUI : GUI for Geometry component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : PrimitiveGUI.h -// Author : Damien COQUERET -// Module : GEOM -// $Header: - -#ifndef PRIMITIVEGUI_H -#define PRIMITIVEGUI_H - -#include "GeometryGUI.h" - -#include - -//================================================================================= -// class : PrimitiveGUI -// purpose : -//================================================================================= -class PrimitiveGUI : public QObject -{ - Q_OBJECT /* for QT compatibility */ - -public : - PrimitiveGUI(); - ~PrimitiveGUI(); - - bool OnGUIEvent(int theCommandID, QAD_Desktop* parent); - - void MakeBoxAndDisplay(const gp_Pnt P1, const gp_Pnt P2); - void MakeCylinderAndDisplay(const gp_Pnt BasePoint, const gp_Dir aDir, - const double Radius, const double aHeight); - void MakeSphereAndDisplay(const gp_Pnt aCenterPoint, const double aRadius); - void MakeTorusAndDisplay(const gp_Pnt BasePoint, const gp_Dir aDir, - const double Radius1, const double Radius2); - void MakeConeAndDisplay(const gp_Pnt BasePoint, const gp_Dir aDir, - const double Radius1, const double Radius2, const double aHeight); - -private: - GeometryGUI* myGeomGUI; - GEOM::GEOM_Gen_var myGeom; /* Current Geom Component */ - -}; - -#endif -- 2.39.2