27 deque<CGAL_Point3> vertices =
build_box(w, h, _source, _receptor);
34 vy.x(), vy.y(), vy.z(),
35 vz.x(), vz.y(), vz.z());
38 deque<CGAL_Point3> cgal_nodes;
39 for(nodes_pool_t::const_iterator it = nodes.begin(); it != nodes.end(); it ++)
41 cgal_nodes.push_back(
CGAL_Point3(it->_x, it->_y, it->_z).transform(to_box_system));
44 for(triangle_pool_t::const_iterator it = triangle_soup.begin(); it != triangle_soup.end(); it++)
46 cgal_triangles.push_back(
CGAL_Triangle(cgal_nodes[it->n[0]], cgal_nodes[it->n[1]],
47 cgal_nodes[it->n[2]]));
49 float l = (float)sqrt(
CGAL_Vector3(_source, _receptor).squared_length());
53 std::deque<CGAL_Point3> box_triangle;
54 box_triangle.push_back(vertices[1].transform(to_box_system));
55 box_triangle.push_back(vertices[2].transform(to_box_system));
56 box_triangle.push_back(vertices[3].transform(to_box_system));
62 all_nodes.push_back(p);
63 return all_nodes.size() - 1;
76 return all_triangles.size() - 1;
79 material_ptr_t AcousticProblemModel::make_material(
const string&
name,
double resistivity,
double deviation,
double length)
82 tympan::make_shared<AcousticGroundMaterial>(
name, resistivity, deviation, length));
83 all_materials.push_back(p_mat);
90 tympan::make_shared<AcousticBuildingMaterial>(
name, spectrum));
91 all_materials.push_back(p_mat);
101 all_sources.push_back(
AcousticSource(point, spectrum, directivity));
102 return all_sources.size() - 1;
106 const Point& position_)
109 return all_receptors.size() - 1;
CGAL::Triangle_3< CGAL_Gt > CGAL_Triangle
This file provides the top-level declaration for the acoustic problem model.
shared_ptr< AcousticMaterialBase > material_ptr_t
std::deque< CGAL_Triangle > CGAL_Triangles
CGAL::Point_3< CGAL_Gt > CGAL_Point3
CGAL_Plane to_cgal(const OPlan &oplan)
Convert a OPlan to CGAL_Plane.
std::deque< CGAL_Point3 > build_box(float w, float h, CGAL_Point3 pta, CGAL_Point3 ptb)
return 4 points defining a 3D parallelepiped
std::unique_ptr< AcousticProblemModel > make_AcousticProblemModel()
CGAL_Vector3 normalize(CGAL_Vector3 v)
normalize vector v
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...
std::deque< AcousticTriangle > triangle_pool_t
Array of AcousticTriangle.
Class to describe the acoustic problem.
Describes an acoustic receptor.
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...
CGAL::Vector_3< CGAL_Gt > CGAL_Vector3
CGAL::Aff_transformation_3< CGAL_Gt > CGAL_Transform3
std::deque< Point > nodes_pool_t
Describes an acoustic source.
Store acoustic power values for different frequencies.
Interface for source directivity classes (SphericalSourceDirectivity, CommonFaceDirectivity, ...)