File failed to load: https://isis.astrogeology.usgs.gov/dev/Object/assets/jax/output/NativeMML/config.js
Isis Developer Reference
BulletShapeModel.h
Go to the documentation of this file.
1#ifndef BulletShapeModel_h
2#define BulletShapeModel_h
7
8/* SPDX-License-Identifier: CC0-1.0 */
9#include "ShapeModel.h"
10
11#include <vector>
12
13#include <QList>
14#include <QMap>
15
16#include "Intercept.h"
19#include "BulletTargetShape.h"
20#include "BulletWorldManager.h"
21#include "Target.h"
22
23namespace Isis {
24 class Target;
25
36 public:
37 // Constructors
39 BulletShapeModel(Target *target, Pvl &pvl);
40 BulletShapeModel(const QString &shapefile, Target *target, Pvl &pvl);
41 BulletShapeModel(BulletTargetShape *shape, Target *target, Pvl &pvl);
43
44 // Destructor
46
47 double getTolerance() const;
48 void setTolerance(const double &tolerance);
49
50 // Intersect the shape model
51 bool intersectSurface(std::vector<double> observerPos,
52 std::vector<double> lookDirection);
53 virtual bool intersectSurface(const Latitude &lat, const Longitude &lon,
54 const std::vector<double> &observerPos,
55 const bool &checkOcclusion = true);
56 virtual bool intersectSurface(const SurfacePoint &surfpt,
57 const std::vector<double> &observerPos,
58 const bool &checkOcclusion = true);
59
60 virtual void setSurfacePoint(const SurfacePoint &surfacePoint);
61 virtual void clearSurfacePoint();
62
63 bool isDEM() const;
64
65 // Calculate the surface normal of the current intersection point
67 void calculateLocalNormal(QVector<double *> cornerNeighborPoints);
68
69 Distance localRadius(const Latitude &lat, const Longitude &lon);
70
71 const BulletWorldManager &model() const;
72
73
74 // Determine if the internal intercept is occluded from the observer/lookdir
75 virtual bool isVisibleFrom(const std::vector<double> observerPos,
76 const std::vector<double> lookDirection);
77
78 private:
79 // Disallow copying because ShapeModel is not copyable
80 Q_DISABLE_COPY(BulletShapeModel)
81
82 QScopedPointer<BulletWorldManager> m_model;
84 double m_tolerance;
86 BulletClosestRayCallback m_intercept;
87
88 btScalar maxDistance() const;
89
90 btVector3 castLookDir(const btVector3 &observer, const btVector3 &lookdir) const;
91 btVector3 latlonToVector(const Latitude &lat, const Longitude &lon) const;
92 btVector3 pointToVector(const SurfacePoint &point) const;
93 SurfacePoint makeSurfacePoint(const btVector3 &point) const;
94
96 const btVector3 &sortPoint) const;
97 bool isOccluded(const BulletClosestRayCallback &hit,
98 const btVector3 &observer) const;
99
100 void updateShapeModel(const BulletClosestRayCallback &result);
101
102
103 };
104}
105
106#endif
Bullet ray tracing callback to return all intersections along a ray's path.
Definition BulletAllHitsRayCallback.h:30
Bullet ray tracing callback for closest hit on target surface.
Definition BulletClosestRayCallback.h:33
const BulletWorldManager & model() const
Returns a direct reference to the Bullet world that contains the target shape and can perform ray cas...
Definition BulletShapeModel.cpp:532
BulletShapeModel(const QString &shapefile, Target *target, Pvl &pvl)
void calculateLocalNormal(QVector< double * > cornerNeighborPoints)
Compute the normal for a local region of surface points.
Definition BulletShapeModel.cpp:516
Distance localRadius(const Latitude &lat, const Longitude &lon)
Compute the radius of the body at a lat/lon point.
Definition BulletShapeModel.cpp:410
double getTolerance() const
Returns the occlusion tolerance in kilometers.
Definition BulletShapeModel.cpp:167
virtual bool isVisibleFrom(const std::vector< double > observerPos, const std::vector< double > lookDirection)
Check if the saved intercept is visible from a observer with a given look direction.
Definition BulletShapeModel.cpp:470
BulletShapeModel()
Default constructor that creates a shape model without any internal model.
Definition BulletShapeModel.cpp:53
~BulletShapeModel()
Destructor.
Definition BulletShapeModel.cpp:159
virtual void clearSurfacePoint()
Clear the saved surface point and reset the saved intersection.
Definition BulletShapeModel.cpp:388
void setLocalNormalFromIntercept()
Set the normal vector to the intercept point normal.
Definition BulletShapeModel.cpp:436
bool isDEM() const
Indicates that this shape model is not from a DEM.
Definition BulletShapeModel.cpp:456
bool intersectSurface(std::vector< double > observerPos, std::vector< double > lookDirection)
This method computes a DEM intercept point given an observer location and look direction using the Bu...
Definition BulletShapeModel.cpp:193
virtual void setSurfacePoint(const SurfacePoint &surfacePoint)
Set the internal surface point.
Definition BulletShapeModel.cpp:379
void setTolerance(const double &tolerance)
Sets the occlusion tolerance.
Definition BulletShapeModel.cpp:177
Bullet Target Shape for planetary bodies.
Definition BulletTargetShape.h:33
Bullet World manager maintains a proper state for target bodies.
Definition BulletWorldManager.h:41
Distance measurement, usually in meters.
Definition Distance.h:34
This class is designed to encapsulate the concept of a Latitude.
Definition Latitude.h:51
This class is designed to encapsulate the concept of a Longitude.
Definition Longitude.h:40
Container for cube-like labels.
Definition Pvl.h:122
ShapeModel()
Default constructor creates ShapeModel object, initializing name to an empty string,...
Definition ShapeModel.cpp:40
This class defines a body-fixed surface point.
Definition SurfacePoint.h:132
This class is used to create and store valid Isis targets.
Definition Target.h:63
This is free and unencumbered software released into the public domain.
Definition Calculator.h:18
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16