Skip to content

Commit

Permalink
update license files
Browse files Browse the repository at this point in the history
  • Loading branch information
qcad committed Apr 12, 2013
1 parent c958c16 commit 4e41b38
Show file tree
Hide file tree
Showing 16 changed files with 971 additions and 726 deletions.
689 changes: 15 additions & 674 deletions LICENSE.txt

Large diffs are not rendered by default.

File renamed without changes.
674 changes: 674 additions & 0 deletions gpl-3.0.txt

Large diffs are not rendered by default.

32 changes: 0 additions & 32 deletions scripts/ImportExport/DxfImporter/DxfImporter.js

This file was deleted.

1 change: 0 additions & 1 deletion scripts/ImportExport/DxfImporter/DxfImporter.pro

This file was deleted.

4 changes: 2 additions & 2 deletions scripts/WidgetFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -945,15 +945,15 @@ WidgetFactory.initLineEdit = function(lineEdit, dimension) {
for (var i=0; i<symbols.length; ++i) {
var symbol = symbols[i];

if (symbol.length==0) {
if (symbol.length===0) {
subMenu.addSeparator();
continue;
}

var symbolSelf = symbol[0];
var symbolText = symbol[1];
var insertion = symbol[0];
if (symbol.length==3) {
if (symbol.length===3) {
insertion = symbol[2];
}

Expand Down
5 changes: 4 additions & 1 deletion scripts/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
* along with QCAD.
*/

requiresFramework([3,0,9,0], [3,0,9,0]);
// Version check is disabled for now. This can be used in the future to
// ensure compatibility between scripts and script bindings.
//requiresFramework([3,0,9,0], [3,1,0,0]);

include("sprintf.js");

if (isNull(Global)) {
Expand Down
5 changes: 4 additions & 1 deletion src/3rdparty/stemmer/bsd-2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4 changes: 4 additions & 0 deletions src/core/RLinetypePatternMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,7 @@ RLinetypePattern RLinetypePatternMap::getPattern(const QString& name) {
}
return RLinetypePattern();
}

QList<RLinetypePattern> RLinetypePatternMap::getPatterns() {
return patternMap.values();
}
2 changes: 2 additions & 0 deletions src/core/RLinetypePatternMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include "core_global.h"

#include <QList>
#include <QString>
#include <QMap>

Expand All @@ -38,6 +39,7 @@ class QCADCORE_EXPORT RLinetypePatternMap: public QMap<QString, RLinetypePattern
public:
RLinetypePatternMap();
static RLinetypePattern getPattern(const QString& name);
static QList<RLinetypePattern> getPatterns();

private:
static RLinetypePatternMap patternMap;
Expand Down
4 changes: 2 additions & 2 deletions src/core/RVersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
/**
* Version number of the QCAD Application Framework.
*/
#define R_QCAD_VERSION_STRING "3.0.10"
#define R_QCAD_VERSION_STRING "3.0.11"

#define R_QCAD_VERSION_MAJOR 3
#define R_QCAD_VERSION_MINOR 0
#define R_QCAD_VERSION_REV 10
#define R_QCAD_VERSION_REV 11
#define R_QCAD_VERSION_BUILD 0

#endif
250 changes: 249 additions & 1 deletion src/io/dxf/RDxfExporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@
* You should have received a copy of the GNU General Public License
* along with QCAD.
*/

#include "dxflib/src/dl_attributes.h"
#include "dxflib/src/dl_codes.h"
#include "dxflib/src/dl_writer_ascii.h"

#include "RDxfExporter.h"
#include "RLinetypePatternMap.h"

RDxfExporter::RDxfExporter(RDocument& document,
RMessageHandler* messageHandler,
Expand All @@ -26,5 +32,247 @@ RDxfExporter::RDxfExporter(RDocument& document,
}

bool RDxfExporter::exportFile(const QString& fileName, const QString& nameFilter, bool resetModified) {
return false;
// set version for DXF filter:
DL_Codes::version exportVersion;
if (nameFilter.contains("R12")) {
exportVersion = DL_Codes::AC1009;
} else {
// TODO: drop support for DXF 2000 (not maintainable):
exportVersion = DL_Codes::AC1015;
}

dw = dxf.out((const char*)QFile::encodeName(fileName), exportVersion);

if (dw==NULL) {
qWarning() << "RS_FilterDxf::fileExport: cannot open file for writing";
return false;
}

// Header
dxf.writeHeader(*dw);

// Variables
writeVariables();

// Section TABLES
dw->sectionTables();

// VPORT:
dxf.writeVPort(*dw);

// Line types:
QList<RLinetypePattern> patterns = RLinetypePatternMap::getPatterns();
int numLT = patterns.count();
//int numLT = (int)RS::BorderLineX2-(int)RS2::LineByBlock;
//if (formatType==RS2::FormatDxf12) {
// numLT-=2;
//}
dw->tableLineTypes(numLT);
for (int i=0; patterns.count(); i++) {
//writeLineType(patterns[i]);
}
// for (int t=(int)RS2::LineByBlock; t<=(int)RS2::BorderLineX2; ++t) {
// if ((RS2::LineType)t!=RS2::NoPen) {
// writeLineType((RS2::LineType)t);
// }
// }
dw->tableEnd();

/*
// Layers:
RS_DEBUG->print("writing layers...");
dw->tableLayers(graphic->countLayers());
for (int i=0; i<graphic->countLayers(); ++i) {
RS_Layer* l = graphic->layerAt(i);
writeLayer(l);
}
dw->tableEnd();
// STYLE:
RS_DEBUG->print("writing styles...");
dxf.writeStyle(*dw);
// VIEW:
RS_DEBUG->print("writing views...");
dxf.writeView(*dw);
// UCS:
RS_DEBUG->print("writing ucs...");
dxf.writeUcs(*dw);
// Appid:
RS_DEBUG->print("writing appid...");
dw->tableAppid(1);
writeAppid("ACAD");
dw->tableEnd();
// DIMSTYLE:
RS_DEBUG->print("writing dim styles...");
dxf.writeDimStyle(*dw,
graphic->getVariableDouble("$DIMASZ", 2.5),
graphic->getVariableDouble("$DIMEXE", 1.25),
graphic->getVariableDouble("$DIMEXO", 0.625),
graphic->getVariableDouble("$DIMGAP", 0.625),
graphic->getVariableDouble("$DIMTXT", 2.5));
// BLOCK_RECORD:
if (formatType!=RS2::FormatDxf12) {
RS_DEBUG->print("writing block records...");
dxf.writeBlockRecord(*dw);
for (int i=0; i<graphic->countBlocks(); ++i) {
RS_Block* blk = graphic->blockAt(i);
dxf.writeBlockRecord(*dw,
std::string((const char*)blk->getName().toLatin1()));
}
dw->tableEnd();
}
// end of tables:
RS_DEBUG->print("writing end of section TABLES...");
dw->sectionEnd();
// Section BLOCKS:
RS_DEBUG->print("writing blocks...");
dw->sectionBlocks();
if (formatType!=RS2::FormatDxf12) {
RS_Block b1(graphic, RS_BlockData("*Model_Space",
RS_Vector(0.0,0.0), false));
writeBlock(&b1);
RS_Block b2(graphic, RS_BlockData("*Paper_Space",
RS_Vector(0.0,0.0), false));
writeBlock(&b2);
RS_Block b3(graphic, RS_BlockData("*Paper_Space0",
RS_Vector(0.0,0.0), false));
writeBlock(&b3);
}
for (int i=0; i<graphic->countBlocks(); ++i) {
RS_Block* blk = graphic->blockAt(i);
writeBlock(blk);
}
dw->sectionEnd();
// Section ENTITIES:
RS_DEBUG->print("writing section ENTITIES...");
dw->sectionEntities();
for (RS_Entity* e=graphic->firstEntity(RS2::ResolveNone);
e!=NULL;
e=graphic->nextEntity(RS2::ResolveNone)) {
writeEntity(e);
}
RS_DEBUG->print("writing end of section ENTITIES...");
dw->sectionEnd();
if (formatType!=RS2::FormatDxf12) {
RS_DEBUG->print("writing section OBJECTS...");
dxf.writeObjects(*dw);
// IMAGEDEF's from images in entities and images in blocks
RS_StringList written;
for (int i=0; i<graphic->countBlocks(); ++i) {
RS_Block* block = graphic->blockAt(i);
for (RS_Entity* e=block->firstEntity(RS2::ResolveAll);
e!=NULL;
e=block->nextEntity(RS2::ResolveAll)) {
if (e->rtti()==RS2::EntityImage) {
RS_Image* img = dynamic_cast<RS_Image*>(e);
if (written.contains(file)==0 && img->getHandle()!=0) {
writeImageDef(img);
written.append(img->getFile());
}
}
}
}
for (RS_Entity* e=graphic->firstEntity(RS2::ResolveNone);
e!=NULL;
e=graphic->nextEntity(RS2::ResolveNone)) {
if (e->rtti()==RS2::EntityImage) {
RS_Image* img = dynamic_cast<RS_Image*>(e);
if (written.contains(file)==0 && img->getHandle()!=0) {
writeImageDef(img);
written.append(img->getFile());
}
}
}
RS_DEBUG->print("writing end of section OBJECTS...");
dxf.writeObjectsEnd(*dw);
}
RS_DEBUG->print("writing EOF...");
dw->dxfEOF();
RS_DEBUG->print("close..");
dw->close();
delete dw;
dw = NULL;
// check if file was actually written (strange world of windoze xp):
if (RS_FileInfo(file).exists()==false) {
RS_DEBUG->print("RS_FilterDxf::fileExport: file could not be written");
return false;
}
*/

return true;
}

/**
* Writes all known variable settings to the DXF file.
*/
void RDxfExporter::writeVariables() {
/*
RS_Hash<RS_String, RS_Variable>::iterator it;
(graphic->getVariableDict());
for (it=graphic->getVariableDict().begin(); it!=graphic->getVariableDict().end(); ++it) {
// exclude variables that are not known to DXF 12:
if (!DL_Dxf::checkVariable(it.key().toLatin1(), dxf.getVersion())) {
continue;
}
if (it.key()!="$ACADVER" && it.key()!="$HANDSEED") {
dw->dxfString(9, (const char*) it.key().toLatin1());
switch (it.value().getType()) {
case RS2::VariableVoid:
break;
case RS2::VariableInt:
dw->dxfInt(it.value().getCode(), it.value().getInt());
break;
case RS2::VariableDouble:
dw->dxfReal(it.value().getCode(), it.value().getDouble());
break;
case RS2::VariableString:
dw->dxfString(it.value().getCode(),
(const char*) it.value().getString().toLatin1());
break;
case RS2::VariableVector:
dw->dxfReal(it.value().getCode(),
it.value().getVector().x);
dw->dxfReal(it.value().getCode()+10,
it.value().getVector().y);
if (isVariableTwoDimensional(it.key())==false) {
dw->dxfReal(it.value().getCode()+20,
it.value().getVector().z);
}
break;
}
}
}
RS_Layer* current = graphic->getActiveLayer();
if (current!=NULL) {
dw->dxfString(9, "$CLAYER");
dw->dxfString(8, (const char*)current->getName().toLatin1());
}
dw->sectionEnd();
*/
}
Loading

0 comments on commit 4e41b38

Please sign in to comment.