1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0030919: ACIS Import - Improving translation of string attributes into XDE

- Added possibility to get (or create if absent) a properties attribute via ShapeTool;
- Added Draw command to print properties attached to a Label.
This commit is contained in:
anv
2019-08-28 16:31:12 +03:00
committed by apn
parent fb64d0f4a2
commit 07f2064617
3 changed files with 110 additions and 1 deletions

View File

@@ -2108,3 +2108,38 @@ Standard_Boolean XCAFDoc_ShapeTool::updateComponent(const TDF_Label& theItemLabe
return isModified;
}
//=======================================================================
//function : GetNamedProperties
//purpose :
//=======================================================================
Handle(TDataStd_NamedData) XCAFDoc_ShapeTool::GetNamedProperties (const TDF_Label& theLabel,
const Standard_Boolean theToCreate) const
{
Handle(TDataStd_NamedData) aNamedProperty;
if (!theLabel.FindAttribute(TDataStd_NamedData::GetID(), aNamedProperty) && theToCreate)
{
aNamedProperty = TDataStd_NamedData::Set(theLabel);
}
return aNamedProperty;
}
//=======================================================================
//function : GetNamedProperties
//purpose :
//=======================================================================
Handle(TDataStd_NamedData) XCAFDoc_ShapeTool::GetNamedProperties (const TopoDS_Shape& theShape,
const Standard_Boolean theToCreate) const
{
Handle(TDataStd_NamedData) aNamedProperty;
TDF_Label aLabel;
if (!Search (theShape, aLabel))
return aNamedProperty;
aNamedProperty = GetNamedProperties (aLabel, theToCreate);
return aNamedProperty;
}