Classes | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
Stg::ModelCamera Class Reference

ModelCamera class More...

#include <stage.hh>

Inheritance diagram for Stg::ModelCamera:
Inheritance graph
[legend]

Classes

struct  ColoredVertex
 

Public Member Functions

virtual void DataVisualize (Camera *cam)
 Draw Camera Model - TODO. More...
 
const GLubyte * FrameColor () const
 get a reference to camera color image. 4 bytes (RGBA) per pixel More...
 
const GLfloat * FrameDepth () const
 get a reference to camera depth buffer More...
 
const PerspectiveCameragetCamera (void) const
 get reference to camera used More...
 
int getHeight (void) const
 height of captured image More...
 
int getWidth (void) const
 width of captured image More...
 
virtual void Load ()
 
 ModelCamera (World *world, Model *parent, const std::string &type)
 
void setPitch (double pitch)
 change the pitch More...
 
void setYaw (double yaw)
 change the yaw More...
 
virtual void Update ()
 Capture a new frame ( calls GetFrame ) More...
 
 ~ModelCamera ()
 
- Public Member Functions inherited from Stg::Model
BlockAddBlockRect (meters_t x, meters_t y, meters_t dx, meters_t dy, meters_t dz)
 
void AddCallback (callback_type_t type, model_callback_t cb, void *user)
 
void AddFlag (Flag *flag)
 
void AddToPose (const Pose &pose)
 
void AddToPose (double dx, double dy, double dz, double da)
 
void AddVisualizer (Visualizer *custom_visual, bool on_by_default)
 
void BecomeParentOf (Model *child)
 
int CallCallbacks (callback_type_t type)
 
void ClearBlocks ()
 
bool DataIsFresh () const
 
void Disable ()
 
void Enable ()
 
PowerPackFindPowerPack () const
 
ModelGetChild (const std::string &name) const
 
Color GetColor () const
 
usec_t GetEnergyInterval () const
 
int GetFiducialReturn () const
 
unsigned int GetFlagCount () const
 
Geom GetGeom () const
 
Pose GetGlobalPose () const
 
Velocity GetGlobalVelocity () const
 
uint32_t GetId () const
 
usec_t GetInterval ()
 
kg_t GetMassOfChildren () const
 
const std::string & GetModelType () const
 
Pose GetPose () const
 
std::string GetSayString ()
 
unsigned int GetSubscriptionCount () const
 
kg_t GetTotalMass () const
 
ModelGetUnsubscribedModelOfType (const std::string &type) const
 
ModelGetUnusedModelOfType (const std::string &type)
 
usec_t GetUpdateInterval () const
 
WorldGetWorld () const
 
Pose GlobalToLocal (const Pose &pose) const
 
bool HasSubscribers () const
 
void InitControllers ()
 
bool IsAntecedent (const Model *testmod) const
 
bool IsDescendent (const Model *testmod) const
 
bool IsRelated (const Model *testmod) const
 
void Load (Worldfile *wf, int wf_entity)
 
void LoadBlock (Worldfile *wf, int entity)
 
void LoadControllerModule (const char *lib)
 
Pose LocalToGlobal (const Pose &pose) const
 
point_t LocalToGlobal (const point_t &pt) const
 
std::vector< point_int_tLocalToPixels (const std::vector< point_t > &local) const
 
 Model (World *world, Model *parent=NULL, const std::string &type="model", const std::string &name="")
 
 Model ()
 
void NeedRedraw ()
 
ModelParent () const
 
void PlaceInFreeSpace (meters_t xmin, meters_t xmax, meters_t ymin, meters_t ymax)
 
virtual void PopColor ()
 
FlagPopFlag ()
 
std::string PoseString ()
 
virtual void Print (char *prefix) const
 
virtual const char * PrintWithPose () const
 
virtual void PushColor (Color col)
 
virtual void PushColor (double r, double g, double b, double a)
 
void PushFlag (Flag *flag)
 
void Rasterize (uint8_t *data, unsigned int width, unsigned int height, meters_t cellwidth, meters_t cellheight)
 
void Redraw ()
 
int RemoveCallback (callback_type_t type, model_callback_t callback)
 
void RemoveFlag (Flag *flag)
 
void RemoveVisualizer (Visualizer *custom_visual)
 
ModelRoot ()
 
virtual void Save ()
 
void Say (const std::string &str)
 
void SetBlobReturn (bool val)
 
void SetBoundary (bool val)
 
void SetColor (Color col)
 
void SetFiducialKey (int key)
 
void SetFiducialReturn (int fid)
 
void SetFriction (double friction)
 
void SetGeom (const Geom &src)
 
void SetGlobalPose (const Pose &gpose)
 
void SetGlobalVelocity (const Velocity &gvel)
 
void SetGravityReturn (bool val)
 
void SetGripperReturn (bool val)
 
void SetGuiGrid (bool val)
 
void SetGuiMove (bool val)
 
void SetGuiNose (bool val)
 
void SetGuiOutline (bool val)
 
void SetMapResolution (meters_t res)
 
void SetMass (kg_t mass)
 
void SetObstacleReturn (bool val)
 
int SetParent (Model *newparent)
 
void SetPose (const Pose &pose)
 
void SetRangerReturn (double val)
 
void SetRangerReturn (bool val)
 
void SetStall (bool stall)
 
void SetStickyReturn (bool val)
 
virtual void SetToken (const std::string &str)
 
void SetWatts (watts_t watts)
 
void SetWorldfile (Worldfile *wf, int wf_entity)
 
bool Stalled () const
 
void Subscribe ()
 
void Unsubscribe ()
 
virtual ~Model ()
 
- Public Member Functions inherited from Stg::Ancestor
virtual void AddChild (Model *mod)
 
 Ancestor ()
 
void ForEachDescendant (model_callback_t func, void *arg)
 
std::vector< Model * > & GetChildren ()
 
void * GetProperty (std::string &key)
 
virtual void RemoveChild (Model *mod)
 
void SetProperty (std::string &key, void *value)
 
const char * Token () const
 
const std::string & TokenStr () const
 
virtual ~Ancestor ()
 

Private Member Functions

bool GetFrame ()
 Take a screenshot from the camera's perspective. return: true for sucess, and data is available via FrameDepth() / FrameColor() More...
 

Private Attributes

PerspectiveCamera _camera
 
GLubyte * _camera_colors
 
GLfloat * _camera_quads
 
int _camera_quads_size
 
Canvas_canvas
 
GLubyte * _frame_color_data
 
GLfloat * _frame_data
 
int _height
 
double _pitch_offset
 
bool _valid_vertexbuf_cache
 
ColoredVertex_vertexbuf_cache
 
int _width
 
double _yaw_offset
 

Static Private Attributes

static const int _depth = 4
 
static Option showCameraData
 

Additional Inherited Members

- Public Types inherited from Stg::Model
enum  callback_type_t {
  CB_FLAGDECR, CB_FLAGINCR, CB_GEOM, CB_INIT,
  CB_LOAD, CB_PARENT, CB_POSE, CB_SAVE,
  CB_SHUTDOWN, CB_STARTUP, CB_UPDATE, CB_VELOCITY,
  __CB_TYPE_COUNT
}
 
- Static Public Member Functions inherited from Stg::Model
static ModelLookupId (uint32_t id)
 
- Public Attributes inherited from Stg::Model
class Stg::Model::Visibility vis
 
- Static Public Attributes inherited from Stg::Model
static std::map< std::string, creator_tname_map
 
- Protected Member Functions inherited from Stg::Model
void AppendTouchingModels (std::set< Model * > &touchers)
 
void CallUpdateCallbacks (void)
 
void CommitTestedPose ()
 
void DataVisualizeTree (Camera *cam)
 
virtual void DrawBlocks ()
 
void DrawBlocksTree ()
 
void DrawBoundingBox ()
 
void DrawBoundingBoxTree ()
 
void DrawFlagList ()
 
void DrawGrid ()
 
void DrawImage (uint32_t texture_id, Camera *cam, float alpha, double width=1.0, double height=1.0)
 
void DrawOrigin ()
 
void DrawOriginTree ()
 
virtual void DrawPicker ()
 
void DrawPose (Pose pose)
 
virtual void DrawSelected (void)
 
virtual void DrawStatus (Camera *cam)
 
void DrawStatusTree (Camera *cam)
 
void DrawTrailArrows ()
 
void DrawTrailBlocks ()
 
void DrawTrailFootprint ()
 
void Map (unsigned int layer)
 
void Map ()
 
void MapFromRoot (unsigned int layer)
 
void MapWithChildren (unsigned int layer)
 
meters_t ModelHeight () const
 
void PopCoords ()
 
void PushLocalCoords ()
 
RaytraceResult Raytrace (const Pose &pose, const meters_t range, const ray_test_func_t func, const void *arg, const bool ztest=true)
 
void Raytrace (const Pose &pose, const meters_t range, const radians_t fov, const ray_test_func_t func, const void *arg, RaytraceResult *samples, const uint32_t sample_count, const bool ztest=true)
 
RaytraceResult Raytrace (const radians_t bearing, const meters_t range, const ray_test_func_t func, const void *arg, const bool ztest=true)
 
void Raytrace (const radians_t bearing, const meters_t range, const radians_t fov, const ray_test_func_t func, const void *arg, RaytraceResult *samples, const uint32_t sample_count, const bool ztest=true)
 
void RegisterOption (Option *opt)
 
virtual void Shutdown ()
 
virtual void Startup ()
 
ModelTestCollision ()
 
void UnMap (unsigned int layer)
 
void UnMap ()
 
void UnMapFromRoot (unsigned int layer)
 
void UnMapWithChildren (unsigned int layer)
 
virtual void UpdateCharge ()
 
void UpdateTrail ()
 
- Protected Member Functions inherited from Stg::Ancestor
AncestorLoad (Worldfile *wf, int section)
 
void Save (Worldfile *wf, int section)
 
- Static Protected Member Functions inherited from Stg::Model
static int UpdateWrapper (Model *mod, void *arg)
 
- Protected Attributes inherited from Stg::Model
bool alwayson
 
BlockGroup blockgroup
 
int blocks_dl
 
int boundary
 
std::vector< std::set< cb_t > > callbacks
 
Color color
 
std::list< Visualizer * > cv_list
 
bool data_fresh
 
bool disabled
 
unsigned int event_queue_num
 
std::list< Flag * > flag_list
 
double friction
 
Geom geom
 
class Stg::Model::GuiState gui
 
bool has_default_block
 
uint32_t id
 
usec_t interval
 time between updates in usec More...
 
usec_t interval_energy
 time between updates of powerpack in usec More...
 
usec_t last_update
 time of last update in us More...
 
bool log_state
 iff true, model state is logged More...
 
meters_t map_resolution
 
kg_t mass
 
Modelparent
 
Pose pose
 
PowerPackpower_pack
 
std::list< PowerPack * > pps_charging
 
Stg::Model::RasterVis rastervis
 
bool rebuild_displaylist
 iff true, regenerate block display list before redraw More...
 
std::string say_string
 if non-empty, this string is displayed in the GUI More...
 
bool stack_children
 whether child models should be stacked on top of this model or not More...
 
bool stall
 Set to true iff the model collided with something else. More...
 
int subs
 the number of subscriptions to this model More...
 
bool thread_safe
 
std::vector< TrailItemtrail
 
unsigned int trail_index
 
const std::string type
 
bool used
 TRUE iff this model has been returned by GetUnusedModelOfType() More...
 
watts_t watts
 power consumed by this model More...
 
watts_t watts_give
 
watts_t watts_take
 
Worldfilewf
 
int wf_entity
 
Worldworld
 
WorldGuiworld_gui
 
- Protected Attributes inherited from Stg::Ancestor
std::map< std::string, unsigned int > child_type_counts
 
std::vector< Model * > children
 
bool debug
 
std::map< std::string, void * > props
 
std::string token
 
- Static Protected Attributes inherited from Stg::Model
static uint64_t trail_interval
 
static unsigned int trail_length
 

Detailed Description

ModelCamera class

Definition at line 2849 of file stage.hh.

Constructor & Destructor Documentation

ModelCamera::ModelCamera ( World world,
Model parent,
const std::string &  type 
)

Definition at line 87 of file model_camera.cc.

ModelCamera::~ModelCamera ( )

Definition at line 131 of file model_camera.cc.

Member Function Documentation

void ModelCamera::DataVisualize ( Camera cam)
virtual

Draw Camera Model - TODO.

Draw camera visualization

Reimplemented from Stg::Model.

Definition at line 244 of file model_camera.cc.

const GLubyte* Stg::ModelCamera::FrameColor ( ) const
inline

get a reference to camera color image. 4 bytes (RGBA) per pixel

Definition at line 2915 of file stage.hh.

const GLfloat* Stg::ModelCamera::FrameDepth ( ) const
inline

get a reference to camera depth buffer

Definition at line 2912 of file stage.hh.

const PerspectiveCamera& Stg::ModelCamera::getCamera ( void  ) const
inline

get reference to camera used

Definition at line 2909 of file stage.hh.

bool ModelCamera::GetFrame ( void  )
private

Take a screenshot from the camera's perspective. return: true for sucess, and data is available via FrameDepth() / FrameColor()

Definition at line 170 of file model_camera.cc.

int Stg::ModelCamera::getHeight ( void  ) const
inline

height of captured image

Definition at line 2906 of file stage.hh.

int Stg::ModelCamera::getWidth ( void  ) const
inline

width of captured image

Definition at line 2903 of file stage.hh.

void ModelCamera::Load ( void  )
virtual

configure a model by reading from the current world file

Reimplemented from Stg::Model.

Definition at line 143 of file model_camera.cc.

void Stg::ModelCamera::setPitch ( double  pitch)
inline

change the pitch

Definition at line 2918 of file stage.hh.

void Stg::ModelCamera::setYaw ( double  yaw)
inline

change the yaw

Definition at line 2921 of file stage.hh.

void ModelCamera::Update ( void  )
virtual

Capture a new frame ( calls GetFrame )

Reimplemented from Stg::Model.

Definition at line 164 of file model_camera.cc.

Member Data Documentation

PerspectiveCamera Stg::ModelCamera::_camera
private

Definition at line 2877 of file stage.hh.

GLubyte* Stg::ModelCamera::_camera_colors
private

Definition at line 2873 of file stage.hh.

GLfloat* Stg::ModelCamera::_camera_quads
private

Definition at line 2872 of file stage.hh.

int Stg::ModelCamera::_camera_quads_size
private

Definition at line 2871 of file stage.hh.

Canvas* Stg::ModelCamera::_canvas
private

Definition at line 2859 of file stage.hh.

const int Stg::ModelCamera::_depth = 4
staticprivate

Definition at line 2869 of file stage.hh.

GLubyte* Stg::ModelCamera::_frame_color_data
private

Definition at line 2862 of file stage.hh.

GLfloat* Stg::ModelCamera::_frame_data
private

Definition at line 2861 of file stage.hh.

int Stg::ModelCamera::_height
private

Definition at line 2868 of file stage.hh.

double Stg::ModelCamera::_pitch_offset
private

Definition at line 2879 of file stage.hh.

bool Stg::ModelCamera::_valid_vertexbuf_cache
private

Definition at line 2864 of file stage.hh.

ColoredVertex* Stg::ModelCamera::_vertexbuf_cache
private

Definition at line 2865 of file stage.hh.

int Stg::ModelCamera::_width
private

Definition at line 2867 of file stage.hh.

double Stg::ModelCamera::_yaw_offset
private

Definition at line 2878 of file stage.hh.

Option ModelCamera::showCameraData
staticprivate

Definition at line 2875 of file stage.hh.


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


stage
Author(s): Richard Vaughan , Brian Gerkey , Reed Hedges , Andrew Howard , Toby Collett , Pooya Karimian , Jeremy Asher , Alex Couture-Beil , Geoff Biggs , Rich Mattes , Abbas Sadat
autogenerated on Mon Jun 10 2019 15:06:12