X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fbase%2Fpattern.cpp;fp=src%2Fbase%2Fpattern.cpp;h=26af65b4593b35a13a209940d2308f6d1f983ee5;hb=16354e0421b316a62c6b9f7b0b4f3b8cf6f06284;hp=5d14519ac524c21b790b143b8ba2eb81aa463363;hpb=3239ef39dcee08fa6e8cd68cdf2727fc68cc7a8c;p=architektonas diff --git a/src/base/pattern.cpp b/src/base/pattern.cpp index 5d14519..26af65b 100644 --- a/src/base/pattern.cpp +++ b/src/base/pattern.cpp @@ -26,9 +26,9 @@ * * @param fileName File name of a DXF file defining the pattern */ -RS_Pattern::RS_Pattern(const QString & fileName): RS_EntityContainer(NULL) +Pattern::Pattern(const QString & fileName): EntityContainer(NULL) { - RS_DEBUG->print("RS_Pattern::RS_Pattern() "); + DEBUG->print("Pattern::Pattern() "); this->fileName = fileName; loaded = false; @@ -42,14 +42,14 @@ RS_Pattern::RS_Pattern(const QString & fileName): RS_EntityContainer(NULL) * @param name Pattern name. * */ -/*RS_Pattern::RS_Pattern(const QString& fileName, const QString& name) - : RS_EntityContainer(NULL) { +/*Pattern::Pattern(const QString& fileName, const QString& name) + : EntityContainer(NULL) { this->fileName = fileName; this->name = name; loaded = false; }*/ -RS_Pattern::~RS_Pattern() +Pattern::~Pattern() { } @@ -60,19 +60,19 @@ RS_Pattern::~RS_Pattern() * @param filename File name of the pattern file (without path and * extension or full path. */ -bool RS_Pattern::loadPattern() +bool Pattern::loadPattern() { if (loaded) return true; - RS_DEBUG->print("RS_Pattern::loadPattern"); + DEBUG->print("Pattern::loadPattern"); QString path; // Search for the appropriate pattern if we have only the name of the pattern: if (!fileName.toLower().contains(".dxf")) { - QStringList patterns = RS_SYSTEM->getPatternList(); + QStringList patterns = SYSTEM->getPatternList(); QFileInfo file; for(QStringList::Iterator it=patterns.begin(); it!=patterns.end(); it++) @@ -80,7 +80,7 @@ bool RS_Pattern::loadPattern() if (QFileInfo(*it).baseName().toLower() == fileName.toLower()) { path = *it; - RS_DEBUG->print("Pattern found: %s", path.toLatin1().data()); + DEBUG->print("Pattern found: %s", path.toLatin1().data()); break; } } @@ -94,21 +94,21 @@ bool RS_Pattern::loadPattern() // No pattern paths found: if (path.isEmpty()) { - RS_DEBUG->print("No pattern \"%s\"available.", fileName.toLatin1().data()); + DEBUG->print("No pattern \"%s\"available.", fileName.toLatin1().data()); return false; } Drawing * gr = new Drawing(); // TODO: Find out why the new dxf filter doesn't work for patterns: - RS_FILEIO->fileImport(*gr, path, RS2::FormatDXF1); + FILEIO->fileImport(*gr, path, RS2::FormatDXF1); - for(RS_Entity * e=gr->firstEntity(); e!=NULL; e=gr->nextEntity()) + for(Entity * e=gr->firstEntity(); e!=NULL; e=gr->nextEntity()) { if (e->rtti() == RS2::EntityLine || e->rtti() == RS2::EntityArc) { - RS_Layer * l = e->getLayer(); - RS_Entity * cl = e->clone(); + Layer * l = e->getLayer(); + Entity * cl = e->clone(); cl->reparent(this); if (l != NULL) @@ -122,13 +122,13 @@ bool RS_Pattern::loadPattern() delete gr; loaded = true; - RS_DEBUG->print("RS_Pattern::loadPattern: OK"); + DEBUG->print("Pattern::loadPattern: OK"); return true; } /** @return the fileName of this pattern. */ -QString RS_Pattern::getFileName() const +QString Pattern::getFileName() const { return fileName; }