Commit 5ae7939e authored by hrchilds's avatar hrchilds

Update from February 23, 2007

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@816 18c085ea-50e0-402c-830e-de6fd14e8384
parent 8d5df46f
......@@ -56,6 +56,7 @@ class QWidget;
class avtDatabaseMetaData;
class ExpressionList;
class avtPlot;
class ViewerPlot;
// ****************************************************************************
// Class: *PluginInfo
......@@ -126,6 +127,9 @@ class avtPlot;
// Mark Blair, Mon Aug 21 18:29:00 PDT 2006
// Added to information passed to plot wizard when created.
//
// Brad Whitlock, Wed Feb 7 15:53:14 PST 2007
// Added methods for alternate display in the viewer plugin info.
//
// ****************************************************************************
class PLUGIN_API GeneralPlotPluginInfo
......@@ -172,20 +176,23 @@ class PLUGIN_API ViewerPlotPluginInfo : public virtual CommonPlotPluginInfo
virtual avtPlot *AllocAvtPlot() = 0;
virtual void InitializePlotAtts(AttributeSubject *atts,
const avtDatabaseMetaData *,
const char *variableName) = 0;
virtual void ReInitializePlotAtts(AttributeSubject *atts,
const avtDatabaseMetaData *,
const char *variableName) { ; };
virtual void InitializePlotAtts(AttributeSubject *atts, ViewerPlot *) = 0;
virtual void ReInitializePlotAtts(AttributeSubject *atts,
ViewerPlot *) { ; }
virtual void ResetPlotAtts(AttributeSubject *atts,
const avtDatabaseMetaData *md,
const char *variableName) { ; } ;
ViewerPlot *) { ; }
virtual const char **XPMIconData() const { return 0; }
virtual int GetVariableTypes() const = 0;
virtual void *AlternateDisplayCreate(ViewerPlot *plot) { return 0; }
virtual void AlternateDisplayDestroy(void *dpy) {; }
virtual void AlternateDisplayClear(void *dpy) {; }
virtual void AlternateDisplayHide(void *dpy) {; }
virtual void AlternateDisplayShow(void *dpy) {; }
virtual void AlternateDisplayIconify(void *dpy) {; }
virtual void AlternateDisplayDeIconify(void *dpy) {; }
};
class PLUGIN_API EnginePlotPluginInfo : public virtual CommonPlotPluginInfo
......
......@@ -123,20 +123,20 @@ QueryList::WindowType_FromString(const std::string &s, QueryList::WindowType &va
static const char *Groups_strings[] = {
"CurveRelated", "MeshRelated", "PickRelated",
"TimeRelated", "VariableRelated", "ShapeRelated",
"NumGroups"};
"ConnectedComponentsRelated", "NumGroups"};
std::string
QueryList::Groups_ToString(QueryList::Groups t)
{
int index = int(t);
if(index < 0 || index >= 7) index = 0;
if(index < 0 || index >= 8) index = 0;
return Groups_strings[index];
}
std::string
QueryList::Groups_ToString(int t)
{
int index = (t < 0 || t >= 7) ? 0 : t;
int index = (t < 0 || t >= 8) ? 0 : t;
return Groups_strings[index];
}
......@@ -144,7 +144,7 @@ bool
QueryList::Groups_FromString(const std::string &s, QueryList::Groups &val)
{
val = QueryList::CurveRelated;
for(int i = 0; i < 7; ++i)
for(int i = 0; i < 8; ++i)
{
if(s == Groups_strings[i])
{
......@@ -202,7 +202,7 @@ QueryList::QueryMode_FromString(const std::string &s, QueryList::QueryMode &val)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Dec 8 11:41:04 PDT 2006
// Creation: Tue Feb 20 10:37:31 PDT 2007
//
// Modifications:
//
......@@ -221,7 +221,7 @@ QueryList::QueryList() : AttributeSubject("s*i*i*i*i*i*i*i*")
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Dec 8 11:41:04 PDT 2006
// Creation: Tue Feb 20 10:37:31 PDT 2007
//
// Modifications:
//
......@@ -250,7 +250,7 @@ QueryList::QueryList(const QueryList &obj) : AttributeSubject("s*i*i*i*i*i*i*i*"
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Dec 8 11:41:04 PDT 2006
// Creation: Tue Feb 20 10:37:31 PDT 2007
//
// Modifications:
//
......@@ -270,7 +270,7 @@ QueryList::~QueryList()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Dec 8 11:41:04 PDT 2006
// Creation: Tue Feb 20 10:37:31 PDT 2007
//
// Modifications:
//
......@@ -302,7 +302,7 @@ QueryList::operator = (const QueryList &obj)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Dec 8 11:41:04 PDT 2006
// Creation: Tue Feb 20 10:37:31 PDT 2007
//
// Modifications:
//
......@@ -331,7 +331,7 @@ QueryList::operator == (const QueryList &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Dec 8 11:41:04 PDT 2006
// Creation: Tue Feb 20 10:37:31 PDT 2007
//
// Modifications:
//
......@@ -352,7 +352,7 @@ QueryList::operator != (const QueryList &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Dec 8 11:41:04 PDT 2006
// Creation: Tue Feb 20 10:37:31 PDT 2007
//
// Modifications:
//
......@@ -373,7 +373,7 @@ QueryList::TypeName() const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Dec 8 11:41:04 PDT 2006
// Creation: Tue Feb 20 10:37:31 PDT 2007
//
// Modifications:
//
......@@ -401,7 +401,7 @@ QueryList::CopyAttributes(const AttributeGroup *atts)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Dec 8 11:41:04 PDT 2006
// Creation: Tue Feb 20 10:37:31 PDT 2007
//
// Modifications:
//
......@@ -427,7 +427,7 @@ QueryList::CreateCompatible(const std::string &tname) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Dec 8 11:41:04 PDT 2006
// Creation: Tue Feb 20 10:37:31 PDT 2007
//
// Modifications:
//
......@@ -454,7 +454,7 @@ QueryList::NewInstance(bool copy) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Dec 8 11:41:04 PDT 2006
// Creation: Tue Feb 20 10:37:31 PDT 2007
//
// Modifications:
//
......@@ -486,7 +486,7 @@ QueryList::SelectAll()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Dec 8 11:41:04 PDT 2006
// Creation: Tue Feb 20 10:37:31 PDT 2007
//
// Modifications:
//
......@@ -570,7 +570,7 @@ QueryList::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Dec 8 11:41:04 PDT 2006
// Creation: Tue Feb 20 10:37:31 PDT 2007
//
// Modifications:
//
......@@ -831,7 +831,7 @@ QueryList::SelectNumVars()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Dec 8 11:41:04 PDT 2006
// Creation: Tue Feb 20 10:37:31 PDT 2007
//
// Modifications:
//
......@@ -863,7 +863,7 @@ QueryList::GetFieldName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Dec 8 11:41:04 PDT 2006
// Creation: Tue Feb 20 10:37:31 PDT 2007
//
// Modifications:
//
......@@ -895,7 +895,7 @@ QueryList::GetFieldType(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Dec 8 11:41:04 PDT 2006
// Creation: Tue Feb 20 10:37:31 PDT 2007
//
// Modifications:
//
......@@ -927,7 +927,7 @@ QueryList::GetFieldTypeName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Dec 8 11:41:04 PDT 2006
// Creation: Tue Feb 20 10:37:31 PDT 2007
//
// Modifications:
//
......
......@@ -50,7 +50,7 @@
// Notes: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Dec 8 11:41:04 PDT 2006
// Creation: Tue Feb 20 10:37:31 PDT 2007
//
// Modifications:
//
......@@ -87,6 +87,7 @@ public:
TimeRelated,
VariableRelated,
ShapeRelated,
ConnectedComponentsRelated,
NumGroups
};
enum QueryMode
......
......@@ -25,6 +25,7 @@
TimeRelated
VariableRelated
ShapeRelated
ConnectedComponentsRelated
NumGroups
</Enum>
<Enum name="QueryMode">
......
This diff is collapsed.
/*****************************************************************************
*
* Copyright (c) 2000 - 2007, The Regents of the University of California
* Produced at the Lawrence Livermore National Laboratory
* All rights reserved.
*
* This file is part of VisIt. For details, see http://www.llnl.gov/visit/. The
* full copyright notice is contained in the file COPYRIGHT located at the root
* of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the disclaimer (as noted below) in the
* documentation and/or materials provided with the distribution.
* - Neither the name of the UC/LLNL nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OF THE UNIVERSITY OF
* CALIFORNIA, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
*****************************************************************************/
// ************************************************************************* //
// avtConnComponentsExpression.h //
// ************************************************************************* //
#ifndef AVT_CONNECTED_COMPONENTS_EXPRESSION_H
#define AVT_CONNECTED_COMPONENTS_EXPRESSION_H
#include <avtExpressionFilter.h>
class vtkDataArray;
class vtkIntArray;
class vtkDataSet;
class vtkCell;
class avtIntervalTree;
// ****************************************************************************
// Class: avtConnComponentsExpression
//
// Purpose:
// An expression that finds and labels the connected components
// of an unstructured mesh.
//
// Programmer: Cyrus Harrison
// Creation: January 22, 2007
//
//
// ****************************************************************************
class EXPRESSION_API avtConnComponentsExpression : public avtExpressionFilter
{
public:
avtConnComponentsExpression();
virtual ~avtConnComponentsExpression();
virtual const char *GetType(void)
{ return "avtConnComponentsExpression"; };
virtual const char *GetDescription(void)
{return "Finding connected components";};
virtual int NumVariableArguments() { return 1; };
virtual int GetVariableDimension() { return 1; };
virtual bool IsPointVariable(void) { return false; }
virtual int GetNumberOfComponents();
// ************************************************************************
// Class: avtConnComponentsExpression::UnionFind
//
// Purpose:
// Helps efficiently solve the disjoint set union problem.
//
// Programmer: Cyrus Harrison
// Creation: January 23, 2007
//
// ************************************************************************
class UnionFind
{
public:
UnionFind(int,bool);
virtual ~UnionFind();
int Find(int);
void Union(int, int);
bool IsValid(int);
void SetValid(int,bool);
int FinalizeLabels();
int GetFinalLabel(int);
int GetNumberOfFinalLabels();
protected:
std::vector<int> ranks;
std::vector<int> parents;
std::vector<bool> valid;
std::vector<int> finalLabels;
int nFinalLabels;
};
class SpatialPartition;
// ************************************************************************
// Class: avtConnComponentsExpression::BoundarySet
//
// Purpose:
// Provides efficient access to cell intersections across sets.
//
// Programmer: Cyrus Harrison
// Creation: January 25, 2007
//
// ************************************************************************
class BoundarySet
{
public:
BoundarySet();
virtual ~BoundarySet();
void AddMesh(vtkDataSet *);
void Finalize();
void Clear();
vector<vtkDataSet *> GetMeshes() const;
void GetBounds(double *) const;
void GetIntersectionSet(int,
int,
vector<int> &,
vector<int> &) const;
bool GetBoundsIntersection(double *,
double *,
double *) const;
void RelocateUsingPartition(const SpatialPartition &);
protected:
vector<vtkDataSet *> meshes;
vector<avtIntervalTree *> itrees;
bool empty;
double bounds[6];
};
// ************************************************************************
// Class: SpatialPartition
//
// Purpose:
// Finds an efficient way to partition meshes across available
// processors.
//
// Notes: Adapted from Hank Child's avtPosCMFEAlgorithm::SpatialPartition
//
//
// Programmer: Cyrus Harrison
// Creation: February 2, 2007
//
// ************************************************************************
class SpatialPartition
{
public:
SpatialPartition();
virtual ~SpatialPartition();
void CreatePartition(const BoundarySet &,
double *);
void GetProcessorList(vtkCell *,
std::vector<int> &) const;
protected:
avtIntervalTree *itree;
};
protected:
int nFinalComps;
virtual void Execute(void);
virtual vtkIntArray *SingleSetLabel(vtkDataSet *, int &);
virtual int MultiSetResolve(int,
const BoundarySet &,
const vector<vtkDataSet*> &,
const vector<vtkIntArray*> &);
virtual void MultiSetList(int,
const BoundarySet &,
const vector<vtkDataSet*> &,
const vector<vtkIntArray*> &,
vector<int> &,
vector<int> &);
virtual int GlobalLabelShift(int,
const vector<vtkIntArray*> &);
virtual int GlobalResolve(int,
BoundarySet &,
const vector<vtkDataSet*> &,
const vector<vtkIntArray*> &);
virtual int GlobalUnion(int,
const vector<int>&,
const vector<int>&,
const vector<vtkIntArray*> &);
virtual void ShiftLabels(vtkIntArray *, int);
};
#endif
......@@ -189,6 +189,9 @@
# Sean Ahern, Wed Feb 7 18:59:25 EST 2007
# Added avtNormalizeFilter.
#
# Cyrus Harrison, Wed Feb 21 09:34:52 PST 2007
# Added avtConnComponentsExpression
#
##############################################################################
@SET_MAKE@
......@@ -255,6 +258,7 @@ General_src= \
General/avtArrayComposeFilter.C \
General/avtArrayComposeWithBinsFilter.C \
General/avtArrayDecomposeFilter.C \
General/avtConnComponentsExpression.C \
General/avtCurlFilter.C \
General/avtDataIdFilter.C \
General/avtDegreeFilter.C \
......@@ -283,7 +287,8 @@ General_src= \
General/avtVariableSkewFilter.C \
General/avtVectorComposeFilter.C \
General/avtVectorDecomposeFilter.C \
General/avtZoneTypeFilter.C
General/avtZoneTypeFilter.C
ImageProcessing_src= \
ImageProcessing/avtAbelInversionExpression.C \
......
......@@ -146,6 +146,7 @@
#include <avtSymmPointExpression.h>
#include <avtTimeExpression.h>
#include <avtMinMaxExpression.h>
#include <avtConnComponentsExpression.h>
#include <stdio.h>
#include <ExpressionException.h>
......@@ -436,7 +437,10 @@ avtVectorExpr::CreateFilters(ExprPipelineState *state)
//
// Hank Childs, Fri Jan 12 13:45:04 PST 2007
// Added array_compose_with_bins.
//
//
// Cyrus Harrison, Wed Feb 21 09:37:38 PST 2007
// Added conn_components
//
// ****************************************************************************
avtExpressionFilter *
......@@ -560,6 +564,8 @@ avtFunctionExpr::CreateFilters(string functionName)
g->SetDoLogicalGradient(true);
return g;
}
if (functionName == "conn_components")
return new avtConnComponentsExpression();
if (functionName == "gradient")
return new avtGradientFilter();
if (functionName == "curl")
......
......@@ -106,6 +106,12 @@ avtCustomRenderer::SetVTKRenderer(vtkRenderer *r)
}
void
avtCustomRenderer::SetAlternateDisplay(void *)
{
// nothing.
}
// ****************************************************************************
// Method: avtCustomRenderer::SetView
//
......
......@@ -115,6 +115,7 @@ class PLOTTER_API avtCustomRenderer
void RegisterOverrideRenderCallback(
OverrideRenderCallback, void *);
void SetVTKRenderer(vtkRenderer *r);
virtual void SetAlternateDisplay(void *dpy);
protected:
avtViewInfo view;
......
......@@ -150,6 +150,8 @@ class PLOTTER_API avtMapper : public avtOriginatingDatasetSink
virtual bool SetFullFrameScaling(bool, const double *)
{ return false; };
virtual void SetAlternateDisplay(void *) {; }
protected:
bool immediateMode;
bool specularIsInappropriate;
......
......@@ -56,7 +56,6 @@
#include <avtSourceFromAVTDataset.h>
#include <avtSourceFromDataset.h>
#include <avtTerminatingSource.h>
#include <avtTheater.h>
#include <avtVertexNormalsFilter.h>
#include <avtSmoothPolyDataFilter.h>
......@@ -127,7 +126,10 @@
avtPlot::avtPlot()
{
needsRecalculation = true;
behavior = theater.GetBehavior();
actor = new avtActor;
behavior = new avtBehavior;
actor->SetBehavior(behavior);
drawer = NULL;
condenseDatasetFilter = new avtCondenseDatasetFilter;
ghostZoneAndFacelistFilter = new avtGhostZoneAndFacelistFilter;
......@@ -592,6 +594,9 @@ avtPlot::Execute(avtDataObjectReader_p reader)
// Hank Childs, Sun Mar 13 11:13:01 PST 2005
// Fix memory leak.
//
// Brad Whitlock, Wed Feb 7 12:19:17 PDT 2007
// Removed avtThreater.
//
// ****************************************************************************
avtActor_p
......@@ -768,11 +773,13 @@ avtPlot::Execute(avtDataObjectReader_p reader, avtDataObject_p dob)
}
//
// Create a theater that will add behavior to our drawable. Set the
// window mode based on the spatial dimension. Call CustomizeBehavior
// to give the derived types a chance to add legends, etc.
// Add behavior to our drawable. Set the window mode based on the
// spatial dimension. Call CustomizeBehavior to give the derived
// types a chance to add legends, etc.