[TD]getters and setters for geometry

- make attributes private (or protected) and use
  getters and setters instead of accessing attributes
  directly.
This commit is contained in:
wandererfan
2023-02-11 17:51:05 -05:00
committed by WandererFan
parent 662473b11f
commit 704fb894a5
20 changed files with 249 additions and 211 deletions

View File

@@ -229,7 +229,7 @@ void CosmeticEdgePy::setEnd(Py::Vector arg)
Py::Float CosmeticEdgePy::getRadius() const
{
TechDraw::GeomType gt = getCosmeticEdgePtr()->m_geometry->geomType;
TechDraw::GeomType gt = getCosmeticEdgePtr()->m_geometry->getGeomType();
if ( (gt != TechDraw::GeomType::CIRCLE) &&
(gt != TechDraw::GeomType::ARCOFCIRCLE) ) {
throw Py::TypeError("Not a circle. Can not get radius");
@@ -240,7 +240,7 @@ Py::Float CosmeticEdgePy::getRadius() const
void CosmeticEdgePy::setRadius(Py::Float arg)
{
TechDraw::GeomType gt = getCosmeticEdgePtr()->m_geometry->geomType;
TechDraw::GeomType gt = getCosmeticEdgePtr()->m_geometry->getGeomType();
if ( (gt != TechDraw::GeomType::CIRCLE) &&
(gt != TechDraw::GeomType::ARCOFCIRCLE) ) {
throw Py::TypeError("Not a circle. Can not set radius");
@@ -256,7 +256,7 @@ void CosmeticEdgePy::setRadius(Py::Float arg)
Py::Vector CosmeticEdgePy::getCenter() const
{
TechDraw::GeomType gt = getCosmeticEdgePtr()->m_geometry->geomType;
TechDraw::GeomType gt = getCosmeticEdgePtr()->m_geometry->getGeomType();
if ( (gt != TechDraw::GeomType::CIRCLE) &&
(gt != TechDraw::GeomType::ARCOFCIRCLE) ) {
throw Py::TypeError("Not a circle. Can not get center");
@@ -268,7 +268,7 @@ Py::Vector CosmeticEdgePy::getCenter() const
void CosmeticEdgePy::setCenter(Py::Vector arg)
{
TechDraw::GeomType gt = getCosmeticEdgePtr()->m_geometry->geomType;
TechDraw::GeomType gt = getCosmeticEdgePtr()->m_geometry->getGeomType();
// PyObject* p = arg.ptr();
if ( (gt != TechDraw::GeomType::CIRCLE) &&
(gt != TechDraw::GeomType::ARCOFCIRCLE) ) {