Commit 153473f3 authored by David Gobbi's avatar David Gobbi
Browse files

Fix warnings due to anonymous namespace.

Some gcc-4.2 builds complain when a type is defined within an
anonymous namespace, but subsequently used to define members of
any class declared outside of the anonymous namespace.  This is
probably a spurious warning, but it is easy to fix by making the
type itself a member of the class that is using it.

Change-Id: I4cf5cf2e9538f6a0fd611046193e9f0bd53b76d1
parent fced8141
......@@ -140,23 +140,6 @@ bool compVector3fX(const vtkIndexedVector2f& v1,
}
}
class VectorPIMPL : public std::vector<vtkIndexedVector2f>
{
public:
VectorPIMPL(vtkVector2f* array, size_t n)
: std::vector<vtkIndexedVector2f>()
{
this->reserve(n);
for (size_t i = 0; i < n; ++i)
{
vtkIndexedVector2f tmp;
tmp.index = i;
tmp.pos = array[i];
this->push_back(tmp);
}
}
};
} // namespace
//-----------------------------------------------------------------------------
......@@ -453,6 +436,23 @@ class vtkPlotBarSegment : public vtkObject {
}
}
class VectorPIMPL : public std::vector<vtkIndexedVector2f>
{
public:
VectorPIMPL(vtkVector2f* array, size_t n)
: std::vector<vtkIndexedVector2f>()
{
this->reserve(n);
for (size_t i = 0; i < n; ++i)
{
vtkIndexedVector2f tmp;
tmp.index = i;
tmp.pos = array[i];
this->push_back(tmp);
}
}
};
vtkSmartPointer<vtkPlotBarSegment> Previous;
vtkSmartPointer<vtkPoints2D> Points;
vtkPlotBar *Bar;
......
......@@ -47,47 +47,49 @@ static const char* TypeNames[] = {
typedef std::vector<bool> BitVector;
class CellProperty
{
public:
template<typename T>
CellProperty(T, const int& sp,
const vtkIdType &numTuples, const vtkIdType& nc):
startPos(sp),
numComps(nc)
{
Data =new unsigned char[numTuples * nc * sizeof(T)];
loc = Data;
len = numComps * sizeof(T);
}
~CellProperty()
{
delete[] Data;
}
template<typename T>
void insertNextTuple(T* values)
{
memcpy(loc,values+startPos,len);
loc = ((T*)loc) + numComps;
}
void resetForNextTimeStep()
{
loc = Data;
}
unsigned char *Data;
protected:
int startPos;
size_t len;
vtkIdType numComps;
void *loc;
};
}
//-----------------------------------------------------------------------------
//lightweight class that holds the cell properties
class vtkLSDynaPart::InternalCellProperties
{
//lightweight class that holds the cell properties
protected:
class CellProperty
{
public:
template<typename T>
CellProperty(T, const int& sp,
const vtkIdType &numTuples, const vtkIdType& nc):
startPos(sp),
numComps(nc)
{
Data =new unsigned char[numTuples * nc * sizeof(T)];
loc = Data;
len = numComps * sizeof(T);
}
~CellProperty()
{
delete[] Data;
}
template<typename T>
void insertNextTuple(T* values)
{
memcpy(loc,values+startPos,len);
loc = ((T*)loc) + numComps;
}
void resetForNextTimeStep()
{
loc = Data;
}
unsigned char *Data;
protected:
int startPos;
size_t len;
vtkIdType numComps;
void *loc;
};
public:
InternalCellProperties():
......
......@@ -35,8 +35,10 @@
#include <list>
//-----------------------------------------------------------------------------
namespace
{
class vtkLSDynaPartCollection::LSDynaPartStorage
{
protected:
//---------------------------------------------------------------------------
//stores the number of cells for a given part
//this struct is meant to resemble a run length encoding style of storage
//of mapping cell ids to the part that holds those cells
......@@ -65,6 +67,7 @@ namespace
vtkLSDynaPart *part;
};
//---------------------------------------------------------------------------
struct PartInsertion
{
PartInsertion():numCellsInserted(0){}
......@@ -88,10 +91,8 @@ namespace
std::vector<PartInfo>::iterator pIt;
vtkIdType numCellsInserted;
};
}
//-----------------------------------------------------------------------------
class vtkLSDynaPartCollection::LSDynaPartStorage
{
//---------------------------------------------------------------------------
public:
LSDynaPartStorage(const vtkIdType& numMaterials):
NumParts(numMaterials),PartIteratorLoc(0)
......
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