Medical Imaging Interaction Toolkit  2018.4.99-07c45cb1
Medical Imaging Interaction Toolkit
mitkRegVisColorStyleProperty.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 
13 
15 
16 
18 {
19  AddTypes();
20  SetValue( 0 );
21 }
22 
23 
25 {
26  AddTypes();
27  if ( IsValidEnumerationValue( value ) )
28  {
29  SetValue( value ) ;
30  }
31  else
32  {
33  SetValue( 0 );
34  }
35 }
36 
38 {
39  AddTypes();
40  if ( IsValidEnumerationValue( value ) )
41  {
42  SetValue( value );
43  }
44  else
45  {
46  SetValue( 0 );
47  }
48 }
49 
51 {
52  AddEnum( "UniColor", static_cast<IdType>( 0 ) );
53  AddEnum( "VectorMagnitude", static_cast<IdType>( 1 ) );
54 }
55 
56 
57 bool mitk::RegVisColorStyleProperty::AddEnum( const std::string& name, const IdType& id )
58 {
59  return Superclass::AddEnum( name, id );
60 }
virtual bool SetValue(const std::string &name)
bool AddEnum(const std::string &name, const IdType &id) override
virtual bool IsValidEnumerationValue(const IdType &id) const