00001 #ifndef __CROPCUBE_H__
00002 #define __CROPCUBE_H__
00003
00004
00005
00006
00007
00008
00009 #include "viasgui.h"
00010 #include "paint.h"
00011 #include "vectori.h"
00012
00013
00014 typedef enum
00015 {
00016 vCROP_DIR_NE,
00017 vCROP_DIR_SW,
00018 vCROP_DIR_NW,
00019 vCROP_DIR_SE,
00020 vCROP_DIR_N,
00021 vCROP_DIR_S,
00022 vCROP_DIR_W,
00023 vCROP_DIR_E,
00024 vNO_CROP_DIR
00025 }
00026 vCROP_DIR_TYPE;
00027
00028
00029 typedef struct tagCropCubeControl
00030 {
00031 vCOORD x;
00032 vCOORD y;
00033 }
00034 CropCubeControl;
00035
00036
00037 #define vNUM_CROP_CONTROLS 4
00038
00039
00040 typedef struct tagCropCube
00041 {
00042 HDC hDC;
00043 RECT client;
00044 RECT workspace;
00045 RECT bounds;
00046 HPEN hDashPen;
00047 HPEN hSolidPen;
00048 vINT offset;
00049 vCROP_DIR_TYPE direction;
00050 vVWS_VIEW_TYPE viewType;
00051 CropCubeControl controls[ vNUM_CROP_CONTROLS ];
00052 }
00053 CropCube;
00054
00055 #define vCROP_CUBE_COLOR ( ( COLORREF )0x00808080 )
00056
00057 #define vCROP_CUBE_DASH_LENGTH 2
00058 #define vCROP_CUBE_SPACE_LENGTH 2
00059
00060 #define vCROP_CUBE_CTRL_WIDTH 5
00061 #define vCROP_CUBE_CTRL_HEIGHT vCROP_CUBE_CTRL_WIDTH
00062
00063 #define vCROP_CUBE_MIN_WIDTH 6
00064 #define vCROP_CUBE_MIN_HEIGHT vCROP_CUBE_MIN_WIDTH
00065
00066
00067
00068
00069 #define vCROP_CUBE_MAX_OFFSET 12
00070
00071
00072
00073
00074
00075
00076 #define vCROP_CUBE_TOLERANCE vCROP_CUBE_CTRL_WIDTH
00077
00078
00079 vVOID CreateCropCube( CropCube *cc, HDC hDC );
00080 vVOID DestroyCropCube( CropCube *cc );
00081
00082 vVOID DrawCropCube( CropCube *cc );
00083 vVOID AnimateCropCube( CropCube *cc );
00084 vVOID EraseCropCube( CropCube *cc );
00085
00086
00087
00088
00089
00090
00091
00092 HCURSOR GetCropCubeCursor( CropCube *cc );
00093
00094
00095
00096
00097 vCROP_DIR_TYPE GetCropCubeDirection( CropCube *cc, vCOORD x, vCOORD y );
00098
00099
00100
00101
00102 vBOOL PointInCropCubeRect( CropCube *cc, vCOORD x, vCOORD y );
00103
00104
00105
00106
00107 vVOID ResizeCropCube( CropCube *cc, Vector2i offset );
00108
00109
00110
00111 vVOID TranslateCropCube( CropCube *cc, Vector2i offset );
00112
00113
00114
00115
00116 vVOID ResetCropCubeClientRect( CropCube *cc );
00117
00118
00119
00120
00121 vVOID InitCropCubeRectangles( CropCube *cc, ImageStackProjection *isp, vVWS_VIEW_TYPE viewType );
00122
00123
00124
00125
00126 vSIZE GetCropCubeMaxWidth( const CropCube *const cc );
00127 vSIZE GetCropCubeMaxHeight( const CropCube *const cc );
00128
00129
00130
00131
00132 vLONG GetCropCubeLeft( const CropCube *const cc );
00133 void SetCropCubeLeft( CropCube *const cc, const vLONG left );
00134
00135 vLONG GetCropCubeTop( const CropCube *const cc );
00136 void SetCropCubeTop( CropCube *const cc, const vLONG top );
00137
00138 vLONG GetCropCubeRight( const CropCube *const cc );
00139 void SetCropCubeRight( CropCube *const cc, const vLONG right );
00140
00141 vLONG GetCropCubeBottom( const CropCube *const cc );
00142 void SetCropCubeBottom( CropCube *const cc, const vLONG bottom );
00143
00144
00145 #endif
00146