2016-09-08 23:08:17 +00:00
|
|
|
//============================================================================
|
|
|
|
// Copyright (c) Kitware, Inc.
|
|
|
|
// All rights reserved.
|
|
|
|
// See LICENSE.txt for details.
|
2019-04-15 23:24:21 +00:00
|
|
|
//
|
2016-09-08 23:08:17 +00:00
|
|
|
// This software is distributed WITHOUT ANY WARRANTY; without even
|
|
|
|
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
// PURPOSE. See the above copyright notice for more information.
|
|
|
|
//============================================================================
|
|
|
|
|
|
|
|
#include <vtkm/rendering/BoundingBoxAnnotation.h>
|
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
namespace vtkm
|
|
|
|
{
|
|
|
|
namespace rendering
|
|
|
|
{
|
2016-09-08 23:08:17 +00:00
|
|
|
|
|
|
|
BoundingBoxAnnotation::BoundingBoxAnnotation()
|
2017-05-18 14:29:41 +00:00
|
|
|
: Color(0.5, 0.5, 0.5)
|
|
|
|
, Extents(-1, 1, -1, 1, -1, 1)
|
2016-09-08 23:08:17 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2020-08-17 14:18:24 +00:00
|
|
|
BoundingBoxAnnotation::~BoundingBoxAnnotation() {}
|
2016-09-08 23:08:17 +00:00
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
void BoundingBoxAnnotation::Render(const vtkm::rendering::Camera&, const WorldAnnotator& annotator)
|
2016-09-08 23:08:17 +00:00
|
|
|
{
|
|
|
|
//win->SetupForWorldSpace();
|
|
|
|
|
|
|
|
vtkm::Float32 linewidth = 1.0;
|
|
|
|
|
2017-05-26 17:53:28 +00:00
|
|
|
annotator.AddLine(this->Extents.X.Min,
|
|
|
|
this->Extents.Y.Min,
|
|
|
|
this->Extents.Z.Min,
|
|
|
|
this->Extents.X.Min,
|
|
|
|
this->Extents.Y.Min,
|
|
|
|
this->Extents.Z.Max,
|
|
|
|
linewidth,
|
2017-05-18 14:29:41 +00:00
|
|
|
this->Color);
|
2017-05-26 17:53:28 +00:00
|
|
|
annotator.AddLine(this->Extents.X.Min,
|
|
|
|
this->Extents.Y.Max,
|
|
|
|
this->Extents.Z.Min,
|
|
|
|
this->Extents.X.Min,
|
|
|
|
this->Extents.Y.Max,
|
|
|
|
this->Extents.Z.Max,
|
|
|
|
linewidth,
|
2017-05-18 14:29:41 +00:00
|
|
|
this->Color);
|
2017-05-26 17:53:28 +00:00
|
|
|
annotator.AddLine(this->Extents.X.Max,
|
|
|
|
this->Extents.Y.Min,
|
|
|
|
this->Extents.Z.Min,
|
|
|
|
this->Extents.X.Max,
|
|
|
|
this->Extents.Y.Min,
|
|
|
|
this->Extents.Z.Max,
|
|
|
|
linewidth,
|
2017-05-18 14:29:41 +00:00
|
|
|
this->Color);
|
2017-05-26 17:53:28 +00:00
|
|
|
annotator.AddLine(this->Extents.X.Max,
|
|
|
|
this->Extents.Y.Max,
|
|
|
|
this->Extents.Z.Min,
|
|
|
|
this->Extents.X.Max,
|
|
|
|
this->Extents.Y.Max,
|
|
|
|
this->Extents.Z.Max,
|
|
|
|
linewidth,
|
2017-05-18 14:29:41 +00:00
|
|
|
this->Color);
|
2016-09-08 23:08:17 +00:00
|
|
|
|
2017-05-26 17:53:28 +00:00
|
|
|
annotator.AddLine(this->Extents.X.Min,
|
|
|
|
this->Extents.Y.Min,
|
|
|
|
this->Extents.Z.Min,
|
|
|
|
this->Extents.X.Min,
|
|
|
|
this->Extents.Y.Max,
|
|
|
|
this->Extents.Z.Min,
|
|
|
|
linewidth,
|
2017-05-18 14:29:41 +00:00
|
|
|
this->Color);
|
2017-05-26 17:53:28 +00:00
|
|
|
annotator.AddLine(this->Extents.X.Min,
|
|
|
|
this->Extents.Y.Min,
|
|
|
|
this->Extents.Z.Max,
|
|
|
|
this->Extents.X.Min,
|
|
|
|
this->Extents.Y.Max,
|
|
|
|
this->Extents.Z.Max,
|
|
|
|
linewidth,
|
2017-05-18 14:29:41 +00:00
|
|
|
this->Color);
|
2017-05-26 17:53:28 +00:00
|
|
|
annotator.AddLine(this->Extents.X.Max,
|
|
|
|
this->Extents.Y.Min,
|
|
|
|
this->Extents.Z.Min,
|
|
|
|
this->Extents.X.Max,
|
|
|
|
this->Extents.Y.Max,
|
|
|
|
this->Extents.Z.Min,
|
|
|
|
linewidth,
|
2017-05-18 14:29:41 +00:00
|
|
|
this->Color);
|
2017-05-26 17:53:28 +00:00
|
|
|
annotator.AddLine(this->Extents.X.Max,
|
|
|
|
this->Extents.Y.Min,
|
|
|
|
this->Extents.Z.Max,
|
|
|
|
this->Extents.X.Max,
|
|
|
|
this->Extents.Y.Max,
|
|
|
|
this->Extents.Z.Max,
|
|
|
|
linewidth,
|
2017-05-18 14:29:41 +00:00
|
|
|
this->Color);
|
2016-09-08 23:08:17 +00:00
|
|
|
|
2017-05-26 17:53:28 +00:00
|
|
|
annotator.AddLine(this->Extents.X.Min,
|
|
|
|
this->Extents.Y.Min,
|
|
|
|
this->Extents.Z.Min,
|
|
|
|
this->Extents.X.Max,
|
|
|
|
this->Extents.Y.Min,
|
|
|
|
this->Extents.Z.Min,
|
|
|
|
linewidth,
|
2017-05-18 14:29:41 +00:00
|
|
|
this->Color);
|
2017-05-26 17:53:28 +00:00
|
|
|
annotator.AddLine(this->Extents.X.Min,
|
|
|
|
this->Extents.Y.Min,
|
|
|
|
this->Extents.Z.Max,
|
|
|
|
this->Extents.X.Max,
|
|
|
|
this->Extents.Y.Min,
|
|
|
|
this->Extents.Z.Max,
|
|
|
|
linewidth,
|
2017-05-18 14:29:41 +00:00
|
|
|
this->Color);
|
2017-05-26 17:53:28 +00:00
|
|
|
annotator.AddLine(this->Extents.X.Min,
|
|
|
|
this->Extents.Y.Max,
|
|
|
|
this->Extents.Z.Min,
|
|
|
|
this->Extents.X.Max,
|
|
|
|
this->Extents.Y.Max,
|
|
|
|
this->Extents.Z.Min,
|
|
|
|
linewidth,
|
2017-05-18 14:29:41 +00:00
|
|
|
this->Color);
|
2017-05-26 17:53:28 +00:00
|
|
|
annotator.AddLine(this->Extents.X.Min,
|
|
|
|
this->Extents.Y.Max,
|
|
|
|
this->Extents.Z.Max,
|
|
|
|
this->Extents.X.Max,
|
|
|
|
this->Extents.Y.Max,
|
|
|
|
this->Extents.Z.Max,
|
|
|
|
linewidth,
|
2017-05-18 14:29:41 +00:00
|
|
|
this->Color);
|
2016-09-08 23:08:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} // namespace vtkm::rendering
|