[Igarden-commit] Garden/source/LayoutDB BSPNode.cpp, 1.28, 1.28.2.1 FreehandPath.cpp, 1.41, 1.41.2.
Status: Beta
Brought to you by:
jlbedell
|
From: Jeffrey B. <jlb...@us...> - 2006-11-01 03:09:50
|
Update of /cvsroot/igarden/Garden/source/LayoutDB In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv30687 Modified Files: Tag: Release_branch_v1 BSPNode.cpp FreehandPath.cpp GardenPlot.h DimensionLine.cpp Element.cpp GardenPlot.cpp ArcPath.cpp Element.h Log Message: Add zAxis to elements Add polygon smoothing to material drawing Index: Element.cpp =================================================================== RCS file: /cvsroot/igarden/Garden/source/LayoutDB/Element.cpp,v retrieving revision 1.40 retrieving revision 1.40.2.1 diff -C2 -d -r1.40 -r1.40.2.1 *** Element.cpp 13 Jan 2006 22:53:20 -0000 1.40 --- Element.cpp 1 Nov 2006 03:09:47 -0000 1.40.2.1 *************** *** 43,46 **** --- 43,47 ---- #include "RGCompression.h" #include <XGFile.h> + #include "GardenPlot.h" const rsuid_t ElementUID = { 0xb672, 0xc187, 0x0006, 0xd935 }; *************** *** 1003,1006 **** --- 1004,1022 ---- } + landscapeHeight_t Element::ElevationAtPosition( planLength_t x, planLength_t y ) + { + GardenPlot *plot = GetPlot(); + if(plot != NULL) + return plot->ElevationAtPosition(x, y); + else + return 0.0; + } + + landscapeHeight_t Element::TopElevation(PlanView* view) + { + return 0.0; + } + + #pragma mark PROTECTED Index: Element.h =================================================================== RCS file: /cvsroot/igarden/Garden/source/LayoutDB/Element.h,v retrieving revision 1.38 retrieving revision 1.38.2.1 diff -C2 -d -r1.38 -r1.38.2.1 *** Element.h 13 Jan 2006 22:53:20 -0000 1.38 --- Element.h 1 Nov 2006 03:09:47 -0000 1.38.2.1 *************** *** 202,205 **** --- 202,207 ---- virtual void PrintPathName() {} bool _converted; + landscapeHeight_t ElevationAtPosition( planLength_t x, planLength_t y ); + virtual landscapeHeight_t TopElevation(PlanView* view); protected: Index: GardenPlot.h =================================================================== RCS file: /cvsroot/igarden/Garden/source/LayoutDB/GardenPlot.h,v retrieving revision 1.19 retrieving revision 1.19.2.1 diff -C2 -d -r1.19 -r1.19.2.1 *** GardenPlot.h 22 Sep 2005 01:41:37 -0000 1.19 --- GardenPlot.h 1 Nov 2006 03:09:47 -0000 1.19.2.1 *************** *** 134,137 **** --- 134,138 ---- bool IsAerialPicturePresent() { return _aerialPhoto != NULL; } MaterialRef* FindMaterial( materialID_t materialID ); + landscapeHeight_t ElevationAtPosition( planLength_t x, planLength_t y ) { return 0.0; } private: Index: BSPNode.cpp =================================================================== RCS file: /cvsroot/igarden/Garden/source/LayoutDB/BSPNode.cpp,v retrieving revision 1.28 retrieving revision 1.28.2.1 diff -C2 -d -r1.28 -r1.28.2.1 *** BSPNode.cpp 31 Oct 2005 02:30:47 -0000 1.28 --- BSPNode.cpp 1 Nov 2006 03:09:47 -0000 1.28.2.1 *************** *** 526,530 **** if(IntersectsRect(within)) { ! Int32 n, count; count = _elements.Length(); --- 526,532 ---- if(IntersectsRect(within)) { ! Int32 n, count; ! landscapeHeight_t maxHeight = 0.0, height; ! Element *maxElem = NULL; count = _elements.Length(); *************** *** 538,546 **** pt.xOffset = within.xOffset; pt.yOffset = within.yOffset; if(elem->IsPointOver(pt, view)) { ! selected->AddSelectedElements(elem); ! result = true; ! break; // Only return 1st element for point } } --- 540,552 ---- pt.xOffset = within.xOffset; pt.yOffset = within.yOffset; + pt.zOffset = 0.0; if(elem->IsPointOver(pt, view)) { ! height = elem->TopElevation(view); ! if(height >= maxHeight) ! { ! maxElem = elem; ! maxHeight = height; ! } } } *************** *** 554,557 **** --- 560,566 ---- } } + + if(maxElem != NULL) + selected->AddSelectedElements(maxElem); if(!_isLeaf) *************** *** 591,594 **** --- 600,605 ---- pt.xOffset = within.xOffset; pt.yOffset = within.yOffset; + pt.zOffset = 0; + if(elem->IsPointOver(pt, view)) { Index: ArcPath.cpp =================================================================== RCS file: /cvsroot/igarden/Garden/source/LayoutDB/ArcPath.cpp,v retrieving revision 1.19 retrieving revision 1.19.2.1 diff -C2 -d -r1.19 -r1.19.2.1 *** ArcPath.cpp 22 Jun 2006 00:35:57 -0000 1.19 --- ArcPath.cpp 1 Nov 2006 03:09:47 -0000 1.19.2.1 *************** *** 44,47 **** --- 44,49 ---- center.xOffset = 0.0; center.yOffset = 0.0; + center.zOffset = 0.0; + AddAnchorPoint( center ); AddAnchorPoint( center ); *************** *** 298,302 **** { pt = GetIndexedPathPoint(n); ! planView->AddTessPoint(pt.xOffset, pt.yOffset, kBackGroundZ); } planView->EndTessContour(); --- 300,304 ---- { pt = GetIndexedPathPoint(n); ! planView->AddTessPoint(pt.xOffset, pt.yOffset, pt.zOffset); } planView->EndTessContour(); *************** *** 316,320 **** planLength_t offset, rad; planAngle_t angle; ! planPoint_t pt, center, startPt1 = { 0,0}, startPt2 = { 0,0}, endPt1 = { 0,0}, endPt2 = { 0,0}; long n, pointCount; --- 318,322 ---- planLength_t offset, rad; planAngle_t angle; ! planPoint_t pt, center, startPt1(0,0,0), startPt2(0,0,0), endPt1(0,0,0), endPt2(0,0,0); long n, pointCount; *************** *** 333,337 **** pt.xOffset = center.xOffset + (cos(angle) * rad); pt.yOffset = center.yOffset + (sin(angle) * rad); ! glVertex3f (pt.xOffset, pt.yOffset, kGraphicsZ); if(n == 0) startPt1 = pt; --- 335,340 ---- pt.xOffset = center.xOffset + (cos(angle) * rad); pt.yOffset = center.yOffset + (sin(angle) * rad); ! pt.zOffset = center.zOffset; ! glVertex3f (pt.xOffset, pt.yOffset, pt.zOffset); if(n == 0) startPt1 = pt; *************** *** 347,351 **** pt.xOffset = center.xOffset + (cos(angle) * rad); pt.yOffset = center.yOffset + (sin(angle) * rad); ! glVertex3f (pt.xOffset, pt.yOffset, kGraphicsZ); if(n == 0) endPt2 = pt; --- 350,355 ---- pt.xOffset = center.xOffset + (cos(angle) * rad); pt.yOffset = center.yOffset + (sin(angle) * rad); ! pt.zOffset = center.zOffset; ! glVertex3f (pt.xOffset, pt.yOffset, pt.zOffset); if(n == 0) endPt2 = pt; *************** *** 357,366 **** { glBegin(GL_LINES); ! glVertex3f (startPt2.xOffset, startPt2.yOffset, kGraphicsZ); ! glVertex3f (startPt1.xOffset, startPt1.yOffset, kGraphicsZ); glEnd(); glBegin(GL_LINES); ! glVertex3f (endPt2.xOffset, endPt2.yOffset, kGraphicsZ); ! glVertex3f (endPt1.xOffset, endPt1.yOffset, kGraphicsZ); glEnd(); } --- 361,370 ---- { glBegin(GL_LINES); ! glVertex3f (startPt2.xOffset, startPt2.yOffset, pt.zOffset); ! glVertex3f (startPt1.xOffset, startPt1.yOffset, pt.zOffset); glEnd(); glBegin(GL_LINES); ! glVertex3f (endPt2.xOffset, endPt2.yOffset, pt.zOffset); ! glVertex3f (endPt1.xOffset, endPt1.yOffset, pt.zOffset); glEnd(); } *************** *** 538,543 **** --- 542,549 ---- center.xOffset = rect.xOffset + 100; center.yOffset = (rect.yOffset + rect.ySize) - 100; + center.zOffset = 0.0; edge.xOffset = rect.xOffset; edge.yOffset = (rect.yOffset + rect.ySize) - 100; + edge.zOffset = 0.0; path = new ArcPath::ArcPath(center, edge); *************** *** 612,615 **** --- 618,622 ---- point.xOffset = center.xOffset + (cos(angle) * (_radius + perpOffset)); point.yOffset = center.yOffset + (sin(angle) * (_radius + perpOffset)); + point.zOffset = center.zOffset; AddElementPoint(point); } *************** *** 756,763 **** --- 763,772 ---- point.xOffset = center.xOffset + (cos(angle) * _radius); point.yOffset = center.yOffset + (sin(angle) * _radius); + point.zOffset = center.zOffset; _pathPoints[n] = point; } point.xOffset = center.xOffset + (cos(_endAngle) * _radius); point.yOffset = center.yOffset + (sin(_endAngle) * _radius); + point.zOffset = center.zOffset; SimplePath::ChangeIndexedAnchorPoint(kPointAnchorArcEnd, point); Index: GardenPlot.cpp =================================================================== RCS file: /cvsroot/igarden/Garden/source/LayoutDB/GardenPlot.cpp,v retrieving revision 1.50 retrieving revision 1.50.2.1 diff -C2 -d -r1.50 -r1.50.2.1 *** GardenPlot.cpp 7 Jun 2006 00:10:51 -0000 1.50 --- GardenPlot.cpp 1 Nov 2006 03:09:47 -0000 1.50.2.1 *************** *** 785,792 **** fixOffset.xOffset = _plotXOffset; fixOffset.yOffset = _plotYOffset; } else { ! fixOffset.xOffset = fixOffset.yOffset = 0.0; } --- 785,793 ---- fixOffset.xOffset = _plotXOffset; fixOffset.yOffset = _plotYOffset; + fixOffset.zOffset = 0.0; } else { ! fixOffset.xOffset = fixOffset.yOffset = fixOffset.zOffset = 0.0; } Index: DimensionLine.cpp =================================================================== RCS file: /cvsroot/igarden/Garden/source/LayoutDB/DimensionLine.cpp,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -C2 -d -r1.11 -r1.11.2.1 *** DimensionLine.cpp 27 Oct 2005 03:03:45 -0000 1.11 --- DimensionLine.cpp 1 Nov 2006 03:09:47 -0000 1.11.2.1 *************** *** 95,101 **** tagX = _end.xOffset+_overshootDx+(30*_defaultScale); glBegin(GL_LINES); ! glVertex3f (_start.xOffset, _start.yOffset, kGraphicsZ); ! glVertex3f (_end.xOffset+_overshootDx, _end.yOffset+_overshootDy, kGraphicsZ); ! glVertex3f (_end.xOffset+_overshootDx, _end.yOffset+_overshootDy, kGraphicsZ); glVertex3f (tagX, _end.yOffset+_overshootDy, kGraphicsZ); glEnd(); --- 95,101 ---- tagX = _end.xOffset+_overshootDx+(30*_defaultScale); glBegin(GL_LINES); ! glVertex3f (_start.xOffset, _start.yOffset, _start.zOffset); ! glVertex3f (_end.xOffset+_overshootDx, _end.yOffset+_overshootDy, _end.zOffset); ! glVertex3f (_end.xOffset+_overshootDx, _end.yOffset+_overshootDy, _end.zOffset); glVertex3f (tagX, _end.yOffset+_overshootDy, kGraphicsZ); glEnd(); *************** *** 108,113 **** { glBegin(GL_LINES); ! glVertex3f (_start.xOffset, _start.yOffset, kGraphicsZ); ! glVertex3f (_end.xOffset, _end.yOffset, kGraphicsZ); glEnd(); } --- 108,113 ---- { glBegin(GL_LINES); ! glVertex3f (_start.xOffset, _start.yOffset, _start.zOffset); ! glVertex3f (_end.xOffset, _end.yOffset, _end.zOffset); glEnd(); } *************** *** 119,125 **** { glBegin(GL_LINE_STRIP); ! glVertex3f (_end.xOffset + _arrowDx1, _end.yOffset + _arrowDy1, kGraphicsZ); ! glVertex3f (_end.xOffset, _end.yOffset, kGraphicsZ); ! glVertex3f (_end.xOffset + _arrowDx2, _end.yOffset + _arrowDy2, kGraphicsZ); glEnd(); } --- 119,125 ---- { glBegin(GL_LINE_STRIP); ! glVertex3f (_end.xOffset + _arrowDx1, _end.yOffset + _arrowDy1, _end.zOffset); ! glVertex3f (_end.xOffset, _end.yOffset, _end.zOffset); ! glVertex3f (_end.xOffset + _arrowDx2, _end.yOffset + _arrowDy2, _end.zOffset); glEnd(); } *************** *** 127,138 **** { glBegin(GL_LINE_STRIP); ! glVertex3f (_start.xOffset + _arrowDx1, _start.yOffset + _arrowDy1, kGraphicsZ); ! glVertex3f (_start.xOffset, _start.yOffset, kGraphicsZ); ! glVertex3f (_start.xOffset + _arrowDx2, _start.yOffset + _arrowDy2, kGraphicsZ); glEnd(); glBegin(GL_LINE_STRIP); ! glVertex3f (_end.xOffset - _arrowDx1, _end.yOffset - _arrowDy1, kGraphicsZ); ! glVertex3f (_end.xOffset, _end.yOffset, kGraphicsZ); ! glVertex3f (_end.xOffset - _arrowDx2, _end.yOffset - _arrowDy2, kGraphicsZ); glEnd(); } --- 127,138 ---- { glBegin(GL_LINE_STRIP); ! glVertex3f (_start.xOffset + _arrowDx1, _start.yOffset + _arrowDy1, _start.zOffset); ! glVertex3f (_start.xOffset, _start.yOffset, _start.zOffset); ! glVertex3f (_start.xOffset + _arrowDx2, _start.yOffset + _arrowDy2, _start.zOffset); glEnd(); glBegin(GL_LINE_STRIP); ! glVertex3f (_end.xOffset - _arrowDx1, _end.yOffset - _arrowDy1, _end.zOffset); ! glVertex3f (_end.xOffset, _end.yOffset, _end.zOffset); ! glVertex3f (_end.xOffset - _arrowDx2, _end.yOffset - _arrowDy2, _end.zOffset); glEnd(); } *************** *** 142,149 **** { glBegin(GL_LINES); ! glVertex3f (_start.xOffset - _projectionDx, _start.yOffset - _projectionDy, kGraphicsZ); ! glVertex3f (_start.xOffset + _projectionDx, _start.yOffset + _projectionDy, kGraphicsZ); ! glVertex3f (_end.xOffset - _projectionDx, _end.yOffset - _projectionDy, kGraphicsZ); ! glVertex3f (_end.xOffset + _projectionDx, _end.yOffset + _projectionDy, kGraphicsZ); glEnd(); } --- 142,149 ---- { glBegin(GL_LINES); ! glVertex3f (_start.xOffset - _projectionDx, _start.yOffset - _projectionDy, _start.zOffset); ! glVertex3f (_start.xOffset + _projectionDx, _start.yOffset + _projectionDy, _start.zOffset); ! glVertex3f (_end.xOffset - _projectionDx, _end.yOffset - _projectionDy, _end.zOffset); ! glVertex3f (_end.xOffset + _projectionDx, _end.yOffset + _projectionDy, _end.zOffset); glEnd(); } *************** *** 164,170 **** { glBegin(GL_LINE_STRIP); ! glVertex3f (end.xOffset - _backupDx - (_arrowLen*_arrowDx1), end.yOffset - _backupDy - (_arrowLen*_arrowDy1), kGraphicsZ); ! glVertex3f (end.xOffset - _backupDx, end.yOffset - _backupDy, kGraphicsZ); ! glVertex3f (end.xOffset - _backupDx - (_arrowLen*_arrowDx2), end.yOffset - _backupDy - (_arrowLen*_arrowDy2), kGraphicsZ); glEnd(); } --- 164,170 ---- { glBegin(GL_LINE_STRIP); ! glVertex3f (end.xOffset - _backupDx - (_arrowLen*_arrowDx1), end.yOffset - _backupDy - (_arrowLen*_arrowDy1), _end.zOffset); ! glVertex3f (end.xOffset - _backupDx, end.yOffset - _backupDy, _end.zOffset); ! glVertex3f (end.xOffset - _backupDx - (_arrowLen*_arrowDx2), end.yOffset - _backupDy - (_arrowLen*_arrowDy2), _end.zOffset); glEnd(); } Index: FreehandPath.cpp =================================================================== RCS file: /cvsroot/igarden/Garden/source/LayoutDB/FreehandPath.cpp,v retrieving revision 1.41 retrieving revision 1.41.2.1 diff -C2 -d -r1.41 -r1.41.2.1 *** FreehandPath.cpp 8 Oct 2005 20:07:14 -0000 1.41 --- FreehandPath.cpp 1 Nov 2006 03:09:47 -0000 1.41.2.1 *************** *** 532,535 **** --- 532,536 ---- to.xOffset = pt.xOffset + deltaX; to.yOffset = pt.yOffset + deltaY; + to.zOffset = pt.zOffset; if(n > 0) *************** *** 548,551 **** --- 549,553 ---- item.xOffset = (long)(from.xOffset + cos(angle)*subOff); item.yOffset = (long)(from.yOffset + sin(angle)*subOff); + item.zOffset = (long)from.zOffset; spreadOut = IsPointNearPreviousElement(item, spacing); |