sprk_dwg.h
1 // Copyright (c) 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 SPRK_DWG_H
11 #define SPRK_DWG_H
12 
13 #include "sprk.h"
14 
15 typedef void DWGObjectID;
16 typedef void DWGDatabase;
17 
18 #ifdef _MSC_VER
19 #ifndef STATIC_APP
20 # ifdef SPRK_DWG
21 # define DWG_API __declspec (dllexport)
22 # else
23 # define DWG_API __declspec (dllimport)
24 # endif
25 #endif
26 #else
27 # include <stddef.h>
28 # if defined(LINUX_SYSTEM) && defined(SPRK_DWG)
29 # ifndef STATIC_APP
30 # define DWG_API __attribute__ ((visibility ("default")))
31 # endif
32 # endif
33 #endif
34 
35 #ifndef DWG_API
36 # define DWG_API
37 #endif
38 
39 namespace HPS
40 {
41 
43 class DWG_API DWG
44 {
45 public:
46  class Layout;
47 
48  typedef std::vector<DWG::Layout, Allocator<DWG::Layout> > LayoutArray;
49 
53  class DWG_API Component : public HPS::Component
54  {
55  public:
57  Component();
58 
63  Component(HPS::Component const & in_that);
64 
67  Component(DWG::Component const & in_that);
68 
71  Component(DWG::Component && in_that);
72 
73  virtual ~Component();
74 
75  static const HPS::Type staticType = HPS::Type::DWGComponent;
76  HPS::Type ObjectType() const { return staticType; }
77 
78 #ifndef _MSC_VER
79  Component & operator=(Component const & in_that) = default;
80 #endif
81 
85  Component & operator=(DWG::Component && in_that);
86 
87 
90  DWGObjectID * GetDWGObjectID() const;
91  };
92 
94  class DWG_API Layer : public DWG::Component
95  {
96  public:
98  Layer();
99 
103  Layer(HPS::Component const & in_that);
104 
108  Layer(Component const & in_that);
109 
112  Layer(Layer const & in_layer);
113 
117  Layer(Layer && in_that);
118 
122  Layer & operator=(Layer && in_that);
123 
124  virtual ~Layer();
125 
126  static const HPS::Type staticType = HPS::Type::DWGLayer;
127  HPS::Type ObjectType() const { return staticType; }
128 
132  bool Equals(Layer const & in_layer) const;
133 
137  bool operator==(Layer const & in_layer) const;
138 
142  bool operator!=(Layer const & in_layer) const;
143 
144  /* Turns this Layer ON.*/
145  void TurnOn() const;
146 
147  /* Turns this Layer OFF.*/
148  void TurnOff() const;
149 
150  /* Checks whether this Layer is considered as being turned on in the Visualize scene graph
151  * \return <span class='code'>true</span> if the Layer is turned on, <span class='code'>false</span> otherwise. */
152  bool IsOn() const;
153  };
154 
157  class DWG_API CADModel : public HPS::CADModel
158  {
159  public:
161  CADModel();
162 
167  CADModel(Component const & in_that);
168 
173  CADModel(HPS::CADModel const & in_that);
174 
177  CADModel(DWG::CADModel const & in_that);
178 
181  CADModel(DWG::CADModel && in_that);
182 
183  virtual ~CADModel();
184 
185  static const HPS::Type staticType = HPS::Type::DWGCADModel;
186  HPS::Type ObjectType() const { return staticType; }
187 
188 #if !defined(_MSC_VER) || _MSC_VER >= 1900
189  CADModel & operator=(DWG::CADModel const & in_that) = default;
190 #endif
191 
195  CADModel & operator=(DWG::CADModel && in_that);
196 
202  HPS::View ActivateDefaultLayout();
203 
206  DWGDatabase * GetDWGDatabase() const;
207 
208 
211  LayoutArray GetAllLayouts() const;
212  };
213 
214  class DWG_API Layout : public Capture
215  {
216  public:
218  Layout();
219 
223  Layout(Component const & in_that);
224 
229  Layout(HPS::Capture const & in_that);
230 
233  Layout(DWG::Layout const & in_that);
234 
237  Layout(DWG::Layout && in_that);
238 
239  virtual ~Layout();
240 
241  static const HPS::Type staticType = HPS::Type::DWGLayout;
242  HPS::Type ObjectType() const { return staticType; }
243 
244 #if !defined(_MSC_VER) || _MSC_VER >= 1900
245  Layout & operator=(Layout const & in_that) = default;
246 #endif
247 
251  Layout & operator=(DWG::Layout && in_that);
252 
253 
256  DWGObjectID * GetDWGObjectID() const;
257  };
258 
260  class DWG_API Factory : public Sprocket
261  {
262  public:
267  static Component CreateComponent(HPS::Component const & in_owner, HPS::Component::ComponentType in_type, DWGObjectID * in_object_id = nullptr);
268 
271  static CADModel CreateCADModel(Model const & in_model = HPS::Factory::CreateModel());
272 
277  static Layout CreateLayout(HPS::Component const & in_owner, HPS::Component::ComponentType in_type, DWGObjectID * in_object_id = nullptr);
278 
282  static Layer CreateLayer(HPS::Component const & in_owner, DWGObjectID * in_object_id = nullptr);
283 
284  private:
286  Factory();
287  };
288 
291  class DWG_API ImportNotifier : public IONotifier
292  {
293  public:
295  ImportNotifier();
296 
299  ImportNotifier(ImportNotifier const & in_that);
300 
305  ImportNotifier(IONotifier const & in_that);
306 
310  ImportNotifier(ImportNotifier && in_that);
311 
315  ImportNotifier & operator=(ImportNotifier && in_that);
316 
317  virtual ~ImportNotifier();
318 
319  static const HPS::Type staticType = HPS::Type::DWGImportNotifier;
320  HPS::Type ObjectType() const { return staticType; };
321 
325  ImportNotifier & operator=(ImportNotifier const & in_that);
326 
329  void Assign(ImportNotifier const & in_that);
330 
333  DWG::CADModel GetCADModel() const;
334 
337  Time GetImportTime() const;
338 
341  Time GetParseTime() const;
342  };
343 
344  class ImportOptionsKit;
345 
347  class DWG_API File
348  {
349  public:
354  static ImportNotifier Import(char const * in_file_name, ImportOptionsKit const & in_options);
355 
356  private:
358  File();
359  };
360 
362  class DWG_API ImportOptionsKit : public HPS::SprocketKit
363  {
364  public:
367 
370  ImportOptionsKit(ImportOptionsKit const & in_kit);
371 
376 
380  ImportOptionsKit & operator=(ImportOptionsKit && in_that);
381 
382  virtual ~ImportOptionsKit();
383 
384  static const HPS::Type staticType = HPS::Type::DWGImportOptionsKit;
385  HPS::Type ObjectType() const { return staticType; }
386 
390  static ImportOptionsKit GetDefault();
391 
394  void Set(ImportOptionsKit const & in_kit);
395 
398  void Show(ImportOptionsKit & out_kit) const;
399 
403  ImportOptionsKit & operator=(ImportOptionsKit const & in_kit);
404 
407  bool Empty() const;
408 
412  bool Equals(ImportOptionsKit const & in_kit) const;
413 
417  bool operator==(ImportOptionsKit const & in_kit) const;
418 
422  bool operator!=(ImportOptionsKit const & in_kit) const;
423 
424 
429  ImportOptionsKit & SetMaxTessellationDeviation(double in_deviation);
430 
434  ImportOptionsKit & SetUnreferencedRecords(bool in_state);
435 
439  ImportOptionsKit & SetLogging(const char * in_log_file);
440 
444  ImportOptionsKit & SetTextureDirectories(HPS::UTF8Array const & in_texture_directories);
445 
448  ImportOptionsKit & UnsetMaxTessellationDeviation();
449 
452  ImportOptionsKit & UnsetUnreferencedRecords();
453 
456  ImportOptionsKit & UnsetLogging();
457 
460  ImportOptionsKit & UnsetTextureDirectories();
461 
464  ImportOptionsKit & UnsetEverything();
465 
469  bool ShowMaxTessellationDeviation(double & out_deviation) const;
470 
474  bool ShowUnreferencedRecords(bool & out_state) const;
475 
479  bool ShowLogging(HPS::UTF8 & out_log_file) const;
480 
484  bool ShowTextureDirectories(HPS::UTF8Array & out_texture_directories) const;
485  };
486 
487 private:
489  DWG();
490 };
491 
492 }
493 
494 #endif
Definition: hps.h:85
HPS::Type ObjectType() const
Definition: sprk_dwg.h:320
Definition: sprk.h:1102
HPS::Type ObjectType() const
Definition: sprk_dwg.h:76
HPS::Type ObjectType() const
Definition: sprk_dwg.h:385
Definition: sprk_dwg.h:53
HPS::Type ObjectType() const
Definition: sprk_dwg.h:242
Definition: sprk.h:68
Definition: sprk.h:1071
Definition: sprk_dwg.h:362
Definition: sprk_dwg.h:347
Definition: hps.h:7396
Definition: sprk_dwg.h:43
Definition: sprk.h:2654
Definition: hps.h:49395
Definition: sprk_dwg.h:157
std::vector< UTF8, Allocator< UTF8 > > UTF8Array
Array of type HPS::UTF8.
Definition: hps.h:6948
Definition: sprk.h:1317
Definition: sprk_dwg.h:260
ComponentType
Definition: sprk.h:2660
Definition: sprk_dwg.h:94
Definition: sprk.h:3832
HPS::Type ObjectType() const
Definition: sprk_dwg.h:186
Definition: sprk_dwg.h:214
Definition: sprk_dwg.h:291
Definition: sprk.h:3919
static Model CreateModel(char const *in_name="")
HPS::Type ObjectType() const
Definition: sprk_dwg.h:127