Alphabetical Class Index  Class Hierarchy   File Members   Compound Members   File List  

HIOUtilityDWG.h
1 // Copyright (c) 1998-2014 by Tech Soft 3D, Inc.
2 //
3 // The information contained herein is confidential and proprietary to Tech Soft 3D, Inc.,
4 // and considered a trade secret as defined under civil and criminal statutes.
5 // Tech Soft 3D, Inc. shall pursue its civil and criminal remedies in the event of
6 // unauthorized use or misappropriation of its trade secrets. Use of this information
7 // by anyone other than authorized employees of Tech Soft 3D, Inc. is granted only under
8 // a written non-disclosure agreement, expressly prescribing the scope and manner of such use.
9 
10 #ifndef _HIO_UTILITY_DWG_H
11 #define _HIO_UTILITY_DWG_H
12 
13 #ifdef H_PACK_8
14 #pragma pack(push)
15 #pragma pack(8)
16 #endif
17 
18 #include "HTools.h"
19 #include "HIOManager.h"
20 
21 #ifdef HIO_DWG
22 #define HIO_API __declspec (dllexport)
23 #else
24 #define HIO_API
25 #endif
26 
27 
29 {
30 public:
31  DWGException(const char* msg);
32  ~DWGException();
33  char* what()
34  {
35  return m_message;
36  }
37 private:
38  char* m_message;
39 };
40 
41 
46 class HIO_API HIOUtilityDWG: public HInputHandler
47 {
48 
49 public:
50 
54  };
55  virtual ~HIOUtilityDWG() {;};
56 
59  HIORegisterInputType("dwg",this);
60  HIORegisterInputType("dxf",this);
61  };
64  const char * GetOutputName() { return "HIOUtilityDWG"; }
65  const char * GetInputName() { return "HIOUtilityDWG"; }
66 
68  const char * GetInputTypesString() {return "dwg;dxf";};
69 
72 
80  HFileInputResult FileInputByKey(const char * FileName, HC_KEY key, HInputHandlerOptions * options);
81 
82  HFileInputResult FileInputByKey(const wchar_t * FileName, HC_KEY key, HInputHandlerOptions * options);
83 
91  HFileInputResult FileInputByKey(const unsigned short * FileName, HC_KEY key, HInputHandlerOptions * options);
92 
100  HFileInputResult DatabaseInputByKey(AcDbDatabase* pAcDbDatabase,
101  HC_KEY key, HInputHandlerOptions * options);
102 
106  static bool InitRealDWG();
107 
111  static bool ShutDownRealDWG();
112 
113 };
114 
115 
116 class AcDbDatabase;
117 
120 class HIO_API HIOConnectorDWG : public HIOConnector
121 {
122 
123 public:
125  HIOConnectorDWG() : m_pAcDbDatabase(0) {;};
126  ~HIOConnectorDWG();
127 
131  void SetDatabase(AcDbDatabase * pAcDbDatabase)
132  {
133  // database needs to me alive for DWG pointers to be valid
134  m_pAcDbDatabase = pAcDbDatabase;
135  }
136 
137 protected:
138 
140  AcDbDatabase * m_pAcDbDatabase;
141 };
142 
143 
144 #ifdef HIO_DWG
145 extern "C" {
146  HIO_API void * CreateInput(HIOManager *manager);
147  HIO_API void * CreateOutput(HIOManager *manager);
148  HIO_API void * CreateConnector(void * unused);
149  HIO_API void Free(HIOUtilityDWG *);
150  HIO_API void FreeConnector(HIOConnectorDWG *connector);
151 }
152 #endif
153 
154 
155 
156 #ifdef H_PACK_8
157 #pragma pack(pop)
158 #endif
159 
160 #endif
161 
162 
163 
164 
165 
166 
HInputHandlerStyle GetInputStyle()
Definition: HIOUtilityDWG.h:71
Definition: HIOManager.h:1412
Specifies an HInputHandler for model data.
Definition: HIOManager.h:225
Definition: HIOUtilityDWG.h:46
const char * GetOutputName()
Definition: HIOUtilityDWG.h:64
virtual HFileInputResult FileInputByKey(const char *filename, HC_KEY key, HInputHandlerOptions *options)
Definition: HIOManager.h:147
HInputHandler an abstract base class for model and image input.
Definition: HIOManager.h:671
HIOConnectorDWG()
Definition: HIOUtilityDWG.h:125
Definition: HIOUtilityDWG.h:120
#define HIORegisterInputType(type, input_object)
Definition: HIOManager.h:84
void RegisterInputHandlerTypes()
Definition: HIOUtilityDWG.h:58
HInputHandlerStyle
Definition: HIOManager.h:224
HIOUtilityDWG()
Definition: HIOUtilityDWG.h:52
#define HInputOpFileInputByKey
This HInputHandler supports input to a segment key.
Definition: HIOManager.h:57
Definition: HIOUtilityDWG.h:28
Definition: HIOManager.h:245
void SetInputOps(unsigned long ops)
This sets the HInputOp.
Definition: HIOManager.h:840
const char * GetInputName()
Definition: HIOUtilityDWG.h:65
AcDbDatabase * m_pAcDbDatabase
Autocad Database pointer associated with the DWG file.
Definition: HIOUtilityDWG.h:140
A header file containing the HIO classes for passing to HBaseView::FileInput and HBaseView::FileOutpu...
const char * GetInputTypesString()
Definition: HIOUtilityDWG.h:68
void SetDatabase(AcDbDatabase *pAcDbDatabase)
Definition: HIOUtilityDWG.h:131