[TD]Section Line position
This commit is contained in:
@@ -328,6 +328,7 @@ GeometryObject* DrawViewPart::makeGeometryForShape(TopoDS_Shape shape)
|
||||
//center shape on origin
|
||||
TopoDS_Shape centeredShape = TechDraw::moveShape(shape,
|
||||
centroid * -1.0);
|
||||
m_saveCentroid = centroid;
|
||||
m_saveShape = centeredShape;
|
||||
|
||||
TopoDS_Shape scaledShape = TechDraw::scaleShape(centeredShape,
|
||||
@@ -792,12 +793,10 @@ gp_Ax2 DrawViewPart::getViewAxis(const Base::Vector3d& pt,
|
||||
}
|
||||
|
||||
//TODO: make saveShape a property
|
||||
Base::Vector3d DrawViewPart::getCentroid(void) const
|
||||
|
||||
Base::Vector3d DrawViewPart::getOriginalCentroid(void) const
|
||||
{
|
||||
Base::Vector3d stdOrg(0.0,0.0,0.0);
|
||||
Base::Vector3d centroid = TechDraw::findCentroidVec(m_saveShape,
|
||||
getProjectionCS(stdOrg));
|
||||
return centroid;
|
||||
return m_saveCentroid;
|
||||
}
|
||||
|
||||
std::vector<DrawViewSection*> DrawViewPart::getSectionRefs(void) const
|
||||
|
||||
@@ -155,7 +155,7 @@ public:
|
||||
const bool flip=true) const;
|
||||
virtual gp_Ax2 getProjectionCS(Base::Vector3d pt) const;
|
||||
virtual Base::Vector3d getXDirection(void) const; //don't use XDirection.getValue()
|
||||
virtual Base::Vector3d getCentroid(void) const;
|
||||
virtual Base::Vector3d getOriginalCentroid(void) const;
|
||||
virtual Base::Vector3d getLegacyX(const Base::Vector3d& pt,
|
||||
const Base::Vector3d& axis,
|
||||
const bool flip = true) const;
|
||||
@@ -247,6 +247,7 @@ protected:
|
||||
bool m_handleFaces;
|
||||
|
||||
TopoDS_Shape m_saveShape; //TODO: make this a Property. Part::TopoShapeProperty??
|
||||
Base::Vector3d m_saveCentroid; //centroid before centering shape in origin
|
||||
|
||||
private:
|
||||
bool nowUnsetting;
|
||||
|
||||
@@ -781,9 +781,9 @@ void QGIViewPart::drawSectionLine(TechDraw::DrawViewSection* viewSection, bool b
|
||||
|
||||
//dvp is centered on centroid looking along dvp direction
|
||||
//dvs is centered on SO looking along section normal
|
||||
//need to subtract SO from centroid to get displacement
|
||||
//dvp view origin is 000 + centroid
|
||||
Base::Vector3d org = viewSection->SectionOrigin.getValue();
|
||||
Base::Vector3d cent = viewPart->getCentroid();
|
||||
Base::Vector3d cent = viewPart->getOriginalCentroid();
|
||||
Base::Vector3d adjOrg = org - cent;
|
||||
double scale = viewPart->getScale();
|
||||
|
||||
@@ -794,7 +794,7 @@ void QGIViewPart::drawSectionLine(TechDraw::DrawViewSection* viewSection, bool b
|
||||
displace.ProjectToLine(pAdjOrg, arrowDir);
|
||||
Base::Vector3d offset = pAdjOrg + displace;
|
||||
|
||||
// makeMark(0.0, 0.0);
|
||||
// makeMark(0.0, 0.0); //red
|
||||
|
||||
sectionLine->setPos(Rez::guiX(offset.x),Rez::guiX(offset.y));
|
||||
double sectionSpan;
|
||||
|
||||
Reference in New Issue
Block a user