VTK  9.2.6
vtkCubicLine.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkCubicLine.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
55#ifndef vtkCubicLine_h
56#define vtkCubicLine_h
57
58#include "vtkCommonDataModelModule.h" // For export macro
59#include "vtkNonLinearCell.h"
60
61class vtkLine;
62class vtkDoubleArray;
63
64class VTKCOMMONDATAMODEL_EXPORT vtkCubicLine : public vtkNonLinearCell
65{
66public:
67 static vtkCubicLine* New();
69 void PrintSelf(ostream& os, vtkIndent indent) override;
70
72
75 int GetCellType() override { return VTK_CUBIC_LINE; }
76 int GetCellDimension() override { return 1; }
77 int GetNumberOfEdges() override { return 0; }
78 int GetNumberOfFaces() override { return 0; }
79 vtkCell* GetEdge(int) override { return nullptr; }
80 vtkCell* GetFace(int) override { return nullptr; }
81 int CellBoundary(int subId, const double pcoords[3], vtkIdList* pts) override;
82 void Contour(double value, vtkDataArray* cellScalars, vtkIncrementalPointLocator* locator,
83 vtkCellArray* verts, vtkCellArray* lines, vtkCellArray* polys, vtkPointData* inPd,
84 vtkPointData* outPd, vtkCellData* inCd, vtkIdType cellId, vtkCellData* outCd) override;
85 int EvaluatePosition(const double x[3], double closestPoint[3], int& subId, double pcoords[3],
86 double& dist2, double weights[]) override;
87 void EvaluateLocation(int& subId, const double pcoords[3], double x[3], double* weights) override;
88 int Triangulate(int index, vtkIdList* ptIds, vtkPoints* pts) override;
90 int subId, const double pcoords[3], const double* values, int dim, double* derivs) override;
91 double* GetParametricCoords() override;
93
98 double GetParametricDistance(const double pcoords[3]) override;
99
104 void Clip(double value, vtkDataArray* cellScalars, vtkIncrementalPointLocator* locator,
105 vtkCellArray* lines, vtkPointData* inPd, vtkPointData* outPd, vtkCellData* inCd,
106 vtkIdType cellId, vtkCellData* outCd, int insideOut) override;
107
111 int GetParametricCenter(double pcoords[3]) override;
112
117 int IntersectWithLine(const double p1[3], const double p2[3], double tol, double& t, double x[3],
118 double pcoords[3], int& subId) override;
119
120 static void InterpolationFunctions(const double pcoords[3], double weights[4]);
121 static void InterpolationDerivs(const double pcoords[3], double derivs[4]);
123
127 void InterpolateFunctions(const double pcoords[3], double weights[4]) override
128 {
129 vtkCubicLine::InterpolationFunctions(pcoords, weights);
130 }
131 void InterpolateDerivs(const double pcoords[3], double derivs[4]) override
132 {
133 vtkCubicLine::InterpolationDerivs(pcoords, derivs);
134 }
136
137protected:
139 ~vtkCubicLine() override;
140
142 vtkDoubleArray* Scalars; // used to avoid New/Delete in contouring/clipping
143
144private:
145 vtkCubicLine(const vtkCubicLine&) = delete;
146 void operator=(const vtkCubicLine&) = delete;
147};
148
149//----------------------------------------------------------------------------
150inline int vtkCubicLine::GetParametricCenter(double pcoords[3])
151{
152
153 pcoords[0] = pcoords[1] = pcoords[2] = 0.0;
154 return 0;
155}
156
157#endif
object to represent cell connectivity
Definition: vtkCellArray.h:296
represent and manipulate cell attribute data
Definition: vtkCellData.h:151
abstract class to specify cell behavior
Definition: vtkCell.h:150
virtual int GetParametricCenter(double pcoords[3])
Return center of the cell in parametric coordinates.
cell represents a cubic , isoparametric 1D line
Definition: vtkCubicLine.h:65
int EvaluatePosition(const double x[3], double closestPoint[3], int &subId, double pcoords[3], double &dist2, double weights[]) override
See the vtkCell API for descriptions of these methods.
vtkCell * GetEdge(int) override
See the vtkCell API for descriptions of these methods.
Definition: vtkCubicLine.h:79
int GetNumberOfFaces() override
See the vtkCell API for descriptions of these methods.
Definition: vtkCubicLine.h:78
vtkCell * GetFace(int) override
See the vtkCell API for descriptions of these methods.
Definition: vtkCubicLine.h:80
void Derivatives(int subId, const double pcoords[3], const double *values, int dim, double *derivs) override
See the vtkCell API for descriptions of these methods.
static vtkCubicLine * New()
void InterpolateFunctions(const double pcoords[3], double weights[4]) override
Compute the interpolation functions/derivatives (aka shape functions/derivatives)
Definition: vtkCubicLine.h:127
int IntersectWithLine(const double p1[3], const double p2[3], double tol, double &t, double x[3], double pcoords[3], int &subId) override
Line-line intersection.
void EvaluateLocation(int &subId, const double pcoords[3], double x[3], double *weights) override
See the vtkCell API for descriptions of these methods.
int GetNumberOfEdges() override
See the vtkCell API for descriptions of these methods.
Definition: vtkCubicLine.h:77
double GetParametricDistance(const double pcoords[3]) override
Return the distance of the parametric coordinate provided to the cell.
double * GetParametricCoords() override
See the vtkCell API for descriptions of these methods.
int GetParametricCenter(double pcoords[3]) override
Return the center of the triangle in parametric coordinates.
Definition: vtkCubicLine.h:150
void Clip(double value, vtkDataArray *cellScalars, vtkIncrementalPointLocator *locator, vtkCellArray *lines, vtkPointData *inPd, vtkPointData *outPd, vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd, int insideOut) override
Clip this line using scalar value provided.
~vtkCubicLine() override
int GetCellType() override
See the vtkCell API for descriptions of these methods.
Definition: vtkCubicLine.h:75
int CellBoundary(int subId, const double pcoords[3], vtkIdList *pts) override
See the vtkCell API for descriptions of these methods.
static void InterpolationDerivs(const double pcoords[3], double derivs[4])
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkLine * Line
Definition: vtkCubicLine.h:141
void InterpolateDerivs(const double pcoords[3], double derivs[4]) override
Compute the interpolation functions/derivatives (aka shape functions/derivatives)
Definition: vtkCubicLine.h:131
int GetCellDimension() override
See the vtkCell API for descriptions of these methods.
Definition: vtkCubicLine.h:76
int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts) override
See the vtkCell API for descriptions of these methods.
vtkDoubleArray * Scalars
Definition: vtkCubicLine.h:142
static void InterpolationFunctions(const double pcoords[3], double weights[4])
void Contour(double value, vtkDataArray *cellScalars, vtkIncrementalPointLocator *locator, vtkCellArray *verts, vtkCellArray *lines, vtkCellArray *polys, vtkPointData *inPd, vtkPointData *outPd, vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd) override
See the vtkCell API for descriptions of these methods.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:165
dynamic, self-adjusting array of double
list of point or cell ids
Definition: vtkIdList.h:143
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition: vtkIndent.h:119
cell represents a 1D line
Definition: vtkLine.h:143
abstract superclass for non-linear cells
represent and manipulate point attribute data
Definition: vtkPointData.h:151
represent and manipulate 3D points
Definition: vtkPoints.h:149
@ value
Definition: vtkX3D.h:226
@ index
Definition: vtkX3D.h:252
@ VTK_CUBIC_LINE
Definition: vtkCellType.h:122
int vtkIdType
Definition: vtkType.h:332