VirtualFluids 0.2.0
Parallel CFD LBM Solver
Loading...
Searching...
No Matches
GbPoint3D.h
Go to the documentation of this file.
1//=======================================================================================
2// ____ ____ __ ______ __________ __ __ __ __
3// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
4// \ \ | | | | | |_) | | | | | | | / \ | |
5// \ \ | | | | | _ / | | | | | | / /\ \ | |
6// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
7// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
8// \ \ | | ________________________________________________________________
9// \ \ | | | ______________________________________________________________|
10// \ \| | | | __ __ __ __ ______ _______
11// \ | | |_____ | | | | | | | | | _ \ / _____)
12// \ | | _____| | | | | | | | | | | \ \ \_______
13// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
14// \ _____| |__| |________| \_______/ |__| |______/ (_______/
15//
16// This file is part of VirtualFluids. VirtualFluids is free software: you can
17// redistribute it and/or modify it under the terms of the GNU General Public
18// License as published by the Free Software Foundation, either version 3 of
19// the License, or (at your option) any later version.
20//
21// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
22// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
23// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24// for more details.
25//
26// SPDX-License-Identifier: GPL-3.0-or-later
27// SPDX-FileCopyrightText: Copyright © VirtualFluids Project contributors, see AUTHORS.md in root folder
28//
33//=======================================================================================
34#ifndef GBPOINT3D_H
35#define GBPOINT3D_H
36
37#include <cmath>
38#include <sstream>
39#include <string>
40
41#include <GbObject3D.h>
42
43#include <PointerDefinitions.h>
44
45class GbTriangle3D;
46
48class GbPoint3D : public GbObject3D
49{
50public:
51 GbPoint3D();
52 GbPoint3D(const double &x1, const double &x2, const double &x3);
54 ~GbPoint3D() override = default;
55
56 GbPoint3D *clone() override { return new GbPoint3D(this); }
57 void finalize() override {}
58
59 void setCoordinates(const double &x1, const double &x2, const double &x3)
60 {
61 this->x1 = x1;
62 this->x2 = x2;
63 this->x3 = x3;
65 }
66 void setX1(const double &x1)
67 {
68 this->x1 = x1;
70 }
71 void setX2(const double &x2)
72 {
73 this->x2 = x2;
75 }
76 void setX3(const double &x3)
77 {
78 this->x3 = x3;
80 }
81
82 double getX1Coordinate() const { return this->x1; }
83 double getX2Coordinate() const { return this->x2; }
84 double getX3Coordinate() const { return this->x3; }
85
86 void transform(const double matrix[4][4]);
87
88 double getX1Centroid() override { return this->x1; }
89 double getX1Minimum() override { return this->x1; }
90 double getX1Maximum() override { return this->x1; }
91 double getX2Centroid() override { return this->x2; }
92 double getX2Minimum() override { return this->x2; }
93 double getX2Maximum() override { return this->x2; }
94 double getX3Centroid() override { return this->x3; }
95 double getX3Minimum() override { return this->x3; }
96 double getX3Maximum() override { return this->x3; }
97
98 void translate(const double &x1, const double &x2, const double &x3) override;
99 void rotate(const double &rx1, const double &rx2, const double &rx3) override;
100 void scale(const double &sx1, const double &sx2, const double &sx3) override;
101
102 double getDistance(GbPoint3D *p);
103 bool equals(const GbPoint3D *point) const;
104 bool isPointInGbObject3D(const double &x1, const double &x2, const double &x3, bool &pointIsOnBoundary) override;
105 bool isPointInGbObject3D(const double &x1, const double &x2, const double &x3) override;
106 bool isCellInsideGbObject3D(const double & /*x11*/, const double & /*x21*/, const double & /*x31*/,
107 const double & /*x12*/, const double & /*x22*/, const double & /*x23*/) override
108 {
109 return false;
110 }
111
112 std::vector<GbTriangle3D *> getSurfaceTriangleSet() override;
114 std::string toString() override;
115
116 using GbObject3D::isPointInGbObject3D; // Grund: dadurch muss man hier isPointInGbObject3D(GbPoint3D*) nicht
117 // ausprogrammieren , welche sonst hier "ueberdeckt" waere,da es dieselbe
118 //methode mit anderen args gibt!
119
120 // member
121 double x1;
122 double x2;
123 double x3;
124};
125
126#endif
127
This Class provides basic 3D line objects.
Definition GbLine3D.h:59
This Interface provides basic 3D geometry objects methods.
Definition GbObject3D.h:64
This Class provides basic 3D point objects.
Definition GbPoint3D.h:49
double getX3Centroid() override
Definition GbPoint3D.h:94
double getX3Maximum() override
Definition GbPoint3D.h:96
double getX2Centroid() override
Definition GbPoint3D.h:91
double getX1Centroid() override
Definition GbPoint3D.h:88
void setX2(const double &x2)
Definition GbPoint3D.h:71
double x1
Definition GbPoint3D.h:121
double getX2Maximum() override
Definition GbPoint3D.h:93
double getX3Coordinate() const
Definition GbPoint3D.h:84
void setX3(const double &x3)
Definition GbPoint3D.h:76
bool isCellInsideGbObject3D(const double &, const double &, const double &, const double &, const double &, const double &) override
Definition GbPoint3D.h:106
double x3
Definition GbPoint3D.h:123
double getX1Minimum() override
Definition GbPoint3D.h:89
GbPoint3D * clone() override
Definition GbPoint3D.h:56
double getX1Maximum() override
Definition GbPoint3D.h:90
void setCoordinates(const double &x1, const double &x2, const double &x3)
Definition GbPoint3D.h:59
double getX3Minimum() override
Definition GbPoint3D.h:95
double getX1Coordinate() const
Definition GbPoint3D.h:82
void setX1(const double &x1)
Definition GbPoint3D.h:66
void finalize() override
Definition GbPoint3D.h:57
~GbPoint3D() override=default
double getX2Minimum() override
Definition GbPoint3D.h:92
double getX2Coordinate() const
Definition GbPoint3D.h:83
double x2
Definition GbPoint3D.h:122
This Class provides basic 3D triangle objects.
virtual void notifyObserversObjectChanged()
std::shared_ptr< T > SPtr
bool isPointInGbObject3D(const double &x1, const double &x2, const double &x3, bool &pointIsOnBoundary) override
Definition GbPoint3D.cpp:94
void scale(const double &sx1, const double &sx2, const double &sx3) override
void translate(const double &x1, const double &x2, const double &x3) override
double getDistance(GbPoint3D *p)
Definition GbPoint3D.cpp:59
void transform(const double matrix[4][4])
Definition GbPoint3D.cpp:79
bool equals(const GbPoint3D *point) const
Definition GbPoint3D.cpp:67
virtual bool isPointInGbObject3D(GbPoint3D *p)
GbLine3D * createClippedLine3D(GbPoint3D &point1, GbPoint3D &point2) override
void rotate(const double &rx1, const double &rx2, const double &rx3) override
std::vector< GbTriangle3D * > getSurfaceTriangleSet() override
std::string toString() override