mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-19 13:40:49 +03:00
Rebased version to up-to-date CR0_DMUReviewer_2.
This commit is contained in:
@@ -280,13 +280,27 @@ Handle(XCAFView_Object) XCAFDoc_View::GetObject() const
|
|||||||
// GDT Points
|
// GDT Points
|
||||||
if (!Label().FindChild(ChildLab_GDTPoints, Standard_False).IsNull()) {
|
if (!Label().FindChild(ChildLab_GDTPoints, Standard_False).IsNull()) {
|
||||||
TDF_Label aPointsLabel = Label().FindChild(ChildLab_GDTPoints);
|
TDF_Label aPointsLabel = Label().FindChild(ChildLab_GDTPoints);
|
||||||
anObj->CreateGDTPoints(aPointsLabel.NbChildren());
|
|
||||||
for (Standard_Integer i = 1; i <= aPointsLabel.NbChildren(); i++) {
|
// Find out the number of stored GDT-points in Ocaf tree.
|
||||||
gp_Pnt aPoint;
|
Standard_Integer nbGDTPoints(0);
|
||||||
Handle(TDataXtd_Point) aGDTPointAttr;
|
Handle(TDataXtd_Point) aGDTPointAttr;
|
||||||
aPointsLabel.FindChild(i).FindAttribute(TDataXtd_Point::GetID(), aGDTPointAttr);
|
TDF_ChildIterator itrpnts(aPointsLabel, Standard_False);
|
||||||
TDataXtd_Geometry::Point(aGDTPointAttr->Label(), aPoint);
|
for (; itrpnts.More(); itrpnts.Next()) {
|
||||||
anObj->SetGDTPoint(i, aPoint);
|
if (itrpnts.Value().FindAttribute(TDataXtd_Point::GetID(), aGDTPointAttr))
|
||||||
|
nbGDTPoints++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Allocate the GDT-points and fill them in from Ocaf tree.
|
||||||
|
if (nbGDTPoints) {
|
||||||
|
anObj->CreateGDTPoints(nbGDTPoints);
|
||||||
|
const Standard_Integer nbChildren = aPointsLabel.NbChildren();
|
||||||
|
for (Standard_Integer i = 1, j = 1; i <= nbChildren; i++) {
|
||||||
|
gp_Pnt aPoint;
|
||||||
|
if (aPointsLabel.FindChild(i).FindAttribute(TDataXtd_Point::GetID(), aGDTPointAttr)) {
|
||||||
|
TDataXtd_Geometry::Point(aGDTPointAttr->Label(), aPoint);
|
||||||
|
anObj->SetGDTPoint(j++, aPoint);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Image
|
//Image
|
||||||
@@ -298,26 +312,50 @@ Handle(XCAFView_Object) XCAFDoc_View::GetObject() const
|
|||||||
// Shapes transparency
|
// Shapes transparency
|
||||||
if (!Label().FindChild(ChildLab_EnabledShapes, Standard_False).IsNull()) {
|
if (!Label().FindChild(ChildLab_EnabledShapes, Standard_False).IsNull()) {
|
||||||
TDF_Label aShapesTranspLabel = Label().FindChild(ChildLab_EnabledShapes);
|
TDF_Label aShapesTranspLabel = Label().FindChild(ChildLab_EnabledShapes);
|
||||||
anObj->CreateEnabledShapes(aShapesTranspLabel.NbChildren());
|
|
||||||
for (Standard_Integer i = 1; i <= aShapesTranspLabel.NbChildren(); i++) {
|
// Find out the number of stored shape-transparencies in Ocaf tree.
|
||||||
|
Standard_Integer nbShapeTransparencies(0);
|
||||||
|
Handle(TDataStd_Integer) aTranspAttr;
|
||||||
|
TDF_ChildIterator itrtrans(aShapesTranspLabel, Standard_False);
|
||||||
|
for (; itrtrans.More(); itrtrans.Next()) {
|
||||||
|
if (itrtrans.Value().FindAttribute(TDataStd_Integer::GetID(), aTranspAttr))
|
||||||
|
nbShapeTransparencies++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Allocate the shape-transparencies and fill them in from Ocaf tree.
|
||||||
|
const Standard_Integer nbChildren = aShapesTranspLabel.NbChildren();
|
||||||
|
anObj->CreateEnabledShapes(nbChildren);
|
||||||
|
for (Standard_Integer i = 1, j = 1; i <= nbChildren; i++) {
|
||||||
gp_Pnt aPoint;
|
gp_Pnt aPoint;
|
||||||
Handle(TDataStd_Integer) aTranspAttr;
|
if (aShapesTranspLabel.FindChild(i).FindAttribute(TDataStd_Integer::GetID(), aTranspAttr)) {
|
||||||
aShapesTranspLabel.FindChild(i).FindAttribute(TDataStd_Integer::GetID(), aTranspAttr);
|
Standard_Boolean aValue = (aTranspAttr->Get() == 1);
|
||||||
Standard_Boolean aValue = (aTranspAttr->Get() == 1);
|
anObj->SetEnabledShape(j++, aValue);
|
||||||
anObj->SetEnabledShape(i, aValue);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note Points
|
// Note Points
|
||||||
if (!Label().FindChild(ChildLab_NotePoints, Standard_False).IsNull()) {
|
if (!Label().FindChild(ChildLab_NotePoints, Standard_False).IsNull()) {
|
||||||
TDF_Label aPointsLabel = Label().FindChild(ChildLab_NotePoints);
|
TDF_Label aPointsLabel = Label().FindChild(ChildLab_NotePoints);
|
||||||
anObj->CreateNotePoints(aPointsLabel.NbChildren());
|
|
||||||
for (Standard_Integer i = 1; i <= aPointsLabel.NbChildren(); i++) {
|
// Find out the number of stored note-points in Ocaf tree.
|
||||||
|
Standard_Integer nbNotePoints(0);
|
||||||
|
Handle(TDataXtd_Point) aPointAttr;
|
||||||
|
TDF_ChildIterator itrpnts(aPointsLabel, Standard_False);
|
||||||
|
for (; itrpnts.More(); itrpnts.Next()) {
|
||||||
|
if (itrpnts.Value().FindAttribute(TDataXtd_Point::GetID(), aPointAttr))
|
||||||
|
nbNotePoints++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Allocate the note-points and fill them in from Ocaf tree.
|
||||||
|
const Standard_Integer nbChildren = aPointsLabel.NbChildren();
|
||||||
|
anObj->CreateNotePoints(nbChildren);
|
||||||
|
for (Standard_Integer i = 1, j = 1; i <= nbChildren; i++) {
|
||||||
gp_Pnt aPoint;
|
gp_Pnt aPoint;
|
||||||
Handle(TDataXtd_Point) aPointAttr;
|
if (aPointsLabel.FindChild(i).FindAttribute(TDataXtd_Point::GetID(), aPointAttr)) {
|
||||||
aPointsLabel.FindChild(i).FindAttribute(TDataXtd_Point::GetID(), aPointAttr);
|
TDataXtd_Geometry::Point(aPointAttr->Label(), aPoint);
|
||||||
TDataXtd_Geometry::Point(aPointAttr->Label(), aPoint);
|
anObj->SetNotePoint(j++, aPoint);
|
||||||
anObj->SetNotePoint(i, aPoint);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return anObj;
|
return anObj;
|
||||||
|
Reference in New Issue
Block a user