Hi every one this is a small patch that will replace existing comets with a picture of comet with tail.<div><br></div><div>what it does:</div><div> - it replaces all comets with a picture that shows a comet with tail</div>
<div> - the picture starts showing up very small and is scaled wit increasing zoom level.</div><div><br></div><div>And is does NOT</div><div> - use any technical calculation about the size of comet image displayed.<br>
</div><div> - the comet tail doesnt point away from sun // still cant figure out how to do that</div><div> </div><div><br></div><div>a patch file is included and an image file is included. image should be put in data folder.</div>
<div><div>patch :</div><div><br></div><div>Property changes on: kstars/kstars/skyobjects/saturnmoons.cpp </div><div>___________________________________________________________________ </div><div>
Added: svn:executable </div><div> + * </div>
<div><br></div><div><br></div><div>Property changes on: kstars/kstars/skyobjects/saturnmoons.h</div><div>___________________________________________________________________</div><div>Added: svn:executable</div><div> + *</div>
<div><br></div><div>Index: kstars/kstars/data/CMakeLists.txt</div><div>===================================================================</div><div>--- kstars/kstars/data/CMakeLists.txt<span class="Apple-tab-span" style="white-space:pre">        </span>(revision 946942)</div>
<div>+++ kstars/kstars/data/CMakeLists.txt<span class="Apple-tab-span" style="white-space:pre">        </span>(working copy)</div><div>@@ -58,6 +58,7 @@</div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>asteroids.dat comets.dat </div>
<div> <span class="Apple-tab-span" style="white-space:pre">        </span>sun.png mercury.png venus.png mars.png jupiter.png saturn.png </div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>uranus.png neptune.png pluto.png </div>
<div>+<span class="Apple-tab-span" style="white-space:pre">        </span>cometWithTail.png</div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>moon00.png moon01.png moon02.png moon03.png moon04.png moon05.png </div>
<div> <span class="Apple-tab-span" style="white-space:pre">        </span>moon06.png moon07.png moon08.png moon09.png moon10.png moon11.png </div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>moon12.png moon13.png moon14.png moon15.png moon16.png moon17.png </div>
<div>Index: kstars/kstars/skycomponents/cometscomponent.cpp</div><div>===================================================================</div><div>--- kstars/kstars/skycomponents/cometscomponent.cpp<span class="Apple-tab-span" style="white-space:pre">        </span>(revision 946942)</div>
<div>+++ kstars/kstars/skycomponents/cometscomponent.cpp<span class="Apple-tab-span" style="white-space:pre">        </span>(working copy)</div><div>@@ -21,6 +21,7 @@</div><div> #include <QFile></div><div> #include <QPen></div>
<div> #include <QPainter></div><div>+#include <QPicture></div><div> #include <kglobal.h></div><div> </div><div> #include "Options.h"</div><div>@@ -110,17 +111,33 @@</div><div> //if ( ( o.x() >= 0. && o.x() <= Width && o.y() >= 0. && o.y() <= Height ) )</div>
<div> </div><div> float size = com->angSize() * map->scale() * dms::PI * Options::zoomFactor()/10800.0;</div><div>-<span class="Apple-tab-span" style="white-space:pre">        </span>if ( size < 1.0 ) {</div><div>
- psky.drawPoint( o );</div><div>- } else {</div><div>- float x1 = o.x() - 0.5*size;</div><div>- float y1 = o.y() - 0.5*size;</div><div> </div><div>- psky.drawEllipse( QRectF( x1, y1, size, size ) );</div>
<div>+ // if ( size < 0.01 ) {</div><div>+ // psky.drawPoint( o );</div><div>+ // } else {</div><div>+</div><div>+ /// load image to be displayed in place of comet</div><div>+ QImage Image,Image0;</div>
<div>+ QString image_file;</div><div>+ image_file=QString("cometWithTail.png");</div><div>+ QFile imFile;</div><div>+</div><div>+ if ( KSUtils::openDataFile( imFile, image_file ) ) {</div>
<div>+ imFile.close();</div><div>+ Image0.load( imFile.fileName() );</div><div>+ Image = Image0.convertToFormat( QImage::Format_ARGB32 );</div><div>+ Image0 = Image;</div><div>
}</div>
<div> </div><div> float tailsize = com->getTailAngSize().Degrees() * map->scale() * dms::PI * Options::zoomFactor()/10800.0;</div><div> </div><div>+ // resize the image according to current zoom level</div>
<div>+ int width=Image.width(); // width of orignal image</div><div>+ Image0=Image.scaledToWidth(width*dms::PI * Options::zoomFactor()/1000000.0 );</div><div>+ float x1 = o.x() - 0.5*Image0.width();</div>
<div>+ float y1 = o.y() - 0.5*Image0.height();</div><div>+ psky.drawImage( QPointF(x1, y1), Image0);</div><div>+ // }</div><div> if ( hideLabels || com->rsun() >= rsunLabelLimit ) continue;</div>
<div> SkyLabeler::AddLabel( o, com, SkyLabeler::COMET_LABEL );</div><div> }</div><div><br></div><div>Property changes on: kstars/kstars/skycomponents/saturnmoonscomponent.h</div><div>___________________________________________________________________</div>
<div>Added: svn:executable</div><div> + *</div><div><br></div><div><br></div><div>Property changes on: kstars/kstars/skycomponents/saturnmoonscomponent.cpp</div><div>___________________________________________________________________</div>
<div>Added: svn:executable</div><div> + *</div><div><br></div></div>