Commit f244ac11 authored by Aron Helser's avatar Aron Helser

Avatar: custom bounding box, updated test baseline

Using multiple sub-actors requires a custom bounding box calc.
parent 907905bf
0520ffd35cd5bc4158c9da8fbc5d97b46fb85108ea9332948cbd7080cabcdd47eef3ac067a8aafa8a855f369cc88fde503bdf72940cd85b50353f9069b7a511c
9a068402a5402abe84157669b59171cfb9de947121ef3db76b2e6ed6d9c6de073fc0152d5a30356ccf174aed5b510b868817cd623e440e55223f90ab3c93c600
......@@ -14,6 +14,7 @@
=========================================================================*/
#include "vtkOpenGLAvatar.h"
#include "vtkBoundingBox.h"
#include "vtkCamera.h"
#include "vtkCommand.h"
#include "vtkObjectFactory.h"
......@@ -234,6 +235,23 @@ void vtkOpenGLAvatar::CalcBody()
}
// Multiple sub-actors require a custom bounding box calc.
double *vtkOpenGLAvatar::GetBounds()
{
vtkDebugMacro( << "Getting Bounds" );
vtkBoundingBox bbox;
bbox.AddBounds(this->HeadActor->GetBounds());
bbox.AddBounds(this->RightHandActor->GetBounds());
bbox.AddBounds(this->LeftHandActor->GetBounds());
for (int i = 0; i < NUM_BODY; ++i) {
bbox.AddBounds(this->BodyActor[i]->GetBounds());
}
bbox.GetBounds(this->Bounds);
return this->Bounds;
}
//----------------------------------------------------------------------------
void vtkOpenGLAvatar::PrintSelf(ostream& os, vtkIndent indent)
{
......
......@@ -43,6 +43,8 @@ public:
*/
void Render(vtkRenderer *ren, vtkMapper *mapper) override;
double *GetBounds() VTK_SIZEHINT(6) override;
protected:
vtkOpenGLAvatar();
~vtkOpenGLAvatar() override;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment