Add Write methods to scene objects

Write methods are polymorphic, overridden by subclasses. There is a single operator<< for Objects that calls the right Write() method for the object. Neat.
This commit is contained in:
Eryn Wells 2014-08-03 17:25:00 -07:00
parent b56bbf4ced
commit 4828cb313f
8 changed files with 64 additions and 1 deletions

View file

@ -161,4 +161,12 @@ Sphere::compute_normal(const Vector3 &p)
return normal;
}
void
Sphere::Write(std::ostream& ost)
const
{
ost << "[Sphere origin=" << GetOrigin() << " r=" << radius << "]";
}
} /* namespace charles */