HIOManager.h
Go to the documentation of this file.
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 
16 #ifndef _HIOMANAGER_H
17 #define _HIOMANAGER_H
18 
19 #ifdef H_PACK_8
20 #pragma pack(push)
21 #pragma pack(8)
22 #endif
23 
24 #include <stdint.h>
25 #include "HTools.h"
26 
27 
28 // forwards
29 enum HFileOutputResult;
30 class HPDFOptions;
31 class HBaseView;
32 class HCamera;
33 class HBaseModel;
34 struct vlist_s;
35 class HStreamFileToolkit;
37 class BREP_Topology;
38 
39 enum H_OUTPUT_TYPE
40 {
41  H_OUTPUT_TYPE_DEFAULT = 0,
42  H_PDF_OUTPUT_PORTFOLIO,
43  H_PDF_OUTPUT_3D,
44  H_PDF_OUTPUT_2D,
45  H_SINGLE_PASS_ZSORT,
46  H_SINGLE_PASS_NO_HIDDEN_SURFACES
47 };
48 
49 
53 #define HInputOpNone (1UL<<0)
54 
58 #define HInputOpFileInputByKey (1UL<<1)
59 
63 #define HInputOpFileInputToImageKey (1UL<<2)
64 
68 #define HOutputOpNone (1UL<<0)
69 
73 #define HOutputOpFileOutputByKey (1UL<<1)
74 
78 #define HOutputOpFileOutputFromImageKey (1UL<<2)
79 
80 
85 #define HIORegisterInputType(type,input_object) HIOManager::GetCurrentHIOManager()->RegisterInputHandler(type, input_object);
86 
87 
88 
90 #define HIORegisterOutputType(type,output_object) HIOManager::GetCurrentHIOManager()->RegisterOutputHandler(type, output_object);
91 
92 
93 
94 
99 class MVO_API HIONoticeCallback
100 {
101 public:
102 
103  virtual ~HIONoticeCallback() {}
108  virtual void Notice(const char * notice) = 0;
109  virtual void Notice(const __wchar_t * notice) {
110  UNREFERENCED(notice);
111  }
112 #ifdef H_USHORT_OVERLOAD
113  virtual void Notice(const unsigned short * notice) {
114  Notice((__wchar_t const *) notice);
115  }
116 #endif
117 };
118 
123 {
124 public:
125  virtual ~HIOPercentNoticeCallback();
130  virtual void Notice(float notice) =0;
131 };
132 
133 
134 
137 typedef void * (*HIO_CREATE_FREE_FUNCTION)(void *);
138 
141 typedef void (*HIO_FREE_CONNECTOR_FUNCTION)(void *);
142 
148 class MVO_API HIOConnector
149 {
150 public:
151 
152  /*Constructs an HIOConnector object.*/
153  HIOConnector();
154  virtual ~HIOConnector();
155 
163  virtual HC_KEY GetHoopsEntity(void * pKernelEntity);
164  virtual HC_KEY GetHoopsEntity(void * pKernelEntity, HC_KEY modelKey);
165 
173  virtual void * GetKernelEntity(HC_KEY key);
174  virtual void * GetKernelEntity(HC_KEY key, HC_KEY modelKey);
175 
182  virtual bool GetHoopsEntities(void * pKernelEntity, vlist_s *ret_HoopsKeysList);
183  virtual bool GetHoopsEntities(void * pKernelEntity, vlist_s *ret_HoopsKeysList, HC_KEY modelKey);
184 
191  virtual bool GetKernelEntities(HC_KEY key, vlist_s *ret_KernelEntitiesList);
192  virtual bool GetKernelEntities(HC_KEY key, vlist_s *ret_KernelEntitiesList, HC_KEY modelKey);
193 
199  virtual void AddConnection(HC_KEY key, void* pKernelEntity);
200  virtual void AddConnection(HC_KEY key, void* pKernelEntity, HC_KEY modelKey);
201 
202 
209  virtual void OptimizeTree(const char * segname, const char * option_string);
210 
211 protected:
212 
214  struct vhash_s *mhash_Hoops2Kernel;
215 
217  struct vhash_s *mhash_Kernel2Hoops;
218 
219 };
220 
228 };
229 
239 };
240 
246 class MVO_API HInputHandlerOptions
247 {
248 public:
249 
252  m_z_separation = 1;
253  m_depth_range = 0;
254  m_pHBaseView = 0;
255  m_pImageName = 0;
256  m_pImageFormat = 0;
257  m_pConnector = 0;
258  m_pExtendedData = 0;
259  m_bLocal = false;
260  m_tk = 0;
261  m_bLogging = false;
262 
263 
264  // Generic options used in DGN, SKP and DWG importer
265  m_bIgnoreOffEntities = false;
266 
267  //DWG/SKP option
268  m_bImportMetadata = false;
269 
270  // DWG import options (try and move them somewhere else)
271  m_bLegacyOptimize = false;
272  m_bDwgSkipUnreferencedBlocks = false;
273 
274  // DGN import Options
275  m_iDGNCellHeaderOption = SINGLE_ENTITY_CELLHEADER;
276  m_coneFactor = 10.0;
277  m_factorForSmartSolids = 45.0;
278  m_bDGNRebaselineModel = false;
279  m_bDGNImportAllModels = false;
280 
281  // PRC options
282  m_pPRCPMIConnector = 0;
283  m_pPRCTopologyManager = 0;
284  m_bPRCMergeFaces = false;
285  m_bPRCImportNonBrepFaces = true;
286  m_bPRCCreatePRCFileOnly = false;
287  m_bPRCInstanceShells = true;
288  m_bPRCCalculatePhysicalProperties = false;
289  m_pPRCMultiModelSelectionCallback = 0;
290  m_pPRCAsmModelFile = 0;
291  m_pPRCDeleteModelFile = false;
292  m_bPRCStoreUserAttributes = true;
293  m_pPRCDeleteModelCallback = 0;
294  m_bPRCImportHiddenObjects = false;
295  m_bPRCLoadAsDrawings = false;
296  m_PRCModelUnits = 0.0f;
297 
298  // DWF import options
299  m_bDisableDWFDrawOrder = false;
300  m_bDWFRebaselineModel = true;
301  m_bImportThumbnail = false;
302 
303  //Rhino import option
304  m_bForceRenderedModeColors = false;
305 
306  //SKP optimization option
307  m_bOptimizeSegmentTree = false;
308  m_license = 0;
309 
310  m_pOOCNodeDeltas = 0;
311  m_bOOCAutoUpdate = true;
312  m_bOOCAutoCleanup = true;
313 
314  m_attributePrecisionMode = FORCE_FLOAT;
315 // m_geometryPrecisionMode = FLOAT_IF_SAFE;
316 
317  m_generatedDouble = false;
318 
319  m_bIsTestingSettings = false;
320  }
321 
325  m_z_separation = o->m_z_separation;
326  m_depth_range = o->m_depth_range;
327  m_pHBaseView = o->m_pHBaseView;
328  m_pImageName = o->m_pImageName;
329  m_pImageFormat = o->m_pImageFormat;
330  m_pConnector = o->m_pConnector;
331  m_pExtendedData = o->m_pExtendedData;
332  m_bLocal = o->m_bLocal;
333 
334  m_license = o->m_license;
335 
336  //DWG/DGN/SKP option
337  m_bIgnoreOffEntities = o->m_bIgnoreOffEntities;
338 
339  //DWG/SKP option
340  m_bImportMetadata = o->m_bImportMetadata;
341 
342 
343  //DWG Options
344  m_bLegacyOptimize = o->m_bLegacyOptimize;
345  m_bDwgSkipUnreferencedBlocks = o->m_bDwgSkipUnreferencedBlocks;
346 
347  //DGN Options
348  m_iDGNCellHeaderOption = o->m_iDGNCellHeaderOption;
349  m_bDGNRebaselineModel = o->m_bDGNRebaselineModel;
350  m_coneFactor = o->m_coneFactor;
351  m_factorForSmartSolids = o->m_factorForSmartSolids;
352  m_bDGNImportAllModels = o->m_bDGNImportAllModels;
353 
354  // PRC options
355  m_pPRCPMIConnector = o->m_pPRCPMIConnector;
356  m_pPRCTopologyManager = o->m_pPRCTopologyManager;
357  m_bPRCMergeFaces = o->m_bPRCMergeFaces;
358  m_bPRCImportNonBrepFaces = o->m_bPRCImportNonBrepFaces;
359 
360  m_bPRCCreatePRCFileOnly = o->m_bPRCCreatePRCFileOnly;
361  m_bPRCInstanceShells = o->m_bPRCInstanceShells;
362  m_bPRCCalculatePhysicalProperties = o->m_bPRCCalculatePhysicalProperties;
363  m_pPRCMultiModelSelectionCallback = o->m_pPRCMultiModelSelectionCallback;
364  m_pPRCAsmModelFile = o->m_pPRCAsmModelFile;
365  m_pPRCDeleteModelFile = o->m_pPRCDeleteModelFile;
366  m_pPRCDeleteModelCallback = o->m_pPRCDeleteModelCallback;
367  m_bPRCImportHiddenObjects = o->m_bPRCImportHiddenObjects;
368  m_bPRCLoadAsDrawings = o->m_bPRCLoadAsDrawings;
369  m_PRCModelUnits = o->m_PRCModelUnits;
370 
371 
372  // DWF import options
373  m_bDisableDWFDrawOrder = o->m_bDisableDWFDrawOrder;
374  m_bDWFRebaselineModel = o->m_bDWFRebaselineModel;
375  m_bImportThumbnail = o->m_bImportThumbnail;
376 
377 
378  //SKP import option
379  m_bOptimizeSegmentTree = o->m_bOptimizeSegmentTree;
380 
381  m_pOOCNodeDeltas = o->m_pOOCNodeDeltas;
382  m_bOOCAutoUpdate = o->m_bOOCAutoUpdate;
383  m_bOOCAutoCleanup = o->m_bOOCAutoCleanup;
384 
385  m_attributePrecisionMode = o->m_attributePrecisionMode;
386 // m_geometryPrecisionMode = o->m_geometryPrecisionMode;
387  m_generatedDouble = o->m_generatedDouble;
388 
389  m_bIsTestingSettings = o->m_bIsTestingSettings;
390 
391  //Rhino import option
392  m_bForceRenderedModeColors = o->m_bForceRenderedModeColors;
393  }
394 
398  m_z_separation = o.m_z_separation;
399  m_depth_range = o.m_depth_range;
400  m_pHBaseView = o.m_pHBaseView;
401  m_pImageName = o.m_pImageName;
402  m_pImageFormat = o.m_pImageFormat;
403  m_pConnector = o.m_pConnector;
404  m_pExtendedData = o.m_pExtendedData;
405  m_bLocal = o.m_bLocal;
406 
407  //DWG/DGN/SKP option
408  m_bIgnoreOffEntities = o.m_bIgnoreOffEntities;
409 
410  //DWG/SKP option
411  m_bImportMetadata = o.m_bImportMetadata;
412 
413  //DWG options
414  m_bLegacyOptimize = o.m_bLegacyOptimize;
415  m_bDwgSkipUnreferencedBlocks = o.m_bDwgSkipUnreferencedBlocks;
416 
417  //DGN options
418  m_iDGNCellHeaderOption = o.m_iDGNCellHeaderOption;
419  m_bDGNRebaselineModel = o.m_bDGNRebaselineModel;
420  m_coneFactor = o.m_coneFactor;
421  m_factorForSmartSolids = o.m_factorForSmartSolids;
422  m_bDGNImportAllModels = o.m_bDGNImportAllModels;
423 
424  // PRC options
425  m_pPRCPMIConnector = o.m_pPRCPMIConnector;
426  m_pPRCTopologyManager = o.m_pPRCTopologyManager;
427  m_bPRCMergeFaces = o.m_bPRCMergeFaces;
428  m_bPRCImportNonBrepFaces = o.m_bPRCImportNonBrepFaces;
429  m_bPRCCreatePRCFileOnly = o.m_bPRCCreatePRCFileOnly;
430  m_bPRCInstanceShells = o.m_bPRCInstanceShells;
431  m_bPRCCalculatePhysicalProperties = o.m_bPRCCalculatePhysicalProperties;
432  m_pPRCMultiModelSelectionCallback = o.m_pPRCMultiModelSelectionCallback;
433  m_pPRCAsmModelFile = o.m_pPRCAsmModelFile;
434  m_pPRCDeleteModelFile = o.m_pPRCDeleteModelFile;
435  m_bPRCImportHiddenObjects = o.m_bPRCImportHiddenObjects;
436  m_bPRCLoadAsDrawings = o.m_bPRCLoadAsDrawings;
437  m_PRCModelUnits = o.m_PRCModelUnits;
438 
439  // DWF import options
440  m_bDisableDWFDrawOrder = o.m_bDisableDWFDrawOrder;
441  m_bDWFRebaselineModel = o.m_bDWFRebaselineModel;
442  m_bImportThumbnail = o.m_bImportThumbnail;
443 
444 
445  //SKP import option
446  m_bOptimizeSegmentTree = o.m_bOptimizeSegmentTree;
447 
448  m_pOOCNodeDeltas = o.m_pOOCNodeDeltas;
449  m_bOOCAutoUpdate = o.m_bOOCAutoUpdate;
450  m_bOOCAutoCleanup = o.m_bOOCAutoCleanup;
451 
452  m_attributePrecisionMode = o.m_attributePrecisionMode;
453 // m_geometryPrecisionMode = o.m_geometryPrecisionMode;
454  m_generatedDouble = o.m_generatedDouble;
455 
456  m_bIsTestingSettings = o.m_bIsTestingSettings;
457 
458  //Rhino import option
459  m_bForceRenderedModeColors = o.m_bForceRenderedModeColors;
460  }
461 
462  virtual ~HInputHandlerOptions();
463 
466 
468  const char * m_pImageName;
469 
471  const char * m_pImageFormat;
472 
474  bool m_bLocal;
475 
477  HStreamFileToolkit * m_tk;
478 
481 
484 
487 
490 
492  const char *m_license;
493 
496 
500  double m_coneFactor;
501 
506 
509 
510 
511 
515  enum {
518  OPT_CELLHEADER
519  };
520 
523 
526 
533  bool m_bPRCImportNonBrepFaces;
534 
537  bool m_bPRCInstanceShells;
538 
539  bool m_bPRCCalculatePhysicalProperties;
541  void (*m_pPRCMultiModelSelectionCallback) (char const * in_container, int in_num_configs, char const * in_configs[],
542  int & out_config_selection);
546  void (*m_pPRCDeleteModelCallback) ( void*& pPRCAsmModelFile);
549 
552 
555 
558 
561 
562  // DWF import options
568 
571 
574 
577 
580 
588 
598 
599  /*
600  For 2D files (DWF only as of this time), the drawing can be layered either by using depth range or by offsetting
601  the z values. To separate the layers by z value, make sure z > 0. To use depth range, make sure depth range > 0.
602  */
603  double m_z_separation;
604 
610 
613 
616 
619 
620 
621 
625  enum {
630  FORCE_DOUBLE
631  };
632 
635 
637 // int m_geometryPrecisionMode; // (NOTE: currently not used)
638 
641 
644 };
645 
646 
647 
649 
655 class MVO_API HInputHandler
656 {
657 
658 public:
666  HInputHandler();
667  virtual ~HInputHandler();
668 
673  unsigned long GetInputOps() {return m_InputOps;};
674 
675 
678  virtual const char * GetInputName() = 0;
679 
680 
687  virtual void RegisterInputHandlerTypes() = 0;
688 
695  virtual HInputHandlerStyle GetInputStyle() = 0;
696 
704  virtual HFileInputResult FileInputByKey(const char * filename, HC_KEY key, HInputHandlerOptions * options);
705  virtual HFileInputResult FileInputByKey(const __wchar_t * filename, HC_KEY key, HInputHandlerOptions * options);
706 
707 
716  virtual HFileInputResult FileInputByKey(const unsigned short * filename, HC_KEY key, HInputHandlerOptions * options);
717 
728  virtual HFileInputResult FileInputToImageKey(const char * filename, HC_KEY * image_key, HC_KEY segment_key, HInputHandlerOptions * options);
729  virtual HFileInputResult FileInputToImageKey(const __wchar_t * filename, HC_KEY * image_key, HC_KEY segment_key, HInputHandlerOptions * options);
730 
731 
741  virtual HFileInputResult FileInputToImageKey(const unsigned short * filename, HC_KEY * image_key, HC_KEY segment_key, HInputHandlerOptions * options);
742 
755  virtual const char * GetInputTypesString() = 0;
756 
760  const __wchar_t * GetInputProgress();
761 
765  float GetInputPercentProgress();
766 
770  const __wchar_t * GetInputInformation();
771 
778  HIONoticeCallback * SetInputProgressNoticeCallback(HIONoticeCallback *notice_callback);
779 
780 
787  HIOPercentNoticeCallback * SetInputPercentProgressNoticeCallback(HIOPercentNoticeCallback *percent_notice_callback);
788 
795  HIONoticeCallback * SetInputInformationNoticeCallback(HIONoticeCallback *notice_callback);
796 
798  void ReportInputProgress(const char * progress);
799  void ReportInputProgress(const __wchar_t * progress);
800 
802  void ReportInputPercentProgress(float percent_progress);
803 
805  void ReportInputInformation(const char * information);
806  void ReportInputInformation(const __wchar_t * information);
807 
808  void SetModuleDirectory(const char *module_directory);
809  void SetModuleDirectory(const __wchar_t *module_directory);
810 
811 protected:
812 
816  void SetStartingInput(const char *filename);
817  void SetStartingInput(const __wchar_t *filename = 0);
818 
822  void SetFinishedInput();
823 
825  void SetInputOps(unsigned long ops) {m_InputOps=ops;};
826 
828  unsigned long m_InputOps;
829 
830  __wchar_t *m_module_directory;
831 
832 private:
833  __wchar_t *m_progress;
834  float m_percent_progress1;
835  float m_percent_progress2;
836  __wchar_t *m_information;
837  struct vlist_s *m_information_list;
838  HIONoticeCallback *m_progress_callback;
839  HIONoticeCallback *m_information_callback;
840  HIOPercentNoticeCallback *m_percent_progress_callback;
841 };
842 
847 {
848  HOutputHandlerStyleModel,
853 };
854 
861 class MVO_API ExportNameMap
862 {
863 private:
864  void * _imp;
865 public:
866  ExportNameMap();
867  ~ExportNameMap();
868 
869  H_FORMAT_TEXT lookup(HC_KEY) const;
870  void tag(HC_KEY, H_FORMAT_TEXT const &);
871 };
872 
885 };
886 
893 {
894 public:
897 
898  virtual char const * GetType() const;
899 
902  virtual bool PopulateOptions();
903 
908  Init(o);
909  };
910 
915  Init(&o);
916  };
917 
918 
919  virtual ~HOutputHandlerOptions();
920 
924  void Init(HOutputHandlerOptions const *o);
925 
929  HBaseView * View() const {return m_pHBaseView;};
931  void View(HBaseView * const v) {m_pHBaseView = v;};
932 
934  HBaseModel * m_pHBaseModel;
936  HBaseModel * Model() const {return m_pHBaseModel;};
938  void Model(HBaseModel * const m) {m_pHBaseModel = m;};
939 
941  HCamera * m_pCamera;
943  HCamera * Camera() const {return m_pCamera;};
945  void Camera(HCamera * const c) {m_pCamera = c;};
946 
948  HC_KEY m_Key;
950  HC_KEY Key() const {return m_Key;};
952  void Key(HC_KEY const k) {m_Key = k;};
953 
955  char const * m_pHSRAOptions;
957  char const * HSRAOptions() const {return m_pHSRAOptions;};
959  void HSRAOptions(char const * const tf) {m_pHSRAOptions = tf;};
960 
962  HPoint const * m_pWindowColor;
964  HPoint const * WindowColor() const {return m_pWindowColor;};
966  void WindowColor(HPoint const * const tf) {m_pWindowColor = tf;};
967 
969  bool m_bUseWindowColor;
971  bool UseWindowColor() const {return m_bUseWindowColor;};
973  void UseWindowColor(bool const tf) {m_bUseWindowColor = tf;};
974 
976  float m_Window_Width;
978  float WindowWidth() const {return m_Window_Width;};
980  void WindowWidth(float const f) {m_Window_Width = f;};
981 
983  float m_Window_Height;
985  float WindowHeight() const {return m_Window_Height;};
987  void WindowHeight(float const f) {m_Window_Height = f;};
988 
990  float m_Paper_Width;
992  float PaperWidth() const {return m_Paper_Width;};
994  void PaperWidth(float const f) {m_Paper_Width = f;};
995 
997  float m_Paper_Height;
999  float PaperHeight() const {return m_Paper_Height;};
1001  void PaperHeight(float const f) {m_Paper_Height = f;};
1002 
1004  bool m_ForceGrayscale;
1006  bool ForceGrayscale() const {return m_ForceGrayscale;};
1008  void ForceGrayscale(bool const tf) {m_ForceGrayscale = tf;};
1009 
1011  size_t m_lineFuseThreshold;
1012 
1016  size_t LineFuseThreshold() const {return m_lineFuseThreshold;};
1017 
1021  void LineFuseThreshold(size_t const tf) {m_lineFuseThreshold = tf;};
1022 
1024  bool m_bFastPrint;
1026  bool FastPrint() const {return m_bFastPrint;};
1028  void FastPrint(bool const tf) {m_bFastPrint = tf;};
1029 
1031  bool m_bConserveMemory;
1033  bool ConserveMemory() const {return m_bConserveMemory;};
1035  void ConserveMemory(bool const tf) {m_bConserveMemory = tf;};
1036 
1037  bool m_bWriteAnimations;
1038  bool WriteAnimations() const {return m_bWriteAnimations;};
1039  void WriteAnimations(bool const tf) {m_bWriteAnimations = tf;};
1040 
1042  bool m_bWindowFrame;
1044  bool WindowFrame() const {return m_bWindowFrame;};
1046  void WindowFrame(bool const tf) {m_bWindowFrame = tf;};
1047 
1049  bool m_bUseSubscreen;
1051  bool UseSubscreen() const {return m_bUseSubscreen;};
1053  void UseSubscreen(bool const tf) {m_bUseSubscreen = tf;};
1054 
1056  int m_Image_Dpi;
1058  int ImageDpi() const {return m_Image_Dpi;};
1060  void ImageDpi(int const dpi) {m_Image_Dpi = dpi;};
1061 
1063  int m_Paper_Dpi;
1065  int PaperDpi() const {return m_Paper_Dpi;};
1067  void PaperDpi(int const dpi) {m_Paper_Dpi = dpi;};
1068 
1070  void * m_pExtendedData;
1071  void * ExtendedData() const {return m_pExtendedData;};
1072  void ExtendedData(void * const vp) {m_pExtendedData = vp;};
1073  void ExtendedData(HPDFOptions * const vp) {m_pExtendedData = (void*)vp;};
1074 
1075  bool ActivateOnPageOpen() const {return m_bActivateOnPageOpen;};
1076  void ActivateOnPageOpen(bool onoff) {m_bActivateOnPageOpen = onoff;};
1077  float AnnotLeft() const {return m_fAnnotLeft;};
1078  void AnnotLeft(float f) {m_fAnnotLeft = f;};
1079  float AnnotRight() const {return m_fAnnotRight;};
1080  void AnnotRight(float f) {m_fAnnotRight = f;};
1081  float AnnotBottom() const {return m_fAnnotBottom;};
1082  void AnnotBottom(float f) {m_fAnnotBottom = f;};
1083  float AnnotTop() const {return m_fAnnotTop;};
1084  void AnnotTop(float f) {m_fAnnotTop = f;};
1085 
1086 
1088  const char *m_license;
1089 
1090  int m_antialiasLevel;
1091  int m_jpeg_quality;
1092  unsigned char* m_imageOutputBuffer;
1093  size_t m_imageOutputBufferSize;
1094 
1095 
1096 
1097 
1100  int Version() const {return m_Version;};
1101  void Version(int const v) {m_Version = v;};
1102 
1104  H_OUTPUT_TYPE m_OutputType;
1106  H_OUTPUT_TYPE OutputType() const {return m_OutputType;};
1108  void OutputType(H_OUTPUT_TYPE ot) {m_OutputType = ot;};
1109 
1111  bool m_b3dOutput;
1113  bool Output3d() const {return m_b3dOutput;};
1115  void Output3d(bool const tf) {m_b3dOutput = tf;};
1116 
1118  bool m_bAscii;
1120  bool Ascii() const {return m_bAscii;};
1122  void Ascii(bool const tf) {m_bAscii = tf;};
1123 
1125  bool m_bStlNormals;
1127  bool StlNormals() const {return m_bStlNormals;};
1129  void StlNormals(bool const tf) {m_bStlNormals = tf;};
1130 
1132  double m_ratio_cm_to_internal_units;
1133 
1137  double PrintToScale() const {return m_ratio_cm_to_internal_units;};
1138 
1154  void PrintToScale(double const r) {m_ratio_cm_to_internal_units = r;};
1155 
1162  float m_PageMargins[4];
1163 
1166 
1168  char const* m_pDWFModelName;
1169 
1174 
1177 
1180 
1183 
1186 
1189 
1192 
1195 
1198 
1201 
1204 
1207 
1209  MVO_POINTER_SIZED_INT m_iPrcNameUserDataIndex;
1210 
1211 
1214 
1217 
1226  char m_bAVICodec[4];
1227 
1230 
1233  char const * m_pHTMLTemplateFile;
1234 
1237 };
1238 
1239 
1241 
1247 class MVO_API HOutputHandler
1248 {
1249 
1250 public:
1258  HOutputHandler();
1259  virtual ~HOutputHandler();
1260 
1261 
1264  virtual const char * GetOutputName() = 0;
1265 
1270  unsigned long GetOutputOps() {return m_OutputOps;};
1271 
1282  virtual void RegisterOutputHandlerTypes() = 0;
1283 
1284 
1292  virtual HFileOutputResult FileOutputByKey(const char * filename, HC_KEY key, HOutputHandlerOptions * options);
1293  virtual HFileOutputResult FileOutputByKey(const __wchar_t * filename, HC_KEY key, HOutputHandlerOptions * options);
1294 
1302  virtual HFileOutputResult FileOutputByKey(const unsigned short * filename, HC_KEY key, HOutputHandlerOptions * options);
1303 
1304 
1313  virtual HFileOutputResult FileOutputFromImageKey(const char * filename, HC_KEY image_key, HOutputHandlerOptions * options);
1314  virtual HFileOutputResult FileOutputFromImageKey(const __wchar_t * filename, HC_KEY image_key, HOutputHandlerOptions * options);
1315 
1326  virtual const char * GetOutputTypesString() = 0;
1327 
1336  virtual HOutputHandlerStyle GetOutputStyle() = 0;
1337 
1344  virtual const char * GetOutputDefaultHSRA();
1345 
1349  const char * GetOutputProgress();
1350 
1354  float GetOutputPercentProgress();
1355 
1359  const __wchar_t * GetOutputInformation();
1360 
1367  HIONoticeCallback * SetOutputProgressNoticeCallback(HIONoticeCallback *notice_callback);
1368 
1369 
1376  HIOPercentNoticeCallback * SetOutputPercentProgressNoticeCallback(HIOPercentNoticeCallback *percent_notice_callback);
1377 
1384  HIONoticeCallback * SetOutputInformationNoticeCallback(HIONoticeCallback *notice_callback);
1385 
1387  void ReportOutputProgress(const char * progress);
1388 
1390  void ReportOutputPercentProgress(float percent_progress);
1391 
1393  void ReportOutputInformation(const char * information);
1394 
1395 
1396  void SetModuleDirectory(const char *module_directory);
1397  void SetModuleDirectory(const __wchar_t *module_directory);
1398 
1399 protected:
1400 
1404  void SetStartingOutput();
1405 
1409  void SetFinishedOutput();
1410 
1412  void SetOutputOps(unsigned long ops) {m_OutputOps=ops;};
1414  unsigned long m_OutputOps;
1415 
1416  char *m_module_directory;
1417 private:
1418 
1419  char *m_progress;
1420  float m_percent_progress1;
1421  float m_percent_progress2;
1422  __wchar_t *m_information;
1423  struct vlist_s *m_information_list;
1424  HIONoticeCallback *m_progress_callback;
1425  HIOPercentNoticeCallback *m_percent_progress_callback;
1426  HIONoticeCallback *m_information_callback;
1427 };
1428 
1434 class MVO_API HIOManager
1435 {
1436 
1437 public:
1438 
1439  HIOManager();
1440  virtual ~HIOManager();
1441 
1451  virtual HInputHandler * RegisterInputHandler(const char * file_type, HInputHandler * handler);
1452 
1461  virtual HOutputHandler * RegisterOutputHandler(const char * file_type, HOutputHandler * handler);
1462 
1473  virtual HIOConnector * RegisterConnector(const char * file_type, HIO_CREATE_FREE_FUNCTION Create, HIO_FREE_CONNECTOR_FUNCTION Free);
1474 
1518  virtual HInputHandler * GetInputHandler(const char * file_type);
1519  HInputHandler * GetInputHandler(const __wchar_t * file_type);
1520 #ifdef _MSC_VER
1521  HInputHandler * GetInputHandler(const unsigned short * file_type);
1522 #endif
1523 
1528  virtual HOutputHandler * GetOutputHandler(const char * file_type);
1529  virtual HOutputHandler * GetOutputHandler(const __wchar_t * file_type);
1530 
1535  virtual void RegisterHandlers();
1536 
1541  virtual const char * GetInputHandlerTypes();
1542 
1547  virtual const char * GetOutputHandlerTypes();
1548 
1549 
1556  virtual HIOConnector * CreateConnector(const char * file_type);
1557 
1562  virtual void FreeConnector(HIOConnector * old_connector);
1563 
1564 
1569  static HIOManager *GetCurrentHIOManager();
1570 
1576  static void GetFileOutputResultString(HFileOutputResult result, char *result_str);
1577 
1581  void CleanCallbacks();
1582 
1583 private:
1584  void RecordOutputHandler (HOutputHandler * handler);
1585  void RecordInputHandler (HInputHandler * handler);
1586 
1587 protected:
1588 
1590  struct vhash_s * input_handlers;
1591 
1593  struct vhash_s * output_handlers;
1594 
1596  struct vhash_s * connector_procs;
1597 
1599  struct vlist_s * owned_input_handlers;
1600 
1602  struct vlist_s * owned_output_handlers;
1603 
1605  struct vlist_s * loaded_input_handlers;
1606 
1608  struct vlist_s * loaded_output_handlers;
1609 
1611  struct vhash_s * created_connectors;
1612 
1613  char * m_input_types;
1614  int m_input_types_allocated;
1615 
1616  char * m_output_types;
1617  int m_output_types_allocated;
1618 };
1619 
1620 #ifdef H_PACK_8
1621 #pragma pack(pop)
1622 #endif
1623 
1624 #endif
1625 
int PaperDpi() const
Indicates the DPI used for paper. This is set from the options dialog.
Definition: HIOManager.h:1065
Definition: HIOManager.h:1434
size_t LineFuseThreshold() const
Definition: HIOManager.h:1016
HBaseView * m_pHBaseView
A pointer to the HBaseView object for this output.
Definition: HIOManager.h:927
float PaperWidth() const
Width for output sizing in inches.
Definition: HIOManager.h:992
bool m_bDGNRebaselineModel
DGN file import option: if true then whole model is rebased with use of model extents to compensate f...
Definition: HIOManager.h:557
Definition: HIOManager.h:861
handling choice is left to the importer
Definition: HIOManager.h:626
Definition: HIOManager.h:99
void WindowFrame(bool const tf)
Determines if a window frame is drawn or not.
Definition: HIOManager.h:1046
void HSRAOptions(char const *const tf)
HOOPS HSRAOption string .
Definition: HIOManager.h:959
bool m_pPRCDeleteModelFile
PRC import option: If true model file is deleted after loading is complete.
Definition: HIOManager.h:525
void(* m_pPRCDeleteModelCallback)(void *&pPRCAsmModelFile)
PRC import option: Function pointer to delete model.
Definition: HIOManager.h:546
double PrintToScale() const
Definition: HIOManager.h:1137
ExportNameMap m_names
Definition: HIOManager.h:1176
void PrintToScale(double const r)
Definition: HIOManager.h:1154
bool m_bPRCImportHiddenObjects
PRC import option: If true, hidden objects will be imported though not visible. If false...
Definition: HIOManager.h:548
data is forced to single-precision
Definition: HIOManager.h:629
Specifies an HInputHandler for model data.
Definition: HIOManager.h:226
char const * m_pPDFResourceDirectory
Definition: HIOManager.h:1173
struct vlist_s * owned_output_handlers
A list of default HOutputHandlers created by the manager.
Definition: HIOManager.h:1602
bool m_bLogging
If true, logging will be enabled in those plugins that support it.
Definition: HIOManager.h:480
The HBhvBehaviorManager class stores and manages all animation related data.
Definition: HBhvBehaviorManager.h:237
Low compression, high accuracy.
Definition: HIOManager.h:882
HCamera * Camera() const
A pointer to the HCamera object for this output.
Definition: HIOManager.h:943
void StlNormals(bool const tf)
Determines if we generate and output face normals when writing to STL file format.
Definition: HIOManager.h:1129
float m_fAnnotLeft
Definition: HIOManager.h:1185
bool m_bDWFRebaselineModel
DWF file import option: if true then whole model is rebased with use of model extents to compensate f...
Definition: HIOManager.h:573
Definition: HUtility.h:2357
bool m_bPrcUseNameUserData
Definition: HIOManager.h:1206
MVO_POINTER_SIZED_INT m_iPrcNameUserDataIndex
Definition: HIOManager.h:1209
const char * m_license
A pointer to a license key, intended to be used by 3rd party toolkits which require a license key to ...
Definition: HIOManager.h:492
Specifies an HOutputHandler for geometry data.
Definition: HIOManager.h:849
struct vhash_s * mhash_Hoops2Kernel
A hash map between HOOPS Keys and kernel entities.
Definition: HIOManager.h:214
const char * m_pImageName
The HOOPS image name to use for a newly loaded image.
Definition: HIOManager.h:468
bool m_bLegacyOptimize
Definition: HIOManager.h:587
Definition: HIOManager.h:148
HInputHandler an abstract base class for model and image input.
Definition: HIOManager.h:655
bool m_bAVIShowCompressionDialog
Definition: HIOManager.h:1216
The HCamera class is the data type of a HOOPS Camera Attribute.
Definition: HUtility.h:540
bool m_bPrcRemoveBRep
Definition: HIOManager.h:1200
bool m_bDGNImportAllModels
DGN file import option: if true then all the models are imported in the DGN file else only current mo...
Definition: HIOManager.h:560
BREP_Topology * m_pPRCTopologyManager
PRC import option: Pointer to connector class. If not null prc topology entities will be associated t...
Definition: HIOManager.h:530
void * m_pOOCNodeDeltas
OOC import option: Pointer to node deltas. If not null, importer will use it to selectively reject po...
Definition: HIOManager.h:612
void(* HIO_FREE_CONNECTOR_FUNCTION)(void *)
Definition: HIOManager.h:141
Specifies an HOutputHandler for a hardcopy output type.
Definition: HIOManager.h:851
HIOConnector * m_pConnector
A pointer to HIOConnector object. The connectivity between HOOPS and kernel will be stored in this...
Definition: HIOManager.h:483
HBhvBehaviorManager * m_pBehaviorManager
A pointer to the behavior manager.
Definition: HIOManager.h:1165
float m_PRCModelUnits
PRC import option: Used to specify the model units of an already loaded model, so that other models c...
Definition: HIOManager.h:554
HOutputHandlerStyle
Definition: HIOManager.h:846
Specifies an HInputHandler for image data.
Definition: HIOManager.h:227
Definition: HIOManager.h:122
void(* m_pPRCMultiModelSelectionCallback)(char const *in_container, int in_num_configs, char const *in_configs[], int &out_config_selection)
PRC import option: Function pointer for interactive multi-model loading.
Definition: HIOManager.h:541
HPrcBrepCompression
Definition: HIOManager.h:880
void PaperWidth(float const f)
Width for output sizing in inches.
Definition: HIOManager.h:994
bool m_bOOCAutoCleanup
OOC import option: Determines whether or not the view for the OOC model should automatically cleanup ...
Definition: HIOManager.h:618
void ConserveMemory(bool const tf)
This option has been deprecated and has no effect.
Definition: HIOManager.h:1035
data is converted to float if it appears safe, otherwise it is retained as double ...
Definition: HIOManager.h:628
Specifies an HOutputHandler for an image.
Definition: HIOManager.h:850
void *(* HIO_CREATE_FREE_FUNCTION)(void *)
Definition: HIOManager.h:137
struct vhash_s * input_handlers
A hash of HInputHandlers.
Definition: HIOManager.h:1590
HOutputHandler an abstract base class for model and image output.
Definition: HIOManager.h:1247
H_OUTPUT_TYPE OutputType() const
The output type.
Definition: HIOManager.h:1106
Specifies using an iso view (looking at the origin from (1, 1, 1))
Definition: HIOManager.h:236
Specifies an HOutputHandler for a MVO style html file.
Definition: HIOManager.h:852
double m_depth_range
Definition: HIOManager.h:609
void OutputType(H_OUTPUT_TYPE ot)
The output type.
Definition: HIOManager.h:1108
bool WindowFrame() const
Determines if a window frame is drawn or not.
Definition: HIOManager.h:1044
int ImageDpi() const
Indicates the DPI used for images. This is calculated with info from HC_Show_Device_Info.
Definition: HIOManager.h:1058
bool m_bPRCLoadAsDrawings
PRC import option: When loading a DWG or DXF file through HIOUtilityExchange, set this option to true...
Definition: HIOManager.h:551
indicates that cell header entity will be imported as single segment
Definition: HIOManager.h:516
const char * m_pImageFormat
The HOOPS image format to use for loading an image if not using filename .ext for format...
Definition: HIOManager.h:471
int m_attributePrecisionMode
The manner in which precision in attributes (such as matrices) is handled.
Definition: HIOManager.h:634
void PaperHeight(float const f)
Height for output sizing in inches.
Definition: HIOManager.h:1001
indicates that cell header will have as many segments as its children
Definition: HIOManager.h:517
struct vhash_s * connector_procs
A hash of HIOConnector Create/Free functions.
Definition: HIOManager.h:1596
void * m_pExtendedData
A pointer to extra data needed by a HInputHandler subclass.
Definition: HIOManager.h:486
float WindowHeight() const
Height for output sizing in inches.
Definition: HIOManager.h:985
bool m_bDisableDWFDrawOrder
Definition: HIOManager.h:567
HOutputHandlerOptions(const HOutputHandlerOptions &o)
Definition: HIOManager.h:914
double m_factorForSmartSolids
Definition: HIOManager.h:505
bool m_bPRCStoreUserAttributes
PRC import option: If true all prc user attributes will be converted as user option.
Definition: HIOManager.h:544
float m_fAnnotBottom
Definition: HIOManager.h:1191
void UseSubscreen(bool const tf)
Determines if HOOPS is calculating a subscreen to match the output to the size of the view window...
Definition: HIOManager.h:1053
float WindowWidth() const
Width for output sizing in inches.
Definition: HIOManager.h:978
void * m_pPRCAsmModelFile
Definition: HIOManager.h:1179
char const * m_pHTMLTemplateFile
Definition: HIOManager.h:1233
HBaseView * View() const
A pointer to the HBaseView object for this output.
Definition: HIOManager.h:929
High compression, low accuracy.
Definition: HIOManager.h:884
float m_fAnnotTop
Definition: HIOManager.h:1194
char const * m_pDWFModelName
Definition: HIOManager.h:1168
HPoint const * WindowColor() const
Set the color of the window. The RGB color stored in xyz of HPoint.
Definition: HIOManager.h:964
bool m_bPRCCreatePRCFileOnly
PRC import option: If true temporary prc file will be created but no parsing and creation of HOOPS en...
Definition: HIOManager.h:536
HInputHandlerOptions(HInputHandlerOptions const *o)
Definition: HIOManager.h:324
HDwgViewVector
Definition: HIOManager.h:234
struct vlist_s * loaded_input_handlers
A list of dynamically loaded HInputHandlers libraries.
Definition: HIOManager.h:1605
void Model(HBaseModel *const m)
A pointer to the HBaseModel object for this output.
Definition: HIOManager.h:938
bool UseSubscreen() const
Determines if HOOPS is calculating a subscreen to match the output to the size of the view window...
Definition: HIOManager.h:1051
HInputHandlerOptions(const HInputHandlerOptions &o)
Definition: HIOManager.h:397
The HBaseModel class is used to store and manage model information.
Definition: HBaseModel.h:47
HInputHandlerStyle
Definition: HIOManager.h:225
The HPoint class is the data type of a three-dimensional point.
Definition: HGlobals.h:121
bool m_bExporting2DDwf
Definition: HIOManager.h:1229
Definition: HIOManager.h:892
The HBaseView class defines and manages a view of model information.
Definition: HBaseView.h:332
Specifies using a top view (looking down the positive Z-axis at the XY-plane)
Definition: HIOManager.h:235
bool m_bForceRenderedModeColors
Rhino file import option: if true then Exchange will force rendered mode colors instead of shading mo...
Definition: HIOManager.h:579
void WindowColor(HPoint const *const tf)
Set the color of the window. The RGB color stored in xyz of HPoint.
Definition: HIOManager.h:966
bool m_bPrcRemoveAttributes
Definition: HIOManager.h:1203
bool m_bIgnoreOffEntities
Definition: HIOManager.h:495
struct vhash_s * output_handlers
A hash of HOutputHandlers.
Definition: HIOManager.h:1593
HInputHandlerOptions()
Definition: HIOManager.h:251
float m_fAnnotRight
Definition: HIOManager.h:1188
bool m_bActivateOnPageOpen
Definition: HIOManager.h:1182
HC_KEY Key() const
The HC_Key for this output.
Definition: HIOManager.h:950
int m_Version
The file format version desired for writing.
Definition: HIOManager.h:1099
bool StlNormals() const
Determines if we generate and output face normals when writing to STL file format.
Definition: HIOManager.h:1127
Medium compression, medium accuracy.
Definition: HIOManager.h:883
bool m_bOOCAutoUpdate
OOC import option: Determines whether or not the view for the OOC model should automatically update w...
Definition: HIOManager.h:615
bool m_bDwgSkipUnreferencedBlocks
Definition: HIOManager.h:597
void WindowWidth(float const f)
Width for output sizing in inches.
Definition: HIOManager.h:980
bool Ascii() const
Some file formats, support binary and ascii such as STL. Set this to true for ascii output...
Definition: HIOManager.h:1120
unsigned long GetOutputOps()
Definition: HIOManager.h:1270
float PaperHeight() const
Height for output sizing in inches.
Definition: HIOManager.h:999
void UseWindowColor(bool const tf)
If set to true, the background color of the view is used.
Definition: HIOManager.h:973
void * m_pPRCAsmModelFile
PRC import option: Returned to user. Contains Pointer to A3DAsmModelFile entity.
Definition: HIOManager.h:522
bool ConserveMemory() const
This option has been deprecated and has no effect.
Definition: HIOManager.h:1033
HPrcBrepCompression m_ePrcBrepCompression
Definition: HIOManager.h:1197
bool ForceGrayscale() const
Specifies black and white output.
Definition: HIOManager.h:1006
double m_coneFactor
Definition: HIOManager.h:500
HBaseModel * Model() const
A pointer to the HBaseModel object for this output.
Definition: HIOManager.h:936
void Output3d(bool const tf)
Some file formats, such as PDF and DWF, support 2d and/or 3d output. Set this to TRUE for 3d output...
Definition: HIOManager.h:1115
bool m_bPrcCompressTessellation
Definition: HIOManager.h:1213
No compression.
Definition: HIOManager.h:881
data is kept in the format from the file
Definition: HIOManager.h:627
unsigned long GetInputOps()
Definition: HIOManager.h:673
Definition: HIOManager.h:246
bool m_bOptimizeSegmentTree
SKP file import option: if true then model is optimized using Optimize_Segment_Tree API...
Definition: HIOManager.h:576
bool m_generatedDouble
The manner in which precision in geometry is handled.
Definition: HIOManager.h:640
void SetInputOps(unsigned long ops)
This sets the HInputOp.
Definition: HIOManager.h:825
struct vlist_s * loaded_output_handlers
A list of dynamically loaded HOutputHandlers libraries.
Definition: HIOManager.h:1608
void PaperDpi(int const dpi)
Indicates the DPI used for paper. This is set from the options dialog.
Definition: HIOManager.h:1067
HStreamFileToolkit * m_tk
The streamfile toolkit to be used.
Definition: HIOManager.h:477
struct vlist_s * owned_input_handlers
A list of default HInputHandlers created by the manager.
Definition: HIOManager.h:1599
bool m_bImportMetadata
DWG and SKP import option: Set to true if you want to import the metadata (xdata) along with the geom...
Definition: HIOManager.h:489
void SetOutputOps(unsigned long ops)
This sets the HOutputOp.
Definition: HIOManager.h:1412
bool UseWindowColor() const
If set to true, the background color of the view is used.
Definition: HIOManager.h:971
struct vhash_s * mhash_Kernel2Hoops
A hash map between kernel entities and HOOPS Keys.
Definition: HIOManager.h:217
bool Output3d() const
Some file formats, such as PDF and DWF, support 2d and/or 3d output. Set this to TRUE for 3d output...
Definition: HIOManager.h:1113
int m_iDGNCellHeaderOption
DGN file import option: has three option about how cell header should be imported.
Definition: HIOManager.h:508
bool m_bIsTestingSettings
Testing settings. true if you want to activate testings settings.
Definition: HIOManager.h:643
Specifies using the active viewport in the DWG file if present (if no active viewport is present...
Definition: HIOManager.h:237
struct vhash_s * created_connectors
A list of created HIOConnectors.
Definition: HIOManager.h:1611
HIOConnector * m_pPRCPMIConnector
PRC import option: Pointer to connector class. If not null prc PMI entities will be associated to HOO...
Definition: HIOManager.h:528
void WindowHeight(float const f)
Height for output sizing in inches.
Definition: HIOManager.h:987
HOutputHandlerOptions(HOutputHandlerOptions const *o)
Definition: HIOManager.h:907
bool m_bPRCMergeFaces
PRC import option: If true individual faces will be merged into one shell.
Definition: HIOManager.h:532
bool FastPrint() const
This option has been deprecated. Specifies printing method.
Definition: HIOManager.h:1026
HBaseView * m_pHBaseView
A pointer to the HBaseView object for this input.
Definition: HIOManager.h:465
char const * HSRAOptions() const
HOOPS HSRAOption string .
Definition: HIOManager.h:957
bool m_bHTMLIncludeMeasurementInformation
Definition: HIOManager.h:1236
bool m_bImportThumbnail
DWF file import option: if true then Thumbnail are imported in the DWF file.
Definition: HIOManager.h:570
void View(HBaseView *const v)
A pointer to the HBaseView object for this output.
Definition: HIOManager.h:931
Specifies using the view determined by the camera in the scene segment.
Definition: HIOManager.h:238
bool m_bLocal
The value is true if the image will have the local attribute.
Definition: HIOManager.h:474