Changeset 345 for experimental/distortionNG
- Timestamp:
- Apr 18, 2012, 10:04:27 PM (13 years ago)
- Location:
- experimental/distortionNG
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
experimental/distortionNG/DistortionSet.cpp
r344 r345 40 40 ADD_INT_SERIALIZER( DistortionMeshColumns, 1 ); //int _distortionMeshColumns; 41 41 42 // Missing serializer macro for PrimitiveMeshType 43 //osg::PrimitiveSet::Mode _MeshType 42 ADD_GLENUM_SERIALIZER( MeshType, GLenum, GL_QUAD_STRIP ); //osg::PrimitiveSet::Mode _MeshType 44 43 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; 46 45 47 46 ADD_UINT_SERIALIZER( TexUnitScene, 0 ); //unsigned int _texUnitScene; -
experimental/distortionNG/DistortionSet.h
r344 r345 21 21 #include <osg/Image> 22 22 #include <osg/Matrixd> 23 #include <osg/PrimitiveSet>24 23 25 24 namespace osgViewer { … … 44 43 45 44 void setDistortionMeshRows(int distortionMeshRows) { _distortionMeshRows = distortionMeshRows; } 46 int getDistortionMeshRows() const { return (_distortionMeshRows); }45 int getDistortionMeshRows() const { return _distortionMeshRows; } 47 46 48 47 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; } 50 52 51 53 void setIntensityMap(osg::Image* intensityMap) { _intensityMap = intensityMap; } 52 const osg::Image* getIntensityMap() const { return (_intensityMap); }54 const osg::Image* getIntensityMap() const { return _intensityMap; } 53 55 54 56 void setTexUnitScene(unsigned int texUnitScene) { _texUnitScene = texUnitScene; } 55 unsigned int getTexUnitScene() const { return (_texUnitScene); }57 unsigned int getTexUnitScene() const { return _texUnitScene; } 56 58 57 59 void setTexUnitIntensityMap(unsigned int texUnitIntensityMap) { _texUnitIntensityMap = texUnitIntensityMap; } 58 unsigned int getTexUnitIntensityMap() const { return (_texUnitIntensityMap); }60 unsigned int getTexUnitIntensityMap() const { return _texUnitIntensityMap; } 59 61 60 62 void setViewOffset(const osg::Matrixd& viewOffset) { _viewOffset = viewOffset; } 61 const osg::Matrixd& getViewOffset() const { return (_viewOffset); }63 const osg::Matrixd& getViewOffset() const { return _viewOffset; } 62 64 63 65 void setProjectionOffset(const osg::Matrixd& projectionOffset) { _projectionOffset = projectionOffset; } 64 const osg::Matrixd& getProjectionOffset() const { return (_projectionOffset); }66 const osg::Matrixd& getProjectionOffset() const { return _projectionOffset; } 65 67 66 68 private: 67 69 int _distortionMeshRows; 68 70 int _distortionMeshColumns; 69 //osg::PrimitiveSet::Mode _MeshType71 GLenum _meshType; 70 72 71 73 osg::ref_ptr<osg::Image> _intensityMap; -
experimental/distortionNG/extViewer.cpp
r342 r345 23 23 arguments.getApplicationUsage()->addCommandLineOption("--distort","load distortion file and set up geometrical distortion for viewer. This includes blending"); 24 24 arguments.getApplicationUsage()->addCommandLineOption("--blend","Set up viewer vor simple blending CullDrawThreadPerContext threading model for viewer."); 25 26 osgDB::Registry::instance()->addFileExtensionAlias("dist", "osgt"); 25 27 } 26 28 … … 153 155 for ( unsigned int row=0; row<rows-1; row++ ) // each strip consists of two affected vertex rows, so we need only row-1 strips. 154 156 { 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. 156 158 for ( unsigned int col=0; col<columns; col++ ) 157 159 { -
experimental/distortionNG/main.cpp
r343 r345 143 143 * modul Funktionen / Description 144 144 * 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 146 146 * 147 147 * 148 * Distortion Container Beinhaltet die folgenden Distortion Details:148 * [done] Distortion Container Beinhaltet die folgenden Distortion Details: 149 149 * - Blendmap (osgImage) 150 150 * - Mesh Dimensions (rows, columns) 151 * - Mesh Type ( osg::PrimitiveSet::QUAD_STRIP, ...)151 * - Mesh Type (GLenum QUAD_STRIP, ...) 152 152 * - textureUnit for Scene RTT (z.B.: 0) 153 153 * - textureUnit for blendmap (z.B.: 1)
Note: See TracChangeset
for help on using the changeset viewer.