Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[Manta] r1819 - trunk/UserInterface


Chronological Thread 
  • From: roni@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [Manta] r1819 - trunk/UserInterface
  • Date: Mon, 5 Nov 2007 13:50:22 -0700 (MST)

Author: roni
Date: Mon Nov  5 13:50:21 2007
New Revision: 1819

Modified:
   trunk/UserInterface/XWindowUI.cc
   trunk/UserInterface/XWindowUI.h
Log:
UserInterface/XWindowUI.cc
UserInterface/XWindowUI.h

        Added "output window" keyboard callback, bound to key "w".
        This just prints the window dimensions on standard out.


Modified: trunk/UserInterface/XWindowUI.cc
==============================================================================
--- trunk/UserInterface/XWindowUI.cc    (original)
+++ trunk/UserInterface/XWindowUI.cc    Mon Nov  5 13:50:21 2007
@@ -340,6 +340,9 @@
                                  DefaultDepth(dpy, screen), InputOutput,
                                  DefaultVisual(dpy, screen), flags, &atts);
 
+  width = window->xres;
+  height = window->yres;
+
   XTextProperty tp;
   ostringstream title;
   title << "Manta ray tracer (channel " << channel << ")";
@@ -413,6 +416,8 @@
                                  int new_xres, int new_yres)
 {
   // cerr << "Resolution: " << new_xres << " " << new_yres << endl;
+  width = new_xres;
+  height = new_yres;
   rtrt_interface->changeResolution(channel, new_xres, new_yres, true);
 }
 
@@ -515,6 +520,9 @@
   register_key(0, XStringToKeysym("v"),
                "autoview",
                Callback::create(this, &XWindowUI::autoview));
+  register_key(0, XStringToKeysym("w"),
+               "output window",
+               Callback::create(this, &XWindowUI::output_window));
   register_key(0, XK_space,
                "animate path",
                Callback::create(this, &XWindowUI::animate_path));
@@ -705,6 +713,11 @@
   Camera* camera = rtrt_interface->getCamera(channel);
   rtrt_interface->addTransaction("output camera",
                                  Callback::create<Camera,std::ostream 
&>(camera, &Camera::output, std::cout));
+}
+
+void XWindowUI::output_window(unsigned int, unsigned long, int)
+{
+  std::cout << "window resolution: " << width << " " << height << std::endl;
 }
 
 void XWindowUI::mouse_fov(unsigned int, unsigned int,

Modified: trunk/UserInterface/XWindowUI.h
==============================================================================
--- trunk/UserInterface/XWindowUI.h     (original)
+++ trunk/UserInterface/XWindowUI.h     Mon Nov  5 13:50:21 2007
@@ -90,6 +90,7 @@
     void animate_path(unsigned int, unsigned long, int);
     void reset_path(unsigned int, unsigned long, int);
     void output_camera(unsigned int, unsigned long, int);
+    void output_window(unsigned int, unsigned long, int);
 
     // button_state (ShiftMask, ControlMask, Mod1Mask),
     // current_button (Button1,2,3,4,5),
@@ -170,6 +171,9 @@
     Real autoview_fov;
     Real trackball_radius;
     bool quitting;
+
+    // The image size
+    int width, height;
 
     XWindowUI(const XWindowUI&);
     XWindowUI& operator=(const XWindowUI&);




  • [Manta] r1819 - trunk/UserInterface, roni, 11/05/2007

Archive powered by MHonArc 2.6.16.

Top of page