#include <SUIT_DataObject.h>
#include <TDF_Tool.hxx>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+#include <QPixmap>
HYDROGUI_DataObject::HYDROGUI_DataObject( SUIT_DataObject* theParent,
Handle(HYDROData_Entity) theData,
return aColor;
}
+QPixmap HYDROGUI_DataObject::icon( const int theId ) const
+{
+ SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+ if ( theId == NameId )
+ {
+ QString anIcon;
+ Handle(HYDROData_Entity) aDataObject = modelObject();
+ if( aDataObject.IsNull() )
+ {
+ anIcon = QObject::tr( "HYDRO_TYPE0_ICO" ); // KIND_UNKNOWN
+ }
+ else
+ {
+ anIcon = QObject::tr( QString("HYDRO_TYPE%1_ICO").arg( (int)aDataObject->GetKind() ).toAscii() );
+ }
+
+ return aResMgr->loadPixmap( "HYDRO", anIcon );
+ }
+ return LightApp_DataObject::icon( theId );
+}
+
QString HYDROGUI_DataObject::dataObjectEntry( const Handle(HYDROData_Entity)& theObject,
const bool theWithPrefix )
{
return myName;
}
+QPixmap HYDROGUI_NamedObject::icon( const int theId ) const
+{
+ SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+ if ( theId == NameId )
+ {
+ return aResMgr->loadPixmap( "HYDRO", QObject::tr( "PARTITION_ICO" ) );
+ }
+ return LightApp_DataObject::icon( theId );
+}
+
HYDROGUI_DropTargetObject::HYDROGUI_DropTargetObject( SUIT_DataObject* theParent,
const QString& theName,
const QString& theParentEntry )
: HYDROGUI_NamedObject( theParent, theName, theParentEntry ), CAM_DataObject( theParent )
{
}
-
*/
virtual QColor color( const ColorRole, const int = NameId ) const;
+ /**
+ * Returns the object icon.
+ */
+ virtual QPixmap icon( const int = NameId ) const;
+
/**
* Returns the model data object.
*/
Handle(HYDROData_Entity) myData; ///< object from data model
QString myParentEntry;
bool myIsValid; ///< indicates if the object is valid
+ QPixmap myIcon;
};
/**
*/
virtual QString name() const;
+ /**
+ * Returns the object icon.
+ */
+ virtual QPixmap icon( const int = NameId ) const;
+
private:
QString myName; ///< name in the OB
QString myParentEntry;
+ QPixmap myIcon;
};
/**
<source>UNDO_ICO</source>
<translation>icon_undo.png</translation>
</message>
+ <message>
+ <source>PARTITION_ICO</source>
+ <translation>icon_partition.png</translation>
+ </message>
+ <message>
+ <source>HYDRO_TYPE0_ICO</source>
+ <translation>icon_hydro_obj.png</translation>
+ </message>
+ <message>
+ <source>HYDRO_TYPE1_ICO</source>
+ <translation>icon_image.png</translation>
+ </message>
+ <message>
+ <source>HYDRO_TYPE2_ICO</source>
+ <translation>icon_polyline.png</translation>
+ </message>
+ <message>
+ <source>HYDRO_TYPE3_ICO</source>
+ <translation>icon_bathymetry.png</translation>
+ </message>
+ <message>
+ <source>HYDRO_TYPE4_ICO</source>
+ <translation>icon_hydro_obj.png</translation>
+ </message>
+ <message>
+ <source>HYDRO_TYPE5_ICO</source>
+ <translation>icon_hydro_obj.png</translation>
+ </message>
+ <message>
+ <source>HYDRO_TYPE6_ICO</source>
+ <translation>icon_river.png</translation>
+ </message>
+ <message>
+ <source>HYDRO_TYPE7_ICO</source>
+ <translation>icon_stream.png</translation>
+ </message>
+ <message>
+ <source>HYDRO_TYPE8_ICO</source>
+ <translation>icon_hydro_obj.png</translation>
+ </message>
+ <message>
+ <source>HYDRO_TYPE9_ICO</source>
+ <translation>icon_hydro_obj.png</translation>
+ </message>
+ <message>
+ <source>HYDRO_TYPE10_ICO</source>
+ <translation>icon_obstacle.png</translation>
+ </message>
+ <message>
+ <source>HYDRO_TYPE11_ICO</source>
+ <translation>icon_hydro_obj.png</translation>
+ </message>
+ <message>
+ <source>HYDRO_TYPE12_ICO</source>
+ <translation>icon_profile.png</translation>
+ </message>
+ <message>
+ <source>HYDRO_TYPE13_ICO</source>
+ <translation>icon_hydro_obj.png</translation>
+ </message>
+ <message>
+ <source>HYDRO_TYPE14_ICO</source>
+ <translation>icon_polyline_xy.png</translation>
+ </message>
+ <message>
+ <source>HYDRO_TYPE15_ICO</source>
+ <translation>icon_calculation.png</translation>
+ </message>
+ <message>
+ <source>HYDRO_TYPE16_ICO</source>
+ <translation>icon_hydro_obj.png</translation>
+ </message>
+ <message>
+ <source>HYDRO_TYPE17_ICO</source>
+ <translation>icon_hydro_obj.png</translation>
+ </message>
+ <message>
+ <source>HYDRO_TYPE18_ICO</source>
+ <translation>icon_vis_state.png</translation>
+ </message>
+ <message>
+ <source>HYDRO_TYPE19_ICO</source>
+ <translation>icon_artobj.png</translation>
+ </message>
+ <message>
+ <source>HYDRO_TYPE20_ICO</source>
+ <translation>icon_hydro_obj.png</translation>
+ </message>
</context>
</TS>