Text archives Help
- From: abe@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [MANTA] r447 - in branches/itanium2: . Model Model/Textures fox scenes
- Date: Thu, 28 Jul 2005 02:04:45 -0600 (MDT)
Author: abe
Date: Thu Jul 28 02:04:38 2005
New Revision: 447
Added:
branches/itanium2/fox/dm_demo.cc
- copied, changed from r442, branches/itanium2/fox/fox_manta.cc
Removed:
branches/itanium2/fox/fox_manta.cc
Modified:
branches/itanium2/Model/CMakeLists.txt
branches/itanium2/Model/Textures/CheckerTexture.h
branches/itanium2/fox/CMakeLists.txt
branches/itanium2/fox/FMantaWidgets.cc
branches/itanium2/fox/FMantaWidgets.h
branches/itanium2/manta-commands.txt
branches/itanium2/scenes/boeing777.cc
branches/itanium2/scenes/objviewer.cc
Log:
Committing changes to try and get a benchmark running on fisher
Modified: branches/itanium2/Model/CMakeLists.txt
==============================================================================
--- branches/itanium2/Model/CMakeLists.txt (original)
+++ branches/itanium2/Model/CMakeLists.txt Thu Jul 28 02:04:38 2005
@@ -11,6 +11,7 @@
INCLUDE (MiscObjects/CMakeLists.txt)
INCLUDE (Readers/CMakeLists.txt)
INCLUDE (Intersections/CMakeLists.txt)
+INCLUDE (Textures/CMakeLists.txt)
SET(BUILD_SCALAR_VOLUME CACHE BOOL false)
IF(BUILD_SCALAR_VOLUME)
@@ -31,6 +32,7 @@
${Manta_MiscObjects_SRCS}
${Manta_Readers_SRCS}
${Manta_Intersections_SRCS}
+ ${Manta_Textures_SRCS}
)
TARGET_LINK_LIBRARIES(Manta_Model Manta_Interface Manta_Core)
Modified: branches/itanium2/Model/Textures/CheckerTexture.h
==============================================================================
--- branches/itanium2/Model/Textures/CheckerTexture.h (original)
+++ branches/itanium2/Model/Textures/CheckerTexture.h Thu Jul 28 02:04:38
2005
@@ -3,6 +3,7 @@
#define Manta_Model_CheckerTexture_h
#include <Interface/Texture.h>
+#include <Core/Geometry/PointVector.h>
namespace Manta {
class RayPacket;
Modified: branches/itanium2/fox/CMakeLists.txt
==============================================================================
--- branches/itanium2/fox/CMakeLists.txt (original)
+++ branches/itanium2/fox/CMakeLists.txt Thu Jul 28 02:04:38 2005
@@ -15,7 +15,7 @@
LINK_DIRECTORIES (${HISTX_LIB} )
ENDIF(HISTX_PATH)
- ADD_EXECUTABLE(dm_demo fox_manta.cc
+ ADD_EXECUTABLE(dm_demo dm_demo.cc
FMantaImageFrame.cc
FMantaImageFrame.h
FMantaWidgets.cc
Modified: branches/itanium2/fox/FMantaWidgets.cc
==============================================================================
--- branches/itanium2/fox/FMantaWidgets.cc (original)
+++ branches/itanium2/fox/FMantaWidgets.cc Thu Jul 28 02:04:38 2005
@@ -0,0 +1,68 @@
+
+#include <fox/FMantaWidgets.h>
+
+#include <Core/Color/Color.h>
+
+using namespace Manta;
+using namespace fox_manta;
+using namespace FX;
+
+
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+// FMANTA REAL SPINNER FMANTA REAL SPINNER FMANTA REAL SPINNER FMANTA
REAL S
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+FXDEFMAP(FMantaRealSpinner) FMantaRealSpinnerMap[] = {
+
/////////////////////////////////////////////////////////////////////////////
+ // Message_Type ID
Message_Handler
+ FXMAPFUNC(SEL_COMMAND, FMantaRealSpinner::ID_SPINNER_CHANGED,
FMantaRealSpinner::onSpinnerChanged )
+};
+
+FXIMPLEMENT(FMantaRealSpinner,FXRealSpinner,FMantaRealSpinnerMap,ARRAYNUMBER(FMantaRealSpinnerMap));
+
+long FMantaRealSpinner::onSpinnerChanged( FXObject *sender, FXSelector key,
void *data ) {
+ Real value = getValue();
+ setter->sendCallback( value );
+ return 1;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+// FMANTA REAL SLIDER FMANTA REAL SLIDER FMANTA REAL SLIDER FMANTA REAL
SLID
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+FXDEFMAP(FMantaRealSlider) FMantaRealSliderMap[] = {
+
/////////////////////////////////////////////////////////////////////////////
+ // Message_Type ID
Message_Handler
+ FXMAPFUNC(SEL_COMMAND, FMantaRealSlider::ID_SLIDER_CHANGED,
FMantaRealSlider::onSliderChanged )
+};
+
+FXIMPLEMENT(FMantaRealSlider,FXRealSlider,FMantaRealSliderMap,ARRAYNUMBER(FMantaRealSliderMap));
+
+long FMantaRealSlider::onSliderChanged( FXObject *sender, FXSelector key,
void *data ) {
+ Real value = getValue();
+ setter->sendCallback( value );
+ return 1;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+// FMANTA COLOR FRAME FMANTA COLOR FRAME FMANTA COLOR FRAME FMANTA COLOR
FRA
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+FXDEFMAP(FMantaColorFrame) FMantaColorFrameMap[] = {
+
/////////////////////////////////////////////////////////////////////////////
+ // Message_Type ID
Message_Handler
+ FXMAPFUNC(SEL_COMMAND, FMantaColorFrame::ID_COLOR_CHANGED,
FMantaColorFrame::onColorChanged )
+};
+
+FXIMPLEMENT(FMantaColorFrame,FXHorizontalFrame,FMantaColorFrameMap,ARRAYNUMBER(FMantaColorFrameMap));
+
+long FMantaColorFrame::onColorChanged( FXObject *sender, FXSelector key,
void *data ) {
+ Color value(RGB( red->getValue(), green->getValue(), blue->getValue()
));
+ setter->sendCallback( value );
+ return 1;
+}
+
+
Modified: branches/itanium2/fox/FMantaWidgets.h
==============================================================================
--- branches/itanium2/fox/FMantaWidgets.h (original)
+++ branches/itanium2/fox/FMantaWidgets.h Thu Jul 28 02:04:38 2005
@@ -3,8 +3,146 @@
#ifndef fox_FMANTAWIDGETS__H
#define fox_FMANTAWIDGETS__H
+#include <fx.h>
+#include <fx3d.h>
+
+#include <MantaTypes.h>
+#include <Interface/RTRTInterface.h>
+
namespace fox_manta {
+ using namespace FX;
+ using namespace Manta;
+
+
/////////////////////////////////////////////////////////////////////////////
+ // This is the base class for Setters. These objects act as data
targets for
+ // gui components, they send callbacks to manta when the gui is
changed.
+ template< class Arg1 >
+ class FMantaSetter {
+ protected:
+ RTRTInterface *manta_interface;
+
+ public:
+ FMantaSetter() : manta_interface( 0 ) { };
+ FMantaSetter( RTRTInterface *manta_interface_ ) :
manta_interface( manta_interface_ ) { };
+
+ // This method is called by a gui widget to send a manta
transaction with
+ // the new value.
+ virtual void sendCallback( Arg1 &data ) = 0;
+ };
+
+ template< class Target, class Arg1 >
+ class FMantaSet : public FMantaSetter<Arg1> {
+ private:
+ // Callback target and method.
+ Target* ptr;
+ void (Target::*pmf)(Arg1);
+
+ public:
+ FMantaSet( RTRTInterface *manta_interface_, Target* ptr_,
void (Target::*pmf_)(Arg1) ) :
+ FMantaSetter<Arg1>( manta_interface_ ), ptr( ptr_ ),
pmf( pmf_ ) { }
+
+ virtual void sendCallback( Arg1 &arg1 ) {
+
FMantaSetter<Arg1>::manta_interface->addTransaction("FMantaSetCallback",
Callback::create( ptr, pmf, arg1 ) );
+ }
+ };
+
+
/////////////////////////////////////////////////////////////////////////////
+
/////////////////////////////////////////////////////////////////////////////
+ // FMANTA REAL SPINNER FMANTA REAL SPINNER FMANTA REAL SPINNER
FMANTA REAL
+
/////////////////////////////////////////////////////////////////////////////
+
/////////////////////////////////////////////////////////////////////////////
+ class FMantaRealSpinner : public FXRealSpinner {
+ FXDECLARE(FMantaRealSpinner)
+ private:
+ // Setter which binds the spinner to a specific
instance/method.
+ FMantaSetter<Real> *setter;
+
+ public:
+ enum {
+ ID_SPINNER_CHANGED = FXRealSpinner::ID_LAST,
+ ID_LAST
+ };
+
+ // Constructors.
+ FMantaRealSpinner( ) { };
+ FMantaRealSpinner( FXComposite *parent, int cols,
FMantaSetter<Real> *setter_ ) :
+ FXRealSpinner( parent, cols, this, ID_SPINNER_CHANGED
), setter( setter_ ) { };
+
+ long onSpinnerChanged( FXObject *sender, FXSelector key, void
*data );
+ };
+
+
/////////////////////////////////////////////////////////////////////////////
+
/////////////////////////////////////////////////////////////////////////////
+ // FMANTA REAL SLIDER FMANTA REAL SLIDER FMANTA REAL SLIDER FMANTA
REAL SL
+
/////////////////////////////////////////////////////////////////////////////
+
/////////////////////////////////////////////////////////////////////////////
+ class FMantaRealSlider : public FXRealSlider {
+ FXDECLARE(FMantaRealSlider)
+private:
+ // Setter which binds the spinner to a specific
instance/method.
+ FMantaSetter<Real> *setter;
+
+public:
+ enum {
+ ID_SLIDER_CHANGED = FXRealSlider::ID_LAST,
+ ID_LAST
+ };
+
+ // Constructors.
+ FMantaRealSlider( ) { };
+ FMantaRealSlider( FXComposite *parent, FMantaSetter<Real>
*setter_, int opts=REALSLIDER_NORMAL ) :
+ FXRealSlider( parent, this, ID_SLIDER_CHANGED, opts
), setter( setter_ ) { };
+
+ long onSliderChanged( FXObject *sender, FXSelector key, void
*data );
+ };
+
+
/////////////////////////////////////////////////////////////////////////////
+
/////////////////////////////////////////////////////////////////////////////
+ // FMANTA COLOR FRAME FMANTA COLOR FRAME FMANTA COLOR FRAME FMANTA
COLOR F
+
/////////////////////////////////////////////////////////////////////////////
+
/////////////////////////////////////////////////////////////////////////////
+ class FMantaColorFrame : FXHorizontalFrame {
+ FXDECLARE(FMantaColorFrame)
+ private:
+ FMantaSetter<Color> *setter;
+
+ // Input spinners.
+ FXRealSpinner *red, *green, *blue;
+
+ public:
+ enum {
+ ID_COLOR_CHANGED = FXHorizontalFrame::ID_LAST,
+ ID_LAST
+ };
+
+ // Constructors.
+ FMantaColorFrame( ) { };
+ FMantaColorFrame( FXComposite *parent, FMantaSetter<Color>
*setter_,
+
FXuint opts=0, FXint x=0, FXint y=0, FXint w=0, FXint h=0,
+
FXint pl=DEFAULT_SPACING, FXint pr=DEFAULT_SPACING,
+
FXint pt=DEFAULT_SPACING, FXint pb=DEFAULT_SPACING,
+
FXint hs=DEFAULT_SPACING, FXint vs=DEFAULT_SPACING ) :
+ FXHorizontalFrame( parent, opts, x, y, w, h, pl, pr,
pt, pb, hs, vs ),
+ setter( setter_ )
+ {
+ red = new FXRealSpinner( this, 2, this,
ID_COLOR_CHANGED );
+ red->setRange( 0.0, 1.0 );
+
+ green = new FXRealSpinner( this, 2, this,
ID_COLOR_CHANGED );
+ green->setRange( 0.0, 1.0 );
+
+ blue = new FXRealSpinner( this, 2, this,
ID_COLOR_CHANGED );
+ blue->setRange( 0.0, 1.0 );
+ }
+
+ long onColorChanged( FXObject *sender, FXSelector key, void
*data );
+ };
+
};
-#endif
\ No newline at end of file
+#endif
+
+
+
+
Copied: branches/itanium2/fox/dm_demo.cc (from r442,
branches/itanium2/fox/fox_manta.cc)
==============================================================================
--- branches/itanium2/fox/fox_manta.cc (original)
+++ branches/itanium2/fox/dm_demo.cc Thu Jul 28 02:04:38 2005
@@ -14,6 +14,7 @@
#include <fox/FMantaUniformNav.h>
#include <fox/FMantaQuakeNav.h>
#include <fox/FMantaTrackballNav.h>
+#include <fox/FMantaWidgets.h>
// #include <histx/SingleSamplerCounter.h>
@@ -40,7 +41,8 @@
FXDECLARE(DmDemoDialog)
private:
FXListBox *render_mode_box;
- FXRealSlider *alpha_slider;
+ // FXRealSlider *alpha_slider;
+ FMantaRealSlider *alpha_slider;
FMantaWindow *manta_window;
@@ -89,6 +91,9 @@
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.
@@ -99,7 +104,12 @@
// 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 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();
@@ -219,23 +229,6 @@
manta_interface->setScene( createDefaultScene() );
}
- // Check to see if the default scene was a kdtree.
- Object *root_object = manta_interface->getScene()->getObject();
-
- KDTree *kdtree = 0;
- if ((kdtree = dynamic_cast<KDTree *>( root_object ))) {
-
- std::cout << "Building transparent tree." << std::endl;
-
- // Create a transparent kdtree.
- TransparentKDTree *transparent_kdtree = new
TransparentKDTree( kdtree, new CopyColorMaterial );
-
- // Create a new extra options dialog.
- manta_window.setExtraOptionsDialog(
- new DmDemoDialog( &manta_window, kdtree,
transparent_kdtree, "Digital Mockup Demo" ) );
-
- }
-
// Check to see if a bookmark file was specified.
if (bookmark_file_name.size() > 0) {
@@ -301,6 +294,27 @@
// Set the manta interface for the application.
manta_window.setMantaInterface( manta_interface, manta_channel );
+ // Check to see if the default scene was a kdtree.
+ Object *root_object = manta_interface->getScene()->getObject();
+
+
/////////////////////////////////////////////////////////////////////////////
+ // Create any necessary dialogs now since everything else should be
initialized.
+ KDTree *kdtree = 0;
+ if ((kdtree = dynamic_cast<KDTree *>( root_object ))) {
+
+ std::cout << "Building transparent tree." << std::endl;
+
+ // Create a transparent kdtree.
+ TransparentKDTree *transparent_kdtree = new
TransparentKDTree( kdtree, new CopyColorMaterial );
+
+ // Create a new extra options dialog.
+ manta_window.setExtraOptionsDialog(
+ new DmDemoDialog( &manta_window, kdtree,
transparent_kdtree, "Digital Mockup Demo" ) );
+
+ }
+
+
+
/////////////////////////////////////////////////////////////////////////////
// Start up manta.
manta_interface->beginRendering(false);
Modified: branches/itanium2/manta-commands.txt
==============================================================================
--- branches/itanium2/manta-commands.txt (original)
+++ branches/itanium2/manta-commands.txt Thu Jul 28 02:04:38 2005
@@ -18,3 +18,4 @@
# Fox demo
bin/fox_manta -np 54 -scene "lib/libscene_boeing777.so( -file
/dev/shm/Boeing777.v3c1 -np 32 )"
+bin/dm_demo -np 50 -scene "lib/libscene_boeing777.so( -file
/dev/shm/Boeing777.v3c1 -np 50 )" -bookmarks /dev/shm/Boeing777.v3c1.txt
Modified: branches/itanium2/scenes/boeing777.cc
==============================================================================
--- branches/itanium2/scenes/boeing777.cc (original)
+++ branches/itanium2/scenes/boeing777.cc Thu Jul 28 02:04:38 2005
@@ -24,6 +24,7 @@
#include <Model/Materials/Lambertian.h>
#include <Model/Materials/MetalMaterial.h>
#include <Model/Materials/NormalMaterial.h>
+#include <Model/Materials/Phong.h>
#include <Model/Primitives/Parallelogram.h>
#include <Model/Primitives/Sphere.h>
#include <Model/Textures/CheckerTexture.h>
@@ -35,6 +36,7 @@
#include <Model/Materials/LambertianAlt.h>
#include <Model/Materials/CopyColorMaterial.h>
+#include <Model/Textures/Constant.h>
#include <SCIRun/Core/Thread/Time.h>
@@ -100,7 +102,11 @@
// Create a kd tree.
// KDTree *kdtree = new KDTree( new Lambertian( new KDTreeTexture ) );
- KDTree *kdtree = new KDTree( new LambertianAlt );
+ KDTree *kdtree = new KDTree( new Phong( new KDTreeTexture,
+ new
Constant<Color>(Color::white()),
+
128,
+
new Constant<double>(0.0) ) );
+ //KDTree *kdtree = new KDTree( new LambertianAlt );
double start_time = Time::currentSeconds();
Modified: branches/itanium2/scenes/objviewer.cc
==============================================================================
--- branches/itanium2/scenes/objviewer.cc (original)
+++ branches/itanium2/scenes/objviewer.cc Thu Jul 28 02:04:38 2005
@@ -140,21 +140,22 @@
Color diffuse(RGB( c0, c1, c2 ));
+// #if 0
// Check the material name.
- // string mtl_name = model->materials[i].name;
- // if (mtl_name.find("Clear")==0) {
+ string mtl_name = model->materials[i].name;
+ if (mtl_name.find("Clear")==0) {
// Note that the first material added by blender is
always an
// unused default material..
- // material_array[i-1] = new Dielectric( diffuse,
- //
Color(RGB(0.6,0.6,0.8)),
- //
Color(RGB(log(c0),log(c1),log(c2))),
- //
128, 1.2, 1.0 );
- // }
- // else {
- material_array[i-1] = new Lambertian( diffuse );
- // material_array[i-1] = new Phong( diffuse,
diffuse*1.1, 128 );
- // }
+ material_array[i-1] = new Dielectric( 1.3, 1.0,
Color(RGB(0.8,0.8,0.8)));
+ // material_array[i-1] = new Dielectric( diffuse,
Color(RGB(0.6,0.6,0.6)), Color(RGB(log(c0),log(c1),log(c2))), 28, 1.3, 1.0 );
+ }
+ else {
+ // material_array[i-1] = new Lambertian( diffuse );
+ material_array[i-1] = new Phong( diffuse,
Color(RGB(1.0,1.0,1.0)), 32, 0.0 );
+ }
+// #endif
+ // material_array[i-1] = new Lambertian( diffuse );
}
};
- [MANTA] r447 - in branches/itanium2: . Model Model/Textures fox scenes, abe, 07/28/2005
Archive powered by MHonArc 2.6.16.