40 float r = 206.0f, g = 206.0f, b = 206.0f;
122 if (TYAcousticFaceSet::operator!=(other))
187 DOM_Element domSquelElem = domDoc.createElement(
"squelette");
191 for (
size_t i = 0; i < nbPts; i++)
194 pt.
toXML(domSquelElem);
197 domNewElem.appendChild(domSquelElem);
209 float height = NAN, width = NAN;
210 bool hauteurOk =
false;
211 bool epaisseurOk =
false;
215 QDomNodeList childs = domElement.childNodes();
216 for (
unsigned int i = 0; i < childs.length(); i++)
218 elemCur = childs.item(i).toElement();
223 if (elemCur.nodeName() ==
"squelette")
227 QDomNodeList childs2 = elemCur.childNodes();
228 for (
unsigned int j = 0; j < childs2.length(); j++)
230 elemCur2 = childs2.item(j).toElement();
272 size_t nbPts = edges.size();
281 for (
size_t i = 0; i < nbPts; i++)
285 if (pt.
_z < centre.
_z)
302 for (
unsigned int i = 0; i < tabFaces.size(); i++)
304 TYTabPoint tabPts = tabFaces[i]->getContour();
305 for (
unsigned j = 0; j < tabPts.size(); j++)
307 minZ = tabPts[j]._z < minZ ? tabPts[j]._z : minZ;
312 std::vector<unsigned int> listIndices;
314 for (
unsigned int i = 0; i < tabFaces.size(); i++)
316 TYTabPoint tabPts = tabFaces[i]->getContour();
318 for (
unsigned j = 0; j < tabPts.size(); j++)
320 if (tabPts[j]._z != minZ)
330 listIndices.push_back(i);
336 for (
unsigned int i = 0; i < listIndices.size(); i++)
338 ret.push_back(tabFaces[listIndices[i]]);
355 if (epaisseur > 0.0f)
392 vertices.push_back(s0);
393 vertices.push_back(s1);
394 vertices.push_back(s2);
395 vertices.push_back(s3);
408 size_t count = tabPts.size();
411 if ((count < 2) || (hauteur <= 0.0) || (epaisseur <= 0.0))
434 vecN = vec01.
cross(zvec);
436 s0 = pt0 + (epaisseur / 2.0f) * vecN;
437 s1 = pt0 - (epaisseur / 2.0f) * vecN;
438 s2 = s0 + hauteur * zvec;
439 s3 = s1 + hauteur * zvec;
442 pFace =
newFace(s0, s2, s3, s1);
445 faces.push_back(pFace);
459 for (
size_t i = 1; i < count - 1; i++)
471 vecN = vec01.
cross(zvec);
474 a1 = pt0 + (epaisseur / 2.0f) * vecN;
475 b1 = pt1 + (epaisseur / 2.0f) * vecN;
476 c1 = pt0 - (epaisseur / 2.0f) * vecN;
477 d1 = pt1 - (epaisseur / 2.0f) * vecN;
479 vecN = vec02.
cross(zvec);
482 a2 = pt1 + (epaisseur / 2.0f) * vecN;
483 b2 = pt2 + (epaisseur / 2.0f) * vecN;
484 c2 = pt1 - (epaisseur / 2.0f) * vecN;
485 d2 = pt2 - (epaisseur / 2.0f) * vecN;
500 s2 = s0 + hauteur * zvec;
501 s3 = s1 + hauteur * zvec;
504 pFace =
newFace(s0, ls0, ls1, s1);
507 faces.push_back(pFace);
511 pFace =
newFace(s1, ls1, ls3, s3);
514 faces.push_back(pFace);
518 pFace =
newFace(s3, ls3, ls2, s2);
521 faces.push_back(pFace);
525 pFace =
newFace(ls0, s0, s2, ls2);
528 faces.push_back(pFace);
539 pt0 = tabPts[count - 2];
540 pt1 = tabPts[count - 1];
546 vecN = vec02.
cross(zvec);
548 s0 = pt1 + (epaisseur / 2.0f) * vecN;
549 s1 = pt1 - (epaisseur / 2.0f) * vecN;
550 s2 = s0 + hauteur * zvec;
551 s3 = s1 + hauteur * zvec;
554 pFace =
newFace(s0, ls0, ls1, s1);
557 faces.push_back(pFace);
561 pFace =
newFace(s1, ls1, ls3, s3);
564 faces.push_back(pFace);
568 pFace =
newFace(s3, ls3, ls2, s2);
571 faces.push_back(pFace);
575 pFace =
newFace(ls0, s0, s2, ls2);
578 faces.push_back(pFace);
582 pFace =
newFace(s0, s1, s3, s2);
585 faces.push_back(pFace);
618 for (
size_t i = 0; i < nbFaces; i++)
646 double minZ = 0.0, maxZ = 0.0;
649 for (
unsigned int i = 0; i < tabFaces.size(); i++)
651 TYTabPoint tabPts = tabFaces[i]->getContour();
652 size_t nbPts = tabPts.size();
657 if ((pt.
_z < minZ) || (pt.
_z > maxZ))
671 for (
size_t i = 0; i < nbPts; i++)
686 OBox box(ptMin, ptMax);
All base classes related to 3D manipulation.
#define INTERS_NULLE
No intersection.
QDomDocument DOM_Document
TYGeometryNode TYAcousticSurfaceGeoNode
Noeud geometrique de type TYAcousticSurface.
std::vector< LPTYAcousticSurfaceGeoNode > TYTabAcousticSurfaceGeoNode
Collection de noeuds geometriques de type TYAcousticSurface.
std::vector< TYPoint > TYTabPoint
Collection de TYPoint.
std::vector< LPTYPolygon > TYTabLPPolygon
Collection de pointeurs de TYPolygon.
Representation graphique d'un ecran (fichier header)
TY_EXT_GRAPHIC_INST(TYEcran)
TY_EXTENSION_INST(TYEcran)
std::vector< LPTYElement > LPTYElementArray
#define TYDIRPREFERENCEMANAGER
double _z
z coordinate of OCoord3D
static void boundingBox(OPoint3D *pts, int nbPts, OPoint3D &ptMin, OPoint3D &ptMax)
Computes the simple bounding box for a volume using min-max method.
static bool pointInPolygonAngleSum(const OPoint3D &ptP, const OPoint3D *pts, int nbPts)
Tests if a point is inside a polygon using angle sum algorithm.
static bool pointInPolygonRayCasting(const OPoint3D &ptP, const OPoint3D *pts, int nbPts)
Tests if a point is inside a polygon using ray casting algorithm.
static int intersDroitesPoints(const OPoint3D &ptA, const OPoint3D &ptB, const OPoint3D &ptC, const OPoint3D &ptD, OPoint3D &ptI)
Calculate the intersection between two lines each defined by two points.
virtual const char * getClassName() const
Class to define a segment.
void normalize()
Normalizes this vector.
OVector3D cross(const OVector3D &vector) const
Cross product.
virtual int intersects(const OSegment3D &seg, TYTabPoint &ptList) const
virtual int fromXML(DOM_Element domElement)
virtual TYBox volEnglob() const
virtual bool deepCopy(const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false)
virtual DOM_Element toXML(DOM_Element &domElement)
virtual void getChilds(LPTYElementArray &childs, bool recursif=true)
TYAcousticFaceSet & operator=(const TYAcousticFaceSet &other)
Operateur =.
virtual TYTabPoint sommets() const
virtual TYPoint centreGravite() const
virtual TYTabLPPolygon faces() const
TYFaceSet _faces
Ensemble des faces.
virtual LPTYPolygon getPolygon()
int isInside(const TYPoint &pt) const
virtual void setColor(const OColor &color)
void setEpaisseur(double epaisseur)
void setacousticFacesPourCalcul(bool bPourCalculTrajet)
bool _bHauteurModified
la hauteur a ete modifiee
TYTabPoint getContour() const
double getHauteur() const
TYPolygon * newFace(OVector3D s0, OVector3D s1, OVector3D s2, OVector3D s3)
virtual TYTabAcousticSurfaceGeoNode acousticFaces()
virtual DOM_Element toXML(DOM_Element &domElement)
virtual std::string toString() const
bool operator==(const TYEcran &other) const
double _hauteur
hauteur de l'ecran
TYTabLPPolygon getContours() const
bool setElements(TYTabPoint tabPts, double hauteur=2.0, double epaisseur=0.5)
TYEcran & operator=(const TYEcran &other)
virtual void getChilds(LPTYElementArray &childs, bool recursif=true)
bool operator!=(const TYEcran &other) const
double getEpaisseur() const
bool _bEpaisseurModified
l'epaisseur a ete modifiee
virtual int fromXML(DOM_Element domElement)
double _epaisseur
epaisseur de l'ecran
virtual int isInside(const TYPoint &pt) const
virtual int intersects(const OSegment3D &seg, TYTabPoint &ptList) const
void setHauteur(double hauteur)
virtual bool deepCopy(const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false)
QString _name
Nom courant de l'element.
bool callFromXMLIfEqual(DOM_Element &domElement, int *pRetVal=NULL)
void setParent(TYElement *pParent)
void setFaces(const TYTabLPPolygon &faces)
size_t getNbFaces() const
virtual TYTabLPPolygon faces() const
QString generateName(const char *classname)
Retourne le nom de la classe associe a un nombre.
static TYNameManager * get()
Retourne l'instance singleton.
virtual DOM_Element toXML(DOM_Element &domElement)
void setPoints(const TYTabPoint &pts)
void calculRayonSphere(const TYBox &volEnglob)
virtual void calculCentreGravite()