30 const std::vector<TYStructSurfIntersect>& tabPolygon,
31 const OSegment3D& rayon,
const string& sourceVolumeId)
37 size_t nbFaces = tabPolygon.size();
40 for (
unsigned i = 0; i < nbFaces; i++)
45 if ((SI.
volume_id.size() != 0) && (sourceVolumeId.size() != 0))
59 bool bVertical =
CalculSegmentCoupe(SI, intersection, plan[0].pt1, plan[0].pt2, plan[0].pt3, 0);
60 bool bHorizontal =
CalculSegmentCoupe(SI, intersection, plan[1].pt1, plan[1].pt2, plan[1].pt3, 1);
62 if (bVertical || bHorizontal)
64 tabIntersect.push_back(intersection);
73 std::deque<unsigned int> indices;
74 std::deque<TYSIntersection> temp;
77 for (
size_t i = 0; i < tabIntersect.size(); i++)
79 if (tabIntersect[i].isInfra)
81 temp.push_back(tabIntersect[i]);
85 indices.push_back(
static_cast<unsigned int>(i));
90 for (
size_t i = 0; i < indices.size(); i++)
92 temp.push_back(tabIntersect[indices[i]]);
101 double planOffset = 10.0;
108 tmpPlan.
pt3 = tmpPlan.
pt1;
109 tmpPlan.
pt3.
_z += planOffset;
115 tmpPlan.
pt2.
_x += planOffset;
116 tmpPlan.
pt2.
_y += planOffset;
166 OPlan planRayon(pt1, pt2, pt3);
170 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.
int intersectsSurface(const TabPoint3D &contour, OSegment3D &segment) const
Compute intersection between a plan and a surface defined by his bounds.
Class to define a segment.
OPoint3D _ptA
Point A of the segment.
OPoint3D _ptB
Point B of the segment.
virtual void selectFaces(std::deque< TYSIntersection > &tabIntersect, const std::vector< TYStructSurfIntersect > &tabPolygon, const OSegment3D &rayon, const string &sourceVolumeId)
Build the array of intersections.
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
void reorder_intersect(std::deque< TYSIntersection > &tabIntersect)
put infrastructure faces on top
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 bIntersect[2]
Flag to indicate the face cuts vertical plane ([0]) or horizontal plane ([1])
bool isEcran
Flag to define if is a screen face.
boost::shared_ptr< tympan::AcousticFaceGeomData > pFaceGeomData
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.
tympan::AcousticMaterialBase * material
Reference to a material.
string volume_id
Volume id.
TabPoint3D tabPoint
Array of points used for the preselection.
boost::shared_ptr< tympan::AcousticFaceGeomData > pFaceGeomData
bool is_infra() const
Detect if a face is on a infrastructure (has a material)