* entities. Usually that's an Drawing entity but
* it can also be a polyline, text, ...
*/
-RS_Selection::RS_Selection(RS_EntityContainer & container, GraphicView * graphicView)
+Selection::Selection(EntityContainer & container, GraphicView * graphicView)
{
this->container = &container;
this->graphicView = graphicView;
/**
* Selects or deselects the given entitiy.
*/
-void RS_Selection::selectSingle(RS_Entity * e)
+void Selection::selectSingle(Entity * e)
{
if (e && (e->getLayer() == NULL || e->getLayer()->isLocked() == false))
{
//Most likely because while the painter is valid, the QPainter is not...
//[WAS]#warning "!!! This is causing a segfault in the draw code !!!"
- if (graphicView != NULL)
+ if (graphicView)
// graphicView->drawEntity(e);
graphicView->redraw();
}
/**
* Selects all entities on visible layers.
*/
-void RS_Selection::selectAll(bool select)
+void Selection::selectAll(bool select)
{
- if (graphicView != NULL)
+ if (graphicView)
{
//graphicView->deleteEntity(container);
}
//container->setSelected(select);
- for(RS_Entity * e=container->firstEntity(); e!=NULL; e=container->nextEntity())
+ for(Entity * e=container->firstEntity(); e!=NULL; e=container->nextEntity())
{
//for (uint i=0; i<container->count(); ++i) {
- //RS_Entity* e = container->entityAt(i);
+ //Entity* e = container->entityAt(i);
if (e != NULL && e->isVisible())
e->setSelected(select);
}
- if (graphicView!=NULL)
- //graphicView->drawEntity(container);
+ if (graphicView)
graphicView->redraw();
}
-void RS_Selection::deselectAll()
+void Selection::deselectAll()
{
selectAll(false);
}
/**
* Selects all entities on visible layers.
*/
-void RS_Selection::invertSelection()
+void Selection::invertSelection()
{
if (graphicView != NULL)
{
//graphicView->deleteEntity(container);
}
- for(RS_Entity * e=container->firstEntity(); e!=NULL; e=container->nextEntity())
+ for(Entity * e=container->firstEntity(); e!=NULL; e=container->nextEntity())
{
//for (uint i=0; i<container->count(); ++i) {
- //RS_Entity* e = container->entityAt(i);
+ //Entity* e = container->entityAt(i);
if (e != NULL && e->isVisible())
e->toggleSelected();
* @param v2 Second corner of the window to select.
* @param select true: select, false: deselect
*/
-void RS_Selection::selectWindow(const Vector & v1, const Vector & v2, bool select, bool cross)
+void Selection::selectWindow(const Vector & v1, const Vector & v2, bool select, bool cross)
{
//if (graphicView!=NULL) {
// graphicView->drawWindow(v1, v2, true);
graphicView->redraw();
}
-void RS_Selection::deselectWindow(const Vector & v1, const Vector & v2)
+void Selection::deselectWindow(const Vector & v1, const Vector & v2)
{
selectWindow(v1, v2, false);
}
* @param v2 Endpoint of line.
* @param select true: select, false: deselect
*/
-void RS_Selection::selectIntersected(const Vector & v1, const Vector & v2, bool select)
+void Selection::selectIntersected(const Vector & v1, const Vector & v2, bool select)
{
- RS_Line line(NULL, RS_LineData(v1, v2));
+ Line line(NULL, LineData(v1, v2));
bool inters;
- for (RS_Entity* e=container->firstEntity(); e!=NULL;
+ for (Entity* e=container->firstEntity(); e!=NULL;
e=container->nextEntity()) {
//for (uint i=0; i<container->count(); ++i) {
- //RS_Entity* e = container->entityAt(i);
+ //Entity* e = container->entityAt(i);
if (e!=NULL && e->isVisible())
{
// select containers / groups:
if (e->isContainer())
{
- RS_EntityContainer * ec = (RS_EntityContainer *)e;
+ EntityContainer * ec = (EntityContainer *)e;
- for(RS_Entity * e2=ec->firstEntity(RS2::ResolveAll); e2!=NULL;
+ for(Entity * e2=ec->firstEntity(RS2::ResolveAll); e2!=NULL;
e2=ec->nextEntity(RS2::ResolveAll))
{
- VectorSolutions sol = RS_Information::getIntersection(&line, e2, true);
+ VectorSolutions sol = Information::getIntersection(&line, e2, true);
if (sol.hasValid())
inters = true;
}
else
{
- VectorSolutions sol = RS_Information::getIntersection(&line, e, true);
+ VectorSolutions sol = Information::getIntersection(&line, e, true);
if (sol.hasValid())
inters = true;
}
}
-void RS_Selection::deselectIntersected(const Vector & v1, const Vector & v2)
+void Selection::deselectIntersected(const Vector & v1, const Vector & v2)
{
selectIntersected(v1, v2, false);
}
*
* @param e The entity where the algorithm starts. Must be an atomic entity.
*/
-void RS_Selection::selectContour(RS_Entity * e)
+void Selection::selectContour(Entity * e)
{
if (!e || !e->isAtomic())
return;
bool select = !e->isSelected();
- RS_AtomicEntity * ae = (RS_AtomicEntity *)e;
+ AtomicEntity * ae = (AtomicEntity *)e;
Vector p1 = ae->getStartpoint();
Vector p2 = ae->getEndpoint();
bool found = false;
{
found = false;
- for(RS_Entity * en=container->firstEntity(); en!=NULL;
+ for(Entity * en=container->firstEntity(); en!=NULL;
en=container->nextEntity())
{
//for (uint i=0; i<container->count(); ++i) {
- //RS_Entity* en = container->entityAt(i);
+ //Entity* en = container->entityAt(i);
if (en!=NULL && en->isVisible() &&
en->isAtomic() && en->isSelected()!=select &&
(en->getLayer()==NULL || en->getLayer()->isLocked()==false))
{
- ae = (RS_AtomicEntity *)en;
+ ae = (AtomicEntity *)en;
bool doit = false;
// startpoint connects to 1st point
/**
* Selects all entities on the given layer.
*/
-void RS_Selection::selectLayer(RS_Entity * e)
+void Selection::selectLayer(Entity * e)
{
if (e == NULL)
return;
bool select = !e->isSelected();
- RS_Layer * layer = e->getLayer(true);
+ Layer * layer = e->getLayer(true);
if (layer == NULL)
return;
/**
* Selects all entities on the given layer.
*/
-void RS_Selection::selectLayer(const QString & layerName, bool select)
+void Selection::selectLayer(const QString & layerName, bool select)
{
- for(RS_Entity * en=container->firstEntity(); en!=NULL; en=container->nextEntity())
+ for(Entity * en=container->firstEntity(); en!=NULL; en=container->nextEntity())
{
if (en != NULL && en->isVisible() && en->isSelected() != select
&& (en->getLayer() == NULL || en->getLayer()->isLocked() == false))
{
- RS_Layer * l = en->getLayer(true);
+ Layer * l = en->getLayer(true);
if (l != NULL && l->getName() == layerName)
{
}
}
-void RS_Selection::deselectLayer(QString & layerName)
+void Selection::deselectLayer(QString & layerName)
{
selectLayer(layerName, false);
}