X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fbase%2Fcreation.cpp;h=55051b4d6b31474b47f5990ae4c88c8a5c6bd3e0;hb=5adb444f3e523d3fd028617ced72d1ea6661db21;hp=b6f9d79eb33d8f3867b717c4d729c95b3a0e7776;hpb=3239ef39dcee08fa6e8cd68cdf2727fc68cc7a8c;p=architektonas
diff --git a/src/base/creation.cpp b/src/base/creation.cpp
index b6f9d79..55051b4 100644
--- a/src/base/creation.cpp
+++ b/src/base/creation.cpp
@@ -32,7 +32,7 @@
* entities. Usually that's an Drawing entity but
* it can also be a polyline, text, ...
*/
-RS_Creation::RS_Creation(RS_EntityContainer * container, GraphicView * graphicView,
+Creation::Creation(EntityContainer * container, GraphicView * graphicView,
bool handleUndo)
{
this->container = container;
@@ -61,8 +61,8 @@ RS_Creation::RS_Creation(RS_EntityContainer * container, GraphicView * graphicVi
*
* @param p position
*/
-/*void RS_Creation::createPoint(const Vector& p) {
- entityContainer->addEntity(new RS_Point(entityContainer, p));
+/*void Creation::createPoint(const Vector& p) {
+ entityContainer->addEntity(new Point(entityContainer, p));
}*/
/**
@@ -76,9 +76,9 @@ RS_Creation::RS_Creation(RS_EntityContainer * container, GraphicView * graphicVi
* @param p1 start point
* @param p2 end point
*/
-/*void RS_Creation::createLine2P(const Vector& p1, const Vector& p2) {
- entityContainer->addEntity(new RS_Line(entityContainer,
- RS_LineData(p1, p2)));
+/*void Creation::createLine2P(const Vector& p1, const Vector& p2) {
+ entityContainer->addEntity(new Line(entityContainer,
+ LineData(p1, p2)));
}*/
/**
@@ -92,17 +92,17 @@ RS_Creation::RS_Creation(RS_EntityContainer * container, GraphicView * graphicVi
* @param p1 edge one
* @param p2 edge two
*/
-/*void RS_Creation::createRectangle(const Vector& e1, const Vector& e2) {
+/*void Creation::createRectangle(const Vector& e1, const Vector& e2) {
Vector e21(e2.x, e1.y);
Vector e12(e1.x, e2.y);
- entityContainer->addEntity(new RS_Line(entityContainer,
- RS_LineData(e1, e12)));
- entityContainer->addEntity(new RS_Line(entityContainer,
- RS_LineData(e12, e2)));
- entityContainer->addEntity(new RS_Line(entityContainer,
- RS_LineData(e2, e21)));
- entityContainer->addEntity(new RS_Line(entityContainer,
- RS_LineData(e21, e1)));
+ entityContainer->addEntity(new Line(entityContainer,
+ LineData(e1, e12)));
+ entityContainer->addEntity(new Line(entityContainer,
+ LineData(e12, e2)));
+ entityContainer->addEntity(new Line(entityContainer,
+ LineData(e2, e21)));
+ entityContainer->addEntity(new Line(entityContainer,
+ LineData(e21, e1)));
}*/
/**
@@ -112,16 +112,16 @@ RS_Creation::RS_Creation(RS_EntityContainer * container, GraphicView * graphicVi
*
* E.g.:
*
- * RS_Polyline *pl = creation.createPolyline(Vector(25.0, 55.0));
+ * Polyline *pl = creation.createPolyline(Vector(25.0, 55.0));
* pl->addVertex(Vector(50.0, 75.0));
*
*
* @param entities array of entities
* @param startPoint Start point of the polyline
*/
-/*RS_Polyline* RS_Creation::createPolyline(const Vector& startPoint) {
- RS_Polyline* pl = new RS_Polyline(entityContainer,
- RS_PolylineData(startPoint, Vector(0.0,0.0), 0));
+/*Polyline* Creation::createPolyline(const Vector& startPoint) {
+ Polyline* pl = new Polyline(entityContainer,
+ PolylineData(startPoint, Vector(0.0,0.0), 0));
entityContainer->addEntity(pl);
return pl;
}*/
@@ -138,7 +138,7 @@ RS_Creation::RS_Creation(RS_EntityContainer * container, GraphicView * graphicVi
* @return Pointer to the first created parallel or NULL if no
* parallel has been created.
*/
-RS_Entity * RS_Creation::createParallelThrough(const Vector & coord, int number, RS_Entity * e)
+Entity * Creation::createParallelThrough(const Vector & coord, int number, Entity * e)
{
if (e == NULL)
return NULL;
@@ -147,8 +147,8 @@ RS_Entity * RS_Creation::createParallelThrough(const Vector & coord, int number,
if (e->rtti() == RS2::EntityLine)
{
- RS_Line * l = (RS_Line *)e;
- RS_ConstructionLine cl(NULL, RS_ConstructionLineData(l->getStartpoint(),
+ Line * l = (Line *)e;
+ ConstructionLine cl(NULL, ConstructionLineData(l->getStartpoint(),
l->getEndpoint()));
dist = cl.getDistanceToPoint(coord);
}
@@ -178,24 +178,24 @@ RS_Entity * RS_Creation::createParallelThrough(const Vector & coord, int number,
* @return Pointer to the first created parallel or NULL if no
* parallel has been created.
*/
-RS_Entity* RS_Creation::createParallel(const Vector& coord,
+Entity* Creation::createParallel(const Vector& coord,
double distance, int number,
- RS_Entity* e) {
+ Entity* e) {
if (e==NULL) {
return NULL;
}
switch (e->rtti()) {
case RS2::EntityLine:
- return createParallelLine(coord, distance, number, (RS_Line*)e);
+ return createParallelLine(coord, distance, number, (Line*)e);
break;
case RS2::EntityArc:
- return createParallelArc(coord, distance, number, (RS_Arc*)e);
+ return createParallelArc(coord, distance, number, (Arc*)e);
break;
case RS2::EntityCircle:
- return createParallelCircle(coord, distance, number, (RS_Circle*)e);
+ return createParallelCircle(coord, distance, number, (Circle*)e);
break;
default:
@@ -221,9 +221,9 @@ RS_Entity* RS_Creation::createParallel(const Vector& coord,
* @return Pointer to the first created parallel or NULL if no
* parallel has been created.
*/
-RS_Line* RS_Creation::createParallelLine(const Vector& coord,
+Line* Creation::createParallelLine(const Vector& coord,
double distance, int number,
- RS_Line* e) {
+ Line* e) {
if (e==NULL) {
return NULL;
@@ -231,8 +231,8 @@ RS_Line* RS_Creation::createParallelLine(const Vector& coord,
double ang = e->getAngle1() + M_PI/2.0;
Vector p1, p2;
- RS_LineData parallelData;
- RS_Line* ret = NULL;
+ LineData parallelData;
+ Line* ret = NULL;
if (document!=NULL && handleUndo) {
document->startUndoCycle();
@@ -245,14 +245,14 @@ RS_Line* RS_Creation::createParallelLine(const Vector& coord,
p1 += e->getStartpoint();
p2.setPolar(distance*num, ang);
p2 += e->getEndpoint();
- RS_Line parallel1(NULL, RS_LineData(p1, p2));
+ Line parallel1(NULL, LineData(p1, p2));
// calculate 2nd parallel:
p1.setPolar(distance*num, ang+M_PI);
p1 += e->getStartpoint();
p2.setPolar(distance*num, ang+M_PI);
p2 += e->getEndpoint();
- RS_Line parallel2(NULL, RS_LineData(p1, p2));
+ Line parallel2(NULL, LineData(p1, p2));
double dist1 = parallel1.getDistanceToPoint(coord);
double dist2 = parallel2.getDistanceToPoint(coord);
@@ -266,7 +266,7 @@ RS_Line* RS_Creation::createParallelLine(const Vector& coord,
}
- RS_Line* newLine = new RS_Line(container, parallelData);
+ Line* newLine = new Line(container, parallelData);
newLine->setLayerToActive();
newLine->setPenToActive();
if (ret==NULL) {
@@ -308,16 +308,16 @@ RS_Line* RS_Creation::createParallelLine(const Vector& coord,
* @return Pointer to the first created parallel or NULL if no
* parallel has been created.
*/
-RS_Arc* RS_Creation::createParallelArc(const Vector& coord,
+Arc* Creation::createParallelArc(const Vector& coord,
double distance, int number,
- RS_Arc* e) {
+ Arc* e) {
if (e==NULL) {
return NULL;
}
- RS_ArcData parallelData;
- RS_Arc* ret = NULL;
+ ArcData parallelData;
+ Arc* ret = NULL;
bool inside = (e->getCenter().distanceTo(coord) < e->getRadius());
@@ -329,7 +329,7 @@ RS_Arc* RS_Creation::createParallelArc(const Vector& coord,
// calculate parallel:
bool ok = true;
- RS_Arc parallel1(NULL, e->getData());
+ Arc parallel1(NULL, e->getData());
parallel1.setRadius(e->getRadius() + distance*num);
if (parallel1.getRadius()<0.0) {
parallel1.setRadius(RS_MAXDOUBLE);
@@ -337,7 +337,7 @@ RS_Arc* RS_Creation::createParallelArc(const Vector& coord,
}
// calculate 2nd parallel:
- //RS_Arc parallel2(NULL, e->getData());
+ //Arc parallel2(NULL, e->getData());
//parallel2.setRadius(e->getRadius()+distance*num);
//double dist1 = parallel1.getDistanceToPoint(coord);
@@ -356,7 +356,7 @@ RS_Arc* RS_Creation::createParallelArc(const Vector& coord,
document->startUndoCycle();
}
- RS_Arc* newArc = new RS_Arc(container, parallelData);
+ Arc* newArc = new Arc(container, parallelData);
newArc->setLayerToActive();
newArc->setPenToActive();
if (ret==NULL) {
@@ -394,16 +394,16 @@ RS_Arc* RS_Creation::createParallelArc(const Vector& coord,
* @return Pointer to the first created parallel or NULL if no
* parallel has been created.
*/
-RS_Circle* RS_Creation::createParallelCircle(const Vector& coord,
+Circle* Creation::createParallelCircle(const Vector& coord,
double distance, int number,
- RS_Circle* e) {
+ Circle* e) {
if (e==NULL) {
return NULL;
}
- RS_CircleData parallelData;
- RS_Circle* ret = NULL;
+ CircleData parallelData;
+ Circle* ret = NULL;
bool inside = (e->getCenter().distanceTo(coord) < e->getRadius());
@@ -415,7 +415,7 @@ RS_Circle* RS_Creation::createParallelCircle(const Vector& coord,
// calculate parallel:
bool ok = true;
- RS_Circle parallel1(NULL, e->getData());
+ Circle parallel1(NULL, e->getData());
parallel1.setRadius(e->getRadius() + distance*num);
if (parallel1.getRadius()<0.0) {
parallel1.setRadius(RS_MAXDOUBLE);
@@ -423,7 +423,7 @@ RS_Circle* RS_Creation::createParallelCircle(const Vector& coord,
}
// calculate 2nd parallel:
- //RS_Circle parallel2(NULL, e->getData());
+ //Circle parallel2(NULL, e->getData());
//parallel2.setRadius(e->getRadius()+distance*num);
//double dist1 = parallel1.getDistanceToPoint(coord);
@@ -442,7 +442,7 @@ RS_Circle* RS_Creation::createParallelCircle(const Vector& coord,
document->startUndoCycle();
}
- RS_Circle* newCircle = new RS_Circle(container, parallelData);
+ Circle* newCircle = new Circle(container, parallelData);
newCircle->setLayerToActive();
newCircle->setPenToActive();
if (ret==NULL) {
@@ -480,15 +480,15 @@ RS_Circle* RS_Creation::createParallelCircle(const Vector& coord,
* @return Pointer to the first bisector created or NULL if no bisectors
* were created.
*/
-RS_Line * RS_Creation::createBisector(const Vector & coord1, const Vector & coord2,
- double length, int num, RS_Line * l1, RS_Line * l2)
+Line * Creation::createBisector(const Vector & coord1, const Vector & coord2,
+ double length, int num, Line * l1, Line * l2)
{
// check given entities:
if (!l1 || !l2 || l1->rtti() != RS2::EntityLine || l2->rtti() != RS2::EntityLine)
return NULL;
// intersection between entities:
- VectorSolutions sol = RS_Information::getIntersection(l1, l2, false);
+ VectorSolutions sol = Information::getIntersection(l1, l2, false);
Vector inters = sol.get(0);
if (!inters.valid)
@@ -496,12 +496,12 @@ RS_Line * RS_Creation::createBisector(const Vector & coord1, const Vector & coor
double angle1 = inters.angleTo(l1->getNearestPointOnEntity(coord1));
double angle2 = inters.angleTo(l2->getNearestPointOnEntity(coord2));
- double angleDiff = RS_Math::getAngleDifference(angle1, angle2);
+ double angleDiff = Math::getAngleDifference(angle1, angle2);
if (angleDiff > M_PI)
angleDiff = angleDiff - 2 * M_PI;
- RS_Line * ret = NULL;
+ Line * ret = NULL;
if (document && handleUndo)
document->startUndoCycle();
@@ -511,8 +511,8 @@ RS_Line * RS_Creation::createBisector(const Vector & coord1, const Vector & coor
double angle = angle1 + (angleDiff / (num + 1) * n);
Vector v;
v.setPolar(length, angle);
- RS_LineData d = RS_LineData(inters, inters + v);
- RS_Line * newLine = new RS_Line(container, d);
+ LineData d = LineData(inters, inters + v);
+ Line * newLine = new Line(container, d);
if (container)
{
@@ -549,10 +549,10 @@ RS_Line * RS_Creation::createBisector(const Vector & coord1, const Vector & coor
* @param point Point.
* @param circle Circle, arc or ellipse entity.
*/
-RS_Line* RS_Creation::createTangent1(const Vector& coord,
+Line* Creation::createTangent1(const Vector& coord,
const Vector& point,
- RS_Entity* circle) {
- RS_Line* ret = NULL;
+ Entity* circle) {
+ Line* ret = NULL;
Vector circleCenter;
// check given entities:
@@ -564,11 +564,11 @@ RS_Line* RS_Creation::createTangent1(const Vector& coord,
}
if (circle->rtti()==RS2::EntityCircle) {
- circleCenter = ((RS_Circle*)circle)->getCenter();
+ circleCenter = ((Circle*)circle)->getCenter();
} else if (circle->rtti()==RS2::EntityArc) {
- circleCenter = ((RS_Arc*)circle)->getCenter();
+ circleCenter = ((Arc*)circle)->getCenter();
} else if (circle->rtti()==RS2::EntityEllipse) {
- circleCenter = ((RS_Ellipse*)circle)->getCenter();
+ circleCenter = ((Ellipse*)circle)->getCenter();
}
// the two tangent points:
@@ -580,15 +580,15 @@ RS_Line* RS_Creation::createTangent1(const Vector& coord,
Vector tCenter = (point + circleCenter)/2.0;
double tRadius = point.distanceTo(tCenter);
- RS_Circle tmp(NULL, RS_CircleData(tCenter, tRadius));
+ Circle tmp(NULL, CircleData(tCenter, tRadius));
// get the two intersection points which are the tangent points:
- sol = RS_Information::getIntersection(&tmp, circle, false);
+ sol = Information::getIntersection(&tmp, circle, false);
}
// calculate tangent points for ellipses:
else {
- RS_Ellipse* el = (RS_Ellipse*)circle;
+ Ellipse* el = (Ellipse*)circle;
sol.alloc(2);
//sol.set(0, circleCenter);
//sol.set(1, circleCenter);
@@ -643,14 +643,14 @@ RS_Line* RS_Creation::createTangent1(const Vector& coord,
}
// create all possible tangents:
- RS_Line* poss[2];
+ Line* poss[2];
- RS_LineData d;
+ LineData d;
- d = RS_LineData(sol.get(0), point);
- poss[0] = new RS_Line(NULL, d);
- d = RS_LineData(sol.get(1), point);
- poss[1] = new RS_Line(NULL, d);
+ d = LineData(sol.get(0), point);
+ poss[0] = new Line(NULL, d);
+ d = LineData(sol.get(1), point);
+ poss[1] = new Line(NULL, d);
// find closest tangent:
double minDist = RS_MAXDOUBLE;
@@ -666,7 +666,7 @@ RS_Line* RS_Creation::createTangent1(const Vector& coord,
// create the closest tangent:
if (idx!=-1) {
- RS_LineData d = poss[idx]->getData();
+ LineData d = poss[idx]->getData();
for (int i=0; i<2; ++i) {
delete poss[i];
@@ -676,7 +676,7 @@ RS_Line* RS_Creation::createTangent1(const Vector& coord,
document->startUndoCycle();
}
- ret = new RS_Line(container, d);
+ ret = new Line(container, d);
ret->setLayerToActive();
ret->setPenToActive();
if (container!=NULL) {
@@ -708,10 +708,10 @@ RS_Line* RS_Creation::createTangent1(const Vector& coord,
* @param circle1 1st circle or arc entity.
* @param circle2 2nd circle or arc entity.
*/
-RS_Line* RS_Creation::createTangent2(const Vector& coord,
- RS_Entity* circle1,
- RS_Entity* circle2) {
- RS_Line* ret = NULL;
+Line* Creation::createTangent2(const Vector& coord,
+ Entity* circle1,
+ Entity* circle2) {
+ Line* ret = NULL;
Vector circleCenter1;
Vector circleCenter2;
double circleRadius1 = 0.0;
@@ -728,28 +728,28 @@ RS_Line* RS_Creation::createTangent2(const Vector& coord,
}
if (circle1->rtti()==RS2::EntityCircle) {
- circleCenter1 = ((RS_Circle*)circle1)->getCenter();
- circleRadius1 = ((RS_Circle*)circle1)->getRadius();
+ circleCenter1 = ((Circle*)circle1)->getCenter();
+ circleRadius1 = ((Circle*)circle1)->getRadius();
} else if (circle1->rtti()==RS2::EntityArc) {
- circleCenter1 = ((RS_Arc*)circle1)->getCenter();
- circleRadius1 = ((RS_Arc*)circle1)->getRadius();
+ circleCenter1 = ((Arc*)circle1)->getCenter();
+ circleRadius1 = ((Arc*)circle1)->getRadius();
}
if (circle2->rtti()==RS2::EntityCircle) {
- circleCenter2 = ((RS_Circle*)circle2)->getCenter();
- circleRadius2 = ((RS_Circle*)circle2)->getRadius();
+ circleCenter2 = ((Circle*)circle2)->getCenter();
+ circleRadius2 = ((Circle*)circle2)->getRadius();
} else if (circle2->rtti()==RS2::EntityArc) {
- circleCenter2 = ((RS_Arc*)circle2)->getCenter();
- circleRadius2 = ((RS_Arc*)circle2)->getRadius();
+ circleCenter2 = ((Arc*)circle2)->getCenter();
+ circleRadius2 = ((Arc*)circle2)->getRadius();
}
// create all possible tangents:
- RS_Line* poss[4];
+ Line* poss[4];
for (int i=0; i<4; ++i) {
poss[i] = NULL;
}
- RS_LineData d;
+ LineData d;
double angle1 = circleCenter1.angleTo(circleCenter2);
double dist1 = circleCenter1.distanceTo(circleCenter2);
@@ -767,17 +767,17 @@ RS_Line* RS_Creation::createTangent2(const Vector& coord,
offs1.setPolar(circleRadius1, angt1);
offs2.setPolar(circleRadius2, angt1);
- d = RS_LineData(circleCenter1 + offs1,
+ d = LineData(circleCenter1 + offs1,
circleCenter2 + offs2);
- poss[0] = new RS_Line(NULL, d);
+ poss[0] = new Line(NULL, d);
offs1.setPolar(circleRadius1, angt2);
offs2.setPolar(circleRadius2, angt2);
- d = RS_LineData(circleCenter1 + offs1,
+ d = LineData(circleCenter1 + offs1,
circleCenter2 + offs2);
- poss[1] = new RS_Line(NULL, d);
+ poss[1] = new Line(NULL, d);
}
// inner tangents:
@@ -792,17 +792,17 @@ RS_Line* RS_Creation::createTangent2(const Vector& coord,
offs1.setPolar(circleRadius1, angt3);
offs2.setPolar(circleRadius2, angt3);
- d = RS_LineData(circleCenter1 - offs1,
+ d = LineData(circleCenter1 - offs1,
circleCenter2 + offs2);
- poss[2] = new RS_Line(NULL, d);
+ poss[2] = new Line(NULL, d);
offs1.setPolar(circleRadius1, angt4);
offs2.setPolar(circleRadius2, angt4);
- d = RS_LineData(circleCenter1 - offs1,
+ d = LineData(circleCenter1 - offs1,
circleCenter2 + offs2);
- poss[3] = new RS_Line(NULL, d);
+ poss[3] = new Line(NULL, d);
}
}
@@ -822,7 +822,7 @@ RS_Line* RS_Creation::createTangent2(const Vector& coord,
}
if (idx!=-1) {
- RS_LineData d = poss[idx]->getData();
+ LineData d = poss[idx]->getData();
for (int i=0; i<4; ++i) {
if (poss[i]!=NULL) {
delete poss[i];
@@ -833,7 +833,7 @@ RS_Line* RS_Creation::createTangent2(const Vector& coord,
document->startUndoCycle();
}
- ret = new RS_Line(container, d);
+ ret = new Line(container, d);
ret->setLayerToActive();
ret->setPenToActive();
if (container!=NULL) {
@@ -864,8 +864,8 @@ RS_Line* RS_Creation::createTangent2(const Vector& coord,
* @param angle Angle of the line relative to the angle of the basis entity.
* @param length Length of the line we're creating.
*/
-RS_Line* RS_Creation::createLineRelAngle(const Vector& coord,
- RS_Entity* entity,
+Line* Creation::createLineRelAngle(const Vector& coord,
+ Entity* entity,
double angle,
double length) {
@@ -881,13 +881,13 @@ RS_Line* RS_Creation::createLineRelAngle(const Vector& coord,
switch (entity->rtti()) {
case RS2::EntityLine:
- a1 = ((RS_Line*)entity)->getAngle1();
+ a1 = ((Line*)entity)->getAngle1();
break;
case RS2::EntityArc:
- a1 = ((RS_Arc*)entity)->getCenter().angleTo(coord) + M_PI/2.0;
+ a1 = ((Arc*)entity)->getCenter().angleTo(coord) + M_PI/2.0;
break;
case RS2::EntityCircle:
- a1 = ((RS_Circle*)entity)->getCenter().angleTo(coord);
+ a1 = ((Circle*)entity)->getCenter().angleTo(coord);
break;
default:
// never reached
@@ -898,15 +898,15 @@ RS_Line* RS_Creation::createLineRelAngle(const Vector& coord,
Vector v1;
v1.setPolar(length, a1);
- //RS_ConstructionLineData(coord-v1, coord+v1);
- RS_LineData d(coord-v1, coord+v1);
- RS_Line* ret;
+ //ConstructionLineData(coord-v1, coord+v1);
+ LineData d(coord-v1, coord+v1);
+ Line* ret;
if (document!=NULL && handleUndo) {
document->startUndoCycle();
}
- ret = new RS_Line(container, d);
+ ret = new Line(container, d);
ret->setLayerToActive();
ret->setPenToActive();
if (container!=NULL) {
@@ -931,7 +931,7 @@ RS_Line* RS_Creation::createLineRelAngle(const Vector& coord,
* @param corner The first corner of the polygon
* @param number Number of edges / corners.
*/
-RS_Line* RS_Creation::createPolygon(const Vector& center,
+Line* Creation::createPolygon(const Vector& center,
const Vector& corner,
int number) {
@@ -940,7 +940,7 @@ RS_Line* RS_Creation::createPolygon(const Vector& center,
return NULL;
}
- RS_Line* ret = NULL;
+ Line* ret = NULL;
if (document!=NULL && handleUndo) {
document->startUndoCycle();
@@ -948,13 +948,13 @@ RS_Line* RS_Creation::createPolygon(const Vector& center,
Vector c1(false);
Vector c2 = corner;
- RS_Line* line;
+ Line* line;
for (int n=1; n<=number; ++n) {
c1 = c2;
c2 = c2.rotate(center, (M_PI*2)/number);
- line = new RS_Line(container, RS_LineData(c1, c2));
+ line = new Line(container, LineData(c1, c2));
line->setLayerToActive();
line->setPenToActive();
@@ -989,7 +989,7 @@ RS_Line* RS_Creation::createPolygon(const Vector& center,
* @param corner2 The second corner of the polygon.
* @param number Number of edges / corners.
*/
-RS_Line* RS_Creation::createPolygon2(const Vector& corner1,
+Line* Creation::createPolygon2(const Vector& corner1,
const Vector& corner2,
int number) {
@@ -998,7 +998,7 @@ RS_Line* RS_Creation::createPolygon2(const Vector& corner1,
return NULL;
}
- RS_Line* ret = NULL;
+ Line* ret = NULL;
if (document!=NULL && handleUndo) {
document->startUndoCycle();
@@ -1011,14 +1011,14 @@ RS_Line* RS_Creation::createPolygon2(const Vector& corner1,
Vector c1(false);
Vector c2 = corner1;
Vector edge;
- RS_Line* line;
+ Line* line;
for (int n=1; n<=number; ++n) {
c1 = c2;
edge.setPolar(len, ang);
c2 = c1 + edge;
- line = new RS_Line(container, RS_LineData(c1, c2));
+ line = new Line(container, LineData(c1, c2));
line->setLayerToActive();
line->setPenToActive();
@@ -1052,14 +1052,14 @@ RS_Line* RS_Creation::createPolygon2(const Vector& corner1,
*
* @param data Insert data (position, block name, ..)
*/
-RS_Insert* RS_Creation::createInsert(RS_InsertData & data)
+Insert* Creation::createInsert(InsertData & data)
{
- RS_DEBUG->print("RS_Creation::createInsert");
+ DEBUG->print("Creation::createInsert");
if (document != NULL && handleUndo)
document->startUndoCycle();
- RS_Insert * ins = new RS_Insert(container, data);
+ Insert * ins = new Insert(container, data);
// inserts are also on layers
ins->setLayerToActive();
ins->setPenToActive();
@@ -1076,7 +1076,7 @@ RS_Insert* RS_Creation::createInsert(RS_InsertData & data)
if (graphicView != NULL)
graphicView->drawEntity(ins);
- RS_DEBUG->print("RS_Creation::createInsert: OK");
+ DEBUG->print("Creation::createInsert: OK");
return ins;
}
@@ -1084,13 +1084,13 @@ RS_Insert* RS_Creation::createInsert(RS_InsertData & data)
/**
* Creates an image with the given data.
*/
-RS_Image* RS_Creation::createImage(RS_ImageData& data) {
+Image* Creation::createImage(ImageData& data) {
if (document!=NULL && handleUndo) {
document->startUndoCycle();
}
- RS_Image* img = new RS_Image(container, data);
+ Image* img = new Image(container, data);
img->setLayerToActive();
img->setPenToActive();
img->update();
@@ -1116,7 +1116,7 @@ RS_Image* RS_Creation::createImage(RS_ImageData& data) {
* @param name Block name
* @param remove true: remove existing entities, false: don't touch entities
*/
-RS_Block * RS_Creation::createBlock(const RS_BlockData & data,
+Block * Creation::createBlock(const BlockData & data,
const Vector & referencePoint, const bool remove)
{
// start undo cycle for the container if we're deleting the existing entities
@@ -1124,15 +1124,15 @@ RS_Block * RS_Creation::createBlock(const RS_BlockData & data,
document->startUndoCycle();
}
- RS_Block* block =
- new RS_Block(container,
- RS_BlockData(data.name, data.basePoint, data.frozen));
+ Block* block =
+ new Block(container,
+ BlockData(data.name, data.basePoint, data.frozen));
// copy entities into a block
- 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; icount(); ++i) {
- //RS_Entity* e = container->entityAt(i);
+ //Entity* e = container->entityAt(i);
if (e && e->isSelected())
{
@@ -1164,7 +1164,7 @@ RS_Block * RS_Creation::createBlock(const RS_BlockData & data,
}
// add entity to block:
- RS_Entity * c = e->clone();
+ Entity * c = e->clone();
c->move(-referencePoint);
block->addEntity(c);
@@ -1192,21 +1192,21 @@ RS_Block * RS_Creation::createBlock(const RS_BlockData & data,
/**
* Inserts a library item from the given path into the drawing.
*/
-RS_Insert * RS_Creation::createLibraryInsert(RS_LibraryInsertData & data)
+Insert * Creation::createLibraryInsert(LibraryInsertData & data)
{
- RS_DEBUG->print("RS_Creation::createLibraryInsert");
+ DEBUG->print("Creation::createLibraryInsert");
Drawing g;
if (!g.open(data.file, RS2::FormatUnknown))
{
- RS_DEBUG->print(RS_Debug::D_WARNING, "RS_Creation::createLibraryInsert: Cannot open file: %s");
+ DEBUG->print(Debug::D_WARNING, "Creation::createLibraryInsert: Cannot open file: %s");
return NULL;
}
// unit conversion:
if (graphic != NULL)
{
- double uf = RS_Units::convert(1.0, g.getUnit(), graphic->getUnit());
+ double uf = Units::convert(1.0, g.getUnit(), graphic->getUnit());
g.scale(Vector(0.0, 0.0), Vector(uf, uf));
}
@@ -1216,10 +1216,10 @@ RS_Insert * RS_Creation::createLibraryInsert(RS_LibraryInsertData & data)
// QString s = QFileInfo(data.file).baseName(true);
QString s = QFileInfo(data.file).completeBaseName();
- RS_Modification m(*container, graphicView);
- m.paste(RS_PasteData(data.insertionPoint, data.factor, data.angle, true, s), &g);
+ Modification m(*container, graphicView);
+ m.paste(PasteData(data.insertionPoint, data.factor, data.angle, true, s), &g);
- RS_DEBUG->print("RS_Creation::createLibraryInsert: OK");
+ DEBUG->print("Creation::createLibraryInsert: OK");
return NULL;
}