VR-Forces 4.0.4 Class Documentation
include/flt/surfCharMap.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 1998 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 /*******************************************************************************
00006 ** $RCSfile: surfCharMap.h,v $ $Revision: 1.13 $ $State: Exp $
00007 *******************************************************************************/
00008 
00009 #ifndef surfCharMap_H_
00010 #define surfCharMap_H_
00011 
00012 #include "flt/fltDefines.h"
00013 #include "geometry/surface.h"
00014 #include <vlutil/vlConfig.h>
00015 #include <vlutil/vlUtil.h>
00016 #include <vlutil/vlFilename.h>
00017 #include <vlutil/vlString.h>
00018 #include <iosfwd>
00019 #include <set>
00020 #include <map>
00021 #include <string>
00022 
00023 class DtSurface;
00024 
00025 //
00026 // This is the base class for all metafile records.
00027 class DT_DLL_flt DtSurfaceCharacteristicMap 
00028 {
00029 
00030 public:
00031 
00032    // default constructor.
00033    DtSurfaceCharacteristicMap();
00034 
00035    // destructor
00036    virtual ~DtSurfaceCharacteristicMap();
00037 
00038    // copy constructor
00039    DtSurfaceCharacteristicMap(const DtSurfaceCharacteristicMap& orig);
00040 
00041    // assignment operator - provided by default by compiler. 
00042    // This class is assignable.
00043 
00044    // Initialize the metafile.  Calls createSurface().
00045    virtual bool init(const DtFilename filename, bool displayWarning = false);
00046 
00047    // get data from a stream
00048    virtual bool get(std::istream& stream);
00049 
00050    // identifies a token or passes token the parent class.
00051    virtual bool processToken(std::istream& stream, DtString& token);
00052 
00053    // Set characteristics based on a string 
00054    virtual bool characteristicsFromString(const char* str, 
00055       unsigned int& characteristics);
00056 
00057 protected:
00058 
00059    // Creates mySufarce.
00060    virtual DtSurface* createSurface();
00061 
00062 protected:
00063    typedef std::map <DtString, DtSurface::DtCharacteristics> DtSurfaceStringToCharacteristics;
00064    typedef DtSurfaceStringToCharacteristics::const_iterator DtSurfStrToCharsConstIter;
00065    typedef DtSurfaceStringToCharacteristics::iterator DtSurfStrToCharsIter;
00066 
00067    DtSurfaceStringToCharacteristics mySurfaceStringToCharacteristics;
00068    static const DtString theMatchString;
00069    DtSurface* mySurface;
00070 
00071 private:
00072 
00073    // This is here to prevent error messages from streaming out when many polygons
00074    // have textures not referenced in the surface characteristics map.  Should
00075    // probably be changed to a logging class that is a member of the class, that explicitly
00076    // has the "only output once" logic held internally.
00077    // NOTE: This is used in the characteristicsFromString function.
00078    // @see characteristicsFromString
00079    std::set<std::string> myPrintedWarnings;
00080 
00081 };
00082 
00083 #endif
00084 

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)