Introduction

Getting Started

Programming Guides

API Reference

Additional Resources

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_PRCModelUnits = 0.0f;
296 
297  // DWF import options
298  m_bDisableDWFDrawOrder = false;
299  m_bDWFRebaselineModel = true;
300  m_bImportThumbnail = false;
301 
302  //SKP optimization option
303  m_bOptimizeSegmentTree = false;
304  m_license = 0;
305 
306  m_pOOCNodeDeltas = 0;
307  m_bOOCAutoUpdate = true;
308  m_bOOCAutoCleanup = true;
309 
310  m_attributePrecisionMode = FORCE_FLOAT;
311 // m_geometryPrecisionMode = FLOAT_IF_SAFE;
312 
313  m_generatedDouble = false;
314  }
315 
319  m_z_separation = o->m_z_separation;
320  m_depth_range = o->m_depth_range;
321  m_pHBaseView = o->m_pHBaseView;
322  m_pImageName = o->m_pImageName;
323  m_pImageFormat = o->m_pImageFormat;
324  m_pConnector = o->m_pConnector;
325  m_pExtendedData = o->m_pExtendedData;
326  m_bLocal = o->m_bLocal;
327 
328  m_license = o->m_license;
329 
330  //DWG/DGN/SKP option
331  m_bIgnoreOffEntities = o->m_bIgnoreOffEntities;
332 
333  //DWG/SKP option
334  m_bImportMetadata = o->m_bImportMetadata;
335 
336 
337  //DWG Options
338  m_bLegacyOptimize = o->m_bLegacyOptimize;
339  m_bDwgSkipUnreferencedBlocks = o->m_bDwgSkipUnreferencedBlocks;
340 
341  //DGN Options
342  m_iDGNCellHeaderOption = o->m_iDGNCellHeaderOption;
343  m_bDGNRebaselineModel = o->m_bDGNRebaselineModel;
344  m_coneFactor = o->m_coneFactor;
345  m_factorForSmartSolids = o->m_factorForSmartSolids;
346  m_bDGNImportAllModels = o->m_bDGNImportAllModels;
347 
348  // PRC options
349  m_pPRCPMIConnector = o->m_pPRCPMIConnector;
350  m_pPRCTopologyManager = o->m_pPRCTopologyManager;
351  m_bPRCMergeFaces = o->m_bPRCMergeFaces;
352  m_bPRCImportNonBrepFaces = o->m_bPRCImportNonBrepFaces;
353 
354  m_bPRCCreatePRCFileOnly = o->m_bPRCCreatePRCFileOnly;
355  m_bPRCInstanceShells = o->m_bPRCInstanceShells;
356  m_bPRCCalculatePhysicalProperties = o->m_bPRCCalculatePhysicalProperties;
357  m_pPRCMultiModelSelectionCallback = o->m_pPRCMultiModelSelectionCallback;
358  m_pPRCAsmModelFile = o->m_pPRCAsmModelFile;
359  m_pPRCDeleteModelFile = o->m_pPRCDeleteModelFile;
360  m_pPRCDeleteModelCallback = o->m_pPRCDeleteModelCallback;
361  m_bPRCImportHiddenObjects = o->m_bPRCImportHiddenObjects;
362  m_PRCModelUnits = o->m_PRCModelUnits;
363 
364 
365  // DWF import options
366  m_bDisableDWFDrawOrder = o->m_bDisableDWFDrawOrder;
367  m_bDWFRebaselineModel = o->m_bDWFRebaselineModel;
368  m_bImportThumbnail = o->m_bImportThumbnail;
369 
370 
371  //SKP import option
372  m_bOptimizeSegmentTree = o->m_bOptimizeSegmentTree;
373 
374  m_pOOCNodeDeltas = o->m_pOOCNodeDeltas;
375  m_bOOCAutoUpdate = o->m_bOOCAutoUpdate;
376  m_bOOCAutoCleanup = o->m_bOOCAutoCleanup;
377 
378  m_attributePrecisionMode = o->m_attributePrecisionMode;
379 // m_geometryPrecisionMode = o->m_geometryPrecisionMode;
380  m_generatedDouble = o->m_generatedDouble;
381  }
382 
386  m_z_separation = o.m_z_separation;
387  m_depth_range = o.m_depth_range;
388  m_pHBaseView = o.m_pHBaseView;
389  m_pImageName = o.m_pImageName;
390  m_pImageFormat = o.m_pImageFormat;
391  m_pConnector = o.m_pConnector;
392  m_pExtendedData = o.m_pExtendedData;
393  m_bLocal = o.m_bLocal;
394 
395  //DWG/DGN/SKP option
396  m_bIgnoreOffEntities = o.m_bIgnoreOffEntities;
397 
398  //DWG/SKP option
399  m_bImportMetadata = o.m_bImportMetadata;
400 
401  //DWG options
402  m_bLegacyOptimize = o.m_bLegacyOptimize;
403  m_bDwgSkipUnreferencedBlocks = o.m_bDwgSkipUnreferencedBlocks;
404 
405  //DGN options
406  m_iDGNCellHeaderOption = o.m_iDGNCellHeaderOption;
407  m_bDGNRebaselineModel = o.m_bDGNRebaselineModel;
408  m_coneFactor = o.m_coneFactor;
409  m_factorForSmartSolids = o.m_factorForSmartSolids;
410  m_bDGNImportAllModels = o.m_bDGNImportAllModels;
411 
412  // PRC options
413  m_pPRCPMIConnector = o.m_pPRCPMIConnector;
414  m_pPRCTopologyManager = o.m_pPRCTopologyManager;
415  m_bPRCMergeFaces = o.m_bPRCMergeFaces;
416  m_bPRCImportNonBrepFaces = o.m_bPRCImportNonBrepFaces;
417  m_bPRCCreatePRCFileOnly = o.m_bPRCCreatePRCFileOnly;
418  m_bPRCInstanceShells = o.m_bPRCInstanceShells;
419  m_bPRCCalculatePhysicalProperties = o.m_bPRCCalculatePhysicalProperties;
420  m_pPRCMultiModelSelectionCallback = o.m_pPRCMultiModelSelectionCallback;
421  m_pPRCAsmModelFile = o.m_pPRCAsmModelFile;
422  m_pPRCDeleteModelFile = o.m_pPRCDeleteModelFile;
423  m_bPRCImportHiddenObjects = o.m_bPRCImportHiddenObjects;
424  m_PRCModelUnits = o.m_PRCModelUnits;
425 
426  // DWF import options
427  m_bDisableDWFDrawOrder = o.m_bDisableDWFDrawOrder;
428  m_bDWFRebaselineModel = o.m_bDWFRebaselineModel;
429  m_bImportThumbnail = o.m_bImportThumbnail;
430 
431 
432  //SKP import option
433  m_bOptimizeSegmentTree = o.m_bOptimizeSegmentTree;
434 
435  m_pOOCNodeDeltas = o.m_pOOCNodeDeltas;
436  m_bOOCAutoUpdate = o.m_bOOCAutoUpdate;
437  m_bOOCAutoCleanup = o.m_bOOCAutoCleanup;
438 
439  m_attributePrecisionMode = o.m_attributePrecisionMode;
440 // m_geometryPrecisionMode = o.m_geometryPrecisionMode;
441  m_generatedDouble = o.m_generatedDouble;
442  }
443 
444  virtual ~HInputHandlerOptions();
445 
448 
450  const char * m_pImageName;
451 
453  const char * m_pImageFormat;
454 
456  bool m_bLocal;
457 
459  HStreamFileToolkit * m_tk;
460 
463 
466 
469 
472 
474  const char *m_license;
475 
478 
482  double m_coneFactor;
483 
488 
491 
492 
493 
497  enum {
500  OPT_CELLHEADER
501  };
502 
505 
508 
515  bool m_bPRCImportNonBrepFaces;
516 
519  bool m_bPRCInstanceShells;
520 
521  bool m_bPRCCalculatePhysicalProperties;
523  void (*m_pPRCMultiModelSelectionCallback) (char const * in_container, int in_num_configs, char const * in_configs[],
524  int & out_config_selection);
528  void (*m_pPRCDeleteModelCallback) ( void*& pPRCAsmModelFile);
531 
534 
537 
540 
541  // DWF import options
547 
550 
553 
556 
564 
574 
575  /*
576  For 2D files (DWF only as of this time), the drawing can be layered either by using depth range or by offsetting
577  the z values. To separate the layers by z value, make sure z > 0. To use depth range, make sure depth range > 0.
578  */
579  double m_z_separation;
580 
586 
589 
592 
595 
596 
597 
601  enum {
606  FORCE_DOUBLE
607  };
608 
611 
613 // int m_geometryPrecisionMode; // (NOTE: currently not used)
614 
617 };
618 
619 
620 
622 
628 class MVO_API HInputHandler
629 {
630 
631 public:
639  HInputHandler();
640  virtual ~HInputHandler();
641 
646  unsigned long GetInputOps() {return m_InputOps;};
647 
648 
651  virtual const char * GetInputName() = 0;
652 
653 
660  virtual void RegisterInputHandlerTypes() = 0;
661 
668  virtual HInputHandlerStyle GetInputStyle() = 0;
669 
677  virtual HFileInputResult FileInputByKey(const char * filename, HC_KEY key, HInputHandlerOptions * options);
678  virtual HFileInputResult FileInputByKey(const __wchar_t * filename, HC_KEY key, HInputHandlerOptions * options);
679 
680 
689  virtual HFileInputResult FileInputByKey(const unsigned short * filename, HC_KEY key, HInputHandlerOptions * options);
690 
701  virtual HFileInputResult FileInputToImageKey(const char * filename, HC_KEY * image_key, HC_KEY segment_key, HInputHandlerOptions * options);
702  virtual HFileInputResult FileInputToImageKey(const __wchar_t * filename, HC_KEY * image_key, HC_KEY segment_key, HInputHandlerOptions * options);
703 
704 
714  virtual HFileInputResult FileInputToImageKey(const unsigned short * filename, HC_KEY * image_key, HC_KEY segment_key, HInputHandlerOptions * options);
715 
728  virtual const char * GetInputTypesString() = 0;
729 
733  const __wchar_t * GetInputProgress();
734 
738  float GetInputPercentProgress();
739 
743  const __wchar_t * GetInputInformation();
744 
751  HIONoticeCallback * SetInputProgressNoticeCallback(HIONoticeCallback *notice_callback);
752 
753 
760  HIOPercentNoticeCallback * SetInputPercentProgressNoticeCallback(HIOPercentNoticeCallback *percent_notice_callback);
761 
768  HIONoticeCallback * SetInputInformationNoticeCallback(HIONoticeCallback *notice_callback);
769 
771  void ReportInputProgress(const char * progress);
772  void ReportInputProgress(const __wchar_t * progress);
773 
775  void ReportInputPercentProgress(float percent_progress);
776 
778  void ReportInputInformation(const char * information);
779  void ReportInputInformation(const __wchar_t * information);
780 
781  void SetModuleDirectory(const char *module_directory);
782  void SetModuleDirectory(const __wchar_t *module_directory);
783 protected:
784 
788  void SetStartingInput(const char *filename);
789  void SetStartingInput(const __wchar_t *filename = 0);
790 
794  void SetFinishedInput();
795 
797  void SetInputOps(unsigned long ops) {m_InputOps=ops;};
798 
800  unsigned long m_InputOps;
801 
802  __wchar_t *m_module_directory;
803 
804 private:
805 
806  __wchar_t *m_progress;
807  float m_percent_progress1;
808  float m_percent_progress2;
809  __wchar_t *m_information;
810  struct vlist_s *m_information_list;
811  HIONoticeCallback *m_progress_callback;
812  HIONoticeCallback *m_information_callback;
813  HIOPercentNoticeCallback *m_percent_progress_callback;
814 };
815 
820 {
821  HOutputHandlerStyleModel,
826 };
827 
834 class MVO_API ExportNameMap
835 {
836 private:
837  void * _imp;
838 public:
839  ExportNameMap();
840  ~ExportNameMap();
841 
842  H_FORMAT_TEXT lookup(HC_KEY) const;
843  void tag(HC_KEY, H_FORMAT_TEXT const &);
844 };
845 
858 };
859 
865 class MVO_API HOutputHandlerOptions
866 {
867 public:
870 
871  virtual char const * GetType() const;
872 
875  virtual bool PopulateOptions();
876 
881  Init(o);
882  };
883 
888  Init(&o);
889  };
890 
891 
892  virtual ~HOutputHandlerOptions();
893 
897  void Init(HOutputHandlerOptions const *o);
898 
902  HBaseView * const View() const {return m_pHBaseView;};
904  void View(HBaseView * const v) {m_pHBaseView = v;};
905 
907  HBaseModel * m_pHBaseModel;
909  HBaseModel * const Model() const {return m_pHBaseModel;};
911  void Model(HBaseModel * const m) {m_pHBaseModel = m;};
912 
914  HCamera * m_pCamera;
916  HCamera * const Camera() const {return m_pCamera;};
918  void Camera(HCamera * const c) {m_pCamera = c;};
919 
921  HC_KEY m_Key;
923  HC_KEY const Key() const {return m_Key;};
925  void Key(HC_KEY const k) {m_Key = k;};
926 
928  char const * m_pHSRAOptions;
930  char const * const HSRAOptions() const {return m_pHSRAOptions;};
932  void HSRAOptions(char const * const tf) {m_pHSRAOptions = tf;};
933 
935  HPoint const * m_pWindowColor;
937  HPoint const * const WindowColor() const {return m_pWindowColor;};
939  void WindowColor(HPoint const * const tf) {m_pWindowColor = tf;};
940 
942  bool m_bUseWindowColor;
944  bool UseWindowColor() const {return m_bUseWindowColor;};
946  void UseWindowColor(bool const tf) {m_bUseWindowColor = tf;};
947 
949  float m_Window_Width;
951  float const WindowWidth() const {return m_Window_Width;};
953  void WindowWidth(float const f) {m_Window_Width = f;};
954 
956  float m_Window_Height;
958  float const WindowHeight() const {return m_Window_Height;};
960  void WindowHeight(float const f) {m_Window_Height = f;};
961 
963  float m_Paper_Width;
965  float const PaperWidth() const {return m_Paper_Width;};
967  void PaperWidth(float const f) {m_Paper_Width = f;};
968 
970  float m_Paper_Height;
972  float const PaperHeight() const {return m_Paper_Height;};
974  void PaperHeight(float const f) {m_Paper_Height = f;};
975 
977  bool m_ForceGrayscale;
979  bool ForceGrayscale() const {return m_ForceGrayscale;};
981  void ForceGrayscale(bool const tf) {m_ForceGrayscale = tf;};
982 
984  size_t m_lineFuseThreshold;
985 
989  size_t LineFuseThreshold() const {return m_lineFuseThreshold;};
990 
994  void LineFuseThreshold(size_t const tf) {m_lineFuseThreshold = tf;};
995 
997  bool m_bFastPrint;
999  bool FastPrint() const {return m_bFastPrint;};
1001  void FastPrint(bool const tf) {m_bFastPrint = tf;};
1002 
1004  bool m_bConserveMemory;
1006  bool ConserveMemory() const {return m_bConserveMemory;};
1008  void ConserveMemory(bool const tf) {m_bConserveMemory = tf;};
1009 
1010  bool m_bWriteAnimations;
1011  bool WriteAnimations() const {return m_bWriteAnimations;};
1012  void WriteAnimations(bool const tf) {m_bWriteAnimations = tf;};
1013 
1015  bool m_bWindowFrame;
1017  bool WindowFrame() const {return m_bWindowFrame;};
1019  void WindowFrame(bool const tf) {m_bWindowFrame = tf;};
1020 
1022  bool m_bUseSubscreen;
1024  bool UseSubscreen() const {return m_bUseSubscreen;};
1026  void UseSubscreen(bool const tf) {m_bUseSubscreen = tf;};
1027 
1029  int m_Image_Dpi;
1031  int const ImageDpi() const {return m_Image_Dpi;};
1033  void ImageDpi(int const dpi) {m_Image_Dpi = dpi;};
1034 
1036  int m_Paper_Dpi;
1038  int const PaperDpi() const {return m_Paper_Dpi;};
1040  void PaperDpi(int const dpi) {m_Paper_Dpi = dpi;};
1041 
1043  void * m_pExtendedData;
1044  void * const ExtendedData() const {return m_pExtendedData;};
1045  void ExtendedData(void * const vp) {m_pExtendedData = vp;};
1046  void ExtendedData(HPDFOptions * const vp) {m_pExtendedData = (void*)vp;};
1047 
1048  bool ActivateOnPageOpen() const {return m_bActivateOnPageOpen;};
1049  void ActivateOnPageOpen(bool onoff) {m_bActivateOnPageOpen = onoff;};
1050  float const AnnotLeft() const {return m_fAnnotLeft;};
1051  void AnnotLeft(float f) {m_fAnnotLeft = f;};
1052  float const AnnotRight() const {return m_fAnnotRight;};
1053  void AnnotRight(float f) {m_fAnnotRight = f;};
1054  float const AnnotBottom() const {return m_fAnnotBottom;};
1055  void AnnotBottom(float f) {m_fAnnotBottom = f;};
1056  float const AnnotTop() const {return m_fAnnotTop;};
1057  void AnnotTop(float f) {m_fAnnotTop = f;};
1058 
1059 
1061  const char *m_license;
1062 
1063  int m_antialiasLevel;
1064  int m_jpeg_quality;
1065  unsigned char* m_imageOutputBuffer;
1066  size_t m_imageOutputBufferSize;
1067 
1068 
1069 
1070 
1073  int const Version() const {return m_Version;};
1074  void Version(int const v) {m_Version = v;};
1075 
1077  H_OUTPUT_TYPE m_OutputType;
1079  H_OUTPUT_TYPE OutputType() const {return m_OutputType;};
1081  void OutputType(H_OUTPUT_TYPE ot) {m_OutputType = ot;};
1082 
1084  bool m_b3dOutput;
1086  bool Output3d() const {return m_b3dOutput;};
1088  void Output3d(bool const tf) {m_b3dOutput = tf;};
1089 
1091  bool m_bAscii;
1093  bool Ascii() const {return m_bAscii;};
1095  void Ascii(bool const tf) {m_bAscii = tf;};
1096 
1098  bool m_bStlNormals;
1100  bool StlNormals() const {return m_bStlNormals;};
1102  void StlNormals(bool const tf) {m_bStlNormals = tf;};
1103 
1105  double m_ratio_cm_to_internal_units;
1106 
1110  double PrintToScale() const {return m_ratio_cm_to_internal_units;};
1111 
1127  void PrintToScale(double const r) {m_ratio_cm_to_internal_units = r;};
1128 
1135  float m_PageMargins[4];
1136 
1139 
1141  char const* m_pDWFModelName;
1142 
1147 
1150 
1153 
1156 
1159 
1162 
1165 
1168 
1171 
1174 
1177 
1180 
1182  MVO_POINTER_SIZED_INT m_iPrcNameUserDataIndex;
1183 
1184 
1187 
1190 
1199  char m_bAVICodec[4];
1200 
1203 };
1204 
1205 
1207 
1213 class MVO_API HOutputHandler
1214 {
1215 
1216 public:
1224  HOutputHandler();
1225  virtual ~HOutputHandler();
1226 
1227 
1230  virtual const char * GetOutputName() = 0;
1231 
1236  unsigned long GetOutputOps() {return m_OutputOps;};
1237 
1248  virtual void RegisterOutputHandlerTypes() = 0;
1249 
1250 
1258  virtual HFileOutputResult FileOutputByKey(const char * filename, HC_KEY key, HOutputHandlerOptions * options);
1259  virtual HFileOutputResult FileOutputByKey(const __wchar_t * filename, HC_KEY key, HOutputHandlerOptions * options);
1260 
1268  virtual HFileOutputResult FileOutputByKey(const unsigned short * filename, HC_KEY key, HOutputHandlerOptions * options);
1269 
1270 
1279  virtual HFileOutputResult FileOutputFromImageKey(const char * filename, HC_KEY image_key, HOutputHandlerOptions * options);
1280  virtual HFileOutputResult FileOutputFromImageKey(const __wchar_t * filename, HC_KEY image_key, HOutputHandlerOptions * options);
1281 
1292  virtual const char * GetOutputTypesString() = 0;
1293 
1302  virtual HOutputHandlerStyle GetOutputStyle() = 0;
1303 
1310  virtual const char * GetOutputDefaultHSRA();
1311 
1315  const char * GetOutputProgress();
1316 
1320  float GetOutputPercentProgress();
1321 
1325  const __wchar_t * GetOutputInformation();
1326 
1333  HIONoticeCallback * SetOutputProgressNoticeCallback(HIONoticeCallback *notice_callback);
1334 
1335 
1342  HIOPercentNoticeCallback * SetOutputPercentProgressNoticeCallback(HIOPercentNoticeCallback *percent_notice_callback);
1343 
1350  HIONoticeCallback * SetOutputInformationNoticeCallback(HIONoticeCallback *notice_callback);
1351 
1353  void ReportOutputProgress(const char * progress);
1354 
1356  void ReportOutputPercentProgress(float percent_progress);
1357 
1359  void ReportOutputInformation(const char * information);
1360 
1361 
1362  void SetModuleDirectory(const char *module_directory);
1363  void SetModuleDirectory(const __wchar_t *module_directory);
1364 
1365 protected:
1366 
1370  void SetStartingOutput();
1371 
1375  void SetFinishedOutput();
1376 
1378  void SetOutputOps(unsigned long ops) {m_OutputOps=ops;};
1380  unsigned long m_OutputOps;
1381 
1382  char *m_module_directory;
1383 private:
1384 
1385  char *m_progress;
1386  float m_percent_progress1;
1387  float m_percent_progress2;
1388  __wchar_t *m_information;
1389  struct vlist_s *m_information_list;
1390  HIONoticeCallback *m_progress_callback;
1391  HIOPercentNoticeCallback *m_percent_progress_callback;
1392  HIONoticeCallback *m_information_callback;
1393 };
1394 
1400 class MVO_API HIOManager
1401 {
1402 
1403 public:
1404 
1405  HIOManager();
1406  virtual ~HIOManager();
1407 
1417  virtual HInputHandler * RegisterInputHandler(const char * file_type, HInputHandler * handler);
1418 
1427  virtual HOutputHandler * RegisterOutputHandler(const char * file_type, HOutputHandler * handler);
1428 
1439  virtual HIOConnector * RegisterConnector(const char * file_type, HIO_CREATE_FREE_FUNCTION Create, HIO_FREE_CONNECTOR_FUNCTION Free);
1440 
1445  virtual HInputHandler * GetInputHandler(const char * file_type);
1446  HInputHandler * GetInputHandler(const __wchar_t * file_type);
1447 #ifdef _MSC_VER
1448  HInputHandler * GetInputHandler(const unsigned short * file_type);
1449 #endif
1450 
1455  virtual HOutputHandler * GetOutputHandler(const char * file_type);
1456  virtual HOutputHandler * GetOutputHandler(const __wchar_t * file_type);
1457 
1462  virtual void RegisterHandlers();
1463 
1468  virtual const char * GetInputHandlerTypes();
1469 
1474  virtual const char * GetOutputHandlerTypes();
1475 
1476 
1483  virtual HIOConnector * CreateConnector(const char * file_type);
1484 
1489  virtual void FreeConnector(HIOConnector * old_connector);
1490 
1491 
1496  static HIOManager *GetCurrentHIOManager();
1497 
1503  static void GetFileOutputResultString(HFileOutputResult result, char *result_str);
1504 
1505 private:
1506  void RecordOutputHandler (HOutputHandler * handler);
1507  void RecordInputHandler (HInputHandler * handler);
1508 
1509 protected:
1510 
1512  struct vhash_s * input_handlers;
1513 
1515  struct vhash_s * output_handlers;
1516 
1518  struct vhash_s * connector_procs;
1519 
1521  struct vlist_s * owned_input_handlers;
1522 
1524  struct vlist_s * owned_output_handlers;
1525 
1527  struct vlist_s * loaded_input_handlers;
1528 
1530  struct vlist_s * loaded_output_handlers;
1531 
1533  struct vhash_s * created_connectors;
1534 
1535  char * m_input_types;
1536  int m_input_types_allocated;
1537 
1538  char * m_output_types;
1539  int m_output_types_allocated;
1540 };
1541 
1542 #ifdef H_PACK_8
1543 #pragma pack(pop)
1544 #endif
1545 
1546 #endif
1547 
Definition: HIOManager.h:1400
HBaseView * m_pHBaseView
A pointer to the HBaseView object for this output.
Definition: HIOManager.h:900
double PrintToScale() const
Definition: HIOManager.h:1110
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:523
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:536
Definition: HIOManager.h:834
void(* HIO_FREE_CONNECTOR_FUNCTION)(void *)
Definition: HIOManager.h:141
handling choice is left to the importer
Definition: HIOManager.h:602
Definition: HIOManager.h:99
void WindowFrame(bool const tf)
Determines if a window frame is drawn or not.
Definition: HIOManager.h:1019
void HSRAOptions(char const *const tf)
HOOPS HSRAOption string .
Definition: HIOManager.h:932
bool m_pPRCDeleteModelFile
PRC import option: If true model file is deleted after loading is complete.
Definition: HIOManager.h:507
float const PaperHeight() const
Height for output sizing in inches.
Definition: HIOManager.h:972
ExportNameMap m_names
Definition: HIOManager.h:1149
void PrintToScale(double const r)
Definition: HIOManager.h:1127
bool m_bPRCImportHiddenObjects
PRC import option: If true, hidden objects will be imported though not visible. If false...
Definition: HIOManager.h:530
data is forced to single-precision
Definition: HIOManager.h:605
Specifies an HInputHandler for model data.
Definition: HIOManager.h:226
char const * m_pPDFResourceDirectory
Definition: HIOManager.h:1146
struct vlist_s * owned_output_handlers
A list of default HOutputHandlers created by the manager.
Definition: HIOManager.h:1524
bool m_bLogging
If true, logging will be enabled in those plugins that support it.
Definition: HIOManager.h:462
The HBhvBehaviorManager class stores and manages all animation related data.
Definition: HBhvBehaviorManager.h:237
char const *const HSRAOptions() const
HOOPS HSRAOption string .
Definition: HIOManager.h:930
Low compression, high accurracy.
Definition: HIOManager.h:855
void *(* HIO_CREATE_FREE_FUNCTION)(void *)
Definition: HIOManager.h:137
void StlNormals(bool const tf)
Determines if we generate and output face normals when writing to STL file format.
Definition: HIOManager.h:1102
float m_fAnnotLeft
Definition: HIOManager.h:1158
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:552
Definition: HUtility.h:2362
bool m_bPrcUseNameUserData
Definition: HIOManager.h:1179
MVO_POINTER_SIZED_INT m_iPrcNameUserDataIndex
Definition: HIOManager.h:1182
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:474
Specifies an HOutputHandler for geometry data.
Definition: HIOManager.h:822
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:450
bool m_bLegacyOptimize
Definition: HIOManager.h:563
Definition: HIOManager.h:148
HInputHandler an abstract base class for model and image input.
Definition: HIOManager.h:628
bool m_bAVIShowCompressionDialog
Definition: HIOManager.h:1189
The HCamera class is the data type of a HOOPS Camera Attribute.
Definition: HUtility.h:541
bool m_bPrcRemoveBRep
Definition: HIOManager.h:1173
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:539
BREP_Topology * m_pPRCTopologyManager
PRC import option: Pointer to connector class. If not null prc topology entities will be associated t...
Definition: HIOManager.h:512
void * m_pOOCNodeDeltas
OOC import option: Pointer to node deltas. If not null, importer will use it to selectively reject po...
Definition: HIOManager.h:588
Specifies an HOutputHandler for a hardcopy output type.
Definition: HIOManager.h:824
HIOConnector * m_pConnector
A pointer to HIOConnector object. The connectivity between HOOPS and kernel will be stored in this...
Definition: HIOManager.h:465
HBhvBehaviorManager * m_pBehaviorManager
A pointer to the behavior manager.
Definition: HIOManager.h:1138
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:533
HOutputHandlerStyle
Definition: HIOManager.h:819
Specifies an HInputHandler for image data.
Definition: HIOManager.h:227
bool ConserveMemory() const
This option has been deprecated and has no effect.
Definition: HIOManager.h:1006
Definition: HIOManager.h:122
bool ForceGrayscale() const
Specifies black and white output.
Definition: HIOManager.h:979
HPrcBrepCompression
Definition: HIOManager.h:853
void PaperWidth(float const f)
Width for output sizing in inches.
Definition: HIOManager.h:967
bool m_bOOCAutoCleanup
OOC import option: Determines whether or not the view for the OOC model should automatically cleanup ...
Definition: HIOManager.h:594
void ConserveMemory(bool const tf)
This option has been deprecated and has no effect.
Definition: HIOManager.h:1008
data is converted to float if it appears safe, otherwise it is retained as double ...
Definition: HIOManager.h:604
void(* m_pPRCDeleteModelCallback)(void *&pPRCAsmModelFile)
PRC import option: Function pointer to delete model.
Definition: HIOManager.h:528
Specifies an HOutputHandler for an image.
Definition: HIOManager.h:823
#define HC_KEY
struct vhash_s * input_handlers
A hash of HInputHandlers.
Definition: HIOManager.h:1512
HOutputHandler an abstract base class for model and image output.
Definition: HIOManager.h:1213
float const PaperWidth() const
Width for output sizing in inches.
Definition: HIOManager.h:965
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:825
double m_depth_range
Definition: HIOManager.h:585
void OutputType(H_OUTPUT_TYPE ot)
The output type.
Definition: HIOManager.h:1081
indicates that cell header entity will be imported as single segment
Definition: HIOManager.h:498
const char * m_pImageFormat
The HOOPS image format to use for loading an image if not using filename .ext for format...
Definition: HIOManager.h:453
int m_attributePrecisionMode
The manner in which precision in attributes (such as matrices) is handled.
Definition: HIOManager.h:610
void PaperHeight(float const f)
Height for output sizing in inches.
Definition: HIOManager.h:974
indicates that cell header will have as many segments as its childs
Definition: HIOManager.h:499
struct vhash_s * connector_procs
A hash of HIOConnector Create/Free functions.
Definition: HIOManager.h:1518
void * m_pExtendedData
A pointer to extra data needed by a HInputHandler subclass.
Definition: HIOManager.h:468
bool Ascii() const
Some file formats, support binary and ascii such as STL. Set this to true for ascii output...
Definition: HIOManager.h:1093
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:1086
bool m_bDisableDWFDrawOrder
Definition: HIOManager.h:546
bool StlNormals() const
Determines if we generate and output face normals when writing to STL file format.
Definition: HIOManager.h:1100
HOutputHandlerOptions(const HOutputHandlerOptions &o)
Definition: HIOManager.h:887
double m_factorForSmartSolids
Definition: HIOManager.h:487
bool m_bPRCStoreUserAttributes
PRC import option: If true all prc user attributes will be converted as user option.
Definition: HIOManager.h:526
float m_fAnnotBottom
Definition: HIOManager.h:1164
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:1026
void * m_pPRCAsmModelFile
Definition: HIOManager.h:1152
int const ImageDpi() const
Indicates the DPI used for images. This is calculated with info from HC_Show_Device_Info.
Definition: HIOManager.h:1031
High compression, low accurracy.
Definition: HIOManager.h:857
float m_fAnnotTop
Definition: HIOManager.h:1167
char const * m_pDWFModelName
Definition: HIOManager.h:1141
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:518
HInputHandlerOptions(HInputHandlerOptions const *o)
Definition: HIOManager.h:318
HDwgViewVector
Definition: HIOManager.h:234
struct vlist_s * loaded_input_handlers
A list of dynamically loaded HInputHandlers libraries.
Definition: HIOManager.h:1527
void Model(HBaseModel *const m)
A pointer to the HBaseModel object for this output.
Definition: HIOManager.h:911
HPoint const *const WindowColor() const
Set the color of the window. The RGB color stored in xyz of HPoint.
Definition: HIOManager.h:937
HInputHandlerOptions(const HInputHandlerOptions &o)
Definition: HIOManager.h:385
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
H_OUTPUT_TYPE OutputType() const
The output type.
Definition: HIOManager.h:1079
bool m_bExporting2DDwf
Definition: HIOManager.h:1202
Definition: HIOManager.h:865
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
int const PaperDpi() const
Indicates the DPI used for paper. This is set from the options dialog.
Definition: HIOManager.h:1038
void WindowColor(HPoint const *const tf)
Set the color of the window. The RGB color stored in xyz of HPoint.
Definition: HIOManager.h:939
bool m_bPrcRemoveAttributes
Definition: HIOManager.h:1176
bool UseWindowColor() const
If set to true, the background color of the view is used.
Definition: HIOManager.h:944
bool m_bIgnoreOffEntities
Definition: HIOManager.h:477
struct vhash_s * output_handlers
A hash of HOutputHandlers.
Definition: HIOManager.h:1515
HInputHandlerOptions()
Definition: HIOManager.h:251
float m_fAnnotRight
Definition: HIOManager.h:1161
bool m_bActivateOnPageOpen
Definition: HIOManager.h:1155
int m_Version
The file format version desired for writing.
Definition: HIOManager.h:1072
Medium compression, medium accurracy.
Definition: HIOManager.h:856
bool m_bOOCAutoUpdate
OOC import option: Determines whether or not the view for the OOC model should automatically update w...
Definition: HIOManager.h:591
bool m_bDwgSkipUnreferencedBlocks
Definition: HIOManager.h:573
void WindowWidth(float const f)
Width for output sizing in inches.
Definition: HIOManager.h:953
unsigned long GetOutputOps()
Definition: HIOManager.h:1236
void UseWindowColor(bool const tf)
If set to true, the background color of the view is used.
Definition: HIOManager.h:946
void * m_pPRCAsmModelFile
PRC import option: Returned to user. Contains Pointer to A3DAsmModelFile entity.
Definition: HIOManager.h:504
HPrcBrepCompression m_ePrcBrepCompression
Definition: HIOManager.h:1170
double m_coneFactor
Definition: HIOManager.h:482
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:1088
bool m_bPrcCompressTessellation
Definition: HIOManager.h:1186
No compression.
Definition: HIOManager.h:854
data is kept in the format from the file
Definition: HIOManager.h:603
unsigned long GetInputOps()
Definition: HIOManager.h:646
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:555
HBaseView *const View() const
A pointer to the HBaseView object for this output.
Definition: HIOManager.h:902
bool m_generatedDouble
The manner in which precision in geometry is handled.
Definition: HIOManager.h:616
HCamera *const Camera() const
A pointer to the HCamera object for this output.
Definition: HIOManager.h:916
void SetInputOps(unsigned long ops)
This sets the HInputOp.
Definition: HIOManager.h:797
bool FastPrint() const
This option has been deprecated. Specifies printing method.
Definition: HIOManager.h:999
struct vlist_s * loaded_output_handlers
A list of dynamically loaded HOutputHandlers libraries.
Definition: HIOManager.h:1530
void PaperDpi(int const dpi)
Indicates the DPI used for paper. This is set from the options dialog.
Definition: HIOManager.h:1040
HStreamFileToolkit * m_tk
The streamfile toolkit to be used.
Definition: HIOManager.h:459
struct vlist_s * owned_input_handlers
A list of default HInputHandlers created by the manager.
Definition: HIOManager.h:1521
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:471
void SetOutputOps(unsigned long ops)
This sets the HOutputOp.
Definition: HIOManager.h:1378
struct vhash_s * mhash_Kernel2Hoops
A hash map between kernel entities and HOOPS Keys.
Definition: HIOManager.h:217
HC_KEY const Key() const
The HC_Key for this output.
Definition: HIOManager.h:923
HBaseModel *const Model() const
A pointer to the HBaseModel object for this output.
Definition: HIOManager.h:909
float const WindowWidth() const
Width for output sizing in inches.
Definition: HIOManager.h:951
bool UseSubscreen() const
Determines if HOOPS is calculating a subscreen to match the output to the size of the view window...
Definition: HIOManager.h:1024
int m_iDGNCellHeaderOption
DGN file import option: has three option about how cell header should be imported.
Definition: HIOManager.h:490
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:1533
HIOConnector * m_pPRCPMIConnector
PRC import option: Pointer to connector class. If not null prc PMI entities will be associated to HOO...
Definition: HIOManager.h:510
void WindowHeight(float const f)
Height for output sizing in inches.
Definition: HIOManager.h:960
HOutputHandlerOptions(HOutputHandlerOptions const *o)
Definition: HIOManager.h:880
float const WindowHeight() const
Height for output sizing in inches.
Definition: HIOManager.h:958
bool m_bPRCMergeFaces
PRC import option: If true individual faces will be merged into one shell.
Definition: HIOManager.h:514
HBaseView * m_pHBaseView
A pointer to the HBaseView object for this input.
Definition: HIOManager.h:447
bool m_bImportThumbnail
DWF file import option: if true then Thumbnail are imported in the DWF file.
Definition: HIOManager.h:549
void View(HBaseView *const v)
A pointer to the HBaseView object for this output.
Definition: HIOManager.h:904
Specifies using the view determined by the camera in the scene segment.
Definition: HIOManager.h:238
size_t LineFuseThreshold() const
Definition: HIOManager.h:989
bool m_bLocal
The value is true if the image will have the local attribute.
Definition: HIOManager.h:456
bool WindowFrame() const
Determines if a window frame is drawn or not.
Definition: HIOManager.h:1017