</message>
<message>
<source>GEOM_MINDIST_NO_SOL</source>
- <translation>No solution found</translation>
+ <translation type="unfinished">No solution found</translation>
</message>
<message>
<source>GEOM_MINDIST_OBJ</source>
<translation>Objects And Results</translation>
</message>
+ <message>
+ <source>GEOM_MINDIST_PUBLISH_TITLE</source>
+ <translation type="unfinished">Multiple solutions found</translation>
+ </message>
+ <message>
+ <source>GEOM_MINDIST_PUBLISH_TEXT</source>
+ <translation type="unfinished">Do you want to publish in the study all found solutions? If No, only the currently selected solution will be published.</translation>
+ </message>
<message>
<source>GEOM_MINDIST_TITLE</source>
<translation>Minimun Distance Between Two Objects</translation>
<source>GEOM_MIN</source>
<translation>Min :</translation>
</message>
+ <message>
+ <source>GEOM_MINDIST_NAME</source>
+ <translation type="unfinished">MinDist</translation>
+ </message>
+ <message>
+ <source>GEOM_MINDIST_NO_SOL</source>
+ <translation type="unfinished">No solution found</translation>
+ </message>
<message>
<source>GEOM_MINDIST_OBJ</source>
<translation>Objets et résultats</translation>
</message>
+ <message>
+ <source>GEOM_MINDIST_PUBLISH_TITLE</source>
+ <translation type="unfinished">Multiple solutions found</translation>
+ </message>
+ <message>
+ <source>GEOM_MINDIST_PUBLISH_TEXT</source>
+ <translation type="unfinished">Do you want to publish in the study all found solutions? If No, only the currently selected solution will be published.</translation>
+ </message>
<message>
<source>GEOM_MINDIST_TITLE</source>
<translation>Distance minimale entre deux objets</translation>
#include <SUIT_ViewWindow.h>
#include <SUIT_ViewManager.h>
#include <SUIT_OverrideCursor.h>
+#include <SUIT_MessageBox.h>
#include <SOCC_Prs.h>
#include <SOCC_ViewModel.h>
#include <SalomeApp_Tools.h>
int nbSols = anOper->ClosestPoints(myObj1, myObj2, aDbls);
if (anOper->IsDone()) {
- for (int i = 0; i < nbSols; i++) {
- GEOM::GEOM_Object_var anObj1 = aBasicOper->MakePointXYZ(aDbls[i*6 + 0], aDbls[i*6 + 1], aDbls[i*6 + 2]);
- GEOM::GEOM_Object_var anObj2 = aBasicOper->MakePointXYZ(aDbls[i*6 + 3], aDbls[i*6 + 4], aDbls[i*6 + 5]);
+ bool doPublishAll = true;
+ if (nbSols > 1) {
+ QMessageBox::StandardButton anAnswer =
+ SUIT_MessageBox::question(this, tr("GEOM_MINDIST_PUBLISH_TITLE"),
+ tr("GEOM_MINDIST_PUBLISH_TEXT"),
+ QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel,
+ QMessageBox::No);
+ if (anAnswer == QMessageBox::No)
+ doPublishAll = false;
+ else if (anAnswer != QMessageBox::Yes)
+ return true;
+ }
+ if (doPublishAll) {
+ for (int i = 0; i < nbSols; i++) {
+ GEOM::GEOM_Object_var anObj1 =
+ aBasicOper->MakePointXYZ(aDbls[i*6 + 0], aDbls[i*6 + 1], aDbls[i*6 + 2]);
+ GEOM::GEOM_Object_var anObj2 =
+ aBasicOper->MakePointXYZ(aDbls[i*6 + 3], aDbls[i*6 + 4], aDbls[i*6 + 5]);
+
+ if (!anObj1->_is_nil() && !anObj2->_is_nil()) {
+ objects.push_back(anObj1._retn());
+ objects.push_back(anObj2._retn());
+ }
+ }
+ }
+ else {
+ int i = myGrp->ComboBox1->currentIndex();
+ GEOM::GEOM_Object_var anObj1 =
+ aBasicOper->MakePointXYZ(aDbls[i*6 + 0], aDbls[i*6 + 1], aDbls[i*6 + 2]);
+ GEOM::GEOM_Object_var anObj2 =
+ aBasicOper->MakePointXYZ(aDbls[i*6 + 3], aDbls[i*6 + 4], aDbls[i*6 + 5]);
if (!anObj1->_is_nil() && !anObj2->_is_nil()) {
objects.push_back(anObj1._retn());