// // DwgViewController.h // iOdaApp // // Created by Irina Bezruk on 03/11/15. // Copyright © 2015 ODA. All rights reserved. // #import #import #include #include #include #include #include typedef NS_ENUM(NSInteger, ShapeType) { ShapeTypePass = 0, //符合背景图,无语音,无照片,无文字 ShapeTypePassOk, //有文字:符合 ShapeTypePassPhoto, //有照片 ShapeTypePassPhotoOk, //有照片,有文字:符合 ShapeTypePassSound, //有语音 ShapeTypePassPhotoSoundOk, //有语音,有照片,有文字:符合 ShapeTypeUnPass, //不符合背景图,无语音,无照片,无文字 ShapeTypeUnPassOk, //有文字:不符合 ShapeTypeUnPassPhoto, //有照片 ShapeTypeUnPassPhotoOk, //有照片,有文字:不符合 ShapeTypeUnPassSound, //有语音 ShapeTypeUnPassPhotoSound, //有语音,有照片 }; @interface DwgViewController : GLKViewController { GLint backingWidth; GLint backingHeight; CGFloat prevAngleRad; CGPoint prevPanPoint; CGFloat prevScale; OdGsDevicePtr gsDevice; OdDbDatabasePtr pDb; } @property (nonatomic, strong) NSString *cadFileName;//dwg文件路径 @property (nonatomic, strong) EAGLContext *glContext; @property (nonatomic, assign) double scale;//相对于初始状态下的放大缩小倍数 @property (nonatomic, assign) BOOL enable; - (void)setupGL; - (void)handlePan:(UIPanGestureRecognizer *)recognizer; - (void)handlePinch:(UIPinchGestureRecognizer *)recognizer; - (void)handleRotate:(UIRotationGestureRecognizer *)recognizer; - (void)handleTap:(UITapGestureRecognizer *)recognizer; - (OdGePoint3d)toWCS: (CGFloat)x andY:(CGFloat) y; - (bool)viewCanRotate; /** 添加点击手势 */ - (void)addTap; - (void)addLongTap; - (void)removeTap; - (void)removeLongTap; /** 复位 */ - (void)zoomExtents; /** 检查是否有标注 0:没有 point为未转化的坐标*/ - (int)picke:(CGPoint)point; /** 添加标注 point为未转化的坐标 */ - (int)addShape:(CGPoint)point text:(NSString *)text type:(ShapeType)type; /** 修改 */ - (int)alter:(int)currentID point:(CGPoint)point text:(NSString *)text type:(ShapeType)type; /** 删除 */ - (void)deleteShape:(int)currentId; @property (nonatomic, assign) BOOL isDelete; @property (nonatomic, assign) CGPoint point; @end