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  m_bPRCExtractLargeTranslations = false;
298  m_PRCReferenceSegmentKey = HC_ERROR_KEY;
299 
300  // DWF import options
301  m_bDisableDWFDrawOrder = false;
302  m_bDWFRebaselineModel = true;
303  m_bImportThumbnail = false;
304 
305  //Rhino import option
306  m_bForceRenderedModeColors = false;
307 
308  //SKP optimization option
309  m_bOptimizeSegmentTree = false;
310  m_license = 0;
311 
312  m_pOOCNodeDeltas = 0;
313  m_bOOCAutoUpdate = true;
314  m_bOOCAutoCleanup = true;
315 
316  m_attributePrecisionMode = FORCE_FLOAT;
317 // m_geometryPrecisionMode = FLOAT_IF_SAFE;
318 
319  m_generatedDouble = false;
320 
321  m_bIsTestingSettings = false;
322  }
323 
327  m_z_separation = o->m_z_separation;
328  m_depth_range = o->m_depth_range;
329  m_pHBaseView = o->m_pHBaseView;
330  m_pImageName = o->m_pImageName;
331  m_pImageFormat = o->m_pImageFormat;
332  m_pConnector = o->m_pConnector;
333  m_pExtendedData = o->m_pExtendedData;
334  m_bLocal = o->m_bLocal;
335 
336  m_license = o->m_license;
337 
338  //DWG/DGN/SKP option
339  m_bIgnoreOffEntities = o->m_bIgnoreOffEntities;
340 
341  //DWG/SKP option
342  m_bImportMetadata = o->m_bImportMetadata;
343 
344 
345  //DWG Options
346  m_bLegacyOptimize = o->m_bLegacyOptimize;
347  m_bDwgSkipUnreferencedBlocks = o->m_bDwgSkipUnreferencedBlocks;
348 
349  //DGN Options
350  m_iDGNCellHeaderOption = o->m_iDGNCellHeaderOption;
351  m_bDGNRebaselineModel = o->m_bDGNRebaselineModel;
352  m_coneFactor = o->m_coneFactor;
353  m_factorForSmartSolids = o->m_factorForSmartSolids;
354  m_bDGNImportAllModels = o->m_bDGNImportAllModels;
355 
356  // PRC options
357  m_pPRCPMIConnector = o->m_pPRCPMIConnector;
358  m_pPRCTopologyManager = o->m_pPRCTopologyManager;
359  m_bPRCMergeFaces = o->m_bPRCMergeFaces;
360  m_bPRCImportNonBrepFaces = o->m_bPRCImportNonBrepFaces;
361 
362  m_bPRCCreatePRCFileOnly = o->m_bPRCCreatePRCFileOnly;
363  m_bPRCInstanceShells = o->m_bPRCInstanceShells;
364  m_bPRCCalculatePhysicalProperties = o->m_bPRCCalculatePhysicalProperties;
365  m_pPRCMultiModelSelectionCallback = o->m_pPRCMultiModelSelectionCallback;
366  m_pPRCAsmModelFile = o->m_pPRCAsmModelFile;
367  m_pPRCDeleteModelFile = o->m_pPRCDeleteModelFile;
368  m_pPRCDeleteModelCallback = o->m_pPRCDeleteModelCallback;
369  m_bPRCImportHiddenObjects = o->m_bPRCImportHiddenObjects;
370  m_bPRCLoadAsDrawings = o->m_bPRCLoadAsDrawings;
371  m_PRCModelUnits = o->m_PRCModelUnits;
372  m_bPRCExtractLargeTranslations = o->m_bPRCExtractLargeTranslations;
373  m_PRCReferenceSegmentKey = o->m_PRCReferenceSegmentKey;
374 
375 
376  // DWF import options
377  m_bDisableDWFDrawOrder = o->m_bDisableDWFDrawOrder;
378  m_bDWFRebaselineModel = o->m_bDWFRebaselineModel;
379  m_bImportThumbnail = o->m_bImportThumbnail;
380 
381 
382  //SKP import option
383  m_bOptimizeSegmentTree = o->m_bOptimizeSegmentTree;
384 
385  m_pOOCNodeDeltas = o->m_pOOCNodeDeltas;
386  m_bOOCAutoUpdate = o->m_bOOCAutoUpdate;
387  m_bOOCAutoCleanup = o->m_bOOCAutoCleanup;
388 
389  m_attributePrecisionMode = o->m_attributePrecisionMode;
390 // m_geometryPrecisionMode = o->m_geometryPrecisionMode;
391  m_generatedDouble = o->m_generatedDouble;
392 
393  m_bIsTestingSettings = o->m_bIsTestingSettings;
394 
395  //Rhino import option
396  m_bForceRenderedModeColors = o->m_bForceRenderedModeColors;
397  }
398 
402  m_z_separation = o.m_z_separation;
403  m_depth_range = o.m_depth_range;
404  m_pHBaseView = o.m_pHBaseView;
405  m_pImageName = o.m_pImageName;
406  m_pImageFormat = o.m_pImageFormat;
407  m_pConnector = o.m_pConnector;
408  m_pExtendedData = o.m_pExtendedData;
409  m_bLocal = o.m_bLocal;
410 
411  //DWG/DGN/SKP option
412  m_bIgnoreOffEntities = o.m_bIgnoreOffEntities;
413 
414  //DWG/SKP option
415  m_bImportMetadata = o.m_bImportMetadata;
416 
417  //DWG options
418  m_bLegacyOptimize = o.m_bLegacyOptimize;
419  m_bDwgSkipUnreferencedBlocks = o.m_bDwgSkipUnreferencedBlocks;
420 
421  //DGN options
422  m_iDGNCellHeaderOption = o.m_iDGNCellHeaderOption;
423  m_bDGNRebaselineModel = o.m_bDGNRebaselineModel;
424  m_coneFactor = o.m_coneFactor;
425  m_factorForSmartSolids = o.m_factorForSmartSolids;
426  m_bDGNImportAllModels = o.m_bDGNImportAllModels;
427 
428  // PRC options
429  m_pPRCPMIConnector = o.m_pPRCPMIConnector;
430  m_pPRCTopologyManager = o.m_pPRCTopologyManager;
431  m_bPRCMergeFaces = o.m_bPRCMergeFaces;
432  m_bPRCImportNonBrepFaces = o.m_bPRCImportNonBrepFaces;
433  m_bPRCCreatePRCFileOnly = o.m_bPRCCreatePRCFileOnly;
434  m_bPRCInstanceShells = o.m_bPRCInstanceShells;
435  m_bPRCCalculatePhysicalProperties = o.m_bPRCCalculatePhysicalProperties;
436  m_pPRCMultiModelSelectionCallback = o.m_pPRCMultiModelSelectionCallback;
437  m_pPRCAsmModelFile = o.m_pPRCAsmModelFile;
438  m_pPRCDeleteModelFile = o.m_pPRCDeleteModelFile;
439  m_bPRCImportHiddenObjects = o.m_bPRCImportHiddenObjects;
440  m_bPRCLoadAsDrawings = o.m_bPRCLoadAsDrawings;
441  m_PRCModelUnits = o.m_PRCModelUnits;
442  m_bPRCExtractLargeTranslations = o.m_bPRCExtractLargeTranslations;
443  m_PRCReferenceSegmentKey = o.m_PRCReferenceSegmentKey;
444 
445  // DWF import options
446  m_bDisableDWFDrawOrder = o.m_bDisableDWFDrawOrder;
447  m_bDWFRebaselineModel = o.m_bDWFRebaselineModel;
448  m_bImportThumbnail = o.m_bImportThumbnail;
449 
450 
451  //SKP import option
452  m_bOptimizeSegmentTree = o.m_bOptimizeSegmentTree;
453 
454  m_pOOCNodeDeltas = o.m_pOOCNodeDeltas;
455  m_bOOCAutoUpdate = o.m_bOOCAutoUpdate;
456  m_bOOCAutoCleanup = o.m_bOOCAutoCleanup;
457 
458  m_attributePrecisionMode = o.m_attributePrecisionMode;
459 // m_geometryPrecisionMode = o.m_geometryPrecisionMode;
460  m_generatedDouble = o.m_generatedDouble;
461 
462  m_bIsTestingSettings = o.m_bIsTestingSettings;
463 
464  //Rhino import option
465  m_bForceRenderedModeColors = o.m_bForceRenderedModeColors;
466  }
467 
468  virtual ~HInputHandlerOptions();
469 
472 
474  const char * m_pImageName;
475 
477  const char * m_pImageFormat;
478 
480  bool m_bLocal;
481 
483  HStreamFileToolkit * m_tk;
484 
487 
490 
493 
496 
498  const char *m_license;
499 
502 
506  double m_coneFactor;
507 
512 
515 
516 
517 
521  enum {
524  OPT_CELLHEADER
525  };
526 
529 
532 
539  bool m_bPRCImportNonBrepFaces;
540 
543  bool m_bPRCInstanceShells;
544 
545  bool m_bPRCCalculatePhysicalProperties;
547  void (*m_pPRCMultiModelSelectionCallback) (char const * in_container, int in_num_configs, char const * in_configs[],
548  int & out_config_selection);
552  void (*m_pPRCDeleteModelCallback) ( void*& pPRCAsmModelFile);
555 
558 
561 
566 
571 
574 
577 
578  // DWF import options
584 
587 
590 
593 
596 
604 
614 
615  /*
616  For 2D files (DWF only as of this time), the drawing can be layered either by using depth range or by offsetting
617  the z values. To separate the layers by z value, make sure z > 0. To use depth range, make sure depth range > 0.
618  */
619  double m_z_separation;
620 
626 
629 
632 
635 
636 
637 
641  enum {
646  FORCE_DOUBLE
647  };
648 
651 
653 // int m_geometryPrecisionMode; // (NOTE: currently not used)
654 
657 
660 };
661 
662 
663 
665 
671 class MVO_API HInputHandler
672 {
673 
674 public:
682  HInputHandler();
683  virtual ~HInputHandler();
684 
689  unsigned long GetInputOps() {return m_InputOps;};
690 
691 
694  virtual const char * GetInputName() = 0;
695 
696 
703  virtual void RegisterInputHandlerTypes() = 0;
704 
711  virtual HInputHandlerStyle GetInputStyle() = 0;
712 
720  virtual HFileInputResult FileInputByKey(const char * filename, HC_KEY key, HInputHandlerOptions * options);
721  virtual HFileInputResult FileInputByKey(const __wchar_t * filename, HC_KEY key, HInputHandlerOptions * options);
722 
723 
732  virtual HFileInputResult FileInputByKey(const unsigned short * filename, HC_KEY key, HInputHandlerOptions * options);
733 
744  virtual HFileInputResult FileInputToImageKey(const char * filename, HC_KEY * image_key, HC_KEY segment_key, HInputHandlerOptions * options);
745  virtual HFileInputResult FileInputToImageKey(const __wchar_t * filename, HC_KEY * image_key, HC_KEY segment_key, HInputHandlerOptions * options);
746 
747 
757  virtual HFileInputResult FileInputToImageKey(const unsigned short * filename, HC_KEY * image_key, HC_KEY segment_key, HInputHandlerOptions * options);
758 
771  virtual const char * GetInputTypesString() = 0;
772 
776  const __wchar_t * GetInputProgress();
777 
781  float GetInputPercentProgress();
782 
786  const __wchar_t * GetInputInformation();
787 
794  HIONoticeCallback * SetInputProgressNoticeCallback(HIONoticeCallback *notice_callback);
795 
796 
803  HIOPercentNoticeCallback * SetInputPercentProgressNoticeCallback(HIOPercentNoticeCallback *percent_notice_callback);
804 
811  HIONoticeCallback * SetInputInformationNoticeCallback(HIONoticeCallback *notice_callback);
812 
814  void ReportInputProgress(const char * progress);
815  void ReportInputProgress(const __wchar_t * progress);
816 
818  void ReportInputPercentProgress(float percent_progress);
819 
821  void ReportInputInformation(const char * information);
822  void ReportInputInformation(const __wchar_t * information);
823 
824  void SetModuleDirectory(const char *module_directory);
825  void SetModuleDirectory(const __wchar_t *module_directory);
826 
827 protected:
828 
832  void SetStartingInput(const char *filename);
833  void SetStartingInput(const __wchar_t *filename = 0);
834 
838  void SetFinishedInput();
839 
841  void SetInputOps(unsigned long ops) {m_InputOps=ops;};
842 
844  unsigned long m_InputOps;
845 
846  __wchar_t *m_module_directory;
847 
848 private:
849  __wchar_t *m_progress;
850  float m_percent_progress1;
851  float m_percent_progress2;
852  __wchar_t *m_information;
853  struct vlist_s *m_information_list;
854  HIONoticeCallback *m_progress_callback;
855  HIONoticeCallback *m_information_callback;
856  HIOPercentNoticeCallback *m_percent_progress_callback;
857 };
858 
863 {
864  HOutputHandlerStyleModel,
869 };
870 
877 class MVO_API ExportNameMap
878 {
879 private:
880  void * _imp;
881 public:
882  ExportNameMap();
883  ~ExportNameMap();
884 
885  H_FORMAT_TEXT lookup(HC_KEY) const;
886  void tag(HC_KEY, H_FORMAT_TEXT const &);
887 };
888 
901 };
902 
909 {
910 public:
913 
914  virtual char const * GetType() const;
915 
918  virtual bool PopulateOptions();
919 
924  Init(o);
925  };
926 
931  Init(&o);
932  };
933 
934 
935  virtual ~HOutputHandlerOptions();
936 
940  void Init(HOutputHandlerOptions const *o);
941 
945  HBaseView * View() const {return m_pHBaseView;};
947  void View(HBaseView * const v) {m_pHBaseView = v;};
948 
950  HBaseModel * m_pHBaseModel;
952  HBaseModel * Model() const {return m_pHBaseModel;};
954  void Model(HBaseModel * const m) {m_pHBaseModel = m;};
955 
957  HCamera * m_pCamera;
959  HCamera * Camera() const {return m_pCamera;};
961  void Camera(HCamera * const c) {m_pCamera = c;};
962 
964  HC_KEY m_Key;
966  HC_KEY Key() const {return m_Key;};
968  void Key(HC_KEY const k) {m_Key = k;};
969 
971  char const * m_pHSRAOptions;
973  char const * HSRAOptions() const {return m_pHSRAOptions;};
975  void HSRAOptions(char const * const tf) {m_pHSRAOptions = tf;};
976 
978  HPoint const * m_pWindowColor;
980  HPoint const * WindowColor() const {return m_pWindowColor;};
982  void WindowColor(HPoint const * const tf) {m_pWindowColor = tf;};
983 
985  bool m_bUseWindowColor;
987  bool UseWindowColor() const {return m_bUseWindowColor;};
989  void UseWindowColor(bool const tf) {m_bUseWindowColor = tf;};
990 
992  float m_Window_Width;
994  float WindowWidth() const {return m_Window_Width;};
996  void WindowWidth(float const f) {m_Window_Width = f;};
997 
999  float m_Window_Height;
1001  float WindowHeight() const {return m_Window_Height;};
1003  void WindowHeight(float const f) {m_Window_Height = f;};
1004 
1006  float m_Paper_Width;
1008  float PaperWidth() const {return m_Paper_Width;};
1010  void PaperWidth(float const f) {m_Paper_Width = f;};
1011 
1013  float m_Paper_Height;
1015  float PaperHeight() const {return m_Paper_Height;};
1017  void PaperHeight(float const f) {m_Paper_Height = f;};
1018 
1020  bool m_ForceGrayscale;
1022  bool ForceGrayscale() const {return m_ForceGrayscale;};
1024  void ForceGrayscale(bool const tf) {m_ForceGrayscale = tf;};
1025 
1027  size_t m_lineFuseThreshold;
1028 
1032  size_t LineFuseThreshold() const {return m_lineFuseThreshold;};
1033 
1037  void LineFuseThreshold(size_t const tf) {m_lineFuseThreshold = tf;};
1038 
1040  bool m_bFastPrint;
1042  bool FastPrint() const {return m_bFastPrint;};
1044  void FastPrint(bool const tf) {m_bFastPrint = tf;};
1045 
1047  bool m_bConserveMemory;
1049  bool ConserveMemory() const {return m_bConserveMemory;};
1051  void ConserveMemory(bool const tf) {m_bConserveMemory = tf;};
1052 
1053  bool m_bWriteAnimations;
1054  bool WriteAnimations() const {return m_bWriteAnimations;};
1055  void WriteAnimations(bool const tf) {m_bWriteAnimations = tf;};
1056 
1058  bool m_bWindowFrame;
1060  bool WindowFrame() const {return m_bWindowFrame;};
1062  void WindowFrame(bool const tf) {m_bWindowFrame = tf;};
1063 
1065  bool m_bUseSubscreen;
1067  bool UseSubscreen() const {return m_bUseSubscreen;};
1069  void UseSubscreen(bool const tf) {m_bUseSubscreen = tf;};
1070 
1072  int m_Image_Dpi;
1074  int ImageDpi() const {return m_Image_Dpi;};
1076  void ImageDpi(int const dpi) {m_Image_Dpi = dpi;};
1077 
1079  int m_Paper_Dpi;
1081  int PaperDpi() const {return m_Paper_Dpi;};
1083  void PaperDpi(int const dpi) {m_Paper_Dpi = dpi;};
1084 
1086  void * m_pExtendedData;
1087  void * ExtendedData() const {return m_pExtendedData;};
1088  void ExtendedData(void * const vp) {m_pExtendedData = vp;};
1089  void ExtendedData(HPDFOptions * const vp) {m_pExtendedData = (void*)vp;};
1090 
1091  bool ActivateOnPageOpen() const {return m_bActivateOnPageOpen;};
1092  void ActivateOnPageOpen(bool onoff) {m_bActivateOnPageOpen = onoff;};
1093  float AnnotLeft() const {return m_fAnnotLeft;};
1094  void AnnotLeft(float f) {m_fAnnotLeft = f;};
1095  float AnnotRight() const {return m_fAnnotRight;};
1096  void AnnotRight(float f) {m_fAnnotRight = f;};
1097  float AnnotBottom() const {return m_fAnnotBottom;};
1098  void AnnotBottom(float f) {m_fAnnotBottom = f;};
1099  float AnnotTop() const {return m_fAnnotTop;};
1100  void AnnotTop(float f) {m_fAnnotTop = f;};
1101 
1102 
1104  const char *m_license;
1105 
1106  int m_antialiasLevel;
1107  int m_jpeg_quality;
1108  unsigned char* m_imageOutputBuffer;
1109  size_t m_imageOutputBufferSize;
1110 
1111 
1112 
1113 
1116  int Version() const {return m_Version;};
1117  void Version(int const v) {m_Version = v;};
1118 
1120  H_OUTPUT_TYPE m_OutputType;
1122  H_OUTPUT_TYPE OutputType() const {return m_OutputType;};
1124  void OutputType(H_OUTPUT_TYPE ot) {m_OutputType = ot;};
1125 
1127  bool m_b3dOutput;
1129  bool Output3d() const {return m_b3dOutput;};
1131  void Output3d(bool const tf) {m_b3dOutput = tf;};
1132 
1134  bool m_bAscii;
1136  bool Ascii() const {return m_bAscii;};
1138  void Ascii(bool const tf) {m_bAscii = tf;};
1139 
1141  bool m_bStlNormals;
1143  bool StlNormals() const {return m_bStlNormals;};
1145  void StlNormals(bool const tf) {m_bStlNormals = tf;};
1146 
1148  double m_ratio_cm_to_internal_units;
1149 
1153  double PrintToScale() const {return m_ratio_cm_to_internal_units;};
1154 
1170  void PrintToScale(double const r) {m_ratio_cm_to_internal_units = r;};
1171 
1178  float m_PageMargins[4];
1179 
1182 
1184  char const* m_pDWFModelName;
1185 
1190 
1193 
1196 
1199 
1202 
1205 
1208 
1211 
1214 
1217 
1220 
1223 
1225  MVO_POINTER_SIZED_INT m_iPrcNameUserDataIndex;
1226 
1227 
1230 
1233 
1242  char m_bAVICodec[4];
1243 
1246 
1249  char const * m_pHTMLTemplateFile;
1250 
1253 
1259 };
1260 
1261 
1263 
1269 class MVO_API HOutputHandler
1270 {
1271 
1272 public:
1280  HOutputHandler();
1281  virtual ~HOutputHandler();
1282 
1283 
1286  virtual const char * GetOutputName() = 0;
1287 
1292  unsigned long GetOutputOps() {return m_OutputOps;};
1293 
1304  virtual void RegisterOutputHandlerTypes() = 0;
1305 
1306 
1314  virtual HFileOutputResult FileOutputByKey(const char * filename, HC_KEY key, HOutputHandlerOptions * options);
1315  virtual HFileOutputResult FileOutputByKey(const __wchar_t * filename, HC_KEY key, HOutputHandlerOptions * options);
1316 
1324  virtual HFileOutputResult FileOutputByKey(const unsigned short * filename, HC_KEY key, HOutputHandlerOptions * options);
1325 
1326 
1335  virtual HFileOutputResult FileOutputFromImageKey(const char * filename, HC_KEY image_key, HOutputHandlerOptions * options);
1336  virtual HFileOutputResult FileOutputFromImageKey(const __wchar_t * filename, HC_KEY image_key, HOutputHandlerOptions * options);
1337 
1348  virtual const char * GetOutputTypesString() = 0;
1349 
1358  virtual HOutputHandlerStyle GetOutputStyle() = 0;
1359 
1366  virtual const char * GetOutputDefaultHSRA();
1367 
1371  const char * GetOutputProgress();
1372 
1376  float GetOutputPercentProgress();
1377 
1381  const __wchar_t * GetOutputInformation();
1382 
1389  HIONoticeCallback * SetOutputProgressNoticeCallback(HIONoticeCallback *notice_callback);
1390 
1391 
1398  HIOPercentNoticeCallback * SetOutputPercentProgressNoticeCallback(HIOPercentNoticeCallback *percent_notice_callback);
1399 
1406  HIONoticeCallback * SetOutputInformationNoticeCallback(HIONoticeCallback *notice_callback);
1407 
1409  void ReportOutputProgress(const char * progress);
1410 
1412  void ReportOutputPercentProgress(float percent_progress);
1413 
1415  void ReportOutputInformation(const char * information);
1416 
1417 
1418  void SetModuleDirectory(const char *module_directory);
1419  void SetModuleDirectory(const __wchar_t *module_directory);
1420 
1421 protected:
1422 
1426  void SetStartingOutput();
1427 
1431  void SetFinishedOutput();
1432 
1434  void SetOutputOps(unsigned long ops) {m_OutputOps=ops;};
1436  unsigned long m_OutputOps;
1437 
1438  char *m_module_directory;
1439 private:
1440 
1441  char *m_progress;
1442  float m_percent_progress1;
1443  float m_percent_progress2;
1444  __wchar_t *m_information;
1445  struct vlist_s *m_information_list;
1446  HIONoticeCallback *m_progress_callback;
1447  HIOPercentNoticeCallback *m_percent_progress_callback;
1448  HIONoticeCallback *m_information_callback;
1449 };
1450 
1456 class MVO_API HIOManager
1457 {
1458 
1459 public:
1460 
1461  HIOManager();
1462  virtual ~HIOManager();
1463 
1473  virtual HInputHandler * RegisterInputHandler(const char * file_type, HInputHandler * handler);
1474 
1483  virtual HOutputHandler * RegisterOutputHandler(const char * file_type, HOutputHandler * handler);
1484 
1495  virtual HIOConnector * RegisterConnector(const char * file_type, HIO_CREATE_FREE_FUNCTION Create, HIO_FREE_CONNECTOR_FUNCTION Free);
1496 
1540  virtual HInputHandler * GetInputHandler(const char * file_type);
1541  HInputHandler * GetInputHandler(const __wchar_t * file_type);
1542 #ifdef _MSC_VER
1543  HInputHandler * GetInputHandler(const unsigned short * file_type);
1544 #endif
1545 
1550  virtual HOutputHandler * GetOutputHandler(const char * file_type);
1551  virtual HOutputHandler * GetOutputHandler(const __wchar_t * file_type);
1552 
1557  virtual void RegisterHandlers();
1558 
1563  virtual const char * GetInputHandlerTypes();
1564 
1569  virtual const char * GetOutputHandlerTypes();
1570 
1571 
1578  virtual HIOConnector * CreateConnector(const char * file_type);
1579 
1584  virtual void FreeConnector(HIOConnector * old_connector);
1585 
1586 
1591  static HIOManager *GetCurrentHIOManager();
1592 
1598  static void GetFileOutputResultString(HFileOutputResult result, char *result_str);
1599 
1603  void CleanCallbacks();
1604 
1605 private:
1606  void RecordOutputHandler (HOutputHandler * handler);
1607  void RecordInputHandler (HInputHandler * handler);
1608 
1609 protected:
1610 
1612  struct vhash_s * input_handlers;
1613 
1615  struct vhash_s * output_handlers;
1616 
1618  struct vhash_s * connector_procs;
1619 
1621  struct vlist_s * owned_input_handlers;
1622 
1624  struct vlist_s * owned_output_handlers;
1625 
1627  struct vlist_s * loaded_input_handlers;
1628 
1630  struct vlist_s * loaded_output_handlers;
1631 
1633  struct vhash_s * created_connectors;
1634 
1635  char * m_input_types;
1636  int m_input_types_allocated;
1637 
1638  char * m_output_types;
1639  int m_output_types_allocated;
1640 };
1641 
1642 #ifdef H_PACK_8
1643 #pragma pack(pop)
1644 #endif
1645 
1646 #endif
1647 
int PaperDpi() const
Indicates the DPI used for paper. This is set from the options dialog.
Definition: HIOManager.h:1081
Definition: HIOManager.h:1456
size_t LineFuseThreshold() const
Definition: HIOManager.h:1032
HBaseView * m_pHBaseView
A pointer to the HBaseView object for this output.
Definition: HIOManager.h:943
float PaperWidth() const
Width for output sizing in inches.
Definition: HIOManager.h:1008
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:573
Definition: HIOManager.h:877
bool m_bPRCExtractLargeTranslations
PRC import option: If set to true, large translation matrices set at the top of the model will be str...
Definition: HIOManager.h:565
handling choice is left to the importer
Definition: HIOManager.h:642
Definition: HIOManager.h:99
void WindowFrame(bool const tf)
Determines if a window frame is drawn or not.
Definition: HIOManager.h:1062
void HSRAOptions(char const *const tf)
HOOPS HSRAOption string .
Definition: HIOManager.h:975
bool m_pPRCDeleteModelFile
PRC import option: If true model file is deleted after loading is complete.
Definition: HIOManager.h:531
void(* m_pPRCDeleteModelCallback)(void *&pPRCAsmModelFile)
PRC import option: Function pointer to delete model.
Definition: HIOManager.h:552
double PrintToScale() const
Definition: HIOManager.h:1153
bool m_bPDFEmbedFonts
Definition: HIOManager.h:1258
ExportNameMap m_names
Definition: HIOManager.h:1192
void PrintToScale(double const r)
Definition: HIOManager.h:1170
bool m_bPRCImportHiddenObjects
PRC import option: If true, hidden objects will be imported though not visible. If false...
Definition: HIOManager.h:554
data is forced to single-precision
Definition: HIOManager.h:645
Specifies an HInputHandler for model data.
Definition: HIOManager.h:226
char const * m_pPDFResourceDirectory
Definition: HIOManager.h:1189
struct vlist_s * owned_output_handlers
A list of default HOutputHandlers created by the manager.
Definition: HIOManager.h:1624
bool m_bLogging
If true, logging will be enabled in those plugins that support it.
Definition: HIOManager.h:486
The HBhvBehaviorManager class stores and manages all animation related data.
Definition: HBhvBehaviorManager.h:237
Low compression, high accuracy.
Definition: HIOManager.h:898
HCamera * Camera() const
A pointer to the HCamera object for this output.
Definition: HIOManager.h:959
void StlNormals(bool const tf)
Determines if we generate and output face normals when writing to STL file format.
Definition: HIOManager.h:1145
float m_fAnnotLeft
Definition: HIOManager.h:1201
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:589
Definition: HUtility.h:2357
bool m_bPrcUseNameUserData
Definition: HIOManager.h:1222
MVO_POINTER_SIZED_INT m_iPrcNameUserDataIndex
Definition: HIOManager.h:1225
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:498
Specifies an HOutputHandler for geometry data.
Definition: HIOManager.h:865
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:474
bool m_bLegacyOptimize
Definition: HIOManager.h:603
Definition: HIOManager.h:148
HInputHandler an abstract base class for model and image input.
Definition: HIOManager.h:671
bool m_bAVIShowCompressionDialog
Definition: HIOManager.h:1232
The HCamera class is the data type of a HOOPS Camera Attribute.
Definition: HUtility.h:540
bool m_bPrcRemoveBRep
Definition: HIOManager.h:1216
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:576
BREP_Topology * m_pPRCTopologyManager
PRC import option: Pointer to connector class. If not null prc topology entities will be associated t...
Definition: HIOManager.h:536
void * m_pOOCNodeDeltas
OOC import option: Pointer to node deltas. If not null, importer will use it to selectively reject po...
Definition: HIOManager.h:628
void(* HIO_FREE_CONNECTOR_FUNCTION)(void *)
Definition: HIOManager.h:141
Specifies an HOutputHandler for a hardcopy output type.
Definition: HIOManager.h:867
HIOConnector * m_pConnector
A pointer to HIOConnector object. The connectivity between HOOPS and kernel will be stored in this...
Definition: HIOManager.h:489
HBhvBehaviorManager * m_pBehaviorManager
A pointer to the behavior manager.
Definition: HIOManager.h:1181
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:560
HOutputHandlerStyle
Definition: HIOManager.h:862
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:547
HPrcBrepCompression
Definition: HIOManager.h:896
void PaperWidth(float const f)
Width for output sizing in inches.
Definition: HIOManager.h:1010
bool m_bOOCAutoCleanup
OOC import option: Determines whether or not the view for the OOC model should automatically cleanup ...
Definition: HIOManager.h:634
void ConserveMemory(bool const tf)
This option has been deprecated and has no effect.
Definition: HIOManager.h:1051
data is converted to float if it appears safe, otherwise it is retained as double ...
Definition: HIOManager.h:644
Specifies an HOutputHandler for an image.
Definition: HIOManager.h:866
void *(* HIO_CREATE_FREE_FUNCTION)(void *)
Definition: HIOManager.h:137
struct vhash_s * input_handlers
A hash of HInputHandlers.
Definition: HIOManager.h:1612
HOutputHandler an abstract base class for model and image output.
Definition: HIOManager.h:1269
H_OUTPUT_TYPE OutputType() const
The output type.
Definition: HIOManager.h:1122
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:868
double m_depth_range
Definition: HIOManager.h:625
void OutputType(H_OUTPUT_TYPE ot)
The output type.
Definition: HIOManager.h:1124
bool WindowFrame() const
Determines if a window frame is drawn or not.
Definition: HIOManager.h:1060
int ImageDpi() const
Indicates the DPI used for images. This is calculated with info from HC_Show_Device_Info.
Definition: HIOManager.h:1074
bool m_bPRCLoadAsDrawings
PRC import option: When loading a DWG or DXF file through HIOUtilityExchange, set this option to true...
Definition: HIOManager.h:557
indicates that cell header entity will be imported as single segment
Definition: HIOManager.h:522
const char * m_pImageFormat
The HOOPS image format to use for loading an image if not using filename .ext for format...
Definition: HIOManager.h:477
int m_attributePrecisionMode
The manner in which precision in attributes (such as matrices) is handled.
Definition: HIOManager.h:650
void PaperHeight(float const f)
Height for output sizing in inches.
Definition: HIOManager.h:1017
indicates that cell header will have as many segments as its children
Definition: HIOManager.h:523
struct vhash_s * connector_procs
A hash of HIOConnector Create/Free functions.
Definition: HIOManager.h:1618
void * m_pExtendedData
A pointer to extra data needed by a HInputHandler subclass.
Definition: HIOManager.h:492
float WindowHeight() const
Height for output sizing in inches.
Definition: HIOManager.h:1001
bool m_bDisableDWFDrawOrder
Definition: HIOManager.h:583
HOutputHandlerOptions(const HOutputHandlerOptions &o)
Definition: HIOManager.h:930
double m_factorForSmartSolids
Definition: HIOManager.h:511
HC_KEY m_PRCReferenceSegmentKey
PRC import option: If this model is being loaded with the intent of it being merged with another...
Definition: HIOManager.h:570
bool m_bPRCStoreUserAttributes
PRC import option: If true all prc user attributes will be converted as user option.
Definition: HIOManager.h:550
float m_fAnnotBottom
Definition: HIOManager.h:1207
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:1069
float WindowWidth() const
Width for output sizing in inches.
Definition: HIOManager.h:994
void * m_pPRCAsmModelFile
Definition: HIOManager.h:1195
char const * m_pHTMLTemplateFile
Definition: HIOManager.h:1249
HBaseView * View() const
A pointer to the HBaseView object for this output.
Definition: HIOManager.h:945
High compression, low accuracy.
Definition: HIOManager.h:900
float m_fAnnotTop
Definition: HIOManager.h:1210
char const * m_pDWFModelName
Definition: HIOManager.h:1184
HPoint const * WindowColor() const
Set the color of the window. The RGB color stored in xyz of HPoint.
Definition: HIOManager.h:980
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:542
HInputHandlerOptions(HInputHandlerOptions const *o)
Definition: HIOManager.h:326
HDwgViewVector
Definition: HIOManager.h:234
struct vlist_s * loaded_input_handlers
A list of dynamically loaded HInputHandlers libraries.
Definition: HIOManager.h:1627
void Model(HBaseModel *const m)
A pointer to the HBaseModel object for this output.
Definition: HIOManager.h:954
bool UseSubscreen() const
Determines if HOOPS is calculating a subscreen to match the output to the size of the view window...
Definition: HIOManager.h:1067
HInputHandlerOptions(const HInputHandlerOptions &o)
Definition: HIOManager.h:401
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:1245
Definition: HIOManager.h:908
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:595
void WindowColor(HPoint const *const tf)
Set the color of the window. The RGB color stored in xyz of HPoint.
Definition: HIOManager.h:982
bool m_bPrcRemoveAttributes
Definition: HIOManager.h:1219
bool m_bIgnoreOffEntities
Definition: HIOManager.h:501
struct vhash_s * output_handlers
A hash of HOutputHandlers.
Definition: HIOManager.h:1615
HInputHandlerOptions()
Definition: HIOManager.h:251
float m_fAnnotRight
Definition: HIOManager.h:1204
bool m_bActivateOnPageOpen
Definition: HIOManager.h:1198
HC_KEY Key() const
The HC_Key for this output.
Definition: HIOManager.h:966
int m_Version
The file format version desired for writing.
Definition: HIOManager.h:1115
bool StlNormals() const
Determines if we generate and output face normals when writing to STL file format.
Definition: HIOManager.h:1143
Medium compression, medium accuracy.
Definition: HIOManager.h:899
bool m_bOOCAutoUpdate
OOC import option: Determines whether or not the view for the OOC model should automatically update w...
Definition: HIOManager.h:631
bool m_bDwgSkipUnreferencedBlocks
Definition: HIOManager.h:613
void WindowWidth(float const f)
Width for output sizing in inches.
Definition: HIOManager.h:996
bool Ascii() const
Some file formats, support binary and ascii such as STL. Set this to true for ascii output...
Definition: HIOManager.h:1136
unsigned long GetOutputOps()
Definition: HIOManager.h:1292
float PaperHeight() const
Height for output sizing in inches.
Definition: HIOManager.h:1015
void UseWindowColor(bool const tf)
If set to true, the background color of the view is used.
Definition: HIOManager.h:989
void * m_pPRCAsmModelFile
PRC import option: Returned to user. Contains Pointer to A3DAsmModelFile entity.
Definition: HIOManager.h:528
bool ConserveMemory() const
This option has been deprecated and has no effect.
Definition: HIOManager.h:1049
HPrcBrepCompression m_ePrcBrepCompression
Definition: HIOManager.h:1213
bool ForceGrayscale() const
Specifies black and white output.
Definition: HIOManager.h:1022
double m_coneFactor
Definition: HIOManager.h:506
HBaseModel * Model() const
A pointer to the HBaseModel object for this output.
Definition: HIOManager.h:952
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:1131
bool m_bPrcCompressTessellation
Definition: HIOManager.h:1229
No compression.
Definition: HIOManager.h:897
data is kept in the format from the file
Definition: HIOManager.h:643
unsigned long GetInputOps()
Definition: HIOManager.h:689
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:592
bool m_generatedDouble
The manner in which precision in geometry is handled.
Definition: HIOManager.h:656
void SetInputOps(unsigned long ops)
This sets the HInputOp.
Definition: HIOManager.h:841
struct vlist_s * loaded_output_handlers
A list of dynamically loaded HOutputHandlers libraries.
Definition: HIOManager.h:1630
void PaperDpi(int const dpi)
Indicates the DPI used for paper. This is set from the options dialog.
Definition: HIOManager.h:1083
HStreamFileToolkit * m_tk
The streamfile toolkit to be used.
Definition: HIOManager.h:483
struct vlist_s * owned_input_handlers
A list of default HInputHandlers created by the manager.
Definition: HIOManager.h:1621
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:495
void SetOutputOps(unsigned long ops)
This sets the HOutputOp.
Definition: HIOManager.h:1434
bool UseWindowColor() const
If set to true, the background color of the view is used.
Definition: HIOManager.h:987
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:1129
int m_iDGNCellHeaderOption
DGN file import option: has three option about how cell header should be imported.
Definition: HIOManager.h:514
bool m_bIsTestingSettings
Testing settings. true if you want to activate testings settings.
Definition: HIOManager.h:659
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:1633
HIOConnector * m_pPRCPMIConnector
PRC import option: Pointer to connector class. If not null prc PMI entities will be associated to HOO...
Definition: HIOManager.h:534
void WindowHeight(float const f)
Height for output sizing in inches.
Definition: HIOManager.h:1003
HOutputHandlerOptions(HOutputHandlerOptions const *o)
Definition: HIOManager.h:923
bool m_bPRCMergeFaces
PRC import option: If true individual faces will be merged into one shell.
Definition: HIOManager.h:538
bool FastPrint() const
This option has been deprecated. Specifies printing method.
Definition: HIOManager.h:1042
HBaseView * m_pHBaseView
A pointer to the HBaseView object for this input.
Definition: HIOManager.h:471
char const * HSRAOptions() const
HOOPS HSRAOption string .
Definition: HIOManager.h:973
bool m_bHTMLIncludeMeasurementInformation
Definition: HIOManager.h:1252
bool m_bImportThumbnail
DWF file import option: if true then Thumbnail are imported in the DWF file.
Definition: HIOManager.h:586
void View(HBaseView *const v)
A pointer to the HBaseView object for this output.
Definition: HIOManager.h:947
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:480