Commit 52dc35a8 authored by Ken Martin's avatar Ken Martin

some module changes override actor change bunny color

parent 0400abf7
......@@ -4,7 +4,7 @@ vtk_module(vtkCommonColor
TEST_DEPENDS
vtkIOImage
vtkCommonExecutionModel
vtkRenderingOpenGL
vtkRenderingOpenGL2
vtkTestingCore
vtkTestingRendering
vtkInteractionStyle
......
......@@ -16,5 +16,5 @@ vtk_module(vtkCommonDataModel
vtkIOLegacy
vtkIOXML
vtkRenderingCore
vtkRenderingOpenGL
vtkRenderingOpenGL2
)
......@@ -11,5 +11,5 @@ vtk_module(vtkDomainsChemistry
vtkTestingCore
vtkTestingRendering
vtkInteractionStyle
vtkRenderingOpenGL
vtkRenderingOpenGL2
)
......@@ -14,5 +14,5 @@ vtk_module(vtkFiltersCore
vtkIOXML
vtkImagingCore
vtkFiltersGeneral
vtkRenderingOpenGL
vtkRenderingOpenGL2
)
......@@ -9,7 +9,7 @@ vtk_module(vtkFiltersExtraction
TEST_DEPENDS
vtkIOLegacy
vtkIOXML
vtkRenderingOpenGL
vtkRenderingOpenGL2
vtkTestingRendering
vtkInteractionStyle
)
......@@ -12,5 +12,5 @@ vtk_module(vtkFiltersFlowPaths
vtkTestingCore
vtkTestingRendering
vtkInteractionStyle
vtkRenderingOpenGL
vtkRenderingOpenGL2
)
......@@ -8,7 +8,7 @@ vtk_module(vtkFiltersGeneral
vtkIOLegacy
vtkIOXML
vtkInteractionStyle
vtkRenderingOpenGL
vtkRenderingOpenGL2
vtkRenderingFreeTypeOpenGL
vtkRenderingAnnotation
vtkRenderingLabel
......
......@@ -7,7 +7,7 @@ vtk_module(vtkFiltersGeneric
TEST_DEPENDS
vtkIOXML
vtkIOLegacy
vtkRenderingOpenGL
vtkRenderingOpenGL2
vtkRenderingFreeTypeOpenGL
vtkFiltersModeling
vtkRenderingLabel
......
......@@ -5,7 +5,7 @@ vtk_module(vtkFiltersGeometry
vtkFiltersCore
TEST_DEPENDS
vtkIOXML
vtkRenderingOpenGL
vtkRenderingOpenGL2
vtkTestingRendering
vtkInteractionStyle
)
......@@ -7,7 +7,7 @@ vtk_module(vtkFiltersHybrid
vtkRenderingCore # For vtkCamera in vtkDepthSortPolyData
TEST_DEPENDS
vtkIOXML
vtkRenderingOpenGL
vtkRenderingOpenGL2
vtkImagingCore
vtkTestingRendering
vtkInteractionStyle
......
......@@ -7,7 +7,7 @@ vtk_module(vtkFiltersModeling
TEST_DEPENDS
vtkCommonColor # For vtkBandedPolyDataContourFilter used in a test
vtkIOXML
vtkRenderingOpenGL
vtkRenderingOpenGL2
vtkTestingRendering
vtkInteractionStyle
)
......@@ -11,7 +11,7 @@ vtk_module(vtkFiltersParallel
vtkParallelMPI
vtkTestingRendering
vtkInteractionStyle
vtkRenderingOpenGL
vtkRenderingOpenGL2
vtkRenderingParallel
vtkFiltersParallelMPI
vtkFiltersParallelImaging
......
......@@ -4,7 +4,7 @@ vtk_module(vtkFiltersProgrammable
DEPENDS
vtkCommonExecutionModel
TEST_DEPENDS
vtkRenderingOpenGL
vtkRenderingOpenGL2
vtkTestingRendering
vtkInteractionStyle
)
......@@ -2,7 +2,7 @@ vtk_module(vtkFiltersReebGraph
DEPENDS
vtkFiltersCore
TEST_DEPENDS
vtkRenderingOpenGL
vtkRenderingOpenGL2
vtkTestingRendering
vtkInteractionStyle
)
......@@ -8,7 +8,7 @@ vtk_module(vtkFiltersSelection
vtkFiltersExtraction
vtkIOLegacy
vtkIOXML
vtkRenderingOpenGL
vtkRenderingOpenGL2
vtkRenderingFreeTypeOpenGL
vtkRenderingAnnotation
vtkTestingRendering
......
......@@ -8,7 +8,7 @@ vtk_module(vtkFiltersSources
vtkTestingCore
vtkTestingRendering
vtkInteractionStyle
vtkRenderingOpenGL
vtkRenderingOpenGL2
vtkRenderingFreeTypeOpenGL
vtkFiltersModeling
vtkIOXML
......
......@@ -3,7 +3,7 @@ if(WIN32)
vtk_module(vtkGUISupportMFC
GROUPS
DEPENDS
vtkRenderingOpenGL
vtkRenderingOpenGL2
vtkInteractionStyle
EXCLUDE_FROM_WRAPPING
)
......
......@@ -3,7 +3,7 @@ vtk_module(vtkGUISupportQt
Qt
DEPENDS
vtkCommonExecutionModel
vtkRenderingOpenGL
vtkRenderingOpenGL2
vtkInteractionStyle
vtkImagingCore
PRIVATE_DEPENDS
......
......@@ -3,7 +3,7 @@ vtk_module(vtkGUISupportQtOpenGL
Qt
DEPENDS
vtkGUISupportQt
vtkRenderingOpenGL
vtkRenderingOpenGL2
TEST_DEPENDS
vtkTestingCore
EXCLUDE_FROM_WRAPPING
......
......@@ -7,7 +7,7 @@ vtk_module(vtkGeovisCore
vtkInteractionStyle
vtkInfovisLayout
vtkViewsCore
vtkRenderingOpenGL # For vtkOpenGLHardwareSupport in vtkGeoTerrain
vtkRenderingOpenGL2 # For vtkOpenGLHardwareSupport in vtkGeoTerrain
vtklibproj4
TEST_DEPENDS
vtkViewsGeovis
......
......@@ -10,5 +10,5 @@ vtk_module(vtkIOExodus
TEST_DEPENDS
vtkTestingRendering
vtkInteractionStyle
vtkRenderingOpenGL
vtkRenderingOpenGL2
)
......@@ -9,7 +9,7 @@ vtk_module(vtkIOExport
vtkRenderingFreeType
vtkRenderingGL2PS
vtkRenderingLabel
vtkRenderingOpenGL
vtkRenderingOpenGL2
vtkImagingCore
PRIVATE_DEPENDS
vtkIOImage
......
......@@ -4,7 +4,7 @@ vtk_module(vtkIOGDAL
vtkCommonExecutionModel
TEST_DEPENDS
vtkTestingCore
vtkRenderingOpenGL
vtkRenderingOpenGL2
vtkTestingRendering
vtkInteractionStyle
)
......@@ -14,7 +14,7 @@ vtk_module(vtkIOGeometry
vtkIOAMR
vtkIOLegacy
vtkFiltersGeometry
vtkRenderingOpenGL
vtkRenderingOpenGL2
vtkTestingRendering
vtkInteractionStyle
)
......@@ -7,7 +7,7 @@ vtk_module(vtkIOImport
PRIVATE_DEPENDS
vtkFiltersSources
TEST_DEPENDS
vtkRenderingOpenGL
vtkRenderingOpenGL2
vtkTestingRendering
vtkInteractionStyle
)
......@@ -7,7 +7,7 @@ vtk_module(vtkIOLSDyna
PRIVATE_DEPENDS
vtksys
TEST_DEPENDS
vtkRenderingOpenGL
vtkRenderingOpenGL2
vtkTestingRendering
vtkInteractionStyle
)
......@@ -11,6 +11,6 @@ vtk_module(vtkIOLegacy
TEST_DEPENDS
vtkFiltersAMR
vtkInteractionStyle
vtkRenderingOpenGL
vtkRenderingOpenGL2
vtkTestingRendering
)
......@@ -12,5 +12,5 @@ vtk_module(vtkIOMPIImage
vtkTestingCore
vtkTestingRendering
vtkInteractionStyle
vtkRenderingOpenGL
vtkRenderingOpenGL2
)
......@@ -9,7 +9,7 @@ vtk_module(vtkIOMPIParallel
PRIVATE_DEPENDS
vtksys
TEST_DEPENDS
vtkRenderingOpenGL
vtkRenderingOpenGL2
vtkTestingRendering
vtkInteractionStyle
)
......@@ -10,7 +10,7 @@ vtk_module(vtkIONetCDF
vtknetcdf
TEST_DEPENDS
vtkCommonExecutionModel
vtkRenderingOpenGL
vtkRenderingOpenGL2
vtkTestingRendering
vtkInteractionStyle
)
......@@ -6,7 +6,7 @@ vtk_module(vtkIOPLY
vtkCommonExecutionModel
vtkIOGeometry
TEST_DEPENDS
vtkRenderingOpenGL
vtkRenderingOpenGL2
vtkIOImage
vtkTestingRendering
vtkInteractionStyle
......
......@@ -8,5 +8,5 @@ vtk_module(vtkIOParallelLSDyna
vtkRenderingParallel
vtkTestingRendering
vtkInteractionStyle
vtkRenderingOpenGL
vtkRenderingOpenGL2
)
......@@ -8,7 +8,7 @@ vtk_module(vtkIOParallelNetCDF
vtknetcdf
TEST_DEPENDS
vtkCommonExecutionModel
vtkRenderingOpenGL
vtkRenderingOpenGL2
vtkTestingRendering
vtkInteractionStyle
)
......@@ -4,7 +4,7 @@ vtk_module(vtkIOVPIC
vtkCommonExecutionModel
vtkParallelCore
TEST_DEPENDS
vtkRenderingOpenGL
vtkRenderingOpenGL2
vtkTestingRendering
vtkInteractionStyle
)
......@@ -14,7 +14,7 @@ vtk_module(vtkIOXML
vtkImagingSources
vtkInfovisCore
vtkIOLegacy
vtkRenderingOpenGL
vtkRenderingOpenGL2
vtkTestingCore
vtkTestingRendering
vtkInteractionStyle
......
......@@ -11,7 +11,7 @@ vtk_module(vtkImagingCore
vtkFiltersModeling
vtkFiltersGeneral
vtkFiltersHybrid
vtkRenderingOpenGL
vtkRenderingOpenGL2
vtkTestingRendering
vtkInteractionStyle
vtkInteractionImage
......
......@@ -3,7 +3,7 @@ vtk_module(vtkInfovisBoostGraphAlgorithms
vtkInfovisCore
vtkCommonExecutionModel
TEST_DEPENDS
vtkRenderingOpenGL
vtkRenderingOpenGL2
vtkTestingRendering
vtkInteractionStyle
vtkIOInfovis
......
......@@ -8,7 +8,7 @@ vtk_module(vtkInfovisCore
vtkFiltersGeneral
TEST_DEPENDS
vtkInfovisLayout
vtkRenderingOpenGL
vtkRenderingOpenGL2
vtkTestingRendering
vtkInteractionStyle
vtkIOInfovis
......
......@@ -8,7 +8,7 @@ vtk_module(vtkInfovisLayout
vtkInfovisCore
TEST_DEPENDS
vtkRenderingLabel
vtkRenderingOpenGL
vtkRenderingOpenGL2
vtkTestingRendering
vtkInteractionStyle
vtkIOInfovis
......
......@@ -8,6 +8,6 @@ vtk_module(vtkRenderingContext2D
vtkCommonDataModel
vtkCommonMath
vtkCommonTransforms
vtkRenderingOpenGL
vtkRenderingOpenGL2
vtkRenderingFreeType
)
......@@ -13,5 +13,5 @@ vtk_module(vtkRenderingCore
vtkIOXML
vtkTestingCore
vtkTestingRendering
vtkRenderingOpenGL
vtkRenderingOpenGL2
)
......@@ -5,7 +5,7 @@ vtk_module(vtkRenderingFreeTypeOpenGL
vtkRenderingCore
DEPENDS
vtkRenderingFreeType
vtkRenderingOpenGL
vtkRenderingOpenGL2
TEST_DEPENDS
vtkTestingCore
vtkTestingRendering
......
......@@ -3,7 +3,7 @@ vtk_module(vtkRenderingGL2PS
DEPENDS
vtkRenderingContext2D
PRIVATE_DEPENDS
vtkRenderingOpenGL
vtkRenderingOpenGL2
vtkRenderingFreeType
vtkgl2ps
TEST_DEPENDS
......
......@@ -5,7 +5,7 @@ vtk_module(vtkRenderingLIC
vtkIOXML
vtkIOLegacy
vtkImagingSources
vtkRenderingOpenGL
vtkRenderingOpenGL2
PRIVATE_DEPENDS
vtksys
TEST_DEPENDS
......
......@@ -14,7 +14,7 @@ vtk_module(vtkRenderingMatplotlib
vtkTestingRendering
vtkInteractionStyle
vtkRenderingGL2PS
vtkRenderingOpenGL
vtkRenderingOpenGL2
vtkRenderingFreeTypeOpenGL
vtkViewsContext2D
)
......@@ -25,4 +25,5 @@ vtk_module(vtkRenderingOpenGL
vtkFiltersProgrammable
vtkFiltersSources
vtkRenderingAnnotation
vtkRenderingOpenGL2
)
......@@ -18,6 +18,7 @@ set(Module_SRCS
vtkglShader.cxx
vtkglShaderProgram.cxx
vtkglTexture2D.cxx
vtkOpenGL2Actor.cxx
vtkOpenGL2Camera.cxx
vtkOpenGL2Light.cxx
vtkVBOPolyDataMapper.cxx
......@@ -77,10 +78,12 @@ set_source_files_properties(
# tests.
if(VTK_REPLACE_OPENGL_OVERRIDES)
set(opengl_overrides
Actor
Camera
Light
)
endif()
vtk_add_override(vtkPolyDataMapper vtkVBOPolyDataMapper)
foreach(_override ${opengl_overrides})
vtk_add_override(vtk${_override} vtkOpenGL2${_override})
......
......@@ -62,8 +62,8 @@ int TestVBOPLYMapper(int argc, char *argv[])
actor->GetProperty()->SetDiffuseColor(1.0, 0.65, 0.7);
actor->GetProperty()->SetSpecularColor(1.0, 1.0, 1.0);
actor->GetProperty()->SetSpecular(0.5);
actor->GetProperty()->SetDiffuse(0.5);
actor->GetProperty()->SetAmbient(0.3);
actor->GetProperty()->SetDiffuse(0.7);
actor->GetProperty()->SetAmbient(0.5);
actor->GetProperty()->SetSpecularPower(20.0);
actor->GetProperty()->SetOpacity(1.0);
......
vtk_module(vtkRenderingOpenGL2
DEPENDS
vtkCommonExecutionModel
vtkRenderingOpenGL
IMPLEMENTS
vtkRenderingCore
PRIVATE_DEPENDS
......@@ -13,6 +14,5 @@ vtk_module(vtkRenderingOpenGL2
vtkTestingRendering
vtkInteractionStyle
vtkIOPLY
vtkRenderingOpenGL
EXCLUDE_FROM_WRAPPING
)
/*=========================================================================
Program: Visualization Toolkit
Module: vtkOpenGLActor.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 "vtkOpenGL2Actor.h"
#include "vtkMapper.h"
#include "vtkMatrix4x4.h"
#include "vtkObjectFactory.h"
#include "vtkOpenGLRenderer.h"
#include "vtkProperty.h"
#include "vtkOpenGLError.h"
#include "vtkOpenGL.h"
#include <math.h>
vtkStandardNewMacro(vtkOpenGL2Actor);
// Actual actor render method.
void vtkOpenGL2Actor::Render(vtkRenderer *ren, vtkMapper *mapper)
{
vtkOpenGLClearErrorMacro();
// get opacity
double opacity = this->GetProperty()->GetOpacity();
if (opacity == 1.0)
{
glDepthMask(GL_TRUE);
}
else
{
// Add this check here for GL_SELECT mode
// If we are not picking, then don't write to the zbuffer
// because we probably haven't sorted the polygons. If we
// are picking, then translucency doesn't matter - we want to
// pick the thing closest to us.
GLint param;
glGetIntegerv(GL_RENDER_MODE, &param);
if (param == GL_SELECT )
{
glDepthMask(GL_TRUE);
}
else
{
if (ren->GetLastRenderingUsedDepthPeeling())
{
glDepthMask(GL_TRUE); // transparency with depth peeling
}
else
{
glDepthMask(GL_FALSE); // transparency with alpha blending
}
}
}
// send a render to the mapper; update pipeline
mapper->Render(ren, this);
if (opacity != 1.0)
{
glDepthMask(GL_TRUE);
}
vtkOpenGLCheckErrorMacro("failed after Render");
}
//----------------------------------------------------------------------------
void vtkOpenGL2Actor::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
}
/*=========================================================================
Program: Visualization Toolkit
Module: vtkOpenGLActor.h
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.
=========================================================================*/
// .NAME vtkOpenGLActor - OpenGL actor
// .SECTION Description
// vtkOpenGLActor is a concrete implementation of the abstract class vtkActor.
// vtkOpenGLActor interfaces to the OpenGL rendering library.
#ifndef __vtkOpenGL2Actor_h
#define __vtkOpenGL2Actor_h
#include "vtkRenderingOpenGL2Module.h" // For export macro
#include "vtkActor.h"
class vtkOpenGLRenderer;
class VTKRENDERINGOPENGL2_EXPORT vtkOpenGL2Actor : public vtkActor
{
public:
static vtkOpenGL2Actor *New();
vtkTypeMacro(vtkOpenGL2Actor, vtkActor);
virtual void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Actual actor render method.
void Render(vtkRenderer *ren, vtkMapper *mapper);
protected:
vtkOpenGL2Actor() {}
~vtkOpenGL2Actor() {}
private:
vtkOpenGL2Actor(const vtkOpenGL2Actor&); // Not implemented.
void operator=(const vtkOpenGL2Actor&); // Not implemented.
};
#endif
......@@ -355,12 +355,12 @@ void vtkVBOPolyDataMapper::SetCameraShaderParameters(vtkRenderer* ren, vtkActor
}
//-----------------------------------------------------------------------------
void vtkVBOPolyDataMapper::SetPropertyShaderParameters(vtkRenderer* vtkNotUsed(ren), vtkActor *actor)
void vtkVBOPolyDataMapper::SetPropertyShaderParameters(vtkRenderer* ren, vtkActor *actor)
{
// Query the actor for some of the properties that can be applied.
float opacity = static_cast<float>(actor->GetProperty()->GetOpacity());
double *aColor = actor->GetProperty()->GetAmbientColor();
double aIntensity = actor->GetProperty()->GetAmbient();
double aIntensity = actor->GetProperty()->GetAmbient(); // ignoring renderer ambient
vtkgl::Vector3ub ambientColor(static_cast<unsigned char>(aColor[0] * aIntensity * 255.0),
static_cast<unsigned char>(aColor[1] * aIntensity * 255.0),
static_cast<unsigned char>(aColor[2] * aIntensity * 255.0));
......
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