WSF
WsfIntersectProcessor.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2003-2015 The Boeing Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11
12#ifndef WSFINTERSECTPROCESSOR_HPP
13#define WSFINTERSECTPROCESSOR_HPP
14
15#include "wsf_mil_export.h"
16
17#include <map>
18#include <string>
19
20#include "UtDictionary.hpp"
21class UtIntersectMesh;
22class WsfPlatform;
23#include "WsfProcessor.hpp"
24
30class WSF_MIL_EXPORT WsfIntersectProcessor : public WsfProcessor
31{
32public:
36 ~WsfIntersectProcessor() override;
37
38 WsfProcessor* Clone() const override;
39 bool Initialize(double aSimTime) override;
40 bool ProcessInput(UtInput& aInput) override;
41
42 bool Intersect(WsfPlatform* aSourcePlatform,
43 const std::string& aTargetOffset,
44 const double aErrorAngle, // in radians
45 double& aBeamSurfaceDotProduct,
46 int& aMaterialPropertyCode,
47 double& aDistance);
48
49 UtIntersectMesh* LookupMesh(const int aIndex);
50 int LoadMesh(const std::string& aFileName, UtIntersectMesh* aMeshPtr = nullptr);
51
52 void DefineOffset(const std::string& aOffsetName, double aOffsetX, double aOffsetY, double aOffsetZ);
53
54 bool RemoveOffset(const std::string& aOffsetName);
55
56 unsigned int GetTargetOffsetCount() { return static_cast<unsigned int>(mOffsetMap.size()); }
57
58 WsfStringId GetTargetOffsetName(unsigned aOffsetEntry) const;
59 bool TargetOffsetExists(const std::string& aTargetOffsetName) const;
60 using MeshMap = std::map<unsigned int, UtIntersectMesh*>; // convert index to meshes
61
62protected:
63private:
64 struct Offset
65 {
66 Offset()
67 : x(0.0)
68 , y(0.0)
69 , z(0.0)
70 {
71 }
72 Offset(double ax, double ay, double az)
73 : x(ax)
74 , y(ay)
75 , z(az)
76 {
77 }
78
79 double x;
80 double y;
81 double z;
82 };
83 using OffsetMap = std::map<unsigned int, Offset>; // convert index to offsets
84 using OffsetNameMap = std::map<WsfStringId, int>; // convert offset name to index
85 class Shared;
86
87 int mMeshIndex;
88 OffsetNameMap mOffsetNameMap;
89 OffsetMap mOffsetMap;
90 Shared* mSharePtr;
91};
92
93#endif
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
bool Intersect(WsfPlatform *aSourcePlatform, const std::string &aTargetOffset, const double aErrorAngle, double &aBeamSurfaceDotProduct, int &aMaterialPropertyCode, double &aDistance)
Definition WsfIntersectProcessor.cpp:161
UtIntersectMesh * LookupMesh(const int aIndex)
Definition WsfIntersectProcessor.cpp:313
void DefineOffset(const std::string &aOffsetName, double aOffsetX, double aOffsetY, double aOffsetZ)
Definition WsfIntersectProcessor.cpp:289
bool RemoveOffset(const std::string &aOffsetName)
Definition WsfIntersectProcessor.cpp:298
std::map< unsigned int, UtIntersectMesh * > MeshMap
Definition WsfIntersectProcessor.hpp:60
WsfIntersectProcessor(WsfScenario &aScenario)
Definition WsfIntersectProcessor.cpp:48
WsfIntersectProcessor & operator=(const WsfIntersectProcessor &)=delete
unsigned int GetTargetOffsetCount()
Definition WsfIntersectProcessor.hpp:56
int LoadMesh(const std::string &aFileName, UtIntersectMesh *aMeshPtr=nullptr)
Definition WsfIntersectProcessor.cpp:261
Platforms represent a entity within the simulation.
Definition WsfPlatform.hpp:115
WsfProcessor * Clone() const override=0
bool Initialize(double aSimTime) override
Definition WsfProcessor.cpp:86
WsfProcessor(const WsfScenario &aScenario)
Definition WsfProcessor.cpp:25
bool ProcessInput(UtInput &aInput) override
Definition WsfProcessor.cpp:132
Contains the data required to create a simulation, and acts as the entry point for input file process...
Definition WsfScenario.hpp:111
Copyrights Multiple, All Rights Reserved