Esempio n. 1
0
    def __init__(self, obj, spline, sketch):
        '''
        Main class intialization
        '''

        obj.Proxy = self
        self.Type = '_' + _CLASS_NAME
        self.Object = None

        #add class properties
        Properties.add(obj,
                       'StringList',
                       'Control_Schedule',
                       'Schedule for loft controls', [],
                       is_read_only=True,
                       is_hidden=False)
        Properties.add(obj, 'Link', 'Alignment', 'Linked alignment', spline)
        Properties.add(obj, 'Link', 'Template', 'Linked template', sketch)
        Properties.add(obj, 'Float', 'Interval', 'Section spacing interval',
                       100.0)
        Properties.add(obj,
                       'FloatList',
                       'Interval_Schedule',
                       'Schedule for loft section intervals', [],
                       is_read_only=True,
                       is_hidden=False)

        self.Object = obj
Esempio n. 2
0
    def __init__(self, obj):

        obj.Proxy = self
        self.Type = "AlignmentGroup"
        self.Object = obj

        Properties.add(obj, 'String', 'ID', 'Alignment group name', '',
                       is_read_only=True)

        Properties.add(obj, 'String', 'Description', 'Alignment group description', '',
                       is_read_only=True)

        Properties.add(obj, 'FileIncluded', 'Xml_Path', '', '', is_hidden=True)

        ProjectObserver.get(App.ActiveDocument).register('StartSaveDocument', self.write_xml)
Esempio n. 3
0
    def __init__(self, obj, label=''):
        """
        Default Constructor
        """

        super(_VerticalAlignment, self).__init__(obj)

        self.no_execute = True

        obj.Proxy = self
        self.Type = _CLASS_NAME
        self.Object = obj
        self.errors = []

        obj.Label = label
        obj.Closed = False

        if not label:
            obj.Label = obj.Name

        #add class properties
        Properties.add(obj, 'String', 'ID', 'ID of alignment', '')
        Properties.add(obj, 'Vector', 'Datum',
                       'Datum value as Station / Elevation',
                       App.Vector(0.0, 0.0, 0.0))
        Properties.add(obj, 'StringList', 'Geometry',
                       'Geometry defining the alignment', [])
        Properties.add(obj,
                       'String',
                       'Units',
                       'Alignment units',
                       'English',
                       is_read_only=True)
        Properties.add(
            obj, 'VectorList', 'PIs',
            'Discretization of Points of Intersection (PIs) as a list of vectors',
            [])
        Properties.add(obj, 'String', 'Horizontal Alignment',
                       'Name of horizontal alignment object', None)

        subdivision_desc = 'Method of Curve Subdivision\n\nTolerance - ensure error between segments and curve is approximately (n)\nInterval - Subdivide curve into segments of a fixed length (n)\nSegment - Subdivide curve into (n) equal-length segments'

        obj.addProperty(
            'App::PropertyEnumeration', 'Method', 'Segment',
            subdivision_desc).Method = ['Tolerance', 'Interval', 'Segment']

        Properties.add(obj, 'Float', 'Segment.Seg_Value',
                       'Set the curve segments to control accuracy', 1.0)

        delattr(self, 'no_execute')
    def __init__(self, obj):
        """
        Default Constructor
        """

        obj.Proxy = self
        self.Type = 'VerticalCurve'
        self.Object = None

        Properties.add(obj, 'Length', 'General.PC_Station',
                       'Station of the vertical Point of Curvature', 0.00,
                       True)
        Properties.add(obj, 'Distance', 'General.PC_Elevation',
                       'Elevtaion of the vertical Point of Curvature', 0.00,
                       True)
        Properties.add(obj, 'Length', 'General.PI_Station',
                       'Station of the vertical Point of Intersection', 0.00)
        Properties.add(obj, 'Distance', 'General.PI_Elevation',
                       'Elevtaion of the vertical Point of Intersection', 0.00)
        Properties.add(obj, 'Length', 'General.PT_Station',
                       'Station of the vertical Point of Tangency', 0.00, True)
        Properties.add(obj, 'Distance', 'General.PT_Elevation',
                       'Elevtaion of the vertical Point of Tangency', 0.00,
                       True)
        Properties.add(obj, 'Float', 'General.Grade_In',
                       'Grade of tangent between VPC and VPI', 0.00)
        Properties.add(obj, 'Float', 'General.Grade_Out',
                       'Grade of tangent beteen VPI and VPT', 0.00)
        Properties.add(obj, 'Length', 'General.Length',
                       'Length of the vertical curve', 0.00)
        Properties.add(obj, 'Float', 'Characteristics.A',
                       'Absolute difference between grades', 0.00, True)
        Properties.add(obj, 'Length', 'Characteristics.K', 'Rate of Curvature',
                       0.00, True)
        Properties.add(obj, 'Bool', 'Characteristics.Equal_Tangent',
                       'Is this an Equal Tangent Curve?', True, True)

        self.Object = obj
    def __init__(self, obj, label=''):
        '''
        Default Constructor
        '''

        super(_HorizontalAlignment, self).__init__(obj)

        self.no_execute = True

        obj.Proxy = self
        self.Type = _CLASS_NAME
        self.Object = obj
        self.errors = []

        self.geometry = []
        self.meta = {}

        obj.Label = label
        obj.Closed = False

        if not label:
            obj.Label = obj.Name

        #add class properties

        #metadata
        Properties.add(obj, 'String', 'ID', 'ID of alignment', '')
        Properties.add(obj, 'String', 'oID', 'Object ID', '')
        Properties.add(obj,
                       'Length',
                       'Length',
                       'Alignment length',
                       0.0,
                       is_read_only=True)
        Properties.add(obj, 'String', 'Description', 'Alignment description',
                       '')
        Properties.add(obj, 'Length', 'Start Station',
                       'Starting station of the alignment', 0.0)

        obj.addProperty('App::PropertyEnumeration', 'Status', 'Base',
                        'Alignment status').Status = [
                            'existing', 'proposed', 'abandoned', 'destroyed'
                        ]

        #Properties.add(obj, 'String', 'Units', 'Alignment units', 'English', is_read_only=True)

        #station
        #Properties.add(obj, 'Vector', 'Intersection Equation',
        #              'Equation for intersection with parent alignment', App.Vector(0.0, 0.0, 0.0))
        Properties.add(obj, 'VectorList', 'Station Equations',
                       'Station equation along the alignment', [])
        Properties.add(obj, 'Vector', 'Datum',
                       'Datum value as Northing / Easting',
                       App.Vector(0.0, 0.0, 0.0))

        #geometry
        Properties.add(
            obj, 'VectorList', 'PIs',
            'Discretization of Points of Intersection (PIs) as a list of vectors',
            [])

        Properties.add(obj, 'Link', 'Parent Alignment',
                       'Links to parent alignment object', None)

        subdivision_desc = 'Method of Curve Subdivision\n\nTolerance - ensure error between segments and curve is approximately (n)\nInterval - Subdivide curve into segments of a fixed length (n)\nSegment - Subdivide curve into (n) equal-length segments'

        obj.addProperty(
            'App::PropertyEnumeration', 'Method', 'Segment',
            subdivision_desc).Method = ['Tolerance', 'Interval', 'Segment']

        Properties.add(obj, 'Float', 'Segment.Seg_Value',
                       'Set the curve segments to control accuracy', 1.0)

        delattr(self, 'no_execute')
    def __init__(self, obj, label=''):
        """
        Default Constructor
        """

        super(_HorizontalAlignment, self).__init__(obj)

        self.no_execute = True

        obj.Proxy = self
        self.Type = _CLASS_NAME
        self.Object = obj
        self.errors = []

        obj.Label = label
        obj.Closed = False

        if not label:
            obj.Label = obj.Name

        #add class properties
        Properties.add(obj, 'String', 'ID', 'ID of alignment', '')
        Properties.add(
            obj, 'Vector', 'Intersection Equation',
            'Station equation for intersections with parent alignment',
            App.Vector(0.0, 0.0, 0.0))
        Properties.add(obj, 'VectorList', 'Alignment Equations',
                       'Station equation along the alignment', [])
        Properties.add(obj, 'Vector', 'Datum',
                       'Datum value as Northing / Easting',
                       App.Vector(0.0, 0.0, 0.0))
        Properties.add(obj, 'VectorList', 'Geometry',
                       'Geometry defining the alignment', [])
        Properties.add(obj,
                       'String',
                       'Units',
                       'Alignment units',
                       'English',
                       is_read_only=True)
        Properties.add(
            obj, 'VectorList', 'PIs',
            'Discretization of Points of Intersection (PIs) as a list of vectors',
            [])
        Properties.add(obj, 'Integer', 'Segments',
                       'Set the curve segments to control accuracy', 1)
        Properties.add(obj, 'Link', 'Parent Alignment',
                       'Links to parent alignment object', None)
        obj.addProperty(
            'App::PropertyEnumeration', 'Draft Shape', '',
            'Represent the alignment as either a Spline or Wire shape'
        ).Draft_Shape = ['Wire', 'Spline']

        delattr(self, 'no_execute')