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 _CIvfConstructionPlane_h_
00026 #define _CIvfConstructionPlane_h_
00027
00028 #include <ivf/IvfShape.h>
00029 #include <ivf/IvfGrid.h>
00030 #include <ivf/IvfCursor.h>
00031 #include <ivf/IvfCamera.h>
00032
00033 #include <ivfmath/IvfUcs3d.h>
00034
00035 IvfSmartPointer(CIvfConstructionPlane);
00036
00047 class IVF_API CIvfConstructionPlane : public CIvfShape {
00048 private:
00049 CIvfUcs3d* m_ucs;
00050 CIvfGrid* m_grid;
00051 CIvfCursor* m_cursor;
00052 CIvfCamera* m_camera;
00053
00054 CIvfVec3d m_last;
00055
00056 double m_size[2];
00057 bool m_cursorLocked;
00058 bool m_snapToGrid;
00059 double m_gridSpacing;
00060
00061 double m_v[3];
00062 double m_theta;
00063
00064 double m_cursorX;
00065 double m_cursorY;
00066 double m_cursorStartX;
00067 double m_cursorStartY;
00068 double m_relativeCursorSize;
00069 double m_relativeAxisSize;
00070
00071 bool m_active;
00072 bool m_updateCursorSize;
00073 bool m_updateAxisSize;
00074
00075 void initPlane();
00076 void updateAxisSize();
00077 void updateCursorSize();
00078 public:
00080 CIvfConstructionPlane();
00081
00083 virtual ~CIvfConstructionPlane();
00084
00085 IvfClassInfo("CIvfConstructionPlane",CIvfShape);
00086
00097 void updateCursor(int x, int y);
00098
00107 void updateSizes();
00108
00115 void activate();
00116
00123 void deactivate();
00124
00126 bool isActive();
00127
00134 void lockCursor();
00135
00142 void unlockCursor();
00143
00145 bool isCursorLocked();
00146
00147 void enableCursor();
00148 void disableCursor();
00149 bool isCursorEnabled();
00150
00152 void setSize(double width, double height);
00153
00160 void setCamera(CIvfCamera* camera);
00161
00169 virtual void setPosition(const double x, const double y, const double z);
00170
00178 void setRotationQuat(double vx, double vy, double vz, double theta);
00179
00181 void setCursor(CIvfCursor* cursor);
00182
00189 void setRelativeAxisSize(double size);
00190
00192 double getRelativeAxisSize();
00193
00200 void setRelativeCursorSize(double size);
00201
00203 double getRelativeCursorSize();
00204
00210 void setUpdateCursorSize(bool flag);
00211
00217 void setUpdateAxisSize(bool flag);
00218
00220 CIvfVec3d& getCursorPosition();
00221
00223 void getPosition(double &x, double &y, double &z);
00224
00226 CIvfUcs3d* getUcs();
00227
00229 void setGridSpacing(double spacing);
00230
00232 virtual void updateBoundingSphere();
00233
00234 CIvfGrid* getGrid();
00235 double getDepth();
00236 double getWidth();
00237 protected:
00238 virtual void createGeometry();
00239 };
00240
00241 #endif