Coin Logo http://www.sim.no/
http://www.coin3d.org/

SoMField.h
00001 #ifndef COIN_SOMFIELD_H
00002 #define COIN_SOMFIELD_H
00003 
00004 /**************************************************************************\
00005  *
00006  *  This file is part of the Coin 3D visualization library.
00007  *  Copyright (C) by Kongsberg Oil & Gas Technologies.
00008  *
00009  *  This library is free software; you can redistribute it and/or
00010  *  modify it under the terms of the GNU General Public License
00011  *  ("GPL") version 2 as published by the Free Software Foundation.
00012  *  See the file LICENSE.GPL at the root directory of this source
00013  *  distribution for additional information about the GNU GPL.
00014  *
00015  *  For using Coin with software that can not be combined with the GNU
00016  *  GPL, and for taking advantage of the additional benefits of our
00017  *  support services, please contact Kongsberg Oil & Gas Technologies
00018  *  about acquiring a Coin Professional Edition License.
00019  *
00020  *  See http://www.coin3d.org/ for more information.
00021  *
00022  *  Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
00023  *  http://www.sim.no/  sales@sim.no  coin-support@coin3d.org
00024  *
00025 \**************************************************************************/
00026 
00027 #include <Inventor/fields/SoField.h>
00028 
00029 class SoInput;
00030 class SoOutput;
00031 
00032 class COIN_DLL_API SoMField : public SoField {
00033   typedef SoField inherited;
00034 
00035 public:
00036   virtual ~SoMField();
00037 
00038   static SoType getClassTypeId(void);
00039   static void atexit_cleanup(void);
00040 
00041   int getNum(void) const;
00042   void setNum(const int num);
00043 
00044   virtual void deleteValues(int start, int num = -1);
00045   virtual void insertSpace(int start, int num);
00046 
00047   SbBool set1(const int index, const char * const valuestring);
00048   void get1(const int index, SbString & valuestring);
00049 
00050   static void initClass(void);
00051 
00052   virtual void enableDeleteValues(void);
00053   virtual SbBool isDeleteValuesEnabled(void) const;
00054 
00055 protected:
00056   SoMField(void);
00057   virtual void makeRoom(int newnum);
00058 
00059 #ifndef DOXYGEN_SKIP_THIS // Internal methods.
00060   virtual int fieldSizeof(void) const = 0;
00061   virtual void * valuesPtr(void) = 0;
00062   virtual void setValuesPtr(void * ptr) = 0;
00063   virtual void allocValues(int num);
00064 #endif // DOXYGEN_SKIP_THIS
00065 
00066   int num;
00067   int maxNum;
00068   SbBool userDataIsUsed;
00069 
00070 private:
00071   virtual void deleteAllValues(void) = 0;
00072   virtual void copyValue(int to, int from) = 0;
00073   virtual SbBool readValue(SoInput * in);
00074   virtual SbBool read1Value(SoInput * in, int idx) = 0;
00075   virtual void writeValue(SoOutput * out) const;
00076   virtual void write1Value(SoOutput * out, int idx) const = 0;
00077   virtual SbBool readBinaryValues(SoInput * in, int num);
00078   virtual void writeBinaryValues(SoOutput * out) const;
00079   virtual int getNumValuesPerLine(void) const;
00080 
00081   static SoType classTypeId;
00082 };
00083 
00084 // inline methods
00085 
00086 inline int
00087 SoMField::getNum(void) const
00088 {
00089   this->evaluate();
00090   return this->num;
00091 }
00092 
00093 #endif // !COIN_SOMFIELD_H

Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.

Generated for Coin by Doxygen 1.7.5.1.