Ignore:
Timestamp:
Apr 18, 2012, 10:04:27 PM (12 years ago)
Author:
Torben Dannhauer
Message:
 
Location:
experimental/distortionNG
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • experimental/distortionNG/DistortionSet.cpp

    r344 r345  
    4040        ADD_INT_SERIALIZER( DistortionMeshColumns, 1 ); //int _distortionMeshColumns;
    4141
    42         // Missing serializer macro for PrimitiveMeshType
    43         //osg::PrimitiveSet::Mode _MeshType
     42    ADD_GLENUM_SERIALIZER( MeshType, GLenum, GL_QUAD_STRIP );  //osg::PrimitiveSet::Mode _MeshType
    4443       
    45         ADD_IMAGE_SERIALIZER( IntensityMap, osg::Image, NULL );  // _image      //osg::ref_ptr<osg::Image> _intensityMap;
     44        ADD_IMAGE_SERIALIZER( IntensityMap, osg::Image, NULL );  //osg::ref_ptr<osg::Image> _intensityMap;
    4645
    4746        ADD_UINT_SERIALIZER( TexUnitScene, 0 ); //unsigned int _texUnitScene;
  • experimental/distortionNG/DistortionSet.h

    r344 r345  
    2121#include <osg/Image>
    2222#include <osg/Matrixd>
    23 #include <osg/PrimitiveSet>
    2423
    2524namespace osgViewer {
     
    4443
    4544        void setDistortionMeshRows(int distortionMeshRows)              { _distortionMeshRows = distortionMeshRows; }
    46         int getDistortionMeshRows() const       { return(_distortionMeshRows); }
     45        int getDistortionMeshRows() const       { return _distortionMeshRows; }
    4746
    4847        void setDistortionMeshColumns(int distortionMeshColumns)                { _distortionMeshColumns = distortionMeshColumns; }
    49         int getDistortionMeshColumns() const    { return(_distortionMeshColumns); }
     48        int getDistortionMeshColumns() const    { return _distortionMeshColumns; }
     49
     50        void setMeshType(GLenum meshType) { _meshType = meshType; }
     51    inline GLenum getMeshType() const { return _meshType; }
    5052
    5153        void setIntensityMap(osg::Image* intensityMap)          { _intensityMap = intensityMap; }
    52         const osg::Image* getIntensityMap() const       { return(_intensityMap); }
     54        const osg::Image* getIntensityMap() const       { return _intensityMap; }
    5355
    5456        void setTexUnitScene(unsigned int texUnitScene)         { _texUnitScene = texUnitScene; }
    55         unsigned int getTexUnitScene() const    { return(_texUnitScene); }
     57        unsigned int getTexUnitScene() const    { return _texUnitScene; }
    5658
    5759        void setTexUnitIntensityMap(unsigned int texUnitIntensityMap)   { _texUnitIntensityMap = texUnitIntensityMap; }
    58         unsigned int getTexUnitIntensityMap() const     { return(_texUnitIntensityMap); }
     60        unsigned int getTexUnitIntensityMap() const     { return _texUnitIntensityMap; }
    5961
    6062        void setViewOffset(const osg::Matrixd& viewOffset)      { _viewOffset = viewOffset; }
    61         const osg::Matrixd& getViewOffset() const       { return(_viewOffset); }
     63        const osg::Matrixd& getViewOffset() const       { return _viewOffset; }
    6264
    6365        void setProjectionOffset(const osg::Matrixd& projectionOffset)          { _projectionOffset = projectionOffset; }
    64         const osg::Matrixd& getProjectionOffset() const { return(_projectionOffset); }
     66        const osg::Matrixd& getProjectionOffset() const { return _projectionOffset; }
    6567
    6668private:
    6769        int _distortionMeshRows;
    6870        int _distortionMeshColumns;
    69         //osg::PrimitiveSet::Mode _MeshType
     71        GLenum _meshType;
    7072       
    7173        osg::ref_ptr<osg::Image> _intensityMap;
  • experimental/distortionNG/extViewer.cpp

    r342 r345  
    2323    arguments.getApplicationUsage()->addCommandLineOption("--distort","load distortion file and set up geometrical distortion for viewer. This includes blending");
    2424    arguments.getApplicationUsage()->addCommandLineOption("--blend","Set up viewer vor simple blending CullDrawThreadPerContext threading model for viewer.");
     25
     26        osgDB::Registry::instance()->addFileExtensionAlias("dist", "osgt");
    2527}
    2628
     
    153155        for ( unsigned int row=0; row<rows-1; row++ )   // each strip consists of two affected vertex rows, so we need only row-1 strips.
    154156        {
    155                 osg::ref_ptr<osg::DrawElementsUInt> de = new osg::DrawElementsUInt(GL_QUAD_STRIP, columns*2);   // columns*2 = number of involved vertices for this strip.
     157                osg::ref_ptr<osg::DrawElementsUInt> de = new osg::DrawElementsUInt(osg::PrimitiveSet::QUAD_STRIP, columns*2);   // columns*2 = number of involved vertices for this strip.
    156158                for ( unsigned int col=0; col<columns; col++ )
    157159                {
  • experimental/distortionNG/main.cpp

    r343 r345  
    143143 * modul                                                                Funktionen / Description
    144144 *
    145  * plugin .dist                                                 load / Save distContainers                                      loads and saves via serializers the distortion container from/to file.
     145 * [postponed] plugin .dist                             load / Save distContainers                                      loads and saves via serializers the distortion container from/to file. Can potentially be replaced by a simple extension alias to osgt|b|x
    146146 *
    147147 *
    148  * Distortion Container                                 Beinhaltet die folgenden Distortion Details:
     148 * [done] Distortion Container                                  Beinhaltet die folgenden Distortion Details:
    149149 *                                                                              - Blendmap (osgImage)
    150150 *                                                                              - Mesh Dimensions (rows, columns)
    151  *                                                                              - Mesh Type (osg::PrimitiveSet::QUAD_STRIP, ...)
     151 *                                                                              - Mesh Type (GLenum QUAD_STRIP, ...)
    152152 *                                                                              - textureUnit for Scene RTT (z.B.: 0)
    153153 *                                                                              - textureUnit for blendmap (z.B.: 1)
Note: See TracChangeset for help on using the changeset viewer.