MoCSI API Reference
Theme:
Default
Round
Robot
Loading...
Searching...
No Matches
src
VtkRayCasting.h
Go to the documentation of this file.
1
#ifndef VTK_RAY_CASTING_H
2
#define VTK_RAY_CASTING_H
3
4
#ifdef VTK_PRESENT
5
#include <vtkActor.h>
6
#include <vtkBYUReader.h>
7
#include <vtkCamera.h>
8
#include <vtkCellCenters.h>
9
#include <vtkCellData.h>
10
#include <vtkDoubleArray.h>
11
#include <vtkIdList.h>
12
#include <vtkMeshQuality.h>
13
#include <vtkNamedColors.h>
14
#include <vtkOBBTree.h>
15
#include <vtkOBJReader.h>
16
#include <vtkPLYReader.h>
17
#include <vtkPoints.h>
18
#include <vtkPolyDataMapper.h>
19
#include <vtkPolyDataNormals.h>
20
#include <vtkPolyDataReader.h>
21
#include <vtkProperty.h>
22
#include <vtkRenderWindow.h>
23
#include <vtkRenderWindowInteractor.h>
24
#include <vtkRenderer.h>
25
#include <vtkSTLReader.h>
26
#include <vtkSmartPointer.h>
27
#include <vtkSphereSource.h>
28
#include <vtkXMLPolyDataReader.h>
29
30
#include <algorithm>
31
#include <array>
32
#include <cmath>
33
#include <fstream>
34
#include <iomanip>
35
#include <numbers>
36
#include <ostream>
37
#include <random>
38
#include <string>
39
#include <vector>
40
#include <vtksys/SystemTools.hxx>
41
42
#include "
CsrMatrix.h
"
43
60
class
VtkRayCasting
61
{
62
private
:
63
int
m_rows{};
64
int
m_cols{};
65
CsrSparseMatrix<double>
m_viewfactor_matrix
;
66
std::vector<double>
m_solar_irradiation
;
67
vtkSmartPointer<vtkPolyData>
m_base_mesh
;
68
vtkSmartPointer<vtkOBBTree>
m_ray_mesh
;
69
vtkSmartPointer<vtkPolyData>
m_centroids
;
70
vtkSmartPointer<vtkDataArray>
m_normals
;
71
vtkSmartPointer<vtkDataArray>
m_areas
;
72
73
static
void
vectorSub
(
const
double
vector_1
[3],
const
double
vector_2
[3],
double
res
[3]);
74
static
void
vectorAdd
(
const
double
vector_1
[3],
const
double
vector_2
[3],
double
res
[3]);
75
static
void
vectorMult
(
const
double
vector_1
[3],
double
mult
,
double
res
[3]);
76
static
double
dotProduct
(
const
double
vector_1
[3],
const
double
vector_2
[3]);
77
static
double
dotProductInv
(
const
double
vector_1
[3],
const
double
vector_2
[3]);
78
static
double
l2Norm
(
double
vector_1
[3],
double
vector_2
[3]);
79
static
void
vectorDirection
(
double
vector_1
[3],
double
vector_2
[3],
double
direction
[3]);
80
void
calculateViewfactorMatrix
(
const
vtkSmartPointer<vtkOBBTree>
&
mesh
,
81
const
vtkSmartPointer<vtkPolyData>
&
centroids
,
82
const
vtkSmartPointer<vtkDataArray>
&
normals
,
83
const
vtkSmartPointer<vtkDataArray>
&
areas
);
84
static
void
calculateSolarIrradiation
(
const
vtkSmartPointer<vtkOBBTree>
&
mesh
,
85
const
vtkSmartPointer<vtkPolyData>
&
centroids
,
86
const
vtkSmartPointer<vtkDataArray>
&
normals
,
87
double
sol_vec
[3],
double
Q_0
,
88
std::vector<double>&
Q_sol
);
89
90
static
vtkSmartPointer<vtkPolyData>
readPolyData
(
const
char
*
fileName
);
91
92
public
:
93
VtkRayCasting
(
const
char
*
fileName
);
94
VtkRayCasting
(
const
char
*
fileName
,
bool
);
95
96
const
CsrSparseMatrix<double>
&
getViewfactorMatrix
()
const
{
return
m_viewfactor_matrix
; }
97
const
std::vector<double>&
getSolarIrradiation
(
double
sol_vec
[3],
double
Q_0
);
98
int
getFacetNumber
()
const
{
return
m_rows; };
99
std::vector<std::vector<double>> getVertices();
100
std::vector<std::vector<int>> getFaces();
101
std::vector<std::vector<double>> getNormals();
102
std::vector<double> getAreas();
103
};
104
#endif
105
106
#endif
CsrMatrix.h
DependencyError
Error class to throw when a module chain has circular or missing dependencies. Inherits from std::exc...
Definition
ChainManager.h:28
Generated by
1.9.8