Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r647 - in branches/itanium2: Model/Groups fox


Chronological Thread 
  • From: abe@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r647 - in branches/itanium2: Model/Groups fox
  • Date: Fri, 21 Oct 2005 17:47:43 -0600 (MDT)

Author: abe
Date: Fri Oct 21 17:47:42 2005
New Revision: 647

Added:
   branches/itanium2/fox/FMantaKdExplorer.cc
   branches/itanium2/fox/FMantaKdExplorer.h
   branches/itanium2/fox/FMantaTransparent.cc
   branches/itanium2/fox/FMantaTransparent.h
Modified:
   branches/itanium2/Model/Groups/KDTree.h
   branches/itanium2/fox/CMakeLists.txt
   branches/itanium2/fox/dm_demo.cc
Log:

Added a dialog box for traversing the kdtree from the gui. Accessible from 
the Options menu in bin/dm_demo.

This allows you to visualize each split all the way to the leaves.

M    Model/Groups/KDTree.h
A    fox/FMantaKdExplorer.cc
A    fox/FMantaKdExplorer.h
M    fox/CMakeLists.txt


Moved the DmDemoDialog code into FMantaTransparentDialog and into its own 
file.

M    fox/dm_demo.cc
A    fox/FMantaTransparent.cc
A    fox/FMantaTransparent.h

Modified: branches/itanium2/Model/Groups/KDTree.h
==============================================================================
--- branches/itanium2/Model/Groups/KDTree.h     (original)
+++ branches/itanium2/Model/Groups/KDTree.h     Fri Oct 21 17:47:42 2005
@@ -366,6 +366,10 @@
       // np specifies the number of workers, for certain loading functions.
       int load( const char *fn, int np );
 
+      // Accessors (used by gui to examine kdtree).
+      void        setRootNode( KDTreeNode *node ) { rootNode = node; };
+      KDTreeNode *getRootNode()                   { return rootNode; };
+      
     };
 
     
///////////////////////////////////////////////////////////////////////////

Modified: branches/itanium2/fox/CMakeLists.txt
==============================================================================
--- branches/itanium2/fox/CMakeLists.txt        (original)
+++ branches/itanium2/fox/CMakeLists.txt        Fri Oct 21 17:47:42 2005
@@ -38,6 +38,10 @@
     # FMantaTextureChooser.cc
     # FMantaMaterialChooser.h
     # FMantaMaterialChooser.cc
+    FMantaTransparent.h
+    FMantaTransparent.cc
+    FMantaKdExplorer.h
+    FMantaKdExplorer.cc
     MediaFusionBridge.h
     MediaFusionBridge.cc
     MediaFusionApp.h

Added: branches/itanium2/fox/FMantaKdExplorer.cc
==============================================================================
--- (empty file)
+++ branches/itanium2/fox/FMantaKdExplorer.cc   Fri Oct 21 17:47:42 2005
@@ -0,0 +1,200 @@
+
+
+#include <fox/FMantaKdExplorer.h>
+
+
+using namespace fox_manta;
+using namespace FX;
+using namespace Manta;
+using namespace Manta::Kdtree;
+
+FXDEFMAP(FMantaKdExplorerDialog) FMantaKdExplorerDialogMap[] = {
+       
//////////////////////////////////////////////////////////////////////////////
+       //        Message_Type ID                                   
Message_Handler
+       FXMAPFUNC(SEL_COMMAND, FMantaKdExplorerDialog::ID_RESET_ROOT,         
FMantaKdExplorerDialog::onResetRoot ),
+       FXMAPFUNC(SEL_COMMAND, FMantaKdExplorerDialog::ID_SET_PARENT,         
FMantaKdExplorerDialog::onSetParent ),
+       FXMAPFUNC(SEL_COMMAND, FMantaKdExplorerDialog::ID_SET_LEFT,           
FMantaKdExplorerDialog::onSetLeft ),
+       FXMAPFUNC(SEL_COMMAND, FMantaKdExplorerDialog::ID_SET_RIGHT,          
FMantaKdExplorerDialog::onSetRight )  
+};     
+
+FXIMPLEMENT(FMantaKdExplorerDialog,FXDialogBox,FMantaKdExplorerDialogMap,ARRAYNUMBER(FMantaKdExplorerDialogMap));
+
+
+FMantaKdExplorerDialog::FMantaKdExplorerDialog( FMantaWindow *manta_window_,
+                                                                             
                                  KDTree *kdtree_,
+                                                                             
                                  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 ) : 
+       manta_window( manta_window_ ),
+       kdtree( kdtree_ ),
+       FXDialogBox ( manta_window_->getApp(), name, opts, x, y, w, h, pl, 
pr, pt, pb, hs, vs ) 
+{
+
+  // Add the root node to the node_stack.
+  node_stack.push_back( kdtree->getRootNode() );
+  
+       manta_interface = manta_window->getMantaInterface();
+
+  // Depth label.
+  depth_label = new FXLabel( this, "Current Depth" );
+
+  // Node lable.
+  node_label = new FXLabel( this, "Axis: Split:" );
+  
+  // Reset button.  
+       FXHorizontalFrame *frame = new FXHorizontalFrame( this );
+  reset_button = new FXButton( frame, "Reset Root", 0, this, ID_RESET_ROOT );
+
+  // Parent button.
+  frame = new FXHorizontalFrame( this );
+  parent_button = new FXButton( frame, "Parent", 0, this, ID_SET_PARENT );
+
+  // Left and right child buttons.
+  frame = new FXHorizontalFrame( this );
+  left_button  = new FXButton( frame, "Left", 0, this, ID_SET_LEFT );
+  right_button = new FXButton( frame, "Right", 0, this, ID_SET_RIGHT );
+
+
+  update_buttons();
+  
+}
+
+FMantaKdExplorerDialog::~FMantaKdExplorerDialog() {
+
+  // Restore the root node.
+  if (node_stack.size() > 0) {
+    KDTreeNode *root = node_stack.front();
+    manta_interface->addTransaction( "Reset Root", Callback::create( kdtree, 
&KDTree::setRootNode, root ) );
+  }
+}
+
+void FMantaKdExplorerDialog::update_buttons() {
+
+  // Check the node on top of the node_stack and turn off any unnecessary 
buttons.
+
+  // Is the node the root node?
+  if (node_stack.size() == 1) {
+    parent_button->disable();
+  }
+  else {
+    parent_button->enable();
+  }
+
+  KDTreeNode *node = node_stack.back();
+  
+  // Is there a left child?
+  if (node->hasLeftChild()) {
+    left_button->enable();
+  }
+  else {
+    left_button->disable();
+  }
+
+  // Is there a right child?
+  if (node->hasRightChild()) {
+    right_button->enable();
+  }
+  else {
+    right_button->disable();
+  }
+
+  // Depth label.
+  FXString depth_string;
+  depth_string.format( "Current depth: %d", node_stack.size() );
+  depth_label->setText( depth_string );
+
+  // Node label.
+  FXString node_string;
+  if (node->isInternal()) {
+    node_string.format( "Node: Axis: %d Split: %4.3f",
+                        node->axis(),
+                        node->split() );
+  }
+  else {
+    node_string.format( "Leaf: Number of Faces: %d",
+                        node->listSize() );
+  };
+  node_label->setText( node_string );
+  
+}
+
+long FMantaKdExplorerDialog::onResetRoot( FXObject *sender, FXSelector key, 
void *data ) {
+
+  // Reset the node stack.
+  KDTreeNode *root = node_stack.front();
+  node_stack.clear();
+  node_stack.push_back( root );
+  
+  // Update manta.
+  manta_interface->addTransaction( "Reset Root", Callback::create( kdtree, 
&KDTree::setRootNode, root ) );
+
+  // Update buttons.
+  update_buttons();
+                                   
+  return 1;
+}
+
+long FMantaKdExplorerDialog::onSetParent( FXObject *sender, FXSelector key, 
void *data ) {
+
+  if (node_stack.size() > 1) {
+  
+    // Get the node
+    node_stack.pop_back();
+    KDTreeNode *root = node_stack.back();
+  
+    // Update manta.
+    manta_interface->addTransaction( "Set Parent", Callback::create( kdtree, 
&KDTree::setRootNode, root ) );
+
+    // Update buttons.
+    update_buttons();
+
+  }
+                                   
+  return 1;
+}
+
+long FMantaKdExplorerDialog::onSetLeft( FXObject *sender, FXSelector key, 
void *data ) {
+
+  // Check to see if there is a left child.
+  KDTreeNode *root = node_stack.back();
+
+  if (root->hasLeftChild()) {
+
+    // Get the child.
+    KDTreeNode *child = root->left();
+
+    // Add to the stack.
+    node_stack.push_back( child );
+
+    // Update manta.
+    manta_interface->addTransaction( "Set Left", Callback::create( kdtree, 
&KDTree::setRootNode, child ) );
+
+    // Update buttons.
+    update_buttons();
+  }
+  
+  return 1;
+}
+
+long FMantaKdExplorerDialog::onSetRight( FXObject *sender, FXSelector key, 
void *data ) {
+
+  // Check to see if there is a left child.
+  KDTreeNode *root = node_stack.back();
+
+  if (root->hasRightChild()) {
+
+    // Get the child.
+    KDTreeNode *child = root->right();
+
+    // Add to the stack.
+    node_stack.push_back( child );
+
+    // Update manta.
+    manta_interface->addTransaction( "Set Right", Callback::create( kdtree, 
&KDTree::setRootNode, child ) );
+
+    // Update buttons.
+    update_buttons();
+  }
+  
+  return 1;
+}

Added: branches/itanium2/fox/FMantaKdExplorer.h
==============================================================================
--- (empty file)
+++ branches/itanium2/fox/FMantaKdExplorer.h    Fri Oct 21 17:47:42 2005
@@ -0,0 +1,86 @@
+
+#ifndef FMANTA_KDEXPLORERDIALOG__H
+#define FMANTA_KDEXPLORERDIALOG__H
+
+#include <fox/FMantaWindow.h>
+
+using namespace FX;
+using namespace fox_manta;
+using namespace Manta;
+
+#include <Model/Groups/KDTree.h>
+#include <Model/Groups/TransparentKDTree.h>
+using namespace Manta::Kdtree;
+
+#include <list>
+
+namespace fox_manta {
+
+  using namespace Manta;
+  using namespace FX;
+  using namespace Manta::Kdtree;
+
+  using std::list;
+  
+  
//////////////////////////////////////////////////////////////////////////////
+  
//////////////////////////////////////////////////////////////////////////////
+  // Dialog box to alter the kdtree root node and move the start of the
+  // traversal up and down the tree.
+  
//////////////////////////////////////////////////////////////////////////////
+  
//////////////////////////////////////////////////////////////////////////////
+  class FMantaKdExplorerDialog : public FXDialogBox {
+    FXDECLARE(FMantaKdExplorerDialog)
+  private:
+
+    FMantaWindow  *manta_window;
+    RTRTInterface *manta_interface;
+    
+    // Target kdtree.
+    KDTree *kdtree;
+
+    // Information labels.
+    FXLabel *depth_label;
+    FXLabel *node_label;
+
+    // Buttons
+    FXButton *reset_button;
+    FXButton *parent_button;
+    FXButton *left_button;
+    FXButton *right_button;
+
+    // Saved nodes.
+    list<KDTreeNode *> node_stack;
+
+    // Helper functions
+    void update_buttons();
+    
+  public:
+    enum {
+      ID_RESET_ROOT = FXDialogBox::ID_LAST,
+      ID_SET_PARENT,
+      ID_SET_LEFT,
+      ID_SET_RIGHT,
+      ID_LAST
+    };
+    
+    FMantaKdExplorerDialog() {  };
+    FMantaKdExplorerDialog( FMantaWindow *manta_window_,
+                            KDTree *kdtree_,
+                  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 
);
+    virtual ~FMantaKdExplorerDialog();
+               
+    void create() { FXDialogBox::create(); show( PLACEMENT_DEFAULT ); };
+       
+    long onResetRoot( FXObject *sender, FXSelector key, void *data );
+    long onSetParent( FXObject *sender, FXSelector key, void *data );
+    long onSetLeft  ( FXObject *sender, FXSelector key, void *data );
+    long onSetRight ( FXObject *sender, FXSelector key, void *data );
+
+  };
+
+};
+
+#endif
+

Added: branches/itanium2/fox/FMantaTransparent.cc
==============================================================================
--- (empty file)
+++ branches/itanium2/fox/FMantaTransparent.cc  Fri Oct 21 17:47:42 2005
@@ -0,0 +1,84 @@
+
+
+#include <fox/FMantaTransparent.h>
+
+
+using namespace fox_manta;
+using namespace FX;
+using namespace Manta;
+using namespace Manta::Kdtree;
+
+FXDEFMAP(FMantaTransparentDialog) FMantaTransparentDialogMap[] = {
+       
//////////////////////////////////////////////////////////////////////////////
+       //        Message_Type ID                                   
Message_Handler
+       FXMAPFUNC(SEL_COMMAND, 
FMantaTransparentDialog::ID_RENDER_MODE_SELECT,    
FMantaTransparentDialog::onRenderModeSelect ),
+       FXMAPFUNC(SEL_COMMAND, FMantaTransparentDialog::ID_ALPHA_SLIDER,      
    FMantaTransparentDialog::onAlphaSlider )
+};     
+
+FXIMPLEMENT(FMantaTransparentDialog,FXDialogBox,FMantaTransparentDialogMap,ARRAYNUMBER(FMantaTransparentDialogMap));
+
+
+FMantaTransparentDialog::FMantaTransparentDialog( FMantaWindow 
*manta_window_,
+                                                                             
                                  KDTree *kdtree_, TransparentKDTree 
*transparent_kdtree_,
+                                                                             
                                  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 ) : 
+       manta_window( manta_window_ ),
+       kdtree( kdtree_ ), transparent_kdtree( transparent_kdtree_ ),
+       FXDialogBox ( manta_window_->getApp(), name, opts, x, y, w, h, pl, 
pr, pt, pb, hs, vs ) 
+{
+
+       RTRTInterface *manta_interface = manta_window->getMantaInterface();
+       
+       FXHorizontalFrame *frame = new FXHorizontalFrame( this );
+
+       // Add render mode selection box.
+       render_mode_box = new FXListBox( frame, this, ID_RENDER_MODE_SELECT );
+       render_mode_box->appendItem( "Opaque Surfaces", 0, kdtree );
+       render_mode_box->appendItem( "Transparent Surfaces", 0, 
transparent_kdtree );
+       
+       // Add alpha slider.
+       frame = new FXHorizontalFrame( this, LAYOUT_FILL_X );
+       new FXLabel( frame, "Alpha: " );
+       // alpha_slider = new FXRealSlider( frame, this, ID_ALPHA_SLIDER, 
LAYOUT_FILL_X );
+       
+       alpha_slider = new FMantaRealSlider( frame, 
+                       new FMantaSet<TransparentKDTree,Real>( 
manta_interface, transparent_kdtree, &TransparentKDTree::setAlpha ),
+                       LAYOUT_FILL_X );
+                       
+       alpha_slider->setRange( 0.0, 1.0 );
+       alpha_slider->setValue( transparent_kdtree->getAlpha() );
+       alpha_slider->disable();
+       
+}
+
+long FMantaTransparentDialog::onRenderModeSelect( FXObject *sender, 
FXSelector key, void *data ) {
+
+       // Determine which option selected.
+       int index = render_mode_box->getCurrentItem();
+       Object *new_root = (Object *)render_mode_box->getItemData( index );
+       
+       if (new_root == kdtree) {
+               alpha_slider->disable();
+       }
+       
+       if (new_root == transparent_kdtree) {
+               alpha_slider->enable();
+       }
+       
+       manta_window->setSceneObject( new_root );
+
+       return 1;
+}
+
+long FMantaTransparentDialog::onAlphaSlider     ( FXObject *sender, 
FXSelector key, void *data ) {
+
+       // Set the control speed for interaction.
+       Real alpha = *((double *)data);
+       
+       manta_window->getMantaInterface()->addTransaction("Set Alpha",
+               Callback::create( transparent_kdtree, 
&TransparentKDTree::setAlpha,alpha));
+       
+       return 1;
+
+}

Added: branches/itanium2/fox/FMantaTransparent.h
==============================================================================
--- (empty file)
+++ branches/itanium2/fox/FMantaTransparent.h   Fri Oct 21 17:47:42 2005
@@ -0,0 +1,64 @@
+
+#ifndef FMANTA_TRANSPARENT__H
+#define FMANTA_TRANSPARENT__H
+
+#include <fox/FMantaWindow.h>
+
+using namespace FX;
+using namespace fox_manta;
+using namespace Manta;
+
+#include <Model/Groups/KDTree.h>
+#include <Model/Groups/TransparentKDTree.h>
+using namespace Manta::Kdtree;
+
+namespace fox_manta {
+
+  using namespace Manta;
+  using namespace FX;
+  using namespace Manta::Kdtree;
+  
+  
//////////////////////////////////////////////////////////////////////////////
+  
//////////////////////////////////////////////////////////////////////////////
+  // Transparent surface dialog box.
+  
//////////////////////////////////////////////////////////////////////////////
+  
//////////////////////////////////////////////////////////////////////////////
+  class FMantaTransparentDialog : public FXDialogBox {
+    FXDECLARE(FMantaTransparentDialog)
+      private:
+    FXListBox    *render_mode_box;
+    // FXRealSlider *alpha_slider;
+    FMantaRealSlider *alpha_slider;
+
+    FMantaWindow *manta_window;
+       
+    KDTree *kdtree;
+    TransparentKDTree *transparent_kdtree;
+       
+  public:
+    enum {
+      ID_RENDER_MODE_SELECT = FXDialogBox::ID_LAST,
+      ID_ALPHA_SLIDER,
+      ID_LAST
+    };
+    FMantaTransparentDialog() {  };
+    FMantaTransparentDialog( FMantaWindow *manta_window_,
+                  KDTree *kdtree_, TransparentKDTree *transparent_kdtree_,
+                  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 setKdtrees( KDTree *kdtree_, TransparentKDTree *transparent_kdtree_ 
) {
+      kdtree = kdtree_; transparent_kdtree = transparent_kdtree_; }
+       
+    void create() { FXDialogBox::create(); show( PLACEMENT_DEFAULT ); };
+       
+    long onRenderModeSelect( FXObject *sender, FXSelector key, void *data );
+    long onAlphaSlider     ( FXObject *sender, FXSelector key, void *data );
+
+  };
+
+};
+
+#endif
+

Modified: branches/itanium2/fox/dm_demo.cc
==============================================================================
--- branches/itanium2/fox/dm_demo.cc    (original)
+++ branches/itanium2/fox/dm_demo.cc    Fri Oct 21 17:47:42 2005
@@ -43,7 +43,10 @@
 #include <fox/FMantaQuakeNav.h>
 #include <fox/FMantaTrackballNav.h>
 #include <fox/FMantaWidgets.h>
+
 #include <fox/FMantaStereo.h>
+#include <fox/FMantaTransparent.h>
+#include <fox/FMantaKdExplorer.h>
 
 // #include <histx/SingleSamplerCounter.h>
 
@@ -61,120 +64,7 @@
 #include <Model/Materials/CopyColorMaterial.h>
 using namespace Manta::Kdtree;
 
-//////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-// Digital Mockup Dialog Box.
-//////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-class DmDemoDialog : public FXDialogBox {
-       FXDECLARE(DmDemoDialog)
-private:
-       FXListBox    *render_mode_box;
-       // FXRealSlider *alpha_slider;
-       FMantaRealSlider *alpha_slider;
-
-       FMantaWindow *manta_window;
-       
-       KDTree *kdtree;
-       TransparentKDTree *transparent_kdtree;
-       
-public:
-       enum {
-               ID_RENDER_MODE_SELECT = FXDialogBox::ID_LAST,
-               ID_ALPHA_SLIDER,
-               ID_LAST
-       };
-       DmDemoDialog() {  };
-       DmDemoDialog( FMantaWindow *manta_window_,
-                     KDTree *kdtree_, TransparentKDTree *transparent_kdtree_,
-                                                               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 setKdtrees( KDTree *kdtree_, TransparentKDTree 
*transparent_kdtree_ ) {
-               kdtree = kdtree_; transparent_kdtree = transparent_kdtree_; }
-       
-       void create() { FXDialogBox::create(); show( PLACEMENT_DEFAULT ); };
-       
-       long onRenderModeSelect( FXObject *sender, FXSelector key, void *data 
);
-       long onAlphaSlider     ( FXObject *sender, FXSelector key, void *data 
);
-
-};
-
-FXDEFMAP(DmDemoDialog) DmDemoDialogMap[] = {
-       
//////////////////////////////////////////////////////////////////////////////
-       //        Message_Type ID                                   
Message_Handler
-       FXMAPFUNC(SEL_COMMAND, DmDemoDialog::ID_RENDER_MODE_SELECT,    
DmDemoDialog::onRenderModeSelect ),
-       FXMAPFUNC(SEL_COMMAND, DmDemoDialog::ID_ALPHA_SLIDER,          
DmDemoDialog::onAlphaSlider )
-};     
-
-FXIMPLEMENT(DmDemoDialog,FXDialogBox,DmDemoDialogMap,ARRAYNUMBER(DmDemoDialogMap));
-
-
-DmDemoDialog::DmDemoDialog( FMantaWindow *manta_window_,
-                                                                             
                                  KDTree *kdtree_, TransparentKDTree 
*transparent_kdtree_,
-                                                                             
                                  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 ) : 
-       manta_window( manta_window_ ),
-       kdtree( kdtree_ ), transparent_kdtree( transparent_kdtree_ ),
-       FXDialogBox ( manta_window_->getApp(), name, opts, x, y, w, h, pl, 
pr, pt, pb, hs, vs ) 
-{
-
-       RTRTInterface *manta_interface = manta_window->getMantaInterface();
-       
-       FXHorizontalFrame *frame = new FXHorizontalFrame( this );
-
-       // Add render mode selection box.
-       render_mode_box = new FXListBox( frame, this, ID_RENDER_MODE_SELECT );
-       render_mode_box->appendItem( "Opaque Surfaces", 0, kdtree );
-       render_mode_box->appendItem( "Transparent Surfaces", 0, 
transparent_kdtree );
-       
-       // Add alpha slider.
-       frame = new FXHorizontalFrame( this, LAYOUT_FILL_X );
-       new FXLabel( frame, "Alpha: " );
-       // alpha_slider = new FXRealSlider( frame, this, ID_ALPHA_SLIDER, 
LAYOUT_FILL_X );
-       
-       alpha_slider = new FMantaRealSlider( frame, 
-                       new FMantaSet<TransparentKDTree,Real>( 
manta_interface, transparent_kdtree, &TransparentKDTree::setAlpha ),
-                       LAYOUT_FILL_X );
-                       
-       alpha_slider->setRange( 0.0, 1.0 );
-       alpha_slider->setValue( transparent_kdtree->getAlpha() );
-       alpha_slider->disable();
-       
-}
-
-long DmDemoDialog::onRenderModeSelect( FXObject *sender, FXSelector key, 
void *data ) {
 
-       // Determine which option selected.
-       int index = render_mode_box->getCurrentItem();
-       Object *new_root = (Object *)render_mode_box->getItemData( index );
-       
-       if (new_root == kdtree) {
-               alpha_slider->disable();
-       }
-       
-       if (new_root == transparent_kdtree) {
-               alpha_slider->enable();
-       }
-       
-       manta_window->setSceneObject( new_root );
-
-       return 1;
-}
-
-long DmDemoDialog::onAlphaSlider     ( FXObject *sender, FXSelector key, 
void *data ) {
-
-       // Set the control speed for interaction.
-       Real alpha = *((double *)data);
-       
-       manta_window->getMantaInterface()->addTransaction("Set Alpha",
-               Callback::create( transparent_kdtree, 
&TransparentKDTree::setAlpha,alpha));
-       
-       return 1;
-
-}
 
 
 
//////////////////////////////////////////////////////////////////////////////
@@ -379,10 +269,13 @@
                __global_transparent_kdtree = transparent_kdtree;
                __global_kdtree = kdtree;
                
-               // Create a new extra options dialog.
+               // Create a transparency dialog
                manta_window.addExtraOptionsDialog( "Transparency",
-      new DmDemoDialog( &manta_window, kdtree, transparent_kdtree, 
"Transparency" ));
-               
+      new FMantaTransparentDialog( &manta_window, kdtree, 
transparent_kdtree, "Transparency" ));
+
+               // Create a kdtree explorer dialog.
+    manta_window.addExtraOptionsDialog( "kd-Tree Explorer",
+      new FMantaKdExplorerDialog( &manta_window, kdtree, "kd-Tree Explorer" 
));
        }
        
        




  • [MANTA] r647 - in branches/itanium2: Model/Groups fox, abe, 10/21/2005

Archive powered by MHonArc 2.6.16.

Top of page