IvfBufferSelection.h

00001 //
00002 // Copyright 1999-2006 by Structural Mechanics, Lund University.
00003 //
00004 // This library is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Library General Public
00006 // License as published by the Free Software Foundation; either
00007 // version 2 of the License, or (at your option) any later version.
00008 //
00009 // This library is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 // Library General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU Library General Public
00015 // License along with this library; if not, write to the Free Software
00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00017 // USA.
00018 //
00019 // Please report all bugs and problems to "ivf@byggmek.lth.se".
00020 //
00021 //
00022 // Written by Jonas Lindemann
00023 //
00024 
00025 #ifndef _CIvfBufferSelection_h_
00026 #define _CIvfBufferSelection_h_
00027 
00028 #include <ivf/IvfBase.h>
00029 #include <ivf/IvfShape.h>
00030 #include <ivf/IvfComposite.h>
00031 #include <ivf/IvfView.h>
00032 
00033 IvfSmartPointer(CIvfBufferSelection);
00034 
00035 typedef std::vector<CIvfShape*> CIvfSelectedShapesVector;
00036 typedef std::vector<CIvfShape*>::iterator CIvfSelectedShapesIterator;
00037 
00101 class IVF_API CIvfBufferSelection : public CIvfBase {
00102 private:
00103         CIvfShape* m_selectedShape;
00104         CIvfComposite* m_composite;
00105         CIvfView* m_camera;
00106         std::vector<CIvfShape*> m_allObjects;
00107 
00108         std::vector<CIvfShape*> m_selectedShapes;
00109 
00110         int m_childCount;
00111         GLuint m_selectBuf[512];
00112 
00113         void nameChildren(CIvfShape* shape);
00114         void processHits(GLint hits, GLuint buffer []);
00115 public:
00117         CIvfBufferSelection();
00118 
00120         virtual ~CIvfBufferSelection();
00121         
00122         IvfClassInfo("CIvfBufferSelection",CIvfBase);
00123 
00133         int pick(int x, int y);
00134 
00144         void update();
00145 
00153         void setComposite(CIvfComposite* composite);
00154 
00156         CIvfComposite* getComposite();
00157 
00159         void setView(CIvfView* view);
00160 
00162         CIvfView* getView();
00163         
00170         CIvfShape* getSelectedShape();
00171 
00173         int getSize();
00174 
00181         CIvfShape* getSelectedShape(int idx);
00182 
00188         CIvfSelectedShapesVector& getSelectedShapes();
00189 };
00194 #endif 

Generated on Fri Sep 1 15:36:45 2006 for Interactive Visualisation Framework - Ivf++ by  doxygen 1.4.6-NO