00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date: 2008-04-14 19:45:53 +0200 (Mo, 14 Apr 2008) $ 00006 Version: $Revision: 14081 $ 00007 00008 Copyright (c) German Cancer Research Center, Division of Medical and 00009 Biological Informatics. All rights reserved. 00010 See MITKCopyright.txt or https://www.mitk.org/copyright.html for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 00019 #include "mitkClippingProperty.h" 00020 00021 00022 namespace mitk 00023 { 00024 00025 ClippingProperty::ClippingProperty() 00026 : m_ClippingEnabled( false ) 00027 { 00028 } 00029 00030 00031 ClippingProperty::ClippingProperty( 00032 const Point3D &origin, const Vector3D &normal ) 00033 : m_ClippingEnabled( true ), 00034 m_Origin( origin ), 00035 m_Normal( normal ) 00036 { 00037 } 00038 00039 00040 bool ClippingProperty::GetClippingEnabled() const 00041 { 00042 return m_ClippingEnabled; 00043 } 00044 00045 00046 void ClippingProperty::SetClippingEnabled( bool enabled ) 00047 { 00048 m_ClippingEnabled = enabled; 00049 } 00050 00051 00052 const Point3D &ClippingProperty::GetOrigin() const 00053 { 00054 return m_Origin; 00055 } 00056 00057 00058 void ClippingProperty::SetOrigin( const Point3D &origin ) 00059 { 00060 m_Origin = origin; 00061 } 00062 00063 00064 const Vector3D &ClippingProperty::GetNormal() const 00065 { 00066 return m_Normal; 00067 } 00068 00069 00070 void ClippingProperty::SetNormal( const Vector3D &normal ) 00071 { 00072 m_Normal = normal; 00073 } 00074 00075 00076 bool ClippingProperty::operator==( const BaseProperty &property ) const 00077 { 00078 const Self *other = dynamic_cast< const Self * >( &property ); 00079 00080 if ( other == NULL ) return false; 00081 00082 return ( (other->m_Origin == m_Origin ) 00083 && (other->m_Normal == m_Normal ) ); 00084 } 00085 00086 00087 std::string ClippingProperty::GetValueAsString() const 00088 { 00089 std::stringstream myStr; 00090 00091 myStr << this->GetOrigin() << this->GetNormal(); 00092 return myStr.str(); 00093 } 00094 } // namespace 00095