Commit 33072344 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit Committed by Kitware Robot
Browse files

Merge topic 'update_vtk_master' into pv-master

6e9be2bf Merge topic 'update_vtk_master' into master
f7f82536 Fixed regression introduced by a6fa3e37.
f81dd42f Merge topic '0012114-fix-getarrayindex-documentation' into master
7915505c Merge topic 'vtkFLUENTReader_array_indexing_12683' into master
0a2836c7 Fix off by one error in vtkFLUENTReader::GetCellsAscii().
736a4ade BUG:0012144 correct the documentation for GetArrayIndex
2193b802 Merge topic 'clear-std-isfinite' into master
f1760ede COMP: Clear VTK_HAS_STD_ISFINITE and related variables.
5239d41d Merge topic 'more-register' into master
c4b4eb3b Merge topic 'std-isfinite-detection' into master
0c41fe46 Merge topic 'coordinates_in_tooltip' into master
3e490c8c Removed deprecated and useless 'register' keyword
a9abb469 add row/column info to tooltip
f808e0c6 14164: Fix incorrectly set VTK_HAS_STD_ISFINITE variable.
c5f21d95 Merge topic 'update-kwsys' into master
3d6e5ff5 Merge branch 'upstream-kwsys' into update-kwsys
...
parents 47118393 6e9be2bf
# - Check if a C++ function exists
# CHECK_CXX_EXPRESSION_COMPILES(<expression> <files> <variable>)
#
# Check that the <expression> compiles in a program that includes
# <files> and store the result in a <variable>. Specify the list
# of files in one argument as a semicolon-separated list.
#
# The following variables may be set before calling this macro to
# modify the way the check is run:
#
# CMAKE_REQUIRED_FLAGS = string of compile command line flags
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
# CMAKE_REQUIRED_INCLUDES = list of include directories
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
#=============================================================================
# Copyright 2003-2011 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
INCLUDE(CheckCXXSourceCompiles)
MACRO(CHECK_CXX_EXPRESSION_COMPILES EXPRESSION FILES VARIABLE)
SET(SOURCE "/* CHECK_CXX_EXPRESSION_COMPILES */\n")
FOREACH(FILE ${FILES})
SET(SOURCE "${SOURCE}#include <${FILE}>\n")
ENDFOREACH(FILE ${FILES})
SET(SOURCE "${SOURCE}\nint main()\n{\n")
SET(SOURCE "${SOURCE} static_cast<void>(${EXPRESSION});\n\n")
SET(SOURCE "${SOURCE} return 0;\n}\n")
CHECK_CXX_SOURCE_COMPILES("${SOURCE}" "${VARIABLE}")
ENDMACRO(CHECK_CXX_EXPRESSION_COMPILES)
......@@ -311,13 +311,17 @@ foreach(t Int8 Int16 Int32 Int64 UInt8 UInt16 UInt32 UInt64 Float32 Float64)
endforeach()
# look for various headers and functions
include(CheckCXXExpressionCompiles)
include(CheckSymbolExists)
include(CheckIncludeFile)
# Check C++ <cmath> first, where the C++11 standard says these must be.
check_symbol_exists(std::isnan "cmath" VTK_HAS_STD_ISNAN)
check_symbol_exists(std::isinf "cmath" VTK_HAS_STD_ISINF)
check_symbol_exists(std::isfinite "cmath" VTK_HAS_STD_ISFINITE)
unset(VTK_HAS_STD_ISNAN CACHE)
unset(VTK_HAS_STD_ISINF CACHE)
unset(VTK_HAS_STD_ISFINITE CACHE)
check_cxx_expression_compiles("std::isnan(0.0)" "cmath" VTK_HAS_STD_ISNAN)
check_cxx_expression_compiles("std::isinf(0.0)" "cmath" VTK_HAS_STD_ISINF)
check_cxx_expression_compiles("std::isfinite(0.0)" "cmath" VTK_HAS_STD_ISFINITE)
# Check C99 <math.h> next, where the C99 standard says these must be.
# (they will be found even if they are defined as macros)
......
......@@ -75,7 +75,7 @@ public:
const char* GetArrayName(int index);
// Description:
// Get an index of the array containing name within the enabled arrays
// Get an index of the array with the given name.
int GetArrayIndex(const char *name);
// Description:
......
......@@ -1245,8 +1245,11 @@ inline double vtkMath::ClampAndNormalizeValue(double value,
#define VTK_MATH_ISINF_IS_INLINE
inline int vtkMath::IsInf(double x)
{
using namespace std; // Could be isinf() or std::isinf()
#if defined(VTK_HAS_STD_ISINF)
return std::isinf(x);
#else
return (isinf(x) != 0); // Force conversion to bool
#endif
}
#endif
......@@ -1255,8 +1258,11 @@ inline int vtkMath::IsInf(double x)
#define VTK_MATH_ISNAN_IS_INLINE
inline int vtkMath::IsNan(double x)
{
using namespace std; // Could be isnan() or std::isnan()
#if defined(VTK_HAS_STD_ISNAN)
return std::isnan(x);
#else
return (isnan(x) != 0); // Force conversion to bool
#endif
}
#endif
......@@ -1265,8 +1271,9 @@ inline int vtkMath::IsNan(double x)
#define VTK_MATH_ISFINITE_IS_INLINE
inline bool vtkMath::IsFinite(double x)
{
#if defined(VTK_HAS_ISFINITE) || defined(VTK_HAS_STD_ISFINITE)
using namespace std; // Could be isfinite() or std::isfinite()
#if defined(VTK_HAS_STD_ISFINITE)
return std::isfinite(x);
#elif defined(VTK_HAS_ISFINITE)
return (isfinite(x) != 0); // Force conversion to bool
#else
return (finite(x) != 0); // Force conversion to bool
......
......@@ -767,12 +767,6 @@ vtkTree* vtkRAdapter::RToVTKTree(SEXP variable)
vtkNew<vtkDoubleArray> nodeWeights;
nodeWeights->SetNumberOfTuples(tree->GetNumberOfVertices());
// trueWeights is (for the most part) a duplicate of nodeWeights.
// The only difference is that leaf nodes aren't clamped to the max
// weight in this array.
vtkNew<vtkDoubleArray> trueWeights;
trueWeights->SetNumberOfTuples(tree->GetNumberOfVertices());
double maxWeight = 0.0;
vtkNew<vtkTreeDFSIterator> treeIterator;
treeIterator->SetStartVertex(tree->GetRoot());
......@@ -787,28 +781,12 @@ vtkTree* vtkRAdapter::RToVTKTree(SEXP variable)
weight = weights->GetValue(tree->GetEdgeId(parent, vertex));
}
weight += nodeWeights->GetValue(parent);
if (weight > maxWeight)
{
maxWeight = weight;
}
nodeWeights->SetValue(vertex, weight);
trueWeights->SetValue(vertex, weight);
}
for (vtkIdType vertex = 0; vertex < tree->GetNumberOfVertices(); ++vertex)
{
if (tree->IsLeaf(vertex))
{
nodeWeights->SetValue(vertex, maxWeight);
}
}
nodeWeights->SetName("node weight");
tree->GetVertexData()->AddArray(nodeWeights.GetPointer());
trueWeights->SetName("true node weight");
tree->GetVertexData()->AddArray(trueWeights.GetPointer());
this->vdoc->AddItem(tree);
tree->Delete();
return tree;
......
......@@ -2666,7 +2666,7 @@ void vtkFLUENTReader::GetCellsAscii()
vtksys_ios::stringstream pdatastream(pdata);
for (int i = firstIndex; i <=lastIndex; i++)
{
pdatastream >> this->Cells->value[i].type;
pdatastream >> this->Cells->value[i-1].type;
this->Cells->value[i-1].zone = zoneId;
this->Cells->value[i-1].parent = 0;
this->Cells->value[i-1].child = 0;
......
......@@ -420,9 +420,9 @@ int vtkMoleculeReaderBase::MakeBonds(vtkPoints *newPts,
vtkIdTypeArray *atype,
vtkCellArray *newBonds)
{
register int i, j, k;
register int nbonds;
register double dx, dy, dz;
int i, j, k;
int nbonds;
double dx, dy, dz;
double max, dist, radius;
double X[3], Y[3];
vtkIdType bond[2];
......
......@@ -133,14 +133,7 @@ int vtkNewickTreeReader:: ReadNewickTree( char * const buffer, vtkTree & tree)
vtkNew<vtkDoubleArray> nodeWeights;
nodeWeights->SetNumberOfTuples(tree.GetNumberOfVertices());
// trueWeights is (for the most part) a duplicate of nodeWeights.
// The only difference is that leaf nodes aren't clamped to the max
// weight in this array.
vtkNew<vtkDoubleArray> trueWeights;
trueWeights->SetNumberOfTuples(tree.GetNumberOfVertices());
//set node weights
double maxWeight = 0.0;
vtkNew<vtkTreeDFSIterator> treeIterator;
treeIterator->SetStartVertex(tree.GetRoot());
treeIterator->SetTree(&tree);
......@@ -154,28 +147,12 @@ int vtkNewickTreeReader:: ReadNewickTree( char * const buffer, vtkTree & tree)
weight = weights->GetValue(tree.GetEdgeId(parent, vertex));
weight += nodeWeights->GetValue(parent);
}
if (weight > maxWeight)
{
maxWeight = weight;
}
nodeWeights->SetValue(vertex, weight);
trueWeights->SetValue(vertex, weight);
}
for (vtkIdType vertex = 0; vertex < tree.GetNumberOfVertices(); ++vertex)
{
if (tree.IsLeaf(vertex))
{
nodeWeights->SetValue(vertex, maxWeight);
}
}
nodeWeights->SetName("node weight");
tree.GetVertexData()->AddArray(nodeWeights.GetPointer());
trueWeights->SetName("true node weight");
tree.GetVertexData()->AddArray(trueWeights.GetPointer());
return 1;
}
......
......@@ -482,7 +482,12 @@ void vtkInteractorStyleImage::WindowLevel()
this->WindowLevelCurrentPosition[0] = rwi->GetEventPosition()[0];
this->WindowLevelCurrentPosition[1] = rwi->GetEventPosition()[1];
if (this->CurrentImageProperty)
if (this->HandleObservers &&
this->HasObserver(vtkCommand::WindowLevelEvent))
{
this->InvokeEvent(vtkCommand::WindowLevelEvent, this);
}
else if (this->CurrentImageProperty)
{
int *size = this->CurrentRenderer->GetSize();
......@@ -541,10 +546,6 @@ void vtkInteractorStyleImage::WindowLevel()
this->Interactor->Render();
}
else
{
this->InvokeEvent(vtkCommand::WindowLevelEvent, this);
}
}
//----------------------------------------------------------------------------
......
......@@ -19,7 +19,7 @@
// vtkMatplotlib module).
#ifndef __vtkMathTextUtilities_h
#define __vtkMathTypeUtilities_h
#define __vtkMathTextUtilities_h
#include "vtkRenderingFreeTypeModule.h" // For export macro
#include "vtkObject.h"
......
......@@ -1628,7 +1628,15 @@ void vtkWin32OpenGLRenderWindow::ResumeScreenRendering(void)
if(this->ContextId!=0)
{
this->MakeCurrent();
this->CleanUpRenderers();
// Renderers will need to redraw anything cached in display lists
vtkRenderer *ren;
vtkCollectionSimpleIterator rsit;
for (this->Renderers->InitTraversal(rsit);
(ren = this->Renderers->GetNextRenderer(rsit));)
{
ren->SetRenderWindow(NULL);
ren->SetRenderWindow(this);
}
}
this->Mapped = this->ScreenMapped;
......
......@@ -26,7 +26,6 @@
#include "vtkPiecewiseFunction.h"
#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
#include "vtkTrivialProducer.h"
#include "vtkVolume.h"
#include "vtkVolumeProperty.h"
#include "vtkVolumeTextureMapper3D.h"
......@@ -528,10 +527,7 @@ void vtkSmartVolumeMapper::ConnectMapperInput(vtkVolumeMapper *m)
// make sure we not create a shallow copy each time to avoid
// performance penalty.
input2=vtkImageData::New();
vtkTrivialProducer* tp = vtkTrivialProducer::New();
tp->SetOutput(input2);
m->SetInputConnection(tp->GetOutputPort());
tp->Delete();
m->SetInputDataObject(input2);
input2->Delete();
needShallowCopy=true;
}
......@@ -557,7 +553,7 @@ void vtkSmartVolumeMapper::ConnectFilterInput(vtkImageResample *f)
// make sure we not create a shallow copy each time to avoid
// performance penalty.
input2=vtkImageData::New();
f->SetInputConnection(f->GetInputConnection(0, 0));
f->SetInputDataObject(input2);
input2->Delete();
needShallowCopy=true;
}
......
......@@ -569,8 +569,17 @@ IF(KWSYS_USE_SystemTools)
"Checking whether CXX compiler has unsetenv" DIRECT)
KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H
"Checking whether CXX compiler has environ in stdlib.h" DIRECT)
SET_SOURCE_FILES_PROPERTIES(SystemTools.cxx PROPERTIES
COMPILE_FLAGS "-DKWSYS_CXX_HAS_SETENV=${KWSYS_CXX_HAS_SETENV} -DKWSYS_CXX_HAS_UNSETENV=${KWSYS_CXX_HAS_UNSETENV} -DKWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H=${KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H}")
KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_UTIMES
"Checking whether CXX compiler has utimes" DIRECT)
KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_UTIMENSAT
"Checking whether CXX compiler has utimensat" DIRECT)
SET_PROPERTY(SOURCE SystemTools.cxx APPEND PROPERTY COMPILE_DEFINITIONS
KWSYS_CXX_HAS_SETENV=${KWSYS_CXX_HAS_SETENV}
KWSYS_CXX_HAS_UNSETENV=${KWSYS_CXX_HAS_UNSETENV}
KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H=${KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H}
KWSYS_CXX_HAS_UTIMES=${KWSYS_CXX_HAS_UTIMES}
KWSYS_CXX_HAS_UTIMENSAT=${KWSYS_CXX_HAS_UTIMENSAT}
)
ENDIF()
IF(KWSYS_USE_SystemInformation)
......
......@@ -44,7 +44,7 @@ struct CommandLineArgumentsCallbackStructure;
*
* For the variable interface you associate variable with each argument. When
* the argument is specified, the variable is set to the specified value casted
* to the apropriate type. For boolean (NO_ARGUMENT), the value is "1".
* to the appropriate type. For boolean (NO_ARGUMENT), the value is "1".
*
* Both interfaces can be used at the same time.
*
......@@ -99,7 +99,7 @@ public:
STRING_TYPE, // The variable is string (char*)
STL_STRING_TYPE, // The variable is string (char*)
VECTOR_INT_TYPE, // The variable is integer (int)
VECTOR_BOOL_TYPE, // The vairable is boolean (bool)
VECTOR_BOOL_TYPE, // The variable is boolean (bool)
VECTOR_DOUBLE_TYPE, // The variable is float (double)
VECTOR_STRING_TYPE, // The variable is string (char*)
VECTOR_STL_STRING_TYPE, // The variable is string (char*)
......@@ -128,7 +128,7 @@ public:
void ProcessArgument(const char* arg);
/**
* This method will parse arguments and call apropriate methods.
* This method will parse arguments and call appropriate methods.
*/
int Parse();
......@@ -144,7 +144,7 @@ public:
/**
* Add handler for argument which is going to set the variable to the
* specified value. If the argument is specified, the option is casted to the
* apropriate type.
* appropriate type.
*/
void AddArgument(const char* argument, ArgumentTypeEnum type,
bool* variable, const char* help);
......@@ -160,7 +160,7 @@ public:
/**
* Add handler for argument which is going to set the variable to the
* specified value. If the argument is specified, the option is casted to the
* apropriate type. This will handle the multi argument values.
* appropriate type. This will handle the multi argument values.
*/
void AddArgument(const char* argument, ArgumentTypeEnum type,
kwsys_stl::vector<bool>* variable, const char* help);
......
......@@ -47,6 +47,12 @@ do.
*/
#if defined(__CYGWIN__)
/* Increase the file descriptor limit for select() before including
related system headers. (Default: 64) */
# define FD_SETSIZE 16384
#endif
#include <stddef.h> /* ptrdiff_t */
#include <stdio.h> /* snprintf */
#include <stdlib.h> /* malloc, free */
......
......@@ -312,8 +312,8 @@ static char* regbranch (int*);
static char* regpiece (int*);
static char* regatom (int*);
static char* regnode (char);
static const char* regnext (register const char*);
static char* regnext (register char*);
static const char* regnext (const char*);
static char* regnext (char*);
static void regc (char);
static void reginsert (char, char*);
static void regtail (char*, const char*);
......@@ -344,10 +344,10 @@ static int strcspn ();
// for later pattern matching.
bool RegularExpression::compile (const char* exp) {
register const char* scan;
register const char* longest;
register size_t len;
int flags;
const char* scan;
const char* longest;
size_t len;
int flags;
if (exp == 0) {
//RAISE Error, SYM(RegularExpression), SYM(No_Expr),
......@@ -444,11 +444,11 @@ bool RegularExpression::compile (const char* exp) {
* follows makes it hard to avoid.
*/
static char* reg (int paren, int *flagp) {
register char* ret;
register char* br;
register char* ender;
register int parno =0;
int flags;
char* ret;
char* br;
char* ender;
int parno =0;
int flags;
*flagp = HASWIDTH; // Tentatively.
......@@ -525,10 +525,10 @@ static char* reg (int paren, int *flagp) {
* Implements the concatenation operator.
*/
static char* regbranch (int *flagp) {
register char* ret;
register char* chain;
register char* latest;
int flags;
char* ret;
char* chain;
char* latest;
int flags;
*flagp = WORST; // Tentatively.
......@@ -562,10 +562,10 @@ static char* regbranch (int *flagp) {
* endmarker role is not redundant.
*/
static char* regpiece (int *flagp) {
register char* ret;
register char op;
register char* next;
int flags;
char* ret;
char op;
char* next;
int flags;
ret = regatom(&flags);
if (ret == 0)
......@@ -631,8 +631,8 @@ static char* regpiece (int *flagp) {
* separate node; the code is simpler that way and it's not worth fixing.
*/
static char* regatom (int *flagp) {
register char* ret;
int flags;
char* ret;
int flags;
*flagp = WORST; // Tentatively.
......@@ -648,8 +648,8 @@ static char* regatom (int *flagp) {
*flagp |= HASWIDTH | SIMPLE;
break;
case '[':{
register int rxpclass;
register int rxpclassend;
int rxpclass;
int rxpclassend;
if (*regparse == '^') { // Complement of range.
ret = regnode(ANYBUT);
......@@ -720,8 +720,8 @@ static char* regatom (int *flagp) {
*flagp |= HASWIDTH | SIMPLE;
break;
default:{
register int len;
register char ender;
int len;
char ender;
regparse--;
len = int(strcspn(regparse, META));
......@@ -754,8 +754,8 @@ static char* regatom (int *flagp) {
Location.
*/
static char* regnode (char op) {
register char* ret;
register char* ptr;
char* ret;
char* ptr;
ret = regcode;
if (ret == &regdummy) {
......@@ -790,9 +790,9 @@ static void regc (char b) {
* Means relocating the operand.
*/
static void reginsert (char op, char* opnd) {
register char* src;
register char* dst;
register char* place;
char* src;
char* dst;
char* place;
if (regcode == &regdummy) {
regsize += 3;
......@@ -816,9 +816,9 @@ static void reginsert (char op, char* opnd) {
- regtail - set the next-pointer at the end of a node chain
*/
static void regtail (char* p, const char* val) {
register char* scan;
register char* temp;
register int offset;
char* scan;
char* temp;
int offset;
if (p == &regdummy)
return;
......@@ -893,7 +893,7 @@ bool RegularExpression::find (kwsys_stl::string const& s)
// Returns true if found, and sets start and end indexes accordingly.
bool RegularExpression::find (const char* string) {
register const char* s;
const char* s;
this->searchstring = string;
......@@ -956,9 +956,9 @@ bool RegularExpression::find (const char* string) {
*/
static int regtry (const char* string, const char* *start,
const char* *end, const char* prog) {
register int i;
register const char* *sp1;
register const char* *ep;
int i;
const char* *sp1;
const char* *ep;
reginput = string;
regstartp = start;
......@@ -992,8 +992,8 @@ static int regtry (const char* string, const char* *start,
* 0 failure, 1 success
*/
static int regmatch (const char* prog) {
register const char* scan; // Current node.
const char* next; // Next node.
const char* scan; // Current node.
const char* next; // Next node.
scan = prog;
......@@ -1016,8 +1016,8 @@ static int regmatch (const char* prog) {
reginput++;
break;
case EXACTLY:{
register size_t len;
register const char* opnd;
size_t len;
const char* opnd;
opnd = OPERAND(scan);
// Inline the first character, for speed.
......@@ -1052,8 +1052,8 @@ static int regmatch (const char* prog) {
case OPEN + 7:
case OPEN + 8:
case OPEN + 9:{
register int no;
register const char* save;
int no;
const char* save;
no = OP(scan) - OPEN;
save = reginput;
......@@ -1081,8 +1081,8 @@ static int regmatch (const char* prog) {
case CLOSE + 7:
case CLOSE + 8:
case CLOSE + 9:{
register int no;
register const char* save;
int no;
const char* save;
no = OP(scan) - CLOSE;
save = reginput;
......@@ -1103,7 +1103,7 @@ static int regmatch (const char* prog) {
// break;
case BRANCH:{
register const char* save;
const char* save;
if (OP(next) != BRANCH) // No choice.
next = OPERAND(scan); // Avoid recursion.
......@@ -1122,10 +1122,10 @@ static int regmatch (const char* prog) {
break;
case STAR:
case PLUS:{
register char nextch;
register int no;
register const char* save;
register int min_no;
char nextch;
int no;