예제 #1
0
    def addIsoSurface(self, isoData, isoValue=0):

        print "Add Isosurface"

        # Create the 3D extractor
        self._isoExtract, bbox, self._iso_description = VisusFunctions.create3dExtractor(
            isoData)

        # Attach the extractor to the passed in slice
        self._root.attachSubTree(self._isoExtract, True)

        # Create the isosurface
        surface = VisusIsoSurface.construct()

        # Create the mesh display
        display = VisusMeshDisplay.construct()
        display.normalIndex(3)

        self._isoExtract.attachSubTree(surface)
        surface.attachSubTree(display)

        # Connect the output of the extractor to the input of each surface node
        if not surface.connectIso(self._isoExtract):
            raise RuntimeError("unable to connect extractor1 as surface input")

        if not display.connectInput(surface):
            raise RuntimeError("unable to connect surface as display input")

        # Set the isosurface
        iso = VisusIsoValue(isoValue)
        surface.setValue(iso)
예제 #2
0
  def addIsoSurface( self, isoData, isoValue=0 ):
    
    print "Add Isosurface"

    # Create the 3D extractor
    self._isoExtract, bbox, self._iso_description = VisusFunctions.create3dExtractor( isoData )

    # Attach the extractor to the passed in slice
    self._root.attachSubTree(self._isoExtract, True)

    # Create the isosurface
    surface = VisusIsoSurface.construct()

    # Create the mesh display
    display = VisusMeshDisplay.construct()
    display.normalIndex(3)

    self._isoExtract.attachSubTree(surface)
    surface.attachSubTree(display)
    
    # Connect the output of the extractor to the input of each surface node
    if not surface.connectIso(self._isoExtract):
      raise RuntimeError("unable to connect extractor1 as surface input")
    
    if not display.connectInput(surface):
      raise RuntimeError("unable to connect surface as display input")

    # Set the isosurface
    iso = VisusIsoValue(isoValue)
    surface.setValue(iso)
예제 #3
0
    def setData(self, dataArray, usrAttribs=dict()):

        # If the user passed in attributes, use those
        if (usrAttribs):
            self._attribs = usrAttribs

        # Create the extractor, description and update the attributes
        self._extractor, self._bbox, self._attribs, self._descrip = VisusFunctions.createExtractor(
            dataArray, self._attribs)

        # Set the bounding box of the root
        self._root.setValue(self._bbox)
예제 #4
0
 def setData( self,dataArray,usrAttribs=dict() ):
   
   # If the user passed in attributes, use those
   if(usrAttribs):
     self._attribs = usrAttribs
       
   # Create the extractor, description and update the attributes 
   self._extractor, self._bbox, self._attribs, self._descrip = VisusFunctions.createExtractor(dataArray,
                                                                                              self._attribs)
   
   
   # Set the bounding box of the root
   self._root.setValue(self._bbox)
예제 #5
0
  slice2.scaleSlice(0.0, -0.25)
  slice2.translateSlice(0, 12)

  # Change the colormap
  slice1.setColorMap(bry())
  slice2.setColorMap(bry())

  # create a colorbar (use just one for the collection)
  slice1.createColorBar()

  # Change the data on the slices
  slice2.moveDataRequest(0.2)

  # Animate the data
  descriptors = []
  attributes = []
  attribute = dict()
  for i in range(0,cl.shape[0]):
    d = VisusFunctions.constructDataDescriptor(cl[i],attribute)
    descriptors.append(d)

  for x in range(1):
    for i in range(len(descriptors)):  
      d = descriptors[i]
      old = d
      slice1.getExtractor().setValue(d)
      slice2.getExtractor().setValue(d)
      time.sleep(1)

  print "GoodBye!"
예제 #6
0
    slice2.scaleSlice(0.0, -0.25)
    slice2.translateSlice(0, 12)

    # Change the colormap
    slice1.setColorMap(bry())
    slice2.setColorMap(bry())

    # create a colorbar (use just one for the collection)
    slice1.createColorBar()

    # Change the data on the slices
    slice2.moveDataRequest(0.2)

    # Animate the data
    descriptors = []
    attributes = []
    attribute = dict()
    for i in range(0, cl.shape[0]):
        d = VisusFunctions.constructDataDescriptor(cl[i], attribute)
        descriptors.append(d)

    for x in range(1):
        for i in range(len(descriptors)):
            d = descriptors[i]
            old = d
            slice1.getExtractor().setValue(d)
            slice2.getExtractor().setValue(d)
            time.sleep(1)

    print "GoodBye!"