import vtk
import time
from graphengine import camera
from graphengine import axes
#from vtk.util.misc import vtkGetDataRoot
from vtk.util.colors import *

def DrawAcrobot( ren, VTKwindow):
        # Get the location of the data.
        #VTK_DATA_ROOT = vtkGetDataRoot()
        #print VTK_DATA_ROOT

        # This creates a polygonal cylinder model with eight circumferential
        # facets.
        part = vtk.vtkSTLReader()
        #part.SetFileName(VTK_DATA_ROOT + "/Data/42400-IDGH.stl")
        part.SetFileName( "42400-IDGH.stl")

        # The mapper is responsible for pushing the geometry into the graphics
        # library. It may also do color mapping, if scalars or other
        # attributes are defined.
        partMapper = vtk.vtkPolyDataMapper()
        partMapper.SetInputConnection(part.GetOutputPort())

        # The LOD actor is a special type of actor. It will change appearance
        # in order to render faster. At the highest resolution, it renders
        # ewverything just like an actor. The middle level is a point cloud,
        # and the lowest level is a simple bounding box.
        partActor = vtk.vtkLODActor()
        partActor.SetMapper(partMapper)
        partActor.GetProperty().SetColor(light_grey)
        partActor.RotateX(30.0)
        partActor.RotateY(-45.0)
        ren.AddActor(partActor)
       
        
        #axes.DrawAxes( ren, VTKwindow )
        
        #Camera Settings
        camera.CameraSettings( ren, VTKwindow)
        """
        for i in range(0,360):                                                          
            time.sleep(0.01)
            partActor.RotateY(i)
            ren.AddActor(partActor)
            VTKwindow.Update()
            VTKwindow.Refresh()
            #Camera Settings
            camera.CameraSettings( ren, VTKwindow)
       """

    
  
  