29 #include "dl_global.h"
37 #endif // _MSC_VER > 1000
42 #include "dl_attributes.h"
63 this->version = version;
66 paperSpace0Handle = 0;
81 void section(
const char* name)
const {
82 dxfString(0,
"SECTION");
96 void sectionHeader()
const {
110 void sectionTables()
const {
124 void sectionBlocks()
const {
138 void sectionEntities()
const {
152 void sectionClasses()
const {
166 void sectionObjects()
const {
178 void sectionEnd()
const {
179 dxfString(0,
"ENDSEC");
194 void table(
const char* name,
int num,
int h=0)
const {
195 dxfString(0,
"TABLE");
197 if (version>=DL_VERSION_2000) {
204 dxfString(100,
"AcDbSymbolTable");
222 void tableLayers(
int num)
const {
223 table(
"LAYER", num, 2);
239 void tableLinetypes(
int num)
const {
241 table(
"LTYPE", num, 5);
257 void tableAppid(
int num)
const {
258 table(
"APPID", num, 9);
274 void tableStyle(
int num)
const {
275 table(
"STYLE", num, 3);
286 void tableEnd()
const {
287 dxfString(0,
"ENDTAB");
298 void dxfEOF()
const {
310 void comment(
const char* text)
const {
311 dxfString(999, text);
324 void entity(
const char* entTypeName)
const {
325 dxfString(0, entTypeName);
326 if (version>=DL_VERSION_2000) {
352 if (version>=DL_VERSION_2000 || attrib.
getColor()!=256) {
355 if (version>=DL_VERSION_2000 && attrib.
getColor24()!=-1) {
358 if (version>=DL_VERSION_2000) {
361 if (version>=DL_VERSION_2000) {
362 dxfReal(48, attrib.getLinetypeScale());
365 std::transform(linetype.begin(), linetype.end(), linetype.begin(), ::toupper);
366 if (version>=DL_VERSION_2000 || linetype==
"BYLAYER") {
374 void subClass(
const char* sub)
const {
386 void tableLayerEntry(
unsigned long int h=0)
const {
387 dxfString(0,
"LAYER");
388 if (version>=DL_VERSION_2000) {
394 dxfString(100,
"AcDbSymbolTableRecord");
395 dxfString(100,
"AcDbLayerTableRecord");
407 void tableLinetypeEntry(
unsigned long int h=0)
const {
408 dxfString(0,
"LTYPE");
409 if (version>=DL_VERSION_2000) {
416 dxfString(100,
"AcDbSymbolTableRecord");
417 dxfString(100,
"AcDbLinetypeTableRecord");
429 void tableAppidEntry(
unsigned long int h=0)
const {
430 dxfString(0,
"APPID");
431 if (version>=DL_VERSION_2000) {
438 dxfString(100,
"AcDbSymbolTableRecord");
439 dxfString(100,
"AcDbRegAppTableRecord");
451 void sectionBlockEntry(
unsigned long int h=0)
const {
452 dxfString(0,
"BLOCK");
453 if (version>=DL_VERSION_2000) {
460 dxfString(100,
"AcDbEntity");
465 dxfString(100,
"AcDbBlockBegin");
477 void sectionBlockEntryEnd(
unsigned long int h=0)
const {
478 dxfString(0,
"ENDBLK");
479 if (version>=DL_VERSION_2000) {
486 dxfString(100,
"AcDbEntity");
491 dxfString(100,
"AcDbBlockEnd");
495 void color(
int col=256)
const {
498 void linetype(
const char *lt)
const {
501 void linetypeScale(
double scale)
const {
504 void lineWeight(
int lw)
const {
508 void coord(
int gc,
double x,
double y,
double z=0)
const {
514 void coordTriplet(
int gc,
const double* value)
const {
516 dxfReal(gc, *value++);
517 dxfReal(gc+10, *value++);
518 dxfReal(gc+20, *value++);
522 void resetHandle()
const {
529 unsigned long handle(
int gc=5)
const {
531 dxfHex(gc, m_handle);
538 unsigned long getNextHandle()
const {
545 unsigned long incHandle()
const {
553 void setModelSpaceHandle(
unsigned long h) {
554 modelSpaceHandle = h;
557 unsigned long getModelSpaceHandle() {
558 return modelSpaceHandle;
565 void setPaperSpaceHandle(
unsigned long h) {
566 paperSpaceHandle = h;
569 unsigned long getPaperSpaceHandle() {
570 return paperSpaceHandle;
577 void setPaperSpace0Handle(
unsigned long h) {
578 paperSpace0Handle = h;
581 unsigned long getPaperSpace0Handle() {
582 return paperSpace0Handle;
592 virtual void dxfReal(
int gc,
double value)
const = 0;
601 virtual void dxfInt(
int gc,
int value)
const = 0;
610 virtual void dxfBool(
int gc,
bool value)
const {
611 dxfInt(gc, (
int)value);
621 virtual void dxfHex(
int gc,
int value)
const = 0;
630 virtual void dxfString(
int gc,
const char* value)
const = 0;
639 virtual void dxfString(
int gc,
const std::string& value)
const = 0;
642 mutable unsigned long m_handle;
643 mutable unsigned long modelSpaceHandle;
644 mutable unsigned long paperSpaceHandle;
645 mutable unsigned long paperSpace0Handle;