#ifndef __ARTWORK_CONVERSION_COPYRIGHT_QISMHEXTRACT_H #define __ARTWORK_CONVERSION_COPYRIGHT_QISMHEXTRACT_H #ifdef __cplusplus #include "qismextension.h" namespace NsQisMLib { class QisMFile; /* qismfile.h */ } namespace NsQisMHExtract { /******************************************************************************* QisMHExtract Flags *******************************************************************************/ struct QisMHExtractFlags { /***************************************************************************** All entities completely inside the clipping window(s) are extracted. Clipping modes apply only to partially crossing entities. For TEXTs, only insertion points are tested. All entities fully-inside the clipping windows are extracted as-is ----------------------------------------------------------------------------*/ enum ClipMode { CLIP_OFF=0 /* No clipping. Partially crossing boundaries, paths, refs are extracted as-is */ ,CLIP_PART_POLYS=1 /* Partially crossing boundaries are clipped, partially crossing paths are converted to boundaries and clipped, partially crossing refs are exploded */ ,DROP_PART_POLYS=2 /* Partially crossing boundaries/paths are dropped, partially crossing refs are exploded */ ,DROP_PART_DATA=3 /* All partially crossing entities are dropped */ }; /***************************************************************************** Output file format types ----------------------------------------------------------------------------*/ enum FileFormat { FMT_GDSII=0 /* Output GDSII file */ ,FMT_OASIS=1 /* Output OASIS file */ ,FMT_COASIS=2 /* Output compressed OASIS file (At the moment, same as FMT_OASIS) */ }; }; /******************************************************************************* QisMHExtract error codes *******************************************************************************/ struct QisMHExtractError { enum Cast_error_codes { CSTE_INV_VERSION=-1 /* Unknown API version (expecting 0-) */ }; enum New_object_codes { NOE_INV_NAME=-1 /* Invalid (null/empty) class name */ ,NOE_UNK_CLASS=-2 /* Unknown class name */ }; enum Create_extractor_codes { CEE_INV_FILEDB=-1 /* Invalid (null) file db */ ,CEE_EXPLODER=-2 /* Failed to create exploder, */ ,CEE_QISMBOOL=-3 /* Failed to create boolean object, */ ,CEE_CLIPPER=-4 /* QisMClipper extension not found */ ,CEE_LICENSE=-5 /* Failed to acquire license, */ }; enum Extract_codes { XE_INV_CELL=-1 /* Failed to identify cell , */ ,XE_INV_LAYERS=-2 /* Failed to set layers , */ ,XE_SETUP_REGIONS=-3 /* Failed to setup regions, */ ,XE_EXPLOSION=-4 /* Failed to collect vector data, */ ,XE_NO_TARGET=-5 /* (null) Extract target */ ,XE_TERM=-6 /* Extraction terminated [] */ }; enum Create_clipper_codes { CCE_VIEW_CELL=-1 /* Failed to get extents for , */ ,CCE_BOOLEAN=-2 /* Boolean error,
*/ ,CEE_CLIPPER_OBJ=-3 /* Failed to create clipper object, */ ,CEE_INV_BOX=-4 /* Invalid box window ,,, */ ,CEE_INV_POLY=-5 /* Invalid poly window () */ ,CEE_INV_CIRC=-6 /* Invalid circ window ,,,,*/ }; enum Create_file_writer_codes { CFWE_OPEN_FILE=-1 /* Failed to create '', */ ,CFWE_INV_PATH=-2 /* Invalid (empty/null) path */ }; }; /******************************************************************************* Interface to a callback handler to get updates during extraction *******************************************************************************/ class QisMHExtractUpdate { public: /***************************************************************************** Cast to a pointer of another version in the class hierarchy (base/derived). Get the latest version number. Version numbers start at 1 and are reflected in the class name using the suffix V. E.g V The topmost base class is version 1 (V1 implied). The cast returns NULL if a version number is not recognized/implemented ----------------------------------------------------------------------------*/ virtual void* QisMHExtractUpdate_cast(const int version) = 0; /* PLEASE ADD THIS IMPLEMENTATION IN YOUR HANDLER { switch(version) { case 0: return this; case 1: return dynamic_cast(this); } return 0; } */ virtual const void* QisMHExtractUpdate_cast(const int version) const = 0; /* PLEASE ADD THIS IMPLEMENTATION IN YOUR HANDLER { switch(version) { case 0: return this; case 1: return dynamic_cast(this); } return 0; } */ virtual int QisMHExtractUpdate_latest_version() const = 0; /* PLEASE ADD THIS IMPLEMENTATION IN YOUR HANDLER { return 1; } */ /***************************************************************************** Opportunity for the client to refresh (update progress, handle events etc.) ----------------------------------------------------------------------------*/ virtual int On_extract_refresh( const char* cellname, const long long nGeometries, const long long nTexts, const long long nReferences ) { return 0; } /*---------------------------------------------------------------------------- PARAMETERS + cellname : Name of the cell being processed + nGeometries, nTexts, nReferences : No. geometries (boundary, path); texts references (single, array) processed (not necessarily extracted) ------------------------------------------------------------------------------ + Return 0 to continue the extraction, non-zero code to terminate *****************************************************************************/ }; /******************************************************************************* Interface to a client (or a file writer) that will receive the data being extracted *******************************************************************************/ class QisMHExtractTarget { public: /***************************************************************************** Cast to a pointer of another version in the class hierarchy (base/derived). Get the latest version number. Version numbers start at 1 and are reflected in the class name using the suffix V. E.g V The topmost base class is version 1 (V1 implied). The cast returns NULL if a version number is not recognized/implemented ----------------------------------------------------------------------------*/ virtual void* QisMHExtractTarget_cast(const int version) = 0; /* PLEASE ADD THIS IMPLEMENTATION IN YOUR HANDLER { switch(version) { case 0: return this; case 1: return dynamic_cast(this); } return 0; } */ virtual const void* QisMHExtractTarget_cast(const int version) const = 0; /* PLEASE ADD THIS IMPLEMENTATION IN YOUR HANDLER { switch(version) { case 0: return this; case 1: return dynamic_cast(this); } return 0; } */ virtual int QisMHExtractTarget_latest_version() const = 0; /* PLEASE ADD THIS IMPLEMENTATION IN YOUR HANDLER { return 1; } */ /***************************************************************************** Indicates the beginning of a cell definition during extraction. Return 0 to continue the extraction, non-zero code to terminate ----------------------------------------------------------------------------*/ virtual int On_extract_begin_cell(const char* cellName) { return 0; } /***************************************************************************** Indicates that a boundary is being added (extracted) to the current cell definition ----------------------------------------------------------------------------*/ virtual int On_extract_boundary( const int* xy, const int nv, const unsigned short l, const unsigned short d ) { return 0; } /*---------------------------------------------------------------------------- PARAMETERS + xy : Array of x,y co-ordinate pairs forming the boundary (in DBU) + nv : Number of vertices (= num_integers(xy)/2) (> 3) + l : Layer number + d : Datatype number ------------------------------------------------------------------------------ + Return 0 to continue the extraction, non-zero code to terminate + 1 DBU = (file-units-in-meters) * (grid-in-file-units) e.g for a um file with resolution of 0.001 um (1 nm), 1 DBU = 1e-6 * 0.001 = 1e-9 m *****************************************************************************/ /***************************************************************************** Indicates that a path is being added (extracted) to the current cell definition ----------------------------------------------------------------------------*/ virtual int On_extract_path( const int* xy, const int nv, const unsigned short l, const unsigned short d, const int width, const char type ) { return 0; } /*---------------------------------------------------------------------------- PARAMETERS + xy : Array of x,y co-ordinate pairs forming the path (in DBU) + nv : Number of vertices (= num_integers(xy)/2) + l : Layer number + d : Datatype number + width : Path width (in DBU) + type : 'F' flush, 'H' half-extended or 'R' round ------------------------------------------------------------------------------ + Return 0 to continue the extraction, non-zero code to terminate + 1 DBU = (file-units-in-meters) * (grid-in-file-units) e.g for a um file with resolution of 0.001 um (1 nm), 1 DBU = 1e-6 * 0.001 = 1e-9 m *****************************************************************************/ /***************************************************************************** Indicates that a text is being added (extracted) to the current cell definition ----------------------------------------------------------------------------*/ virtual int On_extract_text( const char* textstr, const int x, const int y, const unsigned short l, const unsigned short d ) { return 0; } /*---------------------------------------------------------------------------- PARAMETERS + textstr : Text string + x,y : Insertion point (in DBU) + l : Layer number + d : Datatype number ------------------------------------------------------------------------------ + Return 0 to continue the extraction, non-zero code to terminate + 1 DBU = (file-units-in-meters) * (grid-in-file-units) e.g for a um file with resolution of 0.001 um (1 nm), 1 DBU = 1e-6 * 0.001 = 1e-9 m *****************************************************************************/ /***************************************************************************** Indicates that a single cell reference is being added (extracted) to the current cell definition ----------------------------------------------------------------------------*/ virtual int On_extract_sref( const char* refName, const int x, const int y, const double angle, const double scale, const bool flipY ) { return 0; } /*---------------------------------------------------------------------------- PARAMETERS + refName : Name of the cell being referenced + x,y : Insertion point (in DBU) + angle : Rotation in degrees + scale : Scale along X and Y (> 0.0) + flipY : If true, reflection about the X-axis ------------------------------------------------------------------------------ RETURN CODES + 0 : Continue extraction. This reference will not be exploded + Any other value : Terminate execution ------------------------------------------------------------------------------ + 1 DBU = (file-units-in-meters) * (grid-in-file-units) e.g for a um file with resolution of 0.001 um (1 nm), 1 DBU = 1e-6 * 0.001 = 1e-9 m *****************************************************************************/ /***************************************************************************** Indicates that an arrayed cell reference is being added (extracted) to the current cell definition ----------------------------------------------------------------------------*/ virtual int On_extract_aref( const char* refName, const int x, const int y, const double angle, const double scale, const bool flipY, const int nCols, const int nRows, const int colDx, const int colDy, const int rowDx, const int rowDy ) { return 0; } /*---------------------------------------------------------------------------- PARAMETERS + refName : Name of the cell being referenced + x,y : Insertion point (in DBU) + angle : Rotation in degrees + scale : Scale along X and Y (> 0.0) + flipY : If true, reflection about the X-axis + nCols, colDx, colDy : No. columns, offset between elements of the same row and consecutive columns + nRows, rowDx, rowDy : No. rows, offset between elements of the same column and consecutive rows ------------------------------------------------------------------------------ RETURN CODES + 0 : Continue extraction. This reference will not be exploded + Any other value : Terminate execution ------------------------------------------------------------------------------ + 1 DBU = (file-units-in-meters) * (grid-in-file-units) e.g for a um file with resolution of 0.001 um (1 nm), 1 DBU = 1e-6 * 0.001 = 1e-9 m *****************************************************************************/ /***************************************************************************** Indicates the end of a cell definition during extraction ----------------------------------------------------------------------------*/ virtual void On_extract_end_cell() { } }; /******************************************************************************* Opaque handle to an internal object that is responsible for clipping vector data *******************************************************************************/ typedef void* QisMHExtractClipper_p; /******************************************************************************* An object to specify a set of clipping regions (boxes, polygons or circles) *******************************************************************************/ class QisMHextractRegions { public: /***************************************************************************** Cast to a pointer of another version in the class hierarchy (base/derived). Get the latest version number. Version numbers start at 1 and are reflected in the class name using the suffix V. E.g V The topmost base class is version 1 (V1 implied). The cast returns NULL if a version number is not recognized/implemented ----------------------------------------------------------------------------*/ virtual const char* QisMHextractRegions_name(const int version) const = 0; virtual void* QisMHextractRegions_cast(const int version) = 0; virtual const void* QisMHextractRegions_cast(const int version) const = 0; virtual int QisMHextractRegions_latest_version() const = 0; /***************************************************************************** Clear all the clipping regions ----------------------------------------------------------------------------*/ virtual void Reset() = 0; /***************************************************************************** Clear unused memory allocated to store clipping regions ----------------------------------------------------------------------------*/ virtual void Consolidate() = 0; /***************************************************************************** Add a box (orthogonal rectangle) to the set of clipping regions. llx,lly,urx, ury are the min-max (lower left, upper right) extents in file units ----------------------------------------------------------------------------*/ virtual bool Add_box( const double llx, const double lly, const double urx, const double ury ) = 0; /***************************************************************************** Add a closed polygon to the set of clipping regions. nv is the number of vertices and xy is an array of x,y co-ordiinate pairs (nv*2 ints) in file units ----------------------------------------------------------------------------*/ virtual bool Add_polygon(const int nv, const double* xy) = 0; /***************************************************************************** Add a circle to the set of clipping regions (to be converted to a polygon) cx,cy is the center point in file units. {arcres} is the angle subtended by a single edge to the center of the circle (e.g arcres of 9.0 indicates that the polygon will have 360.0/9.0 = 40 edges). {arcsag} is the sagitta of the circular arc that is approximated by each edge of the polygon. If 0.0, this parameter is ignored. The parameter that results in a finer circle becomes the dominant parameter ----------------------------------------------------------------------------*/ virtual bool Add_circle( const double cx, const double cy, const double radius, const double arcres, const double arcsag ) = 0; /***************************************************************************** Compute the complement of the clipping regions w.r.t the extents of the view cell ----------------------------------------------------------------------------*/ virtual void Complement(const bool onOff) = 0; }; /******************************************************************************* An object to specify various extraction options *******************************************************************************/ class QisMHExtractOpts { public: /***************************************************************************** Cast to a pointer of another version in the class hierarchy (base/derived). Get the latest version number. Version numbers start at 1 and are reflected in the class name using the suffix V. E.g V The topmost base class is version 1 (V1 implied). The cast returns NULL if a version number is not recognized/implemented ----------------------------------------------------------------------------*/ virtual const char* QisMHExtractOpts_name(const int version) const = 0; virtual void* QisMHExtractOpts_cast(const int version) = 0; virtual const void* QisMHExtractOpts_cast(const int version) const = 0; virtual int QisMHExtractOpts_latest_version() const = 0; /***************************************************************************** Reset to default values ----------------------------------------------------------------------------*/ virtual void Reset() = 0; /***************************************************************************** Clone settings from another object ----------------------------------------------------------------------------*/ virtual void Copy_from(const QisMHExtractOpts* opts) = 0; /***************************************************************************** Flatten the output. Output will not have any hierarchy. Default: NO (false) ----------------------------------------------------------------------------*/ virtual void Set_flatten(const bool yes) = 0; virtual bool Get_flatten() const = 0; /***************************************************************************** Clipping mode. Default: QisMHExtractFlags::CLIP_PART_POLYS ----------------------------------------------------------------------------*/ virtual void Set_clip_mode(const QisMHExtractFlags::ClipMode mode) = 0; virtual QisMHExtractFlags::ClipMode Get_clip_mode() const = 0; /***************************************************************************** Extract TEXT data. Default: NO (false) ----------------------------------------------------------------------------*/ virtual void Set_text(const bool yes) = 0; virtual bool Get_text() const = 0; /***************************************************************************** Convert all paths to boundaries. Default: NO (false) ----------------------------------------------------------------------------*/ virtual void Set_path_to_boundary(const bool yes) = 0; virtual bool Get_path_to_boundary() const = 0; /***************************************************************************** Filter tiny boundaries. 'ratio' is the ratio of the perimeter to the area ( applied only during clipping). 'area' is used always and is in file-units. Polygons smaller than the specified values will be dropped. Default: 0.0 for both (extract all polygons) ----------------------------------------------------------------------------*/ virtual void Set_sliver(const double ratio, const double area) = 0; virtual double Get_sliver_value() const = 0; virtual double Get_sliver_area() const = 0; /***************************************************************************** Name of the extracted cell. Default: Same as the view cell ----------------------------------------------------------------------------*/ virtual void Set_extracted_name(const char* outputCellName) = 0; virtual const char* Get_extracted_name() const = 0; /***************************************************************************** Only extract refs that match atleast one of the specified regular expressions (dos-like) and immediate child of the view cell. Default: Extract all refs. cellnameRegularExpressions is a comma-separated list of expressions or cellnames ----------------------------------------------------------------------------*/ virtual void Set_only_refs(const char* cellnameRegularExpressions) = 0; virtual const char* Get_only_refs() const = 0; /***************************************************************************** Drop references to the specified cells (via regular expressions). cellnameRegularExpressions is a comma-separated list of dos-like regular expressions. Default: No filtering by cell name (empty/null string). If allrefs is false (default), only the references that are immediate children of the view cell are dropped ----------------------------------------------------------------------------*/ virtual void Set_drop_refs( const char* cellnameRegularExpressions, const bool allrefs ) = 0; virtual const char* Get_drop_refs() const = 0; virtual bool Get_drop_refs_all() const = 0; /***************************************************************************** Transform the final output. dx,dy is the translation in file-units; angle is in degrees and flipY is reflection about the X-axis. Default: No transformation ----------------------------------------------------------------------------*/ virtual void Set_post_transform( const double dx, const double dy, const double scale, const double angle, const bool flipY ) = 0; virtual double Get_post_translate_x() const = 0; virtual double Get_post_translate_y() const = 0; virtual double Get_post_scale() const = 0; virtual double Get_post_angle() const = 0; virtual bool Get_post_flipY() const = 0; virtual bool Get_post_transform(const double grid) const = 0; /***************************************************************************** Add a prefix and/or suffix to every cellname in the output. Also applies to the top cell unless Get_extracted_name() has been specified in which case, Get_extracted_name() is used ----------------------------------------------------------------------------*/ virtual void Set_cellname_mod(const char* prefix, const char* suffix) = 0; virtual const char* Get_cellname_prefix() const = 0; virtual const char* Get_cellname_suffix() const = 0; }; /******************************************************************************* Interface to a single instance of the extractor *******************************************************************************/ class QisMHExtractor { public: /***************************************************************************** Cast to a pointer of another version in the class hierarchy (base/derived). Get the latest version number. Version numbers start at 1 and are reflected in the class name using the suffix V. E.g V The topmost base class is version 1 (V1 implied). The cast returns NULL if a version number is not recognized/implemented ----------------------------------------------------------------------------*/ virtual const char* QisMHExtractor_name(const int version) const = 0; virtual void* QisMHExtractor_cast(const int version) = 0; virtual const void* QisMHExtractor_cast(const int version) const = 0; virtual int QisMHExtractor_latest_version() const = 0; /***************************************************************************** Get error message/code for the last error condition ----------------------------------------------------------------------------*/ virtual const char* Get_last_error_msg() const = 0; virtual int Get_last_error_code() const = 0; /***************************************************************************** Create an instance of the clipper object from a set of regions ----------------------------------------------------------------------------*/ virtual QisMHExtractClipper_p Create_clipper( const QisMHextractRegions* regions, const char* viewcell, bool& error ) = 0; /*---------------------------------------------------------------------------- PARAMETERS + regions : A set of box, polygon, circular regions to be used for clipping + viewcell : Name of the cell being extracted (for computing complement) + error : If true - Use Get_last_error_msg() or Get_last_error_code() for details ------------------------------------------------------------------------------ RETURN + non-null : Handle to a new clipper object + null : Error. Use Get_last_error_msg() or Get_last_error_code() for details ------------------------------------------------------------------------------ ERROR CODES : One of QisMHExtractError::Create_clipper_codes ------------------------------------------------------------------------------ + MUST be destroyed eventually using Destroy_clipper() *****************************************************************************/ /***************************************************************************** Create an instance of the clipper object from a single box ----------------------------------------------------------------------------*/ virtual QisMHExtractClipper_p Create_box_clipper( const double minx, const double miny, const double maxx, const double maxy, const char* viewcell = 0 ) = 0; /*---------------------------------------------------------------------------- PARAMETERS + viewcell : If used, name of the cell being extracted for computing complement otherwise NULL (no complement) + minx, miny, maxx, maxy : Extents of a box in file-units ------------------------------------------------------------------------------ RETURN + non-null : Handle to a new clipper object + null : Error. Use Get_last_error_msg() or Get_last_error_code() for details ------------------------------------------------------------------------------ ERROR CODES : One of QisMHExtractError::Create_clipper_codes ------------------------------------------------------------------------------ + MUST be destroyed eventually using Destroy_clipper() *****************************************************************************/ /***************************************************************************** Create an instance of the clipper object from a single polygon ----------------------------------------------------------------------------*/ virtual QisMHExtractClipper_p Create_poly_clipper( const double* xy, const int nv, const char* viewcell = 0 ) = 0; /*---------------------------------------------------------------------------- PARAMETERS + xy : List of x,y co-ordinate pairs of the polygonal clipping region + nv : Number of vertices in the polygon (num_int(xy)/2) + viewcell : If used, name of the cell being extracted for computing complement otherwise NULL (no complement) ------------------------------------------------------------------------------ RETURN + non-null : Handle to a new clipper object + null : Error. Use Get_last_error_msg() or Get_last_error_code() for details ------------------------------------------------------------------------------ ERROR CODES : One of QisMHExtractError::Create_clipper_codes ------------------------------------------------------------------------------ + MUST be destroyed eventually using Destroy_clipper() *****************************************************************************/ /***************************************************************************** Create an instance of the clipper object from a single circle ----------------------------------------------------------------------------*/ virtual QisMHExtractClipper_p Create_circ_clipper( const double cx, const double cy, const double radius, const double arcres, const double arcsag, const char* viewcell = 0 ) = 0; /*---------------------------------------------------------------------------- PARAMETERS + viewcell : If used, name of the cell being extracted for computing complement otherwise NULL (no complement) + cx,cy : Center point in file units + radius : Circle radius in file units (>0.0) + arcres : Angle (degrees) subtended by the resulting polygon edge at the center + arcsag : Max. chord-error (default: 0.0) ------------------------------------------------------------------------------ RETURN + non-null : Handle to a new clipper object + null : Error. Use Get_last_error_msg() or Get_last_error_code() for details ------------------------------------------------------------------------------ ERROR CODES : One of QisMHExtractError::Create_clipper_codes ------------------------------------------------------------------------------ + MUST be destroyed eventually using Destroy_clipper() *****************************************************************************/ /***************************************************************************** Destroy an instance of the clipper object ----------------------------------------------------------------------------*/ virtual void Destroy_clipper(QisMHExtractClipper_p handle) = 0; /***************************************************************************** Create/Destroy a GDSII/OASIS file writer as the target for extracted data ----------------------------------------------------------------------------*/ virtual QisMHExtractTarget* Create_file_writer( const char* filePath, const QisMHExtractFlags::FileFormat format, const double fileUnitsInM, const double gridInFileUnits ) = 0; virtual void Destroy_file_writer(QisMHExtractTarget* handle) = 0; /*---------------------------------------------------------------------------- PARAMETERS + filePath : Path of the file to be extracted + format : File format + fileUnitsInM : Eg. 1e-6 for a micron file + gridInFileUnits : Eg. 0.001 for a micron file with nanometer resolution ------------------------------------------------------------------------------ RETURN + non-null : Handle to a file writer to be used as the target for extraction + null : Error. Use Get_last_error_msg() or Get_last_error_code() for details ------------------------------------------------------------------------------ ERROR CODES : One of QisMHExtractError::Create_file_writer_codes ------------------------------------------------------------------------------ + As an alternative to receiving extracted data via callbacks, the client application can chose to write the data to a GDSII/OASIS file using this convinience feature *****************************************************************************/ /***************************************************************************** Perform a single extraction ----------------------------------------------------------------------------*/ virtual bool Extract( const char* cell, const char* layerStr, QisMHExtractClipper_p clipper, const QisMHExtractOpts* opts, QisMHExtractTarget* target, QisMHExtractUpdate* updates = 0 ) = 0; /*---------------------------------------------------------------------------- PARAMETERS + cell : Cell to be extracted (view cell). If null/empty, the deepest top cell in the file is used + layerStr : Comma separated list of layers to be extracted. If null/empty, all layers in the file are candidates for extraction + clipper : Clipping object setup using one of the Create_*clipper() methods. If null, the entire view cell is extracted + opts : Clipping options + target : Receiver of extracted data (either a handler specified by the client application or a file writer created using Create_file_writer()) + updates : Receiver of refresh callbacks while the extraction is in progress ------------------------------------------------------------------------------ RETURN + Success : true + Failure : false. Use Get_last_error_msg() or Get_last_error_code() for details ------------------------------------------------------------------------------ ERROR CODES : One of QisMHExtractError::Extract_codes ------------------------------------------------------------------------------ + The extracted data is sent to the target in the same order as if creating a GDSII/OASIS file : > QisMHExtractTarget::On_extract_begin_cell (first cell definition) > QisMHExtractTarget::{ On_extract_boundary | On_extract_path | On_extract_text | On_extract_sref | On_extract_aref }* > QisMHExtractTarget::On_extract_end_cell ... > QisMHExtractTarget::On_extract_begin_cell (last cell definition) ... > QisMHExtractTarget::On_extract_end_cell *****************************************************************************/ }; #define QISMEXTENSION_HEXTRACT "QisMHExtract ABIv2 2018-6-26" #define QISMCODE_HEXTRACT 11083 /******************************************************************************* Interface to the QisMHExtract extension API *******************************************************************************/ class QisMHExtract: public NsQisMLib::QisMExtensionAPI { public: /***************************************************************************** Cast to a pointer of another version in the class hierarchy (base/derived). Get the latest version number. Version numbers start at 1 and are reflected in the class name using the suffix V. E.g V The topmost base class is version 1 (V1 implied). The cast returns NULL if a version number is not recognized/implemented ----------------------------------------------------------------------------*/ virtual const char* QisMHExtract_name(const int version) const = 0; virtual void* QisMHExtract_cast(const int version) = 0; virtual const void* QisMHExtract_cast(const int version) const = 0; virtual int QisMHExtract_latest_version() const = 0; /***************************************************************************** Get error message/code for the last error condition ----------------------------------------------------------------------------*/ virtual const char* Get_last_error_msg() const = 0; virtual int Get_last_error_code() const = 0; /***************************************************************************** Create an instance of a data object (MUST be eventually destroyed using Delete_object()) ----------------------------------------------------------------------------*/ virtual void* New_object(const char* className) = 0; virtual void Delete_object(const char* className, void* handle) = 0; /*---------------------------------------------------------------------------- PARAMETERS + className : Name of the class whose object is to be created (One of these) * QisMHExtractOpts * QisMHextractRegions + handle : Handle of the object to be destroyed ------------------------------------------------------------------------------ RETURN + Success : non-null handle to the new object. MUST be type-casted appropriately before use + Failure : null. Call Get_last_error_msg() or Get_last_error_code() for more information ------------------------------------------------------------------------------ ERROR CODES : One of QisMHExtractError::New_object_codes ------------------------------------------------------------------------------ + Upon creation, the handle must be type-casted to that exact same class before use *****************************************************************************/ /***************************************************************************** Create an instance of the extractor. Requires 1 license of QISMCODE_HEXTRACT. MUST be eventually destroyed using Destroy_extractor() to release the license and free up the resources ----------------------------------------------------------------------------*/ virtual QisMHExtractor* Create_extractor( NsQisMLib::QisMFile* filedb, const int argC = 0, const char* const* argT = 0, void* const* argV = 0 ) = 0; virtual void Destroy_extractor(QisMHExtractor* handle) = 0; /*---------------------------------------------------------------------------- PARAMETERS + filedb : Handle to a QisMFile object representing the file loaded in QisMLib + argC, argT, argV : Reserved ------------------------------------------------------------------------------ RETURN + Success : non-null handle to a new instance of the extractor + Failure : null. Call Get_last_error_msg() or Get_last_error_code() for more information ------------------------------------------------------------------------------ ERROR CODES : One of QisMHExtractError::Create_extractor_codes *****************************************************************************/ }; } #endif #endif /******************************************************************************* VERSION HISTORY ******************************************************************************** -------------------------------------------------------------------------------- v1.2 (2018-06-26) -------------------------------------------------------------------------------- + Compatible with QisMLib 3.20 (API break) + All overloaded methods replaced because of incompatibilities with non-MSVC built apps. API is not backwards compatible + This extension will not load with earlier versions of QisMLib + API to receive progress updates during extraction (QisMHExtractUpdate) -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- v1.1 (2018-04-09) -------------------------------------------------------------------------------- + Bug-fix: Loading the qismhextract64.so caused a crash because of invalid use of dynamic_cast -------------------------------------------------------------------------------- *******************************************************************************/