Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r928 - in trunk: UserInterface fox/FManta


Chronological Thread 
  • From: abe@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r928 - in trunk: UserInterface fox/FManta
  • Date: Sat, 11 Feb 2006 12:07:03 -0700 (MST)

Author: abe
Date: Sat Feb 11 12:07:03 2006
New Revision: 928

Modified:
   trunk/UserInterface/CameraPathAutomator.cc
   trunk/UserInterface/CameraPathAutomator.h
   trunk/fox/FManta/FMantaCapture.cc
   trunk/fox/FManta/FMantaCapture.h
Log:


Added -quiet option to camera path automator. Surpresses performance output 
during sync.
M    UserInterface/CameraPathAutomator.cc
M    UserInterface/CameraPathAutomator.h

Added "Capture One Frame" button to screen capture dialog. Looks like nrrd 
writting is broken for the moment.
M    fox/FManta/FMantaCapture.h
M    fox/FManta/FMantaCapture.cc


Modified: trunk/UserInterface/CameraPathAutomator.cc
==============================================================================
--- trunk/UserInterface/CameraPathAutomator.cc  (original)
+++ trunk/UserInterface/CameraPathAutomator.cc  Sat Feb 11 12:07:03 2006
@@ -257,6 +257,7 @@
   int sync_frames = 0;
   int behavior = PATH_STOP;
   int start = 0, last = 0;
+  bool sync_quiet = false;
   
   Real delta_t    = 0;
   Real delta_time = 0;
@@ -293,6 +294,9 @@
       getArg(i, args, start );
       getArg(i, args, last  );
     }
+    else if (args[i] == "-quiet") {
+      sync_quiet = true;
+    }
   }
 
   
/////////////////////////////////////////////////////////////////////////////
@@ -301,6 +305,7 @@
 
   automator->set_sync_frames  ( sync_frames );
   automator->set_loop_behavior( behavior );
+  automator->set_sync_quiet   ( sync_quiet );
   
   // Check to see if either delta was specified on the command line.
   if (delta_t != 0) {
@@ -442,15 +447,17 @@
   last_sync_seconds = current_sync_seconds;
   last_sync_frame   = current_sync_frame;
 
-  // Output performance since last sync.
-  std::cout << current_sync_frame << " "
-            << issue_transaction << " "
-            << elapse_frame << " "
-            << elapse_seconds << " "
-            << elapse_frame/elapse_seconds << " "
-            << total_elapse_seconds
-            << std::endl;
-  // stdout flush is necessary so that output occurs before program 
terminates.
+  if (!sync_quiet) {
+    // Output performance since last sync.
+    std::cout << current_sync_frame << " "
+              << issue_transaction << " "
+              << elapse_frame << " "
+              << elapse_seconds << " "
+              << elapse_frame/elapse_seconds << " "
+              << total_elapse_seconds
+              << std::endl;
+    // stdout flush is necessary so that output occurs before program 
terminates.
+  }
 }
 
 
///////////////////////////////////////////////////////////////////////////////

Modified: trunk/UserInterface/CameraPathAutomator.h
==============================================================================
--- trunk/UserInterface/CameraPathAutomator.h   (original)
+++ trunk/UserInterface/CameraPathAutomator.h   Sat Feb 11 12:07:03 2006
@@ -80,6 +80,9 @@
     // Number of frames between synchronization points.
     int sync_frames;
 
+    // Should output occur during sync.
+    bool sync_quiet;
+
     
///////////////////////////////////////////////////////////////////////////
     // Behavior
     int loop_behavior;
@@ -140,6 +143,8 @@
     inline void set_interval( int start, int last )   { interval_start = 
start; interval_last = last; };
     inline void get_interval( int &start, int &last ) { start = 
interval_start; last = interval_last; };
 
+    inline void set_sync_quiet( bool sync_quiet_ ) { sync_quiet = 
sync_quiet_; }
+    
     // Get the fps for the last complete run.
     inline Real get_average_fps() { return average_fps; };
 

Modified: trunk/fox/FManta/FMantaCapture.cc
==============================================================================
--- trunk/fox/FManta/FMantaCapture.cc   (original)
+++ trunk/fox/FManta/FMantaCapture.cc   Sat Feb 11 12:07:03 2006
@@ -46,6 +46,7 @@
   //        Message_Type ID                                   Message_Handler
   FXMAPFUNC(SEL_COMMAND, FMantaCaptureDialog::ID_RECORD,        
FMantaCaptureDialog::onRecord ),
   FXMAPFUNC(SEL_COMMAND, FMantaCaptureDialog::ID_STOP,          
FMantaCaptureDialog::onStop ),
+  FXMAPFUNC(SEL_COMMAND, FMantaCaptureDialog::ID_CAPTURE_ONE,   
FMantaCaptureDialog::onCaptureOneFrame )
 };
 
 
FXIMPLEMENT(FMantaCaptureDialog,FXDialogBox,FMantaCaptureDialogMap,ARRAYNUMBER(FMantaCaptureDialogMap));
@@ -67,12 +68,14 @@
 
   new FXLabel( frame, "Prefix: " );
   prefix_field = new FXTextField( frame, 32 );
+  prefix_field->setText( "manta" );
   
   type_box = new FXComboBox( frame, 4 );
   type_box->setEditable( false );
+  type_box->appendItem( "tga" );
   type_box->appendItem( "png" );
   type_box->appendItem( "nrrd" );
-  type_box->appendItem( "tga" );
+
   
   frame = new FXHorizontalFrame( this );
   new FXLabel( frame, "Record every " );
@@ -81,7 +84,7 @@
   
   record_button = new FXButton( frame, "Start", 0, this, ID_RECORD );
   stop_button   = new FXButton( frame, "Stop", 0, this, ID_STOP );
-
+  capture_button= new FXButton( frame, "Capture One Frame", 0, this, 
ID_CAPTURE_ONE );
 }
 
 long FMantaCaptureDialog::onRecord( FXObject *sender, FXSelector key, void 
*data ) {
@@ -112,6 +115,25 @@
   record_button->enable();
   stop_button->disable();
 
+  return 1;
+}
+
+long FMantaCaptureDialog::onCaptureOneFrame( FXObject *sender, FXSelector 
key, void *data ) {
+
+  string prefix = prefix_field->getText().text();
+  string type   = type_box->getText().text();
+  int    skip   = skip_spinner->getValue();
+  
+  manta_window->getMantaInterface()->addTransaction("capture record",
+                                                    Callback::create(this, 
&FMantaCaptureDialog::mantaRecord,
+                                                                     prefix, 
type, skip ),
+                                                    
TransactionBase::CONTINUE );
+  
+  manta_window->getMantaInterface()->addTransaction("capture stop",
+                                                    Callback::create(this, 
&FMantaCaptureDialog::mantaStop ),
+                                                    
TransactionBase::CONTINUE );
+  
+  
   return 1;
 }
 

Modified: trunk/fox/FManta/FMantaCapture.h
==============================================================================
--- trunk/fox/FManta/FMantaCapture.h    (original)
+++ trunk/fox/FManta/FMantaCapture.h    Sat Feb 11 12:07:03 2006
@@ -64,11 +64,13 @@
     
     FXButton *record_button;
     FXButton *stop_button;
+    FXButton *capture_button;
     
   public:
     enum {
       ID_RECORD = FXDialogBox::ID_LAST,
       ID_STOP,
+      ID_CAPTURE_ONE,
       ID_LAST
     };
     
@@ -82,6 +84,7 @@
 
     long onRecord( FXObject *sender, FXSelector key, void *data );
     long onStop  ( FXObject *sender, FXSelector key, void *data );
+    long onCaptureOneFrame( FXObject *sender, FXSelector key, void *data );
 
     void mantaRecord( string prefix, string type, int skip );
     void mantaStop();




  • [MANTA] r928 - in trunk: UserInterface fox/FManta, abe, 02/11/2006

Archive powered by MHonArc 2.6.16.

Top of page