VWorldTree Class Reference

#include <VWorldTree.h>

Inherits wxTreeCtrl.

Collaboration diagram for VWorldTree:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 VWorldTree (VWorld *world, VCanvas *canvas, wxGrid *grid, wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize)
 ~VWorldTree ()
void setWorld (VWorld *world, VCanvas *canvas)
bool selectObject (MObject *object)
 Select the given object.
void onSelectionChanged (wxTreeEvent &event)
 Callback for the selection of an item on the tree.
void updateGrid ()
void onGridChanged (int row, int col)

Protected Member Functions

bool selectObject (wxTreeItemId parent, MObject *object)
void setGridToValue (const int row, const int col, const double value)
void setGridToValue (const int row, const int col, const bool value)

Protected Attributes

VWorldmyWorld
 The world whos elements I display.
VCanvasmyCanvas
 The canvas whos elements I display (lighting, camera).
wxGrid * myGrid
 The grid that I display data onto.

Detailed Description

Creates a tree of all the elements in the world. The base elements are the objects. They have the bodies and geometries that they are made up of. When an object in the world is clicked on, the object will be selected in the tree.

Definition at line 19 of file VWorldTree.h.


Constructor & Destructor Documentation

VWorldTree::VWorldTree VWorld world,
VCanvas canvas,
wxGrid *  grid,
wxWindow *  parent,
wxWindowID  id,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize
 

Build a new VWorldTree.

Parameters:
world The physics world to display
canvas The canvas drawing the world. This is used for the lighting and camera settings that I display
grid The table that I display values on
parent The GUI element that owns this tree
id Window id (unique id to identify this GUI element)
pos The position this element will be placed on its parent
size The size of this element

Definition at line 26 of file VWorldTree.cpp.

References memTraceMsg.

VWorldTree::~VWorldTree  ) 
 

Definition at line 34 of file VWorldTree.cpp.

References memTraceMsg.


Member Function Documentation

void VWorldTree::onGridChanged int  row,
int  col
 

Function called when the grid is changed. This will update the correct part of the model

Definition at line 256 of file VWorldTree.cpp.

References myGrid, TLMDataIF::setDataValue(), and traceId.

Referenced by ViewerGUI::onGridDataChanged().

Here is the call graph for this function:

void VWorldTree::onSelectionChanged wxTreeEvent &  event  ) 
 

Callback for the selection of an item on the tree.

Todo:
Check out mass distribution center of mass and check accuracy of rotation when it isn't about center of mass
Todo:
use the data type to create the right cell editor and renderer

Definition at line 142 of file VWorldTree.cpp.

References TLMDataIF::DataInfo::editable, TLMDataIF::getAvailableData(), myGrid, and traceId.

Referenced by ViewerGUI::onSelectionChanged().

Here is the call graph for this function:

bool VWorldTree::selectObject wxTreeItemId  parent,
MObject object
[protected]
 

Definition at line 273 of file VWorldTree.cpp.

References MObject::name(), VTreeData::OBJECT, and traceId.

Here is the call graph for this function:

bool VWorldTree::selectObject MObject object  ) 
 

Select the given object.

Definition at line 134 of file VWorldTree.cpp.

References traceId.

Referenced by ViewerGUI::selectObject().

void VWorldTree::setGridToValue const int  row,
const int  col,
const bool  value
[protected]
 

Definition at line 302 of file VWorldTree.cpp.

References myGrid.

void VWorldTree::setGridToValue const int  row,
const int  col,
const double  value
[protected]
 

Definition at line 295 of file VWorldTree.cpp.

References myGrid.

Referenced by updateGrid().

void VWorldTree::setWorld VWorld world,
VCanvas canvas
 

Set the world that I should model. This will clear out the existing tree elements and create a new tree to display the given world

Definition at line 40 of file VWorldTree.cpp.

References VTreeData::BODY, VTreeData::CAMERA, VTreeData::LIGHT, VTreeData::LIGHTING, VCanvas::lighting(), VLighting::lights(), myCanvas, myWorld, VTreeData::OBJECT, MWorld::objects(), MWorld::spaces(), traceId, and warnMsg.

Here is the call graph for this function:

void VWorldTree::updateGrid  ) 
 

Update the values on the grid with the current value from the model

Definition at line 210 of file VWorldTree.cpp.

References VTreeData::CAMERA, VCanvas::getCameraPosition(), TLMDataIF::getDataValue(), myCanvas, myGrid, setGridToValue(), and traceId.

Referenced by ViewerGUI::onIdle().

Here is the call graph for this function:


Member Data Documentation

VCanvas* VWorldTree::myCanvas [protected]
 

The canvas whos elements I display (lighting, camera).

Definition at line 64 of file VWorldTree.h.

Referenced by setWorld(), and updateGrid().

wxGrid* VWorldTree::myGrid [protected]
 

The grid that I display data onto.

Definition at line 65 of file VWorldTree.h.

Referenced by onGridChanged(), onSelectionChanged(), setGridToValue(), and updateGrid().

VWorld* VWorldTree::myWorld [protected]
 

The world whos elements I display.

Definition at line 63 of file VWorldTree.h.

Referenced by setWorld().


The documentation for this class was generated from the following files:
Generated on Sat Dec 3 10:48:34 2005 for Robotics by  doxygen 1.4.5