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  HPS::Type ObjectType() const { return HPS::Type::DWGComponent; }
76 
77 #ifndef _MSC_VER
78  Component & operator=(Component const & in_that) = default;
79 #endif
80 
84  Component & operator=(DWG::Component && in_that);
85 
86 
89  DWGObjectID * GetDWGObjectID() const;
90  };
91 
93  class DWG_API Layer : public DWG::Component
94  {
95  public:
97  Layer();
98 
102  Layer(HPS::Component const & in_that);
103 
107  Layer(Component const & in_that);
108 
111  Layer(Layer const & in_layer);
112 
116  Layer(Layer && in_that);
117 
121  Layer & operator=(Layer && in_that);
122 
123  virtual ~Layer();
124 
125  HPS::Type ObjectType() const { return HPS::Type::DWGLayer; }
126 
130  bool Equals(Layer const & in_layer) const;
131 
135  bool operator==(Layer const & in_layer) const;
136 
140  bool operator!=(Layer const & in_layer) const;
141 
142  /* Turns this Layer ON.*/
143  void TurnOn() const;
144 
145  /* Turns this Layer OFF.*/
146  void TurnOff() const;
147 
148  /* Checks whether this Layer is considered as being turned on in the Visualize scene graph
149  * \return <span class='code'>true</span> if the Layer is turned on, <span class='code'>false</span> otherwise. */
150  bool IsOn() const;
151  };
152 
155  class DWG_API CADModel : public HPS::CADModel
156  {
157  public:
159  CADModel();
160 
165  CADModel(Component const & in_that);
166 
171  CADModel(HPS::CADModel const & in_that);
172 
175  CADModel(DWG::CADModel const & in_that);
176 
179  CADModel(DWG::CADModel && in_that);
180 
181  virtual ~CADModel();
182 
183  HPS::Type ObjectType() const { return HPS::Type::DWGCADModel; }
184 
185 #if !defined(_MSC_VER) || _MSC_VER >= 1900
186  CADModel & operator=(DWG::CADModel const & in_that) = default;
187 #endif
188 
192  CADModel & operator=(DWG::CADModel && in_that);
193 
199  HPS::View ActivateDefaultLayout();
200 
203  DWGDatabase * GetDWGDatabase() const;
204 
205 
208  LayoutArray GetAllLayouts() const;
209  };
210 
211  class DWG_API Layout : public Capture
212  {
213  public:
215  Layout();
216 
220  Layout(Component const & in_that);
221 
226  Layout(HPS::Capture const & in_that);
227 
230  Layout(DWG::Layout const & in_that);
231 
234  Layout(DWG::Layout && in_that);
235 
236  virtual ~Layout();
237 
238  HPS::Type ObjectType() const { return HPS::Type::DWGLayout; }
239 
240 #if !defined(_MSC_VER) || _MSC_VER >= 1900
241  Layout & operator=(Layout const & in_that) = default;
242 #endif
243 
247  Layout & operator=(DWG::Layout && in_that);
248 
249 
252  DWGObjectID * GetDWGObjectID() const;
253  };
254 
256  class DWG_API Factory : public Sprocket
257  {
258  public:
263  static Component CreateComponent(HPS::Component const & in_owner, HPS::Component::ComponentType in_type, DWGObjectID * in_object_id = nullptr);
264 
267  static CADModel CreateCADModel(Model const & in_model = HPS::Factory::CreateModel());
268 
273  static Layout CreateLayout(HPS::Component const & in_owner, HPS::Component::ComponentType in_type, DWGObjectID * in_object_id = nullptr);
274 
278  static Layer CreateLayer(HPS::Component const & in_owner, DWGObjectID * in_object_id = nullptr);
279 
280  private:
282  Factory();
283  };
284 
287  class DWG_API ImportNotifier : public IONotifier
288  {
289  public:
291  ImportNotifier();
292 
295  ImportNotifier(ImportNotifier const & in_that);
296 
301  ImportNotifier(IONotifier const & in_that);
302 
306  ImportNotifier(ImportNotifier && in_that);
307 
311  ImportNotifier & operator=(ImportNotifier && in_that);
312 
313  virtual ~ImportNotifier();
314 
315  HPS::Type ObjectType() const { return HPS::Type::DWGImportNotifier; };
316 
320  ImportNotifier & operator=(ImportNotifier const & in_that);
321 
324  void Assign(ImportNotifier const & in_that);
325 
328  DWG::CADModel GetCADModel() const;
329 
332  Time GetImportTime() const;
333 
336  Time GetParseTime() const;
337  };
338 
339  class ImportOptionsKit;
340 
342  class DWG_API File
343  {
344  public:
349  static ImportNotifier Import(char const * in_file_name, ImportOptionsKit const & in_options);
350 
351  private:
353  File();
354  };
355 
357  class DWG_API ImportOptionsKit : public HPS::SprocketKit
358  {
359  public:
362 
365  ImportOptionsKit(ImportOptionsKit const & in_kit);
366 
371 
375  ImportOptionsKit & operator=(ImportOptionsKit && in_that);
376 
377  virtual ~ImportOptionsKit();
378 
379  HPS::Type ObjectType() const { return HPS::Type::DWGImportOptionsKit; }
380 
384  static ImportOptionsKit GetDefault();
385 
388  void Set(ImportOptionsKit const & in_kit);
389 
392  void Show(ImportOptionsKit & out_kit) const;
393 
397  ImportOptionsKit & operator=(ImportOptionsKit const & in_kit);
398 
401  bool Empty() const;
402 
406  bool Equals(ImportOptionsKit const & in_kit) const;
407 
411  bool operator==(ImportOptionsKit const & in_kit) const;
412 
416  bool operator!=(ImportOptionsKit const & in_kit) const;
417 
418 
423  ImportOptionsKit & SetMaxTessellationDeviation(double in_deviation);
424 
428  ImportOptionsKit & SetUnreferencedRecords(bool in_state);
429 
433  ImportOptionsKit & SetLogging(const char * in_log_file);
434 
438  ImportOptionsKit & SetTextureDirectories(HPS::UTF8Array const & in_texture_directories);
439 
442  ImportOptionsKit & UnsetMaxTessellationDeviation();
443 
446  ImportOptionsKit & UnsetUnreferencedRecords();
447 
450  ImportOptionsKit & UnsetLogging();
451 
454  ImportOptionsKit & UnsetTextureDirectories();
455 
458  ImportOptionsKit & UnsetEverything();
459 
463  bool ShowMaxTessellationDeviation(double & out_deviation) const;
464 
468  bool ShowUnreferencedRecords(bool & out_state) const;
469 
473  bool ShowLogging(HPS::UTF8 & out_log_file) const;
474 
478  bool ShowTextureDirectories(HPS::UTF8Array & out_texture_directories) const;
479  };
480 
481 private:
483  DWG();
484 };
485 
486 }
487 
488 #endif
Definition: sprk.h:264
Definition: sprk_dwg.h:53
Definition: sprk.h:66
Definition: sprk.h:234
Definition: sprk_dwg.h:357
Definition: sprk_dwg.h:342
Definition: hps.h:7044
HPS::Type ObjectType() const
Definition: sprk_dwg.h:315
Definition: sprk_dwg.h:43
HPS::Type ObjectType() const
Definition: sprk_dwg.h:183
Definition: sprk.h:1718
Definition: hps.h:45017
Definition: sprk_dwg.h:155
HPS::Type ObjectType() const
Definition: sprk_dwg.h:238
Definition: sprk.h:472
Definition: sprk_dwg.h:256
ComponentType
Definition: sprk.h:1723
HPS::Type ObjectType() const
Definition: sprk_dwg.h:75
Definition: sprk_dwg.h:93
HPS::Type ObjectType() const
Definition: sprk_dwg.h:379
Definition: sprk.h:2442
Definition: sprk_dwg.h:211
Definition: sprk_dwg.h:287
Definition: sprk.h:2528
static Model CreateModel(char const *in_name="")
HPS::Type ObjectType() const
Definition: sprk_dwg.h:125