[Igarden-commit] Garden/source/Plugins MaterialDrawPlugin.h, 1.9, 1.9.2.1 RenderPlugin.cpp, 1.13, 1
Status: Beta
Brought to you by:
jlbedell
|
From: Jeffrey B. <jlb...@us...> - 2006-10-29 03:31:50
|
Update of /cvsroot/igarden/Garden/source/Plugins In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv14353 Modified Files: Tag: Release_branch_v1 MaterialDrawPlugin.h RenderPlugin.cpp MaterialDrawSetup.h DefaultRenderPlugin.cpp MaterialDrawSetup.cpp Log Message: Add color, rectangles, and depth to the rendering. Add three new materials which make use of these features. Index: DefaultRenderPlugin.cpp =================================================================== RCS file: /cvsroot/igarden/Garden/source/Plugins/DefaultRenderPlugin.cpp,v retrieving revision 1.13 retrieving revision 1.13.2.1 diff -C2 -d -r1.13 -r1.13.2.1 *** DefaultRenderPlugin.cpp 17 Apr 2006 01:58:57 -0000 1.13 --- DefaultRenderPlugin.cpp 29 Oct 2006 03:31:48 -0000 1.13.2.1 *************** *** 619,626 **** Color yaafColor; ! upperLeft.xOffset = center.xOffset - (_width/2); ! upperLeft.yOffset = center.yOffset - (_height/2); ! lowerRight.xOffset = center.xOffset + (_width/2); ! lowerRight.yOffset = center.yOffset + (_height/2); /**/ --- 619,626 ---- Color yaafColor; ! upperLeft.xOffset = center.xOffset - (_xSize/2); ! upperLeft.yOffset = center.yOffset - (_ySize/2); ! lowerRight.xOffset = center.xOffset + (_xSize/2); ! lowerRight.yOffset = center.yOffset + (_ySize/2); /**/ *************** *** 646,650 **** } ! PRECONDITION(_width == _height); numColors = _otherColor.Length(); if(numColors != 0) --- 646,650 ---- } ! PRECONDITION(_xSize == _ySize); numColors = _otherColor.Length(); if(numColors != 0) *************** *** 659,663 **** glColor4f (red, green, blue, 0.5); ! gluPartialDisk(quad, 0, _height/4, 64, 16, n * sliceDegrees, sliceDegrees); } yaafColor = _foliageColor; --- 659,663 ---- glColor4f (red, green, blue, 0.5); ! gluPartialDisk(quad, 0, _ySize/4, 64, 16, n * sliceDegrees, sliceDegrees); } yaafColor = _foliageColor; *************** *** 667,671 **** glColor4f (red, green, blue, 0.5); ! gluDisk(quad, _height/4, _height/2, 64, 16); } else --- 667,671 ---- glColor4f (red, green, blue, 0.5); ! gluDisk(quad, _ySize/4, _ySize/2, 64, 16); } else *************** *** 677,681 **** glColor4f (red, green, blue, 0.5); ! gluDisk(quad, 0, _height/2, 64, 16); } --- 677,681 ---- glColor4f (red, green, blue, 0.5); ! gluDisk(quad, 0, _ySize/2, 64, 16); } *************** *** 687,691 **** gluDeleteQuadric(quad); ! if(_fullSpread > _height) { if(_year == kItemPrimaryYear) --- 687,691 ---- gluDeleteQuadric(quad); ! if(_fullSpread > _ySize) { if(_year == kItemPrimaryYear) *************** *** 705,719 **** pt.xOffset = center.xOffset + (cos(angle) * _fullSpread/2); pt.yOffset = center.yOffset + (sin(angle) * _fullSpread/2); ! glVertex3f (pt.xOffset, pt.yOffset, kGraphicsZ); endAngle = angle + (deltaAngle/2.0); pt.xOffset = center.xOffset + (cos(endAngle) * _fullSpread/2); pt.yOffset = center.yOffset + (sin(endAngle) * _fullSpread/2); ! glVertex3f (pt.xOffset, pt.yOffset, kGraphicsZ); glEnd(); } } ! if(_height > 32*_scale) { planLength_t top, left; --- 705,719 ---- pt.xOffset = center.xOffset + (cos(angle) * _fullSpread/2); pt.yOffset = center.yOffset + (sin(angle) * _fullSpread/2); ! glVertex3f (pt.xOffset, pt.yOffset, _zSize); endAngle = angle + (deltaAngle/2.0); pt.xOffset = center.xOffset + (cos(endAngle) * _fullSpread/2); pt.yOffset = center.yOffset + (sin(endAngle) * _fullSpread/2); ! glVertex3f (pt.xOffset, pt.yOffset, _zSize); glEnd(); } } ! if(_ySize > 32*_scale) { planLength_t top, left; *************** *** 731,735 **** glEnd(); _picture->CopyImage(_view, left, top, ! kPlantImageZ, _pictureWidth, _pictureHeight, 1.0, _scale); } } --- 731,735 ---- glEnd(); _picture->CopyImage(_view, left, top, ! _zSize+kPlantImageZ, _pictureWidth, _pictureHeight, 1.0, _scale); } } *************** *** 739,744 **** RGGLSVGDraw draw; ! /*!!!ec =*/ draw.Draw(spec, center.xOffset, center.yOffset, kGraphicsZ, ! _width, _height, _rotate, kMiddleFixed, _forcePastBounds); } glPopAttrib(); --- 739,744 ---- RGGLSVGDraw draw; ! /*!!!ec =*/ draw.Draw(spec, center.xOffset, center.yOffset, _zSize, ! _xSize, _ySize, _rotate, kMiddleFixed, _forcePastBounds); } glPopAttrib(); Index: MaterialDrawSetup.h =================================================================== RCS file: /cvsroot/igarden/Garden/source/Plugins/MaterialDrawSetup.h,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** MaterialDrawSetup.h 1 Sep 2005 11:07:38 -0000 1.3 --- MaterialDrawSetup.h 29 Oct 2006 03:31:48 -0000 1.3.2.1 *************** *** 28,34 **** virtual void StartItemDraw(XGView *view, planScale_t scale, planScale_t defaultScale); virtual void EndItemDraw(); ! virtual void SetSize(double height, double width, bool forcePastBounds); virtual void SetName(String &name, RGGLBitmapFont *bitmapFont); ! virtual void SetPlantSize(double height, double width, double fullSpread); virtual void SetColors(Color foliageColor, XGSDynArray<Color> &otherColor, unsigned char* halftone); virtual void SetPicture(CGWorld *picture, UInt32 pictureHeight, UInt32 pictureWidth); --- 28,34 ---- virtual void StartItemDraw(XGView *view, planScale_t scale, planScale_t defaultScale); virtual void EndItemDraw(); ! virtual void SetSize(double xSize, double ySize, double zSize, bool forcePastBounds); virtual void SetName(String &name, RGGLBitmapFont *bitmapFont); ! virtual void SetPlantSize(double xSize, double ySize, double zSize, double fullSpread); virtual void SetColors(Color foliageColor, XGSDynArray<Color> &otherColor, unsigned char* halftone); virtual void SetPicture(CGWorld *picture, UInt32 pictureHeight, UInt32 pictureWidth); *************** *** 39,44 **** protected: XGView *_view; ! double _height; ! double _width; bool _forcePastBounds; CGWorld *_picture; --- 39,46 ---- protected: XGView *_view; ! double _ySize; ! double _xSize; ! double _zSize; ! // double _width; bool _forcePastBounds; CGWorld *_picture; Index: MaterialDrawPlugin.h =================================================================== RCS file: /cvsroot/igarden/Garden/source/Plugins/MaterialDrawPlugin.h,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -C2 -d -r1.9 -r1.9.2.1 *** MaterialDrawPlugin.h 3 Oct 2005 02:21:24 -0000 1.9 --- MaterialDrawPlugin.h 29 Oct 2006 03:31:48 -0000 1.9.2.1 *************** *** 52,58 **** virtual void StartItemDraw(XGView *view, planScale_t scale, planScale_t defaultScale) = 0; virtual void EndItemDraw() = 0; ! virtual void SetSize(double height, double width, bool forcePastBounds) = 0; virtual void SetName(String &name, RGGLBitmapFont *bitmapFont) = 0; ! virtual void SetPlantSize(double height, double width, double fullSpread) = 0; virtual void SetColors(Color foliageColor, XGSDynArray<Color> &otherColor, unsigned char* halftone) = 0; virtual void SetPicture(CGWorld *picture, UInt32 pictureHeight, UInt32 pictureWidth) = 0; --- 52,58 ---- virtual void StartItemDraw(XGView *view, planScale_t scale, planScale_t defaultScale) = 0; virtual void EndItemDraw() = 0; ! virtual void SetSize(double xSize, double ySize, double zSize, bool forcePastBounds) = 0; virtual void SetName(String &name, RGGLBitmapFont *bitmapFont) = 0; ! virtual void SetPlantSize(double xSize, double ySize, double zSize, double fullSpread) = 0; virtual void SetColors(Color foliageColor, XGSDynArray<Color> &otherColor, unsigned char* halftone) = 0; virtual void SetPicture(CGWorld *picture, UInt32 pictureHeight, UInt32 pictureWidth) = 0; Index: RenderPlugin.cpp =================================================================== RCS file: /cvsroot/igarden/Garden/source/Plugins/RenderPlugin.cpp,v retrieving revision 1.13 retrieving revision 1.13.2.1 diff -C2 -d -r1.13 -r1.13.2.1 *** RenderPlugin.cpp 11 Feb 2006 16:54:31 -0000 1.13 --- RenderPlugin.cpp 29 Oct 2006 03:31:48 -0000 1.13.2.1 *************** *** 494,498 **** ErrorCode ec; ! ec = draw.Draw(spec, centerParm.xOffset, centerParm.yOffset, kGraphicsZ, _width, _height, 0.0, kMiddleFixed, _forcePastBounds); return (ec == yaaf::KYAAFNoError) ? kCanvasOK : kCanvasNotHandled; } --- 494,498 ---- ErrorCode ec; ! ec = draw.Draw(spec, centerParm.xOffset, centerParm.yOffset, kGraphicsZ, _xSize, _ySize, _zSize, kMiddleFixed, _forcePastBounds); return (ec == yaaf::KYAAFNoError) ? kCanvasOK : kCanvasNotHandled; } *************** *** 696,700 **** ErrorCode ec; ! ec = draw.Draw(spec, center.xOffset, center.yOffset, kGraphicsZ, _width, _height, 0.0, kMiddleFixed, _forcePastBounds); return (ec == yaaf::KYAAFNoError) ? kCanvasOK : kCanvasNotHandled; } --- 696,700 ---- ErrorCode ec; ! ec = draw.Draw(spec, center.xOffset, center.yOffset, kGraphicsZ, _xSize, _ySize, _zSize, kMiddleFixed, _forcePastBounds); return (ec == yaaf::KYAAFNoError) ? kCanvasOK : kCanvasNotHandled; } *************** *** 757,761 **** { ec = draw.Draw(spec, center.xOffset, center.yOffset, kGraphicsZ, ! _width, _height, 0.0, kMiddleFixed, _forcePastBounds); } } --- 757,761 ---- { ec = draw.Draw(spec, center.xOffset, center.yOffset, kGraphicsZ, ! _xSize, _ySize, _zSize, kMiddleFixed, _forcePastBounds); } } Index: MaterialDrawSetup.cpp =================================================================== RCS file: /cvsroot/igarden/Garden/source/Plugins/MaterialDrawSetup.cpp,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** MaterialDrawSetup.cpp 1 Sep 2005 11:07:38 -0000 1.3 --- MaterialDrawSetup.cpp 29 Oct 2006 03:31:48 -0000 1.3.2.1 *************** *** 26,31 **** { _view = view; ! _height = 0.0; ! _width = 0.0; _picture = NULL; _pictureHeight = 0; --- 26,32 ---- { _view = view; ! _ySize = 0.0; ! _xSize = 0.0; ! _zSize = 0.0; _picture = NULL; _pictureHeight = 0; *************** *** 60,67 **** /// SetSize // ! void MaterialDrawSetup::SetSize(double height, double width, bool forcePastBounds) { ! _height = height; ! _width = width; _fullSpread = 0; _forcePastBounds = forcePastBounds; --- 61,69 ---- /// SetSize // ! void MaterialDrawSetup::SetSize(double xSize, double ySize, double zSize, bool forcePastBounds) { ! _ySize = ySize; ! _xSize = xSize; ! _zSize = zSize; _fullSpread = 0; _forcePastBounds = forcePastBounds; *************** *** 80,87 **** /// SetPlantSize // ! void MaterialDrawSetup::SetPlantSize(double height, double width, double fullSpread) { ! _height = height; ! _width = width; _fullSpread = fullSpread; } --- 82,90 ---- /// SetPlantSize // ! void MaterialDrawSetup::SetPlantSize(double xSize, double ySize, double zSize, double fullSpread) { ! _ySize = ySize; ! _xSize = xSize; ! _zSize = zSize; _fullSpread = fullSpread; } |