Image Component Library (ICL)
|
00001 /******************************************************************** 00002 ** Image Component Library (ICL) ** 00003 ** ** 00004 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld ** 00005 ** Neuroinformatics Group ** 00006 ** Website: www.iclcv.org and ** 00007 ** http://opensource.cit-ec.de/projects/icl ** 00008 ** ** 00009 ** File : ICLGeom/src/ICLGeom/PlotWidget3D.h ** 00010 ** Module : ICLGeom ** 00011 ** Authors: Christof Elbrechter ** 00012 ** ** 00013 ** ** 00014 ** GNU LESSER GENERAL PUBLIC LICENSE ** 00015 ** This file may be used under the terms of the GNU Lesser General ** 00016 ** Public License version 3.0 as published by the ** 00017 ** ** 00018 ** Free Software Foundation and appearing in the file LICENSE.LGPL ** 00019 ** included in the packaging of this file. Please review the ** 00020 ** following information to ensure the license requirements will ** 00021 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt ** 00022 ** ** 00023 ** The development of this software was supported by the ** 00024 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. ** 00025 ** The Excellence Cluster EXC 277 is a grant of the Deutsche ** 00026 ** Forschungsgemeinschaft (DFG) in the context of the German ** 00027 ** Excellence Initiative. ** 00028 ** ** 00029 ********************************************************************/ 00030 00031 #pragma once 00032 00033 #include <ICLUtils/CompatMacros.h> 00034 #include <ICLQt/DrawWidget3D.h> 00035 #include <ICLGeom/Scene.h> 00036 #include <ICLUtils/Function.h> 00037 00038 00039 namespace icl{ 00040 namespace geom{ 00041 00042 class ICLGeom_API PlotWidget3D : public qt::ICLDrawWidget3D{ 00043 struct Data; 00044 Data *m_data; 00045 00046 public: 00047 00048 typedef SceneObject* Handle; 00049 00050 PlotWidget3D(QWidget *parent=0); 00051 ~PlotWidget3D(); 00052 00053 void setViewPort(const utils::Range32f &xrange, 00054 const utils::Range32f &yrange, 00055 const utils::Range32f &zrange); 00056 00057 const utils::Range32f *getViewPort() const; 00058 00059 Scene &getScene(); 00060 const Scene &getScene() const; 00061 00062 SceneObject *getRootObject(); 00063 const SceneObject *getRootObject() const; 00064 00065 const Camera &getCamera() const; 00066 void setCamera(const Camera &cam); 00067 00068 void add(SceneObject *obj, bool passOwnerShip=true); 00069 void remove(Handle h); 00070 00071 void color(int r, int g, int b, int a); 00072 void nocolor(); 00073 void fill(int r, int g, int b, int a); 00074 void nofill(); 00075 void smoothfill(bool on); 00076 void pointsize(float size); 00077 void linewidth(float width); 00078 void lock(); 00079 void unlock(); 00080 void clear(); 00081 00082 Handle scatter(const std::vector<Vec> &points); 00083 00084 Handle scatter(const std::vector<Vec> &points, 00085 const std::vector<GeomColor> &colors, 00086 const utils::Range32f &colorRange=utils::Range32f(0,255)); 00087 00088 Handle linestrip(const std::vector<Vec> &points); 00089 00090 Handle surf(const std::vector<Vec> &points, int nx, int ny); 00091 00092 Handle surf(utils::Function<float,float,float> fxy, 00093 const utils::Range32f &rx=utils::Range32f(0,0), 00094 const utils::Range32f &ry=utils::Range32f(0,0), 00095 int nx=100, int ny=100, Handle reuseObj=0); 00096 00097 Handle label(const Vec &p, const std::string &text); 00098 }; 00099 } 00100 }