#include <HYDROData_DummyObject3D.h>
#include <HYDROData_ImmersibleZone.h>
#include <HYDROData_Object.h>
+#include <HYDROData_ArtificialObject.h>
+#include <HYDROData_NaturalObject.h>
#include <TDF_Tool.hxx>
#include <SUIT_Study.h>
#include <QPixmap>
+#include <QPainter>
HYDROGUI_DataObject::HYDROGUI_DataObject( SUIT_DataObject* theParent,
Handle(HYDROData_Entity) theData,
{
QString anIcon;
Handle(HYDROData_Entity) aDataObject = modelObject();
+ Handle(HYDROData_Object) anObject;
+ Handle(HYDROData_ArtificialObject) anAObject = Handle( HYDROData_ArtificialObject )::DownCast(aDataObject);
+ Handle(HYDROData_NaturalObject) aNObject = Handle( HYDROData_NaturalObject )::DownCast(aDataObject);
+
+ if (!anAObject.IsNull())
+ anObject = anAObject;
+ if (!aNObject.IsNull())
+ anObject = aNObject;
+
if( aDataObject.IsNull() )
{
anIcon = QObject::tr( "HYDRO_TYPE0_ICO" ); // KIND_UNKNOWN
if ( !aFatherObj.IsNull() )
anObjectKind = aFatherObj->GetKind();
}
- else if ( anObjectKind == 5 )
+ else if ( !anObject.IsNull() )
{
- Handle(HYDROData_ImmersibleZone) anImmZone = Handle(HYDROData_ImmersibleZone)::DownCast( aDataObject );
- IsUnsImmZone = !anImmZone->IsSubmersible();
+ bool IsSubm = anObject->IsSubmersible();
+ QString anIcon1 = QObject::tr( QString("HYDRO_%1TYPE%2_ICO").arg( aNeedUpdate ).arg( anObjectKind ).toLatin1() );
+ QString anIcon2;
+ if (IsSubm)
+ anIcon2 = QObject::tr( QString("HYDRO_SUBMERSIBLE16_ICO").toLatin1());
+ else
+ anIcon2 = QObject::tr( QString("HYDRO_UNSUBMERSIBLE16_ICO").toLatin1());
+
+ QPixmap qpm1 = aResMgr->loadPixmap( "HYDRO", anIcon1 );
+ QPixmap qpm2 = aResMgr->loadPixmap( "HYDRO", anIcon2 );
+ QPixmap qpmD(32,16);
+ qpmD.fill(QColor(0,0,0));
+ QPainter painter;
+ painter.begin(&qpmD);
+ painter.drawPixmap(0, 0, qpm1);
+ painter.drawPixmap(16, 0, qpm2);
+ painter.end();
+ return qpmD;
}
- if (!IsUnsImmZone)
- anIcon = QObject::tr( QString("HYDRO_%1TYPE%2_ICO").arg( aNeedUpdate ).arg( anObjectKind ).toLatin1() );
else
- anIcon = QObject::tr( QString("HYDRO_%1TYPE5U_ICO").arg( aNeedUpdate ).toLatin1() ); //icon fot unsumb imm zone
+ anIcon = QObject::tr( QString("HYDRO_%1TYPE%2_ICO").arg( aNeedUpdate ).arg( anObjectKind ).toLatin1() );
}
return aResMgr->loadPixmap( "HYDRO", anIcon );
#include <HYDROData_Lambert93.h>
#include <HYDROData_Polyline3D.h>
#include <HYDROData_StricklerTable.h>
+#include <HYDROData_ArtificialObject.h>
+#include <HYDROData_NaturalObject.h>
#include <HYDROData_OperationsFactory.h>
{
if( aSeq.Size() > 0 )
{
- Handle( HYDROData_Object ) anObject = Handle( HYDROData_Object )::DownCast( aSeq.First() );
+ Handle( HYDROData_Entity ) aFirstEnt = aSeq.First();
+ Handle(HYDROData_Object) anObject;
+ Handle(HYDROData_ArtificialObject) anAObject = Handle( HYDROData_ArtificialObject )::DownCast(aFirstEnt);
+ Handle(HYDROData_NaturalObject) aNObject = Handle( HYDROData_NaturalObject )::DownCast(aFirstEnt);
+
+ if (!anAObject.IsNull())
+ anObject = anAObject;
+ if (!aNObject.IsNull())
+ anObject = aNObject;
+
if( !anObject.IsNull() )
{
theMenu->addSeparator();
createAction( ProfileInterpolateId, "PROFILE_INTERPOLATE", "PROFILE_INTERPOLATE_ICO" );
createAction( SubmersibleId, "SUBMERSIBLE", "SUBMERSIBLE_ICO" );
- createAction( UnSubmersibleId, "UNSUBMERSIBLE", "UNSUBMERSIBLE_ICO" );
+ createAction( UnSubmersibleId, "UNSUBMERSIBLE", "HYDRO_UNSUBMERSIBLE16_ICO" );
createAction( ExportToShapeFileID, "EXPORT_TO_SHAPE_FILE", "EXPORT_TO_SHAPE_FILE_ICO" );
createAction( PolylineExtractionId, "POLYLINE_EXTRACTION" );
<translation>icon_submersible.png</translation>
</message>
<message>
- <source>UNSUBMERSIBLE_ICO</source>
- <translation>icon_imm_uns_zone.png</translation>
+ <source>HYDRO_UNSUBMERSIBLE_ICO</source>
+ <translation>icon_unsubmersible.png</translation>
+ </message>
+ <message>
+ <source>HYDRO_UNSUBMERSIBLE16_ICO</source>
+ <translation>icon_unsumb_16.png</translation>
+ </message>
+ <message>
+ <source>HYDRO_SUBMERSIBLE16_ICO</source>
+ <translation>icon_sumb_16.png</translation>
</message>