Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitkCircularProfileTubeElement.cpp
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
14 
16 {
17 }
18 
19 mitk::CircularProfileTubeElement::CircularProfileTubeElement(float x, float y, float z, float d) : m_diameter(d)
20 {
21  mitk::FillVector3D(m_coordinates, x, y, z);
22 }
23 
25  : m_coordinates(c), m_diameter(d)
26 {
27 }
28 
30 {
31 }
32 
34 {
35  return m_coordinates;
36 }
37 
39 {
40  m_coordinates = coordinates;
41 }
42 
44 {
45  return m_diameter;
46 }
47 
49 {
50  m_diameter = d;
51 }
52 
54 {
55  // Check if given TubeElement is CircularProfileTubeElement
56  if (dynamic_cast<const mitk::CircularProfileTubeElement *>(&right))
57  {
58  const auto *element = dynamic_cast<const mitk::CircularProfileTubeElement *>(&right);
59  return ((m_diameter == element->m_diameter) && (m_coordinates == element->m_coordinates));
60  }
61  else
62  return false;
63 }
void SetCoordinates(Point3D coordinates) override
Abstract class for elements which describes tubular structur.
void FillVector3D(Tout &out, mitk::ScalarType x, mitk::ScalarType y, mitk::ScalarType z)
Definition: mitkArray.h:106
const Point3D & GetCoordinates() const override
bool operator==(const TubeElement &right) const override
Class for elements which describes tubular structur with a circular cross section.