// The class is implemented as a singlton
SketcherPrs_PositionMgr* SketcherPrs_PositionMgr::get()
{
- if (MyPosMgr == NULL)
+ if (MyPosMgr == NULL)
MyPosMgr = new SketcherPrs_PositionMgr();
return MyPosMgr;
}
}
-int SketcherPrs_PositionMgr::getPositionIndex(ObjectPtr theLine,
+int SketcherPrs_PositionMgr::getPositionIndex(ObjectPtr theLine,
const SketcherPrs_SymbolPrs* thePrs)
{
if (myShapes.count(theLine) == 1) {
}
}
-gp_Pnt SketcherPrs_PositionMgr::getPosition(ObjectPtr theShape,
+gp_Pnt SketcherPrs_PositionMgr::getPosition(ObjectPtr theShape,
const SketcherPrs_SymbolPrs* thePrs,
double theStep)
{
gp_Pnt aP; // Central point
gp_Vec aVec1; // main vector
if (aShape->isEdge()) {
- std::shared_ptr<GeomAPI_Curve> aCurve =
+ std::shared_ptr<GeomAPI_Curve> aCurve =
std::shared_ptr<GeomAPI_Curve>(new GeomAPI_Curve(aShape));
std::shared_ptr<GeomAPI_Pnt> aPnt1; // Start point of main vector
std::shared_ptr<GeomAPI_Pnt> aPnt2; // End point of main vector
if (aCurve->isLine()) {
- std::shared_ptr<GeomAPI_Edge> aEdge =
+ std::shared_ptr<GeomAPI_Edge> aEdge =
std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(aShape));
aPnt1 = aEdge->firstPoint();
aVec1 = gp_Vec(aPnt1->impl<gp_Pnt>(), aPnt2->impl<gp_Pnt>());
} else {
// This is a point
- std::shared_ptr<GeomAPI_Vertex> aVertex =
+ std::shared_ptr<GeomAPI_Vertex> aVertex =
std::shared_ptr<GeomAPI_Vertex>(new GeomAPI_Vertex(aShape));
std::shared_ptr<GeomAPI_Pnt> aPnt = aVertex->point();
aP = aPnt->impl<gp_Pnt>();
// Even position
aP.Translate(aShift);
if (aPos > 0) {
- if (aPos % 4 == 0)
+ if (aPos % 4 == 0)
aM = aPos / 4;
else
aM = -(aPos + 2) / 4;
// Odd position
aP.Translate(-aShift);
if (aPos > 1) {
- if ((aPos - 1) % 4 == 0)
+ if ((aPos - 1) % 4 == 0)
aM = (aPos - 1) / 4;
else
aM = -(aPos + 1) / 4;