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.6 $
00022 // $Date: 2003/02/25 23:34:43 $
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 
00043 class View;
00044 class Projection;
00045 class Clipping;
00046 class Viewport;
00047 class ScanLineConverter;
00048 class Device;
00049 class FACE;
00050 
00051 #include <fstream>
00052 using std::ofstream;
00053 
00054 class X11Renderer : public Renderer
00055 {
00056  public:
00057     X11Renderer(const char *title, int xLoc, int yLoc, int width, int height,
00058                 ColorMap &theMap);
00059     X11Renderer(const char *title, int xLoc, int yLoc, int width, int height,
00060                 ColorMap &theMap, const char *fileName);
00061 
00062     virtual ~X11Renderer();
00063 
00064     virtual int clearImage(void);    
00065     virtual int startImage(void);
00066     virtual int doneImage(void);
00067 
00068     virtual int drawPoint(const Vector &, float V1, int width = 1);
00069     virtual int drawPoint(const Vector &, const Vector &rgb1, int width = 1);
00070     
00071     virtual int drawLine(const Vector &, const Vector &, 
00072                          float V1, float V2, int width = 1, int style = 1);
00073 
00074     virtual int drawLine(const Vector &end1, const Vector &end2, 
00075                          const Vector &rgb1, const Vector &rgb2,
00076                          int width = 1, int style = 1);
00077     
00078     virtual int drawPolygon(const Matrix &points, const Vector &values);
00079     virtual int drawPolygon(const Matrix &points, const Matrix &rgbValues);
00080 
00081     // 
00082     // the following are for setting up the vieing system
00083     //
00084 
00085     // the following are in world coordinates & define view coord system
00086     virtual int setVRP(float x, float y, float z); // point on view plane    
00087     virtual int setVPN(float x, float y, float z); // view plane normal
00088     virtual int setVUP(float x, float y, float z); // view-up vector
00089         
00090     // the following are in view coordinates    
00091     virtual int setViewWindow(float, float, float, float); // view bounds
00092                                // umin, umax, vmin, vmax
00093 
00094     virtual int setPlaneDist(float, float); // location of
00095                                // near and far clipping planes
00096 
00097     virtual int setProjectionMode(const char *mode); // 
00098     virtual int setFillMode(const char *);    // 1 = wire, otherwise fill
00099     
00100     virtual int setPRP(float u, float v, float n); // eye location if 
00101                                  // perspective, dirn to +ViewPlane if parallel
00102 
00103     // the following are in normalized coordinates
00104     virtual int setPortWindow(float, float, float, float); // view port
00105                               // left, right, bottom, top [-1,1,-1,1]
00106                                   
00107     virtual int drawText(const Vector &posGlobal, char *string, int length, 
00108                          char horizontalJustify = 'l', char verticalJustify = 'b');    
00109     
00110  protected:
00111 
00112     int displayFace(FACE &);    
00113 
00114     View *theView;
00115     Projection *theProjection;
00116     Clipping *theClipping;
00117     Viewport *theViewport;
00118     ScanLineConverter *theScan;
00119     Device *theDevice;
00120 
00121   private:
00122     int aFile;                              // int flag indicating if data to be sent to file or not
00123     char *theFileName;                      // file name  
00124     ofstream theFile;                       // output stream    
00125 };
00126 
00127 #endif
00128 

Generated on Mon Oct 23 15:05:27 2006 for OpenSees by doxygen 1.5.0