Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYPolygon.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) <2012> <EDF-R&D> <FRANCE>
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 2 of the License, or
6  * (at your option) any later version.
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10  * See the GNU General Public License for more details.
11  * You should have received a copy of the GNU General Public License along
12  * with this program; if not, write to the Free Software Foundation, Inc.,
13  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
14  */
15 
16 #include <memory>
17 #include <vector>
18 
19 #include <boost/foreach.hpp>
20 
21 #include "Tympan/core/defines.h"
22 #include "Tympan/core/logging.h"
23 #include "Tympan/core/chrono.h"
27 #include "TYRectangle.h"
28 #include "TYGeometryNode.h"
29 #if TY_USE_IHM
33 #endif
34 #include "TYPolygon.h"
35 
36 #include <math.h>
37 
40 
42 {
44 
45  _bConvex = false;
46 }
47 
49 {
50  *this = other;
51 }
52 
54 {
56 
57  _bConvex = false;
58  setPoints(pts);
59 }
60 
62 {
63  _pts.clear();
64 }
65 
67 {
68  if (this != &other)
69  {
70  TYElement::operator=(other);
71  _pts = other._pts;
72  _bConvex = other._bConvex;
73  _plan = other._plan;
74  _box = other._box;
75  }
76  return *this;
77 }
78 
79 bool TYPolygon::operator==(const TYPolygon& other) const
80 {
81  if (this != &other)
82  {
83  if (TYElement::operator!=(other))
84  {
85  return false;
86  }
87  if (_pts != other._pts)
88  {
89  return false;
90  }
91  if (_bConvex != other._bConvex)
92  {
93  return false;
94  }
95  if (_plan != other._plan)
96  {
97  return false;
98  }
99  if (_box != other._box)
100  {
101  return false;
102  }
103  }
104  return true;
105 }
106 
107 bool TYPolygon::operator!=(const TYPolygon& other) const
108 {
109  return !operator==(other);
110 }
111 
112 bool TYPolygon::deepCopy(const TYElement* pOther, bool copyId /*=true*/, bool pUseCopyTag /*=false*/)
113 {
114  if (!TYElement::deepCopy(pOther, copyId))
115  {
116  return false;
117  }
118 
119  TYPolygon* pOtherPoly = (TYPolygon*)pOther;
120 
121  _pts.clear();
122 
123  for (int i = 0; i < pOtherPoly->getNbPts(); i++)
124  {
125  TYPoint pt;
126  pt.deepCopy(&pOtherPoly->getPoints()[i], copyId);
127  _pts.push_back(pt);
128  }
129 
130  _bConvex = pOtherPoly->_bConvex;
131  _plan = pOtherPoly->_plan;
132  _box = pOtherPoly->_box;
133 
134  return true;
135 }
136 
137 std::string TYPolygon::toString() const
138 {
139  std::string str = "TYPolygon";
140  for (int i = 0; i < getNbPts(); i++)
141  {
142  str += "\n\tPt" + intToStr(i) + "=" + _pts[i].toString();
143  }
144  return str;
145 }
146 
148 {
149  DOM_Element domNewElem = TYElement::toXML(domElement);
150 
151  for (int i = 0; i < getNbPts(); i++)
152  {
153  _pts[i].toXML(domNewElem);
154  }
155 
156  return domNewElem;
157 }
158 
160 {
161  TYElement::fromXML(domElement);
162 
163  purge();
164 
165  TYPoint pt;
166  DOM_Element elemCur;
167 
168  QDomNodeList childs = domElement.childNodes();
169 
170  for (unsigned int i = 0; i < childs.length(); i++)
171  {
172  elemCur = childs.item(i).toElement();
173 
174  if (pt.callFromXMLIfEqual(elemCur))
175  {
176  _pts.push_back(pt);
177  }
178  }
179 
180  updateNormal();
181  updateBox();
182 
183  return 1;
184 }
185 
186 double TYPolygon::surface() const
187 {
188  double res = 0.0;
189 
190 #if TY_USE_IHM
191  TYTabPoint tabPt = getContour();
192  size_t nbPts = tabPt.size();
193 
194  if (nbPts >= 3)
195  {
196  ODelaunayMaker oDelaunayMaker(0.001);
197  for (int i = 0; i < nbPts; i++)
198  {
199  OPoint3D oVertex(tabPt[i]._x, tabPt[i]._y, 0);
200  oDelaunayMaker.addVertex(oVertex);
201  }
202 
203  oDelaunayMaker.compute();
204  QList<OPoint3D> vertexes = oDelaunayMaker.getVertex();
205  QList<OTriangle> faces = oDelaunayMaker.getFaces();
206 
207  QListIterator<OTriangle> it(faces);
208  while (it.hasNext())
209  {
210  OTriangle face = it.next();
211  double P = 0;
212  double a = 0; // cote AB
213  double b = 0; // cote BC
214  double c = 0; // cote CA
215  double Xa = vertexes[face._p1]._x;
216  double Xb = vertexes[face._p2]._x;
217  double Xc = vertexes[face._p3]._x;
218  double Ya = vertexes[face._p1]._y;
219  double Yb = vertexes[face._p2]._y;
220  double Yc = vertexes[face._p3]._y;
221 
222  // calcule des longueurs des cotes du triangle
223  a = sqrt((Xa - Xb) * (Xa - Xb) + (Ya - Yb) * (Ya - Yb));
224  b = sqrt((Xb - Xc) * (Xb - Xc) + (Yb - Yc) * (Yb - Yc));
225  c = sqrt((Xc - Xa) * (Xc - Xa) + (Yc - Ya) * (Yc - Ya));
226 
227  // formule de Heron
228  P = a + b + c;
229  P = (P / 2);
230  res += sqrt(P * (P - a) * (P - b) * (P - c));
231  }
232  }
233  else
234 #endif // TY_USE_IHM
235  {
236  // Calcul du volume du bounding rect
237  res = getBoundingRect().surface();
238  }
239 
240  return res;
241 }
242 
244 {
245  return OVector3D(_plan._a, _plan._b, _plan._c);
246 }
247 
249 {
250  return _plan;
251 }
252 
254 {
255  return getPoints();
256 }
257 
259 {
260  TYTabPoint3D pts;
261  const TYTabPoint& tabPts = getPoints();
262 
263  for (unsigned int i = 0; i < tabPts.size(); i++)
264  {
265  pts.push_back(tabPts[i]);
266  }
267 
268  return pts;
269 }
270 
272 {
273  return TYSurfaceInterface::intersects(pSurf, seg);
274 }
275 
276 int TYPolygon::intersects(const OSegment3D& seg, OPoint3D& pt) const
277 {
278  return intersects(seg, pt, true);
279 }
280 
281 int TYPolygon::intersects(const OSegment3D& seg, OPoint3D& pt, bool insideTest) const
282 {
283  int res = INTERS_NULLE;
284 
285  // Minimum 3 points
286  if (getNbPts() < 3)
287  {
288  return res;
289  }
290 
291  // On cherche le pt d'intersection avec le plan
292  res = _plan.intersectsSegment(seg._ptA, seg._ptB, pt);
293 
294  if ((insideTest) && (res == INTERS_OUI))
295  {
296  // Il faut ensuite tester si le point d'intersection trouve
297  // est inclu dans le polygone
298  res = intersects(pt);
299  }
300 
301  return res;
302 }
303 
304 int TYPolygon::intersects(const OPoint3D& pt) const
305 {
306  int res = INTERS_NULLE;
307  // Nb de points constituant le polygon
308  int nbPts = static_cast<int>(getNbPts());
309 
310  // Minimum 3 points !
311  if (nbPts < 3)
312  {
313  return res;
314  }
315 
316  if (_box.isInside(pt) == false)
317  {
318  return res;
319  }
320 
321  if (isConvex() == true)
322  {
323  OVector3D normale = normal();
324 
325  int max_axe = 0;
326  double max_normal = normale[0];
327 
328  if (max_normal < normale[1])
329  {
330  max_axe = 1;
331  max_normal = normale[1];
332  }
333 
334  if (max_normal < normale[2])
335  {
336  max_axe = 2;
337  }
338  switch (max_axe)
339  {
340  case 0:
341  if (isInpolyYZ(_pts, nbPts, pt[1], pt[2]))
342  {
343  res = INTERS_OUI;
344  }
345  break;
346  case 1:
347  if (isInpolyXZ(_pts, nbPts, pt[0], pt[2]))
348  {
349  res = INTERS_OUI;
350  }
351  break;
352  case 2:
353  if (isInpolyXY(_pts, nbPts, pt[0], pt[1]))
354  {
355  res = INTERS_OUI;
356  }
357  break;
358  }
359  }
360  else
361  {
362  // Tableau de OPoint3D (taille memoire differente de TYPoint)
363  OPoint3D* pts = new OPoint3D[nbPts];
364 
365  for (int i = 0; i < nbPts; i++)
366  {
367  pts[i] = _pts[i];
368  }
369 
370  bool result = false;
371 
372 #if TY_USE_IHM
373  result = OGeometrie::pointInPolygonRayCasting(pt, pts, nbPts);
374 #else
375  result = OGeometrie::pointInPolygonAngleSum(pt, pts, nbPts);
376 #endif
377 
378  if (result)
379  {
380  res = INTERS_OUI;
381  }
382  // Cleanning !
383  delete[] pts;
384  }
385 
386  return res;
387 }
388 
390 {
391  _pts = pts;
392  // assert(checkCoplanar());
393  _bConvex = false;
394  updateNormal();
395  updateBox();
396  setIsGeometryModified(true);
397 }
398 
400 {
401  size_t nbPts = _pts.size();
402  if (nbPts < 3)
403  {
404  return true;
405  }
406  OPlan plan(_pts[0], _pts[1], _pts[2]);
407  for (size_t i = 3; i < nbPts; ++i)
408  {
409  if (!plan.isInPlan(_pts[i]))
410  {
411  return false;
412  }
413  }
414  return true;
415 }
416 
417 void TYPolygon::transform(const OMatrix& matrix)
418 {
419  for (int j = 0; j < this->getNbPts(); j++)
420  {
421  this->_pts[j] = matrix * this->_pts[j];
422  }
423  updateNormal();
424  updateBox();
425 }
426 
427 bool TYPolygon::isValid() const
428 {
429  printf("TYPolygon::isValid non implemente.\n");
430  return false;
431 }
432 
434 {
435  ORepere3D res;
436 
437  // Minimum 3 points
438  if (getNbPts() < 3)
439  {
440  return res;
441  }
442 
443  res._origin = _pts[0];
444 
445  res._vecI = OVector3D(_pts[0], _pts[1]);
446  res._vecI.normalize();
447 
448  res._vecK = normal();
449  res._vecK.normalize();
450 
451  res._vecJ = res._vecI.cross(res._vecK);
452  res._vecJ.normalize();
453 
454  return res;
455 }
456 
458 {
459  TYRectangle BoundingRect;
460  int i = 0;
461 
462  size_t nbPts = getNbPts();
463 
464  if (nbPts <= 0)
465  {
466  return BoundingRect;
467  }
468 
469  // Changement de repere
470  OMatrix matrix;
471 
472  matrix = getORepere3D().asMatrix();
473  matrix.invert();
474 
475  // Init
476  TYPoint pt;
477  TYPoint ptMax, ptMin;
478  ptMax = ptMin = matrix * _pts[0];
479 
480  for (i = 0; i < nbPts; i++)
481  {
482  // Changement de repere
483  pt = matrix * _pts[i];
484 
485  // On test uniquement x et y car on s'est ramene au plan
486  // defini par le polygon
487 
488  // Minimuns
489  if (pt._x <= ptMin._x)
490  {
491  ptMin._x = pt._x;
492  }
493  if (pt._y <= ptMin._y)
494  {
495  ptMin._y = pt._y;
496  }
497  // Maximums
498  if (pt._x >= ptMax._x)
499  {
500  ptMax._x = pt._x;
501  }
502  if (pt._y >= ptMax._y)
503  {
504  ptMax._y = pt._y;
505  }
506  }
507 
508  // Construction du rectangle
509  BoundingRect = TYRectangle(TYPoint(ptMin._x, ptMax._y, 0), TYPoint(ptMax._x, ptMax._y, 0),
510  TYPoint(ptMax._x, ptMin._y, 0), TYPoint(ptMin._x, ptMin._y, 0));
511 
512  // Changement de repere inverse
513  matrix.invert();
514 
515  for (i = 0; i < 4; i++)
516  {
517  BoundingRect._pts[i] = matrix * BoundingRect._pts[i];
518  }
519 
520  return BoundingRect;
521 }
522 
524 {
525  int nbpoints = static_cast<int>(getNbPts());
526 
527  // Minimum 3 points
528  if (nbpoints >= 3)
529  {
530  OVector3D normale;
531  OPoint3D* pts = new OPoint3D[nbpoints];
532 
533  for (int i = 0; i < nbpoints; i++)
534  {
535  pts[i] = _pts[i];
536  }
537 
538  OGeometrie::computeNormal(pts, nbpoints, normale);
539 
540  _plan.set(_pts[0], normale);
541 
542  delete[] pts;
543  }
544  else
545  {
546  _plan = OPlan(0, 0, 0, 0);
547  }
548 }
549 
551 {
552  int nbPts = static_cast<int>(getNbPts());
553 
554  if (nbPts > 0)
555  {
556  OPoint3D* pts = new OPoint3D[nbPts];
557 
558  for (int i = 0; i < nbPts; i++)
559  {
560  pts[i] = _pts[i];
561  }
562 
563  OPoint3D ptMin, ptMax;
564 
565  OGeometrie::boundingBox(pts, nbPts, ptMin, ptMax);
566 
567  _box = OBox(ptMin, ptMax);
568 
569  delete[] pts;
570  }
571  else
572  {
573  _box = OBox(OPoint3D(0, 0, 0), OPoint3D(0, 0, 0));
574  }
575 }
576 
577 int TYPolygon::isInpolyXY(const TYTabPoint& poly, int npoints, double xt, double yt) const
578 {
579  double xnew = NAN, ynew = NAN;
580  double xold = NAN, yold = NAN;
581  double x1 = NAN, y1 = NAN;
582  double x2 = NAN, y2 = NAN;
583  int i = 0;
584  int inside = 0;
585 
586  if (npoints < 3)
587  {
588  return (0);
589  }
590 
591  xold = poly[npoints - 1][0];
592  yold = poly[npoints - 1][1];
593 
594  for (i = 0; i < npoints; i++)
595  {
596  xnew = poly[i][0];
597  ynew = poly[i][1];
598 
599  if (xnew > xold)
600  {
601  x1 = xold;
602  x2 = xnew;
603  y1 = yold;
604  y2 = ynew;
605  }
606  else
607  {
608  x1 = xnew;
609  x2 = xold;
610  y1 = ynew;
611  y2 = yold;
612  }
613 
614  if ((xnew < xt) == (xt <= xold) && (yt - y1) * (x2 - x1) < (y2 - y1) * (xt - x1))
615  {
616 
617  inside = !inside;
618  }
619 
620  xold = xnew;
621  yold = ynew;
622  }
623 
624  return (inside);
625 }
626 
627 int TYPolygon::isInpolyXZ(const TYTabPoint& poly, int npoints, double xt, double yt) const
628 {
629  double xnew = NAN, ynew = NAN;
630  double xold = NAN, yold = NAN;
631  double x1 = NAN, y1 = NAN;
632  double x2 = NAN, y2 = NAN;
633  int i = 0;
634  int inside = 0;
635 
636  if (npoints < 3)
637  {
638  return (0);
639  }
640 
641  xold = poly[npoints - 1][0];
642  yold = poly[npoints - 1][2];
643 
644  for (i = 0; i < npoints; i++)
645  {
646  xnew = poly[i][0];
647  ynew = poly[i][2];
648 
649  if (xnew > xold)
650  {
651  x1 = xold;
652  x2 = xnew;
653  y1 = yold;
654  y2 = ynew;
655  }
656  else
657  {
658  x1 = xnew;
659  x2 = xold;
660  y1 = ynew;
661  y2 = yold;
662  }
663 
664  if ((xnew < xt) == (xt <= xold) && (yt - y1) * (x2 - x1) < (y2 - y1) * (xt - x1))
665  {
666 
667  inside = !inside;
668  }
669 
670  xold = xnew;
671  yold = ynew;
672  }
673 
674  return (inside);
675 }
676 
677 int TYPolygon::isInpolyYZ(const TYTabPoint& poly, int npoints, double xt, double yt) const
678 {
679  double xnew = NAN, ynew = NAN;
680  double xold = NAN, yold = NAN;
681  double x1 = NAN, y1 = NAN;
682  double x2 = NAN, y2 = NAN;
683  int i = 0;
684  int inside = 0;
685 
686  if (npoints < 3)
687  {
688  return (0);
689  }
690 
691  xold = poly[npoints - 1][1];
692  yold = poly[npoints - 1][2];
693 
694  for (i = 0; i < npoints; i++)
695  {
696  xnew = poly[i][1];
697  ynew = poly[i][2];
698 
699  if (xnew > xold)
700  {
701  x1 = xold;
702  x2 = xnew;
703  y1 = yold;
704  y2 = ynew;
705  }
706  else
707  {
708  x1 = xnew;
709  x2 = xold;
710  y1 = ynew;
711  y2 = yold;
712  }
713 
714  if ((xnew < xt) == (xt <= xold) && (yt - y1) * (x2 - x1) < (y2 - y1) * (xt - x1))
715  {
716 
717  inside = !inside;
718  }
719 
720  xold = xnew;
721  yold = ynew;
722  }
723 
724  return (inside);
725 }
726 
728 {
729  TYTabPoint tabPtsTemp = _pts;
730  _pts.clear();
731  std::vector<TYPoint>::reverse_iterator it;
732  for (it = tabPtsTemp.rbegin(); it != tabPtsTemp.rend(); it++)
733  {
734  _pts.push_back((*it));
735  }
736 
737  // Actualisation de la normale
738  updateNormal();
739 }
740 
741 void TYPolygon::exportMesh(std::deque<OPoint3D>& points, std::deque<OTriangle>& triangles,
742  const TYGeometryNode& geonode) const
743 {
744  using namespace tympan;
745 
746  // Convert Polygon into global frame
747  TYPolygon gpoly(*this);
748  BOOST_FOREACH (auto& pt, gpoly._pts)
749  pt = geonode.localToGlobal() * pt;
750 
751  auto triangulator = make_polygon_triangulator(gpoly);
752  triangulator->exportMesh(points, triangles);
753 }
All base classes related to 3D manipulation.
#define INTERS_OUI
The intersection exists.
Definition: 3d.h:33
#define INTERS_NULLE
No intersection.
Definition: 3d.h:35
NxReal c
Definition: NxVec3.cpp:317
QDomElement DOM_Element
Definition: QT2DOM.h:30
std::vector< TYPoint > TYTabPoint
Collection de TYPoint.
Definition: TYDefines.h:340
std::deque< OPoint3D > TYTabPoint3D
Collection de OPoint3D.
Definition: TYDefines.h:403
Representation graphique d'un polygone (fichier header)
outil IHM pour un polygone (fichier header)
TY_EXT_GRAPHIC_INST(TYPolygon)
TY_EXTENSION_INST(TYPolygon)
Bridges TY* types with CGAL functionalities exposed by.
The box class.
Definition: 3d.h:1294
virtual bool isInside(const OPoint3D &pt) const
Test whether the point is inside the box or not.
Definition: 3d.cpp:1535
double _y
y coordinate of OCoord3D
Definition: 3d.h:283
double _x
x coordinate of OCoord3D
Definition: 3d.h:282
Delaunay triangulation.
bool compute(void)
Compute the triangulation.
QList< OTriangle > getFaces(void)
Return faces list.
QList< OPoint3D > getVertex(void)
Return the vertexes list.
void addVertex(OPoint3D vertex)
Add a vertex.
static void boundingBox(OPoint3D *pts, int nbPts, OPoint3D &ptMin, OPoint3D &ptMax)
Computes the simple bounding box for a volume using min-max method.
Definition: 3d.cpp:1109
static void computeNormal(OPoint3D *pts, int nbPts, OVector3D &normal)
Computes the normal of the list of points.
Definition: 3d.cpp:1147
static bool pointInPolygonAngleSum(const OPoint3D &ptP, const OPoint3D *pts, int nbPts)
Tests if a point is inside a polygon using angle sum algorithm.
Definition: 3d.cpp:1016
static bool pointInPolygonRayCasting(const OPoint3D &ptP, const OPoint3D *pts, int nbPts)
Tests if a point is inside a polygon using ray casting algorithm.
Definition: 3d.cpp:1046
The 4x4 matrix class.
Definition: 3d.h:625
int invert()
Matrix inversion.
Definition: 3d.cpp:792
Plan defined by its equation : ax+by+cz+d=0.
Definition: plan.h:31
int intersectsSegment(const OPoint3D &pt1, const OPoint3D &pt2, OPoint3D &ptIntersec) const
Calculate the intersection of this plane with a segment defined by two points.
Definition: plan.cpp:141
double _a
The a parameter in the equation ax+by+cz+d=0.
Definition: plan.h:325
double _c
The c parameter in the equation ax+by+cz+d=0.
Definition: plan.h:329
bool isInPlan(const OPoint3D &pt)
Check if a point belongs to a plane.
Definition: plan.cpp:235
double _b
The b parameter in the equation ax+by+cz+d=0.
Definition: plan.h:327
void set(double a, double b, double c, double d)
Sets a, b, c and d parameters directly.
Definition: plan.cpp:94
The 3D point class.
Definition: 3d.h:487
virtual const char * getClassName() const
Definition: TYElement.h:249
3D frame with a point and 3 vectors.
Definition: 3d.h:1211
OVector3D _vecK
Vector K for the Z axis.
Definition: 3d.h:1285
OVector3D _vecJ
Vector J for the Y axis.
Definition: 3d.h:1283
OVector3D _vecI
Vector I for the X axis.
Definition: 3d.h:1281
OPoint3D _origin
The origin point.
Definition: 3d.h:1279
OMatrix asMatrix() const
return the transformation matrix from unity to this pose such as this = transform * unity
Definition: 3d.cpp:1462
Class to define a segment.
Definition: 3d.h:1089
OPoint3D _ptA
Point A of the segment.
Definition: 3d.h:1201
OPoint3D _ptB
Point B of the segment.
Definition: 3d.h:1203
Triangle class.
Definition: triangle.h:28
int _p1
Index of the first OPoint3D _A.
Definition: triangle.h:49
int _p3
Index of the third OPoint3D _C.
Definition: triangle.h:51
int _p2
Index of the second OPoint3D _B.
Definition: triangle.h:50
The 3D vector class.
Definition: 3d.h:298
void normalize()
Normalizes this vector.
Definition: 3d.cpp:225
OVector3D cross(const OVector3D &vector) const
Cross product.
Definition: 3d.cpp:196
virtual bool deepCopy(const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false)
Definition: TYElement.cpp:307
virtual DOM_Element toXML(DOM_Element &domElement)
Definition: TYElement.cpp:368
QString _name
Nom courant de l'element.
Definition: TYElement.h:966
TYElement & operator=(const TYElement &other)
Definition: TYElement.cpp:265
bool callFromXMLIfEqual(DOM_Element &domElement, int *pRetVal=NULL)
Definition: TYElement.cpp:544
virtual int fromXML(DOM_Element domElement)
Definition: TYElement.cpp:381
virtual void setIsGeometryModified(bool isModified)
Definition: TYElement.cpp:253
OMatrix localToGlobal() const
QString generateName(const char *classname)
Retourne le nom de la classe associe a un nombre.
static TYNameManager * get()
Retourne l'instance singleton.
virtual bool deepCopy(const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false)
Definition: TYPoint.cpp:92
const TYTabPoint & getPoints() const
Definition: TYPolygon.h:123
TYRectangle getBoundingRect() const
Definition: TYPolygon.cpp:457
void exportMesh(std::deque< OPoint3D > &points, std::deque< OTriangle > &triangles, const TYGeometryNode &geonode) const
Export the surface as a triangular mesh.
Definition: TYPolygon.cpp:741
size_t getNbPts() const
Definition: TYPolygon.h:107
bool _bConvex
Definition: TYPolygon.h:239
virtual void inverseNormale()
Definition: TYPolygon.cpp:727
bool operator!=(const TYPolygon &other) const
Operateur !=.
Definition: TYPolygon.cpp:107
virtual OVector3D normal() const
Definition: TYPolygon.cpp:243
bool checkCoplanar() const
Definition: TYPolygon.cpp:399
ORepere3D getORepere3D() const
Definition: TYPolygon.cpp:433
int isInpolyYZ(const TYTabPoint &poly, int npoints, double xt, double yt) const
Definition: TYPolygon.cpp:677
virtual bool deepCopy(const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false)
Definition: TYPolygon.cpp:112
void updateNormal()
Definition: TYPolygon.cpp:523
int isInpolyXY(const TYTabPoint &poly, int npoints, double xt, double yt) const
Definition: TYPolygon.cpp:577
virtual int intersects(const TYSurfaceInterface *pSurf, OSegment3D &seg) const
Definition: TYPolygon.cpp:271
void transform(const OMatrix &matrix)
Definition: TYPolygon.cpp:417
virtual TYTabPoint3D getOContour(int n=-1) const
Definition: TYPolygon.cpp:258
void updateBox()
Definition: TYPolygon.cpp:550
virtual ~TYPolygon()
Definition: TYPolygon.cpp:61
bool isConvex() const
Definition: TYPolygon.h:152
virtual TYTabPoint getContour(int n=-1) const
Definition: TYPolygon.cpp:253
OPlan _plan
Definition: TYPolygon.h:235
virtual std::string toString() const
Definition: TYPolygon.cpp:137
virtual int fromXML(DOM_Element domElement)
Definition: TYPolygon.cpp:159
virtual DOM_Element toXML(DOM_Element &domElement)
Definition: TYPolygon.cpp:147
TYTabPoint _pts
Sommets.
Definition: TYPolygon.h:233
TYPolygon & operator=(const TYPolygon &other)
Operateur =.
Definition: TYPolygon.cpp:66
void purge()
Definition: TYPolygon.h:95
void setPoints(const TYTabPoint &pts)
Definition: TYPolygon.cpp:389
virtual OPlan plan() const
Definition: TYPolygon.cpp:248
int isInpolyXZ(const TYTabPoint &poly, int npoints, double xt, double yt) const
Definition: TYPolygon.cpp:627
virtual double surface() const
Definition: TYPolygon.cpp:186
bool operator==(const TYPolygon &other) const
Operateur ==.
Definition: TYPolygon.cpp:79
bool isValid() const
Definition: TYPolygon.cpp:427
OBox _box
Definition: TYPolygon.h:237
TYPoint _pts[4]
Sommets.
Definition: TYRectangle.h:274
virtual double surface() const
virtual int intersects(const OPoint3D &pt) const =0
std::string intToStr(int val)
Definition: macros.h:158
std::unique_ptr< ITYPolygonTriangulator > make_polygon_triangulator(const TYPolygon &poly)
Definition: cgal_bridge.cpp:96