SMILX  1.01
milxQtModel.h
1 /*=========================================================================
2  The Software is copyright (c) Commonwealth Scientific and Industrial Research Organisation (CSIRO)
3  ABN 41 687 119 230.
4  All rights reserved.
5 
6  Licensed under the CSIRO BSD 3-Clause License
7  You may not use this file except in compliance with the License.
8  You may obtain a copy of the License in the file LICENSE.md or at
9 
10  https://stash.csiro.au/projects/SMILI/repos/smili/browse/license.txt
11 
12  Unless required by applicable law or agreed to in writing, software
13  distributed under the License is distributed on an "AS IS" BASIS,
14  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  See the License for the specific language governing permissions and
16  limitations under the License.
17 =========================================================================*/
18 #ifndef MILXQTMODEL_H
19 #define MILXQTMODEL_H
20 
21 #include "milxQtRenderWindow.h"
22 
23 #include <vtkPoints.h>
24 #include <vtkCellArray.h>
25 #include <vtkPointData.h>
26 #include <vtkDataArray.h>
27 #include <vtkFloatArray.h>
28 #include <vtkPolyData.h>
29 #include <vtkProperty.h>
30 #include <vtkAlgorithmOutput.h>
31 #include <vtkTransform.h>
32 #include <vtkAbstractTransform.h>
33 #include <vtkMutableUndirectedGraph.h>
34 #include <vtkOutlineFilter.h>
35 #include <vtkCubeAxesActor.h>
36 //Labelling
37 #include <vtkLabeledDataMapper.h>
38 #include <vtkActor2D.h>
39 #include <vtkImageActor.h>
40 //Rendering
41 #include <vtkPolyDataMapper.h>
42 #include <vtkLODActor.h>
43 
44 #include "milxModel.h"
45 
46 static const int defaultChannelValue = 192;
47 static const float defaultColour = defaultChannelValue/255.0; //HTML Gray
48 
71 
88 
116 {
117  Q_OBJECT
118 
119 public:
124  milxQtModel(QWidget *theParent = 0, bool contextSystem = true);
129  virtual ~milxQtModel();
130 
135  inline QString strippedNamePrefix()
136  {
137  return prefix + QFileInfo(name).fileName();
138  }
139 
144  void AddInput(vtkSmartPointer<vtkPolyData> mesh);
149  void AddArray(vtkSmartPointer<vtkDataArray> array);
154  void SetInput(vtkSmartPointer<vtkPolyData> mesh);
159  //void SetInputPointSet(vtkSmartPointer<vtkPointSet> mesh);
164 // void SetNumberOfInputs(const int inputs);
171 // void SetInput(const int index, vtkSmartPointer<vtkPolyData> mesh);
176  void SetPoints(vtkSmartPointer<vtkPoints> modelPoints);
181  void SetPolys(vtkSmartPointer<vtkCellArray> modelPolys);
186  void SetScalars(vtkSmartPointer<vtkDataArray> modelScalars);
191  inline void SetActiveScalars(std::string nameOfArray)
192  { model.SetActiveScalars(nameOfArray); }
197  void RemoveScalars();
202  void SetVectors(vtkSmartPointer<vtkDataArray> modelVectors);
207  void SetTransform(vtkSmartPointer<vtkTransform> transform);
212  void SetGraph(vtkSmartPointer<vtkMutableUndirectedGraph> graph);
219  inline void SetOpacity(double opacity)
220  {
221  if(modelled) modelActor->GetProperty()->SetOpacity(opacity);
222  }
223 
224  //VTK Interfacing
231  vtkSmartPointer<vtkPolyData> GetPolyDataInput();
236  vtkSmartPointer<vtkPolyData> GetOutput();
237 #if VTK_MAJOR_VERSION <=5
238 
242  inline vtkSmartPointer<vtkAlgorithmOutput> GetOutputPort()
243  {
244  return model.GetProducerPort();
245  }
246 #endif
247 
251  inline vtkSmartPointer<vtkLODActor> GetActor()
252  {
253  return modelActor;
254  }
259  inline vtkSmartPointer<vtkActor2D> GetActor2D()
260  {
261  return modelLabelsActor;
262  }
267  inline vtkSmartPointer<vtkPolyDataMapper> GetMapper()
268  {
269  return modelMapper;
270  }
275  inline vtkIdType GetNumberOfPoints()
276  {
277  return model.GetNumberOfPoints();
278  }
283  inline vtkIdType GetNumberOfArrays()
284  {
285  return model.GetNumberOfArrays();
286  }
291  inline vtkSmartPointer<vtkPoints> GetPoints()
292  {
293  return model.GetPoints();
294  }
299  inline vtkSmartPointer<vtkDataArray> GetScalars()
300  {
301  return model.GetScalars();
302  }
307  inline vtkSmartPointer<vtkDataArray> GetVectors()
308  {
309  return model.GetVectors();
310  }
315  inline vtkSmartPointer<vtkDataArray> GetNormals()
316  {
317  return model.GetNormals();
318  }
323  inline vtkSmartPointer<vtkDataArray> GetTensors()
324  {
325  return model.GetTensors();
326  }
330  inline virtual vtkDataSet* GetDataSet()
331  {
332  return model.Result();
333  }
338  inline void SetScalarRange(double range[2])
339  {
340  modelMapper->SetScalarRange(range);
341  modelMapper->SetLookupTable(lookupTable);
342  modelMapper->Update();
343  }
348  inline void GetScalarRange(double range[2])
349  {
350  model.Result()->GetScalarRange(range);
351  }
358  inline void resetScalarRange()
359  {
360  if(GetScalars())
361  modelMapper->SetScalarRange( model.Result()->GetScalarRange() );
362  }
367  inline double * GetPoint(vtkIdType id)
368  {
369  return model.Result()->GetPoints()->GetPoint(id);
370  }
375  inline vtkSmartPointer<vtkAbstractTransform> GetTransform()
376  {
377  return vtkAbstractTransform::SafeDownCast(model.GetTransform());
378  }
385  inline double GetOpacity()
386  {
387  if(modelled) return modelActor->GetProperty()->GetOpacity();
388  return 1.0;
389  }
394  inline void Update()
395  {
396  model.Update();
397  }
398 
399  //Rendering
404  inline void setLargeDataSetMode(bool large)
405  {
406  largeMode = large;
407  }
413  {
414  if(modelled) modelMapper->ImmediateModeRenderingOn();
415  }
416 
417  //Operators
422  milxQtModel& operator=(const milxQtModel &operand);
423 
424 public slots:
425  //Display
430  void refresh();
435  inline void reset()
436  {
437  generateModel(colourRed, colourGreen, colourBlue);
438  }
443  void toggleInterpolation(bool quiet = false);
444  inline void interpolateDisplay(bool quiet = false)
445  { toggleInterpolation(quiet); }
446  inline void disableInterpolateDisplay(bool quiet = false)
447  { interpAct->setChecked(false); interpolateDisplay(quiet); }
448  inline void enableInterpolateDisplay(bool quiet = false)
449  { interpAct->setChecked(true); interpolateDisplay(quiet); }
454  void toggleSpecular(bool quiet = false);
455  inline void specularDisplay(bool quiet = false)
456  { toggleSpecular(quiet); }
457  inline void disableSpecularDisplay(bool quiet = false)
458  { specularAct->setChecked(false); specularDisplay(quiet); }
459  inline void enableSpecularDisplay(bool quiet = false)
460  { specularAct->setChecked(true); specularDisplay(quiet); }
467  virtual void copyToContextMenu(QMenu *copyMenu);
468 
469  //Computation
476  coordinate& centroid();
481  double centroidSize(bool average = false);
486  vnl_matrix<double>& covarianceMatrix();
487 
488  //Filters
493  void undoProcessing();
498  void clean();
503  void triangulate();
508  void decimate(double factor = 0.0);
513  void quadricDecimate(double factor = 0.0);
518  void clusterDecimate();
523  void renameScalars(QString newName = "");
528  void threshold(double lowValue = 0.0, double upValue = 0.0);
533  void thresholdScalars(double lowValue = 0.0, double upValue = 0.0, double outsideVal = 0.0);
538  void thresholdScalarsBinary(double lowValue = 0.0, double upValue = 0.0, double insideVal = 1.0, double outsideVal = 0.0);
543  void maskScalars(QString filename = "");
548  void gradient();
553  void smooth(int iterations = 0);
561  void smoothSinc(int iterations = 0);
566  void curvature();
571  void transform(QString filename = "", bool inverse = false);
576  void loadScalars(QString filename = "");
581  void removeScalars();
586  inline void append(milxQtModel *mdl)
587  {
588  AddInput(mdl->GetOutput());
589  }
594  void modelInfo();
601  void matchInfo(QString filename = "", bool rescale = true, double factor = 1.0);
606  void registerICP(QString filename = "", bool similarity = false);
613  void registerLandmarks(QString filename = "", bool similarity = false);
618  void voxelise();
623  virtual void contour();
628  virtual void selectPointsInContour();
633  virtual void weightGaussianFromContour(float stddev = -1.0, float clampValue = -1.0);
638  void texture();
643  void changeColour(float red = -1, float green = -1, float blue = -1);
650  void changeOpacity(float opacity = -1);
657  void normals(const bool turnOn = false);
662  void rotate(bool xAxis = false, bool yAxis = false, bool zAxis = false, float angle = 90);
667  void flip(bool xAxis = false, bool yAxis = false, bool zAxis = false);
672  void background(bool white = false);
677  void enableOutline(vtkDataObject *dataOutline = NULL);
682  void disableOutline();
687  void outlineDisplay();
692  void enableCubeAxes(double *range = NULL, double *bounds = NULL);
697  void disableCubeAxes();
702  void cubeAxesDisplay(double *range = NULL);
707  void removeOverlays();
714  virtual void enableScale(QString title = "", const bool quiet = false, double minRange = 0.0, double maxRange = 0.0, int noOfLabels = 3);
721  virtual void scaleDisplay(const bool forceDisplay = false);
726  void outputScalars(QString filename = "");
731  virtual void viewToXYPlane();
736  virtual void viewToZXPlane();
741  virtual void viewToZYPlane();
746  void showArray(QAction * action);
747  void showArray(const QString arrayName);
752  virtual void updateLookupTable();
753 
758  virtual void createMenu(QMenu *menu);
759 
760  //Generators
766  void generateDelaunayGraph(float red = defaultColour, float green = defaultColour, float blue = defaultColour);
771  void generateDelaunay2DTriangulation();
776  void generateDelaunayTriangulation(float red = defaultColour, float green = defaultColour, float blue = defaultColour);
782  void generateVertices(float red = defaultColour, float green = defaultColour, float blue = defaultColour);
788  void generateVerticesAs(const GlyphType glyphType = Circle, float red = defaultColour, float green = defaultColour, float blue = defaultColour);
794  void generateTubes(float red = defaultColour, float green = defaultColour, float blue = defaultColour);
800  inline void generateEdges(float red = defaultColour, float green = defaultColour, float blue = defaultColour)
801  {
802  generateTubes(red, blue, green);
803  }
811  void generatePointModel(double newScale = 1.0, float red = defaultColour, float green = defaultColour, float blue = defaultColour);
819  void generateSampledPoints(float distance = 0.0, float red = defaultColour, float green = defaultColour, float blue = defaultColour);
827  void generateVectorField(double newScale = 0.0, float red = defaultColour, float green = defaultColour, float blue = defaultColour);
835  void generateTensorField(double newScale = 0.0, float red = defaultColour, float green = defaultColour, float blue = defaultColour);
843  void generateStreamLines(vtkSmartPointer<vtkImageData> seeds, float timestep = 0.0);
851  void generateHedgehog(double newScale = 0.0, float red = defaultColour, float green = defaultColour, float blue = defaultColour);
857  void generateNormals(int pointNormals = 0);
864  void generateModel(float red = defaultColour, float green = defaultColour, float blue = defaultColour);
869  void generateLabels();
874  void generatePointIDsScalars();
881  void generatePoints(float red = defaultColour, float green = defaultColour, float blue = defaultColour);
887  void generateWireframe(float red = defaultColour, float green = defaultColour, float blue = defaultColour);
894  void generateSurface(float red = defaultColour, float green = defaultColour, float blue = defaultColour);
899  void generateIsoSurface(vtkSmartPointer<vtkImageData> img, int contourNumber = -1, double value = 0.0);
904  void generatePolyDataFromImage(vtkSmartPointer<vtkImageData> img);
909  void generateKMeansClustering(int numberOfClusters = 0);
914  void generateQuantisedPoints(float quantiseFactor = 0.0);
921  void generateCappedBoundaries();
926  void generateRegionLabels();
931  void generateElevation();
936  //~ void generateReebGraphs();
937 
942  virtual void updateCoords(vtkObject *obj);
943 
944 signals:
949  void surfaceToImage(vtkSmartPointer<vtkPolyData> );
954  void resultAvailable(milxQtRenderWindow*);
959  void resultAvailable(milxQtModel*);
960 
961 protected:
962  //Flags
963  bool appended;
964  bool modelled;
965  bool labelled;
966  bool scalarsSet;
967  bool transformed;
970  bool largeMode;
974 
975  float colourRed;
976  float colourGreen;
977  float colourBlue;
978 
980 
981  //Data attributes
982  coordinate modelCentroid;
983  vnl_matrix<double> modelCovarianceMatrix;
984 
985  //Display Attributes
986  vtkSmartPointer<vtkPolyDataMapper> modelMapper;
987  vtkSmartPointer<vtkLODActor> modelActor;
988  vtkSmartPointer<vtkLODActor> delaunayActor;
989  vtkSmartPointer<vtkActor2D> modelLabelsActor;
990  vtkSmartPointer<vtkActor> outlineActor;
991  vtkSmartPointer<vtkOutlineFilter> outlineMesh;
992  vtkSmartPointer<vtkCubeAxesActor> cubeAxesActor;
993 
994  //------------------
995  //Generate Menu
996  QMenu* generateMenu;
997  QAction* genModelAct;
998  QAction* genVerticesAct;
999  QAction* genNormalsAct;
1000  QAction* genVectorsAct;
1001  QAction* genTensorsAct;
1002  QAction* genHedgehogAct;
1003  QAction* genDelaunayAct;
1006  QAction* genLabelsAct;
1007  QAction* genPointIDsAct;
1008  QAction* genPointModelAct;
1009  QAction* genSamplesAct;
1010  QAction* genKmeansAct;
1011  QAction* genQuantiseAct;
1012  QAction* genCapBoundaries;
1013  QAction* genRegionLabels;
1014  QAction* genElevation;
1015  QAction* genReebGraph;
1016  //Operations Menu
1017  QMenu* operateMenu;
1018  QAction* cleanAct;
1019  QAction* triAct;
1020  QAction* decimateAct;
1023  QAction* smoothAct;
1024  QAction* smoothSincAct;
1025  QAction* curvatureAct;
1026  //Transform Menu
1027  QMenu* transformMenu;
1028  QAction* transformAct;
1029  QAction* matchAct;
1030  QAction* registerAct;
1032  QAction* voxeliseAct;
1033  //Scalars Menu
1034  QMenu* scalarMenu;
1035  QActionGroup* scalarsGroup;
1036  QAction* renameScalarsAct;
1037  QAction* thresholdAct;
1040  QAction* maskScalarsAct;
1041  QAction* gradientAct;
1042  QAction* removeScalarsAct;
1043  QAction* scalarsAct;
1044  QAction* outScalarsAct;
1045  //Show Menu
1046  QMenu* showMenu;
1047  QAction* normalsAct;
1048  QAction* centroidAct;
1049  QAction* outlineAct;
1050  QAction* cubeAxesAct;
1051  QAction* overlaysAct;
1052  //Contour menu
1053  QAction* selectPointsAct;
1054  QAction* weightAct;
1055 
1056  //Context Menu
1057  //menu defined in milxQtWindow
1058  //------------------
1059  QAction* doAct;
1060  //------------------
1061  QAction* infoAct;
1062  QAction* textureAct;
1063  QAction* flipAct;
1064  QAction* rotateAct;
1065  //------------------
1066  QAction* colourAct;
1067  QAction* interpAct;
1068  QAction* specularAct;
1069 
1070  //View Menu
1071  //------------------
1072  QActionGroup* displayGroup;
1073  QAction* pointsAct;
1074  QAction* wireframeAct;
1075  QAction* surfaceAct;
1076  QActionGroup* arrayGroup;
1077  QMenu* arrayMenu;
1078  //------------------
1079 
1080  //Helper Members
1085  void resetFlags();
1090  void createActions();
1095  void createConnections();
1100  void setupTooltips();
1105  void contextMenuEvent(QContextMenuEvent *event);
1110  QMenu* basicContextMenu();
1115  QMenu* generationMenu();
1120  QMenu* operationsMenu();
1125  QMenu* transformsMenu();
1130  QMenu* scalarsMenu();
1135  QMenu* arraysMenu();
1136 
1137 private:
1138  QPointer<milxQtModel> normalsModel;
1139  QPointer<milxQtModel> centroidModel;
1140  QPointer<milxQtModel> outlineModel;
1141 };
1142 
1143 #endif // MILXQTMODEL_H
virtual void createMenu(QMenu *menu)
Create the menu for the data in this object. Used for context menu and file menus.
QAction * infoAct
Action for showing the model info.
Definition: milxQtModel.h:1061
float colourRed
Saved colour, used for refresh etc.
Definition: milxQtModel.h:975
vtkSmartPointer< vtkLODActor > delaunayActor
Delaunay triangulator actor.
Definition: milxQtModel.h:988
QAction * gradientAct
Action for calculating gradient of the scalars of a model.
Definition: milxQtModel.h:1041
QAction * genKmeansAct
Action for calculating k-means clustering of points in a model.
Definition: milxQtModel.h:1010
QAction * normalsAct
Action for showing the normals of a model.
Definition: milxQtModel.h:1047
QAction * outlineAct
show outline action
Definition: milxQtModel.h:1049
QActionGroup * arrayGroup
Grouping for check boxes.
Definition: milxQtModel.h:1076
QAction * voxeliseAct
Action for voxelising surface.
Definition: milxQtModel.h:1032
virtual void enableScale(QString title="", const bool quiet=false, double minRange=0.0, double maxRange=0.0, int noOfLabels=3)
Enable scale bar display with the title provided.
vtkSmartPointer< vtkActor2D > modelLabelsActor
Label Actor.
Definition: milxQtModel.h:989
QAction * maskScalarsAct
Action for masking scalar values on model.
Definition: milxQtModel.h:1040
vtkSmartPointer< vtkActor2D > GetActor2D()
Returns the VTK actor 2D used.
Definition: milxQtModel.h:259
QAction * overlaysAct
removes actors/overlays action
Definition: milxQtModel.h:1051
QAction * weightAct
produce Gaussian weights from contour
Definition: milxQtModel.h:1054
QAction * textureAct
Action for extracting texture.
Definition: milxQtModel.h:1062
vtkSmartPointer< vtkAlgorithmOutput > GetOutputPort()
Returns the connection to the mesh data object (PolyData) used internally VTK style. Call after generate functions. EXPERIMENTAL.
Definition: milxQtModel.h:242
vtkSmartPointer< vtkLODActor > modelActor
Model actor.
Definition: milxQtModel.h:987
QAction * smoothSincAct
Action for smooth model.
Definition: milxQtModel.h:1024
QAction * pointsAct
Show points.
Definition: milxQtModel.h:1073
QAction * genVectorsAct
Action for generating vector fields.
Definition: milxQtModel.h:1000
vnl_matrix< double > modelCovarianceMatrix
Covariance matrix of the model.
Definition: milxQtModel.h:983
vtkSmartPointer< vtkPolyDataMapper > modelMapper
Model mapper.
Definition: milxQtModel.h:986
This class represents the MILX Qt Render Window Display object using QVTK.
QAction * scalarsAct
Action for loading scalars from another model.
Definition: milxQtModel.h:1043
QActionGroup * scalarsGroup
Grouping for scalars.
Definition: milxQtModel.h:1035
QAction * genDelaunayTri2DAct
Action for generating Delaunay triangulation.
Definition: milxQtModel.h:1004
QAction * genLabelsAct
Action for generating labels.
Definition: milxQtModel.h:1006
vtkSmartPointer< vtkDataArray > GetTensors()
Returns the tensors (3x3 matrix per vertex) of the model currently held.
Definition: milxQtModel.h:323
vtkSmartPointer< vtkPoints > GetPoints()
Returns the points of the model currently held.
Definition: milxQtModel.h:291
QAction * genReebGraph
Action for Reeb graphs of mesh.
Definition: milxQtModel.h:1015
vtkSmartPointer< vtkAbstractTransform > GetTransform()
Returns the transform of the model currently held.
Definition: milxQtModel.h:375
void createConnections()
Create the connections for context menu etc.
QAction * surfaceAct
Show surface.
Definition: milxQtModel.h:1075
QAction * genTensorsAct
Action for generating vector fields.
Definition: milxQtModel.h:1001
void setLargeDataSetMode(bool large)
Set display mode to memory conserving and fast rendering (in most cases).
Definition: milxQtModel.h:404
virtual vtkDataSet * GetDataSet()
Get the polydata data, return the vtkImageData object downcast to vtkDataSet, useful for getting scal...
Definition: milxQtModel.h:330
QAction * smoothAct
Action for smooth model.
Definition: milxQtModel.h:1023
bool transformed
Transformed?
Definition: milxQtModel.h:967
QAction * removeScalarsAct
Action for removing scalars from model.
Definition: milxQtModel.h:1042
virtual void contour()
Draw contour interactively.
bool largeMode
Large Data set mode enabled?
Definition: milxQtModel.h:970
virtual void updateLookupTable()
Implement this into your derived class to ensure the new colourmap is passed on to your viewing data ...
virtual void viewToZXPlane()
Change view to zx-plane.
QAction * wireframeAct
Show wireframe.
Definition: milxQtModel.h:1074
QAction * quadricDecimateAct
Action for Quadric decimating model.
Definition: milxQtModel.h:1021
QAction * renameScalarsAct
Action for renaming scalars array.
Definition: milxQtModel.h:1036
float colourGreen
Saved colour, used for refresh etc.
Definition: milxQtModel.h:976
QAction * registerLandmarkAct
Action for registering two models via landmark transform.
Definition: milxQtModel.h:1031
bool appended
Appended data present?
Definition: milxQtModel.h:963
virtual void copyToContextMenu(QMenu *copyMenu)
Copies the menu, by duplicating the entries, to the context menu. Connections are assumed to be made ...
QAction * triAct
Action for triangulate model.
Definition: milxQtModel.h:1019
vtkSmartPointer< vtkOutlineFilter > outlineMesh
outline box
Definition: milxQtModel.h:991
double * GetPoint(vtkIdType id)
Returns the point with id of the model currently held.
Definition: milxQtModel.h:367
QAction * registerAct
Action for registering two models.
Definition: milxQtModel.h:1030
QAction * centroidAct
show centroid action
Definition: milxQtModel.h:1048
vtkIdType GetNumberOfPoints()
Returns the total number of points of the model currently held.
Definition: milxQtModel.h:275
QAction * genQuantiseAct
Action for quantising points in a model.
Definition: milxQtModel.h:1011
bool modelled
Model has been generated?
Definition: milxQtModel.h:964
This class represents the MILX Qt Model/Mesh Display object using VTK.
Definition: milxQtModel.h:115
bool computedCovariance
Computed covariance matrix already?
Definition: milxQtModel.h:969
QAction * genCapBoundaries
Action for capping the boundaries of a open mesh.
Definition: milxQtModel.h:1012
QAction * decimateAct
Action for decimating model.
Definition: milxQtModel.h:1020
QAction * specularAct
Action for changing the specular of a model to flat.
Definition: milxQtModel.h:1068
QAction * cleanAct
Action for cleaning model.
Definition: milxQtModel.h:1018
bool scalarsSet
Scalars set to points of mesh?
Definition: milxQtModel.h:966
bool outlineBefore
scale displayed?
Definition: milxQtModel.h:971
#define MILXQT_EXPORT
Define Windows DLL importing.
Definition: milxQtAliases.h:80
QAction * curvatureAct
Action for calculating mean curvation of a model.
Definition: milxQtModel.h:1025
void SetOpacity(double opacity)
Adjusts the opacity of the model in the display. 1.0 is totally opaque and 0.0 is completely transpar...
Definition: milxQtModel.h:219
QAction * genDelaunayTriAct
Action for generating Delaunay triangulation.
Definition: milxQtModel.h:1005
void SetScalarRange(double range[2])
Set the scalar range of the model currently held.
Definition: milxQtModel.h:338
float colourBlue
Saved colour, used for refresh etc.
Definition: milxQtModel.h:977
virtual void updateCoords(vtkObject *obj)
Picks the coordinates and pixel value from the current mouse position in the window.
QAction * colourAct
Action for changing colours of a model.
Definition: milxQtModel.h:1066
QAction * cubeAxesAct
show cube axes action
Definition: milxQtModel.h:1050
QAction * genRegionLabels
Action for labelling unconnected regions of mesh.
Definition: milxQtModel.h:1013
void contextMenuEvent(QContextMenuEvent *event)
The context menu setup member.
vtkSmartPointer< vtkPolyDataMapper > GetMapper()
Returns the VTK mapper used.
Definition: milxQtModel.h:267
bool cubeAxesBefore
scale displayed?
Definition: milxQtModel.h:972
void createActions()
Create the actions for context menu etc.
QAction * thresholdScalarsAct
Action for thresholding scalar values on model.
Definition: milxQtModel.h:1038
QAction * clusterDecimateAct
Action for Cluster decimating model.
Definition: milxQtModel.h:1022
QAction * flipAct
Action for flipping surface.
Definition: milxQtModel.h:1063
bool computedCentroid
Computed centroid already?
Definition: milxQtModel.h:968
QAction * genModelAct
Action for generating model.
Definition: milxQtModel.h:997
virtual void scaleDisplay(const bool forceDisplay=false)
Toggles the scale bar display.
vtkSmartPointer< vtkPolyData > GetOutput()
Returns the mesh data object (PolyData) used internally VTK style.
QMenu * arrayMenu
arrays Menu
Definition: milxQtModel.h:1077
vtkSmartPointer< vtkDataArray > GetScalars()
Returns the scalars of the model currently held.
Definition: milxQtModel.h:299
QAction * genVerticesAct
Action for generating vertices.
Definition: milxQtModel.h:998
void reset()
Reset the display of the model, includes camera and regeneration.
Definition: milxQtModel.h:435
void resetScalarRange()
Restores the scalar range of the model currently held to current max range for display.
Definition: milxQtModel.h:358
bool labelled
Labels generated?
Definition: milxQtModel.h:965
QAction * genPointModelAct
Action for generating labels.
Definition: milxQtModel.h:1008
QString strippedNamePrefix()
Returns the stripped (path removed) name of the data with "Model" prefix.
Definition: milxQtModel.h:135
QAction * selectPointsAct
select points within contour
Definition: milxQtModel.h:1053
QMenu * transformMenu
Transform Menu.
Definition: milxQtModel.h:1027
QMenu * scalarMenu
Context Menu.
Definition: milxQtModel.h:1034
QAction * genSamplesAct
Action for generating sampled points on mesh.
Definition: milxQtModel.h:1009
vtkSmartPointer< vtkActor > outlineActor
Outline box actor.
Definition: milxQtModel.h:990
virtual void viewToZYPlane()
Change view to zy-plane.
QAction * thresholdScalarsBinaryAct
Action for binary thresholding scalar values on model.
Definition: milxQtModel.h:1039
vtkSmartPointer< vtkDataArray > GetVectors()
Returns the vectors of the model currently held.
Definition: milxQtModel.h:307
void SetActiveScalars(std::string nameOfArray)
Sets the array of name as scalars for the model to be generated.
Definition: milxQtModel.h:191
QMenu * showMenu
Camera Menu.
Definition: milxQtModel.h:1046
void Update()
Update the model currently held.
Definition: milxQtModel.h:394
QAction * genNormalsAct
Action for generating normals.
Definition: milxQtModel.h:999
void generateEdges(float red=defaultColour, float green=defaultColour, float blue=defaultColour)
Generates the tubes for the dataset. Arguments provided are for the colours of the tubes...
Definition: milxQtModel.h:800
void append(milxQtModel *mdl)
Appends the provided model to current model.
Definition: milxQtModel.h:586
QAction * genHedgehogAct
Action for generating Hedgehog fields.
Definition: milxQtModel.h:1002
QAction * thresholdAct
Action for thresholding model.
Definition: milxQtModel.h:1037
Represents a model (i.e. a model with cells and scalar values) and their common operations. Also allows batch operations on collection of models.
Definition: milxModel.h:113
double GetOpacity()
Returns the opacity of the model in the display. 1.0 is totally opaque and 0.0 is completely transpar...
Definition: milxQtModel.h:385
QAction * matchAct
Action for matching scale and centroids of two models.
Definition: milxQtModel.h:1029
QAction * outScalarsAct
Action for output of scalars.
Definition: milxQtModel.h:1044
virtual void viewToXYPlane()
Change view to xy-plane.
void ImmediateModeRenderingOn()
Improve rendering performance for large datasets. Assumes generateModel() has already been called...
Definition: milxQtModel.h:412
milx::Model model
Actual model and its operations (from SMILI)
Definition: milxQtModel.h:979
QMenu * generateMenu
Menu for generating viewing options.
Definition: milxQtModel.h:996
void refresh()
Refresh the display of the model including widgets. Camera remains as is.
vtkSmartPointer< vtkDataArray > GetNormals()
Returns the normals of the model currently held.
Definition: milxQtModel.h:315
QMenu * operateMenu
Operate Menu.
Definition: milxQtModel.h:1017
vtkSmartPointer< vtkLODActor > GetActor()
Returns the VTK actor used.
Definition: milxQtModel.h:251
QAction * interpAct
Action for changing the interpolation of a model.
Definition: milxQtModel.h:1067
QAction * genDelaunayAct
Action for generating Delaunay graphs.
Definition: milxQtModel.h:1003
QActionGroup * displayGroup
Grouping for check boxes.
Definition: milxQtModel.h:1072
QAction * rotateAct
Action for rotating surface.
Definition: milxQtModel.h:1064
QAction * doAct
Action for undoing and redoing actions.
Definition: milxQtModel.h:1059
virtual void background(bool white=false)
Changes background to white.
vtkSmartPointer< vtkCubeAxesActor > cubeAxesActor
outline box
Definition: milxQtModel.h:992
bool undidProcess
Undid a process?
Definition: milxQtModel.h:973
void GetScalarRange(double range[2])
Get the scalar range of the model currently held.
Definition: milxQtModel.h:348
QAction * genElevation
Action for elevation scalars of mesh.
Definition: milxQtModel.h:1014
QAction * genPointIDsAct
Action for generating labels.
Definition: milxQtModel.h:1007
vtkIdType GetNumberOfArrays()
Returns the total number of arrays in the model.
Definition: milxQtModel.h:283
QAction * transformAct
Action for transforming model.
Definition: milxQtModel.h:1028