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 #include <vtkProperty.h> 00019 #include "mitkVtkVolumeRenderingProperty.h" 00020 00021 00022 00023 mitk::VtkVolumeRenderingProperty::VtkVolumeRenderingProperty( ) 00024 { 00025 this->AddRenderingTypes(); 00026 this->SetValue( static_cast<IdType>( VTK_RAY_CAST_COMPOSITE_FUNCTION ) ); 00027 } 00028 00029 00030 mitk::VtkVolumeRenderingProperty::VtkVolumeRenderingProperty( const IdType& value ) 00031 { 00032 this->AddRenderingTypes(); 00033 if ( IsValidEnumerationValue( value ) ) 00034 { 00035 this->SetValue( value ) ; 00036 } 00037 else 00038 MITK_INFO << "Warning: invalid rendering configuration" << std::endl; 00039 } 00040 00041 mitk::VtkVolumeRenderingProperty::VtkVolumeRenderingProperty( const std::string& value ) 00042 { 00043 this->AddRenderingTypes(); 00044 if ( IsValidEnumerationValue( value ) ) 00045 { 00046 this->SetValue( value ); 00047 } 00048 else 00049 MITK_INFO << "Warning: invalid rendering configuration" << std::endl; 00050 } 00051 00052 00053 int mitk::VtkVolumeRenderingProperty::GetRenderingType() 00054 { 00055 return static_cast<int>( this->GetValueAsId() ); 00056 } 00057 00058 00059 void mitk::VtkVolumeRenderingProperty::SetRenderingTypeToMIP() 00060 { 00061 this->SetValue( static_cast<IdType>( VTK_VOLUME_RAY_CAST_MIP_FUNCTION ) ); 00062 } 00063 00064 void mitk::VtkVolumeRenderingProperty::SetRenderingTypeToComposite() 00065 { 00066 this->SetValue( static_cast<IdType>( VTK_RAY_CAST_COMPOSITE_FUNCTION ) ); 00067 } 00068 00069 void mitk::VtkVolumeRenderingProperty::AddRenderingTypes() 00070 { 00071 AddEnum( "MIP", static_cast<IdType>( VTK_VOLUME_RAY_CAST_MIP_FUNCTION ) ); 00072 AddEnum( "COMPOSITE", static_cast<IdType> (VTK_RAY_CAST_COMPOSITE_FUNCTION)); 00073 } 00074 00075 00076 bool mitk::VtkVolumeRenderingProperty::AddEnum( const std::string& name, const IdType& id ) 00077 { 00078 return Superclass::AddEnum( name, id ); 00079 }