Changeset 145


Ignore:
Timestamp:
Nov 1, 2010, 7:23:10 PM (14 years ago)
Author:
Torben Dannhauer
Message:
 
Location:
osgVisual
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • osgVisual/include/distortion/visual_distortion.h

    r88 r145  
    6060         *
    6161         */
    62         visual_distortion(osgViewer::Viewer* viewer_, osg::ArgumentParser& arguments_);
     62        visual_distortion(osgViewer::Viewer* viewer_, osg::ArgumentParser& arguments_, std::string configFileName);
    6363
    6464        /**
  • osgVisual/include/sky_Silverlining/visual_skySilverLining.h

    r144 r145  
    6464         *
    6565         * @param viewer_ : Pointer to the applications viewer
     66         * @param configFileName : Filename of the XML configfile to read the configuration from. Currently not used because skySilverlining currently does not need any configuration parameters.
    6667         */
    6768        visual_skySilverLining(osgViewer::Viewer* viewer_, std::string configFileName);
  • osgVisual/include/util/visual_util.h

    r144 r145  
    220220        static bool setTransparentWindowBackground(osgViewer::Viewer* viewer_);
    221221
    222         // Parses for the XML node of the specified module. The caller has to clean up if ret_value!=NULL, otherwise this function cleans up.
    223         // nötige cleanup-Schritte:       xmlFreeDoc(doc); xmlCleanupParser();
     222        /**
     223         * \brief  Parses for the XML node of the specified module.The caller has to clean up the xmlDoc and the parser, beside it returns NULL because the queried modules is not configured.
     224         *
     225         * To clean up, call this two functions:
     226         *  xmlFreeDoc(doc);
     227         *  xmlCleanupParser();
     228         *
     229         * Example to use this function:
     230         *      xmlDoc* tmpDoc;
     231         *  xmlNode* yourNode = util::getModuleXMLConfig( configFilename, "core", tmpDoc );
     232         *  // use yourNode
     233         *  if(tmpDoc)
     234         *  {
     235         *     xmlFreeDoc(tmpDoc); xmlCleanupParser();
     236         *  }
     237         *
     238         * @param configFilename : Config Filename to parse.
     239         * @param moduleName : Module name to search for.
     240         * @param doc : xmlDoc to use. Must be created outside that the caller can clean it up.
     241         * @return : NULL on error, otherwise pointer to the xmlNode of the queried module.
     242         */
    224243        static xmlNode* getModuleXMLConfig(std::string configFilename, std::string moduleName, xmlDoc*& doc);
    225244
    226245private:
     246        /**
     247         * \brief This functions checks a list of nodes and all of its children for the specified module configuration.
     248         *
     249         * This function is used by getModuleXMLConfig() and works recursive
     250         *
     251         * @param node : Node to search in
     252         * @param moduleName :Module name to search for.
     253         * @return : NULL if the module configuration was not found, otherwise pointer to the XML Node with the configuration for the specified module.
     254         */
    227255        static xmlNode* checkXMLNodeChildrenForModule(xmlNode* node, std::string moduleName);
    228256};
  • osgVisual/src/distortion/visual_distortion.cpp

    r88 r145  
    1919using namespace osgVisual;
    2020
    21 visual_distortion::visual_distortion(osgViewer::Viewer* viewer_, osg::ArgumentParser& arguments_) : viewer(viewer_), arguments(arguments_)
     21visual_distortion::visual_distortion(osgViewer::Viewer* viewer_, osg::ArgumentParser& arguments_, std::string configFileName) : viewer(viewer_), arguments(arguments_)
    2222{
    2323        OSG_NOTIFY (osg::ALWAYS ) << "visual_distortion instantiated." << std::endl;
     
    4141bool visual_distortion::processCommandlineparameters()
    4242{
     43        // Distortion files.
    4344        arguments.getApplicationUsage()->addCommandLineOption("-C <channelname>","Setup the channel name, this is the preset for blendmap, distortionmap and camera configuration file.");
     45    arguments.getApplicationUsage()->addCommandLineOption("--distortionmap","Set a distortion map file name.");
     46    arguments.getApplicationUsage()->addCommandLineOption("--blendmap","Set a blend map file name.");
     47
     48        // Render implementation.
     49        arguments.getApplicationUsage()->addCommandLineOption("--shaderDistortion","Use OpenGL shader for distortion and blending.");
    4450        arguments.getApplicationUsage()->addCommandLineOption("--fbo","Use Frame Buffer Object for render to texture, where supported.");
    4551    arguments.getApplicationUsage()->addCommandLineOption("--fb","Use FrameBuffer for render to texture.");
    4652    arguments.getApplicationUsage()->addCommandLineOption("--pbuffer","Use Pixel Buffer for render to texture, where supported.");
    4753    arguments.getApplicationUsage()->addCommandLineOption("--window","Use a seperate Window for render to texture.");
    48     arguments.getApplicationUsage()->addCommandLineOption("--width","Set the width of the render to texture.");
    49     arguments.getApplicationUsage()->addCommandLineOption("--height","Set the height of the render to texture.");
     54
     55        // Texture
     56    arguments.getApplicationUsage()->addCommandLineOption("--width","Set the width of the render to texture.");         // used for all render implementations
     57    arguments.getApplicationUsage()->addCommandLineOption("--height","Set the height of the render to texture.");       // used for all render implementations
     58
     59        // Texture Rectangle?
    5060    arguments.getApplicationUsage()->addCommandLineOption("--texture-rectangle","Use osg::TextureRectangle for doing the render to texure to.");
    51     arguments.getApplicationUsage()->addCommandLineOption("--distortionmap","Set a distortion map file name.");
    52     arguments.getApplicationUsage()->addCommandLineOption("--blendmap","Set a blend map file name.");
    53     arguments.getApplicationUsage()->addCommandLineOption("--shaderDistortion","Use OpenGL shader for distortion and blending.");
     61
     62        // HDR?
     63    arguments.getApplicationUsage()->addCommandLineOption("--hdr","Render distortion as HDR.");
     64
    5465        arguments.getApplicationUsage()->addKeyboardMouseBinding("d", "Toggle Distortion.");
    5566
     
    162173{
    163174        // Copy Main Camera's matrixes to the PRE_RENDER Camera.
    164         std::cout << "distortion updatecallback" << std::endl;
     175        //std::cout << "distortion updatecallback" << std::endl;
    165176        sceneCamera->setViewMatrix( viewer->getCamera()->getViewMatrix() );
    166177        sceneCamera->setProjectionMatrix( viewer->getCamera()->getProjectionMatrix() );
     
    345356        camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
    346357        camera->setViewMatrix(osg::Matrix::identity());
    347         //camera->setProjectionMatrixAsOrtho2D(0,viewer->getCamera()->getViewport()->width(),0,viewer->getCamera()->getViewport()->height());
     358        //sceneCamera->setProjectionMatrixAsOrtho2D(0,viewer->getCamera()->getViewport()->width(),0,viewer->getCamera()->getViewport()->height());
    348359                camera->setProjectionMatrixAsOrtho2D(0,1280,0,1024);
     360                /** \todo: use screen size dynamically */
    349361
    350362        // set the camera to render before the main camera.
  • osgVisual/src/vista2D/visual_vista2D.cpp

    r31 r145  
    6666   // matrix. Positions described under this node will equate to
    6767   // pixel coordinates.
    68    vista2DProjectionMatrix->setMatrix(osg::Matrix::ortho2D(0,1600,0,900));
     68   vista2DProjectionMatrix->setMatrix(osg::Matrix::ortho2D(0,1600,0,900)); /** todo: use screen size dynamically. */
    6969 
    7070   // For the HUD model view matrix use an identity matrix:
Note: See TracChangeset for help on using the changeset viewer.