gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
PViewX3D.h
Go to the documentation of this file.
1 // Gmsh - Copyright (C) 1997-2022 C. Geuzaine, J.-F. Remacle
2 //
3 // See the LICENSE.txt file in the Gmsh root directory for license information.
4 // Please report all issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
5 //
6 // PViewX3D is a extension for Post-processing outputs :
7 // creates a file in X3D format with the same features as
8 // what is visible in post-processing screen.
9 // contact : gilles.marckmann@ec-nantes.fr
10 
11 #ifndef PVIEWX3D_H
12 #define PVIEWX3D_H
13 
14 static inline void UnsignedChar2rgba(unsigned char *glc, double *rgba)
15 {
16  rgba[0] = glc[0] / 255.;
17  rgba[1] = glc[1] / 255.;
18  rgba[2] = glc[2] / 255.;
19  rgba[3] = glc[3] / 255.;
20 }
21 
22 static inline void unsignedInt2RGBA(unsigned int &color, double &r, double &g,
23  double &b, double &a)
24 {
25  r = color & 255;
26  g = (color >> 8) & 255;
27  b = (color >> 16) & 255;
28  a = (color >> 24) & 255;
29  r = r / 255.;
30  g = g / 255.;
31  b = b / 255.;
32  a = a / 255.;
33 }
34 
35 static void writeX3DScale(FILE *fp, PView *p, double xmin, double ymin,
36  double width, double height, double tic,
37  int horizontal, double font_size);
38 static void writeX3DScaleBar(FILE *fp, PView *p, double xmin, double ymin,
39  double width, double height, double tic,
40  int horizontal);
41 static void writeX3DScaleValues(FILE *fp, PView *p, double xmin, double ymin,
42  double width, double height, double tic,
43  int horizontal, double font_size);
44 static void writeX3DScaleLabel(FILE *fp, PView *p, double xmin, double ymin,
45  double width, double height, double tic,
46  int horizontal, double font_size);
47 static void writeX3DStringCenter(FILE *fp, char *label, double x, double y,
48  double z, double font_size);
49 
51 public:
53  int _index;
55  float xmin, ymin, zmin;
56  float xmax, ymax, zmax;
57 };
58 
59 #endif
writeX3DScale
static void writeX3DScale(FILE *fp, PView *p, double xmin, double ymin, double width, double height, double tic, int horizontal, double font_size)
PView
Definition: PView.h:27
UnsignedChar2rgba
static void UnsignedChar2rgba(unsigned char *glc, double *rgba)
Definition: PViewX3D.h:14
writeX3DScaleLabel
static void writeX3DScaleLabel(FILE *fp, PView *p, double xmin, double ymin, double width, double height, double tic, int horizontal, double font_size)
TriangleToSort::_ppv
PView * _ppv
Definition: PViewX3D.h:52
TriangleToSort::zmax
float zmax
Definition: PViewX3D.h:56
writeX3DScaleBar
static void writeX3DScaleBar(FILE *fp, PView *p, double xmin, double ymin, double width, double height, double tic, int horizontal)
TriangleToSort::_globalIndex
int _globalIndex
Definition: PViewX3D.h:54
TriangleToSort::ymin
float ymin
Definition: PViewX3D.h:55
TriangleToSort
Definition: PViewX3D.h:50
writeX3DStringCenter
static void writeX3DStringCenter(FILE *fp, char *label, double x, double y, double z, double font_size)
TriangleToSort::xmax
float xmax
Definition: PViewX3D.h:56
unsignedInt2RGBA
static void unsignedInt2RGBA(unsigned int &color, double &r, double &g, double &b, double &a)
Definition: PViewX3D.h:22
z
const double z
Definition: GaussQuadratureQuad.cpp:56
TriangleToSort::ymax
float ymax
Definition: PViewX3D.h:56
writeX3DScaleValues
static void writeX3DScaleValues(FILE *fp, PView *p, double xmin, double ymin, double width, double height, double tic, int horizontal, double font_size)
TriangleToSort::_index
int _index
Definition: PViewX3D.h:53
TriangleToSort::zmin
float zmin
Definition: PViewX3D.h:55
TriangleToSort::xmin
float xmin
Definition: PViewX3D.h:55