Skip to content

Commit e089a61

Browse files
committed
odb: separate Point3D from Point
Signed-off-by: Osama <[email protected]>
1 parent c92d017 commit e089a61

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

src/odb/include/odb/geom.h

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,34 +64,39 @@ class Point
6464

6565
std::ostream& operator<<(std::ostream& os, const Point& pIn);
6666

67-
class Point3D : public Point
67+
class Point3D
6868
{
6969
public:
7070
Point3D() = default;
71-
Point3D(int x, int y, int z) : Point(x, y), z_(z) {}
71+
Point3D(int x, int y, int z) : x_(x), y_(y), z_(z) {}
7272
Point3D& operator=(const Point3D&) = default;
73-
Point3D(const Point3D& p) : Point(p.getX(), p.getY()), z_(p.getZ()) {}
74-
Point3D(const Point& p, int z) : Point(p), z_(z) {}
73+
Point3D(const Point3D& p) : x_(p.x()), y_(p.y()), z_(p.z()) {}
74+
Point3D(const Point& p, int z) : x_(p.x()), y_(p.y()), z_(z) {}
7575

7676
bool operator==(const Point3D& rhs) const;
7777
bool operator!=(const Point3D& rhs) const { return !(*this == rhs); }
7878
bool operator<(const Point3D& rhs) const;
7979
bool operator>=(const Point3D& rhs) const { return !(*this < rhs); }
8080

81-
int z() const { return getZ(); }
82-
int getZ() const { return z_; }
81+
int z() const { return z_; }
8382
void setZ(int z) { z_ = z; }
83+
int x() const { return x_; }
84+
void setX(int x) { x_ = x; }
85+
int y() const { return y_; }
86+
void setY(int y) { y_ = y; }
8487
void set(const int x, const int y, const int z)
8588
{
8689
setX(x);
8790
setY(y);
88-
z_ = z;
91+
setZ(z);
8992
}
9093

9194
friend dbIStream& operator>>(dbIStream& stream, Point3D& p);
9295
friend dbOStream& operator<<(dbOStream& stream, const Point3D& p);
9396

9497
private:
98+
int x_ = 0;
99+
int y_ = 0;
95100
int z_ = 0;
96101
};
97102

src/odb/src/db/dbChipInst.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ dbOrientType dbChipInst::getOrient() const
141141
dbTransform dbChipInst::getTransform() const
142142
{
143143
_dbChipInst* obj = (_dbChipInst*) this;
144-
return dbTransform(obj->orient_, obj->loc_);
144+
// TODO: Add 3d Point handling to the transform
145+
return dbTransform(obj->orient_, Point(obj->loc_.x(), obj->loc_.y()));
145146
}
146147

147148
dbChipInst* dbChipInst::create(dbChip* parent_chip,

0 commit comments

Comments
 (0)