Example #1
0
    def __init__(self,name,text,scale=1,position=None):
        """@param name: name under which the sphere should be displayed
        @param text: the text that will be displayed
        @param scale: the scaling of the text (in terms ofcharacterist length of the geometry
        @param position: the actual position at which the object should be centered"""

        try:
            txt=servermanager.sources.VectorText()
        except AttributeError:
            txt=servermanager.sources.a3DText()
            
        txt.Text=text
        
        SimpleSource.__init__(self,name,txt)

        if not position:
            position=gc()

        try:
            self.repr.Translate=list(position)
        except AttributeError:
            self.repr.Position=list(position)
        
        self.repr.Origin=list(position)
        
        scale*=lc()/self.characteristicLength()
        
        self.repr.Scale=(scale,scale,scale)
Example #2
0
    def __init__(self,name,center,relRadius=0.01,absRadius=None):
        """@param name: name under which the sphere should be displayed
        @param center: the center of the sphere
        @param relRadius: radius relative to the characteristic length
        @param absRadius: absolute radius. Overrides relRadius if set"""

        try:
            sphr=servermanager.sources.SphereSource()
        except AttributeError:
            sphr=servermanager.sources.Sphere()

        sphr.Center=list(center)
        if absRadius:
            sphr.Radius=absRadius
        else:
            sphr.Radius=lc()*relRadius

        SimpleSource.__init__(self,name,sphr)