VirtualFluids 0.2.0
Parallel CFD LBM Solver
Loading...
Searching...
No Matches
GbCuboid3D.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 <GbCuboid3D.h>
35#include <GbSystem3D.h>
36#include <GbTriangle3D.h>
37
39
40using namespace std;
41
42/*=======================================================*/
43// Konstruktor
45{
46 this->setName("cuboid");
47 this->p1 = new GbPoint3D(0.0, 0.0, 0.0);
48 this->p2 = new GbPoint3D(0.0, 0.0, 0.0);
49 this->p1->addObserver(this);
50 this->p2->addObserver(this);
51}
52/*=======================================================*/
53GbCuboid3D::GbCuboid3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b, const double &x2b,
54 const double &x3b)
55 : GbObject3D()
56{
57 this->setName("cuboid");
58 this->p1 = new GbPoint3D(x1a, x2a, x3a);
59 this->p1->addObserver(this);
60 this->p2 = new GbPoint3D(x1b, x2b, x3b);
61 this->p2->addObserver(this);
62}
63/*=======================================================*/
65{
66 this->setName("cuboid");
67 if (!p1 || !p2)
68 throw UbException(UB_EXARGS, "one point ==NULL");
69 this->p1 = p1;
70 this->p1->addObserver(this);
71 this->p2 = p2;
72 this->p2->addObserver(this);
73}
74/*=======================================================*/
76{
77 this->setName("cuboid");
78 if (!cuboid->getPoint1() || !cuboid->getPoint2())
79 throw UbException(UB_EXARGS, "cuboid ==NULL");
80 this->p1 = cuboid->getPoint1()->clone();
81 this->p1->addObserver(this);
82 this->p2 = cuboid->getPoint2()->clone();
83 this->p2->addObserver(this);
84}
85/*=======================================================*/
86// Destruktor
88{
89 // cout<<"~GbCuboid3D()"<<endl;
90 if (this->p1)
91 this->p1->removeObserver(this);
92 if (this->p2)
93 this->p2->removeObserver(this);
94}
95/*=======================================================*/
97{
98 if (this->p1) {
99 this->p1->removeObserver(this);
100 this->p1->finalize();
101 delete this->p1;
102 this->p1 = NULL;
103 }
104 if (this->p2) {
105 this->p2->removeObserver(this);
106 this->p2->finalize();
107 delete this->p2;
108 this->p2 = NULL;
109 }
110}
111/*=======================================================*/
113{
114 if (this->p1)
115 this->p1->removeObserver(this);
116 this->p1 = point1;
117 this->p1->addObserver(this);
118
120}
121/*=======================================================*/
123{
124 if (this->p2)
125 this->p2->removeObserver(this);
126 this->p2 = point2;
127 this->p2->addObserver(this);
128
130}
131/*=======================================================*/
133{
134 if (this->p1)
135 this->p1->removeObserver(this);
136 if (this->p2)
137 this->p2->removeObserver(this);
138
139 this->p1 = point1;
140 this->p2 = point2;
141
142 this->p1->addObserver(this);
143 this->p2->addObserver(this);
144
146}
147/*=======================================================*/
148void GbCuboid3D::setCenterCoordinates(const double &x1, const double &x2, const double &x3)
149{
150 this->translate(x1 - getX1Centroid(), x2 - getX2Centroid(), x3 - getX3Centroid());
151}
152/*=======================================================*/
153double GbCuboid3D::getX1Centroid() { return (0.5 * (p1->x1 + p2->x1)); }
154/*=======================================================*/
155double GbCuboid3D::getX1Minimum() { return (this->p1->x1 < this->p2->x1 ? this->p1->x1 : this->p2->x1); }
156/*=======================================================*/
157double GbCuboid3D::getX1Maximum() { return (this->p1->x1 > this->p2->x1 ? this->p1->x1 : this->p2->x1); }
158/*=======================================================*/
159double GbCuboid3D::getX2Centroid() { return (0.5 * (p1->x2 + p2->x2)); }
160/*=======================================================*/
161double GbCuboid3D::getX2Minimum() { return (this->p1->x2 < this->p2->x2 ? this->p1->x2 : this->p2->x2); }
162/*=======================================================*/
163double GbCuboid3D::getX2Maximum() { return (this->p1->x2 > this->p2->x2 ? this->p1->x2 : this->p2->x2); }
164/*=======================================================*/
165double GbCuboid3D::getX3Centroid() { return (0.5 * (p1->x3 + p2->x3)); }
166/*=======================================================*/
167double GbCuboid3D::getX3Minimum() { return (this->p1->x3 < this->p2->x3 ? this->p1->x3 : this->p2->x3); }
168/*=======================================================*/
169double GbCuboid3D::getX3Maximum() { return (this->p1->x3 > this->p2->x3 ? this->p1->x3 : this->p2->x3); }
170/*=======================================================*/
171double GbCuboid3D::getLengthX1() { return (this->getX1Maximum() - this->getX1Minimum()); }
172/*=======================================================*/
173double GbCuboid3D::getLengthX2() { return (this->getX2Maximum() - this->getX2Minimum()); }
174/*=======================================================*/
175double GbCuboid3D::getLengthX3() { return (this->getX3Maximum() - this->getX3Minimum()); }
176/*=======================================================*/
177bool GbCuboid3D::isPointInGbObject3D(const double &x1p, const double &x2p, const double &x3p)
178{
179 // true, wenn 'in Object' oder 'auf Boundary'!
180 if (ub_math::less(x1p, this->getX1Minimum()))
181 return false;
182 else if (ub_math::less(x2p, this->getX2Minimum()))
183 return false;
184 else if (ub_math::less(x3p, this->getX3Minimum()))
185 return false;
186 else if (ub_math::greater(x1p, this->getX1Maximum()))
187 return false;
188 else if (ub_math::greater(x2p, this->getX2Maximum()))
189 return false;
190 else if (ub_math::greater(x3p, this->getX3Maximum()))
191 return false;
192
193 return true;
194}
195/*=======================================================*/
196bool GbCuboid3D::isPointInGbObject3D(const double &x1p, const double &x2p, const double &x3p, bool &pointIsOnBoundary)
197{
198 pointIsOnBoundary = false;
199
200 // true, wenn 'in Object' oder 'auf Boundary'!
201 if (ub_math::less(x1p, this->getX1Minimum()))
202 return false;
203 else if (ub_math::less(x2p, this->getX2Minimum()))
204 return false;
205 else if (ub_math::less(x3p, this->getX3Minimum()))
206 return false;
207 else if (ub_math::greater(x1p, this->getX1Maximum()))
208 return false;
209 else if (ub_math::greater(x2p, this->getX2Maximum()))
210 return false;
211 else if (ub_math::greater(x3p, this->getX3Maximum()))
212 return false;
213
214 if (ub_math::equal(x1p, this->getX1Minimum()))
215 pointIsOnBoundary = true;
216 else if (ub_math::equal(x2p, this->getX2Minimum()))
217 pointIsOnBoundary = true;
218 else if (ub_math::equal(x3p, this->getX3Minimum()))
219 pointIsOnBoundary = true;
220 else if (ub_math::equal(x1p, this->getX1Maximum()))
221 pointIsOnBoundary = true;
222 else if (ub_math::equal(x2p, this->getX2Maximum()))
223 pointIsOnBoundary = true;
224 else if (ub_math::equal(x3p, this->getX3Maximum()))
225 pointIsOnBoundary = true;
226
227 return true;
228}
229/*=======================================================*/
230bool GbCuboid3D::isCellInsideGbObject3D(const double &x1p1, const double &x2p1, const double &x3p1, const double &x1p2,
231 const double &x2p2, const double &x3p2)
232{
233 if (ub_math::less(x1p1, this->getX1Minimum()))
234 return false;
235 else if (ub_math::less(x2p1, this->getX2Minimum()))
236 return false;
237 else if (ub_math::less(x3p1, this->getX3Minimum()))
238 return false;
239 else if (ub_math::greater(x1p2, this->getX1Maximum()))
240 return false;
241 else if (ub_math::greater(x2p2, this->getX2Maximum()))
242 return false;
243 else if (ub_math::greater(x3p2, this->getX3Maximum()))
244 return false;
245
246 return true;
247}
248/*=======================================================*/
249bool GbCuboid3D::isCellCuttingGbObject3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b,
250 const double &x2b, const double &x3b)
251// Merksatz: cell oder deren Volumen schneidet oder beinhaltet komplette oder Teile der CuboidUmrandung
252// returns true:
253// - cell cuts cuboid3D
254// - cell boxes cuboid3D
255// returns false:
256// - cell completely inside cuboid3D ( = cuboid3D boxes cell)
257// - cell und cuboid3D haben kein gemeinsames Volumen
258{
259 // erstmal die dumm Loesung
260 if (!this->isCellInsideGbObject3D(x1a, x2a, x3a, x1b, x2b, x3b) &&
262 return true;
263 }
264
265 return false;
266
267 // GbCuboid3D* cube = gb_system_3d::clipRectangle3D(*this->p1, *this->p2, x1a,x2a,x3a,x1b,x2b,x3b);
268 // if(cube)
269 //{
270 // cube->finalize();
271 // delete cube;
272 // return true;
273 //}
274
275 // return false;
276}
277/*=======================================================*/
278bool GbCuboid3D::isCellInsideOrCuttingGbObject3D(const double &x1a, const double &x2a, const double &x3a,
279 const double &x1b, const double &x2b, const double &x3b)
280// returns true:
281// - cell completely inside cuboid3D ( = cuboid3D boxes cell)
282// - cell cuts cuboid3D
283// - cell boxes cuboid3D
284// returns false:
285// - cell und cuboid3D haben kein gemeinsames Volumen
286{
287 // simpler check, da unser GbCuboid3D ein AABB is:
288 // anfA midA endA anfB midB endB
289 // | x<-- dxA -->| |<-dxB->x |
290 // |<----------------- T --------------->|
291 // ist |T| <= dxA + dxB -> overlap!
292
293 if (ub_math::lessEqual(std::fabs(this->getX1Centroid() - 0.5 * (x1b + x1a) /*Tx1*/),
294 0.5 * (this->getLengthX1() + std::fabs(x1b - x1a) /*dx1A+dx1B*/))
295
296 && ub_math::lessEqual(std::fabs(this->getX2Centroid() - 0.5 * (x2b + x2a) /*Tx2*/),
297 0.5 * (this->getLengthX2() + std::fabs(x2b - x2a) /*dx2A+dx2B*/))
298
299 && ub_math::lessEqual(std::fabs(this->getX3Centroid() - 0.5 * (x3b + x3a) /*Tx3*/),
300 0.5 * (this->getLengthX3() + std::fabs(x3b - x3a) /*dx3A+dx3B*/))) {
301 return true;
302 }
303
304 return false;
305
306 // if( this->isCellInsideGbObject3D(x1a,x2a,x3a,x1b,x2b,x3b)
307 // || this->isCellCuttingGbObject3D(x1a,x2a,x3a,x1b,x2b,x3b) ) return true;
308 //
309 // return false;
310}
311/*=======================================================*/
313{
314 vector<GbTriangle3D *> triangles;
323
330
331 //"unten"
332 triangles.push_back(new GbTriangle3D(new GbPoint3D(p2), new GbPoint3D(pUnten), new GbPoint3D(p3)));
333 triangles.push_back(new GbTriangle3D(new GbPoint3D(p2), new GbPoint3D(p1), new GbPoint3D(pUnten)));
334 triangles.push_back(new GbTriangle3D(new GbPoint3D(p3), new GbPoint3D(pUnten), new GbPoint3D(p4)));
335 triangles.push_back(new GbTriangle3D(new GbPoint3D(p1), new GbPoint3D(p4), new GbPoint3D(pUnten)));
336 //"oben"
337 triangles.push_back(new GbTriangle3D(new GbPoint3D(p5), new GbPoint3D(p6), new GbPoint3D(pOben)));
338 triangles.push_back(new GbTriangle3D(new GbPoint3D(p6), new GbPoint3D(p7), new GbPoint3D(pOben)));
339 triangles.push_back(new GbTriangle3D(new GbPoint3D(p5), new GbPoint3D(pOben), new GbPoint3D(p8)));
340 triangles.push_back(new GbTriangle3D(new GbPoint3D(pOben), new GbPoint3D(p7), new GbPoint3D(p8)));
341 //"links"
342 triangles.push_back(new GbTriangle3D(new GbPoint3D(p4), new GbPoint3D(p1), new GbPoint3D(pLinks)));
343 triangles.push_back(new GbTriangle3D(new GbPoint3D(p4), new GbPoint3D(pLinks), new GbPoint3D(p8)));
344 triangles.push_back(new GbTriangle3D(new GbPoint3D(p8), new GbPoint3D(pLinks), new GbPoint3D(p5)));
345 triangles.push_back(new GbTriangle3D(new GbPoint3D(pLinks), new GbPoint3D(p1), new GbPoint3D(p5)));
346 //"rechts"
347 triangles.push_back(new GbTriangle3D(new GbPoint3D(p2), new GbPoint3D(p3), new GbPoint3D(pRechts)));
348 triangles.push_back(new GbTriangle3D(new GbPoint3D(pRechts), new GbPoint3D(p3), new GbPoint3D(p7)));
349 triangles.push_back(new GbTriangle3D(new GbPoint3D(p2), new GbPoint3D(pRechts), new GbPoint3D(p6)));
350 triangles.push_back(new GbTriangle3D(new GbPoint3D(pRechts), new GbPoint3D(p7), new GbPoint3D(p6)));
351 //"hinten"
352 triangles.push_back(new GbTriangle3D(new GbPoint3D(p3), new GbPoint3D(p4), new GbPoint3D(pHinten)));
353 triangles.push_back(new GbTriangle3D(new GbPoint3D(p3), new GbPoint3D(pHinten), new GbPoint3D(p7)));
354 triangles.push_back(new GbTriangle3D(new GbPoint3D(p7), new GbPoint3D(pHinten), new GbPoint3D(p8)));
355 triangles.push_back(new GbTriangle3D(new GbPoint3D(pHinten), new GbPoint3D(p4), new GbPoint3D(p8)));
356 //"vorne"
357 triangles.push_back(new GbTriangle3D(new GbPoint3D(p1), new GbPoint3D(p2), new GbPoint3D(pVorne)));
358 triangles.push_back(new GbTriangle3D(new GbPoint3D(pVorne), new GbPoint3D(p2), new GbPoint3D(p6)));
359 triangles.push_back(new GbTriangle3D(new GbPoint3D(p1), new GbPoint3D(pVorne), new GbPoint3D(p5)));
360 triangles.push_back(new GbTriangle3D(new GbPoint3D(pVorne), new GbPoint3D(p6), new GbPoint3D(p5)));
361 return triangles;
362}
363/*=======================================================*/
365{
366 /*0*/ nodes.push_back(makeUbTuple((float)getX1Minimum(), (float)getX2Minimum(), (float)getX3Minimum()));
367 /*1*/ nodes.push_back(makeUbTuple((float)getX1Maximum(), (float)getX2Minimum(), (float)getX3Minimum()));
368 /*2*/ nodes.push_back(makeUbTuple((float)getX1Maximum(), (float)getX2Maximum(), (float)getX3Minimum()));
369 /*3*/ nodes.push_back(makeUbTuple((float)getX1Minimum(), (float)getX2Maximum(), (float)getX3Minimum()));
370
371 /*4*/ nodes.push_back(makeUbTuple((float)getX1Minimum(), (float)getX2Minimum(), (float)getX3Maximum()));
372 /*5*/ nodes.push_back(makeUbTuple((float)getX1Maximum(), (float)getX2Minimum(), (float)getX3Maximum()));
373 /*6*/ nodes.push_back(makeUbTuple((float)getX1Maximum(), (float)getX2Maximum(), (float)getX3Maximum()));
374 /*7*/ nodes.push_back(makeUbTuple((float)getX1Minimum(), (float)getX2Maximum(), (float)getX3Maximum()));
375
376 //"unten"
377 triangles.push_back(makeUbTuple(0, 1, 2));
378 triangles.push_back(makeUbTuple(0, 2, 3));
379 //"oben"
380 triangles.push_back(makeUbTuple(4, 5, 6));
381 triangles.push_back(makeUbTuple(4, 6, 7));
382 //"links"
383 triangles.push_back(makeUbTuple(0, 3, 7));
384 triangles.push_back(makeUbTuple(0, 7, 4));
385 //"rechts"
386 triangles.push_back(makeUbTuple(1, 2, 6));
387 triangles.push_back(makeUbTuple(1, 6, 5));
388 //"hinten"
389 triangles.push_back(makeUbTuple(3, 2, 7));
390 triangles.push_back(makeUbTuple(2, 7, 6));
391 //"vorne"
392 triangles.push_back(makeUbTuple(0, 1, 5));
393 triangles.push_back(makeUbTuple(0, 5, 4));
394}
395/*=======================================================*/
397{
399 ss << "GbCuboid3D[";
400 ss << "p1=" << this->p1->toString();
401 ss << ", p2=" << this->p2->toString();
402 ss << "]";
403 return ss.str();
404}
405/*=======================================================*/
407{
408 throw UbException(UB_EXARGS, "not correct implemented");
409}
410/*=======================================================*/
417/*==========================================================*/
419{
420 GbPoint3D *point = dynamic_cast<GbPoint3D *>(changedObject);
421 if (!point || (this->p1 != point && this->p2 != point))
422 return;
423
425}
426/*==========================================================*/
428{
429 if (this->p1) {
430 UbObservable *observedObj = dynamic_cast<UbObservable *>(this->p1);
431 if (objectForDeletion == observedObj) {
432 this->p1 = NULL;
433 }
434 }
435 if (this->p2) {
436 UbObservable *observedObj = dynamic_cast<UbObservable *>(this->p2);
437 if (objectForDeletion == observedObj) {
438 this->p2 = NULL;
439 }
440 }
441 // ACHTUNG: eigentlich muessten in allen methoden von GbLine if abfragen fuer NULL pointer hin... toDo
442}
443/*=======================================================*/
444void GbCuboid3D::translate(const double &tx1, const double &tx2, const double &tx3)
445{
446 this->p1->translate(tx1, tx2, tx3);
447 this->p2->translate(tx1, tx2, tx3);
449}
450/*=======================================================*/
451void GbCuboid3D::scale(const double &sx1, const double &sx2, const double &sx3)
452{
453 double lenX1 = this->getLengthX1();
454 double lenX2 = this->getLengthX2();
455 double lenX3 = this->getLengthX3();
456
457 double deltaX1 = lenX1 * sx1 - lenX1;
458 double deltaX2 = lenX2 * sx2 - lenX2;
459 double deltaX3 = lenX3 * sx3 - lenX3;
460
461 double p1X1 = this->p1->getX1Coordinate();
462 double p1X2 = this->p1->getX2Coordinate();
463 double p1X3 = this->p1->getX3Coordinate();
464
465 double p2X1 = this->p2->getX1Coordinate();
466 double p2X2 = this->p2->getX2Coordinate();
467 double p2X3 = this->p2->getX3Coordinate();
468
469 this->p1->setCoordinates(p1X1 - 0.5 * deltaX1, p1X2 - 0.5 * deltaX2, p1X3 - 0.5 * deltaX3);
470
471 this->p2->setCoordinates(p2X1 + 0.5 * deltaX1, p2X2 + 0.5 * deltaX2, p2X3 + 0.5 * deltaX3);
472}
473/*==========================================================*/
474double GbCuboid3D::getCellVolumeInsideGbObject3D(const double &x1a, const double &x2a, const double &x3a,
475 const double &x1b, const double &x2b, const double &x3b)
476{
477 if (this->isCellInsideGbObject3D(x1a, x2a, x3a, x1b, x2b, x3b))
478 return 1.0 * (x1b - x1a) * (x2b - x2a) * (x3b - x3a);
479 if (!(this->isCellCuttingGbObject3D(x1a, x2a, x3a, x1b, x2b, x3b)))
480 return 0.0;
481
482 GbCuboid3D *cube = gb_system_3d::clipRectangle3D(*this->p1, *this->p2, x1a, x2a, x3a, x1b, x2b, x3b);
483
484 if (cube) {
485 double eps;
486 eps = (cube->getLengthX1()) * (cube->getLengthX2()) * (cube->getLengthX3());
487 cube->finalize();
488 delete cube;
489 return eps;
490 }
491 return 0.0;
492}
493/*==========================================================*/
494double GbCuboid3D::getIntersectionRaytraceFactor(const double &x1, const double &x2, const double &x3,
495 const double &rx1, const double &rx2, const double &rx3)
496{
497 double minB[3] = { this->getX1Minimum(), this->getX2Minimum(), this->getX3Minimum() };
498 double maxB[3] = { this->getX1Maximum(), this->getX2Maximum(), this->getX3Maximum() };
499 double origin[3] = { x1, x2, x3 }; // point
500 double dir[3] = { rx1, rx2, rx3 }; // ray
501
502 bool inside = true;
503 char quadrant[3];
504 int whichPlane;
505 double maxT[3];
506 double candidatePlane[3];
507
508 /* Find candidate planes; this loop can be avoided if
509 rays cast all from the eye(assume perpsective view) */
510 for (int i = 0; i < 3; i++) {
511 if (origin[i] < minB[i]) {
512 quadrant[i] = 1 /*LEFT*/;
514 inside = false;
515 } else if (origin[i] > maxB[i]) {
516 quadrant[i] = 0 /*RIGHT*/;
518 inside = false;
519 } else {
520 quadrant[i] = 2 /*MIDDLE*/;
521 }
522 }
523 /* Ray origin inside bounding box */
524 if (inside) {
525 // throw UbException(UB_EXARGS,"not done");
526 return 0.0;
527 }
528
529 /* Calculate T distances to candidate planes */
530 for (int i = 0; i < 3; i++) {
531 if (quadrant[i] != 2 /*MIDDLE*/ && fabs(dir[i]) > 1.E-10) {
532 maxT[i] = (candidatePlane[i] - origin[i]) / dir[i];
533 } else
534 maxT[i] = -1.0;
535 }
536
537 /* Get largest of the maxT's for final choice of intersection */
538 whichPlane = 0;
539 for (int i = 1; i < 3; i++)
540 if (maxT[whichPlane] < maxT[i])
541 whichPlane = i;
542
543 /* Check final candidate actually inside box */
544 if (maxT[whichPlane] < -1.E-10)
545 return -1.0;
546 double dummy;
547 for (int i = 0; i < 3; i++) {
548 if (whichPlane != i) {
549 dummy = origin[i] + maxT[whichPlane] * dir[i];
550 if (dummy < minB[i] || dummy > maxB[i])
551 return -1.0;
552 }
553 }
554
555 return maxT[whichPlane]; /* ray hits box */
556}
557
This Class provides basic 3D box objects.
Definition GbCuboid3D.h:53
GbPoint3D * p2
Definition GbCuboid3D.h:149
GbPoint3D * p1
Definition GbCuboid3D.h:148
GbPoint3D * getPoint1()
Definition GbCuboid3D.h:65
void setCenterCoordinates(const UbTupleDouble3 &) override
Definition GbCuboid3D.h:81
GbPoint3D * getPoint2()
Definition GbCuboid3D.h:66
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 x1
Definition GbPoint3D.h:121
double getX3Coordinate() const
Definition GbPoint3D.h:84
double x3
Definition GbPoint3D.h:123
GbPoint3D * clone() override
Definition GbPoint3D.h:56
void setCoordinates(const double &x1, const double &x2, const double &x3)
Definition GbPoint3D.h:59
double getX1Coordinate() const
Definition GbPoint3D.h:82
void finalize() override
Definition GbPoint3D.h:57
double getX2Coordinate() const
Definition GbPoint3D.h:83
double x2
Definition GbPoint3D.h:122
This Class provides basic 3D triangle objects.
void setName(std::string name)
Definition ObObject.h:52
Observable object.
virtual void removeObserver(UbObserver *observer)
virtual void addObserver(UbObserver *observer)
virtual void notifyObserversObjectChanged()
std::shared_ptr< T > SPtr
double getIntersectionRaytraceFactor(const double &x1, const double &x2, const double &x3, const double &rx1, const double &rx2, const double &rx3) override
void objectChanged(UbObservable *changedObject) override
double getX1Minimum() override
double getX3Centroid() override
void translate(const double &x1, const double &x2, const double &x3) override
double getX2Minimum() override
void scale(const double &sx1, const double &sx2, const double &sx3) override
void objectWillBeDeleted(UbObservable *objectForDeletion) override
void setPoint2(GbPoint3D *point2)
double getX2Centroid() override
bool isCellInsideOrCuttingGbObject3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b, const double &x2b, const double &x3b) override
double getCellVolumeInsideGbObject3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b, const double &x2b, const double &x3b) override
~GbCuboid3D() override
double getX2Maximum() override
bool isPointInGbObject3D(const double &x1p, const double &x2p, const double &x3p, bool &pointIsOnBoundary) override
double getX3Minimum() override
void addSurfaceTriangleSet(std::vector< UbTupleFloat3 > &nodes, std::vector< UbTupleInt3 > &triangles) override
bool isCellInsideGbObject3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b, const double &x2b, const double &x3b) override
GbPoint3D * calculateInterSectionPoint3D(GbPoint3D &point1, GbPoint3D &point2)
double getLengthX2()
double getX1Centroid() override
double getLengthX3()
void setPoint1(GbPoint3D *point1)
void translate(const double &x1, const double &x2, const double &x3) override
bool isCellCuttingGbObject3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b, const double &x2b, const double &x3b) override
double getLengthX1()
GbLine3D * createClippedLine3D(GbPoint3D &point1, GbPoint3D &point2) override
void finalize() override
std::string toString() override
std::string toString() override
double getX3Maximum() override
double getX1Maximum() override
void setPoints(GbPoint3D *point1, GbPoint3D *point2)
std::vector< GbTriangle3D * > getSurfaceTriangleSet() override
#define UB_EXARGS
Definition UbException.h:73
UbTuple< T1 > makeUbTuple(T1 const &a1)
Definition UbTuple.h:554
GbCuboid3D * clipRectangle3D(GbPoint3D &p1, GbPoint3D &p2, double x11, double x12, double x13, double x21, double x22, double x23)
GbLine3D * createClipLine3D(GbPoint3D &p1, GbPoint3D &p2, double x11, double x12, double x13, double x21, double x22, double x23)
bool lessEqual(const T1 &value, const T2 &reference)
Definition UbMath.h:209
bool equal(const T1 &value, const T2 &reference)
Definition UbMath.h:189
bool greater(const T1 &value, const T2 &reference)
Definition UbMath.h:216
bool less(const T1 &value, const T2 &reference)
Definition UbMath.h:202