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.GPL ** 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 <ICLQt/DrawWidget3D.h> 00034 #include <ICLGeom/Scene.h> 00035 #include <ICLUtils/Function.h> 00036 00037 00038 namespace icl{ 00039 namespace geom{ 00040 00041 class PlotWidget3D : public qt::ICLDrawWidget3D{ 00042 struct Data; 00043 Data *m_data; 00044 00045 public: 00046 00047 typedef SceneObject* Handle; 00048 00049 PlotWidget3D(QWidget *parent=0); 00050 ~PlotWidget3D(); 00051 00052 void setViewPort(const utils::Range32f &xrange, 00053 const utils::Range32f &yrange, 00054 const utils::Range32f &zrange); 00055 00056 const utils::Range32f *getViewPort() const; 00057 00058 Scene &getScene(); 00059 const Scene &getScene() const; 00060 00061 SceneObject *getRootObject(); 00062 const SceneObject *getRootObject() const; 00063 00064 const Camera &getCamera() const; 00065 void setCamera(const Camera &cam); 00066 00067 void add(SceneObject *obj, bool passOwnerShip=true); 00068 void remove(Handle h); 00069 00070 void color(int r, int g, int b, int a); 00071 void nocolor(); 00072 void fill(int r, int g, int b, int a); 00073 void nofill(); 00074 void smoothfill(bool on); 00075 void pointsize(float size); 00076 void linewidth(float width); 00077 void lock(); 00078 void unlock(); 00079 void clear(); 00080 00081 Handle scatter(const std::vector<Vec> &points); 00082 00083 Handle scatter(const std::vector<Vec> &points, 00084 const std::vector<GeomColor> &colors, 00085 const utils::Range32f &colorRange=utils::Range32f(0,255)); 00086 00087 Handle linestrip(const std::vector<Vec> &points); 00088 00089 Handle surf(const std::vector<Vec> &points, int nx, int ny); 00090 00091 Handle surf(utils::Function<float,float,float> fxy, 00092 const utils::Range32f &rx=utils::Range32f(0,0), 00093 const utils::Range32f &ry=utils::Range32f(0,0), 00094 int nx=100, int ny=100, Handle reuseObj=0); 00095 00096 Handle label(const Vec &p, const std::string &text); 00097 }; 00098 } 00099 }