| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | #include "dl_jww.h" |
| |
|
| | #include <algorithm> |
| | #include <string> |
| | #include <cstdio> |
| | #include <cassert> |
| | #include <cmath> |
| |
|
| | #include "dl_creationinterface.h" |
| |
|
| | #define SKIP_MOJI |
| | #ifdef DEBUG |
| | #include "rs_debug.h" |
| | #endif |
| |
|
| | #define ArraySize(arr) (sizeof(arr)/sizeof(arr[0])) |
| |
|
| | static int colTable[] = { |
| | 250, |
| | 4, |
| | 256, |
| | 3, |
| | 2, |
| | 6, |
| | 5, |
| | 131, |
| | 221, |
| | 8, |
| | 23, |
| | 6, |
| | 1, |
| | 7, |
| | 252, |
| | 256 |
| | }; |
| |
|
| | static string lTable[] = { |
| | "CONTINUOUS", |
| | "CONTINUOUS", |
| | "CONTINUOUS", |
| | |
| | |
| | |
| | "DASHED", |
| | "DASHED2", |
| | "DASHEDX2", |
| | |
| | |
| | |
| | |
| | |
| | |
| | "CENTER", |
| | "CENTER2", |
| | |
| | "BORDER", |
| | "BORDER2", |
| | "BORDERX2", |
| | "ByLayer", |
| | "ByBlock", |
| | }; |
| |
|
| | static string HEX[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"}; |
| |
|
| | static double Deg(double ang) |
| | { |
| | return ang / M_PI * 180.0; |
| | } |
| |
|
| | |
| | |
| | |
| | DL_Jww::DL_Jww() { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | DL_Jww::~DL_Jww() { |
| | } |
| |
|
| | void DL_Jww::CreateSen(DL_CreationInterface* creationInterface, CDataSen& DSen) |
| | { |
| | string lName = HEX[DSen.m_nGLayer > ArraySize(HEX)-1 ? ArraySize(HEX)-1: DSen.m_nGLayer] + "-" + |
| | HEX[DSen.m_nLayer > ArraySize(HEX)-1 ? ArraySize(HEX)-1: DSen.m_nLayer]; |
| | |
| | creationInterface->addLayer(DL_LayerData(lName,0)); |
| | |
| | if(DSen.m_nPenStyle > ArraySize(lTable)-1) |
| | std::cout << "線種番号 " << (jwWORD)DSen.m_nPenStyle << std::endl; |
| | if(DSen.m_nPenColor > ArraySize(colTable)-1) |
| | std::cout << "線色番号 " << (jwWORD)DSen.m_nPenColor << std::endl; |
| | if(DSen.m_nPenWidth > 26) |
| | std::cout << "線色幅 " << (jwWORD)DSen.m_nPenWidth << std::endl; |
| | |
| | int width; |
| | if(DSen.m_nPenWidth > 26) |
| | width = 0; |
| | else |
| | width = DSen.m_nPenWidth; |
| | int color = colTable[DSen.m_nPenColor > ArraySize(colTable)-1 ? ArraySize(colTable)-1 : DSen.m_nPenColor]; |
| | attrib = DL_Attributes(values[8], |
| | color, |
| | width, |
| | lTable[DSen.m_nPenStyle > ArraySize(lTable)-1 ? ArraySize(lTable)-1 : DSen.m_nPenStyle]); |
| | creationInterface->setAttributes(attrib); |
| |
|
| | creationInterface->setExtrusion(0.0, 0.0, 1.0, 0.0 ); |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | DL_LineData d(DSen.m_start.x, |
| | DSen.m_start.y, |
| | 0.0, |
| | DSen.m_end.x, |
| | DSen.m_end.y, |
| | 0.0); |
| |
|
| | creationInterface->addLine(d); |
| |
|
| | #ifdef FINISHED |
| | RS_LineData data(RS_Vector(0.0, 0.0), RS_Vector(0.0, 0.0)); |
| | RS_Line* line; |
| |
|
| | data.startpoint = RS_Vector(DSen.m_start.x, DSen.m_start.y); |
| | data.endpoint = RS_Vector(DSen.m_end.x, DSen.m_end.y); |
| | line = new RS_Line(graphic, data); |
| | RS2::LineType ltype = lTable[DSen.m_nPenStyle]; |
| | RS_Color col = colTable[DSen.m_nPenColor]; |
| | RS2::LineWidth lw = lWidth[DSen.m_nPenWidth>26 ? 0 : DSen.m_nPenWidth]; |
| | line->setPen(RS_Pen(col, lw, ltype)); |
| | |
| | |
| | |
| | |
| | |
| | |
| | RS_String lName = HEX[DSen.m_nGLayer > 0x0f ? 0: DSen.m_nGLayer] + "-" + |
| | HEX[DSen.m_nLayer > 0x0f ? 0: DSen.m_nLayer]; |
| | if( graphic->findLayer(lName) == (RS_Layer*)NULL ){ |
| | #ifdef DEBUG |
| | cout << jwdoc->vSen[i].m_nGLayer << " " << jwdoc->vSen[i].m_nLayer << endl; |
| | std::cout << lName.ascii() << std::endl; |
| | #endif |
| | RS_Layer* layer = new RS_Layer(lName); |
| | graphic->addLayer(layer); |
| | } |
| | line->setLayer(lName); |
| | #ifdef DEBUG |
| | std::cout << "線種番号 " << (jwWORD)DSen.m_nPenStyle << std::endl; |
| | std::cout << "線色番号 " << (jwWORD)DSen.m_nPenColor << std::endl; |
| | std::cout << "線色幅 " << (jwWORD)DSen.m_nPenWidth << std::endl; |
| | #endif |
| |
|
| | |
| | graphic->addEntity(line); |
| | std::cout << *line; |
| | #endif |
| | } |
| |
|
| | void DL_Jww::CreateEnko(DL_CreationInterface* creationInterface, CDataEnko& DEnko) |
| | { |
| | string lName = HEX[DEnko.m_nGLayer > ArraySize(HEX)-1 ? ArraySize(HEX)-1: DEnko.m_nGLayer] + "-" + |
| | HEX[DEnko.m_nLayer > ArraySize(HEX)-1 ? ArraySize(HEX)-1: DEnko.m_nLayer]; |
| |
|
| | |
| | creationInterface->addLayer(DL_LayerData(lName,0)); |
| |
|
| | int width; |
| | if(DEnko.m_nPenWidth > 26) |
| | width = 0; |
| | else |
| | width = DEnko.m_nPenWidth; |
| | int color = colTable[DEnko.m_nPenColor > ArraySize(colTable)-1 ? ArraySize(colTable)-1 : DEnko.m_nPenColor]; |
| | attrib = DL_Attributes(values[8], |
| | color, |
| | width, |
| | lTable[DEnko.m_nPenStyle > ArraySize(lTable)-1 ? ArraySize(lTable)-1 : DEnko.m_nPenStyle]); |
| | creationInterface->setAttributes(attrib); |
| |
|
| | creationInterface->setExtrusion(0.0, 0.0, 1.0, 0.0 ); |
| |
|
| | double angle1, angle2; |
| | |
| | if(DEnko.m_bZenEnFlg){ |
| | if(DEnko.m_dHenpeiRitsu == 1.0){ |
| | DL_CircleData d(DEnko.m_start.x, DEnko.m_start.y, 0.0, DEnko.m_dHankei); |
| | creationInterface->addCircle(d); |
| | }else{ |
| | double angle1, angle2; |
| | if(DEnko.m_radEnkoKaku > 0.0){ |
| | angle1 = DEnko.m_radKaishiKaku; |
| | angle2 = DEnko.m_radKaishiKaku + DEnko.m_radEnkoKaku; |
| | }else{ |
| | angle1 = DEnko.m_radKaishiKaku + DEnko.m_radEnkoKaku; |
| | angle2 = DEnko.m_radKaishiKaku; |
| | } |
| | angle1 = angle1 - floor(angle1 / (M_PI * 2.0)) * M_PI * 2.0; |
| | angle2 = angle2 - floor(angle2 / (M_PI * 2.0)) * M_PI * 2.0; |
| | if( angle2 <= angle1 ) |
| | angle1 = angle1 - M_PI * 2.0; |
| | |
| | DL_EllipseData d(DEnko.m_start.x, DEnko.m_start.y, 0.0, |
| | DEnko.m_dHankei * cos(DEnko.m_radKatamukiKaku), DEnko.m_dHankei * sin(DEnko.m_radKatamukiKaku), 0.0, |
| | DEnko.m_dHenpeiRitsu, |
| | angle1, angle2); |
| |
|
| | creationInterface->addEllipse(d); |
| | } |
| | }else{ |
| | if(DEnko.m_dHenpeiRitsu == 1.0){ |
| | |
| | if(DEnko.m_radEnkoKaku > 0.0){ |
| | angle1 = DEnko.m_radKaishiKaku + DEnko.m_radKatamukiKaku; |
| | angle2 = DEnko.m_radKaishiKaku + DEnko.m_radKatamukiKaku + DEnko.m_radEnkoKaku; |
| | }else{ |
| | angle1 = DEnko.m_radKaishiKaku + DEnko.m_radKatamukiKaku + DEnko.m_radEnkoKaku; |
| | angle2 = DEnko.m_radKaishiKaku + DEnko.m_radKatamukiKaku; |
| | } |
| | angle1 = angle1 - floor(angle1 / (M_PI * 2.0)) * M_PI * 2.0; |
| | angle2 = angle2 - floor(angle2 / (M_PI * 2.0)) * M_PI * 2.0; |
| | if( angle2 <= angle1 ) |
| | angle1 = angle1 - M_PI * 2.0; |
| | DL_ArcData d(DEnko.m_start.x, DEnko.m_start.y, 0.0, |
| | DEnko.m_dHankei, |
| | Deg(angle1), |
| | Deg(angle2)); |
| |
|
| | creationInterface->addArc(d); |
| | }else{ |
| | double angle1, angle2; |
| | if(DEnko.m_radEnkoKaku > 0.0){ |
| | angle1 = DEnko.m_radKaishiKaku; |
| | angle2 = DEnko.m_radKaishiKaku + DEnko.m_radEnkoKaku; |
| | }else{ |
| | angle1 = DEnko.m_radKaishiKaku + DEnko.m_radEnkoKaku; |
| | angle2 = DEnko.m_radKaishiKaku; |
| | } |
| | angle1 = angle1 - floor(angle1 / (M_PI * 2.0)) * M_PI * 2.0; |
| | angle2 = angle2 - floor(angle2 / (M_PI * 2.0)) * M_PI * 2.0; |
| | if( angle2 <= angle1 ) |
| | angle1 = angle1 - M_PI * 2.0; |
| | |
| | DL_EllipseData d(DEnko.m_start.x, DEnko.m_start.y, 0.0, |
| | DEnko.m_dHankei * cos(DEnko.m_radKatamukiKaku), DEnko.m_dHankei * sin(DEnko.m_radKatamukiKaku), 0.0, |
| | DEnko.m_dHenpeiRitsu, |
| | angle1, angle2); |
| |
|
| | creationInterface->addEllipse(d); |
| | } |
| | } |
| | #ifdef FINISHED |
| | RS_CircleData data1(RS_Vector(0.0, 0.0), 0.0); |
| | RS_Circle* circle; |
| | RS_ArcData arc_data(RS_Vector(0.0, 0.0), 0.0, 0.0, 0.0, false); |
| | RS_Arc* arc; |
| | RS_Ellipse* elps; |
| | |
| | if(DEnko.m_bZenEnFlg){ |
| | if(DEnko.m_dHenpeiRitsu == 1.0){ |
| | data1.center = RS_Vector(DEnko.m_start.x, DEnko.m_start.y); |
| | data1.radius = DEnko.m_dHankei; |
| | circle = new RS_Circle(graphic, data1); |
| | RS2::LineType ltype = lTable[DEnko.m_nPenStyle]; |
| | RS_Color col = colTable[DEnko.m_nPenColor]; |
| | RS2::LineWidth lw = lWidth[DEnko.m_nPenWidth > 26 ? 0 : DEnko.m_nPenWidth]; |
| | circle->setPen(RS_Pen(col, lw, ltype)); |
| |
|
| | RS_String lName = HEX[DEnko.m_nGLayer > 0x0f ? 0:DEnko.m_nGLayer] + "-" + |
| | HEX[DEnko.m_nLayer > 0x0f ? 0: DEnko.m_nLayer]; |
| | if( graphic->findLayer(lName) == (RS_Layer*)NULL ){ |
| | #ifdef DEBUG |
| | std::cout << lName.ascii() << std::endl; |
| | #endif |
| | RS_Layer* layer = new RS_Layer(lName); |
| | graphic->addLayer(layer); |
| | } |
| | circle->setLayer(lName); |
| | |
| | graphic->addEntity(circle); |
| | #ifdef DEBUG |
| | std::cout << *circle; |
| | #endif |
| | }else{ |
| | |
| | double angle1, angle2; |
| | if(DEnko.m_radEnkoKaku > 0.0){ |
| | angle1 = DEnko.m_radKaishiKaku; |
| | angle2 = DEnko.m_radKaishiKaku + DEnko.m_radEnkoKaku; |
| | }else{ |
| | angle1 = DEnko.m_radKaishiKaku + DEnko.m_radEnkoKaku; |
| | angle2 = DEnko.m_radKaishiKaku; |
| | } |
| | angle1 = angle1 - floor(angle1 / (M_PI * 2.0)) * M_PI * 2.0; |
| | angle2 = angle2 - floor(angle2 / (M_PI * 2.0)) * M_PI * 2.0; |
| | if( angle2 <= angle1 ) |
| | angle1 = angle1 - M_PI * 2.0; |
| | RS_EllipseData elps_data(RS_Vector(DEnko.m_start.x, DEnko.m_start.y), |
| | RS_Vector(DEnko.m_dHankei * cos(DEnko.m_radKatamukiKaku), DEnko.m_dHankei * sin(DEnko.m_radKatamukiKaku)), |
| | DEnko.m_dHenpeiRitsu, |
| | angle1, angle2, false); |
| | elps = new RS_Ellipse(graphic, elps_data); |
| | RS2::LineType ltype = lTable[DEnko.m_nPenStyle]; |
| | RS_Color col = colTable[DEnko.m_nPenColor]; |
| | RS2::LineWidth lw = lWidth[DEnko.m_nPenWidth > 26 ? 0 : DEnko.m_nPenWidth]; |
| | elps->setPen(RS_Pen(col, lw, ltype)); |
| |
|
| | RS_String lName = HEX[DEnko.m_nGLayer > 0x0f ? 0:DEnko.m_nGLayer] + "-" + |
| | HEX[DEnko.m_nLayer > 0x0f ? 0: DEnko.m_nLayer]; |
| | if( graphic->findLayer(lName) == (RS_Layer*)NULL ){ |
| | RS_Layer* layer = new RS_Layer(lName); |
| | graphic->addLayer(layer); |
| | } |
| | elps->setLayer(lName); |
| | |
| | graphic->addEntity(elps); |
| | } |
| | }else{ |
| | |
| | arc_data.center = RS_Vector(DEnko.m_start.x, DEnko.m_start.y); |
| | arc_data.radius = DEnko.m_dHankei; |
| | if(DEnko.m_radEnkoKaku > 0.0){ |
| | arc_data.angle1 = DEnko.m_radKaishiKaku + DEnko.m_radKatamukiKaku; |
| | arc_data.angle2 = DEnko.m_radKaishiKaku + DEnko.m_radKatamukiKaku + DEnko.m_radEnkoKaku; |
| | }else{ |
| | arc_data.angle1 = DEnko.m_radKaishiKaku + DEnko.m_radKatamukiKaku + DEnko.m_radEnkoKaku; |
| | arc_data.angle2 = DEnko.m_radKaishiKaku + DEnko.m_radKatamukiKaku; |
| | } |
| | if( arc_data.angle2 <= arc_data.angle1 ) |
| | arc_data.angle1 = arc_data.angle1 - M_PI * 2.0; |
| | arc_data.angle1 = Deg(arc_data.angle1); |
| | arc_data.angle2 = Deg(arc_data.angle2); |
| | arc_data.reversed = false; |
| | arc = new RS_Arc(graphic, arc_data); |
| | RS2::LineType ltype = lTable[DEnko.m_nPenStyle]; |
| | RS_Color col = colTable[DEnko.m_nPenColor]; |
| | RS2::LineWidth lw = lWidth[DEnko.m_nPenWidth > 26 ? 0 : DEnko.m_nPenWidth]; |
| | arc->setPen(RS_Pen(col, lw, ltype)); |
| |
|
| | RS_String lName = HEX[DEnko.m_nGLayer > 0x0f ? 0:DEnko.m_nGLayer] + "-" + |
| | HEX[DEnko.m_nLayer > 0x0f ? 0: DEnko.m_nLayer]; |
| | if( graphic->findLayer(lName) == (RS_Layer*)NULL ){ |
| | #ifdef DEBUG |
| | std::cout << lName.ascii() << std::endl; |
| | #endif |
| | RS_Layer* layer = new RS_Layer(lName); |
| | graphic->addLayer(layer); |
| | } |
| | arc->setLayer(lName); |
| | |
| | graphic->addEntity(arc); |
| | } |
| | #endif |
| | } |
| |
|
| | void DL_Jww::CreateTen(DL_CreationInterface* creationInterface, CDataTen& DTen) |
| | { |
| | string lName = HEX[DTen.m_nGLayer > ArraySize(HEX)-1 ? ArraySize(HEX)-1: DTen.m_nGLayer] + "-" + |
| | HEX[DTen.m_nLayer > ArraySize(HEX)-1 ? ArraySize(HEX)-1: DTen.m_nLayer]; |
| |
|
| | |
| | creationInterface->addLayer(DL_LayerData(lName,0)); |
| | int width; |
| | if(DTen.m_nPenWidth > 26) |
| | width = 0; |
| | else |
| | width = DTen.m_nPenWidth; |
| | int color = colTable[DTen.m_nPenColor > ArraySize(colTable)-1 ? ArraySize(colTable)-1 : DTen.m_nPenColor]; |
| | attrib = DL_Attributes(values[8], |
| | color, |
| | width, |
| | lTable[DTen.m_nPenStyle > ArraySize(lTable)-1 ? ArraySize(lTable)-1 : DTen.m_nPenStyle]); |
| | creationInterface->setAttributes(attrib); |
| |
|
| | creationInterface->setExtrusion(0.0, 0.0, 1.0, 0.0 ); |
| |
|
| | DL_PointData d(DTen.m_start.x, DTen.m_start.y, 0.0); |
| | creationInterface->addPoint(d); |
| | #ifdef FINISHED |
| | RS_PointData data2(RS_Vector(0.0, 0.0)); |
| | RS_Point* point; |
| |
|
| | data2.pos = RS_Vector(DTen.m_start.x, DTen.m_start.y); |
| | point = new RS_Point(graphic, data2); |
| | RS2::LineType ltype = lTable[DTen.m_nPenStyle]; |
| | RS_Color col = colTable[DTen.m_nPenColor]; |
| | RS2::LineWidth lw = lWidth[DTen.m_nPenWidth > 26 ? 0 :DTen.m_nPenWidth]; |
| | point->setPen(RS_Pen(col, RS2::Width23, ltype)); |
| | |
| | RS_String lName = HEX[DTen.m_nGLayer > 0x0f ? 0 : DTen.m_nGLayer] + "-" + |
| | HEX[DTen.m_nLayer > 0x0f ? 0: DTen.m_nLayer]; |
| | if( graphic->findLayer(lName) == (RS_Layer*)NULL ){ |
| | #ifdef DEBUG |
| | std::cout << lName.ascii() << std::endl; |
| | #endif |
| | RS_Layer* layer = new RS_Layer(lName); |
| | graphic->addLayer(layer); |
| | } |
| | point->setLayer(lName); |
| | |
| | graphic->addEntity(point); |
| | #ifdef DEBUG |
| | std::cout << *point; |
| | #endif |
| | #endif |
| | } |
| |
|
| | void DL_Jww::CreateMoji(DL_CreationInterface* creationInterface, CDataMoji& DMoji) |
| | { |
| | string lName = HEX[DMoji.m_nGLayer > ArraySize(HEX)-1 ? ArraySize(HEX)-1: DMoji.m_nGLayer] + "-" + |
| | HEX[DMoji.m_nLayer > ArraySize(HEX)-1 ? ArraySize(HEX)-1: DMoji.m_nLayer]; |
| |
|
| | |
| | creationInterface->addLayer(DL_LayerData(lName,0)); |
| |
|
| | int width; |
| | if(DMoji.m_nPenWidth > 26) |
| | width = 0; |
| | else |
| | width = DMoji.m_nPenWidth; |
| | int color = colTable[DMoji.m_nPenColor > ArraySize(colTable)-1 ? ArraySize(colTable)-1 : DMoji.m_nPenColor]; |
| | attrib = DL_Attributes(values[8], |
| | color, |
| | width, |
| | lTable[DMoji.m_nPenStyle > ArraySize(lTable)-1 ? ArraySize(lTable)-1 : DMoji.m_nPenStyle]); |
| | creationInterface->setAttributes(attrib); |
| |
|
| | creationInterface->setExtrusion(0.0, 0.0, 1.0, 0.0 ); |
| |
|
| | DL_TextData d( |
| | |
| | DMoji.m_start.x, DMoji.m_start.y, 0.0, |
| | |
| | 0.0, 0.0, 0.0, |
| | |
| | DMoji.m_dSizeY, |
| | |
| | 1.0, |
| | |
| | 0, |
| | |
| | 0, |
| | |
| | 0, |
| | |
| | DMoji.m_string, |
| | |
| | string("japanese"), |
| | |
| | DMoji.m_degKakudo / 180.0 * M_PI); |
| |
|
| | creationInterface->addText(d); |
| | #ifdef FINISHED |
| | QTextCodec* codec = QTextCodec::codecForName("SJIS"); |
| | RS_TextData data3(RS_Vector(0.0, 0.0), |
| | 10, |
| | 10, |
| | RS2::VAlignMiddle, |
| | RS2::HAlignCenter, |
| | RS2::LeftToRight, |
| | RS2::AtLeast, |
| | 1.0, |
| | RS_String(""), |
| | RS_String(""), |
| | 0.0, |
| | RS2::Update); |
| | RS_Text* text; |
| | data3.insertionPoint = RS_Vector(DMoji.m_start.x, DMoji.m_start.y); |
| | data3.height = DMoji.m_dSizeY; |
| | data3.width = DMoji.m_dSizeX; |
| | data3.valign = RS2::VAlignBottom; |
| | data3.halign = RS2::HAlignLeft; |
| | data3.drawingDirection = RS2::LeftToRight; |
| | data3.lineSpacingStyle = RS2::Exact; |
| | data3.lineSpacingFactor = DMoji.m_dKankaku; |
| | |
| | size_t left = DMoji.m_string.length(); |
| | char* sjis = (char *)DMoji.m_string.c_str(); |
| | char buf[200]; |
| | |
| | char* p = buf; |
| | size_t bufleft = 200; |
| | #ifdef _WINDOWS |
| | |
| | iconv_t cd = iconv_open(UTF8_CES, SHIFTJIS_CES); |
| | #ifdef DEBUG |
| | printf("sjis = %x, p = %x\n", sjis, p); |
| | #endif |
| | size_t r = iconv(cd, (const char **)(&sjis), &left, &p, &bufleft); |
| | #ifdef DEBUG |
| | printf("sjis = %x, p = %x\n", sjis, p); |
| | printf("sjis = %x %x %x %x, p = %x %x %x %x\n", sjis[0],sjis[1],sjis[2],sjis[3], buf[0],buf[1],buf[2],buf[3]); |
| | printf("r = %d, left = %d, bufleft = %d\n", r, left, bufleft); |
| | #endif |
| | *p = '\0'; |
| | iconv_close(cd); |
| | #else |
| | |
| | int nBytesOut; |
| | strncpy(buf, sizeof(buf) -1, (const char *)CUnicodeF::sjis_to_euc((const unsigned char *)sjis)); |
| | |
| | |
| | #endif |
| | |
| | data3.text = RS_String::fromUtf8(buf); |
| | data3.style = RS_String("japanese-euc"); |
| | data3.angle = DMoji.m_degKakudo / 180.0 * M_PI; |
| | #ifdef DEBUG |
| | RS_DEBUG->setLevel(RS_Debug::D_DEBUGGING); |
| | #endif |
| | data3.updateMode = RS2::Update; |
| | |
| |
|
| | text = new RS_Text(graphic, data3); |
| | RS2::LineType ltype = lTable[DMoji.m_nPenStyle]; |
| | RS_Color col = colTable[DMoji.m_nPenColor]; |
| | RS2::LineWidth lw = lWidth[DMoji.m_nPenWidth > 26 ? 0 : DMoji.m_nPenWidth]; |
| | text->setPen(RS_Pen(col, RS2::Width08, ltype)); |
| |
|
| | |
| | RS_String lName = HEX[DMoji.m_nGLayer > 0x0f ? 0: DMoji.m_nGLayer] + "-" + |
| | HEX[DMoji.m_nLayer > 0x0f ? 0 : DMoji.m_nLayer]; |
| | if( graphic->findLayer(lName) == (RS_Layer*)NULL ){ |
| | #ifdef DEBUG |
| | std::cout << lName.ascii() << std::endl; |
| | #endif |
| | RS_Layer* layer = new RS_Layer(lName); |
| | graphic->addLayer(layer); |
| | } |
| | text->setLayer(lName); |
| | |
| | graphic->addEntity(text); |
| | #ifdef DEBUG |
| | std::cout << data3.height << " " << data3.width << std::endl; |
| | std::cout << *text; |
| | #endif |
| | #endif |
| | } |
| |
|
| | void DL_Jww::CreateSolid(DL_CreationInterface* , CDataSolid& ) |
| | { |
| | } |
| |
|
| | void DL_Jww::CreateSunpou(DL_CreationInterface* creationInterface, CDataSunpou& DSunpou) |
| | { |
| | string lName = HEX[DSunpou.m_nGLayer > ArraySize(HEX)-1 ? ArraySize(HEX)-1: DSunpou.m_nGLayer] + "-" + |
| | HEX[DSunpou.m_nLayer > ArraySize(HEX)-1 ? ArraySize(HEX)-1: DSunpou.m_nLayer]; |
| |
|
| | |
| | creationInterface->addLayer(DL_LayerData(lName,0)); |
| | int width; |
| | if(DSunpou.m_nPenWidth > 26) |
| | width = 0; |
| | else |
| | width = DSunpou.m_nPenWidth; |
| | int color = colTable[DSunpou.m_nPenColor > ArraySize(colTable)-1 ? ArraySize(colTable)-1 : DSunpou.m_nPenColor]; |
| | attrib = DL_Attributes(values[8], |
| | color, |
| | width, |
| | lTable[DSunpou.m_nPenStyle > ArraySize(lTable)-1 ? ArraySize(lTable)-1 : DSunpou.m_nPenStyle]); |
| | creationInterface->setAttributes(attrib); |
| |
|
| | creationInterface->setExtrusion(0.0, 0.0, 1.0, 0.0 ); |
| |
|
| | CreateSen(creationInterface, DSunpou.m_Sen); |
| | CreateMoji(creationInterface, DSunpou.m_Moji); |
| | #ifdef FINISHED |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | #endif |
| | } |
| |
|
| | void DL_Jww::CreateBlock(DL_CreationInterface* , CDataBlock& ) |
| | { |
| | #ifdef FINISHED |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | #endif |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | bool DL_Jww::in(const string& file, DL_CreationInterface* creationInterface) { |
| | |
| | string ofile(""); |
| | JWWDocument* jwdoc = new JWWDocument((std::string&)file, ofile); |
| | if(!jwdoc->Read()) |
| | return false; |
| | |
| | creationInterface->setVariableString("$DWGCODEPAGE", "SJIS", 7); |
| | creationInterface->setVariableString("$TEXTSTYLE", "japanese", 7); |
| | |
| | for( unsigned int i = 0; i < jwdoc->vSen.size(); i++ ) |
| | CreateSen(creationInterface, jwdoc->vSen[i]); |
| | |
| | for( unsigned int i = 0; i < jwdoc->vEnko.size(); i++ ) |
| | CreateEnko(creationInterface, jwdoc->vEnko[i]); |
| | |
| | for( unsigned int i = 0; i < jwdoc->vTen.size(); i++ ) |
| | CreateTen(creationInterface, jwdoc->vTen[i]); |
| | |
| | for( unsigned int i = 0; i < jwdoc->vMoji.size(); i++ ) |
| | CreateMoji(creationInterface, jwdoc->vMoji[i]); |
| | |
| | for(unsigned int i=0 ; i < jwdoc->vSunpou.size(); i++ ) |
| | CreateSunpou(creationInterface, jwdoc->vSunpou[i]); |
| | |
| | for(unsigned int i=0 ; i < jwdoc->vSolid.size(); i++ ) |
| | CreateSolid(creationInterface, jwdoc->vSolid[i]); |
| | |
| | for(unsigned int i=0 ; i < jwdoc->vBlock.size(); i++) |
| | CreateBlock(creationInterface, jwdoc->vBlock[i]); |
| | delete jwdoc; |
| |
|
| | return true; |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | bool DL_Jww::processJwwGroup(DL_CreationInterface* , |
| | int , const char *) { |
| | return true; |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | void DL_Jww::addSetting(DL_CreationInterface* ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | void DL_Jww::addLayer(DL_CreationInterface* ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | void DL_Jww::addBlock(DL_CreationInterface* ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | void DL_Jww::endBlock(DL_CreationInterface* creationInterface) { |
| | creationInterface->endBlock(); |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | void DL_Jww::addPoint(DL_CreationInterface* ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | void DL_Jww::addLine(DL_CreationInterface* ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | void DL_Jww::addPolyline(DL_CreationInterface* ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | void DL_Jww::addVertex(DL_CreationInterface* ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | void DL_Jww::addSpline(DL_CreationInterface* ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | void DL_Jww::addArc(DL_CreationInterface* ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | void DL_Jww::addCircle(DL_CreationInterface* ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | void DL_Jww::addEllipse(DL_CreationInterface* ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | void DL_Jww::addInsert(DL_CreationInterface* ) { |
| | } |
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::addTrace(DL_CreationInterface* ) { |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::addSolid(DL_CreationInterface* ) { |
| | } |
| |
|
| |
|
| | |
| | |
| | |
| | void DL_Jww::addMText(DL_CreationInterface* ) { |
| | } |
| |
|
| | |
| | |
| | |
| | bool DL_Jww::handleMTextData(DL_CreationInterface* ) { |
| | return true; |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | bool DL_Jww::handleLWPolylineData(DL_CreationInterface* ) { |
| | return true; |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | bool DL_Jww::handleSplineData(DL_CreationInterface* ) { |
| | return true; |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | bool DL_Jww::handleLeaderData(DL_CreationInterface* ) { |
| | return true; |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | bool DL_Jww::handleHatchData(DL_CreationInterface* ) { |
| | return true; |
| | } |
| |
|
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | void DL_Jww::addText(DL_CreationInterface* ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | void DL_Jww::addAttrib(DL_CreationInterface* ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | DL_DimensionData DL_Jww::getDimData() { |
| | |
| | DL_DimensionData dummy(0.,0.,0.,0.,0.,0.,0,0,0,0.,"DUMMY","",0.); |
| | return dummy; |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | void DL_Jww::addDimLinear(DL_CreationInterface* ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | void DL_Jww::addDimAligned(DL_CreationInterface* ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | void DL_Jww::addDimRadial(DL_CreationInterface* ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | void DL_Jww::addDimDiametric(DL_CreationInterface* ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | void DL_Jww::addDimAngular(DL_CreationInterface* ) { |
| | } |
| |
|
| |
|
| | |
| | |
| | |
| | void DL_Jww::addDimAngular3P(DL_CreationInterface* ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | void DL_Jww::addLeader(DL_CreationInterface* ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | void DL_Jww::addHatch(DL_CreationInterface* ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | void DL_Jww::addImage(DL_CreationInterface* ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | void DL_Jww::addImageDef(DL_CreationInterface* ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | void DL_Jww::endEntity(DL_CreationInterface* ) { |
| | } |
| |
|
| |
|
| | |
| | |
| | |
| | void DL_Jww::endSequence(DL_CreationInterface* ) { |
| | } |
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | DL_WriterA* DL_Jww::out(const char* , DL_Codes::version ) { |
| | #ifdef DEBUG |
| | |
| | #endif |
| | return NULL; |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | void DL_Jww::writeHeader(DL_WriterA& ) { |
| | } |
| |
|
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::writePoint(DL_WriterA& , |
| | const DL_PointData& , |
| | const DL_Attributes& ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::writeLine(DL_WriterA& , |
| | const DL_LineData& , |
| | const DL_Attributes& ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::writePolyline(DL_WriterA& , |
| | const DL_PolylineData& , |
| | const DL_Attributes& ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::writeVertex(DL_WriterA& , |
| | const DL_VertexData& ) { |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::writePolylineEnd(DL_WriterA& ) { |
| | } |
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::writeSpline(DL_WriterA& , |
| | const DL_SplineData& , |
| | const DL_Attributes& ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::writeControlPoint(DL_WriterA& , |
| | const DL_ControlPointData& ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::writeKnot(DL_WriterA& , |
| | const DL_KnotData& ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::writeCircle(DL_WriterA& , |
| | const DL_CircleData& , |
| | const DL_Attributes& ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::writeArc(DL_WriterA& , |
| | const DL_ArcData& , |
| | const DL_Attributes& ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::writeEllipse(DL_WriterA& , |
| | const DL_EllipseData& , |
| | const DL_Attributes& ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::writeInsert(DL_WriterA& , |
| | const DL_InsertData& , |
| | const DL_Attributes& ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::writeMText(DL_WriterA& , |
| | const DL_MTextData& , |
| | const DL_Attributes& ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::writeText(DL_WriterA& , |
| | const DL_TextData& , |
| | const DL_Attributes& ) { |
| | } |
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::writeDimAligned(DL_WriterA& , |
| | const DL_DimensionData& , |
| | const DL_DimAlignedData& , |
| | const DL_Attributes& ) { |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::writeDimLinear(DL_WriterA& , |
| | const DL_DimensionData& , |
| | const DL_DimLinearData& , |
| | const DL_Attributes& ) { |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::writeDimRadial(DL_WriterA& , |
| | const DL_DimensionData& , |
| | const DL_DimRadialData& , |
| | const DL_Attributes& ) { |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::writeDimDiametric(DL_WriterA& , |
| | const DL_DimensionData& , |
| | const DL_DimDiametricData& , |
| | const DL_Attributes& ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::writeDimAngular(DL_WriterA& , |
| | const DL_DimensionData& , |
| | const DL_DimAngularData& , |
| | const DL_Attributes& ) { |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::writeDimAngular3P(DL_WriterA& , |
| | const DL_DimensionData& , |
| | const DL_DimAngular3PData& , |
| | const DL_Attributes& ) { |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::writeLeader(DL_WriterA& , |
| | const DL_LeaderData& , |
| | const DL_Attributes& ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::writeLeaderVertex(DL_WriterA& , |
| | const DL_LeaderVertexData& ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::writeHatch1(DL_WriterA& , |
| | const DL_HatchData& , |
| | const DL_Attributes& ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::writeHatch2(DL_WriterA& , |
| | const DL_HatchData& , |
| | const DL_Attributes& ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::writeHatchLoop1(DL_WriterA& , |
| | const DL_HatchLoopData& ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::writeHatchLoop2(DL_WriterA& , |
| | const DL_HatchLoopData& ) { |
| |
|
| | } |
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::writeHatchEdge(DL_WriterA& , |
| | const DL_HatchEdgeData& ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | int DL_Jww::writeImage(DL_WriterA& , |
| | const DL_ImageData& , |
| | const DL_Attributes& ) { |
| |
|
| | return -1; |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | void DL_Jww::writeImageDef(DL_WriterA& , |
| | int , |
| | const DL_ImageData& ) { |
| | } |
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::writeLayer(DL_WriterA& , |
| | const DL_LayerData& , |
| | const DL_Attributes& ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | void DL_Jww::writeLineType(DL_WriterA& , |
| | const DL_LineTypeData& ) { |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::writeAppid(DL_WriterA& , const string& ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | void DL_Jww::writeBlock(DL_WriterA& , const DL_BlockData& ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::writeEndBlock(DL_WriterA& , const string& ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::writeVPort(DL_WriterA& ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::writeStyle(DL_WriterA& ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::writeView(DL_WriterA& ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::writeUcs(DL_WriterA& ) { |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::writeDimStyle(DL_WriterA& , |
| | double , double , double , |
| | double , double ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::writeBlockRecord(DL_WriterA& ) { |
| | } |
| |
|
| | |
| | |
| | |
| | void DL_Jww::writeBlockRecord(DL_WriterA& , const string& ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::writeObjects(DL_WriterA& ) { |
| | } |
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | void DL_Jww::writeObjectsEnd(DL_WriterA& ) { |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | bool DL_Jww::checkVariable(const char* , DL_Codes::version ) { |
| | return true; |
| | } |
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | int DL_Jww::getLibVersion(const char* ) { |
| | return -1; |
| | } |
| |
|