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) 1998-2007 by Systems in Motion. All rights reserved.
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 Systems in Motion about acquiring
18  * a Coin Professional Edition License.
19  *
20  * See http://www.coin3d.org/ for more information.
21  *
22  * Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, 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 
40  int getNum(void) const;
41  void setNum(const int num);
42 
43  virtual void deleteValues(int start, int num = -1);
44  virtual void insertSpace(int start, int num);
45 
46  SbBool set1(const int index, const char * const valuestring);
47  void get1(const int index, SbString & valuestring);
48 
49  static void initClass(void);
50 
51  virtual void enableDeleteValues(void);
52  virtual SbBool isDeleteValuesEnabled(void);
53 
54 protected:
55  SoMField(void);
56  virtual void makeRoom(int newnum);
57 
58 #ifndef DOXYGEN_SKIP_THIS // Internal methods.
59  virtual int fieldSizeof(void) const = 0;
60  virtual void * valuesPtr(void) = 0;
61  virtual void setValuesPtr(void * ptr) = 0;
62  virtual void allocValues(int num);
63 #endif // DOXYGEN_SKIP_THIS
64 
65  int num;
66  int maxNum;
68 
69 private:
70  virtual void deleteAllValues(void) = 0;
71  virtual void copyValue(int to, int from) = 0;
72  virtual SbBool readValue(SoInput * in);
73  virtual SbBool read1Value(SoInput * in, int idx) = 0;
74  virtual void writeValue(SoOutput * out) const;
75  virtual void write1Value(SoOutput * out, int idx) const = 0;
76  virtual SbBool readBinaryValues(SoInput * in, int num);
77  virtual void writeBinaryValues(SoOutput * out) const;
78  virtual int getNumValuesPerLine(void) const;
79 
80  static SoType classTypeId;
81 };
82 
83 // inline methods
84 
85 inline int
86 SoMField::getNum(void) const
87 {
88  this->evaluate();
89  return this->num;
90 }
91 
92 #endif // !COIN_SOMFIELD_H
virtual SbBool readValue(SoInput *in)=0
The SoOutput class is an abstraction of an output stream.SoOutput offers the ability to write basic t...
Definition: SoOutput.h:42
The SoField class is the top-level abstract base class for fields.Fields is the mechanism used throug...
Definition: SoField.h:38
The SoMField class is the base class for fields which can contain multiple values.All field types which may contain more than one member value inherits this class. SoMField is an abstract class.
Definition: SoMField.h:32
int num
Definition: SoMField.h:65
static SoType getClassTypeId(void)
Definition: SoField.cpp:680
virtual void writeValue(SoOutput *out) const =0
void evaluate(void) const
Definition: SoField.h:130
int maxNum
Definition: SoMField.h:66
The SoInput class is an abstraction of file import functionality.This class takes care of most of the...
Definition: SoInput.h:55
static void initClass(void)
Definition: SoField.cpp:600
The SbString class is a string class with convenience functions for string operations.This is the class used for storing and working with character strings. It automatically takes care of supporting all the "bookkeeping" tasks usually associated with working with character strings, like memory allocation and deallocation etc.
Definition: SbString.h:42
The SoType class is the basis for the run-time type system in Coin.Many of the classes in the Coin li...
Definition: SoType.h:50
SbBool userDataIsUsed
Definition: SoMField.h:67
int getNum(void) const
Definition: SoMField.h:86

Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.

Generated on Fri Feb 17 2017 for Coin by Doxygen. 1.8.13