Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r622 - branches/itanium2/fox


Chronological Thread 
  • From: abe@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r622 - branches/itanium2/fox
  • Date: Thu, 13 Oct 2005 13:02:43 -0600 (MDT)

Author: abe
Date: Thu Oct 13 13:02:43 2005
New Revision: 622

Added:
   branches/itanium2/fox/FMantaStereo.cc
   branches/itanium2/fox/FMantaStereo.h
Log:
Added missing files

Added: branches/itanium2/fox/FMantaStereo.cc
==============================================================================
--- (empty file)
+++ branches/itanium2/fox/FMantaStereo.cc       Thu Oct 13 13:02:43 2005
@@ -0,0 +1,121 @@
+/*
+   For more information, please see: http://software.sci.utah.edu
+
+   The MIT License
+
+   Copyright (c) 2005
+   Silicon Graphics Inc. Mountain View California.
+
+   License for the specific language governing rights and limitations under
+   Permission is hereby granted, free of charge, to any person obtaining a
+   copy of this software and associated documentation files (the "Software"),
+   to deal in the Software without restriction, including without limitation
+   the rights to use, copy, modify, merge, publish, distribute, sublicense,
+   and/or sell copies of the Software, and to permit persons to whom the
+   Software is furnished to do so, subject to the following conditions:
+
+   The above copyright notice and this permission notice shall be included
+   in all copies or substantial portions of the Software.
+   
+   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 
MERCHANTABILITY,
+   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+   THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+   DEALINGS IN THE SOFTWARE.
+*/
+
+
+
+#include <Model/Cameras/StereoPinholeCamera.h>
+
+
+#include <fox/FMantaStereo.h>
+
+
+using namespace FX;
+using namespace Manta;
+using namespace fox_manta;
+
+FXDEFMAP(FMantaStereoDialog) FMantaStereoDialogMap[] = {
+  
//////////////////////////////////////////////////////////////////////////////
+  //        Message_Type ID                                   Message_Handler
+  FXMAPFUNC(SEL_COMMAND, FMantaStereoDialog::ID_DISTANCE,        
FMantaStereoDialog::onDistance ),
+  FXMAPFUNC(SEL_COMMAND, FMantaStereoDialog::ID_FOCUS,           
FMantaStereoDialog::onFocus ),
+
+};
+
+FXIMPLEMENT(FMantaStereoDialog,FXDialogBox,FMantaStereoDialogMap,ARRAYNUMBER(FMantaStereoDialogMap));
+
+FMantaStereoDialog::FMantaStereoDialog( FMantaWindow *manta_window_,
+                      const FXString &name, FXuint opts,
+                      FXint x, FXint y, FXint w, FXint h, FXint pl,
+                      FXint pr, FXint pt, FXint pb, FXint hs, FXint vs )
+
+  :
+  
+  FXDialogBox ( manta_window_->getApp(), name, opts, x, y, w, h, pl, pr, pt, 
pb, hs, vs ),
+  manta_window( manta_window_ )
+
+  
+{
+
+  FXHorizontalFrame *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.05 );
+  distance_spinner->setValue( 0.1 );
+
+  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 );
+  
+}
+
+long FMantaStereoDialog::onDistance  ( FXObject *sender, FXSelector key, 
void *data ) {
+
+  Real distance = distance_spinner->getValue();  
+  manta_window->getMantaInterface()->addTransaction("stereo distance",
+                                      Callback::create(this, 
&FMantaStereoDialog::mantaSetDistance,
+                                                       distance ));
+  
+  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;
+}
+
+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 ));
+  if (camera) {
+    camera->set_focus_distance( focus_ );
+  }
+}

Added: branches/itanium2/fox/FMantaStereo.h
==============================================================================
--- (empty file)
+++ branches/itanium2/fox/FMantaStereo.h        Thu Oct 13 13:02:43 2005
@@ -0,0 +1,89 @@
+/*
+   For more information, please see: http://software.sci.utah.edu
+
+   The MIT License
+
+   Copyright (c) 2005
+   Scientific Computing and Imaging Institute, University of Utah
+
+   License for the specific language governing rights and limitations under
+   Permission is hereby granted, free of charge, to any person obtaining a
+   copy of this software and associated documentation files (the "Software"),
+   to deal in the Software without restriction, including without limitation
+   the rights to use, copy, modify, merge, publish, distribute, sublicense,
+   and/or sell copies of the Software, and to permit persons to whom the
+   Software is furnished to do so, subject to the following conditions:
+
+   The above copyright notice and this permission notice shall be included
+   in all copies or substantial portions of the Software.
+   
+   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 
MERCHANTABILITY,
+   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+   THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+   DEALINGS IN THE SOFTWARE.
+*/
+
+#ifndef __FMANTASTEREO_H__
+#define __FMANTASTEREO_H__
+
+
+#include <fox/FMantaWindow.h>
+#include <fox/FMantaUniformNav.h>
+#include <fox/FMantaQuakeNav.h>
+#include <fox/FMantaTrackballNav.h>
+#include <fox/FMantaWidgets.h>
+
+#include <Interface/RTRTInterface.h>
+
+namespace fox_manta {
+
+  using namespace FX;
+  using namespace Manta;
+  using namespace std;
+
+  class FMantaWindow;
+  
+  
//////////////////////////////////////////////////////////////////////////////
+  
//////////////////////////////////////////////////////////////////////////////
+  // Stereo Camera Dialog
+  
//////////////////////////////////////////////////////////////////////////////
+  
//////////////////////////////////////////////////////////////////////////////
+  class FMantaStereoDialog : public FXDialogBox {
+    FXDECLARE(FMantaStereoDialog)
+  private:
+
+    // Objects for playing paths.
+    FMantaWindow *manta_window;
+
+    FXRealSpinner *distance_spinner;
+    FXRealSpinner *focus_spinner;
+    
+  public:
+    enum {
+      ID_DISTANCE = FXDialogBox::ID_LAST,
+      ID_FOCUS,
+      ID_LAST
+    };
+    
+    FMantaStereoDialog::FMantaStereoDialog() { };
+    FMantaStereoDialog( FMantaWindow *manta_window_,
+                        const FXString &name, FXuint opts=DECOR_ALL,
+                        FXint x=50,FXint y=50,FXint w=0,FXint h=0,FXint 
pl=10,
+                        FXint pr=10,FXint pt=10,FXint pb=10,FXint hs=4,FXint 
vs=4 );
+
+    void create() { FXDialogBox::create(); };
+
+    long onDistance( FXObject *sender, FXSelector key, void *data );
+    long onFocus   ( FXObject *sender, FXSelector key, void *data );
+
+    void mantaSetDistance( Real distance_ );
+    void mantaSetFocus   ( Real focus_ );
+  };
+
+};
+
+
+#endif




  • [MANTA] r622 - branches/itanium2/fox, abe, 10/13/2005

Archive powered by MHonArc 2.6.16.

Top of page