Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

SbViewportRegion.h

00001 /**************************************************************************\ 00002 * 00003 * This file is part of the Coin 3D visualization library. 00004 * Copyright (C) 1998-2003 by Systems in Motion. All rights reserved. 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Lesser General Public License 00008 * version 2.1 as published by the Free Software Foundation. See the 00009 * file LICENSE.LGPL at the root directory of the distribution for 00010 * more details. 00011 * 00012 * If you want to use Coin for applications not compatible with the 00013 * LGPL, please contact SIM to acquire a Professional Edition license. 00014 * 00015 * Systems in Motion, Teknobyen, Abels Gate 5, 7030 Trondheim, NORWAY 00016 * http://www.sim.no support@sim.no Voice: +47 22114160 Fax: +47 22207097 00017 * 00018 \**************************************************************************/ 00019 00020 #ifndef COIN_SBVIEWPORTREGION_H 00021 #define COIN_SBVIEWPORTREGION_H 00022 00023 #include <stdio.h> 00024 #include <Inventor/SbVec2s.h> 00025 #include <Inventor/SbVec2f.h> 00026 00027 class COIN_DLL_API SbViewportRegion { 00028 public: 00029 SbViewportRegion(void); 00030 SbViewportRegion(short width, short height); 00031 SbViewportRegion(SbVec2s winSize); 00032 SbViewportRegion(const SbViewportRegion & vpReg); 00033 00034 void setWindowSize(short width, short height); 00035 void setWindowSize(SbVec2s winSize); 00036 void setViewport(float left, float bottom, 00037 float width, float height); 00038 void setViewport(SbVec2f origin, SbVec2f size); 00039 void setViewportPixels(short left, short bottom, 00040 short width, short height); 00041 void setViewportPixels(SbVec2s origin, SbVec2s size); 00042 const SbVec2s & getWindowSize(void) const; 00043 const SbVec2f & getViewportOrigin(void) const; 00044 const SbVec2s & getViewportOriginPixels(void) const; 00045 const SbVec2f & getViewportSize(void) const; 00046 const SbVec2s & getViewportSizePixels(void) const; 00047 float getViewportAspectRatio(void) const; 00048 void scaleWidth(float ratio); 00049 void scaleHeight(float ratio); 00050 void setPixelsPerInch(float ppi); 00051 float getPixelsPerInch(void) const; 00052 float getPixelsPerPoint(void) const; 00053 friend COIN_DLL_API int operator ==(const SbViewportRegion & reg1, 00054 const SbViewportRegion & reg2); 00055 00056 void print(FILE * file) const; 00057 00058 private: 00059 SbVec2s winsize; 00060 SbVec2f vporigin; 00061 SbVec2f vpsize; 00062 SbVec2s vporigin_s; 00063 SbVec2s vpsize_s; 00064 float pixperinch; 00065 }; 00066 00067 COIN_DLL_API int operator ==(const SbViewportRegion & reg1, const SbViewportRegion & reg2); 00068 00069 #endif // !COIN_SBVIEWPORTREGION_H

Generated on Tue Jul 27 23:53:00 2004 for Coin by doxygen 1.3.7