1 #ifndef COIN_SONOTREC_H 2 #define COIN_SONOTREC_H 3 4 /**************************************************************************\ 5 * Copyright (c) Kongsberg Oil & Gas Technologies AS 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions are 10 * met: 11 * 12 * Redistributions of source code must retain the above copyright notice, 13 * this list of conditions and the following disclaimer. 14 * 15 * Redistributions in binary form must reproduce the above copyright 16 * notice, this list of conditions and the following disclaimer in the 17 * documentation and/or other materials provided with the distribution. 18 * 19 * Neither the name of the copyright holder nor the names of its 20 * contributors may be used to endorse or promote products derived from 21 * this software without specific prior written permission. 22 * 23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 \**************************************************************************/ 35 36 #include <Inventor/SbBasic.h> 37 #include <cstdio> 38 39 class SoBase; 40 41 42 class COIN_DLL_API SoNotRec { 43 public: 44 enum Type { 45 CONTAINER, 46 PARENT, 47 SENSOR, 48 FIELD, 49 ENGINE 50 }; 51 52 enum OperationType { 53 UNSPECIFIED, 54 FIELD_UPDATE, 55 GROUP_ADDCHILD, 56 GROUP_INSERTCHILD, 57 GROUP_REPLACECHILD, 58 GROUP_REMOVECHILD, 59 GROUP_REMOVEALLCHILDREN 60 }; 61 62 SoNotRec(SoBase * const notifbase); 63 void setType(const SoNotRec::Type type); 64 SoBase * getBase(void) const; 65 SoNotRec::Type getType(void) const; 66 const SoNotRec * getPrevious(void) const; 67 void setPrevious(const SoNotRec * const prev); 68 void print(FILE * const file) const; 69 SoNotRec::OperationType getOperationType(void) const; 70 int getIndex(void) const; 71 int getFieldNumIndices(void) const; 72 const SoBase * getGroupChild(void) const; 73 const SoBase * getGroupPrevChild(void) const; 74 void setOperationType(const SoNotRec::OperationType opType); 75 void setIndex(const int idx); 76 void setFieldNumIndices(const int fldnumind); 77 void setGroupChild(const SoBase * const gc); 78 void setGroupPrevChild(const SoBase * const pc); 79 80 private: 81 Type type; 82 SoBase * base; 83 const SoNotRec * prev; 84 int index, fieldNumIndices; 85 OperationType operationType; 86 const SoBase * groupChild; 87 const SoBase * groupPrevChild; 88 }; 89 90 #endif // !COIN_SONOTREC_H 91