Commit b6a07984 authored by js9's avatar js9

Adding support for 5- through 8-sided polygons to clipping and Zoo (equi-Z) MIR.


git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@18712 18c085ea-50e0-402c-830e-de6fd14e8384
parent 96ec46e4
......@@ -115,6 +115,9 @@ RecursiveCellReconstructor::RecursiveCellReconstructor(vtkDataSet *d,
// Jeremy Meredith, Fri Feb 13 11:05:06 EST 2009
// Added calculation of output vf's per material, if requested.
//
// Jeremy Meredith, Mon Jul 9 16:53:41 EDT 2012
// Added support for 5- through 8-sided polygons.
//
// ****************************************************************************
void
RecursiveCellReconstructor::ReconstructCell(int cellid_, int celltype_,
......@@ -313,6 +316,35 @@ RecursiveCellReconstructor::ReconstructCell(int cellid_, int celltype_,
numOutput = numClipShapesPix[lookup_case];
vertices_from_edges = pixelVerticesFromEdges;
break;
case VTK_POLYGON:
switch (nids)
{
case 5:
startIndex = startClipShapesPoly5[lookup_case];
splitCase = &clipShapesPoly5[startIndex];
numOutput = numClipShapesPoly5[lookup_case];
vertices_from_edges = poly5VerticesFromEdges;
break;
case 6:
startIndex = startClipShapesPoly6[lookup_case];
splitCase = &clipShapesPoly6[startIndex];
numOutput = numClipShapesPoly6[lookup_case];
vertices_from_edges = poly6VerticesFromEdges;
break;
case 7:
startIndex = startClipShapesPoly7[lookup_case];
splitCase = &clipShapesPoly7[startIndex];
numOutput = numClipShapesPoly7[lookup_case];
vertices_from_edges = poly7VerticesFromEdges;
break;
case 8:
startIndex = startClipShapesPoly8[lookup_case];
splitCase = &clipShapesPoly8[startIndex];
numOutput = numClipShapesPoly8[lookup_case];
vertices_from_edges = poly8VerticesFromEdges;
break;
}
break;
}
//
......
......@@ -722,6 +722,9 @@ private:
// and ScalarAccess so we can get data from different meshes and precisions
// without if statements.
//
// Jeremy Meredith, Mon Jul 9 16:53:41 EDT 2012
// Added support for 5- through 8-sided polygons.
//
// ****************************************************************************
template <typename Bridge, typename ScalarAccess>
......@@ -775,6 +778,14 @@ vtkVisItClipper_Algorithm(Bridge &bridge, ScalarAccess scalar,
break;
default:
// we now handle 5-8 sided polygons as well
if (cellType == VTK_POLYGON &&
nCellPts >= 5 && nCellPts <= 8)
{
break;
}
// everything else; defer for other clipper algorithm
{
if (numIcantClip == 0)
stuff_I_cant_clip->GetCellData()->
......@@ -873,6 +884,35 @@ vtkVisItClipper_Algorithm(Bridge &bridge, ScalarAccess scalar,
numOutput = numClipShapesVtx[lookup_case];
vertices_from_edges = NULL;
break;
case VTK_POLYGON:
switch (nCellPts)
{
case 5:
startIndex = startClipShapesPoly5[lookup_case];
splitCase = &clipShapesPoly5[startIndex];
numOutput = numClipShapesPoly5[lookup_case];
vertices_from_edges = poly5VerticesFromEdges;
break;
case 6:
startIndex = startClipShapesPoly6[lookup_case];
splitCase = &clipShapesPoly6[startIndex];
numOutput = numClipShapesPoly6[lookup_case];
vertices_from_edges = poly6VerticesFromEdges;
break;
case 7:
startIndex = startClipShapesPoly7[lookup_case];
splitCase = &clipShapesPoly7[startIndex];
numOutput = numClipShapesPoly7[lookup_case];
vertices_from_edges = poly7VerticesFromEdges;
break;
case 8:
startIndex = startClipShapesPoly8[lookup_case];
splitCase = &clipShapesPoly8[startIndex];
numOutput = numClipShapesPoly8[lookup_case];
vertices_from_edges = poly8VerticesFromEdges;
break;
}
break;
}
int interpIDsIn[4];
......
......@@ -49,6 +49,10 @@ ClipCasesTri.C
ClipCasesWdg.C
ClipCasesVox.C
ClipCasesVtx.C
ClipCasesPoly5.C
ClipCasesPoly6.C
ClipCasesPoly7.C
ClipCasesPoly8.C
InitVTKLite.C
vtkCellIntersections.C
vtkDataSetFromVolume.C
......
......@@ -161,4 +161,24 @@ extern VISIT_VTK_LIGHT_API int numClipShapesVtx[2];
extern VISIT_VTK_LIGHT_API int startClipShapesVtx[2];
extern VISIT_VTK_LIGHT_API unsigned char clipShapesVtx[];
extern VISIT_VTK_LIGHT_API int numClipCasesPoly5;
extern VISIT_VTK_LIGHT_API int numClipShapesPoly5[32];
extern VISIT_VTK_LIGHT_API int startClipShapesPoly5[32];
extern VISIT_VTK_LIGHT_API unsigned char clipShapesPoly5[];
extern VISIT_VTK_LIGHT_API int numClipCasesPoly6;
extern VISIT_VTK_LIGHT_API int numClipShapesPoly6[64];
extern VISIT_VTK_LIGHT_API int startClipShapesPoly6[64];
extern VISIT_VTK_LIGHT_API unsigned char clipShapesPoly6[];
extern VISIT_VTK_LIGHT_API int numClipCasesPoly7;
extern VISIT_VTK_LIGHT_API int numClipShapesPoly7[128];
extern VISIT_VTK_LIGHT_API int startClipShapesPoly7[128];
extern VISIT_VTK_LIGHT_API unsigned char clipShapesPoly7[];
extern VISIT_VTK_LIGHT_API int numClipCasesPoly8;
extern VISIT_VTK_LIGHT_API int numClipShapesPoly8[256];
extern VISIT_VTK_LIGHT_API int startClipShapesPoly8[256];
extern VISIT_VTK_LIGHT_API unsigned char clipShapesPoly8[];
#endif
......@@ -849,3 +849,44 @@ int lineVerticesFromEdges[1][2] =
{0,1}
};
int poly5VerticesFromEdges[5][2] =
{
{0,1},
{1,2},
{2,3},
{3,4},
{4,0}
};
int poly6VerticesFromEdges[6][2] =
{
{0,1},
{1,2},
{2,3},
{3,4},
{4,5},
{5,0}
};
int poly7VerticesFromEdges[7][2] =
{
{0,1},
{1,2},
{2,3},
{3,4},
{4,5},
{5,6},
{6,0}
};
int poly8VerticesFromEdges[8][2] =
{
{0,1},
{1,2},
{2,3},
{3,4},
{4,5},
{5,6},
{6,7},
{7,0}
};
......@@ -71,5 +71,9 @@ extern VISIT_VTK_LIGHT_API int triVerticesFromEdges[3][2];
extern VISIT_VTK_LIGHT_API int quadVerticesFromEdges[4][2];
extern VISIT_VTK_LIGHT_API int pixelVerticesFromEdges[4][2];
extern VISIT_VTK_LIGHT_API int lineVerticesFromEdges[1][2];
extern VISIT_VTK_LIGHT_API int poly5VerticesFromEdges[5][2];
extern VISIT_VTK_LIGHT_API int poly6VerticesFromEdges[6][2];
extern VISIT_VTK_LIGHT_API int poly7VerticesFromEdges[7][2];
extern VISIT_VTK_LIGHT_API int poly8VerticesFromEdges[8][2];
#endif
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