remove obsolete 3D reference code
This commit is contained in:
@@ -365,7 +365,6 @@ void MDIViewPage::preSelectionChanged(const QPoint &pos)
|
||||
|
||||
TechDraw::DrawView *viewObj = viewItem->getViewObject();
|
||||
std::stringstream ss;
|
||||
//ss << "Edge" << edge->getReference();
|
||||
ss << "Edge" << edge->getProjIndex();
|
||||
//bool accepted =
|
||||
static_cast<void> (Gui::Selection().setPreselect(viewObj->getDocument()->getName()
|
||||
@@ -376,8 +375,6 @@ void MDIViewPage::preSelectionChanged(const QPoint &pos)
|
||||
,0));
|
||||
|
||||
} else if(vert) {
|
||||
// Find the parent view that this edges is contained within
|
||||
//WF: sb Vertex??
|
||||
QGraphicsItem*parent = vert->parentItem();
|
||||
if(!parent)
|
||||
return;
|
||||
@@ -388,7 +385,7 @@ void MDIViewPage::preSelectionChanged(const QPoint &pos)
|
||||
|
||||
TechDraw::DrawView *viewObj = viewItem->getViewObject();
|
||||
std::stringstream ss;
|
||||
ss << "Edge" << vert->getReference(); //WF: sb Vertex??
|
||||
ss << "Vertex" << vert->getProjIndex();
|
||||
//bool accepted =
|
||||
static_cast<void> (Gui::Selection().setPreselect(viewObj->getDocument()->getName()
|
||||
,viewObj->getNameInDocument()
|
||||
@@ -397,8 +394,6 @@ void MDIViewPage::preSelectionChanged(const QPoint &pos)
|
||||
,pos.y()
|
||||
,0));
|
||||
} else {
|
||||
// Check if an edge was preselected
|
||||
//WF: sb View?
|
||||
QGIView *view = qobject_cast<QGIView *>(obj);
|
||||
|
||||
if(!view)
|
||||
|
||||
@@ -50,9 +50,6 @@ public:
|
||||
QPainterPath shape() const;
|
||||
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 );
|
||||
|
||||
//TODO: edge doesn't need ref to 3D, just index in projection. links to 3D handled in Features.
|
||||
int getReference() const { return reference; }
|
||||
void setReference(int ref) {reference = ref; }
|
||||
int getProjIndex() const { return projIndex; }
|
||||
|
||||
void setHighlighted(bool state);
|
||||
@@ -72,7 +69,6 @@ protected:
|
||||
QVariant itemChange(GraphicsItemChange change, const QVariant &value);
|
||||
|
||||
int projIndex; //index of edge in Projection. must exist.
|
||||
int reference; //index of edge in DrawViewPart Source. may not exist(-1).
|
||||
|
||||
bool isHighlighted;
|
||||
bool isCosmetic;
|
||||
|
||||
@@ -85,23 +85,6 @@ QGIHatch::~QGIHatch()
|
||||
{
|
||||
}
|
||||
|
||||
#if 0
|
||||
void QGIHatch::draw()
|
||||
{
|
||||
const std::vector<App::DocumentObject*> &objects = hatch->Edges.getValues();
|
||||
//const std::vector<std::string> &SubNames = hatch->Edges.getSubValues();
|
||||
//const TechDraw::DrawViewPart *refObj = static_cast<const TechDraw::DrawViewPart*>(objects[0]);
|
||||
|
||||
//for edgeName in SubNames
|
||||
// iEdge = _getIndexFromName(edgeName) //from CommandCreateDims.cpp
|
||||
// geom = refObj->getEdgeGeomByRef(iEdge)
|
||||
// subPath = drawPainterPath(geom) //from qgiViewPart
|
||||
// m_path.addPath(subPath)
|
||||
//m_path = m_path.simplified() //????
|
||||
//m_face->setPath(m_path);
|
||||
}
|
||||
#endif
|
||||
|
||||
QVariant QGIHatch::itemChange(GraphicsItemChange change, const QVariant &value)
|
||||
{
|
||||
if (change == ItemSelectedHasChanged && scene()) {
|
||||
|
||||
@@ -48,8 +48,6 @@ public:
|
||||
int type() const { return Type;}
|
||||
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 );
|
||||
|
||||
int getReference() const { return reference; }
|
||||
void setReference(int ref) {reference = ref; }
|
||||
int getProjIndex() const { return projIndex; }
|
||||
|
||||
float getRadius() { return m_radius; }
|
||||
@@ -68,7 +66,6 @@ protected:
|
||||
QVariant itemChange(GraphicsItemChange change, const QVariant &value);
|
||||
|
||||
int projIndex; //index of vertex in Projection. must exist.
|
||||
int reference; //index of vertex in DrawView Source. may not exist(-1).
|
||||
|
||||
bool isHighlighted;
|
||||
|
||||
|
||||
@@ -359,7 +359,6 @@ void QGIViewPart::drawViewPart()
|
||||
|
||||
// Draw Edges
|
||||
const std::vector<TechDrawGeometry::BaseGeom *> &geoms = viewPart->getEdgeGeometry();
|
||||
const std::vector<int> &refs = viewPart->getEdgeReferences();
|
||||
std::vector<TechDrawGeometry::BaseGeom *>::const_iterator itEdge = geoms.begin();
|
||||
QGIEdge* item;
|
||||
|
||||
@@ -379,7 +378,6 @@ void QGIViewPart::drawViewPart()
|
||||
}
|
||||
if (showEdge) {
|
||||
item = new QGIEdge(i);
|
||||
item->setReference(refs.at(i));
|
||||
addToGroup(item); //item is at scene(0,0), not group(0,0)
|
||||
item->setPos(0.0,0.0);
|
||||
item->setPath(drawPainterPath(*itEdge));
|
||||
@@ -403,11 +401,9 @@ void QGIViewPart::drawViewPart()
|
||||
|
||||
// Draw Vertexs:
|
||||
const std::vector<TechDrawGeometry::Vertex *> &verts = viewPart->getVertexGeometry();
|
||||
const std::vector<int> &vertRefs = viewPart->getVertexReferences();
|
||||
std::vector<TechDrawGeometry::Vertex *>::const_iterator vert = verts.begin();
|
||||
for(int i = 0 ; vert != verts.end(); ++vert, i++) {
|
||||
QGIVertex *item = new QGIVertex(i);
|
||||
item->setReference(vertRefs.at(i));
|
||||
addToGroup(item);
|
||||
item->setPos((*vert)->pnt.fX, (*vert)->pnt.fY); //this is in ViewPart coords
|
||||
item->setRadius(lineWidth * vertexScaleFactor);
|
||||
@@ -578,28 +574,6 @@ void QGIViewPart::pathArcSegment(QPainterPath &path,
|
||||
a00 * x3 + a01 * y3, a10 * x3 + a11 * y3);
|
||||
}
|
||||
|
||||
QGIEdge * QGIViewPart::findRefEdge(int idx)
|
||||
{
|
||||
QList<QGraphicsItem*> items = childItems();
|
||||
for(QList<QGraphicsItem*>::iterator it = items.begin(); it != items.end(); it++) {
|
||||
QGIEdge *edge = dynamic_cast<QGIEdge *>(*it);
|
||||
if(edge && edge->getReference() == idx)
|
||||
return edge;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
QGIVertex * QGIViewPart::findRefVertex(int idx)
|
||||
{
|
||||
QList<QGraphicsItem*> items = childItems();
|
||||
for(QList<QGraphicsItem*>::iterator it = items.begin(); it != items.end(); it++) {
|
||||
QGIVertex *vert = dynamic_cast<QGIVertex *>(*it);
|
||||
if(vert && vert->getReference() == idx)
|
||||
return vert;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void QGIViewPart::toggleCache(bool state)
|
||||
{
|
||||
QList<QGraphicsItem*> items = childItems();
|
||||
|
||||
@@ -70,9 +70,6 @@ Q_SIGNALS:
|
||||
void dirty();
|
||||
|
||||
protected:
|
||||
QGIEdge * findRefEdge(int i);
|
||||
QGIVertex * findRefVertex(int idx);
|
||||
|
||||
/// Helper for pathArc()
|
||||
/*!
|
||||
* x_axis_rotation is in radian
|
||||
|
||||
Reference in New Issue
Block a user