1 // Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #include "HYDROGUI_DataModel.h"
25 #include "HYDROGUI_DataObject.h"
26 #include "HYDROGUI_Module.h"
27 #include "HYDROGUI_Tool.h"
28 #include "HYDROGUI_Zone.h"
29 #include "HYDROGUI_Region.h"
31 #include <HYDROData_Bathymetry.h>
32 #include <HYDROData_CalculationCase.h>
33 #include <HYDROData_Document.h>
34 #include <HYDROData_Image.h>
35 #include <HYDROData_ImmersibleZone.h>
36 #include <HYDROData_Iterator.h>
37 #include <HYDROData_Polyline.h>
38 #include <HYDROData_VisualState.h>
39 #include <HYDROData_Region.h>
40 #include <HYDROData_Zone.h>
41 #include <HYDROData_Obstacle.h>
43 #include <CAM_Application.h>
44 #include <CAM_DataObject.h>
45 #include <CAM_Module.h>
46 #include <CAM_Study.h>
48 #include <LightApp_Application.h>
49 #include <LightApp_DataObject.h>
50 #include <LightApp_Study.h>
52 #include <SUIT_DataObject.h>
53 #include <SUIT_DataBrowser.h>
54 #include <SUIT_ResourceMgr.h>
55 #include <SUIT_Study.h>
56 #include <SUIT_Tools.h>
58 #include <HYDROData_Document.h>
60 #include <TDF_Delta.hxx>
61 #include <TDF_ListIteratorOfDeltaList.hxx>
63 #include <QApplication>
66 static HYDROData_SequenceOfObjects myCopyingObjects;
68 HYDROGUI_DataModel::HYDROGUI_DataModel( CAM_Module* theModule )
69 : LightApp_DataModel( theModule )
71 update( module()->application()->activeStudy()->id() );
74 HYDROGUI_DataModel::~HYDROGUI_DataModel()
78 bool HYDROGUI_DataModel::open( const QString& theURL,
80 QStringList theFileList )
82 LightApp_DataModel::open( theURL, theStudy, theFileList );
83 const int aStudyId = theStudy->id();
85 Data_DocError res = DocError_UnknownProblem;
86 if( theFileList.count() == 2 )
88 QString aTmpDir = theFileList[0];
89 QString aFileName = theFileList[1];
92 QString aFullPath = SUIT_Tools::addSlash( aTmpDir ) + aFileName;
96 res = HYDROData_Document::Load( (char*)aFullPath.toLatin1().constData(), aStudyId );
100 res = DocError_UnknownProblem;
102 if( res != DocError_OK )
104 module()->application()->putInfo( tr( "LOAD_ERROR" ) );
109 // if the document open was successful, the data model update happens
110 // in the set mode of the module
111 if( res == DocError_OK )
117 bool HYDROGUI_DataModel::save( QStringList& theFileList )
119 if( !module()->application()->activeStudy() )
122 LightApp_DataModel::save( theFileList );
126 SUIT_ResourceMgr* resMgr = module()->application()->resourceMgr();
127 bool isMultiFile = false;
129 isMultiFile = resMgr->booleanValue( "Study", "multi_file", false );
131 // save data to temporary files
132 LightApp_Study* aStudy = dynamic_cast<LightApp_Study*>( module()->application()->activeStudy() );
133 aTmpDir = aStudy->GetTmpDir( myStudyURL.toLatin1().constData(), isMultiFile ).c_str();
134 aFileName = SUIT_Tools::file( myStudyURL, false ) + "_HYDRO.cbf";
136 QString aFullPath = aTmpDir + aFileName;
137 Data_DocError res = getDocument()->Save( (char*)aFullPath.toLatin1().constData() );
138 if( res != DocError_OK )
140 module()->application()->putInfo( tr( "SAVE_ERROR" ) );
144 theFileList.append( aTmpDir );
145 theFileList.append( aFileName );
150 bool HYDROGUI_DataModel::saveAs( const QString& theURL,
152 QStringList& theFileList )
155 return save( theFileList );
158 bool HYDROGUI_DataModel::close()
163 bool HYDROGUI_DataModel::dumpPython( const QString& theURL,
166 QStringList& theListOfFiles )
168 LightApp_DataModel::dumpPython( theURL, theStudy, isMultiFile, theListOfFiles );
170 int aStudyId = theStudy->id();
172 LightApp_Study* aStudy = ::qobject_cast<LightApp_Study*>( theStudy );
173 Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( aStudyId );
174 if ( aDocument.IsNull() || !aStudy )
177 QString aFileToExport = aStudy->GetTmpDir( theURL.toLatin1().constData(), isMultiFile ).c_str();
178 aFileToExport += QString( QDir::separator() ) + "HYDRO.py";
180 bool aRes = aDocument->DumpToPython( aFileToExport );
184 theListOfFiles.append( aFileToExport );
190 bool HYDROGUI_DataModel::isModified() const
192 return getDocument()->IsModified();
195 bool HYDROGUI_DataModel::isSaved() const
200 void HYDROGUI_DataModel::update( const int theStudyId )
202 LightApp_Application* anApp = dynamic_cast<LightApp_Application*>( module()->application() );
206 SUIT_DataObject* aStudyRoot = anApp->activeStudy()->root();
210 // create root object if not exist
211 CAM_DataObject* aRootObj = root();
213 aRootObj = createRootModuleObject( aStudyRoot );
218 DataObjectList aList;
219 aRootObj->children( aList );
220 QListIterator<SUIT_DataObject*> anIter( aList );
221 while( anIter.hasNext() )
222 removeChild( aRootObj, anIter.next() );
224 Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( theStudyId );
225 if( aDocument.IsNull() )
228 LightApp_DataObject* anImageRootObj = createObject( aRootObj, tr( partitionName( KIND_IMAGE ).toAscii() ) );
230 HYDROData_Iterator anIterator( aDocument, KIND_IMAGE );
231 for( ; anIterator.More(); anIterator.Next() )
233 Handle(HYDROData_Image) anImageObj =
234 Handle(HYDROData_Image)::DownCast( anIterator.Current() );
235 if( !anImageObj.IsNull() )
236 createObject( anImageRootObj, anImageObj );
239 LightApp_DataObject* aBathymetryRootObj = createObject( aRootObj, tr( partitionName( KIND_BATHYMETRY ).toAscii() ) );
241 anIterator = HYDROData_Iterator( aDocument, KIND_BATHYMETRY );
242 for( ; anIterator.More(); anIterator.Next() )
244 Handle(HYDROData_Bathymetry) aBathymetryObj =
245 Handle(HYDROData_Bathymetry)::DownCast( anIterator.Current() );
246 if( !aBathymetryObj.IsNull() )
247 createObject( aBathymetryRootObj, aBathymetryObj );
250 LightApp_DataObject* aPolylineRootObj = createObject( aRootObj, tr( partitionName( KIND_POLYLINE ).toAscii() ) );
252 anIterator = HYDROData_Iterator( aDocument, KIND_POLYLINE );
253 for( ; anIterator.More(); anIterator.Next() )
255 Handle(HYDROData_Polyline) aPolylineObj =
256 Handle(HYDROData_Polyline)::DownCast( anIterator.Current() );
257 if( !aPolylineObj.IsNull() )
258 createObject( aPolylineRootObj, aPolylineObj );
261 LightApp_DataObject* aZonesRootObj = createObject( aRootObj, tr( partitionName( KIND_IMMERSIBLE_ZONE ).toAscii() ) );
263 anIterator = HYDROData_Iterator( aDocument, KIND_IMMERSIBLE_ZONE );
264 for( ; anIterator.More(); anIterator.Next() )
266 Handle(HYDROData_ImmersibleZone) aZoneObj =
267 Handle(HYDROData_ImmersibleZone)::DownCast( anIterator.Current() );
268 if( !aZoneObj.IsNull() )
269 createObject( aZonesRootObj, aZoneObj );
272 LightApp_DataObject* anObstaclesRootObj = createObject( aRootObj, tr( partitionName( KIND_OBSTACLE ).toAscii() ) );
274 anIterator = HYDROData_Iterator( aDocument, KIND_OBSTACLE );
275 for( ; anIterator.More(); anIterator.Next() )
277 Handle(HYDROData_Obstacle) anObstacleObj =
278 Handle(HYDROData_Obstacle)::DownCast( anIterator.Current() );
279 if( !anObstacleObj.IsNull() )
280 createObject( anObstaclesRootObj, anObstacleObj );
283 LightApp_DataObject* aCalculRootObj = createObject( aRootObj, tr( partitionName( KIND_CALCULATION ).toAscii() ) );
285 anIterator = HYDROData_Iterator( aDocument, KIND_CALCULATION );
286 for( ; anIterator.More(); anIterator.Next() )
288 Handle(HYDROData_CalculationCase) aCalculObj =
289 Handle(HYDROData_CalculationCase)::DownCast( anIterator.Current() );
290 if( !aCalculObj.IsNull() )
291 createObject( aCalculRootObj, aCalculObj );
294 LightApp_DataObject* aVisualStateRootObj = createObject( aRootObj, tr( partitionName( KIND_VISUAL_STATE ).toAscii() ) );
296 anIterator = HYDROData_Iterator( aDocument, KIND_VISUAL_STATE );
297 for( ; anIterator.More(); anIterator.Next() )
299 Handle(HYDROData_VisualState) aVisualStateObj =
300 Handle(HYDROData_VisualState)::DownCast( anIterator.Current() );
301 if( !aVisualStateObj.IsNull() )
302 createObject( aVisualStateRootObj, aVisualStateObj );
305 if( SUIT_DataBrowser* anObjectBrowser = anApp->objectBrowser() )
307 anObjectBrowser->setAutoOpenLevel( 3 );
308 anObjectBrowser->openLevels();
312 HYDROGUI_DataObject* HYDROGUI_DataModel::getDataObject( const Handle(HYDROData_Entity)& theModelObject )
314 return NULL; // to do if necessary
317 HYDROGUI_DataObject* HYDROGUI_DataModel::getReferencedDataObject( HYDROGUI_DataObject* theObject )
319 return NULL; // to do if necessary
322 SUIT_DataObject* HYDROGUI_DataModel::findObject( const QString& theEntry ) const
324 LightApp_Application* anApp = dynamic_cast<LightApp_Application*>( module()->application() );
325 return anApp ? anApp->findObject( theEntry ) : 0;
328 void HYDROGUI_DataModel::update( LightApp_DataObject* theObject,
329 LightApp_Study* theStudy )
332 theStudy = dynamic_cast<LightApp_Study*>( module()->application()->activeStudy()) ;
334 update( theStudy->id() );
337 CAM_DataObject* HYDROGUI_DataModel::createRootModuleObject( SUIT_DataObject* theParent )
339 CAM_DataObject* aRootObj = createModuleObject( theParent );
344 void HYDROGUI_DataModel::updateModel()
346 HYDROGUI_Module* aModule = dynamic_cast<HYDROGUI_Module*>( module() );
348 update( aModule->getStudyId() );
351 Handle(HYDROData_Entity) HYDROGUI_DataModel::objectByEntry( const QString& theEntry,
352 const ObjectKind theObjectKind )
354 QString anEntry = theEntry;
355 if( anEntry.indexOf( "_" ) != -1 ) // reference object
356 anEntry = anEntry.section( "_", -1 );
358 Handle(HYDROData_Document) aDocument = getDocument();
359 if( !aDocument.IsNull() )
361 HYDROData_Iterator anIterator( aDocument, theObjectKind );
362 for( ; anIterator.More(); anIterator.Next() )
364 Handle(HYDROData_Entity) anObject = anIterator.Current();
365 if( !anObject.IsNull() )
367 QString anEntryRef = HYDROGUI_DataObject::dataObjectEntry( anObject );
368 if( anEntryRef == anEntry )
376 bool HYDROGUI_DataModel::canUndo() const
378 return getDocument()->CanUndo();
381 bool HYDROGUI_DataModel::canRedo() const
383 return getDocument()->CanRedo();
386 QStringList HYDROGUI_DataModel::undoNames() const
389 for( TDF_ListIteratorOfDeltaList anIter( getDocument()->GetUndos() ); anIter.More(); anIter.Next() )
390 aNames.prepend( HYDROGUI_Tool::ToQString( anIter.Value()->Name() ) );
394 QStringList HYDROGUI_DataModel::redoNames() const
397 for( TDF_ListIteratorOfDeltaList anIter( getDocument()->GetRedos() ); anIter.More(); anIter.Next() )
398 aNames.append( HYDROGUI_Tool::ToQString( anIter.Value()->Name() ) );
402 void HYDROGUI_DataModel::clearUndos()
404 getDocument()->ClearUndos();
407 void HYDROGUI_DataModel::clearRedos()
409 getDocument()->ClearRedos();
412 bool HYDROGUI_DataModel::undo()
416 getDocument()->Undo();
418 catch ( Standard_Failure )
425 bool HYDROGUI_DataModel::redo()
429 getDocument()->Redo();
431 catch ( Standard_Failure )
438 bool HYDROGUI_DataModel::canCopy()
440 HYDROData_SequenceOfObjects aSeq = HYDROGUI_Tool::GetSelectedObjects( (HYDROGUI_Module*)module() );
441 if( aSeq.Length() != 1 )
444 Handle(HYDROData_Entity) anObject = aSeq.First();
445 if( anObject.IsNull() )
448 ObjectKind aKind = anObject->GetKind();
449 if( aKind == KIND_IMAGE ||
450 aKind == KIND_POLYLINE ||
451 aKind == KIND_CALCULATION )
457 bool HYDROGUI_DataModel::canPaste()
459 for( int anIndex = 1, aLength = myCopyingObjects.Length(); anIndex <= aLength; anIndex++ )
461 Handle(HYDROData_Entity) anObject = myCopyingObjects.Value( anIndex );
462 if( !anObject.IsNull() && !anObject->IsRemoved() )
468 bool HYDROGUI_DataModel::copy()
470 HYDROData_SequenceOfObjects aSeq = HYDROGUI_Tool::GetSelectedObjects( (HYDROGUI_Module*)module() );
471 changeCopyingObjects( aSeq );
475 bool HYDROGUI_DataModel::paste()
477 bool anIsChanged = false;
478 for( int anIndex = 1, aLength = myCopyingObjects.Length(); anIndex <= aLength; anIndex++ )
480 Handle(HYDROData_Entity) anObject = myCopyingObjects.Value( anIndex );
481 if( !anObject.IsNull() && !anObject->IsRemoved() )
483 ObjectKind aKind = anObject->GetKind();
484 Handle(HYDROData_Entity) aClone = getDocument()->CreateObject( aKind );
485 if( !aClone.IsNull() )
487 anObject->CopyTo( aClone );
490 // generate a new unique name for the clone object:
491 // case 1: Image_1 -> Image_2
492 // case 2: ImageObj -> ImageObj_1
493 QString aName = aClone->GetName();
494 QString aPrefix = aName;
495 if( aName.contains( '_' ) ) // case 1
497 QString aSuffix = aName.section( '_', -1 );
498 bool anIsInteger = false;
499 aSuffix.toInt( &anIsInteger );
501 aPrefix = aName.section( '_', 0, -2 );
505 aName = HYDROGUI_Tool::GenerateObjectName( (HYDROGUI_Module*)module(), aPrefix );
506 aClone->SetName( aName );
513 void HYDROGUI_DataModel::changeCopyingObjects( const HYDROData_SequenceOfObjects& theSeq )
515 myCopyingObjects.Assign( theSeq );
518 QString HYDROGUI_DataModel::partitionName( const ObjectKind theObjectKind )
520 switch( theObjectKind )
522 case KIND_IMAGE: return "IMAGES";
523 case KIND_POLYLINE: return "POLYLINES";
524 case KIND_VISUAL_STATE: return "VISUAL_STATES";
525 case KIND_BATHYMETRY: return "BATHYMETRIES";
526 case KIND_CALCULATION: return "CALCULATION_CASES";
527 case KIND_IMMERSIBLE_ZONE: return "IMMERSIBLE_ZONES";
528 case KIND_OBSTACLE: return "OBSTACLES";
534 Handle(HYDROData_Document) HYDROGUI_DataModel::getDocument() const
536 int aStudyId = module()->application()->activeStudy()->id();
537 return HYDROData_Document::Document( aStudyId );
540 LightApp_DataObject* HYDROGUI_DataModel::createObject( SUIT_DataObject* theParent,
541 Handle(HYDROData_Entity) theModelObject,
542 const QString& theParentEntry,
543 const bool theIsBuildTree )
545 HYDROGUI_DataObject* aResObj = new HYDROGUI_DataObject( theParent, theModelObject, theParentEntry );
547 if ( theIsBuildTree )
549 buildObjectTree( theParent, aResObj, theParentEntry );
555 LightApp_DataObject* HYDROGUI_DataModel::buildObject( SUIT_DataObject* theParent,
556 HYDROGUI_DataObject* theObject,
557 const QString& theParentEntry,
558 const bool theIsBuildTree )
560 if ( theIsBuildTree )
562 buildObjectTree( theParent, theObject, theParentEntry );
567 LightApp_DataObject* HYDROGUI_DataModel::createZone( SUIT_DataObject* theParent,
568 Handle(HYDROData_Zone) theModelObject,
569 const QString& theParentEntry,
570 const bool theIsBuildTree )
572 return buildObject( theParent, new HYDROGUI_Zone( theParent, theModelObject, theParentEntry ), theParentEntry, theIsBuildTree );
575 LightApp_DataObject* HYDROGUI_DataModel::createRegion( SUIT_DataObject* theParent,
576 Handle(HYDROData_Region) theModelObject,
577 const QString& theParentEntry,
578 const bool theIsBuildTree )
580 return buildObject( theParent, new HYDROGUI_Region( theParent, theModelObject, theParentEntry ), theParentEntry, theIsBuildTree );
583 LightApp_DataObject* HYDROGUI_DataModel::createObject( SUIT_DataObject* theParent,
584 const QString& theName,
585 const QString& theParentEntry )
587 return new HYDROGUI_NamedObject( theParent, theName, theParentEntry );
590 void HYDROGUI_DataModel::buildObjectTree( SUIT_DataObject* theParent,
591 SUIT_DataObject* theObject,
592 const QString& theParentEntry )
594 HYDROGUI_DataObject* aGuiObj = dynamic_cast<HYDROGUI_DataObject*>( theObject );
598 Handle(HYDROData_Entity) aDataObj = aGuiObj->modelObject();
599 if ( aDataObj.IsNull() )
602 ObjectKind anObjectKind = aDataObj->GetKind();
604 if ( anObjectKind == KIND_IMAGE )
606 Handle(HYDROData_Image) anImageObj =
607 Handle(HYDROData_Image)::DownCast( aDataObj );
608 for ( int anIndex = 0, aNbRef = anImageObj->NbReferences(); anIndex < aNbRef; anIndex++ )
610 Handle(HYDROData_Entity) aRefObj = anImageObj->Reference( anIndex );
611 if ( !aRefObj.IsNull() && !aRefObj->IsRemoved() )
612 createObject( aGuiObj, aRefObj, aGuiObj->entry(), false );
615 else if ( anObjectKind == KIND_IMMERSIBLE_ZONE )
617 Handle(HYDROData_ImmersibleZone) aZoneObj =
618 Handle(HYDROData_ImmersibleZone)::DownCast( aDataObj );
620 LightApp_DataObject* aPolylineSect =
621 createObject( aGuiObj, tr( "ZONE_POLYLINE" ), aGuiObj->entry() );
623 Handle(HYDROData_Polyline) aPolyline = aZoneObj->GetPolyline();
624 if ( !aPolyline.IsNull() && !aPolyline->IsRemoved() )
625 createObject( aPolylineSect, aPolyline, aGuiObj->entry(), false );
627 LightApp_DataObject* aBathSect =
628 createObject( aGuiObj, tr( "ZONE_BATHYMETRY" ), aGuiObj->entry() );
630 Handle(HYDROData_Bathymetry) aBathymetry = aZoneObj->GetBathymetry();
631 if ( !aBathymetry.IsNull() && !aBathymetry->IsRemoved() )
632 createObject( aBathSect, aBathymetry, aGuiObj->entry(), false );
634 else if ( anObjectKind == KIND_CALCULATION )
636 Handle(HYDROData_CalculationCase) aCaseObj =
637 Handle(HYDROData_CalculationCase)::DownCast( aDataObj );
639 LightApp_DataObject* aCaseRegionsSect =
640 createObject( aGuiObj, tr( "CASE_REGIONS" ), aGuiObj->entry() );
642 HYDROData_SequenceOfObjects aCaseRegions = aCaseObj->GetRegions();
643 HYDROData_SequenceOfObjects::Iterator anIter( aCaseRegions );
644 for ( ; anIter.More(); anIter.Next() )
646 Handle(HYDROData_Region) aCaseRegion =
647 Handle(HYDROData_Region)::DownCast( anIter.Value() );
648 if( !aCaseRegion.IsNull() && !aCaseRegion->IsRemoved() )
649 createRegion( aCaseRegionsSect, aCaseRegion, "", true );
652 else if ( anObjectKind == KIND_REGION )
654 Handle(HYDROData_Region) aRegionObj =
655 Handle(HYDROData_Region)::DownCast( aDataObj );
657 HYDROData_SequenceOfObjects aRegionZones = aRegionObj->GetZones();
658 HYDROData_SequenceOfObjects::Iterator anIter( aRegionZones );
659 for ( ; anIter.More(); anIter.Next() )
661 Handle(HYDROData_Zone) aRegionZone =
662 Handle(HYDROData_Zone)::DownCast( anIter.Value() );
663 if( !aRegionZone.IsNull() && !aRegionZone->IsRemoved() )
664 createZone( aGuiObj, aRegionZone, "", true );
669 void HYDROGUI_DataModel::buildCaseTree( SUIT_DataObject* theParent, Handle(HYDROData_CalculationCase) theCase )
671 if ( !theCase.IsNull() )
673 new HYDROGUI_DropTargetObject( theParent, tr( "NEW_REGION" ), "" );
675 HYDROData_SequenceOfObjects aCaseRegions = theCase->GetRegions();
676 HYDROData_SequenceOfObjects::Iterator anIter( aCaseRegions );
677 for ( ; anIter.More(); anIter.Next() )
679 Handle(HYDROData_Region) aCaseRegion =
680 Handle(HYDROData_Region)::DownCast( anIter.Value() );
681 if( !aCaseRegion.IsNull() && !aCaseRegion->IsRemoved() )
682 createRegion( theParent, aCaseRegion, "", true );
687 void HYDROGUI_DataModel::removeChild( SUIT_DataObject* theParent,
688 SUIT_DataObject* theChild )
690 SUIT_DataObject* aSubChild = theChild->firstChild();
691 for( ; aSubChild; aSubChild = aSubChild->nextBrother() )
692 removeChild( theChild, aSubChild );
693 theParent->removeChild( theChild );
696 SUIT_DataObject* HYDROGUI_DataModel::findChildByName( const SUIT_DataObject* theFather,
697 const QString& theName )
699 SUIT_DataObject* aChild = theFather->firstChild();
702 if( aChild->name() == theName )
703 return aChild; // found
704 aChild = aChild->nextBrother();
706 return NULL; // not found
709 bool HYDROGUI_DataModel::createNewRegion( Handle(HYDROData_CalculationCase) theCase,
710 const QList<HYDROGUI_Zone*>& theZonesList )
712 bool isOk = !theCase.IsNull();
715 Handle(HYDROData_Region) aRegion;
716 Handle(HYDROData_Zone) aZone;
717 for (int i = 0; i < theZonesList.length(); i++ )
719 aZone = Handle(HYDROData_Zone)::DownCast( theZonesList.at(i)->modelObject() );
720 if ( !aZone.IsNull() )
722 if ( aRegion.IsNull() )
724 aRegion = theCase->AddNewRegion( aZone );
725 isOk = !aRegion.IsNull();
729 if ( !( aRegion->AddZone( aZone ) ) )