[Igarden-commit] Garden/source/LayoutDB Layout.cpp, 1.27, 1.27.2.1 Path.cpp, 1.67, 1.67.2.1 Materia
Status: Beta
Brought to you by:
jlbedell
|
From: Jeffrey B. <jlb...@us...> - 2006-11-01 03:18:31
|
Update of /cvsroot/igarden/Garden/source/LayoutDB In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv1863 Modified Files: Tag: Release_branch_v1 Layout.cpp Path.cpp MaterialRef.h LinePath.cpp Path.h MaterialRef.cpp Log Message: Add zAxis to elements Add polygon smoothing to material drawing Index: Path.cpp =================================================================== RCS file: /cvsroot/igarden/Garden/source/LayoutDB/Path.cpp,v retrieving revision 1.67 retrieving revision 1.67.2.1 diff -C2 -d -r1.67 -r1.67.2.1 *** Path.cpp 24 Jun 2006 15:36:51 -0000 1.67 --- Path.cpp 1 Nov 2006 03:18:29 -0000 1.67.2.1 *************** *** 1095,1098 **** --- 1095,1105 ---- } + landscapeHeight_t Path::ElevationAtPosition( planLength_t x, planLength_t y ) + { + if(_owningElement != NULL) + return _owningElement->ElevationAtPosition(x,y); + else + return 0.0; + } #pragma mark PROTECTED *************** *** 1179,1182 **** --- 1186,1190 ---- if(ySpacing > 0) { + item.zOffset = 0.0; for(y = yStart, row=0; y < yEnd; y += ySpacing, row++) { *************** *** 1482,1485 **** --- 1490,1494 ---- center.xOffset = (long)(((double)(rect.xOffset+ rect.xSize)/2.0) + 0.5); center.yOffset = (long)(((double)(rect.yOffset+ rect.ySize)/2.0) + 0.5); + center.yOffset = (long)0.0; } Index: Path.h =================================================================== RCS file: /cvsroot/igarden/Garden/source/LayoutDB/Path.h,v retrieving revision 1.38 retrieving revision 1.38.2.1 diff -C2 -d -r1.38 -r1.38.2.1 *** Path.h 22 Jun 2006 00:32:26 -0000 1.38 --- Path.h 1 Nov 2006 03:18:29 -0000 1.38.2.1 *************** *** 174,177 **** --- 174,178 ---- virtual void PlaceOneRowOfElementsInPath(planLength_t perpOffset, planLength_t startOffset, planLength_t spacing) {} virtual void ComputeBackdropPoints(PlanView* view, double xSize, double ySize); + landscapeHeight_t ElevationAtPosition( planLength_t x, planLength_t y ); protected: Index: MaterialRef.cpp =================================================================== RCS file: /cvsroot/igarden/Garden/source/LayoutDB/MaterialRef.cpp,v retrieving revision 1.119.2.1 retrieving revision 1.119.2.2 diff -C2 -d -r1.119.2.1 -r1.119.2.2 *** MaterialRef.cpp 29 Oct 2006 03:31:35 -0000 1.119.2.1 --- MaterialRef.cpp 1 Nov 2006 03:18:29 -0000 1.119.2.2 *************** *** 467,470 **** --- 467,471 ---- result.xOffset = center.xOffset; result.yOffset = center.yOffset; + result.zOffset = center.zOffset; switch(Index) { *************** *** 1468,1471 **** --- 1469,1473 ---- XGDirectory mkdir; materialType_t mtype; + planPoint_t centerPoint; PRECONDITION(view != NULL); *************** *** 1475,1479 **** PrepareToDraw(view, actualSize, plantVisible); view->SetLineColorToDefault(); - view->DrawSymbol(point, kPlanSymCenterPoint); if(plantVisible || ((mtype & kMajorMaterialType) != kMaterialTypePlant)) --- 1477,1480 ---- *************** *** 1481,1484 **** --- 1482,1486 ---- XGFileSpecifier spec; + centerPoint = point; glLineWidth (1.0); if(GetPlanDrawFile(spec)) *************** *** 1505,1508 **** --- 1507,1513 ---- GetLatestPlantDimensions(&height, &spread); + centerPoint.zOffset += height + 0.1; + view->DrawSymbol(centerPoint, kPlanSymCenterPoint); + view->SetItemSize(width, length, height, true); view->SetItemRotation(_rotation, point); *************** *** 1515,1518 **** --- 1520,1525 ---- else { + view->DrawSymbol(point, kPlanSymCenterPoint); + glPushAttrib(GL_CURRENT_BIT); glColor3f (0.0, 0.0, 0.0); *************** *** 1522,1526 **** err = glGetError(); glPushMatrix(); ! glTranslatef(point.xOffset, point.yOffset, kGraphicsZ); err = glGetError(); gluDisk(quad, 0, actualSize/2, 64, 16); --- 1529,1533 ---- err = glGetError(); glPushMatrix(); ! glTranslatef(point.xOffset, point.yOffset, point.zOffset); err = glGetError(); gluDisk(quad, 0, actualSize/2, 64, 16); *************** *** 1746,1749 **** --- 1753,1758 ---- GLenum err; short minYear, maxYear, primaryYear; + landscapeHeight_t height; + planLength_t spread; bool growX, growY; *************** *** 1769,1774 **** else { - landscapeHeight_t height; - planLength_t spread; GetPlantDimensions(&height, &spread, primaryYear); actualSize = spread; --- 1778,1781 ---- *************** *** 1798,1806 **** --- 1805,1816 ---- planPoint_t start, end; + height = TopElevation(intoView) + 0.1; if(growY) { start = GetIndexedAnchorPoint(kItemAnchorTop); + start.zOffset += height; intoView->DrawSymbol(start, kPlanSymAnchorPoint); end = GetIndexedAnchorPoint(kItemAnchorBottom); + end.zOffset += height; intoView->DrawSymbol(end, kPlanSymAnchorPoint); *************** *** 1816,1821 **** --- 1826,1833 ---- { start = GetIndexedAnchorPoint(kItemAnchorLeft); + start.zOffset += height; intoView->DrawSymbol(start, kPlanSymAnchorPoint); end = GetIndexedAnchorPoint(kItemAnchorRight); + end.zOffset += height; intoView->DrawSymbol(end, kPlanSymAnchorPoint); *************** *** 1906,1915 **** { PRECONDITION(heightPtr != NULL && spreadPtr != NULL); ! InstanceData *before, *after; ! bool isGiven; ! Int32 growthBitfield, maxHeight, maxSpread, temp32; ! double averageGrowthRate, yearsToMaxHt; ! planLength_t lastKnownHeight, temp; ! double sigmoidDenom, yearOffset; if(_material != NULL) --- 1918,1923 ---- { PRECONDITION(heightPtr != NULL && spreadPtr != NULL); ! Int32 growthBitfield; ! double averageGrowthRate; if(_material != NULL) *************** *** 3320,3324 **** { UInt32 n; ! planPoint_t point = { 0, 0 }; if(_path == NULL) --- 3328,3332 ---- { UInt32 n; ! planPoint_t point; if(_path == NULL) *************** *** 3509,3512 **** --- 3517,3538 ---- } + landscapeHeight_t MaterialRef::TopElevation(PlanView* view) + { + landscapeHeight_t height; + planLength_t spread; + + if((GetMaterialType() & kMajorMaterialType) == kMaterialTypePlant) + { + short minYear, maxYear, primaryYear; + + view->GetYearsDisplayed(minYear, maxYear, primaryYear); + GetPlantDimensions(&height, &spread, primaryYear); + } + else + GetLatestPlantDimensions(&height, &spread); + + return height; + } + #pragma mark PRIVATE Index: Layout.cpp =================================================================== RCS file: /cvsroot/igarden/Garden/source/LayoutDB/Layout.cpp,v retrieving revision 1.27 retrieving revision 1.27.2.1 diff -C2 -d -r1.27 -r1.27.2.1 *** Layout.cpp 25 Oct 2005 00:55:27 -0000 1.27 --- Layout.cpp 1 Nov 2006 03:18:29 -0000 1.27.2.1 *************** *** 1013,1017 **** UInt32 n; Path *path; ! planPoint_t aPoint = { 0, 0 }; ref = _unusedMaterial->FindMaterial(materialID); --- 1013,1017 ---- UInt32 n; Path *path; ! planPoint_t aPoint; ref = _unusedMaterial->FindMaterial(materialID); Index: LinePath.cpp =================================================================== RCS file: /cvsroot/igarden/Garden/source/LayoutDB/LinePath.cpp,v retrieving revision 1.27 retrieving revision 1.27.2.1 diff -C2 -d -r1.27 -r1.27.2.1 *** LinePath.cpp 5 Oct 2005 22:10:08 -0000 1.27 --- LinePath.cpp 1 Nov 2006 03:18:29 -0000 1.27.2.1 *************** *** 298,301 **** --- 298,302 ---- void LinePath::CreateTestPattern( Layer* layout, Material* material ) { + #if 0 Path *path; PathElement *element; *************** *** 313,319 **** plot->GetDimensions(planHeight, planWidth); ! planPoint_t start = { 10, planHeight-10 }, end = { 800, planHeight-800 }; ! planPoint_t matStart = { 10, planHeight-40 }, matEnd = { 1000, planHeight-1000 }; ! planPoint_t star[6] = {{40,planHeight-10}, {34,planHeight-30}, {50,planHeight-18}, {30,planHeight-18}, {46,planHeight-30}, {40,planHeight-10}}; path = new LinePath(start, end); --- 314,320 ---- plot->GetDimensions(planHeight, planWidth); ! planPoint_t start(10, planHeight-10, 0), end(800, planHeight-800, 0); ! planPoint_t matStart(10, planHeight-40, 0), matEnd(1000, planHeight-1000, 0 }; ! planPoint_t star[6] = {{40,planHeight-10, 0}, {34,planHeight-30, 0}, {50,planHeight-18, 0}, {30,planHeight-18, 0}, {46,planHeight-30, 0}, {40,planHeight-10, 0}}; path = new LinePath(start, end); *************** *** 337,340 **** --- 338,342 ---- layout->AddElement(ref); } + #endif } Index: MaterialRef.h =================================================================== RCS file: /cvsroot/igarden/Garden/source/LayoutDB/MaterialRef.h,v retrieving revision 1.43 retrieving revision 1.43.2.1 diff -C2 -d -r1.43 -r1.43.2.1 *** MaterialRef.h 26 Jun 2006 01:23:48 -0000 1.43 --- MaterialRef.h 1 Nov 2006 03:18:29 -0000 1.43.2.1 *************** *** 223,226 **** --- 223,227 ---- virtual void UserChangedAttribute(attributeID_t attributeID); virtual void RefreshElement(PlanView* intoView); + virtual landscapeHeight_t TopElevation(PlanView* view); protected: |