46 #ifndef vtkTensorRepresentation_h
47 #define vtkTensorRepresentation_h
49 #include "vtkInteractionWidgetsModule.h"
96 void SetTensor(
double tensor[9]);
97 void SetSymmetricTensor(
double symTensor[6]);
98 void GetTensor(
double tensor[9]) { std::copy(this->Tensor, this->Tensor + 9, tensor); }
101 symTensor[0] = this->Tensor[0];
102 symTensor[1] = this->Tensor[4];
103 symTensor[2] = this->Tensor[8];
104 symTensor[3] = this->Tensor[1];
105 symTensor[4] = this->Tensor[2];
106 symTensor[5] = this->Tensor[5];
118 std::copy(this->Eigenvalues, this->Eigenvalues + 3, evals);
122 n = (n < 0 ? 0 : (n > 2 ? 2 : n));
123 std::copy(this->Eigenvectors[n], this->Eigenvectors[n] + 3, ev);
133 void SetPosition(
double pos[3]);
136 std::copy(this->TensorPosition, this->TensorPosition + 3, pos);
159 vtkGetObjectMacro(SelectedHandleProperty,
vtkProperty);
169 vtkGetObjectMacro(SelectedFaceProperty,
vtkProperty);
179 vtkGetObjectMacro(SelectedOutlineProperty,
vtkProperty);
195 void SetOutlineFaceWires(
bool);
196 vtkGetMacro(OutlineFaceWires,
bool);
207 void SetOutlineCursorWires(
bool);
208 vtkGetMacro(OutlineCursorWires,
bool);
218 virtual void HandlesOn();
219 virtual void HandlesOff();
226 void SetTensorEllipsoid(
bool);
227 vtkGetMacro(TensorEllipsoid,
bool);
238 void PlaceTensor(
double tensor[9],
double position[3]);
251 unsigned long event,
void* calldata) override;
253 unsigned long event,
void* calldata) override;
255 unsigned long event,
void* calldata,
int modify = 0) override;
257 unsigned long event,
void* calldata) override;
264 void ReleaseGraphicsResources(
vtkWindow*) override;
266 int RenderTranslucentPolygonalGeometry(
vtkViewport*) override;
267 vtkTypeBool HasTranslucentPolygonalGeometry() override;
294 void SetInteractionState(
int state);
301 vtkGetMacro(SnapToAxes,
bool);
302 vtkSetMacro(SnapToAxes,
bool);
324 vtkGetMacro(TranslationAxis,
int);
325 vtkSetClampMacro(TranslationAxis,
int, -1, 2);
351 double Eigenvalues[3];
352 double Eigenvectors[3][3];
353 double TensorPosition[3];
356 double LastEventPosition[3];
357 double LastEventOrientation[4];
358 double StartEventOrientation[4];
359 double SnappedEventOrientations[3][4];
360 bool SnappedOrientation[3];
382 virtual void PositionHandles();
383 int HighlightHandle(
vtkProp* prop);
384 void HighlightFace(
int cellId);
385 void HighlightOutline(
int highlight);
386 virtual void ComputeNormals();
387 virtual void SizeHandles();
425 virtual void CreateDefaultProperties();
431 void GenerateOutline();
433 void UpdateTensorFromWidget();
434 void UpdateWidgetFromTensor();
435 void UpdateTensorEigenfunctions(
double tensor[3][3]);
438 virtual void Translate(
const double* p1,
const double* p2);
439 virtual void Scale(
const double* p1,
const double* p2,
int X,
int Y);
440 virtual void Rotate(
int X,
int Y,
const double* p1,
const double* p2,
const double* vpn);
441 void MovePlusXFace(
const double* p1,
const double* p2,
bool entry);
442 void MoveMinusXFace(
const double* p1,
const double* p2,
bool entry);
443 void MovePlusYFace(
const double* p1,
const double* p2,
bool entry);
444 void MoveMinusYFace(
const double* p1,
const double* p2,
bool entry);
445 void MovePlusZFace(
const double* p1,
const double* p2,
bool entry);
446 void MoveMinusZFace(
const double* p1,
const double* p2,
bool entry);
447 void UpdatePose(
const double* p1,
const double* d1,
const double* p2,
const double* d2);
458 void MoveFace(
const double* p1,
const double* p2,
const double*
dir,
double* x1,
double* x2,
459 double* x3,
double* x4,
double* x5);
463 void GetDirection(
const double Nx[3],
const double Ny[3],
const double Nz[3],
double dir[3]);
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 ContrainedAxis.
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