00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date$ 00006 Version: $Revision: $ 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 <vtkProperty.h> 00020 #include "mitkGridRepresentationProperty.h" 00021 00022 00023 mitk::GridRepresentationProperty::GridRepresentationProperty( ) 00024 { 00025 AddRepresentationTypes(); 00026 SetValue( WIREFRAME ); 00027 } 00028 00029 00030 mitk::GridRepresentationProperty::GridRepresentationProperty( const IdType& value ) 00031 { 00032 AddRepresentationTypes(); 00033 if ( IsValidEnumerationValue( value ) ) 00034 { 00035 SetValue( value ); 00036 } 00037 else 00038 { 00039 SetValue( WIREFRAME ); 00040 } 00041 } 00042 00043 00044 mitk::GridRepresentationProperty::GridRepresentationProperty( const std::string& value ) 00045 { 00046 AddRepresentationTypes(); 00047 if ( IsValidEnumerationValue( value ) ) 00048 { 00049 SetValue( value ); 00050 } 00051 else 00052 { 00053 SetValue( WIREFRAME ); 00054 } 00055 } 00056 00057 00058 void mitk::GridRepresentationProperty::SetRepresentationToPoints() 00059 { 00060 SetValue( POINTS ); 00061 } 00062 00063 00064 void mitk::GridRepresentationProperty::SetRepresentationToWireframe() 00065 { 00066 SetValue( WIREFRAME ); 00067 } 00068 00069 00070 void mitk::GridRepresentationProperty::SetRepresentationToSurface() 00071 { 00072 SetValue( SURFACE ); 00073 } 00074 00075 void mitk::GridRepresentationProperty::SetRepresentationToVolume() 00076 { 00077 SetValue( VOLUME ); 00078 } 00079 00080 void mitk::GridRepresentationProperty::AddRepresentationTypes() 00081 { 00082 AddEnum( "Points", POINTS ); 00083 AddEnum( "Wireframe", WIREFRAME ); 00084 AddEnum( "Surface", SURFACE ); 00085 AddEnum( "Volume", VOLUME ); 00086 } 00087 00088 00089 bool mitk::GridRepresentationProperty::AddEnum( const std::string& name, const IdType& id ) 00090 { 00091 return Superclass::AddEnum( name, id ); 00092 }