46 for (
unsigned i = 0; i < nbFaces; i++)
51 if ((SI.
volume_id.size() != 0) && (source_id.size() != 0))
61 bool bVertical =
CalculSegmentCoupe(SI, intersection, plan[0].pt1, plan[0].pt2, plan[0].pt3, 0);
62 bool bHorizontal =
CalculSegmentCoupe(SI, intersection, plan[1].pt1, plan[1].pt2, plan[1].pt3, 1);
64 if (bVertical || bHorizontal)
66 tabIntersect.push_back(intersection);
75 std::deque<unsigned int> indices;
76 std::deque<TYSIntersection> temp;
79 for (
size_t i = 0; i < tabIntersect.size(); i++)
81 if (tabIntersect[i].isInfra)
83 temp.push_back(tabIntersect[i]);
87 indices.push_back(
static_cast<unsigned int>(i));
92 for (
size_t i = 0; i < indices.size(); i++)
94 temp.push_back(tabIntersect[indices[i]]);
103 double planOffset = 10.0;
110 tmpPlan.
pt3 = tmpPlan.
pt1;
111 tmpPlan.
pt3.
_z += planOffset;
117 tmpPlan.
pt2.
_x += planOffset;
118 tmpPlan.
pt2.
_y += planOffset;
171 OPlan planRayon(pt1, pt2, pt3);
172 if (planRayon.intersectsSurface(FaceCourante.
tabPoint, segInter))
175 Intersect.
segInter[indice] = segInter;
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.
Class to define a segment.
OPoint3D _ptA
Point A of the segment.
OPoint3D _ptB
Point B of the segment.
virtual ~TYFaceSelector()
bool buildPlans(TYSPlan *plan, const OSegment3D &rayon)
bool CalculSegmentCoupe(const TYStructSurfIntersect &FaceCourante, TYSIntersection &Intersect, OPoint3D &pt1, OPoint3D &pt2, OPoint3D &pt3, const int &indice) const
TYSolver & _solver
Reference to the solver.
virtual void selectFaces(std::deque< TYSIntersection > &tabIntersect, const OSegment3D &rayon, const string &sourceVolumeId)
Build the array of intersections.
TYFaceSelector(TYSolver &solver)
void reorder_intersect(std::deque< TYSIntersection > &tabIntersect)
put infrastructure faces on top
const std::vector< TYStructSurfIntersect > & getTabPolygon() const
Get the array of polygons.
This class TYTrajet (journey) links a couple Source-Receptor and a collection of paths,...
void getPtSetPtRfromOSeg3D(OSegment3D &seg) const
tympan::AcousticSource & asrc
Business source.
string volume_id
Volume id.
This file provides the declaration of the entities of the model, which inherit from BaseEntity.
Data structure for intersections.
bool isInfra
Flag to define if is a infrastructure face.
bool isEcran
Flag to define if is a screen face.
bool bIntersect[2]
Flag to indicate the face cuts vertical plane ([0]) or horizontal plane ([1])
bool noIntersect
Flag to indicate that the face should not be tested for intersection.
tympan::AcousticMaterialBase * material
Pointer to a material.
Structure to describe a plan defined with 3 points.
Describe surface intersections.
string volume_id
Volume id.
TabPoint3D tabPoint
Array of points used for the preselection.
tympan::AcousticMaterialBase * material
Reference to a material.
bool is_infra() const
Detect if a face is on a infrastructure (has a material)