Commit 0e815dd9 authored by hrchilds's avatar hrchilds

Update from May 12, 2004

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@241 18c085ea-50e0-402c-830e-de6fd14e8384
parent c357aab0
This diff is collapsed.
Constant: DEFAULT_SCALABLE_THRESHOLD
Declaration: static const int DEFAULT_SCALABLE_THRESHOLD;
Definition: const int RenderingAttributes::DEFAULT_SCALABLE_THRESHOLD = 2000000;
Constant: DEFAULT_SCALABLE_AUTO_THRESHOLD
Declaration: static const int DEFAULT_SCALABLE_AUTO_THRESHOLD;
Definition: const int RenderingAttributes::DEFAULT_SCALABLE_AUTO_THRESHOLD = 2000000;
Constant: DEFAULT_SCALABLE_ACTIVATION_MODE
Declaration: static const int DEFAULT_SCALABLE_ACTIVATION_MODE;
Definition: const int RenderingAttributes::DEFAULT_SCALABLE_ACTIVATION_MODE = Auto;
Function: GetEffectiveScalableThreshold
Declaration: static int GetEffectiveScalableThreshold(TriStateMode mode, int autoThreshold);
Definition:
int RenderingAttributes::GetEffectiveScalableThreshold(TriStateMode mode, int autoThreshold)
{
if (mode == Never)
return INT_MAX;
else if (mode == Always)
return 0;
else if (mode == Auto)
return autoThreshold;
else
return -1;
}
Constant: ModeToThreshold
Declaration: static int ModeToThreshold[3];
Definition: int RenderingAttributes::ModeToThreshold[3] = {DEFAULT_SCALABLE_THRESHOLD, 0, (1<<30)};
......@@ -4,6 +4,7 @@
#include <string>
#include <AttributeSubject.h>
#include <ColorAttribute.h>
#include <float.h>
// ****************************************************************************
// Class: RenderingAttributes
......@@ -14,7 +15,7 @@
// Notes: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Sun May 9 16:06:31 PST 2004
// Creation: Wed May 12 07:29:22 PDT 2004
//
// Modifications:
//
......@@ -35,13 +36,14 @@ public:
Interlaced,
CrystalEyes
};
enum DisplayListMode
enum TriStateMode
{
Never,
Always,
Auto
};
static const int DEFAULT_SCALABLE_THRESHOLD;
static const int DEFAULT_SCALABLE_AUTO_THRESHOLD;
static const int DEFAULT_SCALABLE_ACTIVATION_MODE;
RenderingAttributes();
RenderingAttributes(const RenderingAttributes &obj);
......@@ -63,12 +65,12 @@ public:
// Property setting methods
void SetAntialiasing(bool antialiasing_);
void SetGeometryRepresentation(GeometryRepresentation geometryRepresentation_);
void SetDisplayListMode(DisplayListMode displayListMode_);
void SetDisplayListMode(TriStateMode displayListMode_);
void SetStereoRendering(bool stereoRendering_);
void SetStereoType(StereoTypes stereoType_);
void SetNotifyForEachRender(bool notifyForEachRender_);
void SetScalableRendering(bool scalableRendering_);
void SetScalableThreshold(int scalableThreshold_);
void SetScalableActivationMode(TriStateMode scalableActivationMode_);
void SetScalableAutoThreshold(int scalableAutoThreshold_);
void SetSpecularFlag(bool specularFlag_);
void SetSpecularCoeff(float specularCoeff_);
void SetSpecularPower(float specularPower_);
......@@ -77,12 +79,12 @@ public:
// Property getting methods
bool GetAntialiasing() const;
GeometryRepresentation GetGeometryRepresentation() const;
DisplayListMode GetDisplayListMode() const;
TriStateMode GetDisplayListMode() const;
bool GetStereoRendering() const;
StereoTypes GetStereoType() const;
bool GetNotifyForEachRender() const;
bool GetScalableRendering() const;
int GetScalableThreshold() const;
TriStateMode GetScalableActivationMode() const;
int GetScalableAutoThreshold() const;
bool GetSpecularFlag() const;
float GetSpecularCoeff() const;
float GetSpecularPower() const;
......@@ -104,10 +106,10 @@ public:
protected:
static std::string StereoTypes_ToString(int);
public:
static std::string DisplayListMode_ToString(DisplayListMode);
static bool DisplayListMode_FromString(const std::string &, DisplayListMode &);
static std::string TriStateMode_ToString(TriStateMode);
static bool TriStateMode_FromString(const std::string &, TriStateMode &);
protected:
static std::string DisplayListMode_ToString(int);
static std::string TriStateMode_ToString(int);
public:
// Keyframing methods
......@@ -116,6 +118,8 @@ public:
virtual std::string GetFieldTypeName(int index) const;
virtual bool FieldsEqual(int index, const AttributeGroup *rhs) const;
// User-defined methods
static int GetEffectiveScalableThreshold(TriStateMode mode, int autoThreshold);
private:
bool antialiasing;
int geometryRepresentation;
......@@ -123,8 +127,8 @@ private:
bool stereoRendering;
int stereoType;
bool notifyForEachRender;
bool scalableRendering;
int scalableThreshold;
int scalableActivationMode;
int scalableAutoThreshold;
bool specularFlag;
float specularCoeff;
float specularPower;
......
......@@ -10,7 +10,7 @@
Interlaced
CrystalEyes
</Enum>
<Enum name="DisplayListMode">
<Enum name="TriStateMode">
Never
Always
Auto
......@@ -21,7 +21,7 @@
<Field name="geometryRepresentation" label="geometryRepresentation" type="enum" subtype="GeometryRepresentation">
Surfaces
</Field>
<Field name="displayListMode" label="displayListMode" type="enum" subtype="DisplayListMode">
<Field name="displayListMode" label="displayListMode" type="enum" subtype="TriStateMode">
Auto
</Field>
<Field name="stereoRendering" label="stereoRendering" type="bool">
......@@ -33,10 +33,10 @@
<Field name="notifyForEachRender" label="notifyForEachRender" type="bool">
false
</Field>
<Field name="scalableRendering" label="scalableRendering" type="bool">
false
<Field name="scalableActivationMode" label="scalableActivationMode" type="enum" subtype="TriStateMode">
Auto
</Field>
<Field name="scalableThreshold" label="scalableThreshold" type="int">
<Field name="scalableAutoThreshold" label="scalableAutoThreshold" type="int">
2000000
</Field>
<Field name="specularFlag" label="specularFlag" type="bool">
......@@ -54,6 +54,13 @@
255
255
</Field>
<Constant name="DEFAULT_SCALABLE_THRESHOLD" member="false">
<Function name="GetEffectiveScalableThreshold" user="true" member="true">
</Function>
<Constant name="DEFAULT_SCALABLE_AUTO_THRESHOLD" member="false">
</Constant>
<Constant name="DEFAULT_SCALABLE_ACTIVATION_MODE" member="false">
</Constant>
<Include file="header" quoted="false">
float.h
</Include>
</Attribute>
......@@ -29,6 +29,9 @@
// Mark C. Miller, Thu Dec 19 16:19:23 PST 2002
// Added new data members, extRenderedImagesActor and extRenderedImageId
// Added initialization for transparencyIndex;
//
// Mark C. Miller, Tue May 11 20:21:24 PDT 2004
// Elminated extRenderedImagesActor and extRenderedImageId
// ****************************************************************************
avtActor::avtActor()
......@@ -39,7 +42,6 @@ avtActor::avtActor()
renderer = NULL;
transparencyActor = NULL;
transparencyIndex = -1;
extRenderedImagesActor = NULL;
}
......@@ -618,27 +620,6 @@ avtActor::SetTransparencyActor(avtTransparencyActor *actor)
transparencyIndex = drawable->SetTransparencyActor(transparencyActor);
}
// ****************************************************************************
// Method: avtActor::SetExternallyRenderedImagesActor
//
// Purpose:
// Sets the ERI actor to which this actor must defer rendering requests
//
// Programmer: Mark C. Miller
// Creation: January 9, 2003
//
// ****************************************************************************
void
avtActor::SetExternallyRenderedImagesActor(
avtExternallyRenderedImagesActor *actor)
{
extRenderedImagesActor = actor;
drawable->SetExternallyRenderedImagesActor(actor);
}
// ****************************************************************************
// Method: avtActor::UpdateScaleFactor
//
......
......@@ -16,7 +16,6 @@
class vtkRenderer;
class avtExternallyRenderedImagesActor;
class avtTransparencyActor;
......@@ -70,6 +69,9 @@ class avtTransparencyActor;
// Jeremy Meredith, Fri Nov 14 11:10:53 PST 2003
// Added a method to set the specular properties.
//
// Mark C. Miller, Tue May 11 20:21:24 PDT 2004
// Elminated externally rendered images actor dependence
//
// ****************************************************************************
class PLOTTER_API avtActor
......@@ -101,8 +103,6 @@ class PLOTTER_API avtActor
void VisibilityOn(void);
void VisibilityOff(void);
void SetTransparencyActor(avtTransparencyActor *);
void SetExternallyRenderedImagesActor(
avtExternallyRenderedImagesActor *);
void TurnLightingOn(void);
void TurnLightingOff(void);
......@@ -122,7 +122,6 @@ class PLOTTER_API avtActor
avtDrawable_p decorations;
avtTransparencyActor *transparencyActor;
int transparencyIndex;
avtExternallyRenderedImagesActor *extRenderedImagesActor;
vtkRenderer *renderer;
};
......
......@@ -31,6 +31,9 @@ class avtDecorationsMapper;
// Kathleen Bonnell, Tue Aug 13 15:15:37 PDT 2002
// Added methods in support of lighting.
//
// Mark C. Miller, Tue May 11 20:21:24 PDT 2004
// Removed method to set externally rendered images actor
//
// ****************************************************************************
class PLOTTER_API avtDecorationsDrawable : public avtDrawable
......@@ -50,9 +53,6 @@ class PLOTTER_API avtDecorationsDrawable : public avtDrawable
virtual void VisibilityOff(void);
virtual int SetTransparencyActor(avtTransparencyActor *)
{ return -1; };
virtual void SetExternallyRenderedImagesActor(
avtExternallyRenderedImagesActor *)
{ return; };
virtual void ShiftByVector(const float [3]);
virtual void ScaleByVector(const float [3]);
......
......@@ -14,7 +14,6 @@
class vtkRenderer;
class ColorAttribute;
class avtExternallyRenderedImagesActor;
class avtTransparencyActor;
......@@ -60,6 +59,9 @@ class avtTransparencyActor;
// Moved inlined constructor and destructor definitions to .C files
// because certain compilers have problems with them.
//
// Mark C. Miller, Tue May 11 20:21:24 PDT 2004
// Removed method to SetExternallyRenderedImagesActor
//
// ****************************************************************************
class PLOTTER_API avtDrawable
......@@ -76,8 +78,6 @@ class PLOTTER_API avtDrawable
virtual void VisibilityOn(void) = 0;
virtual void VisibilityOff(void) = 0;
virtual int SetTransparencyActor(avtTransparencyActor*) = 0;
virtual void SetExternallyRenderedImagesActor(
avtExternallyRenderedImagesActor*) = 0;
virtual void ShiftByVector(const float [3]) = 0;
virtual void ScaleByVector(const float [3]) = 0;
......
......@@ -377,32 +377,6 @@ avtGeometryDrawable::SetTransparencyActor(avtTransparencyActor *act)
return rv;
}
// ****************************************************************************
// Method: avtGeometryDrawable::SetExternallyRenderedImagesActor
//
// Purpose:
// Sets the mapper's externally rendered images actor.
//
// Arguments:
// act The ERI actor.
//
// Returns: The id for this actor with the ERI actor.
//
// Programmer: Mark C. Miller
// Creation: January 9, 2003
//
// ****************************************************************************
void
avtGeometryDrawable::SetExternallyRenderedImagesActor(
avtExternallyRenderedImagesActor *act)
{
if (mapper!=NULL)
mapper->SetExternallyRenderedImagesActor(act);
}
// ****************************************************************************
// Method: avtGeometryDrawable::UpdateScaleFactor
//
......
......@@ -54,6 +54,9 @@ class ColorAttribute;
// Jeremy Meredith, Fri Nov 14 11:10:53 PST 2003
// Added a method to set the specular properties.
//
// Mark C. Miller, Tue May 11 20:21:24 PDT 2004
// Removed SetExternallyRenderedImagesActor method
//
// ****************************************************************************
class PLOTTER_API avtGeometryDrawable : public avtDrawable
......@@ -72,8 +75,6 @@ class PLOTTER_API avtGeometryDrawable : public avtDrawable
virtual void VisibilityOn(void);
virtual void VisibilityOff(void);
virtual int SetTransparencyActor(avtTransparencyActor *);
virtual void SetExternallyRenderedImagesActor(
avtExternallyRenderedImagesActor*);
virtual void ShiftByVector(const float [3]);
virtual void ScaleByVector(const float [3]);
......
......@@ -32,6 +32,9 @@ class vtkActor2D;
// Kathleen Bonnell, Tue Aug 13 15:15:37 PDT 2002
// Added methods in support of lighting.
//
// Mark C. Miller, Tue May 11 20:21:24 PDT 2004
// Removed method to set externally rendered images actor
//
// ****************************************************************************
class PLOTTER_API avtImageDrawable : public avtDrawable
......@@ -49,9 +52,6 @@ class PLOTTER_API avtImageDrawable : public avtDrawable
virtual void VisibilityOff(void);
virtual int SetTransparencyActor(avtTransparencyActor*)
{ return -1; };
virtual void SetExternallyRenderedImagesActor(
avtExternallyRenderedImagesActor*)
{ return; };
virtual void ShiftByVector(const float [3]);
virtual void ScaleByVector(const float [3]);
......
......@@ -17,7 +17,6 @@
#include <avtCallback.h>
#include <avtDatasetExaminer.h>
#include <avtExtents.h>
#include <avtExternallyRenderedImagesActor.h>
#include <avtGeometryDrawable.h>
#include <avtTransparencyActor.h>
......@@ -59,6 +58,9 @@ using std::string;
// Added initializiation for transparencyIndex data member to -1
// Added initializations for externally rendered images actor
//
// Mark C. Miller, Tue May 11 20:21:24 PDT 2004
// Removed extRenderedImagesActor data member
//
// ****************************************************************************
avtMapper::avtMapper()
......@@ -70,7 +72,6 @@ avtMapper::avtMapper()
nMappers = 0;
transparencyActor = NULL;
transparencyIndex = -1;
extRenderedImagesActor = NULL;
globalAmbient = 0.;
}
......@@ -835,40 +836,6 @@ avtMapper::SetTransparencyActor(avtTransparencyActor *act)
}
// ****************************************************************************
// Method: avtMapper::SetExternallyRenderedImagesActor
//
// Purpose:
// Sets the externally rendered images actor.
//
// Arguments:
// act The ERI actor. It is associated with a specific
// visualization window and is not owned by this object.
//
// Programmer: Mark C. Miller
// Creation: January 9, 2003
//
// ****************************************************************************
void
avtMapper::SetExternallyRenderedImagesActor(
avtExternallyRenderedImagesActor *act)
{
if (extRenderedImagesActor == act)
{
//
// This is our current ERI actor anyway. No need to do
// anything new.
//
return;
}
extRenderedImagesActor = act;
return;
}
// ****************************************************************************
// Method: avtMapper::GetLighting
//
......
......@@ -15,7 +15,6 @@ class vtkActor;
class vtkDataObjectCollection;
class vtkDataSetMapper;
class avtExternallyRenderedImagesActor;
class avtTransparencyActor;
......@@ -58,6 +57,9 @@ class avtTransparencyActor;
// Added storage for the global Ambient coefficient, and a method
// to retrieve it.
//
// Mark C. Miller Tue May 11 20:21:24 PDT 2004
// Removed extRenderdImagesActor data member and method to set it
//
// ****************************************************************************
class PLOTTER_API avtMapper : public avtOriginatingDatasetSink
......@@ -83,15 +85,12 @@ class PLOTTER_API avtMapper : public avtOriginatingDatasetSink
bool GetImmediateModeRendering();
int SetTransparencyActor(avtTransparencyActor *);
void SetExternallyRenderedImagesActor(
avtExternallyRenderedImagesActor*);
protected:
bool immediateMode;
avtDrawable_p drawable;
avtTransparencyActor *transparencyActor;
int transparencyIndex;
avtExternallyRenderedImagesActor *extRenderedImagesActor;
vtkDataSetMapper **mappers;
int nMappers;
......
......@@ -213,6 +213,9 @@ VisWinPlots::~VisWinPlots()
// Hank Childs, Mon May 10 08:42:32 PDT 2004
// Get the immediate morde rendering info from a different source.
//
// Mark C. Miller, Tue May 11 20:21:24 PDT 2004
// Elminated SetExternallyRenderedImagesActor
//
// ****************************************************************************
void
......@@ -237,7 +240,6 @@ VisWinPlots::AddPlot(avtActor_p &p)
p->Add(mediator.GetCanvas(), mediator.GetForeground());
p->SetTransparencyActor(transparencyActor);
p->SetExternallyRenderedImagesActor(extRenderedImagesActor);
if (mediator.GetFullFrameMode())
{
......
......@@ -84,6 +84,10 @@ bool VisWinRendering::stereoEnabled = false;
// Hank Childs, Mon May 10 08:27:32 PDT 2004
// Initialize displayListMode.
//
// Mark C. Miller, Tue May 11 20:21:24 PDT 2004
// Replaced scalableThreshold member with scalableAutoThreshold
// Added scalableActivationMode member
//
// ****************************************************************************
VisWinRendering::VisWinRendering(VisWindowColleagueProxy &p)
......@@ -109,7 +113,8 @@ VisWinRendering::VisWinRendering(VisWindowColleagueProxy &p)
notifyForEachRender = false;
inMotion = false;
scalableRendering = false;
scalableThreshold = RenderingAttributes::DEFAULT_SCALABLE_THRESHOLD;
scalableAutoThreshold = RenderingAttributes::DEFAULT_SCALABLE_AUTO_THRESHOLD;
scalableActivationMode = RenderingAttributes::DEFAULT_SCALABLE_ACTIVATION_MODE;
canvas = vtkRenderer::New();
canvas->SetInteractive(1);
......@@ -1410,16 +1415,23 @@ VisWinRendering::GetNumTriangles() const
}
// ****************************************************************************
// Method: VisWinRendering::SetScalableRendering
//
// Purpose:
// Sets the scalable rendering mode
// Method: VisWinRendering::GetScalableThreshold
//
// Arguments:
// mode : The new mode
// Programmer: Mark C. Miller
// Creation: May 11, 2004
//
// Return:
// the old mode
// ****************************************************************************
int
VisWinRendering::GetScalableThreshold() const
{
return RenderingAttributes::GetEffectiveScalableThreshold(
(RenderingAttributes::TriStateMode) scalableActivationMode,
scalableAutoThreshold);
}
// ****************************************************************************
// Method: VisWinRendering::SetScalableRendering
//
// Programmer: Mark C. Miller
// Creation: February 5, 2003
......@@ -1439,26 +1451,33 @@ VisWinRendering::SetScalableRendering(bool mode)
}
// ****************************************************************************
// Method: VisWinRendering::SetScalableThreshold
// Method: VisWinRendering::SetScalableAutoThreshold
//
// Purpose:
// Sets the scalable rendering threshold
//
// Arguments:
// threshold: The new threshold
// Programmer: Mark C. Miller
// Creation: May 11, 2004
//
// Return:
// the old threshold
// ****************************************************************************
int
VisWinRendering::SetScalableAutoThreshold(int autoThreshold)
{
int oldVal = scalableAutoThreshold;
scalableAutoThreshold = autoThreshold;
return oldVal;
}
// ****************************************************************************
// Method: VisWinRendering::SetScalableActivationMode
//
// Programmer: Mark C. Miller
// Creation: February 5, 2003
// Creation: May 11, 2004
//
// ****************************************************************************
int
VisWinRendering::SetScalableThreshold(int threshold)
VisWinRendering::SetScalableActivationMode(int mode)
{
int oldVal = scalableThreshold;
scalableThreshold = threshold;
int oldVal = scalableActivationMode;
scalableActivationMode = mode;
return oldVal;
}
......@@ -115,6 +115,11 @@ class VisWindowColleagueProxy;
// Hank Childs, Sun May 9 16:25:27 PDT 2004
// Added IsDirect. Also add support for display list mode.
//
// Mark C. Miller, Tue May 11 20:21:24 PDT 2004
// Added methods to Set/Get scalable activation mode and auto threshold.
// Added data members for same.
// Elminated call to SetScalableThreshold.
//
// ****************************************************************************
class VISWINDOW_API VisWinRendering : public VisWinColleague
......@@ -207,12 +212,16 @@ class VISWINDOW_API VisWinRendering : public VisWinColleague
static void SetStereoEnabled(bool se)
{ stereoEnabled = se; };
int GetScalableThreshold() const;
bool SetScalableRendering(bool mode);
bool GetScalableRendering() const
{ return scalableRendering; };
int SetScalableThreshold(int threshold);
int GetScalableThreshold() const
{ return scalableThreshold; };
int SetScalableActivationMode(int mode);
int GetScalableActivationMode() const
{ return scalableActivationMode; };
int SetScalableAutoThreshold(int threshold);
int GetScalableAutoThreshold() const
{ return scalableAutoThreshold; };
virtual void *CreateToolbar(const char *) { return 0; };
virtual void SetLargeIcons(bool) { };
......@@ -249,7 +258,8 @@ class VISWINDOW_API VisWinRendering : public VisWinColleague
// scalable rendering options
bool scalableRendering;
int scalableThreshold;
int scalableActivationMode;
int scalableAutoThreshold;
void InitializeRenderWindow(vtkRenderWindow *);
void ResetCounters();
......
......@@ -4830,10 +4830,10 @@ VisWindow::GetScalableRendering() const
}
// ****************************************************************************
// Method: VisWindow::SetScalableThreshold
// Method: VisWindow::GetScalableThreshold
//
// Purpose:
// Sets the threshold (and modality) for scalable rendering
// returns scalable rendering threshold
//
// Programmer: Mark C. Miller
// Creation: Tue Dec 3 19:15:37 PST 2002
......@@ -4842,29 +4842,67 @@ VisWindow::GetScalableRendering() const
//
// ****************************************************************************
void
VisWindow::SetScalableThreshold(int threshold)
int
VisWindow::GetScalableThreshold() const
{
rendering->SetScalableThreshold(threshold);
return rendering->GetScalableThreshold();
}
// ****************************************************************************
// Method: VisWindow::GetScalableThreshold
// Method: VisWindow::SetScalableActivationMode
//
// Purpose:
// returns scalable rendering threshold
// Programmer: Mark C. Miller
// Creation: May 11, 2004
//
// ****************************************************************************
void
VisWindow::SetScalableActivationMode(int mode)
{
rendering->SetScalableActivationMode(mode);
}
// ****************************************************************************
// Method: VisWindow::GetScalableActivationMode
//
// Programmer: Mark C. Miller
// Creation: Tue Dec 3 19:15:37 PST 2002
// Creation: May 11, 2004
//
// Modifications:
// ****************************************************************************
int
VisWindow::GetScalableActivationMode() const
{
return rendering->GetScalableActivationMode();
}
// ****************************************************************************
// Method: VisWindow::SetScalableAutoThreshold
//
// Programmer: Mark C. Miller
// Creation: May 11, 2004
//
// ****************************************************************************
void
VisWindow::SetScalableAutoThreshold(int threshold)
{
rendering->SetScalableAutoThreshold(threshold);
}
// ****************************************************************************
// Method: VisWindow::GetScalableAutoThreshold
//
// Programmer: Mark C. Miller
// Creation: May 11, 2004
//
// ****************************************************************************
int
VisWindow::GetScalableThreshold() const
VisWindow::GetScalableAutoThreshold() const
{
return rendering->GetScalableThreshold();
return rendering->GetScalableAutoThreshold();
}