Skip to content

Commit fec20ae

Browse files
committedFeb 19, 2019
dwg import: less noisy noise reduction
1 parent 7949046 commit fec20ae

File tree

4 files changed

+26
-564
lines changed

4 files changed

+26
-564
lines changed
 

‎external/libdxfrw/drw_entities.cpp

Lines changed: 15 additions & 555 deletions
Large diffs are not rendered by default.

‎external/libdxfrw/intern/dwgbuffer.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,8 @@ std::string dwgBuffer::getCP8Text()
711711

712712
//TU unicode 16 bit (UCS) text converted to utf8
713713

714-
/** Reads 2-bytes char (UCS2, nullptr terminated) and convert to std::string (only for Latin-1)
714+
/**
715+
* Reads 2-bytes char (UCS2, nullptr terminated) and convert to std::string (only for Latin-1)
715716
ts= total input size in bytes.
716717
**/
717718
std::string dwgBuffer::getUCSStr( duint16 ts )
@@ -919,31 +920,31 @@ duint32 dwgBuffer::getEnColor( DRW::Version v, int &rgb, int &transparency )
919920
transparency = 0;
920921

921922
duint16 idx = getBitShort();
922-
QgsDebugMsg( QString( "idx reads COLOR: 0x%1" ).arg( idx, 0, 16 ) );
923+
QgsDebugMsgLevel( QString( "idx reads COLOR: 0x%1" ).arg( idx, 0, 16 ), 4 );
923924

924925
duint16 flags = idx >> 8;
925926

926927
idx = idx & 0x1FF; //RLZ: warning this is correct?
927928

928-
QgsDebugMsg( QString( "flag COLOR:0x%1, index COLOR:0x%2" ).arg( flags, 0, 16 ).arg( idx, 0, 16 ) );
929+
QgsDebugMsgLevel( QString( "flag COLOR:0x%1, index COLOR:0x%2" ).arg( flags, 0, 16 ).arg( idx, 0, 16 ), 4 );
929930

930931
if ( flags & 0x80 )
931932
{
932933
// complex color (rgb)
933934
rgb = getBitLong() & 0xffffff;
934935

935-
QgsDebugMsg( QString( "RGB COLOR:0x%1" ).arg( rgb, 0, 16 ) );
936+
QgsDebugMsgLevel( QString( "RGB COLOR:0x%1" ).arg( rgb, 0, 16 ), 4 );
936937

937938
if ( flags & 0x80 )
938939
{
939-
QgsDebugMsg( "acdbColor COLOR are present" );
940+
QgsDebugMsgLevel( "acdbColor COLOR are present", 4 );
940941
}
941942
}
942943

943944
if ( flags & 0x20 )
944945
{
945946
transparency = getBitLong();
946-
QgsDebugMsg( QString( "Transparency COLOR:0x%1" ).arg( transparency, 0, 16 ) );
947+
QgsDebugMsgLevel( QString( "Transparency COLOR:0x%1" ).arg( transparency, 0, 16 ), 4 );
947948
}
948949

949950
return idx; //default return ByLayer

‎external/libdxfrw/intern/dwgreader.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ bool dwgReader::checkSentinel( dwgBuffer *buf, enum secEnum::DWGSection, bool st
149149

150150
/*********** objects map ************************/
151151

152-
/** Note: object map are split in sections with max size 2035?
152+
/**
153+
* Note: object map are split in sections with max size 2035?
153154
* each section are 2 bytes size + data bytes + 2 bytes crc
154155
* size value are data bytes + 2 and to calculate crc are used
155156
* 2 bytes size + data bytes
@@ -973,7 +974,7 @@ bool dwgReader::readDwgBlocks( DRW_Interface &intfa, dwgBuffer *dbuf )
973974
ret = false;
974975
continue;
975976
}
976-
else //foud entity reads it
977+
else //found entity, read it
977978
{
978979
oc = mit->second;
979980
ObjectMap.erase( mit );

‎src/app/dwg/qgsdwgimporter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2196,7 +2196,7 @@ void QgsDwgImporter::addText( const DRW_Text &data )
21962196
addEntity( dfn, f, data );
21972197

21982198
SETDOUBLE( height );
2199-
SETSTRING( text );
2199+
SETSTRING( text ); // TODO: parse MTEXT
22002200
SETDOUBLE( angle );
22012201
SETDOUBLE( widthscale );
22022202
SETDOUBLE( oblique );

0 commit comments

Comments
 (0)
Please sign in to comment.