/***************************************************** ** ** PdfPainter --- drawSignSymbol ** ******************************************************/ void PdfPainter::drawSignSymbol( const int&x, const int &y, const int &sign, const int type, const int zoom, const double angle ) { Lang lang; double w, h; wxString s; if ( type == 2 ) s = textwriter->getSignName( sign, TSHORT ); else s = lang.getSignSymbolCode( sign, type ); getTextExtent( s, &w, &h ); /* setTransparentBrush(); setDefaultPen(); drawRectangle( x-3, y-3, 6, 6 ); drawRectangle( x-10, y-10, 20, 20 ); */ double x4 = x - .5 * w * cos( .25 * PI + angle * DEG2RAD ); double y4 = y + .5 * h * sin( .25 * PI + angle * DEG2RAD ); pdf->RotatedText( x4, y4, s, angle ); }
/***************************************************** ** ** VedicRasiChart --- paintNorth ** ******************************************************/ void VedicRasiChart::paintNorth() { Lang lang; wxString s; int current, i; // used for sign number/symbol display const double rtol = xmax / 15.0; // used for free space in the middle of the chart (leave free for center string if required) const double mtol = xmax / 100.0; // 1/4 of the chart const double xi = .5 * xr; const double yi = .5 * yr; // middle square for separation of 2 charts (transit or partner mode) const double ri_prop = .4; const double xm = ri_prop * xi + ( 1 - ri_prop ) * xr; const double ym = ri_prop * yi + ( 1 - ri_prop ) * yr; // text separation from chart border const double text_border = xr / 30.0; // Rasi coordinates in single mode const MyRect rasi_rect[12] = { MyRect( xcenter - xi, ycenter - yr, xr, yr ), MyRect( xcenter - xr, ycenter - yr, xr, yi ), MyRect( xcenter - xr, ycenter - yr, xr, yr ), MyRect( xcenter - xr, ycenter - yi, xr, yr ), MyRect( xcenter - xr, ycenter, xi, yr ), MyRect( xcenter - xr, ycenter + yi, xr, yi ), MyRect( xcenter - xi, ycenter, xr, yr ), MyRect( xcenter, ycenter + yi, xr, yi ), MyRect( xcenter, ycenter, xr, yr ), MyRect( xcenter, ycenter - yi, xr, yr ), MyRect( xcenter + xi, ycenter - yr, xi, yr ), MyRect( xcenter, ycenter - yr, xr, yi ) }; // Rasi coordinates for 2nd chart (only in double mode) const MyRect planet1_rect[12] = { MyRect( xcenter - xi, ycenter - ym, xr, xm ), MyRect( xcenter - xm, ycenter - ym, xi, ym ), MyRect( xcenter - xm, ycenter - yr, xr - xm, yr ), MyRect( xcenter - xm, ycenter - yi, xm, yr ), MyRect( xcenter - xm, ycenter, xr - xm, yr ), MyRect( xcenter - xr, ycenter + yi, xr, ym - yi ), MyRect( xcenter - xi, ycenter, xr, ym ), MyRect( xcenter + xi / 2, ycenter + yi, xi, ym - yi ), MyRect( xcenter + xi, ycenter, xm - xi, yr ), MyRect( xcenter, ycenter - yi, xm, yr ), MyRect( xcenter + xi, ycenter - ym, xm - xi, ym ), MyRect( xcenter + xi / 2, ycenter - ym, xi, ym - xi ) }; // Rasi coordinates for 2nd chart (only in double mode) const MyRect planet2_rect[12] = { MyRect( xcenter - xi, ycenter - yr, xr, yr - ym ), MyRect( xcenter - xr, ycenter - yr, xr, yr - ym ), MyRect( xcenter - xr, ycenter - yr, xr - xm, yr ), MyRect( xcenter - xr, ycenter - yi, xr - xm, yr ), MyRect( xcenter - xr, ycenter, xr - xm, yr ), MyRect( xcenter - xr, ycenter + ym, xr, yr - ym ), MyRect( xcenter - xi, ycenter + ym, xr, yr - ym ), MyRect( xcenter, ycenter + ym, xr, yr - ym ), MyRect( xcenter + xm, ycenter, xr - xm, yr ), MyRect( xcenter + xm, ycenter - yi, xr - xm, yr ), MyRect( xcenter + xm, ycenter - yr, xr - xm, yr ), MyRect( xcenter, ycenter - yr, xr, yr - ym ) }; // Rectangles for sign names resp. numbers const MyRect sign_rect[12] = { MyRect( xcenter - rtol, ycenter - rtol, 2 * rtol, rtol ), MyRect( xcenter - xi - rtol / 2, ycenter - yi - rtol, rtol, rtol ), MyRect( xcenter - xi - rtol, ycenter - yi - rtol / 2, rtol, rtol ), MyRect( xcenter - 2 * rtol, ycenter - rtol, 2 * rtol, rtol ), MyRect( xcenter - xi - rtol, ycenter + yi - rtol / 2, rtol, rtol ), MyRect( xcenter - xi - rtol / 2, ycenter + yi, rtol, rtol ), MyRect( xcenter - rtol, ycenter, 2 * rtol, rtol ), MyRect( xcenter + xi - rtol / 2, ycenter + yi, rtol, rtol ), MyRect( xcenter + xi, ycenter + yi - rtol / 2, rtol, rtol ), MyRect( xcenter, ycenter - rtol, 2 * rtol, rtol ), MyRect( xcenter + xi, ycenter - yi - rtol / 2, rtol, rtol ), MyRect( xcenter + xi - rtol / 2, ycenter - yi - rtol, rtol, rtol ) }; // Text alignment for rasis const int rasi_alignment[12] = { Align::Center, Align::Top + Align::HCenter, Align::Left + Align::VCenter, Align::Center, Align::Left + Align::VCenter, Align::Bottom + Align::HCenter, Align::Center, Align::Bottom + Align::HCenter, Align::Right + Align::VCenter, Align::Center, Align::Right + Align::VCenter, Align::Top + Align::HCenter }; // polygon coordinates for signs const MyPoint rasi_polygons[][12] = { { MyPoint( xcenter-xi, ycenter - yi ), MyPoint( xcenter, ycenter ), MyPoint( xcenter+xi, ycenter - yi ), MyPoint( xcenter, ycenter - yr ) }, { MyPoint( xcenter-xr, ycenter - yr ), MyPoint( xcenter, ycenter-yr ), MyPoint( xcenter-xi, ycenter - yi ) }, { MyPoint( xcenter-xr, ycenter - yr ), MyPoint( xcenter-xr, ycenter ), MyPoint( xcenter-xi, ycenter - yi ) }, { MyPoint( xcenter-xr, ycenter ), MyPoint( xcenter-xi, ycenter+yi ), MyPoint( xcenter, ycenter ), MyPoint( xcenter-xi, ycenter - yi ) }, { MyPoint( xcenter-xr, ycenter + yr ), MyPoint( xcenter-xr, ycenter ), MyPoint( xcenter-xi, ycenter + yi ) }, { MyPoint( xcenter-xr, ycenter + yr ), MyPoint( xcenter, ycenter+yr ), MyPoint( xcenter-xi, ycenter + yi ) }, { MyPoint( xcenter-xi, ycenter+yi ), MyPoint( xcenter, ycenter+yr ), MyPoint( xcenter+xi, ycenter+yi ), MyPoint( xcenter, ycenter ) }, { MyPoint( xcenter, ycenter + yr ), MyPoint( xcenter+xr, ycenter+yr ), MyPoint( xcenter+xi, ycenter + yi ) }, { MyPoint( xcenter+xr, ycenter + yr ), MyPoint( xcenter+xr, ycenter ), MyPoint( xcenter+xi, ycenter + yi ) }, { MyPoint( xcenter, ycenter ), MyPoint( xcenter+xi, ycenter+yi ), MyPoint( xcenter+xr, ycenter ), MyPoint( xcenter+xi, ycenter-yi ) }, { MyPoint( xcenter+xr, ycenter - yr ), MyPoint( xcenter+xr, ycenter ), MyPoint( xcenter+xi, ycenter - yi ) }, { MyPoint( xcenter, ycenter - yr ), MyPoint( xcenter+xr, ycenter-yr ), MyPoint( xcenter+xi, ycenter - yi ) }, }; // rectangle for separation of double charts const MyRect transit_rect( xcenter - xm, ycenter - ym, 2 * xm, 2 * ym ); // draw filled polygons GcZodiacalSigns *signs = &vconf->signs; if ( signs->needsBgPaint() ) { painter->setTransparentPen(); for ( i = ARIES; i <= PISCES; i++ ) { painter->setBrush( signs->getBrush(redRasi( getAscendant() + i ))); painter->drawPolygon( i % 3 ? 3 : 4, (MyPoint*)rasi_polygons[i] ); } } paintOuterRectangle(); painter->setPen( defaultPen ); // diagonal from egde to egde paint one line or two depending on chart center if ( ! ( chartprops->getVedicGraphicStyle().centerInfoType == VGRAPHIC_CHART_CENTER_NOTHING )) { painter->drawLine( xcenter - xr, ycenter - yr, xcenter - mtol, ycenter - mtol ); painter->drawLine( xcenter + mtol, ycenter + mtol, xcenter + xr, ycenter + yr ); painter->drawLine( xcenter - xr, ycenter + yr, xcenter - mtol, ycenter + mtol ); painter->drawLine( xcenter + mtol , ycenter - mtol, xcenter + xr, ycenter - yr ); } else { painter->drawLine( xcenter - xr, ycenter - yr, xcenter + xr, ycenter + yr ); painter->drawLine( xcenter - xr, ycenter + yr, xcenter + xr, ycenter - yr ); } painter->drawLine( xcenter, ycenter + yr, xcenter + xr, ycenter ); painter->drawLine( xcenter, ycenter + yr, xcenter - xr, ycenter ); painter->drawLine( xcenter, ycenter - yr, xcenter - xr, ycenter ); painter->drawLine( xcenter, ycenter - yr, xcenter + xr, ycenter ); if ( chart_count == 2 ) painter->drawRectangle( transit_rect ); /********************************************************* ** draw number of houses *********************************************************/ if ( ! ( chartprops->getVedicGraphicStyle().northIndianSignDisplayType == VGRAPHIC_NORTH_INDIAN_SYMBOL )) painter->setGraphicFont( textzoom ); else painter->setSymbolFont( symbolzoom ); for ( i = ARIES; i <= PISCES; i++ ) { current = redRasi( getAscendant() + i ); switch( chartprops->getVedicGraphicStyle().northIndianSignDisplayType ) { case VGRAPHIC_NORTH_INDIAN_ASC: s.Printf( wxT( "%d" ), current + 1 ); break; case VGRAPHIC_NORTH_INDIAN_NUMBER: s.Printf( wxT( "%d" ), current + 1 ); break; case VGRAPHIC_NORTH_INDIAN_SHORT: { s = lang.getSignName( current, TSHORT ); } break; default: s = lang.getSignSymbolCode( current ); break; } painter->drawSimpleText( sign_rect[i], s ); // leave after ascendant for style == 0 if ( chartprops->getVedicGraphicStyle().northIndianSignDisplayType == VGRAPHIC_NORTH_INDIAN_ASC ) break; } painter->setGraphicFont( textzoom ); /********************************************************* ** draw planets *********************************************************/ if ( ! chartprops->isBlank() ) { for ( i = ARIES; i <= PISCES; i++ ) { if ( chart_count == 1 ) drawFieldText( rasi_rect[i], redRasi( i + getAscendant() ), rasi_alignment[i], 0, text_border ); else { drawFieldText( planet1_rect[i], redRasi( i + getAscendant() ), rasi_alignment[i], 0, text_border ); drawFieldText( planet2_rect[i], redRasi( i + getAscendant() ), rasi_alignment[i], 1, text_border ); } } paintCenterString(); } painter->setGraphicFont( textzoom ); }