コード例 #1
0
 def set_side_colorbar(self, side, nvalues=10):
     from caid.graphics.colorbar import colorbar as cbar
     # Create a colorbar array...
     C = np.linspace(self.vmin,self.vmax,nvalues).astype(np.float32)
     colorbar = cbar(C, colormap=self.colormap, side=side)
     self._colorbar = colorbar
     self._side_colorbar = side
コード例 #2
0
ファイル: field.py プロジェクト: gdrealm/caid
 def set_side_colorbar(self, side, nvalues=10):
     from caid.graphics.colorbar import colorbar as cbar
     # Create a colorbar array...
     C = np.linspace(self.vmin, self.vmax, nvalues).astype(np.float32)
     colorbar = cbar(C, colormap=self.colormap, side=side)
     self._colorbar = colorbar
     self._side_colorbar = side
コード例 #3
0
ファイル: field.py プロジェクト: gdrealm/caid
    def update(self,
               colormap=None,
               colorbar=None,
               field=None,
               clean=False,
               n=None,
               force=False):
        if colormap is not None:
            self._colormap = colormap
            force = True
        if colorbar is not None:
            self._colorbar = colorbar
            force = True
        if field is not None:
            self._field = field
            force = True

        print(("show_colorbar ", self.show_colorbar))
        self.updateVertexBuffer(colormap=colormap,
                                field=field,
                                n=n,
                                force=force)

        if self.show_colorbar:
            if self.colorbar is None:
                from caid.graphics.colorbar import colorbar as cbar
                # Create a colorbar array...
                nvalues = 10
                C = np.linspace(self.vmin, self.vmax,
                                nvalues).astype(np.float32)
                colorbar = cbar(C, colormap=colormap, side='left'\
                               , xmin = self.xmin \
                               , ymin = self.ymin \
                               , zmin = self.zmin \
                               , xmax = self.xmax \
                               , ymax = self.ymax \
                               , zmax = self.zmax \
                               )
                self._colorbar = colorbar
            print(">>> Enter colorbar VB")
            self.updateVertexBuffer(  colormap=colormap \
                                    , field=self.colorbar \
                                    , n=[10,10] \
                                    , force=force)

        self.finalizeVertexBuffer(colormap=colormap,
                                  field=self.colorbar,
                                  n=n,
                                  force=force)
コード例 #4
0
    def update(self, colormap=None, colorbar=None, field=None, clean=False, n=None, force=False):
        if colormap is not None:
            self._colormap = colormap
            force = True
        if colorbar is not None:
            self._colorbar = colorbar
            force = True
        if field is not None:
            self._field = field
            force = True

        print("show_colorbar ", self.show_colorbar)
        self.updateVertexBuffer(colormap=colormap, field=field, n=n, force=force)

        if self.show_colorbar:
            if self.colorbar is None:
                from caid.graphics.colorbar import colorbar as cbar
                # Create a colorbar array...
                nvalues = 10
                C = np.linspace(self.vmin,self.vmax,nvalues).astype(np.float32)
                colorbar = cbar(C, colormap=colormap, side='left'\
                               , xmin = self.xmin \
                               , ymin = self.ymin \
                               , zmin = self.zmin \
                               , xmax = self.xmax \
                               , ymax = self.ymax \
                               , zmax = self.zmax \
                               )
                self._colorbar = colorbar
            print(">>> Enter colorbar VB")
            self.updateVertexBuffer(  colormap=colormap \
                                    , field=self.colorbar \
                                    , n=[10,10] \
                                    , force=force)

        self.finalizeVertexBuffer(colormap=colormap, field=self.colorbar, n=n, force=force)