Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

vrj::SimViewport Class Reference

#include <SimViewport.h>

Inheritance diagram for vrj::SimViewport:

Inheritance graph
[legend]
Collaboration diagram for vrj::SimViewport:

Collaboration graph
[legend]
List of all members.

Public Methods

 SimViewport ()
 SimViewport (const SimViewport &sv)
virtual ~SimViewport ()
virtual void config (jccl::ConfigElementPtr element)
 Configure the simulator. More...

virtual void updateProjections (const float positionScale)
 Update the projections. More...

DrawSimInterfacegetDrawSimInterface ()
void setDrawSimInterface (DrawSimInterface *draw_sim_i)

Protected Attributes

DrawSimInterfacemSimulator
 The simulator that we are using here. More...


Constructor & Destructor Documentation

vrj::SimViewport::SimViewport   [inline]
 

Definition at line 51 of file SimViewport.h.

00051                  : Viewport()
00052    {;}

vrj::SimViewport::SimViewport const SimViewport &    sv [inline]
 

Definition at line 54 of file SimViewport.h.

00054                                       : Viewport(sv), mSimulator(sv.mSimulator)
00055    {
00056       ;
00057    }

virtual vrj::SimViewport::~SimViewport   [inline, virtual]
 

Definition at line 59 of file SimViewport.h.

00060    {
00061       ;
00062    }


Member Function Documentation

void vrj::SimViewport::config jccl::ConfigElementPtr    element [virtual]
 

Configure the simulator.

Reimplemented from vrj::Viewport.

Definition at line 50 of file SimViewport.cpp.

References mSimulator, and vrj::Viewport::SIM.

00051 {
00052    vprASSERT(element.get() != NULL);
00053    vprASSERT(element->getID() == "simulator_viewport");
00054 
00055    Viewport::config(element);
00056 
00057    mType = SIM;
00058 
00059    const float vert_fov = element->getProperty<float>("vertical_fov");
00060 
00061    mLeftProj = new CameraProjection;
00062    ((CameraProjection*) mLeftProj)->setVerticalFOV(vert_fov);
00063    mLeftProj->config(element);
00064    mLeftProj->setEye(Projection::LEFT);
00065    mLeftProj->setViewport(this);
00066 
00067    mRightProj = new CameraProjection;
00068    ((CameraProjection*) mRightProj)->setVerticalFOV(vert_fov);
00069    mRightProj->config(element);
00070    mRightProj->setEye(Projection::RIGHT);
00071    mRightProj->setViewport(this);
00072 
00073    //bool has_simulator(false);
00074    //has_simulator = element->getProperty<bool>("has_simulator_plugin");
00075    mSimulator = NULL;
00076 
00077    // Create the simulator stuff
00078    /*if(has_simulator)
00079    {
00080       jccl::ConfigElementPtr sim_element =
00081          element->getProperty<jccl::ConfigElementPtr>("simulator_plugin");
00082 
00083       vprDEBUG(vrjDBG_DISP_MGR, vprDBG_CONFIG_LVL)
00084          << "SimViewport::config() creating simulator of type '"
00085          << sim_element->getID() << "'\n" << vprDEBUG_FLUSH;
00086       mSimulator = DrawSimInterfaceFactory::instance()->createObject(sim_element->getID());
00087 
00088       // XXX: Change this to an error once the new simulator loading code is
00089       // more robust.  -PH (4/13/2003)
00090       vprASSERT(NULL != mSimulator && "Failed to create draw simulator");
00091       mSimulator->initialize(this);
00092       mSimulator->config(sim_element);
00093    }
00094    */
00095 }

void vrj::SimViewport::updateProjections const float    positionScale [virtual]
 

Update the projections.

Parameters:
positionScale  - Scale value for converting from Juggler units (meters) to the display units

Implements vrj::Viewport.

Definition at line 97 of file SimViewport.cpp.

References mSimulator.

00098 {
00099    if(mSimulator != NULL)
00100    {
00101       mSimulator->updateProjectionData(positionScale, mLeftProj, mRightProj);
00102    }
00103 }

DrawSimInterface* vrj::SimViewport::getDrawSimInterface   [inline]
 

Definition at line 73 of file SimViewport.h.

00074    { return mSimulator; }

void vrj::SimViewport::setDrawSimInterface DrawSimInterface   draw_sim_i [inline]
 

Definition at line 76 of file SimViewport.h.

00077    {
00078       mSimulator = draw_sim_i;
00079    }


Member Data Documentation

DrawSimInterface* vrj::SimViewport::mSimulator [protected]
 

The simulator that we are using here.

Definition at line 82 of file SimViewport.h.

Referenced by config, and updateProjections.


The documentation for this class was generated from the following files:
Generated on Sun May 2 15:11:06 2004 for VR Juggler by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002