Esempio n. 1
0
    def __init__(self, selfobj):
        if M_DEBUG:
            print("running AlongLinePoint.__init__ !")

        self.name = "AlongLinePoint"
        WF_Point.__init__(self, selfobj, self.name)
        # Add some custom properties to our AlongLinePoint feature object.
        selfobj.addProperty("App::PropertyLinkSubGlobal",
                            "AlongEdge",
                            self.name,
                            "Along edge")
        selfobj.addProperty("App::PropertyLinkSubGlobal",
                            "Point",
                            self.name,
                            "point")
        selfobj.addProperty("App::PropertyLinkSubGlobal",
                            "Edge",
                            self.name,
                            "edge")

        m_tooltip = """Distance from the reference Point.
The reference Point is the projection of the selected Point(s)
onto the first selected Line.
Or the reference Point is the projection of Line(s) closest end
onto the first selected Line."""
        selfobj.addProperty("App::PropertyFloat",
                            "Distance",
                            self.name,
                            m_tooltip).Distance = M_DISTANCELINEPOINT

        selfobj.setEditorMode("AlongEdge", 1)
        selfobj.setEditorMode("Point", 1)
        selfobj.setEditorMode("Edge", 1)

        selfobj.Proxy = self
    def onChanged(self, selfobj, prop):
        """ Print the name of the property that has changed """
        # Debug mode
        if WF.verbose() != 0:
            App.Console.PrintMessage("Change property : " + str(prop) + "\n")

        WF_Point.onChanged(self, selfobj, prop)
    def __init__(self, selfobj):
        if M_DEBUG:
            print("running ExtremaLinePoint.__init__ !")

        self.name = "ExtremaLinePoint"
        WF_Point.__init__(self, selfobj, self.name)
        # Add some custom properties to our feature object.
        selfobj.addProperty("App::PropertyLinkSub", "Edge", self.name,
                            "Input edge")
        m_tooltip = """Indicates where is located the Point
relative to the parent Line.
        """
        selfobj.addProperty("App::PropertyEnumeration", "At", self.name,
                            m_tooltip)
        if sys.version_info > (3, 0):
            # Python 3 code in this block
            selfobj.At = [
                v.encode('utf8').decode('utf-8') for v in M_LOCATIONS
            ]
            selfobj.At = 'Begin'.encode('utf8').decode('utf-8')
        else:
            # Python 2 code in this block
            selfobj.At = [v.encode('utf8') for v in M_LOCATIONS]
            selfobj.At = 'Begin'.encode('utf8')

        selfobj.setEditorMode("Edge", 1)

        selfobj.Proxy = self
Esempio n. 4
0
    def onChanged(self, selfobj, prop):
        """ Run when a proterty change.
        """
        if M_DEBUG:
            print("running CenterLinePoint.onChanged !")
            print("Change property : " + str(prop))

        WF_Point.onChanged(self, selfobj, prop)

        if prop == "Parametric":
            if 'Parametric' in selfobj.PropertiesList:
                if selfobj.Parametric == 'Not':
                    selfobj.setEditorMode("NumberLinePart", 1)
                    selfobj.setEditorMode("IndexPart", 1)
                else:
                    selfobj.setEditorMode("NumberLinePart", 0)
                    selfobj.setEditorMode("IndexPart", 0)
            propertiesPoint(selfobj.Label, self.color)

        if prop == "IndexPart":
            selfobj.Proxy.execute(selfobj)

        if prop == 'NumberLinePart':
            if selfobj.NumberLinePart <= 1:
                selfobj.NumberLinePart = 2
            elif selfobj.NumberLinePart > 100:
                selfobj.NumberLinePart = 100
            selfobj.Proxy.execute(selfobj)
    def onChanged(self, selfobj, prop):
        if WF.verbose():
            App.Console.PrintMessage("Change property : " + str(prop) + "\n")

        if m_debug:
            print("running CenterLinePoint.onChanged !")

        WF_Point.onChanged(self, selfobj, prop)

        if prop == "Parametric":
            if 'Parametric' in selfobj.PropertiesList:
                if selfobj.Parametric == 'Not':
                    selfobj.setEditorMode("NumberLinePart", 1)
                    selfobj.setEditorMode("IndexPart", 1)
                else:
                    selfobj.setEditorMode("NumberLinePart", 0)
                    selfobj.setEditorMode("IndexPart", 0)
            propertiesPoint(selfobj.Label, self.color)

        if prop == "IndexPart":
            selfobj.Proxy.execute(selfobj)

        if prop == 'NumberLinePart':
            if selfobj.NumberLinePart <= 1:
                selfobj.NumberLinePart = 2
            elif selfobj.NumberLinePart > 100:
                selfobj.NumberLinePart = 100
            selfobj.Proxy.execute(selfobj)
    def __init__(self, selfobj):
        if m_debug:
            print("running ProjectedPoint.__init__ !")

        self.name = "ProjectedPoint"
        WF_Point.__init__(self, selfobj, self.name)
        # Add some custom properties to our ProjectedPoint feature object.
        selfobj.addProperty("App::PropertyLinkSub", "Point", self.name,
                            "Input Point")
        selfobj.addProperty("App::PropertyLinkSub", "Plane", self.name,
                            "Input Plane")
        m_tooltip = """Indicates the projection plane.
        """
        selfobj.addProperty("App::PropertyEnumeration", "At", self.name,
                            m_tooltip)
        if (sys.version_info > (3, 0)):
            # Python 3 code in this block
            selfobj.At = [
                v.encode('utf8').decode('utf-8') for v in m_sel_planeList
            ]
            selfobj.At = 'XY plane'.encode('utf8').decode('utf-8')
        else:
            # Python 2 code in this block
            selfobj.At = [v.encode('utf8') for v in m_sel_planeList]
            selfobj.At = 'XY plane'.encode('utf8')

        selfobj.setEditorMode("Point", 1)
        selfobj.setEditorMode("Plane", 1)

        selfobj.Proxy = self
    def __init__(self, selfobj):
        self.name = "CenterCirclePoint"
        WF_Point.__init__(self, selfobj, self.name)
        """ Add some custom properties to our CenterCirclePoint feature object. """
        selfobj.addProperty("App::PropertyLinkSub", "Edge", self.name,
                            "Input edge")

        selfobj.setEditorMode("Edge", 1)
        selfobj.Proxy = self
    def __init__(self, selfobj):
        if M_DEBUG:
            print("running CenterFacePoint.__init__ !")

        self.name = "CenterFacePoint"
        WF_Point.__init__(self, selfobj, self.name)
        """ Add some custom properties to our CenterFacePoint feature object. """
        selfobj.addProperty("App::PropertyLinkSub", "Face", self.name,
                            "Input face")

        selfobj.setEditorMode("Face", 1)
        selfobj.Proxy = self
Esempio n. 9
0
    def __init__(self, selfobj):
        if m_debug:
            print("running NPointsPoint.__init__ !")

        self.name = "NPointsPoint"
        WF_Point.__init__(self, selfobj, self.name)
        # Add some custom properties to our NPointsPoint feature object.
        selfobj.addProperty("App::PropertyLinkSubList", "Points", self.name,
                            "List of Points")
        selfobj.Points = []
        selfobj.setEditorMode("Points", 1)

        selfobj.Proxy = self
    def __init__(self, selfobj):
        if m_debug:
            print("running CenterLinePoint.__init__ !")

        self.name = "CenterLinePoint"
        WF_Point.__init__(self, selfobj, self.name)
        # Add some custom properties to our CenterLinePoint feature object.
        selfobj.addProperty("App::PropertyLinkSubGlobal",
                            "Edge",
                            self.name,
                            "Input edge")
        selfobj.addProperty("App::PropertyLinkSubGlobal",
                            "Point1",
                            self.name,
                            "Start point")
        selfobj.addProperty("App::PropertyLinkSubGlobal",
                            "Point2",
                            self.name,
                            "End point")

        m_tooltip = """The number indicates in how many Parts
each selected parent Lines(s) will be cut in.
Limits : (Min: 2, Max: 100).
"""
        selfobj.addProperty("App::PropertyInteger",
                            "NumberLinePart",
                            self.name,
                            m_tooltip).NumberLinePart = 2

        m_tooltip = """The location of the point :
1/2 means middle of the segment !
The number indicates at which part's end the point will be located.
- If the Number of parts is 2 and Point at part's end 1,
this means that the point will be located in the middle of the Line.
- If the Number of parts is 2 and Point at part's end 2,
this means that the point will be located in the end of the Line.

Negative value are allowed
Limits : [-1000:1000]
"""
        selfobj.addProperty("App::PropertyInteger",
                            "IndexPart",
                            self.name,
                            m_tooltip).IndexPart = 1

        selfobj.setEditorMode("Edge", 1)
        selfobj.setEditorMode("Point1", 1)
        selfobj.setEditorMode("Point2", 1)

        selfobj.Proxy = self
Esempio n. 11
0
    def onChanged(self, selfobj, prop):
        if WF.verbose():
            App.Console.PrintMessage("Change property : " + str(prop) + "\n")

        if M_DEBUG:
            print("running CenterFacePoint.onChanged !")

        WF_Point.onChanged(self, selfobj, prop)

        if prop == "Parametric":
            if 'Parametric' in selfobj.PropertiesList:
                if selfobj.Parametric == 'Not':
                    pass
                else:
                    pass
            propertiesPoint(selfobj.Label, self.color)
Esempio n. 12
0
    def onChanged(self, selfobj, prop):
        """ Run when a proterty change.
        """
        if M_DEBUG:
            print("running CenterLinePoint.onChanged !")
            print("Change property : " + str(prop))

        WF_Point.onChanged(self, selfobj, prop)

        if prop == "Parametric":
            if 'Parametric' in selfobj.PropertiesList:
                if selfobj.Parametric == 'Not':
                    selfobj.setEditorMode("Distance", 1)
                else:
                    selfobj.setEditorMode("Distance", 0)
            propertiesPoint(selfobj.Label, self.color)

        if prop == "Distance":
            selfobj.Proxy.execute(selfobj)
Esempio n. 13
0
    def onChanged(self, selfobj, prop):
        if WF.verbose():
            App.Console.PrintMessage("Change property : " + str(prop) + "\n")

        if m_debug:
            print("running AlongLinePoint.onChanged !")

        WF_Point.onChanged(self, selfobj, prop)

        if prop == "Parametric":
            if 'Parametric' in selfobj.PropertiesList:
                if selfobj.Parametric == 'Not':
                    selfobj.setEditorMode("Distance", 1)
                else:
                    selfobj.setEditorMode("Distance", 0)
            propertiesPoint(selfobj.Label, self.color)

        if prop == "Distance":
            selfobj.Proxy.execute(selfobj)