Loading...
Searching...
No Matches
Map.hpp
1/*---------------------------------------------------------------------------*\
2 *
3 * bitpit
4 *
5 * Copyright (C) 2015-2021 OPTIMAD engineering Srl
6 *
7 * -------------------------------------------------------------------------
8 * License
9 * This file is part of bitpit.
10 *
11 * bitpit is free software: you can redistribute it and/or modify it
12 * under the terms of the GNU Lesser General Public License v3 (LGPL)
13 * as published by the Free Software Foundation.
14 *
15 * bitpit is distributed in the hope that it will be useful, but WITHOUT
16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18 * License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with bitpit. If not, see <http://www.gnu.org/licenses/>.
22 *
23\*---------------------------------------------------------------------------*/
24
25#ifndef __BITPIT_PABLO_MAP_HPP__
26#define __BITPIT_PABLO_MAP_HPP__
27
28// =================================================================================== //
29// INCLUDES //
30// =================================================================================== //
31#include <vector>
32#include <iostream>
33#include <array>
34#include <limits>
35
36namespace bitpit {
37
38// =================================================================================== //
39// TYPEDEFS
40// =================================================================================== //
41typedef std::vector<double> dvector;
42typedef std::vector<dvector> dvector2D;
43typedef std::vector<uint32_t> u32vector;
44typedef std::vector<u32vector> u32vector2D;
45typedef std::vector<uint64_t> u64vector;
46typedef std::vector<u64vector> u64vector2D;
47typedef std::array<double, 3> darray3;
48typedef std::array<int8_t, 3> i8array3;
49typedef std::array<uint32_t, 3> u32array3;
50typedef std::vector<u32array3> u32arr3vector;
51typedef std::vector<darray3> darr3vector;
52
53// =================================================================================== //
54// CLASS DEFINITION //
55// =================================================================================== //
71class Map{
72
73 // =================================================================================== //
74 // FRIENDSHIPS
75 // =================================================================================== //
76
77 friend class ParaTree;
78
79 // =================================================================================== //
80 // MEMBERS
81 // =================================================================================== //
82private:
83 darray3 m_origin;
84 double m_L;
85 uint8_t m_dim;
86 uint8_t m_nnodes;
87 uint8_t m_nnodesPerFace;
88 uint32_t m_maxLength;
89 double m_maxLength_1;
90 uint64_t m_maxArea;
91 double m_maxArea_1;
92 uint64_t m_maxVolume;
93 double m_maxVolume_1;
96 // =================================================================================== //
97 // CONSTRUCTORS AND OPERATORS
98 // =================================================================================== //
99 Map();
100 Map(uint8_t dim);
101// Map(double & X, double & Y, double & Z, double & LL, uint8_t dim);
102
103 // =================================================================================== //
104 // METHODS
105 // =================================================================================== //
106
107 void initialize();
108 void initialize(uint8_t dim);
109
110 darray3 mapCoordinates(u32array3 const & X) const;
111 double mapX(uint32_t X) const;
112 double mapY(uint32_t Y) const;
113 double mapZ(uint32_t Z) const;
114 u32array3 mapCoordinates(darray3 const & X) const;
115 uint32_t mapX(double X) const;
116 uint32_t mapY(double Y) const;
117 uint32_t mapZ(double Z) const;
118 double mapSize(uint32_t size) const;
119 double mapArea(uint64_t area) const;
120 double mapVolume(uint64_t volume) const;
121 void mapCenter(double* & center, darray3 & mapcenter) const;
122 void mapCenter(darray3 & center, darray3 & mapcenter) const;
123 void mapNodes(uint32_t (*nodes)[3], darr3vector & mapnodes) const;
124 void mapNodes(u32arr3vector nodes, darr3vector & mapnodes) const;
125 void mapNode(u32array3 & node, darray3 & mapnode) const;
126 void mapNodesIntersection(uint32_t (*nodes)[3], darr3vector & mapnodes) const;
127 void mapNodesIntersection(u32arr3vector nodes, darr3vector & mapnodes) const;
128 void mapNormals(i8array3 normal, darray3 & mapnormal) const;
129
130};
131
132}
133
134#endif /* __BITPIT_PABLO_MAP_HPP__ */
Transformation Mapper.
Definition Map.hpp:71
Para Tree is the user interface class.
Definition ParaTree.hpp:113
--- layout: doxygen_footer ---