zjf
2023-03-06 392b76515f40376b6d36f40a114850ef63650384
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//
//  DwgViewController.h
//  iOdaApp
//
//  Created by Irina Bezruk on 03/11/15.
//  Copyright © 2015 ODA. All rights reserved.
//
 
#import <UIKit/UIKit.h>
#import <GLKit/GLKit.h>
 
#include <OdaCommon.h>
#include <Gs/Gs.h>
#include <DbDatabase.h>
#include <GiContextForDbDatabase.h>
#include <DbGsManager.h>
 
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