Shinya Kitaoka 810553
#pragma once
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef MESHUTILS_H
Toshihiro Shimizu 890ddd
#define MESHUTILS_H
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#undef DVAPI
Toshihiro Shimizu 890ddd
#undef DVVAR
Toshihiro Shimizu 890ddd
#ifdef TNZEXT_EXPORTS
Toshihiro Shimizu 890ddd
#define DVAPI DV_EXPORT_API
Toshihiro Shimizu 890ddd
#define DVVAR DV_EXPORT_VAR
Toshihiro Shimizu 890ddd
#else
Toshihiro Shimizu 890ddd
#define DVAPI DV_IMPORT_API
Toshihiro Shimizu 890ddd
#define DVVAR DV_IMPORT_VAR
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=======================================================================
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//    Forward Declarations
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TMeshImageP;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
struct DrawableTextureData;
Toshihiro Shimizu 890ddd
struct PlasticDeformerDataGroup;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=======================================================================
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//********************************************************************************************
Toshihiro Shimizu 890ddd
//    Mesh Image Utility  functions
Toshihiro Shimizu 890ddd
//********************************************************************************************
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*!
Toshihiro Shimizu 890ddd
  \brief    Transforms a mesh image by the specified affine transform.
Toshihiro Shimizu 890ddd
*/
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
DVAPI void transform(
Shinya Kitaoka 120a6e
    const TMeshImageP &image,  //!< Mesh image to be transformed.
Shinya Kitaoka 120a6e
    const TAffine &aff  //!< Affine transform to be applied on the input image.
Shinya Kitaoka 120a6e
    );
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//---------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*!
Toshihiro Shimizu 890ddd
  \brief    Draws the edges of the input meshImage on current OpenGL context.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
  \remark   This function accepts input data associated to a deformation of
Toshihiro Shimizu 890ddd
            the mesh image to be drawn. See PlasticDeformerStorage for details.
Toshihiro Shimizu 890ddd
*/
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
DVAPI void tglDrawEdges(
Shinya Kitaoka 120a6e
    const TMeshImage &image,  //!< Input mesh image whose edges will be drawn.
Shinya Kitaoka 120a6e
    const PlasticDeformerDataGroup *deformerDatas =
Shinya Kitaoka 120a6e
        0  //!< Optional data about a deformation of the input image.
Shinya Kitaoka 120a6e
    );
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//---------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*!
Toshihiro Shimizu 890ddd
  \brief    Draws the faces of the input meshImage on current OpenGL context.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
  \remark   This function accepts input data associated to a deformation of
Toshihiro Shimizu 890ddd
            the mesh image to be drawn. See PlasticDeformerStorage for details.
Toshihiro Shimizu 890ddd
*/
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
DVAPI void tglDrawFaces(
Shinya Kitaoka 120a6e
    const TMeshImage &image,  //!< Input mesh image whose faces will be drawn.
Shinya Kitaoka 120a6e
    const PlasticDeformerDataGroup *deformerDatas =
Shinya Kitaoka 120a6e
        0  //!< Optional data about a deformation of the input image.
Shinya Kitaoka 120a6e
    );
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//---------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*!
Shinya Kitaoka 120a6e
  \brief    Draws the stacking order information of the input mesh
Shinya Kitaoka 120a6e
  image's
Toshihiro Shimizu 890ddd
            faces, on current OpenGL context.
Toshihiro Shimizu 890ddd
*/
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
DVAPI void tglDrawSO(
Shinya Kitaoka 120a6e
    const TMeshImage &image,  //!< Input mesh image whose SO will be drawn.
Shinya Kitaoka 120a6e
    double minColor[4],  //!< RGBM color quadruple (in [0, 1]) corresponding to
Shinya Kitaoka 38fd86
                         //! the lowest SO value.
Shinya Kitaoka 120a6e
    double maxColor[4],  //!< RGBM color quadruple corresponding to the highest
Shinya Kitaoka 38fd86
                         //! SO value.
Shinya Kitaoka 120a6e
    const PlasticDeformerDataGroup *deformerDatas =
Shinya Kitaoka 120a6e
        0,  //!< Deformation data structure containing SO data.
Shinya Kitaoka 120a6e
    bool deformedDomain =
Shinya Kitaoka 120a6e
        false  //!< Whether the image data must be drawn \a deformed
Shinya Kitaoka 120a6e
               //!  by the specified deformerDatas, or not.
Shinya Kitaoka 120a6e
    );
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//---------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*!
Toshihiro Shimizu 890ddd
  \brief    Draws the \a rigidity information of the input mesh image's
Toshihiro Shimizu 890ddd
            faces, on current OpenGL context.
Toshihiro Shimizu 890ddd
*/
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
DVAPI void tglDrawRigidity(
Shinya Kitaoka 120a6e
    const TMeshImage
Shinya Kitaoka 120a6e
        &image,          //!< Input mesh image whose rigidity will be drawn.
Shinya Kitaoka 120a6e
    double minColor[4],  //!< RGBM color quadruple (in [0, 1]) corresponding to
Shinya Kitaoka 38fd86
                         //! the lowest rigidity value.
Shinya Kitaoka 120a6e
    double maxColor[4],  //!< RGBM color quadruple corresponding to the highest
Shinya Kitaoka 38fd86
                         //! rigidity value.
Shinya Kitaoka 120a6e
    const PlasticDeformerDataGroup *deformerDatas =
Shinya Kitaoka 120a6e
        0,  //!< Data structure of an optional deformation of the input image.
Shinya Kitaoka 120a6e
    bool deformedDomain =
Shinya Kitaoka 120a6e
        false  //!< Whether the image data must be drawn \a deformed
Shinya Kitaoka 120a6e
               //!  by the specified deformerDatas, or not.
Shinya Kitaoka 120a6e
    );
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//---------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*!
Toshihiro Shimizu 890ddd
  \brief    Draws a texturized mesh image on current OpenGL context.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
  \remark   The input textures are assumed to be \a nonpremultiplied,
Toshihiro Shimizu 890ddd
            while the drawn image will be \a premultiplied.
Toshihiro Shimizu 890ddd
*/
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
DVAPI void tglDraw(
Shinya Kitaoka 120a6e
    const TMeshImage &image,  //!< Mesh image to be drawn.
Shinya Kitaoka 120a6e
    const DrawableTextureData
Shinya Kitaoka 120a6e
        &texData,  //!< Textures data to use for texturing.
Shinya Kitaoka 120a6e
    const TAffine
Shinya Kitaoka 120a6e
        &meshToTexAffine,  //!< Transform from mesh to texture coordinates.
Shinya Kitaoka 120a6e
    const PlasticDeformerDataGroup
Shinya Kitaoka 120a6e
        &deformerDatas  //!< Data structure of a deformation of the input image.
Shinya Kitaoka 120a6e
    );
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
#endif  // MESHUTILS_H