00001
00002
00003
00004
00005
00006
00007
00008 #include "drawSubWinEntity.h"
00009 #include "Axes.h"
00010 #include "SetProperty.h"
00011 #include "GetProperty.h"
00012 #include "PloEch.h"
00013 #include "Xcall1.h"
00014 #include "periScreen.h"
00015 #include "DrawObjects.h"
00016 #include "GraphicZoom.h"
00017 #include "clipping.h"
00018
00019
00020 int drawSubWinEntity( sciPointObj * pObj )
00021 {
00022 sciSubWindow * ppsubwin = pSUBWIN_FEATURE(pObj) ;
00023
00024 if ( !sciGetVisibility(pObj) ) { return 0 ; }
00025
00026 sciSetSelectedSubWin(pObj);
00027
00028 set_scale("tttftt", ppsubwin->WRect, ppsubwin->FRect,
00029 NULL, ppsubwin->logflags,
00030 ppsubwin->ARect);
00031
00032 if ( sciGetIs3d(pObj) )
00033 {
00034 int isoflag = 0 ;
00035 int axesFlag = ppsubwin->axes.flag[1] ;
00036 double xbox[8] ;
00037 double ybox[8] ;
00038 double zbox[8] ;
00039 int InsideU[4] ;
00040 int InsideD[4] ;
00041 sciSons * curSon = NULL ;
00042
00043
00044
00045 if ( isZoom3dOn() )
00046 {
00047 int one = 1 ;
00048 C2F(dr)("xset","pixmap",&one,PI0,PI0,PI0,PI0,PI0,PD0,
00049 PD0,PD0,PD0,0L,0L);
00050 C2F (dr) ("xset","wwpc", PI0, PI0, PI0, PI0, PI0, PI0, PD0, PD0, PD0, PD0,0L, 0L);
00051 }
00052
00053
00054
00055 isoflag = ( axesFlag + 1 ) / 2 ;
00056
00057 if( ppsubwin->isoview )
00058 {
00059 if( isoflag != 2 && isoflag != 3 )
00060 {
00061 if( axesFlag == 0 || axesFlag == 2 )
00062 {
00063
00064
00065 ppsubwin->axes.flag[1] = 4 ;
00066 }
00067 else if ( axesFlag == 1 )
00068 {
00069 ppsubwin->axes.flag[1] = 3 ;
00070 }
00071 }
00072 }
00073 else {
00074 if ( axesFlag == 3 || axesFlag == 5 )
00075 {
00076 ppsubwin->axes.flag[1] = 1;
00077 }
00078 else if( axesFlag == 4 || axesFlag == 6 )
00079 {
00080
00081 ppsubwin->axes.flag[1] = 2 ;
00082 }
00083 }
00084
00085 axis_3ddraw( pObj,xbox,ybox,zbox,InsideU,InsideD);
00086
00087
00088
00089
00090 if ( ppsubwin->facetmerge )
00091 {
00092 sciDrawObj( sciGetMerge( pObj ) ) ;
00093 }
00094
00095 curSon = sciGetLastSons (pObj);
00096 while ( curSon != NULL)
00097 {
00098 if ( !(ppsubwin->facetmerge && sciIsMergeable(curSon->pointobj)) )
00099 {
00100 sciDrawObj( curSon->pointobj ) ;
00101 }
00102 curSon = curSon->pprev;
00103 }
00104
00105 triedre(pObj,xbox,ybox,zbox,InsideU,InsideD);
00106 }
00107 else
00108 {
00109 sciSons * curSon = NULL ;
00110 int foreground = sciGetForeground( pObj ) ;
00111 int lineWidth = sciGetLineWidth( pObj ) ;
00112 int markStyle = sciGetMarkStyle( pObj ) ;
00113 int markSize = sciGetLineWidth( pObj ) ;
00114 int v = 0 ;
00115 double dv = 0.0 ;
00116 char strFlag[4];
00117
00118 #ifdef _MSC_VER
00119 flag_DO=MaybeSetWinhdc();
00120 #endif
00121 C2F (dr) ("xset","dashes",&foreground,&foreground,&v,&v,&v,&v,&dv,&dv,&dv,&dv,5L,4096);
00122 C2F (dr) ("xset","foreground",&foreground,&foreground,&v,&v,&v,&v,&dv,&dv,&dv,&dv,5L,4096);
00123 C2F (dr) ("xset","thickness",&lineWidth,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
00124 C2F (dr) ("xset","mark",&markStyle,&markSize,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
00125
00126 sciUpdateScaleAngles( ppsubwin->theta, ppsubwin->alpha ) ;
00127 sci_update_frame_bounds_2d(pObj);
00128
00129
00130
00131
00132
00133
00134 sciClip( pObj ) ;
00135 sciUnClip( pObj ) ;
00136
00137 DrawAxesBackground();
00138
00139 drawAxesGrid( pObj ) ;
00140
00141
00142
00143
00144
00145 curSon = sciGetLastSons( pObj ) ;
00146 while ( curSon != NULL )
00147 {
00148 if ( !(ppsubwin->facetmerge && sciGetEntityType(curSon->pointobj) == SCI_SEGS) )
00149 {
00150 sciDrawObj( curSon->pointobj ) ;
00151 }
00152
00153 curSon = curSon->pprev;
00154 }
00155
00156
00157
00158 C2F (dr) ("xset","dashes",&foreground,&foreground,&v,&v,&v,&v,&dv,&dv,&dv,&dv,5L,4096);
00159 C2F (dr) ("xset","foreground",&foreground,&foreground,&v,&v,&v,&v,&dv,&dv,&dv,&dv,5L,4096);
00160 C2F (dr) ("xset","thickness",&lineWidth,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
00161 C2F (dr) ("xset","mark",&markStyle,&markSize,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
00162
00163 rebuild_strflag( pObj, strFlag ) ;
00164 axis_draw2( strFlag ) ;
00165
00166 labels2D_draw( pObj ) ;
00167
00168 #ifdef _MSC_VER
00169 if ( flag_DO == 1) { ReleaseWinHdc() ; }
00170 #endif
00171 wininfo("") ;
00172 }
00173 return 0 ;
00174 }
00175