Skip to content

Commit

Permalink
Merge b11c0b8 into 59c1755
Browse files Browse the repository at this point in the history
  • Loading branch information
rupakbajgain committed Jun 27, 2020
2 parents 59c1755 + b11c0b8 commit 5492e62
Show file tree
Hide file tree
Showing 14 changed files with 121 additions and 121 deletions.
12 changes: 6 additions & 6 deletions lckernel/cad/primitive/arc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,29 +92,29 @@ geo::Coordinate Arc::nearestPointOnPath(const geo::Coordinate &coord) const {

CADEntity_CSPtr Arc::move(const geo::Coordinate &offset) const {
auto newArc = std::make_shared<Arc>(this->center() + offset, this->radius(), this->startAngle(), this->endAngle(),
this->CCW(), layer());
this->CCW(), layer(), metaInfo(), block());
newArc->setID(this->id());
return newArc;
}

CADEntity_CSPtr Arc::copy(const geo::Coordinate &offset) const {
auto newArc = std::make_shared<Arc>(this->center() + offset, this->radius(), this->startAngle(), this->endAngle(),
this->CCW(), layer());
this->CCW(), layer(), metaInfo(), block());
return newArc;
}

CADEntity_CSPtr Arc::rotate(const geo::Coordinate &rotation_center, const double rotation_angle) const {
auto newArc = std::make_shared<Arc>(this->center().rotate(rotation_center, rotation_angle),
this->radius(), this->startAngle() + rotation_angle,
this->endAngle() + rotation_angle, this->CCW(), layer());
this->endAngle() + rotation_angle, this->CCW(), layer(), metaInfo(), block());
newArc->setID(this->id());
return newArc;
}

CADEntity_CSPtr Arc::scale(const geo::Coordinate &scale_center, const geo::Coordinate &scale_factor) const {
auto newArc = std::make_shared<Arc>(this->center().scale(scale_center, scale_factor),
this->radius() * fabs(scale_factor.x()),
this->startAngle(), this->endAngle(), this->CCW(), layer());
this->startAngle(), this->endAngle(), this->CCW(), layer(), metaInfo(), block());
newArc->setID(this->id());
return newArc;

Expand All @@ -127,7 +127,7 @@ CADEntity_CSPtr Arc::mirror(const geo::Coordinate &axis1, const geo::Coordinate
this->radius(),
lc::maths::Math::correctAngle(a - this->startAngle()),
lc::maths::Math::correctAngle(a - this->endAngle()),
!this->CCW(), layer());
!this->CCW(), layer(), metaInfo(), block());
newArc->setID(this->id());
return newArc;

Expand Down Expand Up @@ -164,4 +164,4 @@ CADEntity_CSPtr Arc::setDragPoints(std::map<unsigned int, lc::geo::Coordinate> d
catch(std::out_of_range& e) {
return shared_from_this();
}
}
}
10 changes: 5 additions & 5 deletions lckernel/cad/primitive/circle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,19 @@ geo::Coordinate Circle::nearestPointOnPath(const geo::Coordinate &coord) const {
}

CADEntity_CSPtr Circle::move(const geo::Coordinate &offset) const {
auto newCircle = std::make_shared<Circle>(this->center() + offset, this->radius(), layer(), metaInfo());
auto newCircle = std::make_shared<Circle>(this->center() + offset, this->radius(), layer(), metaInfo(), block());
newCircle->setID(this->id());
return newCircle;
}

CADEntity_CSPtr Circle::copy(const geo::Coordinate &offset) const {
auto newCircle = std::make_shared<Circle>(this->center() + offset, this->radius(), layer(), metaInfo());
auto newCircle = std::make_shared<Circle>(this->center() + offset, this->radius(), layer(), metaInfo(), block());
return newCircle;
}

CADEntity_CSPtr Circle::rotate(const geo::Coordinate &rotation_center, const double rotation_angle) const {
auto newCircle = std::make_shared<Circle>(this->center().rotate(rotation_center, rotation_angle), this->radius(),
layer(), metaInfo());
layer(), metaInfo(), block());
newCircle->setID(this->id());
return newCircle;
}
Expand All @@ -85,14 +85,14 @@ CADEntity_CSPtr Circle::scale(const geo::Coordinate &scale_center, const geo::Co
// TODO return ellipse if scalefactor.x != scalefactor.y

auto newCircle = std::make_shared<Circle>(this->center().scale(scale_center, scale_factor),
this->radius() * fabs(scale_factor.x()), layer(), metaInfo());
this->radius() * fabs(scale_factor.x()), layer(), metaInfo(), block());
newCircle->setID(this->id());
return newCircle;
}

CADEntity_CSPtr Circle::mirror(const geo::Coordinate &axis1, const geo::Coordinate &axis2) const {
auto newCircle = std::make_shared<Circle>(this->center().mirror(axis1, axis2),
this->radius(), layer(), metaInfo());
this->radius(), layer(), metaInfo(), block());
newCircle->setID(this->id());
return newCircle;
}
Expand Down
18 changes: 6 additions & 12 deletions lckernel/cad/primitive/dimaligned.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ CADEntity_CSPtr DimAligned::move(const geo::Coordinate& offset) const {
this->explicitValue(),
this->_definitionPoint2 + offset,
this->_definitionPoint3 + offset,
this->layer(),
this->metaInfo()
this->layer(), metaInfo(), block()
);
newDimAligned->setID(this->id());
return newDimAligned;
Expand All @@ -75,8 +74,7 @@ CADEntity_CSPtr DimAligned::copy(const geo::Coordinate& offset) const {
this->explicitValue(),
this->_definitionPoint2 + offset,
this->_definitionPoint3 + offset,
this->layer(),
this->metaInfo()
this->layer(), metaInfo(), block()
);
return newDimAligned;
}
Expand All @@ -91,8 +89,7 @@ CADEntity_CSPtr DimAligned::rotate(const geo::Coordinate& rotation_center, doubl
this->explicitValue(),
this->_definitionPoint2.rotate(rotation_center, rotation_angle),
this->_definitionPoint3.rotate(rotation_center, rotation_angle),
this->layer(),
this->metaInfo()
this->layer(), metaInfo(), block()
);
return newDimAligned;
}
Expand All @@ -107,8 +104,7 @@ CADEntity_CSPtr DimAligned::scale(const geo::Coordinate& scale_center, const geo
this->explicitValue(),
this->_definitionPoint2.scale(scale_center, scale_factor),
this->_definitionPoint3.scale(scale_center, scale_factor),
this->layer(),
this->metaInfo()
this->layer(), metaInfo(), block()
);
return newDimAligned;
}
Expand All @@ -125,8 +121,7 @@ CADEntity_CSPtr DimAligned::mirror(const geo::Coordinate& axis1,
this->explicitValue(),
this->_definitionPoint2.mirror(axis1, axis2),
this->_definitionPoint3.mirror(axis1, axis2),
this->layer(),
this->metaInfo()
this->layer(), metaInfo(), block()
);
return newDimAligned;
}
Expand Down Expand Up @@ -185,8 +180,7 @@ CADEntity_CSPtr DimAligned::setDragPoints(std::map<unsigned int, lc::geo::Coordi
explicitValue(),
dragPoints.at(2),
dragPoints.at(3),
layer(),
metaInfo());
layer(), metaInfo(), block());
newEntity->setID(id());
return newEntity;
}
Expand Down
18 changes: 6 additions & 12 deletions lckernel/cad/primitive/dimdiametric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ CADEntity_CSPtr DimDiametric::move(const geo::Coordinate& offset) const {
this->explicitValue(),
this->_definitionPoint2 + offset,
this->_leader,
this->layer(),
this->metaInfo());
this->layer(), metaInfo(), block());
newDimDiametric->setID(this->id());
return newDimDiametric;
}
Expand All @@ -73,8 +72,7 @@ CADEntity_CSPtr DimDiametric::copy(const geo::Coordinate& offset) const {
this->explicitValue(),
this->_definitionPoint2 + offset,
this->_leader,
this->layer(),
this->metaInfo());
this->layer(), metaInfo(), block());
return newDimDiametric;
}

Expand All @@ -89,8 +87,7 @@ CADEntity_CSPtr DimDiametric::rotate(const geo::Coordinate& rotation_center, con
this->explicitValue(),
this->_definitionPoint2.rotate(rotation_center, rotation_angle),
this->_leader,
this->layer(),
this->metaInfo());
this->layer(), metaInfo(), block());
return newDimDiametric;
}

Expand All @@ -104,8 +101,7 @@ CADEntity_CSPtr DimDiametric::scale(const geo::Coordinate& scale_center, const g
this->explicitValue(),
this->_definitionPoint2.scale(scale_center, scale_factor),
this->_leader,
this->layer(),
this->metaInfo());
this->layer(), metaInfo(), block());
return newDimDiametric;
}

Expand All @@ -119,8 +115,7 @@ CADEntity_CSPtr DimDiametric::mirror(const geo::Coordinate& axis1, const geo::Co
this->explicitValue(),
this->_definitionPoint2.mirror(axis1, axis2),
this->_leader,
this->layer(),
this->metaInfo());
this->layer(), metaInfo(), block());
return newDimDiametric;
}

Expand Down Expand Up @@ -178,8 +173,7 @@ CADEntity_CSPtr DimDiametric::setDragPoints(std::map<unsigned int, lc::geo::Coor
explicitValue(),
dragPoints.at(2),
leader(),
layer(),
metaInfo());
layer(), metaInfo(), block());
newEntity->setID(id());
return newEntity;
}
Expand Down
17 changes: 6 additions & 11 deletions lckernel/cad/primitive/dimlinear.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ CADEntity_CSPtr DimLinear::move(const geo::Coordinate& offset) const {
this->_definitionPoint3 + offset,
this->_angle,
this->_oblique,
this->layer(),
this->metaInfo()
this->layer(), metaInfo(), block()
);
newDimLinear->setID(this->id());
return newDimLinear;
Expand All @@ -85,8 +84,7 @@ CADEntity_CSPtr DimLinear::copy(const geo::Coordinate& offset) const {
this->_definitionPoint3 + offset,
this->_angle,
this->_oblique,
this->layer(),
this->metaInfo()
this->layer(), metaInfo(), block()
);
return newDimLinear;
}
Expand All @@ -103,8 +101,7 @@ CADEntity_CSPtr DimLinear::rotate(const geo::Coordinate& rotation_center, double
this->_definitionPoint3.rotate(rotation_center, rotation_angle),
this->_angle,
this->_oblique,
this->layer(),
this->metaInfo()
this->layer(), metaInfo(), block()
);
return newDimLinear;
}
Expand All @@ -121,8 +118,7 @@ CADEntity_CSPtr DimLinear::scale(const geo::Coordinate& scale_center, const geo:
this->_definitionPoint3.scale(scale_center, scale_factor),
this->_angle,
this->_oblique,
this->layer(),
this->metaInfo()
this->layer(), metaInfo(), block()
);
return newDimLinear;
}
Expand Down Expand Up @@ -192,12 +188,11 @@ CADEntity_CSPtr DimLinear::setDragPoints(std::map<unsigned int, lc::geo::Coordin
dragPoints.at(3),
angle(),
oblique(),
layer(),
metaInfo());
layer(), metaInfo(), block());
newEntity->setID(id());
return newEntity;
}
catch(std::out_of_range& e) {
return shared_from_this();
}
}
}
19 changes: 7 additions & 12 deletions lckernel/cad/primitive/dimradial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ CADEntity_CSPtr DimRadial::move(const geo::Coordinate& offset) const {
this->explicitValue(),
this->_definitionPoint2 + offset,
this->_leader,
this->layer(),
this->metaInfo()
this->layer()
, metaInfo(), block()
);
newDimRadial->setID(this->id());
return newDimRadial;
Expand All @@ -74,8 +74,7 @@ CADEntity_CSPtr DimRadial::copy(const geo::Coordinate& offset) const {
this->explicitValue(),
this->_definitionPoint2 + offset,
this->_leader,
this->layer(),
this->metaInfo()
this->layer(), metaInfo(), block()
);
return newDimRadial;
}
Expand All @@ -90,8 +89,7 @@ CADEntity_CSPtr DimRadial::rotate(const geo::Coordinate& rotation_center, double
this->explicitValue(),
this->_definitionPoint2.rotate(rotation_center, rotation_angle),
this->_leader,
this->layer(),
this->metaInfo()
this->layer(), metaInfo(), block()
);
return newDimRadial;
}
Expand All @@ -106,8 +104,7 @@ CADEntity_CSPtr DimRadial::scale(const geo::Coordinate& scale_center, const geo:
this->explicitValue(),
this->_definitionPoint2.scale(scale_center, scale_factor),
this->_leader,
this->layer(),
this->metaInfo()
this->layer(), metaInfo(), block()
);
return newDimRadial;
}
Expand All @@ -122,8 +119,7 @@ CADEntity_CSPtr DimRadial::mirror(const geo::Coordinate& axis1, const geo::Coord
this->explicitValue(),
this->_definitionPoint2.mirror(axis1,axis2),
this->_leader,
this->layer(),
this->metaInfo()
this->layer(), metaInfo(), block()
);
return newDimRadial;
}
Expand Down Expand Up @@ -181,8 +177,7 @@ CADEntity_CSPtr DimRadial::setDragPoints(std::map<unsigned int, lc::geo::Coordin
explicitValue(),
dragPoints.at(2),
leader(),
layer(),
metaInfo());
layer(), metaInfo(), block());
newEntity->setID(id());
return newEntity;
}
Expand Down

0 comments on commit 5492e62

Please sign in to comment.