Commit 190b87555d6313fe007f8a0c1ac29eed3c7055f4

Authored by Charles Otto
1 parent 30d1f4d5

Remove original Show transform, rename Show2 to Show

Also, change the default waitKey value to be consistent with original
Show
openbr/plugins/gui.cpp
... ... @@ -111,20 +111,19 @@ public slots:
111 111 * \ingroup transforms
112 112 * \brief Displays templates in a GUI pop-up window using QT.
113 113 * \author Charles Otto \cite caotto
114   - * Unlike ShowTransform, this can be used with parallelism enabled, although it
115   - * is considered TimeVarying.
  114 + * Can be used with parallelism enabled, although it is considered TimeVarying.
116 115 */
117   -class Show2Transform : public TimeVaryingTransform
  116 +class ShowTransform : public TimeVaryingTransform
118 117 {
119 118 Q_OBJECT
120 119 public:
121 120 Q_PROPERTY(bool waitInput READ get_waitInput WRITE set_waitInput RESET reset_waitInput STORED false)
122   - BR_PROPERTY(bool, waitInput, false)
  121 + BR_PROPERTY(bool, waitInput, true)
123 122  
124 123 Q_PROPERTY(QStringList keys READ get_keys WRITE set_keys RESET reset_keys STORED false)
125 124 BR_PROPERTY(QStringList, keys, QStringList("FrameNumber"))
126 125  
127   - Show2Transform() : TimeVaryingTransform(false, false)
  126 + ShowTransform() : TimeVaryingTransform(false, false)
128 127 {
129 128 // Create our GUI proxy
130 129 gui = new GUIProxy();
... ... @@ -136,7 +135,7 @@ public:
136 135 connect(this, SIGNAL(updateImage(QPixmap)), gui,SLOT(showImage(QPixmap)));
137 136 }
138 137  
139   - ~Show2Transform()
  138 + ~ShowTransform()
140 139 {
141 140 delete gui;
142 141 }
... ... @@ -145,7 +144,7 @@ public:
145 144  
146 145 void project(const TemplateList &src, TemplateList &dst) const
147 146 {
148   - Transform * non_const = (Show2Transform *) this;
  147 + Transform * non_const = (ShowTransform *) this;
149 148 non_const->projectUpdate(src,dst);
150 149 }
151 150  
... ... @@ -210,7 +209,7 @@ signals:
210 209 void hideWindow();
211 210 };
212 211  
213   -BR_REGISTER(Transform, Show2Transform)
  212 +BR_REGISTER(Transform, ShowTransform)
214 213  
215 214 class FPSSynch : public TimeVaryingTransform
216 215 {
... ...
openbr/plugins/misc.cpp
... ... @@ -51,46 +51,6 @@ BR_REGISTER(Transform, OpenTransform)
51 51  
52 52 /*!
53 53 * \ingroup transforms
54   - * \brief Displays templates in a GUI pop-up window.
55   - * \author Josh Klontz \cite jklontz
56   - */
57   -class ShowTransform : public UntrainableMetaTransform
58   -{
59   - Q_OBJECT
60   - Q_PROPERTY(bool waitKey READ get_waitKey WRITE set_waitKey RESET reset_waitKey STORED false)
61   - BR_PROPERTY(bool, waitKey, true)
62   -
63   - static int counter;
64   - int uid;
65   -
66   - void init()
67   - {
68   - uid = counter++;
69   - Globals->setProperty("parallelism", "0"); // Can only work in single threaded mode
70   - }
71   -
72   - void project(const Template &src, Template &dst) const
73   - {
74   - dst = src;
75   -
76   - if (Globals->parallelism) {
77   - qWarning("Show::project() only works in single threaded mode.");
78   - return;
79   - }
80   -
81   - for (int i=0; i<src.size(); i++)
82   - OpenCVUtils::showImage(src[i], "Show" + (counter*src.size() > 1 ? "-" + QString::number(uid*src.size()+i) : QString()), false);
83   -
84   - if (waitKey && !src.isEmpty()) cv::waitKey(-1);
85   - }
86   -};
87   -
88   -int ShowTransform::counter = 0;
89   -
90   -BR_REGISTER(Transform, ShowTransform)
91   -
92   -/*!
93   - * \ingroup transforms
94 54 * \brief Prints the template's file to stdout or stderr.
95 55 * \author Josh Klontz \cite jklontz
96 56 */
... ...