36 float r = 255.0f, g = 67.0f, b = 133.0f;
77 if (TYAcousticSurface::operator!=(other))
97 return "TYAcousticCircle";
137 nbSrcsAngulaire < 2 ? 2 : nbSrcsAngulaire;
138 const double distAngulaire = 2 *
M_PI / nbSrcsAngulaire;
141 double distRayon = 0;
142 if (nbSrcsRadiale > 0)
144 distRayon = rayon / (nbSrcsRadiale + 1);
150 double posCercle = distRayon;
162 pt.
_x = 0.000, pt.
_y = 0.000;
181 for (
int i = 0; i < nbSrcsRadiale; i++)
183 for (
int j = 0; j < nbSrcsAngulaire; j++)
185 angle = j * distAngulaire;
187 pt.
_x = cos(angle) * posCercle;
188 pt.
_y = sin(angle) * posCercle;
209 posCercle += distRayon;
222 return (
M_PI * rayon * rayon);
245 n =
ROUND(n / 4 * 4);
272 for (
int i = 0; i < n; i++)
275 angle = (
M_2PI * (n - i)) / n;
278 pt.
_x = cos(angle) * rayon;
279 pt.
_y = sin(angle) * rayon;
304 n =
ROUND(n / 4 * 4);
330 for (
int i = 0; i < n; i++)
333 angle = (
M_2PI * (n - i)) / n;
336 pt.
_x = cos(angle) * rayon;
337 pt.
_y = sin(angle) * rayon;
401 double rayon = diameter / 2.0;
402 double norm = sqrt(2.0) * rayon;
406 double normOP0 = vecOP0.
norme();
408 double normOP1 = vecOP1.
norme();
410 double normOP2 = vecOP2.
norme();
412 double normOP3 = vecOP3.
norme();
414 if ((normOP0 == 0) || (normOP1 == 0) || (normOP2 == 0) || (normOP3 == 0))
433 assert(points.size() == 0 &&
"Output arguments 'points' is expected to be initially empty");
434 assert(triangles.size() == 0 &&
"Output arguments 'triangles' is expected to be initially empty");
455 for (
int i = 0; i < poly.size(); ++i)
460 points.push_front(center);
463 for (
int i = 1; i < resolution; ++i)
465 OTriangle tri(center, points[i], points[i + 1]);
469 triangles.push_back(tri);
472 OTriangle tri(center, points[resolution], points[1]);
474 tri.
_p2 = resolution;
476 triangles.push_back(tri);
All base classes related to 3D manipulation.
int ROUND(double a)
Compute the rounded value of a number.
#define INTERS_OUI
The intersection exists.
#define INTERS_NULLE
No intersection.
Representation graphique d'un cercle accoustique (fichier header)
TY_EXT_GRAPHIC_INST(TYAcousticCircle)
TY_EXTENSION_INST(TYAcousticCircle)
std::vector< TYPoint > TYTabPoint
Collection de TYPoint.
#define TYDEFAULTRESOLUTIONIONCIRCLE
Resolution par defaut pour la representation des cercles par des segments.
std::deque< OPoint3D > TYTabPoint3D
Collection de OPoint3D.
#define TYPRECISIONCIRCLE
Precision pour la representation des cercles par des segments.
#define TYDIRPREFERENCEMANAGER
std::vector< LPTYSourcePonctuelleGeoNode > TYTabSourcePonctuelleGeoNode
Collection de noeuds geometriques de type TYSourcePonctuelle.
double _y
y coordinate of OCoord3D
double _z
z coordinate of OCoord3D
double _x
x coordinate of OCoord3D
Plan defined by its equation : ax+by+cz+d=0.
virtual const char * getClassName() const
3D frame with a point and 3 vectors.
OPoint3D _origin
The origin point.
OMatrix asMatrix() const
return the transformation matrix from unity to this pose such as this = transform * unity
Class to define a segment.
int _p1
Index of the first OPoint3D _A.
int _p3
Index of the third OPoint3D _C.
int _p2
Index of the second OPoint3D _B.
double norme() const
Computes the length of this vector.
void normalize()
Normalizes this vector.
virtual TYSourcePonctuelle srcPonctEquiv() const
virtual OVector3D normal() const
virtual std::string toString() const
virtual ~TYAcousticCircle()
virtual OPlan plan() const
virtual void exportMesh(std::deque< OPoint3D > &points, std::deque< OTriangle > &triangles, const TYGeometryNode &geonode) const
Export the surface as a triangular mesh.
TYAcousticCircle & operator=(const TYAcousticCircle &other)
Operateur =.
virtual double surface() const
virtual TYTabSourcePonctuelleGeoNode getSrcs() const
void setDiameter(double diameter)
bool operator==(const TYAcousticCircle &other) const
Operateur ==.
TYPoint getCenter() const
virtual TYTabPoint3D getOContour(int n=-1) const
virtual void distriSrcs()
virtual int intersects(const TYSurfaceInterface *pSurf, OSegment3D &seg) const
virtual DOM_Element toXML(DOM_Element &domElement)
virtual int fromXML(DOM_Element domElement)
bool operator!=(const TYAcousticCircle &other) const
Operateur !=.
virtual TYTabPoint getContour(int n=-1) const
double getDiameter() const
virtual bool deepCopy(const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false)
double _offsetSources
Offset de decalage des sources ponctuelles sur les surfaces.
bool _isRayonnant
Etat courant de l'element (rayonnant ou non rayonnant)
TYAcousticSurface & operator=(const TYAcousticSurface &other)
Operateur =.
virtual bool deepCopy(const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false)
virtual TYTabSourcePonctuelleGeoNode getSrcs() const
LPTYRectangle _pBoundingRect
Rectangle englobant.
virtual DOM_Element toXML(DOM_Element &domElement)
LPTYSourceSurfacic _pSrcSurf
Source surfacique.
virtual int fromXML(DOM_Element domElement)
virtual void setColor(const OColor &color)
QString _name
Nom courant de l'element.
virtual void setIsGeometryModified(bool isModified)
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.
ORepere3D getORepere3D() const
virtual int intersects(const TYSurfaceInterface *pSurf, OSegment3D &seg) const
virtual OVector3D normal() const
void setDirectivity(TYDirectivity *directivity_)
: Get/Set directivity to source
void setTypeRaynt(TYTypeRaynt type)
double getDensiteSrcsH() const
bool addSrc(LPTYSourcePonctuelle pSrcPonct)
double getDensiteSrcsV() const
virtual int intersects(const OPoint3D &pt) const =0