Commit c2d71a68 authored by claes's avatar claes

Function measure_window added

parent 03f3a198
/*
* Proview $Id: glow_growapi.cpp,v 1.37 2008-05-13 13:59:03 claes Exp $
* Proview $Id: glow_growapi.cpp,v 1.38 2008-07-17 11:25:03 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -531,6 +531,12 @@ void grow_MeasureNode( grow_tNode node, double *ll_x, double *ll_y,
((GlowNode *)node)->measure( ll_x, ll_y, ur_x, ur_y);
}
void grow_MeasureWindow( grow_tCtx ctx, double *ll_x, double *ll_y,
double *ur_x, double *ur_y)
{
ctx->measure_window( ll_x, ll_y, ur_x, ur_y);
}
void grow_Print( grow_tCtx ctx, char *filename, double x0, double x1, int end)
{
ctx->print( filename, x0, x1, end);
......
/*
* Proview $Id: glow_growapi.h,v 1.31 2008-05-13 13:59:03 claes Exp $
* Proview $Id: glow_growapi.h,v 1.32 2008-07-17 11:25:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -579,6 +579,9 @@ extern "C" {
void grow_MeasureNode( grow_tNode node, double *ll_x, double *ll_y,
double *ur_x, double *ur_y);
void grow_MeasureWindow( grow_tCtx ctx, double *ll_x, double *ll_y,
double *ur_x, double *ur_y);
//! Print context to postscript file.
void grow_Print( grow_tCtx ctx, char *filename, double x0, double x1, int end);
......
/*
* Proview $Id: glow_growctx.cpp,v 1.31 2008-05-13 13:59:03 claes Exp $
* Proview $Id: glow_growctx.cpp,v 1.32 2008-07-17 11:25:03 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -4349,3 +4349,13 @@ void GrowCtx::read_object( ifstream& fp, GlowArrayElem **o)
a.insert( n);
*o = n;
}
void GrowCtx::measure_window( double *ll_x, double *ll_y,
double *ur_x, double *ur_y)
{
*ll_x = double(mw.offset_x) / mw.zoom_factor_x;
*ur_x = double(mw.offset_x + mw.window_width) / mw.zoom_factor_x;
*ll_y = double(mw.offset_y) / mw.zoom_factor_y;
*ur_y = double(mw.offset_y + mw.window_height) / mw.zoom_factor_y;
}
/*
* Proview $Id: glow_growctx.h,v 1.16 2008-05-13 13:59:03 claes Exp $
* Proview $Id: glow_growctx.h,v 1.17 2008-07-17 11:25:03 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -822,6 +822,9 @@ class GrowCtx : public GlowCtx {
//! Order object. */
int order_object( GlowArrayElem *o, GlowArrayElem *dest, glow_eDest code) { return a.move( o, dest, code);}
void measure_window( double *ll_x, double *ll_y,
double *ur_x, double *ur_y);
char name[40]; //!< Name of the context.
grow_eMode edit_mode; //!< Current edit mode.
int conpoint_num_cnt; //!< Counter to get next number for when creating conpoints in a subgraph.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment