Regression of Offset dialog: result shape not published

+ fix some warnings and memory leaks
This commit is contained in:
eap 2017-12-29 17:42:48 +03:00
parent 14bd7e1d70
commit b9104d97c5
10 changed files with 146 additions and 133 deletions

View File

@ -109,7 +109,7 @@ AdvancedGUI_SmoothingSurfaceDlg::~AdvancedGUI_SmoothingSurfaceDlg()
void AdvancedGUI_SmoothingSurfaceDlg::Init() void AdvancedGUI_SmoothingSurfaceDlg::Init()
{ {
// Get setting of step value from file configuration // Get setting of step value from file configuration
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); //SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
initSpinBox(myDMaxSpin, 0., COORD_MAX, 0.00001, "parametric_precision" ); initSpinBox(myDMaxSpin, 0., COORD_MAX, 0.00001, "parametric_precision" );

View File

@ -297,8 +297,8 @@ bool EntityGUI::OnMousePress( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWi
bool EntityGUI::OnMouseRelease( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWindow* theViewWindow ) bool EntityGUI::OnMouseRelease( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWindow* theViewWindow )
{ {
((OCCViewer_ViewWindow*)theViewWindow)->setSketcherStyle(false); ((OCCViewer_ViewWindow*)theViewWindow)->setSketcherStyle(false);
QDialog* aDlg = getGeometryGUI()->GetActiveDialogBox();
#ifdef WITH_OPENCV #ifdef WITH_OPENCV
QDialog* aDlg = getGeometryGUI()->GetActiveDialogBox();
if ( aDlg && ( QString( aDlg->metaObject()->className() ).compare( "EntityGUI_FeatureDetectorDlg" ) == 0 ) && if ( aDlg && ( QString( aDlg->metaObject()->className() ).compare( "EntityGUI_FeatureDetectorDlg" ) == 0 ) &&
theViewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() && theViewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() &&
pe->modifiers() != Qt::ControlModifier ) pe->modifiers() != Qt::ControlModifier )

View File

@ -145,10 +145,10 @@ void GEOMBase_Helper::display( GEOM::GEOM_Object_ptr object, const bool updateVi
{ {
// Unset color of shape ( this color may be set during preview displaying ) // Unset color of shape ( this color may be set during preview displaying )
// Default color will be used // Default color will be used
// getDisplayer()->UnsetColor(); // getDisplayer()->UnsetColor();
getDisplayer()->UnsetWidth(); getDisplayer()->UnsetWidth();
MESSAGE("GEOMBase_Helper::display myTexture = "<<getDisplayer()->GetTexture()) MESSAGE("GEOMBase_Helper::display myTexture = "<<getDisplayer()->GetTexture());
// Enable activisation of selection // Enable activisation of selection
getDisplayer()->SetToActivate( true ); getDisplayer()->SetToActivate( true );
@ -179,9 +179,11 @@ void GEOMBase_Helper::erase( GEOM::GEOM_Object_ptr object, const bool updateView
{ {
if ( !object->_is_nil() ) { if ( !object->_is_nil() ) {
QString entry = getEntry( object ); QString entry = getEntry( object );
getDisplayer()->Erase( new SALOME_InteractiveObject( QString name = GEOMBase::GetName( object );
entry.toLatin1().constData(), getDisplayer()->Erase ( new SALOME_InteractiveObject(entry.toLatin1().constData(),
"GEOM", strdup( GEOMBase::GetName( object ).toLatin1().constData() ) ), true, updateView ); "GEOM",
name.toLatin1().constData() ),
true, updateView );
} }
} }
@ -219,8 +221,12 @@ void GEOMBase_Helper::redisplay( GEOM::GEOM_Object_ptr object,
getDisplayer()->SetToActivate( true ); getDisplayer()->SetToActivate( true );
QString entry = getEntry( object ); QString entry = getEntry( object );
getDisplayer()->Redisplay(new SALOME_InteractiveObject QString name = GEOMBase::GetName( object );
(entry.toLatin1().constData(), "GEOM", strdup(GEOMBase::GetName(object).toLatin1().constData())), false); getDisplayer()->Redisplay
(new SALOME_InteractiveObject (entry.toLatin1().constData(),
"GEOM",
name.toLatin1().constData()),
false);
} }
if ( withChildren ) { if ( withChildren ) {
@ -237,8 +243,12 @@ void GEOMBase_Helper::redisplay( GEOM::GEOM_Object_ptr object,
if ( !CORBA::is_nil( aChild ) ) { if ( !CORBA::is_nil( aChild ) ) {
if ( !aChild->_is_nil() ) { if ( !aChild->_is_nil() ) {
QString entry = getEntry( aChild ); QString entry = getEntry( aChild );
getDisplayer()->Redisplay( new SALOME_InteractiveObject( QString name = GEOMBase::GetName( aChild );
entry.toLatin1().constData(), "GEOM", strdup( GEOMBase::GetName( aChild ).toLatin1().constData() ) ), false ); getDisplayer()->Redisplay
( new SALOME_InteractiveObject( entry.toLatin1().constData(),
"GEOM",
name.toLatin1().constData() ),
false );
} }
} }
} }
@ -267,7 +277,7 @@ void GEOMBase_Helper::displayPreview( const bool display,
erasePreview( update ); erasePreview( update );
return; return;
} }
isPreview = true; isPreview = true;
QString msg; QString msg;
if ( !isValid( msg ) ) if ( !isValid( msg ) )
@ -283,20 +293,20 @@ void GEOMBase_Helper::displayPreview( const bool display,
try { try {
SUIT_OverrideCursor wc; SUIT_OverrideCursor wc;
ObjectList objects; ObjectList objects;
if ( !isWaitCursorEnabled() ) if ( !isWaitCursorEnabled() )
wc.suspend(); wc.suspend();
if ( !execute( objects ) || !getOperation()->IsDone() ) { if ( !execute( objects ) || !getOperation()->IsDone() ) {
wc.suspend(); wc.suspend();
} }
else { else {
for ( ObjectList::iterator it = objects.begin(); it != objects.end(); ++it ) for ( ObjectList::iterator it = objects.begin(); it != objects.end(); ++it )
{ {
GEOM::GEOM_Object_var obj=*it; GEOM::GEOM_Object_var obj = *it;
displayPreview( obj, true, activate, false, lineWidth, displayMode, color ); displayPreview( obj, true, activate, false, lineWidth, displayMode, color );
if ( toRemoveFromEngine ) if ( toRemoveFromEngine )
obj->UnRegister(); obj->UnRegister();
} }
} }
} }
@ -322,7 +332,7 @@ void GEOMBase_Helper::displayPreview( GEOM::GEOM_Object_ptr object,
const int displayMode, const int displayMode,
const int color ) const int color )
{ {
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
// Set color for preview shape // Set color for preview shape
getDisplayer()->SetColor( color == -1 ? Quantity_NOC_VIOLET : color ); getDisplayer()->SetColor( color == -1 ? Quantity_NOC_VIOLET : color );
@ -344,7 +354,7 @@ void GEOMBase_Helper::displayPreview( GEOM::GEOM_Object_ptr object,
SALOME_Prs* aPrs = getDisplayer()->BuildPrs( object ); SALOME_Prs* aPrs = getDisplayer()->BuildPrs( object );
if ( aPrs == 0 || aPrs->IsNull() ) if ( aPrs == 0 || aPrs->IsNull() )
return; return;
// Make preview not clippable // Make preview not clippable
aPrs->SetClippable (false); aPrs->SetClippable (false);
@ -375,17 +385,17 @@ void GEOMBase_Helper::displayPreview( const SALOME_Prs* prs,
if ( myViewWindow == 0 ) if ( myViewWindow == 0 )
return; return;
// Display prs // Display prs
SUIT_ViewManager* aViewManager = myViewWindow->getViewManager(); SUIT_ViewManager* aViewManager = myViewWindow->getViewManager();
if ( aViewManager->getType() == OCCViewer_Viewer::Type() || if ( aViewManager->getType() == OCCViewer_Viewer::Type() ||
aViewManager->getType() == SVTK_Viewer::Type() ) aViewManager->getType() == SVTK_Viewer::Type() )
{ {
SUIT_ViewModel* aViewModel = aViewManager->getViewModel(); SUIT_ViewModel* aViewModel = aViewManager->getViewModel();
SALOME_View* aView = dynamic_cast<SALOME_View*>(aViewModel); SALOME_View* aView = dynamic_cast<SALOME_View*>(aViewModel);
if (aView) if (aView)
aView->Display( getDisplayer(), prs ); aView->Display( getDisplayer(), prs );
} }
// Add prs to the preview list // Add prs to the preview list
myPreview.push_back( (SALOME_Prs*)prs ); myPreview.push_back( (SALOME_Prs*)prs );
@ -478,8 +488,11 @@ void GEOMBase_Helper::localSelection( const ObjectList& theObjs, const std::list
continue; continue;
QString anEntry = getEntry( anObj ); QString anEntry = getEntry( anObj );
if ( anEntry != "" ) if ( anEntry != "" )
aListOfIO.Append( new SALOME_InteractiveObject( {
anEntry.toLatin1().constData(), "GEOM", strdup( GEOMBase::GetName( anObj ).toLatin1().constData() ) ) ); QString aName = GEOMBase::GetName( anObj );
aListOfIO.Append( new SALOME_InteractiveObject( anEntry.toLatin1().constData(),
"GEOM", aName.toLatin1().constData() ));
}
} }
getDisplayer()->LocalSelection( aListOfIO, modes ); getDisplayer()->LocalSelection( aListOfIO, modes );
@ -685,11 +698,11 @@ SalomeApp_Study* GEOMBase_Helper::getStudy() const
SUIT_Application* anApp = 0; SUIT_Application* anApp = 0;
QListIterator<SUIT_Application*> it( anAppList ); QListIterator<SUIT_Application*> it( anAppList );
while ( it.hasNext() ) while ( it.hasNext() )
{ {
anApp = it.next(); anApp = it.next();
if ( anApp && anApp->desktop() == aDesktop ) if ( anApp && anApp->desktop() == aDesktop )
break; break;
} }
return dynamic_cast<SalomeApp_Study*>(anApp->activeStudy()); return dynamic_cast<SalomeApp_Study*>(anApp->activeStudy());
} }
@ -742,7 +755,7 @@ bool GEOMBase_Helper::openCommand()
if ( !getStudy() || hasCommand() ) if ( !getStudy() || hasCommand() )
{ {
MESSAGE("Getting out from openCommand()") MESSAGE("Getting out from openCommand()")
return res; return res;
} }
GEOM::GEOM_IOperations_var anOp = GEOM::GEOM_IOperations::_narrow( getOperation() ); GEOM::GEOM_IOperations_var anOp = GEOM::GEOM_IOperations::_narrow( getOperation() );
@ -754,7 +767,7 @@ bool GEOMBase_Helper::openCommand()
else else
{ {
MESSAGE("anOp->_is_nil() = true") MESSAGE("anOp->_is_nil() = true")
} }
return res; return res;
} }
@ -824,10 +837,10 @@ bool GEOMBase_Helper::checkViewWindow()
QList<SUIT_ViewWindow*> aViewWindowsList = SUIT_Session::session()->activeApplication()->desktop()->windows(); QList<SUIT_ViewWindow*> aViewWindowsList = SUIT_Session::session()->activeApplication()->desktop()->windows();
QListIterator<SUIT_ViewWindow*> it( aViewWindowsList ); QListIterator<SUIT_ViewWindow*> it( aViewWindowsList );
while ( it.hasNext() ) while ( it.hasNext() )
{ {
if ( myViewWindow == it.next() ) if ( myViewWindow == it.next() )
return true; return true;
} }
} }
myViewWindow = 0; myViewWindow = 0;
return false; return false;
@ -842,10 +855,10 @@ bool GEOMBase_Helper::checkViewWindow()
bool GEOMBase_Helper::onAccept( const bool publish, const bool useTransaction, bool erasePreviewFlag ) bool GEOMBase_Helper::onAccept( const bool publish, const bool useTransaction, bool erasePreviewFlag )
{ {
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() ); SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
if ( !appStudy ) if ( !appStudy )
{ {
MESSAGE("appStudy is empty") MESSAGE("appStudy is empty")
return false; return false;
} }
_PTR(Study) aStudy = appStudy->studyDS(); _PTR(Study) aStudy = appStudy->studyDS();
@ -864,7 +877,7 @@ bool GEOMBase_Helper::onAccept( const bool publish, const bool useTransaction, b
showError( msg ); showError( msg );
return false; return false;
} }
if(erasePreviewFlag) if(erasePreviewFlag)
erasePreview( false ); erasePreview( false );
@ -892,21 +905,21 @@ bool GEOMBase_Helper::onAccept( const bool publish, const bool useTransaction, b
QString aName = getObjectName(obj); QString aName = getObjectName(obj);
if (aName.isEmpty()) { if (aName.isEmpty()) {
aName = getNewObjectName(currObj); aName = getNewObjectName(currObj);
if ( nbObjs > 1 ) { if ( nbObjs > 1 ) {
if (aName.isEmpty()) if (aName.isEmpty())
aName = getPrefix(obj); aName = getPrefix(obj);
if (nbObjs <= 30) { if (nbObjs <= 30) {
// Try to find a unique name // Try to find a unique name
aName = GEOMBase::GetDefaultName(aName, extractPrefix()); aName = GEOMBase::GetDefaultName(aName, extractPrefix());
} else { } else {
// Don't check name uniqueness in case of numerous objects // Don't check name uniqueness in case of numerous objects
aName = aName + "_" + QString::number(aNumber++); aName = aName + "_" + QString::number(aNumber++);
} }
} else { } else {
// PAL6521: use a prefix, if some dialog box doesn't reimplement getNewObjectName() // PAL6521: use a prefix, if some dialog box doesn't reimplement getNewObjectName()
if ( aName.isEmpty() ) if ( aName.isEmpty() )
aName = GEOMBase::GetDefaultName( getPrefix( obj ) ); aName = GEOMBase::GetDefaultName( getPrefix( obj ) );
} }
} }
anEntryList << addInStudy( obj, aName.toLatin1().constData() ); anEntryList << addInStudy( obj, aName.toLatin1().constData() );
// updateView=false // updateView=false
@ -956,12 +969,12 @@ bool GEOMBase_Helper::onAccept( const bool publish, const bool useTransaction, b
SalomeApp_Tools::QtCatchCorbaException( e ); SalomeApp_Tools::QtCatchCorbaException( e );
abortCommand(); abortCommand();
MESSAGE("Exception caught") MESSAGE("Exception caught")
} }
updateViewer(); updateViewer();
MESSAGE("result ="<<result) MESSAGE("result ="<<result)
return result; return result;
} }
@ -1083,15 +1096,15 @@ QString GEOMBase_Helper::getPrefix( GEOM::GEOM_Object_ptr theObj ) const
switch ( aType ) switch ( aType )
{ {
case GEOM::VERTEX : return QObject::tr( "GEOM_VERTEX" ); case GEOM::VERTEX : return QObject::tr( "GEOM_VERTEX" );
case GEOM::EDGE : return QObject::tr( "GEOM_EDGE" ); case GEOM::EDGE : return QObject::tr( "GEOM_EDGE" );
case GEOM::WIRE : return QObject::tr( "GEOM_WIRE" ); case GEOM::WIRE : return QObject::tr( "GEOM_WIRE" );
case GEOM::FACE : return QObject::tr( "GEOM_FACE" ); case GEOM::FACE : return QObject::tr( "GEOM_FACE" );
case GEOM::SHELL : return QObject::tr( "GEOM_SHELL" ); case GEOM::SHELL : return QObject::tr( "GEOM_SHELL" );
case GEOM::SOLID : return QObject::tr( "GEOM_SOLID" ); case GEOM::SOLID : return QObject::tr( "GEOM_SOLID" );
case GEOM::COMPSOLID: return QObject::tr( "GEOM_COMPOUNDSOLID" ); case GEOM::COMPSOLID: return QObject::tr( "GEOM_COMPOUNDSOLID" );
case GEOM::COMPOUND : return QObject::tr( "GEOM_COMPOUND" ); case GEOM::COMPOUND : return QObject::tr( "GEOM_COMPOUND" );
default : return ""; default : return "";
} }
} }
@ -1162,7 +1175,7 @@ GEOM::GEOM_Object_ptr GEOMBase_Helper::findObjectInFather (GEOM::GEOM_Object_ptr
} }
if (inStudy) if (inStudy)
return aReturnObject._retn(); return aReturnObject._retn();
return GEOM::GEOM_Object::_nil(); return GEOM::GEOM_Object::_nil();
} }
@ -1175,7 +1188,7 @@ GEOM::GEOM_Object_ptr GEOMBase_Helper::findObjectInFather( GEOM::GEOM_Object_ptr
int theIndex ) int theIndex )
{ {
GEOM::GEOM_Object_var object; GEOM::GEOM_Object_var object;
SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() ); SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
if ( study ) { if ( study ) {
_PTR(Study) studyDS = study->studyDS(); _PTR(Study) studyDS = study->studyDS();
@ -1197,7 +1210,7 @@ GEOM::GEOM_Object_ptr GEOMBase_Helper::findObjectInFather( GEOM::GEOM_Object_ptr
} }
} }
} }
return object._retn(); return object._retn();
} }
@ -1228,7 +1241,7 @@ QList<GEOM::GeomObjPtr> GEOMBase_Helper::getSourceObjects()
// Returns valid object if only one object of the specified type is selected // Returns valid object if only one object of the specified type is selected
// (no matter global or local selection is activated). If \a type is TopAbs_SHAPE, // (no matter global or local selection is activated). If \a type is TopAbs_SHAPE,
// geometrical object of any valid type is expected. // geometrical object of any valid type is expected.
// //
// \param type type of the object to be obtained from selection // \param type type of the object to be obtained from selection
// \return selected geometrical object or nil object if selection is not satisfactory // \return selected geometrical object or nil object if selection is not satisfactory
//================================================================ //================================================================
@ -1247,7 +1260,7 @@ GEOM::GeomObjPtr GEOMBase_Helper::getSelected( TopAbs_ShapeEnum type )
// (no matter global or local selection is activated). The list of allowed // (no matter global or local selection is activated). The list of allowed
// shape types is passed via \a types. If \a types includes TopAbs_SHAPE, // shape types is passed via \a types. If \a types includes TopAbs_SHAPE,
// geometrical object of any valid type is expected. // geometrical object of any valid type is expected.
// //
// \param types list of allowed shape types for the objects to be obtained from selection // \param types list of allowed shape types for the objects to be obtained from selection
// \return selected geometrical object or nil object if selection is not satisfactory // \return selected geometrical object or nil object if selection is not satisfactory
//================================================================ //================================================================
@ -1267,7 +1280,7 @@ GEOM::GeomObjPtr GEOMBase_Helper::getSelected( const QList<TopAbs_ShapeEnum>& ty
// //
// The \a type parameter specifies allowed type of the object(s) being selected. // The \a type parameter specifies allowed type of the object(s) being selected.
// The \a count parameter specifies exact number of the objects to be retrieved from selection. // The \a count parameter specifies exact number of the objects to be retrieved from selection.
// The \a strict parameter specifies policy being applied to the selection. // The \a strict parameter specifies policy being applied to the selection.
// If \a count < 0, then any number of the selected objects is valid (including 0). // If \a count < 0, then any number of the selected objects is valid (including 0).
// In this case, if \a strict is \c true (default), all selected objects should satisfy // In this case, if \a strict is \c true (default), all selected objects should satisfy
// the specified \a type. // the specified \a type.
@ -1275,7 +1288,7 @@ GEOM::GeomObjPtr GEOMBase_Helper::getSelected( const QList<TopAbs_ShapeEnum>& ty
// In this case, if \a strict is \c true (default), function returns empty list if total number of selected // In this case, if \a strict is \c true (default), function returns empty list if total number of selected
// objects does not correspond to the \a count parameter. Otherwise (if \a strict is \c false), // objects does not correspond to the \a count parameter. Otherwise (if \a strict is \c false),
// function returns valid list of objects if at least \a count objects satisfy specified \a type. // function returns valid list of objects if at least \a count objects satisfy specified \a type.
// //
// \param type type of the object(s) to be obtained from selection // \param type type of the object(s) to be obtained from selection
// \param count number of items to be retrieved from selection // \param count number of items to be retrieved from selection
// \param strict selection policy // \param strict selection policy
@ -1306,7 +1319,7 @@ static bool typeInList( TopAbs_ShapeEnum type, const QList<TopAbs_ShapeEnum>& ty
// //
// The \a types parameter specifies allowed types of the object(s) being selected. // The \a types parameter specifies allowed types of the object(s) being selected.
// The \a count parameter specifies exact number of the objects to be retrieved from selection. // The \a count parameter specifies exact number of the objects to be retrieved from selection.
// The \a strict parameter specifies policy being applied to the selection. // The \a strict parameter specifies policy being applied to the selection.
// If \a count < 0, then any number of the selected objects is valid (including 0). // If \a count < 0, then any number of the selected objects is valid (including 0).
// In this case, if \a strict is \c true (default), all selected objects should satisfy // In this case, if \a strict is \c true (default), all selected objects should satisfy
// the specified \a type. // the specified \a type.
@ -1314,7 +1327,7 @@ static bool typeInList( TopAbs_ShapeEnum type, const QList<TopAbs_ShapeEnum>& ty
// In this case, if \a strict is \c true (default), function returns empty list if total number of selected // In this case, if \a strict is \c true (default), function returns empty list if total number of selected
// objects does not correspond to the \a count parameter. Otherwise (if \a strict is \c false), // objects does not correspond to the \a count parameter. Otherwise (if \a strict is \c false),
// function returns valid list of objects if at least \a count objects satisfy specified \a type. // function returns valid list of objects if at least \a count objects satisfy specified \a type.
// //
// \param types list of allowed shape types for the objects to be obtained from selection // \param types list of allowed shape types for the objects to be obtained from selection
// \param count number of items to be retrieved from selection // \param count number of items to be retrieved from selection
// \param strict selection policy // \param strict selection policy

View File

@ -327,11 +327,11 @@ GEOM::GEOM_Object_ptr GroupGUI_BooleanDlg::getFather(GEOM::GEOM_Object_ptr theOb
QList<GEOM::GeomObjPtr> GroupGUI_BooleanDlg::getSourceObjects() QList<GEOM::GeomObjPtr> GroupGUI_BooleanDlg::getSourceObjects()
{ {
QList<GEOM::GeomObjPtr> res; QList<GEOM::GeomObjPtr> res;
for (int i = 0; i < myListShapes.length(); i++) { for ( CORBA::ULong i = 0; i < myListShapes.length(); i++) {
GEOM::GeomObjPtr aGeomObjPtr(myListShapes[i]); GEOM::GeomObjPtr aGeomObjPtr(myListShapes[i]);
res << aGeomObjPtr; res << aGeomObjPtr;
} }
for (int i = 0; i < myListTools.length(); i++) { for ( CORBA::ULong i = 0; i < myListTools.length(); i++) {
GEOM::GeomObjPtr aGeomObjPtr(myListTools[i]); GEOM::GeomObjPtr aGeomObjPtr(myListTools[i]);
res << aGeomObjPtr; res << aGeomObjPtr;
} }

View File

@ -89,7 +89,7 @@ MeasureGUI_CheckSelfIntersectionsDlg::MeasureGUI_CheckSelfIntersectionsDlg (Geom
mainFrame()->RadioButton3->close(); mainFrame()->RadioButton3->close();
/***************************************************************/ /***************************************************************/
/* SIMPLE SELF-INTERSECTION constructor // SIMPLE SELF-INTERSECTION constructor
/***************************************************************/ /***************************************************************/
mySimpleGrp = new QGroupBox(tr("GEOM_CHECK_INFOS")); mySimpleGrp = new QGroupBox(tr("GEOM_CHECK_INFOS"));
QLabel *anObjLbl = new QLabel(tr("GEOM_OBJECT")); QLabel *anObjLbl = new QLabel(tr("GEOM_OBJECT"));
@ -139,7 +139,7 @@ MeasureGUI_CheckSelfIntersectionsDlg::MeasureGUI_CheckSelfIntersectionsDlg (Geom
aGrpLayout1->addWidget(myShapeList1, 6, 2); aGrpLayout1->addWidget(myShapeList1, 6, 2);
/***************************************************************/ /***************************************************************/
/* FAST SELF-INTERSECTION constructor // FAST SELF-INTERSECTION constructor
/***************************************************************/ /***************************************************************/
myFastGrp = new QGroupBox(tr("GEOM_CHECK_INFOS"), centralWidget()); myFastGrp = new QGroupBox(tr("GEOM_CHECK_INFOS"), centralWidget());
@ -268,7 +268,7 @@ void MeasureGUI_CheckSelfIntersectionsDlg::Init()
/***************************************************************/ /***************************************************************/
connect(this, SIGNAL(constructorsClicked(int)), connect(this, SIGNAL(constructorsClicked(int)),
this, SLOT(ConstructorsClicked(int))); this, SLOT(ConstructorsClicked(int)));
connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()),
this, SLOT(DeactivateActiveDialog())); this, SLOT(DeactivateActiveDialog()));
connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()),
@ -527,19 +527,19 @@ void MeasureGUI_CheckSelfIntersectionsDlg::SelectionIntoArgument()
if ( getConstructorId() == 0 ) { if ( getConstructorId() == 0 ) {
typesLst << TopAbs_COMPOUND typesLst << TopAbs_COMPOUND
<< TopAbs_COMPSOLID << TopAbs_COMPSOLID
<< TopAbs_SOLID << TopAbs_SOLID
<< TopAbs_SHELL << TopAbs_SHELL
<< TopAbs_FACE << TopAbs_FACE
<< TopAbs_WIRE << TopAbs_WIRE
<< TopAbs_EDGE << TopAbs_EDGE
<< TopAbs_VERTEX << TopAbs_VERTEX
<< TopAbs_SHAPE; << TopAbs_SHAPE;
} else { } else {
typesLst << TopAbs_FACE typesLst << TopAbs_FACE
<< TopAbs_SHELL << TopAbs_SHELL
<< TopAbs_SOLID << TopAbs_SOLID
<< TopAbs_COMPOUND; << TopAbs_COMPOUND;
} }
// Clear the dialog. // Clear the dialog.
@ -672,11 +672,11 @@ void MeasureGUI_CheckSelfIntersectionsDlg::onSubShapesListSelectionChanged()
foreach(int idx, aIds) { foreach(int idx, aIds) {
aSubShape = anIndices.FindKey(idx); aSubShape = anIndices.FindKey(idx);
try { try {
SALOME_Prs* aPrs = !aSubShape.IsNull() ? getDisplayer()->BuildPrs(aSubShape) : 0; SALOME_Prs* aPrs = !aSubShape.IsNull() ? getDisplayer()->BuildPrs(aSubShape) : 0;
if (aPrs) displayPreview(aPrs, true); if (aPrs) displayPreview(aPrs, true);
} }
catch (const SALOME::SALOME_Exception& e) { catch (const SALOME::SALOME_Exception& e) {
SalomeApp_Tools::QtCatchCorbaException(e); SalomeApp_Tools::QtCatchCorbaException(e);
} }
} }
} }

View File

@ -475,7 +475,7 @@ void MeasureGUI_CheckShapeDlg::onErrorsListSelectionChanged()
myGrp->ListBox2->clear(); myGrp->ListBox2->clear();
if (aCurItem < aErrs.length()) { if (aCurItem < (int)aErrs.length()) {
GEOM::GEOM_IMeasureOperations::ShapeError aErr = aErrs[aCurItem]; GEOM::GEOM_IMeasureOperations::ShapeError aErr = aErrs[aCurItem];
GEOM::ListOfLong aObjLst = aErr.incriminated; GEOM::ListOfLong aObjLst = aErr.incriminated;
QStringList aSubShapeList; QStringList aSubShapeList;

View File

@ -204,7 +204,7 @@ void MeasureGUI_DistanceDlg::enterEvent(QEvent*)
//================================================================================= //=================================================================================
void MeasureGUI_DistanceDlg::SolutionSelected (int i) void MeasureGUI_DistanceDlg::SolutionSelected (int i)
{ {
if (i < 0 || myDbls->length() < (i+1)*6) { if (i < 0 || (int)myDbls->length() < (i+1)*6) {
myGrp->LineEdit3->setText(""); myGrp->LineEdit3->setText("");
myGrp->LineEdit4->setText(""); myGrp->LineEdit4->setText("");
myGrp->LineEdit5->setText(""); myGrp->LineEdit5->setText("");
@ -341,7 +341,7 @@ SALOME_Prs* MeasureGUI_DistanceDlg::buildPrs()
int currSol = myGrp->ComboBox1->currentIndex(); int currSol = myGrp->ComboBox1->currentIndex();
if (!myObj1 || !myObj2 || if (!myObj1 || !myObj2 ||
currSol == -1 || (currSol+1)*6 > myDbls->length() || currSol == -1 || (currSol+1)*6 > (int)myDbls->length() ||
vw->getViewManager()->getType() != OCCViewer_Viewer::Type()) vw->getViewManager()->getType() != OCCViewer_Viewer::Type())
return 0; return 0;

View File

@ -65,9 +65,9 @@
// class : MeasureGUI_ShapeStatisticsDlg() // class : MeasureGUI_ShapeStatisticsDlg()
//=========================================================================== //===========================================================================
MeasureGUI_ShapeStatisticsDlg::MeasureGUI_ShapeStatisticsDlg( QWidget* parent, TopoDS_Shape aShape, TopAbs_ShapeEnum aSubShapeType ) MeasureGUI_ShapeStatisticsDlg::MeasureGUI_ShapeStatisticsDlg( QWidget* parent, TopoDS_Shape aShape, TopAbs_ShapeEnum aSubShapeType )
: GEOMBase_Helper( SUIT_Session::session()->activeApplication()->desktop() ), : GEOMBase_Helper( SUIT_Session::session()->activeApplication()->desktop() ),
QDialog( parent ), QDialog( parent ),
myHistogram ( 0 ) myHistogram ( 0 )
{ {
myShapes.push_back( aShape ); myShapes.push_back( aShape );
@ -106,9 +106,9 @@ MeasureGUI_ShapeStatisticsDlg::MeasureGUI_ShapeStatisticsDlg( QWidget* parent, T
myCBTypes = new QtxComboBox( this ); myCBTypes = new QtxComboBox( this );
myCBTypes->setCleared( true ); myCBTypes->setCleared( true );
if ( aSubShapeType != TopAbs_SHAPE ) { if ( aSubShapeType != TopAbs_SHAPE ) {
fillTypes( aSubShapeType == TopAbs_EDGE, fillTypes( aSubShapeType == TopAbs_EDGE,
aSubShapeType == TopAbs_FACE, aSubShapeType == TopAbs_FACE,
aSubShapeType == TopAbs_SOLID ); aSubShapeType == TopAbs_SOLID );
myCBTypes->setEnabled( false ); myCBTypes->setEnabled( false );
} }
@ -137,7 +137,7 @@ MeasureGUI_ShapeStatisticsDlg::MeasureGUI_ShapeStatisticsDlg( QWidget* parent, T
QLabel* maxLabel = new QLabel( tr( "GEOM_SHAPE_STATISTICS_MAX" ), this ); QLabel* maxLabel = new QLabel( tr( "GEOM_SHAPE_STATISTICS_MAX" ), this );
myMax = new QLineEdit( this ); myMax = new QLineEdit( this );
myMax->setValidator( aValid ); myMax->setValidator( aValid );
QPushButton* buttonCompute = new QPushButton( tr( "GEOM_SHAPE_STATISTICS_COMPUTE" ), this ); QPushButton* buttonCompute = new QPushButton( tr( "GEOM_SHAPE_STATISTICS_COMPUTE" ), this );
connect( buttonCompute, SIGNAL( clicked() ), this, SLOT( clickOnCompute() ) ); connect( buttonCompute, SIGNAL( clicked() ), this, SLOT( clickOnCompute() ) );
@ -209,10 +209,10 @@ GEOM::GEOM_IOperations_ptr MeasureGUI_ShapeStatisticsDlg::createOperation()
return getGeomEngine()->GetIGroupOperations(getStudyId()); return getGeomEngine()->GetIGroupOperations(getStudyId());
} }
#define RETURN_WITH_MSG(a, b) \ #define RETURN_WITH_MSG(a, b) \
if (!(a)) { \ if (!(a)) { \
theMessage += (b); \ theMessage += (b); \
return false; \ return false; \
} }
//================================================================ //================================================================
@ -334,9 +334,9 @@ TopAbs_ShapeEnum MeasureGUI_ShapeStatisticsDlg::currentType()
bool MeasureGUI_ShapeStatisticsDlg::isValid(QString& theMessage) bool MeasureGUI_ShapeStatisticsDlg::isValid(QString& theMessage)
{ {
if ( myScalarRangeBox->isChecked() ) { if ( myScalarRangeBox->isChecked() ) {
RETURN_WITH_MSG( !myMin->text().isEmpty(), tr("GEOM_SHAPE_STATISTICS_MIN_ERROR") ) RETURN_WITH_MSG( !myMin->text().isEmpty(), tr("GEOM_SHAPE_STATISTICS_MIN_ERROR") );
RETURN_WITH_MSG( !myMax->text().isEmpty(), tr("GEOM_SHAPE_STATISTICS_MAX_ERROR") ) RETURN_WITH_MSG( !myMax->text().isEmpty(), tr("GEOM_SHAPE_STATISTICS_MAX_ERROR") );
RETURN_WITH_MSG( myMin->text().toDouble() <= myMax->text().toDouble(), tr("GEOM_SHAPE_STATISTICS_MIN_MAX_ERROR") ) RETURN_WITH_MSG( myMin->text().toDouble() <= myMax->text().toDouble(), tr("GEOM_SHAPE_STATISTICS_MIN_MAX_ERROR") );
} }
return true; return true;
} }
@ -360,7 +360,7 @@ void MeasureGUI_ShapeStatisticsDlg::clickOnPlot()
aRange.max = -1.0; // flag that range is empty aRange.max = -1.0; // flag that range is empty
} }
GEOMUtils::Distribution aShapesDistr = GEOMUtils::Distribution aShapesDistr =
GEOMUtils::ComputeDistribution( myShapes, currentType(), myNbIntervals->value(), aRange ); GEOMUtils::ComputeDistribution( myShapes, currentType(), myNbIntervals->value(), aRange );
QList<double> xVals, yVals; QList<double> xVals, yVals;
@ -445,7 +445,7 @@ void MeasureGUI_ShapeStatisticsDlg::clickOnCreateGroups()
//================================================================================= //=================================================================================
// function : execute(ObjectList& objects) // function : execute(ObjectList& objects)
// purpose : // purpose :
//================================================================================= //=================================================================================
bool MeasureGUI_ShapeStatisticsDlg::execute(ObjectList& objects) bool MeasureGUI_ShapeStatisticsDlg::execute(ObjectList& objects)
{ {
@ -472,9 +472,9 @@ bool MeasureGUI_ShapeStatisticsDlg::execute(ObjectList& objects)
int aPrecision = resMgr->integerValue( "Geometry", "length_precision", 6 ); int aPrecision = resMgr->integerValue( "Geometry", "length_precision", 6 );
QString aTypePrefix = myCBTypes->currentText().replace(' ', '_'); QString aTypePrefix = myCBTypes->currentText().replace(' ', '_');
QString objIOR, aMin, aMax, aGroupName; QString objIOR, aMin, aMax, aGroupName;
SalomeApp_Study* study = getStudy(); //SalomeApp_Study* study = getStudy();
GEOMUtils::Distribution aShapesDistr = GEOMUtils::Distribution aShapesDistr =
GEOMUtils::ComputeDistribution( myShapes, currentType(), myNbIntervals->value(), aRange ); GEOMUtils::ComputeDistribution( myShapes, currentType(), myNbIntervals->value(), aRange );
int nbGroups = 0; int nbGroups = 0;
@ -489,7 +489,7 @@ bool MeasureGUI_ShapeStatisticsDlg::execute(ObjectList& objects)
int ii = 0; int ii = 0;
std::list<long>::const_iterator id_it; std::list<long>::const_iterator id_it;
for ( id_it = idList.begin(); id_it != idList.end(); id_it++ ) { for ( id_it = idList.begin(); id_it != idList.end(); id_it++ ) {
aNewList[ii++] = *id_it; aNewList[ii++] = *id_it;
} }
// Create an empty group // Create an empty group
@ -497,12 +497,12 @@ bool MeasureGUI_ShapeStatisticsDlg::execute(ObjectList& objects)
aGroup = anOper->CreateGroup( myMainObj.get(), currentType() ); aGroup = anOper->CreateGroup( myMainObj.get(), currentType() );
if (CORBA::is_nil(aGroup) || !anOper->IsDone()) if (CORBA::is_nil(aGroup) || !anOper->IsDone())
return false; return false;
// Add sub-shapes into group // Add sub-shapes into group
anOper->UnionIDs(aGroup, aNewList); anOper->UnionIDs(aGroup, aNewList);
if (!anOper->IsDone()) if (!anOper->IsDone())
return false; return false;
// publish group // publish group
aMin = DlgRef::PrintDoubleValue( (*it).min, aPrecision ); aMin = DlgRef::PrintDoubleValue( (*it).min, aPrecision );

View File

@ -45,7 +45,7 @@ namespace
GEOM::shape_type maxShapeType(const GEOM::ListOfGO& objs) GEOM::shape_type maxShapeType(const GEOM::ListOfGO& objs)
{ {
GEOM::shape_type r = GEOM::SHAPE; GEOM::shape_type r = GEOM::SHAPE;
for ( int i = 0; i < objs.length(); i++ ) { for ( CORBA::ULong i = 0; i < objs.length(); i++ ) {
GEOM::shape_type t = objs[i]->GetShapeType(); GEOM::shape_type t = objs[i]->GetShapeType();
if ( t == GEOM::COMPOUND || t == GEOM::COMPSOLID ) if ( t == GEOM::COMPOUND || t == GEOM::COMPSOLID )
t = objs[i]->GetMaxShapeType(); t = objs[i]->GetMaxShapeType();
@ -412,7 +412,7 @@ QList<GEOM::GeomObjPtr> OperationGUI_GetSharedShapesDlg::getSourceObjects()
{ {
QList<GEOM::GeomObjPtr> res; QList<GEOM::GeomObjPtr> res;
GEOM::ListOfGO aListPtr(myListShapes); GEOM::ListOfGO aListPtr(myListShapes);
for (int i = 0; i < aListPtr.length(); i++) { for (CORBA::ULong i = 0; i < aListPtr.length(); i++) {
GEOM::GeomObjPtr aGeomObjPtr(aListPtr[i]); GEOM::GeomObjPtr aGeomObjPtr(aListPtr[i]);
res << aGeomObjPtr; res << aGeomObjPtr;
} }

View File

@ -37,7 +37,7 @@
//================================================================================= //=================================================================================
// class : TransformationGUI_OffsetDlg() // class : TransformationGUI_OffsetDlg()
// purpose : Constructs a TransformationGUI_OffsetDlg which is a child of 'parent', with the // purpose : Constructs a TransformationGUI_OffsetDlg which is a child of 'parent', with the
// name 'name' and widget flags set to 'f'. // name 'name' and widget flags set to 'f'.
// The dialog will by default be modeless, unless you set 'modal' to // The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog. // TRUE to construct a modal dialog.
@ -85,7 +85,7 @@ TransformationGUI_OffsetDlg::TransformationGUI_OffsetDlg( GeometryGUI* theGeomet
// purpose : Destroys the object and frees any allocated resources // purpose : Destroys the object and frees any allocated resources
//================================================================================= //=================================================================================
TransformationGUI_OffsetDlg::~TransformationGUI_OffsetDlg() TransformationGUI_OffsetDlg::~TransformationGUI_OffsetDlg()
{ {
/* no need to delete child widgets, Qt does it all for us */ /* no need to delete child widgets, Qt does it all for us */
} }
@ -148,9 +148,9 @@ void TransformationGUI_OffsetDlg::ClickOnOk()
//================================================================================= //=================================================================================
bool TransformationGUI_OffsetDlg::ClickOnApply() bool TransformationGUI_OffsetDlg::ClickOnApply()
{ {
if ( !onAccept( GroupPoints->CheckButton1->isChecked() ) ) if ( !onAccept( /*copy=*/true ))
return false; return false;
initName(); initName();
return true; return true;
} }
@ -182,7 +182,7 @@ void TransformationGUI_OffsetDlg::SelectionIntoArgument()
void TransformationGUI_OffsetDlg::SetEditCurrentArgument() void TransformationGUI_OffsetDlg::SetEditCurrentArgument()
{ {
QPushButton* send = (QPushButton*)sender(); QPushButton* send = (QPushButton*)sender();
if ( send == GroupPoints->PushButton1 ) { if ( send == GroupPoints->PushButton1 ) {
GroupPoints->PushButton1->setDown(true); GroupPoints->PushButton1->setDown(true);
myEditCurrentArgument = GroupPoints->LineEdit1; myEditCurrentArgument = GroupPoints->LineEdit1;
@ -210,7 +210,7 @@ void TransformationGUI_OffsetDlg::enterEvent( QEvent* )
void TransformationGUI_OffsetDlg::ActivateThisDialog() void TransformationGUI_OffsetDlg::ActivateThisDialog()
{ {
GEOMBase_Skeleton::ActivateThisDialog(); GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(), connect( myGeomGUI->getApp()->selectionMgr(),
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
globalSelection( GEOM_ALLSHAPES ); globalSelection( GEOM_ALLSHAPES );
myEditCurrentArgument = GroupPoints->LineEdit1; myEditCurrentArgument = GroupPoints->LineEdit1;
@ -260,14 +260,14 @@ bool TransformationGUI_OffsetDlg::isValid( QString& msg )
bool TransformationGUI_OffsetDlg::execute( ObjectList& objects ) bool TransformationGUI_OffsetDlg::execute( ObjectList& objects )
{ {
bool res = false; bool res = false;
GEOM::GEOM_Object_var anObj; GEOM::GEOM_Object_var anObj;
GEOM::GEOM_ITransformOperations_var anOper = GEOM::GEOM_ITransformOperations::_narrow(getOperation()); GEOM::GEOM_ITransformOperations_var anOper = GEOM::GEOM_ITransformOperations::_narrow(getOperation());
if ( true /*GroupPoints->CheckButton1->isChecked() || IsPreview()*/ ) { if ( true /*GroupPoints->CheckButton1->isChecked() || IsPreview()*/ ) {
for ( int i = 0; i < myObjects.count(); i++ ) { for ( int i = 0; i < myObjects.count(); i++ ) {
anObj = anOper->OffsetShapeCopy( myObjects[i].get(), GetOffset(), GetIsJoinByPipes() ); anObj = anOper->OffsetShapeCopy( myObjects[i].get(), GetOffset(), GetIsJoinByPipes() );
if ( !anObj->_is_nil() ) { if ( !anObj->_is_nil() ) {
if(!IsPreview()) { if(!IsPreview()) {
@ -285,7 +285,7 @@ bool TransformationGUI_OffsetDlg::execute( ObjectList& objects )
} }
} }
res = true; res = true;
return res; return res;
} }
@ -316,7 +316,7 @@ double TransformationGUI_OffsetDlg::GetOffset() const
//======================================================================= //=======================================================================
//function : GetIsJoinByPipes //function : GetIsJoinByPipes
//purpose : //purpose :
//======================================================================= //=======================================================================
bool TransformationGUI_OffsetDlg::GetIsJoinByPipes() const bool TransformationGUI_OffsetDlg::GetIsJoinByPipes() const