Commit 621401d0 authored by hrchilds's avatar hrchilds

Update from December 4, 2005

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@579 18c085ea-50e0-402c-830e-de6fd14e8384
parent ea0ec949
......@@ -64,6 +64,9 @@ class avtSourceFromAVTDataset;
// Hank Childs, Tue Aug 16 16:50:56 PDT 2005
// Add method VerifyVariableTypes.
//
// Hank Childs, Sun Dec 4 17:31:14 PST 2005
// Added description.
//
// ****************************************************************************
class EXPRESSION_API avtExpressionEvaluatorFilter
......@@ -77,6 +80,9 @@ class EXPRESSION_API avtExpressionEvaluatorFilter
virtual ~avtExpressionEvaluatorFilter();
virtual const char* GetType(void)
{ return "avtExpressionEvaluatorFilter";};
virtual const char *GetDescription(void)
{ return "Creating expressions"; };
virtual void Query(PickAttributes *);
virtual avtQueryableSource *
......
......@@ -34,6 +34,9 @@
// Moved inlined destructor definition to .C file because certain compilers
// have problems with them.
//
// Hank Childs, Sun Dec 4 17:07:52 PST 2005
// Added description method.
//
// ****************************************************************************
class AVTFILTERS_API avtImageCompositer : public avtImageToImageFilter
......@@ -42,6 +45,10 @@ class AVTFILTERS_API avtImageCompositer : public avtImageToImageFilter
avtImageCompositer();
virtual ~avtImageCompositer();
virtual const char *GetType(void) { return "avtImageCompositer"; };
virtual const char *GetDescription(void)
{ return "Compositing images."; };
void SetOutputImageSize(const int numRows,
const int numCols);
void GetOutputImageSize(int *numRows,
......
......@@ -179,6 +179,62 @@ avtRayTracer::SetGradientBackgroundColors(const float bg1[3],
}
// ****************************************************************************
// Function: GetNumberOfStages
//
// Purpose:
// Determines how many stages the ray tracer will take.
//
// Programmer: Hank Childs
// Creation: December 4, 2005
//
// ****************************************************************************
int
avtRayTracer::GetNumberOfStages(int screenX, int screenY, int screenZ)
{
int nD = GetNumberOfDivisions(screenX, screenY, screenZ);
int numPerTile = 3;
#ifdef PARALLEL
numPerTile = 5;
#endif
return 3*nD*nD;
}
// ****************************************************************************
// Function: GetNumberOfDivisions
//
// Purpose:
// Determines how many divisions of screen space we should use. That is,
// how many tiles should we use.
//
// Programmer: Hank Childs
// Creation: December 4, 2005
//
// ****************************************************************************
int
avtRayTracer::GetNumberOfDivisions(int screenX, int screenY, int screenZ)
{
VISIT_LONG_LONG numSamps = screenX*screenY*screenZ;
int sampLimitPerProc = 25000000; // 25M
numSamps /= PAR_Size();
int numTiles = numSamps/sampLimitPerProc;
int numDivisions = (int) sqrt((double) numTiles);
if (numDivisions < 1)
numDivisions = 1;
int altNumDiv = (int)(screenX / 700.) + 1;
if (altNumDiv > numDivisions)
numDivisions = altNumDiv;
altNumDiv = (int)(screenY / 700.) + 1;
if (altNumDiv > numDivisions)
numDivisions = altNumDiv;
return numDivisions;
}
// ****************************************************************************
// Method: avtRayTracer::Execute
//
......@@ -338,19 +394,7 @@ avtRayTracer::Execute(void)
// The tiles are important to make sure that we never need too much
// memory.
//
VISIT_LONG_LONG numSamps = screen[0]*screen[1]*samplesPerRay;
int sampLimitPerProc = 25000000; // 25M
numSamps /= PAR_Size();
int numTiles = numSamps/sampLimitPerProc;
int numDivisions = (int) sqrt((double) numTiles);
if (numDivisions < 1)
numDivisions = 1;
int altNumDiv = (int)(screen[0] / 700.) + 1;
if (altNumDiv > numDivisions)
numDivisions = altNumDiv;
altNumDiv = (int)(screen[1] / 700.) + 1;
if (altNumDiv > numDivisions)
numDivisions = altNumDiv;
int numDivisions = GetNumberOfDivisions(screen[0],screen[1],samplesPerRay);
int IStep = screen[0] / numDivisions;
int JStep = screen[1] / numDivisions;
......
......@@ -41,6 +41,9 @@ class avtRayFunction;
// Moved inlined destructor definition to .C file because certain compilers
// have problems with them.
//
// Hank Childs, Sun Dec 4 18:00:55 PST 2005
// Add method that estimates number of stages.
//
// ****************************************************************************
class AVTFILTERS_API avtRayTracer : public avtDatasetToImageFilter
......@@ -55,6 +58,8 @@ class AVTFILTERS_API avtRayTracer : public avtDatasetToImageFilter
void SetView(const avtViewInfo &);
static int GetNumberOfStages(int, int, int);
void InsertOpaqueImage(avtImage_p);
void SetRayFunction(avtRayFunction *);
......@@ -83,6 +88,7 @@ class AVTFILTERS_API avtRayTracer : public avtDatasetToImageFilter
virtual void Execute(void);
virtual avtPipelineSpecification_p
PerformRestriction(avtPipelineSpecification_p);
static int GetNumberOfDivisions(int, int, int);
};
......
......@@ -185,23 +185,20 @@ avtTerminatingSource::GetSpeciesAuxiliaryData(const char *type, void *args,
// Hank Childs, Tue Sep 30 16:33:37 PDT 2003
// Reset all of the validity fields, not just error occurred.
//
// Hank Childs, Sun Dec 4 17:45:14 PST 2005
// No longer issue progress. All this does is clobber useful progress
// reports.
//
// ****************************************************************************
bool
avtTerminatingSource::Update(avtPipelineSpecification_p spec)
{
if (!ArtificialPipeline())
{
UpdateProgress(0, 0, "avtTerminatingSource", "Retrieving data.");
}
if (!ArtificialPipeline())
GetOutput()->GetInfo().GetValidity().Reset();
avtDataSpecification_p data = BalanceLoad(spec);
bool rv = FetchData(data);
if (!ArtificialPipeline())
{
UpdateProgress(1, 0, "avtTerminatingSource", "Retrieving data.");
}
return rv;
}
......
......@@ -168,6 +168,9 @@ class AttributeSubject;
// Brad Whitlock, Tue Dec 14 15:29:22 PST 2004
// I made SetVarName be virtual.
//
// Hank Childs, Sun Dec 4 17:52:16 PST 2005
// Added GetNumberOfStagesForImageBasedPlots.
//
// ****************************************************************************
class PLOTTER_API avtPlot
......@@ -188,6 +191,8 @@ class PLOTTER_API avtPlot
const WindowAttributes*);
virtual bool PlotIsImageBased(void) { return false; };
virtual int GetNumberOfStagesForImageBasedPlot(
const WindowAttributes &) { return 0; };
virtual avtImage_p ImageExecute(avtImage_p img,
const WindowAttributes &)
{ return img; };
......
......@@ -1490,12 +1490,25 @@ VisWinRendering::GetRenderTimes(float times[6]) const
// Kathleen Bonnell, Thu Jun 30 15:29:55 PDT 2005
// Support red-green stereo type.
//
// Hank Childs, Sun Dec 4 18:50:46 PST 2005
// Issue a warning if the user tried to start stereo without putting
// "-stereo" on the command line ['4432].
//
// ****************************************************************************
void
VisWinRendering::SetStereoRendering(bool enabled, int type)
{
if(enabled != stereo || type != stereoType)
if (enabled && !stereoEnabled && (type == 2))
{
avtCallback::IssueWarning("To use crystal eyes stereo, you need "
"to re-start VisIt with the \"-stereo\" flag. VisIt does not "
"automatically have stereo functionality enabled, because enabling "
" it can incur severe performance penalties in non-stereo mode. We"
" apologize for any inconvience.");
return;
}
if (enabled != stereo || type != stereoType)
{
stereo = enabled;
stereoType = type;
......
......@@ -1240,6 +1240,10 @@ RPCExecutor<DefineVirtualDatabaseRPC>::Execute(DefineVirtualDatabaseRPC *rpc)
//
// Mark C. Miller, Thu Nov 3 16:59:41 PST 2005
// Added compression controls
//
// Hank Childs, Sun Dec 4 16:51:20 PST 2005
// Allow SR mode to give progress during rendering.
//
// ****************************************************************************
template<>
void
......@@ -1254,10 +1258,14 @@ RPCExecutor<RenderRPC>::Execute(RenderRPC *rpc)
debug2 << rpc->GetIDs()[i] << ", ";
debug2 << endl;
avtDataObjectSource::RegisterProgressCallback(NULL, NULL);
LoadBalancer::RegisterProgressCallback(NULL, NULL);
avtDataObjectSource::RegisterProgressCallback(
Engine::EngineUpdateProgressCallback, (void*)rpc);
avtTerminatingSource::RegisterInitializeProgressCallback(NULL, NULL);
avtCallback::RegisterWarningCallback(Engine::EngineWarningCallback, (void*)rpc);
LoadBalancer::RegisterProgressCallback(NULL, NULL);
NetworkManager::RegisterInitializeProgressCallback(
Engine::EngineInitializeProgressCallback, (void*)rpc);
NetworkManager::RegisterProgressCallback(
Engine::EngineUpdateProgressCallback, (void*)rpc);
TRY
{
// do the render
......@@ -1285,6 +1293,8 @@ RPCExecutor<RenderRPC>::Execute(RenderRPC *rpc)
avtTerminatingSource::RegisterInitializeProgressCallback(
Engine::EngineInitializeProgressCallback, NULL);
avtCallback::RegisterWarningCallback(Engine::EngineWarningCallback, NULL);
NetworkManager::RegisterInitializeProgressCallback(NULL, NULL);
NetworkManager::RegisterProgressCallback(NULL, NULL);
}
// ****************************************************************************
......
// ************************************************************************* //
// NetworkManager.C //
// ************************************************************************* //
#include <snprintf.h>
#include <AttributeSubject.h>
#include <NetworkManager.h>
......@@ -75,12 +79,25 @@
#include <map>
using std::set;
//
// Static functions.
//
static double RenderBalance(int numTrianglesIHave);
static void DumpImage(avtDataObject_p, const char *fmt, bool allprocs=true);
static void DumpImage(avtImage_p, const char *fmt, bool allprocs=true);
static ref_ptr<avtDatabase> GetDatabase(void *, const std::string &,
int, const char *);
//
// Static data members of the NetworkManager class.
//
InitializeProgressCallback NetworkManager::initializeProgressCallback = NULL;
void *NetworkManager::initializeProgressCallbackArgs=NULL;
ProgressCallback NetworkManager::progressCallback = NULL;
void *NetworkManager::progressCallbackArgs = NULL;
// ****************************************************************************
// Method: NetworkManager default constructor
//
......@@ -1730,6 +1747,10 @@ NetworkManager::HasNonMeshPlots(const intVector plotIds)
//
// Mark C. Miller, Wed Jun 8 11:03:31 PDT 2005
// Added code to deal with opaque mesh plots correctly.
//
// Hank Childs, Sun Dec 4 16:58:32 PST 2005
// Added progress to scalable renderings.
//
// ****************************************************************************
avtDataObjectWriter_p
NetworkManager::Render(intVector plotIds, bool getZBuffer, int annotMode,
......@@ -1965,6 +1986,15 @@ NetworkManager::Render(intVector plotIds, bool getZBuffer, int annotMode,
two_pass_mode = UnifyMaximumValue(two_pass_mode);
}
#endif
int nstages = 3; // Rendering + Two for Compositing
nstages += (doShadows ? 2 : 0);
nstages += (two_pass_mode ? 1 : 0);
for (int ss = 0 ; ss < imageBasedPlots.size() ; ss++)
{
nstages += imageBasedPlots[ss]
->GetNumberOfStagesForImageBasedPlot(windowAttributes);
}
initializeProgressCallback(initializeProgressCallbackArgs,nstages);
// render the image and capture it. Relies upon explicit render
int t3 = visitTimer->StartTimer();
......@@ -1977,11 +2007,17 @@ NetworkManager::Render(intVector plotIds, bool getZBuffer, int annotMode,
// FIRST PASS - Opaque only
// ************************************************************
progressCallback(progressCallbackArgs, "NetworkManager",
"Render geometry", 0, 1);
avtImage_p theImage;
if (two_pass_mode)
theImage=viswin->ScreenCapture(viewportedMode,true,true,false);
else
theImage=viswin->ScreenCapture(viewportedMode,true);
progressCallback(progressCallbackArgs, "NetworkManager",
"Render geometry", 1, 1);
progressCallback(progressCallbackArgs, "NetworkManager",
"Compositing", 0, 1);
visitTimer->StopTimer(t3, "Screen capture for SR");
......@@ -2040,6 +2076,8 @@ NetworkManager::Render(intVector plotIds, bool getZBuffer, int annotMode,
if (dumpRenders)
DumpImage(compositedImageAsDataObject,
"after_OpaqueComposite", two_pass_mode);
progressCallback(progressCallbackArgs, "NetworkManager",
"Compositing", 1, 1);
// ************************************************************
......@@ -2048,6 +2086,8 @@ NetworkManager::Render(intVector plotIds, bool getZBuffer, int annotMode,
if (two_pass_mode)
{
progressCallback(progressCallbackArgs, "NetworkManager",
"Transparent rendering", 0, 1);
int t1 = visitTimer->StartTimer();
//
......@@ -2088,6 +2128,8 @@ NetworkManager::Render(intVector plotIds, bool getZBuffer, int annotMode,
imageCompositer2.Execute();
compositedImageAsDataObject = imageCompositer2.GetOutput();
visitTimer->StopTimer(t2, "tiled image compositor execute");
progressCallback(progressCallbackArgs, "NetworkManager",
"Transparent rendering", 1, 1);
}
//
......@@ -2095,6 +2137,8 @@ NetworkManager::Render(intVector plotIds, bool getZBuffer, int annotMode,
//
if (doShadows)
{
progressCallback(progressCallbackArgs, "NetworkManager",
"Creating shadows", 0, 1);
avtView3D cur_view = viswin->GetView3D();
//
......@@ -2160,14 +2204,20 @@ NetworkManager::Render(intVector plotIds, bool getZBuffer, int annotMode,
if (PAR_Rank() == 0)
#endif
{
progressCallback(progressCallbackArgs, "NetworkManager",
"Synch'ing up shadows", 0, 1);
avtSoftwareShader::AddShadows(lightImage,
compositedImage,
light_view,
cur_view,
strength);
progressCallback(progressCallbackArgs, "NetworkManager",
"Synch'ing up shadows", 1, 1);
}
delete wic;
}
progressCallback(progressCallbackArgs, "NetworkManager",
"Creating shadows", 1, 1);
}
//
......@@ -3578,6 +3628,47 @@ NetworkManager::NewVisWindow(int winID)
viswinMap[winID].viswin->DisableUpdates();
}
// ****************************************************************************
// Method: NetworkManager::RegisterInitializeProgressCallback
//
// Purpose:
// Registers a callback that allows the network manager to initialize
// its progress.
//
// Programmer: Hank Childs
// Creation: December 4, 2005
//
// ****************************************************************************
void
NetworkManager::RegisterInitializeProgressCallback(
InitializeProgressCallback pc, void *args)
{
initializeProgressCallback = pc;
initializeProgressCallbackArgs = args;
}
// ****************************************************************************
// Method: NetworkManager::RegisterProgressCallback
//
// Purpose:
// Registers a callback that allows the network manager to indicate
// its progress.
//
// Programmer: Hank Childs
// Creation: December 4, 2005
//
// ****************************************************************************
void
NetworkManager::RegisterProgressCallback(ProgressCallback pc, void *args)
{
progressCallback = pc;
progressCallbackArgs = args;
}
// ****************************************************************************
// Function: DumpImage
//
......
......@@ -41,6 +41,10 @@ typedef struct _EngineVisWinInfo
bool markedForDeletion;
} EngineVisWinInfo;
typedef void (*InitializeProgressCallback)(void *, int);
typedef void (*ProgressCallback)(void *, const char *, const char *,int,int);
// ****************************************************************************
// Class: NetworkManager
//
......@@ -232,6 +236,10 @@ typedef struct _EngineVisWinInfo
//
// Mark C. Miller, Wed Nov 16 10:46:36 PST 2005
// Added mesh management attributes to StartNetwork
//
// Hank Childs, Sun Dec 4 16:54:05 PST 2005
// Add progress to SR.
//
// ****************************************************************************
class NetworkManager
{
......@@ -307,6 +315,9 @@ class NetworkManager
void CloneNetwork(const int id);
void AddQueryOverTimeFilter(QueryOverTimeAttributes *,
const int clonedFromId);
static void RegisterInitializeProgressCallback(
InitializeProgressCallback, void *);
static void RegisterProgressCallback(ProgressCallback, void *);
private:
......@@ -333,6 +344,12 @@ class NetworkManager
std::map<int, EngineVisWinInfo> viswinMap;
bool dumpRenders;
static InitializeProgressCallback
initializeProgressCallback;
static void *initializeProgressCallbackArgs;
static ProgressCallback progressCallback;
static void *progressCallbackArgs;
};
#endif
......@@ -1017,6 +1017,9 @@ QvisRenderingWindow::renderNotifyToggled(bool val)
// Changed scalable rendering controls to use activation mode and auto
// threshold
//
// Hank Childs, Sun Dec 4 18:41:39 PST 2005
// Automatically update the shadow toggle ['5596].
//
// ****************************************************************************
void
......@@ -1028,11 +1031,13 @@ QvisRenderingWindow::scalrenActivationModeChanged(int val)
scalrenGeometryLabel->setEnabled(1);
renderAtts->SetScalableActivationMode(RenderingAttributes::Auto);
scalrenAutoThresholdChanged(scalrenAutoThreshold->value());
shadowToggle->setEnabled(false);
}
else if (val == 1)
{
scalrenAutoThreshold->setEnabled(0);
scalrenGeometryLabel->setEnabled(0);
shadowToggle->setEnabled(true);
renderAtts->SetScalableActivationMode(RenderingAttributes::Always);
}
else
......@@ -1040,6 +1045,7 @@ QvisRenderingWindow::scalrenActivationModeChanged(int val)
scalrenAutoThreshold->setEnabled(0);
scalrenGeometryLabel->setEnabled(0);
renderAtts->SetScalableActivationMode(RenderingAttributes::Never);
shadowToggle->setEnabled(false);
}
SetUpdate(false);
Apply();
......
......@@ -2092,12 +2092,20 @@ QvisVolumePlotWindow::resampleTargetSliderReleased()
// Brad Whitlock, Thu Dec 9 17:39:00 PST 2004
// I renamed the method and recoded it.
//
// Hank Childs, Sun Dec 4 18:30:40 PST 2005
// Set whether or not the toggles should be active ['6827].
//
// ****************************************************************************
void
QvisVolumePlotWindow::opacityVariableChanged(const QString &var)
{
volumeAtts->SetOpacityVariable(var.latin1());
bool notDefaultVar = (volumeAtts->GetOpacityVariable() != "default");
opacityMinToggle->setEnabled(notDefaultVar);
opacityMaxToggle->setEnabled(notDefaultVar);
opacityMin->setEnabled(notDefaultVar && volumeAtts->GetUseOpacityVarMin());
opacityMax->setEnabled(notDefaultVar && volumeAtts->GetUseOpacityVarMax());
SetUpdate(false);
Apply();
}
......
......@@ -396,6 +396,26 @@ avtVolumeFilter::RenderImage(avtImage_p opaque_image,
}
// ****************************************************************************
// Method: avtVolumeFilter::GetNumberOfStages
//
// Purpose:
// Determines the number of stages based on the window size and number
// of samples.
//
// Programmer: Hank Childs
// Creation: December 4, 2005
//
// ****************************************************************************
int
avtVolumeFilter::GetNumberOfStages(const WindowAttributes &a)
{
return avtRayTracer::GetNumberOfStages(a.GetSize()[0], a.GetSize()[1],
atts.GetSamplesPerRay());
}
// ****************************************************************************
// Function: CreateViewInfoFromViewAttributes
//
......
......@@ -47,6 +47,7 @@ class avtVolumeFilter : public avtDatasetToDatasetFilter
{ return "Volume rendering"; };
avtImage_p RenderImage(avtImage_p, const WindowAttributes &);
int GetNumberOfStages(const WindowAttributes &);
protected:
VolumeAttributes atts;
......
......@@ -258,6 +258,23 @@ avtVolumePlot::SetLegendOpacities()
}
// ****************************************************************************
// Method: avtVolumePlot::GetNumberOfStagesForImageBasedPlot
//
// Purpose:
// Determines the number of stages for this plot.
//
// Programmer: Hank Childs
// Creation: December 4, 2005
//
// ****************************************************************************
int
avtVolumePlot::GetNumberOfStagesForImageBasedPlot(const WindowAttributes &a)
{
return volumeFilter->GetNumberOfStages(a);
}
// ****************************************************************************
// Method: avtVolumePlot::ImageExecute
//
......
......@@ -52,6 +52,9 @@ class avtResampleFilter;
// Integrated this plot with SR mode, meaning that a lot of infrastructure
// for delivering images could be removed.
//
// Hank Childs, Sun Dec 4 17:55:06 PST 2005
// Added GetNumberOfStagesForImageBasedPlots.
//
// ****************************************************************************
class
......@@ -70,6 +73,8 @@ avtVolumePlot : public avtVolumeDataPlot
virtual bool PlotIsImageBased(void);
virtual avtImage_p ImageExecute(avtImage_p, const WindowAttributes &);
virtual int GetNumberOfStagesForImageBasedPlot(
const WindowAttributes &);
virtual bool Equivalent(const AttributeGroup *);
virtual bool CanCacheWriterExternally(void) { return false; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment