BUG IPAL13407: Fixed

This commit is contained in:
maintenance team 2006-09-20 13:06:43 +00:00
parent 264ee57423
commit 8480689ba0
2 changed files with 17 additions and 1 deletions

View File

@ -2958,3 +2958,7 @@ msgstr "Default display mode"
msgid "PREF_TAB_SETTINGS" msgid "PREF_TAB_SETTINGS"
msgstr "Settings" msgstr "Settings"
msgid "ERROR_SHAPE_TYPE"
msgstr "Object of incorrect type selected!\nPlease, select face, shell or solid and try again"

View File

@ -270,7 +270,18 @@ GEOM::GEOM_IOperations_ptr TransformationGUI_OffsetDlg::createOperation()
//================================================================================= //=================================================================================
bool TransformationGUI_OffsetDlg::isValid( QString& msg ) bool TransformationGUI_OffsetDlg::isValid( QString& msg )
{ {
return !(myObjects.length() == 0); //return !(myObjects.length() == 0);
if (myObjects.length() == 0) return false;
for (int i = 0; i < myObjects.length(); i++)
{
GEOM::shape_type aType = myObjects[i]->GetShapeType();
if( aType != GEOM::FACE && aType != GEOM::SHELL && aType != GEOM::SOLID ){
msg = tr("ERROR_SHAPE_TYPE");
return false;
}
}
return true;
} }
@ -288,6 +299,7 @@ bool TransformationGUI_OffsetDlg::execute( ObjectList& objects )
if (GroupPoints->CheckButton1->isChecked() || IsPreview()) if (GroupPoints->CheckButton1->isChecked() || IsPreview())
for (int i = 0; i < myObjects.length(); i++) for (int i = 0; i < myObjects.length(); i++)
{ {
anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->OffsetShapeCopy( myObjects[i], GetOffset() ); anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->OffsetShapeCopy( myObjects[i], GetOffset() );
if ( !anObj->_is_nil() ) if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() ); objects.push_back( anObj._retn() );