mirror of https://gitlab.com/pamhyr/pamhyr2
geometry: Factorize profile.
parent
878c1403b6
commit
9a165d59d0
|
|
@ -0,0 +1,45 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
class Profile(object):
|
||||||
|
def __init__(self, kp:float = 0.0, name:str = ""):
|
||||||
|
super(Profile, self).__init__()
|
||||||
|
|
||||||
|
self._num = int(num)
|
||||||
|
self._kp = float(kp)
|
||||||
|
self._name = str(name)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def num(self):
|
||||||
|
"""
|
||||||
|
Returns:
|
||||||
|
Number of profile.
|
||||||
|
"""
|
||||||
|
return self._num
|
||||||
|
|
||||||
|
@num.setter
|
||||||
|
def num(self, value: int):
|
||||||
|
self._num = int(value)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def kp(self):
|
||||||
|
"""
|
||||||
|
Returns:
|
||||||
|
Kilometer point.
|
||||||
|
"""
|
||||||
|
return self._kp
|
||||||
|
|
||||||
|
@kp.setter
|
||||||
|
def kp(self, value: float):
|
||||||
|
self._kp = float(value)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def name(self):
|
||||||
|
"""
|
||||||
|
Returns:
|
||||||
|
Profile name.
|
||||||
|
"""
|
||||||
|
return self._name
|
||||||
|
|
||||||
|
@name.setter
|
||||||
|
def name(self, other: str):
|
||||||
|
self._name = other
|
||||||
|
|
@ -4,11 +4,11 @@ import numpy as np
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
from Model.Geometry.PointXYZ import PointXYZ
|
from Model.Geometry.Profile import Profile
|
||||||
|
|
||||||
class ProfileXYZ:
|
class ProfileXYZ(Profile):
|
||||||
def __init__(self, num: int = 0, code1: int = 0, code2: int = 0,
|
def __init__(self, num: int = 0, code1: int = 0, code2: int = 0,
|
||||||
nb_points: int = 0, kp: float = 0., name: str = ""):
|
kp: float = 0., name: str = ""):
|
||||||
"""ProfileXYZ constructor
|
"""ProfileXYZ constructor
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
|
@ -22,12 +22,15 @@ class ProfileXYZ:
|
||||||
Returns:
|
Returns:
|
||||||
Nothing.
|
Nothing.
|
||||||
"""
|
"""
|
||||||
self._num = int(num)
|
super(ProfileXYZ, self).__init__(
|
||||||
|
num = num,
|
||||||
|
name = name
|
||||||
|
kp = kp,
|
||||||
|
)
|
||||||
|
|
||||||
self._code1 = int(code1)
|
self._code1 = int(code1)
|
||||||
self._code2 = int(code2)
|
self._code2 = int(code2)
|
||||||
self._nb_points = int(nb_points)
|
self._nb_points = int(nb_points)
|
||||||
self._kp = float(kp)
|
|
||||||
self._name = str(name)
|
|
||||||
self._list_points: List[PointXYZ] = []
|
self._list_points: List[PointXYZ] = []
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
|
|
@ -35,17 +38,6 @@ class ProfileXYZ:
|
||||||
data=[[p.x, p.y, p.z, p.name] for p in self._list_points])
|
data=[[p.x, p.y, p.z, p.name] for p in self._list_points])
|
||||||
return f"\n{self.header}\n{df}"
|
return f"\n{self.header}\n{df}"
|
||||||
|
|
||||||
@property
|
|
||||||
def num(self):
|
|
||||||
"""
|
|
||||||
Returns:
|
|
||||||
Number of profile.
|
|
||||||
"""
|
|
||||||
return self._num
|
|
||||||
|
|
||||||
@num.setter
|
|
||||||
def num(self, value: int):
|
|
||||||
self._num = int(value)
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def code1(self):
|
def code1(self):
|
||||||
|
|
@ -75,34 +67,6 @@ class ProfileXYZ:
|
||||||
def nb_points(self):
|
def nb_points(self):
|
||||||
return self._nb_points
|
return self._nb_points
|
||||||
|
|
||||||
# @nb_points.setter
|
|
||||||
# def nb_points(self, nb: int):
|
|
||||||
# self._nb_points = int(nb)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def kp(self):
|
|
||||||
"""
|
|
||||||
Returns:
|
|
||||||
Kilometer point.
|
|
||||||
"""
|
|
||||||
return self._kp
|
|
||||||
|
|
||||||
@kp.setter
|
|
||||||
def kp(self, value: float):
|
|
||||||
self._kp = float(value)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def name(self):
|
|
||||||
"""
|
|
||||||
Returns:
|
|
||||||
Profile name.
|
|
||||||
"""
|
|
||||||
return self._name
|
|
||||||
|
|
||||||
@name.setter
|
|
||||||
def name(self, other: str):
|
|
||||||
self._name = other
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def header(self):
|
def header(self):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue