x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
ProgressCalculator.hpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\OgreMaxScene\include\ProgressCalculator.hpp
旋转
特效
属性
历史版本
/* * OgreMaxViewer - An Ogre 3D-based viewer for .scene and .mesh files * Copyright 2008 Derek Nedelman * * This code is available under the OgreMax Free License: * -You may use this code for any purpose, commercial or non-commercial. * -If distributing derived works (that use this source code) in binary or source code form, * you must give the following credit in your work's end-user documentation: * "Portions of this work provided by OgreMax (www.ogremax.com)" * * Derek Nedelman assumes no responsibility for any harm caused by using this code. * * OgreMaxViewer was written by Derek Nedelman and released at www.ogremax.com */ #ifndef OgreMax_ProgressCalculator_INCLUDED #define OgreMax_ProgressCalculator_INCLUDED //Includes--------------------------------------------------------------------- #include
#include "OgreMaxPlatform.hpp" //Classes---------------------------------------------------------------------- namespace OgreMax { /** * A hierarchical collection of progress calculators. Having a hierarchy * allows a collection of small events to have their progress tracked separately * and aggregated as a larger event, such as loading a file and all of the * objects in that file. Progress is calculated as a number between 0 and 1, inclusive */ class _OgreMaxExport ProgressCalculator { public: ProgressCalculator(); ProgressCalculator(const Ogre::String& name); virtual ~ProgressCalculator(); /** Gets the name of the calculator. */ const Ogre::String& GetName() const; /** Calculates and returns the total progress, on a scale of 0 to 1. */ Ogre::Real GetProgress(); /** * Manually sets the progress * This will not normally need to be called, but it is useful in circumstances * where there are multiple progress calculators virtually connected, and the * progress of one calculator needs to be input into a separate one elsewhere. * Calling this is pointless if the calculator has child calculators. * @param progress [in] - The total progress, on a scale of 0 to 1 */ void SetProgress(Ogre::Real progress); /** * Updates the progress for this calculator. * Calling this is pointless if the calculator has child calculators. * @param amount [in] - The amount of progress to add. The amount is * in the same units as those passed into SetRange(). The amount may * be positive or negative */ void Update(Ogre::Real amount); /** * Gets the current value range. * Calling this is pointless if the calculator has child calculators. */ Ogre::Real GetRange() const; /** * Sets the value range of this calculator. * Note that calling this method resets the progress to 0. * Also note that calling this is pointless if the calculator has child calculators * @param range [in] - The range is used to scale amounts passed to Update() and, in turn, * calculate the total progress. As an example, if using the calculator * to track the number of objects loaded, SetRange() should be called with * the total number of objects, and Update(1) should be called every * time one object is loaded. */ void SetRange(Ogre::Real range); /** * Creates a child calculator. * @param name [in] - The name of the calculator * @return A child calculator is returned. This calculator should not * be deleted. */ ProgressCalculator* AddCalculator(const Ogre::String& name); protected: /** The name of the calculator. This is provided for the user's benefit. */ Ogre::String name; /** The current progress. */ Ogre::Real progress; /** The range used to scale progress to [0,1]. */ Ogre::Real range; typedef std::list
Calculators; /** Child calculators. */ Calculators childCalculators; }; } #endif
ProgressCalculator.hpp
网页地址
文件地址
上一页
7/8
下一页
下载
( 4 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.