Text archives Help
- From: abe@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [MANTA] r758 - in trunk: Engine/Control Model/Cameras fox
- Date: Fri, 9 Dec 2005 15:37:21 -0700 (MST)
Author: abe
Date: Fri Dec 9 15:37:20 2005
New Revision: 758
Removed:
trunk/Model/Cameras/StereoPinholeCamera.cc
trunk/Model/Cameras/StereoPinholeCamera.h
Modified:
trunk/Engine/Control/RTRT_register.cc
trunk/Model/Cameras/CMakeLists.txt
trunk/Model/Cameras/PinholeCamera.cc
trunk/fox/FMantaStereo.cc
trunk/fox/FMantaStereo.h
trunk/fox/dm_demo.cc
Log:
Removed StereoPinholeCamera. Stereo functionality is available in the
PinholeCamera, specify -offset <distance> while running in stereo mode.
Updated dm_demo stereo gui to reflect difference.
Use: bin/dm_demo -stereo ...
M fox/dm_demo.cc
M fox/FMantaStereo.cc
M fox/FMantaStereo.h
D Model/Cameras/StereoPinholeCamera.h
M Model/Cameras/PinholeCamera.cc
M Model/Cameras/CMakeLists.txt
D Model/Cameras/StereoPinholeCamera.cc
M Engine/Control/RTRT_register.cc
Modified: trunk/Engine/Control/RTRT_register.cc
==============================================================================
--- trunk/Engine/Control/RTRT_register.cc (original)
+++ trunk/Engine/Control/RTRT_register.cc Fri Dec 9 15:37:20 2005
@@ -27,7 +27,6 @@
#include <Image/SimpleImage.h>
#include <Model/Cameras/EnvironmentCamera.h>
#include <Model/Cameras/PinholeCamera.h>
-#include <Model/Cameras/StereoPinholeCamera.h>
#include <Model/Cameras/OrthogonalCamera.h>
#include <Model/Cameras/FisheyeCamera.h>
#include <Model/Groups/BVH.h>
@@ -84,7 +83,6 @@
// Register cameras
engine->registerComponent("environment", &EnvironmentCamera::create);
engine->registerComponent("pinhole", &PinholeCamera::create);
- engine->registerComponent("stereo", &StereoPinholeCamera::create);
engine->registerComponent("orthogonal", &OrthogonalCamera::create);
engine->registerComponent("fisheye", &FisheyeCamera::create);
Modified: trunk/Model/Cameras/CMakeLists.txt
==============================================================================
--- trunk/Model/Cameras/CMakeLists.txt (original)
+++ trunk/Model/Cameras/CMakeLists.txt Fri Dec 9 15:37:20 2005
@@ -8,6 +8,4 @@
Cameras/OrthogonalCamera.cc
Cameras/FisheyeCamera.h
Cameras/FisheyeCamera.cc
- Cameras/StereoPinholeCamera.h
- Cameras/StereoPinholeCamera.cc
)
Modified: trunk/Model/Cameras/PinholeCamera.cc
==============================================================================
--- trunk/Model/Cameras/PinholeCamera.cc (original)
+++ trunk/Model/Cameras/PinholeCamera.cc Fri Dec 9 15:37:20 2005
@@ -73,10 +73,16 @@
void PinholeCamera::output( std::ostream &os ) {
os << "pinhole( -eye " << eye
- << " -lookat " << lookat
- << " -up " << up
- << " -fov " << hfov << " )"
- << std::endl;
+ << " -lookat " << lookat
+ << " -up " << up
+ << " -fov " << hfov;
+
+ // Output the offset if one is set.
+ if (stereo_offset != 0.0) {
+ os << " -offset " << stereo_offset;
+ }
+
+ os << " )" << std::endl;
}
Camera* PinholeCamera::create(const vector<string>& args)
Modified: trunk/fox/FMantaStereo.cc
==============================================================================
--- trunk/fox/FMantaStereo.cc (original)
+++ trunk/fox/FMantaStereo.cc Fri Dec 9 15:37:20 2005
@@ -28,7 +28,7 @@
-#include <Model/Cameras/StereoPinholeCamera.h>
+#include <Model/Cameras/PinholeCamera.h>
#include <fox/FMantaStereo.h>
@@ -42,9 +42,6 @@
//////////////////////////////////////////////////////////////////////////////
// Message_Type ID Message_Handler
FXMAPFUNC(SEL_COMMAND, FMantaStereoDialog::ID_DISTANCE,
FMantaStereoDialog::onDistance ),
- FXMAPFUNC(SEL_COMMAND, FMantaStereoDialog::ID_FOCUS,
FMantaStereoDialog::onFocus ),
- FXMAPFUNC(SEL_COMMAND, FMantaStereoDialog::ID_FOCUS_EYE,
FMantaStereoDialog::onFocusEye ),
-
};
FXIMPLEMENT(FMantaStereoDialog,FXDialogBox,FMantaStereoDialogMap,ARRAYNUMBER(FMantaStereoDialogMap));
@@ -63,29 +60,15 @@
{
FXHorizontalFrame *frame = new FXHorizontalFrame( this );
- new FXLabel( frame, "The \"stereo\" camera must be specified to use stereo
mode." );
+ new FXLabel( frame, "Settings for the PinholeCamera in stereo mode." );
frame = new FXHorizontalFrame( this );
new FXLabel( frame, "Eye distance" );
distance_spinner = new FXRealSpinner( frame, 5, this, ID_DISTANCE );
distance_spinner->setRange( 0, 999 );
distance_spinner->setIncrement( 0.001 );
- distance_spinner->setValue( 1.0 );
-
- frame = new FXHorizontalFrame( this );
- new FXLabel( frame, "Focus distance" );
- focus_spinner = new FXRealSpinner( frame, 5, this, ID_FOCUS );
- focus_spinner->setRange( 0, 999 );
- focus_spinner->setIncrement( 0.05 );
- focus_spinner->setValue( 10.0 );
+ distance_spinner->setValue( 0.1 );
- frame = new FXHorizontalFrame( this );
- new FXLabel( frame, "Focus separation" );
- focus_eye_spinner = new FXRealSpinner( frame, 5, this, ID_FOCUS_EYE );
- focus_eye_spinner->setRange( 0, 999 );
- focus_eye_spinner->setIncrement( 0.001 );
- focus_eye_spinner->setValue( 0.5 );
-
}
long FMantaStereoDialog::onDistance ( FXObject *sender, FXSelector key,
void *data ) {
@@ -98,55 +81,15 @@
return 1;
}
-long FMantaStereoDialog::onFocus ( FXObject *sender, FXSelector key, void
*data ) {
-
- Real focus = focus_spinner->getValue();
- manta_window->getMantaInterface()->addTransaction("stereo focus",
- Callback::create(this,
&FMantaStereoDialog::mantaSetFocus,
- focus ));
-
- return 1;
-}
-
-long FMantaStereoDialog::onFocusEye( FXObject *sender, FXSelector key, void
*data ) {
-
- Real focus = focus_spinner->getValue();
- manta_window->getMantaInterface()->addTransaction("stereo focus eye",
- Callback::create(this,
&FMantaStereoDialog::mantaSetFocusEye,
- focus ));
-
- return 1;
-}
-
void FMantaStereoDialog::mantaSetDistance( Real distance_ ) {
int channel = 0;
// Check to make sure that the camera is a stereo camera.
- StereoPinholeCamera *camera = dynamic_cast<StereoPinholeCamera
*>(manta_window->getMantaInterface()->getCamera( channel ));
- if (camera) {
- camera->set_eye_distance( distance_ );
- }
-}
-
-void FMantaStereoDialog::mantaSetFocus ( Real focus_ ) {
-
- int channel = 0;
-
- // Check to make sure that the camera is a stereo camera.
- StereoPinholeCamera *camera = dynamic_cast<StereoPinholeCamera
*>(manta_window->getMantaInterface()->getCamera( channel ));
+ PinholeCamera *camera = dynamic_cast<PinholeCamera
*>(manta_window->getMantaInterface()->getCamera( channel ));
if (camera) {
- camera->set_focus_distance( focus_ );
+ camera->setStereoOffset( distance_ );
}
}
-void FMantaStereoDialog::mantaSetFocusEye( Real distance_ ) {
- int channel = 0;
-
- // Check to make sure that the camera is a stereo camera.
- StereoPinholeCamera *camera = dynamic_cast<StereoPinholeCamera
*>(manta_window->getMantaInterface()->getCamera( channel ));
- if (camera) {
- camera->set_focus_eye_distance( distance_ );
- }
-}
Modified: trunk/fox/FMantaStereo.h
==============================================================================
--- trunk/fox/FMantaStereo.h (original)
+++ trunk/fox/FMantaStereo.h Fri Dec 9 15:37:20 2005
@@ -59,14 +59,10 @@
FMantaWindow *manta_window;
FXRealSpinner *distance_spinner;
- FXRealSpinner *focus_spinner;
- FXRealSpinner *focus_eye_spinner;
public:
enum {
ID_DISTANCE = FXDialogBox::ID_LAST,
- ID_FOCUS,
- ID_FOCUS_EYE,
ID_LAST
};
@@ -79,12 +75,8 @@
void create() { FXDialogBox::create(); };
long onDistance( FXObject *sender, FXSelector key, void *data );
- long onFocus ( FXObject *sender, FXSelector key, void *data );
- long onFocusEye( FXObject *sender, FXSelector key, void *data );
void mantaSetDistance( Real distance_ );
- void mantaSetFocus ( Real focus_ );
- void mantaSetFocusEye( Real distance_ );
};
};
Modified: trunk/fox/dm_demo.cc
==============================================================================
--- trunk/fox/dm_demo.cc (original)
+++ trunk/fox/dm_demo.cc Fri Dec 9 15:37:20 2005
@@ -271,8 +271,16 @@
manta_window.addExtraOptionsDialog( "Stereo", new FMantaStereoDialog(
&manta_window, "Stereo" ));
// Add a transaction to switch on the stereo camera.
- manta_interface->addTransaction("Switch to stereo",
-
Callback::create(&manta_window,&FMantaWindow::mantaCamera2,string("stereo"))
);
+ PinholeCamera *pinhole = dynamic_cast<PinholeCamera *>( camera );
+ if (pinhole) {
+
+ // Only set the stereo offset if it has not already been set.
+ if (pinhole->getStereoOffset() == 0.0) {
+
+ manta_interface->addTransaction("Switch to stereo",
+
Callback::create(pinhole,&PinholeCamera::setStereoOffset,(Real)0.1) );
+ }
+ }
}
// Check to see if the default scene was a kdtree.
- [MANTA] r758 - in trunk: Engine/Control Model/Cameras fox, abe, 12/09/2005
Archive powered by MHonArc 2.6.16.