VrmlViewer.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.2 $
00022 // $Date: 2003/02/18 23:38:04 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/renderer/VrmlViewer.h,v $
00024                                                                         
00025                                                                         
00026 // File: ~/graphics/VrmlViewer.h
00027 //
00028 // Written: fmk 
00029 // Created: 1/99
00030 // Revision: A
00031 //
00032 // Description: This file contains the class definition for VrmlViewer.
00033 // A VrmlViewer object is used to create an image of the domain, this image is 
00034 // stored in a file. The language used to store the image is VRML.
00035 //
00036 // What: "@(#) VrmlViewer.h, revA"
00037 
00038 #ifndef VrmlViewer_h
00039 #define VrmlViewer_h
00040 
00041 #include <Renderer.h>
00042 #include <fstream>
00043 using std::fstream;
00044 
00045 class ColorMap;
00046 class Domain;
00047 
00048 class VrmlViewer : public Renderer
00049 {
00050  public:
00051     VrmlViewer(char *fileName, Domain &theDomain, ColorMap &theMap);    
00052     
00053     ~VrmlViewer();
00054 
00055     int clearImage(void);    
00056     int doneImage(void);
00057     
00058     int drawLine(const Vector &, const Vector &, 
00059                  float V1, float V2);
00060     
00061     int drawTriangle(const Vector &, const Vector &, const Vector &,
00062                      float V1, float V2, float V3);
00063 
00064 
00065     int setVRP(float x, float y, float z); // point on view plane    
00066     int setVPN(float x, float y, float z); // view plane normal
00067     int setVUP(float x, float y, float z); // view-up vector
00068         
00069     // the following are in view coordinates    
00070     int setViewWindow(float, float, float, float); // view bounds
00071                                // umin, umax, vmin, vmax
00072 
00073     int setPlaneDist(float, float); // location of
00074                                // near and far clipping planes
00075 
00076     int setProjectionMode(int); // 
00077     int setFillMode(int);    // 1 = wire, otherwise fill
00078     
00079     int setPRP(float u, float v, float n); // eye location if 
00080                                  // perspective, dirn to +ViewPlane if parallel
00081 
00082     // the following are in normalized coordinates
00083     int setPortWindow(float, float, float, float); // view port
00084                               // left, right, bottom, top [-1,1,-1,1]
00085 
00086 
00087  protected:
00088     
00089  private:
00090     fstream *vrmlFile;
00091     char vrmlFileName[50];    
00092     ColorMap *theMap;
00093 };
00094 
00095 #endif
00096 

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