osg中的工厂模式(c++)
来源:互联网 发布:bestv百视通第三方软件 编辑:程序博客网 时间:2024/04/27 04:29
c++中的工厂模式: http://blog.csdn.net/wuzhekai1985
不过在实际应用中,我们往往不需要使用到上文链接中介绍的那么复杂的继承关系,通常一个普通的类就可以解决问题.
osgearth中也使用到了工厂模式:GeometryFactory,很好的解决了圆形,弧形,椭圆,椭圆弧形,矩形的创建.
namespace osgEarth { namespace Symbology{ using namespace osgEarth; /** * Convenience class for building simple tessellated Geometry shapes. */ class OSGEARTHSYMBOLOGY_EXPORT GeometryFactory { public: /** * Constructs the factory. * @param srs The spatial reference in which to create the geometry, or NULL to * create simple localized geometry. */ GeometryFactory( const SpatialReference* srs =0L ); /** dtor */ virtual ~GeometryFactory() { } /** * Creates a circle geometry. * @param center Center point (must be in map SRS if a map was provided in ctor) * @param radius Circle radius * @param numSegments Number of circumference segments, or zero to automatically calculate it * @param geomToUse Use this geometry instead of creating a Polygon. */ Geometry* createCircle( const osg::Vec3d& center, const Distance& radius, unsigned numSegments =0, Geometry* geomToUse =0L) const; /** * Creates an arc geometry. * @param center Center point (must be in map SRS if a map was provided in ctor) * @param radius Arc radius * @param start Starting angle of the arc * @param end Ending angle of the arc * @param numSegments Number of circumference segments, or zero to automatically calculate it * @param pie Indicates to create a pie shape rather than an arc. */ Geometry* createArc( const osg::Vec3d& center, const Distance& radius, const Angle& startAngle, const Angle& endAngle, unsigned numSegments =0, Geometry* geomToUse =0L, bool pie = false) const; /** * Creates a ellipse geometry. * @param center Center point (must be in map SRS if a map was provided in ctor) * @param radiusMajor Major radius (X-axis) length * @param radiusMinor Minor radius (Y-axis) length * @param rotationAngle with respect to the X-axis * @param numSegments Number of circumference segments, or zero to automatically calculate it * @param geomToUse Use this geometry instead of creating a Polygon. */ Geometry* createEllipse( const osg::Vec3d& center, const Distance& radiusMajor, const Distance& radiusMinor, const Angle& rotationAngle, unsigned numSegments =0, Geometry* geomToUse =0L) const; /** * Creates a ellipse geometry. * @param center Center point (must be in map SRS if a map was provided in ctor) * @param radiusMajor Major radius (X-axis) length * @param radiusMinor Minor radius (Y-axis) length * @param rotationAngle with respect to the X-axis * @param start Starting angle of the arc * @param end Ending angle of the arc * @param numSegments Number of circumference segments, or zero to automatically calculate it * @param geomToUse Use this geometry instead of creating a Polygon. * @param pie Indicates to create a pie shape rather than an arc. */ Geometry* createEllipticalArc( const osg::Vec3d& center, const Distance& radiusMajor, const Distance& radiusMinor, const Angle& rotationAngle, const Angle& startAngle, const Angle& endAngle, unsigned numSegments =0, Geometry* geomToUse =0L, bool pie = false) const; /** * Creates a rectangle geometry * @param center Center point (must be in map SRS if the map was provided in ctor) * @param width The width of the rectangle * @param height The height of the rectangle */ Geometry* createRectangle( const osg::Vec3d& center, const Distance& width, const Distance& height ) const; protected: osg::ref_ptr<const SpatialReference> _srs; };} }
0 0
- osg中的工厂模式(c++)
- osg中的访问器模式
- 工厂模式-C-工厂方法
- Delphi中的工厂模式
- Java中的工厂模式
- java中的工厂模式
- java中的工厂模式
- java中的工厂模式
- java中的工厂模式
- Android中的工厂模式
- 工厂模式中的反射
- java中的工厂模式
- Javascript中的工厂模式
- Android 中的工厂模式
- JS中的工厂模式
- java中的工厂模式
- Java中的工厂模式
- 工厂模式(c++)
- html文件格式
- 十进制转换为二进制
- maven学习---开发环境的配置
- Android studio解决工程编译超过65535报错的方法
- nyoj 623 A*B Problem II
- osg中的工厂模式(c++)
- 接口测试初识
- OkHttp
- Matlab代码实现SOM(自组织映射)算法
- 利用jQuery-file-upload在MVC中实现上传文件(未完成)
- 【Tiny4412】 Tiny4412开发环境搭建
- Android关于分包方案、插件化动态加载APK或DEX 以及热补丁资料总结
- Linux 目录体系
- MySQL show的实际操作用法