Text archives Help
- From: abe@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [MANTA] r707 - branches/itanium2/fox
- Date: Sun, 13 Nov 2005 23:02:32 -0700 (MST)
Author: abe
Date: Sun Nov 13 23:02:29 2005
New Revision: 707
Modified:
branches/itanium2/fox/FMantaRecorder.cc
branches/itanium2/fox/FMantaTransparent.cc
branches/itanium2/fox/FMantaWindow.cc
branches/itanium2/fox/FMantaWindow.h
branches/itanium2/fox/MediaFusionBridge.cc
branches/itanium2/fox/dm_demo.cc
branches/itanium2/fox/sc_demo.cc
Log:
Updates for Boeing/Intel/SGI Demo.
1.) Made transparent mode with alpha==1.0 default rendering mode.
2.) Added ability to add bookmarks and specify name in a dialog box,
added save bookmarks option to file menu.
3.) Added "Hide on Select" and "Unhide All" menu options.
M fox/FMantaRecorder.cc
M fox/FMantaWindow.cc
M fox/FMantaWindow.h
M fox/dm_demo.cc
M fox/sc_demo.cc
M fox/MediaFusionBridge.cc
M fox/FMantaTransparent.cc
Modified: branches/itanium2/fox/FMantaRecorder.cc
==============================================================================
--- branches/itanium2/fox/FMantaRecorder.cc (original)
+++ branches/itanium2/fox/FMantaRecorder.cc Sun Nov 13 23:02:29 2005
@@ -286,6 +286,7 @@
// which will enable the play button.
automator->set_loop_behavior( CameraPathAutomator::PATH_ABORT );
+ automator->set_automator_mode( AutomatorUI::AUTOMATOR_EXIT );
return 1;
}
Modified: branches/itanium2/fox/FMantaTransparent.cc
==============================================================================
--- branches/itanium2/fox/FMantaTransparent.cc (original)
+++ branches/itanium2/fox/FMantaTransparent.cc Sun Nov 13 23:02:29 2005
@@ -36,6 +36,9 @@
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 );
+
+ // Transparent by default
+ render_mode_box->setCurrentItem( 1 );
// Add alpha slider.
frame = new FXHorizontalFrame( this, LAYOUT_FILL_X );
@@ -48,7 +51,9 @@
alpha_slider->setRange( 0.0, 1.0 );
alpha_slider->setValue( transparent_kdtree->getAlpha() );
- alpha_slider->disable();
+
+ // Transparent by default
+ // alpha_slider->disable();
}
Modified: branches/itanium2/fox/FMantaWindow.cc
==============================================================================
--- branches/itanium2/fox/FMantaWindow.cc (original)
+++ branches/itanium2/fox/FMantaWindow.cc Sun Nov 13 23:02:29 2005
@@ -26,55 +26,58 @@
using namespace Manta;
FXDEFMAP(FMantaWindow) FMantaWindowMap[] = {
-
//////////////////////////////////////////////////////////////////////////////
- // Message_Type ID
Message_Handler
- FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_QUIT,
FMantaWindow::onQuit ),
- FXMAPFUNC(SEL_COMMAND, FXApp::ID_QUIT,
FMantaWindow::onQuit ),
-
- // Control options
- FXMAPFUNC(SEL_CHANGED, FMantaWindow::ID_SPEED_SLIDER,
FMantaWindow::onSpeedSlider ),
- FXMAPFUNC(SEL_CHANGED, FMantaWindow::ID_CUTTING_SLIDER,
FMantaWindow::onCuttingSlider ),
- FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_CUTTING_FLIP,
FMantaWindow::onCuttingFlip ),
- FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_BOOKMARK_LIST,
FMantaWindow::onCameraBookmark ),
- FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_NAVIGATOR_LIST,
FMantaWindow::onNavigator ),
- FXMAPFUNC(SEL_KEYPRESS,0,
FMantaWindow::onNavigatorToggle ),
- FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_ADD_BOOKMARK,
FMantaWindow::onAddBookmark ),
-
- // Cameras.
- FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_PINHOLE_CAMERA,
FMantaWindow::onCamera ),
- FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_ORTHO_CAMERA,
FMantaWindow::onCamera ),
- FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_ENVIRONMENT_CAMERA,
FMantaWindow::onCamera ),
+
//////////////////////////////////////////////////////////////////////////////
+ // Message_Type ID Message_Handler
+ FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_QUIT,
FMantaWindow::onQuit ),
+ FXMAPFUNC(SEL_COMMAND,
FMantaWindow::ID_SAVE_BOOKMARKS,FMantaWindow::onSaveBookmarks ),
+ FXMAPFUNC(SEL_COMMAND, FXApp::ID_QUIT,
FMantaWindow::onQuit ),
+
+ // Control options
+ FXMAPFUNC(SEL_CHANGED, FMantaWindow::ID_SPEED_SLIDER,
FMantaWindow::onSpeedSlider ),
+ FXMAPFUNC(SEL_CHANGED, FMantaWindow::ID_CUTTING_SLIDER,
FMantaWindow::onCuttingSlider ),
+ FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_CUTTING_FLIP,
FMantaWindow::onCuttingFlip ),
+ FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_BOOKMARK_LIST,
FMantaWindow::onCameraBookmark ),
+ FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_NAVIGATOR_LIST,
FMantaWindow::onNavigator ),
+ FXMAPFUNC(SEL_KEYPRESS,0,
FMantaWindow::onNavigatorToggle ),
+ FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_ADD_BOOKMARK,
FMantaWindow::onAddBookmark ),
+
+ // Cameras.
+ FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_PINHOLE_CAMERA,
FMantaWindow::onCamera ),
+ FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_ORTHO_CAMERA,
FMantaWindow::onCamera ),
+ FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_ENVIRONMENT_CAMERA,
FMantaWindow::onCamera ),
FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_FISHEYE_CAMERA,
FMantaWindow::onCamera ),
- FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_TEXT_CAMERA,
FMantaWindow::onCameraText ),
+ FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_TEXT_CAMERA,
FMantaWindow::onCameraText ),
FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_CAMERA_PATHS,
FMantaWindow::onCameraPath ),
- // Shadows.
- FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_HARD_SHADOWS,
FMantaWindow::onShadowAlgorithm ),
- FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_NO_SHADOWS,
FMantaWindow::onShadowAlgorithm ),
- FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_TEXT_SHADOWS,
FMantaWindow::onShadowAlgorithmText ),
-
- // Samplers.
- FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_SINGLE_SAMPLER,
FMantaWindow::onPixelSampler ),
- FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_JITTER2_SAMPLER,
FMantaWindow::onPixelSampler ),
- FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_JITTER4_SAMPLER,
FMantaWindow::onPixelSampler ),
- FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_JITTER8_SAMPLER,
FMantaWindow::onPixelSampler ),
- FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_TEXT_SAMPLER,
FMantaWindow::onPixelSamplerText ),
+ // Shadows.
+ FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_HARD_SHADOWS,
FMantaWindow::onShadowAlgorithm ),
+ FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_NO_SHADOWS,
FMantaWindow::onShadowAlgorithm ),
+ FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_TEXT_SHADOWS,
FMantaWindow::onShadowAlgorithmText ),
+
+ // Samplers.
+ FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_SINGLE_SAMPLER,
FMantaWindow::onPixelSampler ),
+ FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_JITTER2_SAMPLER,
FMantaWindow::onPixelSampler ),
+ FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_JITTER4_SAMPLER,
FMantaWindow::onPixelSampler ),
+ FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_JITTER8_SAMPLER,
FMantaWindow::onPixelSampler ),
+ FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_TEXT_SAMPLER,
FMantaWindow::onPixelSamplerText ),
- // Traversers
+ // Traversers
FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_TILED_TRAVERSER,
FMantaWindow::onTraverser ),
FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_FRAMELESS_TRAVERSER,
FMantaWindow::onTraverser ),
FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_DISSOLVETILED_TRAVERSER,
FMantaWindow::onTraverser ),
- FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_TEXT_TRAVERSER,
FMantaWindow::onTraverserText ),
-
- // Cutting planes.
- FXMAPFUNC(SEL_LEFTBUTTONPRESS, FMantaImageFrame::ID_PIXEL_SELECT,
FMantaWindow::onAddCuttingPlane ),
+ FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_TEXT_TRAVERSER,
FMantaWindow::onTraverserText ),
- // Picking
- FXMAPFUNC(SEL_RIGHTBUTTONPRESS, FMantaImageFrame::ID_PIXEL_SELECT,
FMantaWindow::onPick ),
+ // Cutting planes.
+ FXMAPFUNC(SEL_LEFTBUTTONPRESS, FMantaImageFrame::ID_PIXEL_SELECT,
FMantaWindow::onAddCuttingPlane ),
- // Other options.
- FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_EXTRA_OPTIONS,
FMantaWindow::onExtraOptions )
+ // Picking
+ FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_HIDE_SELECTED,
FMantaWindow::onHideSelected ),
+ FXMAPFUNC(SEL_RIGHTBUTTONPRESS, FMantaImageFrame::ID_PIXEL_SELECT,
FMantaWindow::onPick ),
+
+ // Other options.
+ FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_EXTRA_OPTIONS,
FMantaWindow::onExtraOptions ),
+ FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_UNHIDE_ALL,
FMantaWindow::onUnHideAll )
};
FXIMPLEMENT(FMantaWindow,FXMainWindow,FMantaWindowMap,ARRAYNUMBER(FMantaWindowMap));
@@ -83,105 +86,117 @@
bool use_glx,
int width, int height,
int xres, int yres,
-
FXIcon *ic,FXIcon *mi,FXuint opts,FXint
x,FXint y,FXint w,FXint h,FXint pl,FXint pr,FXint pt,FXint pb,FXint hs,FXint
vs )
- : FXMainWindow( app, name, ic, mi, opts, x, y, width, height, pl, pr,
pt, pb, hs, vs ),
+ FXIcon *ic,FXIcon *mi,FXuint opts,FXint x,FXint
y,FXint w,FXint h,FXint pl,FXint pr,FXint pt,FXint pb,FXint hs,FXint vs )
+ : FXMainWindow( app, name, ic, mi, opts, x, y, width, height, pl, pr, pt,
pb, hs, vs ),
- manta_interface( 0 ),
- fast_quit( false ) ,
- cutting_snap( 1 ),
- extra_options_dialog( 0 )
+ manta_interface( 0 ),
+ fast_quit( false ) ,
+ cutting_snap( 1 ),
+ extra_options_dialog( 0 )
{
/////////////////////////////////////////////////////////////////////////////
- // Menu Bar.
- menu_bar = new FXMenuBar( this, LAYOUT_FILL_X );
+ // Menu Bar.
+ menu_bar = new FXMenuBar( this, LAYOUT_FILL_X );
- // File Menu.
- file_menu = new FXMenuPane( this );
- new FXMenuCommand( file_menu, "Quit", 0, this, ID_QUIT );
- new FXMenuTitle ( menu_bar, "File", 0, file_menu );
-
- // Camera menu.
- camera_menu = new FXMenuPane( this );
- new FXMenuCommand( camera_menu, "Pinhole Camera", 0, this,
ID_PINHOLE_CAMERA );
- new FXMenuCommand( camera_menu, "Orthogonal Camera", 0, this,
ID_ORTHO_CAMERA );
- new FXMenuCommand( camera_menu, "Environment Camera", 0, this,
ID_ENVIRONMENT_CAMERA );
+ // File Menu.
+ file_menu = new FXMenuPane( this );
+ new FXMenuCommand( file_menu, "Save Bookmarks", 0, this, ID_SAVE_BOOKMARKS
);
+ new FXMenuCommand( file_menu, "Quit", 0, this, ID_QUIT );
+ new FXMenuTitle ( menu_bar, "File", 0, file_menu );
+
+ // Camera menu.
+ camera_menu = new FXMenuPane( this );
+ new FXMenuCommand( camera_menu, "Pinhole Camera", 0, this,
ID_PINHOLE_CAMERA );
+ new FXMenuCommand( camera_menu, "Orthogonal Camera", 0, this,
ID_ORTHO_CAMERA );
+ new FXMenuCommand( camera_menu, "Environment Camera", 0, this,
ID_ENVIRONMENT_CAMERA );
new FXMenuCommand( camera_menu, "Fish Eye Camera", 0, this,
ID_FISHEYE_CAMERA );
- new FXMenuCommand( camera_menu, "Enter Text...", 0, this,
ID_TEXT_CAMERA );
+ new FXMenuCommand( camera_menu, "Enter Text...", 0, this, ID_TEXT_CAMERA );
new FXMenuSeparator( camera_menu );
new FXMenuCommand( camera_menu, "Camera Paths", 0, this, ID_CAMERA_PATHS );
new FXMenuTitle ( menu_bar, "Camera", 0, camera_menu );
- // Shadow Menu.
- shadow_menu = new FXMenuPane( this );
- new FXMenuCommand( shadow_menu, "Hard Shadows", 0, this,
ID_HARD_SHADOWS );
- new FXMenuCommand( shadow_menu, "No Shadows", 0, this, ID_NO_SHADOWS
);
- new FXMenuCommand( shadow_menu, "Enter Text...", 0, this,
ID_TEXT_SHADOWS );
- // new FXMenuTitle ( menu_bar, "Shadows", 0, shadow_menu );
-
- // Sampler menu.
- sampler_menu = new FXMenuPane( this );
- new FXMenuCommand( sampler_menu, "Single Sample", 0, this,
ID_SINGLE_SAMPLER );
- new FXMenuCommand( sampler_menu, "Jitter 2 Samples", 0, this,
ID_JITTER2_SAMPLER );
- new FXMenuCommand( sampler_menu, "Jitter 4 Samples", 0, this,
ID_JITTER4_SAMPLER );
- new FXMenuCommand( sampler_menu, "Jitter 8 Samples", 0, this,
ID_JITTER8_SAMPLER );
- new FXMenuCommand( sampler_menu, "Enter Text...", 0, this,
ID_TEXT_SAMPLER );
- // new FXMenuTitle( menu_bar, "Samplers", 0, sampler_menu );
+ // Shadow Menu.
+ shadow_menu = new FXMenuPane( this );
+ new FXMenuCommand( shadow_menu, "Hard Shadows", 0, this, ID_HARD_SHADOWS );
+ new FXMenuCommand( shadow_menu, "No Shadows", 0, this, ID_NO_SHADOWS );
+ new FXMenuCommand( shadow_menu, "Enter Text...", 0, this, ID_TEXT_SHADOWS
);
+ // new FXMenuTitle ( menu_bar, "Shadows", 0, shadow_menu );
+
+ // Sampler menu.
+ sampler_menu = new FXMenuPane( this );
+ new FXMenuCommand( sampler_menu, "Single Sample", 0, this,
ID_SINGLE_SAMPLER );
+ new FXMenuCommand( sampler_menu, "Jitter 2 Samples", 0, this,
ID_JITTER2_SAMPLER );
+ new FXMenuCommand( sampler_menu, "Jitter 4 Samples", 0, this,
ID_JITTER4_SAMPLER );
+ new FXMenuCommand( sampler_menu, "Jitter 8 Samples", 0, this,
ID_JITTER8_SAMPLER );
+ new FXMenuCommand( sampler_menu, "Enter Text...", 0, this,
ID_TEXT_SAMPLER );
+ // new FXMenuTitle( menu_bar, "Samplers", 0, sampler_menu );
- // Traverser Menu.
- traverser_menu = new FXMenuPane( this );
+ // Traverser Menu.
+ traverser_menu = new FXMenuPane( this );
new FXMenuCommand( traverser_menu, "Tiled", 0, this, ID_TILED_TRAVERSER );
new FXMenuCommand( traverser_menu, "Frameless", 0, this,
ID_FRAMELESS_TRAVERSER );
new FXMenuCommand( traverser_menu, "Dissolve Tiled", 0, this,
ID_DISSOLVETILED_TRAVERSER );
new FXMenuCommand( traverser_menu, "Enter Text...", 0, this,
ID_TEXT_TRAVERSER );
- // new FXMenuTitle( menu_bar, "Traversers", 0, traverser_menu );
+ // new FXMenuTitle( menu_bar, "Traversers", 0, traverser_menu );
+
+ // Options menu.
+ options_menu = new FXMenuPane( this );
+
+ // Cutting planes.
+ new FXMenuCheck( options_menu, "Snap Cutting Planes", new FXDataTarget(
cutting_snap ), FXDataTarget::ID_VALUE );
+ cutting_flip = new FXMenuCommand( options_menu, "Flip Cutting Plane", 0,
this, ID_CUTTING_FLIP );
+ cutting_flip->disable();
+
+ // Hide/Show
+ hide_selected_check = new FXMenuCheck( options_menu, "Hide on Select",
this, ID_HIDE_SELECTED );
+ new FXMenuCommand( options_menu, "Unhide All", 0, this, ID_UNHIDE_ALL );
+
- // Options menu.
- options_menu = new FXMenuPane( this );
- new FXMenuCheck( options_menu, "Snap Cutting Planes", new
FXDataTarget( cutting_snap ), FXDataTarget::ID_VALUE );
- cutting_flip = new FXMenuCommand( options_menu, "Flip Cutting
Plane", 0, this, ID_CUTTING_FLIP );
- cutting_flip->disable();
+ // Fly to bookmarks.
+ // fly_bookmarks_check = new FXMenuCheck( options_menu, "Fly to Bookmarks"
);
+ // fly_bookmarks_check->enable();
new FXMenuSeparator( options_menu );
- new FXMenuTitle( menu_bar, "Options", 0, options_menu );
+ new FXMenuTitle( menu_bar, "Options", 0, options_menu );
/////////////////////////////////////////////////////////////////////////////
- // Create the content of the window.
+ // Create the content of the window.
FXComposite *frame = 0;
FXComposite *viewers = new FXVerticalFrame( this, LAYOUT_FILL );
- FXComposite *controls = new FXVerticalFrame( this,
FRAME_GROOVE|LAYOUT_FILL_X|LAYOUT_SIDE_BOTTOM );
+ FXComposite *controls = new FXVerticalFrame( this,
FRAME_GROOVE|LAYOUT_FILL_X|LAYOUT_SIDE_BOTTOM );
/////////////////////////////////////////////////////////////////////////////
// Sliders.
- // Control speed.
+ // Control speed.
frame = new FXHorizontalFrame( controls, LAYOUT_FILL_X );
new FXLabel( frame, "Control Speed: " );
- speed_slider = new FXRealSlider( frame, this, ID_SPEED_SLIDER,
REALSLIDER_HORIZONTAL|LAYOUT_FILL_X );
- speed_slider->setRange( 0.001, 5.0 );
+ speed_slider = new FXRealSlider( frame, this, ID_SPEED_SLIDER,
REALSLIDER_HORIZONTAL|LAYOUT_FILL_X );
+ speed_slider->setRange( 0.001, 5.0 );
- // Cutting plane slider.
+ // Cutting plane slider.
frame = new FXHorizontalFrame( controls, LAYOUT_FILL_X );
new FXLabel( frame, "Cutting Plane: " );
- cutting_slider = new FXRealSlider( frame, this, ID_CUTTING_SLIDER,
REALSLIDER_HORIZONTAL|LAYOUT_FILL_X );
- cutting_slider->setRange( -1.0, 1.0 );
- cutting_slider->setValue( 0.0 );
- cutting_slider->disable();
+ cutting_slider = new FXRealSlider( frame, this, ID_CUTTING_SLIDER,
REALSLIDER_HORIZONTAL|LAYOUT_FILL_X );
+ cutting_slider->setRange( -1.0, 1.0 );
+ cutting_slider->setValue( 0.0 );
+ cutting_slider->disable();
/////////////////////////////////////////////////////////////////////////////
- // Navigators.
+ // Navigators.
frame = new FXHorizontalFrame( controls, LAYOUT_FILL_X );
new FXLabel( frame, "Camera Controls:" );
- navigator_list = new FXListBox( frame, this, ID_NAVIGATOR_LIST,
LAYOUT_BOTTOM|COMBOBOX_STATIC,0,0,0,20 );
- navigator_list->setNumVisible( 3 );
+ navigator_list = new FXListBox( frame, this, ID_NAVIGATOR_LIST,
LAYOUT_BOTTOM|COMBOBOX_STATIC,0,0,0,20 );
+ navigator_list->setNumVisible( 3 );
- // Camera bookmarks.
- camera_bookmark_list = new FXListBox( frame, this, ID_BOOKMARK_LIST,
LAYOUT_FILL_X|LAYOUT_BOTTOM|COMBOBOX_REPLACE,0,0,0,20 );
- camera_bookmark_list->setNumVisible( 5 );
+ // Camera bookmarks.
+ camera_bookmark_list = new FXListBox( frame, this, ID_BOOKMARK_LIST,
LAYOUT_FILL_X|LAYOUT_BOTTOM|COMBOBOX_REPLACE,0,0,0,20 );
+ camera_bookmark_list->setNumVisible( 5 );
- new FXButton( frame, "Add", 0, this, ID_ADD_BOOKMARK );
+ new FXButton( frame, "Add", 0, this, ID_ADD_BOOKMARK );
/////////////////////////////////////////////////////////////////////////////
// Camera paths dialog.
@@ -189,9 +204,8 @@
camera_path_dialog->hide();
//////////////////////////////////////////////////////////////////////////////
- // Manta Image Frame.
- manta_frame = new FMantaImageFrame( viewers, app, this, width,
height, 0 );
-
+ // Manta Image Frame.
+ manta_frame = new FMantaImageFrame( viewers, app, this, width, height, 0 );
}
@@ -210,8 +224,8 @@
void FMantaWindow::setSceneObject( Object *root_object_ ) {
- manta_interface->addTransaction("Set Scene",
-
Callback::create(this,&FMantaWindow::mantaSetSceneObject,root_object_));
+ manta_interface->addTransaction("Set Scene",
+
Callback::create(this,&FMantaWindow::mantaSetSceneObject,root_object_));
}
///////////////////////////////////////////////////////////////////////////////
@@ -219,127 +233,161 @@
// Quit the program.
long FMantaWindow::onQuit( FXObject *sender, FXSelector key, void *data ) {
- // Hard quit.
- // if (fast_quit) {
- SCIRun::Thread::exitAll( 0 );
- //}
-
- // Add a quit command to manta.
- //
manta_interface->addTransaction("Quit",Callback::create(manta_interface,&RTRTInterface::finish));
- // fast_quit = true;
+ // Hard quit.
+ // if (fast_quit) {
+ SCIRun::Thread::exitAll( 0 );
+ //}
+
+ // Add a quit command to manta.
+ //
manta_interface->addTransaction("Quit",Callback::create(manta_interface,&RTRTInterface::finish));
+ // fast_quit = true;
- return 1;
+ return 1;
};
long FMantaWindow::onSpeedSlider( FXObject *sender, FXSelector key, void
*data ) {
- // Set the control speed for interaction.
- Real new_speed = *((double *)data);
+ // Set the control speed for interaction.
+ Real new_speed = *((double *)data);
- // std::cout << "Control speed: " << new_speed << std::endl;
- manta_frame->getNavigator()->setControlSpeed( new_speed );
- return 1;
+ // std::cout << "Control speed: " << new_speed << std::endl;
+ manta_frame->getNavigator()->setControlSpeed( new_speed );
+ return 1;
}
long FMantaWindow::onCuttingSlider( FXObject *sender, FXSelector key, void
*data ) {
- // Set the control speed for interaction.
- Real amount = *((double *)data);
+ // Set the control speed for interaction.
+ Real amount = *((double *)data);
- manta_interface->addTransaction("Move Cutting Plane.",
-
Callback::create(this,&FMantaWindow::mantaMoveCuttingPlane,amount));
+ manta_interface->addTransaction("Move Cutting Plane.",
+
Callback::create(this,&FMantaWindow::mantaMoveCuttingPlane,amount));
- return 1;
+ return 1;
}
long FMantaWindow::onCuttingFlip( FXObject *sender, FXSelector key, void
*data ) {
- std::cout << "onCuttingFlip" << std::endl;
+ std::cout << "onCuttingFlip" << std::endl;
- manta_interface->addTransaction("Flip Cutting Plane.",
- Callback::create(this,&FMantaWindow::mantaFlipCuttingPlane));
+ manta_interface->addTransaction("Flip Cutting Plane.",
+
Callback::create(this,&FMantaWindow::mantaFlipCuttingPlane));
- return 1;
+ return 1;
}
long FMantaWindow::onCameraBookmark( FXObject *sender, FXSelector key, void
*data ) {
- // Determine the selected index.
- int index = (FXint)(FXival)data;
+ // Determine the selected index.
+ int index = (FXint)(FXival)data;
- // Get the text from the list box.
- string camera_text = camera_text_list[ index ];
+ // Get the text from the list box.
+ string camera_text = camera_text_list[ index ];
- // Send a transaction to our self to change the camera.
- manta_interface->addTransaction("Camera Bookmark",
-
Callback::create(this,&FMantaWindow::mantaThreadBookmark,camera_text));
+ // Send a transaction to our self to change the camera.
+ manta_interface->addTransaction("Camera Bookmark",
+
Callback::create(this,&FMantaWindow::mantaThreadBookmark,camera_text));
- return 1;
+ return 1;
}
long FMantaWindow::onAddBookmark( FXObject *sender, FXSelector key, void
*data ) {
- // Get a pointer to the camera.
- Camera *camera = manta_interface->getCamera(
manta_frame->getMantaChannel() );
-
- // Get the camera in text form.
- ostringstream str;
- camera->output( str );
-
- std::cout << "New Bookmark" << std::endl
- << str.str() << std::endl;
+ // Get a pointer to the camera.
+ Camera *camera = manta_interface->getCamera(
manta_frame->getMantaChannel() );
- addCameraBookmark( "New Bookmark", str.str() );
+ // Get the camera in text form.
+ ostringstream str;
+ camera->output( str );
+
+ std::cout << "New Bookmark" << std::endl
+ << str.str() << std::endl;
+
+ // Get a name for the bookmark.
+ FXString description;
+ if (!FXInputDialog::getString(description, getApp(), "Enter Text..",
"Bookmark name:", 0 )) {
+ description = "New Bookmark";
+ }
+
+ addCameraBookmark( description.text(), str.str() );
- return 1;
+ return 1;
+}
+
+long FMantaWindow::onSaveBookmarks( FXObject *sender, FXSelector key, void
*data ) {
+
+ FXString file_name = FXFileDialog::getSaveFilename( this, "Bookmark File",
".", "*.txt" );
+ if (file_name.length() > 0) {
+
+ // Open the output file
+ FILE *file;
+ file = fopen( file_name.text(), "w" );
+ if (!file) {
+ FXMessageBox::error(this,MBOX_OK,"Error saving file.","Bookmarks not
saved.");
+ return 1;
+ }
+
+ // Write out the bookmarks.
+ int total = camera_text_list.size();
+
+ for (int i=0;i<total;++i) {
+ fprintf( file, "%s\n", camera_bookmark_list->getItem( i ).text() );
+ fprintf( file, "%s\n", camera_text_list[i].c_str() );
+ }
+
+ // Close the file.
+ fclose( file );
+ }
+
+ return 1;
}
long FMantaWindow::onCamera( FXObject *sender, FXSelector key, void *data ) {
- // Determine which shadow algorithm to use.
- int id = FXSELID( key );
+ // Determine which shadow algorithm to use.
+ int id = FXSELID( key );
- // Get the channel's camera.
- int channel = manta_frame->getMantaChannel();
- Camera *camera = manta_interface->getCamera( channel );
- Camera *new_camera = 0;
-
- switch (id) {
- case ID_PINHOLE_CAMERA:
- new_camera = new PinholeCamera(
camera->getPosition(), camera->getLookAt(), camera->getUp(), 60.0 );
- manta_interface->addTransaction("Camera",
-
Callback::create(this,&FMantaWindow::mantaCamera1,new_camera));
- break;
- case ID_ORTHO_CAMERA:
- new_camera = new OrthogonalCamera(
camera->getPosition(), camera->getLookAt(), camera->getUp(), 10.0 );
- manta_interface->addTransaction("Camera",
-
Callback::create(this,&FMantaWindow::mantaCamera1,new_camera));
- break;
- case ID_ENVIRONMENT_CAMERA:
- new_camera = new EnvironmentCamera(
camera->getPosition(), camera->getLookAt(), camera->getUp() );
- manta_interface->addTransaction("Camera",
-
Callback::create(this,&FMantaWindow::mantaCamera1,new_camera));
- break;
+ // Get the channel's camera.
+ int channel = manta_frame->getMantaChannel();
+ Camera *camera = manta_interface->getCamera( channel );
+ Camera *new_camera = 0;
+
+ switch (id) {
+ case ID_PINHOLE_CAMERA:
+ new_camera = new PinholeCamera( camera->getPosition(),
camera->getLookAt(), camera->getUp(), 60.0 );
+ manta_interface->addTransaction("Camera",
+
Callback::create(this,&FMantaWindow::mantaCamera1,new_camera));
+ break;
+ case ID_ORTHO_CAMERA:
+ new_camera = new OrthogonalCamera( camera->getPosition(),
camera->getLookAt(), camera->getUp(), 10.0 );
+ manta_interface->addTransaction("Camera",
+
Callback::create(this,&FMantaWindow::mantaCamera1,new_camera));
+ break;
+ case ID_ENVIRONMENT_CAMERA:
+ new_camera = new EnvironmentCamera( camera->getPosition(),
camera->getLookAt(), camera->getUp() );
+ manta_interface->addTransaction("Camera",
+
Callback::create(this,&FMantaWindow::mantaCamera1,new_camera));
+ break;
case ID_FISHEYE_CAMERA:
- new_camera = new FisheyeCamera( camera->getPosition(),
camera->getLookAt(), camera->getUp(), 120 );
- manta_interface->addTransaction("Camera",
-
Callback::create(this,&FMantaWindow::mantaCamera1,new_camera));
- break;
- };
+ new_camera = new FisheyeCamera( camera->getPosition(),
camera->getLookAt(), camera->getUp(), 120 );
+ manta_interface->addTransaction("Camera",
+
Callback::create(this,&FMantaWindow::mantaCamera1,new_camera));
+ break;
+ };
- return 1;
+ return 1;
}
long FMantaWindow::onCameraText( FXObject *sender, FXSelector key, void
*data ) {
- // Collect a string from the user.
- FXString description;
- if (FXInputDialog::getString(description, getApp(), "Enter Text..",
"Camera Spec:", 0 )) {
- manta_interface->addTransaction("Camera",
-
Callback::create(this,&FMantaWindow::mantaCamera2,string(description.text())));
- }
+ // Collect a string from the user.
+ FXString description;
+ if (FXInputDialog::getString(description, getApp(), "Enter Text..",
"Camera Spec:", 0 )) {
+ manta_interface->addTransaction("Camera",
+
Callback::create(this,&FMantaWindow::mantaCamera2,string(description.text())));
+ }
- return 1;
+ return 1;
}
long FMantaWindow::onCameraPath( FXObject *sender, FXSelector key, void
*data ) {
@@ -351,202 +399,279 @@
long FMantaWindow::onShadowAlgorithm( FXObject *sender, FXSelector key, void
*data ) {
- // Determine which shadow algorithm to use.
- int id = FXSELID( key );
+ // Determine which shadow algorithm to use.
+ int id = FXSELID( key );
- switch (id) {
- case ID_HARD_SHADOWS:
- manta_interface->addTransaction("Shadow Algorithm.",
-
Callback::create(this,&FMantaWindow::mantaShadowAlgorithm,string("hard")));
- break;
- case ID_NO_SHADOWS:
- manta_interface->addTransaction("Shadow Algorithm.",
-
Callback::create(this,&FMantaWindow::mantaShadowAlgorithm,string("noshadows")));
- break;
- }
+ switch (id) {
+ case ID_HARD_SHADOWS:
+ manta_interface->addTransaction("Shadow Algorithm.",
+
Callback::create(this,&FMantaWindow::mantaShadowAlgorithm,string("hard")));
+ break;
+ case ID_NO_SHADOWS:
+ manta_interface->addTransaction("Shadow Algorithm.",
+
Callback::create(this,&FMantaWindow::mantaShadowAlgorithm,string("noshadows")));
+ break;
+ }
- return 1;
+ return 1;
}
long FMantaWindow::onShadowAlgorithmText( FXObject *sender, FXSelector key,
void *data ) {
- // Collect a string from the user.
- FXString description;
- if (FXInputDialog::getString(description, getApp(), "Enter Text..",
"Shadow Algorithm Spec:", 0 )) {
- manta_interface->addTransaction("Shadow Algorithm.",
-
Callback::create(this,&FMantaWindow::mantaShadowAlgorithm,string(description.text())));
- }
+ // Collect a string from the user.
+ FXString description;
+ if (FXInputDialog::getString(description, getApp(), "Enter Text..",
"Shadow Algorithm Spec:", 0 )) {
+ manta_interface->addTransaction("Shadow Algorithm.",
+
Callback::create(this,&FMantaWindow::mantaShadowAlgorithm,string(description.text())));
+ }
- return 1;
+ return 1;
}
long FMantaWindow::onPixelSampler( FXObject *sender, FXSelector key, void
*data ) {
- // Determine which shadow algorithm to use.
- int id = FXSELID( key );
+ // Determine which shadow algorithm to use.
+ int id = FXSELID( key );
- switch (id) {
- case ID_SINGLE_SAMPLER:
- manta_interface->addTransaction("Pixel Sampler.",
-
Callback::create(this,&FMantaWindow::mantaPixelSampler,string("singlesample")));
- break;
- case ID_JITTER2_SAMPLER:
- manta_interface->addTransaction("Pixel Sampler.",
-
Callback::create(this,&FMantaWindow::mantaPixelSampler,string("jittersample(
-numberOfSamples 2 )")));
- break;
- case ID_JITTER4_SAMPLER:
- manta_interface->addTransaction("Pixel Sampler.",
-
Callback::create(this,&FMantaWindow::mantaPixelSampler,string("jittersample(
-numberOfSamples 4 )")));
- break;
- case ID_JITTER8_SAMPLER:
- manta_interface->addTransaction("Pixel Sampler.",
-
Callback::create(this,&FMantaWindow::mantaPixelSampler,string("jittersample(
-numberOfSamples 8 )")));
- break;
- }
+ switch (id) {
+ case ID_SINGLE_SAMPLER:
+ manta_interface->addTransaction("Pixel Sampler.",
+
Callback::create(this,&FMantaWindow::mantaPixelSampler,string("singlesample")));
+ break;
+ case ID_JITTER2_SAMPLER:
+ manta_interface->addTransaction("Pixel Sampler.",
+
Callback::create(this,&FMantaWindow::mantaPixelSampler,string("jittersample(
-numberOfSamples 2 )")));
+ break;
+ case ID_JITTER4_SAMPLER:
+ manta_interface->addTransaction("Pixel Sampler.",
+
Callback::create(this,&FMantaWindow::mantaPixelSampler,string("jittersample(
-numberOfSamples 4 )")));
+ break;
+ case ID_JITTER8_SAMPLER:
+ manta_interface->addTransaction("Pixel Sampler.",
+
Callback::create(this,&FMantaWindow::mantaPixelSampler,string("jittersample(
-numberOfSamples 8 )")));
+ break;
+ }
- return 1;
+ return 1;
}
long FMantaWindow::onPixelSamplerText( FXObject *sender, FXSelector key,
void *data ) {
- // Collect a string from the user.
- FXString description;
- if (FXInputDialog::getString(description, getApp(), "Enter Text",
"Pixel Sampler Spec:", 0 )) {
- manta_interface->addTransaction("Pixel Sampler.",
-
Callback::create(this,&FMantaWindow::mantaPixelSampler,string(description.text())));
- }
+ // Collect a string from the user.
+ FXString description;
+ if (FXInputDialog::getString(description, getApp(), "Enter Text", "Pixel
Sampler Spec:", 0 )) {
+ manta_interface->addTransaction("Pixel Sampler.",
+
Callback::create(this,&FMantaWindow::mantaPixelSampler,string(description.text())));
+ }
- return 1;
+ return 1;
}
long FMantaWindow::onTraverser( FXObject *sender, FXSelector key, void *data
) {
- // Determine which shadow algorithm to use.
- int id = FXSELID( key );
+ // Determine which shadow algorithm to use.
+ int id = FXSELID( key );
- switch (id) {
- case ID_TILED_TRAVERSER:
- manta_interface->addTransaction("Image Traverser.",
-
Callback::create(this,&FMantaWindow::mantaTraverser,string("tiled")));
- break;
- case ID_FRAMELESS_TRAVERSER:
- manta_interface->addTransaction("Image Traverser.",
-
Callback::create(this,&FMantaWindow::mantaTraverser,string("frameless")));
- break;
- case ID_DISSOLVETILED_TRAVERSER:
- manta_interface->addTransaction("Image Traverser.",
-
Callback::create(this,&FMantaWindow::mantaTraverser,string("dissolvetiled(
-tilesize 8x8 )")));
- break;
- }
+ switch (id) {
+ case ID_TILED_TRAVERSER:
+ manta_interface->addTransaction("Image Traverser.",
+
Callback::create(this,&FMantaWindow::mantaTraverser,string("tiled")));
+ break;
+ case ID_FRAMELESS_TRAVERSER:
+ manta_interface->addTransaction("Image Traverser.",
+
Callback::create(this,&FMantaWindow::mantaTraverser,string("frameless")));
+ break;
+ case ID_DISSOLVETILED_TRAVERSER:
+ manta_interface->addTransaction("Image Traverser.",
+
Callback::create(this,&FMantaWindow::mantaTraverser,string("dissolvetiled(
-tilesize 8x8 )")));
+ break;
+ }
- return 1;
+ return 1;
}
long FMantaWindow::onTraverserText( FXObject *sender, FXSelector key, void
*data ) {
- // Collect a string from the user.
- FXString description;
- if (FXInputDialog::getString(description, getApp(), "Enter Text",
"Image Traverser Spec:", 0 )) {
- manta_interface->addTransaction("Image Traverser.",
-
Callback::create(this,&FMantaWindow::mantaTraverser,string(description.text())));
- }
+ // Collect a string from the user.
+ FXString description;
+ if (FXInputDialog::getString(description, getApp(), "Enter Text", "Image
Traverser Spec:", 0 )) {
+ manta_interface->addTransaction("Image Traverser.",
+
Callback::create(this,&FMantaWindow::mantaTraverser,string(description.text())));
+ }
- return 1;
+ return 1;
}
long FMantaWindow::onAddCuttingPlane( FXObject *sender, FXSelector key, void
*data ) {
- FXEvent *event = (FXEvent *)data;
+ FXEvent *event = (FXEvent *)data;
- std::cout << "Image location: " << event->win_x << " " <<
event->win_y << std::endl;
+ std::cout << "Image location: " << event->win_x << " " << event->win_y <<
std::endl;
- if ((event->state & CONTROLMASK) == CONTROLMASK) {
- onPOI(sender, key, data);
- return 1;
- }
+ if ((event->state & CONTROLMASK) == CONTROLMASK) {
+ onPOI(sender, key, data);
+ return 1;
+ }
- Point point;
- Vector normal;
+ Point point;
+ Vector normal;
- // Shoot a ray into the scene.
- if (manta_frame->shootOneRay( event->win_x, event->win_y, point,
normal )) {
+ // Shoot a ray into the scene.
+ if (manta_frame->shootOneRay( event->win_x, event->win_y, point, normal ))
{
- // Check to see if the cutting plane should be snapped to an
axis.
- if (cutting_snap) {
+ // Check to see if the cutting plane should be snapped to an axis.
+ if (cutting_snap) {
- Real snap_data[] = { 1.0, 0.0, 0.0 ,
-
0.0, 1.0, 0.0 ,
-
0.0, 0.0, 1.0 ,
-
-1.0, 0.0, 0.0 ,
-
0.0,-1.0, 0.0 ,
-
0.0, 0.0,-1.0 };
- Vector *snap_axis = (Vector *)snap_data;
- // Find the axis with the greatest dot product.
- Real max_dot = 0.0;
- int max_axis = 0;
- for (int i=0;i<6;++i) {
- Real d = Dot( snap_axis[i], normal );
- if (d > max_dot) {
- max_dot = d;
- max_axis = i;
- }
- }
+ Real snap_data[] = { 1.0, 0.0, 0.0 ,
+ 0.0, 1.0, 0.0 ,
+ 0.0, 0.0, 1.0 ,
+ -1.0, 0.0, 0.0 ,
+ 0.0,-1.0, 0.0 ,
+ 0.0, 0.0,-1.0 };
+ Vector *snap_axis = (Vector *)snap_data;
+ // Find the axis with the greatest dot product.
+ Real max_dot = 0.0;
+ int max_axis = 0;
+ for (int i=0;i<6;++i) {
+ Real d = Dot( snap_axis[i], normal );
+ if (d > max_dot) {
+ max_dot = d;
+ max_axis = i;
+ }
+ }
- normal = snap_axis[ max_axis ];
- }
+ normal = snap_axis[ max_axis ];
+ }
- std::cout << "Adding cutting plane" << std::endl;
- std::cout << point << std::endl;
- std::cout << normal << std::endl;
-
- // Add a cutting plane at this point.
- manta_interface->addTransaction("Add Cutting Plane",
-
Callback::create(this,&FMantaWindow::mantaAddCuttingPlane,point,normal));
-
- // Enable the cutting plane slider.
- cutting_slider->enable();
- cutting_flip->enable();
- cutting_slider->setValue( 0.0 );
- }
- else {
- // Remove the cutting plane if one exists.
- manta_interface->addTransaction("Remove Cutting Plane",
-
Callback::create(this,&FMantaWindow::mantaRemoveCuttingPlane));
- cutting_slider->disable();
- cutting_flip->disable();
- }
+ std::cout << "Adding cutting plane" << std::endl;
+ std::cout << point << std::endl;
+ std::cout << normal << std::endl;
+
+ // Add a cutting plane at this point.
+ manta_interface->addTransaction("Add Cutting Plane",
+
Callback::create(this,&FMantaWindow::mantaAddCuttingPlane,point,normal));
+
+ // Enable the cutting plane slider.
+ cutting_slider->enable();
+ cutting_flip->enable();
+ cutting_slider->setValue( 0.0 );
+ }
+ else {
+ // Remove the cutting plane if one exists.
+ manta_interface->addTransaction("Remove Cutting Plane",
+
Callback::create(this,&FMantaWindow::mantaRemoveCuttingPlane));
+ cutting_slider->disable();
+ cutting_flip->disable();
+ }
- return 1;
+ return 1;
};
+long FMantaWindow::onHideSelected( FXObject *sender, FXSelector key, void
*data ) {
+
+ if (hide_selected_check->isEnabled()) {
+ bool checked = hide_selected_check->getCheck();
+
+ manta_interface->addTransaction("Toggle hide selected",
+ Callback::create(this,&FMantaWindow::mantaToggleHideSelected,
+ KDTree::PICK_HIGHLIGHT+checked));
+ }
+
+ return 1;
+}
+
+long FMantaWindow::onUnHideAll( FXObject *sender, FXSelector key, void *data
) {
+
+ manta_interface->addTransaction("Unhide All",
+ Callback::create(this,&FMantaWindow::mantaUnHideAll));
+
+ return 1;
+}
+
long FMantaWindow::onPick( FXObject *sender, FXSelector key, void *data ) {
- FXEvent *event = (FXEvent *)data;
+ FXEvent *event = (FXEvent *)data;
+
+ std::cout << "Picking at: " << event->win_x << " " << event->win_y <<
std::endl;
+
+ manta_interface->addTransaction("Picking",
+
Callback::create(this,&FMantaWindow::mantaPick,event->win_x,event->win_y));
+
+ return 1;
+}
+
+
+void FMantaWindow::mantaToggleHideSelected( int mode ) {
+
+ // Get a pointer to the kdtree.
+ Scene *scene = manta_interface->getScene();
+ Object *root_object = scene->getObject();
+
+ // Check to see if the root object is a cutting plane.
+ CuttingPlane *cutting_plane = dynamic_cast< CuttingPlane * >( root_object
);
+ if (cutting_plane != 0) {
+
+ // If so use the cutting plane's child as the root.
+ root_object = cutting_plane->getObject();
+ }
- std::cout << "Picking at: " << event->win_x << " " << event->win_y <<
std::endl;
+ // Check to see if this object is either a transparent or normal kdtree.
+ if (dynamic_cast<KDTree *>( root_object )) {
+ KDTree * kdtree = dynamic_cast<KDTree *>( root_object );
+
+ kdtree->setPickedFlag( mode );
+ }
+ else if (dynamic_cast<TransparentKDTree*>( root_object )) {
+ TransparentKDTree *kdtree = dynamic_cast<TransparentKDTree *>(
root_object );
- manta_interface->addTransaction("Picking",
-
Callback::create(this,&FMantaWindow::mantaPick,event->win_x,event->win_y));
+ kdtree->setPickedFlag( mode );
+ }
- return 1;
+}
+
+void FMantaWindow::mantaUnHideAll() {
+
+ // Get a pointer to the kdtree.
+ Scene *scene = manta_interface->getScene();
+ Object *root_object = scene->getObject();
+
+ // Check to see if the root object is a cutting plane.
+ CuttingPlane *cutting_plane = dynamic_cast< CuttingPlane * >( root_object
);
+ if (cutting_plane != 0) {
+
+ // If so use the cutting plane's child as the root.
+ root_object = cutting_plane->getObject();
+ }
+
+ // Check to see if this object is either a transparent or normal kdtree.
+ if (dynamic_cast<KDTree *>( root_object )) {
+ KDTree * kdtree = dynamic_cast<KDTree *>( root_object );
+
+ kdtree->resetPicking();
+ }
+ else if (dynamic_cast<TransparentKDTree*>( root_object )) {
+ TransparentKDTree *kdtree = dynamic_cast<TransparentKDTree *>(
root_object );
+
+ kdtree->resetPicking();
+ }
}
void FMantaWindow::mantaPick( int x, int y ) const {
- Scene *scene = manta_interface->getScene();
- Object *root_object = scene->getObject();
+ Scene *scene = manta_interface->getScene();
+ Object *root_object = scene->getObject();
- // Check to see if the root object is a cutting plane.
- CuttingPlane *cutting_plane = dynamic_cast< CuttingPlane * >(
root_object );
- if (cutting_plane != 0) {
+ // Check to see if the root object is a cutting plane.
+ CuttingPlane *cutting_plane = dynamic_cast< CuttingPlane * >( root_object
);
+ if (cutting_plane != 0) {
// If so use the cutting plane's child as the root.
root_object = cutting_plane->getObject();
}
- Point point;
- Vector normal;
+ Point point;
+ Vector normal;
// Check to see if this object is either a transparent or normal kdtree.
if (dynamic_cast<KDTree *>( root_object )) {
@@ -559,10 +684,12 @@
int result = manta_frame->shootOneRay( x, y, point, normal );
if (!result) {
kdtree->resetPicking();
+ // hide_selected_check->disable();
}
// Disable picking.
kdtree->disablePicking();
+ // hide_selected_check->enable();
}
}
else if (dynamic_cast<TransparentKDTree*>( root_object )) {
@@ -574,11 +701,14 @@
if (kdtree->isPickingEnabled()) {
int result = manta_frame->shootOneRay( x, y, point, normal );
if (!result) {
+ std::cerr << "reset picking" << std::endl;
kdtree->resetPicking();
+ // hide_selected_check->disable();
}
// Disable picking.
kdtree->disablePicking();
+ // hide_selected_check->enable();
}
}
@@ -586,130 +716,130 @@
long FMantaWindow::onPOI( FXObject *sender, FXSelector key, void *data ) {
- FXEvent *event = (FXEvent *)data;
+ FXEvent *event = (FXEvent *)data;
- std::cout << "POI at: " << event->win_x << " " << event->win_y <<
std::endl;
+ std::cout << "POI at: " << event->win_x << " " << event->win_y <<
std::endl;
- manta_interface->addTransaction("POI",
-
Callback::create(this,&FMantaWindow::mantaPOI,event->win_x,event->win_y));
+ manta_interface->addTransaction("POI",
+
Callback::create(this,&FMantaWindow::mantaPOI,event->win_x,event->win_y));
- return 1;
+ return 1;
}
void FMantaWindow::mantaPOI( int x, int y ) {
- Scene *scene = manta_interface->getScene();
- Object *root_object = scene->getObject();
+ Scene *scene = manta_interface->getScene();
+ Object *root_object = scene->getObject();
- // Check to see if the root object is a cutting plane.
- CuttingPlane *cutting_plane = dynamic_cast< CuttingPlane * >(
root_object );
- if (cutting_plane != 0) {
+ // Check to see if the root object is a cutting plane.
+ CuttingPlane *cutting_plane = dynamic_cast< CuttingPlane * >( root_object
);
+ if (cutting_plane != 0) {
// If so use the cutting plane's child as the root.
root_object = cutting_plane->getObject();
}
- Point point;
- Vector normal;
+ Point point;
+ Vector normal;
// Check to see if this object is either a transparent or normal kdtree.
- int result = manta_frame->shootOneRay( x, y, point, normal );
- if (result) {
- Point eye[4];
- Point lookat[4];
- Vector up[4];
- // Get the current manta camera.
- int channel = manta_frame->getNavigator()->getMantaChannel();
- Camera *camera = manta_interface->getCamera( channel );
-
- eye[0] = eye[1] = camera->getPosition();
- lookat[0] = lookat[1] = camera->getLookAt();
- up[0] = up[1] = camera->getUp();
-
- // distance between POI and current location
- Vector eyetopoi = point - camera->getPosition();
- Real dist = sqrt(Dot(eyetopoi, eyetopoi));
-
- eye[2] = eye[3] = point + normal*dist*0.1;
- lookat[2] = lookat[3] = point-normal;
- up[2] = up[3] = camera->getUp();
-
- dstPosition = eye[3];
- dstLookAt = lookat[3];
- dstUp = up[3];
-
- Real delta_t = 1.0/dist, delta_time = delta_t*5.0;
-
- automator = new CameraPathAutomator(
- manta_interface, 0, 0,
- eye, lookat, up, 4,
- delta_t,
- delta_time);
- automator->set_automator_mode( AutomatorUI::AUTOMATOR_EXIT );
- automator->set_loop_behavior( CameraPathAutomator::PATH_STOP
);
+ int result = manta_frame->shootOneRay( x, y, point, normal );
+ if (result) {
+ Point eye[4];
+ Point lookat[4];
+ Vector up[4];
+ // Get the current manta camera.
+ int channel = manta_frame->getNavigator()->getMantaChannel();
+ Camera *camera = manta_interface->getCamera( channel );
+
+ eye[0] = eye[1] = camera->getPosition();
+ lookat[0] = lookat[1] = camera->getLookAt();
+ up[0] = up[1] = camera->getUp();
+
+ // distance between POI and current location
+ Vector eyetopoi = point - camera->getPosition();
+ Real dist = sqrt(Dot(eyetopoi, eyetopoi));
+
+ eye[2] = eye[3] = point + normal*dist*0.1;
+ lookat[2] = lookat[3] = point-normal;
+ up[2] = up[3] = camera->getUp();
+
+ dstPosition = eye[3];
+ dstLookAt = lookat[3];
+ dstUp = up[3];
+
+ Real delta_t = 1.0/dist, delta_time = delta_t*5.0;
+
+ automator = new CameraPathAutomator(
+ manta_interface, 0, 0,
+ eye, lookat, up, 4,
+ delta_t,
+ delta_time);
+ automator->set_automator_mode( AutomatorUI::AUTOMATOR_EXIT );
+ automator->set_loop_behavior( CameraPathAutomator::PATH_STOP );
- automator->set_terminate_callback( Callback::create( this,
&FMantaWindow::mantaPOIManeuverComplete ) );
+ automator->set_terminate_callback( Callback::create( this,
&FMantaWindow::mantaPOIManeuverComplete ) );
- automator->restart();
- }
+ automator->restart();
+ }
};
void FMantaWindow::mantaPOIManeuverComplete()
{
- //int channel = manta_frame->getNavigator()->getMantaChannel();
- //Camera *camera = manta_interface->getCamera( channel );
- //camera->reset(dstPosition, dstUp, dstLookAt);
- manta_frame->getNavigator()->resetToCamera(dstPosition, dstLookAt,
dstUp);
+ //int channel = manta_frame->getNavigator()->getMantaChannel();
+ //Camera *camera = manta_interface->getCamera( channel );
+ //camera->reset(dstPosition, dstUp, dstLookAt);
+ manta_frame->getNavigator()->resetToCamera(dstPosition, dstLookAt, dstUp);
}
long FMantaWindow::onNavigator( FXObject *sender, FXSelector key, void *data
) {
- // Determine the selected index.
- int index = (FXint)(FXival)data;
+ // Determine the selected index.
+ int index = (FXint)(FXival)data;
- // Get the pointer to the new navigator.
- FMantaNavigator *nav = (FMantaNavigator
*)navigator_list->getItemData(index);
+ // Get the pointer to the new navigator.
+ FMantaNavigator *nav = (FMantaNavigator
*)navigator_list->getItemData(index);
- // Get the current manta camera.
- int channel = manta_frame->getNavigator()->getMantaChannel();
- Camera *camera = manta_interface->getCamera( channel );
+ // Get the current manta camera.
+ int channel = manta_frame->getNavigator()->getMantaChannel();
+ Camera *camera = manta_interface->getCamera( channel );
- // Reset the new nav to this camera.
- nav->resetToCamera( camera->getPosition(), camera->getLookAt(),
camera->getUp());
+ // Reset the new nav to this camera.
+ nav->resetToCamera( camera->getPosition(), camera->getLookAt(),
camera->getUp());
- manta_frame->setNavigator( nav );
+ manta_frame->setNavigator( nav );
- return 1;
+ return 1;
}
long FMantaWindow::onNavigatorToggle( FXObject *sender, FXSelector key, void
*data ) {
- FXEvent *event = (FXEvent *)data;
- if (event->text[0] == '\t') {
+ FXEvent *event = (FXEvent *)data;
+ if (event->text[0] == '\t') {
- // Determine the selected index.
- int index = (navigator_list->getCurrentItem() + 1) %
navigator_list->getNumItems();
- navigator_list->setCurrentItem( index );
+ // Determine the selected index.
+ int index = (navigator_list->getCurrentItem() + 1) %
navigator_list->getNumItems();
+ navigator_list->setCurrentItem( index );
- // Get the pointer to the new navigator.
- FMantaNavigator *nav = (FMantaNavigator
*)navigator_list->getItemData(index);
+ // Get the pointer to the new navigator.
+ FMantaNavigator *nav = (FMantaNavigator
*)navigator_list->getItemData(index);
- // Get the current manta camera.
- int channel = manta_frame->getNavigator()->getMantaChannel();
- Camera *camera = manta_interface->getCamera( channel );
+ // Get the current manta camera.
+ int channel = manta_frame->getNavigator()->getMantaChannel();
+ Camera *camera = manta_interface->getCamera( channel );
- // Reset the new nav to this camera.
- nav->resetToCamera( camera->getPosition(),
camera->getLookAt(), camera->getUp());
- nav->setControlSpeed( speed_slider->getValue() );
+ // Reset the new nav to this camera.
+ nav->resetToCamera( camera->getPosition(), camera->getLookAt(),
camera->getUp());
+ nav->setControlSpeed( speed_slider->getValue() );
- manta_frame->setNavigator( nav );
+ manta_frame->setNavigator( nav );
- return 0;
- }
- else {
- return manta_frame->getNavigator()->onKeyPress( sender, key,
data );
- }
+ return 0;
+ }
+ else {
+ return manta_frame->getNavigator()->onKeyPress( sender, key, data );
+ }
}
@@ -729,231 +859,231 @@
extra_options_dialog[index]->create();
extra_options_dialog[index]->show();
- return 1;
+ return 1;
}
///////////////////////////////////////////////////////////////////////////////
void FMantaWindow::mantaThreadBookmark( const string camera_text ) {
- // Determine the channel number.
- int channel = manta_frame->getMantaChannel();
+ // Determine the channel number.
+ int channel = manta_frame->getMantaChannel();
- std::cout << "Camera text: " << camera_text << std::endl;
+ std::cout << "Camera text: " << camera_text << std::endl;
- // Create the camera.
- Camera *camera = manta_interface->createCamera( camera_text );
+ // Create the camera.
+ Camera *camera = manta_interface->createCamera( camera_text );
- // Check to make sure the camera text was valid.
- if (camera != 0) {
- manta_interface->setCamera( channel, camera );
+ // Check to make sure the camera text was valid.
+ if (camera != 0) {
+ manta_interface->setCamera( channel, camera );
- // This is unsafe.
- manta_frame->getNavigator()->resetToCamera(
camera->getPosition(),camera->getLookAt(),camera->getUp());
- }
+ // This is unsafe.
+ manta_frame->getNavigator()->resetToCamera(
camera->getPosition(),camera->getLookAt(),camera->getUp());
+ }
}
void FMantaWindow::mantaCamera1( Camera *new_camera ) {
- // Determine the channel number.
- int channel = manta_frame->getMantaChannel();
+ // Determine the channel number.
+ int channel = manta_frame->getMantaChannel();
- // Get the old camera.
- Camera *old_camera = manta_interface->getCamera( channel );
+ // Get the old camera.
+ Camera *old_camera = manta_interface->getCamera( channel );
- // Replace the camera.
- manta_interface->setCamera( channel, new_camera );
+ // Replace the camera.
+ manta_interface->setCamera( channel, new_camera );
- delete old_camera;
+ delete old_camera;
}
void FMantaWindow::mantaCamera2( const string text ) {
- // Determine the channel number.
- int channel = manta_frame->getMantaChannel();
+ // Determine the channel number.
+ int channel = manta_frame->getMantaChannel();
- // Update the shadow algorithm.
- Camera *new_camera = manta_interface->createCamera( text );
- if (new_camera == 0) {
- std::cout << "Could not select camera " << text << std::endl;
- return;
- }
+ // Update the shadow algorithm.
+ Camera *new_camera = manta_interface->createCamera( text );
+ if (new_camera == 0) {
+ std::cout << "Could not select camera " << text << std::endl;
+ return;
+ }
- // Get the old camera.
- Camera *old_camera = manta_interface->getCamera( channel );
+ // Get the old camera.
+ Camera *old_camera = manta_interface->getCamera( channel );
- // Replace the camera.
- manta_interface->setCamera( channel, new_camera );
+ // Replace the camera.
+ manta_interface->setCamera( channel, new_camera );
- delete old_camera;
+ delete old_camera;
- // This is unsafe.
- manta_frame->getNavigator()->resetToCamera(
new_camera->getPosition(),new_camera->getLookAt(),new_camera->getUp());
+ // This is unsafe.
+ manta_frame->getNavigator()->resetToCamera(
new_camera->getPosition(),new_camera->getLookAt(),new_camera->getUp());
}
void FMantaWindow::mantaShadowAlgorithm( const string text ) const {
- // Determine the channel number.
- int channel = manta_frame->getMantaChannel();
+ // Determine the channel number.
+ int channel = manta_frame->getMantaChannel();
- try {
- if (!manta_interface->selectShadowAlgorithm( text )) {
- std::cout << "Could not select shadow algorithm " <<
text << std::endl;
- }
- }
- catch (IllegalArgument e) {
- std::cout << "Caught IllegalArgument exception" << std::endl;
- };
+ try {
+ if (!manta_interface->selectShadowAlgorithm( text )) {
+ std::cout << "Could not select shadow algorithm " << text << std::endl;
+ }
+ }
+ catch (IllegalArgument e) {
+ std::cout << "Caught IllegalArgument exception" << std::endl;
+ };
}
void FMantaWindow::mantaPixelSampler( const string text ) const {
- // Determine the channel number.
- int channel = manta_frame->getMantaChannel();
+ // Determine the channel number.
+ int channel = manta_frame->getMantaChannel();
- try {
- if (!manta_interface->selectPixelSampler( text )) {
- std::cout << "Could not select pixel sampler " <<
text << std::endl;
- }
- }
- catch (SCIRun::Exception &e) {
+ try {
+ if (!manta_interface->selectPixelSampler( text )) {
+ std::cout << "Could not select pixel sampler " << text << std::endl;
+ }
+ }
+ catch (SCIRun::Exception &e) {
std::cout << "Caught exception:"
<< e.message()
<< std::endl;
- };
+ };
}
void FMantaWindow::mantaTraverser( const string text ) const {
- // Determine the channel number.
- int channel = manta_frame->getMantaChannel();
+ // Determine the channel number.
+ int channel = manta_frame->getMantaChannel();
- try {
- if (!manta_interface->selectImageTraverser( text )) {
- std::cout << "Could not select image traverser " <<
text << std::endl;
- }
- }
- catch (IllegalArgument e) {
- std::cout << "Caught IllegalArgument exception" <<
e.message() << std::endl;
- }
+ try {
+ if (!manta_interface->selectImageTraverser( text )) {
+ std::cout << "Could not select image traverser " << text << std::endl;
+ }
+ }
+ catch (IllegalArgument e) {
+ std::cout << "Caught IllegalArgument exception" << e.message() <<
std::endl;
+ }
catch (SCIRun::Exception &e) {
std::cout << "Caught exception:"
<< e.message()
<< std::endl;
- };
+ };
}
///////////////////////////////////////////////////////////////////////////////
void FMantaWindow::addCameraBookmark( const string &description, const
string &camera_text ) {
- // Add the description to the drop down list.
- camera_bookmark_list->appendItem( description.c_str() );
+ // Add the description to the drop down list.
+ camera_bookmark_list->appendItem( description.c_str() );
- // Add the camera text to the camera text list.
- camera_text_list.push_back( camera_text );
+ // Add the camera text to the camera text list.
+ camera_text_list.push_back( camera_text );
}
void FMantaWindow::addNavigatorOption( const string &description,
FMantaNavigator *nav ) {
- // Add the navigator to the list.
- navigator_list->appendItem( description.c_str(), 0, nav );
+ // Add the navigator to the list.
+ navigator_list->appendItem( description.c_str(), 0, nav );
}
// This method is called by the manta thread to add a cutting plane.
void FMantaWindow::mantaAddCuttingPlane( Point point, Vector normal ) const {
- // Add a cutting plane on top of the root object.
- Scene *scene = manta_interface->getScene();
- Object *root_object = scene->getObject();
-
- // Normalize the normal.
- normal.normalize();
-
- // Check to see if the root object is already a cutting plane.
- CuttingPlane *cutting_plane = dynamic_cast< CuttingPlane * >(
root_object );
- if (cutting_plane != 0) {
- cutting_plane->setPlanePoint( point );
- cutting_plane->setPlaneNormal( normal );
- }
- else {
- // Create the cutting plane.
- cutting_plane = new CuttingPlane( point, normal, root_object
);
-
- // Preprocess the cutting plane.
- PreprocessContext preprocess_context( manta_interface,
scene->getLights() );
- cutting_plane->preprocess( preprocess_context );
+ // Add a cutting plane on top of the root object.
+ Scene *scene = manta_interface->getScene();
+ Object *root_object = scene->getObject();
+
+ // Normalize the normal.
+ normal.normalize();
+
+ // Check to see if the root object is already a cutting plane.
+ CuttingPlane *cutting_plane = dynamic_cast< CuttingPlane * >( root_object
);
+ if (cutting_plane != 0) {
+ cutting_plane->setPlanePoint( point );
+ cutting_plane->setPlaneNormal( normal );
+ }
+ else {
+ // Create the cutting plane.
+ cutting_plane = new CuttingPlane( point, normal, root_object );
+
+ // Preprocess the cutting plane.
+ PreprocessContext preprocess_context( manta_interface,
scene->getLights() );
+ cutting_plane->preprocess( preprocess_context );
- // Place the cutting plane at the top of the tree.
- scene->setObject( cutting_plane );
- }
+ // Place the cutting plane at the top of the tree.
+ scene->setObject( cutting_plane );
+ }
}
void FMantaWindow::mantaRemoveCuttingPlane() const {
- // Add a cutting plane on top of the root object.
- Scene *scene = manta_interface->getScene();
- Object *root_object = scene->getObject();
+ // Add a cutting plane on top of the root object.
+ Scene *scene = manta_interface->getScene();
+ Object *root_object = scene->getObject();
- CuttingPlane *cutting_plane = dynamic_cast< CuttingPlane * >(
root_object );
- if (cutting_plane) {
+ CuttingPlane *cutting_plane = dynamic_cast< CuttingPlane * >( root_object
);
+ if (cutting_plane) {
- // Replace the root object by the cutting plane's child.
- scene->setObject( cutting_plane->getObject() );
+ // Replace the root object by the cutting plane's child.
+ scene->setObject( cutting_plane->getObject() );
- // Delete the cutting plane.
- delete cutting_plane;
- }
+ // Delete the cutting plane.
+ delete cutting_plane;
+ }
}
void FMantaWindow::mantaMoveCuttingPlane( Real amount ) const {
- // Add a cutting plane on top of the root object.
- Scene *scene = manta_interface->getScene();
- Object *root_object = scene->getObject();
-
- CuttingPlane *cutting_plane = dynamic_cast< CuttingPlane * >(
root_object );
- if (cutting_plane) {
-
- // Move the plane along the normal.
- cutting_plane->movePlaneAlongNormal( amount );
- }
+ // Add a cutting plane on top of the root object.
+ Scene *scene = manta_interface->getScene();
+ Object *root_object = scene->getObject();
+
+ CuttingPlane *cutting_plane = dynamic_cast< CuttingPlane * >( root_object
);
+ if (cutting_plane) {
+
+ // Move the plane along the normal.
+ cutting_plane->movePlaneAlongNormal( amount );
+ }
}
void FMantaWindow::mantaFlipCuttingPlane() const {
- // Add a cutting plane on top of the root object.
- Scene *scene = manta_interface->getScene();
- Object *root_object = scene->getObject();
-
- CuttingPlane *cutting_plane = dynamic_cast< CuttingPlane * >(
root_object );
- if (cutting_plane) {
-
- // Move the plane along the normal.
- Vector normal;
- cutting_plane->getPlaneNormal( normal );
- normal *= -1.0;
- cutting_plane->setPlaneNormal( normal );
- }
+ // Add a cutting plane on top of the root object.
+ Scene *scene = manta_interface->getScene();
+ Object *root_object = scene->getObject();
+
+ CuttingPlane *cutting_plane = dynamic_cast< CuttingPlane * >( root_object
);
+ if (cutting_plane) {
+
+ // Move the plane along the normal.
+ Vector normal;
+ cutting_plane->getPlaneNormal( normal );
+ normal *= -1.0;
+ cutting_plane->setPlaneNormal( normal );
+ }
}
void FMantaWindow::mantaSetSceneObject( Object *root_object_ ) const {
- // If a cutting plane is the root object, replace the cutting plane's
child
- // otherwise replace the root object.
- Scene *scene = manta_interface->getScene();
- Object *root_object = scene->getObject();
-
- // Check to see if the root object is already a cutting plane.
- CuttingPlane *cutting_plane = dynamic_cast< CuttingPlane * >(
root_object );
- if (cutting_plane != 0) {
- cutting_plane->setObject( root_object_ );
- }
- else {
- // Otherwise replace the whole scene
- scene->setObject( root_object_ );
- }
+ // If a cutting plane is the root object, replace the cutting plane's child
+ // otherwise replace the root object.
+ Scene *scene = manta_interface->getScene();
+ Object *root_object = scene->getObject();
+
+ // Check to see if the root object is already a cutting plane.
+ CuttingPlane *cutting_plane = dynamic_cast< CuttingPlane * >( root_object
);
+ if (cutting_plane != 0) {
+ cutting_plane->setObject( root_object_ );
+ }
+ else {
+ // Otherwise replace the whole scene
+ scene->setObject( root_object_ );
+ }
}
Modified: branches/itanium2/fox/FMantaWindow.h
==============================================================================
--- branches/itanium2/fox/FMantaWindow.h (original)
+++ branches/itanium2/fox/FMantaWindow.h Sun Nov 13 23:02:29 2005
@@ -16,197 +16,211 @@
namespace fox_manta {
- using namespace FX;
- using namespace Manta;
- using std::vector;
+ using namespace FX;
+ using namespace Manta;
+ using std::vector;
class FMantaRecorderDialog;
- // This is the main window for the Fox application.
- // this class will have a pointer to the RTRTInterface (manta
interface)
- // it will also be responsible for initializing manta as well as the
rest of
- // the application.
- class FMantaWindow : public FXMainWindow {
- FXDECLARE(FMantaWindow)
- private:
+ // This is the main window for the Fox application.
+ // this class will have a pointer to the RTRTInterface (manta interface)
+ // it will also be responsible for initializing manta as well as the rest
of
+ // the application.
+ class FMantaWindow : public FXMainWindow {
+ FXDECLARE(FMantaWindow)
+ private:
- // Interface to the manta rendering library.
- RTRTInterface *manta_interface;
+ // Interface to the manta rendering library.
+ RTRTInterface *manta_interface;
- // Other manta pipeline components which the application
"controls"
- // (Transactions must be sent through manta in order to
manipulate
- // these components
-
- // Fox GUI Components.
- FXMenuBar *menu_bar;
- FXMenuPane *file_menu;
- FXMenuPane *camera_menu;
- FXMenuPane *shadow_menu;
- FXMenuPane *sampler_menu;
- FXMenuPane *traverser_menu;
- FXMenuPane *options_menu;
-
- FXMenuCommand *cutting_flip;
+ // Other manta pipeline components which the application "controls"
+ // (Transactions must be sent through manta in order to manipulate
+ // these components
+
+ // Fox GUI Components.
+ FXMenuBar *menu_bar;
+ FXMenuPane *file_menu;
+ FXMenuPane *camera_menu;
+ FXMenuPane *shadow_menu;
+ FXMenuPane *sampler_menu;
+ FXMenuPane *traverser_menu;
+ FXMenuPane *options_menu;
+
+ FXMenuCommand *cutting_flip;
+ FXMenuCheck *hide_selected_check;
+ FXMenuCheck *fly_bookmarks_check;
vector<FXMenuCommand *> extra_options_command;
- vector<FXDialogBox *> extra_options_dialog;
+ vector<FXDialogBox *> extra_options_dialog;
FMantaRecorderDialog *camera_path_dialog;
- FXRealSlider *speed_slider;
- FXRealSlider *cutting_slider;
- int cutting_snap;
-
- // Camera options.
- FXListBox *camera_bookmark_list;
- vector<string> camera_text_list;
+ FXRealSlider *speed_slider;
+ FXRealSlider *cutting_slider;
+ int cutting_snap;
+
+ // Camera options.
+ FXListBox *camera_bookmark_list;
+ vector<string> camera_text_list;
- // Navigator options.
- FXListBox *navigator_list; // User data field will hold
pointer to navigator.
+ // Navigator options.
+ FXListBox *navigator_list; // User data field will hold pointer to
navigator.
- // Image panels for displaying output.
- FMantaImageFrame *manta_frame;
+ // Image panels for displaying output.
+ FMantaImageFrame *manta_frame;
- bool fast_quit;
+ bool fast_quit;
- public:
- // Commands for the main window.
- enum {
- ID_QUIT = FXMainWindow::ID_LAST, // Sent when the
application must quit.
- ID_SPEED_SLIDER, // Control speed
slider was changed.
- ID_CUTTING_SLIDER, // Cutting plane
slider was changed.
- ID_CUTTING_FLIP,
-
- // Bookmarks.
- ID_BOOKMARK_LIST, // User selected a
camera bookmark.
- ID_ADD_BOOKMARK,
-
- // Navigators.
- ID_NAVIGATOR_LIST,
- ID_NAVIGATOR_TOGGLE,
-
- // Camera options.
- ID_PINHOLE_CAMERA,
- ID_ORTHO_CAMERA,
- ID_ENVIRONMENT_CAMERA,
+ public:
+ // Commands for the main window.
+ enum {
+ ID_QUIT = FXMainWindow::ID_LAST, // Sent when the application must
quit.
+ ID_SPEED_SLIDER, // Control speed slider was changed.
+ ID_CUTTING_SLIDER, // Cutting plane slider was changed.
+ ID_CUTTING_FLIP,
+
+ // Bookmarks.
+ ID_BOOKMARK_LIST, // User selected a camera bookmark.
+ ID_ADD_BOOKMARK,
+ ID_SAVE_BOOKMARKS,
+
+ // Navigators.
+ ID_NAVIGATOR_LIST,
+ ID_NAVIGATOR_TOGGLE,
+
+ // Camera options.
+ ID_PINHOLE_CAMERA,
+ ID_ORTHO_CAMERA,
+ ID_ENVIRONMENT_CAMERA,
ID_FISHEYE_CAMERA,
- ID_TEXT_CAMERA,
+ ID_TEXT_CAMERA,
ID_CAMERA_PATHS,
- // Shadow options.
- ID_HARD_SHADOWS,
- ID_NO_SHADOWS,
- ID_TEXT_SHADOWS,
-
- // Multisample options.
- ID_SINGLE_SAMPLER,
- ID_JITTER2_SAMPLER,
- ID_JITTER4_SAMPLER,
- ID_JITTER8_SAMPLER,
- ID_TEXT_SAMPLER, // User wants to enter a
description manually.
+ // Shadow options.
+ ID_HARD_SHADOWS,
+ ID_NO_SHADOWS,
+ ID_TEXT_SHADOWS,
+
+ // Multisample options.
+ ID_SINGLE_SAMPLER,
+ ID_JITTER2_SAMPLER,
+ ID_JITTER4_SAMPLER,
+ ID_JITTER8_SAMPLER,
+ ID_TEXT_SAMPLER, // User wants to enter a description manually.
- // Image traverser options.
+ // Image traverser options.
ID_TILED_TRAVERSER,
ID_FRAMELESS_TRAVERSER,
ID_DISSOLVETILED_TRAVERSER,
- ID_TEXT_TRAVERSER,
+ ID_TEXT_TRAVERSER,
- // Cutting planes.
- ID_ADD_CUTTING_PLANE,
+ // Cutting planes.
+ ID_ADD_CUTTING_PLANE,
- // Different scene options.
- ID_EXTRA_OPTIONS,
+ // Different scene options.
+ ID_HIDE_SELECTED,
+ ID_UNHIDE_ALL,
+ ID_EXTRA_OPTIONS,
- ID_LAST
- };
+ ID_LAST
+ };
- // Constructors.
- FMantaWindow() : manta_interface( 0 ), fast_quit( false ) {
};
- FMantaWindow( FXApp *app, const FXString &name,
+ // Constructors.
+ FMantaWindow() : manta_interface( 0 ), fast_quit( false ) { };
+ FMantaWindow( FXApp *app, const FXString &name,
- bool use_glx = true,
+ bool use_glx = true,
int width = 512, int height = 512, // Dimensions of the gui
int xres = 512, int yres = 512, // Dimensions of the
image.
- FXIcon *ic=NULL,FXIcon *mi=NULL,FXuint
opts=(DECOR_ALL),
- FXint
x=50,FXint y=50,FXint w=512,FXint h=512,FXint pl=0,FXint pr=0,FXint
pt=0,FXint pb=0,FXint hs=0,FXint vs=0);
+ FXIcon *ic=NULL,FXIcon *mi=NULL,FXuint opts=(DECOR_ALL),
+ FXint x=50,FXint y=50,FXint w=512,FXint h=512,FXint
pl=0,FXint pr=0,FXint pt=0,FXint pb=0,FXint hs=0,FXint vs=0);
- // Setup
- void addCameraBookmark ( const string &description, const
string &camera_text );
- void addNavigatorOption( const string &description,
FMantaNavigator *nav );
-
- void addExtraOptionsDialog( const FXString &name, FXDialogBox
*extra_options_dialog_ );
- void setSceneObject( Object *root_object_ );
-
- const string &getCameraBookmark( int i ) { return
camera_text_list[i]; };
-
- // Create the window.
- void create() { FXMainWindow::create(); show(
PLACEMENT_DEFAULT ); };
-
- // Message handlers.
- long onQuit ( FXObject *sender, FXSelector key,
void *data );
- long onSpeedSlider ( FXObject *sender, FXSelector key,
void *data );
- long onCuttingSlider ( FXObject *sender, FXSelector key,
void *data );
- long onCuttingFlip ( FXObject *sender, FXSelector key,
void *data );
- long onCameraBookmark ( FXObject *sender, FXSelector key,
void *data );
+ // Setup
+ void addCameraBookmark ( const string &description, const string
&camera_text );
+ void addNavigatorOption( const string &description, FMantaNavigator *nav
);
+
+ void addExtraOptionsDialog( const FXString &name, FXDialogBox
*extra_options_dialog_ );
+ void setSceneObject( Object *root_object_ );
+
+ const string &getCameraBookmark( int i ) { return camera_text_list[i];
};
+
+ // Create the window.
+ void create() { FXMainWindow::create(); show( PLACEMENT_DEFAULT ); };
+
+ // Message handlers.
+ long onQuit ( FXObject *sender, FXSelector key, void *data );
+ long onSpeedSlider ( FXObject *sender, FXSelector key, void *data );
+ long onCuttingSlider ( FXObject *sender, FXSelector key, void *data );
+ long onCuttingFlip ( FXObject *sender, FXSelector key, void *data );
+ long onCameraBookmark ( FXObject *sender, FXSelector key, void *data );
long onCameraPath ( FXObject *sender, FXSelector key, void *data );
- long onNavigator ( FXObject *sender, FXSelector key,
void *data );
- long onNavigatorToggle( FXObject *sender, FXSelector key,
void *data );
- long onAddBookmark ( FXObject *sender, FXSelector key,
void *data );
- long onCamera ( FXObject *sender, FXSelector key,
void *data );
- long onCameraText ( FXObject *sender, FXSelector key,
void *data );
- long onShadowAlgorithm( FXObject *sender, FXSelector key,
void *data );
- long onShadowAlgorithmText( FXObject *sender, FXSelector key,
void *data );
- long onPixelSampler ( FXObject *sender, FXSelector key,
void *data );
- long onPixelSamplerText( FXObject *sender, FXSelector key,
void *data );
- long onTraverser ( FXObject *sender, FXSelector key,
void *data );
- long onTraverserText ( FXObject *sender, FXSelector key,
void *data );
- long onAddCuttingPlane( FXObject *sender, FXSelector key,
void *data );
- long onPick( FXObject *sender, FXSelector key, void *data );
- long onPOI( FXObject *sender, FXSelector key, void *data );
- long onExtraOptions ( FXObject *sender, FXSelector key,
void *data );
-
- // Accessors.
- void setMantaInterface( RTRTInterface *manta_interface_, int
manta_channel_ ) {
- manta_interface = manta_interface_;
manta_frame->setMantaInterface( manta_interface_, manta_channel_ ); };
- void setNavigator( FMantaNavigator *navigator_ ) {
manta_frame->setNavigator( navigator_ ); };
-
- RTRTInterface *getMantaInterface() { return
manta_interface; };
- FMantaImageFrame *getMantaFrame() { return manta_frame; };
-
- // This method is called by the manta thread to replace the
camera.
- void mantaThreadBookmark( const string camera_text );
-
- // This method is called by the manta thread to replace the
camera.
- void mantaCamera2( const string camera_text );
- void mantaCamera1( Camera *new_camera );
-
- // This method is called by the manta thread to replace the
shadow algorithm.
- void mantaShadowAlgorithm( const string shadow_text ) const;
-
- // This method is called by the manta thread to replace the
shadow algorithm.
- void mantaPixelSampler( const string shadow_text ) const;
-
- // This method is called by the manta thread to replace the
image traverser.
- void mantaTraverser( const string shadow_text ) const;
-
- // This method is called by the manta thread to add a cutting
plane.
- void mantaAddCuttingPlane( Point point, Vector normal ) const;
- void mantaRemoveCuttingPlane() const;
- void mantaMoveCuttingPlane( Real amount ) const;
- void mantaFlipCuttingPlane() const;
- void mantaPick( int x, int y ) const;
- void mantaPOI( int x, int y ) ;
-
- void mantaPOIManeuverComplete();
- mutable CameraPathAutomator *automator;
- mutable Point dstPosition, dstLookAt;
- mutable Vector dstUp;
-
- // This method is called by the manta thread to change the
rendering mode.
- void FMantaWindow::mantaSetSceneObject( Object *root_object_
) const;
- };
+ long onNavigator ( FXObject *sender, FXSelector key, void *data );
+ long onNavigatorToggle( FXObject *sender, FXSelector key, void *data );
+ long onSaveBookmarks ( FXObject *sender, FXSelector key, void *data );
+ long onAddBookmark ( FXObject *sender, FXSelector key, void *data );
+ long onCamera ( FXObject *sender, FXSelector key, void *data );
+ long onCameraText ( FXObject *sender, FXSelector key, void *data );
+ long onShadowAlgorithm( FXObject *sender, FXSelector key, void *data );
+ long onShadowAlgorithmText( FXObject *sender, FXSelector key, void *data
);
+ long onPixelSampler ( FXObject *sender, FXSelector key, void *data );
+ long onPixelSamplerText( FXObject *sender, FXSelector key, void *data );
+ long onTraverser ( FXObject *sender, FXSelector key, void *data );
+ long onTraverserText ( FXObject *sender, FXSelector key, void *data );
+ long onAddCuttingPlane( FXObject *sender, FXSelector key, void *data );
+ long onHideSelected( FXObject *sender, FXSelector key, void *data );
+ long onUnHideAll( FXObject *sender, FXSelector key, void *data );
+ long onPick( FXObject *sender, FXSelector key, void *data );
+ long onPOI( FXObject *sender, FXSelector key, void *data );
+ long onExtraOptions ( FXObject *sender, FXSelector key, void *data );
+
+ // Accessors.
+ void setMantaInterface( RTRTInterface *manta_interface_, int
manta_channel_ ) {
+ manta_interface = manta_interface_; manta_frame->setMantaInterface(
manta_interface_, manta_channel_ ); };
+ void setNavigator( FMantaNavigator *navigator_ ) {
manta_frame->setNavigator( navigator_ ); };
+
+ RTRTInterface *getMantaInterface() { return manta_interface; };
+ FMantaImageFrame *getMantaFrame() { return manta_frame; };
+
+ // This method is called by the manta thread to replace the camera.
+ void mantaThreadBookmark( const string camera_text );
+
+ // This method is called by the manta thread to replace the camera.
+ void mantaCamera2( const string camera_text );
+ void mantaCamera1( Camera *new_camera );
+
+ // This method is called by the manta thread to replace the shadow
algorithm.
+ void mantaShadowAlgorithm( const string shadow_text ) const;
+
+ // This method is called by the manta thread to replace the shadow
algorithm.
+ void mantaPixelSampler( const string shadow_text ) const;
+
+ // This method is called by the manta thread to replace the image
traverser.
+ void mantaTraverser( const string shadow_text ) const;
+
+ // This method is called by the manta thread to add a cutting plane.
+ void mantaAddCuttingPlane( Point point, Vector normal ) const;
+ void mantaRemoveCuttingPlane() const;
+ void mantaMoveCuttingPlane( Real amount ) const;
+ void mantaFlipCuttingPlane() const;
+ void mantaPick( int x, int y ) const;
+ void mantaPOI( int x, int y ) ;
+
+ void mantaPOIManeuverComplete();
+ mutable CameraPathAutomator *automator;
+ mutable Point dstPosition, dstLookAt;
+ mutable Vector dstUp;
+
+ // This method is called by the manta thread to change the rendering
mode.
+ void FMantaWindow::mantaSetSceneObject( Object *root_object_ ) const;
+
+ // This method is called to toggle hide/show selected submeshes.
+ void mantaToggleHideSelected( int mode );
+
+ // Unhide all hidden parts.
+ void mantaUnHideAll();
+ };
};
#endif
Modified: branches/itanium2/fox/MediaFusionBridge.cc
==============================================================================
--- branches/itanium2/fox/MediaFusionBridge.cc (original)
+++ branches/itanium2/fox/MediaFusionBridge.cc Sun Nov 13 23:02:29 2005
@@ -281,12 +281,12 @@
// Set the owner if the button is pressed.
if (event_type == ButtonPress) {
owner_pid = packet.pid[i];
- std::cerr << "*** Owner " << owner_pid << " set." << std::endl;
+ // std::cerr << "*** Owner " << owner_pid << " set." << std::endl;
}
// Otherwise clear the owner.
else {
- std::cerr << "*** Owner " << owner_pid << " cleared." <<
std::endl;
+ // std::cerr << "*** Owner " << owner_pid << " cleared." <<
std::endl;
owner_pid = 0;
}
Modified: branches/itanium2/fox/dm_demo.cc
==============================================================================
--- branches/itanium2/fox/dm_demo.cc (original)
+++ branches/itanium2/fox/dm_demo.cc Sun Nov 13 23:02:29 2005
@@ -272,7 +272,7 @@
// Create a transparent kdtree.
TransparentKDTree *transparent_kdtree =
- new TransparentKDTree( kdtree, new KDTreeCopyColorMaterial );
+ new TransparentKDTree( kdtree, new KDTreeCopyColorMaterial, 1.0 );
// XXX to be replaced
__global_transparent_kdtree = transparent_kdtree;
@@ -285,6 +285,9 @@
// Create a kdtree explorer dialog.
manta_window.addExtraOptionsDialog( "kd-Tree Explorer",
new FMantaKdExplorerDialog(
&manta_window, kdtree, "kd-Tree Explorer" ));
+
+ // Use the transparent renderer by default
+ manta_window.setSceneObject( transparent_kdtree );
}
}
Modified: branches/itanium2/fox/sc_demo.cc
==============================================================================
--- branches/itanium2/fox/sc_demo.cc (original)
+++ branches/itanium2/fox/sc_demo.cc Sun Nov 13 23:02:29 2005
@@ -306,7 +306,7 @@
// Create a transparent kdtree.
TransparentKDTree *transparent_kdtree =
- new TransparentKDTree( kdtree, new KDTreeCopyColorMaterial );
+ new TransparentKDTree( kdtree, new KDTreeCopyColorMaterial, 1.0 );
// XXX to be replaced
__global_transparent_kdtree = transparent_kdtree;
@@ -316,6 +316,8 @@
manta_window.addExtraOptionsDialog( "Transparency",
new FMantaTransparentDialog(
&manta_window, kdtree, transparent_kdtree, "Transparency" ));
+ // Use the transparent renderer by default
+ manta_window.setSceneObject( transparent_kdtree );
}
/////////////////////////////////////////////////////////////////////////////
- [MANTA] r707 - branches/itanium2/fox, abe, 11/13/2005
Archive powered by MHonArc 2.6.16.