VirtualFluids 0.2.0
Parallel CFD LBM Solver
Loading...
Searching...
No Matches
GbSphere3D.cpp
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#include <geometry3d/GbLine3D.h>
39
40using namespace std;
41
42/*=====================================================*/
44{
45 this->setName("sphere");
46 radius = 0;
47 midPoint = new GbPoint3D(0, 0, 0);
48}
49/*=====================================================*/
50GbSphere3D::GbSphere3D(const double &x1, const double &x2, const double &x3, const double &radius)
52{
53 this->setName("sphere");
54 midPoint = new GbPoint3D(x1, x2, x3);
55 midPoint->addObserver(this);
56
57 this->radius = radius;
58 triangulationMode = RAYPROJECTION;
59 // triangulationMode = CUBOIDPROJECTION;
60}
61/*=====================================================*/
63{
64 this->setName("sphere");
65
66 this->midPoint = sphere.midPoint->clone();
67 this->radius = sphere.radius;
68 triangulationMode = RAYPROJECTION;
69
70 this->midPoint->addObserver(this);
71}
72/*=====================================================*/
74{
75 this->setName(sphere->getName());
76 midPoint = sphere->midPoint->clone();
77 midPoint->addObserver(this);
78
79 this->radius = sphere->getRadius();
80 triangulationMode = RAYPROJECTION;
81}
82/*=====================================================*/
84{
85 if (this->midPoint)
86 this->midPoint->removeObserver(this);
87}
88/*=====================================================*/
90{
91 if (this->midPoint) {
92 this->midPoint->removeObserver(this);
93 this->midPoint->finalize();
94 delete this->midPoint;
95 this->midPoint = NULL;
96 }
97
98 if (this->midPoint)
99 this->midPoint->removeObserver(this);
100}
101/*=====================================================*/
103{
104 return this->getDistance(sphere->midPoint) < radius + sphere->radius;
105}
106/*=======================================================*/
107void GbSphere3D::setCenterCoordinates(const double &x1, const double &x2, const double &x3)
108{
109 this->translate(x1 - getX1Centroid(), x2 - getX2Centroid(), x3 - getX3Centroid());
110}
111
113{
114 this->setCenterCoordinates(val<1>(position), val<2>(position), val<3>(position));
115}
116
117/*=====================================================*/
119{
120 return this->getDistance(p->getX1Centroid(), p->getX2Coordinate(), p->getX3Coordinate());
121}
122/*=====================================================*/
123void GbSphere3D::setCenterX1Coordinate(const double &value)
124{
125 if (this->midPoint)
126 this->midPoint->setX1(value);
127 else
128 throw UbException(UB_EXARGS, "Sphere has no midPoint");
129 // kein notifyObserver(), da der knoten notifyObserver() ausfuehrt und die GbSphere dieses event
130 // abfaengt und dann selbst notifyObservers ausfuehrt ;-)
131}
132/*=====================================================*/
133void GbSphere3D::setCenterX2Coordinate(const double &value)
134{
135 if (this->midPoint)
136 this->midPoint->setX2(value);
137 else
138 throw UbException(UB_EXARGS, "Sphere has no midPoint");
139 // kein notifyObserver(), da der knoten notifyObserver() ausfuehrt und die GbSphere dieses event
140 // abfaengt und dann selbst notifyObservers ausfuehrt ;-)
141}
142/*=====================================================*/
143void GbSphere3D::setCenterX3Coordinate(const double &value)
144{
145 if (this->midPoint)
146 this->midPoint->setX3(value);
147 else
148 throw UbException(UB_EXARGS, "sphere has no midPoint");
149 // kein notifyObserver(), da der knoten notifyObserver() ausfuehrt und die GbSphere dieses event
150 // abfaengt und dann selbst notifyObservers ausfuehrt ;-)
151}
152/*=====================================================*/
153void GbSphere3D::setRadius(const double &radius)
154{
155 if (radius != this->radius) {
156 this->radius = radius;
158 }
159}
160/*=====================================================*/
161double GbSphere3D::getDistance(const double &x1p, const double &x2p, const double &x3p)
162{
163 double deltaX1 = x1p - midPoint->getX1Coordinate();
164 double deltaX2 = x2p - midPoint->getX2Coordinate();
165 double deltaX3 = x3p - midPoint->getX3Coordinate();
166 return sqrt(deltaX1 * deltaX1 + deltaX2 * deltaX2 + deltaX3 * deltaX3) - this->radius;
167}
168/*=====================================================*/
169// true, wenn 'in Object' oder 'auf Boundary'!
170bool GbSphere3D::isPointInGbObject3D(const double &x1p, const double &x2p, const double &x3p)
171{
172 double deltaX1 = x1p - midPoint->getX1Coordinate();
173 double deltaX2 = x2p - midPoint->getX2Coordinate();
174 double deltaX3 = x3p - midPoint->getX3Coordinate();
175
176 return ub_math::lessEqual(deltaX1 * deltaX1 + deltaX2 * deltaX2 + deltaX3 * deltaX3, this->radius * this->radius);
177}
178/*=====================================================*/
179// true, wenn 'in Object' oder 'auf Boundary'!
180bool GbSphere3D::isPointInGbObject3D(const double &x1p, const double &x2p, const double &x3p, bool &pointIsOnBoundary)
181{
182 double deltaX1 = x1p - midPoint->getX1Coordinate();
183 double deltaX2 = x2p - midPoint->getX2Coordinate();
184 double deltaX3 = x3p - midPoint->getX3Coordinate();
185
186 double distanceSquare = deltaX1 * deltaX1 + deltaX2 * deltaX2 + deltaX3 * deltaX3;
187 double radiusSquare = this->radius * this->radius;
188
190
192}
193/*=====================================================*/
194// bool GbSphere3D::crossCellCrossSection(double x11,double x21,double x12,double x22, double ra)
195//{
196// if(this->isPointInCrossection(x11, x12) || this->isPointInCrossection(x21, x22) || this->isPointInCrossection(x11,
197// x22) || this->isPointInCrossection(x21, x12))
198// {
199// if(!this->isPointInCrossection(x11, x12) || !this->isPointInCrossection(x21, x22) ||
201// }
202// return false;
203//}
204//
206// bool GbSphere3D::cellCrossAndInsideCrossSection(double x11,double x21,double x12,double x22, double ra)
207//{
208// if(this->isPointInCrossection(x11, x12) || this->isPointInCrossection(x21, x22) || this->isPointInCrossection(x11,
209// x22) || this->isPointInCrossection(x21, x12)) return true; return false;
210//}
211/*=====================================================*/
213{
215 ss << "GbSphere3D[";
216 ss << "mid=" << midPoint->toString() << ", r=" << radius << "]";
217 return ss.str();
218}
219/*=====================================================*/
221{
222 double factor = 100.0; // um rundungsfehler beim wurzelterm zu minimieren
223 double xa = factor * point1.getX1Coordinate();
224 double ya = factor * point1.getX2Coordinate();
225 double za = factor * point1.getX3Coordinate();
226 double xb = factor * point2.getX1Coordinate();
227 double yb = factor * point2.getX2Coordinate();
228 double zb = factor * point2.getX3Coordinate();
229 double xm = factor * this->midPoint->getX1Coordinate();
230 double ym = factor * this->midPoint->getX2Coordinate();
231 double zm = factor * this->midPoint->getX3Coordinate();
232 double r = factor * this->radius;
233
234 double xa2 = xa * xa;
235 double ya2 = ya * ya;
236 double za2 = za * za;
237 double xb2 = xb * xb;
238 double yb2 = yb * yb;
239 double zb2 = zb * zb;
240 double xm2 = xm * xm;
241 double ym2 = ym * ym;
242 double zm2 = zm * zm;
243 double r2 = r * r;
244
245 double wurzel =
246 2.0 * xa * xb * ym2 - 2.0 * ya * yb * r2 + 2.0 * ya * ym * xb2 + 2.0 * yb * ym * za2 + 2.0 * ya * ym * zb2 +
247 2.0 * xb * xm * za2 + 2.0 * za * zb * ym2 + 2.0 * xb * xm * ya2 + 2.0 * xa * xm * yb2 + 2.0 * yb * ym * xa2 +
248 2.0 * zb * zm * ya2 + 2.0 * xa * xm * zb2 + 2.0 * za * zm * xb2 + 2.0 * za * zm * yb2 + 2.0 * xa * xb * zm2 -
249 2.0 * xa * xb * r2 - 2.0 * za * zb * r2 + 2.0 * za * zb * xm2 - 2.0 * ya * yb * xa * xm +
250 2.0 * ya * yb * xa * xb + 2.0 * zb * zm * xa2 - 2.0 * ya * yb * xb * xm + 2.0 * ya * yb * xm2 -
251 2.0 * ya * yb * zb * zm + 2.0 * ya * yb * zm2 + 2.0 * zb * zm * yb * ym - 2.0 * zb * zm * ya * ym +
252 2.0 * zb * zm * xb * xm - 2.0 * xa * xm * yb * ym + 2.0 * xa * xm * za * zm + 2.0 * xa * xm * ya * ym -
253 2.0 * yb * ym * za * zm + 2.0 * yb * ym * xb * xm + 2.0 * za * zm * ya * ym - 2.0 * za * zm * xb * xm -
254 2.0 * ya * ym * xb * xm + 2.0 * za * zb * xa * xb - 2.0 * za * zb * xa * xm - 2.0 * za * zb * xb * xm +
255 2.0 * za * zb * ya * yb - 2.0 * za * zb * ya * ym - 2.0 * za * zb * yb * ym - 2.0 * ya * yb * za * zm -
256 xa2 * zb2 - xa2 * yb2 - zb2 * ya2 - za2 * xb2 - za2 * yb2 - xb2 * ya2 - 2.0 * zb * zm * xa * xm -
257 2.0 * xa * xb * za * zm - 2.0 * xa * xb * zb * zm - 2.0 * xa * xb * ya * ym - 2.0 * xa * xb * yb * ym +
258 za2 * r2 - za2 * xm2 - za2 * ym2 + zb2 * r2 - zb2 * xm2 - zb2 * ym2 + xa2 * r2 - xa2 * zm2 - xa2 * ym2 +
259 xb2 * r2 - xb2 * zm2 - xb2 * ym2 + ya2 * r2 - ya2 * zm2 - ya2 * xm2 + yb2 * r2 - yb2 * zm2 - yb2 * xm2;
260 double nenner = -2.0 * za * zb - 2.0 * ya * yb - 2.0 * xa * xb + za2 + zb2 + xa2 + xb2 + ya2 + yb2;
261 double zaehler = 2.0 * zb * zm - 2.0 * xa * xm + 2.0 * yb * ym - 2.0 * za * zm + xa2 - 2.0 * ya * ym +
262 2.0 * xb * xm - zb2 + za2 - xb2 + ya2 - yb2;
263
265
266 if (fabs(nenner) > 1.E-13 && ub_math::greaterEqual(wurzel, 0.0)) {
267 double t1 = (zaehler + 2.0 * sqrt(wurzel)) / nenner;
268 double t2 = (zaehler - 2.0 * sqrt(wurzel)) / nenner;
269
270 if (ub_math::inClosedInterval(t1, -1.0, 1.0)) {
271 double x = (xa * (0.5 - 0.5 * t1) + xb * (0.5 + 0.5 * t1)) / factor;
272 double y = (ya * (0.5 - 0.5 * t1) + yb * (0.5 + 0.5 * t1)) / factor;
273 double z = (za * (0.5 - 0.5 * t1) + zb * (0.5 + 0.5 * t1)) / factor;
274
275 schnittpunkte.push_back(new GbPoint3D(x, y, z));
276 }
277 if (fabs(t2 - t1) > 1.E-13 && ub_math::inClosedInterval(t2, -1.0, 1.0)) {
278 double x = (xa * (0.5 - 0.5 * t2) + xb * (0.5 + 0.5 * t2)) / factor;
279 double y = (ya * (0.5 - 0.5 * t2) + yb * (0.5 + 0.5 * t2)) / factor;
280 double z = (za * (0.5 - 0.5 * t2) + zb * (0.5 + 0.5 * t2)) / factor;
281
282 schnittpunkte.push_back(new GbPoint3D(x, y, z));
283 }
284 }
285
286 int nofSchnittpunkte = (int)schnittpunkte.size();
287 if (nofSchnittpunkte == 1) {
288 if (this->isPointInGbObject3D(&point1))
289 return new GbLine3D(schnittpunkte[0], new GbPoint3D(point1));
290 else if (this->isPointInGbObject3D(&point2))
291 return new GbLine3D(schnittpunkte[0], new GbPoint3D(point2));
292 else // line beruehrt kugel! -> clippedLine reduziert sich zu einem Punkt!
293 {
294 if (std::fabs(this->getDistance(schnittpunkte[0]) - this->radius) < 1.E-13)
295 throw UbException(UB_EXARGS, "Beide LinenPunkte ausserhalb des Kreises, der berechnete Punkt ist "
296 "jedoch KEIN Beruhrungspunkt der Sphere...");
297 return new GbLine3D(schnittpunkte[0], new GbPoint3D(*(schnittpunkte[0])));
298 }
299 } else if (nofSchnittpunkte == 2)
300 return new GbLine3D(schnittpunkte[0], schnittpunkte[1]);
301
302 return NULL;
303}
304/*=========================================================================*/
306{
307 if (triangulationMode == RAYPROJECTION) {
308 double x1m = midPoint->getX1Coordinate();
309 double x2m = midPoint->getX2Coordinate();
310 double x3m = midPoint->getX3Coordinate();
311
312 vector<GbTriangle3D *> triangles;
313
314 int segments = 30;
316 double phiX1a, phiX1b, phiX3a, phiX3b;
317 double x1a, x2a, x3a, x1b, x2b, x3b, x1c, x2c, x3c, x1d, x2d, x3d;
318
319 for (phiX3a = 0.5 * ub_math::PI; phiX3a > -1.5 * ub_math::PI; phiX3a -= deltaPhi) {
320 for (phiX1a = 0.0; phiX1a < ub_math::PI; phiX1a += deltaPhi) {
323
324 x1a = x1m + radius * cos(phiX3a) * std::cos(phiX1a);
325 x2a = x2m + radius * cos(phiX3a) * std::sin(phiX1a);
326 x3a = x3m + radius * sin(phiX3a);
327 x1b = x1m + radius * cos(phiX3a) * std::cos(phiX1b);
328 x2b = x2m + radius * cos(phiX3a) * std::sin(phiX1b);
329 x3b = x3m + radius * sin(phiX3a);
330 x1c = x1m + radius * cos(phiX3b) * std::cos(phiX1b);
331 x2c = x2m + radius * cos(phiX3b) * std::sin(phiX1b);
332 x3c = x3m + radius * sin(phiX3b);
333 x1d = x1m + radius * cos(phiX3b) * std::cos(phiX1a);
334 x2d = x2m + radius * cos(phiX3b) * std::sin(phiX1a);
335 x3d = x3m + radius * sin(phiX3b);
336
338 triangles.push_back(new GbTriangle3D(new GbPoint3D(x1a, x2a, x3a), new GbPoint3D(x1b, x2b, x3b),
339 new GbPoint3D(x1c, x2c, x3c)));
340 triangles.push_back(new GbTriangle3D(new GbPoint3D(x1a, x2a, x3a), new GbPoint3D(x1c, x2c, x3c),
341 new GbPoint3D(x1d, x2d, x3d)));
342 } else {
343 triangles.push_back(new GbTriangle3D(new GbPoint3D(x1d, x2d, x3d), new GbPoint3D(x1c, x2c, x3c),
344 new GbPoint3D(x1a, x2a, x3a)));
345 triangles.push_back(new GbTriangle3D(new GbPoint3D(x1c, x2c, x3c), new GbPoint3D(x1b, x2b, x3b),
346 new GbPoint3D(x1a, x2a, x3a)));
347 }
348 }
349 }
350 return triangles;
351 } else if (triangulationMode == CUBOIDPROJECTION) {
352 vector<GbTriangle3D *> triangles;
353 vector<GbPoint3D *> points;
354 double x1min = this->getX1Minimum();
355 double x2min = this->getX2Minimum();
356 double x3min = this->getX3Minimum();
357 double x1max = this->getX1Maximum();
358 double x2max = this->getX2Maximum();
359 double x3max = this->getX3Maximum();
360 double ax1 = x1min;
361 double bx2 = x2min;
362 double cx1 = x1min;
363 double ax2 = x2min;
364 double bx3 = x3min;
365 double cx3 = x3min;
366
367 int anzahl = 20;
368 double dx1 = (x1max - x1min) / (double)(anzahl - 1);
369 double dx2 = (x2max - x2min) / (double)(anzahl - 1);
370 double dx3 = (x3max - x3min) / (double)(anzahl - 1);
371
372 for (int u = 0; u < anzahl; u++) {
373 ax2 = x2min;
374 bx2 = x2min;
375 cx3 = x3min;
376 for (int v = 0; v < anzahl; v++) {
377 GbPoint3D p1 = GbPoint3D(ax1, ax2, x3max);
378 GbPoint3D p2 = GbPoint3D(ax1, ax2, x3min);
379 GbPoint3D p3 = GbPoint3D(cx1, x2min, cx3);
380 GbPoint3D p4 = GbPoint3D(cx1, x2max, cx3);
381 GbPoint3D p5 = GbPoint3D(x1min, bx2, bx3);
382 GbPoint3D p6 = GbPoint3D(x1max, bx2, bx3);
383
384 GbLine3D *clippedline1 = this->createClippedLine3D(*this->midPoint, p1);
385 GbLine3D *clippedline2 = this->createClippedLine3D(*this->midPoint, p2);
386 GbLine3D *clippedline3 = this->createClippedLine3D(*this->midPoint, p3);
387 GbLine3D *clippedline4 = this->createClippedLine3D(*this->midPoint, p4);
388 GbLine3D *clippedline5 = this->createClippedLine3D(*this->midPoint, p5);
389 GbLine3D *clippedline6 = this->createClippedLine3D(*this->midPoint, p6);
390 points.push_back(new GbPoint3D(clippedline1->getPoint1()));
391 points.push_back(new GbPoint3D(clippedline2->getPoint1()));
392 points.push_back(new GbPoint3D(clippedline3->getPoint1()));
393 points.push_back(new GbPoint3D(clippedline4->getPoint1()));
394 points.push_back(new GbPoint3D(clippedline5->getPoint1()));
395 points.push_back(new GbPoint3D(clippedline6->getPoint1()));
396 clippedline1->deletePoints();
397 delete clippedline1;
398 clippedline2->deletePoints();
399 delete clippedline2;
400 clippedline3->deletePoints();
401 delete clippedline3;
402 clippedline4->deletePoints();
403 delete clippedline4;
404 clippedline5->deletePoints();
405 delete clippedline5;
406 clippedline6->deletePoints();
407 delete clippedline6;
408 ax2 += dx2;
409 cx3 += dx3;
410 bx2 += dx2;
411 }
412 ax1 += dx1;
413 cx1 += dx1;
414 bx3 += dx3;
415 }
416
417 int anz = anzahl * anzahl * 6;
421 int anzahl2 = anzahl * 6;
422 int anzahl3 = anzahl2 + 6;
423 for (int u = 0; u < anz - anzahl3; u++) {
424 point1 = new GbPoint3D(points[u + 6]);
425 point2 = new GbPoint3D(points[u]);
426 point3 = new GbPoint3D(points[u + anzahl2]);
427 if (u % 2 == 0)
428 triangles.push_back(new GbTriangle3D(point1, point2, point3));
429 else
430 triangles.push_back(new GbTriangle3D(point2, point1, point3));
431
432 point1 = new GbPoint3D(points[u + 6]);
433 point2 = new GbPoint3D(points[u + anzahl2]);
434 point3 = new GbPoint3D(points[u + anzahl3]);
435 if (u % 2 == 0)
436 triangles.push_back(new GbTriangle3D(point1, point2, point3));
437 else
438 triangles.push_back(new GbTriangle3D(point2, point1, point3));
439 }
440 for (int u = 0; u < anz; u++)
441 delete points[u];
442
443 return triangles;
444 } else
445 throw UbException(UB_EXARGS, "undefined triangulationmode");
446}
447/*=======================================================*/
449{
450 // wenn ich viele Kugeln bei der PE rausschreibe sollten die vektoren nicht geresized werden
451 // nodes.resize(0);
452 // triangles.resize(0);
453
454 if (triangulationMode == RAYPROJECTION) {
455 float x1m = (float)midPoint->getX1Coordinate();
456 float x2m = (float)midPoint->getX2Coordinate();
457 float x3m = (float)midPoint->getX3Coordinate();
458
459 int segments = 30;
460 float deltaPhi = (float)ub_math::PI / (float)segments;
461 float phiX1a, phiX1b, phiX3a, phiX3b;
462 float x1a, x2a, x3a, x1b, x2b, x3b, x1c, x2c, x3c, x1d, x2d, x3d;
463 int nodeNr = int(nodes.size());
464 for (phiX3a = (float)(0.5 * ub_math::PI); phiX3a > (float)(-1.5 * ub_math::PI); phiX3a -= deltaPhi) {
465 for (phiX1a = 0.0; phiX1a < ub_math::PI; phiX1a += deltaPhi) {
468
469 x1a = x1m + (float)(radius * cos(phiX3a) * std::cos(phiX1a));
470 x2a = x2m + (float)(radius * cos(phiX3a) * std::sin(phiX1a));
471 x3a = x3m + (float)(radius * sin(phiX3a));
472 x1b = x1m + (float)(radius * cos(phiX3a) * std::cos(phiX1b));
473 x2b = x2m + (float)(radius * cos(phiX3a) * std::sin(phiX1b));
474 x3b = x3m + (float)(radius * sin(phiX3a));
475 x1c = x1m + (float)(radius * cos(phiX3b) * std::cos(phiX1b));
476 x2c = x2m + (float)(radius * cos(phiX3b) * std::sin(phiX1b));
477 x3c = x3m + (float)(radius * sin(phiX3b));
478 x1d = x1m + (float)(radius * cos(phiX3b) * std::cos(phiX1a));
479 x2d = x2m + (float)(radius * cos(phiX3b) * std::sin(phiX1a));
480 x3d = x3m + (float)(radius * sin(phiX3b));
481
483 nodes.push_back(makeUbTuple(x1a, x2a, x3a));
484 nodes.push_back(makeUbTuple(x1b, x2b, x3b));
485 nodes.push_back(makeUbTuple(x1c, x2c, x3c));
486
487 nodes.push_back(makeUbTuple(x1a, x2a, x3a));
488 nodes.push_back(makeUbTuple(x1c, x2c, x3c));
489 nodes.push_back(makeUbTuple(x1d, x2d, x3d));
490 } else {
491 nodes.push_back(makeUbTuple(x1d, x2d, x3d));
492 nodes.push_back(makeUbTuple(x1c, x2c, x3c));
493 nodes.push_back(makeUbTuple(x1a, x2a, x3a));
494
495 nodes.push_back(makeUbTuple(x1c, x2c, x3c));
496 nodes.push_back(makeUbTuple(x1b, x2b, x3b));
497 nodes.push_back(makeUbTuple(x1a, x2a, x3a));
498 }
499 triangles.push_back(makeUbTuple(nodeNr, nodeNr + 1, nodeNr + 2));
500 triangles.push_back(makeUbTuple(nodeNr + 3, nodeNr + 4, nodeNr + 5));
501 nodeNr += 6;
502 }
503 }
504 } else if (triangulationMode == CUBOIDPROJECTION) {
505 vector<GbPoint3D *> points;
506 double x1min = this->getX1Minimum();
507 double x2min = this->getX2Minimum();
508 double x3min = this->getX3Minimum();
509 double x1max = this->getX1Maximum();
510 double x2max = this->getX2Maximum();
511 double x3max = this->getX3Maximum();
512 double ax1 = x1min;
513 double bx2 = x2min;
514 double cx1 = x1min;
515 double ax2 = x2min;
516 double bx3 = x3min;
517 double cx3 = x3min;
518
519 int anzahl = 20;
520 double dx1 = (x1max - x1min) / (double)(anzahl - 1);
521 double dx2 = (x2max - x2min) / (double)(anzahl - 1);
522 double dx3 = (x3max - x3min) / (double)(anzahl - 1);
523
524 for (int u = 0; u < anzahl; u++) {
525 ax2 = x2min;
526 bx2 = x2min;
527 cx3 = x3min;
528 for (int v = 0; v < anzahl; v++) {
529 GbPoint3D p1 = GbPoint3D(ax1, ax2, x3max);
530 GbPoint3D p2 = GbPoint3D(ax1, ax2, x3min);
531 GbPoint3D p3 = GbPoint3D(cx1, x2min, cx3);
532 GbPoint3D p4 = GbPoint3D(cx1, x2max, cx3);
533 GbPoint3D p5 = GbPoint3D(x1min, bx2, bx3);
534 GbPoint3D p6 = GbPoint3D(x1max, bx2, bx3);
535
536 GbLine3D *clippedline1 = this->createClippedLine3D(*this->midPoint, p1);
537 GbLine3D *clippedline2 = this->createClippedLine3D(*this->midPoint, p2);
538 GbLine3D *clippedline3 = this->createClippedLine3D(*this->midPoint, p3);
539 GbLine3D *clippedline4 = this->createClippedLine3D(*this->midPoint, p4);
540 GbLine3D *clippedline5 = this->createClippedLine3D(*this->midPoint, p5);
541 GbLine3D *clippedline6 = this->createClippedLine3D(*this->midPoint, p6);
542 points.push_back(new GbPoint3D(clippedline1->getPoint1()));
543 points.push_back(new GbPoint3D(clippedline2->getPoint1()));
544 points.push_back(new GbPoint3D(clippedline3->getPoint1()));
545 points.push_back(new GbPoint3D(clippedline4->getPoint1()));
546 points.push_back(new GbPoint3D(clippedline5->getPoint1()));
547 points.push_back(new GbPoint3D(clippedline6->getPoint1()));
548 clippedline1->deletePoints();
549 delete clippedline1;
550 clippedline2->deletePoints();
551 delete clippedline2;
552 clippedline3->deletePoints();
553 delete clippedline3;
554 clippedline4->deletePoints();
555 delete clippedline4;
556 clippedline5->deletePoints();
557 delete clippedline5;
558 clippedline6->deletePoints();
559 delete clippedline6;
560 ax2 += dx2;
561 cx3 += dx3;
562 bx2 += dx2;
563 }
564 ax1 += dx1;
565 cx1 += dx1;
566 bx3 += dx3;
567 }
568
569 int anz = anzahl * anzahl * 6;
570 int anzahl2 = anzahl * 6;
571 int anzahl3 = anzahl2 + 6;
572 int nodeNr = 0;
573 for (int u = 0; u < anz - anzahl3; u++) {
574 nodes.push_back(makeUbTuple((float)points[u + 6]->x1, (float)points[u + 6]->x2, (float)points[u + 6]->x3));
575 nodes.push_back(makeUbTuple((float)points[u]->x1, (float)points[u]->x2, (float)points[u]->x3));
576 nodes.push_back(makeUbTuple((float)points[u + anzahl2]->x1, (float)points[u + anzahl2]->x2,
577 (float)points[u + anzahl2]->x3));
578
579 if (u % 2 == 0)
580 triangles.push_back(makeUbTuple(nodeNr, nodeNr + 1, nodeNr + 2));
581 else
582 triangles.push_back(makeUbTuple(nodeNr, nodeNr + 1, nodeNr + 2));
583
584 nodes.push_back(makeUbTuple((float)points[u + 6]->x1, (float)points[u + 6]->x2, (float)points[u + 6]->x3));
585 nodes.push_back(makeUbTuple((float)points[u + anzahl2]->x1, (float)points[u + anzahl2]->x2,
586 (float)points[u + anzahl2]->x3));
587 nodes.push_back(makeUbTuple((float)points[u + anzahl3]->x1, (float)points[u + anzahl3]->x2,
588 (float)points[u + anzahl3]->x3));
589 if (u % 2 == 0)
590 triangles.push_back(makeUbTuple(nodeNr + 3, nodeNr + 4, nodeNr + 5));
591 else
592 triangles.push_back(makeUbTuple(nodeNr + 3, nodeNr + 4, nodeNr + 5));
593
594 nodeNr += 6;
595 }
596 for (int u = 0; u < anz; u++)
597 delete points[u];
598 } else
599 throw UbException(UB_EXARGS, "undefined triangulationmode");
600}
601/*=======================================================*/
602void GbSphere3D::transform(const double matrix[4][4])
603{
604 midPoint->transform(matrix);
605 this->setRadius(this->getRadius() * matrix[0][0]);
607}
608/*=======================================================*/
610{
612 GbVector3D vecDirection(direction.getX1Coordinate(), direction.getX2Coordinate(), direction.getX3Coordinate());
615 float a = (float)(vecDirection.Dot(vecDirection));
616 float b = (float)(2.0 * vecDirection.Dot(diff));
617 float c = (float)(diff.Dot(diff) - this->getRadius() * this->getRadius());
618
619 // use 'abc'-formula for finding root t_1,2 = (-b +/- sqrt(b^2-4ac))/(2a)
620 float inRoot = (float)(b * b - 4.0 * a * c);
621 if (inRoot < 0)
622 return false;
623 float root = sqrt(inRoot);
624
625 float dist = (float)((-b - root) / (2.0 * a));
626
627 double infinity = DBL_MAX;
628 double eps = 1E-4;
629
630 if (dist > infinity)
631 return false;
632
633 if (dist < eps) {
634 dist = (float)((-b + root) / (2.0 * a));
636 return false;
637 }
638 return true;
639}
640/*=======================================================*/
641bool GbSphere3D::isCellCuttingGbObject3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b,
642 const double &x2b, const double &x3b)
643// Merksatz: cell oder deren Volumen schneidet oder beinhaltet komplette oder Teile der SphereUmrandung
644// returns true:
645// - cell cuts sphere3D
646// - cell boxes sphere3D
647// returns false:
648// - cell completely inside sphere3D ( = sphere3D boxes cell)
649// - cell und sphere3D haben kein gemeinsames Volumen
650{
651 double midX[] = { this->getX1Centroid(), this->getX2Centroid(), this->getX3Centroid() };
652
654
656
657 /* Solid Box - Hollow Sphere */
658 double dmin = 0.0;
659 double dmax = 0.0;
660 double r2 = radius * radius;
661
662 for (int i = 0; i < 3; i++) {
663 double a = pow(midX[i] - Bmin[i], 2.0);
664 double b = pow(midX[i] - Bmax[i], 2.0);
665 dmax += ub_math::max(a, b);
666 if (ub_math::less(midX[i], Bmin[i]))
667 dmin += a;
668 else if (ub_math::greater(midX[i], Bmax[i]))
669 dmin += b;
670 }
672 return true;
673 }
674 return false;
675}
676/*=======================================================*/
677bool GbSphere3D::isCellInsideOrCuttingGbObject3D(const double &x1a, const double &x2a, const double &x3a,
678 const double &x1b, const double &x2b, const double &x3b)
679// returns true:
680// - cell completely inside sphere3D ( = sphere3D boxes cell)
681// - cell cuts sphere3D
682// - cell boxes sphere3D
683// returns false:
684// - cell und sphere3D haben kein gemeinsames Volumen
685{
686 // URL: http://tog.acm.org/GraphicsGems/gems/BoxSphere.c (mode=4, beides solids!!!)
687 // solid - solid
688 // this routine tests for intersection between an 3-dimensional
689 // axis-aligned box and an 3-dimensional sphere.
690
691 // true:
692 // - wenn Schnitt
693 // - Cell komplett innerhalb GbSphere3D
694 // - Cell umhuellt GbSphere3D
695
696 double midX1 = this->getX1Centroid();
697 double midX2 = this->getX2Centroid();
698 double midX3 = this->getX3Centroid();
699
700 double dmin = 0.0;
701
702 if (ub_math::less(midX1, x1a))
703 dmin += std::pow(midX1 - x1a, 2.0);
704 else if (ub_math::greater(midX1, x1b))
705 dmin += std::pow(midX1 - x1b, 2.0);
706
707 if (ub_math::less(midX2, x2a))
708 dmin += std::pow(midX2 - x2a, 2.0);
709 else if (ub_math::greater(midX2, x2b))
710 dmin += std::pow(midX2 - x2b, 2.0);
711
712 if (ub_math::less(midX3, x3a))
713 dmin += std::pow(midX3 - x3a, 2.0);
714 else if (ub_math::greater(midX3, x3b))
715 dmin += std::pow(midX3 - x3b, 2.0);
716
717 if (ub_math::lessEqual(dmin, radius * radius)) {
718 return true;
719 }
720
721 return false;
722}
723/*==========================================================*/
724double GbSphere3D::getCellVolumeInsideGbObject3D(const double &x1a, const double &x2a, const double &x3a,
725 const double &x1b, const double &x2b, const double &x3b)
726{
727 double deltaX1 = (x1b - x1a);
728 double deltaX2 = (x2b - x2a);
729 double deltaX3 = (x3b - x3a);
730
731 if (this->isCellInsideGbObject3D(x1a, x2a, x3a, x1b, x2b, x3b))
732 return 1.0 * deltaX1 * deltaX2 * deltaX3;
733 if (!(this->isCellCuttingGbObject3D(x1a, x2a, x3a, x1b, x2b, x3b)))
734 return 0.0;
735
736 double tempResult = 0.0;
737
738 int iMax = 10;
739 int jMax = 10;
740 int kMax = 10;
741
742 for (int i = 0; i < iMax; i++) {
743 for (int j = 0; j < jMax; j++) {
744 for (int k = 0; k < kMax; k++) {
745
747 x1a + ((double)i) * deltaX1 / ((double)iMax), x2a + ((double)j) * deltaX2 / ((double)jMax),
748 x3a + ((double)k) * deltaX3 / ((double)kMax), x1a + ((double)(i + 1)) * deltaX1 / ((double)iMax),
749 x2a + ((double)(j + 1)) * deltaX2 / ((double)jMax),
750 x3a + ((double)(k + 1)) * deltaX3 / ((double)kMax));
751 }
752 }
753 }
754
755 // double resultWithOneCell = getCellVolumeInsideGbObject3DHelperFunction( x1a, x2a, x3a, x1b, x2b, x3b );
756 // cout << tempResult << " vs. " << resultWithOneCell << endl;
757
758 return tempResult;
759}
760/*==========================================================*/
761double GbSphere3D::getCellVolumeInsideGbObject3DHelperFunction(const double &x1a, const double &x2a, const double &x3a,
762 const double &x1b, const double &x2b, const double &x3b)
763{
764
765 double deltaX1 = x1b - x1a;
766 double deltaX2 = x2b - x2a;
767 double deltaX3 = x3b - x3a;
768
769 if (this->isCellInsideGbObject3D(x1a, x2a, x3a, x1b, x2b, x3b))
770 return 1.0 * deltaX1 * deltaX2 * deltaX3;
771 if (!(this->isCellCuttingGbObject3D(x1a, x2a, x3a, x1b, x2b, x3b)))
772 return 0.0;
773
774 double alpha = 0.0;
775 double internX1, internX2, internX3;
776
777 for (int x1vers = 0; x1vers < 2; x1vers++) {
778 for (int x2vers = 0; x2vers < 2; x2vers++) {
779 for (int x3vers = 0; x3vers < 2; x3vers++) {
780 internX1 = x1a + (x1b - x1a) * x1vers;
781 internX2 = x2a + (x2b - x2a) * x2vers;
782 internX3 = x3a + (x3b - x3a) * x3vers;
783
784 if (ub_math::lessEqual(this->getDistance(internX1, internX2, internX3), alpha))
785 alpha = this->getDistance(internX1, internX2, internX3);
786 // cout<<zelltyp<<" "<<kugel->getDistance(internX1,internX2,internX3)<<" "<<alpha<<endl;
787 } // end first for
788 } // end second for
789 } // end third for
790
791 alpha = (-1) * alpha;
792
793 double n[3];
794 n[0] = 0.5 * (x1b + x1a) - this->getX1Centroid();
795 n[1] = 0.5 * (x2b + x2a) - this->getX2Centroid();
796 n[2] = 0.5 * (x3b + x3a) - this->getX3Centroid();
797
798 // cout << "Koordinaten: "<<x1<<" "<<x2<<" "<<x3<<endl;
799 // cout << "Deltas: "<<deltaX1<<" "<<deltaX2<<" "<<deltaX3<<endl;
800 // cout << "Halbe Zelle: "<<halfcelldelta<<endl;
801
802 // cout<<"Centroid: "<<kugel->getX1Centroid()<<" "<<kugel->getX2Centroid()<<" "<<kugel->getX3Centroid()<<endl;
803
804 // cout<<"Normals: "<<n[0]<<" "<<n[1]<<" "<<n[2]<<endl;
805
806 double normLength;
807 normLength = sqrt(n[0] * n[0] + n[1] * n[1] + n[2] * n[2]);
808 n[0] /= normLength;
809 n[1] /= normLength;
810 n[2] /= normLength;
811
812 if (ub_math::less(n[0], 0.0))
813 n[0] = -n[0];
814 if (ub_math::less(n[1], 0.0))
815 n[1] = -n[1];
816 if (ub_math::less(n[2], 0.0))
817 n[2] = -n[2];
818
819 // cout<<"Normals: "<<n[0]<<" "<<n[1]<<" "<<n[2]<<endl;
820
821 double dummy;
822 if (ub_math::greater(n[0], n[1])) {
823 dummy = n[1];
824 n[1] = n[0];
825 n[0] = dummy;
826 }
827 if (ub_math::greater(n[1], n[2])) {
828 dummy = n[2];
829 n[2] = n[1];
830 n[1] = dummy;
831 }
832 if (ub_math::greater(n[0], n[1])) {
833 dummy = n[1];
834 n[1] = n[0];
835 n[0] = dummy;
836 }
837
838 // cout<<"Normals: "<<n[0]<<" "<<n[1]<<" "<<n[2]<<endl;
839
840 double n1, n2, n3;
841 n1 = n[0];
842 n2 = n[1];
843 n3 = n[2];
844
845 double maxVol = deltaX1 * deltaX2 * deltaX3;
846
847 double result = 0.0, preresult = 0.0;
848
849 if (ub_math::lessEqual(maxVol, 0.000001))
850 return 0.0;
851
852 // 1D Check
853 if (ub_math::lessEqual(n1, 0.001) && ub_math::lessEqual(n2, 0.001)) {
854 result = alpha * deltaX1 * deltaX2;
855 }
856 // 2D Check
857 else if (ub_math::lessEqual(n1, 0.001)) {
858 preresult = (2 * n2 * n3);
859 result = (alpha * alpha) / preresult;
860
861 if (ub_math::greater(alpha, n2 * deltaX2)) {
862 result += -(alpha - n2 * deltaX2) * (alpha - n2 * deltaX2) / preresult;
863 }
864 if (ub_math::greater(alpha, n3 * deltaX3)) {
865 result += -(alpha - n3 * deltaX3) * (alpha - n3 * deltaX3) / preresult;
866 }
867 if (ub_math::greater(alpha, n2 * deltaX2 + n3 * deltaX3)) {
868 result += (alpha - n2 * deltaX2 - n3 * deltaX3) * (alpha - n2 * deltaX2 - n3 * deltaX3) / preresult;
869 }
870
871 // tiefenrichtung mit einmultiplizieren...
872 result *= deltaX1;
873 }
874 // 3D Check
875 else {
876 preresult = 6 * n1 * n2 * n3;
877
878 result = alpha * alpha * alpha;
879
880 if (ub_math::greaterEqual(alpha, n1 * deltaX1)) {
881 result += -((alpha - n1 * deltaX1) * (alpha - n1 * deltaX1) * (alpha - n1 * deltaX1));
882 }
883 if (ub_math::greaterEqual(alpha, n2 * deltaX2)) {
884 result += -((alpha - n2 * deltaX2) * (alpha - n2 * deltaX2) * (alpha - n2 * deltaX2));
885 }
886 if (ub_math::greaterEqual(alpha, n3 * deltaX3)) {
887 result += -((alpha - n3 * deltaX3) * (alpha - n3 * deltaX3) * (alpha - n3 * deltaX3));
888 }
889 if (ub_math::greaterEqual(alpha, (n1 * deltaX1 + n2 * deltaX2))) {
890 result += ((alpha - (n1 * deltaX1 + n2 * deltaX2)) * (alpha - (n1 * deltaX1 + n2 * deltaX2)) *
891 (alpha - (n1 * deltaX1 + n2 * deltaX2)));
892 }
893 if (ub_math::greaterEqual(alpha, (n1 * deltaX1 + n3 * deltaX3))) {
894 result += ((alpha - (n1 * deltaX1 + n3 * deltaX3)) * (alpha - (n1 * deltaX1 + n3 * deltaX3)) *
895 (alpha - (n1 * deltaX1 + n3 * deltaX3)));
896 }
897 if (ub_math::greaterEqual(alpha, (n2 * deltaX2 + n3 * deltaX3))) {
898 result += ((alpha - (n2 * deltaX2 + n3 * deltaX3)) * (alpha - (n2 * deltaX2 + n3 * deltaX3)) *
899 (alpha - (n2 * deltaX2 + n3 * deltaX3)));
900 }
901
902 // NEW
903 if (ub_math::greaterEqual(alpha, (n1 * deltaX1 + n2 * deltaX2 + n3 * deltaX3))) {
904 result += -((alpha - (n1 * deltaX1 + n2 * deltaX2 + n3 * deltaX3)) *
905 (alpha - (n1 * deltaX1 + n2 * deltaX2 + n3 * deltaX3)) *
906 (alpha - (n1 * deltaX1 + n2 * deltaX2 + n3 * deltaX3)));
907 }
908
910 }
911 return (result);
912
913 // cout << "alpha ist " << alpha << endl;
914 // cout << "fillLevel ist " << eps << endl;
915}
916/*==========================================================*/
917double GbSphere3D::getIntersectionRaytraceFactor(const double &x1, const double &x2, const double &x3,
918 const double &rx1, const double &rx2, const double &rx3)
919{
920 double lx1 = midPoint->x1 - x1;
921 double lx2 = midPoint->x2 - x2;
922 double lx3 = midPoint->x3 - x3;
923 double l_sq = lx1 * lx1 + lx2 * lx2 + lx3 * lx3; // l = abstand Punkt(x1,x2,x3)<->kreismittelpunkt
924
925 double s = lx1 * rx1 + lx2 * rx2 + lx3 * rx3; // s= l*ray_dir)
926 double r_sq = this->radius * this->radius; // r� =r*r
927 // if (d<0 (fuer die Richtung falls sie gegen das Kreis dann haben wir ein negativer Zahl)
928 // && l� > r� (point outside ))
929 // wenn s<0->Punkt liegt rechts vom mittelpunkt, wenn nun punkt ausserhalb des kreises liegt, kann es keinen SP mehr
930 // geben
931 if (s < -1.E-10 && l_sq > r_sq + 1.E-10)
932 return -1.0;
933 // Pythagor on Triangle Rectangle (point, center of the cercle, intersection of the direction on point and m)
934 // l� = m� + d�
935 double m_sq = l_sq - s * s;
936 // if (m� > r� (dann gibt es kein schnittpunt zwischen direction und circle))
937 if (m_sq > r_sq + 1.E-10)
938 return -1.0;
939 // Pythagoras on Triangle Rectangle in cercle (direction , m, r)
940 // r� = m� + h�
941
942 // patch: rundungsfehler bei kleinen delta!!!
943 //-> wenn wurzel minimal null->
944 double wurzelTerm = r_sq - m_sq;
945 if (wurzelTerm < 0.0) {
946 if (wurzelTerm < -1E-10)
947 return -1.0; // definitiv kein SP
948 else
949 return s; // im rundungsfehler-bereich. SP liegt dierkt auf sphere umrandung
950 }
951
952 // if point outside of the circle
953 if (l_sq > r_sq)
954 return s - sqrt(wurzelTerm);
955
956 return s + sqrt(wurzelTerm);
957}
958/*=======================================================*/
959
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 getX1Centroid() override
Definition GbPoint3D.h:88
void setX2(const double &x2)
Definition GbPoint3D.h:71
double x1
Definition GbPoint3D.h:121
double getX3Coordinate() const
Definition GbPoint3D.h:84
void setX3(const double &x3)
Definition GbPoint3D.h:76
double x3
Definition GbPoint3D.h:123
GbPoint3D * clone() override
Definition GbPoint3D.h:56
double getX1Coordinate() const
Definition GbPoint3D.h:82
void setX1(const double &x1)
Definition GbPoint3D.h:66
void finalize() override
Definition GbPoint3D.h:57
double getX2Coordinate() const
Definition GbPoint3D.h:83
double x2
Definition GbPoint3D.h:122
double getRadius() const
Definition GbSphere3D.h:74
double getX1Maximum() override
Definition GbSphere3D.h:78
@ CUBOIDPROJECTION
Definition GbSphere3D.h:58
double getX3Centroid() override
Definition GbSphere3D.h:82
void translate(const double &x1, const double &x2, const double &x3) override
Definition GbSphere3D.h:121
double getX2Minimum() override
Definition GbSphere3D.h:80
double getX1Centroid() override
Definition GbSphere3D.h:76
double getX2Centroid() override
Definition GbSphere3D.h:79
double getX3Maximum() override
Definition GbSphere3D.h:84
double getX3Minimum() override
Definition GbSphere3D.h:83
double getX1Minimum() override
Definition GbSphere3D.h:77
double getX2Maximum() override
Definition GbSphere3D.h:81
This Class provides basic 3D triangle objects.
This Class provides basic 3D vector objects.
Definition GbVector3D.h:47
virtual std::string getName()
Definition ObObject.h:51
void setName(std::string name)
Definition ObObject.h:52
virtual void removeObserver(UbObserver *observer)
virtual void addObserver(UbObserver *observer)
virtual void notifyObserversObjectChanged()
Observer.
Definition UbObserver.h:51
A class implements a tuple.
Definition UbTuple.h:477
std::shared_ptr< T > SPtr
void setCenterCoordinates(const double &x1, const double &x2, const double &x3) override
bool isCellInsideOrCuttingGbObject3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b, const double &x2b, const double &x3b) override
virtual bool isCellInsideGbObject3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b, const double &x2b, const double &x3b)
void addSurfaceTriangleSet(std::vector< UbTupleFloat3 > &nodes, std::vector< UbTupleInt3 > &triangles) override
void setCenterX2Coordinate(const double &value) override
double getDistance(GbPoint3D *p)
void transform(const double matrix[4][4])
Definition GbPoint3D.cpp:79
bool intersects(SPtr< GbSphere3D > sphere)
void transform(const double matrix[4][4])
double getCellVolumeInsideGbObject3DHelperFunction(const double &x1a, const double &x2a, const double &x3a, const double &x1b, const double &x2b, const double &x3b)
std::string toString() override
this->isPointInCrossection(x11, x22) || !this->isPointInCrossection(x21, x12)) return true;
double getIntersectionRaytraceFactor(const double &x1, const double &x2, const double &x3, const double &rx1, const double &rx2, const double &rx3) override
std::vector< GbTriangle3D * > getSurfaceTriangleSet() override
bool isCellCuttingGbObject3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b, const double &x2b, const double &x3b) override
~GbSphere3D() override
double getCellVolumeInsideGbObject3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b, const double &x2b, const double &x3b) override
void finalize() override
void setCenterX3Coordinate(const double &value) override
GbLine3D * createClippedLine3D(GbPoint3D &point1, GbPoint3D &point2) override
void setCenterX1Coordinate(const double &value) override
void setRadius(const double &radius)
bool isPointInGbObject3D(const double &x1, const double &x2, const double &x3) override
std::string toString() override
bool hasIntersectionWithDirectedLine(GbPoint3D origin, GbPoint3D direction)
@ z
Definition Axis.h:44
@ x
Definition Axis.h:42
@ y
Definition Axis.h:43
#define UB_EXARGS
Definition UbException.h:73
UbTuple< T1 > makeUbTuple(T1 const &a1)
Definition UbTuple.h:554
bool greaterEqual(const T1 &value, const T2 &reference)
Definition UbMath.h:223
const double PI
const T & min(const T &a1, const T &a2)
Definition UbMath.h:389
bool lessEqual(const T1 &value, const T2 &reference)
Definition UbMath.h:209
bool equal(const T1 &value, const T2 &reference)
Definition UbMath.h:189
const T & max(const T &a1, const T &a2)
Definition UbMath.h:371
bool greater(const T1 &value, const T2 &reference)
Definition UbMath.h:216
bool inClosedInterval(const T1 &value, const T2 &threshold1, const T3 &threshold2)
Definition UbMath.h:309
bool less(const T1 &value, const T2 &reference)
Definition UbMath.h:202