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)

    
    
    
  • 相关阅读:
    窗口设置背景图片
    双链表
    单链表
    Hough直线检测
    轮廓跟踪
    轮廓提取
    基于腐蚀的二值图像距离变换
    创建对话框用于交互
    hello world
    c#---params参数
  • 原文地址:https://www.cnblogs.com/ankier/p/2805936.html
Copyright © 2011-2022 走看看