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 _CIvfSelectComposite_h_
00026 #define _CIvfSelectComposite_h_
00027
00029 #include <ivf/ivfconfig.h>
00030
00031 namespace std {};
00032 using namespace std;
00033
00034 #include <ivf/IvfComposite.h>
00035 #include <ivf/IvfCoordinateSystem.h>
00036 #include <ivf/IvfView.h>
00037 #include <ivf/IvfShape.h>
00038 #include <ivf/IvfCursor.h>
00039
00040 #include <ivfmath/IvfPoint3d.h>
00041
00042 IvfSmartPointer(CIvfSelectComposite);
00043
00050 class IVF_API CIvfSelectComposite : public CIvfComposite {
00051 public:
00053 CIvfSelectComposite ();
00054
00056 virtual ~CIvfSelectComposite ();
00057
00058 IvfClassInfo("CIvfSelectComposite",CIvfComposite);
00059
00069 void setCamera(CIvfView* camera);
00070
00072 CIvfView* getCamera();
00073
00075 CIvfShape* getSelectedShape();
00076
00077 void setRenderCamera(bool flag);
00078 void setUseCustomTransform(bool flag);
00079
00090 GLint pick(int x, int y);
00091
00093 void addChild(CIvfShape* shape);
00094
00096 CIvfShape* removeChild(int index);
00097
00099 CIvfShape* removeShape(CIvfShape *removeShape);
00100
00102 void deleteChild(int index);
00103
00104 void renameChildren();
00105 private:
00106 CIvfShape* m_selectedShape;
00107 int m_childCount;
00108 GLuint m_selectBuf[512];
00109 CIvfView* m_camera;
00110 vector<CIvfShape*> m_allObjects;
00111 bool m_useCustomTransform;
00112 bool m_renderCamera;
00113
00114 void compositeRemove(CIvfComposite* composite, CIvfShape* deleteChild);
00115 void nameChildren(CIvfShape* shape);
00116 protected:
00117 void processHits(GLint hits, GLuint buffer[]);
00118 virtual void endTransform();
00119 virtual void beginTransform();
00120 virtual void createGeometry();
00121 virtual void initializeSelect(int x, int y, int w, int h);
00122 virtual void customView();
00123 };
00124 #endif
00125