int
main(int, char *[])
{
using TransformType = SpatialObjectType::TransformType;
SpatialObjectType::Pointer object1 = SpatialObjectType::New();
object1->GetProperty().SetName("First Object");
SpatialObjectType::Pointer object2 = SpatialObjectType::New();
object2->GetProperty().SetName("Second Object");
object1->AddChild(object2);
double scale[2];
scale[0] = 2;
scale[1] = 2;
object2->GetModifiableObjectToParentTransform()->Scale(scale);
TransformType::OffsetType object1Offset;
object1Offset[0] = 4;
object1Offset[1] = 3;
object1->GetModifiableObjectToParentTransform()->SetOffset(object1Offset);
object1->Update();
std::cout << "object2 ObjectToParent Matrix: " << std::endl;
std::cout << object2->GetObjectToParentTransform()->GetMatrix()
<< std::endl;
std::cout << "object2 ObjectToParent Offset: ";
std::cout << object2->GetObjectToParentTransform()->GetOffset()
<< std::endl;
std::cout << "object2 ObjectToWorld Matrix: " << std::endl;
std::cout << object2->GetObjectToWorldTransform()->GetMatrix() << std::endl;
std::cout << "object2 ObjectToWorld Offset: ";
std::cout << object2->GetObjectToWorldTransform()->GetOffset() << std::endl;
TransformType::OffsetType Object1ToWorldOffset;
Object1ToWorldOffset[0] = 3;
Object1ToWorldOffset[1] = 3;
object1->GetModifiableObjectToWorldTransform()->SetOffset(
Object1ToWorldOffset);
object1->ComputeObjectToParentTransform();
std::cout << "object1 ObjectToParent Matrix: " << std::endl;
std::cout << object1->GetObjectToParentTransform()->GetMatrix()
<< std::endl;
std::cout << "object1 ObjectToParent Offset: ";
std::cout << object1->GetObjectToParentTransform()->GetOffset()
<< std::endl;
std::cout << "object2 ObjectToWorld Matrix: " << std::endl;
std::cout << object2->GetObjectToWorldTransform()->GetMatrix() << std::endl;
std::cout << "object2 ObjectToWorld Offset: ";
std::cout << object2->GetObjectToWorldTransform()->GetOffset() << std::endl;
object1->RemoveChild(object2);
object2->Update();
std::cout << "object2 ObjectToWorld Matrix: " << std::endl;
std::cout << object2->GetObjectToWorldTransform()->GetMatrix() << std::endl;
std::cout << "object2 ObjectToWorld Offset: ";
std::cout << object2->GetObjectToWorldTransform()->GetOffset() << std::endl;
std::cout << "object2 ObjectToParent Matrix: " << std::endl;
std::cout << object2->GetObjectToParentTransform()->GetMatrix()
<< std::endl;
std::cout << "object2 ObjectToParent Offset: ";
std::cout << object2->GetObjectToParentTransform()->GetOffset()
<< std::endl;
return EXIT_FAILURE;
}