[TD]fix bad 3d dimensions
- mapToPage was left in place when converting to using projectPoint instead of projectToPlane.
This commit is contained in:
@@ -50,7 +50,7 @@ void pointPair::move(Base::Vector3d offset)
|
||||
m_second = m_second - offset;
|
||||
}
|
||||
|
||||
// project the points onto the dvp's paper plane. Points are still in R3 coords.
|
||||
// project the points onto the dvp's paper plane.
|
||||
void pointPair::project(DrawViewPart* dvp)
|
||||
{
|
||||
m_first = dvp->projectPoint(m_first) * dvp->getScale();
|
||||
@@ -58,6 +58,8 @@ void pointPair::project(DrawViewPart* dvp)
|
||||
}
|
||||
|
||||
// map the points onto the dvp's XY coordinate system
|
||||
// this routine is no longer needed since we now use the hlr projector instead
|
||||
// of "projectToPlane" from Vector3d
|
||||
void pointPair::mapToPage(DrawViewPart* dvp)
|
||||
{
|
||||
gp_Trsf xOXYZ;
|
||||
@@ -70,13 +72,15 @@ void pointPair::mapToPage(DrawViewPart* dvp)
|
||||
m_second = DU::toVector3d(gvSecond);
|
||||
}
|
||||
|
||||
// this routine is no longer needed since we now use the dvp's projectPoint
|
||||
// which performs Y inversion by default
|
||||
void pointPair::invertY()
|
||||
{
|
||||
m_first = DU::invertY(m_first);
|
||||
m_second = DU::invertY(m_second);
|
||||
}
|
||||
|
||||
void pointPair::dump(std::string &text) const
|
||||
void pointPair::dump(std::string text) const
|
||||
{
|
||||
Base::Console().Message("pointPair - %s\n", text.c_str());
|
||||
Base::Console().Message("pointPair - first: %s second: %s\n",
|
||||
@@ -106,7 +110,7 @@ void anglePoints::move(Base::Vector3d offset)
|
||||
m_vertex = m_vertex - offset;
|
||||
}
|
||||
|
||||
// project the points onto the dvp's paper plane. Points are still in R3 coords.
|
||||
// project the points onto the dvp's paper plane.
|
||||
void anglePoints::project(DrawViewPart* dvp)
|
||||
{
|
||||
m_ends.project(dvp);
|
||||
@@ -114,6 +118,7 @@ void anglePoints::project(DrawViewPart* dvp)
|
||||
}
|
||||
|
||||
// map the points onto the dvp's XY coordinate system
|
||||
// obsolete. see above.
|
||||
void anglePoints::mapToPage(DrawViewPart* dvp)
|
||||
{
|
||||
m_ends.mapToPage(dvp);
|
||||
@@ -126,13 +131,14 @@ void anglePoints::mapToPage(DrawViewPart* dvp)
|
||||
}
|
||||
|
||||
// map the points onto the coordinate system used for drawing where -Y direction is "up"
|
||||
// obsolete. see above
|
||||
void anglePoints::invertY()
|
||||
{
|
||||
m_ends.invertY();
|
||||
m_vertex = DU::invertY(m_vertex);
|
||||
}
|
||||
|
||||
void anglePoints::dump(std::string &text) const
|
||||
void anglePoints::dump(std::string text) const
|
||||
{
|
||||
Base::Console().Message("anglePoints - %s\n", text.c_str());
|
||||
Base::Console().Message("anglePoints - ends - first: %s second: %s\n",
|
||||
@@ -186,6 +192,7 @@ void arcPoints::project(DrawViewPart* dvp)
|
||||
midArc = dvp->projectPoint(midArc) * dvp->getScale();
|
||||
}
|
||||
|
||||
// obsolete. see above
|
||||
void arcPoints::mapToPage(DrawViewPart* dvp)
|
||||
{
|
||||
gp_Trsf xOXYZ;
|
||||
@@ -206,6 +213,7 @@ void arcPoints::mapToPage(DrawViewPart* dvp)
|
||||
midArc = DU::toVector3d(gvMidArc);
|
||||
}
|
||||
|
||||
// obsolete. see above
|
||||
void arcPoints::invertY()
|
||||
{
|
||||
center = DU::invertY(center);
|
||||
@@ -214,7 +222,7 @@ void arcPoints::invertY()
|
||||
midArc = DU::invertY(midArc);
|
||||
}
|
||||
|
||||
void arcPoints::dump(std::string &text) const
|
||||
void arcPoints::dump(std::string text) const
|
||||
{
|
||||
Base::Console().Message("arcPoints - %s\n", text.c_str());
|
||||
Base::Console().Message("arcPoints - radius: %.3f center: %s\n", radius,
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
void project(DrawViewPart* dvp);
|
||||
void mapToPage(DrawViewPart* dvp);
|
||||
void invertY();
|
||||
void dump(std::string& text) const;
|
||||
void dump(std::string text) const;
|
||||
|
||||
private:
|
||||
Base::Vector3d m_first;
|
||||
@@ -87,7 +87,7 @@ public:
|
||||
void project(DrawViewPart* dvp);
|
||||
void mapToPage(DrawViewPart* dvp);
|
||||
void invertY();
|
||||
void dump(std::string& text) const;
|
||||
void dump(std::string text) const;
|
||||
|
||||
private:
|
||||
pointPair m_ends;
|
||||
@@ -107,7 +107,7 @@ public:
|
||||
void project(DrawViewPart* dvp);
|
||||
void mapToPage(DrawViewPart* dvp);
|
||||
void invertY();
|
||||
void dump(std::string& text) const;
|
||||
void dump(std::string text) const;
|
||||
|
||||
//TODO: setters and getters
|
||||
bool isArc;
|
||||
|
||||
@@ -648,9 +648,8 @@ pointPair DrawViewDimension::getPointsOneEdge(ReferenceVector references)
|
||||
gp_Pnt gEnd1 = BRep_Tool::Pnt(TopExp::LastVertex(edge));
|
||||
|
||||
pointPair pts(DrawUtil::toVector3d(gEnd0), DrawUtil::toVector3d(gEnd1));
|
||||
pts.move(getViewPart()->getOriginalCentroid());
|
||||
pts.move(getViewPart()->getCurrentCentroid());
|
||||
pts.project(getViewPart());
|
||||
pts.mapToPage(getViewPart());
|
||||
return pts;
|
||||
}
|
||||
|
||||
@@ -682,9 +681,8 @@ pointPair DrawViewDimension::getPointsTwoEdges(ReferenceVector references)
|
||||
}
|
||||
|
||||
pointPair pts = closestPoints(geometry0, geometry1);
|
||||
pts.move(getViewPart()->getOriginalCentroid());
|
||||
pts.move(getViewPart()->getCurrentCentroid());
|
||||
pts.project(getViewPart());
|
||||
pts.mapToPage(getViewPart());
|
||||
return pts;
|
||||
}
|
||||
|
||||
@@ -721,9 +719,8 @@ pointPair DrawViewDimension::getPointsTwoVerts(ReferenceVector references)
|
||||
gp_Pnt gPoint1 = BRep_Tool::Pnt(vertex1);
|
||||
|
||||
pointPair pts(DrawUtil::toVector3d(gPoint0), DrawUtil::toVector3d(gPoint1));
|
||||
pts.move(getViewPart()->getOriginalCentroid());
|
||||
pts.move(getViewPart()->getCurrentCentroid());
|
||||
pts.project(getViewPart());
|
||||
pts.mapToPage(getViewPart());
|
||||
return pts;
|
||||
}
|
||||
|
||||
@@ -761,9 +758,8 @@ pointPair DrawViewDimension::getPointsEdgeVert(ReferenceVector references)
|
||||
}
|
||||
|
||||
pointPair pts = closestPoints(geometry0, geometry1);
|
||||
pts.move(getViewPart()->getOriginalCentroid());
|
||||
pts.move(getViewPart()->getCurrentCentroid());
|
||||
pts.project(getViewPart());
|
||||
pts.mapToPage(getViewPart());
|
||||
return pts;
|
||||
}
|
||||
|
||||
@@ -791,9 +787,8 @@ arcPoints DrawViewDimension::getArcParameters(ReferenceVector references)
|
||||
}
|
||||
const TopoDS_Edge& edge = TopoDS::Edge(geometry);
|
||||
arcPoints pts = arcPointsFromEdge(edge);
|
||||
pts.move(getViewPart()->getOriginalCentroid());
|
||||
pts.move(getViewPart()->getCurrentCentroid());
|
||||
pts.project(getViewPart());
|
||||
pts.mapToPage(getViewPart());
|
||||
return pts;
|
||||
}
|
||||
|
||||
@@ -913,6 +908,7 @@ arcPoints DrawViewDimension::arcPointsFromEdge(TopoDS_Edge occEdge)
|
||||
pts.arcEnds.second(DrawUtil::toVector3d(props.Value()));
|
||||
props.SetParameter(pMid);
|
||||
pts.onCurve.first(DrawUtil::toVector3d(props.Value()));
|
||||
pts.onCurve.second(DrawUtil::toVector3d(props.Value()));
|
||||
pts.midArc = DrawUtil::toVector3d(props.Value());
|
||||
|
||||
if (adapt.GetType() == GeomAbs_Circle) {
|
||||
@@ -1117,9 +1113,8 @@ anglePoints DrawViewDimension::getAnglePointsTwoEdges(ReferenceVector references
|
||||
}
|
||||
anglePoints pts(DrawUtil::toVector3d(gApex), DrawUtil::toVector3d(gFar0),
|
||||
DrawUtil::toVector3d(gFar1));
|
||||
pts.move(getViewPart()->getOriginalCentroid());
|
||||
pts.move(getViewPart()->getCurrentCentroid());
|
||||
pts.project(getViewPart());
|
||||
pts.mapToPage(getViewPart());
|
||||
return pts;
|
||||
}
|
||||
|
||||
@@ -1164,9 +1159,8 @@ anglePoints DrawViewDimension::getAnglePointsThreeVerts(ReferenceVector referenc
|
||||
gp_Pnt point2 = BRep_Tool::Pnt(vertex2);
|
||||
anglePoints pts(DrawUtil::toVector3d(point1), DrawUtil::toVector3d(point0),
|
||||
DrawUtil::toVector3d(point2));
|
||||
pts.move(getViewPart()->getOriginalCentroid());
|
||||
pts.move(getViewPart()->getCurrentCentroid());
|
||||
pts.project(getViewPart());
|
||||
pts.mapToPage(getViewPart());
|
||||
return pts;
|
||||
}
|
||||
|
||||
@@ -1178,7 +1172,6 @@ DrawViewPart* DrawViewDimension::getViewPart() const
|
||||
return dynamic_cast<TechDraw::DrawViewPart*>(References2D.getValues().at(0));
|
||||
}
|
||||
|
||||
|
||||
//return the references controlling this dimension. 3d references are used when available
|
||||
//otherwise 2d references are returned. no checking is performed. Result is pairs of (object, subName)
|
||||
ReferenceVector DrawViewDimension::getEffectiveReferences() const
|
||||
|
||||
Reference in New Issue
Block a user