zoukankan      html  css  js  c++  java
  • vtk类之vtkEarthSource:生成地球的多边形

    vtkEarthSource 数据源,用圆球形的样式来生产地铁的版块轮廓形状。

    基本方法:

    virtual void  SetRadius (double)
    virtual double  GetRadius ()
     
     
    virtual void  SetOnRatio (int)
    virtual int  GetOnRatio ()

    Radius 设置地球的半径长度

    OnRatio 设置地球显示的精确程度 0~16, 值越小,显示越精确。

    例子:

    #-*- coding: UTF-8 -*-
    #
    ------------------------------------------------------------------------------- # Name: 模块2 # Purpose: # # Author: Administrator # # Created: 06-12-2012 # Copyright: (c) Administrator 2012 # Licence: <your licence> #------------------------------------------------------------------------------- from ActorFactory import ActorFactory from vtk import * ## @detal 地球类 class EarthActorFactory(ActorFactory): def __init__(self): ActorFactory.__init__(self) self.__EarthSource = vtkEarthSource() def _MakeActors(self): self.__EarthSource.SetRadius(20) self.__EarthSource.SetOutline(0) self.__EarthSource.SetOnRatio(0) self.__EarthSource.OutlineOn() polyDataMapper = vtkPolyDataMapper() polyDataMapper.SetInput(self.__EarthSource.GetOutput()) actor = self._NewActor() actor.SetMapper(polyDataMapper) actor.GetProperty().SetColor((0.5, 0.7, 0.2)) return [actor] def __del__(self): del self.__EarthSource

    设置精密度位16时的效果:

    self.__EarthSource.SetOnRatio(16)

    
    
    
  • 相关阅读:
    BZOJ3744 : Gty的妹子序列
    BZOJ2827 : 千山鸟飞绝
    BZOJ3547 : [ONTAK2010]Matchings
    BZOJ1185 : [HNOI2007]最小矩形覆盖
    BZOJ3046 : lagoon
    BZOJ3743 : [Coci2014]Kamp
    BZOJ3742 : Painting
    iOS移动开发周报-第25期
    适合码农工作时玩的游戏:Scrum
    iOS移动开发周报-第24期
  • 原文地址:https://www.cnblogs.com/ankier/p/2805936.html
Copyright © 2011-2022 走看看