itom 2.2.1
K:/git-itom/sources/itom/plot/AbstractDObjPCLFigure.h
00001 /* ********************************************************************
00002     itom software
00003     URL: http://www.uni-stuttgart.de/ito
00004     Copyright (C) 2016, Institut fuer Technische Optik (ITO),
00005     Universitaet Stuttgart, Germany
00006 
00007     This file is part of itom and its software development toolkit (SDK).
00008 
00009     itom is free software; you can redistribute it and/or modify it
00010     under the terms of the GNU Library General Public Licence as published by
00011     the Free Software Foundation; either version 2 of the Licence, or (at
00012     your option) any later version.
00013    
00014     In addition, as a special exception, the Institut fuer Technische
00015     Optik (ITO) gives you certain additional rights.
00016     These rights are described in the ITO LGPL Exception version 1.0,
00017     which can be found in the file LGPL_EXCEPTION.txt in this package.
00018 
00019     itom is distributed in the hope that it will be useful, but
00020     WITHOUT ANY WARRANTY; without even the implied warranty of
00021     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library
00022     General Public Licence for more details.
00023 
00024     You should have received a copy of the GNU Library General Public License
00025     along with itom. If not, see <http://www.gnu.org/licenses/>.
00026 *********************************************************************** */
00027 
00028 #ifndef ABSTRACTDOBJPCLFIGURE_H
00029 #define ABSTRACTDOBJPCLFIGURE_H
00030 
00031 #include "AbstractFigure.h"
00032 #include "../DataObject/dataobj.h"
00033 #if defined USEPCL || ITOM_POINTCLOUDLIBRARY
00034 #include "../PointCloud/pclStructures.h"
00035 #endif
00036 #include "../common/sharedStructuresQt.h"
00037 #include "../common/addInInterface.h"
00038 #include "../common/interval.h"
00039 #include "../common/qtMetaTypeDeclarations.h"
00040 
00041 #include <qpointer.h>
00042 #include <qpixmap.h>
00043 
00044 
00045 #if !defined(Q_MOC_RUN) || defined(ITOMCOMMONPLOT_MOC) //only moc this file in itomCommonQtLib but not in other libraries or executables linking against this itomCommonQtLib
00046 
00047 namespace ito {
00048 
00049     class ITOMCOMMONPLOT_EXPORT AbstractDObjPclFigure : public AbstractFigure
00050 {
00051     Q_OBJECT
00052     Q_PROPERTY(QSharedPointer<ito::DataObject> dataObject READ getDataObject WRITE setDataObject DESIGNABLE false USER false)   
00053 #ifdef USEPCL //this symbol is automatically defined if the itom SDK is compiled with PCL support (set in itom_sdk.cmake)
00054     Q_PROPERTY(QSharedPointer<ito::PCLPointCloud> pointCloud READ getPointCloud WRITE setPointCloud DESIGNABLE false USER false)
00055     Q_PROPERTY(QSharedPointer<ito::PCLPolygonMesh> polygonMesh READ getPolygonMesh WRITE setPolygonMesh DESIGNABLE false USER false)
00056 #endif
00057 
00058     Q_PROPERTY(ito::AutoInterval xAxisInterval READ getXAxisInterval WRITE setXAxisInterval DESIGNABLE true USER true)
00059     Q_PROPERTY(ito::AutoInterval yAxisInterval READ getYAxisInterval WRITE setYAxisInterval DESIGNABLE true USER true)
00060     Q_PROPERTY(ito::AutoInterval zAxisInterval READ getZAxisInterval WRITE setZAxisInterval DESIGNABLE true USER true)
00061     Q_PROPERTY(QString colorMap READ getColorMap WRITE setColorMap DESIGNABLE true USER true)
00062 
00063     Q_CLASSINFO("prop://dataObject", "Sets the input data object for this plot.")
00064     Q_CLASSINFO("prop://polygonMesh", "Sets the input polygon mesh for this plot.")
00065     Q_CLASSINFO("prop://pointCloud", "Sets the input point cloud for this plot.")
00066 
00067     Q_CLASSINFO("prop://xAxisInterval", "Sets the visible range of the displayed x-axis (in coordinates of the data object) or (0.0, 0.0) if range should be automatically set [default].")
00068     Q_CLASSINFO("prop://yAxisInterval", "Sets the visible range of the displayed y-axis (in coordinates of the data object) or (0.0, 0.0) if range should be automatically set [default].")
00069     Q_CLASSINFO("prop://zAxisInterval", "Sets the visible range of the displayed z-axis (in coordinates of the data object) or (0.0, 0.0) if range should be automatically set [default].")
00070     Q_CLASSINFO("prop://colorMap", "Color map (string) that should be used to colorize a non-color data object.")
00071     
00072     Q_CLASSINFO("slot://setLinePlot", "This (virtual) slot can be invoked by python to trigger a lineplot.")
00073 
00074 public:
00075     AbstractDObjPclFigure(const QString &itomSettingsFile, const ito::ParamBase::Type inpType, AbstractFigure::WindowMode windowMode = AbstractFigure::ModeStandaloneInUi, QWidget *parent = 0);
00076 
00077     AbstractDObjPclFigure(const QString &itomSettingsFile, AbstractFigure::WindowMode windowMode = AbstractFigure::ModeStandaloneInUi, QWidget *parent = 0);
00078     
00079     virtual ~AbstractDObjPclFigure();
00080 
00081     ito::RetVal update(void);
00082 
00083     virtual void setDataObject(QSharedPointer<ito::DataObject>);
00084     virtual QSharedPointer<ito::DataObject> getDataObject(void) const;
00085 
00086     virtual ito::AutoInterval getXAxisInterval(void) const;
00087     virtual void setXAxisInterval(ito::AutoInterval);
00088 
00089     virtual ito::AutoInterval getYAxisInterval(void) const;
00090     virtual void setYAxisInterval(ito::AutoInterval);
00091 
00092     virtual ito::AutoInterval getZAxisInterval(void) const;
00093     virtual void setZAxisInterval(ito::AutoInterval);
00094 
00095     virtual QString getColorMap(void) const;
00096     virtual void setColorMap(QString);
00097 
00099     virtual QPixmap renderToPixMap(const int xsize, const int ysize, const int resolution);
00100 
00101 #ifdef USEPCL
00102     virtual void setPointCloud(QSharedPointer<ito::PCLPointCloud>);
00103     virtual QSharedPointer<ito::PCLPointCloud> getPointCloud(void) const;
00104 
00105     virtual void setPolygonMesh(QSharedPointer<ito::PCLPolygonMesh>);
00106     virtual QSharedPointer<ito::PCLPolygonMesh> getPolygonMesh(void) const;
00107 #endif
00108 
00109 protected:
00110     QHash<QString, QSharedPointer<ito::DataObject> > m_dataPointerDObj;
00111     int m_inpType;
00112 #ifdef USEPCL
00113     QHash<QString, QSharedPointer<ito::PCLPointCloud> > m_dataPointerPC;
00114     QHash<QString, QSharedPointer<ito::PCLPolygonMesh> > m_dataPointerPM;
00115 #endif
00116 
00117 signals:
00118 
00119 public slots:
00120     //this can be invoked by python to trigger a lineplot
00121     virtual ito::RetVal setLinePlot(const double x0, const double y0, const double x1, const double y1, const int destID = -1);
00122 };
00123 
00124 } // namespace ito
00125 
00126 
00127 #endif //#if !defined(Q_MOC_RUN) || defined(ITOMCOMMONQT_MOC)
00128 
00129 #endif //ABSTRACTDOBJPCLFIGURE_H
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Friends