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 "mitkGridVolumeMapperProperty.h" 00021 00022 mitk::GridVolumeMapperProperty::GridVolumeMapperProperty( ) 00023 { 00024 AddRepresentationTypes(); 00025 #if (VTK_MAJOR_VERSION >= 5) 00026 SetValue( PT ); 00027 #else 00028 SetValue( RAYCAST ); 00029 #endif 00030 } 00031 00032 00033 mitk::GridVolumeMapperProperty::GridVolumeMapperProperty( const IdType& value ) 00034 { 00035 AddRepresentationTypes(); 00036 if ( IsValidEnumerationValue( value ) ) 00037 { 00038 SetValue( value ); 00039 } 00040 else 00041 { 00042 #if (VTK_MAJOR_VERSION >= 5) 00043 SetValue( PT ); 00044 #else 00045 SetValue( RAYCAST ); 00046 #endif 00047 } 00048 } 00049 00050 00051 mitk::GridVolumeMapperProperty::GridVolumeMapperProperty( const std::string& value ) 00052 { 00053 AddRepresentationTypes(); 00054 if ( IsValidEnumerationValue( value ) ) 00055 { 00056 SetValue( value ); 00057 } 00058 else 00059 { 00060 #if (VTK_MAJOR_VERSION >= 5) 00061 SetValue( PT ); 00062 #else 00063 SetValue( RAYCAST ); 00064 #endif 00065 } 00066 } 00067 00068 #if (VTK_MAJOR_VERSION >= 5) 00069 void mitk::GridVolumeMapperProperty::SetVolumeMapperToPT() 00070 { 00071 SetValue( PT ); 00072 } 00073 #endif 00074 00075 #if (VTK_MAJOR_VERSION >= 5) 00076 void mitk::GridVolumeMapperProperty::SetVolumeMapperToZSweep() 00077 { 00078 SetValue( ZSWEEP ); 00079 } 00080 #endif 00081 00082 00083 void mitk::GridVolumeMapperProperty::SetVolumeMapperToRayCast() 00084 { 00085 SetValue( RAYCAST ); 00086 } 00087 00088 00089 void mitk::GridVolumeMapperProperty::AddRepresentationTypes() 00090 { 00091 AddEnum( "Ray Cast", RAYCAST ); 00092 00093 #if (VTK_MAJOR_VERSION >= 5) 00094 AddEnum( "Projected Tetrahedra", PT ); 00095 AddEnum( "ZSweep", ZSWEEP ); 00096 #endif 00097 00098 } 00099 00100 00101 bool mitk::GridVolumeMapperProperty::AddEnum( const std::string& name, const IdType& id ) 00102 { 00103 return Superclass::AddEnum( name, id ); 00104 }