本文整理汇总了Python中vtk.vtkConeSource函数的典型用法代码示例。如果您正苦于以下问题:Python vtkConeSource函数的具体用法?Python vtkConeSource怎么用?Python vtkConeSource使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了vtkConeSource函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: vtkRenderWindowInteractorConeExample
def vtkRenderWindowInteractorConeExample():
"""Like it says, just a simple example
"""
# create root window
root = Tkinter.Tk()
# create vtkTkRenderWidget
pane = vtkTkRenderWindowInteractor(root, width=300, height=300)
pane.Initialize()
def quit(obj=root):
obj.quit()
pane.AddObserver("ExitEvent", lambda o,e,q=quit: q())
ren = vtk.vtkRenderer()
pane.GetRenderWindow().AddRenderer(ren)
cone = vtk.vtkConeSource()
cone.SetResolution(8)
coneMapper = vtk.vtkPolyDataMapper()
coneMapper.SetInput(cone.GetOutput())
coneActor = vtk.vtkActor()
coneActor.SetMapper(coneMapper)
ren.AddActor(coneActor)
# pack the pane into the tk root
pane.pack(fill='both', expand=1)
pane.Start()
# start the tk mainloop
root.mainloop()
开发者ID:SRabbelier,项目名称:Casam,代码行数:35,代码来源:vtkTkRenderWindowInteractor.py
示例2: __init__
def __init__(self):
ActorFactory.ActorFactory.__init__(self)
colors = ((1, 0, 0), (0, 1, 0), (0, 0, 1))
self._Properties = []
for i in range(3):
property = vtk.vtkProperty()
property.SetColor(colors[i])
property.SetAmbient(1.0)
property.SetOpacity(0.3)
self._Properties.append(property)
self._ConeProperties = []
for i in range(3):
property = vtk.vtkProperty()
property.SetColor(colors[i])
property.SetAmbient(1.0)
# property.SetOpacity(0.3)
self._ConeProperties.append(property)
self._Planes = []
self._Cutters = []
self._LineActorsIndex = []
self._ConeActorsIndex = []
self._ConeSize = 24.0
self._Cones = []
for i in range(6):
cone = vtk.vtkConeSource()
cone.SetResolution(2)
cone.SetHeight(self._ConeSize)
cone.SetRadius(self._ConeSize)
self._Cones.append(cone)
开发者ID:parallaxinnovations,项目名称:vtkEVS,代码行数:33,代码来源:OrthoPlanesIntersectionsFactory.py
示例3: OnInit
def OnInit(self):
"""Initializer.
"""
frame = wx.Frame(None, -1, u'DatasourcePanel Demo')
# Node provides vtkRenderer.
visualizer_node = Vtk3dVisualizerNode()
# Panel provides wxVtkRenderWindowInteractor.
visualizer_panel = Vtk3dVisualizerPage(frame, -1, target=visualizer_node)
sizer = wx.BoxSizer()
sizer.Add(visualizer_panel, 1, wx.ALL|wx.EXPAND, 5)
frame.SetSizer(sizer)
frame.Layout()
frame.Show(True)
self.SetTopWindow(frame)
# configure renderer.
renderer = visualizer_node.renderer
source = vtk.vtkConeSource()
source.SetResolution(64)
mapper = vtk.vtkPolyDataMapper()
mapper.SetInput(source.GetOutput())
actor = vtk.vtkActor()
actor.SetMapper(mapper)
renderer.AddActor(actor)
# add renderer to the window.
visualizer_panel.add_renderer(renderer)
return True
开发者ID:ecell,项目名称:ecell4-vis,代码行数:26,代码来源:page.py
示例4: makeTextCaption
def makeTextCaption(text,size,labPos,attPos):
coneGlyph = vtk.vtkConeSource()
coneGlyph.SetResolution(10)
coneGlyph.SetHeight(150)
coneGlyph.SetRadius(50)
coneGlyph.Update()
glyphMaxSize = 50
glyphSize = .1
capt = vtk.vtkCaptionActor2D()
capt.BorderOff()
capt.SetCaption(text)
capt.GetCaptionTextProperty().SetFontSize(size)
capt.GetCaptionTextProperty().BoldOn()
capt.GetCaptionTextProperty().ItalicOff()
capt.GetCaptionTextProperty().ShadowOff()
capt.SetAttachmentPoint(attPos)
capt.GetPositionCoordinate().SetCoordinateSystemToNormalizedViewport()
capt.GetPositionCoordinate().SetReferenceCoordinate(None)
capt.GetPositionCoordinate().SetValue(labPos)
capt.SetWidth(0.013*(len(text)+1))
capt.SetHeight(0.1)
capt.ThreeDimensionalLeaderOff()
capt.SetLeaderGlyph(coneGlyph.GetOutput())
capt.SetMaximumLeaderGlyphSize(glyphMaxSize)
capt.SetLeaderGlyphSize(glyphSize)
capt.GetProperty().SetColor(0,0,0)
capt.GetProperty().SetLineWidth(5)
return capt
开发者ID:simpeg,项目名称:presentations,代码行数:30,代码来源:VTKUtil.py
示例5: OnInit
def OnInit(self):
frame = wx.Frame(None, -1, u'RenderWindowPanel demo',
size=(400, 400))
aspect_radio = wx.RadioBox(
frame, -1,
choices=['%s:%s' %ar for ar in self.ASPECT_RATIOS])
render_window_panel = RenderWindowPanel(frame, -1)
frame.Bind(wx.EVT_RADIOBOX, self.OnRadioSelect)
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(aspect_radio, 0, wx.ALL|wx.EXPAND, 5)
sizer.Add(render_window_panel, 1, wx.ALL|wx.EXPAND, 5)
frame.SetSizer(sizer)
frame.Layout()
frame.Show(True)
self.render_window_panel = render_window_panel
self.SetTopWindow(frame)
renderer = vtk.vtkRenderer()
# stuff to be rendererd
source = vtk.vtkConeSource()
source.SetResolution(8)
mapper = vtk.vtkPolyDataMapper()
mapper.SetInput(source.GetOutput())
actor = vtk.vtkActor()
actor.SetMapper(mapper)
renderer.AddActor(actor)
render_window_panel.add_renderer(renderer)
return True
开发者ID:ecell,项目名称:ecell4-vis,代码行数:27,代码来源:render_window.py
示例6: initialize
def initialize(self):
global renderer, renderWindow, renderWindowInteractor, cone, mapper, actor
# Bring used components
self.registerVtkWebProtocol(protocols.vtkWebMouseHandler())
self.registerVtkWebProtocol(protocols.vtkWebViewPort())
self.registerVtkWebProtocol(protocols.vtkWebViewPortImageDelivery())
self.registerVtkWebProtocol(protocols.vtkWebViewPortGeometryDelivery())
# Create default pipeline (Only once for all the session)
if not _WebCone.view:
# VTK specific code
renderer = vtk.vtkRenderer()
renderWindow = vtk.vtkRenderWindow()
renderWindow.AddRenderer(renderer)
renderWindowInteractor = vtk.vtkRenderWindowInteractor()
renderWindowInteractor.SetRenderWindow(renderWindow)
renderWindowInteractor.GetInteractorStyle().SetCurrentStyleToTrackballCamera()
cone = vtk.vtkConeSource()
mapper = vtk.vtkPolyDataMapper()
actor = vtk.vtkActor()
mapper.SetInputConnection(cone.GetOutputPort())
actor.SetMapper(mapper)
renderer.AddActor(actor)
renderer.ResetCamera()
renderWindow.Render()
# VTK Web application specific
_WebCone.view = renderWindow
self.Application.GetObjectIdMap().SetActiveObject("VIEW", renderWindow)
开发者ID:berendkleinhaneveld,项目名称:VTK,代码行数:34,代码来源:vtk_web_cone.py
示例7: QVTKRenderWidgetConeExample
def QVTKRenderWidgetConeExample():
"""Like it says, just a simple example
"""
# every QT app needs an app
app = QApplication(['QVTKRenderWidget'])
# create the widget
widget = QVTKRenderWidget()
ren = vtk.vtkRenderer()
widget.GetRenderWindow().AddRenderer(ren)
cone = vtk.vtkConeSource()
cone.SetResolution(8)
coneMapper = vtk.vtkPolyDataMapper()
coneMapper.SetInput(cone.GetOutput())
coneActor = vtk.vtkActor()
coneActor.SetMapper(coneMapper)
ren.AddActor(coneActor)
# show the widget
widget.show()
# close the application when window is closed
qApp.setMainWidget(widget)
# start event processing
app.exec_loop()
开发者ID:FlorianChevassu,项目名称:VTK,代码行数:29,代码来源:QVTKRenderWidget.py
示例8: QVTKRenderWidgetConeExample
def QVTKRenderWidgetConeExample():
"""A simple example that uses the QVTKRenderWindowInteractor class."""
# every QT app needs an app
app = QApplication(['QVTKRenderWindowInteractor'])
# create the widget
frame, widget = QFramedVTK()
# for PyQt4, no automatic retina handling
# frame, widget = QFramedVTK(retina=True)
widget.Initialize()
widget.Start()
# if you dont want the 'q' key to exit comment this.
widget.AddObserver("ExitEvent", lambda o, e, a=app: a.quit())
ren = vtk.vtkRenderer()
widget.GetRenderWindow().AddRenderer(ren)
cone = vtk.vtkConeSource()
cone.SetResolution(8)
coneMapper = vtk.vtkPolyDataMapper()
coneMapper.SetInputConnection(cone.GetOutputPort())
coneActor = vtk.vtkActor()
coneActor.SetMapper(coneMapper)
ren.AddActor(coneActor)
# show the widget
frame.show()
# start event processing
app.exec_()
开发者ID:siudej,项目名称:Eigenvalues,代码行数:34,代码来源:qvtk.py
示例9: __init__
def __init__(self, center=(-2,0,0), radius = 1, angle=45, height=0.4, color=(1,1,0) , resolution=60):
""" cone"""
self.src = vtk.vtkConeSource()
self.src.SetResolution(resolution)
self.src.SetRadius( radius )
#self.src.SetAngle( angle )
self.src.SetHeight( height )
#self.src.SetCenter(center)
transform = vtk.vtkTransform()
transform.Translate(center[0], center[1], center[2] - self.src.GetHeight()/2)
#transform.RotateX(rotXYZ[0])
transform.RotateY( -90 )
#transform.RotateZ(rotXYZ[2])
transformFilter=vtk.vtkTransformPolyDataFilter()
transformFilter.SetTransform(transform)
transformFilter.SetInputConnection(self.src.GetOutputPort())
transformFilter.Update()
self.mapper = vtk.vtkPolyDataMapper()
self.mapper.SetInput(transformFilter.GetOutput())
#self.mapper = vtk.vtkPolyDataMapper()
#self.mapper.SetInput(self.src.GetOutput())
self.SetMapper(self.mapper)
self.SetColor(color)
开发者ID:aewallin,项目名称:randompolygon,代码行数:27,代码来源:ovdvtk.py
示例10: initialize
def initialize(self, VTKWebApp, args):
if not VTKWebApp.view:
# VTK specific code
renderer = vtk.vtkRenderer()
renderWindow = vtk.vtkRenderWindow()
renderWindow.AddRenderer(renderer)
renderWindowInteractor = vtk.vtkRenderWindowInteractor()
renderWindowInteractor.SetRenderWindow(renderWindow)
renderWindowInteractor.GetInteractorStyle().SetCurrentStyleToTrackballCamera()
cone = vtk.vtkConeSource()
mapper = vtk.vtkPolyDataMapper()
actor = vtk.vtkActor()
mapper.SetInputConnection(cone.GetOutputPort())
actor.SetMapper(mapper)
renderer.AddActor(actor)
renderer.ResetCamera()
renderWindow.Render()
# VTK Web application specific
VTKWebApp.view = renderWindow
self.Application.GetObjectIdMap().SetActiveObject("VIEW", renderWindow)
开发者ID:Halfnhav,项目名称:tangelo,代码行数:25,代码来源:vtkweb_cone.py
示例11: testQVTKWidget
def testQVTKWidget(self):
w2 = vtk.QVTKWidget()
w2.resize(500,500)
ren = vtk.vtkRenderer()
ren.SetBackground(0,0,0)
ren.SetBackground2(1,1,1)
ren.SetGradientBackground(1)
win2 = vtk.vtkRenderWindow()
win2.AddRenderer(ren)
w2.SetRenderWindow(win2)
renwin = w2.GetRenderWindow()
cone = vtk.vtkConeSource()
mapper = vtk.vtkPolyDataMapper()
mapper.SetInput(cone.GetOutput())
actor = vtk.vtkActor()
actor.SetMapper(mapper)
ren.AddViewProp(actor)
ren.ResetCamera()
w2.show()
if Testing.isInteractive():
PyQt4.QtGui.qApp.exec_()
开发者ID:0004c,项目名称:VTK,代码行数:25,代码来源:TestQVTKWidget.py
示例12: __init__
def __init__(self, parent=None):
logging.debug("In SimpleTest::_QVtkWidgetCone::__init__()")
super(_QVtkWidgetCone, self).__init__(parent)
self.setWindowTitle("Test QVtkWidget with QMainWindow")
self.setGeometry(QtCore.QRect(500, 500, 200, 200))
centralwidget = QtGui.QWidget(self)
centralwidget.setObjectName("centralwidget")
gridLayout = QtGui.QGridLayout(centralwidget)
gridLayout.setObjectName("gridLayout")
self.setCentralWidget(centralwidget)
ren = vtk.vtkRenderer()
widget = QVtkWidget(centralwidget)
widget.setWindowTitle("Test QVtkWidget with QMainWindow")
widget.setGeometry(QtCore.QRect(1, 30, 200, 200))
widget.GetRenderWindow().AddRenderer(ren)
widget.GetRenderWindow().SetSize(200, 200)
cone = vtk.vtkConeSource()
cone.SetResolution(8)
coneMapper = vtk.vtkPolyDataMapper()
coneMapper.SetInput(cone.GetOutput())
coneActor = vtk.vtkActor()
coneActor.SetMapper(coneMapper)
ren.AddActor(coneActor)
开发者ID:aevum,项目名称:moonstone,代码行数:31,代码来源:tests.py
示例13: __init__
def __init__(self, module_manager):
SimpleVTKClassModuleBase.__init__(
self, module_manager,
vtk.vtkConeSource(), 'Processing.',
(), ('vtkPolyData',),
replaceDoc=True,
inputFunctions=None, outputFunctions=None)
开发者ID:fvpolpeta,项目名称:devide,代码行数:7,代码来源:vtkConeSource.py
示例14: initPicker
def initPicker(self):
coneSource = vtk.vtkConeSource()
coneSource.CappingOn()
coneSource.SetHeight(2)
coneSource.SetRadius(1)
coneSource.SetResolution(10)
coneSource.SetCenter(1,0,0)
coneSource.SetDirection(-1,0,0)
coneMapper = vtk.vtkDataSetMapper()
coneMapper.SetInputConnection(coneSource.GetOutputPort())
self.redCone = vtk.vtkActor()
self.redCone.PickableOff()
self.redCone.SetMapper(coneMapper)
self.redCone.GetProperty().SetColor(1,0,0)
self.greenCone = vtk.vtkActor()
self.greenCone.PickableOff()
self.greenCone.SetMapper(coneMapper)
self.greenCone.GetProperty().SetColor(0,1,0)
# Add the two cones (or just one, if you want)
self.renderer.AddViewProp(self.redCone)
self.renderer.AddViewProp(self.greenCone)
self.picker = vtk.vtkVolumePicker()
self.picker.SetTolerance(1e-6)
self.picker.SetVolumeOpacityIsovalue(0.1)
开发者ID:smdabdoub,项目名称:ProkaryMetrics,代码行数:29,代码来源:vtkRender.py
示例15: renderthis
def renderthis(self):
# open a window and create a renderer
ren = vtk.vtkRenderer()
self.widget.GetRenderWindow().AddRenderer(ren)
# to generate polygonal data for a cone.
cone = vtk.vtkConeSource()
cone.SetResolution(25)
# o take the polygonal data from the vtkConeSource and
# create a rendering for the renderer.
coneMapper = vtk.vtkPolyDataMapper()
coneMapper.SetInput(cone.GetOutput())
# create an actor for our scene
coneActor = vtk.vtkActor()
coneActor.SetMapper(coneMapper)
# Add actor
ren.AddActor(coneActor)
axes = vtk.vtkAxesActor()
self.marker = vtk.vtkOrientationMarkerWidget()
self.marker.SetInteractor( self.widget._Iren )
self.marker.SetOrientationMarker( axes )
self.marker.SetViewport(0.75,0,1,0.25)
self.marker.SetEnabled(1)
ren.ResetCamera()
ren.ResetCameraClippingRange()
cam = ren.GetActiveCamera()
cam.Elevation(10)
cam.Azimuth(70)
self.isploted = True
开发者ID:SpartacusVipul,项目名称:U.I.,代码行数:33,代码来源:wv.py
示例16: __init__
def __init__(self, parent = None):
super(VTKFrame, self).__init__(parent)
self.vtkWidget = QVTKRenderWindowInteractor(self)
vl = QtGui.QVBoxLayout(self)
vl.addWidget(self.vtkWidget)
vl.setContentsMargins(0, 0, 0, 0)
self.ren = vtk.vtkRenderer()
self.ren.SetBackground(0.1, 0.2, 0.4)
self.vtkWidget.GetRenderWindow().AddRenderer(self.ren)
self.iren = self.vtkWidget.GetRenderWindow().GetInteractor()
# Create source
source = vtk.vtkConeSource()
source.SetHeight(3.0)
source.SetRadius(1.0)
source.SetResolution(20)
# Create a mapper
mapper = vtk.vtkPolyDataMapper()
mapper.SetInputConnection(source.GetOutputPort())
# Create an actor
actor = vtk.vtkActor()
actor.SetMapper(mapper)
self.ren.AddActor(actor)
self.ren.ResetCamera()
self._initialized = False
开发者ID:dbzhang800,项目名称:VTKDemoForPyQt,代码行数:31,代码来源:simple.py
示例17: vtkRenderWidgetConeExample
def vtkRenderWidgetConeExample():
"""Like it says, just a simple example
"""
# create root window
root = Tkinter.Tk()
# create vtkTkRenderWidget
pane = vtkTkRenderWidget(root,width=300,height=300)
ren = vtk.vtkRenderer()
pane.GetRenderWindow().AddRenderer(ren)
cone = vtk.vtkConeSource()
cone.SetResolution(8)
coneMapper = vtk.vtkPolyDataMapper()
coneMapper.SetInput(cone.GetOutput())
coneActor = vtk.vtkActor()
coneActor.SetMapper(coneMapper)
ren.AddActor(coneActor)
# pack the pane into the tk root
pane.pack()
# start the tk mainloop
root.mainloop()
开发者ID:bitcoinsoftware,项目名称:3D-Scientific-Visualization,代码行数:28,代码来源:vtkTkRenderWidget.py
示例18: ex
def ex():
# create a rendering window and renderer
ren = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren)
WIDTH=640
HEIGHT=480
renWin.SetSize(WIDTH,HEIGHT)
# create a renderwindowinteractor
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)
# create cone
cone = vtk.vtkConeSource()
cone.SetResolution(60)
cone.SetCenter(-2,0,0)
# mapper
coneMapper = vtk.vtkPolyDataMapper()
coneMapper.SetInput(cone.GetOutput())
# actor
coneActor = vtk.vtkActor()
coneActor.SetMapper(coneMapper)
# assign actor to the renderer
ren.AddActor(coneActor)
# enable user interface interactor
iren.Initialize()
renWin.Render()
iren.Start()
开发者ID:haskellpostgresprogrammer,项目名称:python_files,代码行数:33,代码来源:vtkstuff.py
示例19: QVTKRenderWidgetConeExample
def QVTKRenderWidgetConeExample():
"""A simple example that uses the QVTKRenderWindowInteractor
class. """
# every QT app needs an app
app = qt.QApplication(['QVTKRenderWindowInteractor'])
# create the widget
widget = QVTKRenderWindowInteractor()
widget.Initialize()
widget.Start()
# if you dont want the 'q' key to exit comment this.
widget.AddObserver("ExitEvent", lambda o, e, a=app: a.quit())
ren = vtk.vtkRenderer()
widget.GetRenderWindow().AddRenderer(ren)
cone = vtk.vtkConeSource()
cone.SetResolution(8)
coneMapper = vtk.vtkPolyDataMapper()
coneMapper.SetInputConnection(cone.GetOutputPort())
coneActor = vtk.vtkActor()
coneActor.SetMapper(coneMapper)
ren.AddActor(coneActor)
# show the widget
widget.show()
# close the application when window is closed
app.setMainWidget(widget)
# start event processing
app.exec_loop()
开发者ID:151706061,项目名称:VTK,代码行数:34,代码来源:QVTKRenderWindowInteractor.py
示例20: __init__
def __init__ (self, mod_m):
debug ("In VelocityVector::__init__ ()")
Common.state.busy ()
Base.Objects.Module.__init__ (self, mod_m)
self.glyph2d_src = vtk.vtkGlyphSource2D ()
self.cone = vtk.vtkConeSource ()
self.arrow = vtk.vtkArrowSource ()
self.glyph_src = self.cone
self.glyph3d = vtk.vtkGlyph3D ()
self.mapper = self.map = vtk.vtkPolyDataMapper ()
self.actor = self.act = vtk.vtkActor ()
# used to orient the cone properly
self.glph_trfm = vtk.vtkTransformFilter ()
self.glph_trfm.SetTransform (vtk.vtkTransform ())
self.data_out = self.mod_m.GetOutput ()
# Point of glyph that is attached -- -1 is tail, 0 is center,
# 1 is head.
self.glyph_pos = -1
self.scale = 1.0
self.color_mode = 2 #2 is vector, 1 is scalar, -1 none
self._initialize ()
self._gui_init ()
self.renwin.Render ()
Common.state.idle ()
开发者ID:sldion,项目名称:DNACC,代码行数:25,代码来源:VelocityVector.py
注:本文中的vtk.vtkConeSource函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论