Skip to content
Permalink
Browse files

dwg import: less noisy debugging

  • Loading branch information
jef-n committed Feb 17, 2019
1 parent 1a96982 commit 6090a932c225672a64b725d0b36807756c99a007
@@ -13,15 +13,6 @@
// uncomment to get detailed debug output on DWG read. Caution: this option makes DWG import super-slow!
// #define DWGDEBUG 1

#ifndef DWGDEBUG
#ifdef QGSLOGGER_H
#error qgislogger.h already included
#endif
#undef QGISDEBUG
#endif // !DWGDEBUG

#include "qgslogger.h"

#include <cstdlib>

#include "drw_entities.h"
@@ -31,6 +22,17 @@

#include <QStringList>

#include "qgslogger.h"

#ifndef DWGDEBUG
#undef QgsDebugCall
#undef QgsDebugMsg
#undef QgsDebugMsgLevel
#define QgsDebugCall
#define QgsDebugMsg(str)
#define QgsDebugMsgLevel(str, level)
#endif

#define RESERVE( vector, size ) try { \
vector.reserve(size); \
} catch(const std::exception &e) { \
@@ -1305,7 +1307,7 @@ bool DRW_Insert::parseDwg( DRW::Version version, dwgBuffer *buf, duint32 bs )
angle = buf->getBitDouble();
extPoint = buf->getExtrusion( false ); //3BD R14 style

QgsDebugMsgLevel( QStringLiteral( "scale:%1, angle:%2 extrusion:%3" )
QgsDebugMsgLevel( QStringLiteral( "scale:%1 angle:%2 extrusion:%3" )
.arg( QStringLiteral( "%1,%2,%3" ).arg( xscale ).arg( yscale ).arg( zscale ) )
.arg( angle )
.arg( QStringLiteral( "%1,%2,%3" ).arg( extPoint.x ).arg( extPoint.y ).arg( extPoint.z ) ), 4
@@ -10,17 +10,30 @@
** along with this program. If not, see <http://www.gnu.org/licenses/>. **
******************************************************************************/

// uncomment to get detailed debug output on DWG read. Caution: this option makes DWG import super-slow!
// #define DWGDEBUG 1

#include "drw_header.h"
#include "intern/dxfreader.h"
#include "intern/dxfwriter.h"
#include "intern/drw_dbg.h"
#include "intern/dwgbuffer.h"

#include "qgslogger.h"
#include <QStringList>

#include <cassert>

#include "qgslogger.h"

#ifndef DWGDEBUG
#undef QgsDebugCall
#undef QgsDebugMsg
#undef QgsDebugMsgLevel
#define QgsDebugCall
#define QgsDebugMsg(str)
#define QgsDebugMsgLevel(str, level)
#endif

DRW_Header::DRW_Header()
: curr( nullptr )
, version( DRW::AC1021 )
@@ -10,6 +10,9 @@
** along with this program. If not, see <http://www.gnu.org/licenses/>. **
******************************************************************************/

// uncomment to get detailed debug output on DWG read. Caution: this option makes DWG import super-slow!
// #define DWGDEBUG 1

#include <iostream>
#include <cmath>

@@ -20,10 +23,19 @@
#include "intern/drw_dbg.h"
#include "intern/dwgutil.h"

#undef QGISDEBUG
#include "qgslogger.h"
#include <QStringList>

#include "qgslogger.h"

#ifndef DWGDEBUG
#undef QgsDebugCall
#undef QgsDebugMsg
#undef QgsDebugMsgLevel
#define QgsDebugCall
#define QgsDebugMsg(str)
#define QgsDebugMsgLevel(str, level)
#endif

#define RESERVE( vector, size ) try { \
vector.reserve(size); \
} catch(const std::exception &e) { \
@@ -296,7 +296,8 @@ std::string DRW_Converter::encodeNum( int c )
return std::string( ( char * )ret );
}

/** 's' is a string with at least 4 bytes length
/**
* 's' is a string with at least 4 bytes length
** returned 'b' is byte length of encoded char: 2,3 or 4
**/
int DRW_Converter::decodeNum( std::string s, int *b )
@@ -10,34 +10,23 @@
** along with this program. If not, see <http://www.gnu.org/licenses/>. **
******************************************************************************/

// uncomment to get detailed debug output on DWG read. Caution: this option makes DWG import super-slow!
// #define DWGDEBUG 1

#include "dwgbuffer.h"
#include "../libdwgr.h"
#include "drw_textcodec.h"
#include "drw_dbg.h"

#undef QGISDEBUG
#include "qgslogger.h"

#if 0
//#include <bitset>
#include <fstream>
#include <algorithm>
#include <sstream>
#include "dwgreader.h"
#include "dxfwriter.h"

#define FIRSTHANDLE 48

enum sections
{
secUnknown,
secHeader,
secTables,
secBlocks,
secEntities,
secObjects
};
#ifndef DWGDEBUG
#undef QgsDebugCall
#undef QgsDebugMsg
#undef QgsDebugMsgLevel
#define QgsDebugCall
#define QgsDebugMsg(str)
#define QgsDebugMsgLevel(str, level)
#endif

static unsigned int crctable[256] =
@@ -10,6 +10,9 @@
** along with this program. If not, see <http://www.gnu.org/licenses/>. **
******************************************************************************/

// uncomment to get detailed debug output on DWG read. Caution: this option makes DWG import super-slow!
// #define DWGDEBUG 1

#include <cstdlib>
#include <iostream>
#include <fstream>
@@ -19,12 +22,20 @@
#include "dwgreader.h"
#include "drw_textcodec.h"

#undef QGISDEBUG
#include "qgslogger.h"
#include "qgsmessagelog.h"

#include <QStringList>

#ifndef DWGDEBUG
#undef QgsDebugCall
#undef QgsDebugMsg
#undef QgsDebugMsgLevel
#define QgsDebugCall
#define QgsDebugMsg(str)
#define QgsDebugMsgLevel(str, level)
#endif


dwgReader::~dwgReader()
{
@@ -221,7 +232,7 @@ bool dwgReader::readDwgHandles( dwgBuffer *dbuf, duint32 offset, duint32 size )
*/
bool dwgReader::readDwgTables( DRW_Header &hdr, dwgBuffer *dbuf )
{
QgsDebugMsg( "Entering." );
QgsDebugMsgLevel( "Entering.", 4 );

bool ret = true;
bool ret2 = true;
@@ -10,6 +10,9 @@
** along with this program. If not, see <http://www.gnu.org/licenses/>. **
******************************************************************************/

// uncomment to get detailed debug output on DWG read. Caution: this option makes DWG import super-slow!
// #define DWGDEBUG 1

#include <cstdlib>
#include <fstream>
#include <string>
@@ -20,6 +23,14 @@

#include "qgslogger.h"

#ifndef DWGDEBUG
#undef QgsDebugCall
#undef QgsDebugMsg
#undef QgsDebugMsgLevel
#define QgsDebugCall
#define QgsDebugMsg(str)
#define QgsDebugMsgLevel(str, level)
#endif

bool dxfReader::readRec( int *codeData )
{
@@ -10,8 +10,11 @@
** along with this program. If not, see <http://www.gnu.org/licenses/>. **
******************************************************************************/

// uncomment to get detailed debug output on DWG read. Caution: this option makes DWG import super-slow!
// #define DWGDEBUG 1

#include "libdxfrw.h"

#include <fstream>
#include <algorithm>
#include <sstream>
@@ -24,6 +27,15 @@

#include "qgslogger.h"

#ifndef DWGDEBUG
#undef QgsDebugCall
#undef QgsDebugMsg
#undef QgsDebugMsgLevel
#define QgsDebugCall
#define QgsDebugMsg(str)
#define QgsDebugMsgLevel(str, level)
#endif

#if __cplusplus >= 201500
#define FALLTHROUGH [[fallthrough]];
#elif defined(__clang__)
@@ -2314,7 +2326,6 @@ bool dxfRW::processTables()
bool dxfRW::processLType()
{
QgsDebugMsg( "Entering." );

int code;
std::string sectionstr;
bool reading = false;
@@ -262,7 +262,7 @@ Multiply x and y by the given value
sipRes = qHash( *sipCpp );
%End

}; // class QgsPoint
}; // class QgsPointXY



0 comments on commit 6090a93

Please sign in to comment.
You can’t perform that action at this time.