Alphabetical Class Index  Class Hierarchy   File Members   Compound Members   File List  

HIOUtilityPDF.h
00001 // Copyright (c) 1998-2014 by Tech Soft 3D, Inc.
00002 //
00003 // The information contained herein is confidential and proprietary to Tech Soft 3D, Inc.,
00004 // and considered a trade secret as defined under civil and criminal statutes.
00005 // Tech Soft 3D, Inc. shall pursue its civil and criminal remedies in the event of
00006 // unauthorized use or misappropriation of its trade secrets.  Use of this information
00007 // by anyone other than authorized employees of Tech Soft 3D, Inc. is granted only under
00008 // a written non-disclosure agreement, expressly prescribing the scope and manner of such use.
00009 
00010 #ifndef _HIOUTILITYPDF_H
00011 #define _HIOUTILITYPDF_H
00012 
00013 #ifdef H_PACK_8
00014 #pragma pack(push)
00015 #pragma pack(8)
00016 #endif
00017 
00018 #include "HTools.h"
00019 #include "HIOManager.h"
00020 #include "HDB.h"
00021 #include <string>
00022 #include <map>
00023 
00024 
00025 
00032 class MVO_API HU3DOptions
00033 {
00034 public:
00036     HU3DOptions() {Reset();};
00038     void Reset(){
00039         m_bExportLines = m_bExportAnnotations = false;
00040     };
00041 
00043     bool m_bExportLines;
00045     bool m_bExportAnnotations;
00046 
00048     bool ExportLines() const {return m_bExportLines;};
00050     void ExportLines(bool onoff) {m_bExportLines = onoff;};
00052     bool ExportAnnotations() const {return m_bExportAnnotations;};
00054     void ExportAnnotations(bool onoff) {m_bExportAnnotations = onoff;};
00055 };
00056 
00059 class MVO_API HIOUtilityPDF: public HOutputHandler
00060 {
00061 public:
00063     HIOUtilityPDF() { 
00064         SetOutputOps(HOutputOpFileOutputByKey);
00065     };
00066 
00067     ~HIOUtilityPDF() {;};
00068 
00071     const char * GetOutputName() { return "HIOUtilityPDF"; }
00072 
00074     void RegisterOutputHandlerTypes() {
00075         HC_Begin_Segment_Search("/driver/pdf");{
00076             char seg[100];
00077             while(HC_Find_Segment(seg)){
00078                 if(strieq(seg, "/driver/pdf")){
00079                     HIORegisterOutputType("pdf",this);
00080                     break;
00081                 }
00082             }
00083         }HC_End_Segment_Search();
00084     };
00085 
00087     const char * GetOutputTypesString() {return "pdf";};
00089     HOutputHandlerStyle GetOutputStyle() {return HOutputHandlerStyleHardcopy;};
00090 
00092     const char * GetOutputDefaultHSRA() {return "painters";};
00093 
00097     bool Has3dSupport(){
00098         return HDB::GetHIOManager()->GetOutputHandler("u3d") != 0;
00099     }
00100 
00107     HFileOutputResult FileOutputByKey(const __wchar_t * filename, HC_KEY key, HOutputHandlerOptions * options);
00108 
00109 #ifdef _MSC_VER
00110     HFileOutputResult FileOutputByKey(const unsigned short * filename, HC_KEY key, HOutputHandlerOptions * options){
00111         H_UTF16 utf16;
00112         utf16.encodedText((utf16_char const*) filename);
00113         return FileOutputByKey(H_WCS(utf16).encodedText(), key, options);
00114     }
00115 #endif
00116 
00117     HFileOutputResult FileOutputByKey(const char * filename, HC_KEY key, HOutputHandlerOptions * options){
00118         return FileOutputByKey(H_WCS(filename).encodedText(), key, options);
00119     }
00120 
00121 protected:
00128     HFileOutputResult FileOutputByKey2D(const __wchar_t * filename, HC_KEY key, HOutputHandlerOptions * options);
00129     HFileOutputResult FileOutputByKey2D(const char * filename, HC_KEY key, HOutputHandlerOptions * options){
00130         return FileOutputByKey2D((__wchar_t*)H_WCS(filename).encodedText(), key, options);
00131     }
00132 
00133 
00134 };
00135 
00136 
00137 #ifdef H_PACK_8
00138 #pragma pack(pop)
00139 #endif
00140 
00141 #endif