DlgDisplayPropertiesImp.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (c) 2002 Jürgen Riegel <juergen.riegel@web.de>              *
00003  *                                                                         *
00004  *   This file is part of the FreeCAD CAx development system.              *
00005  *                                                                         *
00006  *   This library is free software; you can redistribute it and/or         *
00007  *   modify it under the terms of the GNU Library General Public           *
00008  *   License as published by the Free Software Foundation; either          *
00009  *   version 2 of the License, or (at your option) any later version.      *
00010  *                                                                         *
00011  *   This library  is distributed in the hope that it will be useful,      *
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00014  *   GNU Library General Public License for more details.                  *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU Library General Public     *
00017  *   License along with this library; see the file COPYING.LIB. If not,    *
00018  *   write to the Free Software Foundation, Inc., 59 Temple Place,         *
00019  *   Suite 330, Boston, MA  02111-1307, USA                                *
00020  *                                                                         *
00021  ***************************************************************************/
00022 
00023 
00024 #ifndef GUI_DIALOG_DLGDISPLAYPROPERTIES_IMP_H
00025 #define GUI_DIALOG_DLGDISPLAYPROPERTIES_IMP_H
00026 
00027 #include <vector>
00028 #include <boost/signals.hpp>
00029 
00030 #include "ui_DlgDisplayProperties.h"
00031 #include "Selection.h"
00032 #include <App/Material.h>
00033 
00034 namespace App
00035 {
00036   class Property;
00037 }
00038 
00039 namespace Gui {
00040 
00041   class ViewProvider;
00042   class Command;
00043 
00044 namespace Dialog {
00045 typedef boost::signals::connection DlgDisplayPropertiesImp_Connection;
00046 
00052 class DlgDisplayPropertiesImp : public QDialog, public Ui_DlgDisplayProperties,
00053                                 public Gui::SelectionSingleton::ObserverType
00054 {
00055     Q_OBJECT
00056 
00057 public:
00058     DlgDisplayPropertiesImp( QWidget* parent = 0, Qt::WFlags fl = 0 );
00059     ~DlgDisplayPropertiesImp();
00061     void OnChange(Gui::SelectionSingleton::SubjectType &rCaller,
00062                   Gui::SelectionSingleton::MessageType Reason);
00063 
00064 private Q_SLOTS:
00065     void on_changeMaterial_activated(const QString&);
00066     void on_changeMode_activated(const QString&);
00067     void on_changePlot_activated(const QString&);
00068     void on_buttonColor_changed();
00069     void on_spinTransparency_valueChanged(int);
00070     void on_spinPointSize_valueChanged(int);
00071     void on_buttonLineColor_changed();
00072     void on_spinLineWidth_valueChanged(int);
00073     void on_spinLineTransparency_valueChanged(int);
00074     void on_buttonUserDefinedMaterial_clicked();
00075     void on_buttonColorPlot_clicked();
00076 
00077 protected:
00078     void changeEvent(QEvent *e);
00079 
00080 private:
00081     void slotChangedObject(const Gui::ViewProvider&, const App::Property& Prop);
00082     void reject();
00083     void setDisplayModes(const std::vector<ViewProvider*>&);
00084     void setMaterial(const std::vector<ViewProvider*>&);
00085     void setColorPlot(const std::vector<ViewProvider*>&);
00086     void fillupMaterials();
00087     void setShapeColor(const std::vector<ViewProvider*>&);
00088     void setLineColor(const std::vector<ViewProvider*>&);
00089     void setPointSize(const std::vector<ViewProvider*>&);
00090     void setLineWidth(const std::vector<ViewProvider*>&);
00091     void setTransparency(const std::vector<ViewProvider*>&);
00092     void setLineTransparency(const std::vector<ViewProvider*>&);
00093     std::vector<ViewProvider*> getSelection() const;
00094     QMap<QString, App::Material::MaterialType> Materials;
00095 
00096     DlgDisplayPropertiesImp_Connection connectChangedObject;
00097 };
00098 
00099 } // namespace Dialog
00100 } // namespace Gui
00101 
00102 #endif // GUI_DIALOG_DLGDISPLAYPROPERTIES_IMP_H

Generated on Wed Nov 23 19:00:06 2011 for FreeCAD by  doxygen 1.6.1