Commit 4caaa92f authored by hrchilds's avatar hrchilds
Browse files

Update from November 15, 2006

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@761 18c085ea-50e0-402c-830e-de6fd14e8384
parent d4820b93
/*****************************************************************************
*
* Copyright (c) 2000 - 2006, 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.
*
*****************************************************************************/
// ************************************************************************* //
// avtZoneTypeFilter.C //
// ************************************************************************* //
#include <avtZoneTypeFilter.h>
#include <vtkCellData.h>
#include <vtkDataSet.h>
#include <vtkFloatArray.h>
// ****************************************************************************
// Method: avtZoneTypeFilter constructor
//
// Purpose:
// Defines the constructor. Note: this should not be inlined in the
// header because it causes problems for certain compilers.
//
// Programmer: Mark C. Miller
// Creation: November 15, 2006
//
// ****************************************************************************
avtZoneTypeFilter::avtZoneTypeFilter()
{
;
}
// ****************************************************************************
// Method: avtZoneTypeFilter destructor
//
// Purpose:
// Defines the destructor. Note: this should not be inlined in the header
// because it causes problems for certain compilers.
//
// Programmer: Mark C. Miller
// Creation: November 15, 2006
//
// ****************************************************************************
avtZoneTypeFilter::~avtZoneTypeFilter()
{
;
}
// ****************************************************************************
// Method: avtZoneTypeFilter::DeriveVariable
//
// Purpose:
// Determines the zon type of a cell.
//
// Arguments:
// inDS The input dataset.
//
// Returns: The derived variable. The calling class must free this
// memory.
//
// Programmer: Mark C. Miller
// Creation: November 15, 2006
//
// ****************************************************************************
vtkDataArray *
avtZoneTypeFilter::DeriveVariable(vtkDataSet *in_ds)
{
int i;
int ncells = in_ds->GetNumberOfCells();
vtkFloatArray *rv = vtkFloatArray::New();
rv->SetNumberOfTuples(ncells);
for (i = 0 ; i < ncells ; i++)
{
rv->SetTuple1(i, (float) in_ds->GetCellType(i));
}
return rv;
}
/*****************************************************************************
*
* Copyright (c) 2000 - 2006, 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.
*
*****************************************************************************/
// ************************************************************************* //
// avtZoneTypeFilter.h //
// ************************************************************************* //
#ifndef AVT_ZONETYPE_FILTER_H
#define AVT_ZONETYPE_FILTER_H
#include <avtSingleInputExpressionFilter.h>
class vtkDataArray;
class ArgsExpr;
class ExprPipelineState;
class ConstExpr;
// ****************************************************************************
// Class: avtZoneTypeFilter
//
// Purpose:
// Determines the number of materials in a zone.
//
// Programmer: Mark C. Miller (copied from Hank's NMats filter)
// Creation: November 15, 2006
//
// ****************************************************************************
class EXPRESSION_API avtZoneTypeFilter : public avtSingleInputExpressionFilter
{
public:
avtZoneTypeFilter();
virtual ~avtZoneTypeFilter();
virtual const char *GetType(void) { return "avtZoneTypeFilter"; };
virtual const char *GetDescription(void)
{return "Finding ZoneType";};
protected:
virtual vtkDataArray *DeriveVariable(vtkDataSet *);
virtual bool IsPointVariable(void) { return false; };
};
#endif
......@@ -255,7 +255,8 @@ General_src= \
General/avtSurfaceNormalExpression.C \
General/avtVariableSkewFilter.C \
General/avtVectorComposeFilter.C \
General/avtVectorDecomposeFilter.C
General/avtVectorDecomposeFilter.C \
General/avtZoneTypeFilter.C
ImageProcessing_src= \
ImageProcessing/avtAbelInversionExpression.C \
......
......@@ -120,6 +120,7 @@
#include <avtTestNotEqualToFilter.h>
#include <avtNeighborEvaluatorFilter.h>
#include <avtDataIdFilter.h>
#include <avtZoneTypeFilter.h>
#include <avtExpressionComponentMacro.h>
#include <avtAbelInversionExpression.h>
#include <avtConservativeSmoothingExpression.h>
......@@ -564,6 +565,8 @@ avtFunctionExpr::CreateFilters(ExprPipelineState *state)
f = new avtSpecMFFilter();
else if (functionName == "nmats")
f = new avtNMatsFilter();
else if (functionName == "zonetype")
f = new avtZoneTypeFilter();
else if (functionName == "localized_compactness")
f = new avtLocalizedCompactnessExpression();
else if (functionName == "recenter")
......
......@@ -412,6 +412,9 @@ avtExternallyRenderedImagesActor::GetVisibility(void)
// Programmer: Mark C. Miller
// Creation: February 4, 2003
//
// Modifications:
// Mark C. Miller, Wed Nov 15 23:04:02 PST 2006
// Removed call to SetVisibility to zero
// ****************************************************************************
bool
......@@ -419,7 +422,6 @@ avtExternallyRenderedImagesActor::DisableExternalRenderRequests(void)
{
bool oldMode = makeExternalRenderRequests;
makeExternalRenderRequests = false;
SetVisibility(false);
return oldMode;
}
......@@ -438,6 +440,9 @@ avtExternallyRenderedImagesActor::DisableExternalRenderRequests(void)
// Programmer: Mark C. Miller
// Creation: February 4, 2003
//
// Modifications:
// Mark C. Miller, Wed Nov 15 23:04:02 PST 2006
// Removed call to SetVisibility to one
// ****************************************************************************
bool
......@@ -445,7 +450,6 @@ avtExternallyRenderedImagesActor::EnableExternalRenderRequests(void)
{
bool oldMode = makeExternalRenderRequests;
makeExternalRenderRequests = true;
SetVisibility(true);
return oldMode;
}
......
......@@ -58,7 +58,9 @@
#include <InvalidFilesException.h>
#include <InvalidVariableException.h>
#include <errno.h>
#include <float.h>
#include <stdlib.h>
using std::vector;
using std::string;
......@@ -282,21 +284,40 @@ avtCurve2DFileFormat::PopulateDatabaseMetaData(avtDatabaseMetaData *md)
// Added VALID_XVALUE for case where X but no Y is given at the END of
// a curve specification and interpreted it as a "zone-centered" curve.
// Added logic to re-center curve for the "zone-centered" case
//
// Mark C. Miller, Wed Nov 15 16:24:06 PST 2006
// Deal with possible exception during INVALID_POINT_WARNING. Fix
// lack of suppression of more than 5 lines of errors. Fix possible
// reference to array index -1 when xl.size() or yl.size()==0
// ****************************************************************************
#define INVALID_POINT_WARNING(X) \
{ \
char msg[512] = "Further warnings will be supressed"; \
if (invalidPointCount++ < 6) \
{ \
SNPRINTF(msg, sizeof(msg),"Encountered invalid point " \
"at or near line %d beginning with \"%s\"", \
lineCount, lineName.c_str()); \
char msg[512] = "Further warnings will be supressed"; \
if (invalidPointCount < 6) \
{ \
SNPRINTF(msg, sizeof(msg),"Encountered invalid point " \
"at or near line %d beginning with \"%s\"", \
lineCount, lineName.c_str()); \
} \
TRY \
{ \
if (!avtCallback::IssueWarning(msg)) \
cerr << msg << endl; \
} \
CATCH(VisItException) \
{ \
cerr << msg << endl; \
} \
ENDTRY \
} \
if (!avtCallback::IssueWarning(msg)) \
cerr << msg << endl; \
xl.push_back(X); \
yl.push_back(yl[yl.size()-1]); \
if (yl.size()) \
yl.push_back(yl[yl.size()-1]); \
else \
yl.push_back(X); \
breakpoint_following.push_back(false); \
}
......@@ -408,7 +429,14 @@ avtCurve2DFileFormat::ReadFile(void)
}
case INVALID_POINT:
{
INVALID_POINT_WARNING(xl[xl.size()-1]);
if (xl.size())
{
INVALID_POINT_WARNING(xl[xl.size()-1]);
}
else
{
INVALID_POINT_WARNING(0);
}
break;
}
case VALID_XVALUE:
......@@ -569,6 +597,9 @@ avtCurve2DFileFormat::ReadFile(void)
// Mark C. Miller, Tue Oct 31 20:33:29 PST 2006
// Added code to detect more closely possible errors from strtod.
// Added logic to handle VALID_XVALUE case.
//
// Mark C. Miller, Wed Nov 15 16:24:06 PST 2006
// Reset errno before calling strtod
// ****************************************************************************
CurveToken
......@@ -632,6 +663,7 @@ avtCurve2DFileFormat::GetPoint(ifstream &ifile, float &x, float &y, string &ln)
char *ystr = NULL;
errno = 0;
x = (float) strtod(line, &ystr);
if (((x == 0.0) && (ystr == line)) || (errno == ERANGE))
{
......@@ -651,6 +683,7 @@ avtCurve2DFileFormat::GetPoint(ifstream &ifile, float &x, float &y, string &ln)
ystr++;
char *tmpstr;
errno = 0;
y = (float) strtod(ystr, &tmpstr);
if (((y == 0.0) && (tmpstr == ystr)) || (errno == ERANGE))
{
......
This diff is collapsed.
......@@ -109,6 +109,9 @@
// Hank Childs, Fri Oct 6 15:47:04 PDT 2006
// Added abel_inversion.
//
// Mark C. Miller, Wed Nov 15 12:47:05 PST 2006
// Added zonetype expression
//
// ****************************************************************************
struct ExprNameList
{
......@@ -251,6 +254,7 @@ const char *expr_mesh[] = {
"revolved_volume",
"volume",
"zoneid",
"zonetype",
NULL
};
......
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