drawArcEntity.h File Reference

#include "ObjectStructure.h"

Include dependency graph for drawArcEntity.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int drawArcEntity (sciPointObj *pObj)


Function Documentation

int drawArcEntity ( sciPointObj pObj  ) 

Routine which draw an arc object

Parameters:
pObj the pointer on the arc object

DJ.Abdemouche 2003

Definition at line 17 of file drawArcEntity.c.

References sciArc::alphabegin, sciArc::alphaend, sciSubWindow::axes, C2F, dr(), sciArc::height, HScale, L, MaybeSetWinhdc(), pARC_FEATURE, PD0, PI0, pSUBWIN_FEATURE, ReleaseWinHdc(), AXES::reverse, ReverseDataFor3D(), round, sciClip(), sciGetBackground(), sciGetForeground(), sciGetIs3d(), sciGetIsFilled(), sciGetIsLine(), sciGetLineStyle(), sciGetLineWidth(), sciGetParentSubwin(), sciGetVisibility(), sciUnClip(), trans3d(), v, sciArc::width, WScale, sciArc::x, XDouble2Pixel, sciArc::y, YDouble2Pixel, and sciArc::z.

Referenced by sciDrawObj().

00018 {
00019   sciArc * ppArc = pARC_FEATURE(pObj) ;
00020   sciPointObj * parentSubWin = sciGetParentSubwin(pObj) ;
00021   sciSubWindow * ppSubWin = pSUBWIN_FEATURE(parentSubWin) ;
00022   int v = 0 ;
00023   double dv = 0.0 ;
00024   int lineWidth = sciGetLineWidth(pObj) ;
00025   int lineStyle = sciGetLineStyle(pObj) ;
00026   int xCoord = 0 ;
00027   int yCoord = 0 ;
00028   int pixWidth = 0 ;
00029   int pixHeight = 0 ;
00030   int angle1 = 0 ;
00031   int angle2 = 0 ;
00032 
00033   if ( !sciGetVisibility(pObj) ) { return 0 ; }
00034 
00035 #ifdef _MSC_VER 
00036   flag_DO = MaybeSetWinhdc ();
00037 #endif
00038 
00039   C2F (dr) ("xset", "thickness", &lineWidth, PI0, PI0, PI0, PI0, PI0, 
00040     PD0, PD0, PD0, PD0, 4L, 9L);   
00041   C2F (dr) ("xset", "line style", &lineStyle, PI0, PI0, PI0, PI0, PI0, 
00042     PD0, PD0, PD0, PD0, 4L, 10L);
00043 
00044 #ifdef _MSC_VER 
00045   if ( flag_DO == 1) { ReleaseWinHdc () ; }
00046 #endif
00047 
00048   if ( sciGetIs3d(parentSubWin) )
00049   {
00050     int one = 1 ;
00051     double xPos = ppArc->x ;
00052     double yPos = ppArc->y ;
00053     double zPos = ppArc->z ;
00054 
00055     ReverseDataFor3D( parentSubWin, &xPos, &yPos, &zPos, one ) ;
00056 
00057     trans3d( parentSubWin,one,&xCoord,&yCoord,&xPos,&yPos,&zPos);
00058   }
00059   else
00060   {
00061     double xPos = ppArc->x ;
00062     double yPos = ppArc->y ;
00063 
00064     if ( ppSubWin->axes.reverse[0] )
00065     {
00066       xPos = xPos + ppArc->width ;
00067     }
00068 
00069     if ( ppSubWin->axes.reverse[1] )
00070     {
00071       yPos = yPos - ppArc->height ;
00072     }
00073 
00074     xCoord = XDouble2Pixel( xPos ) ;
00075     yCoord = YDouble2Pixel( yPos ) ;
00076   }
00077 
00078   pixWidth  = WScale(ppArc->width ) ;
00079   pixHeight = HScale(ppArc->height) ;
00080 
00081   angle1 = round( ppArc->alphabegin ) ;
00082   angle2 = round( ppArc->alphaend   ) ; 
00083 
00084   if( ppSubWin->axes.reverse[0] && !ppSubWin->axes.reverse[1] )
00085   {
00086       angle1 = 180 * 64 - ( angle2 + angle1 ) ;
00087   }
00088   else if ( ppSubWin->axes.reverse[0] && ppSubWin->axes.reverse[1] )
00089   {
00090       angle1 = 180 * 64 + angle1 ;
00091   }
00092   else if( !ppSubWin->axes.reverse[0] && ppSubWin->axes.reverse[1] )
00093   {
00094       angle1 = 360 * 64 - ( angle2 + angle1 ) ;
00095   }
00096 
00097 #ifdef _MSC_VER 
00098   flag_DO = MaybeSetWinhdc ();
00099 #endif
00100   sciClip(pObj);
00101 
00102   if( sciGetIsFilled(pObj) )
00103   {
00104     int background = sciGetBackground(pObj) ;
00105     C2F (dr) ("xset", "dashes", &background, &background, &v, &v, &v, &v, 
00106       &dv, &dv, &dv, &dv, 5L, 6L);
00107     C2F (dr) ("xset", "foreground", &background, &background, &v, &v, &v,&v, 
00108       &dv, &dv, &dv, &dv, 5L, 10L );
00109     C2F (dr) ("xfarc", "xv", &xCoord, &yCoord, &pixWidth, &pixHeight, &angle1, &angle2, PD0, PD0, PD0,PD0, 5L, 2L);
00110   }
00111 
00112   if( sciGetIsLine(pObj) ) 
00113   {
00114     int foreground = sciGetForeground(pObj) ;
00115     C2F (dr) ("xset", "dashes", &foreground, &foreground, &v, &v, &v, &v, 
00116       &dv, &dv, &dv, &dv, 5L, 6L);
00117     C2F (dr) ("xset", "foreground", &foreground, &foreground, &v, &v, &v,&v, 
00118       &dv, &dv, &dv, &dv, 5L, 10L );
00119     C2F (dr) ("xarc", "xv", &xCoord, &yCoord, &pixWidth, &pixHeight, &angle1, &angle2, PD0, PD0, PD0,PD0, 5L, 2L);
00120   }
00121 
00122   sciUnClip(pObj);
00123 #ifdef _MSC_VER 
00124   if ( flag_DO == 1) { ReleaseWinHdc () ; }
00125 #endif
00126 
00127   return 0 ;
00128 }

Here is the call graph for this function:

Here is the caller graph for this function:


Generated on Sun Mar 4 15:47:08 2007 for Scilab [trunk] by  doxygen 1.5.1