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 
299  // DWF import options
300  m_bDisableDWFDrawOrder = false;
301  m_bDWFRebaselineModel = true;
302  m_bImportThumbnail = false;
303 
304  //Rhino import option
305  m_bForceRenderedModeColors = false;
306 
307  //SKP optimization option
308  m_bOptimizeSegmentTree = false;
309  m_license = 0;
310 
311  m_pOOCNodeDeltas = 0;
312  m_bOOCAutoUpdate = true;
313  m_bOOCAutoCleanup = true;
314 
315  m_attributePrecisionMode = FORCE_FLOAT;
316 // m_geometryPrecisionMode = FLOAT_IF_SAFE;
317 
318  m_generatedDouble = false;
319 
320  m_bIsTestingSettings = false;
321  }
322 
326  m_z_separation = o->m_z_separation;
327  m_depth_range = o->m_depth_range;
328  m_pHBaseView = o->m_pHBaseView;
329  m_pImageName = o->m_pImageName;
330  m_pImageFormat = o->m_pImageFormat;
331  m_pConnector = o->m_pConnector;
332  m_pExtendedData = o->m_pExtendedData;
333  m_bLocal = o->m_bLocal;
334 
335  m_license = o->m_license;
336 
337  //DWG/DGN/SKP option
338  m_bIgnoreOffEntities = o->m_bIgnoreOffEntities;
339 
340  //DWG/SKP option
341  m_bImportMetadata = o->m_bImportMetadata;
342 
343 
344  //DWG Options
345  m_bLegacyOptimize = o->m_bLegacyOptimize;
346  m_bDwgSkipUnreferencedBlocks = o->m_bDwgSkipUnreferencedBlocks;
347 
348  //DGN Options
349  m_iDGNCellHeaderOption = o->m_iDGNCellHeaderOption;
350  m_bDGNRebaselineModel = o->m_bDGNRebaselineModel;
351  m_coneFactor = o->m_coneFactor;
352  m_factorForSmartSolids = o->m_factorForSmartSolids;
353  m_bDGNImportAllModels = o->m_bDGNImportAllModels;
354 
355  // PRC options
356  m_pPRCPMIConnector = o->m_pPRCPMIConnector;
357  m_pPRCTopologyManager = o->m_pPRCTopologyManager;
358  m_bPRCMergeFaces = o->m_bPRCMergeFaces;
359  m_bPRCImportNonBrepFaces = o->m_bPRCImportNonBrepFaces;
360 
361  m_bPRCCreatePRCFileOnly = o->m_bPRCCreatePRCFileOnly;
362  m_bPRCInstanceShells = o->m_bPRCInstanceShells;
363  m_bPRCCalculatePhysicalProperties = o->m_bPRCCalculatePhysicalProperties;
364  m_pPRCMultiModelSelectionCallback = o->m_pPRCMultiModelSelectionCallback;
365  m_pPRCAsmModelFile = o->m_pPRCAsmModelFile;
366  m_pPRCDeleteModelFile = o->m_pPRCDeleteModelFile;
367  m_pPRCDeleteModelCallback = o->m_pPRCDeleteModelCallback;
368  m_bPRCImportHiddenObjects = o->m_bPRCImportHiddenObjects;
369  m_bPRCLoadAsDrawings = o->m_bPRCLoadAsDrawings;
370  m_PRCModelUnits = o->m_PRCModelUnits;
371  m_bPRCExtractLargeTranslations = o->m_bPRCExtractLargeTranslations;
372 
373 
374  // DWF import options
375  m_bDisableDWFDrawOrder = o->m_bDisableDWFDrawOrder;
376  m_bDWFRebaselineModel = o->m_bDWFRebaselineModel;
377  m_bImportThumbnail = o->m_bImportThumbnail;
378 
379 
380  //SKP import option
381  m_bOptimizeSegmentTree = o->m_bOptimizeSegmentTree;
382 
383  m_pOOCNodeDeltas = o->m_pOOCNodeDeltas;
384  m_bOOCAutoUpdate = o->m_bOOCAutoUpdate;
385  m_bOOCAutoCleanup = o->m_bOOCAutoCleanup;
386 
387  m_attributePrecisionMode = o->m_attributePrecisionMode;
388 // m_geometryPrecisionMode = o->m_geometryPrecisionMode;
389  m_generatedDouble = o->m_generatedDouble;
390 
391  m_bIsTestingSettings = o->m_bIsTestingSettings;
392 
393  //Rhino import option
394  m_bForceRenderedModeColors = o->m_bForceRenderedModeColors;
395  }
396 
400  m_z_separation = o.m_z_separation;
401  m_depth_range = o.m_depth_range;
402  m_pHBaseView = o.m_pHBaseView;
403  m_pImageName = o.m_pImageName;
404  m_pImageFormat = o.m_pImageFormat;
405  m_pConnector = o.m_pConnector;
406  m_pExtendedData = o.m_pExtendedData;
407  m_bLocal = o.m_bLocal;
408 
409  //DWG/DGN/SKP option
410  m_bIgnoreOffEntities = o.m_bIgnoreOffEntities;
411 
412  //DWG/SKP option
413  m_bImportMetadata = o.m_bImportMetadata;
414 
415  //DWG options
416  m_bLegacyOptimize = o.m_bLegacyOptimize;
417  m_bDwgSkipUnreferencedBlocks = o.m_bDwgSkipUnreferencedBlocks;
418 
419  //DGN options
420  m_iDGNCellHeaderOption = o.m_iDGNCellHeaderOption;
421  m_bDGNRebaselineModel = o.m_bDGNRebaselineModel;
422  m_coneFactor = o.m_coneFactor;
423  m_factorForSmartSolids = o.m_factorForSmartSolids;
424  m_bDGNImportAllModels = o.m_bDGNImportAllModels;
425 
426  // PRC options
427  m_pPRCPMIConnector = o.m_pPRCPMIConnector;
428  m_pPRCTopologyManager = o.m_pPRCTopologyManager;
429  m_bPRCMergeFaces = o.m_bPRCMergeFaces;
430  m_bPRCImportNonBrepFaces = o.m_bPRCImportNonBrepFaces;
431  m_bPRCCreatePRCFileOnly = o.m_bPRCCreatePRCFileOnly;
432  m_bPRCInstanceShells = o.m_bPRCInstanceShells;
433  m_bPRCCalculatePhysicalProperties = o.m_bPRCCalculatePhysicalProperties;
434  m_pPRCMultiModelSelectionCallback = o.m_pPRCMultiModelSelectionCallback;
435  m_pPRCAsmModelFile = o.m_pPRCAsmModelFile;
436  m_pPRCDeleteModelFile = o.m_pPRCDeleteModelFile;
437  m_bPRCImportHiddenObjects = o.m_bPRCImportHiddenObjects;
438  m_bPRCLoadAsDrawings = o.m_bPRCLoadAsDrawings;
439  m_PRCModelUnits = o.m_PRCModelUnits;
440  m_bPRCExtractLargeTranslations = o.m_bPRCExtractLargeTranslations;
441 
442  // DWF import options
443  m_bDisableDWFDrawOrder = o.m_bDisableDWFDrawOrder;
444  m_bDWFRebaselineModel = o.m_bDWFRebaselineModel;
445  m_bImportThumbnail = o.m_bImportThumbnail;
446 
447 
448  //SKP import option
449  m_bOptimizeSegmentTree = o.m_bOptimizeSegmentTree;
450 
451  m_pOOCNodeDeltas = o.m_pOOCNodeDeltas;
452  m_bOOCAutoUpdate = o.m_bOOCAutoUpdate;
453  m_bOOCAutoCleanup = o.m_bOOCAutoCleanup;
454 
455  m_attributePrecisionMode = o.m_attributePrecisionMode;
456 // m_geometryPrecisionMode = o.m_geometryPrecisionMode;
457  m_generatedDouble = o.m_generatedDouble;
458 
459  m_bIsTestingSettings = o.m_bIsTestingSettings;
460 
461  //Rhino import option
462  m_bForceRenderedModeColors = o.m_bForceRenderedModeColors;
463  }
464 
465  virtual ~HInputHandlerOptions();
466 
469 
471  const char * m_pImageName;
472 
474  const char * m_pImageFormat;
475 
477  bool m_bLocal;
478 
480  HStreamFileToolkit * m_tk;
481 
484 
487 
490 
493 
495  const char *m_license;
496 
499 
503  double m_coneFactor;
504 
509 
512 
513 
514 
518  enum {
521  OPT_CELLHEADER
522  };
523 
526 
529 
536  bool m_bPRCImportNonBrepFaces;
537 
540  bool m_bPRCInstanceShells;
541 
542  bool m_bPRCCalculatePhysicalProperties;
544  void (*m_pPRCMultiModelSelectionCallback) (char const * in_container, int in_num_configs, char const * in_configs[],
545  int & out_config_selection);
549  void (*m_pPRCDeleteModelCallback) ( void*& pPRCAsmModelFile);
552 
555 
558 
560  // The extracted translation, if any, will be stored on the model segment as a user option with name "extracted translation = (x, y, z)".
561  // By default, this option is set to false
563 
566 
569 
570  // DWF import options
576 
579 
582 
585 
588 
596 
606 
607  /*
608  For 2D files (DWF only as of this time), the drawing can be layered either by using depth range or by offsetting
609  the z values. To separate the layers by z value, make sure z > 0. To use depth range, make sure depth range > 0.
610  */
611  double m_z_separation;
612 
618 
621 
624 
627 
628 
629 
633  enum {
638  FORCE_DOUBLE
639  };
640 
643 
645 // int m_geometryPrecisionMode; // (NOTE: currently not used)
646 
649 
652 };
653 
654 
655 
657 
663 class MVO_API HInputHandler
664 {
665 
666 public:
674  HInputHandler();
675  virtual ~HInputHandler();
676 
681  unsigned long GetInputOps() {return m_InputOps;};
682 
683 
686  virtual const char * GetInputName() = 0;
687 
688 
695  virtual void RegisterInputHandlerTypes() = 0;
696 
703  virtual HInputHandlerStyle GetInputStyle() = 0;
704 
712  virtual HFileInputResult FileInputByKey(const char * filename, HC_KEY key, HInputHandlerOptions * options);
713  virtual HFileInputResult FileInputByKey(const __wchar_t * filename, HC_KEY key, HInputHandlerOptions * options);
714 
715 
724  virtual HFileInputResult FileInputByKey(const unsigned short * filename, HC_KEY key, HInputHandlerOptions * options);
725 
736  virtual HFileInputResult FileInputToImageKey(const char * filename, HC_KEY * image_key, HC_KEY segment_key, HInputHandlerOptions * options);
737  virtual HFileInputResult FileInputToImageKey(const __wchar_t * filename, HC_KEY * image_key, HC_KEY segment_key, HInputHandlerOptions * options);
738 
739 
749  virtual HFileInputResult FileInputToImageKey(const unsigned short * filename, HC_KEY * image_key, HC_KEY segment_key, HInputHandlerOptions * options);
750 
763  virtual const char * GetInputTypesString() = 0;
764 
768  const __wchar_t * GetInputProgress();
769 
773  float GetInputPercentProgress();
774 
778  const __wchar_t * GetInputInformation();
779 
786  HIONoticeCallback * SetInputProgressNoticeCallback(HIONoticeCallback *notice_callback);
787 
788 
795  HIOPercentNoticeCallback * SetInputPercentProgressNoticeCallback(HIOPercentNoticeCallback *percent_notice_callback);
796 
803  HIONoticeCallback * SetInputInformationNoticeCallback(HIONoticeCallback *notice_callback);
804 
806  void ReportInputProgress(const char * progress);
807  void ReportInputProgress(const __wchar_t * progress);
808 
810  void ReportInputPercentProgress(float percent_progress);
811 
813  void ReportInputInformation(const char * information);
814  void ReportInputInformation(const __wchar_t * information);
815 
816  void SetModuleDirectory(const char *module_directory);
817  void SetModuleDirectory(const __wchar_t *module_directory);
818 
819 protected:
820 
824  void SetStartingInput(const char *filename);
825  void SetStartingInput(const __wchar_t *filename = 0);
826 
830  void SetFinishedInput();
831 
833  void SetInputOps(unsigned long ops) {m_InputOps=ops;};
834 
836  unsigned long m_InputOps;
837 
838  __wchar_t *m_module_directory;
839 
840 private:
841  __wchar_t *m_progress;
842  float m_percent_progress1;
843  float m_percent_progress2;
844  __wchar_t *m_information;
845  struct vlist_s *m_information_list;
846  HIONoticeCallback *m_progress_callback;
847  HIONoticeCallback *m_information_callback;
848  HIOPercentNoticeCallback *m_percent_progress_callback;
849 };
850 
855 {
856  HOutputHandlerStyleModel,
861 };
862 
869 class MVO_API ExportNameMap
870 {
871 private:
872  void * _imp;
873 public:
874  ExportNameMap();
875  ~ExportNameMap();
876 
877  H_FORMAT_TEXT lookup(HC_KEY) const;
878  void tag(HC_KEY, H_FORMAT_TEXT const &);
879 };
880 
893 };
894 
901 {
902 public:
905 
906  virtual char const * GetType() const;
907 
910  virtual bool PopulateOptions();
911 
916  Init(o);
917  };
918 
923  Init(&o);
924  };
925 
926 
927  virtual ~HOutputHandlerOptions();
928 
932  void Init(HOutputHandlerOptions const *o);
933 
937  HBaseView * View() const {return m_pHBaseView;};
939  void View(HBaseView * const v) {m_pHBaseView = v;};
940 
942  HBaseModel * m_pHBaseModel;
944  HBaseModel * Model() const {return m_pHBaseModel;};
946  void Model(HBaseModel * const m) {m_pHBaseModel = m;};
947 
949  HCamera * m_pCamera;
951  HCamera * Camera() const {return m_pCamera;};
953  void Camera(HCamera * const c) {m_pCamera = c;};
954 
956  HC_KEY m_Key;
958  HC_KEY Key() const {return m_Key;};
960  void Key(HC_KEY const k) {m_Key = k;};
961 
963  char const * m_pHSRAOptions;
965  char const * HSRAOptions() const {return m_pHSRAOptions;};
967  void HSRAOptions(char const * const tf) {m_pHSRAOptions = tf;};
968 
970  HPoint const * m_pWindowColor;
972  HPoint const * WindowColor() const {return m_pWindowColor;};
974  void WindowColor(HPoint const * const tf) {m_pWindowColor = tf;};
975 
977  bool m_bUseWindowColor;
979  bool UseWindowColor() const {return m_bUseWindowColor;};
981  void UseWindowColor(bool const tf) {m_bUseWindowColor = tf;};
982 
984  float m_Window_Width;
986  float WindowWidth() const {return m_Window_Width;};
988  void WindowWidth(float const f) {m_Window_Width = f;};
989 
991  float m_Window_Height;
993  float WindowHeight() const {return m_Window_Height;};
995  void WindowHeight(float const f) {m_Window_Height = f;};
996 
998  float m_Paper_Width;
1000  float PaperWidth() const {return m_Paper_Width;};
1002  void PaperWidth(float const f) {m_Paper_Width = f;};
1003 
1005  float m_Paper_Height;
1007  float PaperHeight() const {return m_Paper_Height;};
1009  void PaperHeight(float const f) {m_Paper_Height = f;};
1010 
1012  bool m_ForceGrayscale;
1014  bool ForceGrayscale() const {return m_ForceGrayscale;};
1016  void ForceGrayscale(bool const tf) {m_ForceGrayscale = tf;};
1017 
1019  size_t m_lineFuseThreshold;
1020 
1024  size_t LineFuseThreshold() const {return m_lineFuseThreshold;};
1025 
1029  void LineFuseThreshold(size_t const tf) {m_lineFuseThreshold = tf;};
1030 
1032  bool m_bFastPrint;
1034  bool FastPrint() const {return m_bFastPrint;};
1036  void FastPrint(bool const tf) {m_bFastPrint = tf;};
1037 
1039  bool m_bConserveMemory;
1041  bool ConserveMemory() const {return m_bConserveMemory;};
1043  void ConserveMemory(bool const tf) {m_bConserveMemory = tf;};
1044 
1045  bool m_bWriteAnimations;
1046  bool WriteAnimations() const {return m_bWriteAnimations;};
1047  void WriteAnimations(bool const tf) {m_bWriteAnimations = tf;};
1048 
1050  bool m_bWindowFrame;
1052  bool WindowFrame() const {return m_bWindowFrame;};
1054  void WindowFrame(bool const tf) {m_bWindowFrame = tf;};
1055 
1057  bool m_bUseSubscreen;
1059  bool UseSubscreen() const {return m_bUseSubscreen;};
1061  void UseSubscreen(bool const tf) {m_bUseSubscreen = tf;};
1062 
1064  int m_Image_Dpi;
1066  int ImageDpi() const {return m_Image_Dpi;};
1068  void ImageDpi(int const dpi) {m_Image_Dpi = dpi;};
1069 
1071  int m_Paper_Dpi;
1073  int PaperDpi() const {return m_Paper_Dpi;};
1075  void PaperDpi(int const dpi) {m_Paper_Dpi = dpi;};
1076 
1078  void * m_pExtendedData;
1079  void * ExtendedData() const {return m_pExtendedData;};
1080  void ExtendedData(void * const vp) {m_pExtendedData = vp;};
1081  void ExtendedData(HPDFOptions * const vp) {m_pExtendedData = (void*)vp;};
1082 
1083  bool ActivateOnPageOpen() const {return m_bActivateOnPageOpen;};
1084  void ActivateOnPageOpen(bool onoff) {m_bActivateOnPageOpen = onoff;};
1085  float AnnotLeft() const {return m_fAnnotLeft;};
1086  void AnnotLeft(float f) {m_fAnnotLeft = f;};
1087  float AnnotRight() const {return m_fAnnotRight;};
1088  void AnnotRight(float f) {m_fAnnotRight = f;};
1089  float AnnotBottom() const {return m_fAnnotBottom;};
1090  void AnnotBottom(float f) {m_fAnnotBottom = f;};
1091  float AnnotTop() const {return m_fAnnotTop;};
1092  void AnnotTop(float f) {m_fAnnotTop = f;};
1093 
1094 
1096  const char *m_license;
1097 
1098  int m_antialiasLevel;
1099  int m_jpeg_quality;
1100  unsigned char* m_imageOutputBuffer;
1101  size_t m_imageOutputBufferSize;
1102 
1103 
1104 
1105 
1108  int Version() const {return m_Version;};
1109  void Version(int const v) {m_Version = v;};
1110 
1112  H_OUTPUT_TYPE m_OutputType;
1114  H_OUTPUT_TYPE OutputType() const {return m_OutputType;};
1116  void OutputType(H_OUTPUT_TYPE ot) {m_OutputType = ot;};
1117 
1119  bool m_b3dOutput;
1121  bool Output3d() const {return m_b3dOutput;};
1123  void Output3d(bool const tf) {m_b3dOutput = tf;};
1124 
1126  bool m_bAscii;
1128  bool Ascii() const {return m_bAscii;};
1130  void Ascii(bool const tf) {m_bAscii = tf;};
1131 
1133  bool m_bStlNormals;
1135  bool StlNormals() const {return m_bStlNormals;};
1137  void StlNormals(bool const tf) {m_bStlNormals = tf;};
1138 
1140  double m_ratio_cm_to_internal_units;
1141 
1145  double PrintToScale() const {return m_ratio_cm_to_internal_units;};
1146 
1162  void PrintToScale(double const r) {m_ratio_cm_to_internal_units = r;};
1163 
1170  float m_PageMargins[4];
1171 
1174 
1176  char const* m_pDWFModelName;
1177 
1182 
1185 
1188 
1191 
1194 
1197 
1200 
1203 
1206 
1209 
1212 
1215 
1217  MVO_POINTER_SIZED_INT m_iPrcNameUserDataIndex;
1218 
1219 
1222 
1225 
1234  char m_bAVICodec[4];
1235 
1238 
1241  char const * m_pHTMLTemplateFile;
1242 
1245 };
1246 
1247 
1249 
1255 class MVO_API HOutputHandler
1256 {
1257 
1258 public:
1266  HOutputHandler();
1267  virtual ~HOutputHandler();
1268 
1269 
1272  virtual const char * GetOutputName() = 0;
1273 
1278  unsigned long GetOutputOps() {return m_OutputOps;};
1279 
1290  virtual void RegisterOutputHandlerTypes() = 0;
1291 
1292 
1300  virtual HFileOutputResult FileOutputByKey(const char * filename, HC_KEY key, HOutputHandlerOptions * options);
1301  virtual HFileOutputResult FileOutputByKey(const __wchar_t * filename, HC_KEY key, HOutputHandlerOptions * options);
1302 
1310  virtual HFileOutputResult FileOutputByKey(const unsigned short * filename, HC_KEY key, HOutputHandlerOptions * options);
1311 
1312 
1321  virtual HFileOutputResult FileOutputFromImageKey(const char * filename, HC_KEY image_key, HOutputHandlerOptions * options);
1322  virtual HFileOutputResult FileOutputFromImageKey(const __wchar_t * filename, HC_KEY image_key, HOutputHandlerOptions * options);
1323 
1334  virtual const char * GetOutputTypesString() = 0;
1335 
1344  virtual HOutputHandlerStyle GetOutputStyle() = 0;
1345 
1352  virtual const char * GetOutputDefaultHSRA();
1353 
1357  const char * GetOutputProgress();
1358 
1362  float GetOutputPercentProgress();
1363 
1367  const __wchar_t * GetOutputInformation();
1368 
1375  HIONoticeCallback * SetOutputProgressNoticeCallback(HIONoticeCallback *notice_callback);
1376 
1377 
1384  HIOPercentNoticeCallback * SetOutputPercentProgressNoticeCallback(HIOPercentNoticeCallback *percent_notice_callback);
1385 
1392  HIONoticeCallback * SetOutputInformationNoticeCallback(HIONoticeCallback *notice_callback);
1393 
1395  void ReportOutputProgress(const char * progress);
1396 
1398  void ReportOutputPercentProgress(float percent_progress);
1399 
1401  void ReportOutputInformation(const char * information);
1402 
1403 
1404  void SetModuleDirectory(const char *module_directory);
1405  void SetModuleDirectory(const __wchar_t *module_directory);
1406 
1407 protected:
1408 
1412  void SetStartingOutput();
1413 
1417  void SetFinishedOutput();
1418 
1420  void SetOutputOps(unsigned long ops) {m_OutputOps=ops;};
1422  unsigned long m_OutputOps;
1423 
1424  char *m_module_directory;
1425 private:
1426 
1427  char *m_progress;
1428  float m_percent_progress1;
1429  float m_percent_progress2;
1430  __wchar_t *m_information;
1431  struct vlist_s *m_information_list;
1432  HIONoticeCallback *m_progress_callback;
1433  HIOPercentNoticeCallback *m_percent_progress_callback;
1434  HIONoticeCallback *m_information_callback;
1435 };
1436 
1442 class MVO_API HIOManager
1443 {
1444 
1445 public:
1446 
1447  HIOManager();
1448  virtual ~HIOManager();
1449 
1459  virtual HInputHandler * RegisterInputHandler(const char * file_type, HInputHandler * handler);
1460 
1469  virtual HOutputHandler * RegisterOutputHandler(const char * file_type, HOutputHandler * handler);
1470 
1481  virtual HIOConnector * RegisterConnector(const char * file_type, HIO_CREATE_FREE_FUNCTION Create, HIO_FREE_CONNECTOR_FUNCTION Free);
1482 
1526  virtual HInputHandler * GetInputHandler(const char * file_type);
1527  HInputHandler * GetInputHandler(const __wchar_t * file_type);
1528 #ifdef _MSC_VER
1529  HInputHandler * GetInputHandler(const unsigned short * file_type);
1530 #endif
1531 
1536  virtual HOutputHandler * GetOutputHandler(const char * file_type);
1537  virtual HOutputHandler * GetOutputHandler(const __wchar_t * file_type);
1538 
1543  virtual void RegisterHandlers();
1544 
1549  virtual const char * GetInputHandlerTypes();
1550 
1555  virtual const char * GetOutputHandlerTypes();
1556 
1557 
1564  virtual HIOConnector * CreateConnector(const char * file_type);
1565 
1570  virtual void FreeConnector(HIOConnector * old_connector);
1571 
1572 
1577  static HIOManager *GetCurrentHIOManager();
1578 
1584  static void GetFileOutputResultString(HFileOutputResult result, char *result_str);
1585 
1589  void CleanCallbacks();
1590 
1591 private:
1592  void RecordOutputHandler (HOutputHandler * handler);
1593  void RecordInputHandler (HInputHandler * handler);
1594 
1595 protected:
1596 
1598  struct vhash_s * input_handlers;
1599 
1601  struct vhash_s * output_handlers;
1602 
1604  struct vhash_s * connector_procs;
1605 
1607  struct vlist_s * owned_input_handlers;
1608 
1610  struct vlist_s * owned_output_handlers;
1611 
1613  struct vlist_s * loaded_input_handlers;
1614 
1616  struct vlist_s * loaded_output_handlers;
1617 
1619  struct vhash_s * created_connectors;
1620 
1621  char * m_input_types;
1622  int m_input_types_allocated;
1623 
1624  char * m_output_types;
1625  int m_output_types_allocated;
1626 };
1627 
1628 #ifdef H_PACK_8
1629 #pragma pack(pop)
1630 #endif
1631 
1632 #endif
1633 
int PaperDpi() const
Indicates the DPI used for paper. This is set from the options dialog.
Definition: HIOManager.h:1073
Definition: HIOManager.h:1442
size_t LineFuseThreshold() const
Definition: HIOManager.h:1024
HBaseView * m_pHBaseView
A pointer to the HBaseView object for this output.
Definition: HIOManager.h:935
float PaperWidth() const
Width for output sizing in inches.
Definition: HIOManager.h:1000
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:565
Definition: HIOManager.h:869
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:562
handling choice is left to the importer
Definition: HIOManager.h:634
Definition: HIOManager.h:99
void WindowFrame(bool const tf)
Determines if a window frame is drawn or not.
Definition: HIOManager.h:1054
void HSRAOptions(char const *const tf)
HOOPS HSRAOption string .
Definition: HIOManager.h:967
bool m_pPRCDeleteModelFile
PRC import option: If true model file is deleted after loading is complete.
Definition: HIOManager.h:528
void(* m_pPRCDeleteModelCallback)(void *&pPRCAsmModelFile)
PRC import option: Function pointer to delete model.
Definition: HIOManager.h:549
double PrintToScale() const
Definition: HIOManager.h:1145
ExportNameMap m_names
Definition: HIOManager.h:1184
void PrintToScale(double const r)
Definition: HIOManager.h:1162
bool m_bPRCImportHiddenObjects
PRC import option: If true, hidden objects will be imported though not visible. If false...
Definition: HIOManager.h:551
data is forced to single-precision
Definition: HIOManager.h:637
Specifies an HInputHandler for model data.
Definition: HIOManager.h:226
char const * m_pPDFResourceDirectory
Definition: HIOManager.h:1181
struct vlist_s * owned_output_handlers
A list of default HOutputHandlers created by the manager.
Definition: HIOManager.h:1610
bool m_bLogging
If true, logging will be enabled in those plugins that support it.
Definition: HIOManager.h:483
The HBhvBehaviorManager class stores and manages all animation related data.
Definition: HBhvBehaviorManager.h:237
Low compression, high accuracy.
Definition: HIOManager.h:890
HCamera * Camera() const
A pointer to the HCamera object for this output.
Definition: HIOManager.h:951
void StlNormals(bool const tf)
Determines if we generate and output face normals when writing to STL file format.
Definition: HIOManager.h:1137
float m_fAnnotLeft
Definition: HIOManager.h:1193
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:581
Definition: HUtility.h:2357
bool m_bPrcUseNameUserData
Definition: HIOManager.h:1214
MVO_POINTER_SIZED_INT m_iPrcNameUserDataIndex
Definition: HIOManager.h:1217
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:495
Specifies an HOutputHandler for geometry data.
Definition: HIOManager.h:857
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:471
bool m_bLegacyOptimize
Definition: HIOManager.h:595
Definition: HIOManager.h:148
HInputHandler an abstract base class for model and image input.
Definition: HIOManager.h:663
bool m_bAVIShowCompressionDialog
Definition: HIOManager.h:1224
The HCamera class is the data type of a HOOPS Camera Attribute.
Definition: HUtility.h:540
bool m_bPrcRemoveBRep
Definition: HIOManager.h:1208
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:568
BREP_Topology * m_pPRCTopologyManager
PRC import option: Pointer to connector class. If not null prc topology entities will be associated t...
Definition: HIOManager.h:533
void * m_pOOCNodeDeltas
OOC import option: Pointer to node deltas. If not null, importer will use it to selectively reject po...
Definition: HIOManager.h:620
void(* HIO_FREE_CONNECTOR_FUNCTION)(void *)
Definition: HIOManager.h:141
Specifies an HOutputHandler for a hardcopy output type.
Definition: HIOManager.h:859
HIOConnector * m_pConnector
A pointer to HIOConnector object. The connectivity between HOOPS and kernel will be stored in this...
Definition: HIOManager.h:486
HBhvBehaviorManager * m_pBehaviorManager
A pointer to the behavior manager.
Definition: HIOManager.h:1173
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:557
HOutputHandlerStyle
Definition: HIOManager.h:854
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:544
HPrcBrepCompression
Definition: HIOManager.h:888
void PaperWidth(float const f)
Width for output sizing in inches.
Definition: HIOManager.h:1002
bool m_bOOCAutoCleanup
OOC import option: Determines whether or not the view for the OOC model should automatically cleanup ...
Definition: HIOManager.h:626
void ConserveMemory(bool const tf)
This option has been deprecated and has no effect.
Definition: HIOManager.h:1043
data is converted to float if it appears safe, otherwise it is retained as double ...
Definition: HIOManager.h:636
Specifies an HOutputHandler for an image.
Definition: HIOManager.h:858
void *(* HIO_CREATE_FREE_FUNCTION)(void *)
Definition: HIOManager.h:137
struct vhash_s * input_handlers
A hash of HInputHandlers.
Definition: HIOManager.h:1598
HOutputHandler an abstract base class for model and image output.
Definition: HIOManager.h:1255
H_OUTPUT_TYPE OutputType() const
The output type.
Definition: HIOManager.h:1114
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:860
double m_depth_range
Definition: HIOManager.h:617
void OutputType(H_OUTPUT_TYPE ot)
The output type.
Definition: HIOManager.h:1116
bool WindowFrame() const
Determines if a window frame is drawn or not.
Definition: HIOManager.h:1052
int ImageDpi() const
Indicates the DPI used for images. This is calculated with info from HC_Show_Device_Info.
Definition: HIOManager.h:1066
bool m_bPRCLoadAsDrawings
PRC import option: When loading a DWG or DXF file through HIOUtilityExchange, set this option to true...
Definition: HIOManager.h:554
indicates that cell header entity will be imported as single segment
Definition: HIOManager.h:519
const char * m_pImageFormat
The HOOPS image format to use for loading an image if not using filename .ext for format...
Definition: HIOManager.h:474
int m_attributePrecisionMode
The manner in which precision in attributes (such as matrices) is handled.
Definition: HIOManager.h:642
void PaperHeight(float const f)
Height for output sizing in inches.
Definition: HIOManager.h:1009
indicates that cell header will have as many segments as its children
Definition: HIOManager.h:520
struct vhash_s * connector_procs
A hash of HIOConnector Create/Free functions.
Definition: HIOManager.h:1604
void * m_pExtendedData
A pointer to extra data needed by a HInputHandler subclass.
Definition: HIOManager.h:489
float WindowHeight() const
Height for output sizing in inches.
Definition: HIOManager.h:993
bool m_bDisableDWFDrawOrder
Definition: HIOManager.h:575
HOutputHandlerOptions(const HOutputHandlerOptions &o)
Definition: HIOManager.h:922
double m_factorForSmartSolids
Definition: HIOManager.h:508
bool m_bPRCStoreUserAttributes
PRC import option: If true all prc user attributes will be converted as user option.
Definition: HIOManager.h:547
float m_fAnnotBottom
Definition: HIOManager.h:1199
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:1061
float WindowWidth() const
Width for output sizing in inches.
Definition: HIOManager.h:986
void * m_pPRCAsmModelFile
Definition: HIOManager.h:1187
char const * m_pHTMLTemplateFile
Definition: HIOManager.h:1241
HBaseView * View() const
A pointer to the HBaseView object for this output.
Definition: HIOManager.h:937
High compression, low accuracy.
Definition: HIOManager.h:892
float m_fAnnotTop
Definition: HIOManager.h:1202
char const * m_pDWFModelName
Definition: HIOManager.h:1176
HPoint const * WindowColor() const
Set the color of the window. The RGB color stored in xyz of HPoint.
Definition: HIOManager.h:972
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:539
HInputHandlerOptions(HInputHandlerOptions const *o)
Definition: HIOManager.h:325
HDwgViewVector
Definition: HIOManager.h:234
struct vlist_s * loaded_input_handlers
A list of dynamically loaded HInputHandlers libraries.
Definition: HIOManager.h:1613
void Model(HBaseModel *const m)
A pointer to the HBaseModel object for this output.
Definition: HIOManager.h:946
bool UseSubscreen() const
Determines if HOOPS is calculating a subscreen to match the output to the size of the view window...
Definition: HIOManager.h:1059
HInputHandlerOptions(const HInputHandlerOptions &o)
Definition: HIOManager.h:399
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:1237
Definition: HIOManager.h:900
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:587
void WindowColor(HPoint const *const tf)
Set the color of the window. The RGB color stored in xyz of HPoint.
Definition: HIOManager.h:974
bool m_bPrcRemoveAttributes
Definition: HIOManager.h:1211
bool m_bIgnoreOffEntities
Definition: HIOManager.h:498
struct vhash_s * output_handlers
A hash of HOutputHandlers.
Definition: HIOManager.h:1601
HInputHandlerOptions()
Definition: HIOManager.h:251
float m_fAnnotRight
Definition: HIOManager.h:1196
bool m_bActivateOnPageOpen
Definition: HIOManager.h:1190
HC_KEY Key() const
The HC_Key for this output.
Definition: HIOManager.h:958
int m_Version
The file format version desired for writing.
Definition: HIOManager.h:1107
bool StlNormals() const
Determines if we generate and output face normals when writing to STL file format.
Definition: HIOManager.h:1135
Medium compression, medium accuracy.
Definition: HIOManager.h:891
bool m_bOOCAutoUpdate
OOC import option: Determines whether or not the view for the OOC model should automatically update w...
Definition: HIOManager.h:623
bool m_bDwgSkipUnreferencedBlocks
Definition: HIOManager.h:605
void WindowWidth(float const f)
Width for output sizing in inches.
Definition: HIOManager.h:988
bool Ascii() const
Some file formats, support binary and ascii such as STL. Set this to true for ascii output...
Definition: HIOManager.h:1128
unsigned long GetOutputOps()
Definition: HIOManager.h:1278
float PaperHeight() const
Height for output sizing in inches.
Definition: HIOManager.h:1007
void UseWindowColor(bool const tf)
If set to true, the background color of the view is used.
Definition: HIOManager.h:981
void * m_pPRCAsmModelFile
PRC import option: Returned to user. Contains Pointer to A3DAsmModelFile entity.
Definition: HIOManager.h:525
bool ConserveMemory() const
This option has been deprecated and has no effect.
Definition: HIOManager.h:1041
HPrcBrepCompression m_ePrcBrepCompression
Definition: HIOManager.h:1205
bool ForceGrayscale() const
Specifies black and white output.
Definition: HIOManager.h:1014
double m_coneFactor
Definition: HIOManager.h:503
HBaseModel * Model() const
A pointer to the HBaseModel object for this output.
Definition: HIOManager.h:944
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:1123
bool m_bPrcCompressTessellation
Definition: HIOManager.h:1221
No compression.
Definition: HIOManager.h:889
data is kept in the format from the file
Definition: HIOManager.h:635
unsigned long GetInputOps()
Definition: HIOManager.h:681
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:584
bool m_generatedDouble
The manner in which precision in geometry is handled.
Definition: HIOManager.h:648
void SetInputOps(unsigned long ops)
This sets the HInputOp.
Definition: HIOManager.h:833
struct vlist_s * loaded_output_handlers
A list of dynamically loaded HOutputHandlers libraries.
Definition: HIOManager.h:1616
void PaperDpi(int const dpi)
Indicates the DPI used for paper. This is set from the options dialog.
Definition: HIOManager.h:1075
HStreamFileToolkit * m_tk
The streamfile toolkit to be used.
Definition: HIOManager.h:480
struct vlist_s * owned_input_handlers
A list of default HInputHandlers created by the manager.
Definition: HIOManager.h:1607
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:492
void SetOutputOps(unsigned long ops)
This sets the HOutputOp.
Definition: HIOManager.h:1420
bool UseWindowColor() const
If set to true, the background color of the view is used.
Definition: HIOManager.h:979
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:1121
int m_iDGNCellHeaderOption
DGN file import option: has three option about how cell header should be imported.
Definition: HIOManager.h:511
bool m_bIsTestingSettings
Testing settings. true if you want to activate testings settings.
Definition: HIOManager.h:651
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:1619
HIOConnector * m_pPRCPMIConnector
PRC import option: Pointer to connector class. If not null prc PMI entities will be associated to HOO...
Definition: HIOManager.h:531
void WindowHeight(float const f)
Height for output sizing in inches.
Definition: HIOManager.h:995
HOutputHandlerOptions(HOutputHandlerOptions const *o)
Definition: HIOManager.h:915
bool m_bPRCMergeFaces
PRC import option: If true individual faces will be merged into one shell.
Definition: HIOManager.h:535
bool FastPrint() const
This option has been deprecated. Specifies printing method.
Definition: HIOManager.h:1034
HBaseView * m_pHBaseView
A pointer to the HBaseView object for this input.
Definition: HIOManager.h:468
char const * HSRAOptions() const
HOOPS HSRAOption string .
Definition: HIOManager.h:965
bool m_bHTMLIncludeMeasurementInformation
Definition: HIOManager.h:1244
bool m_bImportThumbnail
DWF file import option: if true then Thumbnail are imported in the DWF file.
Definition: HIOManager.h:578
void View(HBaseView *const v)
A pointer to the HBaseView object for this output.
Definition: HIOManager.h:939
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:477