1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
|
/*=========================================================================
Program: Visualization Toolkit
Module: vtkValuePasses.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "vtkValuePasses.h"
#include "vtkObjectFactory.h"
#include "vtkClearRGBPass.h"
#include "vtkLightsPass.h"
#include "vtkRenderPassCollection.h"
#include "vtkRenderState.h"
#include "vtkSequencePass.h"
#include "vtkSmartPointer.h"
#include "vtkValuePass.h"
// ----------------------------------------------------------------------------
class vtkValuePasses::vtkInternals
{
public:
vtkInternals()
{
this->SequencePass = vtkSequencePass::New();
this->ClearPass = vtkClearRGBPass::New();
this->LightsPass = vtkLightsPass::New();
this->ValuePass = vtkValuePass::New();
vtkSmartPointer<vtkRenderPassCollection> passes=vtkSmartPointer<vtkRenderPassCollection>::New();
passes->AddItem(this->ClearPass);
passes->AddItem(this->LightsPass);
passes->AddItem(this->ValuePass);
this->SequencePass->SetPasses(passes);
}
~vtkInternals()
{
this->SequencePass->Delete();
this->ClearPass->Delete();
this->LightsPass->Delete();
this->ValuePass->Delete();
}
vtkSequencePass *SequencePass;
vtkClearRGBPass *ClearPass;
vtkLightsPass *LightsPass;
vtkValuePass *ValuePass;
};
// ============================================================================
vtkStandardNewMacro(vtkValuePasses);
// ----------------------------------------------------------------------------
vtkValuePasses::vtkValuePasses()
{
this->Internals = new vtkValuePasses::vtkInternals();
}
// ----------------------------------------------------------------------------
vtkValuePasses::~vtkValuePasses()
{
delete this->Internals;
}
// ----------------------------------------------------------------------------
void vtkValuePasses::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os, indent);
}
// ----------------------------------------------------------------------------
void vtkValuePasses::SetInputArrayToProcess(int fieldAssociation, const char *name)
{
this->Internals->ValuePass->SetInputArrayToProcess(fieldAssociation, name);
}
// ----------------------------------------------------------------------------
void vtkValuePasses::SetInputArrayToProcess(int fieldAssociation, int fieldAttributeType)
{
this->Internals->ValuePass->SetInputArrayToProcess(fieldAssociation, fieldAttributeType);
}
// ----------------------------------------------------------------------------
void vtkValuePasses::SetInputComponentToProcess(int comp)
{
this->Internals->ValuePass->SetInputComponentToProcess(comp);
}
// ----------------------------------------------------------------------------
void vtkValuePasses::SetScalarRange(double min, double max)
{
this->Internals->ValuePass->SetScalarRange(min, max);
}
// ----------------------------------------------------------------------------
// Description:
void vtkValuePasses::Render(const vtkRenderState *s)
{
this->NumberOfRenderedProps=0;
this->Internals->SequencePass->Render(s);
this->NumberOfRenderedProps+=
this->Internals->SequencePass->GetNumberOfRenderedProps();
}
|