소스 검색

wxNviz: forgot to commit in https://trac.osgeo.org/grass/changeset/49082

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@49083 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 13 년 전
부모
커밋
4f16144bcf
1개의 변경된 파일23개의 추가작업 그리고 0개의 파일을 삭제
  1. 23 0
      gui/wxpython/gui_modules/wxnviz.py

+ 23 - 0
gui/wxpython/gui_modules/wxnviz.py

@@ -967,6 +967,29 @@ class Nviz(object):
         """
         return Vect_read_colors(name, mapset, self.color)
         
+    def CheckColorTable(self, id, type):
+        """!Check if color table exists.
+        
+        @param id vector set id
+        @param type vector set type (lines/points)
+        
+        @return 1 color table exists
+        @return 0 no color table found
+        @return -1 on error
+        @return -2 vector set not found
+        """
+        file = c_char_p()
+        
+        if type == 'points':
+            ret = GP_get_sitename(id, byref(file))
+        elif type == 'lines':
+            ret = GV_get_vectname(id, byref(file))
+            
+        if ret < 0:
+            return -2
+        
+        return self.ReadVectorColors(file, "")
+        
     def SetPointsStyleThematic(self, id, layer, color = None, colorTable = False, 
                                width = None, size = None, symbol = None):
         """!Set thematic style for vector points