Commit 1bef9072 authored by hrchilds's avatar hrchilds

Update from February 16, 2004

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@177 18c085ea-50e0-402c-830e-de6fd14e8384
parent c4323ecb
......@@ -222,3 +222,23 @@ avtIsovolumeFilter::ExecuteData(vtkDataSet *in_ds, int, std::string)
return out_ds;
}
// ****************************************************************************
// Method: avtIsovolumeFilter::RefashionDataObjectInfo
//
// Purpose:
// Indicates the zones no longer correspond to the original problem.
//
// Programmer: Jeremy Meredith
// Creation: February 16, 2004
//
// ****************************************************************************
void
avtIsovolumeFilter::RefashionDataObjectInfo(void)
{
GetOutput()->GetInfo().GetValidity().InvalidateZones();
}
......@@ -22,6 +22,11 @@ class vtkDataSet;
// Programmer: meredith -- generated by xml2info
// Creation: Fri Jan 30 14:50:21 PST 2004
//
// Modifications:
// Jeremy Meredith, Mon Feb 16 19:12:11 PST 2004
// Added RefashionDataObjectInfo. This was needed for correct support
// on various mesh types.
//
// ****************************************************************************
class avtIsovolumeFilter : public avtPluginStreamer
......@@ -43,6 +48,7 @@ class avtIsovolumeFilter : public avtPluginStreamer
IsovolumeAttributes atts;
virtual vtkDataSet *ExecuteData(vtkDataSet *, int, std::string);
virtual void RefashionDataObjectInfo(void);
};
......
This diff is collapsed.
......@@ -23,6 +23,9 @@ class vtkUnstructuredGrid;
// Jeremy Meredith, Fri Jan 30 16:15:50 PST 2004
// Added scalar array and scalar range for isovolume.
//
// Jeremy Meredith, Mon Feb 16 19:08:16 PST 2004
// Added PolyData support.
//
// ****************************************************************************
class VISIT_VTK_API vtkVisItClipper3D
: public vtkDataSetToUnstructuredGridFilter
......@@ -48,6 +51,7 @@ class VISIT_VTK_API vtkVisItClipper3D
void RectilinearGridExecute();
void StructuredGridExecute();
void UnstructuredGridExecute();
void PolyDataExecute();
void GeneralExecute();
void ClipDataset(vtkDataSet *, vtkUnstructuredGrid *);
......
......@@ -342,8 +342,95 @@ vtkVolumeFromVolume::TetList::AddTet(int cellId, int v1,int v2,int v3,int v4)
currentShape++;
}
vtkVolumeFromVolume::QuadList::QuadList()
: vtkVolumeFromVolume::ShapeList(4)
{
}
vtkVolumeFromVolume::QuadList::~QuadList()
{
}
void
vtkVolumeFromVolume::QuadList::AddQuad(int cellId, int v1,int v2,int v3,int v4)
{
if (currentShape >= shapesPerList)
{
if (currentList >= listSize+1)
{
int **tmpList = new int*[2*listSize];
for (int i = 0 ; i < listSize ; i++)
{
tmpList[i] = list[i];
}
listSize *= 2;
delete [] list;
list = tmpList;
}
currentList++;
list[currentList] = new int[(shapeSize+1)*shapesPerList];
currentShape = 0;
}
int idx = (shapeSize+1)*currentShape;
list[currentList][idx+0] = cellId;
list[currentList][idx+1] = v1;
list[currentList][idx+2] = v2;
list[currentList][idx+3] = v3;
list[currentList][idx+4] = v4;
currentShape++;
}
vtkVolumeFromVolume::TriList::TriList()
: vtkVolumeFromVolume::ShapeList(3)
{
}
vtkVolumeFromVolume::TriList::~TriList()
{
}
void
vtkVolumeFromVolume::TriList::AddTri(int cellId, int v1,int v2,int v3)
{
if (currentShape >= shapesPerList)
{
if (currentList >= listSize+1)
{
int **tmpList = new int*[2*listSize];
for (int i = 0 ; i < listSize ; i++)
{
tmpList[i] = list[i];
}
listSize *= 2;
delete [] list;
list = tmpList;
}
currentList++;
list[currentList] = new int[(shapeSize+1)*shapesPerList];
currentShape = 0;
}
int idx = (shapeSize+1)*currentShape;
list[currentList][idx+0] = cellId;
list[currentList][idx+1] = v1;
list[currentList][idx+2] = v2;
list[currentList][idx+3] = v3;
currentShape++;
}
// ****************************************************************************
// Modifications:
// Jeremy Meredith, Mon Feb 16 19:11:34 PST 2004
// Added polygonal cell support.
//
// ****************************************************************************
void
vtkVolumeFromVolume::ConstructDataSet(vtkPointData *inPD, vtkCellData *inCD,
vtkUnstructuredGrid *output,
......@@ -534,6 +621,43 @@ vtkVolumeFromVolume::ConstructDataSet(vtkPointData *inPD, vtkCellData *inCD,
cellId++;
}
}
nlists = quads.GetNumberOfLists();
for (i = 0 ; i < nlists ; i++)
{
const int *list;
int listSize = quads.GetList(i, list);
for (j = 0 ; j < listSize ; j++)
{
outCD->CopyData(inCD, list[0], cellId);
vtkIdType quad[4];
quad[0] = (list[1] < 0) ? (centroidStart-1 - list[1]) : (list[1]);
quad[1] = (list[2] < 0) ? (centroidStart-1 - list[2]) : (list[2]);
quad[2] = (list[3] < 0) ? (centroidStart-1 - list[3]) : (list[3]);
quad[3] = (list[4] < 0) ? (centroidStart-1 - list[4]) : (list[4]);
output->InsertNextCell(VTK_QUAD, 4, quad);
list += 5;
cellId++;
}
}
nlists = tris.GetNumberOfLists();
for (i = 0 ; i < nlists ; i++)
{
const int *list;
int listSize = tris.GetList(i, list);
for (j = 0 ; j < listSize ; j++)
{
outCD->CopyData(inCD, list[0], cellId);
vtkIdType tri[3];
tri[0] = (list[1] < 0) ? (centroidStart-1 - list[1]) : (list[1]);
tri[1] = (list[2] < 0) ? (centroidStart-1 - list[2]) : (list[2]);
tri[2] = (list[3] < 0) ? (centroidStart-1 - list[3]) : (list[3]);
output->InsertNextCell(VTK_TRIANGLE, 3, tri);
list += 4;
cellId++;
}
}
}
......@@ -549,6 +673,12 @@ inline void GetPoint(float *pt, const float *X, const float *Y,
}
// ****************************************************************************
// Modifications:
// Jeremy Meredith, Mon Feb 16 19:11:34 PST 2004
// Added polygonal cell support.
//
// ****************************************************************************
void
vtkVolumeFromVolume::ConstructDataSet(vtkPointData *inPD, vtkCellData *inCD,
vtkUnstructuredGrid *output,
......@@ -738,4 +868,41 @@ vtkVolumeFromVolume::ConstructDataSet(vtkPointData *inPD, vtkCellData *inCD,
cellId++;
}
}
nlists = quads.GetNumberOfLists();
for (i = 0 ; i < nlists ; i++)
{
const int *list;
int listSize = quads.GetList(i, list);
for (j = 0 ; j < listSize ; j++)
{
outCD->CopyData(inCD, list[0], cellId);
vtkIdType quad[4];
quad[0] = (list[1] < 0) ? (centroidStart-1 - list[1]) : (list[1]);
quad[1] = (list[2] < 0) ? (centroidStart-1 - list[2]) : (list[2]);
quad[2] = (list[3] < 0) ? (centroidStart-1 - list[3]) : (list[3]);
quad[3] = (list[4] < 0) ? (centroidStart-1 - list[4]) : (list[4]);
output->InsertNextCell(VTK_QUAD, 4, quad);
list += 5;
cellId++;
}
}
nlists = tris.GetNumberOfLists();
for (i = 0 ; i < nlists ; i++)
{
const int *list;
int listSize = tris.GetList(i, list);
for (j = 0 ; j < listSize ; j++)
{
outCD->CopyData(inCD, list[0], cellId);
vtkIdType tri[3];
tri[0] = (list[1] < 0) ? (centroidStart-1 - list[1]) : (list[1]);
tri[1] = (list[2] < 0) ? (centroidStart-1 - list[2]) : (list[2]);
tri[2] = (list[3] < 0) ? (centroidStart-1 - list[3]) : (list[3]);
output->InsertNextCell(VTK_TRIANGLE, 3, tri);
list += 4;
cellId++;
}
}
}
......@@ -31,6 +31,9 @@ class vtkUnstructuredGrid;
// Creation: August 7, 2003
//
// Modifications:
// Jeremy Meredith, Mon Feb 16 18:01:29 PST 2004
// Added 2D shape support. This might seem weird, but there may be
// some 2D shapes in a volumetric setting.
//
// ****************************************************************************
......@@ -86,6 +89,22 @@ class TetList : public ShapeList
void AddTet(int, int, int, int, int);
};
class QuadList : public ShapeList
{
public:
QuadList();
virtual ~QuadList();
void AddQuad(int, int, int, int, int);
};
class TriList : public ShapeList
{
public:
TriList();
virtual ~TriList();
void AddTri(int, int, int, int);
};
struct CentroidPointEntry
{
int nPts;
......@@ -140,6 +159,10 @@ class CentroidPointList
{ pyramids.AddPyramid(z, v0, v1, v2, v3, v4); }
void AddTet(int z, int v0, int v1, int v2, int v3)
{ tets.AddTet(z, v0, v1, v2, v3); }
void AddQuad(int z, int v0, int v1, int v2, int v3)
{ quads.AddQuad(z, v0, v1, v2, v3); }
void AddTri(int z, int v0, int v1, int v2)
{ tris.AddTri(z, v0, v1, v2); }
protected:
CentroidPointList centroid_list;
......@@ -147,6 +170,8 @@ class CentroidPointList
WedgeList wedges;
PyramidList pyramids;
TetList tets;
QuadList quads;
TriList tris;
};
......
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