Add option to enable/disable world annotations.

This commit is contained in:
dpugmire 2020-07-09 14:38:39 -04:00
parent e2027da0c3
commit cabaf3e269
3 changed files with 11 additions and 2 deletions

@ -83,6 +83,12 @@ public:
VTKM_CONT
void SetForegroundColor(const vtkm::rendering::Color& color);
VTKM_CONT
bool GetWorldAnnotationsEnabled() const { return this->WorldAnnotationsEnabled; }
VTKM_CONT
void SetWorldAnnotationsEnabled(bool val) { this->WorldAnnotationsEnabled = val; }
VTKM_DEPRECATED(1.6, "Initialize() does nothing.")
virtual void Initialize();
@ -109,6 +115,7 @@ protected:
void RenderAnnotations();
vtkm::rendering::Color AxisColor = vtkm::rendering::Color::white;
bool WorldAnnotationsEnabled = true;
private:
std::shared_ptr<InternalData> Internal;

@ -44,7 +44,8 @@ void View2D::Paint()
this->UpdateCameraProperties();
this->SetupForWorldSpace();
this->GetScene().Render(this->GetMapper(), this->GetCanvas(), this->GetCamera());
this->RenderWorldAnnotations();
if (this->WorldAnnotationsEnabled)
this->RenderWorldAnnotations();
this->SetupForScreenSpace();
this->RenderScreenAnnotations();
this->RenderAnnotations();

@ -43,7 +43,8 @@ void View3D::Paint()
this->GetCanvas().Clear();
this->SetupForWorldSpace();
this->RenderWorldAnnotations();
if (this->WorldAnnotationsEnabled)
this->RenderWorldAnnotations();
this->GetScene().Render(this->GetMapper(), this->GetCanvas(), this->GetCamera());
this->SetupForScreenSpace();