int
main(int, char *[])
{
object1->GetProperty().SetName("First Object");
object2->GetProperty().SetName("Second Object");
object1->AddChild(object2);
object1->Update();
if (object2->HasParent())
{
std::cout << "Name of the parent of the object2: ";
std::cout << object2->GetParent()->GetProperty().GetName() << std::endl;
}
SpatialObjectType::ChildrenListType * childrenList = object1->GetChildren();
std::cout << "object1 has " << childrenList->size() << " child"
<< std::endl;
SpatialObjectType::ChildrenListType::const_iterator it =
childrenList->begin();
while (it != childrenList->end())
{
std::cout << "Name of the child of the object 1: ";
std::cout << (*it)->GetProperty().GetName() << std::endl;
++it;
}
delete childrenList;
object1->RemoveChild(object2);
object2->Update();
std::cout << "Number of children for object1: ";
std::cout << object1->GetNumberOfChildren() << std::endl;
object1->Clear();
object1->RemoveAllChildren();
return EXIT_SUCCESS;
}