Commit 1f3d0624 authored by hrchilds's avatar hrchilds
Browse files

Update from May 10, 2004

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@239 18c085ea-50e0-402c-830e-de6fd14e8384
parent ab52cada
......@@ -79,6 +79,44 @@ RenderingAttributes::StereoTypes_FromString(const std::string &s, RenderingAttri
return false;
}
//
// Enum conversion methods for RenderingAttributes::DisplayListMode
//
static const char *DisplayListMode_strings[] = {
"Never", "Always", "Auto"
};
std::string
RenderingAttributes::DisplayListMode_ToString(RenderingAttributes::DisplayListMode t)
{
int index = int(t);
if(index < 0 || index >= 3) index = 0;
return DisplayListMode_strings[index];
}
std::string
RenderingAttributes::DisplayListMode_ToString(int t)
{
int index = (t < 0 || t >= 3) ? 0 : t;
return DisplayListMode_strings[index];
}
bool
RenderingAttributes::DisplayListMode_FromString(const std::string &s, RenderingAttributes::DisplayListMode &val)
{
val = RenderingAttributes::Never;
for(int i = 0; i < 3; ++i)
{
if(s == DisplayListMode_strings[i])
{
val = (DisplayListMode)i;
return true;
}
}
return false;
}
// ****************************************************************************
// Method: RenderingAttributes::RenderingAttributes
//
......@@ -88,18 +126,18 @@ RenderingAttributes::StereoTypes_FromString(const std::string &s, RenderingAttri
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:27 PDT 2003
// Creation: Sun May 9 16:06:31 PST 2004
//
// Modifications:
//
// ****************************************************************************
RenderingAttributes::RenderingAttributes() : AttributeSubject("bibbibbibffa"),
RenderingAttributes::RenderingAttributes() : AttributeSubject("biibibbibffa"),
specularColor(255, 255, 255)
{
antialiasing = false;
geometryRepresentation = Surfaces;
displayLists = true;
displayListMode = Auto;
stereoRendering = false;
stereoType = CrystalEyes;
notifyForEachRender = false;
......@@ -119,17 +157,17 @@ RenderingAttributes::RenderingAttributes() : AttributeSubject("bibbibbibffa"),
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:27 PDT 2003
// Creation: Sun May 9 16:06:31 PST 2004
//
// Modifications:
//
// ****************************************************************************
RenderingAttributes::RenderingAttributes(const RenderingAttributes &obj) : AttributeSubject("bibbibbibffa")
RenderingAttributes::RenderingAttributes(const RenderingAttributes &obj) : AttributeSubject("biibibbibffa")
{
antialiasing = obj.antialiasing;
geometryRepresentation = obj.geometryRepresentation;
displayLists = obj.displayLists;
displayListMode = obj.displayListMode;
stereoRendering = obj.stereoRendering;
stereoType = obj.stereoType;
notifyForEachRender = obj.notifyForEachRender;
......@@ -152,7 +190,7 @@ RenderingAttributes::RenderingAttributes(const RenderingAttributes &obj) : Attri
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:27 PDT 2003
// Creation: Sun May 9 16:06:31 PST 2004
//
// Modifications:
//
......@@ -172,7 +210,7 @@ RenderingAttributes::~RenderingAttributes()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:27 PDT 2003
// Creation: Sun May 9 16:06:31 PST 2004
//
// Modifications:
//
......@@ -183,7 +221,7 @@ RenderingAttributes::operator = (const RenderingAttributes &obj)
{
antialiasing = obj.antialiasing;
geometryRepresentation = obj.geometryRepresentation;
displayLists = obj.displayLists;
displayListMode = obj.displayListMode;
stereoRendering = obj.stereoRendering;
stereoType = obj.stereoType;
notifyForEachRender = obj.notifyForEachRender;
......@@ -206,7 +244,7 @@ RenderingAttributes::operator = (const RenderingAttributes &obj)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:27 PDT 2003
// Creation: Sun May 9 16:06:31 PST 2004
//
// Modifications:
//
......@@ -218,7 +256,7 @@ RenderingAttributes::operator == (const RenderingAttributes &obj) const
// Create the return value
return ((antialiasing == obj.antialiasing) &&
(geometryRepresentation == obj.geometryRepresentation) &&
(displayLists == obj.displayLists) &&
(displayListMode == obj.displayListMode) &&
(stereoRendering == obj.stereoRendering) &&
(stereoType == obj.stereoType) &&
(notifyForEachRender == obj.notifyForEachRender) &&
......@@ -239,7 +277,7 @@ RenderingAttributes::operator == (const RenderingAttributes &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:27 PDT 2003
// Creation: Sun May 9 16:06:31 PST 2004
//
// Modifications:
//
......@@ -260,7 +298,7 @@ RenderingAttributes::operator != (const RenderingAttributes &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:27 PDT 2003
// Creation: Sun May 9 16:06:31 PST 2004
//
// Modifications:
//
......@@ -281,7 +319,7 @@ RenderingAttributes::TypeName() const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:27 PDT 2003
// Creation: Sun May 9 16:06:31 PST 2004
//
// Modifications:
//
......@@ -309,7 +347,7 @@ RenderingAttributes::CopyAttributes(const AttributeGroup *atts)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:27 PDT 2003
// Creation: Sun May 9 16:06:31 PST 2004
//
// Modifications:
//
......@@ -335,7 +373,7 @@ RenderingAttributes::CreateCompatible(const std::string &tname) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:27 PDT 2003
// Creation: Sun May 9 16:06:31 PST 2004
//
// Modifications:
//
......@@ -362,7 +400,7 @@ RenderingAttributes::NewInstance(bool copy) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:27 PDT 2003
// Creation: Sun May 9 16:06:31 PST 2004
//
// Modifications:
//
......@@ -373,7 +411,7 @@ RenderingAttributes::SelectAll()
{
Select(0, (void *)&antialiasing);
Select(1, (void *)&geometryRepresentation);
Select(2, (void *)&displayLists);
Select(2, (void *)&displayListMode);
Select(3, (void *)&stereoRendering);
Select(4, (void *)&stereoType);
Select(5, (void *)&notifyForEachRender);
......@@ -398,7 +436,7 @@ RenderingAttributes::SelectAll()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:27 PDT 2003
// Creation: Sun May 9 16:06:31 PST 2004
//
// Modifications:
//
......@@ -430,7 +468,7 @@ RenderingAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool fo
if(completeSave || !FieldsEqual(2, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("displayLists", displayLists));
node->AddNode(new DataNode("displayListMode", DisplayListMode_ToString(displayListMode)));
}
if(completeSave || !FieldsEqual(3, &defaultObject))
......@@ -508,7 +546,7 @@ RenderingAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool fo
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:27 PDT 2003
// Creation: Sun May 9 16:06:31 PST 2004
//
// Modifications:
//
......@@ -544,8 +582,22 @@ RenderingAttributes::SetFromNode(DataNode *parentNode)
SetGeometryRepresentation(value);
}
}
if((node = searchNode->GetNode("displayLists")) != 0)
SetDisplayLists(node->AsBool());
if((node = searchNode->GetNode("displayListMode")) != 0)
{
// Allow enums to be int or string in the config file
if(node->GetNodeType() == INT_NODE)
{
int ival = node->AsInt();
if(ival >= 0 && ival < 3)
SetDisplayListMode(DisplayListMode(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
DisplayListMode value;
if(DisplayListMode_FromString(node->AsString(), value))
SetDisplayListMode(value);
}
}
if((node = searchNode->GetNode("stereoRendering")) != 0)
SetStereoRendering(node->AsBool());
if((node = searchNode->GetNode("stereoType")) != 0)
......@@ -599,10 +651,10 @@ RenderingAttributes::SetGeometryRepresentation(RenderingAttributes::GeometryRepr
}
void
RenderingAttributes::SetDisplayLists(bool displayLists_)
RenderingAttributes::SetDisplayListMode(RenderingAttributes::DisplayListMode displayListMode_)
{
displayLists = displayLists_;
Select(2, (void *)&displayLists);
displayListMode = displayListMode_;
Select(2, (void *)&displayListMode);
}
void
......@@ -684,10 +736,10 @@ RenderingAttributes::GetGeometryRepresentation() const
return GeometryRepresentation(geometryRepresentation);
}
bool
RenderingAttributes::GetDisplayLists() const
RenderingAttributes::DisplayListMode
RenderingAttributes::GetDisplayListMode() const
{
return displayLists;
return DisplayListMode(displayListMode);
}
bool
......@@ -773,7 +825,7 @@ RenderingAttributes::SelectSpecularColor()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:27 PDT 2003
// Creation: Sun May 9 16:06:31 PST 2004
//
// Modifications:
//
......@@ -786,7 +838,7 @@ RenderingAttributes::GetFieldName(int index) const
{
case 0: return "antialiasing";
case 1: return "geometryRepresentation";
case 2: return "displayLists";
case 2: return "displayListMode";
case 3: return "stereoRendering";
case 4: return "stereoType";
case 5: return "notifyForEachRender";
......@@ -809,7 +861,7 @@ RenderingAttributes::GetFieldName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:27 PDT 2003
// Creation: Sun May 9 16:06:31 PST 2004
//
// Modifications:
//
......@@ -822,7 +874,7 @@ RenderingAttributes::GetFieldType(int index) const
{
case 0: return FieldType_bool;
case 1: return FieldType_enum;
case 2: return FieldType_bool;
case 2: return FieldType_enum;
case 3: return FieldType_bool;
case 4: return FieldType_enum;
case 5: return FieldType_bool;
......@@ -845,7 +897,7 @@ RenderingAttributes::GetFieldType(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:27 PDT 2003
// Creation: Sun May 9 16:06:31 PST 2004
//
// Modifications:
//
......@@ -858,7 +910,7 @@ RenderingAttributes::GetFieldTypeName(int index) const
{
case 0: return "bool";
case 1: return "enum";
case 2: return "bool";
case 2: return "enum";
case 3: return "bool";
case 4: return "enum";
case 5: return "bool";
......@@ -881,7 +933,7 @@ RenderingAttributes::GetFieldTypeName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:27 PDT 2003
// Creation: Sun May 9 16:06:31 PST 2004
//
// Modifications:
//
......@@ -906,7 +958,7 @@ RenderingAttributes::FieldsEqual(int index_, const AttributeGroup *rhs) const
break;
case 2:
{ // new scope
retval = (displayLists == obj.displayLists);
retval = (displayListMode == obj.displayListMode);
}
break;
case 3:
......
......@@ -14,7 +14,7 @@
// Notes: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:27 PDT 2003
// Creation: Sun May 9 16:06:31 PST 2004
//
// Modifications:
//
......@@ -35,6 +35,12 @@ public:
Interlaced,
CrystalEyes
};
enum DisplayListMode
{
Never,
Always,
Auto
};
static const int DEFAULT_SCALABLE_THRESHOLD;
RenderingAttributes();
......@@ -57,7 +63,7 @@ public:
// Property setting methods
void SetAntialiasing(bool antialiasing_);
void SetGeometryRepresentation(GeometryRepresentation geometryRepresentation_);
void SetDisplayLists(bool displayLists_);
void SetDisplayListMode(DisplayListMode displayListMode_);
void SetStereoRendering(bool stereoRendering_);
void SetStereoType(StereoTypes stereoType_);
void SetNotifyForEachRender(bool notifyForEachRender_);
......@@ -71,7 +77,7 @@ public:
// Property getting methods
bool GetAntialiasing() const;
GeometryRepresentation GetGeometryRepresentation() const;
bool GetDisplayLists() const;
DisplayListMode GetDisplayListMode() const;
bool GetStereoRendering() const;
StereoTypes GetStereoType() const;
bool GetNotifyForEachRender() const;
......@@ -98,6 +104,11 @@ public:
protected:
static std::string StereoTypes_ToString(int);
public:
static std::string DisplayListMode_ToString(DisplayListMode);
static bool DisplayListMode_FromString(const std::string &, DisplayListMode &);
protected:
static std::string DisplayListMode_ToString(int);
public:
// Keyframing methods
virtual std::string GetFieldName(int index) const;
......@@ -108,7 +119,7 @@ public:
private:
bool antialiasing;
int geometryRepresentation;
bool displayLists;
int displayListMode;
bool stereoRendering;
int stereoType;
bool notifyForEachRender;
......
<?xml version="1.0"?>
<Attribute name="RenderingAttributes" purpose="This class contains special rendering attributes like antialiasing and stero settings." exportAPI="STATE_API" exportInclude="state_exports.h" codefile="RenderingAttributes.code">
<Constant name="DEFAULT_SCALABLE_THRESHOLD" member="false"></Constant>
<Attribute name="RenderingAttributes" purpose="This class contains special rendering attributes like antialiasing and stero settings." persistent="true" exportAPI="STATE_API" exportInclude="state_exports.h" codefile="RenderingAttributes.code">
<Enum name="GeometryRepresentation">
Surfaces
Wireframe
Points
Surfaces
Wireframe
Points
</Enum>
<Enum name="StereoTypes">
RedBlue
Interlaced
CrystalEyes
RedBlue
Interlaced
CrystalEyes
</Enum>
<Field name="antialiasing" type="bool">false</Field>
<Field name="geometryRepresentation" type="enum" subtype="GeometryRepresentation">Surfaces</Field>
<Field name="displayLists" type="bool">true</Field>
<Field name="stereoRendering" type="bool">false</Field>
<Field name="stereoType" type="enum" subtype="StereoTypes">CrystalEyes</Field>
<Field name="notifyForEachRender" type="bool">false</Field>
<Field name="scalableRendering" type="bool">false</Field>
<Field name="scalableThreshold" type="int">2000000</Field>
<Field name="specularFlag" type="bool">false</Field>
<Field name="specularCoeff" type="float">0.6</Field>
<Field name="specularPower" type="float">10.0</Field>
<Field name="specularColor" type="color">255 255 255 255</Field>
<Enum name="DisplayListMode">
Never
Always
Auto
</Enum>
<Field name="antialiasing" label="antialiasing" type="bool">
false
</Field>
<Field name="geometryRepresentation" label="geometryRepresentation" type="enum" subtype="GeometryRepresentation">
Surfaces
</Field>
<Field name="displayListMode" label="displayListMode" type="enum" subtype="DisplayListMode">
Auto
</Field>
<Field name="stereoRendering" label="stereoRendering" type="bool">
false
</Field>
<Field name="stereoType" label="stereoType" type="enum" subtype="StereoTypes">
CrystalEyes
</Field>
<Field name="notifyForEachRender" label="notifyForEachRender" type="bool">
false
</Field>
<Field name="scalableRendering" label="scalableRendering" type="bool">
false
</Field>
<Field name="scalableThreshold" label="scalableThreshold" type="int">
2000000
</Field>
<Field name="specularFlag" label="specularFlag" type="bool">
false
</Field>
<Field name="specularCoeff" label="specularCoeff" type="float">
0.600000
</Field>
<Field name="specularPower" label="specularPower" type="float">
10.000000
</Field>
<Field name="specularColor" label="specularColor" type="color">
255
255
255
255
</Field>
<Constant name="DEFAULT_SCALABLE_THRESHOLD" member="false">
</Constant>
</Attribute>
......@@ -210,6 +210,9 @@ VisWinPlots::~VisWinPlots()
// Jeremy Meredith, Fri Nov 14 17:56:24 PST 2003
// Added specular properties.
//
// Hank Childs, Mon May 10 08:42:32 PDT 2004
// Get the immediate morde rendering info from a different source.
//
// ****************************************************************************
void
......@@ -306,7 +309,8 @@ VisWinPlots::AddPlot(avtActor_p &p)
//
// Ensure that the new plot has the right immediate mode rendering flag.
//
p->SetImmediateModeRendering(mediator.GetImmediateModeRendering());
VisWindow *vw = mediator;
p->SetImmediateModeRendering(vw->GetImmediateModeRendering());
mediator.UpdatePlotList(plots);
......
......@@ -81,6 +81,9 @@ bool VisWinRendering::stereoEnabled = false;
// Jeremy Meredith, Fri Nov 14 11:29:05 PST 2003
// Added specular properties.
//
// Hank Childs, Mon May 10 08:27:32 PDT 2004
// Initialize displayListMode.
//
// ****************************************************************************
VisWinRendering::VisWinRendering(VisWindowColleagueProxy &p)
......@@ -95,7 +98,7 @@ VisWinRendering::VisWinRendering(VisWindowColleagueProxy &p)
minRenderTime = 1.e6;
stereo = false;
stereoType = 2;
immediateMode = false;
displayListMode = 2; // Auto
surfaceRepresentation = 0;
specularFlag = false;
specularCoeff = .6;
......@@ -834,6 +837,24 @@ VisWinRendering::SetSize(int w, int h)
}
}
// ****************************************************************************
// Method: VisWinRendering::IsDirect
//
// Purpose:
// Determines if the vis window is direct connection to the GPU or if it
// goes through the X-server.
//
// Programmer: Hank Childs
// Creation: May 9, 2004
//
// ****************************************************************************
bool
VisWinRendering::IsDirect(void)
{
return (GetRenderWindow()->IsDirect() ? true : false);
}
// ****************************************************************************
// Method: VisWinRendering::GetSize
//
......@@ -1257,26 +1278,23 @@ VisWinRendering::SetStereoRendering(bool enabled, int type)
}
// ****************************************************************************
// Method: VisWinRendering::SetImmediateModeRendering
// Method: VisWinRendering::SetDisplayListMode
//
// Purpose:
// Sets the immediate rendering mode for all of the actors in the canvas
// renderer.
// Sets the display list mode.
//
// Arguments:
// mode : The new immediate rendering mode.
// mode : The new display list mode.
//
// Programmer: Brad Whitlock
// Creation: Mon Sep 23 14:26:10 PST 2002
// Programmer: Hank Childs
// Creation: May 10, 2004
//
// Modifications:
//
// ****************************************************************************
void
VisWinRendering::SetImmediateModeRendering(bool mode)
VisWinRendering::SetDisplayListMode(int mode)
{
immediateMode = mode;
displayListMode = mode;
}
// ****************************************************************************
......
......@@ -112,6 +112,9 @@ class VisWindowColleagueProxy;
// Mark C. Miller, Wed Mar 31 17:47:20 PST 2004
// Added doViewportOnly bool argument to ScreenCapture method
//
// Hank Childs, Sun May 9 16:25:27 PDT 2004
// Added IsDirect. Also add support for display list mode.
//
// ****************************************************************************
class VISWINDOW_API VisWinRendering : public VisWinColleague
......@@ -160,6 +163,7 @@ class VISWINDOW_API VisWinRendering : public VisWinColleague
bool GetRealized() {return realized;};
bool IsDirect(void);
vtkRenderer *GetFirstRenderer(void);
virtual void SetResizeEvent(void(*callback)(void *), void *) = 0;
......@@ -178,9 +182,9 @@ class VISWINDOW_API VisWinRendering : public VisWinColleague
{ return stereo; };
int GetStereoType() const
{ return stereoType; };
void SetImmediateModeRendering(bool mode);
bool GetImmediateModeRendering() const
{ return immediateMode; };
void SetDisplayListMode(int mode);
int GetDisplayListMode() const
{ return displayListMode; };
virtual void SetSurfaceRepresentation(int rep);
int GetSurfaceRepresentation() const
{ return surfaceRepresentation; };
......@@ -223,7 +227,7 @@ class VISWINDOW_API VisWinRendering : public VisWinColleague
bool antialiasing;
bool stereo;
int stereoType;
bool immediateMode;
int displayListMode;
int surfaceRepresentation;
bool specularFlag;
float specularCoeff;
......@@ -248,7 +252,6 @@ class VISWINDOW_API VisWinRendering : public VisWinColleague
int scalableThreshold;
void InitializeRenderWindow(vtkRenderWindow *);
void UpdateImmediateMode(bool mode);
void ResetCounters();
virtual vtkRenderWindow *GetRenderWindow(void) = 0;
......
......@@ -71,6 +71,8 @@
// Kathleen Bonnell, Wed Dec 3 16:49:14 PST 2003
// Added 'ReAddtoolsToRenderWindow'.