|
@@ -3,15 +3,6 @@
|
|
* This is a high level D call.
|
|
* This is a high level D call.
|
|
* It does a full setup for the current graphics frame.
|
|
* It does a full setup for the current graphics frame.
|
|
*
|
|
*
|
|
- * 1. Makes sure there is a current graphics frame
|
|
|
|
- * (will create a full-screen one, if not
|
|
|
|
- * 2. Sets the region coordinates so that the graphics frame
|
|
|
|
- * and the active program region agree
|
|
|
|
- * (may change active program region to do this).
|
|
|
|
- * 3. Performs graphic frame/region coordinate conversion intialization
|
|
|
|
- *
|
|
|
|
- * Returns: 0 if ok. Exits with error message if failure.
|
|
|
|
- *
|
|
|
|
* Note: Connection to driver must already be made.
|
|
* Note: Connection to driver must already be made.
|
|
*
|
|
*
|
|
* clear values:
|
|
* clear values:
|
|
@@ -23,22 +14,27 @@
|
|
#include <grass/display.h>
|
|
#include <grass/display.h>
|
|
#include <grass/raster.h>
|
|
#include <grass/raster.h>
|
|
|
|
|
|
|
|
+
|
|
/*!
|
|
/*!
|
|
* \brief graphics frame setup
|
|
* \brief graphics frame setup
|
|
*
|
|
*
|
|
- * Performs a full setup
|
|
|
|
- * for the current graphics frame: 1) Makes sure there is a current graphics
|
|
|
|
- * frame (will create a full-screen one, if not); 2) Sets the region coordinates
|
|
|
|
- * so that the graphics frame and the active module region agree (may change
|
|
|
|
- * active module region to do this); and 3) performs graphic frame/region
|
|
|
|
- * coordinate conversion initialization.
|
|
|
|
|
|
+ * D_setup() sets the source coordinate system to the current region, and
|
|
|
|
+ * adjusts the destination coordinate system to preserve the aspect
|
|
|
|
+ * ratio.
|
|
|
|
+ *
|
|
|
|
+ * Performs a full setup for the current graphics frame:
|
|
|
|
+ * 1) Makes sure there is a current graphics frame (will create a full-screen
|
|
|
|
+ * one, if not);
|
|
|
|
+ * 2) Sets the region coordinates so that the graphics frame and the active
|
|
|
|
+ * module region agree (may change active module region to do this); and
|
|
|
|
+ * 3) Performs graphic frame/region coordinate conversion initialization.
|
|
|
|
+ *
|
|
* If <b>clear</b> is true, the frame is cleared (same as running
|
|
* If <b>clear</b> is true, the frame is cleared (same as running
|
|
- * <i>d.erase.</i>) Otherwise, it is not cleared.
|
|
|
|
|
|
+ * <i>d.erase</i>.) Otherwise, it is not cleared.
|
|
*
|
|
*
|
|
* \param clear
|
|
* \param clear
|
|
- * \return int
|
|
|
|
|
|
+ * \return none
|
|
*/
|
|
*/
|
|
-
|
|
|
|
void D_setup(int clear)
|
|
void D_setup(int clear)
|
|
{
|
|
{
|
|
struct Cell_head region;
|
|
struct Cell_head region;
|
|
@@ -56,6 +52,20 @@ void D_setup(int clear)
|
|
D_erase(DEFAULT_BG_COLOR);
|
|
D_erase(DEFAULT_BG_COLOR);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+/*!
|
|
|
|
+ * \brief
|
|
|
|
+ *
|
|
|
|
+ * D_setup_unity() sets the source coordinate system to match the
|
|
|
|
+ * destination coordinate system, so that D_* functions use the same
|
|
|
|
+ * coordinate system as R_* functions.
|
|
|
|
+ *
|
|
|
|
+ * If <b>clear</b> is true, the frame is cleared (same as running
|
|
|
|
+ * <i>d.erase</i>.) Otherwise, it is not cleared.
|
|
|
|
+ *
|
|
|
|
+ * \param clear
|
|
|
|
+ * \return none
|
|
|
|
+ */
|
|
void D_setup_unity(int clear)
|
|
void D_setup_unity(int clear)
|
|
{
|
|
{
|
|
double dt, db, dl, dr;
|
|
double dt, db, dl, dr;
|
|
@@ -71,6 +81,25 @@ void D_setup_unity(int clear)
|
|
D_erase(DEFAULT_BG_COLOR);
|
|
D_erase(DEFAULT_BG_COLOR);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+/*!
|
|
|
|
+ * \brief
|
|
|
|
+ *
|
|
|
|
+ * D_setup2() sets the source coordinate system to its arguments, and if
|
|
|
|
+ * the <b>fit</b> argument is non-zero, adjusts the destination coordinate
|
|
|
|
+ * system to preserve the aspect ratio.
|
|
|
|
+ *
|
|
|
|
+ * If <b>clear</b> is true, the frame is cleared (same as running
|
|
|
|
+ * <i>d.erase</i>.) Otherwise, it is not cleared.
|
|
|
|
+ *
|
|
|
|
+ * \param clear
|
|
|
|
+ * \param fit
|
|
|
|
+ * \param s_top
|
|
|
|
+ * \param s_bottom
|
|
|
|
+ * \param s_left
|
|
|
|
+ * \param s_right
|
|
|
|
+ * \return none
|
|
|
|
+ */
|
|
void D_setup2(int clear, int fit, double st, double sb, double sl, double sr)
|
|
void D_setup2(int clear, int fit, double st, double sb, double sl, double sr)
|
|
{
|
|
{
|
|
double dt, db, dl, dr;
|
|
double dt, db, dl, dr;
|
|
@@ -88,4 +117,3 @@ void D_setup2(int clear, int fit, double st, double sb, double sl, double sr)
|
|
if (clear)
|
|
if (clear)
|
|
D_erase(DEFAULT_BG_COLOR);
|
|
D_erase(DEFAULT_BG_COLOR);
|
|
}
|
|
}
|
|
-
|
|
|