Ignore:
Timestamp:
Aug 13, 2012, 8:36:29 PM (12 years ago)
Author:
Torben Dannhauer
Message:

New Distortion setup strategy added: distortionNG can now handle configuration files of "Projection Designer"

File:
1 edited

Legend:

Unmodified
Added
Removed
  • experimental/distortionNG/DistortionSetupStrategyProjectionDesigner.h

    r406 r410  
    1919#pragma once
    2020
     21#include <osgDB/FileUtils>
     22#include <osg/Texture2D>
     23
    2124#include "DistortionSetupStrategy.h"
     25
     26/**
     27 * \brief This class parses the Projection Dsigner specific configuration files.
     28 *
     29 * @author Torben Dannhauer
     30 * @date  Aug 2012
     31 */
     32class CameraConfigParser : public osg::Referenced
     33{
     34public:
     35        CameraConfigParser();
     36        virtual ~CameraConfigParser() {};
     37
     38        bool parseConfigFile(const char * filename);
     39
     40        bool extractFrustum(std::string data_);
     41        bool extractRotation(std::string data_);
     42        bool extractTranslation(std::string data_);
     43
     44        std::vector<double> getFrustumDataset() {return(frustumValues);}       
     45        std::vector<double> getRotationDataset() {return(rotationValues);}
     46        std::vector<double> getTranslationDataset() {return(translationValues);}
     47        bool isConfigParsed() {return configParsed;};
     48
     49private:
     50        bool configParsed;
     51        std::vector<double> frustumValues;
     52        std::vector<double> rotationValues;
     53        std::vector<double> translationValues;
     54};
    2255
    2356
    2457/**
    25  * \brief "Project Syntropy" Setup Strategy reads setup files of http://www.project-syntropy.de/ and configures the distortion accordingly.
     58 * \brief "Projection Designer" Setup Strategy reads setup files of Projection Designer and configures the distortion accordingly.
    2659 *
    27  * @author Torben Dannhauer
     60 * @author Torben Dannhauer, Ludwig Friedmann
    2861 * @date  Aug 2012
    2962 */
     
    3568        ~DistortionSetupStrategyProjectionDesigner();
    3669        void delegateDistortionSetup(osgViewer::DistortionSet* distortionSet);
     70        void setDistortionInputFiles(std::string distortionFile, std::string blendmapFile, std::string frustumFile);
     71
     72        std::vector<double> getFrustumDataset() {return parser->getFrustumDataset();};
     73       
     74        std::vector<double> getRotationDataset() {return parser->getRotationDataset();};
     75
     76        std::vector<double> getTranslationDataset() {return parser->getTranslationDataset();};
     77
    3778private:
    3879        bool _distortionInitialized;                            //Is Distortion already initialized?
     80        std::string _blendmapFilename;
     81        std::string _frustumFilename;
     82        std::string _distortionFilename;
    3983
     84
     85
     86        osg::Texture* loadTexture( const std::string& fileName );
     87
     88        osg::ref_ptr<CameraConfigParser> parser;
     89        osg::ref_ptr<osg::Texture> distortMapTexture;
    4090};
     91
     92
     93
Note: See TracChangeset for help on using the changeset viewer.