Skip to content

Commit 175efdc

Browse files
author
Kenneth Moreland
committed
ENH: Enhance ability to render quadratic surfaces.
These changes are designed to enhance the rendering of surfaces that come from unstructured grids that have quadratic cells. Whereas before every quadratic face was tessellated on the control points, these changes allow you to select a subdivision level in vtkDataSetSurfacefilter used to convert the quadratic faces to approximating linear polygons. There has also been some support added for rendering correct wireframes from the extracted surface. This includes changing the painters to support a new vtkDataSetAttributes::EDGEFLAG that hides the internal edges of the approximating polygons.
1 parent deca0bf commit 175efdc

17 files changed

+772
-42
lines changed

Filtering/vtkCellType.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
// GetCell() and vtkGenericCell::SetCellType(). Also, to do the job right,
3030
// you'll also have to modify some filters (vtkGeometryFilter...) and
3131
// regression tests (example scripts) to reflect the new cell addition.
32-
// Also, make sure to update vtkCellTypesStrings in vtkCellTypes.cxx.
32+
// Also, make sure to update vtkCellTypesStrings in vtkCellTypes.cxx
33+
// and the vtkCellTypes::IsLinear method in vtkCellTypes.h.
3334

3435
// .SECTION Caveats
3536
// An unstructured grid stores the types of its cells as a

Filtering/vtkCellTypes.h

+13
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,13 @@ class VTK_FILTERING_EXPORT vtkCellTypes : public vtkObject
118118
// defined in vtkCellType.h)
119119
static int GetTypeIdFromClassName(const char* classname);
120120

121+
// Description:
122+
// This convenience method is a fast check to determine if a cell type
123+
// represents a linear or nonlinear cell. This is generally much more
124+
// efficient than getting the appropriate vtkCell and checking its IsLinear
125+
// method.
126+
static int IsLinear(unsigned char type);
127+
121128
protected:
122129
vtkCellTypes();
123130
~vtkCellTypes();
@@ -148,5 +155,11 @@ inline int vtkCellTypes::IsType(unsigned char type)
148155
return 0;
149156
}
150157

158+
//-----------------------------------------------------------------------------
159+
inline int vtkCellTypes::IsLinear(unsigned char type)
160+
{
161+
return ((type <= 20) || (type == VTK_CONVEX_POINT_SET));
162+
}
163+
151164

152165
#endif

Filtering/vtkDataSetAttributes.cxx

+8-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ ::AttributeNames[vtkDataSetAttributes::NUM_ATTRIBUTES][12] =
5050
"TCoords",
5151
"Tensors",
5252
"GlobalIds",
53-
"PedigreeIds" };
53+
"PedigreeIds",
54+
"EdgeFlag"
55+
};
5456

5557
const char vtkDataSetAttributes
5658
::LongAttributeNames[vtkDataSetAttributes::NUM_ATTRIBUTES][35] =
@@ -60,7 +62,9 @@ ::LongAttributeNames[vtkDataSetAttributes::NUM_ATTRIBUTES][35] =
6062
"vtkDataSetAttributes::TCOORDS",
6163
"vtkDataSetAttributes::TENSORS",
6264
"vtkDataSetAttributes::GLOBALIDS",
63-
"vtkDataSetAttributes::PEDIGREEIDS" };
65+
"vtkDataSetAttributes::PEDIGREEIDS",
66+
"vtkDataSetAttributes::EDGEFLAG"
67+
};
6468

6569
//--------------------------------------------------------------------------
6670
// Construct object with copying turned on for all data.
@@ -1072,6 +1076,7 @@ ::NumberOfAttributeComponents[vtkDataSetAttributes::NUM_ATTRIBUTES] =
10721076
3,
10731077
9,
10741078
1,
1079+
1,
10751080
1};
10761081

10771082
//--------------------------------------------------------------------------
@@ -1084,6 +1089,7 @@ ::AttributeLimits[vtkDataSetAttributes::NUM_ATTRIBUTES] =
10841089
MAX,
10851090
EXACT,
10861091
EXACT,
1092+
EXACT,
10871093
EXACT};
10881094

10891095
//--------------------------------------------------------------------------

Filtering/vtkDataSetAttributes.h

+2
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ class VTK_FILTERING_EXPORT vtkDataSetAttributes : public vtkFieldData
9090
TENSORS=4,
9191
GLOBALIDS=5,
9292
PEDIGREEIDS=6,
93+
EDGEFLAG=7,
9394
NUM_ATTRIBUTES
9495
};
9596

@@ -165,6 +166,7 @@ class VTK_FILTERING_EXPORT vtkDataSetAttributes : public vtkFieldData
165166
// vtkDataSetAttributes::TENSORS = 4
166167
// vtkDataSetAttributes::GLOBALIDS = 5
167168
// vtkDataSetAttributes::PEDIGREEIDS = 6
169+
// vtkDataSetAttributes::EDGEFLAG = 7
168170
// Returns the index of the array if succesful, -1 if the array
169171
// is not in the list of arrays.
170172
int SetActiveAttribute(const char* name, int attributeType);

0 commit comments

Comments
 (0)