Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

SoMField.h

00001 /**************************************************************************\
00002  *
00003  *  This file is part of the Coin 3D visualization library.
00004  *  Copyright (C) 1998-2002 by Systems in Motion. All rights reserved.
00005  *
00006  *  This library is free software; you can redistribute it and/or
00007  *  modify it under the terms of the GNU Lesser General Public License
00008  *  version 2.1 as published by the Free Software Foundation. See the
00009  *  file LICENSE.LGPL at the root directory of the distribution for
00010  *  more details.
00011  *
00012  *  If you want to use Coin for applications not compatible with the
00013  *  LGPL, please contact SIM to acquire a Professional Edition license.
00014  *
00015  *  Systems in Motion, Prof Brochs gate 6, 7030 Trondheim, NORWAY
00016  *  http://www.sim.no support@sim.no Voice: +47 22114160 Fax: +47 22207097
00017  *
00018 \**************************************************************************/
00019 
00020 #ifndef COIN_SOMFIELD_H
00021 #define COIN_SOMFIELD_H
00022 
00023 #include <Inventor/fields/SoField.h>
00024 
00025 class SoInput;
00026 class SoOutput;
00027 
00028 
00029 class COIN_DLL_API SoMField : public SoField {
00030   typedef SoField inherited;
00031 
00032 public:
00033   virtual ~SoMField();
00034 
00035   static SoType getClassTypeId(void);
00036 
00037   int getNum(void) const;
00038   void setNum(const int num);
00039 
00040   virtual void deleteValues(int start, int num = -1);
00041   virtual void insertSpace(int start, int num);
00042 
00043   SbBool set1(const int index, const char * const valuestring);
00044   void get1(const int index, SbString & valuestring);
00045 
00046   static void initClass(void);
00047 
00048 protected:
00049   SoMField(void);
00050   virtual void makeRoom(int newnum);
00051 
00052 #ifndef DOXYGEN_SKIP_THIS // Internal methods.
00053   virtual int fieldSizeof(void) const = 0;
00054   virtual void * valuesPtr(void) = 0;
00055   virtual void setValuesPtr(void * ptr) = 0;
00056   virtual void allocValues(int num);
00057 #endif // DOXYGEN_SKIP_THIS
00058 
00059   int num;
00060   int maxNum;
00061 
00062 private:
00063   virtual void deleteAllValues(void) = 0;
00064   virtual void copyValue(int to, int from) = 0;
00065   virtual SbBool readValue(SoInput * in);
00066   virtual SbBool read1Value(SoInput * in, int idx) = 0;
00067   virtual void writeValue(SoOutput * out) const;
00068   virtual void write1Value(SoOutput * out, int idx) const = 0;
00069   virtual SbBool readBinaryValues(SoInput * in, int num);
00070   virtual void writeBinaryValues(SoOutput * out) const;
00071   virtual int getNumValuesPerLine(void) const;
00072 
00073   static SoType classTypeId;
00074 };
00075 
00076 // inline methods
00077 
00078 inline int
00079 SoMField::getNum(void) const
00080 {
00081   this->evaluate();
00082   return this->num;
00083 }
00084 
00085 
00086 #endif // !COIN_SOMFIELD_H

Generated at Tue Mar 5 03:31:15 2002 for Coin by doxygen1.2.9 written by Dimitri van Heesch, © 1997-2001