com.supermap.data

类 GeoParticle

  • 所有已实现的接口:
    IDisposable


    public class GeoParticle
    extends Geometry3D
    三维粒子几何对象类。

    该类主要用于构造三维粒子几何对象,返回或设置三维粒子几何对象的资源文件路径、粒子效果类型及其持有的粒子系统对象等。

    SuperMap Realspace 产品对传统的粒子系统进行了调整,每个三维粒子几何对象均由一个或若干粒子系统对象的共同作用来表现,三维粒子几何对象的结构如下图所示:

    从上图可知,三维粒子几何对象中包含若干粒子系统对象,每个粒子系统对象均包含:一个或多个粒子发射器和粒子影响器,其中粒子发射器用于控制发射出来粒子的速度、方向等;粒子影响器则按照一定规则对粒子的路径和生命周期进行影响,使粒子效果更为真实。

    注意:该类的对象调用 getGeoModel() 方法无效,即返回值为null。

    • 构造器详细资料

      • GeoParticle

        public GeoParticle()
        构造一个新的 GeoParticle 对象。
      • GeoParticle

        public GeoParticle(GeoParticle geoParticle)
        根据给定的 GeoParticle 对象构造一个与其完全相同的新对象。
        参数:
        geoParticle - 指定的 GeoParticle 对象。
      • GeoParticle

        public GeoParticle(String filename,
                           Geometry geometry)
        根据指定的参数来构造一个 GeoParticle 的新对象。
        参数:
        filename - 指定的粒子资源文件的全路径。
        geometry - 指定的与三维粒子几何对象关联的几何对象。
      • GeoParticle

        public GeoParticle(ParticleType type,
                           Geometry geometry)
        根据指定的参数来构造一个 GeoParticle 的新对象。
        参数:
        type - 指定的粒子效果类型。
        geometry - 指定的与三维粒子几何对象关联的几何对象。
    • 方法详细资料

      • getParticleType

        public ParticleType getParticleType()
        返回粒子效果类型。
        返回:
        粒子效果类型。
      • setParticleType

        public void setParticleType(ParticleType type)
        设置粒子效果类型。

        调用此方法后,除 ParticleSystem.setLocalCenterPos() 方法外,GeoParticle 持有的 ParticleSystem 对象(GeoParticle.getParticleSystems())的其他方法的设置均将失效,改变为对应粒子效果类型的 ParticleSystem 的默认设置值,关于不同粒子效果类型的默认值可参见 ParticleType 类。

        参数:
        type - 指定的粒子效果类型。
      • setParticleFilePath

        public void setParticleFilePath(String filename)
        设置粒子效果资源文件的路径。

        系统为各种粒子效果类型(ParticleType)均提供了默认的参数设置并保存为 par 文件,最后存储在资源文件中。各种效果类型的具体参数默认值请参考 ParticleType 类。

        参数:
        filename - 粒子效果资源文件的路径。
      • getParticleFilePath

        public String getParticleFilePath()
        返回粒子效果资源文件的路径。

        系统为各种粒子效果类型(ParticleType)均提供了默认的参数设置并保存为 par 文件,最后存储在资源文件中。各种效果类型的具体参数默认值请参考 ParticleType 类。

        返回:
        粒子效果资源文件的路径。
      • makeWithGeometry

        public boolean makeWithGeometry(Geometry geometry)
        设置与三维粒子几何对象关联的几何对象,使用默认构造函数后,调用该方法来指定几何对象。
        参数:
        geometry - 指定的几何对象。该几何对象用于指定三维粒子几何对象的位置或者区域。
        返回:
        一个布尔值,设置成功返回 true,否则返回 false。
      • isValid

        public boolean isValid()
        用于判定该 GeoParticle 对象是否有效。

        判断 GeoParticle 对象是否有效的条件如下:

        1、GeoParticle 对象必须存在与之关联的 Geometry 对象,可通过 GeoParticle(String, Geometry)、GeoParticle(ParticleType type, Geometry geometry) 构造或 makeWithGeometry() 方法设置来实现;

        2、若 getParticleType() 方法的返回值为 ParticleType.RAIN 或者 ParticleType.SNOW,则要求该 GeoParticle 对象关联的 Geometry 对象必须为 GeoRegion 或 GeoRegion3D 类型;

        3、GeoParticle 对象必须指定了粒子效果类型(ParticleType),可通过 GeoParticle(ParticleType type, Geometry geometry) 构造或 setParticleType() 方法设置来实现。

        返回:
        一个布尔值,表示该 GeoParticle 对象是否有效,true 表示有效,false 表示无效。
      • clone

        public GeoParticle clone()
        从类复制的说明: Geometry
        克隆一个Geometry对象。
        指定者:
        clone 在类中 Geometry
        返回:
        克隆的Geometry对象。
      • dispose

        public void dispose()
        从类复制的说明: Geometry
        释放该对象所占用的资源。当调用该方法之后,此对象不再可用。
        指定者:
        dispose 在接口中 IDisposable
        指定者:
        dispose 在类中 Geometry
      • getParticleSystems

        public ParticleSystem[] getParticleSystems()
        返回三维粒子几何对象所持有的 ParticleSystem 对象数组。
        返回:
        三维粒子几何对象所持有的 ParticleSystem 对象数组。

Copyright © 2021–2024 SuperMap. All rights reserved.