Isis 3 Programmer Reference
Isis::BulletTargetShape Class Reference

Bullet Target Shape for planetary bodies. More...

#include <BulletTargetShape.h>

Inheritance diagram for Isis::BulletTargetShape:
Inheritance graph
Collaboration diagram for Isis::BulletTargetShape:
Collaboration graph

Public Member Functions

 BulletTargetShape ()
 Default empty constructor.
 
 BulletTargetShape (btCollisionObject *btbody, const QString &name="")
 Constructs a BulletTargetShape for a given a Bullet object.
 
virtual ~BulletTargetShape ()
 Desctructor.
 
QString name () const
 Return name of the target shape.
 
void writeBullet (const QString &btName) const
 Write a serialized version of the target shape to a Bullet file.
 
btCollisionObject * body () const
 Return a pointer to the Bullet target object/shape.
 
btScalar maximumDistance () const
 

Static Public Member Functions

static BulletTargetShapeload (const QString &dem, const Pvl *conf=0)
 Load a DEM file into the target shape.
 
static BulletTargetShapeloadPC (const QString &dem, const Pvl *conf=0)
 Load a point cloud type DEM in Bullet.
 
static BulletTargetShapeloadDSK (const QString &dem, const Pvl *conf=0)
 Load a DSK in Bullet.
 
static BulletTargetShapeloadCube (const QString &dem, const Pvl *conf=0)
 Load an ISIS cube type DEM in Bullet.
 

Protected Member Functions

void setTargetBody (btCollisionObject *body)
 Set the Bullet shape object to this object instance

 
void setMaximumDistance ()
 Calculate and save the maximum distance across the body.
 

Private Attributes

QString m_name
 
QSharedPointer< btCollisionObject > m_btbody
 ! The name of the body
 
btScalar m_maximumDistance
 ! The Bullet collision object for the body
 

Detailed Description

Bullet Target Shape for planetary bodies.

This class contains the in memory representation of a body for use with the Bullet library. For each type of file that can be used to create a bullet target body, this class should be extended to manage that type of file.

Author
2017-03-17 Kris Becker
History
2017-03-17 Kris Becker Original Version

Definition at line 33 of file BulletTargetShape.h.

Constructor & Destructor Documentation

◆ BulletTargetShape() [1/2]

Isis::BulletTargetShape::BulletTargetShape ( )

Default empty constructor.

The filename defaults to an empty string and the maximum distance defaults to 0.

Definition at line 28 of file BulletTargetShape.cpp.

◆ BulletTargetShape() [2/2]

Isis::BulletTargetShape::BulletTargetShape ( btCollisionObject * btbody,
const QString & name = "" )

Constructs a BulletTargetShape for a given a Bullet object.

Parameters
btbodyThe Bullet collision object to contain.
nameThe name of the object.

Definition at line 38 of file BulletTargetShape.cpp.

References setMaximumDistance().

◆ ~BulletTargetShape()

Isis::BulletTargetShape::~BulletTargetShape ( )
virtual

Desctructor.

Definition at line 47 of file BulletTargetShape.cpp.

Member Function Documentation

◆ body()

btCollisionObject * Isis::BulletTargetShape::body ( ) const

Return a pointer to the Bullet target object/shape.

Returns
btCollisionObject A target to the Bullet collision object.

Definition at line 150 of file BulletTargetShape.cpp.

References m_btbody.

Referenced by Isis::BulletWorldManager::addTarget(), and setTargetBody().

◆ load()

BulletTargetShape * Isis::BulletTargetShape::load ( const QString & dem,
const Pvl * conf = 0 )
static

Load a DEM file into the target shape.

Parameters
demThe DEM file to load.
confPVL config for the DEM load. Currently unused.
Returns
BulletTargetShape A target shape containing the DEM

Definition at line 84 of file BulletTargetShape.cpp.

References loadCube(), loadDSK(), and loadPC().

Referenced by Isis::BulletShapeModel::BulletShapeModel(), and Isis::ShapeModelFactory::create().

◆ loadCube()

BulletTargetShape * Isis::BulletTargetShape::loadCube ( const QString & dem,
const Pvl * conf = 0 )
static

Load an ISIS cube type DEM in Bullet.

Note
Currently not implemented
Parameters
demThe DEM file to load.
confPVL config for the DEM load. Currently unused.
Returns
BulletTargetShape A target shape containing the DEM

Definition at line 130 of file BulletTargetShape.cpp.

Referenced by load().

◆ loadDSK()

BulletTargetShape * Isis::BulletTargetShape::loadDSK ( const QString & dem,
const Pvl * conf = 0 )
static

Load a DSK in Bullet.

Parameters
demThe DEM file to load.
confPVL config for the DEM load. Currently unused.
Returns
BulletTargetShape A target shape containing the DEM

Definition at line 117 of file BulletTargetShape.cpp.

Referenced by load().

◆ loadPC()

BulletTargetShape * Isis::BulletTargetShape::loadPC ( const QString & dem,
const Pvl * conf = 0 )
static

Load a point cloud type DEM in Bullet.

Note
Currently not implemented
Parameters
demThe DEM file to load.
confPVL config for the DEM load. Currently unused.
Returns
BulletTargetShape A target shape containing the DEM

Definition at line 105 of file BulletTargetShape.cpp.

Referenced by load().

◆ maximumDistance()

btScalar Isis::BulletTargetShape::maximumDistance ( ) const

Definition at line 163 of file BulletTargetShape.cpp.

◆ name()

QString Isis::BulletTargetShape::name ( ) const

Return name of the target shape.

Returns
QString The target name

Definition at line 71 of file BulletTargetShape.cpp.

Referenced by Isis::BulletShapeModel::BulletShapeModel(), and Isis::BulletWorldManager::getTarget().

◆ setMaximumDistance()

void Isis::BulletTargetShape::setMaximumDistance ( )
protected

Calculate and save the maximum distance across the body.

This is calculated as the distance from the x, y, z minimum to x, y, z maximum.

Definition at line 54 of file BulletTargetShape.cpp.

References m_btbody, and m_maximumDistance.

Referenced by Isis::BulletDskShape::BulletDskShape(), BulletTargetShape(), and setTargetBody().

◆ setTargetBody()

void Isis::BulletTargetShape::setTargetBody ( btCollisionObject * body)
protected

Set the Bullet shape object to this object instance

Definition at line 156 of file BulletTargetShape.cpp.

References body(), m_btbody, and setMaximumDistance().

Referenced by Isis::BulletDskShape::loadFromDsk().

◆ writeBullet()

void Isis::BulletTargetShape::writeBullet ( const QString & btName) const

Write a serialized version of the target shape to a Bullet file.

Parameters
btNameThe name of the file to write the target shape to.
Note
Currently not implemented

Definition at line 141 of file BulletTargetShape.cpp.

Member Data Documentation

◆ m_btbody

QSharedPointer<btCollisionObject> Isis::BulletTargetShape::m_btbody
private

! The name of the body

Definition at line 58 of file BulletTargetShape.h.

Referenced by body(), setMaximumDistance(), and setTargetBody().

◆ m_maximumDistance

btScalar Isis::BulletTargetShape::m_maximumDistance
private

! The Bullet collision object for the body

Definition at line 60 of file BulletTargetShape.h.

Referenced by setMaximumDistance().

◆ m_name

QString Isis::BulletTargetShape::m_name
private

Definition at line 57 of file BulletTargetShape.h.


The documentation for this class was generated from the following files: