VPTissue Reference Manual
VectorGraphicsPreferences.h
Go to the documentation of this file.
1 #ifndef VIEWERS_VECTOR_GRAPHICS_PREFERENCES_H_
2 #define VIEWERS_VECTOR_GRAPHICS_PREFERENCES_H_
3 /*
4  * Copyright 2011-2016 Universiteit Antwerpen
5  *
6  * Licensed under the EUPL, Version 1.1 or as soon they will be approved by
7  * the European Commission - subsequent versions of the EUPL (the "Licence");
8  * You may not use this work except in compliance with the Licence.
9  * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl5
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the Licence is distributed on an "AS IS" basis,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the Licence for the specific language governing
15  * permissions and limitations under the Licence.
16  */
23 #include "util/misc/Exception.h"
24 
25 namespace SimPT_Shell
26 {
27 
32 {
33  enum Format {
34  Pdf, Eps
35  };
36 
37  Format m_format;
38 
40  {
41  m_format = Pdf;
42  }
43 
45  {
46  GraphicsPreferences::Update(e);
47 
48  const auto f = e.source->Get<std::string>("format", "");
49  if (!f.empty()) {
50  if (f == "pdf") {
51  m_format = Pdf;
52  } else if (f == "eps") {
53  m_format = Eps;
54  } else {
55  throw SimPT_Sim::Util::Exception("Unknown vector_graphics format: " + f);
56  }
57  }
58  }
59 };
60 
61 } // namespace
62 
63 #endif
Namespace for SimPT shell package.
Definition: Client.cpp:50
Extremely simple Exception root class.
Definition: Exception.h:28
Interface/Implementation for GraphicsPreferences.
Preferences for a graphic viewer.
Preferences for graphics viewer.
Header file for Exception class.