Medical Imaging Interaction Toolkit  2018.4.99-064ad45c
Medical Imaging Interaction Toolkit
mitkRegVisStyleProperty.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( "Grid", static_cast<IdType>( 0 ) );
53  AddEnum( "Glyph", static_cast<IdType>( 1 ) );
54  AddEnum( "Points", static_cast<IdType>( 2 ) );
55 }
56 
57 
58 bool mitk::RegVisStyleProperty::AddEnum( const std::string& name, const IdType& id )
59 {
60  return Superclass::AddEnum( name, id );
61 }
virtual bool SetValue(const std::string &name)
bool AddEnum(const std::string &name, const IdType &id) override
virtual bool IsValidEnumerationValue(const IdType &id) const