/*********************************************************************************************************************** * * Copyright (c) 2010 - 2025 by Tech Soft 3D, Inc. * The information contained herein is confidential and proprietary to Tech Soft 3D, Inc., and considered a trade secret * as defined under civil and criminal statutes. Tech Soft 3D shall pursue its civil and criminal remedies in the event * of unauthorized use or misappropriation of its trade secrets. Use of this information by anyone other than authorized * employees of Tech Soft 3D, Inc. is granted only under a written non-disclosure agreement, expressly prescribing the * scope and manner of such use. * ***********************************************************************************************************************/ #pragma once using namespace System; using namespace System::Collections::Generic; namespace TechSoft3D { namespace HOOPS { /// /// Class wrapping the HOOPS Exchange DLL. /// public ref class Exchange { public: /// /// Callback functions indicating what's starting: iStart == 1: Parsing CAD File /// iStart == 2: Reading CAD File /// iStart == 3: Writing Parasolid File /// delegate void CallbackStart(int iStart); /// /// Callback function giving the name of the file being converted. Useful when managing assemblies. /// delegate void CallbackTitle(String^ sTitle); /// /// Callback function giving the size of the progress bar. /// delegate void CallbackSize(int iSize); /// /// Callback function giving the current position in the progress bar the positions relative to iSize (provided by CallbackSize). /// delegate void CallbackIncrement(int iIncr); /// /// Callback function indicating the end of a reading/parsing/writing phase. /// delegate void CallbackEnd(void); /// /// Callback function reporting messages. /// delegate int CallbackReportMessage(String^ pMsg); /// /// Callback function reporting warning messages. /// delegate int CallbackReportWarning(String^ pCode,String^ pMsg); /// /// Callback function reporting error messages. /// delegate int CallbackReportError(String^ pCode,String^ pMsg); /// /// Load HOOPS Exchange DLL and check if the license is valid. /// /// /// true if DLL has been loaded and the license is valid. /// bool Init(); Exchange(); ~Exchange(); !Exchange(); /// /// Determine if a file is a ProeFile /// bool IsProEFile(String^ path); /// /// Function setting the unit in mm. The default value is 1000 as Parasolid files are usually in meters. /// void SetUnit(double dUnit); /// /// Function to define a log file /// void SetLogFile(String^ LogFileName); /// /// Convert any CAD file into XT file. /// /// /// true if both reading and writing succeeded. /// bool ConvertToXT(String^ sourceFileName, String^ destinationFileName, IDictionary^ sOptions); /// /// Break the conversion. /// void Break(); /// /// Set callback functions to manage a progress bar. /// /// /// fctStart: Function called when the parsing or reading or writing phase of a file is starting. /// fctTitle: Function called when a new file is being loaded. /// fctSize: Function called during conversion that gives the size of the progress bar. /// fctIncr: Function called during conversion that gives the position in the progress bar. /// void SetCallBackFct(CallbackStart^ fctStart,CallbackTitle^ fctTitle, CallbackSize^ stm_pFCTSize, CallbackIncrement^ fctIncr, CallbackEnd^ fctEnd); /// /// Set callback functions to manage a progress bar. /// /// /// fctStart: Function called when the parsing or reading or writing phase of a file is starting. /// fctTitle: Function called when a new file is being loaded. /// fctSize: Function called during conversion that gives the size of the progress bar. /// fctIncr: Function called during conversion that gives the position in the progress bar. /// void SetCallBackMessageFct(CallbackReportMessage^ fctReportMessage,CallbackReportWarning^ fctReportWarning, CallbackReportError^ fctReportError); static CallbackStart^ stm_pFCTStart; static CallbackTitle^ stm_pFCTTitle; static CallbackSize^ stm_pFCTSize; static CallbackIncrement^ stm_pFCTIncr; static CallbackEnd^ stm_pFCTEnd; static CallbackReportMessage^ stm_pFctReportMessage; static CallbackReportWarning^ stm_pFctReportWarning; static CallbackReportError^ stm_pFctReportError; private: void Terminate(); void SetLoadParametersOptions(A3DRWParamsLoadData & sLoadParametersData, IDictionary^ sOptions); double m_dUnit; bool m_bBreakTranslation; }; } }