Fix for calculation case wizard when no geometry object and Next is pushed.
myValidator = new HYDROGUI_NameValidator(module(), myObjectName);
myObjectName->setValidator( myValidator );
- //connect( myValidator, SIGNAL( emptyName() ), SLOT( onEmptyName() ) );
- //connect( myValidator, SIGNAL( alreadyExists( QString ) ), SLOT( onAlreadyExists( QString ) ) );
+ connect( myValidator, SIGNAL( emptyName() ), SLOT( onEmptyName() ) );
+ connect( myValidator, SIGNAL( alreadyExists( QString ) ), SLOT( onAlreadyExists( QString ) ) );
myGeomObjects = new QListWidget( aPage );
myGeomObjects->setSelectionMode( QListWidget::SingleSelection );
HYDROData_SequenceOfObjects::Iterator aRegionsIter( aRegions );
HYDROData_SequenceOfObjects aZones;
Handle(HYDROData_Region) aRegion;
- if ( OCCViewer_Viewer* aViewer = myPreviewViewManager->getOCCViewer() )
+ if ( myPreviewViewManager )
{
- Handle(AIS_InteractiveContext) aCtx = aViewer->getAISContext();
- if ( !aCtx.IsNull() )
+ if ( OCCViewer_Viewer* aViewer = myPreviewViewManager->getOCCViewer() )
{
- for ( ; aRegionsIter.More(); aRegionsIter.Next() )
+ Handle(AIS_InteractiveContext) aCtx = aViewer->getAISContext();
+ if ( !aCtx.IsNull() )
{
- aRegion = Handle(HYDROData_Region)::DownCast( aRegionsIter.Value() );
- if ( !aRegion.IsNull() )
+ for ( ; aRegionsIter.More(); aRegionsIter.Next() )
{
- aZones = aRegion->GetZones();
- HYDROData_SequenceOfObjects::Iterator aZonesIter( aZones );
- for ( ; aZonesIter.More(); aZonesIter.Next() )
+ aRegion = Handle(HYDROData_Region)::DownCast( aRegionsIter.Value() );
+ if ( !aRegion.IsNull() )
{
- if ( theIsVisible )
- {
- showObject( aZonesIter.Value(), aCtx );
- }
- else
+ aZones = aRegion->GetZones();
+ HYDROData_SequenceOfObjects::Iterator aZonesIter( aZones );
+ for ( ; aZonesIter.More(); aZonesIter.Next() )
{
- module()->removeObjectShape( HYDROGUI_Module::VMR_PreviewCaseZones, aZonesIter.Value() );
+ if ( theIsVisible )
+ {
+ showObject( aZonesIter.Value(), aCtx );
+ }
+ else
+ {
+ module()->removeObjectShape( HYDROGUI_Module::VMR_PreviewCaseZones, aZonesIter.Value() );
+ }
}
}
}
for( int aPointType = HYDROGUI_PrsImage::PointA;
aPointType <= HYDROGUI_PrsImage::PointC; aPointType++ )
{
- myPointXDegMap[ aPointType ]->setVisible( anIsManualLambert );
- myPointYDegMap[ aPointType ]->setVisible( anIsManualLambert );
- myPointXMinMap[ aPointType ]->setVisible( anIsManualLambert );
- myPointYMinMap[ aPointType ]->setVisible( anIsManualLambert );
- myPointXSecMap[ aPointType ]->setVisible( anIsManualLambert );
- myPointYSecMap[ aPointType ]->setVisible( anIsManualLambert );
-
- myCartPointXMap[ aPointType ]->setVisible( anIsManualCartesian );
- myCartPointYMap[ aPointType ]->setVisible( anIsManualCartesian );
+ myPointXDegMap[ aPointType ]->setVisible( anIsManualCartesian );
+ myPointYDegMap[ aPointType ]->setVisible( anIsManualCartesian );
+ myPointXMinMap[ aPointType ]->setVisible( anIsManualCartesian );
+ myPointYMinMap[ aPointType ]->setVisible( anIsManualCartesian );
+ myPointXSecMap[ aPointType ]->setVisible( anIsManualCartesian );
+ myPointYSecMap[ aPointType ]->setVisible( anIsManualCartesian );
+
+ myCartPointXMap[ aPointType ]->setVisible( anIsManualLambert );
+ myCartPointYMap[ aPointType ]->setVisible( anIsManualLambert );
myRefPointXMap[ aPointType ]->setVisible( anIsRefImage );
myRefPointYMap[ aPointType ]->setVisible( anIsRefImage );
State aRes = Acceptable;
QString aName = theName.simplified();
- if ( aName.isEmpty() )
+ if( !myEditedObject.IsNull() ) // To avoid problems when myEditedObject is not set yet
{
- aRes = Intermediate;
- }
- else if( !myEditedObject.IsNull() && myEditedObject->GetName() != theName )
- {
- // check that there are no other objects with the same name in the document
- Handle(HYDROData_Entity) anObject = HYDROGUI_Tool::FindObjectByName( myModule, aName );
- if ( !anObject.IsNull() )
+ if ( aName.isEmpty() )
{
aRes = Intermediate;
}
+ else if( myEditedObject->GetName() != theName )
+ {
+ // check that there are no other objects with the same name in the document
+ Handle(HYDROData_Entity) anObject = HYDROGUI_Tool::FindObjectByName( myModule, aName );
+ if ( !anObject.IsNull() )
+ {
+ aRes = Intermediate;
+ }
+ }
}
return aRes;
emit alreadyExists( theName );
}
- theName = myEditedObject->GetName();
+ if( !myEditedObject.IsNull() )
+ {
+ theName = myEditedObject->GetName();
+ }
}
void HYDROGUI_NameValidator::setEditedObject( const Handle(HYDROData_Entity) theObj )