SMILX  1.01
milxQtAnimatePlugin.cpp
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 #include "milxQtAnimatePlugin.h"
19 
20 #include <qplugin.h>
21 
23 {
25  MainWindow = qobject_cast<milxQtMain *>(theParent);
26 
27  threaded = false;
28  dockable = false;
29  consoleWindow = false;
30  extension = false;
31  pluginName = "Animate";
32  dataName = "";
33 
34  createConnections();
35 }
36 
37 milxQtAnimatePlugin::~milxQtAnimatePlugin()
38 {
39  if(isRunning() && threaded)
40  quit();
41  cerr << "Animate Plugin Destroyed." << endl;
42 }
43 
45 {
46  return pluginName;
47 }
48 
50 {
51  QString openPythonExt = "";
52 
53  return openPythonExt;
54 }
55 
57 {
58  QStringList exts;
59 
60  return exts;
61 }
62 
64 {
65  QStringList exts;
66 
67  return exts;
68 }
69 
71 {
72  QString savePythonExt = "";
73 
74  return savePythonExt;
75 }
76 
77 void milxQtAnimatePlugin::SetInputCollection(vtkPolyDataCollection* collection, QStringList &filenames)
78 {
79  cout << "Loading Collection via the Animate Plugin" << endl;
80  animateModel = new milxQtAnimateModel(MainWindow);
81  animateModel->SetInputCollection(collection, filenames);
82  animateModel->setConsole(console);
83  cout << "Loaded Collection as an animation." << endl;
84 
86 // QStringList headingList;
87 //
88 // headingList << "Index" << "Case ID"; //!< Case Browser
89 // if(!caseManagerCreated)
90 // {
91 // caseTabIndex = manager->newTab("Case Browser", headingList);
92 // caseManagerCreated = true;
93 // }
94 // else
95 // manager->clearTab(caseTabIndex);
96 //
97 // cout << "Loading cases into browser." << endl;
98 // QList< int > cases = shapes.last()->getCaseIDs();
99 // for(int j = 0; j < cases.size(); j ++)
100 // {
101 // QStringList caseList;
102 //
103 // caseList << QString::number(j) << "Case " + QString::number(cases[j]);
104 //
105 // manager->addItem(caseTabIndex, caseList, Qt::NoItemFlags);
106 // }
107 //
108 // manager->show();
109 }
110 
111 void milxQtAnimatePlugin::open(QString filename)
112 {
113 
114 }
115 
116 void milxQtAnimatePlugin::save(QString filename)
117 {
118 
119 }
120 
122 {
123  return NULL;
124 } //No image result
125 
127 {
128  return animateModel;
129 } //No image result
130 
132 {
133  return NULL;
134 } //No image result
135 
137 {
138  return NULL;
139 } //No Dock result
140 
142 {
143 // if(pluginWindow(window) == 0)
144 // return false;
145 // else
146  return true;
147 }
148 
150 {
151  if(window)
152  return qobject_cast<milxQtAnimateModel *>(window);
153  return 0;
154 }
155 
157 {
158 
159 }
160 
162 {
163  QMutexLocker locker(&mutex); //Lock memory
164 
166 
167  //exec();
168 }
169 
170 void milxQtAnimatePlugin::createConnections()
171 {
172  //QObject::connect(denoiseAct, SIGNAL(triggered(bool)), denoiseModel, SLOT(denoise()));
173 }
174 
175 Q_EXPORT_PLUGIN2(animatePlugin, milxQtAnimatePluginFactory);
bool threaded
Threaded plugin?
This class represents the MILX Qt Render Window Display object using QVTK.
bool consoleWindow
console window?
This class represents the MILX Qt Image Display object using VTK.
Definition: milxQtImage.h:118
void open(QString filename)
Open the file using the plugin. [Implement this in your plugin].
bool extension
Extension rather than a plugin?
milxQtImage * imageResult()
Get the image result. The result can then be displayed in milxQtMain etc.[Implement this in your plug...
QString name()
Get the Name of the plugin. [Implement this in your plugin].
milxQtAnimateModel * pluginWindow(QWidget *window)
This class represents the MILX Qt Model/Mesh Display object using VTK.
Definition: milxQtModel.h:115
QDockWidget * dockWidget()
Return the dock widget (if one is provided by plugin). [Implement this in your plugin].
bool dockable
Dockable plugin?
milxQtAnimatePlugin(QObject *theParent=0)
milxQtRenderWindow * genericResult()
Get the generic result, which is a milxQtRenderWindow. The result can then be displayed in milxQtMain...
QStringList openExtensions()
Get a list of supported file format extensions. [Implement this in your plugin].
QString openFileSupport()
Get the file support string for opening (extension wildcard list). [Implement this in your plugin]...
milxQtConsole * console
console for logging
QPointer< milxQtAnimateModel > animateModel
Model extension.
The interface for any plugins that can be made for milxQtMain.
void save(QString filename)
Save the result as a file using the plugin. [Implement this in your plugin].
milxQtModel * modelResult()
Get the model result. The result can then be displayed in milxQtMain etc. [Implement this in your plu...
QString saveFileSupport()
Get the file support string for saving (extension wildcard list). [Implement this in your plugin]...
QStringList saveExtensions()
Get a list of supported file format extensions. [Implement this in your plugin].
void SetInputCollection(vtkPolyDataCollection *collection, QStringList &filenames)
Pass a collection to internal plugin class. [Implement this in your plugin].
This class represents the MILX Qt Main Window object using Qt.
Definition: milxQtMain.h:85
bool isPluginWindow(QWidget *window)
Is the window provided a plugin generated window? In this case a milxQtShapeModel window...