34 #ifndef vtkTensorRepresentation_h
35 #define vtkTensorRepresentation_h
37 #include "vtkInteractionWidgetsModule.h"
40 VTK_ABI_NAMESPACE_BEGIN
85 void SetTensor(
double tensor[9]);
86 void SetSymmetricTensor(
double symTensor[6]);
87 void GetTensor(
double tensor[9]) { std::copy(this->Tensor, this->Tensor + 9, tensor); }
90 symTensor[0] = this->Tensor[0];
91 symTensor[1] = this->Tensor[4];
92 symTensor[2] = this->Tensor[8];
93 symTensor[3] = this->Tensor[1];
94 symTensor[4] = this->Tensor[2];
95 symTensor[5] = this->Tensor[5];
107 std::copy(this->Eigenvalues, this->Eigenvalues + 3, evals);
111 n = (n < 0 ? 0 : (n > 2 ? 2 : n));
112 std::copy(this->Eigenvectors[n], this->Eigenvectors[n] + 3, ev);
122 void SetPosition(
double pos[3]);
125 std::copy(this->TensorPosition, this->TensorPosition + 3, pos);
148 vtkGetObjectMacro(SelectedHandleProperty,
vtkProperty);
158 vtkGetObjectMacro(SelectedFaceProperty,
vtkProperty);
168 vtkGetObjectMacro(SelectedOutlineProperty,
vtkProperty);
184 void SetOutlineFaceWires(
bool);
185 vtkGetMacro(OutlineFaceWires,
bool);
196 void SetOutlineCursorWires(
bool);
197 vtkGetMacro(OutlineCursorWires,
bool);
207 virtual void HandlesOn();
208 virtual void HandlesOff();
215 void SetTensorEllipsoid(
bool);
216 vtkGetMacro(TensorEllipsoid,
bool);
227 void PlaceTensor(
double tensor[9],
double position[3]);
240 unsigned long event,
void* calldata) override;
242 unsigned long event,
void* calldata) override;
244 unsigned long event,
void* calldata,
int modify = 0) override;
246 unsigned long event,
void* calldata) override;
253 void ReleaseGraphicsResources(
vtkWindow*) override;
255 int RenderTranslucentPolygonalGeometry(
vtkViewport*) override;
256 vtkTypeBool HasTranslucentPolygonalGeometry() override;
283 void SetInteractionState(
int state);
290 vtkGetMacro(SnapToAxes,
bool);
291 vtkSetMacro(SnapToAxes,
bool);
313 vtkGetMacro(TranslationAxis,
int);
314 vtkSetClampMacro(TranslationAxis,
int, -1, 2);
340 double Eigenvalues[3];
341 double Eigenvectors[3][3];
342 double TensorPosition[3];
345 double LastEventPosition[3];
346 double LastEventOrientation[4];
347 double StartEventOrientation[4];
348 double SnappedEventOrientations[3][4];
349 bool SnappedOrientation[3];
371 virtual void PositionHandles();
372 int HighlightHandle(
vtkProp* prop);
373 void HighlightFace(
int cellId);
374 void HighlightOutline(
int highlight);
375 virtual void ComputeNormals();
376 virtual void SizeHandles();
414 virtual void CreateDefaultProperties();
420 void GenerateOutline();
422 void UpdateTensorFromWidget();
423 void UpdateWidgetFromTensor();
424 void UpdateTensorEigenfunctions(
double tensor[3][3]);
427 virtual void Translate(
const double* p1,
const double* p2);
428 virtual void Scale(
const double* p1,
const double* p2,
int X,
int Y);
429 virtual void Rotate(
int X,
int Y,
const double* p1,
const double* p2,
const double* vpn);
430 void MovePlusXFace(
const double* p1,
const double* p2,
bool entry);
431 void MoveMinusXFace(
const double* p1,
const double* p2,
bool entry);
432 void MovePlusYFace(
const double* p1,
const double* p2,
bool entry);
433 void MoveMinusYFace(
const double* p1,
const double* p2,
bool entry);
434 void MovePlusZFace(
const double* p1,
const double* p2,
bool entry);
435 void MoveMinusZFace(
const double* p1,
const double* p2,
bool entry);
436 void UpdatePose(
const double* p1,
const double* d1,
const double* p2,
const double* d2);
447 void MoveFace(
const double* p1,
const double* p2,
const double*
dir,
double* x1,
double* x2,
448 double* x3,
double* x4,
double* x5);
452 void GetDirection(
const double Nx[3],
const double Ny[3],
const double Nz[3],
double dir[3]);
459 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