ctkVTKScalarsToColorsView.cpp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  1. /*=========================================================================
  2. Library: CTK
  3. Copyright (c) Kitware Inc.
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0.txt
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. =========================================================================*/
  14. // Qt includes
  15. #include <QColorDialog>
  16. // CTK includes
  17. #include "ctkLogger.h"
  18. #include "ctkVTKScalarsToColorsView.h"
  19. // VTK includes
  20. #include <vtkAxis.h>
  21. #include <vtkChartXY.h>
  22. #include <vtkColorTransferControlPointsItem.h>
  23. #include <vtkColorTransferFunction.h>
  24. #include <vtkColorTransferFunctionItem.h>
  25. #include <vtkCompositeControlPointsItem.h>
  26. #include <vtkCompositeTransferFunctionItem.h>
  27. #include <vtkIdTypeArray.h>
  28. #include <vtkLookupTable.h>
  29. #include <vtkLookupTableItem.h>
  30. #include <vtkPen.h>
  31. #include <vtkPiecewiseControlPointsItem.h>
  32. #include <vtkPiecewiseFunction.h>
  33. #include <vtkPiecewiseFunctionItem.h>
  34. #include <vtkSmartPointer.h>
  35. //----------------------------------------------------------------------------
  36. static ctkLogger logger("org.commontk.visualization.vtk.widgets.ctkVTKScalarsToColorsView");
  37. //----------------------------------------------------------------------------
  38. class ctkVTKScalarsToColorsViewPrivate
  39. {
  40. Q_DECLARE_PUBLIC(ctkVTKScalarsToColorsView);
  41. protected:
  42. ctkVTKScalarsToColorsView* const q_ptr;
  43. public:
  44. ctkVTKScalarsToColorsViewPrivate(ctkVTKScalarsToColorsView& object);
  45. void init();
  46. void updateBounds();
  47. void showBorders(bool);
  48. };
  49. // ----------------------------------------------------------------------------
  50. // ctkVTKScalarsToColorsViewPrivate methods
  51. // ----------------------------------------------------------------------------
  52. ctkVTKScalarsToColorsViewPrivate::ctkVTKScalarsToColorsViewPrivate(ctkVTKScalarsToColorsView& object)
  53. :q_ptr(&object)
  54. {
  55. }
  56. // ----------------------------------------------------------------------------
  57. void ctkVTKScalarsToColorsViewPrivate::init()
  58. {
  59. Q_Q(ctkVTKScalarsToColorsView);
  60. vtkChartXY* chart = q->chart();
  61. chart->SetAutoAxes(false);
  62. chart->SetHiddenAxisBorder(0);
  63. this->showBorders(true);
  64. QObject::connect(q, SIGNAL(boundsChanged()), q, SLOT(onBoundsChanged()));
  65. q->onChartUpdated();
  66. }
  67. // ----------------------------------------------------------------------------
  68. void ctkVTKScalarsToColorsViewPrivate::showBorders(bool visible)
  69. {
  70. Q_Q(ctkVTKScalarsToColorsView);
  71. vtkChartXY* chart = q->chart();
  72. for (int i = 0; i < 4; ++i)
  73. {
  74. chart->GetAxis(i)->SetVisible(true);
  75. chart->GetAxis(i)->GetPen()->SetOpacityF(0.3);
  76. chart->GetAxis(i)->SetTitle("");
  77. chart->GetAxis(i)->SetNumberOfTicks(0);
  78. chart->GetAxis(i)->SetLabelsVisible(false);
  79. chart->GetAxis(i)->SetMargins(7.,7.);
  80. if (visible)
  81. {
  82. chart->GetAxis(i)->SetBehavior(2);
  83. }
  84. else
  85. {
  86. chart->GetAxis(i)->SetBehavior(1);
  87. }
  88. }
  89. }
  90. // ----------------------------------------------------------------------------
  91. // ctkVTKScalarsToColorsView methods
  92. // ----------------------------------------------------------------------------
  93. ctkVTKScalarsToColorsView::ctkVTKScalarsToColorsView(QWidget* parentWidget)
  94. :ctkVTKChartView(parentWidget)
  95. , d_ptr(new ctkVTKScalarsToColorsViewPrivate(*this))
  96. {
  97. Q_D(ctkVTKScalarsToColorsView);
  98. d->init();
  99. }
  100. // ----------------------------------------------------------------------------
  101. ctkVTKScalarsToColorsView::~ctkVTKScalarsToColorsView()
  102. {
  103. }
  104. // ----------------------------------------------------------------------------
  105. void ctkVTKScalarsToColorsView::addPlot(vtkPlot* plot)
  106. {
  107. if (vtkColorTransferControlPointsItem::SafeDownCast(plot))
  108. {
  109. this->qvtkConnect(plot, vtkControlPointsItem::CurrentPointEditEvent,
  110. this, SLOT(editPoint(vtkObject*,void*)));
  111. }
  112. this->Superclass::addPlot(plot);
  113. }
  114. // ----------------------------------------------------------------------------
  115. void ctkVTKScalarsToColorsView::onBoundsChanged()
  116. {
  117. this->boundAxesToChartBounds();
  118. this->setAxesToChartBounds();
  119. this->Superclass::onChartUpdated();
  120. }
  121. // ----------------------------------------------------------------------------
  122. vtkPlot* ctkVTKScalarsToColorsView::addLookupTable(vtkLookupTable* lut)
  123. {
  124. vtkSmartPointer<vtkLookupTableItem> item =
  125. vtkSmartPointer<vtkLookupTableItem>::New();
  126. item->SetLookupTable(lut);
  127. this->addPlot(item);
  128. return item;
  129. }
  130. // ----------------------------------------------------------------------------
  131. vtkPlot* ctkVTKScalarsToColorsView
  132. ::addColorTransferFunction(vtkColorTransferFunction* colorTF,
  133. bool editable)
  134. {
  135. vtkSmartPointer<vtkColorTransferFunctionItem> item =
  136. vtkSmartPointer<vtkColorTransferFunctionItem>::New();
  137. item->SetColorTransferFunction(colorTF);
  138. this->addPlot(item);
  139. if (editable)
  140. {
  141. this->addColorTransferFunctionControlPoints(colorTF);
  142. }
  143. return item;
  144. }
  145. // ----------------------------------------------------------------------------
  146. vtkPlot* ctkVTKScalarsToColorsView
  147. ::addOpacityFunction(vtkPiecewiseFunction* opacityTF,
  148. bool editable)
  149. {
  150. return this->addPiecewiseFunction(opacityTF, editable);
  151. }
  152. // ----------------------------------------------------------------------------
  153. vtkPlot* ctkVTKScalarsToColorsView
  154. ::addPiecewiseFunction(vtkPiecewiseFunction* piecewiseTF,
  155. bool editable)
  156. {
  157. vtkSmartPointer<vtkPiecewiseFunctionItem> item =
  158. vtkSmartPointer<vtkPiecewiseFunctionItem>::New();
  159. item->SetPiecewiseFunction(piecewiseTF);
  160. QColor defaultColor = this->palette().highlight().color();
  161. item->SetColor(defaultColor.redF(), defaultColor.greenF(), defaultColor.blueF());
  162. item->SetMaskAboveCurve(true);
  163. this->addPlot(item);
  164. if (editable)
  165. {
  166. this->addPiecewiseFunctionControlPoints(piecewiseTF);
  167. }
  168. return item;
  169. }
  170. // ----------------------------------------------------------------------------
  171. vtkPlot* ctkVTKScalarsToColorsView
  172. ::addCompositeFunction(vtkColorTransferFunction* colorTF,
  173. vtkPiecewiseFunction* opacityTF,
  174. bool colorTFEditable, bool opacityTFEditable)
  175. {
  176. vtkSmartPointer<vtkCompositeTransferFunctionItem> item =
  177. vtkSmartPointer<vtkCompositeTransferFunctionItem>::New();
  178. item->SetColorTransferFunction(colorTF);
  179. item->SetOpacityFunction(opacityTF);
  180. item->SetMaskAboveCurve(true);
  181. this->addPlot(item);
  182. if (colorTFEditable && opacityTFEditable)
  183. {
  184. this->addCompositeFunctionControlPoints(colorTF, opacityTF);
  185. }
  186. else if (colorTFEditable)
  187. {
  188. this->addColorTransferFunctionControlPoints(colorTF);
  189. }
  190. else if (opacityTFEditable)
  191. {
  192. this->addOpacityFunctionControlPoints(opacityTF);
  193. }
  194. return item;
  195. }
  196. // ----------------------------------------------------------------------------
  197. vtkPlot* ctkVTKScalarsToColorsView
  198. ::addColorTransferFunctionControlPoints(vtkColorTransferFunction* colorTF)
  199. {
  200. vtkSmartPointer<vtkColorTransferControlPointsItem> controlPointsItem =
  201. vtkSmartPointer<vtkColorTransferControlPointsItem>::New();
  202. controlPointsItem->SetColorTransferFunction(colorTF);
  203. this->addPlot(controlPointsItem);
  204. return controlPointsItem;
  205. }
  206. // ----------------------------------------------------------------------------
  207. vtkPlot* ctkVTKScalarsToColorsView
  208. ::addOpacityFunctionControlPoints(vtkPiecewiseFunction* opacityTF)
  209. {
  210. return this->addPiecewiseFunctionControlPoints(opacityTF);
  211. }
  212. // ----------------------------------------------------------------------------
  213. vtkPlot* ctkVTKScalarsToColorsView
  214. ::addCompositeFunctionControlPoints(vtkColorTransferFunction* colorTF,
  215. vtkPiecewiseFunction* opacityTF)
  216. {
  217. vtkSmartPointer<vtkCompositeControlPointsItem> controlPointsItem =
  218. vtkSmartPointer<vtkCompositeControlPointsItem>::New();
  219. controlPointsItem->SetColorTransferFunction(colorTF);
  220. controlPointsItem->SetOpacityFunction(opacityTF);
  221. this->addPlot(controlPointsItem);
  222. return controlPointsItem;
  223. }
  224. // ----------------------------------------------------------------------------
  225. vtkPlot* ctkVTKScalarsToColorsView
  226. ::addPiecewiseFunctionControlPoints(vtkPiecewiseFunction* piecewiseTF)
  227. {
  228. vtkSmartPointer<vtkPiecewiseControlPointsItem> controlPointsItem =
  229. vtkSmartPointer<vtkPiecewiseControlPointsItem>::New();
  230. controlPointsItem->SetPiecewiseFunction(piecewiseTF);
  231. this->addPlot(controlPointsItem);
  232. return controlPointsItem;
  233. }
  234. // ----------------------------------------------------------------------------
  235. QList<vtkPlot*> ctkVTKScalarsToColorsView::plots()const
  236. {
  237. QList<vtkPlot*> res;
  238. const vtkIdType count = this->chart()->GetNumberOfPlots();
  239. for(vtkIdType i = 0; i < count; ++i)
  240. {
  241. res << this->chart()->GetPlot(i);
  242. }
  243. return res;
  244. }
  245. // ----------------------------------------------------------------------------
  246. QList<vtkControlPointsItem*> ctkVTKScalarsToColorsView
  247. ::controlPointsItems()const
  248. {
  249. QList<vtkControlPointsItem*> res;
  250. foreach(vtkPlot* plot, this->plots())
  251. {
  252. vtkControlPointsItem* controlPointsItem =
  253. vtkControlPointsItem::SafeDownCast(plot);
  254. if (controlPointsItem)
  255. {
  256. res << controlPointsItem;
  257. }
  258. }
  259. return res;
  260. }
  261. // ----------------------------------------------------------------------------
  262. QList<vtkPlot*> ctkVTKScalarsToColorsView::lookupTablePlots()const
  263. {
  264. QList<vtkPlot*> res;
  265. foreach(vtkPlot* plot, this->plots())
  266. {
  267. if (vtkLookupTableItem::SafeDownCast(plot))
  268. {
  269. res << plot;
  270. }
  271. }
  272. return res;
  273. }
  274. // ----------------------------------------------------------------------------
  275. QList<vtkPlot*> ctkVTKScalarsToColorsView::lookupTablePlots(vtkLookupTable* lut)const
  276. {
  277. QList<vtkPlot*> res;
  278. foreach(vtkPlot* plot, this->lookupTablePlots())
  279. {
  280. vtkLookupTableItem* item = vtkLookupTableItem::SafeDownCast(plot);
  281. if (item->GetLookupTable() == lut)
  282. {
  283. res << plot;
  284. }
  285. }
  286. return res;
  287. }
  288. // ----------------------------------------------------------------------------
  289. QList<vtkPlot*> ctkVTKScalarsToColorsView::colorTransferFunctionPlots()const
  290. {
  291. QList<vtkPlot*> res;
  292. foreach(vtkPlot* plot, this->plots())
  293. {
  294. if (vtkColorTransferFunctionItem::SafeDownCast(plot) ||
  295. vtkColorTransferControlPointsItem::SafeDownCast(plot))
  296. {
  297. res << plot;
  298. }
  299. }
  300. return res;
  301. }
  302. // ----------------------------------------------------------------------------
  303. QList<vtkPlot*> ctkVTKScalarsToColorsView
  304. ::colorTransferFunctionPlots(vtkColorTransferFunction* colorTF)const
  305. {
  306. QList<vtkPlot*> res;
  307. foreach(vtkPlot* plot, this->colorTransferFunctionPlots())
  308. {
  309. vtkColorTransferFunctionItem* item =
  310. vtkColorTransferFunctionItem::SafeDownCast(plot);
  311. if (item
  312. && item->GetColorTransferFunction() == colorTF)
  313. {
  314. res << plot;
  315. }
  316. vtkColorTransferControlPointsItem* controlPointsItem =
  317. vtkColorTransferControlPointsItem::SafeDownCast(plot);
  318. if (controlPointsItem
  319. && controlPointsItem->GetColorTransferFunction() == colorTF)
  320. {
  321. res << plot;
  322. }
  323. }
  324. return res;
  325. }
  326. // ----------------------------------------------------------------------------
  327. QList<vtkPlot*> ctkVTKScalarsToColorsView::opacityFunctionPlots()const
  328. {
  329. QList<vtkPlot*> res;
  330. foreach(vtkPlot* plot, this->plots())
  331. {
  332. if (vtkPiecewiseFunctionItem::SafeDownCast(plot) ||
  333. vtkPiecewiseControlPointsItem::SafeDownCast(plot) ||
  334. vtkCompositeTransferFunctionItem::SafeDownCast(plot) ||
  335. vtkCompositeControlPointsItem::SafeDownCast(plot))
  336. {
  337. res << plot;
  338. }
  339. }
  340. return res;
  341. }
  342. // ----------------------------------------------------------------------------
  343. QList<vtkPlot*> ctkVTKScalarsToColorsView
  344. ::opacityFunctionPlots(vtkPiecewiseFunction* opacityTF)const
  345. {
  346. QList<vtkPlot*> res;
  347. foreach(vtkPlot* plot, this->opacityFunctionPlots())
  348. {
  349. vtkPiecewiseFunctionItem* item =
  350. vtkPiecewiseFunctionItem::SafeDownCast(plot);
  351. if (item
  352. && item->GetPiecewiseFunction() == opacityTF)
  353. {
  354. res << plot;
  355. }
  356. vtkPiecewiseControlPointsItem* controlPointsItem =
  357. vtkPiecewiseControlPointsItem::SafeDownCast(plot);
  358. if (controlPointsItem
  359. && controlPointsItem->GetPiecewiseFunction() == opacityTF)
  360. {
  361. res << plot;
  362. }
  363. vtkCompositeTransferFunctionItem* compositeItem =
  364. vtkCompositeTransferFunctionItem::SafeDownCast(plot);
  365. if (compositeItem
  366. && compositeItem->GetOpacityFunction() == opacityTF)
  367. {
  368. res << plot;
  369. }
  370. vtkCompositeControlPointsItem* compositeControlPointsItem =
  371. vtkCompositeControlPointsItem::SafeDownCast(plot);
  372. if (compositeControlPointsItem
  373. && compositeControlPointsItem->GetOpacityFunction() == opacityTF)
  374. {
  375. res << plot;
  376. }
  377. }
  378. return res;
  379. }
  380. // ----------------------------------------------------------------------------
  381. void ctkVTKScalarsToColorsView::setLookuptTableToPlots(vtkLookupTable* lut)
  382. {
  383. foreach(vtkLookupTableItem* plot,
  384. this->plots<vtkLookupTableItem>())
  385. {
  386. plot->SetLookupTable(lut);
  387. }
  388. this->onChartUpdated();
  389. }
  390. // ----------------------------------------------------------------------------
  391. void ctkVTKScalarsToColorsView
  392. ::setColorTransferFunctionToPlots(vtkColorTransferFunction* colorTF)
  393. {
  394. foreach(vtkColorTransferFunctionItem* plot,
  395. this->plots<vtkColorTransferFunctionItem>())
  396. {
  397. plot->SetColorTransferFunction(colorTF);
  398. }
  399. foreach(vtkColorTransferControlPointsItem* plot,
  400. this->plots<vtkColorTransferControlPointsItem>())
  401. {
  402. plot->SetColorTransferFunction(colorTF);
  403. }
  404. this->onChartUpdated();
  405. }
  406. // ----------------------------------------------------------------------------
  407. void ctkVTKScalarsToColorsView
  408. ::setOpacityFunctionToPlots(vtkPiecewiseFunction* opacityTF)
  409. {
  410. this->setPiecewiseFunctionToPlots(opacityTF);
  411. foreach(vtkCompositeTransferFunctionItem* plot,
  412. this->plots<vtkCompositeTransferFunctionItem>())
  413. {
  414. plot->SetOpacityFunction(opacityTF);
  415. }
  416. foreach(vtkCompositeControlPointsItem* plot,
  417. this->plots<vtkCompositeControlPointsItem>())
  418. {
  419. plot->SetOpacityFunction(opacityTF);
  420. }
  421. this->onChartUpdated();
  422. }
  423. // ----------------------------------------------------------------------------
  424. void ctkVTKScalarsToColorsView
  425. ::setPiecewiseFunctionToPlots(vtkPiecewiseFunction* piecewiseTF)
  426. {
  427. foreach(vtkPiecewiseFunctionItem* plot,
  428. this->plots<vtkPiecewiseFunctionItem>())
  429. {
  430. plot->SetPiecewiseFunction(piecewiseTF);
  431. }
  432. foreach(vtkPiecewiseControlPointsItem* plot,
  433. this->plots<vtkPiecewiseControlPointsItem>())
  434. {
  435. plot->SetPiecewiseFunction(piecewiseTF);
  436. }
  437. this->onChartUpdated();
  438. }
  439. // ----------------------------------------------------------------------------
  440. bool ctkVTKScalarsToColorsView
  441. ::areBordersVisible()const
  442. {
  443. Q_D(const ctkVTKScalarsToColorsView);
  444. return this->chart()->GetAxis(0)->GetVisible();
  445. }
  446. // ----------------------------------------------------------------------------
  447. void ctkVTKScalarsToColorsView
  448. ::setBordersVisible(bool show)
  449. {
  450. Q_D(ctkVTKScalarsToColorsView);
  451. d->showBorders(show);
  452. }
  453. // ----------------------------------------------------------------------------
  454. void ctkVTKScalarsToColorsView
  455. ::setPlotsUserBounds(double* bounds)
  456. {
  457. double plotBounds[4];
  458. this->chartBoundsToPlotBounds(bounds, plotBounds);
  459. foreach(vtkScalarsToColorsItem* plot,
  460. this->plots<vtkScalarsToColorsItem>())
  461. {
  462. plot->SetUserBounds(plotBounds);
  463. }
  464. foreach(vtkControlPointsItem* plot,
  465. this->plots<vtkControlPointsItem>())
  466. {
  467. plot->SetUserBounds(plotBounds);
  468. }
  469. }
  470. // ----------------------------------------------------------------------------
  471. void ctkVTKScalarsToColorsView::editPoint(vtkObject* caller, void* callData)
  472. {
  473. vtkControlPointsItem* controlPoints = reinterpret_cast<vtkControlPointsItem*>(caller);
  474. int pointToEdit = reinterpret_cast<unsigned long>(callData);
  475. if (!controlPoints || pointToEdit < 0)
  476. {
  477. return;
  478. }
  479. vtkColorTransferControlPointsItem* colorTransferFunctionItem =
  480. vtkColorTransferControlPointsItem::SafeDownCast(controlPoints);
  481. vtkCompositeControlPointsItem* compositeControlPoints =
  482. vtkCompositeControlPointsItem::SafeDownCast(controlPoints);
  483. if (colorTransferFunctionItem &&
  484. (!compositeControlPoints ||
  485. compositeControlPoints->GetPointsFunction() == vtkCompositeControlPointsItem::ColorPointsFunction ||
  486. compositeControlPoints->GetPointsFunction() == vtkCompositeControlPointsItem::ColorAndOpacityPointsFunction))
  487. {
  488. double xrgbms[6];
  489. vtkColorTransferFunction* colorTF = colorTransferFunctionItem->GetColorTransferFunction();
  490. colorTF->GetNodeValue(pointToEdit, xrgbms);
  491. QColor oldColor = QColor::fromRgbF(xrgbms[1], xrgbms[2], xrgbms[3]);
  492. QColor newColor = QColorDialog::getColor(oldColor, this);
  493. if (newColor.isValid())
  494. {
  495. xrgbms[1] = newColor.redF();
  496. xrgbms[2] = newColor.greenF();
  497. xrgbms[3] = newColor.blueF();
  498. colorTF->SetNodeValue(pointToEdit, xrgbms);
  499. }
  500. }
  501. }
  502. // ----------------------------------------------------------------------------
  503. void ctkVTKScalarsToColorsView::boundAxesToChartBounds()
  504. {
  505. this->Superclass::boundAxesToChartBounds();
  506. /// We only set the plot user bounds if the chart is using User bounds.
  507. double userBounds[8];
  508. this->chartUserBounds(userBounds);
  509. if (userBounds[0] < userBounds[1])
  510. {
  511. this->setPlotsUserBounds(userBounds);
  512. }
  513. }
  514. // ----------------------------------------------------------------------------
  515. void ctkVTKScalarsToColorsView::moveAllPoints(double xOffset, double yOffset)
  516. {
  517. vtkVector2f offset(xOffset, yOffset);
  518. foreach(vtkControlPointsItem* controlPointsItem, this->controlPointsItems())
  519. {
  520. vtkSmartPointer<vtkIdTypeArray> ids;
  521. ids.TakeReference(controlPointsItem->GetControlPointsIds());
  522. controlPointsItem->MovePoints(offset, ids.GetPointer());
  523. }
  524. }
  525. // ----------------------------------------------------------------------------
  526. void ctkVTKScalarsToColorsView::spreadAllPoints(double factor)
  527. {
  528. foreach(vtkControlPointsItem* controlPointsItem, this->controlPointsItems())
  529. {
  530. vtkSmartPointer<vtkIdTypeArray> ids;
  531. ids.TakeReference(controlPointsItem->GetControlPointsIds());\
  532. controlPointsItem->SpreadPoints(factor, ids.GetPointer());
  533. }
  534. }