Commit e542ad28 authored by Robert Maynard's avatar Robert Maynard Committed by Code Review
Browse files

Merge topic 'anon-used-by-non-anon' into master

153473f3 Fix warnings due to anonymous namespace.
parents 296dc589 153473f3
......@@ -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