Commit 93b15a76 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit Committed by Kitware Robot

Merge topic '0012871-vtknetcdf-headers' into pv-master

91f7024c Install headers to make vtk's netcdf c++ interface externally usable.
515029b2 KWSys Nightly Date Stamp
48877e3b KWSys Nightly Date Stamp
69e1c723 KWSys Nightly Date Stamp
16629db7 Merge topic 'rename-vtkVectorBase'
457cf62f Merge topic 'pv-master'
41c349b1 ENH: Rename the vtkVectorBase class to vtkTuple.
parents d4815489 91f7024c
......@@ -196,7 +196,7 @@ vtkUnsignedShortArray.cxx
vtkVariant.cxx
vtkVariantArray.cxx
vtkVector.h
vtkVectorBase.h
vtkTuple.h
vtkVersion.cxx
vtkVoidArray.cxx
vtkWarpTransform.cxx
......@@ -401,7 +401,7 @@ SET_SOURCE_FILES_PROPERTIES(
vtkMathUtilities
vtkRect
vtkVector
vtkVectorBase
vtkTuple
HEADER_FILE_ONLY
)
......@@ -432,7 +432,7 @@ SET_SOURCE_FILES_PROPERTIES(
vtkWeakPointerBase.cxx
vtkUnicodeString.cxx
vtkVector.h
vtkVectorBase.h
vtkTuple.h
WRAP_EXCLUDE
)
......@@ -443,7 +443,7 @@ SET_SOURCE_FILES_PROPERTIES(
vtkTimeStamp.cxx
vtkVariant.cxx
vtkVector.h
vtkVectorBase.h
vtkTuple.h
PROPERTIES WRAP_SPECIAL 1
)
......
......@@ -107,7 +107,7 @@ IF(PYTHON_EXECUTABLE)
vtkVariantExtract.h
vtkVariantInlineOperators.h
vtkVector.h
vtkVectorBase.h
vtkTuple.h
vtkVectorIterator.h
vtkVectorOperators.h
vtkVersion.h
......
......@@ -22,12 +22,12 @@
#ifndef __vtkColor_h
#define __vtkColor_h
#include "vtkVectorBase.h"
#include "vtkTuple.h"
// .NAME vtkColor3 - templated base type for storage of 3 component colors.
//
template<typename T>
class vtkColor3 : public vtkVectorBase<T, 3>
class vtkColor3 : public vtkTuple<T, 3>
{
public:
vtkColor3(const T& red = 0, const T& green = 0, const T& blue = 0)
......@@ -36,7 +36,7 @@ public:
this->Data[1] = green;
this->Data[2] = blue;
}
explicit vtkColor3(const T* init) : vtkVectorBase<T, 3>(init)
explicit vtkColor3(const T* init) : vtkTuple<T, 3>(init)
{
}
......@@ -80,7 +80,7 @@ public:
// .NAME vtkColor4 - templated base type for storage of 4 component colors.
//
template<typename T>
class vtkColor4 : public vtkVectorBase<T, 4>
class vtkColor4 : public vtkTuple<T, 4>
{
public:
vtkColor4(const T& red = 0, const T& green = 0, const T& blue = 0,
......@@ -91,7 +91,7 @@ public:
this->Data[2] = blue;
this->Data[3] = alpha;
}
explicit vtkColor4(const T* init) : vtkVectorBase<T, 4>(init)
explicit vtkColor4(const T* init) : vtkTuple<T, 4>(init)
{
}
......
/*=========================================================================
Program: Visualization Toolkit
Module: vtkVectorBase.h
Module: vtkTuple.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
......@@ -13,28 +13,27 @@
=========================================================================*/
// .NAME vtkVectorBase - templated base type for sized vector containers.
// .NAME vtkTuple - templated base type for containers of constant size.
//
// .SECTION Description
// This class is a templated data type for storing and manipulating fixed
// size vectors.
// This class is a templated data type for storing and manipulating tuples.
#ifndef __vtkVectorBase_h
#define __vtkVectorBase_h
#ifndef __vtkTuple_h
#define __vtkTuple_h
#include <cassert> // For inline assert for bounds checked methods.
template<typename T, int Size>
class vtkVectorBase
class vtkTuple
{
public:
vtkVectorBase()
vtkTuple()
{
}
// Description:
// Initialize all of the vector's elements with the supplied scalar.
explicit vtkVectorBase(const T& scalar)
// Initialize all of the tuple's elements with the supplied scalar.
explicit vtkTuple(const T& scalar)
{
for (int i = 0; i < Size; ++i)
{
......@@ -43,10 +42,10 @@ public:
}
// Description:
// Initalize the vector's elements with the elements of the supplied array.
// Initalize the tuple's elements with the elements of the supplied array.
// Note that the supplied pointer must contain at least as many elements as
// the vector, or it will result in access to out of bounds memory.
explicit vtkVectorBase(const T* init)
// the tuple, or it will result in access to out of bounds memory.
explicit vtkTuple(const T* init)
{
for (int i = 0; i < Size; ++i)
{
......@@ -55,23 +54,25 @@ public:
}
// Description:
// Get the size of the vtkVector.
// Get the size of the tuple.
int GetSize() const { return Size; }
// Description:
// Get a pointer to the underlying data of the vtkVector.
// Get a pointer to the underlying data of the tuple.
T* GetData() { return this->Data; }
const T* GetData() const { return this->Data; }
// Description:
// Get a reference to the underlying data element of the vtkVector. Can be
// used in much the same way as vector[i] is used.
// Get a reference to the underlying data element of the tuple.
// This works similarly to the way C++ STL containers work. No
// bounds checking is performed.
T& operator[](int i) { return this->Data[i]; }
const T& operator[](int i) const { return this->Data[i]; }
// Description:
// Get the value of the vector at the index speciifed. Does bounds checking,
// used in much the same way as vector.at(i) is used.
// Get the value of the tuple at the index specifed. Does bounds
// checking, similar to the at(i) method of C++ STL containers, but
// only when the code is compiled in debug mode.
T operator()(int i) const
{
assert("pre: index_in_bounds" && i >= 0 && i < Size);
......@@ -80,7 +81,7 @@ public:
// Description:
// Equality operator with a tolerance to allow fuzzy comparisons.
bool Compare(const vtkVectorBase<T, Size>& other, const T& tol) const
bool Compare(const vtkTuple<T, Size>& other, const T& tol) const
{
if (Size != other.GetSize())
{
......@@ -97,11 +98,11 @@ public:
}
// Description:
// Cast the vector to the specified type, returning the result.
// Cast the tuple to the specified type, returning the result.
template<typename TR>
vtkVectorBase<TR, Size> Cast() const
vtkTuple<TR, Size> Cast() const
{
vtkVectorBase<TR, Size> result;
vtkTuple<TR, Size> result;
for (int i = 0; i < Size; ++i)
{
result[i] = static_cast<TR>(this->Data[i]);
......@@ -115,4 +116,4 @@ protected:
T Data[Size];
};
#endif // __vtkVectorBase_h
#endif // __vtkTuple_h
......@@ -25,19 +25,19 @@
#ifndef __vtkVector_h
#define __vtkVector_h
#include "vtkVectorBase.h"
#include "vtkTuple.h"
#include <cmath> // For math functions
template<typename T, int Size>
class vtkVector : public vtkVectorBase<T, Size>
class vtkVector : public vtkTuple<T, Size>
{
public:
vtkVector()
{
}
vtkVector(const T* init) : vtkVectorBase<T, Size>(init)
vtkVector(const T* init) : vtkTuple<T, Size>(init)
{
}
......
......@@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2012)
SET(KWSYS_DATE_STAMP_MONTH 01)
# KWSys version date day component. Format is DD.
SET(KWSYS_DATE_STAMP_DAY 20)
SET(KWSYS_DATE_STAMP_DAY 23)
......@@ -367,6 +367,8 @@ ENDIF(NOT VTK_INSTALL_NO_LIBRARIES)
IF(NOT VTK_INSTALL_NO_DEVELOPMENT)
INSTALL(FILES
${VTKNETCDF_BINARY_DIR}/ncconfig.h
${VTKNETCDF_SOURCE_DIR}/cxx/netcdfcpp.h
${VTKNETCDF_SOURCE_DIR}/cxx/ncvalues.h
DESTINATION ${VTK_INSTALL_INCLUDE_DIR_CM24}/vtknetcdf
COMPONENT Development)
INSTALL(DIRECTORY
......
......@@ -624,7 +624,7 @@ void vtkWrap_FindCountHints(
{
entry = vtkParseHierarchy_FindEntry(hinfo, data->Name);
if (entry && vtkParseHierarchy_IsTypeOfTemplated(
hinfo, entry, data->Name, "vtkVectorBase", &classname))
hinfo, entry, data->Name, "vtkTuple", &classname))
{
/* attempt to get count from template parameter */
if (classname)
......@@ -650,7 +650,7 @@ void vtkWrap_FindCountHints(
if (theFunc->IsOperator && theFunc->Name &&
strcmp(theFunc->Name, "operator[]") == 0)
{
if (vtkWrap_IsTypeOf(hinfo, data->Name, "vtkVectorBase"))
if (vtkWrap_IsTypeOf(hinfo, data->Name, "vtkTuple"))
{
theFunc->SizeHint = "GetSize()";
}
......
......@@ -452,7 +452,7 @@ static const char *vtkWrapPython_ClassHeader(
{ "vtkVariant", "vtkVariant.h" },
{ "vtkStdString", "vtkStdString.h" },
{ "vtkUnicodeString", "vtkUnicodeString.h" },
{ "vtkVectorBase", "vtkVector.h" },
{ "vtkTuple", "vtkVector.h" },
{ "vtkVector", "vtkVector.h" },
{ "vtkVector2", "vtkVector.h" },
{ "vtkVector2i", "vtkVector.h" },
......
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