#include "HYDROData_CalculationCase.h"
#include "HYDROData_ArtificialObject.h"
-#include "HYDROData_Bathymetry.h"
+#include "HYDROData_IAltitudeObject.h"
#include "HYDROData_Document.h"
#include "HYDROData_ShapesGroup.h"
#include "HYDROData_Iterator.h"
double HYDROData_CalculationCase::GetAltitudeForPoint( const gp_XY& thePoint ) const
{
- double aResAltitude = HYDROData_Bathymetry::GetInvalidAltitude();
+ double aResAltitude = HYDROData_IAltitudeObject::GetInvalidAltitude();
Handle(HYDROData_Zone) aZone = GetZoneFromPoint( thePoint );
if ( aZone.IsNull() )
return aResAltitude;
- HYDROData_Zone::MergeBathymetriesType aZoneMergeType = aZone->GetMergeType();
+ HYDROData_Zone::MergeAltitudesType aZoneMergeType = aZone->GetMergeType();
if ( !aZone->IsMergingNeed() )
{
aZoneMergeType = HYDROData_Zone::Merge_UNKNOWN;
if ( aZoneMergeType == HYDROData_Zone::Merge_Object )
{
- Handle(HYDROData_Bathymetry) aMergeBathymetry = aZone->GetMergeBathymetry();
- if ( !aMergeBathymetry.IsNull() )
- aResAltitude = aMergeBathymetry->GetAltitudeForPoint( thePoint );
+ Handle(HYDROData_IAltitudeObject) aMergeAltitude = aZone->GetMergeAltitude();
+ if ( !aMergeAltitude.IsNull() )
+ aResAltitude = aMergeAltitude->GetAltitudeForPoint( thePoint );
}
else
{
if ( aZoneObj.IsNull() )
continue;
- Handle(HYDROData_Bathymetry) anObjBathymetry = aZoneObj->GetBathymetry();
- if ( anObjBathymetry.IsNull() )
+ Handle(HYDROData_IAltitudeObject) anObjAltitude = aZoneObj->GetAltitudeObject();
+ if ( anObjAltitude.IsNull() )
continue;
- double aPointAltitude = anObjBathymetry->GetAltitudeForPoint( thePoint );
- if ( ValuesEquals( aPointAltitude, HYDROData_Bathymetry::GetInvalidAltitude() ) )
+ double aPointAltitude = anObjAltitude->GetAltitudeForPoint( thePoint );
+ if ( ValuesEquals( aPointAltitude, HYDROData_IAltitudeObject::GetInvalidAltitude() ) )
continue;
if ( aZoneMergeType == HYDROData_Zone::Merge_UNKNOWN )
}
else if ( aZoneMergeType == HYDROData_Zone::Merge_ZMIN )
{
- if ( ValuesEquals( aResAltitude, HYDROData_Bathymetry::GetInvalidAltitude() ) ||
+ if ( ValuesEquals( aResAltitude, HYDROData_IAltitudeObject::GetInvalidAltitude() ) ||
aResAltitude > aPointAltitude )
{
aResAltitude = aPointAltitude;
}
else if ( aZoneMergeType == HYDROData_Zone::Merge_ZMAX )
{
- if ( ValuesEquals( aResAltitude, HYDROData_Bathymetry::GetInvalidAltitude() ) ||
+ if ( ValuesEquals( aResAltitude, HYDROData_IAltitudeObject::GetInvalidAltitude() ) ||
aResAltitude < aPointAltitude )
{
aResAltitude = aPointAltitude;
#include "HYDROData_ImmersibleZone.h"
-#include "HYDROData_Bathymetry.h"
+#include "HYDROData_IAltitudeObject.h"
#include "HYDROData_Document.h"
#include "HYDROData_ShapesGroup.h"
#include "HYDROData_PolylineXY.h"
aResList << QString( "%1.SetBorderColor( border_color );" ).arg( aZoneName );
aResList << QString( "" );
- Handle(HYDROData_Bathymetry) aRefBathymetry = GetBathymetry();
- setPythonReferenceObject( theTreatedObjects, aResList, aRefBathymetry, "SetBathymetry" );
+ Handle(HYDROData_IAltitudeObject) aRefAltitude = GetAltitudeObject();
+ setPythonReferenceObject( theTreatedObjects, aResList, aRefAltitude, "SetAltitudeObject" );
Handle(HYDROData_PolylineXY) aRefPolyline = GetPolyline();
setPythonReferenceObject( theTreatedObjects, aResList, aRefPolyline, "SetPolyline" );
#include "HYDROData_Object.h"
-#include "HYDROData_Bathymetry.h"
#include "HYDROData_DummyObject3D.h"
#include "HYDROData_ShapesGroup.h"
#include "HYDROData_Iterator.h"
+#include "HYDROData_IAltitudeObject.h"
#include <TNaming_Builder.hxx>
#include <TNaming_NamedShape.hxx>
{
HYDROData_SequenceOfObjects aResSeq = HYDROData_Entity::GetAllReferenceObjects();
- Handle(HYDROData_Bathymetry) aRefBathymetry = GetBathymetry();
- if ( !aRefBathymetry.IsNull() )
- aResSeq.Append( aRefBathymetry );
+ Handle(HYDROData_IAltitudeObject) aRefAltitude = GetAltitudeObject();
+ if ( !aRefAltitude.IsNull() )
+ aResSeq.Append( aRefAltitude );
return aResSeq;
}
return GetReferenceObjects( DataTag_EdgesGroup );
}
-bool HYDROData_Object::SetBathymetry( const Handle(HYDROData_Bathymetry)& theBathymetry )
+bool HYDROData_Object::SetAltitudeObject(
+ const Handle(HYDROData_IAltitudeObject)& theAltitude )
{
- if ( theBathymetry.IsNull() )
+ if ( theAltitude.IsNull() )
return false;
- Handle(HYDROData_Bathymetry) aPrevBathymetry = GetBathymetry();
- if ( IsEqual( aPrevBathymetry, theBathymetry ) )
+ Handle(HYDROData_IAltitudeObject) aPrevAltitude = GetAltitudeObject();
+ if ( IsEqual( aPrevAltitude, theAltitude ) )
return true;
- SetReferenceObject( theBathymetry, DataTag_Bathymetry );
+ SetReferenceObject( theAltitude, DataTag_AltitudeObject );
// Indicate model of the need to update object
SetToUpdate( true );
return true;
}
-
-Handle(HYDROData_Bathymetry) HYDROData_Object::GetBathymetry() const
+Handle(HYDROData_IAltitudeObject) HYDROData_Object::GetAltitudeObject() const
{
- return Handle(HYDROData_Bathymetry)::DownCast(
- GetReferenceObject( DataTag_Bathymetry ) );
+ return Handle(HYDROData_IAltitudeObject)::DownCast(
+ GetReferenceObject( DataTag_AltitudeObject ) );
}
-void HYDROData_Object::RemoveBathymetry()
+void HYDROData_Object::RemoveAltitudeObject()
{
- Handle(HYDROData_Bathymetry) aPrevBathymetry = GetBathymetry();
- if ( aPrevBathymetry.IsNull() )
+ Handle(HYDROData_IAltitudeObject) aPrevAltitude = GetAltitudeObject();
+ if ( aPrevAltitude.IsNull() )
return;
- ClearReferenceObjects( DataTag_Bathymetry );
+ ClearReferenceObjects( DataTag_AltitudeObject );
// Indicate model of the need to update object
SetToUpdate( true );
DEFINE_STANDARD_HANDLE(HYDROData_Object, HYDROData_Entity)
class TopoDS_Shape;
-class Handle(HYDROData_Bathymetry);
+class Handle(HYDROData_IAltitudeObject);
class Handle(HYDROData_DummyObject3D);
class Handle(HYDROData_ShapesGroup);
DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve
DataTag_TopShape,
DataTag_Shape3D,
- DataTag_Bathymetry, ///< reference bathymetry
- DataTag_FillingColor, ///< filling color of geometrical object
- DataTag_BorderColor, ///< border color of geometrical object
- DataTag_Object3D, ///< child 3D object
- DataTag_EdgesGroup, ///< child group objects
+ DataTag_AltitudeObject, ///< reference altitude object
+ DataTag_FillingColor, ///< filling color of geometrical object
+ DataTag_BorderColor, ///< border color of geometrical object
+ DataTag_Object3D, ///< child 3D object
+ DataTag_EdgesGroup, ///< child group objects
};
public:
/**
- * Set reference bathymetry object for geometry object.
+ * Set reference altitude object for geometry object.
*/
- HYDRODATA_EXPORT virtual bool SetBathymetry( const Handle(HYDROData_Bathymetry)& theBathymetry );
+ HYDRODATA_EXPORT virtual bool SetAltitudeObject( const Handle(HYDROData_IAltitudeObject)& theAltitude );
/**
- * Returns reference bathymetry object of geometry object.
+ * Returns reference altitude object of geometry object.
*/
- HYDRODATA_EXPORT virtual Handle(HYDROData_Bathymetry) GetBathymetry() const;
+ HYDRODATA_EXPORT virtual Handle(HYDROData_IAltitudeObject) GetAltitudeObject() const;
/**
- * Clear the reference bathymetry object for geometry object.
+ * Clear the reference altitude object for geometry object.
*/
- HYDRODATA_EXPORT virtual void RemoveBathymetry();
+ HYDRODATA_EXPORT virtual void RemoveAltitudeObject();
+
/**
* Sets filling color for object.
#include "HYDROData_Polyline3D.h"
-#include "HYDROData_Bathymetry.h"
+#include "HYDROData_IAltitudeObject.h"
#include "HYDROData_Document.h"
#include "HYDROData_PolylineXY.h"
#include "HYDROData_Profile.h"
Handle(HYDROData_ProfileUZ) aProfileUZ = GetProfileUZ();
- Handle(HYDROData_Bathymetry) aBathymetry = GetBathymetry();
- if ( !aBathymetry.IsNull() )
+ Handle(HYDROData_IAltitudeObject) anAltitude = GetAltitudeObject();
+ if ( !anAltitude.IsNull() )
aProfileUZ = GetChildProfileUZ();
if ( aProfileUZ.IsNull() )
SetReferenceObject( theProfile, DataTag_ProfileUZ );
// Remove the bathymetry, because one altitude object can be presented at time
- RemoveBathymetry();
+ RemoveAltitudeObject();
// Indicate model of the need to update the polyline presentation
SetToUpdate( true );
SetToUpdate( true );
}
-bool HYDROData_Polyline3D::SetBathymetry( const Handle(HYDROData_Bathymetry)& theBathymetry )
+bool HYDROData_Polyline3D::SetAltitudeObject(
+ const Handle(HYDROData_IAltitudeObject)& theAltitude )
{
- Handle(HYDROData_Bathymetry) aPrevBathymetry = GetBathymetry();
+ Handle(HYDROData_IAltitudeObject) aPrevAltitude = GetAltitudeObject();
- if ( !HYDROData_Object::SetBathymetry( theBathymetry ) )
+ if ( !HYDROData_Object::SetAltitudeObject( theAltitude ) )
return false;
- if ( IsEqual( aPrevBathymetry, theBathymetry ) )
+ if ( IsEqual( aPrevAltitude, theAltitude ) )
return true;
// Remove the u,z profile, because one altitude object can be presented at time
}
-void HYDROData_Polyline3D::RemoveBathymetry()
+void HYDROData_Polyline3D::RemoveAltitudeObject()
{
- HYDROData_Object::RemoveBathymetry();
+ HYDROData_Object::RemoveAltitudeObject();
// Remove the child profile object
removeChildProfileUZ();
}
HYDROData_IPolyline::PointsList generateProfileUZPoints(
- const Handle(HYDROData_PolylineXY)& thePolyline,
- const Handle(HYDROData_Bathymetry)& theBathymetry )
+ const Handle(HYDROData_PolylineXY)& thePolyline,
+ const Handle(HYDROData_IAltitudeObject)& theAltitude )
{
HYDROData_IPolyline::PointsList aPointsList;
- if ( thePolyline.IsNull() || theBathymetry.IsNull() )
+ if ( thePolyline.IsNull() || theAltitude.IsNull() )
return aPointsList;
bool anIsSectionClosed = thePolyline->IsClosedSection( 0 );
const HYDROData_PolylineXY::Point& aSectPoint = aPolylinePoints.Value( i );
double aPointDistance = thePolyline->GetDistance( 0, i - 1 );
- double aPointDepth = theBathymetry->GetAltitudeForPoint( aSectPoint );
- if( aPointDepth==theBathymetry->GetInvalidAltitude() )
+ double aPointDepth = theAltitude->GetAltitudeForPoint( aSectPoint );
+ if( aPointDepth == theAltitude->GetInvalidAltitude() )
aPointDepth = 0.0;
HYDROData_IPolyline::Point anAltitudePoint( aPointDistance, aPointDepth );
void HYDROData_Polyline3D::updateChildProfilePoints()
{
- Handle(HYDROData_Bathymetry) aBathymetry = GetBathymetry();
- if ( aBathymetry.IsNull() )
+ Handle(HYDROData_IAltitudeObject) anAltitude = GetAltitudeObject();
+ if ( anAltitude.IsNull() )
return;
Handle(HYDROData_ProfileUZ) aChildProfileUZ = GetChildProfileUZ();
return;
HYDROData_IPolyline::PointsList aProfilePoints =
- generateProfileUZPoints( GetPolylineXY(), GetBathymetry() );
+ generateProfileUZPoints( GetPolylineXY(), anAltitude );
aProfile->SetParametricPoints( aProfilePoints );
aProfile->Update();
* Set reference bathymetry object for geometry object.
* Reimplemented to remove reference u,z profile.
*/
- HYDRODATA_EXPORT virtual bool SetBathymetry( const Handle(HYDROData_Bathymetry)& theBathymetry );
+ HYDRODATA_EXPORT virtual bool SetAltitudeObject( const Handle(HYDROData_IAltitudeObject)& theAltitude );
/**
* Clear the reference bathymetry object for geometry object.
* Reimplemented to remove child u,z profile.
*/
- HYDRODATA_EXPORT virtual void RemoveBathymetry();
+ HYDRODATA_EXPORT virtual void RemoveAltitudeObject();
/**
#include "HYDROData_Zone.h"
#include "HYDROData_ArtificialObject.h"
-#include "HYDROData_Bathymetry.h"
+#include "HYDROData_IAltitudeObject.h"
#include "HYDROData_Document.h"
#include "HYDROData_NaturalObject.h"
bool HYDROData_Zone::IsMergingNeed() const
{
- Handle(HYDROData_Bathymetry) aRefBathymetry;
+ Handle(HYDROData_IAltitudeObject) aRefAltitude;
HYDROData_SequenceOfObjects aGeomObjects = GetGeometryObjects();
HYDROData_SequenceOfObjects::Iterator aGeomObjsIter( aGeomObjects );
if ( aRefGeomObj.IsNull() )
continue;
- Handle(HYDROData_Bathymetry) anObjBathymetry = aRefGeomObj->GetBathymetry();
- if ( anObjBathymetry.IsNull() )
+ Handle(HYDROData_IAltitudeObject) anObjAltitude = aRefGeomObj->GetAltitudeObject();
+ if ( anObjAltitude.IsNull() )
continue;
- if ( aRefBathymetry.IsNull() )
+ if ( aRefAltitude.IsNull() )
{
- aRefBathymetry = anObjBathymetry;
+ aRefAltitude = anObjAltitude;
continue;
}
- if ( !IsEqual( aRefBathymetry, anObjBathymetry ) )
+ if ( !IsEqual( aRefAltitude, anObjAltitude ) )
return true;
}
return false;
}
-void HYDROData_Zone::SetMergeType( const MergeBathymetriesType& theType )
+void HYDROData_Zone::SetMergeType( const MergeAltitudesType& theType )
{
Handle(TDataStd_Integer) anInt;
if ( myLab.FindChild( DataTag_MergeType ).FindAttribute( TDataStd_Integer::GetID(), anInt ) )
}
}
-HYDROData_Zone::MergeBathymetriesType HYDROData_Zone::GetMergeType() const
+HYDROData_Zone::MergeAltitudesType HYDROData_Zone::GetMergeType() const
{
- MergeBathymetriesType aMergeType = Merge_UNKNOWN;
+ MergeAltitudesType aMergeType = Merge_UNKNOWN;
Handle(TDataStd_Integer) anInt;
if ( myLab.FindChild( DataTag_MergeType ).FindAttribute( TDataStd_Integer::GetID(), anInt ) )
- aMergeType = (MergeBathymetriesType)anInt->Get();
+ aMergeType = (MergeAltitudesType)anInt->Get();
return aMergeType;
}
-void HYDROData_Zone::SetMergeBathymetry( const Handle(HYDROData_Bathymetry)& theBathymetry )
+void HYDROData_Zone::SetMergeAltitude( const Handle(HYDROData_IAltitudeObject)& theAltitude )
{
- SetReferenceObject( theBathymetry, DataTag_Bathymetry );
+ SetReferenceObject( theAltitude, DataTag_MergeAltitude );
}
-Handle(HYDROData_Bathymetry) HYDROData_Zone::GetMergeBathymetry() const
+Handle(HYDROData_IAltitudeObject) HYDROData_Zone::GetMergeAltitude() const
{
- return Handle(HYDROData_Bathymetry)::DownCast(
- GetReferenceObject( DataTag_Bathymetry ) );
+ return Handle(HYDROData_IAltitudeObject)::DownCast(
+ GetReferenceObject( DataTag_MergeAltitude ) );
}
-void HYDROData_Zone::RemoveMergeBathymetry()
+void HYDROData_Zone::RemoveMergeAltitude()
{
- ClearReferenceObjects( DataTag_Bathymetry );
+ ClearReferenceObjects( DataTag_MergeAltitude );
}
bool HYDROData_Zone::AddGeometryObject( const Handle(HYDROData_Object)& theObject )
#include <HYDROData_Entity.h>
class Handle(HYDROData_Object);
-class Handle(HYDROData_Bathymetry);
+class Handle(HYDROData_IAltitudeObject);
class TopoDS_Shape;
DEFINE_STANDARD_HANDLE(HYDROData_Zone, HYDROData_Entity)
public:
- // Enumeration of mergin types for conflict bathymetries
- enum MergeBathymetriesType
+ // Enumeration of mergin types for conflict altitudes
+ enum MergeAltitudesType
{
Merge_UNKNOWN, // Undefined
Merge_ZMIN, // The minimum values
Merge_ZMAX, // The maximum values
- Merge_Object // Only one bathymetry will be taken into account
+ Merge_Object // Only one altitude will be taken into account
};
protected:
DataTag_Shape, ///< reference shape
DataTag_GeometryObject, ///< reference geometry objects
DataTag_MergeType, ///< mergin type of conflict bathymetries
- DataTag_Bathymetry, ///< reference bathymetry
+ DataTag_MergeAltitude, ///< reference altitude for conflict merge
};
public:
/**
- * Sets the merging type for conflict bathymetries.
+ * Sets the merging type for conflict altitudes.
* By default it is set to Merge_UNKNOWN.
*/
- HYDRODATA_EXPORT virtual void SetMergeType( const MergeBathymetriesType& theType );
+ HYDRODATA_EXPORT virtual void SetMergeType( const MergeAltitudesType& theType );
/**
- * Returns the merging type for conflict bathymetries.
+ * Returns the merging type for conflict altitudes.
*/
- HYDRODATA_EXPORT virtual MergeBathymetriesType GetMergeType() const;
+ HYDRODATA_EXPORT virtual MergeAltitudesType GetMergeType() const;
/**
- * Sets the reference bathymetry to resolve the conflict.
+ * Sets the reference altitude to resolve the conflict.
* This object is used only in case of "Merge_Object" merge type.
*/
- HYDRODATA_EXPORT virtual void SetMergeBathymetry( const Handle(HYDROData_Bathymetry)& theBathymetry );
+ HYDRODATA_EXPORT virtual void SetMergeAltitude( const Handle(HYDROData_IAltitudeObject)& theAltitude );
/**
- * Returns the reference bathymetry to resolve the conflict.
+ * Returns the reference altitude to resolve the conflict.
*/
- HYDRODATA_EXPORT virtual Handle(HYDROData_Bathymetry) GetMergeBathymetry() const;
+ HYDRODATA_EXPORT virtual Handle(HYDROData_IAltitudeObject) GetMergeAltitude() const;
/**
- * Removes the reference bathymetry for resolving the conflict.
+ * Removes the reference altitude for resolving the conflict.
*/
- HYDRODATA_EXPORT virtual void RemoveMergeBathymetry();
+ HYDRODATA_EXPORT virtual void RemoveMergeAltitude();
/**
myBathymetryChoice->addItem( tr("MERGE_UNKNOWN"), HYDROData_Zone::Merge_UNKNOWN );
myBathymetryChoice->addItem( tr("MERGE_ZMIN"), HYDROData_Zone::Merge_ZMIN );
myBathymetryChoice->addItem( tr("MERGE_ZMAX"), HYDROData_Zone::Merge_ZMAX );
- QStringList aList = aZone->getBathymetries();
+ QStringList aList = aZone->getAltitudes();
for ( int i = 0; i < aList.length(); i++ )
{
myBathymetryChoice->addItem( aList.at( i ), HYDROData_Zone::Merge_Object );
aCurIndex = 2;
break;
case HYDROData_Zone::Merge_Object:
- aCurIndex = 3 + aList.indexOf( aZone->text( HYDROGUI_DataObject::BathymetryId ) );
+ aCurIndex = 3 + aList.indexOf( aZone->text( HYDROGUI_DataObject::AltitudeObjId ) );
break;
default:
aCurIndex = 0; // Select unknown by default
}
}
-void HYDROGUI_CalculationOp::onSetMergeType( int theMergeType, QString& theBathymetryName )
+void HYDROGUI_CalculationOp::onSetMergeType( int theMergeType, QString& theAltitudeName )
{
HYDROGUI_CalculationDlg* aPanel =
::qobject_cast<HYDROGUI_CalculationDlg*>( inputPanel() );
HYDROGUI_Zone* aZone = aPanel->getCurrentZone();
if ( aZone )
{
- aZone->setMergeType( theMergeType, theBathymetryName );
+ aZone->setMergeType( theMergeType, theAltitudeName );
HYDROGUI_Shape* aShape = module()->getObjectShape( HYDROGUI_Module::VMR_PreviewCaseZones, aZone->modelObject() );
if ( aShape )
{
QString EntryCol = QObject::tr( "ENTRY_COLUMN" );
QString RefObjCol = tr( "REF_OBJECT_COLUMN" );
- QString BathymetryCol = tr( "BATHYMETRY_COLUMN" );
+ QString AltitudeCol = tr( "ALTITUDE_COLUMN" );
SUIT_AbstractModel* treeModel = dynamic_cast<SUIT_AbstractModel*>( model() );
//RKV: treeModel->setSearcher( theModule->getApp() );
treeModel->setAppropriate( EntryCol, Qtx::Toggled );
treeModel->registerColumn( 0, RefObjCol, HYDROGUI_DataObject::RefObjectId );
treeModel->setAppropriate( RefObjCol, Qtx::Toggled );
- treeModel->registerColumn( 0, BathymetryCol, HYDROGUI_DataObject::BathymetryId );
- treeModel->setAppropriate( BathymetryCol, Qtx::Toggled );
+ treeModel->registerColumn( 0, AltitudeCol, HYDROGUI_DataObject::AltitudeObjId );
+ treeModel->setAppropriate( AltitudeCol, Qtx::Toggled );
// Mantis issue 0020136: Drag&Drop in OB
SUIT_ProxyModel* proxyModel = dynamic_cast<SUIT_ProxyModel*>(treeModel);
LightApp_DataObject* aBathSect =
createObject( aGuiObj, tr( "ZONE_BATHYMETRY" ), aGuiObj->entry() );
- Handle(HYDROData_Bathymetry) aBathymetry = aZoneObj->GetBathymetry();
- if ( !aBathymetry.IsNull() && !aBathymetry->IsRemoved() )
- createObject( aBathSect, aBathymetry, aGuiObj->entry(), false );
+ Handle(HYDROData_IAltitudeObject) anAltitudeObj = aZoneObj->GetAltitudeObject();
+ if ( !anAltitudeObj.IsNull() && !anAltitudeObj->IsRemoved() )
+ createObject( aBathSect, anAltitudeObj, aGuiObj->entry(), false );
}
else if ( anObjectKind == KIND_POLYLINE )
{
LightApp_DataObject* aBathSect =
createObject( aGuiObj, tr( "POLYLINE3D_BATHYMETRY" ), aGuiObj->entry() );
- Handle(HYDROData_Bathymetry) aBathymetry = aPolyline3D->GetBathymetry();
- if ( !aBathymetry.IsNull() && !aBathymetry->IsRemoved() )
- createObject( aBathSect, aBathymetry, aGuiObj->entry(), false );
+ Handle(HYDROData_IAltitudeObject) anAltitudeObj = aPolyline3D->GetAltitudeObject();
+ if ( !anAltitudeObj.IsNull() && !anAltitudeObj->IsRemoved() )
+ createObject( aBathSect, anAltitudeObj, aGuiObj->entry(), false );
}
else if ( anObjectKind == KIND_CALCULATION )
{
//! Column id
enum {
RefObjectId = RefEntryId + 1, //!< Ref.Object column
- BathymetryId //!< Bathymetry column
+ AltitudeObjId //!< Altitude column
};
//! Role
if ( !aRefPolyline.IsNull() )
aSelectedPolyline = aRefPolyline->GetName();
- Handle(HYDROData_Bathymetry) aRefBathymetry = myEditedObject->GetBathymetry();
- if ( !aRefBathymetry.IsNull() )
- aSelectedBathymetry = aRefBathymetry->GetName();
+ Handle(HYDROData_IAltitudeObject) aRefAltitude = myEditedObject->GetAltitudeObject();
+ if ( !aRefAltitude.IsNull() )
+ aSelectedBathymetry = aRefAltitude->GetName();
}
}
}
aZoneObj->SetPolyline( aZonePolyline );
- aZoneObj->SetBathymetry( aZoneBathymetry );
+ aZoneObj->SetAltitudeObject( aZoneBathymetry );
aZoneObj->Update();
closePreview();
if( !aPoly.IsNull() )
aPolyName = aPoly->GetName();
- Handle(HYDROData_Bathymetry) aBathymetry = myEditedObject->GetBathymetry();
- if( !aBathymetry.IsNull() )
- aBathName = aBathymetry->GetName();
+ Handle(HYDROData_IAltitudeObject) anAltitudeObj = myEditedObject->GetAltitudeObject();
+ if( !anAltitudeObj.IsNull() )
+ aBathName = anAltitudeObj->GetName();
aPanel->setSelectedObjects( aPolyName, aProfileName, aBathName );
}
}
else
{
- aResult->SetBathymetry( aBath );
+ aResult->SetAltitudeObject( aBath );
}
if( !myIsEdit )
#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;
}
}
bool isMergingNeed() const;
/**
- * Returns the list of bathymetries names.
+ * Returns the list of altidude object names.
*/
- QStringList getBathymetries() const;
+ QStringList getAltitudes() const;
/**
- * Returns the merging type for conflict bathymetries.
+ * Returns the merging type for conflict altidudes.
*/
- HYDROData_Zone::MergeBathymetriesType getMergeType() const;
+ HYDROData_Zone::MergeAltitudesType getMergeType() const;
/**
- * Set the merging type for conflict bathymetries.
+ * Set the merging type for conflict altidudes.
* If the type is Merge_Object then use the second parameter to set the merge bathymetry.
*/
- void setMergeType( int theMergeType, QString theBathymetryName = QString() );
+ void setMergeType( int theMergeType, QString theAltitudeName = QString() );
private:
QString getRefObjectNames() const;
- QString getBathimetryName() const;
+ QString getAltitudeName() const;
};
#endif
<translation>Ref.Object</translation>
</message>
<message>
- <source>BATHYMETRY_COLUMN</source>
- <translation>Bathymetry</translation>
+ <source>ALTITUDE_COLUMN</source>
+ <translation>Altitude.Object</translation>
</message>
</context>
SET(_sip_files2
HYDROData_Entity.sip
- HYDROData_Object.sip
HYDROData_IPolyline.sip
+ HYDROData_IAltitudeObject.sip
+ HYDROData_Object.sip
HYDROData_ProfileUZ.sip
HYDROData_PolylineXY.sip
HYDROData_ArtificialObject.sip
%Import QtGuimod.sip
%Include HYDROData_Entity.sip
-%Include HYDROData_Object.sip
%Include HYDROData_IPolyline.sip
+%Include HYDROData_IAltitudeObject.sip
+%Include HYDROData_Object.sip
%Include HYDROData_ProfileUZ.sip
%Include HYDROData_PolylineXY.sip
%Include HYDROData_ArtificialObject.sip
%End
-class HYDROData_Bathymetry : HYDROData_Entity
+class HYDROData_Bathymetry : HYDROData_IAltitudeObject
{
%ConvertToSubClassCode
// Public methods to work with Bathymetry altitudes.
/**
- * Returns altitude points list.
- * \return points list
+ * Returns altitude for given point.
+ * \param thePoint the point to examine
+ * \return altitude value
*/
- static double GetInvalidAltitude();
+ double GetAltitudeForPoint( const QPointF& thePoint ) const [double (const gp_XY&)];
+ %MethodCode
+
+ // The C++ API gets the gp_XY object, we convert it from QPointF.
+ gp_XY aPoint( a0->x(), a0->y() );
+
+ Py_BEGIN_ALLOW_THREADS
+ sipRes = sipSelfWasArg ? sipCpp->HYDROData_Bathymetry::GetAltitudeForPoint( aPoint ) :
+ sipCpp->GetAltitudeForPoint( aPoint );
+ Py_END_ALLOW_THREADS
+ %End
+
+
/**
* Replace current altitude points by new one.
*/
void RemoveAltitudePoints();
- /**
- * Returns altitude for given point.
- * \param thePoint the point to examine
- * \return altitude value
- */
- double GetAltitudeForPoint( const QPointF& thePoint ) const;
- %MethodCode
-
- // The C++ API gets the gp_XY object, we convert it from QPointF.
- gp_XY aPoint( a0->x(), a0->y() );
-
- Py_BEGIN_ALLOW_THREADS
- sipRes = sipSelfWasArg ? sipCpp->HYDROData_Bathymetry::GetAltitudeForPoint( aPoint ) :
- sipCpp->GetAltitudeForPoint( aPoint );
- Py_END_ALLOW_THREADS
- %End
-
public:
// Public methods to work with files.
--- /dev/null
+// Copyright (C) 2007-2013 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.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+%ExportedHeaderCode
+#include <HYDROData_IAltitudeObject.h>
+%End
+
+class HYDROData_IAltitudeObject : HYDROData_Entity /Abstract/
+{
+
+%ConvertToSubClassCode
+ switch ( sipCpp->GetKind() )
+ {
+ case KIND_BATHYMETRY:
+ sipClass = sipClass_HYDROData_Bathymetry;
+ break;
+
+ default:
+ // We don't recognise the type.
+ sipClass = NULL;
+ }
+%End
+
+%TypeHeaderCode
+#include <HYDROData_IAltitudeObject.h>
+%End
+
+public:
+ // Public methods to work with altitudes.
+
+ /**
+ * Returns altitude points list.
+ * \return points list
+ */
+ static double GetInvalidAltitude();
+
+protected:
+
+ /**
+ * Creates new object in the internal data structure. Use higher level objects
+ * to create objects with real content.
+ */
+ HYDROData_IAltitudeObject();
+
+ /**
+ * Destructs properties of the object and object itself, removes it from the document.
+ */
+ ~HYDROData_IAltitudeObject();
+};
+
+
*/
void RemovePolyline();
- /**
- * Set reference bathymetry object for zone.
- */
- void SetBathymetry( HYDROData_Bathymetry theBathymetry ) [void (const Handle_HYDROData_Bathymetry&)];
- %MethodCode
-
- Handle(HYDROData_Bathymetry) aRefBath =
- Handle(HYDROData_Bathymetry)::DownCast( createHandle( a0 ) );
- if ( !aRefBath.IsNull() )
- {
- Py_BEGIN_ALLOW_THREADS
- sipSelfWasArg ? sipCpp->HYDROData_ImmersibleZone::SetBathymetry( aRefBath ) :
- sipCpp->SetBathymetry( aRefBath );
- Py_END_ALLOW_THREADS
- }
-
- %End
-
- /**
- * Returns reference bathymetry object of zone.
- */
- HYDROData_Bathymetry GetBathymetry() const [Handle_HYDROData_Bathymetry ()];
- %MethodCode
-
- Handle(HYDROData_Bathymetry) aRefBath;
-
- Py_BEGIN_ALLOW_THREADS
- aRefBath = sipSelfWasArg ? sipCpp->HYDROData_ImmersibleZone::GetBathymetry() :
- sipCpp->GetBathymetry();
- Py_END_ALLOW_THREADS
-
- sipRes = (HYDROData_Bathymetry*)createPointer( aRefBath );
-
- %End
-
- /**
- * Clear the bathymetry object for zone.
- */
- void RemoveBathymetry();
-
protected:
/**
public:
+ /**
+ * Set reference altitude object for geometry object.
+ */
+ bool SetAltitudeObject( HYDROData_IAltitudeObject theAltitude ) [void (const Handle_HYDROData_IAltitudeObject&)];
+ %MethodCode
+
+ Handle(HYDROData_IAltitudeObject) aRefAltitude =
+ Handle(HYDROData_IAltitudeObject)::DownCast( createHandle( a0 ) );
+ if ( !aRefAltitude.IsNull() )
+ {
+ Py_BEGIN_ALLOW_THREADS
+ sipRes = sipSelfWasArg ? sipCpp->HYDROData_Object::SetAltitudeObject( aRefAltitude ) :
+ sipCpp->SetAltitudeObject( aRefAltitude );
+ Py_END_ALLOW_THREADS
+ }
+
+ %End
+
+ /**
+ * Returns reference altitude object of geometry object.
+ */
+ HYDROData_IAltitudeObject GetAltitudeObject() const [Handle_HYDROData_IAltitudeObject ()];
+ %MethodCode
+
+ Handle(HYDROData_IAltitudeObject) aRefAltitude;
+
+ Py_BEGIN_ALLOW_THREADS
+ aRefAltitude = sipSelfWasArg ? sipCpp->HYDROData_Object::GetAltitudeObject() :
+ sipCpp->GetAltitudeObject();
+ Py_END_ALLOW_THREADS
+
+ sipRes = (HYDROData_IAltitudeObject*)createPointer( aRefAltitude );
+
+ %End
+
+ /**
+ * Clear the reference altitude object for geometry object.
+ */
+ void RemoveAltitudeObject();
protected:
public:
- // Enumeration of mergin types for conflict bathymetries
- enum MergeBathymetriesType
+ // Enumeration of mergin types for conflict altitudes
+ enum MergeAltitudesType
{
Merge_ZMIN, // The minimum values
Merge_ZMAX, // The maximum values
- Merge_Object // Only one bathymetry will be taken into account
+ Merge_Object // Only one altitude will be taken into account
};
public:
/**
- * Sets the merging type for conflict bathymetries.
+ * Sets the merging type for conflict altitudes.
* By default it is set to Merge_ZMIN.
*/
- void SetMergeType( const MergeBathymetriesType& theType );
+ void SetMergeType( const MergeAltitudesType& theType );
/**
- * Returns the merging type for conflict bathymetries.
+ * Returns the merging type for conflict altitudes.
*/
- MergeBathymetriesType GetMergeType() const;
+ MergeAltitudesType GetMergeType() const;
/**
- * Sets the reference bathymetry to resolve the conflict.
+ * Sets the reference altitude to resolve the conflict.
* This object is used only in case of "Merge_Object" merge type.
*/
- void SetMergeBathymetry( HYDROData_Bathymetry theBathymetry ) [void (const Handle_HYDROData_Bathymetry&)];
+ void SetMergeAltitude( HYDROData_IAltitudeObject theAltitude ) [void (const Handle_HYDROData_IAltitudeObject&)];
%MethodCode
- Handle(HYDROData_Bathymetry) aRefBath =
- Handle(HYDROData_Bathymetry)::DownCast( createHandle( a0 ) );
- if ( !aRefBath.IsNull() )
+ Handle(HYDROData_IAltitudeObject) aRefAltitude =
+ Handle(HYDROData_IAltitudeObject)::DownCast( createHandle( a0 ) );
+ if ( !aRefAltitude.IsNull() )
{
Py_BEGIN_ALLOW_THREADS
- sipSelfWasArg ? sipCpp->HYDROData_Zone::SetMergeBathymetry( aRefBath ) :
- sipCpp->SetMergeBathymetry( aRefBath );
+ sipSelfWasArg ? sipCpp->HYDROData_Zone::SetMergeAltitude( aRefAltitude ) :
+ sipCpp->SetMergeAltitude( aRefAltitude );
Py_END_ALLOW_THREADS
}
%End
/**
- * Returns the reference bathymetry to resolve the conflict.
+ * Returns the reference altitude to resolve the conflict.
*/
- HYDROData_Bathymetry GetMergeBathymetry() const [Handle_HYDROData_Bathymetry ()];
+ HYDROData_IAltitudeObject GetMergeAltitude() const [Handle_HYDROData_IAltitudeObject ()];
%MethodCode
- Handle(HYDROData_Bathymetry) aRefBath;
+ Handle(HYDROData_IAltitudeObject) aRefAltitude;
Py_BEGIN_ALLOW_THREADS
- aRefBath = sipSelfWasArg ? sipCpp->HYDROData_Zone::GetMergeBathymetry() :
- sipCpp->GetMergeBathymetry();
+ aRefAltitude = sipSelfWasArg ? sipCpp->HYDROData_Zone::GetMergeAltitude() :
+ sipCpp->GetMergeAltitude();
Py_END_ALLOW_THREADS
- sipRes = (HYDROData_Bathymetry*)createPointer( aRefBath );
+ sipRes = (HYDROData_IAltitudeObject*)createPointer( aRefAltitude );
%End
/**
- * Removes the reference bathymetry for resolving the conflict.
+ * Removes the reference altitude for resolving the conflict.
*/
- void RemoveMergeBathymetry();
+ void RemoveMergeAltitude();
/**