VPTissue Reference Manual
BitmapFormat.h
Go to the documentation of this file.
1 #ifndef SIMPT_SHELL_BITMAP_CONVERTER_FORMAT_H_INCLUDED
2 #define SIMPT_SHELL_BITMAP_CONVERTER_FORMAT_H_INCLUDED
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  */
22 #include "IConverterFormat.h"
23 #include "TimeStepPostfixFormat.h"
24 
26 
27 namespace SimPT_Sim { class SimState; }
28 
29 namespace SimPT_Shell {
30 
35 {
36 public:
37  using FileFormat = BitmapGraphicsPreferences::Format;
38 
39  BitmapFormat(FileFormat f) : m_format(f) {}
40 
41  virtual bool AppendTimeStepSuffix() const { return true; };
42 
43  virtual bool IsPostProcessFormat() const { return true; }
44 
45  virtual std::string GetExtension() const
46  {
47  switch (m_format) {
48  case FileFormat::Png:
49  return "png";
50  case FileFormat::Bmp:
51  return "bmp";
52  case FileFormat::Jpeg:
53  return "jpg";
54  }
55  return std::string();
56  }
57 
58  virtual std::string GetName() const
59  {
60  switch (m_format) {
61  case FileFormat::Png:
62  return "PNG";
63  case FileFormat::Bmp:
64  return "BMP";
65  case FileFormat::Jpeg:
66  return "JPEG";
67  }
68  return std::string();
69  }
70 
71  virtual void Convert(const SimPT_Sim::SimState& src);
72 
73 private:
74  FileFormat m_format;
75 };
76 
77 } // namespace
78 
79 #endif // end_of_include_guard
Interface of TimeStepPostfixFormat.
Namespace for SimPT shell package.
Definition: Client.cpp:50
Namespace for the core simulator.
Bitmap graphics converter format specifications.
Definition: BitmapFormat.h:34
Interface for IConverterFormat.
Contains the state of the whole Simulator at a given simulation step.
Definition: SimState.h:33
Interface for BitmapGraphicsExporter.
Manages time labels int file names.