Commits (33)
......@@ -645,16 +645,6 @@ function(vtk_module_library name)
list(APPEND _hdrs "${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}Module.h")
list(REMOVE_DUPLICATES _hdrs)
# Add the vtkWrapHierarchy custom command output to the target, if any.
# TODO: Re-order things so we do not need to duplicate this condition.
if(NOT ${vtk-module}_EXCLUDE_FROM_WRAPPING AND
NOT ${vtk-module}_EXCLUDE_FROM_WRAP_HIERARCHY AND
( VTK_WRAP_PYTHON OR VTK_WRAP_JAVA ))
set(_hierarchy ${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}Hierarchy.stamp.txt)
else()
set(_hierarchy "")
endif()
set(target_suffix)
set(force_object)
set(export_symbol_object)
......@@ -667,7 +657,15 @@ function(vtk_module_library name)
# OBJECT libraries don't like this variable being set; clear it.
unset(${vtk-module}_LIB_DEPENDS CACHE)
endif()
vtk_add_library(${vtk-module}${force_object} ${ARGN} ${_hdrs} ${_hierarchy})
vtk_add_library(${vtk-module}${force_object} ${ARGN} ${_hdrs})
# Add the vtkWrapHierarchy custom command output to the target, if any.
# TODO: Re-order things so we do not need to duplicate this condition.
if (TARGET "${vtk-module}Hierarchy")
add_dependencies("${vtk-module}${force_object}"
"${vtk-module}Hierarchy")
endif ()
if(_vtk_build_as_kit)
# Make an interface library to link with for libraries.
add_library(${vtk-module} INTERFACE)
......
......@@ -105,6 +105,7 @@ $<$<BOOL:$<TARGET_PROPERTY:${module_name},INCLUDE_DIRECTORIES>>:
# search through the deps to find modules we depend on
set(OTHER_HIERARCHY_FILES)
set(OTHER_HIERARCHY_TARGETS)
# Don't use ${module_name}_DEPENDS. That list also includes COMPILE_DEPENDS,
# which aren't library dependencies, merely dependencies for generators and
# such. Instead, use _WRAP_DEPENDS which includes the DEPENDS and the
......@@ -113,6 +114,9 @@ $<$<BOOL:$<TARGET_PROPERTY:${module_name},INCLUDE_DIRECTORIES>>:
if(NOT "${module_name}" STREQUAL "${dep}")
if(NOT ${dep}_EXCLUDE_FROM_WRAPPING)
list(APPEND OTHER_HIERARCHY_FILES "${${dep}_WRAP_HIERARCHY_FILE}")
if (TARGET "${dep}Hierarchy")
list(APPEND OTHER_HIERARCHY_TARGETS "${dep}Hierarchy")
endif ()
endif()
endif()
endforeach()
......@@ -127,33 +131,28 @@ $<$<BOOL:$<TARGET_PROPERTY:${module_name},INCLUDE_DIRECTORIES>>:
configure_file(${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in
${_other_hierarchy_args_file} @ONLY)
# Ninja does not wait for order-only dependencies before enforcing the
# existence of explicit dependencies that those order-only dependencies
# might have produced. Specify the real output to help it out.
if(CMAKE_GENERATOR MATCHES "Ninja")
set(help_ninja ${OUTPUT_DIR}/${module_name}Hierarchy.txt)
else()
set(help_ninja "")
endif()
if (CMAKE_GENERATOR MATCHES "Ninja")
set(hierarchy_depends ${OTHER_HIERARCHY_FILES})
else ()
set(hierarchy_depends ${OTHER_HIERARCHY_TARGETS})
endif ()
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${module_name}Hierarchy.stamp.txt
${help_ninja}
OUTPUT "${OUTPUT_DIR}/${module_name}Hierarchy.txt"
COMMAND ${VTK_WRAP_HIERARCHY_EXE}
@${_args_file} -o ${OUTPUT_DIR}/${module_name}Hierarchy.txt
${module_name}Hierarchy.data
@${_other_hierarchy_args_file}
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/${module_name}Hierarchy.stamp.txt
COMMENT "For ${module_name} - updating ${module_name}Hierarchy.txt"
DEPENDS ${VTK_WRAP_HIERARCHY_EXE}
${CMAKE_CURRENT_BINARY_DIR}/${_args_file}
${CMAKE_CURRENT_BINARY_DIR}/${module_name}Hierarchy.data
${OTHER_HIERARCHY_FILES}
${hierarchy_depends}
${INPUT_FILES}
VERBATIM
)
add_custom_target(${module_name}Hierarchy
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/${module_name}Hierarchy.stamp.txt)
${OUTPUT_DIR}/${module_name}Hierarchy.txt)
endmacro()
......@@ -960,7 +960,7 @@ vtkStandardNewMacro(vtkHyperOctree);
// Default constructor.
vtkHyperOctree::vtkHyperOctree()
{
VTK_LEGACY_BODY(vtkHyperOctree, "VTK 8.2");
VTK_LEGACY_BODY(vtkHyperOctree, "VTK 8.1");
this->DualGridFlag = 1;
this->Dimension=3;
......
......@@ -19,7 +19,7 @@
// Constructor.
vtkHyperOctreeCursor::vtkHyperOctreeCursor()
{
VTK_LEGACY_BODY(vtkHyperOctreeCursor, "VTK 8.2");
VTK_LEGACY_BODY(vtkHyperOctreeCursor, "VTK 8.1");
}
//-----------------------------------------------------------------------------
......
......@@ -21,7 +21,7 @@
// Default constructor.
vtkHyperOctreePointsGrabber::vtkHyperOctreePointsGrabber()
{
VTK_LEGACY_BODY(vtkHyperOctreePointsGrabber, "VTK 8.2");
VTK_LEGACY_BODY(vtkHyperOctreePointsGrabber, "VTK 8.1");
this->Dimension=3;
}
......
......@@ -25,7 +25,7 @@
//----------------------------------------------------------------------------
vtkHyperOctreeAlgorithm::vtkHyperOctreeAlgorithm()
{
VTK_LEGACY_BODY(vtkHyperOctreeAlgorithm, "VTK 8.2");
VTK_LEGACY_BODY(vtkHyperOctreeAlgorithm, "VTK 8.1");
// by default assume filters have one input and one output
// subclasses that deviate should modify this setting
this->SetNumberOfInputPorts(1);
......
......@@ -52,7 +52,7 @@ vtkCxxSetObjectMacro(vtkClipHyperOctree,ClipFunction,vtkImplicitFunction);
// set to 0.0; and generate clip scalars turned off.
vtkClipHyperOctree::vtkClipHyperOctree(vtkImplicitFunction *cf)
{
VTK_LEGACY_BODY(vtkClipHyperOctree, "VTK 8.2");
VTK_LEGACY_BODY(vtkClipHyperOctree, "VTK 8.1");
this->ClipFunction = cf;
this->InsideOut = 0;
......
......@@ -34,7 +34,7 @@ public:
// Default constructor.
vtkHyperOctreeClipCutPointsGrabber::vtkHyperOctreeClipCutPointsGrabber()
{
VTK_LEGACY_BODY(vtkHyperOctreeClipCutPointsGrabber, "VTK 8.2");
VTK_LEGACY_BODY(vtkHyperOctreeClipCutPointsGrabber, "VTK 8.1");
this->Triangulator=vtkOrderedTriangulator::New();
this->IdSet=new vtkHyperOctreeIdSet;
......
......@@ -161,7 +161,7 @@ vtkStandardNewMacro(vtkHyperOctreeContourFilter);
// set to 0.0; and generate cut scalars turned off.
vtkHyperOctreeContourFilter::vtkHyperOctreeContourFilter()
{
VTK_LEGACY_BODY(vtkHyperOctreeContourFilter, "VTK 8.2");
VTK_LEGACY_BODY(vtkHyperOctreeContourFilter, "VTK 8.1");
this->ContourValues = vtkContourValues::New();
......
......@@ -52,7 +52,7 @@ vtkCxxSetObjectMacro(vtkHyperOctreeCutter,CutFunction,vtkImplicitFunction);
// set to 0.0; and generate cut scalars turned off.
vtkHyperOctreeCutter::vtkHyperOctreeCutter(vtkImplicitFunction *cf)
{
VTK_LEGACY_BODY(vtkHyperOctreeCutter, "VTK 8.2");
VTK_LEGACY_BODY(vtkHyperOctreeCutter, "VTK 8.1");
this->ContourValues = vtkContourValues::New();
this->SortBy = VTK_SORT_BY_VALUE;
......
......@@ -29,7 +29,7 @@ vtkStandardNewMacro(vtkHyperOctreeDepth);
//----------------------------------------------------------------------------
vtkHyperOctreeDepth::vtkHyperOctreeDepth()
{
VTK_LEGACY_BODY(vtkHyperOctreeDepth, "VTK 8.2");
VTK_LEGACY_BODY(vtkHyperOctreeDepth, "VTK 8.1");
this->GeneratedDepths = nullptr;
}
......
......@@ -80,7 +80,7 @@ vtkStandardNewMacro(vtkHyperOctreeDualGridContourFilter);
// set to 0.0; and generate cut scalars turned off.
vtkHyperOctreeDualGridContourFilter::vtkHyperOctreeDualGridContourFilter()
{
VTK_LEGACY_BODY(vtkHyperOctree, "VTK 8.2");
VTK_LEGACY_BODY(vtkHyperOctree, "VTK 8.1");
this->ContourValues = vtkContourValues::New();
......
......@@ -34,7 +34,7 @@ vtkStandardNewMacro(vtkHyperOctreeLimiter);
//----------------------------------------------------------------------------
vtkHyperOctreeLimiter::vtkHyperOctreeLimiter()
{
VTK_LEGACY_BODY(vtkHyperOctreeLimiter, "VTK 8.2");
VTK_LEGACY_BODY(vtkHyperOctreeLimiter, "VTK 8.1");
this->MaximumLevel = 5;
this->AccumScratch = new double[1024];
......
......@@ -33,7 +33,7 @@ vtkCxxSetObjectMacro(vtkHyperOctreeSampleFunction,ImplicitFunction,
//----------------------------------------------------------------------------
vtkHyperOctreeSampleFunction::vtkHyperOctreeSampleFunction()
{
VTK_LEGACY_BODY(vtkHyperOctreeSampleFunction, "VTK 8.2");
VTK_LEGACY_BODY(vtkHyperOctreeSampleFunction, "VTK 8.1");
this->SetNumberOfInputPorts(0);
this->Dimension=3;
......
......@@ -34,7 +34,7 @@ vtkStandardNewMacro(vtkHyperOctreeToUniformGridFilter);
//----------------------------------------------------------------------------
vtkHyperOctreeToUniformGridFilter::vtkHyperOctreeToUniformGridFilter()
{
VTK_LEGACY_BODY(vtkHyperOctreeToUniformGridFilter, "VTK 8.2");
VTK_LEGACY_BODY(vtkHyperOctreeToUniformGridFilter, "VTK 8.1");
this->InputCD=nullptr;
this->OutputCD=nullptr;
......
......@@ -32,7 +32,7 @@ vtkStandardNewMacro(vtkHyperOctreeFractalSource);
//----------------------------------------------------------------------------
vtkHyperOctreeFractalSource::vtkHyperOctreeFractalSource()
{
VTK_LEGACY_BODY(vtkHyperOctreeFractalSource, "VTK 8.2");
VTK_LEGACY_BODY(vtkHyperOctreeFractalSource, "VTK 8.1");
this->SetNumberOfInputPorts(0);
......
......@@ -15,6 +15,7 @@
#ifndef vtkSegYIOUtils_h
#define vtkSegYIOUtils_h
#ifndef __VTK_WRAP__
#include <fstream>
......@@ -44,5 +45,6 @@ private:
}
};
#endif
#endif // vtkSegYIOUtils_h
// VTK-HeaderTest-Exclude: vtkSegYIOUtils.h
......@@ -15,6 +15,7 @@
#ifndef vtkSegYReader_h
#define vtkSegYReader_h
#ifndef __VTK_WRAP__
#include <fstream>
#include <string>
......@@ -52,5 +53,6 @@ private:
int VerticalCRS;
};
#endif
#endif // vtkSegYReader_h
// VTK-HeaderTest-Exclude: vtkSegYReader.h
......@@ -15,6 +15,7 @@
#ifndef vtkSegYTraceReader_h
#define vtkSegYTraceReader_h
#ifndef __VTK_WRAP__
#include <fstream>
#include <vector>
......@@ -59,5 +60,6 @@ public:
int GetTraceSize(int numSamples, int formatCode);
};
#endif
#endif // vtkSegYTraceReader_h
// VTK-HeaderTest-Exclude: vtkSegYTraceReader.h
......@@ -35,7 +35,7 @@ vtkStandardNewMacro(vtkXMLHyperOctreeReader);
//----------------------------------------------------------------------------
vtkXMLHyperOctreeReader::vtkXMLHyperOctreeReader()
{
VTK_LEGACY_BODY(vtkXMLHyperOctreeReader, "VTK 8.2");
VTK_LEGACY_BODY(vtkXMLHyperOctreeReader, "VTK 8.1");
}
//----------------------------------------------------------------------------
......
......@@ -38,7 +38,7 @@ vtkStandardNewMacro(vtkXMLHyperOctreeWriter);
//----------------------------------------------------------------------------
vtkXMLHyperOctreeWriter::vtkXMLHyperOctreeWriter()
{
VTK_LEGACY_BODY(vtkXMLHyperOctreeWriter, "VTK 8.2");
VTK_LEGACY_BODY(vtkXMLHyperOctreeWriter, "VTK 8.1");
this->TopologyArray = nullptr;
this->TopologyOM = new OffsetsManagerGroup;
......
......@@ -103,6 +103,7 @@ vtkOrientationMarkerWidget::vtkOrientationMarkerWidget()
this->OutlineActor->SetMapper( mapper );
this->OutlineActor->SetPosition( 0, 0 );
this->OutlineActor->SetPosition2( 1, 1 );
this->OutlineActor->VisibilityOff();
points->Delete();
mapper->Delete();
......@@ -112,6 +113,11 @@ vtkOrientationMarkerWidget::vtkOrientationMarkerWidget()
//-------------------------------------------------------------------------
vtkOrientationMarkerWidget::~vtkOrientationMarkerWidget()
{
if (this->Enabled)
{
this->TearDownWindowInteraction();
}
this->Observer->Delete();
this->Observer = nullptr;
this->Renderer->Delete();
......@@ -122,108 +128,108 @@ vtkOrientationMarkerWidget::~vtkOrientationMarkerWidget()
}
//-------------------------------------------------------------------------
void vtkOrientationMarkerWidget::SetEnabled(int enabling)
void vtkOrientationMarkerWidget::SetEnabled(int value)
{
if (!this->Interactor)
{
vtkErrorMacro("The interactor must be set prior to enabling/disabling widget");
}
if (enabling)
if (value != this->Enabled)
{
if (this->Enabled)
{
return;
}
if (!this->OrientationMarker)
if (value)
{
vtkErrorMacro("An orientation marker must be set prior to enabling/disabling widget");
return;
}
if (!this->CurrentRenderer)
{
this->SetCurrentRenderer( this->Interactor->FindPokedRenderer(
this->Interactor->GetLastEventPosition()[0],
this->Interactor->GetLastEventPosition()[1]));
if (this->CurrentRenderer == nullptr)
if (!this->OrientationMarker)
{
vtkErrorMacro("An orientation marker must be set prior to enabling/disabling widget");
return;
}
}
this->Enabled = 1;
this->UpdateInternalViewport();
if (!this->CurrentRenderer)
{
int *pos = this->Interactor->GetLastEventPosition();
this->SetCurrentRenderer(this->Interactor->FindPokedRenderer(pos[0], pos[1]));
vtkRenderWindow* renwin = this->CurrentRenderer->GetRenderWindow();
renwin->AddRenderer( this->Renderer );
if (renwin->GetNumberOfLayers() < 2)
{
renwin->SetNumberOfLayers( 2 );
}
if (this->CurrentRenderer == NULL)
{
return;
}
}
this->CurrentRenderer->AddViewProp( this->OutlineActor );
this->OutlineActor->VisibilityOff();
this->Renderer->AddViewProp( this->OrientationMarker );
this->OrientationMarker->VisibilityOn();
this->UpdateInternalViewport();
if (this->Interactive)
{
vtkRenderWindowInteractor *i = this->Interactor;
if ( this->EventCallbackCommand )
{
i->AddObserver( vtkCommand::MouseMoveEvent,
this->EventCallbackCommand, this->Priority );
i->AddObserver( vtkCommand::LeftButtonPressEvent,
this->EventCallbackCommand, this->Priority );
i->AddObserver( vtkCommand::LeftButtonReleaseEvent,
this->EventCallbackCommand, this->Priority );
}
this->SetupWindowInteraction();
this->Enabled = 1;
this->InvokeEvent(vtkCommand::EnableEvent, NULL);
}
vtkCamera* pcam = this->CurrentRenderer->GetActiveCamera();
vtkCamera* cam = this->Renderer->GetActiveCamera();
if (pcam && cam)
else
{
cam->SetParallelProjection( pcam->GetParallelProjection() );
this->InvokeEvent(vtkCommand::DisableEvent, NULL);
this->Enabled = 0;
this->TearDownWindowInteraction();
this->SetCurrentRenderer(NULL);
}
}
}
// We need to copy the camera before the compositing observer is called.
// Compositing temporarily changes the camera to display an image.
this->StartEventObserverId = this->CurrentRenderer->AddObserver(
vtkCommand::StartEvent, this->Observer, 1 );
this->InvokeEvent( vtkCommand::EnableEvent, nullptr );
//-------------------------------------------------------------------------
void vtkOrientationMarkerWidget::SetupWindowInteraction()
{
vtkRenderWindow* renwin = this->CurrentRenderer->GetRenderWindow();
renwin->AddRenderer(this->Renderer);
if (renwin->GetNumberOfLayers() < 2)
{
renwin->SetNumberOfLayers(2);
}
else
this->CurrentRenderer->AddViewProp(this->OutlineActor);
this->Renderer->AddViewProp(this->OrientationMarker);
this->OrientationMarker->VisibilityOn();
if (this->Interactive)
{
if (!this->Enabled)
vtkRenderWindowInteractor *interactor = this->Interactor;
if (this->EventCallbackCommand)
{
return;
interactor->AddObserver(vtkCommand::MouseMoveEvent, this->EventCallbackCommand, this->Priority);
interactor->AddObserver(vtkCommand::LeftButtonPressEvent, this->EventCallbackCommand, this->Priority);
interactor->AddObserver(vtkCommand::LeftButtonReleaseEvent, this->EventCallbackCommand, this->Priority);
}
}
vtkCamera* pcam = this->CurrentRenderer->GetActiveCamera();
vtkCamera* cam = this->Renderer->GetActiveCamera();
if (pcam && cam)
{
cam->SetParallelProjection(pcam->GetParallelProjection());
}
// We need to copy the camera before the compositing observer is called.
// Compositing temporarily changes the camera to display an image.
this->StartEventObserverId = this->CurrentRenderer->AddObserver(vtkCommand::StartEvent, this->Observer, 1);
}
//-------------------------------------------------------------------------
void vtkOrientationMarkerWidget::TearDownWindowInteraction()
{
if (this->StartEventObserverId != 0)
{
this->CurrentRenderer->RemoveObserver(this->StartEventObserverId);
}
this->Enabled = 0;
this->Interactor->RemoveObserver( this->EventCallbackCommand );
this->Interactor->RemoveObserver(this->EventCallbackCommand);
this->OrientationMarker->VisibilityOff();
this->Renderer->RemoveViewProp( this->OrientationMarker );
this->OutlineActor->VisibilityOff();
this->CurrentRenderer->RemoveViewProp( this->OutlineActor );
this->OrientationMarker->VisibilityOff();
this->Renderer->RemoveViewProp(this->OrientationMarker);
// if the render window is still around, remove our renderer from it
if (this->CurrentRenderer->GetRenderWindow())
{
this->CurrentRenderer->GetRenderWindow()->
RemoveRenderer( this->Renderer );
}
if ( this->StartEventObserverId != 0 )
{
this->CurrentRenderer->RemoveObserver( this->StartEventObserverId );
}
this->CurrentRenderer->RemoveViewProp(this->OutlineActor);
this->InvokeEvent( vtkCommand::DisableEvent, nullptr );
this->SetCurrentRenderer( nullptr );
// if the render window is still around, remove our renderer from it
vtkRenderWindow* renwin = this->CurrentRenderer->GetRenderWindow();
if (renwin)
{
renwin->RemoveRenderer(this->Renderer);
}
}
......
......@@ -233,6 +233,11 @@ protected:
private:
vtkOrientationMarkerWidget(const vtkOrientationMarkerWidget&) = delete;
void operator=(const vtkOrientationMarkerWidget&) = delete;
//set up the actors and observers created by this widget
void SetupWindowInteraction();
//tear down up the actors and observers created by this widget
void TearDownWindowInteraction();
};
#endif
......@@ -176,10 +176,6 @@ void vtkCompositePolyDataMapper::Render(vtkRenderer *ren, vtkActor *a)
this->GetUseLookupTableScalarRange());
this->Internal->Mappers[i]->SetScalarRange(
this->GetScalarRange());
#ifdef VTK_LEGACY_SILENT
this->Internal->Mappers[i]->SetImmediateModeRendering(
this->GetImmediateModeRendering());
#endif
this->Internal->Mappers[i]->SetColorMode(this->GetColorMode());
this->Internal->Mappers[i]->SetInterpolateScalarsBeforeMapping(
this->GetInterpolateScalarsBeforeMapping());
......
......@@ -130,10 +130,6 @@ void vtkDataSetMapper::Render(vtkRenderer *ren, vtkActor *act)
this->GetUseLookupTableScalarRange());
this->PolyDataMapper->SetScalarRange(this->GetScalarRange());
#ifdef VTK_LEGACY_SILENT
this->PolyDataMapper->SetImmediateModeRendering(
this->GetImmediateModeRendering());
#endif
this->PolyDataMapper->SetColorMode(this->GetColorMode());
this->PolyDataMapper->SetInterpolateScalarsBeforeMapping(
this->GetInterpolateScalarsBeforeMapping());
......
......@@ -95,16 +95,6 @@ unsigned int vtkDiscretizableColorTransferFunction::GetNumberOfIndexedColors()
return static_cast<unsigned int>(this->Internals->IndexedColors.size());
}
//-----------------------------------------------------------------------------
#if !defined(VTK_LEGACY_REMOVE)
void vtkDiscretizableColorTransferFunction::SetIndexedColor(unsigned int index, const double rgb[3])
{
VTK_LEGACY_REPLACED_BODY(
vtkDiscretizableColorTransferFunction, "VTK 8.1", "SetIndexedColorRGB");
this->SetIndexedColorRGB(index, rgb);
}
#endif
//-----------------------------------------------------------------------------
void vtkDiscretizableColorTransferFunction::SetIndexedColor(
unsigned int index, double r, double g, double b, double a)
......@@ -424,19 +414,6 @@ void vtkDiscretizableColorTransferFunction::MapScalarsThroughTable2(void *input,
}
}
#ifndef VTK_LEGACY_REMOVE
//-----------------------------------------------------------------------------
double* vtkDiscretizableColorTransferFunction::GetRGBPoints()
{
// This method is redundant with
// vtkColorTransferFunction::GetDataPointer(), so we simply call
// that method here.
VTK_LEGACY_REPLACED_BODY(vtkDiscretizableColorTransferFunction::GetRGBPoints,
"VTK 6.2", "vtkDiscretizableColorTransferFunction::GetDataPointer()" );
return this->Superclass::GetDataPointer();
}
#endif
//----------------------------------------------------------------------------
vtkIdType vtkDiscretizableColorTransferFunction::GetNumberOfAvailableColors()
{
......
......@@ -78,7 +78,6 @@ public:
void SetIndexedColorRGBA(unsigned int index, const double rgba[4])
{ this->SetIndexedColor(index, rgba[0], rgba[1], rgba[2], rgba[3]); }
void SetIndexedColor(unsigned int index, double r, double g, double b, double a = 1.0);
VTK_LEGACY(void SetIndexedColor(unsigned int index, const double rgb[3]));
/**
* Get the "indexed color" assigned to an index.
......@@ -169,14 +168,6 @@ public:
int inputDataType, int numberOfValues,
int inputIncrement, int outputFormat) override;
/**
* Returns the (x, r, g, b) values as an array.
* vtkColorTransferFunction::GetDataPointer(). Retained for
* backwards compatibility.
* \deprecated Use GetDataPointer() instead.
*/
VTK_LEGACY(double* GetRGBPoints());
/**
* Specify an additional opacity (alpha) value to blend with. Values
* != 1 modify the resulting color consistent with the requested
......
......@@ -93,10 +93,6 @@ vtkGlyph3DMapper::vtkGlyph3DMapper()
this->SetOrientationArray(vtkDataSetAttributes::VECTORS);
this->SetSelectionIdArray(vtkDataSetAttributes::SCALARS);
#if !defined(VTK_LEGACY_REMOVE)
this->NestedDisplayLists = true;
#endif
this->Masking = false;
this->SelectionColorId=1;
}
......@@ -430,9 +426,6 @@ void vtkGlyph3DMapper::PrintSelf(ostream& os, vtkIndent indent)
{
this->BlockAttributes->PrintSelf(os, indent.GetNextIndent());
}
#if !defined(VTK_LEGACY_REMOVE)
os << "NestedDisplayLists: " << (this->NestedDisplayLists? "On" : "Off") << endl;
#endif
}
// ---------------------------------------------------------------------------
......@@ -845,42 +838,3 @@ void vtkGlyph3DMapper::SetInputData(vtkDataObject* input)
{
this->SetInputDataInternal(0, input);
}
#if !defined(VTK_LEGACY_REMOVE)
//---------------------------------------------------------------------------
void vtkGlyph3DMapper::SetNestedDisplayLists(bool val)
{
VTK_LEGACY_BODY(vtkGlyph3DMapper::SetNestedDisplayLists, "VTK 8.1");
if (this->NestedDisplayLists != val)
{
this->NestedDisplayLists = val;
this->Modified();
}
}
bool vtkGlyph3DMapper::GetNestedDisplayLists()
{
VTK_LEGACY_BODY(vtkGlyph3DMapper::GetNestedDisplayLists, "VTK 8.1");
return this->NestedDisplayLists;
}
void vtkGlyph3DMapper::NestedDisplayListsOn()
{
VTK_LEGACY_BODY(vtkGlyph3DMapper::NestedDisplayListsOn, "VTK 8.1.");
if (this->NestedDisplayLists != true)
{
this->NestedDisplayLists = true;
this->Modified();
}
}
void vtkGlyph3DMapper::NestedDisplayListsOff()
{
VTK_LEGACY_BODY(vtkGlyph3DMapper::NestedDisplayListsOn, "VTK 8.1.");
if (this->NestedDisplayLists != false)
{
this->NestedDisplayLists = false;
this->Modified();
}
}
#endif
......@@ -246,23 +246,6 @@ public:
*/
void Render(vtkRenderer *ren, vtkActor *act) override;
//@{
/**
* If immediate mode is off, if NestedDisplayLists is false,
* only the mappers of each glyph use display lists. If true,
* in addition, matrices transforms and color per glyph are also
* in a parent display list.
* Not relevant if immediate mode is on.
* For debugging/profiling purpose. Initial value is true.
* @deprecated in 8.1. Only applicable for legacy OpenGL rendering
* backend which is also deprecated.
*/
VTK_LEGACY(void SetNestedDisplayLists(bool));
VTK_LEGACY(bool GetNestedDisplayLists());
VTK_LEGACY(void NestedDisplayListsOn());
VTK_LEGACY(void NestedDisplayListsOff());
//@}
//@{
/**
* Tells the mapper to skip glyphing input points that haves false values
......@@ -461,9 +444,6 @@ protected:
bool UseSelectionIds; // Enable/disable custom pick ids
bool Masking; // Enable/disable masking.
int OrientationMode;
#if !defined(VTK_LEGACY_REMOVE)
bool NestedDisplayLists; // boolean
#endif
bool UseSourceTableTree; // Map DataObjectTree glyph source into table
......
......@@ -32,9 +32,6 @@
#include "vtkVariantArray.h"
// Initialize static member that controls global immediate mode rendering
static int vtkMapperGlobalImmediateModeRendering = 0;
// Initialize static member that controls global coincidence resolution
static int vtkMapperGlobalResolveCoincidentTopology = VTK_RESOLVE_OFF;
static double vtkMapperGlobalResolveCoincidentTopologyZShift = 0.01;
......@@ -58,11 +55,6 @@ vtkMapper::vtkMapper()
this->ScalarRange[0] = 0.0; this->ScalarRange[1] = 1.0;
this->UseLookupTableScalarRange = 0;
#ifndef VTK_LEGACY_REMOVE
this->ImmediateModeRendering = 0;
this->ForceCompileOnly=0;
#endif
this->ColorMode = VTK_COLOR_MODE_DEFAULT;
this->ScalarMode = VTK_SCALAR_MODE_DEFAULT;
......@@ -141,100 +133,6 @@ vtkDataSet *vtkMapper::GetInput()
this->GetExecutive()->GetInputData(0, 0));
}
#ifndef VTK_LEGACY_REMOVE
void vtkMapper::SetForceCompileOnly(int value)
{
VTK_LEGACY_BODY(vtkMapper::SetForceCompileOnly, "VTK 8.1");
if(this->ForceCompileOnly!=value)
{
this->ForceCompileOnly=value;
// make sure we don't call this->Modified();
// this->Modified();
}
}
int vtkMapper::GetForceCompileOnly()
{
VTK_LEGACY_BODY(vtkMapper::GetForceCompileOnly, "VTK 8.1");
return this->ForceCompileOnly;
}
void vtkMapper::SetImmediateModeRendering(int val)
{
VTK_LEGACY_BODY(vtkMapper::SetImmediateModeRendering, "VTK 8.1");
if (val == this->ImmediateModeRendering)
{
return;
}
this->ImmediateModeRendering = val;
this->Modified();
}
void vtkMapper::ImmediateModeRenderingOn()
{
VTK_LEGACY_BODY(vtkMapper::ImmediateModeRenderingOn, "VTK 8.1");
if (this->ImmediateModeRendering == 1)
{
return;
}
this->ImmediateModeRendering = 1;
this->Modified();
}
void vtkMapper::ImmediateModeRenderingOff()
{
VTK_LEGACY_BODY(vtkMapper::ImmediateModeRenderingOff, "VTK 8.1");
if (this->ImmediateModeRendering == 0)
{
return;
}
this->ImmediateModeRendering = 0;
this->Modified();
}
int vtkMapper::GetImmediateModeRendering()
{
VTK_LEGACY_BODY(vtkMapper::GetImmediateModeRendering, "VTK 8.1");
return this->ImmediateModeRendering;
}
void vtkMapper::SetGlobalImmediateModeRendering(int val)
{
VTK_LEGACY_BODY(vtkMapper::SetImmediateModeRendering, "VTK 8.1");
if (val == vtkMapperGlobalImmediateModeRendering)
{
return;
}
vtkMapperGlobalImmediateModeRendering = val;
}
void vtkMapper::GlobalImmediateModeRenderingOn()
{
VTK_LEGACY_BODY(vtkMapper::GlobalImmediateModeRenderingOn, "VTK 8.1");
if (vtkMapperGlobalImmediateModeRendering == 1)
{
return;
}
vtkMapperGlobalImmediateModeRendering = 1;
}
void vtkMapper::GlobalImmediateModeRenderingOff()
{
VTK_LEGACY_BODY(vtkMapper::GlobalImmediateModeRenderingOff, "VTK 8.1");
if (vtkMapperGlobalImmediateModeRendering == 0)
{
return;
}
vtkMapperGlobalImmediateModeRendering = 0;
}
int vtkMapper::GetGlobalImmediateModeRendering()
{
VTK_LEGACY_BODY(vtkMapper::GetGlobalImmediateModeRendering, "VTK 8.1");
return vtkMapperGlobalImmediateModeRendering;
}
#endif
void vtkMapper::SetResolveCoincidentTopology(int val)
{
if (val == vtkMapperGlobalResolveCoincidentTopology)
......@@ -437,11 +335,6 @@ void vtkMapper::ShallowCopy(vtkAbstractMapper *mapper)
this->SetScalarRange(m->GetScalarRange());
this->SetColorMode(m->GetColorMode());
this->SetScalarMode(m->GetScalarMode());
#ifdef VTK_LEGACY_SILENT
this->SetImmediateModeRendering(m->GetImmediateModeRendering());
#endif
this->SetUseLookupTableScalarRange(m->GetUseLookupTableScalarRange());
this->SetInterpolateScalarsBeforeMapping(
m->GetInterpolateScalarsBeforeMapping());
......@@ -810,40 +703,6 @@ const char *vtkMapper::GetScalarModeAsString(void)
}
}
#ifndef VTK_LEGACY_REMOVE
void vtkMapper::SetScalarMaterialMode(int)
{
VTK_LEGACY_BODY(vtkMapper::SetScalarMaterialMode, "VTK 8.1");
}
int vtkMapper::GetScalarMaterialMode()
{
VTK_LEGACY_BODY(vtkMapper::GetScalarMaterialMode, "VTK 8.1");
return VTK_MATERIALMODE_AMBIENT_AND_DIFFUSE;
}
void vtkMapper::SetScalarMaterialModeToDefault()
{
VTK_LEGACY_BODY(vtkMapper::SetScalarMaterialModeToDefault, "VTK 8.1");
}
void vtkMapper::SetScalarMaterialModeToAmbient()
{
VTK_LEGACY_BODY(vtkMapper::SetScalarMaterialModeToambient, "VTK 8.1");
}
void vtkMapper::SetScalarMaterialModeToDiffuse()
{
VTK_LEGACY_BODY(vtkMapper::SetScalarMaterialModeToDiffuse, "VTK 8.1");
}
void vtkMapper::SetScalarMaterialModeToAmbientAndDiffuse()
{
VTK_LEGACY_BODY(vtkMapper::SetScalarMaterialModeToAmbientAndDiffuse, "VTK 8.1");
}
const char *vtkMapper::GetScalarMaterialModeAsString(void)
{
VTK_LEGACY_BODY(vtkMapper::GetScalarMaterialModeAsString, "VTK 8.1");
return "Ambient and Diffuse";
}
#endif
//-----------------------------------------------------------------------------
bool vtkMapper::GetIsOpaque()
{
......@@ -1123,16 +982,6 @@ void vtkMapper::PrintSelf(ostream& os, vtkIndent indent)
os << indent << "Lookup Table: (none)\n";
}
#ifdef VTK_LEGACY_SILENT
os << indent << "Immediate Mode Rendering: "
<< (this->ImmediateModeRendering ? "On\n" : "Off\n");
os << indent << "Force compile only for display lists: "
<< (this->ForceCompileOnly ? "On\n" : "Off\n");
#endif
os << indent << "Global Immediate Mode Rendering: " <<
(vtkMapperGlobalImmediateModeRendering ? "On\n" : "Off\n");
os << indent << "Scalar Visibility: "
<< (this->ScalarVisibility ? "On\n" : "Off\n");
......
......@@ -203,50 +203,6 @@ public:
vtkGetVectorMacro(ScalarRange, double, 2);
//@}
//@{
/**
* Turn on/off flag to control whether data is rendered using
* immediate mode or note. Immediate mode rendering
* tends to be slower but it can handle larger datasets.
* The default value is immediate mode off. If you are
* having problems rendering a large dataset you might
* want to consider using immediate more rendering.
*/
VTK_LEGACY(void SetImmediateModeRendering(int));
VTK_LEGACY(int GetImmediateModeRendering());
VTK_LEGACY(void ImmediateModeRenderingOn());
VTK_LEGACY(void ImmediateModeRenderingOff());
//@}
//@{
/**
* Turn on/off flag to control whether data is rendered using
* immediate mode or note. Immediate mode rendering
* tends to be slower but it can handle larger datasets.
* The default value is immediate mode off. If you are
* having problems rendering a large dataset you might
* want to consider using immediate more rendering.
*/
VTK_LEGACY(static void SetGlobalImmediateModeRendering(int val));
VTK_LEGACY(static void GlobalImmediateModeRenderingOn());
VTK_LEGACY(static void GlobalImmediateModeRenderingOff());
VTK_LEGACY(static int GetGlobalImmediateModeRendering());
//@}
//@{
/**
* Force compile only mode in case display lists are used
* (ImmediateModeRendering is false). If ImmediateModeRendering is true,
* no rendering happens. Changing the value of this flag does not change
* modified time of the mapper. Initial value is false.
* This can be used by another rendering class which also uses display lists
* (call of display lists can be nested but not their creation.)
* There is no good reason to expose it to wrappers.
*/
VTK_LEGACY(int GetForceCompileOnly());
VTK_LEGACY(void SetForceCompileOnly(int value));
//@}
/**
* Control how the filter works with scalar point data and cell attribute
* data. By default (ScalarModeToDefault), the filter will use point data,
......@@ -507,23 +463,6 @@ public:
int &cellFlag);
//@}
//@{
/**
* Set/Get the light-model color mode.
*/
VTK_LEGACY(void SetScalarMaterialMode(int val));
VTK_LEGACY(int GetScalarMaterialMode());
VTK_LEGACY(void SetScalarMaterialModeToDefault());
VTK_LEGACY(void SetScalarMaterialModeToAmbient());
VTK_LEGACY(void SetScalarMaterialModeToDiffuse());
VTK_LEGACY(void SetScalarMaterialModeToAmbientAndDiffuse());
//@}
/**
* Return the light-model color mode.
*/
VTK_LEGACY(const char *GetScalarMaterialModeAsString());
/**
* Returns if the mapper does not expect to have translucent geometry. This
* may happen when using ColorMode is set to not map scalars i.e. render the
......@@ -595,11 +534,6 @@ protected:
double ScalarRange[2];
int UseLookupTableScalarRange;
#ifndef VTK_LEGACY_REMOVE
int ImmediateModeRendering;
int ForceCompileOnly;
#endif
int ColorMode;
int ScalarMode;
......
......@@ -56,15 +56,8 @@ vtkRenderWindow::vtkRenderWindow()
this->AlphaBitPlanes = 0;
this->StencilCapable = 0;
this->Interactor = nullptr;
this->AAFrames = 0;
this->FDFrames = 0;
this->UseConstantFDOffsets = 0;
this->ConstantFDOffsets[0] = nullptr;
this->ConstantFDOffsets[1] = nullptr;
this->SubFrames = 0;
this->AccumulationBuffer = nullptr;
this->AccumulationBufferSize = 0;
this->CurrentSubFrame = 0;
this->DesiredUpdateRate = 0.0001;
this->ResultFrame = nullptr;
this->SwapBuffers = 1;
......@@ -102,12 +95,6 @@ vtkRenderWindow::~vtkRenderWindow()
delete [] this->ResultFrame;
this->ResultFrame = nullptr;
for (int i = 0; i < 2; ++i)
{
delete [] this->ConstantFDOffsets[i];
this->ConstantFDOffsets[i] = nullptr;
}
if (this->Renderers)
{
vtkCollectionSimpleIterator rsit;
......@@ -163,54 +150,6 @@ void vtkRenderWindow::SetInteractor(vtkRenderWindowInteractor *rwi)
}
}
//----------------------------------------------------------------------------
#if !defined(VTK_LEGACY_REMOVE)
void vtkRenderWindow::SetFDFrames(int fdFrames)
{
VTK_LEGACY_BODY(SetFDFrames, "VTK 8.1");
if (this->FDFrames != fdFrames)
{
this->FDFrames = fdFrames;
for (int i = 0; i < 2; i++)
{
delete [] this->ConstantFDOffsets[i];
this->ConstantFDOffsets[i] = nullptr;
if (this->FDFrames > 0)
{
this->ConstantFDOffsets[i] = new double[this->FDFrames];
for (int fi = 0; fi < this->FDFrames; fi++)
{
this->ConstantFDOffsets[i][fi] = vtkMath::Random();
}
}
}
vtkDebugMacro(<< this->GetClassName() << " (" << this
<< "): setting FDFrames to " << fdFrames);
this->Modified();
}
}
//----------------------------------------------------------------------------
void vtkRenderWindow::SetSubFrames(int subFrames)
{
VTK_LEGACY_BODY(SetSubFrames, "VTK 8.1");
if (this->SubFrames != subFrames)
{
this->SubFrames = subFrames;
if (this->CurrentSubFrame >= this->SubFrames)
{
this->CurrentSubFrame = 0;
}
vtkDebugMacro(<< this->GetClassName() << " (" << this
<< "): setting SubFrames to " << subFrames);
this->Modified();
}
}
#endif
//----------------------------------------------------------------------------
void vtkRenderWindow::SetDesiredUpdateRate(double rate)
{
......@@ -273,10 +212,6 @@ void vtkRenderWindow::SetStereoRender(int stereo)
// synchronize this process.
void vtkRenderWindow::Render()
{
int *size;
int x,y;
float *p1;
// if we are in the middle of an abort check then return now
if (this->InAbortCheck)
{
......@@ -319,159 +254,8 @@ void vtkRenderWindow::Render()
event = this->RenderTimer->StartScopedEvent("vtkRenderWindow::Render");
}
// CAUTION:
// This method uses this->GetSize() and allocates buffers using that size.
// Remember that GetSize() will returns a size scaled by the TileScale factor.
// We should use GetActualSize() when we don't want the size to be scaled.
// if there is a reason for an AccumulationBuffer
if ( this->SubFrames || this->AAFrames || this->FDFrames)
{
// check the current size
size = this->GetSize();
unsigned int bufferSize = 3*size[0]*size[1];
// If there is not a buffer or the size is too small
// re-allocate it
if( !this->AccumulationBuffer
|| bufferSize > this->AccumulationBufferSize)
{
// it is OK to delete null, no sense in two if's
delete [] this->AccumulationBuffer;
// Save the size of the buffer
this->AccumulationBufferSize = 3*size[0]*size[1];
this->AccumulationBuffer = new float [this->AccumulationBufferSize];
memset(this->AccumulationBuffer,0,this->AccumulationBufferSize*sizeof(float));
}
}
// handle any sub frames
if (this->SubFrames)
{
// get the size
size = this->GetSize();
// draw the images
this->DoAARender();
// now accumulate the images
if ((!this->AAFrames) && (!this->FDFrames))
{
p1 = this->AccumulationBuffer;
unsigned char *p2;
unsigned char *p3 = nullptr;
if (this->ResultFrame)
{
p2 = this->ResultFrame;
}
else
{
p2 = this->GetPixelData(0,0,size[0]-1,size[1]-1,!this->DoubleBuffer);
p3 = p2;
}
for (y = 0; y < size[1]; y++)
{
for (x = 0; x < size[0]; x++)
{
*p1 += *p2; p1++; p2++;
*p1 += *p2; p1++; p2++;
*p1 += *p2; p1++; p2++;
}
}
delete [] p3;
}
// if this is the last sub frame then convert back into unsigned char
this->CurrentSubFrame++;
if (this->CurrentSubFrame >= this->SubFrames)
{
double num;
unsigned char *p2 = new unsigned char [3*size[0]*size[1]];
num = this->SubFrames;
if (this->AAFrames)
{
num *= this->AAFrames;
}
if (this->FDFrames)
{
num *= this->FDFrames;
}
this->ResultFrame = p2;
p1 = this->AccumulationBuffer;
for (y = 0; y < size[1]; y++)
{
for (x = 0; x < size[0]; x++)
{
*p2 = static_cast<unsigned char>(*p1/num);
p1++;
p2++;
*p2 = static_cast<unsigned char>(*p1/num);
p1++;
p2++;
*p2 = static_cast<unsigned char>(*p1/num);
p1++;
p2++;
}
}
this->CurrentSubFrame = 0;
this->CopyResultFrame();
// free any memory
delete [] this->AccumulationBuffer;
this->AccumulationBuffer = nullptr;
}
}
else // no subframes
{
// get the size
size = this->GetSize();
this->DoAARender();
// if we had some accumulation occur
if (this->AccumulationBuffer)
{
double num;
unsigned char *p2 = new unsigned char [3*size[0]*size[1]];
if (this->AAFrames)
{
num = this->AAFrames;
}
else
{
num = 1;
}
if (this->FDFrames)
{
num *= this->FDFrames;
}
this->ResultFrame = p2;
p1 = this->AccumulationBuffer;
for (y = 0; y < size[1]; y++)
{
for (x = 0; x < size[0]; x++)
{
*p2 = static_cast<unsigned char>(*p1/num);
p1++;
p2++;
*p2 = static_cast<unsigned char>(*p1/num);
p1++;
p2++;
*p2 = static_cast<unsigned char>(*p1/num);
p1++;
p2++;
}
}
delete [] this->AccumulationBuffer;
this->AccumulationBuffer = nullptr;
}
this->CopyResultFrame();
}
this->DoStereoRender();
this->CopyResultFrame();
delete [] this->ResultFrame;
this->ResultFrame = nullptr;
......@@ -483,264 +267,6 @@ void vtkRenderWindow::Render()
this->InvokeEvent(vtkCommand::EndEvent,nullptr);
}
//----------------------------------------------------------------------------
// Handle rendering any antialiased frames.
void vtkRenderWindow::DoAARender()
{
int i;
// handle any anti aliasing
if (this->AAFrames)
{
int *<