#ifndef _EXPORTER_H_ #define _EXPORTER_H_ #include namespace projection { /** * Projection settings export class. */ class Exporter { public: /** * Constructor. * * @param pModel Projection model. */ Exporter(ProjectionModel* pModel); /** * Destructor. */ virtual ~Exporter(); /** * Enable or disable soft edge blending. * * @param bSoftEdge True if soft edge blending is enabled. */ void setSoftEdge(bool bSoftEdgeBlend); /** * Check whether sof edge blending is enabled or not. * * @return True if soft edge blending is enabled. */ bool getSoftEdge() const { return m_bSoftEdge; } /** * Set width of the soft edge blending. * * @param blendWidth Width of the soft edge blending. */ void setBlendEdgeWidth(int blendEdgeWidth); /** * Retrieve width of the soft edge blending. * * @return Width of the soft edge blending. */ int getBlendEdgeWidth() const { return m_blendEdgeWidth; } /** * Set gamma curve of blend map edge. * * @param gamma Curve exponent of blend map edge. */ void setBlendEdgeExponent(float blendEdgeExponent); /** * Retrieve curve exponent of blend map edge. * * @return Curve exponent of blend map edge. */ float getBlendEdgeExponent() const { return m_blendEdgeExponent; } /** * Set width of distortion map to export. * * @param width Width of distortion map to export. */ void setExportWidth(int exportWidth); /** * Retrieve width of distortion map to export. * * @return Width of distortion map to export. */ int getExportWidth() const { return m_exportWidth; } /** * Set height of distortion map to export. * * @param height Height of distortion map to export. */ void setExportHeight(int exportHeight); /** * Retrieve height of distortion map to export. * * @return Height of distortion map to export. */ int getExportHeight() const { return m_exportHeight; } /** * Set file name pattern of distortion map file. * * @param pattern File name pattern of distortion map file. */ void setDistortMapFileNamePattern(const QString& pattern) { m_distortMapFileNamePattern = pattern; } /** * Retrieve file name pattern of distortion map file. * * @return File name pattern of distortion map file. */ QString getDistortMapFileNamePattern() const { return m_distortMapFileNamePattern; } /** * Set file name pattern of blend map file. * * @param pattern File name pattern of blend map file. */ void setBlendMapFileNamePattern(const QString& pattern) { m_blendMapFileNamePattern = pattern; } /** * Retrieve file name pattern of blend map file. * * @return File name pattern of blend map file. */ QString getBlendMapFileNamePattern() const { return m_blendMapFileNamePattern; } /** * Set file name pattern of rendering matrix file. * * @param pattern File name pattern of view matrix file. */ void setViewMatrixFileNamePattern(const QString& pattern) { m_viewMatrixFileNamePattern = pattern; } /** * Retrieve file name pattern of view matrix file. * * @return File name pattern of view matrix file. */ QString getViewMatrixFileNamePattern() const { return m_viewMatrixFileNamePattern; } /** * Export projection settings to file. * * @param fileName File name of the projection settings. * @return True if successfully exported. */ bool exportDataset(const QString& fileName); /** * Create a color encoded coordinate texture and retrieve its texture object index. * * @return Texture object index of the encoded coordinate texture. */ unsigned int getTexCoordColorTexture(); /** * Create a color encoded coordinate texture (green and blue channel) and retrieve its texture object index. * * @return Texture object index of the encoded coordinate texture (red channel). */ unsigned int getTexCoordColorRTexture(); /** * Create an edge blending texture and retrieve its texture object index. * * @return Texture object index of the edge blending texture. */ unsigned int getBlendingAreaTexture(); /** * Restore the export settings from XML data. * * @param element Parent XML element of the export settings data. */ bool initFromDOMElement(const QDomElement& element); /** * Store the current export settings as XML data. * * @param name XML node name of the data. * @param doc XML document to store the data. * @return Current export settings data as XML data. */ QDomElement domElement(const QString& name, QDomDocument& doc) const; protected: bool m_bSoftEdge; //!< True if soft edge blending is enabled. int m_blendEdgeWidth; //!< Width of the soft edge blending. float m_blendEdgeExponent; //!< Curve exponent of blend map edge. int m_exportWidth; //!< Width of distortion map to export. int m_exportHeight; //!< Height of distortion map to export. QString m_distortMapFileNamePattern; //!< File name pattern of distortion map file. QString m_blendMapFileNamePattern; //!< File name pattern of blend map file. QString m_viewMatrixFileNamePattern; //!< File name pattern of view matrix file. unsigned int m_texCoordColorTexIndex; //!< Texture object index of the encoded coordinate texture (green and blue channels). unsigned int m_texCoordColorRTexIndex; //!< Texture object index of the encoded coordinate texture (red channel). unsigned int m_blendAreaTexIndex; //!< Texture object index of the edge blending texture. ProjectionModel* m_pModel; //!< Projection model. }; }; // projection #endif // _EXPORTER_H_