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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user