Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

xyobj.cpp

Go to the documentation of this file.
00001 /*****************************************************************************/
00002 /* Módulo: xyobj.cpp                                                         */
00003 /* Autores: Carlos Henrique Levy e Jaudênia Cavalcante                       */
00004 /* Data: 29 jul 97                                                           */
00005 /* Comentário:                                                               */
00006 /*    Implementação de métodos da classe abstrata que define as característi */
00007 /* cas comuns de uma classe do pacote XY++. Basicamente, é responsável pela  */
00008 /* função de visibilidade, posição, conexão com módulo XY++ ativo, controle  */
00009 /* de window e viewport, desenho e contorno (boundingBox).                   */
00010 /*****************************************************************************/
00011 
00012 #include "xyobj.h"
00013 
00014 const char* xy_id_xyobj_cpp="$Id: xyobj.cpp,v 1.7 1999/12/09 21:47:46 rborges Exp $";
00015                                                                 
00016 XYObject::XYObject (XYCoordinate x,
00017                       XYCoordinate y,
00018                     xybool visible)
00019                     : _visible(visible),
00020                       _p(new XYCoordinate(x), new XYCoordinate(y)),
00021                       _handle(NULL)
00022 {
00023 }
00024 
00025 XYObject::~XYObject (void)
00026 {
00027 }
00028 
00029 void XYObject::visible (xybool v)
00030 {
00031    _visible = v;
00032 }
00033 
00034 xybool XYObject::visible (void) const
00035 {
00036    return _visible;
00037 }
00038                 
00039 void XYObject::position (double x, double y)
00040 {
00041    _p.set(x, y);
00042 }
00043 
00044 void XYObject::position (double* x, double* y) const
00045 {
00046    _p.getX(x, this);
00047    _p.getY(y, this);
00048 }
00049 
00050 void XYObject::position (int xp, int yp)
00051 {
00052    _p.set(xp, yp);
00053 }
00054 
00055 void XYObject::position (int* xp, int* yp) const
00056 {
00057    _p.getX(xp, this);
00058    _p.getY(yp, this);
00059 }
00060 
00061 XYCoordinate* XYObject::position (void)
00062 {
00063    XYCoordinate* xr = NULL;
00064    _p.getX(xr);
00065 
00066    return xr;
00067 }
00068 
00069 void XYObject::setHandle (void* h)
00070 {
00071    _handle = h;
00072 }
00073 
00074 void* XYObject::getHandle (void) const
00075 {
00076    return _handle;
00077 }
00078 
00079 void XYObject::setWindow (double xmin, double xmax, double ymin,
00080                           double ymax) const
00081 {
00082    wdWindow(xmin, xmax, ymin, ymax);
00083 }
00084                 
00085 void XYObject::setViewport (void) const
00086 {
00087    wdViewport(_xmin, _xmax, _ymin, _ymax);
00088 }
00089 
00090 void XYObject::setViewport (int xmin, int xmax, int ymin, int ymax)
00091 {
00092    _xmin = xmin;
00093    _xmax = xmax;
00094    _ymin = ymin;
00095    _ymax = ymax;
00096 
00097    setViewport();
00098 }
00099 
00100 void XYObject::getViewport (int& xmin, int& xmax, int& ymin, int& ymax)
00101                             const
00102 {
00103    xmin = _xmin;
00104    xmax = _xmax;
00105    ymin = _ymin;
00106    ymax = _ymax;
00107 }
00108 
00109 

XY
Tecgraf / PUC-Rio - Computer Graphics Technology Group