00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00027 #ifndef __MFBOOL_H__
00028 #define __MFBOOL_H__
00029
00030 #include "MField.h"
00031
00032 namespace H3D {
00033 template<>
00034 inline string MFieldBase< bool >::classTypeName() { return "MFBool"; }
00035
00038 class H3DAPI_API MFBool: public MField< bool > {
00039 public:
00040 MFBool(){}
00041 MFBool( size_type sz ): MField< bool >( sz ){}
00042 virtual X3DTypes::X3DType getX3DType() { return X3DTypes::MFBOOL; }
00045 inline virtual string getValueAsString( const string& separator = " " ) {
00046 stringstream s;
00047 const vector< bool > &v = getValue();
00048
00049 if( v.size() == 0 )
00050 return "";
00051 unsigned int i;
00052 for( i = 0; i < v.size() - 1; i++ ) {
00053 if( v[i] ) s << "true";
00054 else s << "false";
00055 s << separator;
00056
00057 }
00058 if( v[i] ) s << "true";
00059 else s << "false";
00060 return s.str();
00061 }
00062 };
00063 }
00064
00065 #endif
00066