Commit 6fd1af30 authored by hrchilds's avatar hrchilds

Update from August 9, 2006

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@707 18c085ea-50e0-402c-830e-de6fd14e8384
parent 7b7630ec
......@@ -182,6 +182,9 @@ class VisWindowColleagueProxy;
// Mark C. Miller, Thu Nov 3 16:59:41 PST 2005
// Added 3 most recent rendering times to set of times returned by
// GetRenderTimes. Added supporting data members
//
// Mark C. Miller, Wed Aug 9 19:40:30 PDT 2006
// Removed bool arg from SetStereoEnabled since it defaults to off
// ****************************************************************************
class VISWINDOW_API VisWinRendering : public VisWinColleague
......@@ -279,8 +282,8 @@ class VISWINDOW_API VisWinRendering : public VisWinColleague
bool GetNotifyForEachRender() const
{ return notifyForEachRender; };
static void SetStereoEnabled(bool se)
{ stereoEnabled = se; };
static void SetStereoEnabled()
{ stereoEnabled = true; };
int GetScalableThreshold() const;
bool SetScalableRendering(bool mode);
......
......@@ -981,6 +981,9 @@ Engine::ProcessInput()
//
// Mark C. Miller, Wed Aug 2 19:58:44 PDT 2006
// Allowed '-timings' with an 's' too
//
// Mark C. Miller, Wed Aug 9 19:40:30 PDT 2006
// Added "-stereo" option to support stereo in SR mode
// ****************************************************************************
void
Engine::ProcessCommandLine(int argc, char **argv)
......@@ -992,6 +995,8 @@ Engine::ProcessCommandLine(int argc, char **argv)
{
if (strcmp(argv[i], "-allowdynamic") == 0)
LoadBalancer::AllowDynamic();
else if (strcmp(argv[i], "-stereo") == 0)
NetworkManager::SetStereoEnabled();
else if (strcmp(argv[i], "-hw-accel") == 0)
haveHWAccel = true;
else if ((strcmp(argv[i], "-timing") == 0 ||
......
......@@ -103,6 +103,7 @@
#include <avtQueryFactory.h>
#include <CompactSILRestrictionAttributes.h>
#include <VisWindow.h>
#include <VisWinRendering.h> // for SetStereoEnabled
#include <ParsingExprList.h>
#include <avtExprNode.h>
#include <DatabasePluginManager.h>
......@@ -1867,7 +1868,6 @@ NetworkManager::Render(intVector plotIds, bool getZBuffer, int annotMode,
int *const &frameAndState = viswinInfo.frameAndState;
std::vector<int>& plotsCurrentlyInWindow = viswinMap[windowID].plotsCurrentlyInWindow;
std::vector<avtPlot_p>& imageBasedPlots = viswinMap[windowID].imageBasedPlots;
bool &handleLeftRightEye = viswinMap[windowID].handleLeftRightEye;
TRY
{
......@@ -1878,9 +1878,9 @@ NetworkManager::Render(intVector plotIds, bool getZBuffer, int annotMode,
bool handledAnnotations = false;
//
// Explicitly specify left or right eye for crystal-eyes stereo
// Explicitly specify left or right eye for stereo
//
if (handleLeftRightEye)
if (viswin->GetStereo())
viswin->SetStereoRendering(true, leftEye ? 4 : 5);
// put all the plot objects into the VisWindow
......@@ -2503,7 +2503,6 @@ NetworkManager::SetWindowAttributes(const WindowAttributes &atts,
WindowAttributes &windowAttributes = viswinInfo.windowAttributes;
std::string &extentTypeString = viswinInfo.extentTypeString;
std::string &changedCtName = viswinInfo.changedCtName;
bool &handleLeftRightEye = viswinInfo.handleLeftRightEye;
// do nothing if nothing changed
if ((windowAttributes == atts) && (extentTypeString == extstr) &&
......@@ -2618,41 +2617,11 @@ NetworkManager::SetWindowAttributes(const WindowAttributes &atts,
viswin->SetSurfaceRepresentation(atts.GetRenderAtts().GetGeometryRepresentation());
viswin->SetDisplayListMode(0); // never
//
// Only enable stereo rendering in the viswin object for non-crystal-eyes modes
//
if (atts.GetRenderAtts().GetStereoRendering())
{
if (viswin->GetStereo() != true)
{
if (atts.GetRenderAtts().GetStereoType() == RenderingAttributes::CrystalEyes)
handleLeftRightEye = true;
else
{
viswin->SetStereoRendering(true, atts.GetRenderAtts().GetStereoType());
handleLeftRightEye = false;
}
}
else
{
if (viswin->GetStereoType() != atts.GetRenderAtts().GetStereoType())
{
if (atts.GetRenderAtts().GetStereoType() == RenderingAttributes::CrystalEyes)
handleLeftRightEye = true;
else
{
viswin->SetStereoRendering(true, atts.GetRenderAtts().GetStereoType());
handleLeftRightEye = false;
}
}
}
}
else
{
if (viswin->GetStereo() != false)
viswin->SetStereoRendering(false, 0);
handleLeftRightEye = false;
}
// handle stereo rendering settings
if (viswin->GetStereo() != atts.GetRenderAtts().GetStereoRendering() ||
viswin->GetStereoType() != atts.GetRenderAtts().GetStereoType())
viswin->SetStereoRendering(atts.GetRenderAtts().GetStereoRendering(),
atts.GetRenderAtts().GetStereoType());
windowAttributes = atts;
extentTypeString = extstr;
......@@ -4227,3 +4196,18 @@ NetworkManager::PickForIntersection(const int winId, PickAttributes *pa)
}
}
// ****************************************************************************
// Method: SetStereoEnabled
//
// Purpose: Setup stereo rendering mode
//
// Programmer: Mark C. Miller
// Creation: August 9, 2006
//
// ****************************************************************************
void
NetworkManager::SetStereoEnabled()
{
VisWinRendering::SetStereoEnabled();
}
......@@ -79,7 +79,6 @@ typedef struct _EngineVisWinInfo
std::vector<int> plotsCurrentlyInWindow;
std::vector<avtPlot_p> imageBasedPlots;
bool markedForDeletion;
bool handleLeftRightEye;
} EngineVisWinInfo;
typedef void (*InitializeProgressCallback)(void *, int);
......@@ -295,6 +294,9 @@ typedef void (*ProgressCallback)(void *, const char *, const char *,int,int);
//
// Mark C. Miller, Sat Jul 22 23:21:09 PDT 2006
// Added leftEye arg to Render method
//
// Mark C. Miller, Wed Aug 9 19:40:30 PDT 2006
// Added SetStereoEnabled
// ****************************************************************************
class NetworkManager
......@@ -378,6 +380,8 @@ class NetworkManager
InitializeProgressCallback, void *);
static void RegisterProgressCallback(ProgressCallback, void *);
static void SetStereoEnabled();
private:
void UpdateVisualCues(int winID);
......
......@@ -2177,6 +2177,10 @@ ViewerSubject::GetOperatorFactory() const
// Brad Whitlock, Wed Jan 11 17:40:16 PST 2006
// I added support for -nowindowmetrics.
//
// Mark C. Miller, Wed Aug 9 18:59:30 PDT 2006
// Pass "-stereo" to engine. Allow "-timings" in addition to "-timing"
// Changed interface to SetStereoEnabled to void args
//
// ****************************************************************************
void
......@@ -2352,7 +2356,8 @@ ViewerSubject::ProcessCommandLine(int *argc, char ***argv)
appearanceAtts->SetFontDescription(argv2[i + 1]);
++i;
}
else if (strcmp(argv2[i], "-timing") == 0)
else if (strcmp(argv2[i], "-timing") == 0 ||
strcmp(argv2[i], "-timings") == 0)
{
//
// Enable timing and pass the option to child processes.
......@@ -2390,8 +2395,9 @@ ViewerSubject::ProcessCommandLine(int *argc, char ***argv)
}
else if (strcmp(argv2[i], "-stereo") == 0)
{
VisWinRendering::SetStereoEnabled(true);
VisWinRendering::SetStereoEnabled();
defaultStereoToOn = true;
unknownArguments.push_back(argv2[i]);
}
else if (strcmp(argv2[i], "-launchengine") == 0)
{
......
......@@ -237,6 +237,9 @@ static void RotateAroundY(const avtView3D&, double, avtView3D&);
//
// Mark C. Miller, Sat Jul 22 23:21:09 PDT 2006
// Added scalableStereoType to support stereo SR
//
// Mark C. Miller, Wed Aug 9 16:35:25 PDT 2006
// Removed scalableStereoType
// ****************************************************************************
ViewerWindow::ViewerWindow(int windowIndex) : undoViewStack(true), redoViewStack()
......@@ -283,7 +286,6 @@ ViewerWindow::ViewerWindow(int windowIndex) : undoViewStack(true), redoViewStack
isVisible = false;
isChangingScalableRenderingMode = false;
targetScalableRenderingMode = false;
scalableStereoType = -1;
nameOfCtChangedSinceLastRender = "";
isCompressingScalableImage = false;
compressionActivationMode = RenderingAttributes::Never;
......@@ -6237,29 +6239,17 @@ ViewerWindow::GetRenderTimes(double times[6]) const
// Mark C. Miller, Sat Jul 22 23:21:09 PDT 2006
// For certain cases of stereo and SR, all the stereo work is done on the
// engine and the Viewer's visWindow object should NOT be in stereo. In
// Other cases, it is necessary for the Viewer's visWindow object to als
// Other cases, it is necessary for the Viewer's visWindow object to also
// be in stereo.
//
// Mark C. Miller, Wed Aug 9 16:35:25 PDT 2006
// Removed above optimization
// ****************************************************************************
void
ViewerWindow::SetStereoRendering(bool enabled, int type)
{
scalableStereoType = -1;
if (enabled == false)
visWindow->SetStereoRendering(false, type);
else
{
if (GetScalableRendering())
{
scalableStereoType = type;
if (type == (int) RenderingAttributes::CrystalEyes)
visWindow->SetStereoRendering(true, type);
}
else
{
visWindow->SetStereoRendering(true, type);
}
}
visWindow->SetStereoRendering(enabled, type);
}
// ****************************************************************************
......@@ -6276,15 +6266,15 @@ ViewerWindow::SetStereoRendering(bool enabled, int type)
// Mark C. Miller, Sat Jul 22 23:21:09 PDT 2006
// Added logic to deal with cases in which the visWindow object itself
// may not be in stereo even though we are indeed doing stereo rendering.
//
// Mark C. Miller, Wed Aug 9 16:35:25 PDT 2006
// Removed above optimization
// ****************************************************************************
bool
ViewerWindow::GetStereo() const
{
if (scalableStereoType != -1)
return true;
else
return visWindow->GetStereo();
return visWindow->GetStereo();
}
// ****************************************************************************
......@@ -6306,10 +6296,7 @@ ViewerWindow::GetStereo() const
int
ViewerWindow::GetStereoType() const
{
if (scalableStereoType != -1)
return scalableStereoType;
else
return visWindow->GetStereoType();
return visWindow->GetStereoType();
}
// ****************************************************************************
......@@ -6662,6 +6649,9 @@ ViewerWindow::GetNotifyForEachRender() const
// Since the visWindow object isn't always in stereo for stereo SR, we
// need logic here to correctly put the visWindow into stereo when changing
// out of SR, if needed.
//
// Mark C. Miller, Wed Aug 9 16:35:25 PDT 2006
// Removed above logic. Now visWindow will be in stereo mode
// ****************************************************************************
void
......@@ -6684,23 +6674,6 @@ ViewerWindow::ChangeScalableRenderingMode(bool newMode)
SendWindowEnvironmentToEngine(GetPlotList()->GetEngineKey());
GetPlotList()->TransmutePlots(!newMode);
// If we're stereo rendering, then it may be the case that the
// visWindow isn't already in stereo. Make it so.
if (GetStereo())
{
if (newMode == true)
{
scalableStereoType = visWindow->GetStereoType();
if (visWindow->GetStereoType() != (int) RenderingAttributes::CrystalEyes)
visWindow->SetStereoRendering(false, visWindow->GetStereoType());
}
else
{
visWindow->SetStereoRendering(true, scalableStereoType);
scalableStereoType = -1;
}
}
// set scalable rendering mode in the vis window
visWindow->SetScalableRendering(newMode);
......@@ -7994,6 +7967,9 @@ ViewerWindow::UpdateLastExternalRenderRequestInfo(
// in which left/right images are in separate buffers (e.g. crystal-eyes),
// two render requests are needed. However, for all others, a single render
// request for a complete, stereo image, is all that is needed.
//
// Mark C. Miller, Wed Aug 9 16:29:43 PDT 2006
// Removed optimization to skip second eye for non-crystal-eyes stereo mode
// ****************************************************************************
bool
......@@ -8002,14 +7978,10 @@ ViewerWindow::CanSkipExternalRender(const ExternalRenderRequestInfo& thisRequest
const ExternalRenderRequestInfo& lastRequest = lastExternalRenderRequest;
//
// Don't skip render for either eye when using crystal-eyes stereo
// Don't skip render for either eye when in stereo
//
if (thisRequest.leftEye != lastRequest.leftEye)
{
if (thisRequest.winAtts.GetRenderAtts().GetStereoType() ==
RenderingAttributes::CrystalEyes)
return false;
}
return false;
// compare window attributes but ignore a few of them by forcing
// old/new to be equal for those few
......
......@@ -396,6 +396,9 @@ class ViewerToolbar;
// to store knowledge of stereo mode for cases where it is not appropriate
// to actually put the visWindow into stereo.
//
// Mark C. Miller, Wed Aug 9 16:35:25 PDT 2006
// Removed scalableStereoType data member
//
// ****************************************************************************
class VIEWER_API ViewerWindow
......@@ -685,7 +688,6 @@ private:
bool isChangingScalableRenderingMode;
bool targetScalableRenderingMode;
int scalableStereoType;
std::string nameOfCtChangedSinceLastRender;
bool isCompressingScalableImage;
int compressionActivationMode;
......
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