-// Copyright (C) 2011-2013 CEA/DEN, EDF R&D
+// Copyright (C) 2011-2014 CEA/DEN, EDF R&D
//
// 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.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-using namespace std;
-
#include "MonCreateZone.h"
#include "MonCreateHypothesis.h"
#include <SUIT_Session.h>
#include <SUIT_ViewManager.h>
+using namespace std;
+
// ----------------------------------------------------------------------
MonCreateZone::MonCreateZone(MonCreateHypothesis* parent, bool modal,
HOMARD::HOMARD_Gen_var myHomardGen0,
}
// Rayons
SpinBox_Rayon->setSingleStep(_Rayon/10.) ;
- SpinBox_Rayon->setMinimum(0.) ;
SpinBox_Radius->setSingleStep(_Rayon/10.) ;
- SpinBox_Radius->setMinimum(0.) ;
SpinBox_Radius_int->setSingleStep(_Rayon/20.) ;
- SpinBox_Radius_int->setMinimum(0.) ;
SpinBox_Radius_ext->setSingleStep(_Rayon/10.) ;
- SpinBox_Radius_ext->setMinimum(0.) ;
// Axe et hauteur
// Si une coordonnee est constante, inutile de demander l'axe et la hauteur
if ( _Orient > 0) {
TLHaut_p->setVisible(0) ;
}
else {
- SpinBox_Haut->setMinimum(0.) ;
SpinBox_Haut->setSingleStep(_Rayon/10.) ;
- SpinBox_Haut_p->setMinimum(0.) ;
SpinBox_Haut_p->setSingleStep(_Rayon/10.) ;
}
}
{ }
case 2 : // il s agit d un parallelipipede rectangle
{
- if ( (_ZoneXmin != SpinBox_Xmini->value()) or
- (_ZoneXmax != SpinBox_Xmaxi->value()) or
- (_ZoneYmin != SpinBox_Ymini->value()) or
- (_ZoneYmax != SpinBox_Ymaxi->value()) or
- (_ZoneZmin != SpinBox_Zmini->value()) or
+ if ( (_ZoneXmin != SpinBox_Xmini->value()) ||
+ (_ZoneXmax != SpinBox_Xmaxi->value()) ||
+ (_ZoneYmin != SpinBox_Ymini->value()) ||
+ (_ZoneYmax != SpinBox_Ymaxi->value()) ||
+ (_ZoneZmin != SpinBox_Zmini->value()) ||
(_ZoneZmax != SpinBox_Zmaxi->value()) )
{
Chgt = true;
}
case 4 : // il s agit d une sphere
{
- if ( (_ZoneXcentre != SpinBox_Xcentre->value()) or
- (_ZoneYcentre != SpinBox_Ycentre->value()) or
- (_ZoneZcentre != SpinBox_Zbase->value()) or
+ if ( (_ZoneXcentre != SpinBox_Xcentre->value()) ||
+ (_ZoneYcentre != SpinBox_Ycentre->value()) ||
+ (_ZoneZcentre != SpinBox_Zbase->value()) ||
(_ZoneRayon != SpinBox_Rayon->value()) )
{
Chgt = true;
{ }
case 5 : // il s agit d un cylindre
{
- if ( (_ZoneXcentre != SpinBox_Xbase->value()) or
- (_ZoneYcentre != SpinBox_Ybase->value()) or
- (_ZoneZcentre != SpinBox_Zbase->value()) or
- (_ZoneRayon != SpinBox_Radius->value()) or
- (_ZoneHaut != SpinBox_Haut->value()) or
- (_ZoneXaxis != SpinBox_Xaxis->value()) or
- (_ZoneYaxis != SpinBox_Yaxis->value()) or
+ if ( (_ZoneXcentre != SpinBox_Xbase->value()) ||
+ (_ZoneYcentre != SpinBox_Ybase->value()) ||
+ (_ZoneZcentre != SpinBox_Zbase->value()) ||
+ (_ZoneRayon != SpinBox_Radius->value()) ||
+ (_ZoneHaut != SpinBox_Haut->value()) ||
+ (_ZoneXaxis != SpinBox_Xaxis->value()) ||
+ (_ZoneYaxis != SpinBox_Yaxis->value()) ||
(_ZoneZaxis != SpinBox_Zaxis->value()) )
{
Chgt = true;
{ }
case 7 : // il s agit d un tuyau
{
- if ( (_ZoneXcentre != SpinBox_Xbase_p->value()) or
- (_ZoneYcentre != SpinBox_Ybase_p->value()) or
- (_ZoneZcentre != SpinBox_Zbase_p->value()) or
- (_ZoneRayonInt != SpinBox_Radius_int->value()) or
- (_ZoneRayon != SpinBox_Radius_ext->value()) or
- (_ZoneHaut != SpinBox_Haut_p->value()) or
- (_ZoneXaxis != SpinBox_Xaxis_p->value()) or
- (_ZoneYaxis != SpinBox_Yaxis_p->value()) or
+ if ( (_ZoneXcentre != SpinBox_Xbase_p->value()) ||
+ (_ZoneYcentre != SpinBox_Ybase_p->value()) ||
+ (_ZoneZcentre != SpinBox_Zbase_p->value()) ||
+ (_ZoneRayonInt != SpinBox_Radius_int->value()) ||
+ (_ZoneRayon != SpinBox_Radius_ext->value()) ||
+ (_ZoneHaut != SpinBox_Haut_p->value()) ||
+ (_ZoneXaxis != SpinBox_Xaxis_p->value()) ||
+ (_ZoneYaxis != SpinBox_Yaxis_p->value()) ||
(_ZoneZaxis != SpinBox_Zaxis_p->value()) )
{
Chgt = true;
// Controles
// Pour un rectangle ou un parallelepipede :
- if ( ( _Type >= 11 and _Type <= 13 ) or _Type == 2 )
+ if ( ( _Type >= 11 && _Type <= 13 ) || _Type == 2 )
{
- if ((_ZoneXmin >= _ZoneXmax) and (_Xincr > 0)) {
+ if ((_ZoneXmin >= _ZoneXmax) && (_Xincr > 0)) {
QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
QObject::tr("HOM_ZONE_LIMIT").arg("X") ) ;
return false; }
- if ((_ZoneYmin >= _ZoneYmax) and (_Yincr > 0)) {
+ if ((_ZoneYmin >= _ZoneYmax) && (_Yincr > 0)) {
QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
QObject::tr("HOM_ZONE_LIMIT").arg("Y") ) ;
return false; }
- if ((_ZoneZmin >= _ZoneZmax) and (_Zincr > 0)) {
+ if ((_ZoneZmin >= _ZoneZmax) && (_Zincr > 0)) {
QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
QObject::tr("HOM_ZONE_LIMIT").arg("Z") ) ;
return false; }
}
// L'axe pour un cylindre ou un tuyau :
- if ( _Type == 5 or _Type == 7 )
+ if ( _Type == 5 || _Type == 7 )
{
double daux = _ZoneXaxis*_ZoneXaxis + _ZoneYaxis*_ZoneYaxis + _ZoneZaxis*_ZoneZaxis ;
if ( daux < 0.0000001 )
}
}
// Rayons pour disque avec trou ou un tuyau :
- if ( ( _Type >= 61 and _Type <= 63 ) or _Type == 7 )
+ if ( ( _Type >= 61 && _Type <= 63 ) || _Type == 7 )
{
if ( _ZoneRayonInt >= _ZoneRayon )
{
void MonCreateZone::PushOnHelp()
// ------------------------------------------------------------------------
{
- char* LanguageShort = myHomardGen->GetLanguageShort();
- HOMARD_UTILS::PushOnHelp(QString("gui_create_zone.html"), QString(""), QString(LanguageShort));
+ std::string LanguageShort = myHomardGen->GetLanguageShort();
+ HOMARD_UTILS::PushOnHelp(QString("gui_create_zone.html"), QString(""), QString(LanguageShort.c_str()));
}
// -----------------------------------
{
if ( aName == QString(MyObjects[i]))
{
- num=num+1;
- aName="";
- break;
+ num ++ ;
+ aName = "" ;
+ break ;
}
}
}