/** * Generate a set of contour lines to be draped on the terrain. * * \param fInterval The vertical spacing between the contours. For example, * if the elevation range of your data is from 50 to 350 meters, then * an fIterval of 100 will place contour bands at 100,200,300 meters. */ void ContourConverter::GenerateContours(float fInterval) { float fMin, fMax; vtHeightField *hf = m_pHF; hf->GetHeightExtents(fMin, fMax); int start = (int) (fMin / fInterval) + 1; int stop = (int) (fMax / fInterval); SetQuikGridCallbackFunction(ReceiveContourPoint1, this); for (int i = start; i <= stop; i++) { m_fAltitude = i * fInterval; Contour(*m_pGrid, i * fInterval); } }
/** * Generate a set of contour lines to be draped on the terrain. * * \param fInterval The vertical spacing between the contours. For example, * if the elevation range of your data is from 50 to 350 meters, then * an fIterval of 100 will place contour bands at 100,200,300 meters. */ void vtContourConverter::GenerateContours(float fInterval) { float fMin, fMax; vtHeightField *hf; if (m_pHF) hf = m_pHF; else hf = m_pTerrain->GetTiledGeom(); if (!hf) return; hf->GetHeightExtents(fMin, fMax); int start = (int) (fMin / fInterval) + 1; int stop = (int) (fMax / fInterval); SetQuikGridCallbackFunction(ReceiveContourPoint2, this); for (int i = start; i <= stop; i++) { m_fAltitude = i * fInterval; Contour(*m_pGrid, i * fInterval); } }
/** * Generate a contour line to be draped on the terrain. * * \param fAlt The altitude (elevation) of the line to be generated. */ void ContourConverter::GenerateContour(float fAlt) { SetQuikGridCallbackFunction(ReceiveContourPoint1, this); m_fAltitude = fAlt; Contour(*m_pGrid, fAlt); }