00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
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