|
template<class V , class IV >
void vtkfig::DataSet::SetSimplexGrid |
( |
int |
dim, |
|
|
const V & |
points, |
|
|
const IV & |
cells |
|
) |
| |
|
inline |
Enter data of a simplex grid.
- Template Parameters
-
V | Vector class counting from zero with member functions size() and operator[]. std::vector will work. |
IV | Vector class counting from zero with member functions size() and operator[]. std::vector will work. |
- Parameters
-
dim | Space dimension (2 or 3) |
points | Point coordinates, stored consecutively.
In 2D, coordinates of point i are (points[2*i],points[2*i+1])
In 3D, coordinates of point i are (points[3*i],points[3*i+1],,points[3*i+2]) |
cells | Simplex point indices (counting from 0!) In 2D, point indices of triangle i are (cells[3*i],cells[3*i+1],cells[3*i+2])
In 3D, point indices of tetrahedron i are (cells[3*i],cells[3*i+1],cells[3*i+2],cells[3*i+3]) |
Definition at line 343 of file vtkfigDataSet.h.
347 if (this-> data==NULL) 348 this-> data=vtkSmartPointer<vtkUnstructuredGrid>::New(); 350 auto udata=vtkUnstructuredGrid::SafeDownCast(this-> data); 354 auto gridpoints = vtkSmartPointer<vtkPoints>::New(); 355 udata->SetPoints(gridpoints); 359 for ( int icell=0;icell<cells.size(); icell+=3) 361 vtkIdType c[3]={cells[icell+0],cells[icell+1],cells[icell+2]}; 362 udata->InsertNextCell(VTK_TRIANGLE,3,c); 365 for ( int ipoint=0;ipoint<points.size(); ipoint+=2) 367 gridpoints->InsertNextPoint( 375 for ( int icell=0;icell<cells.size(); icell+=4) 377 vtkIdType c[4]={cells[icell+0],cells[icell+1],cells[icell+2],cells[icell+3]}; 378 udata->InsertNextCell(VTK_TETRA,4,c); 381 for ( int ipoint=0;ipoint<points.size(); ipoint+=3)
vtkSmartPointer< vtkDataSet > data
double coordinate_scale_factor_xyz[3]
double coordinate_scale_factor
|