QCAD
Open Source 2D CAD
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RDxfServices Class Reference

Copyright (c) 2011-2013 by Andrew Mustun. More...

#include <RDxfServices.h>

List of all members.

Public Member Functions

QString collectQCad2Info (const QString &fileName)
 QCAD 2 stores the font name in field 'text style name', DXF code 7 which is not supported by Teigha.
void detectQCad2Format (const QString &fileName)
void fixBlockName (QString &blockName)
void fixDimensionLabel (QString &text, QString &uTol, QString &lTol)
QString fixFontName (const QString &fontName) const
 Makes DXF/DWG font names QCAD compatible by removing .shx and fixing the name if appropriate.
void fixLayerName (QString &layerName)
void fixQCad2HatchData (QString &patternName, double &angle, double &scale, bool solid) const
void fixQCad2String (QString &str) const
QTextCodec * getCodec () const
QString getQCad2BlockName (const QString &blockName) const
bool getQCad2Compatibility () const
QString getQCad2DimensionLabel (const QString &handle) const
QString getQCad2Font (const QString &handle) const
QString getQCad2LayerName (const QString &layerName) const
double getQCad2PatternAngle (double angle, const QString &patternName) const
QString getQCad2PatternName (const QString &patternName) const
double getQCad2PatternScale (double scale, const QString &patternName) const
bool getQCad3Compatibility () const
bool hasDIMAZIN () const
bool hasDIMZIN () const
bool hasInvalidEllipse () const
 RDxfServices ()
 Copyright (c) 2011-2013 by Andrew Mustun.
void reset ()
void setCodec (QTextCodec *codec)

Static Public Member Functions

static RColor attributesToColor (int color, int color24, const double dxfColors[][3], bool forLayer=false)
static int colorToNumber (const RColor &col, const double dxfColors[][3])
 Converts a color into a color number in the DXF palette.
static int colorToNumber24 (const RColor &col)
static QString escapeUnicode (const QString &str)
static int getCodeForVariable (RS::KnownVariable v)
static bool isVariable2D (RS::KnownVariable v)
 Checks if the given variable is two-dimensional (e.g.
static RColor numberToColor (int num, const double dxfColors[][3], bool comp=false, bool forLayer=false)
 Converts a color index (num) into a RColor object.
static RColor numberToColor24 (int num)
static RLineweight::Lineweight numberToWeight (int num)
 Converts a line width number (e.g.
static QString parseUnicode (const QString &str)
static RS::KnownVariable stringToVariable (const QString &s)
static QString variableToString (RS::KnownVariable v)
static int widthToNumber (RLineweight::Lineweight w)
 Converts a RLineweight::Lineweight into an int width for use in DXF files.

Private Attributes

QTextCodec * codec
QMap< QString, QString > qcad2BlockMapping
bool qcad2Compatibility
QMap< QString, QString > qcad2DimensionLabels
bool qcad2GotDIMAZIN
bool qcad2GotDIMZIN
bool qcad2GotInvalidEllipse
QMap< QString, QString > qcad2LayerMapping
QMap< QString, QString > qcad2TextFonts
bool qcad3Compatibility

Detailed Description

Copyright (c) 2011-2013 by Andrew Mustun.

All rights reserved.

This file is part of the QCAD project.

QCAD is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

QCAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with QCAD. DXF support tools, mainly for QCAD 2 DXF imports.

Scriptable:
This class is wrapped for script environments.
Copyable:
Script wrappers of this class should pass objects by reference.

Constructor & Destructor Documentation

RDxfServices::RDxfServices ( )

Copyright (c) 2011-2013 by Andrew Mustun.

All rights reserved.

This file is part of the QCAD project.

QCAD is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

QCAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with QCAD.


Member Function Documentation

RColor RDxfServices::attributesToColor ( int  color,
int  color24,
const double  dxfColors[][3],
bool  forLayer = false 
)
static
   \par Non-Scriptable:

This function is not available in script environments.

Returns:
Pen with the same attributes as 'attributes'.
QString RDxfServices::collectQCad2Info ( const QString &  fileName)

QCAD 2 stores the font name in field 'text style name', DXF code 7 which is not supported by Teigha.

This function collects all font names of MTEXT entities for use by RDwgMTextImporter.

int RDxfServices::colorToNumber ( const RColor col,
const double  dxfColors[][3] 
)
static

Converts a color into a color number in the DXF palette.

   \par Non-Scriptable:

This function is not available in script environments.

The color that fits best is chosen.

int RDxfServices::colorToNumber24 ( const RColor col)
static
Returns:
24 bit color as DXF prepared int.
void RDxfServices::detectQCad2Format ( const QString &  fileName)
QString RDxfServices::escapeUnicode ( const QString &  str)
static
void RDxfServices::fixBlockName ( QString &  blockName)
void RDxfServices::fixDimensionLabel ( QString &  text,
QString &  uTol,
QString &  lTol 
)
QString RDxfServices::fixFontName ( const QString &  fontName) const

Makes DXF/DWG font names QCAD compatible by removing .shx and fixing the name if appropriate.

void RDxfServices::fixLayerName ( QString &  layerName)
void RDxfServices::fixQCad2HatchData ( QString &  patternName,
double &  angle,
double &  scale,
bool  solid 
) const
void RDxfServices::fixQCad2String ( QString &  str) const
QTextCodec* RDxfServices::getCodec ( ) const
inline
int RDxfServices::getCodeForVariable ( RS::KnownVariable  v)
static
QString RDxfServices::getQCad2BlockName ( const QString &  blockName) const
bool RDxfServices::getQCad2Compatibility ( ) const
inline
QString RDxfServices::getQCad2DimensionLabel ( const QString &  handle) const
QString RDxfServices::getQCad2Font ( const QString &  handle) const
QString RDxfServices::getQCad2LayerName ( const QString &  layerName) const
double RDxfServices::getQCad2PatternAngle ( double  angle,
const QString &  patternName 
) const
QString RDxfServices::getQCad2PatternName ( const QString &  patternName) const
double RDxfServices::getQCad2PatternScale ( double  scale,
const QString &  patternName 
) const
Parameters:
scaleOld QCAD 2 pattern scale.
patternNameOld QCAD 2 pattern name.
bool RDxfServices::getQCad3Compatibility ( ) const
inline
bool RDxfServices::hasDIMAZIN ( ) const
inline
bool RDxfServices::hasDIMZIN ( ) const
inline
bool RDxfServices::hasInvalidEllipse ( ) const
inline
bool RDxfServices::isVariable2D ( RS::KnownVariable  v)
static

Checks if the given variable is two-dimensional (e.g.

$LIMMIN).

RColor RDxfServices::numberToColor ( int  num,
const double  dxfColors[][3],
bool  comp = false,
bool  forLayer = false 
)
static

Converts a color index (num) into a RColor object.

   \par Non-Scriptable:

This function is not available in script environments.

Please refer to the dxflib documentation for details.

Parameters:
numColor number.
compCompatibility with older QCad versions (1.5.3 and older)
RColor RDxfServices::numberToColor24 ( int  num)
static
Returns:
color object from DXF coded integar 24 bit color number.
RLineweight::Lineweight RDxfServices::numberToWeight ( int  num)
static

Converts a line width number (e.g.

1) into a RS2::LineWidth.

QString RDxfServices::parseUnicode ( const QString &  str)
static
void RDxfServices::reset ( )
void RDxfServices::setCodec ( QTextCodec *  codec)
inline
RS::KnownVariable RDxfServices::stringToVariable ( const QString &  s)
static
QString RDxfServices::variableToString ( RS::KnownVariable  v)
static
int RDxfServices::widthToNumber ( RLineweight::Lineweight  w)
static

Converts a RLineweight::Lineweight into an int width for use in DXF files.


Member Data Documentation

QTextCodec* RDxfServices::codec
private
QMap<QString, QString> RDxfServices::qcad2BlockMapping
private
bool RDxfServices::qcad2Compatibility
private
QMap<QString, QString> RDxfServices::qcad2DimensionLabels
private
bool RDxfServices::qcad2GotDIMAZIN
private
bool RDxfServices::qcad2GotDIMZIN
private
bool RDxfServices::qcad2GotInvalidEllipse
private
QMap<QString, QString> RDxfServices::qcad2LayerMapping
private
QMap<QString, QString> RDxfServices::qcad2TextFonts
private
bool RDxfServices::qcad3Compatibility
private

The documentation for this class was generated from the following files: