#pragma once#include"FEMesh.h"#include"Intersect.h"#include<vector>#include<string>#include<memory>usingnamespacestd;classFEAreaCoverage{classSurface{public:Surface(){}intFaces(){return(int)m_face.size();}voidCreate(std::shared_ptr<FEMesh>m);intNodes(){return(int)m_node.size();}std::shared_ptr<FEMesh>m_mesh;vector<int>m_face;// face listvector<int>m_node;// node listvector<vec3d>m_pos;// node positionsvector<int>m_lnode;// local node listvector<vec3d>m_norm;// node normalsvector<vec3d>m_fnorm;// face normalsvector<vector<int>>m_NLT;// node-facet look-up table};public:FEAreaCoverage();// assign selectionsvoidSetSelection1(vector<int>&s){m_surf1.m_face=s;}voidSetSelection2(vector<int>&s){m_surf2.m_face=s;}// apply the map// returns one value per nodevector<double>Apply(std::shared_ptr<FEMesh>mesh1,std::shared_ptr<FEMesh>mesh2);// get/set back intersection flagvoidAllowBackIntersection(boolb);boolAllowBackIntersection()const;// set/get the angle threshold (w between 0 and 1)voidSetAngleThreshold(doublew);doubleGetAngleThreshold()const;// set/get back-intersection search radius (0 ignores the search radius)voidSetBackSearchRadius(doubleR);doubleGetBackSearchRadius()const;protected:// build node normal listvoidUpdateSurface(FEAreaCoverage::Surface&s);// see if a ray intersects with a surfaceboolintersect(constvec3d&r,constvec3d&N,FEAreaCoverage::Surface&surf,Intersection&q);boolfaceIntersect(FEAreaCoverage::Surface&surf,constRay&ray,intnface,Intersection&q);protected:Surfacem_surf1;Surfacem_surf2;boolm_ballowBackIntersections;// include back intersectionsdoublem_angleThreshold;// angular threshold (between 0 and 1)doublem_backSearchRadius;// search radius for back intersections (set to 0 to ignore)};