-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// 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
#include <HYDROData_Zone.h>
#include <HYDROData_Object.h>
-#include <HYDROData_Bathymetry.h>
+#include <HYDROData_IAltitudeObject.h>
#include <SUIT_DataObject.h>
#include <QSet>
// Get Ref.Object name
aRes = getRefObjectNames();
break;
- case BathymetryId:
- // Get bathymetry name
- aRes = getBathimetryName();
+ case AltitudeObjId:
+ // Get altitude object name
+ aRes = getAltitudeName();
break;
default:
aRes = LightApp_DataObject::text( theColumnId );
return aRes;
}
-QString HYDROGUI_Zone::getBathimetryName() const
+QString HYDROGUI_Zone::getAltitudeName() const
{
QString aRes;
Handle(HYDROData_Zone) aZone = Handle(HYDROData_Zone)::DownCast( modelObject() );
if ( ( isMergingNeed && aZone->GetMergeType() == HYDROData_Zone::Merge_UNKNOWN )
|| ( aSeq.Length() == 1 ) || ( !isMergingNeed ) )
{
- // Collect all used bathymetries names when merging is necessary
- // or just get the name of bathymetry of a single geometry object
- // or just get the name of a single bathymetry
+ // Collect all used altitudes names when merging is necessary
+ // or just get the name of altitude of a single geometry object
+ // or just get the name of a single altitude
HYDROData_SequenceOfObjects::Iterator anIter( aSeq );
QSet<QString> aNamesSet;
QString aName;
Handle(HYDROData_Object)::DownCast( anIter.Value() );
if ( !aRefGeomObj.IsNull() )
{
- // Get bathymetry name
- Handle(HYDROData_Bathymetry) aBathymetry = aRefGeomObj->GetBathymetry();
- if ( !aBathymetry.IsNull() )
+ // Get altitude object name
+ Handle(HYDROData_IAltitudeObject) anAltitudeObj = aRefGeomObj->GetAltitudeObject();
+ if ( !anAltitudeObj.IsNull() )
{
- aName = aBathymetry->GetName();
+ aName = anAltitudeObj->GetName();
if ( !isMergingNeed )
{
- // Get the first geometry object's bathymetry name and go out
+ // Get the first geometry object's altitude name and go out
aRes = aName;
break;
}
case HYDROData_Zone::Merge_ZMAX: // The maximum values
aRes = QObject::tr( "MERGE_ZMAX" );
break;
- case HYDROData_Zone::Merge_Object: // Only one bathymetry will be taken into account
+ case HYDROData_Zone::Merge_Object: // Only one altitude will be taken into account
{
- Handle(HYDROData_Bathymetry) aBathymetry = aZone->GetMergeBathymetry();
- if ( !aBathymetry.IsNull() )
- {
- aRes = aBathymetry->GetName();
- }
+ Handle(HYDROData_IAltitudeObject) anAltitude = aZone->GetMergeAltitude();
+ if ( !anAltitude.IsNull() )
+ aRes = anAltitude->GetName();
break;
}
default:
QColor HYDROGUI_Zone::color( const ColorRole theColorRole, const int theColumnId ) const
{
- // Implement red color for bathymetry conflicts in case creation dialog
+ // Implement red color for altitude conflicts in case creation dialog
QColor aRes;
Handle(HYDROData_Zone) aZone = Handle(HYDROData_Zone)::DownCast( modelObject() );
if ( !aZone.IsNull() )
return aRes;
}
-QStringList HYDROGUI_Zone::getBathymetries() const
+QStringList HYDROGUI_Zone::getAltitudes() const
{
QStringList aRes;
Handle(HYDROData_Zone) aZone = Handle(HYDROData_Zone)::DownCast( modelObject() );
if ( !aZone.IsNull() )
{
HYDROData_SequenceOfObjects aSeq = aZone->GetGeometryObjects();
- // Collect all used bathymetries names when merging is necessary
- // or just get the name of bathymetry of a single geometry object
+ // Collect all used altitudes names when merging is necessary
+ // or just get the name of altitude of a single geometry object
HYDROData_SequenceOfObjects::Iterator anIter( aSeq );
for ( ; anIter.More(); anIter.Next() )
{
Handle(HYDROData_Object)::DownCast( anIter.Value() );
if ( !aRefGeomObj.IsNull() )
{
- // Get bathymetry name
- Handle(HYDROData_Bathymetry) aBathymetry = aRefGeomObj->GetBathymetry();
- if ( !aBathymetry.IsNull() && !aRes.contains( aBathymetry->GetName() ))
- {
- aRes.append( aBathymetry->GetName() );
- }
+ Handle(HYDROData_IAltitudeObject) anAltitudeObj = aRefGeomObj->GetAltitudeObject();
+ if ( !anAltitudeObj.IsNull() && !aRes.contains( anAltitudeObj->GetName() ) )
+ aRes.append( anAltitudeObj->GetName() );
}
}
}
return aRes;
}
-HYDROData_Zone::MergeBathymetriesType HYDROGUI_Zone::getMergeType() const
+HYDROData_Zone::MergeAltitudesType HYDROGUI_Zone::getMergeType() const
{
- HYDROData_Zone::MergeBathymetriesType aRes = HYDROData_Zone::Merge_UNKNOWN;
+ HYDROData_Zone::MergeAltitudesType aRes = HYDROData_Zone::Merge_UNKNOWN;
Handle(HYDROData_Zone) aZone = Handle(HYDROData_Zone)::DownCast( modelObject() );
if ( !aZone.IsNull() )
{
return aRes;
}
-void HYDROGUI_Zone::setMergeType( int theMergeType, QString theBathymetryName )
+void HYDROGUI_Zone::setMergeType( int theMergeType, QString theAltitudeName )
{
Handle(HYDROData_Zone) aZone = Handle(HYDROData_Zone)::DownCast( modelObject() );
if ( !aZone.IsNull() )
{
- HYDROData_Zone::MergeBathymetriesType aMergeType =
- ( HYDROData_Zone::MergeBathymetriesType )theMergeType;
+ HYDROData_Zone::MergeAltitudesType aMergeType =
+ ( HYDROData_Zone::MergeAltitudesType )theMergeType;
aZone->SetMergeType( aMergeType );
if ( aMergeType == HYDROData_Zone::Merge_Object )
{
- // Find a bathymetry by the given name and set it as the zone's merge bathymetry
+ // Find an altitude object by the given name and set it as the zone's merge altitude
HYDROData_SequenceOfObjects aSeq = aZone->GetGeometryObjects();
HYDROData_SequenceOfObjects::Iterator anIter( aSeq );
for ( ; anIter.More(); anIter.Next() )
Handle(HYDROData_Object)::DownCast( anIter.Value() );
if ( !aRefGeomObj.IsNull() )
{
- // Get bathymetry name
- Handle(HYDROData_Bathymetry) aBathymetry = aRefGeomObj->GetBathymetry();
- if ( !aBathymetry.IsNull() && theBathymetryName == aBathymetry->GetName() )
+ // Get altitude object name
+ Handle(HYDROData_IAltitudeObject) anAltitudeObj = aRefGeomObj->GetAltitudeObject();
+ if ( !anAltitudeObj.IsNull() && theAltitudeName == anAltitudeObj->GetName() )
{
- aZone->SetMergeBathymetry( aBathymetry );
+ aZone->SetMergeAltitude( anAltitudeObj );
break;
}
}