Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

exotkUtils.hxx

Go to the documentation of this file.
00001 
00002 //   exotkUtils.hxx
00004 //    Copyright (C) 2001  Stephane Routelous
00005 //
00006 //    This file is part of exoTK.
00007 //
00008 //    exoTK is free software; you can redistribute it and/or modify
00009 //    it under the terms of the GNU General Public License as published by
00010 //    the Free Software Foundation; either version 2 of the License, or
00011 //    (at your option) any later version.
00012 //
00013 //    exoTK is distributed in the hope that it will be useful,
00014 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 //    GNU General Public License for more details.
00017 //
00018 //    You should have received a copy of the GNU General Public License
00019 //    along with exoTK; if not, write to the Free Software
00020 //    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 
00028 #ifndef _exotkUtils_HeaderFile
00029 #define _exotkUtils_HeaderFile
00030 
00031 #if _MSC_VER > 1000
00032 #pragma once
00033 #endif // _MSC_VER > 1000
00034 
00035 #ifndef  _Standard_TypeDef_HeaderFile
00036 #include <Standard_TypeDef.hxx>
00037 #endif
00038 #ifndef  _exotkUtils_ColorRef_HeaderFile
00039 #include <exotkUtils_ColorRef.hxx>
00040 #endif
00041 class Quantity_Color;
00042 class TCollection_AsciiString;
00043 class Quantity_Date;
00044 
00050 enum exotkUtils_DateFormat
00051 {
00053         exotkUtils_dfFile,
00055         exotkUtils_dfText
00056 };
00062 class exotkUtils  
00063 {
00064 public:
00065 
00073     inline void* operator new(size_t,void* anAddress) 
00074       {
00075         return anAddress;
00076       }
00077 
00084     inline void* operator new(size_t size) 
00085       { 
00086         return Standard::Allocate(size); 
00087       }
00088 
00095     inline void  operator delete(void *anAddress) 
00096       { 
00097         if (anAddress) Standard::Free((Standard_Address&)anAddress); 
00098       }
00099 
00106         Standard_EXPORT static TCollection_AsciiString CurrentDateToAsciiString(const enum exotkUtils_DateFormat aDateFormat);
00107 
00115         Standard_EXPORT static TCollection_AsciiString DateToAsciiString(const enum exotkUtils_DateFormat aDateFormat,const Quantity_Date& aDate);
00116 
00123         Standard_EXPORT static Quantity_Color ConvertColor(const exotkUtils_ColorRef& aColorRef) ;
00124 
00131         Standard_EXPORT static exotkUtils_ColorRef ConvertColor(const Quantity_Color& aColor) ;
00140         Standard_EXPORT static Standard_Boolean AsciiStringToReal(const TCollection_AsciiString& aStringToConvert,Standard_Real& aRealResult);
00141 
00150         Standard_EXPORT static Standard_Boolean AsciiStringToInteger(const TCollection_AsciiString& aStringToConvert,Standard_Integer& anIntegerResult);
00151 
00152 
00160         Standard_EXPORT static Standard_Real TruncateReal(const Standard_Real aRealToTruncate,const Standard_Integer aNegNb = 3);
00161     
00162 
00171         Standard_EXPORT static TCollection_AsciiString TruncateRealToAsciiString(const Standard_Real aReal,const Standard_Integer aNegNb = 3,const Standard_Integer aNbChar = -1);
00172 
00179         Standard_EXPORT static TCollection_AsciiString ColorToAsciiString(const Quantity_Color& aColor);
00180 
00188         Standard_EXPORT static Standard_Boolean AsciiStringToColor(const TCollection_AsciiString& aString,Quantity_Color& aColor);
00189 
00197         Standard_EXPORT static Standard_Boolean AsciiStringToBoolean(const TCollection_AsciiString& aString,Standard_Boolean& aBoolean);
00198 
00205         Standard_EXPORT static TCollection_AsciiString BooleanToAsciiString(const Standard_Boolean aBoolean);
00206 };
00207 
00208 #endif 

Generated on Wed Jan 23 12:16:45 2002 for exotk by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001