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

X11Renderer.h

Go to the documentation of this file.
00001 /* ****************************************************************** **
00002 **    OpenSees - Open System for Earthquake Engineering Simulation    **
00003 **          Pacific Earthquake Engineering Research Center            **
00004 **                                                                    **
00005 **                                                                    **
00006 ** (C) Copyright 1999, The Regents of the University of California    **
00007 ** All Rights Reserved.                                               **
00008 **                                                                    **
00009 ** Commercial use of this program without express permission of the   **
00010 ** University of California, Berkeley, is strictly prohibited.  See   **
00011 ** file 'COPYRIGHT'  in main directory for information on usage and   **
00012 ** redistribution,  and for a DISCLAIMER OF ALL WARRANTIES.           **
00013 **                                                                    **
00014 ** Developed by:                                                      **
00015 **   Frank McKenna (fmckenna@ce.berkeley.edu)                         **
00016 **   Gregory L. Fenves (fenves@ce.berkeley.edu)                       **
00017 **   Filip C. Filippou (filippou@ce.berkeley.edu)                     **
00018 **                                                                    **
00019 ** ****************************************************************** */
00020                                                                         
00021 // $Revision: 1.3 $
00022 // $Date: 2001/07/26 00:56:05 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/renderer/X11Renderer.h,v $
00024                                                                         
00025                                                                         
00026 // File: ~/renderer/X11Renderer.h
00027 //
00028 // Written: fmk 
00029 // Created: 10/98
00030 // Revision: A
00031 //
00032 // Description: This file contains the class definition for X11Renderer.
00033 // X11Renderer is an abstract base class. An X11Renderer object is used
00034 // to create an image of the domain.
00035 //
00036 // What: "@(#) X11Renderer.h, revA"
00037 
00038 #ifndef X11Renderer_h
00039 #define X11Renderer_h
00040 
00041 #include <Renderer.h>
00042 #include <G3Globals.h>
00043 #include <fstream.h>
00044 
00045 #include <View.h>
00046 #include <Projection.h>
00047 #include <Clipping.h>
00048 #include <Viewport.h>
00049 #include <ScanLineConverter.h>
00050 #include <Device.h>
00051 #include <FACE.h>
00052 
00054 class X11Renderer : public Renderer
00055 {
00056  public:
00058     X11Renderer(char *title, int xLoc, int yLoc, int width, int height,
00059   ColorMap &theMap);
00061     X11Renderer(char *title, int xLoc, int yLoc, int width, int height,
00062   ColorMap &theMap, char *fileName);
00063 
00065     virtual ~X11Renderer();
00066 
00068     virtual int clearImage(void);    
00070     virtual int startImage(void);
00072     virtual int doneImage(void);
00073 
00075     virtual int drawPoint(const Vector &, float V1, int width = 1);
00077     virtual int drawPoint(const Vector &, const Vector &rgb1, int width = 1);
00078     
00080     virtual int drawLine(const Vector &, const Vector &, 
00081     float V1, float V2, int width = 1, int style = 1);
00082 
00084     virtual int drawLine(const Vector &end1, const Vector &end2, 
00085     const Vector &rgb1, const Vector &rgb2,
00086     int width = 1, int style = 1);
00087     
00089     virtual int drawPolygon(const Matrix &points, const Vector &values);
00091     virtual int drawPolygon(const Matrix &points, const Matrix &rgbValues);
00092 
00093     // 
00094     // the following are for setting up the vieing system
00095     //
00096 
00098     virtual int setVRP(float x, float y, float z); 
00099     virtual int setVPN(float x, float y, float z); 
00100     virtual int setVUP(float x, float y, float z); // view-up vector
00101  
00103     virtual int setViewWindow(float, float, float, float); // view bounds
00105 
00106     virtual int setPlaneDist(float, float); // location of
00108 
00109     virtual int setProjectionMode(char *mode); 
00110     virtual int setFillMode(char *);    
00111     
00112     virtual int setPRP(float u, float v, float n); // eye location if 
00113                           // perspective, dirn to +ViewPlane if parallel
00114 
00116     virtual int setPortWindow(float, float, float, float); // view port
00118       
00119     virtual int drawText(const Vector &posGlobal, char *string, int length, 
00120     char horizontalJustify = 'l', char verticalJustify = 'b');    
00121     
00122  protected:
00123 
00125     int displayFace(FACE &);    
00126 
00128     View *theView;
00130     Projection *theProjection;
00132     Clipping *theClipping;
00134     Viewport *theViewport;
00136     ScanLineConverter *theScan;
00138     Device *theDevice;
00139 
00140   private:
00142     int aFile;                              
00143     char theFileName[MAX_FILENAMELENGTH];   
00144     ofstream theFile;                      // output stream    
00145 };
00146 
00147 #endif
00148 
00149 ÿ
Copyright Contact Us