PropagationEngine.h 3.84 KB
Newer Older
1 2 3
#ifndef INCLUDE_WATCHER_COMBINED_PROPAGATION_ENGINE
#define INCLUDE_WATCHER_COMBINED_PROPAGATION_ENGINE

4
#include<ITAPropagationPathSim/CombinedModel/PropagationShapes.h>
5 6 7 8 9 10 11 12

// ITA includes
#include <ITAGeo/Base.h>
#include <ITAGeo/Halfedge/MeshModel.h>
#include <ITAGeo/Utils.h>

namespace ITAPropagationPathSim
{
13
	namespace CombinedModel
14 15 16
	{
		using namespace ITAGeo;

17
		class ITA_PROPAGATION_PATH_SIM_API CPathEngine
18 19 20 21
		{
		public:

			//Constructor
22
			CPathEngine(shared_ptr<const Halfedge::CMeshModelList> pMeshModelList, bool bIgnoreIlluminatedRegionDiffraction = false);
23

24
			void ApplyEmitter(shared_ptr<CEmitter> pEmitter, const int iMaxDiffractions, const int iMaxReflections, const int iMaxCombinedOrder);
25

26
			void ApplySensor(shared_ptr<CSensor> pSensor);
27

28
			void ConstructPropagationPaths(CPropagationPathList& oPaths);
29 30 31 32 33 34 35 36


		private:

			vector<CPropagationShapeShared> m_vpPropagationShapes; //!< Vector of all propagation shapes
			shared_ptr<const ITAGeo::Halfedge::CMeshModelList> m_pMeshModelList; //!< Copy of propagation model list
			CShapesMap m_mvpShapeVisibilityMap; //!< Map of which shape can illuminate which ones
			vector<CPropagationShapeShared> m_vpPropagationTree; //!< Vector of all propagation shapes (as well as its children) visible to the emitter
37
			vector<CPropagationShapeShared> m_vpPropagationLists; //!< Vector of all propagation shape visible to the emitter with each one pointing to up to one child with the last one visible to the sensor
38 39
			shared_ptr<CEmitter> m_pEmitter; //!< Const pointer to emitter
			shared_ptr<CSensor> m_pSensor; //!< Const pointer to sensor
40 41 42
			unique_ptr<const int> m_pMaxReflectionOrder; //!< Const pointer to maximum reflection order
			unique_ptr<const int> m_pMaxDiffractionOrder; //!< Const pointer to maximum diffraction order
			unique_ptr<const int> m_pMaxCombinedOrder; //!< Const pointer to maximum order of combined diffractions and reflections
43 44
			unique_ptr<const bool> m_pIgnoreIlluminatedRegionDiffraction; //!< Const pointer to bolean whether to ignore diffractions that can only diffract in illuminated regions(and have therefore a low impact to the whole IR)

45 46 47

			void CreateVisibilityMap();
			bool CanPointIlluminateFace(const VistaVector3D & v3Point, const string & sMeshModelName, CITAMesh::FaceHandle hFace);
48 49
			bool CanPointIlluminateEdge(const VistaVector3D & v3Point, CPropagationEdgeShared & pPropagationEdge, const bool& bTestIntersection = false);
			bool IsPathVisible(const VistaVector3D & v3StartPoint, const VistaVector3D & v3EndPoint);
50
			void CanEdgeIlluminateFace(bool & bCanEdgeIlluminateFaceOut, ITAPropagationPathSim::CombinedModel::CPropagationFaceShared & pPropagationFace, ITAPropagationPathSim::CombinedModel::CPropagationEdgeShared & pPropagationEdge);
51 52
			void CanFaceIlluminateEdge(bool & bCanFaceIlluminateEdgeOut, CPropagationFaceShared & pPropagationFace, CPropagationEdgeShared & pPropagationEdge);
			void CanFaceIlluminateFace(bool & bCanFaceIlluminateFaceOut, CPropagationFaceShared & pPropagationFaceStart, CPropagationFaceShared & pPropagationFaceEnd);
53
			void CanEdgeIlluminateEdge(bool & bCanEdgeIlluminateEdgeOut, CPropagationEdgeShared & pPropagationEdgeStart, CPropagationEdgeShared & pPropagationEdgeEnd, const bool& bTestIntersection = false);
54 55 56 57
			void ConstructPropagationShapes();

			//Create the propagation tree
			void CreatePropagationTree();
58
			void RecursiveAddChildrenToTree(const CPropagationShapeShared & pPropagationShapeChildIn, CPropagationShapeShared& vpShapeChildCopyOut, int iReflectionOrder, int iDiffractionOrder, int iCombinedOrder);
59 60 61 62
			
			//Create the propagation list
			void CreatePropagationLists();
			void RecursiveAddShapesToPropagationLists(shared_ptr<CPropagationShape>& pPropagationShapeIn);
63 64 65 66

			//Convert the propagation list
			void ConvertShapeListsToPropagationPaths(ITAGeo::CPropagationPathList& oPathsOut);

67 68 69
		};
	}

70 71 72 73
}


#endif // INCLUDE_WATCHER_COMBINED_PROPAGATION_ENGINE