Commit c7e9c1b6 authored by Kenneth Moreland's avatar Kenneth Moreland

Add default constructors/destructors/assignment to CellSet classes

The CellSet classes all exclusively work in the control environment.
However, CUDA likes to add __device__ to constructors, destructors, and
assignment operators it automatically adds. This in turn causes warnings
about the __device__ function using host-only classes (like
boost::shared_ptr). Solve this problem by adding explicit methods for
all of these.
parent 65c22618
......@@ -44,6 +44,22 @@ public:
{
}
VTKM_CONT_EXPORT
CellSet(const vtkm::cont::CellSet &src)
: Name(src.Name),
Dimensionality(src.Dimensionality),
LogicalStructure(src.LogicalStructure)
{ }
VTKM_CONT_EXPORT
CellSet &operator=(const vtkm::cont::CellSet &src)
{
this->Name = src.Name;
this->Dimensionality = src.Dimensionality;
this->LogicalStructure = src.LogicalStructure;
return *this;
}
virtual ~CellSet()
{
}
......
......@@ -66,15 +66,16 @@ template<typename ShapeStorageTag = VTKM_DEFAULT_SHAPE_STORAGE_TAG,
typename OffsetsStorageTag = VTKM_DEFAULT_OFFSETS_STORAGE_TAG >
class CellSetExplicit : public CellSet
{
typedef CellSetExplicit< ShapeStorageTag,
NumIndicesStorageTag,
ConnectivityStorageTag,
OffsetsStorageTag > Thisclass;
template<typename FromTopology, typename ToTopology>
struct ConnectivityChooser
{
typedef CellSetExplicit< ShapeStorageTag,
NumIndicesStorageTag,
ConnectivityStorageTag,
OffsetsStorageTag > CellSetExplicitType;
typedef typename detail::CellSetExplicitConnectivityChooser<
CellSetExplicitType,
Thisclass,
FromTopology,
ToTopology>::ConnectivityType ConnectivityType;
......@@ -118,6 +119,30 @@ public:
{
}
VTKM_CONT_EXPORT
CellSetExplicit(const Thisclass &src)
: CellSet(src),
PointToCell(src.PointToCell),
CellToPoint(src.CellToPoint),
ConnectivityLength(src.ConnectivityLength),
NumberOfCells(src.NumberOfCells),
NumberOfPoints(src.NumberOfPoints)
{ }
VTKM_CONT_EXPORT
Thisclass &operator=(const Thisclass &src)
{
this->CellSet::operator=(src);
this->PointToCell = src.PointToCell;
this->CellToPoint = src.CellToPoint;
this->ConnectivityLength = src.ConnectivityLength;
this->NumberOfCells = src.NumberOfCells;
this->NumberOfPoints = src.NumberOfPoints;
return *this;
}
virtual ~CellSetExplicit() { }
virtual vtkm::Id GetNumberOfCells() const
{
return this->PointToCell.GetNumberOfElements();
......
......@@ -70,6 +70,9 @@ template< typename ValidCellArrayHandleType,
typename OriginalCellSet >
class CellSetPermutation : public CellSet
{
typedef vtkm::cont::CellSetPermutation<
ValidCellArrayHandleType,OriginalCellSet> Thisclass;
public:
typedef typename vtkm::cont::internal::CellSetPermutationTraits<
ValidCellArrayHandleType,OriginalCellSet>::PermutedCellSetType PermutedCellSetType;
......@@ -100,6 +103,24 @@ public:
{
}
VTKM_CONT_EXPORT
CellSetPermutation(const Thisclass &src)
: CellSet(src),
ValidCellIds(src.ValidCellIds),
PermutedCellSet(src.PermutedCellSet)
{ }
VTKM_CONT_EXPORT
Thisclass &operator=(const Thisclass &src)
{
this->CellSet::operator=(src);
this->ValidCellIds = src.ValidCellIds;
this->PermutedCellSet = src.PermutedCellSet;
return *this;
}
virtual ~CellSetPermutation() { }
//This is the way you can fill the memory from another system without copying
VTKM_CONT_EXPORT
void Fill(const ValidCellArrayHandleType &validCellIds,
......
......@@ -45,6 +45,7 @@ class CellSetSingleType :
typename vtkm::cont::ArrayHandleCounting<vtkm::Id>::StorageTag //IndexOffsetStorageTag
>
{
typedef vtkm::cont::CellSetSingleType<ConnectivityStorageTag> Thisclass;
typedef vtkm::cont::CellSetExplicit<
typename vtkm::cont::ArrayHandleConstant<vtkm::UInt8>::StorageTag,
typename vtkm::cont::ArrayHandleConstant<vtkm::IdComponent>::StorageTag,
......@@ -67,6 +68,21 @@ public:
{
}
VTKM_CONT_EXPORT
CellSetSingleType(const Thisclass &src)
: Superclass(src), CellTypeAsId(src.CellTypeAsId)
{ }
VTKM_CONT_EXPORT
Thisclass &operator=(const Thisclass &src)
{
this->Superclass::operator=(src);
this->CellTypeAsId = src.CellTypeAsId;
return *this;
}
virtual ~CellSetSingleType() { }
/// First method to add cells -- one at a time.
VTKM_CONT_EXPORT
void PrepareToAddCells(vtkm::Id numShapes, vtkm::Id connectivityMaxLen)
......
......@@ -35,6 +35,7 @@ template<vtkm::IdComponent DIMENSION>
class CellSetStructured : public CellSet
{
private:
typedef vtkm::cont::CellSetStructured<DIMENSION> Thisclass;
typedef vtkm::internal::ConnectivityStructuredInternals<DIMENSION>
InternalsType;
......@@ -49,6 +50,20 @@ public:
{
}
VTKM_CONT_EXPORT
CellSetStructured(const Thisclass &src)
: CellSet(src), Structure(src.Structure)
{ }
VTKM_CONT_EXPORT
Thisclass &operator=(const Thisclass &src)
{
this->CellSet::operator=(src);
this->Structure = src.Structure;
return *this;
}
virtual ~CellSetStructured() { }
virtual vtkm::Id GetNumberOfCells() const
{
......
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