Commit 11bec9f2 authored by hrchilds's avatar hrchilds
Browse files

Update from September 2, 2004

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@314 18c085ea-50e0-402c-830e-de6fd14e8384
parent b5d90150
......@@ -89,6 +89,9 @@
# Hank Childs, Thu Aug 19 16:40:07 PDT 2004
# Add reflect2.py to the skipList for SR-mode.
#
# Kathleen Bonnell, Thu Sep 2 16:45:02 PDT 2004
# Removed queryMultiWindow.py from skipList for parallel and
# scalable,parallel.
# ----------------------------------------------------------------------------
# list of users who want email every night with the log file
......@@ -218,9 +221,7 @@ modes="serial parallel scalable,parallel"
# set list of tests/modes to skip
skipList="scalable,parallel:tests/hybrid/lineout.py \
scalable,parallel:tests/rendering/volume.py \
scalable,parallel:tests/operators/reflect2.py \
parallel:tests/queries/queryMultiWindow.py \
scalable,parallel:tests/queries/queryMultiWindow.py"
scalable,parallel:tests/operators/reflect2.py"
# run the test(s)
error=0
......
......@@ -20,11 +20,15 @@
// Added rayPoint1, rayPoint2. Removed domain, zoneNumber, pickLetter,
// pickPoint.
//
// Kathleen Bonnell, Thu Sep 2 13:40:25 PDT 2004
// Added intersectionOnly.
//
// ****************************************************************************
typedef struct PickPointInfo
{
bool validPick;
bool intersectionOnly;
float rayPt1[3];
float rayPt2[3];
void *callbackData;
......
......@@ -11,6 +11,7 @@
#include <vtkRenderer.h>
#include <avtImageMapper.h>
#include <ColorAttribute.h>
// ****************************************************************************
......@@ -305,3 +306,49 @@ avtCustomRenderer::ImmediateModeRenderingOff()
}
// ****************************************************************************
// Method: avtCustomRenderer::SetSpecularProperties
//
// Purpose:
// Sets the specified specular properties.
// This is a stub for derived types.
//
// Arguments:
// <un-named> : true to enable specular, false otherwise
// <un-named> : the new specular coefficient
// <un-named> : the new specular power
// <un-named> : the new specular color
//
// Programmer: Kathleen Bonnell
// Creation: September 2, 2004
//
// ****************************************************************************
void
avtCustomRenderer::SetSpecularProperties(bool , float , float ,
const ColorAttribute &)
{
;
}
// ****************************************************************************
// Method: avtCustomRenderer::SetSurfaceRepresentation
//
// Purpose:
// Set the surface representation to the specified value.
// This is a stub for derived types.
//
// Arguments:
// <un-named> The new surface representation.
//
// Programmer: Kathleen Bonnell
// Creation: September 2, 2004
//
// ****************************************************************************
void
avtCustomRenderer::SetSurfaceRepresentation(int rep)
{
;
}
......@@ -12,6 +12,7 @@
#include <avtDataObject.h>
#include <avtViewInfo.h>
class ColorAttribute;
class vtkDataSet;
class vtkRenderer;
......@@ -42,6 +43,9 @@ typedef void (*OverrideRenderCallback)(void *, avtDataObject_p &);
// Kathleen Bonnell, Mon Aug 4 11:14:22 PDT 2003
// Added member and methods in support of immediate mode rendering.
//
// Kathleen Bonnell, Thu Sep 2 11:44:09 PDT 2004
// Added SetSurfaceRepresentation and SetSpecularProperties.
//
// ****************************************************************************
class PLOTTER_API avtCustomRenderer
......@@ -66,6 +70,11 @@ class PLOTTER_API avtCustomRenderer
virtual void SetImmediateModeRendering(bool);
virtual bool GetImmediateModeRendering(void);
virtual void SetSurfaceRepresentation(int rep);
virtual void SetSpecularProperties(bool,float,float,
const ColorAttribute&);
void RegisterOverrideRenderCallback(
OverrideRenderCallback, void *);
void SetVTKRenderer(vtkRenderer *r);
......
......@@ -463,43 +463,17 @@ avtGeometryDrawable::SetAmbientCoefficient(const float amb)
// Kathleen Bonnell, Sat Oct 19 15:07:04 PDT 2002
// Disable lighting for Wireframe and Points representation.
//
// Kathleen Bonnell, Thu Sep 2 11:44:09 PDT 2004
// Moved logic into avtMapper so that derived mappers may have a chance
// to override the behavior.
//
// ****************************************************************************
void
avtGeometryDrawable::SetSurfaceRepresentation(int rep)
{
for (int i = 0 ; i < nActors ; i++)
{
if (actors[i] != NULL)
{
vtkProperty *prop = actors[i]->GetProperty();
if(prop != NULL)
{
int actorRep = prop->GetRepresentation();
if(rep == 0 && actorRep != VTK_SURFACE)
{
prop->SetRepresentation(VTK_SURFACE);
if (mapper->GetLighting())
{
prop->SetAmbient(mapper->GetGlobalAmbientCoefficient());
prop->SetDiffuse(1.);
}
}
else if(rep == 1 && actorRep != VTK_WIREFRAME)
{
prop->SetRepresentation(VTK_WIREFRAME);
prop->SetAmbient(1.);
prop->SetDiffuse(0.);
}
else if(rep == 2 && actorRep != VTK_POINTS)
{
prop->SetRepresentation(VTK_POINTS);
prop->SetAmbient(1.);
prop->SetDiffuse(0.);
}
}
}
}
if (mapper != NULL)
mapper->SetSurfaceRepresentation(rep);
}
// ****************************************************************************
......@@ -518,6 +492,9 @@ avtGeometryDrawable::SetSurfaceRepresentation(int rep)
// Creation: November 14, 2003
//
// Modifications:
// Kathleen Bonnell, Thu Sep 2 08:52:56 PDT 2004
// Moved logic into avtMapper so that derived mappers may have a chance
// to override the behavior.
//
// ****************************************************************************
......@@ -525,24 +502,8 @@ void
avtGeometryDrawable::SetSpecularProperties(bool flag, float coeff, float power,
const ColorAttribute &color)
{
for (int i = 0 ; i < nActors ; i++)
{
if (actors[i] != NULL)
{
vtkProperty *prop = actors[i]->GetProperty();
if(prop != NULL)
{
prop->SetSpecular(flag ? coeff : 0);
prop->SetSpecularPower(power);
int r = color.Red();
int g = color.Green();
int b = color.Blue();
prop->SetSpecularColor(float(r)/255.,
float(g)/255.,
float(b)/255.);
}
}
}
if (mapper != NULL)
mapper->SetSpecularProperties(flag, coeff, power, color);
}
// ****************************************************************************
......
......@@ -20,6 +20,7 @@
#include <avtGeometryDrawable.h>
#include <avtTransparencyActor.h>
#include <ColorAttribute.h>
#include <BadIndexException.h>
#include <DebugStream.h>
#include <ImproperUseException.h>
......@@ -61,6 +62,9 @@ using std::string;
// Mark C. Miller, Tue May 11 20:21:24 PDT 2004
// Removed extRenderedImagesActor data member
//
// Kathleen Bonnell, Thu Sep 2 11:44:09 PDT 2004
// Initialize specularIsInappropriate.
//
// ****************************************************************************
avtMapper::avtMapper()
......@@ -73,6 +77,7 @@ avtMapper::avtMapper()
transparencyActor = NULL;
transparencyIndex = -1;
globalAmbient = 0.;
specularIsInappropriate = false;
}
......@@ -1021,3 +1026,115 @@ avtMapper::GetImmediateModeRendering()
return immediateMode;
}
// ****************************************************************************
// Method: avtMapper::SetSpecularProperties
//
// Purpose:
// Sets the property's surface representation.
//
// Arguments:
// flag : true to enable specular, false otherwise
// coeff : the new specular coefficient
// power : the new specular power
// color : the new specular color
//
// Programmer: Jeremy Meredith
// Creation: November 14, 2003
//
// Modifications:
// Kathleen Bonnell, Thu Sep 2 08:52:56 PDT 2004
// Moved from avtGeometryDrawable so that derived mappers may override.
// Only set the specular properties when appropriate (eg. only for surface
// renderings.)
//
// ****************************************************************************
void
avtMapper::SetSpecularProperties(bool flag, float coeff, float power,
const ColorAttribute &color)
{
if (specularIsInappropriate)
{
return;
}
for (int i = 0 ; i < nMappers ; i++)
{
if (actors[i] != NULL)
{
vtkProperty *prop = actors[i]->GetProperty();
if(prop != NULL && prop->GetRepresentation() == VTK_SURFACE)
{
prop->SetSpecular(flag ? coeff : 0);
prop->SetSpecularPower(power);
int r = color.Red();
int g = color.Green();
int b = color.Blue();
prop->SetSpecularColor(float(r)/255.,
float(g)/255.,
float(b)/255.);
}
}
}
}
// ****************************************************************************
// Method: avtMapper::SetSurfaceRepresentation
//
// Purpose:
// Sets the drawable's surface representation.
//
// Arguments:
// rep : The new surface representation.
//
// Programmer: Brad Whitlock
// Creation: Mon Sep 23 15:58:48 PST 2002
//
// Modifications:
// Kathleen Bonnell, Sat Oct 19 15:07:04 PDT 2002
// Disable lighting for Wireframe and Points representation.
//
// Kathleen Bonnell, Thu Sep 2 11:44:09 PDT 2004
// Moved from avtGeometryDrawable so that derived mappers may override.
//
// ****************************************************************************
void
avtMapper::SetSurfaceRepresentation(int rep)
{
for (int i = 0 ; i < nMappers ; i++)
{
if (actors[i] != NULL)
{
vtkProperty *prop = actors[i]->GetProperty();
if(prop != NULL)
{
int actorRep = prop->GetRepresentation();
if(rep == 0 && actorRep != VTK_SURFACE)
{
prop->SetRepresentation(VTK_SURFACE);
if (GetLighting())
{
prop->SetAmbient(GetGlobalAmbientCoefficient());
prop->SetDiffuse(1.);
}
}
else if(rep == 1 && actorRep != VTK_WIREFRAME)
{
prop->SetRepresentation(VTK_WIREFRAME);
prop->SetAmbient(1.);
prop->SetDiffuse(0.);
}
else if(rep == 2 && actorRep != VTK_POINTS)
{
prop->SetRepresentation(VTK_POINTS);
prop->SetAmbient(1.);
prop->SetDiffuse(0.);
}
}
}
}
}
......@@ -16,6 +16,7 @@ class vtkDataObjectCollection;
class vtkDataSetMapper;
class avtTransparencyActor;
class ColorAttribute;
// ****************************************************************************
......@@ -60,6 +61,12 @@ class avtTransparencyActor;
// Mark C. Miller Tue May 11 20:21:24 PDT 2004
// Removed extRenderdImagesActor data member and method to set it
//
// Kathleen Bonnell, Thu Sep 2 11:44:09 PDT 2004
// Added specularIsInappropriate to control whether or not specular
// properties get applied. Moved SetSpecularProperties and
// SetSurfaceRepresentation from avtGeometryDrawable so that derived
// mappers may override.
//
// ****************************************************************************
class PLOTTER_API avtMapper : public avtOriginatingDatasetSink
......@@ -86,8 +93,18 @@ class PLOTTER_API avtMapper : public avtOriginatingDatasetSink
int SetTransparencyActor(avtTransparencyActor *);
void SetSpecularIsInappropriate(bool val)
{ specularIsInappropriate = val; };
bool GetSpecularIsInappropriate()
{ return specularIsInappropriate; };
virtual void SetSurfaceRepresentation(int rep);
virtual void SetSpecularProperties(bool,float,float,
const ColorAttribute&);
protected:
bool immediateMode;
bool specularIsInappropriate;
avtDrawable_p drawable;
avtTransparencyActor *transparencyActor;
int transparencyIndex;
......
......@@ -3732,7 +3732,6 @@ avtOpenGLSurfaceAndWireframeRenderer::DrawSurface2()
// how do we draw points
void (*draw0)(vtkCellArray *, GLenum, int &, vtkPoints *, vtkDataArray *,
vtkUnsignedCharArray *, vtkDataArray *);
switch (idx)
{
case 0: draw0 = Draw01; break;
......@@ -4051,12 +4050,15 @@ avtOpenGLSurfaceAndWireframeRenderer::DrawEdges()
// Mark C. Miller, Wed Aug 11 13:38:14 PDT 2004
// Added a code to adjust glDepthRange and reset it upon exit
//
// Kathleen Bonnell, Thu Sep 2 16:15:35 PDT 2004
// Added code to select the glFunction depending upon Representation.
//
// ****************************************************************************
void
avtOpenGLSurfaceAndWireframeRenderer::DrawEdges2()
{
GLenum aGlFunction;
GLenum aGlFunction, glFunction[4];
vtkPoints *p;
vtkCellArray *aPrim;
vtkDataArray *n;
......@@ -4064,6 +4066,35 @@ avtOpenGLSurfaceAndWireframeRenderer::DrawEdges2()
int tDim;
int cellNum = 0;
int cellNormals = 0;
switch (prop->GetRepresentation())
{
case VTK_POINTS:
glFunction[0] = GL_POINTS;
glFunction[1] = GL_POINTS;
glFunction[2] = GL_POINTS;
glFunction[3] = GL_POINTS;
break;
case VTK_WIREFRAME:
glFunction[0] = GL_POINTS;
glFunction[1] = GL_LINE_STRIP;
glFunction[2] = GL_LINE_STRIP;
glFunction[3] = GL_LINE_LOOP;
break;
case VTK_SURFACE:
glFunction[0] = GL_POINTS;
glFunction[1] = GL_LINE_STRIP;
glFunction[2] = GL_LINE_STRIP;
glFunction[3] = GL_LINE_LOOP;
break;
default:
debug5 << "Bad representation sent\n";
glFunction[0] = GL_POINTS;
glFunction[1] = GL_LINE_STRIP;
glFunction[2] = GL_LINE_STRIP;
glFunction[3] = GL_LINE_LOOP;
break;
}
p = input->GetPoints();
......@@ -4122,6 +4153,7 @@ avtOpenGLSurfaceAndWireframeRenderer::DrawEdges2()
// how do we draw points
void (*draw0)(vtkCellArray *, GLenum, int &, vtkPoints *, vtkDataArray *,
vtkUnsignedCharArray *, vtkDataArray *) = NULL;
switch (idx)
{
case 0: draw0 = Draw01; break;
......@@ -4196,7 +4228,7 @@ avtOpenGLSurfaceAndWireframeRenderer::DrawEdges2()
// different lists of primitives. So, we can't rely on GL's
// glPolygonOffset stuff to help us here. Instead, we borrow from
// a trick the VTK folks do in vtkPolyDataMapper, and adjust the
// depth range of the scene using glDepthRange. We then undue this
// depth range of the scene using glDepthRange. We then undo this
// adjustment when we exit this routine. In short, we move the
// maximum Z value toward the viewer 0.01% of the total range in Z.
//
......@@ -4207,7 +4239,7 @@ avtOpenGLSurfaceAndWireframeRenderer::DrawEdges2()
glDepthRange(savedDepthRange[0],savedDepthRange[1]-eps);
aPrim = input->GetVerts();
aGlFunction = GL_POINTS;
aGlFunction = glFunction[0];
// draw all the points
if (draw0)
......@@ -4216,7 +4248,7 @@ avtOpenGLSurfaceAndWireframeRenderer::DrawEdges2()
}
aPrim = input->GetLines();
aGlFunction = GL_LINE_STRIP;
aGlFunction = glFunction[1];
// draw all the elements
if (drawEdgeLines)
......@@ -4230,6 +4262,7 @@ avtOpenGLSurfaceAndWireframeRenderer::DrawEdges2()
// here. Pulled from the normal Draw method. draw2 and draw2W
// compute normals differently.
aPrim = input->GetStrips();
aGlFunction = glFunction[2];
if (drawEdgeStrips)
{
draw2(aPrim, aGlFunction, cellNum, p, n, NULL, t);
......@@ -4241,7 +4274,7 @@ avtOpenGLSurfaceAndWireframeRenderer::DrawEdges2()
// do polys
aPrim = input->GetPolys();
aGlFunction = GL_LINE_LOOP;
aGlFunction = glFunction[3];
if (drawEdgePolys)
{
draw3(aPrim, aGlFunction, cellNum, p, n, NULL, t);
......
......@@ -52,6 +52,9 @@
// Kathleen Bonnell, Tue Aug 26 14:45:31 PDT 2003
// Initialize lastWindowSize.
//
// Kathleen Bonnell, Thu Sep 2 16:24:49 PDT 2004
// Added globalAmbientCoeff and canApplyGlobalRep.
//
// ****************************************************************************
avtSurfaceAndWireframeRenderer::avtSurfaceAndWireframeRenderer()
......@@ -71,6 +74,7 @@ avtSurfaceAndWireframeRenderer::avtSurfaceAndWireframeRenderer()
drawSurfaceVerts = drawSurfaceLines = true;
drawSurfaceStrips = drawSurfacePolys = true;
canApplyGlobalRep = true;
drawEdgeLines = drawEdgeStrips = drawEdgePolys = true;
......@@ -78,6 +82,7 @@ avtSurfaceAndWireframeRenderer::avtSurfaceAndWireframeRenderer()
ignoreLighting = false;
lutColorsChanged = false;
lastWindowSize[0] = lastWindowSize[1] = -1;
globalAmbientCoeff = 0.;
}
......@@ -157,6 +162,10 @@ avtSurfaceAndWireframeRenderer::New(void)
// Programmer: Kathleen Bonnell (thanks to Kitware)
// Creation: August 16, 2001
//
// Modifications:
// Kathleen Bonnell, Thu Sep 2 16:24:49 PDT 2004
// Allow DrawEdges to be called, even if Representation is points.
//
// ****************************************************************************
void
......@@ -182,7 +191,7 @@ avtSurfaceAndWireframeRenderer::Draw()
DrawSurface();
}
if (prop->GetEdgeVisibility() && rep != VTK_POINTS)
if (prop->GetEdgeVisibility())
{
DrawEdges();
}
......@@ -1059,11 +1068,15 @@ avtSurfaceAndWireframeRenderer::GlobalLightingOff()
// Kathleen Bonnell, Wed Aug 14 12:33:59 PDT 2002
// Allow the lighting coefficents to be ignored.
//
// Kathleen Bonnell, Thu Sep 2 16:24:49 PDT 2004
// Set internal globalAmbientCoeff.
//
// ****************************************************************************
void
avtSurfaceAndWireframeRenderer::GlobalSetAmbientCoefficient(const float amb)
{
globalAmbientCoeff = amb;
if (!ignoreLighting)
{
prop->SetAmbient(amb);
......@@ -1111,3 +1124,89 @@ avtSurfaceAndWireframeRenderer::LUTColorsChanged(const bool val)
lutColorsChanged = val;
}
// ****************************************************************************
// Method: avtSurfaceAndWireframeRenderer::SetSpecularProperties
//
// Purpose:
// Sets the drawable's surface representation.
//
// Arguments:
// flag : true to enable specular, false otherwise
// coeff : the new specular coefficient
// power : the new specular power
// color : the new specular color
//
// Programmer: Kathleen Bonnell
// Creation: September 2, 2004
//
// Modifications:
//
// ****************************************************************************
void
avtSurfaceAndWireframeRenderer::SetSpecularProperties(bool flag, float coeff,
float power, const ColorAttribute &color)
{
if (prop != NULL && (drawSurfaceStrips || drawSurfacePolys ||
prop->GetRepresentation() == VTK_SURFACE))
{
prop->SetSpecular(flag ? coeff : 0);
prop->SetSpecularPower(power);
int r = color.Red();
int g = color.Green();
int b = color.Blue();
prop->SetSpecularColor(float(r)/255.,
float(g)/255.,
float(b)/255.);
}
}
// ****************************************************************************
// Method: avtSurfaceAndWireframeRenderer::SetSurfaceRepresentation
//
// Purpose:
// Sets the property's surface representation.
//
// Arguments:
// rep : The new surface representation.
//
// Programmer: Kathleen Bonnell
// Creation: September 2, 2004