OpenFPM_io
0.2.0
Project that contain the implementation and interfaces for basic structure like vectors, grids, graph ... .
All
Data Structures
Functions
Variables
Typedefs
VTKWriter.hpp
1
/*
2
* VTKWriter.hpp
3
*
4
* Created on: Dec 15, 2014
5
* Author: Pietro Incardona
6
*/
7
8
#ifndef VTKWRITER_HPP_
9
#define VTKWRITER_HPP_
10
11
#include "Graph/map_graph.hpp"
12
#include <iostream>
13
#include <boost/fusion/include/mpl.hpp>
14
#include <boost/fusion/include/for_each.hpp>
15
#include <fstream>
16
#include "util/common.hpp"
17
24
template
<
typename
T> std::string getType()
25
{
26
// Create a property string based on the type of the property
27
if
(
typeid
(T) ==
typeid
(
float
))
28
return
"float"
;
29
else
if
(
typeid
(T) ==
typeid
(
double
))
30
return
"double"
;
31
else
if
(
typeid
(T) ==
typeid
(
char
))
32
return
"char"
;
33
else
if
(
typeid
(T) ==
typeid
(
unsigned
char
))
34
return
"unsigned_char"
;
35
else
if
(
typeid
(T) ==
typeid
(
short
))
36
return
"short"
;
37
else
if
(
typeid
(T) ==
typeid
(
unsigned
short
))
38
return
"unsigned_short"
;
39
else
if
(
typeid
(T) ==
typeid
(
int
))
40
return
"int"
;
41
else
if
(
typeid
(T) ==
typeid
(
unsigned
int
))
42
return
"unsigned_int"
;
43
else
if
(
typeid
(T) ==
typeid
(
long
int
))
44
return
"long"
;
45
else
if
(
typeid
(T) ==
typeid
(
unsigned
long
int
))
46
return
"unsigned_long"
;
47
else
if
(
typeid
(T) ==
typeid
(
bool
))
48
return
"bit"
;
49
50
return
""
;
51
}
52
62
template
<
typename
A>
63
class
convert
64
{
65
public
:
66
template
<
typename
B>
static
B to(
const
A & data)
67
{
68
return
static_cast<
B
>
(data);
69
}
70
};
71
77
template
<>
78
class
convert
<std::string>
79
{
80
public
:
81
template
<
typename
B>
static
B to(
const
std::string & data)
82
{
83
return
atof(data.c_str());
84
}
85
};
86
91
enum
file_type
92
{
93
BINARY,
94
ASCII
95
};
96
97
#define VTK_GRAPH 1
98
#define VECTOR_BOX 2
99
#define VECTOR_GRIDS 3
100
#define VECTOR_ST_GRIDS 4
101
#define DIST_GRAPH 5
102
#define VECTOR_POINTS 6
103
#define VTK_WRITER 0x10000
104
105
template
<
typename
Object,
unsigned
int
imp>
106
class
VTKWriter
107
{
108
109
};
110
111
#include "VTKWriter_graph.hpp"
112
#include "VTKWriter_vector_box.hpp"
113
#include "VTKWriter_grids.hpp"
114
#include "VTKWriter_grids_st.hpp"
115
#include "VTKWriter_dist_graph.hpp"
116
#include "VTKWriter_point_set.hpp"
117
118
#endif
/* VTKWRITER_HPP_ */
convert
Set a conversion map between A and B.
Definition:
VTKWriter.hpp:63
VTKWriter
Definition:
VTKWriter.hpp:106
src
VTKWriter
VTKWriter.hpp
Generated by
1.8.6