void HYDROData_Entity::SetLabel( const TDF_Label& theLabel )
{
- myLab = theLabel;
+ myLab = theLabel;
}
void HYDROData_Entity::SaveByteArray( const int theTag,
Handle(HYDROData_Entity) HYDROData_Entity::GetReferenceObject( const int theTag,
const int theIndex ) const
{
+ //DEBTRACE("GetReferenceObject " << theTag << " " << theIndex);
Handle(HYDROData_Entity) aRes;
Handle(TDataStd_ReferenceList) aRefs = getReferenceList( theTag, false );
Handle(TDataStd_ReferenceList) HYDROData_Entity::getReferenceList( const int theTag,
const bool theIsCreate ) const
{
+ //DEBTRACE("getReferenceList " << theTag << " " << theIsCreate);
TDF_Label aLabel = theTag == 0 ? myLab : myLab.FindChild( theTag );
Handle(TDataStd_ReferenceList) aRefs;
if ( !aLabel.FindAttribute( TDataStd_ReferenceList::GetID(), aRefs ) && theIsCreate )
aRefs = TDataStd_ReferenceList::Set( aLabel );
-
return aRefs;
}
QString HYDROData_Entity::getPyTypeID() const
{
- DEBTRACE("HYDROData_Entity::getPyTypeID " << GetKind());
+ //DEBTRACE("HYDROData_Entity::getPyTypeID " << GetKind());
switch( GetKind() )
{
case KIND_IMAGE: return "KIND_IMAGE";
return anAttr->Get();
}
+
+void HYDROData_Entity::SetInteger( int theTag, int theValue )
+{
+ Handle(TDataStd_Integer) anAttr;
+ TDF_Label aLabel = myLab.FindChild( theTag );
+ if( !aLabel.FindAttribute( TDataStd_Integer::GetID(), anAttr ) )
+ aLabel.AddAttribute( anAttr = new TDataStd_Integer() );
+ anAttr->Set( theValue );
+}
+
+int HYDROData_Entity::GetInteger( int theTag, int theDefValue ) const
+{
+ Handle(TDataStd_Integer) anAttr;
+ TDF_Label aLabel = myLab.FindChild( theTag );
+ if( !aLabel.FindAttribute( TDataStd_Integer::GetID(), anAttr ) )
+ return 0;
+
+ return anAttr->Get();
+}
+
+bool HYDROData_Entity::CompareLabels(const Handle(HYDROData_Entity)& theOtherObj)
+{
+ if ( !theOtherObj.IsNull() )
+ return this->Label() == theOtherObj->Label();
+ return false;
+}
+