42 std::deque<CGAL_Point3> vertices =
build_box(w, h, _source, _receptor);
48 CGAL_Transform3 to_box_system(vx.x(), vx.y(), vx.z(), vy.x(), vy.y(), vy.z(), vz.x(), vz.y(), vz.z());
51 std::deque<CGAL_Point3> cgal_nodes;
52 for (nodes_pool_t::const_iterator it = nodes.begin(); it != nodes.end(); it++)
54 cgal_nodes.push_back(
CGAL_Point3(it->_x, it->_y, it->_z).transform(to_box_system));
57 for (triangle_pool_t::const_iterator it = triangle_soup.begin(); it != triangle_soup.end(); it++)
59 cgal_triangles.push_back(
60 CGAL_Triangle(cgal_nodes[it->n[0]], cgal_nodes[it->n[1]], cgal_nodes[it->n[2]]));
62 float l = (float)sqrt(
CGAL_Vector3(_source, _receptor).squared_length());
66 std::deque<CGAL_Point3> box_triangle;
67 box_triangle.push_back(vertices[1].transform(to_box_system));
68 box_triangle.push_back(vertices[2].transform(to_box_system));
69 box_triangle.push_back(vertices[3].transform(to_box_system));
93 double length,
double factor_g)
96 shared_ptr<AcousticGroundMaterial> ptr =
nullptr;
101 ptr = tympan::dynamic_pointer_cast<AcousticGroundMaterial>(*iter);
105 if (ptr->compare(
name, resistivity, deviation, length, factor_g))
118 p_mat = tympan::static_pointer_cast<AcousticMaterialBase>(
119 tympan::make_shared<AcousticGroundMaterial>(
name, resistivity, deviation, length, factor_g));
127 material_ptr_t p_mat = tympan::static_pointer_cast<AcousticMaterialBase>(
128 tympan::make_shared<AcousticBuildingMaterial>(
name, spectrum));
136 boost::shared_ptr<AcousticFaceGeomData> pFaceGeomData = boost::make_shared<AcousticFaceGeomData>();
137 pFaceGeomData->a = a;
138 pFaceGeomData->h = h;
139 pFaceGeomData->n = n;
140 return pFaceGeomData;
This file provides the top-level declaration for the acoustic problem model.
Class to describe the acoustic problem.
source_pool_t all_sources
Array of all sources.
receptor_idx make_receptor(const Point &position_)
Push a new acoustic receptor into the model.
triangle_idx make_triangle(node_idx n1, node_idx n2, node_idx n3)
node_idx make_node(const Point &point)
Destructor.
material_ptr_t make_material(const string &name, double resistivity, double deviation, double length, double factor_g)
Push a representation of a ground material into the model. If an instance of a ground material with s...
material_pool_t all_materials
Array of all materials.
nodes_pool_t all_nodes
Array of all nodes.
boost::shared_ptr< AcousticFaceGeomData > makeFaceGeomData(double a, double h, const OVector3D &n)
Create in memory an AcousticFaceGeomData instance.
receptor_pool_t all_receptors
Array of all receptors.
triangle_pool_t all_triangles
Array of all triangles.
source_idx make_source(const Point &point_, const Spectrum &spectrum_, SourceDirectivityInterface *directivity)
Push a new acoustic source into the model.
Describes an acoustic receptor.
Describes an acoustic source.
node_idx n[3]
Triangle vertexes.
AcousticTriangle(node_idx n1, node_idx n2, node_idx n3)
Constructor with the 3 vertexes of the triangle.
Interface for source directivity classes (SphericalSourceDirectivity, CommonFaceDirectivity,...
CGAL_Vector3 normalize(CGAL_Vector3 v)
normalize vector v
CGAL::Triangle_3< CGAL_Gt > CGAL_Triangle
CGAL_Plane to_cgal(const OPlan &oplan)
Convert a OPlan to CGAL_Plane.
CGAL::Point_3< CGAL_Gt > CGAL_Point3
CGAL::Vector_3< CGAL_Gt > CGAL_Vector3
std::deque< CGAL_Triangle > CGAL_Triangles
std::deque< triangle_idx > scene_volume_intersection(const triangle_pool_t &triangle_soup, const nodes_pool_t &nodes, float w, float h, OPoint3D source, OPoint3D receptor)
Find the intersection between some triangles (triangles, nodes) and a volume given by a width,...
std::deque< Point > nodes_pool_t
std::unique_ptr< AcousticProblemModel > make_AcousticProblemModel()
std::deque< CGAL_Point3 > build_box(float w, float h, CGAL_Point3 pta, CGAL_Point3 ptb)
return 4 points defining a 3D parallelepiped
CGAL::Aff_transformation_3< CGAL_Gt > CGAL_Transform3
shared_ptr< AcousticMaterialBase > material_ptr_t
std::deque< AcousticTriangle > triangle_pool_t
Array of AcousticTriangle.
std::deque< size_t > intersected_triangles(CGAL_Triangles &triangle_soup, std::deque< CGAL_Point3 > query_box, float length, float width, float height)
Find the triangles from triangle_soup that are intersected by the 3D box including the points of quer...