# Path: qad_msg.py
# class QadMsgClass():
#    def __init__(self):
#    def translate(self, context, sourceText, disambiguation = None, encoding = QCoreApplication.UnicodeUTF8, n = -1):
# def qadShowPluginHelp(section = "", filename = "index", packageName = None):
# 
# Path: qad_variables.py
# class QadVariableTypeEnum():
# class QadAUTOSNAPEnum():
# class QadINPUTSEARCHOPTIONSEnum():
# class QadPOLARMODEnum():
# class QadDELOBJEnum():
# class QadGRIPMULTIFUNCTIONALEnum():
# class QadVariableLevelEnum():
# class QadVariable():
# class QadVariablesClass():
#    UNKNOWN = 0 # sconosciuto (non gestito da QAD)
#    STRING  = 1 # caratteri
#    COLOR   = 2 # colore espresso in caratteri (es. rosso = "#FF0000")
#    INT     = 3 # numero intero
#    FLOAT   = 4 # nmer con decimali
#    BOOL    = 5 # booleano (True o False)
#    DISPLAY_MARK      = 1  # Turns on the AutoSnap mark
#    DISPLAY_TOOLTIPS  = 2  # Turns on the AutoSnap tooltips
#    MAGNET            = 4  # Turns on the AutoSnap magnet
#    POLAR_TRACKING    = 8  # Turns on polar tracking
#    OBJ_SNAP_TRACKING = 16 # Turns on object snap tracking
#    DISPLAY_TOOLTIPS_POLAR_OSNAP_TRACKING_ORTHO = 32 # Turns on tooltips for polar tracking, object snap tracking, and Ortho mode
#    ON              = 1  # Turns off all automated keyboard features when typing at the Command prompt
#    AUTOCOMPLETE    = 2  # Automatically appends suggestions as each keystroke is entered after the second keystroke
#    DISPLAY_LIST    = 4  # Displays a list of suggestions as keystrokes are entered
#    DISPLAY_ICON    = 8  # Displays the icon of the command or system variable, if available
#    EXCLUDE_SYS_VAR = 16 # Excludes the display of system variables
#    MEASURE_RELATIVE_ANGLE = 1 # if setted: Measure polar angles from selected objects (relative) 
#    POLAR_TRACKING         = 2 # if setted: Use polar tracking settings in object snap tracking
#    SHIFT_TO_ACQUIRE       = 8 # if setted: Press Shift to acquire object snap tracking points, if not setted
#    ALL_RETAINED       =  0 # All defining geometry is retained
#    DELETE_ALL         =  1 # Delete all defining geometry 
#    ASK_FOR_DELETE_ALL = -1 # Ask the user for delete all defining geometry 
#    ON_CTRL_CYCLE_AND_HOT_GRIPT   = 1 # Access multi-functional grips with Ctrl-cycling and the Hot Grip shortcut menu
#    ON_DYNAMIC_MENU_AND_HOT_GRIPT = 2 # Access multi-functional grips with the dynamic menu and the Hot Grip shortcut menu
#    GLOBAL  = 0 # variabile globale di QAD
#    PROJECT = 2 # variabile del progetto corrente (che sovrascrive quella globale)
#    def __init__(self, name, value, typeValue, minNum = None, maxNum = None, descr = "", level = QadVariableLevelEnum.GLOBAL):
#    def __init__(self):
#    def getVarNames(self):
#    def set(self, VarName, varValue):
#    def get(self, VarName, defaultValue = None):
#    def getVariable(self, VarName):
#    def getDefaultQadIniFilePath(self):
#    def getDefaultQadIniFilePath(self):
#    def getProjectQadIniFilePath(self):
#    def __saveVariables(self, Path, filterOnLevel = None):
#    def save(self, Path=""):
#    def __loadVariables(self, Path, filterOnLevel = None):
#    def load(self, Path=""):
#    def copyTo(self, dest):


from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
from qgis.gui import *
from qad_msg import QadMsg
from qad_variables import QadVariables
   TRIANGLE         = 4  # triangolo equilatero con punta in su
   CIRCLE           = 5  # cerchio
   CIRCLE_X         = 6  # cerchio con al centro una x
   RHOMBUS          = 7  # rombo
   INFINITY_LINE    = 8  # linea infinita (------ . .)
   DOUBLE_BOX       = 9  # due quadrati sfalsati
   PERP             = 10 # simbolo di "perpendicolare"
   TANGENT          = 11 # un cerchio con una retta tangente sopra
   DOUBLE_TRIANGLE  = 12 # due triangoli uno sull'altro con vertice al centro (clessidra)
   BOX_X            = 13 # quadrato con al centro una x
   PARALLEL         = 14 # due righe parallele a 45 gradi
   PROGRESS         = 15 # linea con X e i puntini (----X-- . .)
   X_INFINITY_LINE  = 16 # X e i puntini (X-- . .)
   PERP_DEFERRED    = 17 # come perpendicolare con i puntini 
   TANGENT_DEFERRED = 18 # come tangente con i puntini 


class QadVertexMarker(QgsMapCanvasItem):
   """
   Classe che gestisce i marcatori dei vertici
   """
      

   #============================================================================
   # __init__
   #============================================================================
   def __init__(self, mapCanvas):
      QgsMapCanvasItem.__init__(self, mapCanvas)
      self.__canvas = mapCanvas
      self.__iconType = QadVertexmarkerIconTypeEnum.X # icon to be shown

# Path: qad_msg.py
# class QadMsgClass():
#    def __init__(self):
#    def translate(self, context, sourceText, disambiguation = None, encoding = QCoreApplication.UnicodeUTF8, n = -1):
# def qadShowPluginHelp(section = "", filename = "index", packageName = None):
# 
# Path: qad_variables.py
# class QadVariableTypeEnum():
# class QadAUTOSNAPEnum():
# class QadINPUTSEARCHOPTIONSEnum():
# class QadPOLARMODEnum():
# class QadDELOBJEnum():
# class QadGRIPMULTIFUNCTIONALEnum():
# class QadVariableLevelEnum():
# class QadVariable():
# class QadVariablesClass():
#    UNKNOWN = 0 # sconosciuto (non gestito da QAD)
#    STRING  = 1 # caratteri
#    COLOR   = 2 # colore espresso in caratteri (es. rosso = "#FF0000")
#    INT     = 3 # numero intero
#    FLOAT   = 4 # nmer con decimali
#    BOOL    = 5 # booleano (True o False)
#    DISPLAY_MARK      = 1  # Turns on the AutoSnap mark
#    DISPLAY_TOOLTIPS  = 2  # Turns on the AutoSnap tooltips
#    MAGNET            = 4  # Turns on the AutoSnap magnet
#    POLAR_TRACKING    = 8  # Turns on polar tracking
#    OBJ_SNAP_TRACKING = 16 # Turns on object snap tracking
#    DISPLAY_TOOLTIPS_POLAR_OSNAP_TRACKING_ORTHO = 32 # Turns on tooltips for polar tracking, object snap tracking, and Ortho mode
#    ON              = 1  # Turns off all automated keyboard features when typing at the Command prompt
#    AUTOCOMPLETE    = 2  # Automatically appends suggestions as each keystroke is entered after the second keystroke
#    DISPLAY_LIST    = 4  # Displays a list of suggestions as keystrokes are entered
#    DISPLAY_ICON    = 8  # Displays the icon of the command or system variable, if available
#    EXCLUDE_SYS_VAR = 16 # Excludes the display of system variables
#    MEASURE_RELATIVE_ANGLE = 1 # if setted: Measure polar angles from selected objects (relative) 
#    POLAR_TRACKING         = 2 # if setted: Use polar tracking settings in object snap tracking
#    SHIFT_TO_ACQUIRE       = 8 # if setted: Press Shift to acquire object snap tracking points, if not setted
#    ALL_RETAINED       =  0 # All defining geometry is retained
#    DELETE_ALL         =  1 # Delete all defining geometry 
#    ASK_FOR_DELETE_ALL = -1 # Ask the user for delete all defining geometry 
#    ON_CTRL_CYCLE_AND_HOT_GRIPT   = 1 # Access multi-functional grips with Ctrl-cycling and the Hot Grip shortcut menu
#    ON_DYNAMIC_MENU_AND_HOT_GRIPT = 2 # Access multi-functional grips with the dynamic menu and the Hot Grip shortcut menu
#    GLOBAL  = 0 # variabile globale di QAD
#    PROJECT = 2 # variabile del progetto corrente (che sovrascrive quella globale)
#    def __init__(self, name, value, typeValue, minNum = None, maxNum = None, descr = "", level = QadVariableLevelEnum.GLOBAL):
#    def __init__(self):
#    def getVarNames(self):
#    def set(self, VarName, varValue):
#    def get(self, VarName, defaultValue = None):
#    def getVariable(self, VarName):
#    def getDefaultQadIniFilePath(self):
#    def getDefaultQadIniFilePath(self):
#    def getProjectQadIniFilePath(self):
#    def __saveVariables(self, Path, filterOnLevel = None):
#    def save(self, Path=""):
#    def __loadVariables(self, Path, filterOnLevel = None):
#    def load(self, Path=""):
#    def copyTo(self, dest):


# Path: qad_vertexmarker.py
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
from qgis.gui import *
from qad_msg import QadMsg
from qad_variables import QadVariables

   TRIANGLE         = 4  # triangolo equilatero con punta in su
   CIRCLE           = 5  # cerchio
   CIRCLE_X         = 6  # cerchio con al centro una x
   RHOMBUS          = 7  # rombo
   INFINITY_LINE    = 8  # linea infinita (------ . .)
   DOUBLE_BOX       = 9  # due quadrati sfalsati
   PERP             = 10 # simbolo di "perpendicolare"
   TANGENT          = 11 # un cerchio con una retta tangente sopra
   DOUBLE_TRIANGLE  = 12 # due triangoli uno sull'altro con vertice al centro (clessidra)
   BOX_X            = 13 # quadrato con al centro una x
   PARALLEL         = 14 # due righe parallele a 45 gradi
   PROGRESS         = 15 # linea con X e i puntini (----X-- . .)
   X_INFINITY_LINE  = 16 # X e i puntini (X-- . .)
   PERP_DEFERRED    = 17 # come perpendicolare con i puntini 
   TANGENT_DEFERRED = 18 # come tangente con i puntini 


class QadVertexMarker(QgsMapCanvasItem):
   """
   Classe che gestisce i marcatori dei vertici
   """
      

   #============================================================================
   # __init__
   #============================================================================
   def __init__(self, mapCanvas):
      QgsMapCanvasItem.__init__(self, mapCanvas)
      self.__canvas = mapCanvas
      self.__iconType = QadVertexmarkerIconTypeEnum.X # icon to be shown

      self.__iconSize = QadVariables.get(QadMsg.translate("Environment variables", "AUTOSNAPSIZE"))