1 #ifndef RT_AnnotationDefines_H_ 2 #define RT_AnnotationDefines_H_ 12 using rtc::AvdWindowId;
13 using rtc::AvdDesktopId;
18 #ifndef LOG_FONT_FACE_NAME_SIZE 19 #define LOG_FONT_FACE_NAME_SIZE 32 22 #ifndef DEFAULT_LINE_WIDTH 23 #define DEFAULT_LINE_WIDTH 1 25 #ifndef DEFAULT_LINE_COLOR 26 #define DEFAULT_LINE_COLOR 0xFF000000 28 #ifndef DEFAULT_BGROUNG_COLOR 29 #define DEFAULT_BGROUNG_COLOR 0xFF0000FF 31 #ifndef DEFAULT_FILL_COLOR 32 #define DEFAULT_FILL_COLOR 0xFF000000 116 void getSize(
float& x,
float &y,
float& w,
float &h){
136 static bool CalculateCheckMarkPoints(
Point& pt1,
Point& pt2,
Point aPoints[]) {
137 aPoints[0].x = pt1.x;
138 aPoints[0].y = pt1.y + (pt2.y - pt1.y)*2.0 / 3.0;
139 aPoints[1].x = (pt1.x + pt2.x) / 2;
140 aPoints[1].y = pt2.y;
141 aPoints[2].x = pt2.x;
142 aPoints[2].y = pt1.y;
159 virtual std::string
setNewfile(
const std::string& file,
const Point& pt);
185 std::shared_ptr<DrawImgInfo>
getImg(
const std::string&
id)
const;
221 std::map<std::string, std::shared_ptr<DrawImgInfo>>
imgMp_;
227 template<
class ItemType,
int GrowSize>
253 bool Add(ItemType item,
bool bCheckDuplicate =
false) {
255 if (bCheckDuplicate &&
GetIndex(item) >= 0)
343 bool SetAt(
int nIndex, ItemType item) {
369 bool Compare(ItemType* item1, ItemType* item2) {
370 if (memcmp(item1, item2,
sizeof(ItemType)) == 0)
378 ItemType* ppNew =
new ItemType[
m_allocSize + GrowSize];
398 template<
class ItemType,
int GrowSize>
424 bool Add(ItemType item,
bool bCheckDuplicate =
false) {
426 if (bCheckDuplicate &&
GetIndex(item) >= 0)
435 bool InsertAt(
int nIndex, ItemType item,
bool bCheckDuplicate =
false) {
436 if (bCheckDuplicate &&
GetIndex(item) >= 0)
439 if (nIndex >= 0 && nIndex <=
m_nUsed) {
445 sizeof(ItemType)*(
m_nUsed - nIndex));
457 for (i = 0; i <
m_nUsed; i++) {
467 sizeof(ItemType)*(
m_nUsed - i - 1));
479 sizeof(ItemType)*(
m_nUsed - i - 1));
509 ItemType retVal = NULL;
518 bool SetAt(
int nIndex, ItemType item) {
519 if (nIndex >= 0 && nIndex <
m_nUsed) {
529 switch (
sizeof(ItemType)) {
532 int dwItem = (int)item;
533 for (
int i = 0; i <
m_nUsed; i++) {
541 short wItem = (short)item;
542 for (
int i = 0; i <
m_nUsed; i++) {
550 char cbItem = (char)item;
551 for (
int i = 0; i <
m_nUsed; i++) {
558 for (
int i = 0; i <
m_nUsed; i++) {
573 bool Compare(ItemType* item1, ItemType* item2) {
574 if (memcmp(item1, item2,
sizeof(ItemType)) == 0)
582 ItemType* ppNew =
new ItemType[
m_nAlloc + GrowSize];
584 memset(ppNew, 0, (
m_nAlloc + GrowSize)*
sizeof(ItemType));
604 template <
class ItemType>
630 ItemType* pNewHead =
new ItemType[nSize];
632 memset(pNewHead, 0,
sizeof(ItemType)*nSize);
657 #endif //RT_AnnotationDefines_H_ std::string selectOneImg(Point pt)
static AvdWindowId Cast(uint64 id)
Definition: common.h:425
char lfUnderline
Definition: annotationdefines.h:42
~EMDynamicBuffer()
Definition: annotationdefines.h:613
Rect annotation_rect_
Definition: annotationdefines.h:215
ItemType * m_ppHead
Definition: annotationdefines.h:600
ItemType * m_pHead
Definition: annotationdefines.h:653
Rect display_rect_
Definition: annotationdefines.h:214
int width() const
Definition: annotationbasedefines.h:32
int lineWidth() const
Definition: annotationdefines.h:162
Color lineColor() const
Definition: annotationdefines.h:178
Definition: annotationdefines.h:399
int GetCount()
Definition: annotationdefines.h:249
bool _isupdate
Definition: annotationdefines.h:66
int m_nAlloc
Definition: annotationdefines.h:601
virtual ~EMArrayBaseT2()
Definition: annotationdefines.h:244
std::map< std::string, std::shared_ptr< DrawImgInfo > > imgMp_
Definition: annotationdefines.h:221
#define LOG_FONT_FACE_NAME_SIZE
Definition: annotationdefines.h:19
virtual ~EMArrayBaseT()
Definition: annotationdefines.h:415
LineArrowType line_arrow_
Definition: annotationdefines.h:207
bool InsertAt(int nIndex, ItemType item)
Definition: annotationdefines.h:264
void getBoardSize(float &x, float &y, float &w, float &h)
Definition: annotationdefines.h:122
Definition: annotationbasedefines.h:12
int _zoom_times
Definition: annotationdefines.h:62
int GetIndex(ItemType item)
Definition: annotationdefines.h:528
std::string imgFile() const
Definition: annotationdefines.h:183
int x
Definition: annotationbasedefines.h:13
鼠标在图片内
Definition: annotationdefines.h:55
char lfPitchAndFamily
Definition: annotationdefines.h:48
bool SetAt(int nIndex, ItemType item)
Definition: annotationdefines.h:343
char lfStrikeOut
Definition: annotationdefines.h:43
bool RemoveAt(int i)
Definition: annotationdefines.h:475
long lfWeight
Definition: annotationdefines.h:40
virtual bool isDuplicatefile(const std::string &file)
virtual void setDisplayRect(const Rect &rc)
Definition: annotationdefines.h:156
bool zoomMode() const
Definition: annotationdefines.h:182
int layermax_
Definition: annotationdefines.h:220
unsigned int uint32
Definition: defines.h:387
区域对象信息结构.
Definition: annotationbasedefines.h:24
int y
Definition: annotationbasedefines.h:14
ItemType operator [](int i)
Definition: annotationdefines.h:508
int _zoom_restor
Definition: annotationdefines.h:63
bool Compare(ItemType *item1, ItemType *item2)
Definition: annotationdefines.h:369
EMArrayBaseT2(const EMArrayBaseT2 &other)
Definition: annotationdefines.h:236
virtual void setFillColor(const Color &color)
Definition: annotationdefines.h:154
bool Add(ItemType item, bool bCheckDuplicate=false)
Definition: annotationdefines.h:424
void getSize(float &x, float &y, float &w, float &h)
Definition: annotationdefines.h:116
鼠标在右边框内
Definition: annotationdefines.h:56
float _x
Definition: annotationdefines.h:68
void Reset()
Definition: annotationdefines.h:617
#define DEFAULT_LINE_WIDTH
Definition: annotationdefines.h:23
virtual void setLineWidth(int width)
Definition: annotationdefines.h:152
鼠标在下边框内
Definition: annotationdefines.h:57
Definition: annotationbasedefines.h:42
int _boder
Definition: annotationdefines.h:61
Definition: annotationdefines.h:605
long lfOrientation
Definition: annotationdefines.h:39
#define DEFAULT_LINE_COLOR
Definition: annotationdefines.h:26
float _h
Definition: annotationdefines.h:71
int GetIndex(ItemType item)
Definition: annotationdefines.h:355
Rect annotationRect() const
Definition: annotationdefines.h:181
directZone
Definition: annotationdefines.h:52
bool _has_select
Definition: annotationdefines.h:65
std::string imgfile_
Definition: annotationdefines.h:217
bool Add(ItemType item, bool bCheckDuplicate=false)
Definition: annotationdefines.h:253
long lfHeight
Definition: annotationdefines.h:36
virtual void setDrawWindowId(const AvdWindowId &id)
Definition: annotationdefines.h:150
EMArrayBaseT(const EMArrayBaseT &other)
Definition: annotationdefines.h:407
void clear()
Definition: annotationdefines.h:190
Definition: annotationdefines.h:59
bool Remove(ItemType item)
Definition: annotationdefines.h:455
virtual void setLineArrow(const LineArrowType &arrow)
Definition: annotationdefines.h:155
Definition: annotationdefines.h:146
EMArrayBaseT & operator=(const EMArrayBaseT &other)
Definition: annotationdefines.h:494
bool Remove(ItemType item)
Definition: annotationdefines.h:281
int line_width_
Definition: annotationdefines.h:208
char lfQuality
Definition: annotationdefines.h:47
virtual void setDisplayWindowId(const AvdWindowId &id)
Definition: annotationdefines.h:151
int startIndex_
Definition: annotationdefines.h:219
uint32 m_nSize
Definition: annotationdefines.h:654
std::string curImgId() const
Definition: annotationdefines.h:184
int _rotation
Definition: annotationdefines.h:64
bool operator<(const DrawImgInfo &p) const
Definition: annotationdefines.h:113
long lfWidth
Definition: annotationdefines.h:37
ItemType * GetHead()
Definition: annotationdefines.h:647
void setNewsize(int ix, int iy, int iw, int ih)
Definition: annotationdefines.h:129
#define RT_ASSERTE(expr)
Definition: defines.h:270
Definition: annotationbasedefines.h:8
directZone pointIn(const Point &pt)
Definition: annotationdefines.h:53
bool InsertAt(int nIndex, ItemType item, bool bCheckDuplicate=false)
Definition: annotationdefines.h:435
struct rtcimp::tagRect Rect
区域对象信息结构.
~DrawImgInfo()
Definition: annotationdefines.h:103
bool Expand()
Definition: annotationdefines.h:580
Definition: annotationdefines.h:35
std::shared_ptr< DrawImgInfo > getImg(const std::string &id) const
DrawImgInfo(std::string file, Point p, int index, std::string id)
Definition: annotationdefines.h:82
virtual ~AVDContext()
Definition: annotationdefines.h:149
ItemType * m_head
Definition: annotationdefines.h:394
int m_nUsed
Definition: annotationdefines.h:602
float _w
Definition: annotationdefines.h:70
AvdWindowId drawWindowId() const
Definition: annotationdefines.h:177
int m_allocSize
Definition: annotationdefines.h:395
bool _enable
Definition: annotationdefines.h:67
bool RemoveAt(int i)
Definition: annotationdefines.h:301
std::string curImgId_
Definition: annotationdefines.h:218
Rect displayRect() const
Definition: annotationdefines.h:180
void RemoveAll()
Definition: annotationdefines.h:486
LineArrowType
Definition: common.h:535
bool Expand()
Definition: annotationdefines.h:376
AvdWindowId draw_window_id_
Definition: annotationdefines.h:211
char lfOutPrecision
Definition: annotationdefines.h:45
float _y
Definition: annotationdefines.h:69
bool SetAt(int nIndex, ItemType item)
Definition: annotationdefines.h:518
ItemType operator [](int i)
Definition: annotationdefines.h:334
std::string _file
Definition: annotationdefines.h:73
char lfClipPrecision
Definition: annotationdefines.h:46
int GetSize()
Definition: annotationdefines.h:624
int displayWidth() const
Definition: annotationdefines.h:163
char lfFaceName[32]
Definition: annotationdefines.h:49
virtual std::string setNewfile(const std::string &file, const Point &pt)
LineArrowType lineArrow() const
Definition: annotationdefines.h:161
std::string _id
Definition: annotationdefines.h:72
int _layer
Definition: annotationdefines.h:60
EMArrayBaseT()
Definition: annotationdefines.h:401
#define DEFAULT_FILL_COLOR
Definition: annotationdefines.h:32
std::string ResetStatus()
struct rtcimp::tagPoint Point
bool Compare(ItemType *item1, ItemType *item2)
Definition: annotationdefines.h:573
鼠标在图片之外的区域
Definition: annotationdefines.h:54
AvdWindowId display_window_id_
Definition: annotationdefines.h:210
ItemType * GetHead()
Definition: annotationdefines.h:568
virtual void setZoomMode(bool isZoom)
Definition: annotationdefines.h:158
Color fillColor() const
Definition: annotationdefines.h:179
堆数组模板类.
Definition: annotationdefines.h:228
EMArrayBaseT2()
Definition: annotationdefines.h:230
virtual void setAnnotationRect(const Rect &rc)
Definition: annotationdefines.h:157
virtual void setLineColor(const Color &color)
Definition: annotationdefines.h:153
EMDynamicBuffer(uint32 nSize=1024)
Definition: annotationdefines.h:607
AvdWindowId dispayWindowId() const
Definition: annotationdefines.h:176
bool SetSize(uint32 nSize)
Definition: annotationdefines.h:628
ItemType * GetHead()
Definition: annotationdefines.h:364
int RemoveOneImg(const std::string &id)
Color fill_color_
Definition: annotationdefines.h:213
void RemoveAll()
Definition: annotationdefines.h:312
struct rtcimp::tagLOGFONTA LogFont
EMArrayBaseT2 & operator=(const EMArrayBaseT2 &other)
Definition: annotationdefines.h:320
bool zoom_
Definition: annotationdefines.h:216
std::string _url
Definition: annotationdefines.h:74
Color line_color_
Definition: annotationdefines.h:212
int GetCount()
Definition: annotationdefines.h:420
int m_usedSize
Definition: annotationdefines.h:396
char lfCharSet
Definition: annotationdefines.h:44
char lfItalic
Definition: annotationdefines.h:41
int height() const
Definition: annotationbasedefines.h:33
long lfEscapement
Definition: annotationdefines.h:38