34 #ifndef vtkTensorRepresentation_h
35 #define vtkTensorRepresentation_h
37 #include "vtkInteractionWidgetsModule.h"
43 VTK_ABI_NAMESPACE_BEGIN
89 void SetTensor(
double tensor[9]);
90 void SetSymmetricTensor(
double symTensor[6]);
91 void GetTensor(
double tensor[9]) { std::copy(this->Tensor, this->Tensor + 9, tensor); }
94 symTensor[0] = this->Tensor[0];
95 symTensor[1] = this->Tensor[4];
96 symTensor[2] = this->Tensor[8];
97 symTensor[3] = this->Tensor[1];
98 symTensor[4] = this->Tensor[2];
99 symTensor[5] = this->Tensor[5];
111 std::copy(this->Eigenvalues, this->Eigenvalues + 3, evals);
116 std::copy(this->Eigenvectors[n], this->Eigenvectors[n] + 3, ev);
126 void SetPosition(
double pos[3]);
129 std::copy(this->TensorPosition, this->TensorPosition + 3, pos);
152 vtkGetObjectMacro(SelectedHandleProperty,
vtkProperty);
162 vtkGetObjectMacro(SelectedFaceProperty,
vtkProperty);
172 vtkGetObjectMacro(SelectedOutlineProperty,
vtkProperty);
188 void SetOutlineFaceWires(
bool);
189 vtkGetMacro(OutlineFaceWires,
bool);
200 void SetOutlineCursorWires(
bool);
201 vtkGetMacro(OutlineCursorWires,
bool);
211 virtual void HandlesOn();
212 virtual void HandlesOff();
219 void SetTensorEllipsoid(
bool);
220 vtkGetMacro(TensorEllipsoid,
bool);
231 void PlaceTensor(
double tensor[9],
double position[3]);
244 unsigned long event,
void* calldata) override;
246 unsigned long event,
void* calldata) override;
248 unsigned long event,
void* calldata,
int modify = 0) override;
250 unsigned long event,
void* calldata) override;
257 void ReleaseGraphicsResources(
vtkWindow*) override;
259 int RenderTranslucentPolygonalGeometry(
vtkViewport*) override;
260 vtkTypeBool HasTranslucentPolygonalGeometry() override;
287 void SetInteractionState(
int state);
294 vtkGetMacro(SnapToAxes,
bool);
295 vtkSetMacro(SnapToAxes,
bool);
317 vtkGetMacro(TranslationAxis,
int);
318 vtkSetClampMacro(TranslationAxis,
int, -1, 2);
344 double Eigenvalues[3];
345 double Eigenvectors[3][3];
346 double TensorPosition[3];
349 double LastEventPosition[3];
350 double LastEventOrientation[4];
351 double StartEventOrientation[4];
352 double SnappedEventOrientations[3][4];
353 bool SnappedOrientation[3];
375 virtual void PositionHandles();
376 int HighlightHandle(
vtkProp* prop);
377 void HighlightFace(
int cellId);
378 void HighlightOutline(
int highlight);
379 virtual void ComputeNormals();
380 virtual void SizeHandles();
418 virtual void CreateDefaultProperties();
424 void GenerateOutline();
426 void UpdateTensorFromWidget();
427 void UpdateWidgetFromTensor();
428 void UpdateTensorEigenfunctions(
double tensor[3][3]);
431 virtual void Translate(
const double* p1,
const double* p2);
432 virtual void Scale(
const double* p1,
const double* p2,
int X,
int Y);
433 virtual void Rotate(
int X,
int Y,
const double* p1,
const double* p2,
const double* vpn);
434 void MovePlusXFace(
const double* p1,
const double* p2,
bool entry);
435 void MoveMinusXFace(
const double* p1,
const double* p2,
bool entry);
436 void MovePlusYFace(
const double* p1,
const double* p2,
bool entry);
437 void MoveMinusYFace(
const double* p1,
const double* p2,
bool entry);
438 void MovePlusZFace(
const double* p1,
const double* p2,
bool entry);
439 void MoveMinusZFace(
const double* p1,
const double* p2,
bool entry);
440 void UpdatePose(
const double* p1,
const double* d1,
const double* p2,
const double* d2);
451 void MoveFace(
const double* p1,
const double* p2,
const double*
dir,
double* x1,
double* x2,
452 double* x3,
double* x4,
double* x5);
456 void GetDirection(
const double Nx[3],
const double Ny[3],
const double Nz[3],
double dir[3]);
463 VTK_ABI_NAMESPACE_END
vtkProperty * SelectedFaceProperty
vtkPolyData * HexFacePolyData
abstract superclass for all actors, volumes and annotations
void GetEigenvalues(double evals[3])
These are methods used to retrieve derived information about the tensor.
void SetTranslationAxisOff()
Toggles constraint translation axis on/off.
bool IsTranslationConstrained()
Returns true if ConstrainedAxis.
represents an object (geometry & properties) in a rendered scene
vtkProperty * FaceProperty
void OutlineFaceWiresOn()
Control the representation of the outline.
represent and manipulate 4x4 transformation matrices
void TensorEllipsoidOff()
Indicate whether to show the tensor ellipsoid.
represent the position of a point in 3D space
vtkPolyData * OutlinePolyData
vtkPolyDataMapper * OutlineMapper
abstract specification for Viewports
represent surface properties of a geometric object
vtkTransform * EllipsoidTransform
void SetXTranslationAxisOn()
Toggles constraint translation axis on/off.
vtkProperty * OutlineProperty
void SetZTranslationAxisOn()
Toggles constraint translation axis on/off.
void GetEigenvector(int n, double ev[3])
These are methods used to retrieve derived information about the tensor.
implicit function for convex set of planes
vtkPolyDataMapper * EllipsoidMapper
concrete dataset represents vertices, lines, polygons, and triangle strips
vtkPolyDataMapper * HexMapper
void GetPosition(double pos[3])
Set/Get a position for the location of the tensor.
dynamic, self-adjusting array of double
vtkCellPicker * HandlePicker
window superclass for vtkRenderWindow
platform-independent render window interaction including picking and frame rate control.
create a polygonal sphere centered at the origin
Superclass for algorithms that produce only polydata as output.
vtkMatrix4x4 * EllipsoidMatrix
a simple class to control print indentation
class defining a representation for the vtkTensorWidget
vtkSphereSource * EllipsoidSource
vtkProperty * SelectedOutlineProperty
void OutlineCursorWiresOn()
Control the representation of the outline.
vtkDoubleArray * PlaneNormals
vtkCellPicker * LastPicker
perform various plane computations
void OutlineFaceWiresOff()
Control the representation of the outline.
vtkPolyData * HexPolyData
void OutlineCursorWiresOff()
Control the representation of the outline.
#define VTK_SIZEHINT(...)
vtkActor * EllipsoidActor
void SetYTranslationAxisOn()
Toggles constraint translation axis on/off.
vtkPolyDataMapper * HexFaceMapper
create a line defined by two end points
map vtkPolyData to graphics primitives
void GetSymmetricTensor(double symTensor[6])
These are the basic methods used to define the tensor (these methods coordinate with the overloaded P...
vtkPolyDataMapper ** HandleMapper
vtkCellPicker * HexPicker
vtkProperty * HandleProperty
void TensorEllipsoidOn()
Indicate whether to show the tensor ellipsoid.
ray-cast cell picker for all kinds of Prop3Ds
vtkProperty * EllipsoidProperty
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
vtkProperty * SelectedHandleProperty
implicit function for a bounding box
vtkSphereSource ** HandleGeometry
void GetTensor(double tensor[9])
These are the basic methods used to define the tensor (these methods coordinate with the overloaded P...
represent and manipulate 3D points