2 * @file GetInfoDialog.h
3 * Declares the GetInfoDialog class.
8 * Copyright 2012 Joel Baxter
10 * This file is part of MeshTex.
12 * MeshTex is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation, either version 2 of the License, or
15 * (at your option) any later version.
17 * MeshTex is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with MeshTex. If not, see <http://www.gnu.org/licenses/>.
26 #if !defined(INCLUDED_GETINFODIALOG_H)
27 #define INCLUDED_GETINFODIALOG_H
29 #include "GenericDialog.h"
30 #include "SetScaleDialog.h"
31 #include "MeshVisitor.h"
33 #include "generic/referencecounted.h"
36 * Subclass of GenericDialog that implements the window summoned by selecting
37 * the Get Info menu entry. This window allows the user to query information
38 * about selected meshes and optionally transfer some of that information to
39 * the Set S/T Scale dialog.
41 * @image html getinfo.png
45 class GetInfoDialog : public GenericDialog
47 private: // private types
50 * Visitor for interrogating a mesh.
52 class GetInfoVisitor : public MeshVisitor
55 GetInfoVisitor(const int *refRow,
57 const MeshEntity::TexInfoCallback *rowTexInfoCallback,
58 const MeshEntity::TexInfoCallback *colTexInfoCallback);
60 bool Execute(MeshEntity& meshEntity) const;
64 const MeshEntity::TexInfoCallback *_rowTexInfoCallback;
65 const MeshEntity::TexInfoCallback *_colTexInfoCallback;
68 public: // public methods
70 GetInfoDialog(const std::string& key,
71 SmartPointer<SetScaleDialog>& setScaleDialog);
75 private: // private member vars
78 * Handle on the Set S/T Scale dialog.
80 SmartPointer<SetScaleDialog> _setScaleDialog;
83 * Callback to process row texture scale information from a query.
85 MeshEntity::TexInfoCallback _rowTexInfoCallback;
88 * Callback to process column texture scale information from a query.
90 MeshEntity::TexInfoCallback _colTexInfoCallback;
93 * Action-less mesh visitor used purely to count the number of selected mesh
96 SmartPointer<MeshVisitor> _nullVisitor;
99 #endif // #if !defined(INCLUDED_GETINFODIALOG_H)