{
}
-
//=======================================================================
//function : SetGraphID
//purpose :
myGraphID = explicitID;
}
-
-
//=======================================================================
//function : SetFather
//purpose :
{
Standard_Integer Findex = FatherIndex(F);
if (Findex != 0)
- F->UnSetChildlink(this);
- UnSetFatherlink(F);
+ {
+ F->UnSetChildlink(this);
+ UnSetFatherlink(F);
+ }
}
void XCAFDoc_GraphNode::UnSetFather(const Standard_Integer Findex)
{
if (Findex != 0)
- UnSetFather( GetFather(Findex) );
+ {
+ UnSetFather( GetFather(Findex) );
+ }
}
-
//=======================================================================
//function : UnSetFatherlink
//purpose : Remove link finily
void XCAFDoc_GraphNode::UnSetFatherlink(const Handle(XCAFDoc_GraphNode)& F)
{
Backup();
- myFathers.Remove( FatherIndex(F) );
+ Standard_Integer Findex = FatherIndex(F);
+ if (Findex != 0)
+ {
+ myFathers.Remove(Findex);
+ }
}
//=======================================================================
void XCAFDoc_GraphNode::UnSetChild(const Handle(XCAFDoc_GraphNode)& Ch)
{
Standard_Integer Chindex = ChildIndex(Ch);
- if (Chindex != 0)
- Ch->UnSetFatherlink(this);
- UnSetChildlink(Ch);
+ if (Chindex != 0)
+ {
+ Ch->UnSetFatherlink(this);
+ UnSetChildlink(Ch);
+ }
}
-
//=======================================================================
//function : UnSetChild
//purpose :
void XCAFDoc_GraphNode::UnSetChild(const Standard_Integer Chindex)
{
- if (Chindex != 0 )
- UnSetChild( GetChild(Chindex) );
+ if (Chindex != 0)
+ {
+ UnSetChild( GetChild(Chindex) );
+ }
}
-
//=======================================================================
//function : UnSetChildlink
//purpose : Remove link finily
void XCAFDoc_GraphNode::UnSetChildlink(const Handle(XCAFDoc_GraphNode)& Ch)
{
Backup();
- myChildren.Remove( ChildIndex(Ch) );
+ Standard_Integer Chindex = ChildIndex(Ch);
+ if (Chindex != 0)
+ {
+ myChildren.Remove(Chindex);
+ }
}
//=======================================================================
if (!RT->HasRelocation(myFathers(i), func) && RT->AfterRelocate()) {
func.Nullify();
}
- intof->SetFather(func);
+ if (!func.IsNull()) {
+ intof->SetFather(func);
+ }
}
i = 1;
if (!RT->HasRelocation(myChildren(i), func) && RT->AfterRelocate()) {
func.Nullify();
}
- intof->SetFather(func);
+ if (!func.IsNull()) {
+ intof->SetChild(func);
+ }
}
intof->SetGraphID(myGraphID);
}