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

SoMField.h
1 #ifndef COIN_SOMFIELD_H
2 #define COIN_SOMFIELD_H
3 
4 /**************************************************************************\
5  *
6  * This file is part of the Coin 3D visualization library.
7  * Copyright (C) by Kongsberg Oil & Gas Technologies.
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * ("GPL") version 2 as published by the Free Software Foundation.
12  * See the file LICENSE.GPL at the root directory of this source
13  * distribution for additional information about the GNU GPL.
14  *
15  * For using Coin with software that can not be combined with the GNU
16  * GPL, and for taking advantage of the additional benefits of our
17  * support services, please contact Kongsberg Oil & Gas Technologies
18  * about acquiring a Coin Professional Edition License.
19  *
20  * See http://www.coin3d.org/ for more information.
21  *
22  * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
23  * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24  *
25 \**************************************************************************/
26 
27 #include <Inventor/fields/SoField.h>
28 
29 class SoInput;
30 class SoOutput;
31 
32 class COIN_DLL_API SoMField : public SoField {
33  typedef SoField inherited;
34 
35 public:
36  virtual ~SoMField();
37 
38  static SoType getClassTypeId(void);
39  static void atexit_cleanup(void);
40 
41  int getNum(void) const;
42  void setNum(const int num);
43 
44  virtual void deleteValues(int start, int num = -1);
45  virtual void insertSpace(int start, int num);
46 
47  SbBool set1(const int index, const char * const valuestring);
48  void get1(const int index, SbString & valuestring);
49 
50  static void initClass(void);
51 
52  virtual void enableDeleteValues(void);
53  virtual SbBool isDeleteValuesEnabled(void) const;
54 
55 protected:
56  SoMField(void);
57  virtual void makeRoom(int newnum);
58 
59 #ifndef DOXYGEN_SKIP_THIS // Internal methods.
60  virtual int fieldSizeof(void) const = 0;
61  virtual void * valuesPtr(void) = 0;
62  virtual void setValuesPtr(void * ptr) = 0;
63  virtual void allocValues(int num);
64 #endif // DOXYGEN_SKIP_THIS
65 
66  int num;
67  int maxNum;
69 
70 private:
71  virtual void deleteAllValues(void) = 0;
72  virtual void copyValue(int to, int from) = 0;
73  virtual SbBool readValue(SoInput * in);
74  virtual SbBool read1Value(SoInput * in, int idx) = 0;
75  virtual void writeValue(SoOutput * out) const;
76  virtual void write1Value(SoOutput * out, int idx) const = 0;
77  virtual SbBool readBinaryValues(SoInput * in, int num);
78  virtual void writeBinaryValues(SoOutput * out) const;
79  virtual int getNumValuesPerLine(void) const;
80 
81  static SoType classTypeId;
82 };
83 
84 // inline methods
85 
86 inline int
87 SoMField::getNum(void) const
88 {
89  this->evaluate();
90  return this->num;
91 }
92 
93 #endif // !COIN_SOMFIELD_H
SoMField::maxNum
int maxNum
Definition: SoMField.h:67
SoMField::getNum
int getNum(void) const
Definition: SoMField.h:87
SoField::getClassTypeId
static SoType getClassTypeId(void)
Definition: SoField.cpp:705
SoField::writeValue
virtual void writeValue(SoOutput *out) const =0
SoField::readValue
virtual SbBool readValue(SoInput *in)=0
SoOutput
The SoOutput class is an abstraction of an output stream.
Definition: SoOutput.h:42
SoMField::num
int num
Definition: SoMField.h:66
SbString
The SbString class is a string class with convenience functions for string operations.
Definition: SbString.h:42
SoField
The SoField class is the top-level abstract base class for fields.
Definition: SoField.h:38
SoType
The SoType class is the basis for the run-time type system in Coin.
Definition: SoType.h:50
SoMField
The SoMField class is the base class for fields which can contain multiple values.
Definition: SoMField.h:32
SoField::initClass
static void initClass(void)
Definition: SoField.cpp:612
SoMField::userDataIsUsed
SbBool userDataIsUsed
Definition: SoMField.h:68
SoInput
The SoInput class is an abstraction of file import functionality.
Definition: SoInput.h:52
SoField::evaluate
void evaluate(void) const
Definition: SoField.h:131

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

Generated on Mon Jan 27 2020 23:41:05 for Coin by Doxygen 1.8.17.