本文整理汇总了C++中VisWindow::GetBackgroundMode方法的典型用法代码示例。如果您正苦于以下问题:C++ VisWindow::GetBackgroundMode方法的具体用法?C++ VisWindow::GetBackgroundMode怎么用?C++ VisWindow::GetBackgroundMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VisWindow
的用法示例。
在下文中一共展示了VisWindow::GetBackgroundMode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: second_pass
// ****************************************************************************
// Method: RenderTranslucent
//
// Purpose: Renders translucent geometry within a VisWindow.
// Expects that opaque geometry has already been rendered. In the
// IceT case, our work is a lot simpler because we don't need to
// read the image back from the framebuffer (we'll read it back from
// IceT later anyway).
//
// Programmer: Tom Fogal
// Creation: August 4, 2008
//
// Modifications:
//
// ****************************************************************************
avtDataObject_p
IceTNetworkManager::RenderTranslucent(int windowID, const avtImage_p& input)
{
VisWindow *viswin = viswinMap.find(windowID)->second.viswin;
CallProgressCallback("IceTNetworkManager", "Transparent rendering", 0, 1);
{
StackTimer second_pass("Second-pass screen capture for SR");
//
// We have to disable any gradient background before
// rendering, as those will overwrite the first pass
//
AnnotationAttributes::BackgroundMode bm = viswin->GetBackgroundMode();
viswin->SetBackgroundMode(AnnotationAttributes::Solid);
viswin->ScreenRender(
this->r_mgmt.viewportedMode,
true, // Z buffer
false, // opaque geometry
true, // translucent geometry
input // image to composite with
);
// Restore the background mode for next time
viswin->SetBackgroundMode(bm);
}
CallProgressCallback("IceTNetworkManager", "Transparent rendering", 1, 1);
//
// In this implementation, the user should never use the return value --
// read it back from IceT instead!
//
return NULL;
}
示例2: RenderSetup
avtDataObject_p
IceTNetworkManager::Render(
bool checkThreshold, intVector networkIds,
bool getZBuffer, int annotMode, int windowID,
bool leftEye)
{
int t0 = visitTimer->StartTimer();
DataNetwork *origWorkingNet = workingNet;
avtDataObject_p retval;
EngineVisWinInfo &viswinInfo = viswinMap[windowID];
viswinInfo.markedForDeletion = false;
VisWindow *viswin = viswinInfo.viswin;
std::vector<avtPlot_p>& imageBasedPlots = viswinInfo.imageBasedPlots;
renderings = 0;
TRY
{
this->StartTimer();
RenderSetup(windowID, networkIds, getZBuffer,
annotMode, leftEye, checkThreshold);
bool plotDoingTransparencyOutsideTransparencyActor = false;
for(size_t i = 0 ; i < networkIds.size() ; i++)
{
workingNet = NULL;
UseNetwork(networkIds[i]);
if(this->workingNet->GetPlot()->ManagesOwnTransparency())
{
plotDoingTransparencyOutsideTransparencyActor = true;
}
}
workingNet = NULL;
// We can't easily figure out a compositing order, which IceT requires
// in order to properly composite transparent geometry. Thus if there
// is some transparency, fallback to our parent implementation.
avtTransparencyActor* trans = viswin->GetTransparencyActor();
bool transparenciesExist = trans->TransparenciesExist()
|| plotDoingTransparencyOutsideTransparencyActor;
if (transparenciesExist)
{
debug2 << "Encountered transparency: falling back to old "
"SR / compositing routines." << std::endl;
retval = NetworkManager::RenderInternal();
}
else
{
bool needZB = !imageBasedPlots.empty() ||
renderState.shadowMap ||
renderState.depthCues;
// Confusingly, we need to set the input to be *opposite* of what VisIt
// wants. This is due to (IMHO) poor naming in the IceT case; on the
// input side:
// ICET_DEPTH_BUFFER_BIT set: do Z-testing
// ICET_DEPTH_BUFFER_BIT not set: do Z-based compositing.
// On the output side:
// ICET_DEPTH_BUFFER_BIT set: readback of Z buffer is allowed
// ICET_DEPTH_BUFFER_BIT not set: readback of Z does not work.
// In VisIt's case, we calculated a `need Z buffer' predicate based
// around the idea that we need the Z buffer to do Z-compositing.
// However, IceT \emph{always} needs the Z buffer internally -- the
// flag only differentiates between `compositing' methodologies
// (painter-style or `over' operator) on input.
GLenum inputs = ICET_COLOR_BUFFER_BIT;
GLenum outputs = ICET_COLOR_BUFFER_BIT;
// Scratch all that, I guess. That might be the correct way to go
// about things in the long run, but IceT only gives us back half an
// image if we don't set the depth buffer bit. The compositing is a
// bit wrong, but there's not much else we can do..
// Consider removing the `hack' if a workaround is found.
if (/*hack*/true/*hack*/) // || !this->MemoMultipass(viswin))
{
inputs |= ICET_DEPTH_BUFFER_BIT;
}
if(needZB)
{
outputs |= ICET_DEPTH_BUFFER_BIT;
}
ICET(icetInputOutputBuffers(inputs, outputs));
// If there is a backdrop image, we need to tell IceT so that it can
// composite correctly.
if(viswin->GetBackgroundMode() != AnnotationAttributes::Solid)
{
ICET(icetEnable(ICET_CORRECT_COLORED_BACKGROUND));
}
else
{
ICET(icetDisable(ICET_CORRECT_COLORED_BACKGROUND));
}
if (renderState.renderOnViewer)
{
RenderCleanup();
avtDataObject_p dobj = NULL;
//.........这里部分代码省略.........